Commit 066b5862 by wangweidong

整体优化

parent d60f4559
......@@ -30,6 +30,10 @@ export default {
pageGoOutEntrust: data =>
http.post('meter/v1/entrust/page_out_draft_entrust', data).then(res => res),
pageClientOnlineEntrust: data =>
http
.post('meter/v1/entrust/page_client_online_entrust', data)
.then(res => res),
pageGoOutEntrustHis: data =>
http
.post('meter/v1/entrust/page_out_draft_entrust_his', data)
......
......@@ -150,11 +150,6 @@ export default {
await this._page()
}
},
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......
......@@ -122,11 +122,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......
......@@ -126,11 +126,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......
......@@ -122,11 +122,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......
......@@ -143,11 +143,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......
......@@ -122,11 +122,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......
......@@ -132,7 +132,7 @@ export default {
],
dateList: [],
formObj: {
entrustId: undefined,
contractId: undefined,
name: undefined,
code: undefined,
type: undefined
......@@ -145,19 +145,6 @@ export default {
}
},
methods: {
_modalResult(data1, data2) {
switch (this.currentComponent) {
case 'CopyModal':
if (data1 === 0) {
this._copySample(data2)
} else {
this._copyAll(data2)
}
break
default:
this._search()
}
},
_dateChange(data) {
this.formObj.ctimeBegin = data[0]
this.formObj.ctimeEnd = data[1]
......@@ -227,7 +214,8 @@ export default {
}
},
_open(id) {
this.formObj.entrustId = id
alert(id)
this.formObj.contractId = id
this.showModal = true
this._page()
},
......
......@@ -137,11 +137,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......@@ -169,27 +164,15 @@ export default {
this.$refs.reasonModal._open('退回原因')
}
},
// _reportCheckBack: async function(data) {
// const result = await meterContract.checkSecond({
// ids: this.selectIds,
// remark: data
// })
//
// if (result) {
// this.$Message.success('退回成功!')
// await this._page()
// }
// },
_reasonResult(data) {
if (undefined !== data && data !== '') {
// this._reportCheckBack(data)
console.log('退回')
}
console.log(data)
},
_manageSample(data) {
// 管理样品
this.$refs.meterSampleManageModal._open(data.id)
this.$refs.meterSampleManageModal._open(data)
},
_iconClick(res, data, componentName) {
this.currentComponent = componentName
......
......@@ -127,11 +127,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......@@ -175,7 +170,7 @@ export default {
},
_manageSample(data) {
// 管理样品
this.$refs.meterSampleManageModal._open(data.id)
this.$refs.meterSampleManageModal._open(data)
},
_submitToReview() {
this._submitByContractIds('合同评审')
......
......@@ -119,11 +119,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......
......@@ -2,13 +2,10 @@
<div>
<div class="layout-content-padding">
<div class="layout-content-main">
<el-tabs v-model="activeName">
<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="finish">
<MeterSendEntrustFinish ref="finishTabs"></MeterSendEntrustFinish>
</el-tab-pane>
<el-tab-pane label="历史记录" name="his">
<MeterSendEntrustHis ref="hisTabs"></MeterSendEntrustHis>
</el-tab-pane>
......@@ -20,19 +17,33 @@
<script>
import MeterSendEntrust from './MeterContractRegister'
import MeterSendEntrustFinish from './MeterContractRegisterFinish'
import MeterSendEntrustHis from './MeterContractRegisterHis'
export default {
name: 'MeterSendEntrustIndex',
components: {
MeterSendEntrust,
MeterSendEntrustFinish,
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>
......
......@@ -135,11 +135,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......
......@@ -119,11 +119,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......
......@@ -135,11 +135,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......
......@@ -119,11 +119,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......
......@@ -121,19 +121,6 @@ export default {
}
},
methods: {
_modalResult(data1, data2) {
switch (this.currentComponent) {
case 'CopyModal':
if (data1 === 0) {
this._copySample(data2)
} else {
this._copyAll(data2)
}
break
default:
this._search()
}
},
_dateChange(data) {
this.formObj.ctimeBegin = data[0]
this.formObj.ctimeEnd = data[1]
......
......@@ -153,19 +153,6 @@ export default {
}
},
methods: {
_modalResult(data1, data2) {
switch (this.currentComponent) {
case 'CopyModal':
if (data1 === 0) {
this._copySample(data2)
} else {
this._copyAll(data2)
}
break
default:
this._search()
}
},
_dateChange(data) {
this.formObj.ctimeBegin = data[0]
this.formObj.ctimeEnd = data[1]
......
......@@ -153,19 +153,6 @@ export default {
}
},
methods: {
_modalResult(data1, data2) {
switch (this.currentComponent) {
case 'CopyModal':
if (data1 === 0) {
this._copySample(data2)
} else {
this._copyAll(data2)
}
break
default:
this._search()
}
},
_dateChange(data) {
this.formObj.ctimeBegin = data[0]
this.formObj.ctimeEnd = data[1]
......
<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' }
],
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.name" name="name" placeholder="请输入实验室名称" clearable @on-enter="_formSearch"/>
</Form-item>
<Form-item class="search-item" label="资质:">
<Input v-model="formObj.aptitude" name="aptitude" 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.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>
<MeterSampleManage ref="meterSampleManageModal" @on-result-change="_page"></MeterSampleManage>
<MeterEntrustRecord ref="entrustRecordModal" @on-result-change="_page"></MeterEntrustRecord>
</div>
</template>
<script>
import { meterEntrust } from '../../../api'
import MeterEntrustRecord from '../../../components/operation/Operation'
import MeterSampleManage from './MeterSampleManage'
import MeterSubcontractorEdit from './MeterGoOutTestEdit'
export default {
components: { MeterSubcontractorEdit, MeterSampleManage, MeterEntrustRecord },
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: {
name: undefined,
aptitude: undefined
},
selectIds: [],
getPage: {},
pageColumns: [
{ title: '委托单位', key: 'client', width: 140 },
{ title: '联系人', key: 'person', width: 120 },
{ title: '下单号', key: 'orderNum', width: 130 },
{ title: '联系电话', key: 'tel', width: 120 },
{ title: '进度', key: 'progress', width: 200, status: true },
{ title: '传真', key: 'fax', width: 120 },
{ title: '详细地址', key: 'address', width: 250 },
{ title: '邮编', key: 'postcode' },
{ title: 'E-mail', key: 'email', width: 120 },
{ title: '委托日期', key: 'edate', width: 120 },
{ title: '费用合计', key: 'fee', width: 120 },
{ title: '合同号', key: 'contractCode', 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 '提交':
this._submitToReview()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
_submitToReview() {
this._submitByContractIds('委托评审')
},
_submitByContractIds(cont) {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定要把这 ' + ids.length + ' 条记录提交到' + cont + '?',
onOk: () => {
const result = meterEntrust.submit(ids)
if (result) {
this.$Message.warning('提交成功!')
this._page()
}
}
})
}
},
_sampleManage(data) {
// 管理样品
this.$refs.meterSampleManageModal._open(data)
},
_iconClick(res, data, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (res) {
case '编辑':
this._editModal(true, data.id)
break
case '管理样品':
this._sampleManage(data.id)
break
case '附件':
this._upload(data.id)
break
case '删除':
this._deleteByIds([data.id])
break
case '操作日志':
this._record(data)
break
}
})
},
_record(data) {
this.$refs.entrustRecordModal._open(data.id)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
case 'selectIds':
this.selectIds = data
break
case 'changeSize':
this._page()
break
}
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await meterEntrust.pageClientOnlineEntrust(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._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 meterEntrust.getVOById(id)
if (result) {
this.$refs.editSubcontractorModal._openEdit(result)
}
},
_delete: async function(ids) {
const result = await meterEntrust.deleteById(ids)
if (result) {
this._formSearch()
this.$Message.success('删除成功!')
}
}
}
}
</script>
......@@ -28,7 +28,7 @@
<!--表格-->
<Col span="24">
<PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true"
:get-page="getPage" :icon-msg="iconMsg" @on-result-change="_tableResultChange" hide-checkbox>
:get-page="getPage" :icon-msg="iconMsg" @on-result-change="_tableResultChange" >
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
......@@ -46,14 +46,17 @@
</div>
</div>
<MeterSubcontractorEdit ref="editSubcontractorModal" @on-result-change="_formSearch"></MeterSubcontractorEdit>
<MeterSampleManage ref="meterSampleManageModal" @on-result-change="_page"></MeterSampleManage>
<MeterEntrustRecord ref="entrustRecordModal" @on-result-change="_page"></MeterEntrustRecord>
</div>
</template>
<script>
import { meterEntrust, meterSubcontractor } from '../../../api'
import MeterSubcontractorEdit from './MeterContractRegisterEdit'
import { meterEntrust } from '../../../api'
import MeterSampleManage from '../MeterSampleManageRead'
import MeterEntrustRecord from '../../../components/operation/Operation'
export default {
components: { MeterSubcontractorEdit },
components: { MeterSampleManage, MeterEntrustRecord },
data() {
return {
currentComponent: '',
......@@ -62,26 +65,24 @@ export default {
btn: [
{
type: 'success',
id: 'meter-subcontractor-add-btn',
id: 'meter-go-out-entrust-add-btn',
name: '添加'
},
{
type: 'success',
id: 'meter-go-out-entrust-submit-btn',
name: '提交'
}
],
iconMsg: [
{
type: 'ios-clock',
type: 'md-flask',
id: '',
name: '编辑'
name: '查看样品'
},
{
type: 'ios-clock',
id: '',
name: '资质项目'
},
{ type: 'ios-clock', id: '', name: '附件' },
{ type: 'ios-clock', id: '', name: '删除' },
{
type: 'ios-clock',
id: '',
name: '操作日志'
}
],
......@@ -94,6 +95,7 @@ export default {
pageColumns: [
{ title: '委托单位', key: 'client', width: 200 },
{ title: '联系人', key: 'person', width: 120 },
{ title: '委托编号', key: 'entrustCode', width: 120 },
{ title: '联系电话', key: 'tel', width: 120 },
{ title: '传真', key: 'fax', width: 120 },
{ title: '详细地址', key: 'address', width: 250 },
......@@ -119,11 +121,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......@@ -131,12 +128,35 @@ export default {
case '添加':
this._editModal(false)
break
case '提交':
this._submitToReview()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
_submitToReview() {
this._submitByContractIds('委托评审')
},
_submitByContractIds(cont) {
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定要把这 ' + ids.length + ' 条记录提交到' + cont + '?',
onOk: () => {
const result = meterEntrust.submit(ids)
if (result) {
console.log(result)
}
}
})
}
},
_iconClick(res, data, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......@@ -150,26 +170,30 @@ export default {
case '附件':
this._upload(data.id)
break
case '删除':
this._deleteByIds([data.id])
break
case '操作日志':
this._record(data.id)
break
case '查看样品':
this._sampleManage(data.id)
break
}
})
},
_sampleManage(data) {
// 管理样品
this.$refs.meterSampleManageModal._open(data)
},
_record(id) {
this.$refs.refModal._open(id)
this.$refs.entrustRecordModal._open(id)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodSubcontracter.page
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
case 'selectIds':
this.selectIds = data
break
case 'changeSize':
this._page()
break
......@@ -177,8 +201,7 @@ export default {
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await meterEntrust.pageSendEntrust(this.formObj)
const result = await meterEntrust.pageGoOutEntrustHis(this.formObj)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
......@@ -201,7 +224,6 @@ export default {
_editModal(edit, id) {
if (edit) {
// 编辑
// this.$refs.editSubcontractorModal._open(id)
this._getById(id)
} else {
// 添加
......@@ -218,13 +240,13 @@ export default {
this.$refs.refModal._open(id, 'subcontractorId')
},
_getById: async function(id) {
const result = await meterSubcontractor.getById(id)
const result = await meterEntrust.getVOById(id)
if (result) {
this.$refs.editSubcontractorModal._open(result)
this.$refs.editSubcontractorModal._openEdit(result)
}
},
_delete: async function(ids) {
const result = await meterSubcontractor.deleteById(ids)
const result = await meterEntrust.deleteById(ids)
if (result) {
this._formSearch()
this.$Message.success('删除成功!')
......
<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">
<MeterGoOutEntrust ref="waitTabs"></MeterGoOutEntrust>
</el-tab-pane>
<el-tab-pane label="历史记录" name="his">
<MeterGoOutEntrustHis ref="hisTabs"></MeterGoOutEntrustHis>
</el-tab-pane>
</el-tabs>
</div>
</div>
</div>
</template>
<script>
import MeterGoOutEntrust from './MeterClientOnlineEntrust'
import MeterGoOutEntrustHis from './MeterClientOnlineEntrustHis'
export default {
name: 'MeterGoOutEntrustIndex',
components: {
MeterGoOutEntrust,
MeterGoOutEntrustHis
},
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>
<template>
<div>
<Modal v-model="showModal" :mask-closable="false" width="600">
<p slot="header">{{modalTitle}}</p>
<div>
<Form id="edit-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="100">
<Form-item label="样品名称" prop="name">
<Input v-model="formObj.name" name="name" placeholder="请输入或选择样品名称" @on-result-change="_judgeBasisChange" />
</Form-item>
<Form-item label="检定依据" prop="verification">
<Input v-model="formObj.verification" name="verification" placeholder="请选择检定依据" />
</Form-item>
<Form-item label="型号规格" prop="spec">
<Input v-model="formObj.spec" name="spec" placeholder="请输入型号规格" />
</Form-item>
<Form-item label="出厂编号" prop="factoryNumber">
<Input v-model="formObj.factoryNumber" name="factoryNumber" placeholder="请输入出厂编号" />
</Form-item>
<Form-item label="数量" prop="quantity">
<Input v-model="formObj.quantity" name="quantity" placeholder="请选择数量" />
</Form-item>
<Form-item label="检测类型" prop="type">
<Input v-model="formObj.type" name="quantity" placeholder="请选择检测类型" />
</Form-item>
<Form-item label="备注" prop="remark">
<Input v-model="formObj.remark" :rows="3" placeholder="请输入备注" type="textarea" name="remark"/>
</Form-item>
</Form>
</div>
<div slot="footer">
<ModalFooter ref="footerModal" :footer="footerList" @on-result-change="_footerResult"></ModalFooter>
</div>
</Modal>
</div>
</template>
<script>
/**
* 添加编辑环境检测项目包
*/
import ModalFooter from '../../../components/base/modalFooter'
import { meterAptitude } from '../../../api'
export default {
components: {
ModalFooter
// autoComplete
},
data() {
// const validateJudgeBasis = (rule, value, callback) => {
// if (this.formObj.code === '') {
// callback(new Error('判定依据不能为空!'))
// } else if (this.formObj.stdId === '') {
// this.formObj.code = ''
// callback(new Error('请选择已维护过的判定依据!'))
// } else {
// callback()
// }
// }
return {
id: '',
modalTitle: '',
formObj: {
verification: '',
name: '',
spec: '',
factoryNumber: '',
type: '',
remark: '',
quantity: 1,
entrustId: ''
},
showModal: false,
aptitudeData: [],
ruleValidate: {
name: [{ required: true, message: '样品名称不能为空', trigger: 'blur' }]
},
footerList: [
{ name: '取消', type: '' },
{ name: '保存', type: 'primary' }
],
typeData: [],
judgeBasisData: []
}
},
methods: {
_save: async function(data) {
const result = await meterAptitude.save(data)
console.log(result)
if (result) {
this._resultChange('添加成功!')
}
},
_edit: async function(data) {
const result = await meterAptitude.edit(data)
if (result) {
this._resultChange('编辑成功!')
}
},
_open(entrustId) {
this.formObj.entrustId = entrustId
this._getJudgeBasisList()
this.$refs.formObj.resetFields()
this.id = ''
this.modalTitle = '添加样品'
this.showModal = true
},
_typeChange(msg, data) {
switch (msg) {
case 'select':
this.formObj.testType = data.name
break
}
},
_ok() {
this.$refs.formObj.validate(valid => {
if (valid) {
const data = this.$serialize('edit-form')
if (this.$string(this.id).isEmpty()) {
// 添加
this._save(data)
} else {
// 编辑
this._edit({ id: this.formObj.id, obj: data })
}
// if (this.$string(this.id).isEmpty()) {
// // 添加
// this.$store.dispatch('FoodJudgeBasis/add', data).then(() => {
// this._resultChange('添加成功!')
// })
// } else {
// // 编辑
// this.$store
// .dispatch('FoodJudgeBasis/edit', { id: this.id, obj: data })
// .then(() => {
// this._resultChange('编辑成功!')
// })
// }
} else {
this.$refs.footerModal._hideLoading()
this.$Message.error('表单验证失败!')
}
})
},
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '保存':
this._ok()
break
}
},
_cancel() {
this.showModal = false
},
_resultChange(msg) {
this.showModal = false
this.$refs.footerModal._hideLoading()
this.$Message.success(msg)
this.$emit('on-result-change')
this.$refs.footerModal._hideLoading()
},
// 关联
_getJudgeBasisList(data) {
const obj = { classify: 0 }
if (data) {
obj.stdNum = data
}
// this.$store.dispatch('StandardInfo/list', obj).then(() => {
// this.judgeBasisData = this.$store.state.StandardInfo.list
// })
},
_judgeBasisChange(msg, data) {
switch (msg) {
case 'select':
this.formObj.stdId = data.id
this.formObj.code = data.stdNum
this.formObj.name = data.name
this.$refs.formObj.validateField('code')
break
case 'query':
this.formObj.stdId = ''
this.formObj.code = data.stdNum
this.formObj.name = ''
this._getJudgeBasisList(data.stdNum)
break
case 'focus':
this._getJudgeBasisList()
break
case 'blur':
if (this.formObj.stdId === '') {
this.formObj.code = ''
this._getJudgeBasisList()
}
this.$refs.formObj.validateField('code')
}
}
}
}
</script>
......@@ -134,11 +134,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......@@ -208,9 +203,6 @@ export default {
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodSubcontracter.page
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
......
......@@ -121,11 +121,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......
......@@ -98,9 +98,6 @@ export default {
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodContractRecord.page
break
case 'changeSize':
this._page()
break
......
......@@ -398,9 +398,6 @@ export default {
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
// this.getPage = this.$store.state.FoodJudgeBasis.page
break
case 'selectIds':
// this.selectIds = data
break
......
......@@ -126,11 +126,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......@@ -203,9 +198,6 @@ export default {
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodSubcontracter.page
break
case 'selectIds':
this.selectIds = data
break
......
......@@ -115,11 +115,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......
......@@ -98,9 +98,6 @@ export default {
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodContractRecord.page
break
case 'changeSize':
this._page()
break
......
......@@ -349,9 +349,6 @@ export default {
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
// this.getPage = this.$store.state.FoodJudgeBasis.page
break
case 'selectIds':
// this.selectIds = data
break
......
......@@ -176,11 +176,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......
......@@ -124,11 +124,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......
......@@ -170,19 +170,6 @@ export default {
}
},
methods: {
_modalResult(data1, data2) {
switch (this.currentComponent) {
case 'CopyModal':
if (data1 === 0) {
this._copySample(data2)
} else {
this._copyAll(data2)
}
break
default:
this._search()
}
},
_dateChange(data) {
this.formObj.ctimeBegin = data[0]
this.formObj.ctimeEnd = data[1]
......
......@@ -128,19 +128,6 @@ export default {
}
},
methods: {
_modalResult(data1, data2) {
switch (this.currentComponent) {
case 'CopyModal':
if (data1 === 0) {
this._copySample(data2)
} else {
this._copyAll(data2)
}
break
default:
this._search()
}
},
_dateChange(data) {
this.formObj.ctimeBegin = data[0]
this.formObj.ctimeEnd = data[1]
......
......@@ -117,11 +117,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......
......@@ -121,11 +121,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......
......@@ -149,11 +149,6 @@ export default {
// })
// })
},
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......@@ -204,7 +199,7 @@ export default {
this.$nextTick(function() {
switch (res) {
case '样品管理':
this._manageSample(data)
this._manageSample(data.id)
break
case '详情':
this._detailModal(data)
......@@ -229,7 +224,7 @@ export default {
},
_manageSample(data) {
// 管理样品
this.$refs.meterSampleManageModal._open(data.id)
this.$refs.meterSampleManageModal._open(data)
},
_componentResult(data, msg) {
switch (this.currentComponent) {
......
......@@ -116,11 +116,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......
......@@ -121,19 +121,6 @@ export default {
}
},
methods: {
_modalResult(data1, data2) {
switch (this.currentComponent) {
case 'CopyModal':
if (data1 === 0) {
this._copySample(data2)
} else {
this._copyAll(data2)
}
break
default:
this._search()
}
},
_dateChange(data) {
this.formObj.ctimeBegin = data[0]
this.formObj.ctimeEnd = data[1]
......
......@@ -149,19 +149,6 @@ export default {
}
},
methods: {
_modalResult(data1, data2) {
switch (this.currentComponent) {
case 'CopyModal':
if (data1 === 0) {
this._copySample(data2)
} else {
this._copyAll(data2)
}
break
default:
this._search()
}
},
_dateChange(data) {
this.formObj.ctimeBegin = data[0]
this.formObj.ctimeEnd = data[1]
......
......@@ -130,24 +130,6 @@ export default {
_detailModal(data) {
console.log(data)
this.$refs.meterSampleEdit._open(data)
// 查看
// this.$store.dispatch('FoodContract/getById', data.id).then(() => {
// if (data.type === 0) {
// // 企业委托 ’0‘
// this.currentComponent = 'FoodContractCompanyDetail'
// } else {
// // 政府委托 ’1‘
// this.currentComponent = 'FoodContractGovernDetail'
// }
// this.$nextTick(() => {
// this.$refs.refModal._open(this.$store.state.FoodContract.model)
// })
// })
},
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
......@@ -169,7 +151,7 @@ export default {
this.$nextTick(function() {
switch (res) {
case '样品管理':
this._manageSample(data)
this._manageSample(data.id)
break
case '详情':
this._detailModal(data)
......@@ -194,7 +176,7 @@ export default {
},
_manageSample(data) {
// 管理样品
this.$refs.meterSampleManageModal._open(data.id)
this.$refs.meterSampleManageModal._open(data)
},
_componentResult(data, msg) {
switch (this.currentComponent) {
......
......@@ -116,11 +116,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......
......@@ -141,19 +141,6 @@ export default {
}
},
methods: {
_modalResult(data1, data2) {
switch (this.currentComponent) {
case 'CopyModal':
if (data1 === 0) {
this._copySample(data2)
} else {
this._copyAll(data2)
}
break
default:
this._search()
}
},
_cancel() {
this.showModal = false
this.$emit('on-result-change')
......
......@@ -152,19 +152,6 @@ export default {
}
},
methods: {
_modalResult(data1, data2) {
switch (this.currentComponent) {
case 'CopyModal':
if (data1 === 0) {
this._copySample(data2)
} else {
this._copyAll(data2)
}
break
default:
this._search()
}
},
_dateChange(data) {
this.formObj.ctimeBegin = data[0]
this.formObj.ctimeEnd = data[1]
......
......@@ -133,11 +133,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......
......@@ -122,11 +122,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......
......@@ -148,19 +148,6 @@ export default {
}
},
methods: {
_modalResult(data1, data2) {
switch (this.currentComponent) {
case 'CopyModal':
if (data1 === 0) {
this._copySample(data2)
} else {
this._copyAll(data2)
}
break
default:
this._search()
}
},
_dateChange(data) {
this.formObj.ctimeBegin = data[0]
this.formObj.ctimeEnd = data[1]
......
......@@ -159,11 +159,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......
......@@ -124,11 +124,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......
......@@ -143,19 +143,6 @@ export default {
}
},
methods: {
_modalResult(data1, data2) {
switch (this.currentComponent) {
case 'CopyModal':
if (data1 === 0) {
this._copySample(data2)
} else {
this._copyAll(data2)
}
break
default:
this._search()
}
},
_footerResult(name) {
switch (name) {
case '关闭':
......
......@@ -132,11 +132,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......
......@@ -124,11 +124,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......
......@@ -148,19 +148,6 @@ export default {
}
},
methods: {
_modalResult(data1, data2) {
switch (this.currentComponent) {
case 'CopyModal':
if (data1 === 0) {
this._copySample(data2)
} else {
this._copyAll(data2)
}
break
default:
this._search()
}
},
_dateChange(data) {
this.formObj.ctimeBegin = data[0]
this.formObj.ctimeEnd = data[1]
......
......@@ -107,11 +107,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......
......@@ -159,19 +159,6 @@ export default {
}
},
methods: {
_modalResult(data1, data2) {
switch (this.currentComponent) {
case 'CopyModal':
if (data1 === 0) {
this._copySample(data2)
} else {
this._copyAll(data2)
}
break
default:
this._search()
}
},
_dateChange(data) {
this.formObj.ctimeBegin = data[0]
this.formObj.ctimeEnd = data[1]
......
......@@ -127,11 +127,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......
......@@ -117,11 +117,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......
......@@ -152,19 +152,6 @@ export default {
}
},
methods: {
_modalResult(data1, data2) {
switch (this.currentComponent) {
case 'CopyModal':
if (data1 === 0) {
this._copySample(data2)
} else {
this._copyAll(data2)
}
break
default:
this._search()
}
},
_dateChange(data) {
this.formObj.ctimeBegin = data[0]
this.formObj.ctimeEnd = data[1]
......
......@@ -154,19 +154,6 @@ export default {
}
},
methods: {
_modalResult(data1, data2) {
switch (this.currentComponent) {
case 'CopyModal':
if (data1 === 0) {
this._copySample(data2)
} else {
this._copyAll(data2)
}
break
default:
this._search()
}
},
_dateChange(data) {
this.formObj.ctimeBegin = data[0]
this.formObj.ctimeEnd = data[1]
......
......@@ -128,11 +128,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......
......@@ -103,11 +103,6 @@ export default {
this._page()
},
methods: {
_modalResult() {
if (this.currentComponent === 'FoodSubcontracterEdit') {
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......
......@@ -33,6 +33,7 @@ import MeterContractRegisterIndex from '../pages/meter-contract/contract-registe
import MeterContractReviewIndex from '../pages/meter-contract/contract-review/MeterContractReviewIndex'
import MeterContractFileIndex from '../pages/meter-contract/contract-file/MeterContractFileIndex'
import MeterSampleProgress from '../pages/meter-progress/progress-sample/MeterSampleProgress'
import MeterClientOnlineEntrustIndex from '../pages/meter-entrust/client-online/MeterClientOnlineEntrustIndex'
import Blank from '~/pages/blank'
export default [
{
......@@ -82,6 +83,11 @@ export default [
component: Blank,
children: [
{
path: 'client_online',
component: MeterClientOnlineEntrustIndex,
meta: { title: '客户在线委托单' }
},
{
path: 'send_test',
component: MeterSendEntrustIndex,
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