Commit 47fe0dff by wangweidong

需求修改

parent e5224981
<template>
<div>
<Modal v-model="showUserGroupModal">
<p slot="header">
{{ modalTitle }}
</p>
<Row>
<!--查询条件-->
<Col span="24">
<Form id="test-item-form" :label-width="90" inline onsubmit="return false">
<label class="label-sign" />
<Form-item :label-width="70" label="授权资质仪器名称" >
<Input
v-model="code"
placeholder="授权资质仪器名称"
style="width: 100%"
@on-enter="_pageChange(1)"
/>
</Form-item>
<Form-item label="检测依据名称">
<Input
v-model="name"
placeholder="请输入检测依据名称"
style="width: 100%"
@on-enter="_pageChange(1)"
/>
</Form-item>
</Form>
</Col>
<Col span="24" style="margin-bottom: 10px">
<el-table
:height="300"
:data="getPage"
border
size="small"
highlight-current-row
style="width: 100%"
@row-click="_rowChange"
@row-dblclick="_dbClick"
>
<el-table-column
v-for="item in pageColumns"
:key="item.key"
:prop="item.key"
:label="item.title"
:min-width="item.width"
show-overflow-tooltip
>
<template slot-scope="scope">
<span v-if="item.key==='status'">
{{ scope.row[item.key]?scope.row[item.key].display:'' }}
</span>
<span v-else>{{ scope.row[item.key] }}</span>
</template>
</el-table-column>
</el-table>
</Col>
<Col span="24">
<Page
:total="getPage.total"
:page-size="getPage.size"
placement="top"
show-total
show-elevator
show-sizer
@on-change="_pageChange"
@on-page-size-change="_pageRows"
/>
<div style="clear: both" />
</Col>
</Row>
<div slot="footer" class="btn-width">
<Button style="margin-left: 8px" @click="_cancel">
取消
</Button>
<Button type="primary" @click="_ok">
确定
</Button>
</div>
</Modal>
</div>
</template>
<script>
// import { meterAptitude } from '../../../api'
import { meterManage } from '../../../api'
export default {
name: 'EditModal',
data() {
return {
loading: true,
pageParams: { rows: 20 },
pageColumns: [
{ title: '样品名称', key: 'name' },
{ title: '检定依据', key: 'code' },
{ title: '检定依据名称', key: 'basis' },
{ title: '检定周期', key: 'cycle' },
{ title: '价格', key: 'price' }
],
getPage: [],
showUserGroupModal: false,
modalTitle: '',
currentRowData: {},
name: '',
code: ''
}
},
methods: {
_open() {
this.modalTitle = '选择授权资质仪器名称'
this.name = ''
this.code = ''
this._judge()
},
_judge() {
this.showUserGroupModal = true
this.currentRowData = {}
this._page()
},
_page: async function() {
const result = await meterManage.page(this._searchParams())
if (result) {
console.log('查询结果')
console.log(result)
this.getPage = result.records
this.loading = false
console.log(this.getPage)
}
},
_pageChange(page) {
this.pageParams.page = page
this._page()
},
_pageRows(rows) {
this.pageParams.rows = rows
this._page()
},
_searchParams() {
const data = this.$serialize('test-item-form')
if (this.name) {
data.name = this.name
}
if (this.code) {
data.code = this.code
}
return this.$extend(data, this.pageParams)
},
_search() {
this._page()
},
_rowChange(data) {
this.currentRowData = data // 选中的行数据;
},
_cancel() {
this.showUserGroupModal = false
},
_ok() {
if (JSON.stringify(this.currentRowData) === '{}') {
switch (this.modalTitle) {
case '选择检测依据':
this.$Message.warning('请选择一条检测依据!')
break
}
} else {
this.$emit('on-result-change', this.currentRowData)
this.showUserGroupModal = false
}
},
// 双击
_dbClick(data, event) {
this.currentRowData = data
// 选中的行数据;
this._ok()
}
}
}
</script>
<style scoped>
</style>
<template>
<div>
<!--内容-->
<div class="layout-content-padding">
<div class="layout-content-main">
<Row>
<!--查询-->
<Col span="24" style="margin-top: 10px">
<Form v-show="searchOpen" id="formId" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="委托单位:">
<Input v-model="formObj.client" name="client" placeholder="请输入委托单位" clearable @on-enter="_formSearch"/>
</Form-item>
<Form-item class="search-btn">
<Button type="primary" @click="_formSearch">搜索</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" class="contHide"
@on-result-change="_btnClick"></btn-list>
</Col>
<!--表格-->
<Col span="24">
<PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true"
:get-page="getPage" :icon-msg="iconMsg" @on-result-change="_tableResultChange">
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope">
<span v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span>
<span v-else-if="item.status">{{scope.row[item.key].display}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
</div>
<FileManage ref="FileManage"></FileManage>
<MeterSubcontractorEdit ref="editSubcontractorModal" @on-result-change="_formSearch"></MeterSubcontractorEdit>
</div>
</template>
<script>
import { meterContract, meterSubcontractor } from '../../../api'
import MeterSubcontractorEdit from './MeterCannotSubEdit'
export default {
components: { MeterSubcontractorEdit },
data() {
return {
currentComponent: '',
formId: 'meterSubcontractorFormId',
searchOpen: false,
btn: [
{
type: 'success',
id: '',
name: '添加'
},
{
type: 'success',
id: '',
name: '提交'
}
],
iconMsg: [
{
type: 'md-create',
id: '',
name: '编辑'
},
{
type: 'ios-beaker',
id: '',
name: '报价样品'
},
{ type: 'md-cloud', id: '', name: '附件' },
{ type: 'md-remove-circle', id: '', name: '删除' },
{
type: 'ios-clock',
id: '',
name: '操作日志'
}
],
formObj: {
client: undefined
},
selectIds: [],
getPage: {},
pageColumns: [
{ title: '委托单位', key: 'client', width: 200 },
{ title: '状态', key: 'progress', width: 120, status: true },
{ title: '联系人', key: 'person', width: 120 },
{ title: '联系电话', key: 'tel', width: 120 },
{ title: '传真', key: 'fax', width: 120 },
{ title: '要求完成时间', key: 'odate', width: 120, date: true },
{ title: '折扣', key: 'discount', width: 120 },
{ title: '总价', key: 'totalPrice', width: 120 },
{ title: '折扣价', key: 'discountPrice', width: 120 },
{ title: '备注', key: 'remark' }
]
}
},
computed: {
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('search')
} else {
return this.$tableHeight('noSearch')
}
}
},
mounted() {
this._page()
},
methods: {
_manageSample(data) {
// 管理样品
this.$refs.meterSampleManageModal._open(data)
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (msg) {
case '添加':
this._editModal(false)
break
case '提交':
this._submitToReview()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
_iconClick(res, data, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (res) {
case '编辑':
this._editModal(true, data.id)
break
case '报价样品':
this._manageSample(data.id)
break
case '资质项目':
this._itemModal(data.id)
break
case '附件':
this._upload(data.id)
break
case '删除':
this._deleteByIds([data.id])
break
case '操作日志':
this._record(data.id)
break
}
})
},
_submitToReview() {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定要把这 ' + ids.length + ' 条记录提交?',
onOk: () => {
this._submit(ids)
}
})
}
},
_submit: async function(ids) {
const result = await meterContract.submitQuoteFirstReview(ids)
if (result) {
this._resultChange('提交成功')
}
},
_resultChange(msg) {
this.$Message.success(msg)
this._page()
},
_record(id) {
this.$refs.operationModal._open(id)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'selectIds':
this.selectIds = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
case 'changeSize':
this._page()
break
}
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await meterContract.page(this.formObj)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
// 删除
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
this._delete(ids)
}
})
},
// 编辑&添加
_editModal(edit, id) {
if (edit) {
// 编辑
// this.$refs.editSubcontractorModal._open(id)
this._getById(id)
} else {
// 添加
this.$refs.editSubcontractorModal._open()
}
},
// 追加项目
_itemModal(data) {
this.$refs.refModal._open(data)
},
_upload(id) {
// 上传文件
this.$refs.FileManage._open(id, 'subcontractorId')
},
_getById: async function(id) {
const result = await meterContract.getVOById(id)
if (result) {
this.$refs.editSubcontractorModal._openEdit(result)
}
},
_delete: async function(ids) {
const result = await meterSubcontractor.deleteById(ids)
if (result) {
this._formSearch()
this.$Message.success('删除成功!')
}
}
}
}
</script>
<template>
<div>
<!--内容-->
<div class="layout-content-padding">
<div class="layout-content-main">
<Row>
<!--查询-->
<Col span="24" style="margin-top: 10px">
<Form v-show="searchOpen" id="formId" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="委托单位:">
<Input v-model="formObj.client" name="client" placeholder="请输入委托单位" clearable @on-enter="_formSearch"/>
</Form-item>
<Form-item class="search-btn">
<Button type="primary" @click="_formSearch">搜索</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" class="contHide"
@on-result-change="_btnClick"></btn-list>
</Col>
<!--表格-->
<Col span="24">
<PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true"
:get-page="getPage" :icon-msg="iconMsg" hide-checkbox @on-result-change="_tableResultChange">
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope">
<div v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</div>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
</div>
</div>
</template>
<script>
import { meterContract, meterSubcontractor } from '../../../api'
export default {
components: {},
data() {
return {
currentComponent: '',
formId: 'meterQuoteRegisterHis.vueFormId',
searchOpen: true,
btn: [
// {
// type: 'success',
// id: 'meter-subcontractor-add-btn',
// name: '添加'
// }
],
iconMsg: [
{
type: 'ios-beaker',
id: '',
name: '报检样品查询'
},
{ type: 'md-cloud', id: '', name: '附件' },
{
type: 'ios-clock',
id: '',
name: '操作日志'
}
],
formObj: {
client: undefined
},
selectIds: [],
getPage: {},
pageColumns: [
{ title: '委托单位', key: 'client', width: 200 },
{ title: '联系人', key: 'person', width: 120 },
{ title: '联系电话', key: 'tel', width: 120 },
{ title: '传真', key: 'fax', width: 120 },
{ title: '要求完成时间', key: 'odate', width: 120, date: true },
{ title: '折扣', key: 'discount', width: 120 },
{ title: '总价', key: 'totalPrice', width: 120 },
{ title: '折扣价', key: 'discountPrice', width: 120 },
{ title: '备注', key: 'remark' }
]
}
},
computed: {
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('search')
} else {
return this.$tableHeight('noSearch')
}
}
},
mounted() {
this._page()
},
methods: {
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (msg) {
case '添加':
this._editModal(false)
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
_iconClick(res, data, componentName) {
this.$nextTick(function() {
switch (res) {
case '编辑':
this._editModal(true, data.id)
break
case '报检样品查询':
this._itemModal(data.id)
break
case '附件':
this._upload(data.id)
break
case '删除':
this._deleteByIds([data.id])
break
case '操作日志':
this._record(data.id)
break
}
})
},
_record(id) {
this.$refs.meterContractRecordModal._open(id)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
case 'changeSize':
this._page()
break
}
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await meterContract.pageHis(this.formObj)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
// 删除
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
this._delete(ids)
}
})
},
// 编辑&添加
_editModal(edit, id) {
if (edit) {
// 编辑
// this.$refs.editSubcontractorModal._open(id)
this._getById(id)
} else {
// 添加
this.$refs.editSubcontractorModal._open()
}
},
_itemModal(data) {
this.$refs.meterSampleQuoteManageModal._open(data)
},
_upload(id) {
// 上传文件
this.$refs.refModal._open(id, 'subcontractorId')
},
_getById: async function(id) {
const result = await meterSubcontractor.getById(id)
if (result) {
this.$refs.editSubcontractorModal._open(result)
}
},
_delete: async function(ids) {
const result = await meterSubcontractor.deleteById(ids)
if (result) {
this._formSearch()
this.$Message.success('删除成功!')
}
}
}
}
</script>
<template>
<div>
<div class="layout-content-padding">
<div class="layout-content-main">
<el-tabs v-model="activeName" @tab-click="_changeTabs">
<el-tab-pane label="待完成" name="wait">
<MeterSendEntrust ref="waitTabs"></MeterSendEntrust>
</el-tab-pane>
<el-tab-pane label="历史记录" name="his">
<MeterSendEntrustHis ref="hisTabs"></MeterSendEntrustHis>
</el-tab-pane>
</el-tabs>
</div>
</div>
</div>
</template>
<script>
import MeterSendEntrust from './MeterCannotSub'
import MeterSendEntrustHis from './MeterCannotSubHis'
export default {
name: 'MeterSendEntrustIndex',
components: {
MeterSendEntrust,
MeterSendEntrustHis
},
data() {
return {
activeName: 'wait'
}
},
mounted() {
this.activeName = 'wait'
this._page()
},
methods: {
_changeTabs(tab, event) {
if (tab.name === 'wait') {
this._page()
} else {
this.$refs.hisTabs._page()
}
},
_page() {
this.$refs.waitTabs._page()
}
}
}
</script>
<style scoped>
</style>
...@@ -37,6 +37,7 @@ import MeterClientOnlineEntrustIndex from '../pages/meter-entrust/client-online/ ...@@ -37,6 +37,7 @@ import MeterClientOnlineEntrustIndex from '../pages/meter-entrust/client-online/
import MeterMeterWarehouseInIndex from '../pages/meter-warehouse/warehouse-in/MeterMeterWarehouseInIndex' import MeterMeterWarehouseInIndex from '../pages/meter-warehouse/warehouse-in/MeterMeterWarehouseInIndex'
import MeterMeterWarehouseOutIndex from '../pages/meter-warehouse/warehouse-out/MeterMeterWarehouseOutIndex' import MeterMeterWarehouseOutIndex from '../pages/meter-warehouse/warehouse-out/MeterMeterWarehouseOutIndex'
import MeterCertificatePrintIndex from '../pages/meter-certificate/print/MeterCertificatePrintIndex' import MeterCertificatePrintIndex from '../pages/meter-certificate/print/MeterCertificatePrintIndex'
import MeterCannotSubIndex from '../pages/meter-subcontract/cannot-sub/MeterCannotSubIndex'
import Blank from '~/pages/blank' import Blank from '~/pages/blank'
export default [ export default [
{ {
...@@ -78,6 +79,11 @@ export default [ ...@@ -78,6 +79,11 @@ export default [
path: 'task_input', path: 'task_input',
component: MeterSubpackageInputIndex, component: MeterSubpackageInputIndex,
meta: { title: '分包数据录入' } meta: { title: '分包数据录入' }
},
{
path: 'cannot_sub',
component: MeterCannotSubIndex,
meta: { title: '资质外分包' }
} }
] ]
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment