Commit 60e340e8 by lichengming

修改了试样检测和委托单登记

parent 3e499eda
...@@ -26,6 +26,8 @@ export default { ...@@ -26,6 +26,8 @@ export default {
samplePage: data => http.post('soil/v1/sample/page', data).then(res => res), samplePage: data => http.post('soil/v1/sample/page', data).then(res => res),
pageExpTestSample: data => pageExpTestSample: data =>
http.post('soil/v1/sample/page_exp_test_sample', data).then(res => res), http.post('soil/v1/sample/page_exp_test_sample', data).then(res => res),
pageExpAuditSample: data =>
http.post('soil/v1/sample/page_exp_audit_sample', data).then(res => res),
pageExpCheckSample: data => pageExpCheckSample: data =>
http.post('soil/v1/sample/page_exp_check_sample', data).then(res => res), http.post('soil/v1/sample/page_exp_check_sample', data).then(res => res),
pageItem: data => http.post('soil/v1/experiment/page', data).then(res => res), pageItem: data => http.post('soil/v1/experiment/page', data).then(res => res),
...@@ -117,5 +119,15 @@ export default { ...@@ -117,5 +119,15 @@ export default {
pageExpCheckHis: data => pageExpCheckHis: data =>
http.post('soil/v1/entrust/page_exp_check_his', data).then(res => res), http.post('soil/v1/entrust/page_exp_check_his', data).then(res => res),
pageExpTestSampleHis: data => pageExpTestSampleHis: data =>
http.post('soil/v1/sample/page_exp_test_sample_his', data).then(res => res) http.post('soil/v1/sample/page_exp_test_sample_his', data).then(res => res),
// 数据复核历史任务 试样分页列表
pageExpCheckSampleHis: data =>
http
.post('soil/v1/sample/page_exp_check_sample_his', data)
.then(res => res),
// 数据审核 按照样品审核 右侧分页列表
pageAudit: data =>
http.post('soil/v1/experiment/page_audit', data).then(res => res),
pageExpAuditSampleHis: data =>
http.post('soil/v1/sample/page_exp_audit_sample_his', data).then(res => res)
} }
...@@ -142,7 +142,6 @@ export default { ...@@ -142,7 +142,6 @@ export default {
], ],
pageColumns: [ pageColumns: [
{ title: '试验名称', key: 'name', width: 160 }, { title: '试验名称', key: 'name', width: 160 },
{ title: '试样编号', key: 'sampleCode', width: 160 },
{ title: '试验项目英文简写', key: 'shortName', width: 140 }, { title: '试验项目英文简写', key: 'shortName', width: 140 },
{ title: '试验科室', key: 'groupName', width: 140 }, { title: '试验科室', key: 'groupName', width: 140 },
{ title: '大类', key: 'mainType', width: 140 }, { title: '大类', key: 'mainType', width: 140 },
......
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
<div class="layout-content-padding"> <div class="layout-content-padding">
<div class="layout-content-main"> <div class="layout-content-main">
<el-tabs v-model="activeName" @tab-click="_changeTabs"> <el-tabs v-model="activeName" @tab-click="_changeTabs">
<el-tab-pane label="待完成" name="wait"> <el-tab-pane label="待完成" name="wait"></el-tab-pane>
<MeterSendEntrust ref="waitTabs"></MeterSendEntrust> <el-tab-pane label="历史记录" name="his"></el-tab-pane>
</el-tab-pane>
<el-tab-pane label="历史记录" name="his">
<MeterSendEntrustHis ref="hisTabs"></MeterSendEntrustHis>
</el-tab-pane>
</el-tabs> </el-tabs>
<keep-alive>
<!-- eslint-disable-next-line vue/require-component-is -->
<component ref="refModal" :is="currentComponent"></component>
</keep-alive>
</div> </div>
</div> </div>
</div> </div>
...@@ -20,28 +20,38 @@ import MeterSendEntrustHis from './EntrustRegisterHis' ...@@ -20,28 +20,38 @@ import MeterSendEntrustHis from './EntrustRegisterHis'
export default { export default {
name: 'MeterSendEntrustIndex', name: 'MeterSendEntrustIndex',
components: { components: {
// eslint-disable-next-line vue/no-unused-components
MeterSendEntrust, MeterSendEntrust,
// eslint-disable-next-line vue/no-unused-components
MeterSendEntrustHis MeterSendEntrustHis
}, },
data() { data() {
return { return {
activeName: 'wait' activeName: 'wait',
currentComponent: ''
} }
}, },
mounted() { mounted() {
this.activeName = 'wait' this.activeName = 'wait'
this._page() this.currentComponent = 'MeterSendEntrust'
this.$nextTick(() => {
this.$refs.refModal._page()
})
}, },
methods: { methods: {
_changeTabs(tab, event) { _changeTabs(tab, event) {
if (tab.name === 'wait') { if (tab.name === 'wait') {
this._page() this.currentComponent = 'MeterSendEntrust'
this.$nextTick(() => {
this.$refs.refModal._page()
})
} else { } else {
this.$refs.hisTabs._page() this.currentComponent = 'MeterSendEntrustHis'
this.$nextTick(() => {
this.$refs.refModal._page()
})
// this.$refs.hisTabs._page()
} }
},
_page() {
this.$refs.waitTabs._page()
} }
} }
} }
......
...@@ -47,12 +47,10 @@ ...@@ -47,12 +47,10 @@
</Row> </Row>
</div> </div>
</div> </div>
<FileManage ref="FileManage"></FileManage> <keep-alive>
<importModal ref="importModal" @on-result-change="_page"></importModal> <!-- eslint-disable-next-line vue/require-component-is -->
<Operation ref="operationModal"></Operation> <component ref="refModal" :is="currentComponent" @on-result-change="_componentResult"></component>
<EntrustRegisterEdit ref="editModal" @on-result-change="_formSearch"></EntrustRegisterEdit> </keep-alive>
<SoilSampleManage ref="sampleManageModal" @on-result-change="_page"></SoilSampleManage>
<SoilSampleItemManage ref="itemManageModal" @on-result-change="_page"></SoilSampleItemManage>
</div> </div>
</template> </template>
<script> <script>
...@@ -65,10 +63,15 @@ import SoilSampleItemManage from '../SoilSampleItemManageEdit' ...@@ -65,10 +63,15 @@ import SoilSampleItemManage from '../SoilSampleItemManageEdit'
import EntrustRegisterEdit from './EntrustRegisterEdit' import EntrustRegisterEdit from './EntrustRegisterEdit'
export default { export default {
components: { components: {
// eslint-disable-next-line vue/no-unused-components
Operation, Operation,
// eslint-disable-next-line vue/no-unused-components
EntrustRegisterEdit, EntrustRegisterEdit,
// eslint-disable-next-line vue/no-unused-components
SoilSampleManage, SoilSampleManage,
// eslint-disable-next-line vue/no-unused-components
importModal, importModal,
// eslint-disable-next-line vue/no-unused-components
SoilSampleItemManage SoilSampleItemManage
}, },
data() { data() {
...@@ -173,9 +176,7 @@ export default { ...@@ -173,9 +176,7 @@ export default {
} }
} }
}, },
mounted() { mounted() {},
this._page()
},
methods: { methods: {
_btnClick(msg, componentName) { _btnClick(msg, componentName) {
this.currentComponent = componentName this.currentComponent = componentName
...@@ -200,12 +201,31 @@ export default { ...@@ -200,12 +201,31 @@ export default {
}) })
}, },
_import() { _import() {
this.currentComponent = 'importModal'
const data = { const data = {
importUrl: '/soil/v1/entrust/import_entrust/', importUrl: '/soil/v1/entrust/import_entrust/',
downloadUrl: '/soil/v1/excel/template/SoilEntrustImport', downloadUrl: '/soil/v1/excel/template/SoilEntrustImport',
title: '试验委托单导入' title: '试验委托单导入'
} }
this.$refs.importModal._open(data, '试验委托单导入') this.$nextTick(() => {
this.$refs.refModal._open(data, '试验委托单导入')
})
// this.$refs.importModal._open(data, '试验委托单导入')
},
_componentResult(msg, data) {
switch (this.currentComponent) {
case 'MeterSubcontractorEdit':
this._formSearch()
break
case 'DrugSampleManage':
this._formSearch()
break
case 'FileManage':
this._fileResult(msg, data)
break
default:
this._page()
}
}, },
_iconClick(res, data, componentName) { _iconClick(res, data, componentName) {
this.currentComponent = componentName this.currentComponent = componentName
...@@ -238,11 +258,19 @@ export default { ...@@ -238,11 +258,19 @@ export default {
_sampleManage(data) { _sampleManage(data) {
// 管理样品 // 管理样品
this.$refs.sampleManageModal._open(data) this.currentComponent = 'SoilSampleManage'
this.$nextTick(() => {
this.$refs.refModal._open(data)
})
// this.$refs.sampleManageModal._open(data)
}, },
_itemManage(data) { _itemManage(data) {
// 管理样品 // 管理样品
this.$refs.itemManageModal._openByEntrustId(data) this.currentComponent = 'SoilSampleItemManage'
this.$nextTick(() => {
this.$refs.refModal._openByEntrustId(data)
})
// this.$refs.itemManageModal._openByEntrustId(data)
}, },
_submitToReview() { _submitToReview() {
this._submitByContractIds('委托评审') this._submitByContractIds('委托评审')
...@@ -294,7 +322,11 @@ export default { ...@@ -294,7 +322,11 @@ export default {
this._page() this._page()
}, },
_record(id) { _record(id) {
this.$refs.operationModal._open(id) this.currentComponent = 'Operation'
this.$nextTick(() => {
this.$refs.refModal._open(id)
})
// this.$refs.operationModal._open(id)
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
...@@ -336,12 +368,16 @@ export default { ...@@ -336,12 +368,16 @@ export default {
}, },
// 编辑&添加 // 编辑&添加
_editModal(edit, id) { _editModal(edit, id) {
this.currentComponent = 'EntrustRegisterEdit'
if (edit) { if (edit) {
// 编辑 // 编辑
this._getById(id) this._getById(id)
} else { } else {
// 添加 // 添加
this.$refs.editModal._open() this.$nextTick(() => {
this.$refs.refModal._open()
})
// this.$refs.editModal._open()
} }
}, },
// 追加项目 // 追加项目
...@@ -351,7 +387,11 @@ export default { ...@@ -351,7 +387,11 @@ export default {
_upload(id) { _upload(id) {
// 上传文件 // 上传文件
this.$refs.FileManage._open(id, 'entrustId') this.currentComponent = 'FileManage'
this.$nextTick(() => {
this.$refs.refModal._open(id, 'entrustId')
})
// this.$refs.FileManage._open(id, 'entrustId')
}, },
_exportEntrust(id) { _exportEntrust(id) {
this.$Modal.confirm({ this.$Modal.confirm({
...@@ -366,7 +406,7 @@ export default { ...@@ -366,7 +406,7 @@ export default {
_getById: async function(id) { _getById: async function(id) {
const result = await soilEntrust.getVOById(id) const result = await soilEntrust.getVOById(id)
if (result) { if (result) {
this.$refs.editModal._openEdit(result) this.$refs.refModal._openEdit(result)
} }
}, },
_delete: async function(ids) { _delete: async function(ids) {
......
...@@ -47,8 +47,12 @@ ...@@ -47,8 +47,12 @@
</Row> </Row>
</div> </div>
</div> </div>
<MeterEntrustRecord ref="entrustRecordModal" @on-result-change="_page"></MeterEntrustRecord> <keep-alive>
<SoilSampleManage ref="sampleManageModal" @on-result-change="_page"></SoilSampleManage> <!-- eslint-disable-next-line vue/require-component-is -->
<component ref="refModal" :is="currentComponent" @on-result-change="_componentResult"></component>
</keep-alive>
<!-- <MeterEntrustRecord ref="entrustRecordModal" @on-result-change="_page"></MeterEntrustRecord>-->
<!-- <SoilSampleManage ref="sampleManageModal" @on-result-change="_page"></SoilSampleManage>-->
</div> </div>
</template> </template>
<script> <script>
...@@ -56,6 +60,7 @@ import { soilAptitude, soilEntrust } from '../../../api' ...@@ -56,6 +60,7 @@ import { soilAptitude, soilEntrust } from '../../../api'
import MeterEntrustRecord from '../../../components/operation/Operation' import MeterEntrustRecord from '../../../components/operation/Operation'
import SoilSampleManage from '../SoilSampleManageHis' import SoilSampleManage from '../SoilSampleManageHis'
export default { export default {
// eslint-disable-next-line vue/no-unused-components
components: { MeterEntrustRecord, SoilSampleManage }, components: { MeterEntrustRecord, SoilSampleManage },
data() { data() {
return { return {
...@@ -161,10 +166,18 @@ export default { ...@@ -161,10 +166,18 @@ export default {
}, },
_sampleManage(data) { _sampleManage(data) {
// 管理样品 // 管理样品
this.$refs.sampleManageModal._open(data) this.currentComponent = 'SoilSampleManage'
this.$nextTick(() => {
this.$refs.refModal._open(data)
})
// this.$refs.sampleManageModal._open(data)
}, },
_record(id) { _record(id) {
this.$refs.entrustRecordModal._open(id) this.currentComponent = 'MeterEntrustRecord'
this.$nextTick(() => {
this.$refs.refModal._open(id)
})
// this.$refs.entrustRecordModal._open(id)
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
......
...@@ -2,14 +2,22 @@ ...@@ -2,14 +2,22 @@
<div> <div>
<div class="layout-content-padding"> <div class="layout-content-padding">
<div class="layout-content-main"> <div class="layout-content-main">
<!-- <el-tabs v-model="activeName" @tab-click="_changeTabs">-->
<!-- <el-tab-pane label="按委托接收" name="entrust">-->
<!-- <ReceiveByEntrust ref="entrustTabs"></ReceiveByEntrust>-->
<!-- </el-tab-pane>-->
<!-- <el-tab-pane label="接收历史" name="sample">-->
<!-- <ReceiveBySample ref="sampleTabs"></ReceiveBySample>-->
<!-- </el-tab-pane>-->
<!-- </el-tabs>-->
<el-tabs v-model="activeName" @tab-click="_changeTabs"> <el-tabs v-model="activeName" @tab-click="_changeTabs">
<el-tab-pane label="按委托接收" name="entrust"> <el-tab-pane label="待完成" name="entrust"></el-tab-pane>
<ReceiveByEntrust ref="entrustTabs"></ReceiveByEntrust> <el-tab-pane label="历史记录" name="sample"></el-tab-pane>
</el-tab-pane>
<el-tab-pane label="接收历史" name="sample">
<ReceiveBySample ref="sampleTabs"></ReceiveBySample>
</el-tab-pane>
</el-tabs> </el-tabs>
<keep-alive>
<!-- eslint-disable-next-line vue/require-component-is -->
<component ref="refModal" :is="currentComponent"></component>
</keep-alive>
</div> </div>
</div> </div>
</div> </div>
...@@ -22,12 +30,15 @@ import ReceiveBySample from './ReceiveBySample' ...@@ -22,12 +30,15 @@ import ReceiveBySample from './ReceiveBySample'
export default { export default {
name: 'MeterSummaryEntrustIndex', name: 'MeterSummaryEntrustIndex',
components: { components: {
// eslint-disable-next-line vue/no-unused-components
ReceiveByEntrust, ReceiveByEntrust,
// eslint-disable-next-line vue/no-unused-components
ReceiveBySample ReceiveBySample
}, },
data() { data() {
return { return {
activeName: 'entrust' activeName: 'entrust',
currentComponent: ''
} }
}, },
mounted() { mounted() {
...@@ -39,11 +50,19 @@ export default { ...@@ -39,11 +50,19 @@ export default {
if (tab.name === 'entrust') { if (tab.name === 'entrust') {
this._page() this._page()
} else { } else {
this.$refs.sampleTabs._page() this.currentComponent = 'ReceiveBySample'
this.$nextTick(() => {
this.$refs.refModal._page()
})
// this.$refs.sampleTabs._page()
} }
}, },
_page() { _page() {
this.$refs.entrustTabs._page() this.currentComponent = 'ReceiveByEntrust'
this.$nextTick(() => {
this.$refs.refModal._page()
})
// this.$refs.entrustTabs._page()
} }
} }
} }
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
import UserInfo from '../../../components/user-info-single/AssignPerson' import UserInfo from '../../../components/user-info-single/AssignPerson'
import { soilTest } from '../../../api' import { soilTest } from '../../../api'
import Operation from '../../../components/operation/Operation' import Operation from '../../../components/operation/Operation'
import SoilSampleManageHis from '../SoilSampleManageHis' import SoilSampleManageHis from './SoilSampleManageHis'
export default { export default {
components: { components: {
UserInfo, UserInfo,
......
<template>
<div>
<Modal v-model="showModal" width="800" class="modal-footer-none full-screen">
<div slot="header">{{modalTitle}}</div>
<div>
<Form id="index-right-form" :label-width="80" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="仪器名称:">
<Input v-model="formObj.equipName" @on-enter="_formSearch" placeholder="请输入仪器名称" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
<btn-list :msg="btn" @on-result-change="_btnClick" class="contHide" style="margin-bottom: 10px;"/>
<PTVXETable ref="pageTable" :tableHeight="tableHeight"
@on-result-change="_tableResultChange" :icon-msg="iconMsg" :getPage="getPage">
<vxe-table-column
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined"
v-for="item in pageColumns" :key="item.key">
<template slot-scope="scope">
<span v-if="item.key==='defaulted'">{{scope.row[item.key]?'是':'否'}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
</PTVXETable>
</div>
</Modal>
<IndexManageEdit ref="indexEdit" @on-result-change="_page"></IndexManageEdit>
</div>
</template>
<script>
import { soilTest } from '../../../api'
import IndexManageEdit from './IndexManageEdit'
export default {
components: { IndexManageEdit },
data() {
return {
id: '',
modalTitle: '',
showModal: false,
btn: [],
tableHeight: document.documentElement.clientHeight - 180,
pageColumns: [
{ title: '仪器名称', key: 'equipName', width: 120 },
{ title: '仪器编号', key: 'equipNum', width: 120 },
{ title: '仪器品牌', key: 'brand', width: 120 },
{ title: '采集类型', key: 'collectionType', width: 120 },
{ title: '采集地址', key: 'collectionAddress', width: 120 },
{ title: '采集命令', key: 'acquisitionCommand', width: 120 }
],
getPage: {},
iconMsg: [{ type: 'md-trash', id: '', name: '删除' }],
selectIds: [],
formObj: {
name: ''
},
// 资质信息
aptitudeItemInfo: {}
}
},
methods: {
_open(data) {
console.log(data)
this.aptitudeItemInfo = data
this.formObj = this.$resetFields(this.formObj)
this.id = data.id
this.modalTitle = data.name + ' 设备管理'
this.showModal = true
this._page()
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
this.formObj.experimentId = this.id
const result = await soilTest.equipPage(this.$serializeForm(this.formObj))
if (result) {
console.log(result)
this.getPage = result
this.$refs.pageTable._hideLoading()
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
break
case 'selectIds':
this.selectIds = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
case 'changeSize':
this._page()
break
}
},
_iconClick(res, data) {
switch (res) {
case '编辑':
this._editModal(true, data)
break
case '删除':
this._deleteByIds(data.id)
break
}
},
_editModal(edit, data) {
if (edit) {
this._getById(data)
} else {
this.$refs.indexEdit._open(this.id, '')
}
},
_getById: async function(data) {
const result = await soilTest.itemGetById(data.id)
console.log(result)
if (result) {
this.$refs.indexEdit._open('', result)
}
},
_btnClick(msg) {
switch (msg) {
case '添加指标':
this._editModal(false)
break
case '删除':
this._deleteByIds()
break
}
},
_deleteByIds(id) {
this.$Modal.confirm({
title: '提示',
content: '确定删除这条记录?',
onOk: () => {
this._delOk(id)
}
})
},
_delOk: async function(id) {
const result = await soilTest.deleteEquip(id)
if (result) {
this.$Message.success('删除成功')
this._page()
}
}
}
}
</script>
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
<AssignPerson ref="personModal" @on-result-change="_assignBackData"></AssignPerson> <AssignPerson ref="personModal" @on-result-change="_assignBackData"></AssignPerson>
<!-- <SelectOriTempRecord ref="recordModal" @on-result-change="_page"></SelectOriTempRecord>--> <!-- <SelectOriTempRecord ref="recordModal" @on-result-change="_page"></SelectOriTempRecord>-->
<!-- <OriginalRecordEdit ref="editModal"></OriginalRecordEdit>--> <!-- <OriginalRecordEdit ref="editModal"></OriginalRecordEdit>-->
<EquipManage ref="equipModal" @on-result-change="_page"></EquipManage>
<IndexManage ref="indexModal" @on-result-change="_page"></IndexManage> <IndexManage ref="indexModal" @on-result-change="_page"></IndexManage>
<Reason ref="reasonModal" @on-result-change="_reasonResult"></Reason> <Reason ref="reasonModal" @on-result-change="_reasonResult"></Reason>
</div> </div>
...@@ -57,6 +58,7 @@ ...@@ -57,6 +58,7 @@
import Global from '../../../../api/config' import Global from '../../../../api/config'
import { soilTest } from '../../../../api' import { soilTest } from '../../../../api'
import AssignPerson from '../../../../components/user-info-single/AssignPerson' import AssignPerson from '../../../../components/user-info-single/AssignPerson'
import EquipManage from '../EquipManage'
// import SelectOriTempRecord from '../SelectOriTempRecord' // import SelectOriTempRecord from '../SelectOriTempRecord'
// import OriginalRecordEdit from '../OriginalRecordEdit' // import OriginalRecordEdit from '../OriginalRecordEdit'
import IndexManage from '../IndexManage' import IndexManage from '../IndexManage'
...@@ -65,6 +67,7 @@ export default { ...@@ -65,6 +67,7 @@ export default {
components: { components: {
AssignPerson, AssignPerson,
Reason, Reason,
EquipManage,
// SelectOriTempRecord, // SelectOriTempRecord,
// OriginalRecordEdit, // OriginalRecordEdit,
IndexManage IndexManage
...@@ -117,7 +120,8 @@ export default { ...@@ -117,7 +120,8 @@ export default {
], ],
iconMsg: [ iconMsg: [
{ type: 'ios-book', id: '', name: '查看原始记录' }, { type: 'ios-book', id: '', name: '查看原始记录' },
{ type: 'md-apps', id: '', name: '查看指标' } { type: 'md-apps', id: '', name: '查看指标' },
{ type: 'ios-flask', id: '', name: '设备列表' }
], ],
getPage: {}, getPage: {},
pageColumns: [ pageColumns: [
...@@ -185,9 +189,15 @@ export default { ...@@ -185,9 +189,15 @@ export default {
case '查看指标': case '查看指标':
this._indexManage(data) this._indexManage(data)
break break
case '设备列表':
this._equipManage(data)
break
} }
}) })
}, },
_equipManage(data) {
this.$refs.equipModal._open(data)
},
_auditBack() { _auditBack() {
if (this.selectIds.length === 0) { if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据') this.$Message.warning('请至少选择一条数据')
......
...@@ -106,7 +106,7 @@ export default { ...@@ -106,7 +106,7 @@ export default {
_page: async function() { _page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams()) Object.assign(this.formObj, this.$refs.pageTable._searchParams())
this.formObj.entrustId = this.entrustId this.formObj.entrustId = this.entrustId
const result = await soilTest.pageExpTestSample( const result = await soilTest.pageExpAuditSample(
this.$serializeForm(this.formObj) this.$serializeForm(this.formObj)
) )
if (result) { if (result) {
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<!-- 表格 --> <!-- 表格 -->
<Col span="24"> <Col span="24">
<PTVXETable ref="pageTable" :pageColumns="pageColumns" :tableHeight="tableHeight" <PTVXETable ref="pageTable" :pageColumns="pageColumns" :tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" :table-name="tableName" :rows="100" is-task select-data> @on-result-change="_tableResultChange" :icon-msg="iconMsg" :getPage="getPage" :table-name="tableName" :rows="100" is-task select-data>
<vxe-table-column <vxe-table-column
v-for="item in userColumns.length > 0 ?userColumns:pageColumns" v-for="item in userColumns.length > 0 ?userColumns:pageColumns"
:key="item.key" :key="item.key"
...@@ -48,14 +48,20 @@ ...@@ -48,14 +48,20 @@
</Col> </Col>
</Row> </Row>
<AssignPerson ref="personModal" @on-result-change="_assignBackData"></AssignPerson> <AssignPerson ref="personModal" @on-result-change="_assignBackData"></AssignPerson>
<Reason ref="reasonModal" @on-result-change="_reasonResult"></Reason>
<IndexManage ref="indexModal" @on-result-change="_page"></IndexManage>
<EquipManage ref="equipModal" @on-result-change="_page"></EquipManage>
</div> </div>
</template> </template>
<script> <script>
import Global from '../../../../api/config' import Global from '../../../../api/config'
import { soilTest } from '../../../../api' import { soilTest } from '../../../../api'
import AssignPerson from '../../../../components/user-info-single/AssignPerson' import AssignPerson from '../../../../components/user-info-single/AssignPerson'
import IndexManage from '../IndexManage'
import Reason from '../../../../components/base/Reason'
import EquipManage from '../EquipManage'
export default { export default {
components: { AssignPerson }, components: { AssignPerson, IndexManage, Reason, EquipManage },
data() { data() {
return { return {
// 定义表格名称----英文 // 定义表格名称----英文
...@@ -86,7 +92,8 @@ export default { ...@@ -86,7 +92,8 @@ export default {
{ key: 'detectType', name: '样品类别', placeholder: '请输入样品类别' } { key: 'detectType', name: '样品类别', placeholder: '请输入样品类别' }
], ],
btn: [ btn: [
{ type: 'success', id: '', name: '试验项目分配' }, { type: 'success', id: '', name: '提交' },
{ type: 'warning', id: '', name: '退回' },
{ type: '', id: 'food-task-assign-adjust-group', name: '调整分组' }, { type: '', id: 'food-task-assign-adjust-group', name: '调整分组' },
{ {
type: '', type: '',
...@@ -95,6 +102,11 @@ export default { ...@@ -95,6 +102,11 @@ export default {
}, },
{ type: '', id: 'food-task-assign-maintain-info', name: '信息维护' } { type: '', id: 'food-task-assign-maintain-info', name: '信息维护' }
], ],
iconMsg: [
{ type: 'ios-book', id: '', name: '查看原始记录' },
{ type: 'md-apps', id: '', name: '查看指标' },
{ type: 'ios-flask', id: '', name: '设备列表' }
],
getPage: {}, getPage: {},
pageColumns: [ pageColumns: [
{ title: '试验名称', key: 'name', width: 160 }, { title: '试验名称', key: 'name', width: 160 },
...@@ -134,6 +146,21 @@ export default { ...@@ -134,6 +146,21 @@ export default {
// this._dicSearch() // this._dicSearch()
}, },
methods: { methods: {
_reasonResult(data) {
if (undefined !== data && data !== '') {
this._reportCheckBack(data)
}
},
_reportCheckBack: async function(data) {
const result = await soilTest.auditBack({
ids: this.selectIds,
remark: data
})
if (result) {
this._resultChange('退回成功')
}
},
// 获取column // 获取column
_getColumn() { _getColumn() {
this.$refs.pageTable._getColByTableName() this.$refs.pageTable._getColByTableName()
...@@ -264,6 +291,12 @@ export default { ...@@ -264,6 +291,12 @@ export default {
await this._reportDueDate() await this._reportDueDate()
await this._groupAssign() await this._groupAssign()
break break
case '提交':
this._submitToMake()
break
case '退回':
this._auditBack()
break
case '调整分组': case '调整分组':
if (this.selectIds.length === 0) { if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择=一条数据') this.$Message.warning('请至少选择=一条数据')
...@@ -285,6 +318,32 @@ export default { ...@@ -285,6 +318,32 @@ export default {
break break
} }
}, },
_auditBack() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
this.$refs.reasonModal._open('退回原因')
}
},
_submitToMake() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定提交该数据?',
onOk: () => {
this._submitToMakeOk()
}
})
}
},
_submitToMakeOk: async function() {
const result = await soilTest.endExpAudit(this.selectIds.join(','))
if (result) {
this._resultChange('提交成功')
}
},
// 信息维护 // 信息维护
_maintainInfo() { _maintainInfo() {
if (this.selectSampleIds.length === 0) { if (this.selectSampleIds.length === 0) {
...@@ -339,7 +398,7 @@ export default { ...@@ -339,7 +398,7 @@ export default {
_page: async function() { _page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams()) Object.assign(this.formObj, this.$refs.pageTable._searchParams())
this.formObj.sampleIds = this.sampleIds this.formObj.sampleIds = this.sampleIds
const result = await soilTest.pageTest(this.$serializeForm(this.formObj)) const result = await soilTest.pageAudit(this.$serializeForm(this.formObj))
if (result) { if (result) {
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
this.$refs.pageTable._checkAll() this.$refs.pageTable._checkAll()
...@@ -351,13 +410,9 @@ export default { ...@@ -351,13 +410,9 @@ export default {
switch (msg) { switch (msg) {
case 'page': case 'page':
this._page() this._page()
// this.result = this.getPage.records; break
// this.$nextTick(() => { case 'iconClick':
// this.$refs.pageTable._checkAll() this._iconClick(data.name, data.rowData, data.componentName)
// })
// if (this.getPage.records.length === 0) {
// this.$emit('on-result-change')
// }
break break
case 'selectData': case 'selectData':
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
...@@ -376,6 +431,50 @@ export default { ...@@ -376,6 +431,50 @@ export default {
break break
} }
}, },
_iconClick(res, data, currentComponent) {
this.$nextTick(() => {
switch (res) {
case '查看原始记录':
console.log(data)
this._viewRecord(data.id)
break
case '查看指标':
this._indexManage(data)
break
case '设备列表':
this._equipManage(data)
break
}
})
},
_equipManage(data) {
this.$refs.equipModal._open(data)
},
_indexManage(data) {
this.$refs.indexModal._open(data)
},
_viewRecord(originalRecordId) {
// layx.iframe('labRecordWriteOriView', '原始记录预览', Global.recordURL + '/print/v1/form/' + originalRecordId, {
// eslint-disable-next-line no-undef
layx.iframe(
'labRecordWriteOriView',
'原始记录预览',
Global.recordURL +
'/print/v1/form/' +
originalRecordId +
'?type=ENVTESTMAKE',
{
event: {
onload: {
after: function(layxWindow, winform) {
// eslint-disable-next-line no-undef
layx.max(winform.id)
}
}
}
}
)
},
// 按人分配 选人选时间 // 按人分配 选人选时间
_userAssign() { _userAssign() {
const user = Global.getUserInfo('userInfo') const user = Global.getUserInfo('userInfo')
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
import UserInfo from '../../../components/user-info-single/AssignPerson' import UserInfo from '../../../components/user-info-single/AssignPerson'
import { soilTest } from '../../../api' import { soilTest } from '../../../api'
import Operation from '../../../components/operation/Operation' import Operation from '../../../components/operation/Operation'
import SoilSampleManageHis from '../SoilSampleManageHis' import SoilSampleManageHis from './SoilSampleManageHis'
export default { export default {
components: { components: {
UserInfo, UserInfo,
......
...@@ -184,11 +184,7 @@ export default { ...@@ -184,11 +184,7 @@ export default {
switch (res) { switch (res) {
case '查看原始记录': case '查看原始记录':
console.log(data) console.log(data)
if (data.originalRecordId) { this._viewRecord(data.id)
this._viewRecord(data.originalRecordId)
} else {
this.$Message.warning('尚未编制报告')
}
break break
case '查看指标': case '查看指标':
this._indexManage(data) this._indexManage(data)
......
...@@ -436,7 +436,11 @@ export default { ...@@ -436,7 +436,11 @@ export default {
switch (res) { switch (res) {
case '查看原始记录': case '查看原始记录':
console.log(data) console.log(data)
this._viewRecord('1309434759937146882') if (data.originalRecordId) {
this._viewRecord(data.originalRecordId)
} else {
this.$Message.warning('尚未填写原始记录')
}
break break
case '查看指标': case '查看指标':
this._indexManage(data) this._indexManage(data)
......
...@@ -172,9 +172,9 @@ export default { ...@@ -172,9 +172,9 @@ export default {
switch (res) { switch (res) {
case '查看原始记录': case '查看原始记录':
console.log(data) console.log(data)
if (data.recorded === '是') { if (data.recordId) {
// this._viewRecord('1309434759937146882') // this._viewRecord('1309434759937146882')
this._viewRecord(data.originalRecordId) this._viewRecord(data.recordId)
} else { } else {
this.$Message.warning('未填写原始记录') this.$Message.warning('未填写原始记录')
} }
...@@ -450,13 +450,12 @@ export default { ...@@ -450,13 +450,12 @@ export default {
const errorInfo = [] const errorInfo = []
for (let i = 0; i < this.selectData.length; i++) { for (let i = 0; i < this.selectData.length; i++) {
console.log(this.selectData[i].recorded) console.log(this.selectData[i].recorded)
if (this.selectData[i].recorded === '否') { if (this.selectData[i].recorded !== '否') {
errorInfo.push(this.selectData[i].index + 1) errorInfo.push(this.selectData[i].index + 1)
} }
} }
console.log('未编制报告', errorInfo)
if (errorInfo.length !== 0) { if (errorInfo.length !== 0) {
this.$Message.warning('第' + errorInfo + '条数据未编制报告') this.$Message.warning('第' + errorInfo + '条数据已填写原始记录')
} else { } else {
console.log('打开填写原始记录界面') console.log('打开填写原始记录界面')
this.$refs.recordModal._open(this.selectIds, this.entrustId) this.$refs.recordModal._open(this.selectIds, this.entrustId)
......
...@@ -373,13 +373,12 @@ export default { ...@@ -373,13 +373,12 @@ export default {
const errorInfo = [] const errorInfo = []
for (let i = 0; i < this.selectData.length; i++) { for (let i = 0; i < this.selectData.length; i++) {
console.log(this.selectData[i].recorded) console.log(this.selectData[i].recorded)
if (this.selectData[i].recorded === '否') { if (this.selectData[i].recorded !== '否') {
errorInfo.push(this.selectData[i].index + 1) errorInfo.push(this.selectData[i].index + 1)
} }
} }
console.log('未编制报告', errorInfo)
if (errorInfo.length !== 0) { if (errorInfo.length !== 0) {
this.$Message.warning('第' + errorInfo + '条数据未编制报告') this.$Message.warning('第' + errorInfo + '条数据已填写原始记录')
} else { } else {
console.log('打开填写原始记录界面') console.log('打开填写原始记录界面')
this.$refs.recordModal._open(this.selectIds, this.entrustId) this.$refs.recordModal._open(this.selectIds, this.entrustId)
...@@ -485,9 +484,9 @@ export default { ...@@ -485,9 +484,9 @@ export default {
switch (res) { switch (res) {
case '查看原始记录': case '查看原始记录':
console.log(data) console.log(data)
if (data.recorded === '是') { if (data.recordId) {
// this._viewRecord('1309434759937146882') // this._viewRecord('1309434759937146882')
this._viewRecord(data.originalRecordId) this._viewRecord(data.recordId)
} else { } else {
this.$Message.warning('未填写原始记录') this.$Message.warning('未填写原始记录')
} }
......
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