Commit 3e499eda by lichengming

修改了数据复核的按样品复核

parent 1327a4a6
<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 @@
<AssignPerson ref="personModal" @on-result-change="_assignBackData"></AssignPerson>
<!-- <SelectOriTempRecord ref="recordModal" @on-result-change="_page"></SelectOriTempRecord>-->
<!-- <OriginalRecordEdit ref="editModal"></OriginalRecordEdit>-->
<EquipManage ref="equipModal" @on-result-change="_page"></EquipManage>
<IndexManage ref="indexModal" @on-result-change="_page"></IndexManage>
<Reason ref="reasonModal" @on-result-change="_reasonResult"></Reason>
</div>
......@@ -57,6 +58,7 @@
import Global from '../../../../api/config'
import { soilTest } from '../../../../api'
import AssignPerson from '../../../../components/user-info-single/AssignPerson'
import EquipManage from '../EquipManage'
// import SelectOriTempRecord from '../SelectOriTempRecord'
// import OriginalRecordEdit from '../OriginalRecordEdit'
import IndexManage from '../IndexManage'
......@@ -65,6 +67,7 @@ export default {
components: {
AssignPerson,
Reason,
EquipManage,
// SelectOriTempRecord,
// OriginalRecordEdit,
IndexManage
......@@ -106,7 +109,7 @@ export default {
],
btn: [
{ type: 'success', id: '', name: '提交' },
{ type: 'waring', id: '', name: '退回' },
{ type: 'warning', id: '', name: '退回' },
{ type: '', id: 'food-task-assign-adjust-group', name: '调整分组' },
{
type: '',
......@@ -117,7 +120,8 @@ export default {
],
iconMsg: [
{ type: 'ios-book', id: '', name: '查看原始记录' },
{ type: 'md-apps', id: '', name: '查看指标' }
{ type: 'md-apps', id: '', name: '查看指标' },
{ type: 'ios-flask', id: '', name: '设备列表' }
],
getPage: {},
pageColumns: [
......@@ -180,14 +184,24 @@ export default {
switch (res) {
case '查看原始记录':
console.log(data)
this._viewRecord('1309434759937146882')
if (data.originalRecordId) {
this._viewRecord(data.originalRecordId)
} else {
this.$Message.warning('尚未编制报告')
}
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)
},
......@@ -492,13 +506,6 @@ export default {
switch (msg) {
case 'page':
this._page()
// this.result = this.getPage.records;
// this.$nextTick(() => {
// this.$refs.pageTable._checkAll()
// })
// if (this.getPage.records.length === 0) {
// this.$emit('on-result-change')
// }
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
......
......@@ -20,7 +20,7 @@
<!-- 表格 -->
<Col span="24">
<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" :getPage="getPage" :icon-msg="iconMsg" :table-name="tableName" :rows="100" is-task select-data>
<vxe-table-column
v-for="item in userColumns.length > 0 ?userColumns:pageColumns"
:key="item.key"
......@@ -48,14 +48,20 @@
</Col>
</Row>
<AssignPerson ref="personModal" @on-result-change="_assignBackData"></AssignPerson>
<IndexManage ref="indexModal" @on-result-change="_page"></IndexManage>
<Reason ref="reasonModal" @on-result-change="_reasonResult"></Reason>
<EquipManage ref="equipModal" @on-result-change="_page"></EquipManage>
</div>
</template>
<script>
import Global from '../../../../api/config'
import { soilTest } from '../../../../api'
import AssignPerson from '../../../../components/user-info-single/AssignPerson'
import IndexManage from '../IndexManage'
import Reason from '../../../../components/base/Reason'
import EquipManage from '../EquipManage'
export default {
components: { AssignPerson },
components: { AssignPerson, IndexManage, Reason, EquipManage },
data() {
return {
// 定义表格名称----英文
......@@ -86,7 +92,8 @@ export default {
{ key: 'detectType', name: '样品类别', placeholder: '请输入样品类别' }
],
btn: [
{ type: 'success', id: '', name: '试验项目分配' },
{ type: 'success', id: '', name: '提交' },
{ type: 'warning', id: '', name: '退回' },
{ type: '', id: 'food-task-assign-adjust-group', name: '调整分组' },
{
type: '',
......@@ -96,6 +103,11 @@ export default {
{ type: '', id: 'food-task-assign-maintain-info', name: '信息维护' }
],
getPage: {},
iconMsg: [
{ type: 'ios-book', id: '', name: '查看原始记录' },
{ type: 'md-apps', id: '', name: '查看指标' },
{ type: 'ios-flask', id: '', name: '设备列表' }
],
pageColumns: [
{ title: '试验名称', key: 'name', width: 160 },
{ title: '试验项目英文简写', key: 'shortName', width: 140 },
......@@ -185,6 +197,21 @@ export default {
break
}
},
_reasonResult(data) {
if (undefined !== data && data !== '') {
this._reportCheckBack(data)
}
},
_reportCheckBack: async function(data) {
const result = await soilTest.checkBack({
ids: this.selectIds,
remark: data
})
if (result) {
this._resultChange('退回成功')
}
},
_modalResult(data) {
switch (this.currentComponent) {
case 'AssignPerson':
......@@ -264,6 +291,12 @@ export default {
await this._reportDueDate()
await this._groupAssign()
break
case '提交':
this._submitToAudit()
break
case '退回':
this._checkBack()
break
case '调整分组':
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择=一条数据')
......@@ -285,6 +318,32 @@ export default {
break
}
},
_submitToAudit() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定提交该数据?',
onOk: () => {
this._submitToAuditOk()
}
})
}
},
_submitToAuditOk: async function() {
const result = await soilTest.endExpCheck(this.selectIds.join(','))
if (result) {
this._resultChange('提交成功')
}
},
_checkBack() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
this.$refs.reasonModal._open('退回原因')
}
},
// 信息维护
_maintainInfo() {
if (this.selectSampleIds.length === 0) {
......@@ -351,13 +410,6 @@ export default {
switch (msg) {
case 'page':
this._page()
// this.result = this.getPage.records;
// this.$nextTick(() => {
// this.$refs.pageTable._checkAll()
// })
// if (this.getPage.records.length === 0) {
// this.$emit('on-result-change')
// }
break
case 'selectData':
for (let i = 0; i < data.length; i++) {
......@@ -366,6 +418,9 @@ export default {
this.selectIds = selectIds
this.selectData = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
case 'table-col':
// 用户选中的表格列
this.userColumns = data
......@@ -376,6 +431,50 @@ export default {
break
}
},
_iconClick(res, data, currentComponent) {
this.$nextTick(() => {
switch (res) {
case '查看原始记录':
console.log(data)
this._viewRecord('1309434759937146882')
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() {
const user = Global.getUserInfo('userInfo')
......
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