Commit 6eedaae7 by zhangmengqi

Merge branch 'dev'

parents 95a940d1 887702a9
...@@ -29,6 +29,8 @@ export default { ...@@ -29,6 +29,8 @@ export default {
getVOById: data => http.get('soil/v1/entrust/vo/' + data).then(res => res), getVOById: data => http.get('soil/v1/entrust/vo/' + data).then(res => res),
deleteById: data => deleteById: data =>
http.delete('soil/v1/entrust/?ids=' + data).then(res => res), http.delete('soil/v1/entrust/?ids=' + data).then(res => res),
experimentDeleteById: data =>
http.delete('soil/v1/experiment/?ids=' + data).then(res => res),
// 保存 // 保存
save: data => save: data =>
https https
...@@ -65,6 +67,8 @@ export default { ...@@ -65,6 +67,8 @@ export default {
http.post('soil/v1/sample/page_send_his', data).then(res => res), http.post('soil/v1/sample/page_send_his', data).then(res => res),
receiveSample: data => receiveSample: data =>
http.post('soil/v1/sample/receive_sample', data).then(res => res), http.post('soil/v1/sample/receive_sample', data).then(res => res),
sampleRetain: data =>
http.post('soil/v1/sample/sample_retain', data).then(res => res),
sendSample: data => sendSample: data =>
http.post('soil/v1/sample/send_sample', data).then(res => res), http.post('soil/v1/sample/send_sample', data).then(res => res),
pagePrepare: data => pagePrepare: data =>
......
...@@ -9,6 +9,8 @@ export default { ...@@ -9,6 +9,8 @@ export default {
// page // page
locationPage: data => locationPage: data =>
http.post('soil/v1/receive_location/page', data).then(res => res), http.post('soil/v1/receive_location/page', data).then(res => res),
pageRetain: data =>
http.post('soil/v1/sample/page_retain', data).then(res => res),
locationList: data => locationList: data =>
http.post('soil/v1/receive_location/list', data).then(res => res), http.post('soil/v1/receive_location/list', data).then(res => res),
locationGetById: data => locationGetById: data =>
...@@ -137,5 +139,24 @@ export default { ...@@ -137,5 +139,24 @@ export default {
// 余样编辑 // 余样编辑
editPrepare: data => editPrepare: data =>
http.put('soil/v1/prepare/' + data.id, data.obj).then(res => res), http.put('soil/v1/prepare/' + data.id, data.obj).then(res => res),
getUserList: data => http.post('/base/v1/user/page').then(res => res) getUserList: data => http.post('/base/v1/user/page').then(res => res),
scanTakeSample: data =>
http
.post('soil/v1/sample/scan_take_sample?sampleCode=' + data)
.then(res => res),
pageLocationSample: data =>
http.post('soil/v1/sample/page_location_sample', data).then(res => res),
importExperiments: data =>
http
.post(
'soil/v1/experiment/import_experiments?aptitudeIds=' +
data.aptitudeIds +
'&ids=' +
data.ids
)
.then(res => res),
pageSecondary: data =>
http.post('soil/v1/prepare/page_secondary', data).then(res => res),
pageSecondaryHis: data =>
http.post('soil/v1/prepare/page_secondary_his', data).then(res => res)
} }
{ {
"name": "nuxt-demo", "name": "nuxt-demo",
"version": "1.0.0", "version": "1.0.0",
"description": "计量检定LIMS", "description": "土工试验",
"author": "wwd", "author": "wwd",
"private": true, "private": true,
"scripts": { "scripts": {
......
...@@ -413,10 +413,7 @@ export default { ...@@ -413,10 +413,7 @@ export default {
} }
}, },
_visibleChange(data) { _visibleChange(data) {
if (!data && this.$showBtn('food-aptitude-item-step-edit')) {
this.$emit('on-result-change') this.$emit('on-result-change')
this.$refs.testStepByAptitude._clear()
}
} }
} }
} }
......
...@@ -69,7 +69,7 @@ export default { ...@@ -69,7 +69,7 @@ export default {
{ key: 'belongUnit', title: '归口单位' }, { key: 'belongUnit', title: '归口单位' },
{ key: 'publishUnit', title: '发布单位' } { key: 'publishUnit', title: '发布单位' }
], ],
modalTitle: '添加食品标准表', modalTitle: '收样位置选择',
formObj: { formObj: {
code: '', code: '',
name: '' name: ''
......
<template> <template>
<div> <div>
<Modal v-model="showModal" width="1010" class="modal-footer-none"> <Modal v-model="showModal" width="1030" class="modal-footer-none">
<p slot="header"> <p slot="header">
{{ modalTitle }} {{ modalTitle }}
</p> </p>
...@@ -114,7 +114,7 @@ export default { ...@@ -114,7 +114,7 @@ export default {
selectData: {}, selectData: {},
getPage: {}, getPage: {},
pageColumns: [ pageColumns: [
{ title: '试样编号', key: 'sampleCode', width: 100, fixed: 'left' }, { title: '试样编号', key: 'sampleCode', width: 120, fixed: 'left' },
{ title: '试样深度', key: 'sampleDepth', width: 100 }, { title: '试样深度', key: 'sampleDepth', width: 100 },
{ title: '现场编号', key: 'siteNo', width: 100 }, { title: '现场编号', key: 'siteNo', width: 100 },
{ title: '试验项目', key: 'experimentNames' }, { title: '试验项目', key: 'experimentNames' },
......
...@@ -158,7 +158,7 @@ export default { ...@@ -158,7 +158,7 @@ export default {
{ title: '水深(米)', key: 'waterDepth', width: 120 }, { title: '水深(米)', key: 'waterDepth', width: 120 },
{ title: '钻孔名称', key: 'boreholeName', width: 120 }, { title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '进度', key: 'progress', width: 120, status: true }, { title: '进度', key: 'progress', width: 120, status: true },
{ title: '工程号', key: 'projectNo', width: 120 }, { title: '平均容重', key: 'projectNo', width: 120 },
{ title: '制表日期', key: 'tabulateDate', width: 120, date: true }, { title: '制表日期', key: 'tabulateDate', width: 120, date: true },
{ title: '制表人', key: 'tabulater', width: 120 }, { title: '制表人', key: 'tabulater', width: 120 },
{ title: '批准日期', key: 'approveDate', width: 120, date: true }, { title: '批准日期', key: 'approveDate', width: 120, date: true },
......
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
<Form-item label="水深(米)" prop="waterDepth" class="width-48"> <Form-item label="水深(米)" prop="waterDepth" class="width-48">
<Input v-model="formObj.waterDepth" name="waterDepth" placeholder="请输入深度"/> <Input v-model="formObj.waterDepth" name="waterDepth" placeholder="请输入深度"/>
</Form-item> </Form-item>
<Form-item label="工程号" prop="projectNo" class="width-48"> <Form-item label="平均容重" prop="projectNo" class="width-48">
<Input v-model="formObj.projectNo" name="projectNo" placeholder="请输入工程号"/> <Input v-model="formObj.projectNo" name="projectNo" placeholder="请输入平均容重"/>
</Form-item> </Form-item>
<Form-item label="制单日期:" prop="tabulateDate" class="width-48"> <Form-item label="制单日期:" prop="tabulateDate" class="width-48">
<Date-picker v-model="formObj.tabulateDate" @on-change="_tabulateChange" name="tabulateDate" type="date" split-panels style="width:100%;" <Date-picker v-model="formObj.tabulateDate" @on-change="_tabulateChange" name="tabulateDate" type="date" split-panels style="width:100%;"
......
...@@ -100,7 +100,7 @@ export default { ...@@ -100,7 +100,7 @@ export default {
{ title: '水深(米)', key: 'waterDepth', width: 120 }, { title: '水深(米)', key: 'waterDepth', width: 120 },
{ title: '钻孔名称', key: 'boreholeName', width: 120 }, { title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '进度', key: 'progress', width: 120, status: true }, { title: '进度', key: 'progress', width: 120, status: true },
{ title: '工程号', key: 'projectNo', width: 120 }, { title: '平均容重', key: 'projectNo', width: 120 },
{ title: '报告编号', key: 'reportCode', width: 120 }, { title: '报告编号', key: 'reportCode', width: 120 },
{ title: '制表日期', key: 'tabulateDate', width: 120, date: true }, { title: '制表日期', key: 'tabulateDate', width: 120, date: true },
{ title: '制表人', key: 'tabulater', width: 120 }, { title: '制表人', key: 'tabulater', width: 120 },
......
...@@ -118,7 +118,7 @@ export default { ...@@ -118,7 +118,7 @@ export default {
{ title: '水深(米)', key: 'waterDepth', width: 120 }, { title: '水深(米)', key: 'waterDepth', width: 120 },
{ title: '钻孔名称', key: 'boreholeName', width: 120 }, { title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '进度', key: 'progress', width: 120, status: true }, { title: '进度', key: 'progress', width: 120, status: true },
{ title: '工程号', key: 'projectNo', width: 120 }, { title: '平均容重', key: 'projectNo', width: 120 },
{ title: '制表日期', key: 'tabulateDate', width: 120, date: true }, { title: '制表日期', key: 'tabulateDate', width: 120, date: true },
{ title: '制表人', key: 'tabulater', width: 120 }, { title: '制表人', key: 'tabulater', width: 120 },
{ title: '批准日期', key: 'approveDate', width: 120, date: true }, { title: '批准日期', key: 'approveDate', width: 120, date: true },
......
...@@ -61,9 +61,13 @@ ...@@ -61,9 +61,13 @@
</div> </div>
<!--组件加载--> <!--组件加载-->
<!--选择领样人--> <!--选择领样人-->
<UserInfo ref="userModal" @on-result-change="_userResult"></UserInfo> <keep-alive>
<Operation ref="operation"></Operation> <!-- eslint-disable-next-line vue/require-component-is -->
<FileManage ref="FileManage"></FileManage> <component ref="refModal" :is="currentComponent" @on-result-change="_componentResult"></component>
</keep-alive>
<!-- <UserInfo ref="userModal" @on-result-change="_userResult"></UserInfo>-->
<!-- <Operation ref="operation"></Operation>-->
<!-- <FileManage ref="FileManage"></FileManage>-->
</div> </div>
</template> </template>
<script> <script>
...@@ -71,10 +75,8 @@ import UserInfo from '../../../components/user-info-single/assignPerson' ...@@ -71,10 +75,8 @@ import UserInfo from '../../../components/user-info-single/assignPerson'
import { soilReport } from '../../../api' import { soilReport } from '../../../api'
import Operation from '../../../components/operation/Operation' import Operation from '../../../components/operation/Operation'
export default { export default {
components: { // eslint-disable-next-line vue/no-unused-components
UserInfo, components: { UserInfo, Operation },
Operation
},
data() { data() {
return { return {
formObj: { formObj: {
...@@ -89,7 +91,6 @@ export default { ...@@ -89,7 +91,6 @@ export default {
// name: '管理样品' // name: '管理样品'
// }, // },
{ type: 'md-cloud', id: '', name: '附件' }, { type: 'md-cloud', id: '', name: '附件' },
{ type: 'md-trash', id: '', name: '删除' },
{ {
type: 'ios-clock', type: 'ios-clock',
id: '', id: '',
...@@ -429,7 +430,11 @@ export default { ...@@ -429,7 +430,11 @@ export default {
}, },
_operationRecord(id) { _operationRecord(id) {
// 操作日志 // 操作日志
this.$refs.operation._open(id) this.currentComponent = 'Operation'
this.$nextTick(() => {
this.$refs.refModal._open(id)
})
// this.$refs.operation._open(id)
}, },
_resultChange(msg) { _resultChange(msg) {
if (this.$store.state.FoodContract.success) { if (this.$store.state.FoodContract.success) {
...@@ -440,7 +445,11 @@ export default { ...@@ -440,7 +445,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')
} }
} }
} }
......
...@@ -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="check">-->
<!-- <ReportMakeByEntrust ref="checkTabs"></ReportMakeByEntrust>-->
<!-- </el-tab-pane>-->
<!-- <el-tab-pane label="历史报告" name="checkHis">-->
<!-- <ReportMakeHis ref="checkHisTabs"></ReportMakeHis>-->
<!-- </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="check"> <el-tab-pane label="数据审核" name="check"></el-tab-pane>
<ReportMakeByEntrust ref="checkTabs"></ReportMakeByEntrust> <el-tab-pane label="历史任务" name="checkHis"></el-tab-pane>
</el-tab-pane>
<el-tab-pane label="历史报告" name="checkHis">
<ReportMakeHis ref="checkHisTabs"></ReportMakeHis>
</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 +28,37 @@ import ReportMakeByEntrust from './tabs/ReportMakeByEntrust' ...@@ -20,28 +28,37 @@ import ReportMakeByEntrust from './tabs/ReportMakeByEntrust'
import ReportMakeHis from './ReportMakeHis' import ReportMakeHis from './ReportMakeHis'
export default { export default {
components: { // eslint-disable-next-line vue/no-unused-components
ReportMakeByEntrust, components: { ReportMakeByEntrust, ReportMakeHis },
ReportMakeHis
},
data() { data() {
return { return {
activeName: 'check' activeName: 'check',
currentComponent: ''
} }
}, },
mounted() { mounted() {
this.activeName = 'check' this.activeName = 'check'
this.$refs.checkTabs._page() this._page()
}, },
methods: { methods: {
_changeTabs(tab, event) { _changeTabs(tab, event) {
if (tab.name === 'check') { if (tab.name === 'check') {
this.$refs.checkTabs._open() this._page()
} else if (tab.name === 'applyRecord') { } else if (tab.name === 'applyRecord') {
// this.$refs.applyRecordTabs._page() // this.$refs.applyRecordTabs._page()
} else { } else {
this.$refs.checkHisTabs._page() this.currentComponent = 'ReportMakeHis'
this.$nextTick(() => {
this.$refs.refModal._page()
})
} }
},
_page() {
this.currentComponent = 'ReportMakeByEntrust'
this.$nextTick(() => {
this.$refs.refModal._page()
})
// this.$refs.entrustTabs._page()
} }
} }
} }
......
...@@ -76,11 +76,15 @@ ...@@ -76,11 +76,15 @@
</Row> </Row>
</div> </div>
</div> </div>
<SampleByMakeModal ref="sampleByMakeModal"></SampleByMakeModal> <keep-alive>
<Operation ref="operation"></Operation> <!-- eslint-disable-next-line vue/require-component-is -->
<FileManage ref="FileManage"></FileManage> <component ref="refModal" :is="currentComponent" @on-result-change="_componentResult"></component>
<OriginalRecordView ref="originalRecordView" @on-result-change="_page"></OriginalRecordView> </keep-alive>
<UploadByReport ref="uploadReport" @on-result-change="_page"></UploadByReport> <!-- <SampleByMakeModal ref="sampleByMakeModal"></SampleByMakeModal>-->
<!-- <Operation ref="operation"></Operation>-->
<!-- <FileManage ref="FileManage"></FileManage>-->
<!-- <OriginalRecordView ref="originalRecordView" @on-result-change="_page"></OriginalRecordView>-->
<!-- <UploadByReport ref="uploadReport" @on-result-change="_page"></UploadByReport>-->
</div> </div>
</template> </template>
<script> <script>
...@@ -91,9 +95,13 @@ import OriginalRecordView from '../OriginalRecordView' ...@@ -91,9 +95,13 @@ import OriginalRecordView from '../OriginalRecordView'
import UploadByReport from '../UploadByReport' import UploadByReport from '../UploadByReport'
export default { export default {
components: { components: {
// eslint-disable-next-line vue/no-unused-components
SampleByMakeModal, SampleByMakeModal,
// eslint-disable-next-line vue/no-unused-components
Operation, Operation,
// eslint-disable-next-line vue/no-unused-components
OriginalRecordView, OriginalRecordView,
// eslint-disable-next-line vue/no-unused-components
UploadByReport UploadByReport
}, },
data() { data() {
...@@ -124,12 +132,14 @@ export default { ...@@ -124,12 +132,14 @@ export default {
{ {
type: 'ios-flask-outline', type: 'ios-flask-outline',
id: '', id: '',
name: '管理样品和报告' name: '管理样品和报告',
currentComponent: SampleByMakeModal
}, },
{ {
type: 'ios-beaker', type: 'ios-beaker',
id: '', id: '',
name: '查看原始记录' name: '查看原始记录',
currentComponent: OriginalRecordView
}, },
{ {
type: 'ios-cloud-upload', type: 'ios-cloud-upload',
...@@ -265,15 +275,21 @@ export default { ...@@ -265,15 +275,21 @@ export default {
}) })
} }
}, },
_componentResult(data, msg) {
switch (this.currentComponent) {
default:
this._page()
}
},
_iconClick(res, data, componentName) { _iconClick(res, data, componentName) {
this.currentComponent = componentName this.currentComponent = componentName
this.$nextTick(function() { this.$nextTick(function() {
switch (res) { switch (res) {
case '管理样品和报告': case '管理样品和报告':
this.$refs.sampleByMakeModal._open(data.id) this.$refs.refModal._open(data.id)
break break
case '查看原始记录': case '查看原始记录':
this.$refs.originalRecordView._open(data.id) this.$refs.refModal._open(data.id)
break break
case '上传报告': case '上传报告':
this._uploadReport(data.id) this._uploadReport(data.id)
...@@ -297,7 +313,11 @@ export default { ...@@ -297,7 +313,11 @@ export default {
}) })
}, },
_uploadReport(id) { _uploadReport(id) {
this.$refs.uploadReport._open(id) this.currentComponent = 'UploadByReport'
this.$nextTick(() => {
this.$refs.refModal._open(id)
})
// this.$refs.uploadReport._open(id)
}, },
_viewReport: async function(id) { _viewReport: async function(id) {
const result = await soilSample.getReport(id) const result = await soilSample.getReport(id)
...@@ -314,8 +334,12 @@ export default { ...@@ -314,8 +334,12 @@ export default {
}) })
}, },
_operationRecord(id) { _operationRecord(id) {
this.currentComponent = 'Operation'
this.$nextTick(() => {
this.$refs.refModal._open(id)
})
// 操作日志 // 操作日志
this.$refs.operation._open(id) // this.$refs.operation._open(id)
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
...@@ -370,8 +394,12 @@ export default { ...@@ -370,8 +394,12 @@ export default {
}) })
}, },
_upload(id) { _upload(id) {
this.currentComponent = 'FileManage'
this.$nextTick(() => {
this.$refs.refModal._open(id, 'entrustId')
})
// 上传文件 // 上传文件
this.$refs.FileManage._open(id, 'entrustId') // this.$refs.FileManage._open(id, 'entrustId')
} }
} }
} }
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<!-- 表格 --> <!-- 表格 -->
<Col span="24"> <Col span="24">
<PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true" <PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true"
:get-page="getPage" @on-result-change="_tableResultChange"> :get-page="getPage" :icon-msg="iconMsg" @on-result-change="_tableResultChange" select-data>
<vxe-table-column <vxe-table-column
v-for="item in pageColumns" v-for="item in pageColumns"
:key="item.key" :key="item.key"
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
</el-select> </el-select>
<span v-if="!showOption">{{ scope.row[item.key]===0? '否':'是' }}</span> <span v-if="!showOption">{{ scope.row[item.key]===0? '否':'是' }}</span>
</div> </div>
<span v-else-if="item.status">{{scope.row[item.key]}}</span> <span v-else-if="item.status">{{scope.row[item.key].display}}</span>
<div v-else-if="item.judged"> <div v-else-if="item.judged">
{{ scope.row[item.key]===0? '否':'是' }} {{ scope.row[item.key]===0? '否':'是' }}
</div> </div>
...@@ -105,28 +105,36 @@ ...@@ -105,28 +105,36 @@
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult" /> <modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult" />
</div> </div>
</Modal> </Modal>
<ImportItem ref="itemImport" @on-result-change="_page"></ImportItem>
</div> </div>
</template> </template>
<script> <script>
import http from '../../api/http' import http from '../../api/http'
import { soilEntrust } from '../../api' import { soilEntrust } from '../../api'
import ImportItem from './sample-preparation/ImportItem'
export default { export default {
components: {}, components: { ImportItem },
data() { data() {
return { return {
formId: 'SoilSampleItemManage', formId: 'SoilSampleItemManage',
currentComponent: '', currentComponent: '',
btn: [], btn: [
iconMsg: [{ type: 'pt-a-end', id: '', name: '删除' }], {
type: 'success',
id: '',
name: '导入检测项目'
}
],
iconMsg: [{ type: 'md-trash', id: '', name: '删除' }],
sampleId: '', // 样品id sampleId: '', // 样品id
showModal: false, showModal: false,
modalTitle: '管理检测项目', modalTitle: '管理检测项目',
selectIds: [], selectIds: [],
selectData: [],
itemId: '', itemId: '',
index: '', index: '',
showOption: true, showOption: true,
searchOpen: true, searchOpen: true,
selectData: {},
getPage: {}, getPage: {},
currentRow: '', currentRow: '',
currentIndex: '', currentIndex: '',
...@@ -142,7 +150,7 @@ export default { ...@@ -142,7 +150,7 @@ export default {
{ title: '小类', key: 'smallType' }, { title: '小类', key: 'smallType' },
{ title: '检测依据', key: 'testBasis', width: 180 }, { title: '检测依据', key: 'testBasis', width: 180 },
{ title: '试验方法', key: 'testMethod', width: 180 }, { title: '试验方法', key: 'testMethod', width: 180 },
{ title: '状态', key: 'status', width: 180 } { title: '状态', key: 'status', width: 180, status: true }
], ],
subOptions: [ subOptions: [
{ {
...@@ -381,7 +389,6 @@ export default { ...@@ -381,7 +389,6 @@ export default {
this._copy(data) this._copy(data)
break break
case '删除': case '删除':
console.log(index)
this._deleteById(data.id) this._deleteById(data.id)
break break
case '导出样品委托协议': case '导出样品委托协议':
...@@ -425,9 +432,9 @@ export default { ...@@ -425,9 +432,9 @@ export default {
this.selectIds = selectIds this.selectIds = selectIds
this.selectData = data this.selectData = data
break break
// case 'iconClick': case 'iconClick':
// this._iconClick(data.name, data.rowData, data.componentName) this._iconClick(data.name, data.rowData, data.componentName)
// break break
case 'page': case 'page':
this._page() this._page()
break break
...@@ -480,7 +487,7 @@ export default { ...@@ -480,7 +487,7 @@ export default {
}, },
_deleteOk: async function(ids) { _deleteOk: async function(ids) {
const result = await soilEntrust.deleteById(ids) const result = await soilEntrust.experimentDeleteById(ids)
if (result) { if (result) {
this._resultChange('删除成功! ') this._resultChange('删除成功! ')
} }
...@@ -588,15 +595,7 @@ export default { ...@@ -588,15 +595,7 @@ export default {
}, },
// 导入检测项目 // 导入检测项目
_importItem() { _importItem() {
if (this.selectIds.length === 0) { this.$refs.itemImport._open(this.sampleId)
this.$Message.warning('请至少选中一条样品数据!')
} else {
this.$refs.refModal._open(
this.selectIds,
this.selectData[0],
this.selectData
)
}
}, },
// 导入检测项目包 // 导入检测项目包
_importItemPackage() { _importItemPackage() {
......
...@@ -123,6 +123,7 @@ export default { ...@@ -123,6 +123,7 @@ export default {
{ title: '试样编号', key: 'sampleCode', width: 100, fixed: 'left' }, { title: '试样编号', key: 'sampleCode', width: 100, fixed: 'left' },
{ title: '试样深度', key: 'sampleDepth', width: 100 }, { title: '试样深度', key: 'sampleDepth', width: 100 },
{ title: '现场编号', key: 'siteNo', width: 100 }, { title: '现场编号', key: 'siteNo', width: 100 },
{ title: '试验项目', key: 'experimentNames', width: 100 },
{ title: '土质描述', key: 'sampleDescribe', width: 160 }, { title: '土质描述', key: 'sampleDescribe', width: 160 },
{ title: '土质描述详情', key: 'describeDetail', width: 160 }, { title: '土质描述详情', key: 'describeDetail', width: 160 },
{ title: '样品包装类型', key: 'samplePack', width: 120 } { title: '样品包装类型', key: 'samplePack', width: 120 }
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</Form-item> </Form-item>
<Form-item label="备样人:"> <Form-item label="备样人:">
<el-select :value="formObj.backupUser" @change="selUser" style="width:100%" size="small"> <el-select :value="formObj.backupUser" @change="selUser" style="width:100%" size="small">
<el-option v-for="item in backupUserList" :value="item.id" :label="item.realname" :key="item.realname">{{ item.realname }} <el-option v-for="item in backupUserList" :value="item.id" :label="item.realname" :key="item.id">{{ item.realname }}
</el-option> </el-option>
</el-select> </el-select>
</Form-item> </Form-item>
......
...@@ -135,30 +135,10 @@ export default { ...@@ -135,30 +135,10 @@ export default {
type: 'primary', type: 'primary',
id: '', id: '',
name: '批量填写存放信息' name: '批量填写存放信息'
}, }
{
type: 'primary',
id: 'food-sample-preparation-his-all',
name: '制备'
},
{
type: 'primary',
id: 'food-sample-preparation-his-no-pre',
name: '无需制备'
},
{
type: 'primary',
id: 'food-sample-preparation-his-scan-pre',
name: '扫码制备'
},
// { type: '', id: '', name: '填写存放信息' }, // { type: '', id: '', name: '填写存放信息' },
// { type: '', id: '', name: '申请处理' }, // { type: '', id: '', name: '申请处理' },
// { type: '', id: '', name: '导出' }, // { type: '', id: '', name: '导出' },
{
type: '',
id: 'food-sample-prepare-record-export',
name: '导出备样记录'
}
], ],
iconMsg: [ iconMsg: [
{ type: 'md-create', id: '', name: '编辑' }, // food-sample-prepare-edit { type: 'md-create', id: '', name: '编辑' }, // food-sample-prepare-edit
......
...@@ -67,11 +67,6 @@ export default { ...@@ -67,11 +67,6 @@ export default {
}, },
btn: [ btn: [
// { type: '', id: '', name: '导出' }, // { type: '', id: '', name: '导出' },
{
type: '',
id: 'food-sample-handle-already-export-sample-store',
name: '导出样品贮存表'
}
], ],
iconMsg: [ iconMsg: [
{ {
......
<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">
<SampleBackupsManage ref="waitTabs"></SampleBackupsManage>
</el-tab-pane>
<el-tab-pane label="副样查询" name="query">
<SampleBackupsQuery ref="queryTabs"></SampleBackupsQuery>
</el-tab-pane>
</el-tabs>
</div>
</div>
</div>
</template>
<script>
import SampleBackupsManage from './tab/SampleduplicateManage'
import SampleBackupsQuery from './tab/SampleduplicateQuery'
export default {
components: {
SampleBackupsManage,
SampleBackupsQuery
},
data() {
return {
activeName: 'wait'
}
},
mounted() {
this.activeName = 'wait'
this.$refs.waitTabs._page()
},
methods: {
_changeTabs(tab, event) {
if (tab.name === 'wait') {
this.$refs.waitTabs._page()
} else if (tab.name === 'applyRecord') {
// this.$refs.applyRecordTabs._page()
} else {
this.$refs.queryTabs._page()
}
}
}
}
</script>
<template>
<div>
<Modal v-model="showModalHandleApply" :mask-closable="false" width="500">
<p slot="header">处理申请</p>
<div>
<Form ref="formObj" :id="formId" :model="formObj" :rules="ruleValidate" :label-width="90" inline>
<Form-item label="申请日期:" prop="applyHandleTime" style="width:100%">
<Date-picker v-model="formObj.applyHandleTime" :editable="false" name="applyHandleTime"
type="date" placeholder="请选择申请日期" style="width: 100%;"
></Date-picker>
</Form-item>
<Form-item label="申请人:" prop="applyHandler" style="width:100%">
<Input v-model="formObj.applyHandler" @click.native="_selectPerson()" name="applyHandler" readonly></Input>
</Form-item>
<Form-item label="处理方式:" style="width:100%">
<el-select v-model="formObj.handleWay" name="handleWay" placeholder="请选择"
size="small"
style="width:100%"
clearable>
<el-option
v-for="item in handleWayList"
:key="item.name"
:label="item.name"
:value="item.name">
</el-option>
</el-select>
</Form-item>
<Form-item label="处理原因" prop="applyRemark" style="width:100%">
<Input :rows="3" v-model="formObj.applyRemark" placeholder="请输入处理原因" type="textarea" name="applyRemark"/>
</Form-item>
</Form>
</div>
<div slot="footer">
<modal-footer ref="footerModal" @on-result-change="_footerResult" :footer="footerList"></modal-footer>
</div>
</Modal>
<AssignPerson ref="personModal" @on-result-change="_assignBackData"></AssignPerson>
</div>
</template>
<script>
import Global from '../../../api/config'
import AssignPerson from '../../../components/user-info-single/assignPerson'
import { soilSample } from '../../../api'
export default {
components: { AssignPerson },
data() {
return {
lengthLimitList: [{ key: 'handleQuantity', title: '样品处理数量' }],
ids: [], // 委托ids
showModalHandleApply: false,
formObj: {
id: '',
applyHandleTime: new Date(),
applyHandler: '',
applyHandlerId: '',
handleBatch: '',
retentionTime: '',
applyRemark: '',
lmsEquipFiles: [],
handleWay: '',
handleQuantity: '',
sampleUnit: ''
},
applyId: 0,
ruleValidate: {},
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '提交', type: 'primary' }
],
visible: false,
fileAction: Global.baseURL + '/food/v1/sample_handle_apply/uploadFile',
fileData: {
id: 0,
name: ''
},
formId: '',
handleWayList: [
{
name: '到期处置'
},
{
name: '立即处置'
}
],
imgSrc: ''
}
},
mounted() {
// this._dicSearch()
this._getDisposeWay()
},
methods: {
_getDisposeWay: async function() {
const result = await soilSample.getDictList('土工处理方式')
if (result) {
this.handleWayList = result
}
},
_selectPerson() {
this.$refs.personModal._openGoup('申请人', 'itemTree')
},
_assignBackData(data) {
this.formObj.applyHandler = data.realname
this.formObj.applyHandlerId = data.id
},
// 从字典中查询类别
_dicSearch() {
this.$store.dispatch('LmsBaseDict/getItem', '样品处理方式').then(() => {
const result = this.$store.state.LmsBaseDict.item
this.handleWayList = result
})
},
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '提交':
this._ok()
break
}
},
_open(data) {
this.ids = []
this.applyId = 0
this.fileData.id = 0
this.formObj = this.$resetFields(this.formObj)
// this._getRetention(data)
// this._getSampleBatch(data)
this.$refs.footerModal._hideLoading()
this.ids = data
this.formObj.lmsEquipFiles = []
this.showModalHandleApply = true
this.formObj.applyHandler = Global.getUserInfo().realname
this.formObj.applyHandlerId = Global.getUserInfo().id
this.formId = 'handleApplyEditForm' + this.$randomCode()
this.formObj.applyHandleTime = new Date()
},
_getSampleBatch(data) {
this.formObj.handleBatch = data.length
},
// 计算存储期限
_getRetention(data) {
const handleQuantityList = []
const sampleUnitList = []
let lastTime = ''
const ids = []
for (let i = 0; i < data.length; i++) {
ids.push(data[i].id)
// 样品处理数量和单位
handleQuantityList.push(data[i].handleQuantity)
sampleUnitList.push(data[i].sampleUnit)
if (lastTime === '') {
lastTime = data[i].endDate
} else if (lastTime !== '' && lastTime < data[i].endDate) {
lastTime = data[i].endDate
}
}
this.ids = ids
this.formObj.retentionTime = this.$dateformat(lastTime, 'yyyy-mm-dd')
// 若勾选的样品处理数量、单位一样则显示
// 通过for循环来判断数组的每一元素(若有不重复的,则返回false)
this.formObj.handleQuantity =
this.$duplicates(handleQuantityList) && handleQuantityList.length > 0
? handleQuantityList[0]
: ''
this.formObj.sampleUnit =
this.$duplicates(sampleUnitList) && sampleUnitList.length > 0
? sampleUnitList[0]
: ''
},
// 附件
_handleView(data) {
const filePath = data.filePath
const index1 = filePath.lastIndexOf('.')
const index2 = filePath.length
const suffix = filePath.substring(index1 + 1, index2) // 后缀名
if (
suffix.toLowerCase() === 'png' ||
suffix.toLowerCase() === 'jpg' ||
suffix.toLowerCase() === 'jpeg'
) {
this.visible = true
this.imgSrc =
Global.baseURL +
'/food/v1/sample_handle_apply_attachment/view' +
'?id=' +
data.id +
'&objectKey=' +
data.filePath
} else {
this.$Message.warning({
content: '非图片文件无法查看,请下载查看',
duration: 3
})
this.visible = false
}
},
// 下载文件
_downloadFile(file) {
this.$Modal.confirm({
title: '提示',
content: '确定要下载?',
onOk: () => {
const url =
Global.baseURL +
'/food/v1/sample_handle_apply/downLoadFile?id=' +
file.id
window.open(url)
}
})
},
_handleSuccess(response, file, fileList) {
if (response.success) {
this.fileData.id = response.data.applyId
this.applyId = response.data.applyId
this.$Message.success('上传成功!')
this.formObj.lmsEquipFiles.push(response.data)
} else {
this.$Message.error('上传失败!')
}
},
_handleBeforeUpload(file) {},
// 删除文件
_handleRemove(file) {
this.$Modal.confirm({
title: '提示',
content: '确定删除文件?',
onOk: () => {
const fileList = this.formObj.lmsEquipFiles
this.$store
.dispatch('FoodSampleHandleApplyAttachment/deleteByIds', file.id)
.then(() => {
if (this.$store.state.FoodSampleHandleApplyAttachment.success) {
this.formObj.lmsEquipFiles.splice(fileList.indexOf(file), 1)
this.$Message.success('删除成功!')
}
})
}
})
},
_ok() {
this.$refs.formObj.validate(valid => {
if (valid) {
this.$refs.footerModal._hideLoading()
const data = this.$serialize(this.formId)
data.applyHandlerId = this.formObj.applyHandlerId
data.ids = this.ids.join(',')
this._submitDispose(data)
// data.handleBatch = this.formObj.handleBatch
// data.id = this.applyId
// data.handleWay = this.formObj.handleWay
// data.applyHandler = this.formObj.applyHandler
// data.handleQuantity = this.formObj.handleQuantity
// // let returnData = {ids: this.ids, obj: data};
// this.$extend(data, { backupIds: this.ids.join(',') })
// if (this.$lengthLimitVal(this.lengthLimitList, data) === false) {
// this._hideLoading()
// return
// }
// this.$store
// .dispatch('FoodSampleHandleApply/handleApplySubmit', data)
// .then(() => {
// if (this.$store.state.FoodSampleHandleApply.success) {
// this._cancel()
// this.$Message.success('提交成功')
// this.$emit('on-result-change')
// } else {
// this.$refs.footerModal._hideLoading()
// }
// })
} else {
this.$Message.error('表单验证失败!')
this.$refs.footerModal._hideLoading()
}
})
},
_submitDispose: async function(data) {
const result = await soilSample.surplusApplyHandle(data)
if (result) {
this._resultChange('提交成功')
}
},
_resultChange(msg) {
this.$Message.success(msg)
this.showModalHandleApply = false
this.$emit('on-result-change')
},
_cancel() {
this.showModalHandleApply = false
this.$refs.footerModal._hideLoading()
}
}
}
</script>
<style scoped>
.file-upload-list {
display: inline-block;
width: 100px;
height: 100px;
text-align: center;
line-height: 100px;
border: 1px solid transparent;
border-radius: 4px;
overflow: hidden;
background: #fff;
position: relative;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
margin-right: 4px;
}
.file-upload-list i {
color: #fff;
font-size: 20px;
cursor: pointer;
margin: 0 2px;
}
.file-upload-list-cover {
display: none;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(0, 0, 0, 0.6);
}
.file-upload-list:hover .file-upload-list-cover {
display: block;
}
</style>
<template>
<div>
<!--内容-->
<div class="layout-content-padding">
<div class="layout-content-main">
<Row>
<!--查询-->
<Col span="24">
<Form id="search-form" :label-width="80" v-show="searchOpen" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="委托编号:">
<Input @on-enter="_formSearch" v-model="formObj.entrustCode" name="entrustCode" placeholder="请输入样品编号" clearable/>
</Form-item>
<Form-item class="search-item" label="试样编号:">
<Input @on-enter="_formSearch" v-model="formObj.sampleCode" name="sampleCode" placeholder="请输入样品名称" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" @on-result-change="_btnClick" :showSearchBtn="true"
class="contHide">
</btn-list>
</Col>
<!--样品数量-->
<!-- 表格 -->
<Col span="24">
<PTVXETableHeight ref="pageTable" :table-height="tableHeight" :loading="true"
:get-page="getPage" @on-result-change="_tableResultChange" select-data>
<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>
<div v-else-if="item.key==='keepContainer'">
<div v-if="editIndex!==scope.rowIndex">{{scope.row[item.key]}}</div>
<div v-else>
<el-select v-model="scope.row.keepContainer" clearable style="width:100%" size="small">
<el-option v-for="item in containerList" :value="item.name" :key="item.name">{{ item.name }}
</el-option>
</el-select>
</div>
</div>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
<vxe-table-column
slot="col"
:width="80"
title="操作"
align="center"
fixed="right">
<template slot-scope="scope">
<VXEIconList :msg="editIndex===scope.rowIndex?iconMsgSave:iconMsg" @on-result-change="_iconClick" :rowData="scope.row" :rowIndex="scope.rowIndex"></VXEIconList>
</template>
</vxe-table-column>
</PTVXETableHeight>
</Col>
</Row>
</div>
</div>
<SampleParpareApply ref="applyModal" @on-result-change="_page"></SampleParpareApply>
<Operation ref="recordModal"></Operation>
</div>
</template>
<script>
import SampleParpareApply from '../SurplusduplicateApply'
// eslint-disable-next-line no-unused-vars
import http from '../../../../api/http'
import { soilSample } from '../../../../api'
import Operation from '../../../../components/operation/Operation'
export default {
components: {
SampleParpareApply,
Operation
},
data() {
return {
currentComponent: '',
searchOpen: false,
formObj: {},
selectData: [],
selectIds: [],
indexList: [],
selectSampleIds: [],
getPage: {},
btn: [
{
type: 'primary',
id: '',
name: '申请处理'
},
{
type: 'primary',
id: '',
name: '完成处理'
}
// { type: '', id: '', name: '填写存放信息' },
// { type: '', id: '', name: '申请处理' },
// { type: '', id: '', name: '导出' },
],
iconMsg: [
{ type: 'md-create', id: '', name: '编辑' }, // food-sample-prepare-edit
{ type: 'ios-clock', id: '', name: '操作日志' }
],
iconMsgSave: [{ type: 'ios-checkmark', id: '', name: '保存' }],
pageColumns: [
{ title: '试样编号', key: 'sampleCode', width: 150 },
{ title: '状态', key: 'status', status: true, width: 100 },
{ title: '包装类型', key: 'samplePack', width: 100 },
{ title: '保存容器', key: 'keepContainer', width: 150 },
{ title: '制备数量', key: 'quantity', width: 100 },
{ title: '单位', key: 'unit', width: 70 },
{ title: '制备人', key: 'preparer', width: 130 },
{ title: '制备时间', key: 'prepareDate', date: true, width: 130 }
// { title: '备注', key: 'remark', width: 130 }
/* {title: '处置方式', key: 'handleMethod', width: 120,}, */
],
conditionList: [],
locList: [],
containerList: [],
currentIndex: -1,
editIndex: -1,
endDateBegin: '',
endDateEnd: '',
contList: [
{ key: 'backupCount', name: '今日新增数量', value: 0 },
{
key: 'backupCountOver',
name: '超期数量',
value: 0,
color: 'red-color'
},
{
key: 'backupCountWarn',
name: '预警数量',
value: 0,
color: 'warning-color'
}
],
// 只看预警和超期样品
warnAndOver: 0,
sampleHandleValue: '',
issueDateBegin: '',
issueDateEnd: '',
isEligible: ''
}
},
computed: {
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('', 255)
} else {
return this.$tableHeight('', 220)
}
},
colorComputed() {
return function(date) {
if (this.$warningValue(date) < 0) {
return '#eb6877' // 红色
} else if (
this.$warningValue(date) >= 0 &&
this.$warningValue(date) <= this.sampleHandleValue
) {
return '#f90' // 橙色
}
}
}
},
mounted() {
this.$refs.pageTable._showLoading()
// 样品存储期限预警
// this.sampleHandleValue = Number(localStorage.getItem('sampleHandleValue'))
// this._getLocList()
// this._getConditionList()
// this._getBackUpCount()
this._getContainerList()
},
methods: {
// 签发日期
_issueDateChange(date) {
this.issueDateBegin = date[0]
this.issueDateEnd = date[1]
},
// 重新请求page以及备样数量
_relPage() {
this._page()
// this._getBackUpCount()
},
_getContainerList: async function() {
const result = await soilSample.getDictList('保存容器')
if (result) {
this.containerList = result
}
},
// 查询卡片备样数量
_getBackUpCount() {
this.$store.dispatch('FoodSampleBackup/backUpCount').then(() => {
const result = this.$store.state.FoodSampleBackup.model
const length = this.contList.length
for (let i = 0; i < length; i++) {
this.$set(this.contList[i], 'value', result[this.contList[i].key])
}
})
},
// 选择时间
_endDateChange(data) {
this.getPage.records[this.currentIndex].endDate = data
},
// 查询-接收日期
_dateChange(data) {
this.endDateBegin = data[0]
this.endDateEnd = data[1]
},
_save() {
this.$nextTick(function() {
const tempData = {
keepContainer: this.getPage.records[this.currentIndex].keepContainer
}
this._saveOk({
id: this.getPage.records[this.currentIndex].id,
obj: tempData
})
})
},
_saveOk: async function(data) {
console.log(data)
const result = await soilSample.editPrepare(data)
if (result) {
this.$Message.success('编辑成功')
}
},
_iconClick(res, data, componentName, index) {
this.currentIndex = index
switch (res) {
case '操作日志':
this._record(data.id)
break
case '编辑':
this.editIndex = index
break
case '保存':
console.log('保存')
// if (data.endDate !== '') {
// // 非空情况下格式化赋值,如果不判断会格式化为当天的日期
// this._endDateChange(this.$dateformat(data.endDate, 'yyyy-mm-dd'))
// }
this._save()
this.editIndex = -1
break
}
},
_record(id) {
this.$refs.recordModal._openSurplus(id)
},
_locChange(msg, data) {
switch (msg) {
case 'select':
this.getPage.records[this.currentIndex].backupPlace = data.backupPlace
break
case 'query':
this.getPage.records[this.currentIndex].backupPlace = data.backupPlace
this._getLocList(data.backupPlace)
break
case 'focus':
this._getLocList()
break
}
},
_getLocList(data) {
const obj = {}
if (data) {
obj.backupPlace = data
}
this.$store.dispatch('FoodSampleBackup/getPositionList', obj).then(() => {
this.locList = this.$store.state.FoodSampleBackup.list
})
},
_getConditionList() {
this.$store.dispatch('LmsBaseDict/getItem', '保存方式').then(() => {
this.conditionList = this.$store.state.LmsBaseDict.item
})
},
_exportReceiveRecord() {
// 导出备样记录
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条数据!')
} else {
const obj = {
param: 'ids',
ids: this.selectIds,
url: ''
}
this.$store
.dispatch('ReportExport/getById', 'food-sample-prepare-record-export')
.then(() => {
const result = this.$store.state.ReportExport.model
obj.url = result
this.$exportByQuery(obj)
})
}
},
// 操作的序号
_handleIndex(data) {
this.currentIndex = data.rowIndex
},
_btnClick(msg) {
switch (msg) {
case '申请处理':
this._applyDispose()
break
case '完成处理':
this._handleApply()
break
case '制备':
this._preMethod()
break
case '无需制备':
this._noPreMethod()
break
case '扫码制备':
this._scanPreMethod()
break
case '填写存放信息':
this._batchEdit()
break
case '导出':
if (this.getPage.records.length === 0) {
this.$Message.warning('暂无数据,不可导出')
} else {
this._export()
}
break
case '导出备样记录':
this._exportReceiveRecord()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
},
_resultChange(msg) {
this.$Message.success(msg)
this._page()
},
_applyDispose() {
if (this.selectIds.length === 0) {
this.$Message.warning('请选择一条或多条数据!')
} else {
this.$refs.applyModal._open(this.selectIds)
}
},
_handleApply() {
if (this.selectIds.length === 0) {
this.$Message.warning('请选择一条或多条数据!')
} else {
console.log(this.selectData)
const errorIds = []
for (let i = 0; i < this.selectIds.length; i++) {
if (this.selectData[i].status.display !== '处理审批通过') {
errorIds.push(this.selectData[i].index + 1)
}
}
if (errorIds.length === 0) {
this.$Modal.confirm({
title: '提示',
content: '确定处理这 ' + this.selectIds.length + ' 条数据?',
onOk: () => {
this._handleOk(this.selectIds.join(','))
}
})
} else {
this.$Message.warning('第 ' + errorIds + ' 条数据的审批未通过')
}
}
},
_handleOk: async function() {
const result = await soilSample.surplusHandleOk(this.selectIds.join(','))
if (result) {
this._resultChange('提交成功')
}
},
// 制备
_preMethod() {
if (this.selectSampleIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.$refs.preModal._open(this.selectSampleIds)
}
},
// 无需制备
_noPreMethod() {
if (this.selectSampleIds.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
this.$refs.noPreModal._open(this.selectSampleIds)
}
},
_scanPreMethod() {
this.$refs.scanPreModal._open()
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.getPage.records = []
this.getPage = {
total: this.$store.state.LmsFoodSamplePrepare.page.total,
pages: this.$store.state.LmsFoodSamplePrepare.page.pages,
current: this.$store.state.LmsFoodSamplePrepare.page.current,
size: this.$store.state.LmsFoodSamplePrepare.page.size,
records: []
}
const tableList = this.$store.state.LmsFoodSamplePrepare.page.records
for (let i = 0; i < tableList.length; i++) {
this.getPage.records.push({
sampleId:
tableList[i].sampleId !== undefined
? tableList[i].sampleId
: '',
sampleSn:
tableList[i].sampleSn !== undefined
? tableList[i].sampleSn
: '',
sampleName:
tableList[i].sampleName !== undefined
? tableList[i].sampleName
: '',
backupPlace:
tableList[i].backupPlace !== undefined
? tableList[i].backupPlace
: '',
cname: tableList[i].cname !== undefined ? tableList[i].cname : '',
storageCondition:
tableList[i].storageCondition !== undefined
? tableList[i].storageCondition
: '',
quantity:
tableList[i].quantity !== undefined
? tableList[i].quantity
: '',
sampleQuantity:
tableList[i].sampleQuantity !== undefined
? tableList[i].sampleQuantity
: '',
handleQuantity:
tableList[i].handleQuantity !== undefined
? tableList[i].handleQuantity
: '',
sampleUnit:
tableList[i].sampleUnit !== undefined
? tableList[i].sampleUnit
: '',
endDate:
tableList[i].endDate !== undefined
? new Date(tableList[i].endDate)
: '',
handleMethod:
tableList[i].handleMethod !== undefined
? tableList[i].handleMethod
: '',
id: tableList[i].id !== undefined ? tableList[i].id : '',
contractName:
tableList[i].contractName !== undefined
? tableList[i].contractName
: '',
code: tableList[i].code !== undefined ? tableList[i].code : '',
contractSn:
tableList[i].contractSn !== undefined
? tableList[i].contractSn
: '',
progress:
tableList[i].progress !== undefined
? tableList[i].progress
: '',
type: tableList[i].type !== undefined ? tableList[i].type : '',
issueDate:
tableList[i].issueDate !== undefined
? tableList[i].issueDate
: '',
sampleRemark:
tableList[i].sampleRemark !== undefined
? tableList[i].sampleRemark
: '',
contractRemark:
tableList[i].contractRemark !== undefined
? tableList[i].contractRemark
: '',
isEligible:
tableList[i].isEligible !== undefined
? tableList[i].isEligible
: '',
remark:
tableList[i].remark !== undefined ? tableList[i].remark : '',
contractId:
tableList[i].contractId !== undefined
? tableList[i].contractId
: ''
})
}
this.selectIds = []
this.selectData = []
this.selectSampleIds = []
break
case 'selectData':
this.selectData = data
this.selectIds = []
this.selectSampleIds = []
for (let i = 0; i < data.length; i++) {
this.selectIds.push(data[i].id)
this.selectSampleIds.push(data[i].sampleId)
}
break
case 'changeSize':
this._page()
break
}
},
allSelect(data) {
this.indexList = []
for (let i = 0; i < data.length; i++) {
this.indexList.push(data[i])
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
// this._getBackUpCount()
},
_page: async function() {
this.editIndex = -1
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await soilSample.pageSecondary(
this.$serializeForm(this.formObj)
)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_batchEdit() {
if (this.selectIds.length === 0) {
this.$Message.warning('请选择一条或多条数据!')
} else {
this.$refs.editModal._open(this.selectData)
}
},
_handle() {
if (this.selectIds.length === 0) {
this.$Message.warning('请选择一条或多条数据!')
} else {
this.$refs.applyModal._open(this.selectData)
}
},
// 委托详情
_detailModal(data) {
// 查看
this.$store.dispatch('FoodContract/getById', data.contractId).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)
})
})
},
// 样品详情
_sampleDetailModal(data) {
if (data.type === 1) {
// 政府
this.currentComponent = 'FoodSampleGovernDetail'
this.$nextTick(() => {
this.$store
.dispatch('FoodSample/getByGovernId', data.sampleId)
.then(() => {
this.$refs.refModal._open(
this.$store.state.FoodSample.governModel
)
})
})
} else {
this.currentComponent = 'FoodSampleCompanyDetail'
this.$nextTick(() => {
this.$store
.dispatch('FoodSample/getByCompanyId', data.sampleId)
.then(() => {
this.$refs.refModal._open(
this.$store.state.FoodSample.companyModel
)
})
})
}
},
/** *********************************导出-begin*********************************************/
_export() {
let result = []
if (this.selectData.length === 0) {
// 导出全部数据
this.$store
.dispatch('LmsFoodSamplePrepare/page', this._searchParams())
.then(() => {
result = this.$store.state.LmsFoodSamplePrepare.page.records
this.$Modal.confirm({
title: '提示',
content:
this.selectData.length === 0
? '确定导出全部数据(最多导出5000条)?'
: '确定导出这' + result.length + ' 条数据?',
onOk: () => {
this.$exportExcel(
'samplePreManage',
'备样记录',
this.pageColumns,
result
)
}
})
})
} else {
// 只导出选中的数据
result = this.selectData
this.$Modal.confirm({
title: '提示',
content:
this.selectData.length === 0
? '确定导出全部数据(最多导出5000条)?'
: '确定导出这' + result.length + ' 条数据?',
onOk: () => {
this.$exportExcel(
'samplePreManage',
'备样记录',
this.pageColumns,
result
)
}
})
}
},
// 参数
_searchParams() {
const data = this.$serialize('search-form')
return this.$extend(data, { page: 1, rows: 5000 })
}
/** *********************************导出样品台账-end*********************************************/
}
}
</script>
<style scoped>
/******副样、备样卡片********/
.reimbursement-item {
flex: 1;
border-radius: 5px;
border: 1px solid #e8e8e8;
padding-bottom: 10px;
}
.reimbursement-item + .reimbursement-item {
margin-left: 20px;
}
.reimbursement-item p {
text-align: center;
margin: 0;
}
.reimbursement-item > p:first-child {
font-size: 22px;
line-height: 40px;
}
</style>
<template>
<div>
<!--内容-->
<div class="layout-content-padding">
<div class="layout-content-main">
<Row>
<!--查询-->
<Col span="24">
<Form id="search-form-query" :label-width="80" v-show="searchOpen" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="试样编号:">
<Input @on-enter="_formSearch" v-model="formObj.sampleCode" name="sampleCode" placeholder="请输入委托名称" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" @on-result-change="_btnClick" :showSearchBtn="true"
class="contHide"></btn-list>
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETableHeight ref="pageTable" :table-height="tableHeight" :loading="true"
:get-page="getPage" @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>
<vxe-table-column
slot="col"
:width="80"
title="操作"
align="center"
fixed="right">
<template slot-scope="scope">
<VXEIconList :msg="editIndex===scope.rowIndex?iconMsgSave:iconMsg" @on-result-change="_iconClick" :rowData="scope.row" :rowIndex="scope.rowIndex"></VXEIconList>
</template>
</vxe-table-column>
</PTVXETableHeight>
</Col>
</Row>
</div>
</div>
<Operation ref="recordModal"></Operation>
</div>
</template>
<script>
import { soilSample } from '../../../../api'
import Operation from '../../../../components/operation/Operation'
export default {
components: { Operation },
data() {
return {
currentComponent: '',
selectIds: [],
formObj: {
client: '',
entrustCode: '',
sampleCode: ''
},
iconMsg: [
{
type: 'ios-clock',
id: '',
name: '操作日志'
}
],
btn: [
// { type: '', id: '', name: '导出' },
],
pageColumns: [
{ title: '试样编号', key: 'sampleCode', width: 150 },
{ title: '状态', key: 'status', status: true, width: 100 },
{ title: '包装类型', key: 'samplePack', width: 100 },
{ title: '保存容器', key: 'keepContainer', width: 100 },
{ title: '制备数量', key: 'quantity', width: 100 },
{ title: '单位', key: 'unit', width: 70 },
{ title: '制备人', key: 'preparer', width: 130 },
{ title: '制备时间', key: 'prepareDate', date: true, width: 130 }
],
searchOpen: false,
getPage: {},
selectData: [],
endDateBegin: '',
endDateEnd: ''
}
},
computed: {
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('', 255)
} else {
return this.$tableHeight('', 220)
}
}
},
methods: {
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await soilSample.pageSecondaryHis(
this.$serializeForm(this.formObj)
)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.selectIds = []
this.getPage = this.$store.state.FoodSampleBackup.page
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
case 'selectData':
this.selectData = data
this.selectIds = []
for (let i = 0; i < data.length; i++) {
this.selectIds.push(data[i].id)
}
break
case 'changeSize':
this._page()
break
// default :
// this._page();
}
},
_iconClick(res, data, componentName, index) {
this.currentIndex = index
switch (res) {
case '操作日志':
this._record(data.id)
break
default:
this._page()
}
},
_record(id) {
this.$refs.recordModal._openSurplus(id)
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_dateChange(data) {
this.endDateBegin = data[0]
this.endDateEnd = data[1]
},
_btnClick(msg) {
switch (msg) {
case '导出':
if (this.getPage.records.length === 0) {
this.$Message.warning('暂无数据,不可导出')
} else {
this._export()
}
break
case '导出样品贮存表':
this._exportSampleStore()
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
},
_exportSampleStore() {
const obj = {
param: 'ids',
ids: this.selectIds,
url: '',
queryObj: this.$serialize('search-form-query')
}
this.$store
.dispatch(
'ReportExport/getById',
'food-sample-handle-already-export-sample-store'
)
.then(() => {
const result = this.$store.state.ReportExport.model
obj.url = result
this.$exportByQuery(obj)
})
},
// 样品详情
_sampleDetailModal(data) {
if (data.type === 1) {
// 政府
this.currentComponent = 'FoodSampleGovernDetail'
this.$nextTick(() => {
this.$store
.dispatch('FoodSample/getByGovernId', data.sampleId)
.then(() => {
this.$refs.refModal._open(
this.$store.state.FoodSample.governModel
)
})
})
} else {
this.currentComponent = 'FoodSampleCompanyDetail'
this.$nextTick(() => {
this.$store
.dispatch('FoodSample/getByCompanyId', data.sampleId)
.then(() => {
this.$refs.refModal._open(
this.$store.state.FoodSample.companyModel
)
})
})
}
},
/** *********************************导出-begin*********************************************/
_export() {
let result = []
if (this.selectData.length === 0) {
// 导出全部数据
this.$store
.dispatch('FoodSampleBackup/perSampleQuery', this._searchParams())
.then(() => {
result = this.$store.state.FoodSampleBackup.page.records
this.$Modal.confirm({
title: '提示',
content:
this.selectData.length === 0
? '确定导出全部数据(最多导出5000条)?'
: '确定导出这' + result.length + ' 条数据?',
onOk: () => {
this.$exportExcel(
'perSampleQuery',
'样品处理',
this.pageColumns,
result
)
}
})
})
} else {
// 只导出选中的数据
result = this.selectData
this.$Modal.confirm({
title: '提示',
content:
this.selectData.length === 0
? '确定导出全部数据(最多导出5000条)?'
: '确定导出这' + result.length + ' 条数据?',
onOk: () => {
this.$exportExcel(
'perSampleQuery',
'样品处理',
this.pageColumns,
result
)
}
})
}
},
// 参数
_searchParams() {
const data = this.$serialize('search-form-query')
return this.$extend(data, { page: 1, rows: 5000 })
}
/** *********************************导出样品台账-end*********************************************/
}
}
</script>
<template>
<div>
<!--内容-->
<div class="layout-content-padding">
<div class="layout-content-main">
<Row>
<Col span="24" class="margin-top-10">
<!--搜索表单-->
<Form id="search-form" :label-width="90" v-show="searchOpen" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="委托编号:">
<Input @on-enter="_formSearch" v-model="formObj.entrustCode" name="entrustCode" placeholder="请输入委托编号" clearable/>
</Form-item>
<Form-item class="search-item" label="试样编号:">
<Input @on-enter="_formSearch" v-model="formObj.sampleCode" name="sampleCode" placeholder="请输入试样编号" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" :showSearchBtn="true" @on-result-change="_btnClick"
class="contHide"></btn-list>
</Col>
<!--表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :tableHeight="tableHeight"
@on-result-change="_tableResultChange" :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" sortable>
<template slot-scope="scope">
<div v-if="item.key==='status'">{{scope.row[item.key]===0?'现行':scope.row[item.key]===1?'即将实施':
scope.row[item.key]===2?'部分被代替':scope.row[item.key]===3?'被代替':scope.row[item.key]===4?'作废':''}}
</div>
<span v-else-if="item.status">{{scope.row[item.key].display}}</span>
<div v-else-if="item.key==='classify'">
{{scope.row[item.key]===0?'判定依据':scope.row[item.key]===1?'检测依据':scope.row[item.key]===2?'其他':''}}
</div>
<div v-else-if="item.key==='type'">
{{scope.row[item.key]===0?'国家标准':scope.row[item.key]===1?'地方标准':scope.row[item.key]===2?'行业标准':scope.row[item.key]===3?'企业标准': ''}}
</div>
<div v-else-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}
</div>
<div v-else-if="item.key==='fileUrl'">
<span v-if="scope.row['fileUrl']" class="green-color"></span>
<span v-else class="red-color"></span>
</div>
<div v-else>{{scope.row[item.key]}}</div>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
</div>
<!--组件加载-->
<ViewSample ref="viewSample"></ViewSample>
<StandardsManageEdit ref="editModal" @on-result-change="_page"></StandardsManageEdit>
<DownloadTemplateImport ref="importModal" @on-result-change="_page"></DownloadTemplateImport>
<!-- <component ref="refModal" :is="currentComponent" @on-result-change="_page"></component>-->
</div>
</template>
<script>
import http from '../../../api/http'
import { soilSample } from '../../../api'
import global from '../../../api/config'
import DownloadTemplateImport from '../../../components/import/DownloadTemplateImport' // 导入
import StandardsManageEdit from './AddressManageEdit' // 添加、编辑
import ViewSample from './ViewSample'
export default {
components: {
StandardsManageEdit,
DownloadTemplateImport,
ViewSample
},
data() {
return {
currentComponent: '',
formObj: {
entrustCode: undefined,
sampleCode: undefined,
name: undefined
},
btn: [
// {
// type: 'success',
// id: '',
// name: '添加',
// componentName: 'StandardsManageEdit'
// },
// { type: 'error', id: '', name: '删除' }
// { id: '', name: '导入', componentName: 'DownloadTemplateImport' },
// { id: '', name: '导出' }
],
// 表格
pageColumns: [
{ title: '委托商', key: 'client', width: 200 },
{ title: '委托编号', key: 'entrustCode', width: 120 },
{ title: '试样编号', key: 'sampleCode', width: 100 },
{ title: '试样深度', key: 'sampleDepth', width: 95 },
{ title: '现场编号', key: 'siteNo', width: 100 },
{ title: '接收人', key: 'receiver', width: 120 },
{ title: '接收时间', key: 'receiveTime', width: 140, date: true },
{ title: '收样存储位置', key: 'receiveLocation', width: 140 },
{ title: '土质描述', key: 'sampleDescribe', width: 185 },
{ title: '样品包装类型', key: 'samplePack', width: 120 }
],
// 操作
iconMsg: [
{
type: 'md-create',
id: '',
name: '编辑',
componentName: 'StandardsManageEdit'
},
{
type: 'md-apps',
id: '',
name: '查看试样'
},
{ type: 'md-remove-circle', id: '', name: '删除' }
],
searchOpen: true,
getPage: {},
// 选中的内容
selectIds: [],
statusList: [
{ value: 0, name: '现行' },
{ value: 1, name: '即将实施' },
{ value: 2, name: '部分被代替' },
{ value: 3, name: '被代替' },
{ value: 4, name: '作废' }
],
classifyList: [
{ value: 0, name: '判定标准' },
{ value: 1, name: '检测依据' },
{ value: 2, name: '其他' }
],
typeList: [
{ value: 0, name: '国家标准' },
{ value: 1, name: '地方标准' },
{ value: 2, name: '行业标准' },
{ value: 3, name: '企业标准' }
]
}
},
computed: {
// 表格的高度
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('search')
} else {
return this.$tableHeight('noSearch')
}
}
},
mounted() {
this._page()
},
methods: {
// 操作按钮
_btnClick(msg, currentComponent) {
this.currentComponent = currentComponent
switch (msg) {
case '添加':
this.$nextTick(() => {
this._editModal(false)
})
break
case '删除':
this._deleteSelected()
break
case '导入':
this.$nextTick(() => {
this._import()
})
break
case '导出':
// this._export()
break
// 收起搜索
case 'search':
this.searchOpen = !this.searchOpen
break
}
},
// 表格中操作
_iconClick(res, data, currentComponent) {
this.currentComponent = currentComponent
this.$nextTick(() => {
switch (res) {
case '编辑':
this._editModal(true, data.id)
break
case '查看试样':
this._viewSample(data.name)
break
case '上传':
this._upload(data.id)
break
case '下载':
this._download(data)
break
case '预览':
this._viewReport(data)
break
case '查看替代关系':
this.$refs.relationModal._open(data.id)
break
case '删除':
this._deleteById(data.id)
break
}
})
},
_upload(id) {
const obj = {
importUrl: '/soil/v1/standard_annex/upload/' + id
}
this.$refs.uploadModal._open(obj)
},
_viewSample(data) {
console.log(data)
this.$refs.viewSample._openHis(data)
},
_editModal: async function(edit, id) {
if (edit) {
// 编辑
// this.$store.dispatch('StandardInfo/getById', id).then(() => {
// this.$refs.refModal._open(this.$store.state.StandardInfo.model)
// })
const result = await soilSample.locationGetById(id)
if (result) {
this.$refs.editModal._open(result)
}
} else {
// 添加
this.$refs.editModal._open()
}
},
// 获取数据
_page: async function() {
// this.$refs.pageTable._page('search-form', 'StandardInfo/page')
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilSample.pageRetain(
this.$serializeForm(this.formObj)
)
if (result) {
console.log(result)
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
// 查询
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
// 删除一条记录
_deleteById(id) {
this._deleteByIds([id])
},
// 批量删除
_deleteSelected() {
if (this.selectIds.length === 0) {
this.$Message.warning('请选择一条或多条数据!')
} else {
this._deleteByIds(
this.selectIds,
'确定删除这 ' + this.selectIds.length + ' 条记录?'
)
}
},
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
loading: true,
content: content || '确定删除该记录?',
onOk: () => {
this._delOk(ids)
}
})
},
_delOk: async function(ids) {
const result = await soilSample.locationDeleteById(ids)
if (result) {
this._page()
this.$Modal.remove()
this.$Message.success('删除成功')
}
},
// 表格内容
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this._page()
// this.getPage = this.$store.state.StandardInfo.page
break
case 'selectIds':
this.selectIds = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
case 'changeSize':
this._page()
break
}
},
// 导入
_import() {
const data = {
importUrl: '/food/v1/food_standard_info/import_standard',
downloadUrl: '/food/v1/excel/template/FoodStandardInfo',
title: '导入食品标准管理'
}
this.$refs.importModal._open(data)
},
// 导出
_export() {
const ids = this.selectIds
this._exportByIds(
ids,
ids.length === 0
? '确定导出全部记录?'
: '确定导出 ' + ids.length + ' 条记录?'
)
},
_exportByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content,
onOk: () => {
if (ids.length === 0) {
http.open('/food/v1/food_standard_info/export_standard')
} else {
http.open('/food/v1/food_standard_info/export_standard?ids=' + ids)
}
}
})
},
// 预览
_viewReport(data) {
const fileUrl = encodeURIComponent(
global.baseURL + '/soil/v1/standard_annex/preview/' + data.id
)
console.log(fileUrl)
window.open(
global.staticURL + '/pdf/PDFJS/pdfjs/web/viewer.html?file=' + fileUrl
)
},
// 下载
_download(data) {
console.log(data)
this.$Modal.confirm({
title: '提示',
content: '确定要下载文件?',
onOk: () => {
if (!data.fileUrl) {
this.$Message.error('附件未上传,请上传附件!')
return
}
window.open(
global.baseURL + '/soil/v1/standard_annex/download/' + data.id,
'_blank'
)
}
})
}
}
}
</script>
<template>
<div>
<Modal v-model="showEditModal" :mask-closable="false" :width="500" class="zIndex-1200">
<p slot="header">{{modalTitle}}</p>
<div>
<Form id="edit-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="100" inline>
<Form-item label="位置编号" prop="code" style="width: 100%">
<Input v-model="formObj.code" name="code" placeholder="请输入位置编号"/>
</Form-item>
<Form-item label="收样存储位置" prop="name" style="width: 100%">
<Input v-model="formObj.name" name="name" placeholder="请输入收样存储位置"/>
</Form-item>
<Form-item label="位置管理人" prop="manager" style="width: 100%">
<Input v-model="formObj.manager" @click.native="_selectStaff" name="manager" readonly/>
</Form-item>
<Form-item prop="managerId" style="width: 100%;display: none">
<Input v-model="formObj.managerId" @click.native="_selectStaff" name="managerId" readonly/>
</Form-item>
<Form-item label="备注说明" prop="remark" style="width: 100%">
<Input v-model="formObj.remark" name="remark" placeholder="请输入备注说明"/>
</Form-item>
</Form>
</div>
<div slot="footer">
<ModalFooter ref="footerModal" @on-result-change="_footerResult" :footer="footerList"></ModalFooter>
</div>
</Modal>
<UserInfo ref="userModal" @on-result-change="_userData" is-change></UserInfo>
</div>
</template>
<script>
/**
* 添加编辑
*/
import ModalFooter from '../../../components/base/modalFooter'
import { soilSample } from '../../../api'
import Global from '../../../api/config'
import UserInfo from '../../../components/user-info-single/assignPerson'
export default {
components: {
ModalFooter,
UserInfo
},
data() {
return {
formId: '',
lengthLimitList: [
{ key: 'stdNum', title: '标准号' },
{ key: 'enName', title: '英文名称' },
{ key: 'belongUnit', title: '归口单位' },
{ key: 'publishUnit', title: '发布单位' }
],
modalTitle: '收样位置选择',
formObj: {
name: '',
code: '',
remark: '',
manager: '',
managerId: ''
},
options: [
{
name: '国家标准'
},
{
name: '地方标准'
},
{
name: '行业标准'
},
{
name: '企业标准'
}
],
ruleValidate: {
code: [
{ required: true, message: '检测依据不能为空', trigger: 'blur' }
],
name: [
{ required: true, message: '检测依据名称不能为空', trigger: 'blur' }
]
},
showEditModal: false,
classifyList: [
{ value: 0, name: '判定依据' },
{ value: 1, name: '检测依据' },
{ value: 2, name: '其他' }
],
typeList: [
{ value: 0, name: '国家标准' },
{ value: 1, name: '地方标准' },
{ value: 2, name: '行业标准' },
{ value: 3, name: '企业标准' }
],
statusList: [
{ value: 0, name: '现行' },
{ value: 1, name: '即将实施' },
{ value: 2, name: '部分被代替' },
{ value: 3, name: '被代替' },
{ value: 4, name: '作废' }
],
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '保存', type: 'primary' }
]
}
},
methods: {
_getUser() {
const user = Global.getUserInfo()
this.formObj.manager = user.realname
this.formObj.managerId = user.id
console.log(user)
},
_selectStaff() {
this.$refs.userModal._open()
},
_userData(data, msg, contractTempData) {
console.log(data, msg)
},
/** *modal-footer */
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '保存':
this._ok()
break
}
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_resultChange(msg) {
this.showEditModal = false
this.$Message.success(msg)
this.$emit('on-result-change')
this._hideLoading()
},
_ok() {
this.$refs.formObj.validate(valid => {
if (valid) {
if (this.formObj.publishDate && this.formObj.effectDate) {
if (this.formObj.publishDate > this.formObj.effectDate) {
this.$Message.error('发布日期应早于实施日期')
this._hideLoading()
return
}
}
const data = this.$serialize('edit-form')
if (this.$string(this.formObj.id).isEmpty()) {
// 添加
this._save(data)
} else {
// 编辑
this._edit({ id: this.formObj.id, obj: data })
}
} else {
this.$Message.error('表单验证失败!')
this._hideLoading()
}
})
},
_save: async function(data) {
const result = await soilSample.locationSave(data)
if (result) {
this._resultChange('添加成功!')
}
},
_edit: async function(data) {
const result = await soilSample.locationEdit(data)
if (result) {
this._resultChange('编辑成功!')
}
},
_cancel() {
this._hideLoading()
this.showEditModal = false
},
_open(formObj) {
this.formId = this.$randomCode()
this._hideLoading()
this.$refs.formObj.resetFields()
if (this.$string(formObj).isEmpty()) {
this.modalTitle = '添加'
this.formObj.id = ''
this._getUser()
} else {
this.formObj = formObj
this.formObj.id = formObj.id
this.formObj.effectDate = this.formObj.effectDate
? new Date(formObj.effectDate)
: ''
this.formObj.publishDate = this.formObj.publishDate
? new Date(formObj.publishDate)
: ''
this.modalTitle = '编辑'
}
this.showEditModal = true
},
_registerAdd() {
this.formId = this.$randomCode()
this._hideLoading()
this.$refs.formObj.resetFields()
this.modalTitle = '添加'
this.formObj.id = ''
this.formObj.type = 3
this.showEditModal = true
}
}
}
</script>
<template>
<div>
<Modal v-model="showModal" width="980" class="modal-footer-none">
<p slot="header">
{{ modalTitle }}
</p>
<div>
<!--内容-->
<Row>
<!--查询-->
<Col span="24">
<Form id="search-sample-company" v-show="searchOpen" :label-width="80" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="试样编号:" class="search-item">
<Input v-model="formObj.sampleCode" @on-enter="_formSearch" placeholder="请输入样品编号" clearable />
</Form-item>
<Form-item class="search-btn">
<Button @click="_page" type="primary">
搜索
</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" @on-result-change="_btnClick" class="contHide" show-search-btn="true"></btn-list>
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETableHeight ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true"
:get-page="getPage" @on-result-change="_tableResultChange" select-data>
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope">
<div v-if="item.detail">
<a @click.stop="_detailModal(scope.row)">{{ scope.row[item.key] }}</a>
</div>
<div v-else-if="item.status">
{{ scope.row[item.key].display }}
</div>
<div v-else-if="item.date">
{{ scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):'' }}
</div>
<div v-else>
{{ scope.row[item.key] }}
</div>
</template>
</vxe-table-column>
</PTVXETableHeight>
</Col>
</Row>
</div>
<div slot="footer">
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult" />
</div>
</Modal>
</div>
</template>
<script>
import http from '../../../api/http'
import { soilEntrust, soilSample } from '../../../api'
import { getLodop } from '../../../plugins/clodop/LodopFuncs'
let LODOP
export default {
components: {},
data() {
return {
formId: 'soilSampleManage',
currentComponent: '',
btn: [
{
type: 'success',
id: 'ZBC',
name: '打印标签'
}
],
itemList: [],
indexList: [],
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '确定', type: 'primary' }
],
entrustId: '', // 委托id
showModal: false,
recordHis: false,
searchOpen: true,
modalTitle: '管理样品',
selectIds: [],
selectData: {},
getPage: {},
pageColumns: [
{ title: '试样编号', key: 'sampleCode', width: 100, fixed: 'left' },
{ title: '试样深度', key: 'sampleDepth', width: 100 },
{ title: '现场编号', key: 'siteNo', width: 100 },
{ title: '委托编号', key: 'entrustCode', width: 100 },
{ title: '收样位置', key: 'receiveLocation', width: 100 },
{ title: '土质描述', key: 'sampleDescribe', width: 160 },
{ title: '土质描述详情', key: 'describeDetail', width: 160 },
{ title: '样品包装类型', key: 'samplePack', width: 120 }
],
sampleId: '',
dateList: [],
formObj: {
receiveLocation: undefined,
sampleCode: undefined
}
}
},
computed: {
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('search')
} else {
return this.$tableHeight('noSearch')
}
}
},
methods: {
_inputChange: async function(info) {
const result = await soilEntrust.sampleEdit({
id: info.id,
describeDetail: info.describeDetail
})
if (result) {
this._resultChange('修改成功')
}
},
_handleRow(data) {
this.currentRow = data.row
this.currentIndex = data.rowIndex
},
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '确定':
this._ok()
break
}
},
_cancel() {
this.showModal = false
},
_ok() {
this.showModal = false
this.$refs.footerModal._hideLoading()
console.log(this.getPage)
},
_itemImportBack(data) {
if (this.selectIds === undefined || this.selectIds.length === 0) {
return false
}
if (data === undefined || data.length === 0) {
return false
}
this._importItemOk({ sampleIds: this.selectIds, drugItemList: data })
},
// _importItemOk: async function(data) {
// const result = await drugSample.importSampleItemDTO(data)
// if (result) {
// this.$Message.success('导入成功!')
// await this._page()
// }
// },
_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]
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (msg) {
case '添加':
this._editModal(false)
break
case '复制历史样品':
this._copyHisSample()
break
case '导入样品':
this._importSample()
break
case '导入检测项目':
this._importItem()
break
case '导入检测项目包':
this._importItemPackage()
break
case '打印标签':
this._printLabel()
break
case '试样制备':
this._samplePre()
break
case '批量填写土质描述详情':
this._writeDetail(this.selectIds)
break
case '复制历史样品检测项目':
this._copyHisItem()
break
case '删除':
this._deleteSelected()
break
case '导出':
this._exportSample()
break
case '添加模拟样品':
this._editImitateModal(false)
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
_samplePre() {
if (this.selectIds.length === 0) {
this.$message.warning('至少选择一条数据')
} else {
this.$refs.preModal._open(this.selectIds.join(','))
}
},
_writeDetail(id) {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
const ids = id.join(',')
this.$refs.writeDetailModal._open(ids)
}
},
_exportSample() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条样品')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定导出这' + this.selectIds.length + '条样品',
onOk: () => {
http.open(
'/food/v1/sample/company/export',
{ ids: this.selectIds.join(',') },
'_blank'
)
}
})
}
},
_copyHisSample() {
this.$refs.refModal._open(this.entrustId)
},
_iconClick(res, data, componentName, index) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (res) {
case '管理检测项目':
this._itemManage(data.id)
break
case '制备详情':
this._preEdit(data.id)
break
case '编辑':
this._editModal(true, data)
break
case '复制':
this._copy(data)
break
case '删除':
console.log(index)
this._deleteById(data.id)
break
case '附件':
this.$refs.refModal._open(data.id, 'sampleId')
break
}
})
},
_preEdit(id) {
this.$refs.preHisModal._open(id)
},
_itemManage(data) {
// 管理检测项目
if (this.recordHis) {
this.$refs.sampleItemManage._openRecord(data)
} else {
this.$refs.sampleItemManage._open(data)
}
},
_tableResultChange(msg, data) {
const selectIds = []
switch (msg) {
case 'selectData':
for (let i = 0; i < data.length; i++) {
selectIds.push(data[i].id)
}
this.selectIds = selectIds
this.selectData = data
break
case 'allSelect':
console.log('123465798', data)
this.allSelect(data)
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
case 'changeSize':
this._page()
break
}
},
allSelect(data) {
this.indexList = []
for (let i = 0; i < data.length; i++) {
this.indexList.push(data[i].index)
}
console.log('索引', this.indexList)
},
_open(id) {
this.formObj = this.$resetFields(this.formObj)
this.dateList = []
this.showModal = true
this.formObj.entrustId = id // 委托id
console.log(this.entrustId)
this.$refs.pageTable._hideLoading()
this._page()
},
_openHis(adress) {
this.formObj = this.$resetFields(this.formObj)
this.dateList = []
this.showModal = true
this.formObj.receiveLocation = adress // 委托id
this.$refs.pageTable._hideLoading()
this.recordHis = true
this._page()
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_page: async function() {
const result = await soilSample.pageLocationSample(this.formObj)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
// this.$store.dispatch('FoodSample/deleteByIds', ids).then(() => {
// this._resultChange('删除成功!')
// })
this._deleteOk(ids)
}
})
},
// _deleteOk: async function(ids) {
// const result = await drugSample.deleteById(ids)
// if (result) {
// this._resultChange('删除成功')
// }
// },
_deleteById(id) {
// 删除一条记录
this._deleteByIds([id])
},
_deleteSelected() {
// 批量删除
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请选择一条或多条数据!')
} else {
this._deleteByIds(ids, '确定删除 ' + ids.length + ' 条记录?')
}
},
_detailModal(data) {},
_editModal(edit, data) {
if (edit) {
console.log(data)
this.$refs.sampleManageEdit._open(data)
} else {
// 添加
this.$refs.refModal._open('', this.entrustId)
}
},
// 添加编辑模拟样品
_editImitateModal(edit, data) {
if (edit) {
// 模拟样品的编辑
const tempData = JSON.parse(JSON.stringify(data)) // 深拷贝
this.$refs.imitateModal._open(tempData, this.entrustId)
} else {
// 模拟样品的添加
this.$refs.imitateModal._open('', this.entrustId)
}
},
_search() {
this._page()
},
_resultChange(msg) {
this.$Message.success(msg)
this._page()
},
_copy(data) {
this.$refs.copyModal._open(data.id, data.type)
},
// 复制样品
_copySample(data) {
this.$store
.dispatch('FoodSample/getByCompanyId', data.sampleId)
.then(() => {
const result = this.$store.state.FoodSample.companyModel
if (data.type === 0) {
// 普通样品
this.currentComponent = 'FoodSampleCompanyEdit'
this.$nextTick(function() {
this.$refs.refModal._openCopySample(result)
})
} else if (data.type === 3) {
// 模拟样品
this.$refs.imitateModal._openCopySample(result)
}
})
},
_copyAll(data) {
this.$store
.dispatch('FoodSample/getByCompanyId', data.sampleId)
.then(() => {
const result = this.$store.state.FoodSample.companyModel
if (data.type === 0) {
// 普通样品
this.currentComponent = 'FoodSampleCompanyEdit'
this.$nextTick(function() {
this.$refs.refModal._openCopyAll(result)
})
} else if (data.type === 3) {
// 模拟样品
this.$refs.imitateModal._openCopyAll(result)
}
})
},
// 导入检测项目
_importItem() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
this.$refs.sampleItemModal._open()
this.$refs.pageTable.checkedData()
}
},
// 导入检测项目包
_importItemPackage() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
// this.$refs.refModal._open(this.selectIds, 'sample-rel-package-item')
this.$refs.itemPackageModal._open(
this.selectIds,
'sample-rel-package-item'
)
}
},
_printLabel() {
if (this.selectData.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
for (let m = 0; m < this.selectData.length; m++) {
const row = this.selectData[m]
this._printLabelOk(row)
}
}
},
_printLabelOk(row) {
LODOP = getLodop()
if (LODOP === 'undefined' || LODOP === undefined) {
this._pluginDownload()
return false
}
if (LODOP.GET_PRINTER_COUNT() === 0) {
this.$Messager.warning('系统未关联打印机,请确认....')
return false
}
LODOP.PRINT_INITA('0mm', '0mm', '70.01mm', '50.01mm', '样品标签打印')
LODOP.ADD_PRINT_LINE(36, 15, 35, 251, 0, 1)
LODOP.ADD_PRINT_LINE(74, 15, 73, 251, 0, 1)
LODOP.ADD_PRINT_LINE(107, 15, 106, 251, 0, 1)
LODOP.ADD_PRINT_LINE(140, 15, 139, 251, 0, 1)
LODOP.ADD_PRINT_LINE(175, 15, 174, 251, 0, 1)
LODOP.ADD_PRINT_LINE(35, 15, 174, 16, 0, 1)
LODOP.ADD_PRINT_LINE(35, 74, 174, 75, 0, 1)
LODOP.ADD_PRINT_LINE(35, 251, 174, 252, 0, 1)
LODOP.ADD_PRINT_TEXT(49, 17, 59, 20, '样品名称')
LODOP.ADD_PRINT_TEXT(82, 18, 59, 20, '样品编号')
LODOP.ADD_PRINT_TEXT(116, 17, 59, 20, '样品状态')
LODOP.ADD_PRINT_TEXT(151, 27, 39, 20, '备注')
LODOP.ADD_PRINT_TEXT(16, 95, 100, 20, '检测样品标签')
LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
LODOP.ADD_PRINT_TEXT(49, 78, 135, 20, row.name)
LODOP.ADD_PRINT_TEXT(82, 77, 136, 20, row.sampleCode)
LODOP.ADD_PRINT_TEXT(117, 76, 176, 20, '□未检 □在检 □已检 □留样')
if (row.surplus === '取回') {
LODOP.ADD_PRINT_TEXT(152, 77, 138, 20, '☑"取回 □服务方处理')
} else if (row.surplus === '服务方处理') {
LODOP.ADD_PRINT_TEXT(152, 77, 138, 20, '□取回 ☑服务方处理')
} else {
LODOP.ADD_PRINT_TEXT(152, 77, 138, 20, '□取回 □服务方处理')
}
LODOP.PRINT_DESIGN()
},
_copyHisItem() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
this.$refs.refModal._open(this.selectIds)
}
},
_operationRecord(id) {
// 操作日志
this.$refs.recordModal._open(id)
}
}
}
</script>
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<Form id="search-form" :label-width="90" v-show="searchOpen" inline onsubmit="return false"> <Form id="search-form" :label-width="90" v-show="searchOpen" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item class="search-item" label="位置编号:"> <Form-item class="search-item" label="位置编号:">
<Input @on-enter="_formSearch" v-model="formObj.code" name="code" placeholder="请输入检测依据" clearable/> <Input @on-enter="_formSearch" v-model="formObj.code" name="code" placeholder="请输入位置编号" clearable/>
</Form-item> </Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button> <Button @click="_formSearch" type="primary">搜索</Button>
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
</div> </div>
</div> </div>
<!--组件加载--> <!--组件加载-->
<ViewSample ref="viewSample"></ViewSample>
<StandardsManageEdit ref="editModal" @on-result-change="_page"></StandardsManageEdit> <StandardsManageEdit ref="editModal" @on-result-change="_page"></StandardsManageEdit>
<DownloadTemplateImport ref="importModal" @on-result-change="_page"></DownloadTemplateImport> <DownloadTemplateImport ref="importModal" @on-result-change="_page"></DownloadTemplateImport>
<!-- <component ref="refModal" :is="currentComponent" @on-result-change="_page"></component>--> <!-- <component ref="refModal" :is="currentComponent" @on-result-change="_page"></component>-->
...@@ -72,10 +73,12 @@ import { soilSample } from '../../../api' ...@@ -72,10 +73,12 @@ import { soilSample } from '../../../api'
import global from '../../../api/config' import global from '../../../api/config'
import DownloadTemplateImport from '../../../components/import/DownloadTemplateImport' // 导入 import DownloadTemplateImport from '../../../components/import/DownloadTemplateImport' // 导入
import StandardsManageEdit from './AddressManageEdit' // 添加、编辑 import StandardsManageEdit from './AddressManageEdit' // 添加、编辑
import ViewSample from './ViewSample'
export default { export default {
components: { components: {
StandardsManageEdit, StandardsManageEdit,
DownloadTemplateImport DownloadTemplateImport,
ViewSample
}, },
data() { data() {
return { return {
...@@ -116,6 +119,11 @@ export default { ...@@ -116,6 +119,11 @@ export default {
name: '编辑', name: '编辑',
componentName: 'StandardsManageEdit' componentName: 'StandardsManageEdit'
}, },
{
type: 'md-apps',
id: '',
name: '查看试样'
},
{ type: 'md-remove-circle', id: '', name: '删除' } { type: 'md-remove-circle', id: '', name: '删除' }
], ],
searchOpen: false, searchOpen: false,
...@@ -190,6 +198,9 @@ export default { ...@@ -190,6 +198,9 @@ export default {
case '编辑': case '编辑':
this._editModal(true, data.id) this._editModal(true, data.id)
break break
case '查看试样':
this._viewSample(data.name)
break
case '上传': case '上传':
this._upload(data.id) this._upload(data.id)
break break
...@@ -214,7 +225,10 @@ export default { ...@@ -214,7 +225,10 @@ export default {
} }
this.$refs.uploadModal._open(obj) this.$refs.uploadModal._open(obj)
}, },
_viewSample(data) {
console.log(data)
this.$refs.viewSample._openHis(data)
},
_editModal: async function(edit, id) { _editModal: async function(edit, id) {
if (edit) { if (edit) {
// 编辑 // 编辑
......
...@@ -51,7 +51,7 @@ export default { ...@@ -51,7 +51,7 @@ export default {
{ key: 'belongUnit', title: '归口单位' }, { key: 'belongUnit', title: '归口单位' },
{ key: 'publishUnit', title: '发布单位' } { key: 'publishUnit', title: '发布单位' }
], ],
modalTitle: '添加食品标准表', modalTitle: '收样位置选择',
formObj: { formObj: {
name: '', name: '',
code: '', code: '',
......
<template>
<div>
<Modal v-model="showModal" width="980" class="modal-footer-none">
<p slot="header">
{{ modalTitle }}
</p>
<div>
<!--内容-->
<Row>
<!--查询-->
<Col span="24">
<Form id="search-sample-company" v-show="searchOpen" :label-width="80" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="试样编号:" class="search-item">
<Input v-model="formObj.sampleCode" @on-enter="_formSearch" placeholder="请输入样品编号" clearable />
</Form-item>
<Form-item class="search-btn">
<Button @click="_page" type="primary">
搜索
</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" @on-result-change="_btnClick" class="contHide" show-search-btn="true"></btn-list>
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETableHeight ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true"
:get-page="getPage" @on-result-change="_tableResultChange" select-data>
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope">
<div v-if="item.detail">
<a @click.stop="_detailModal(scope.row)">{{ scope.row[item.key] }}</a>
</div>
<div v-else-if="item.status">
{{ scope.row[item.key].display }}
</div>
<div v-else-if="item.date">
{{ scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):'' }}
</div>
<div v-else>
{{ scope.row[item.key] }}
</div>
</template>
</vxe-table-column>
</PTVXETableHeight>
</Col>
</Row>
</div>
<div slot="footer">
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult" />
</div>
</Modal>
</div>
</template>
<script>
import http from '../../../api/http'
import { soilEntrust, soilSample } from '../../../api'
import { getLodop } from '../../../plugins/clodop/LodopFuncs'
let LODOP
export default {
components: {},
data() {
return {
formId: 'soilSampleManage',
currentComponent: '',
btn: [
{
type: 'success',
id: 'ZBC',
name: '打印标签'
}
],
itemList: [],
indexList: [],
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '确定', type: 'primary' }
],
entrustId: '', // 委托id
showModal: false,
recordHis: false,
searchOpen: true,
modalTitle: '管理样品',
selectIds: [],
selectData: {},
getPage: {},
pageColumns: [
{ title: '试样编号', key: 'sampleCode', width: 100, fixed: 'left' },
{ title: '试样深度', key: 'sampleDepth', width: 100 },
{ title: '现场编号', key: 'siteNo', width: 100 },
{ title: '委托编号', key: 'entrustCode', width: 100 },
{ title: '收样位置', key: 'receiveLocation', width: 100 },
{ title: '土质描述', key: 'sampleDescribe', width: 160 },
{ title: '土质描述详情', key: 'describeDetail', width: 160 },
{ title: '样品包装类型', key: 'samplePack', width: 120 }
],
sampleId: '',
dateList: [],
formObj: {
receiveLocation: undefined,
sampleCode: undefined
}
}
},
computed: {
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('search')
} else {
return this.$tableHeight('noSearch')
}
}
},
methods: {
_inputChange: async function(info) {
const result = await soilEntrust.sampleEdit({
id: info.id,
describeDetail: info.describeDetail
})
if (result) {
this._resultChange('修改成功')
}
},
_handleRow(data) {
this.currentRow = data.row
this.currentIndex = data.rowIndex
},
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '确定':
this._ok()
break
}
},
_cancel() {
this.showModal = false
},
_ok() {
this.showModal = false
this.$refs.footerModal._hideLoading()
console.log(this.getPage)
},
_itemImportBack(data) {
if (this.selectIds === undefined || this.selectIds.length === 0) {
return false
}
if (data === undefined || data.length === 0) {
return false
}
this._importItemOk({ sampleIds: this.selectIds, drugItemList: data })
},
// _importItemOk: async function(data) {
// const result = await drugSample.importSampleItemDTO(data)
// if (result) {
// this.$Message.success('导入成功!')
// await this._page()
// }
// },
_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]
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (msg) {
case '添加':
this._editModal(false)
break
case '复制历史样品':
this._copyHisSample()
break
case '导入样品':
this._importSample()
break
case '导入检测项目':
this._importItem()
break
case '导入检测项目包':
this._importItemPackage()
break
case '打印标签':
this._printLabel()
break
case '试样制备':
this._samplePre()
break
case '批量填写土质描述详情':
this._writeDetail(this.selectIds)
break
case '复制历史样品检测项目':
this._copyHisItem()
break
case '删除':
this._deleteSelected()
break
case '导出':
this._exportSample()
break
case '添加模拟样品':
this._editImitateModal(false)
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
_samplePre() {
if (this.selectIds.length === 0) {
this.$message.warning('至少选择一条数据')
} else {
this.$refs.preModal._open(this.selectIds.join(','))
}
},
_writeDetail(id) {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
const ids = id.join(',')
this.$refs.writeDetailModal._open(ids)
}
},
_exportSample() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条样品')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定导出这' + this.selectIds.length + '条样品',
onOk: () => {
http.open(
'/food/v1/sample/company/export',
{ ids: this.selectIds.join(',') },
'_blank'
)
}
})
}
},
_copyHisSample() {
this.$refs.refModal._open(this.entrustId)
},
_iconClick(res, data, componentName, index) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (res) {
case '管理检测项目':
this._itemManage(data.id)
break
case '制备详情':
this._preEdit(data.id)
break
case '编辑':
this._editModal(true, data)
break
case '复制':
this._copy(data)
break
case '删除':
console.log(index)
this._deleteById(data.id)
break
case '附件':
this.$refs.refModal._open(data.id, 'sampleId')
break
}
})
},
_preEdit(id) {
this.$refs.preHisModal._open(id)
},
_itemManage(data) {
// 管理检测项目
if (this.recordHis) {
this.$refs.sampleItemManage._openRecord(data)
} else {
this.$refs.sampleItemManage._open(data)
}
},
_tableResultChange(msg, data) {
const selectIds = []
switch (msg) {
case 'selectData':
for (let i = 0; i < data.length; i++) {
selectIds.push(data[i].id)
}
this.selectIds = selectIds
this.selectData = data
break
case 'allSelect':
console.log('123465798', data)
this.allSelect(data)
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
case 'changeSize':
this._page()
break
}
},
allSelect(data) {
this.indexList = []
for (let i = 0; i < data.length; i++) {
this.indexList.push(data[i].index)
}
console.log('索引', this.indexList)
},
_open(id) {
this.formObj = this.$resetFields(this.formObj)
this.dateList = []
this.showModal = true
this.formObj.entrustId = id // 委托id
console.log(this.entrustId)
this.$refs.pageTable._hideLoading()
this._page()
},
_openHis(adress) {
this.formObj = this.$resetFields(this.formObj)
this.dateList = []
this.showModal = true
this.formObj.receiveLocation = adress // 委托id
this.$refs.pageTable._hideLoading()
this.recordHis = true
this._page()
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_page: async function() {
const result = await soilSample.pageLocationSample(this.formObj)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_deleteByIds(ids, content) {
this.$Modal.confirm({
title: '提示',
content: content || '确定删除该记录?',
onOk: () => {
// this.$store.dispatch('FoodSample/deleteByIds', ids).then(() => {
// this._resultChange('删除成功!')
// })
this._deleteOk(ids)
}
})
},
// _deleteOk: async function(ids) {
// const result = await drugSample.deleteById(ids)
// if (result) {
// this._resultChange('删除成功')
// }
// },
_deleteById(id) {
// 删除一条记录
this._deleteByIds([id])
},
_deleteSelected() {
// 批量删除
const ids = this.selectIds
if (ids.length === 0) {
this.$Message.warning('请选择一条或多条数据!')
} else {
this._deleteByIds(ids, '确定删除 ' + ids.length + ' 条记录?')
}
},
_detailModal(data) {},
_editModal(edit, data) {
if (edit) {
console.log(data)
this.$refs.sampleManageEdit._open(data)
} else {
// 添加
this.$refs.refModal._open('', this.entrustId)
}
},
// 添加编辑模拟样品
_editImitateModal(edit, data) {
if (edit) {
// 模拟样品的编辑
const tempData = JSON.parse(JSON.stringify(data)) // 深拷贝
this.$refs.imitateModal._open(tempData, this.entrustId)
} else {
// 模拟样品的添加
this.$refs.imitateModal._open('', this.entrustId)
}
},
_search() {
this._page()
},
_resultChange(msg) {
this.$Message.success(msg)
this._page()
},
_copy(data) {
this.$refs.copyModal._open(data.id, data.type)
},
// 复制样品
_copySample(data) {
this.$store
.dispatch('FoodSample/getByCompanyId', data.sampleId)
.then(() => {
const result = this.$store.state.FoodSample.companyModel
if (data.type === 0) {
// 普通样品
this.currentComponent = 'FoodSampleCompanyEdit'
this.$nextTick(function() {
this.$refs.refModal._openCopySample(result)
})
} else if (data.type === 3) {
// 模拟样品
this.$refs.imitateModal._openCopySample(result)
}
})
},
_copyAll(data) {
this.$store
.dispatch('FoodSample/getByCompanyId', data.sampleId)
.then(() => {
const result = this.$store.state.FoodSample.companyModel
if (data.type === 0) {
// 普通样品
this.currentComponent = 'FoodSampleCompanyEdit'
this.$nextTick(function() {
this.$refs.refModal._openCopyAll(result)
})
} else if (data.type === 3) {
// 模拟样品
this.$refs.imitateModal._openCopyAll(result)
}
})
},
// 导入检测项目
_importItem() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
this.$refs.sampleItemModal._open()
this.$refs.pageTable.checkedData()
}
},
// 导入检测项目包
_importItemPackage() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
// this.$refs.refModal._open(this.selectIds, 'sample-rel-package-item')
this.$refs.itemPackageModal._open(
this.selectIds,
'sample-rel-package-item'
)
}
},
_printLabel() {
if (this.selectData.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
for (let m = 0; m < this.selectData.length; m++) {
const row = this.selectData[m]
this._printLabelOk(row)
}
}
},
_printLabelOk(row) {
LODOP = getLodop()
if (LODOP === 'undefined' || LODOP === undefined) {
this._pluginDownload()
return false
}
if (LODOP.GET_PRINTER_COUNT() === 0) {
this.$Messager.warning('系统未关联打印机,请确认....')
return false
}
LODOP.PRINT_INITA('0mm', '0mm', '70.01mm', '50.01mm', '样品标签打印')
LODOP.ADD_PRINT_LINE(36, 15, 35, 251, 0, 1)
LODOP.ADD_PRINT_LINE(74, 15, 73, 251, 0, 1)
LODOP.ADD_PRINT_LINE(107, 15, 106, 251, 0, 1)
LODOP.ADD_PRINT_LINE(140, 15, 139, 251, 0, 1)
LODOP.ADD_PRINT_LINE(175, 15, 174, 251, 0, 1)
LODOP.ADD_PRINT_LINE(35, 15, 174, 16, 0, 1)
LODOP.ADD_PRINT_LINE(35, 74, 174, 75, 0, 1)
LODOP.ADD_PRINT_LINE(35, 251, 174, 252, 0, 1)
LODOP.ADD_PRINT_TEXT(49, 17, 59, 20, '样品名称')
LODOP.ADD_PRINT_TEXT(82, 18, 59, 20, '样品编号')
LODOP.ADD_PRINT_TEXT(116, 17, 59, 20, '样品状态')
LODOP.ADD_PRINT_TEXT(151, 27, 39, 20, '备注')
LODOP.ADD_PRINT_TEXT(16, 95, 100, 20, '检测样品标签')
LODOP.SET_PRINT_STYLEA(0, 'Bold', 1)
LODOP.ADD_PRINT_TEXT(49, 78, 135, 20, row.name)
LODOP.ADD_PRINT_TEXT(82, 77, 136, 20, row.sampleCode)
LODOP.ADD_PRINT_TEXT(117, 76, 176, 20, '□未检 □在检 □已检 □留样')
if (row.surplus === '取回') {
LODOP.ADD_PRINT_TEXT(152, 77, 138, 20, '☑"取回 □服务方处理')
} else if (row.surplus === '服务方处理') {
LODOP.ADD_PRINT_TEXT(152, 77, 138, 20, '□取回 ☑服务方处理')
} else {
LODOP.ADD_PRINT_TEXT(152, 77, 138, 20, '□取回 □服务方处理')
}
LODOP.PRINT_DESIGN()
},
_copyHisItem() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
this.$refs.refModal._open(this.selectIds)
}
},
_operationRecord(id) {
// 操作日志
this.$refs.recordModal._open(id)
}
}
}
</script>
...@@ -103,30 +103,10 @@ export default { ...@@ -103,30 +103,10 @@ export default {
type: '', type: '',
id: '', id: '',
name: '驳回' name: '驳回'
}, }
{
type: 'primary',
id: 'food-sample-preparation-his-all',
name: '制备'
},
{
type: 'primary',
id: 'food-sample-preparation-his-no-pre',
name: '无需制备'
},
{
type: 'primary',
id: 'food-sample-preparation-his-scan-pre',
name: '扫码制备'
},
// { type: '', id: '', name: '填写存放信息' }, // { type: '', id: '', name: '填写存放信息' },
// { type: '', id: '', name: '申请处理' }, // { type: '', id: '', name: '申请处理' },
// { type: '', id: '', name: '导出' }, // { type: '', id: '', name: '导出' },
{
type: '',
id: 'food-sample-prepare-record-export',
name: '导出备样记录'
}
], ],
iconMsg: [ iconMsg: [
{ type: 'md-create', id: '', name: '编辑' } // food-sample-prepare-edit { type: 'md-create', id: '', name: '编辑' } // food-sample-prepare-edit
......
...@@ -94,39 +94,19 @@ export default { ...@@ -94,39 +94,19 @@ export default {
selectSampleIds: [], selectSampleIds: [],
getPage: {}, getPage: {},
btn: [ btn: [
{ // {
type: 'primary', // type: 'primary',
id: '', // id: '',
name: '通过' // name: '通过'
}, // },
{ // {
type: '', // type: '',
id: '', // id: '',
name: '驳回' // name: '驳回'
}, // }
{
type: 'primary',
id: 'food-sample-preparation-his-all',
name: '制备'
},
{
type: 'primary',
id: 'food-sample-preparation-his-no-pre',
name: '无需制备'
},
{
type: 'primary',
id: 'food-sample-preparation-his-scan-pre',
name: '扫码制备'
},
// { type: '', id: '', name: '填写存放信息' }, // { type: '', id: '', name: '填写存放信息' },
// { type: '', id: '', name: '申请处理' }, // { type: '', id: '', name: '申请处理' },
// { type: '', id: '', name: '导出' }, // { type: '', id: '', name: '导出' },
{
type: '',
id: 'food-sample-prepare-record-export',
name: '导出备样记录'
}
], ],
iconMsg: [ iconMsg: [
{ type: 'md-create', id: '', name: '编辑' } // food-sample-prepare-edit { type: 'md-create', id: '', name: '编辑' } // food-sample-prepare-edit
......
<!--资质项目列表-->
<template>
<div>
<div>
<Form :label-width="65" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="检测项目:" class="search-item">
<Input v-model="formObj.name" @on-enter="_search" placeholder="请输入检测项目" clearable />
</Form-item>
<Form-item>
<Button @click="_search" type="primary">搜索</Button>
</Form-item>
</Form>
</div>
<PTVXETable ref="pageTable" :tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" select-data>
<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" sortable>
<template slot-scope="scope">
<div v-if="item.judge">{{scope.row[item.key] === 0 ?'否':'是'}}</div>
<div v-else-if="item.key==='testBasis'">
{{(scope.row.testBasis?scope.row.testBasis:' ')+(scope.row.testBasisName?scope.row.testBasisName:'')}}
</div>
<div v-else>{{scope.row[item.key]}}</div>
</template>
</vxe-table-column>
</PTVXETable>
</div>
</template>
<script>
import { soilAptitude } from '../../../api'
export default {
components: {},
data() {
return {
getPage: {},
formObj: {
name: undefined,
testBasis: undefined,
aptitude: undefined
},
tableHeight: document.documentElement.clientHeight - 285,
pageColumns: [
{ title: '检测项目', key: 'name', width: 100 },
{ title: '检测依据', key: 'testBasis', width: 260 },
// {title: '检测依据名称', key: 'testBasisName', width: 330},
{ title: '检测方法', key: 'testMethod', width: 130 },
{ title: '检测科室', key: 'groupName', width: 140 },
{ title: '资质', key: 'aptitude', width: 130 },
{ title: '检出限类别', key: 'detectionType', width: 130 },
{ title: '检出限', key: 'detectionLimit', width: 130 },
{ title: '单位', key: 'unit', width: 130 }
],
formId: '',
itemList: [],
testBasisList: []
}
},
methods: {
_open() {
this.formObj = this.$resetFields(this.formObj)
this._page()
},
// 获取检测项目
_getItemList(data) {
const obj = {}
if (data) {
obj.name = data
}
this.$store.dispatch('FoodAptitudeItem/getTestItem', obj).then(() => {
this.itemList = this.$store.state.FoodAptitudeItem.list
})
},
// 检测项目结果
_testItemChange(msg, data) {
switch (msg) {
case 'select':
this.formObj.name = data
this._getItemList()
break
case 'query':
this.formObj.name = data
this._getItemList(data)
break
case 'focus':
this._getItemList()
break
case 'enter':
this._search()
break
}
},
_getTestBasisList(data) {
const obj = { classify: 1, page: 1, rows: 20 }
if (data) {
obj.name = data.stdNum
}
this.$store.dispatch('StandardInfo/pageListByName', obj).then(() => {
this.testBasisList = this.$store.state.StandardInfo.page.records
})
},
_testBasisChange(msg, data) {
switch (msg) {
case 'select':
this.formObj.testBasis = data.stdNum
this._getTestBasisList()
break
case 'query':
this.formObj.testBasis = data.stdNum
this._getTestBasisList(data)
break
case 'focus':
this._getTestBasisList()
break
case 'enter':
this._search()
break
}
},
_page: async function() {
const result = await soilAptitude.page(this.$serializeForm(this.formObj))
if (result) {
console.log(result)
this.getPage = result
this.$refs.pageTable._hideLoading()
}
},
_clearSelection() {
this.$refs.pageTable._clearSelection()
},
_search() {
this.$refs.pageTable._pageChange(1)
},
_reset() {
this.formObj = this.$resetFields(this.formObj)
},
_tableResultChange(msg, data, checked) {
switch (msg) {
case 'page':
this._page()
break
case 'selectAll':
this.$emit('on-result-change', 'selectAll', data)
break
case 'selectData':
this.$emit('on-result-change', 'selectData', data)
break
case 'dbSelect':
this.$emit('on-result-change', 'dbClick', data)
break
case 'changeSize':
this._page()
break
}
}
}
}
</script>
...@@ -35,7 +35,7 @@ export default { ...@@ -35,7 +35,7 @@ export default {
{ key: 'belongUnit', title: '归口单位' }, { key: 'belongUnit', title: '归口单位' },
{ key: 'publishUnit', title: '发布单位' } { key: 'publishUnit', title: '发布单位' }
], ],
modalTitle: '添加食品标准表', modalTitle: '收样位置选择',
formObj: { formObj: {
detail: '' detail: ''
}, },
......
<!--Collapse关联框 单个导入项目-->
<template>
<div>
<Modal v-model="showModal" :mask-closable="false" width="100" class="zIndex-1200 full-screen modal-header-none">
<div>
<Collapse :right-title="'已选的检测项目 (共'+getPage.records.length+'条)'" @on-result-change="_optionResult"
:left-width="18"
left-title="资质项目">
<template #left>
<AptitudeItem ref="leftModal" @on-result-change="_leftResult"></AptitudeItem>
</template>
<template #right>
<PTVXETable ref="pageTable" :tableHeight="tableHeight" :getPage="getPage"
@on-result-change="_rightResult" select-data hide-page>
<vxe-table-column
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
v-for="item in pageColumns" :key="item.key">
<template slot-scope="scope">
<div v-if="item.key==='scened'">{{scope.row[item.key]?'':scope.row[item.key]===0?'否':'是'}}</div>
<div v-else-if="item.key==='testBasis'">
{{(scope.row.testBasis?scope.row.testBasis:' ')+
(scope.row.testBasisName?scope.row.testBasisName:'')}}
</div>
<div v-else>{{scope.row[item.key]}}</div>
</template>
</vxe-table-column>
</PTVXETable>
</template>
</Collapse>
</div>
<div slot="footer">
<modal-footer ref="footerModal" @on-result-change="_footerResult" :footer="footerList"></modal-footer>
</div>
</Modal>
</div>
</template>
<script>
import Collapse from '../../../components/base/Collapse'
import { soilSample } from '../../../api'
import AptitudeItem from './AptitudeItem'
/* 普通样品导入检测项目(一种是直接走接口保存,另一种是返回已选中的数据),专用于除了【质控】之外的导入检测项目 */
export default {
components: {
Collapse,
// AddItem,
AptitudeItem
},
props: {
isRepeat: null // 只有模拟样品才能导入重复的检测项目
},
data() {
return {
pageColumns: [
{ title: '检测项目', key: 'name', width: 100 },
{ title: '检测依据', key: 'testBasis', width: 260 },
// {title: '检测依据名称', key: 'testBasisName', width: 180,},
{ title: '检测方法', key: 'testMethod', width: 130 },
{ title: '检测科室', key: 'groupName', width: 140 }
],
footerList: [
{ name: '取消', type: '' },
{ name: '确定', type: 'primary' }
],
selectData: [],
showModal: false,
addIds: [],
sampleId: '',
delData: [],
getPage: {
records: []
},
isEditModal: false,
isReceive: false, // 用于区别是样品接收中导入检测项目还是普通样品中导入检测项目
tableHeight: document.documentElement.clientHeight - 240
}
},
methods: {
_open(sampleId) {
this.showModal = true
this.isReceive = false
this.sampleId = sampleId
this.selectData = []
this.addIds = []
this.delData = []
this.getPage.records = []
this.$refs.leftModal._open()
},
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '确定':
this._ok()
break
}
},
_ok: async function() {
const result = await soilSample.importExperiments({
aptitudeIds: this.addIds,
ids: this.sampleId
})
if (result) {
this.showModal = false
this.$Message.success('导入成功')
this.$emit('on-result-change')
}
},
_cancel() {
this.showModal = false
this.$refs.footerModal._hideLoading()
},
// 样品接收中用的导入检测项目(给一个样品导入检测项目)
_openReceive() {
this.isReceive = true
this.selectData = []
this.addIds = []
this.delData = []
// this.getPage = [];
this.getPage.records = []
this.$refs.leftModal._open()
},
_optionResult(name) {
switch (name) {
case '添加':
this._add()
break
case '删除':
this._deleteSelected()
break
}
},
// 未关联方法返回的数据
_leftResult(msg, data, checked) {
switch (msg) {
case 'selectAll':
this.selectData = data
break
case 'selectData':
this.selectData = data
// if (data.checked) {
// this.selectData.push(data)
// const set = new Set([...this.selectData])
// this.selectData = [...set]
// console.log('选择的数据', this.selectData)
// } else {
// const index = this.selectData.indexOf(data)
// this.selectData.splice(index, 1)
// }
break
case 'dbClick':
this.selectData = [data]
this._add()
break
case 'search':
this.selectData = []
break
}
},
// 已关联方法返回的数据
_rightResult(msg, data) {
switch (msg) {
case 'selectData':
this.delData = data
break
}
},
// 添加关联方法
_add() {
if (this.selectData.length === 0) {
this.$Message.warning('请至少选择一条数据!')
} else {
for (let i = 0; i < this.selectData.length; i++) {
if (this.isRepeat) {
// 表示模拟样品,可导入重复的项目
this.getPage.records.push(this.selectData[i])
this.addIds.push(this.selectData[i].id)
} else {
// 普通样品,不能导入重复的项目
// eslint-disable-next-line no-lonely-if
if (
!this.getPage.records.find(
item => item.name === this.selectData[i].name
)
) {
this.getPage.records.push(this.selectData[i])
this.addIds.push(this.selectData[i].id)
}
}
}
// 勾选之后两侧都需要手动清空,否则会出现另一侧也勾选的问题
this.$refs.leftModal._clearSelection()
this.$refs.pageTable._clearSelection()
this.selectData = []
}
},
_deleteSelected() {
if (this.delData.length === 0) {
this.$Message.warning('请选择一条或多条数据!')
} else {
this._deleteByIds(
this.delData,
'确定删除 ' + this.delData.length + ' 条记录?'
)
}
},
_deleteByIds(row, content) {
for (let i = 0; i < row.length; i++) {
const dataIndex = this.getPage.records.indexOf(row[i])
this.getPage.records.splice(dataIndex, 1)
const idIndex = this.addIds.indexOf(row[i].id)
this.addIds.splice(idIndex, 1)
}
// 勾选之后两侧都需要手动清空,否则会出现另一侧也勾选的问题
this.$refs.leftModal._clearSelection()
this.$refs.pageTable._clearSelection()
// 手动清空删除的数据
this.delData = []
}
}
}
</script>
...@@ -344,46 +344,6 @@ export default { ...@@ -344,46 +344,6 @@ export default {
this.showModal = false this.showModal = false
this._hideLoading() this._hideLoading()
}, },
_changeMic() {
const preList = []
for (let i = 0; i < this.getPage.records.length; i++) {
const obj = {
groupName: this.getPage.records[i].groupName,
groupId: this.getPage.records[i].groupId,
sampleId: this.getPage.records[i].sampleId,
itemName: this.getPage.records[i].itemName,
resultQuantity: this.getPage.records[i].resultQuantity,
preparationWay: this.getPage.records[i].preparationWay,
unit: this.getPage.records[i].unit,
remark: this.getPage.records[i].remark,
resultState: this.getPage.records[i].resultState,
saveWay: this.getPage.records[i].saveWay,
pack: this.getPage.records[i].pack,
storePlace: this.getPage.records[i].storePlace,
preparationDate: this.getPage.records[i].preparationDate,
sampleQuantity: this.getPage.records[i].sampleQuantity,
preparationPerson: this.getPage.records[i].preparationPerson,
preparationPersonId: this.getPage.records[i].preparationPersonId
}
if (this.getPage.records[i].id) {
obj.id = this.getPage.records[i].id
}
preList.push(obj)
}
this.$store
.dispatch('FoodSamplePreparation/saveBatch', {
foodSamplePreparationList: preList,
flag: 1
})
.then(() => {
if (this.$store.state.FoodSamplePreparation.success) {
this.showModal = false
this.$Message.success('操作成功')
this.$emit('on-result-change')
}
this.$refs.footerModal._hideLoading()
})
},
_ok() { _ok() {
console.log(this.getPage.records) console.log(this.getPage.records)
const prepareList = [] const prepareList = []
...@@ -396,22 +356,6 @@ export default { ...@@ -396,22 +356,6 @@ export default {
return false return false
} }
this.save({ prepareList: prepareList }) this.save({ prepareList: prepareList })
// const preList = []
// for (let i = 0; i < this.getPage.records.length; i++) {
// const reg = /^[0-9]+([.]{1}[0-9]+){0,1}$/
// if (!reg.test(this.getPage.records[i].resultQuantity)) {
// this.$Message.warning('制备数量请输入数字')
// this._hideLoading()
// return
// }
// const obj = {
// groupName: this.getPage.records[i].groupName
// }
// if (this.getPage.records[i].id) {
// obj.id = this.getPage.records[i].id
// }
// preList.push(obj)
// }
}, },
save: async function(data) { save: async function(data) {
const result = await soilEntrust.savePrepare(data) const result = await soilEntrust.savePrepare(data)
...@@ -496,7 +440,7 @@ export default { ...@@ -496,7 +440,7 @@ export default {
'58.87mm', '58.87mm',
'24.74mm', '24.74mm',
'QRCode', 'QRCode',
data[i].sampleCode + '-' + data[i].groupName data[i].sampleCode + '-' + data[i].groupId
) )
LODOP.ADD_PRINT_TEXT( LODOP.ADD_PRINT_TEXT(
130, 130,
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
</Form-item> </Form-item>
<Form-item label="制备人:"> <Form-item label="制备人:">
<el-select :value="formObj.preparer" @change="selUser" style="width:100%" size="small"> <el-select :value="formObj.preparer" @change="selUser" style="width:100%" size="small">
<el-option v-for="item in backupUserList" :value="item.id" :label="item.realname" :key="item.realname">{{ item.realname }} <el-option v-for="(item,index) in backupUserList" :value="item.id" :label="item.realname" :key="index">{{ item.realname }}
</el-option> </el-option>
</el-select> </el-select>
</Form-item> </Form-item>
......
...@@ -145,7 +145,7 @@ export default { ...@@ -145,7 +145,7 @@ export default {
{ title: '水深(米)', key: 'waterDepth', width: 120 }, { title: '水深(米)', key: 'waterDepth', width: 120 },
{ title: '钻孔名称', key: 'boreholeName', width: 120 }, { title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '进度', key: 'progress', width: 120, status: true }, { title: '进度', key: 'progress', width: 120, status: true },
// { title: '工程号', key: 'projectNo', width: 120 }, // { title: '平均容重', key: 'projectNo', width: 120 },
// { title: '报告编号', key: 'reportCode', width: 120 }, // { title: '报告编号', key: 'reportCode', width: 120 },
{ title: '制表日期', key: 'tabulateDate', width: 120, date: true }, { title: '制表日期', key: 'tabulateDate', width: 120, date: true },
{ title: '制表人', key: 'tabulater', width: 120 }, { title: '制表人', key: 'tabulater', width: 120 },
......
...@@ -114,7 +114,7 @@ export default { ...@@ -114,7 +114,7 @@ export default {
{ title: '水深(米)', key: 'waterDepth', width: 120 }, { title: '水深(米)', key: 'waterDepth', width: 120 },
{ title: '钻孔名称', key: 'boreholeName', width: 120 }, { title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '进度', key: 'progress', width: 120, status: true }, { title: '进度', key: 'progress', width: 120, status: true },
{ title: '工程号', key: 'projectNo', width: 120 }, { title: '平均容重', key: 'projectNo', width: 120 },
{ title: '报告编号', key: 'reportCode', width: 120 }, { title: '报告编号', key: 'reportCode', width: 120 },
{ title: '制表日期', key: 'tabulateDate', width: 120, date: true }, { title: '制表日期', key: 'tabulateDate', width: 120, date: true },
{ title: '制表人', key: 'tabulater', width: 120 }, { title: '制表人', key: 'tabulater', width: 120 },
......
...@@ -17,6 +17,9 @@ ...@@ -17,6 +17,9 @@
<Form-item label="试验科室:" class="search-item"> <Form-item label="试验科室:" class="search-item">
<Input v-model="formObj.groupName" @on-enter="_formSearch" placeholder="请输入试验科室" clearable /> <Input v-model="formObj.groupName" @on-enter="_formSearch" placeholder="请输入试验科室" clearable />
</Form-item> </Form-item>
<Form-item label="试验编号:" class="search-item">
<Input v-model="formObj.sampleCode" @on-enter="_formSearch" placeholder="请输入试样编号" clearable />
</Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button @click="_formSearch" type="primary"> <Button @click="_formSearch" type="primary">
搜索 搜索
...@@ -110,7 +113,7 @@ ...@@ -110,7 +113,7 @@
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult" /> <modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult" />
</div> </div>
</Modal> </Modal>
<PrepareItemBatchEdit ref="batchEdit" @on-result-change="_page"></PrepareItemBatchEdit> <PrepareItemBatchEdit ref="batchEdit" @on-result-change="_pageByEntrustId"></PrepareItemBatchEdit>
</div> </div>
</template> </template>
<script> <script>
...@@ -129,6 +132,11 @@ export default { ...@@ -129,6 +132,11 @@ export default {
type: 'success', type: 'success',
id: '', id: '',
name: '批量填写试验项目信息' name: '批量填写试验项目信息'
},
{
type: 'error',
id: '',
name: '删除'
} }
], ],
iconMsg: [{ type: 'pt-a-end', id: '', name: '删除' }], iconMsg: [{ type: 'pt-a-end', id: '', name: '删除' }],
...@@ -182,6 +190,7 @@ export default { ...@@ -182,6 +190,7 @@ export default {
name: undefined, name: undefined,
sampleId: undefined, sampleId: undefined,
groupName: undefined, groupName: undefined,
sampleCode: undefined,
entrustId: undefined entrustId: undefined
} }
} }
...@@ -372,7 +381,7 @@ export default { ...@@ -372,7 +381,7 @@ export default {
const result = await soilEntrust.pageItemEdit(data) const result = await soilEntrust.pageItemEdit(data)
if (result) { if (result) {
this.$message.success('保存成功') this.$message.success('保存成功')
this._page() this._pageByEntrustId()
} else { } else {
this.$message.warning('保存失败') this.$message.warning('保存失败')
} }
...@@ -381,7 +390,7 @@ export default { ...@@ -381,7 +390,7 @@ export default {
const result = await soilEntrust.pageItemEdit(data) const result = await soilEntrust.pageItemEdit(data)
if (result) { if (result) {
this.$message.success('保存成功') this.$message.success('保存成功')
this._page() this._pageByEntrustId()
} else { } else {
this.$message.warning('保存失败') this.$message.warning('保存失败')
} }
...@@ -390,7 +399,7 @@ export default { ...@@ -390,7 +399,7 @@ export default {
const result = await soilEntrust.pageItemEdit(data) const result = await soilEntrust.pageItemEdit(data)
if (result) { if (result) {
this.$message.success('保存成功') this.$message.success('保存成功')
this._page() this._pageByEntrustId()
} else { } else {
this.$message.warning('保存失败') this.$message.warning('保存失败')
} }
...@@ -399,7 +408,7 @@ export default { ...@@ -399,7 +408,7 @@ export default {
const result = await soilEntrust.pageItemEdit(data) const result = await soilEntrust.pageItemEdit(data)
if (result) { if (result) {
this.$message.success('保存成功') this.$message.success('保存成功')
this._page() this._pageByEntrustId()
} else { } else {
this.$message.warning('保存失败') this.$message.warning('保存失败')
} }
...@@ -541,7 +550,7 @@ export default { ...@@ -541,7 +550,7 @@ export default {
this.showModal = true this.showModal = true
this.sampleId = id // 委托id this.sampleId = id // 委托id
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
this._page() this._pageByEntrustId()
}, },
_openByEntrustId(id) { _openByEntrustId(id) {
this.formObj = this.$resetFields(this.formObj) this.formObj = this.$resetFields(this.formObj)
...@@ -560,7 +569,7 @@ export default { ...@@ -560,7 +569,7 @@ export default {
this.sampleId = id // 委托id this.sampleId = id // 委托id
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
this.showOption = false this.showOption = false
this._page() this._pageByEntrustId()
}, },
_formSearch() { _formSearch() {
this.$refs.pageTable._pageChange(1) this.$refs.pageTable._pageChange(1)
...@@ -602,7 +611,7 @@ export default { ...@@ -602,7 +611,7 @@ export default {
}, },
_deleteOk: async function(ids) { _deleteOk: async function(ids) {
const result = await soilEntrust.deleteById(ids) const result = await soilEntrust.experimentDeleteById(ids)
if (result) { if (result) {
this._resultChange('删除成功! ') this._resultChange('删除成功! ')
} }
...@@ -654,10 +663,10 @@ export default { ...@@ -654,10 +663,10 @@ export default {
} }
}, },
_search() { _search() {
this._page() this._pageByEntrustId()
}, },
_resultChange(msg) { _resultChange(msg) {
this._page() this._pageByEntrustId()
this.$Message.success(msg) this.$Message.success(msg)
this.$emit('on-result-change') this.$emit('on-result-change')
}, },
......
...@@ -103,7 +103,7 @@ export default { ...@@ -103,7 +103,7 @@ export default {
{ title: '水深(米)', key: 'waterDepth', width: 120 }, { title: '水深(米)', key: 'waterDepth', width: 120 },
{ title: '钻孔名称', key: 'boreholeName', width: 120 }, { title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '进度', key: 'progress', width: 120, status: true }, { title: '进度', key: 'progress', width: 120, status: true },
{ title: '工程号', key: 'projectNo', width: 120 }, { title: '平均容重', key: 'projectNo', width: 120 },
{ title: '报告编号', key: 'reportCode', width: 120 }, { title: '报告编号', key: 'reportCode', width: 120 },
{ title: '制表日期', key: 'tabulateDate', width: 120, date: true }, { title: '制表日期', key: 'tabulateDate', width: 120, date: true },
{ title: '制表人', key: 'tabulater', width: 120 }, { title: '制表人', key: 'tabulater', width: 120 },
......
...@@ -106,7 +106,7 @@ export default { ...@@ -106,7 +106,7 @@ export default {
{ title: '水深(米)', key: 'waterDepth', width: 120 }, { title: '水深(米)', key: 'waterDepth', width: 120 },
{ title: '钻孔名称', key: 'boreholeName', width: 120 }, { title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '进度', key: 'progress', width: 120, status: true }, { title: '进度', key: 'progress', width: 120, status: true },
{ title: '工程号', key: 'projectNo', width: 120 }, { title: '平均容重', key: 'projectNo', width: 120 },
{ title: '报告编号', key: 'reportCode', width: 120 }, { title: '报告编号', key: 'reportCode', width: 120 },
{ title: '制表日期', key: 'tabulateDate', width: 120, date: true }, { title: '制表日期', key: 'tabulateDate', width: 120, date: true },
{ title: '制表人', key: 'tabulater', width: 120 }, { title: '制表人', key: 'tabulater', width: 120 },
......
...@@ -39,7 +39,7 @@ export default { ...@@ -39,7 +39,7 @@ export default {
{ key: 'belongUnit', title: '归口单位' }, { key: 'belongUnit', title: '归口单位' },
{ key: 'publishUnit', title: '发布单位' } { key: 'publishUnit', title: '发布单位' }
], ],
modalTitle: '添加食品标准表', modalTitle: '收样位置选择',
formObj: { formObj: {
receiveLocation: '', receiveLocation: '',
locationId: '' locationId: ''
...@@ -112,6 +112,7 @@ export default { ...@@ -112,6 +112,7 @@ export default {
if (result) { if (result) {
this._resultChange('收样成功!') this._resultChange('收样成功!')
} }
this._hideLoading()
}, },
_save: async function(data) { _save: async function(data) {
const result = await soilAptitude.standardSave(data) const result = await soilAptitude.standardSave(data)
......
<template>
<div>
<Modal v-model="showEditModal" :mask-closable="false" :width="500" class="zIndex-1200">
<p slot="header">{{modalTitle}}</p>
<div>
<Form id="edit-form" ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="100" inline>
<Form-item label="收样位置" prop="name" style="width: 100%">
<el-select v-model="formObj.locationId" @change="selectLocation($event)" name="locationId">
<el-option v-for="(item) in options" :label="item.name" :key="item.id" :value="item.id">
{{ item.name }}
</el-option>
</el-select>
</Form-item>
</Form>
</div>
<div slot="footer">
<ModalFooter ref="footerModal" @on-result-change="_footerResult" :footer="footerList"></ModalFooter>
</div>
</Modal>
</div>
</template>
<script>
/**
* 添加编辑
*/
import ModalFooter from '../../../../components/base/modalFooter'
import { soilAptitude, soilEntrust, soilSample } from '../../../../api'
export default {
components: {
ModalFooter
},
data() {
return {
formId: '',
lengthLimitList: [
{ key: 'stdNum', title: '标准号' },
{ key: 'enName', title: '英文名称' },
{ key: 'belongUnit', title: '归口单位' },
{ key: 'publishUnit', title: '发布单位' }
],
modalTitle: '留存位置选择',
formObj: {
receiveLocation: '',
locationId: ''
},
ruleValidate: {},
showEditModal: false,
ids: '',
options: [],
classifyList: [
{ value: 0, name: '判定依据' },
{ value: 1, name: '检测依据' },
{ value: 2, name: '其他' }
],
typeList: [
{ value: 0, name: '国家标准' },
{ value: 1, name: '地方标准' },
{ value: 2, name: '行业标准' },
{ value: 3, name: '企业标准' }
],
statusList: [
{ value: 0, name: '现行' },
{ value: 1, name: '即将实施' },
{ value: 2, name: '部分被代替' },
{ value: 3, name: '被代替' },
{ value: 4, name: '作废' }
],
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '保存', type: 'primary' }
]
}
},
methods: {
/** *modal-footer */
selectLocation(data) {
this._getLocationById(data)
},
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '保存':
this._ok()
break
}
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_resultChange(msg) {
this.showEditModal = false
this.$Message.success(msg)
this.$emit('on-result-change')
this._hideLoading()
},
_ok() {
this.$refs.formObj.validate(valid => {
if (valid) {
this.formObj.ids = this.ids
this._receive(this.formObj)
} else {
this.$Message.error('表单验证失败!')
this._hideLoading()
}
})
},
_receive: async function(data) {
const result = await soilEntrust.sampleRetain(data)
if (result) {
this._resultChange('留存成功!')
}
this.$refs.footerModal._hideLoading()
},
_save: async function(data) {
const result = await soilAptitude.standardSave(data)
if (result) {
this._resultChange('添加成功!')
}
},
_edit: async function(data) {
const result = await soilAptitude.standardEdit(data)
if (result) {
this._resultChange('编辑成功!')
}
},
_cancel() {
this._hideLoading()
this.showEditModal = false
},
_open(ids) {
this.formObj.receiveLocation = ''
this.formObj.locationId = ''
this._getLocation()
this.ids = ids
this.showEditModal = true
},
_getLocation: async function() {
const result = await soilSample.locationList()
if (result) {
console.log(result)
this.options = result
console.log(this.options)
}
},
_getLocationById: async function(id) {
console.log(id)
const result = await soilSample.locationGetById(id)
if (result) {
this.formObj.receiveLocation = result.name
}
console.log(this.formObj.receiveLocation)
},
_registerAdd() {
this.formId = this.$randomCode()
this._hideLoading()
this.$refs.formObj.resetFields()
this.modalTitle = '添加'
this.formObj.id = ''
this.formObj.type = 3
this.showEditModal = true
}
}
}
</script>
<template> <template>
<div> <div>
<Modal v-model="showSampleModal" @on-visible-change="_visibleChange" width="1000" <Modal v-model="showSampleModal" @on-visible-change="_visibleChange" width="1100"
class="zIndex-900 modal-footer-none"> class="zIndex-900 modal-footer-none">
<p slot="header"> {{name}}--管理样品</p> <p slot="header"> {{name}}--管理样品</p>
<div> <div>
......
...@@ -5,11 +5,16 @@ ...@@ -5,11 +5,16 @@
<Row> <Row>
<!--查询--> <!--查询-->
<Col span="24" style="padding-bottom: 5px"> <Col span="24" style="padding-bottom: 5px">
<Form id="search-wait" :label-width="90" v-show="searchOpen" inline onsubmit="return false"> <Form id="search-wait" :label-width="100" v-show="searchOpen" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item label="试样编号:" class="search-item"> <Form-item label="试样编号:" class="search-item">
<Input @on-enter="_formSearch" v-model="formObj.sampleCode" name="sampleCode" placeholder="请输入试样编号" clearable></Input> <Input @on-enter="_formSearch" v-model="formObj.sampleCode" name="sampleCode" placeholder="请输入试样编号" clearable></Input>
</Form-item> </Form-item>
<Form-item label="是否有试验项目:" class="search-item">
<Select v-model="formObj.haveExp" clearable name="groupId" style="width:150px" placeholder="请选择检测科室">
<Option v-for="(item,index) in itemData" :value="item.value" :key="index">{{item.name}}</Option>
</Select>
</Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button> <Button @click="_formSearch" type="primary">搜索</Button>
</Form-item> </Form-item>
...@@ -52,23 +57,39 @@ ...@@ -52,23 +57,39 @@
<!--选择领样人--> <!--选择领样人-->
<SampleReceiveModal ref="locationModal" @on-result-change="_page()"></SampleReceiveModal> <SampleReceiveModal ref="locationModal" @on-result-change="_page()"></SampleReceiveModal>
<SoilSampleItemManage ref="sampleItemManage" @on-result-change="_page"></SoilSampleItemManage> <SoilSampleItemManage ref="sampleItemManage" @on-result-change="_page"></SoilSampleItemManage>
<KeepAdress ref="keepAdressModal" @on-result-change="_page"></KeepAdress>
</div> </div>
</template> </template>
<script> <script>
import { soilEntrust } from '../../../../api' import { soilEntrust } from '../../../../api'
import SampleReceiveModal from '../SampleReceiveModal' import SampleReceiveModal from '../SampleReceiveModal'
import SoilSampleItemManage from './SoilSampleItemManage' import SoilSampleItemManage from './SoilSampleItemManage'
import KeepAdress from './KeepAdress'
export default { export default {
components: { SampleReceiveModal, SoilSampleItemManage }, components: { SampleReceiveModal, SoilSampleItemManage, KeepAdress },
data() { data() {
return { return {
btn: [{ type: 'primary', id: '', name: '收样室收样' }], btn: [
{ type: 'primary', id: '', name: '收样室收样' },
{ type: 'primary', id: '', name: '样品留存' }
],
selectIds: [], selectIds: [],
getPage: {}, getPage: {},
itemData: [
{
name: '是',
value: 1
},
{
name: '否',
value: 0
}
],
pageColumns: [ pageColumns: [
{ title: '试样编号', key: 'sampleCode', width: 120, fixed: 'left' }, { title: '试样编号', key: 'sampleCode', width: 120, fixed: 'left' },
{ title: '试样深度', key: 'sampleDepth', width: 120 }, { title: '试样深度', key: 'sampleDepth', width: 100 },
{ title: '现场编号', key: 'siteNo', width: 120 }, { title: '现场编号', key: 'siteNo', width: 100 },
{ title: '试验项目', key: 'experimentNames', width: 220 },
{ title: '土质描述', key: 'sampleDescribe', width: 205 }, { title: '土质描述', key: 'sampleDescribe', width: 205 },
{ title: '样品包装类型', key: 'samplePack', width: 120 }, { title: '样品包装类型', key: 'samplePack', width: 120 },
{ title: '备注', key: 'remark', width: 210 } { title: '备注', key: 'remark', width: 210 }
...@@ -84,7 +105,8 @@ export default { ...@@ -84,7 +105,8 @@ export default {
num: '', num: '',
detectType: '', detectType: '',
standard: '', standard: '',
samplingLinkList: [] samplingLinkList: [],
haveExp: undefined
}, },
stdList: [], stdList: [],
sampleLinkList: [ sampleLinkList: [
...@@ -268,6 +290,9 @@ export default { ...@@ -268,6 +290,9 @@ export default {
case '收样室收样': case '收样室收样':
this._sampleReceive(this.selectIds) this._sampleReceive(this.selectIds)
break break
case '样品留存':
this._sampleKeep(this.selectIds)
break
case '打印标签': case '打印标签':
this._selectPrinter('print-label') this._selectPrinter('print-label')
break break
...@@ -501,7 +526,14 @@ export default { ...@@ -501,7 +526,14 @@ export default {
break break
} }
}, },
_sampleKeep(id) {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
const ids = id.join(',')
this.$refs.keepAdressModal._open(ids)
}
},
// 样品接收 // 样品接收
_sampleReceive(id) { _sampleReceive(id) {
if (this.selectIds.length === 0) { if (this.selectIds.length === 0) {
......
...@@ -70,6 +70,7 @@ export default { ...@@ -70,6 +70,7 @@ export default {
{ title: '试样编号', key: 'sampleCode', width: 100, fixed: 'left' }, { title: '试样编号', key: 'sampleCode', width: 100, fixed: 'left' },
{ title: '试样深度', key: 'sampleDepth', width: 95 }, { title: '试样深度', key: 'sampleDepth', width: 95 },
{ title: '现场编号', key: 'siteNo', width: 100 }, { title: '现场编号', key: 'siteNo', width: 100 },
{ title: '试验项目', key: 'experimentNames', width: 225 },
{ title: '土质描述', key: 'sampleDescribe', width: 185 }, { title: '土质描述', key: 'sampleDescribe', width: 185 },
{ title: '样品包装类型', key: 'samplePack', width: 120 } { title: '样品包装类型', key: 'samplePack', width: 120 }
], ],
......
...@@ -78,30 +78,10 @@ export default { ...@@ -78,30 +78,10 @@ export default {
type: '', type: '',
id: '', id: '',
name: '驳回' name: '驳回'
}, }
{
type: 'primary',
id: 'food-sample-preparation-his-all',
name: '制备'
},
{
type: 'primary',
id: 'food-sample-preparation-his-no-pre',
name: '无需制备'
},
{
type: 'primary',
id: 'food-sample-preparation-his-scan-pre',
name: '扫码制备'
},
// { type: '', id: '', name: '填写存放信息' }, // { type: '', id: '', name: '填写存放信息' },
// { type: '', id: '', name: '申请处理' }, // { type: '', id: '', name: '申请处理' },
// { type: '', id: '', name: '导出' }, // { type: '', id: '', name: '导出' },
{
type: '',
id: 'food-sample-prepare-record-export',
name: '导出备样记录'
}
], ],
iconMsg: [ iconMsg: [
{ type: 'md-create', id: '', name: '编辑' } // food-sample-prepare-edit { type: 'md-create', id: '', name: '编辑' } // food-sample-prepare-edit
......
...@@ -56,11 +56,6 @@ export default { ...@@ -56,11 +56,6 @@ export default {
formObj: {}, formObj: {},
btn: [ btn: [
// { type: '', id: '', name: '导出' }, // { type: '', id: '', name: '导出' },
{
type: '',
id: 'food-sample-handle-already-export-sample-store',
name: '导出样品贮存表'
}
], ],
pageColumns: [ pageColumns: [
{ title: '试样编号', key: 'sampleCode', width: 150 }, { title: '试样编号', key: 'sampleCode', width: 150 },
......
<template>
<div>
<Modal v-model="showSubmitModal" :mask-closable="false" @on-visible-change="_visibleChange" width="700">
<p slot="header">{{modalTitle}}</p>
<div>
<Form :label-width="80" onsubmit="return false">
<Form-item label="样品编号" prop="num">
<Input ref="inputFocus" @submit.native.prevent @on-enter="_numBlur" v-model="num"
placeholder="请将鼠标聚焦在此,并保持英文输入状态" style="width:100%"></Input>
</Form-item>
<Form-item label="扫码信息">
<div class="scanInfo">
<ul>
<li v-for="(item,index) in scanInfo" v-bind:key="index">{{item}}</li>
</ul>
</div>
</Form-item>
</Form>
</div>
</Modal>
</div>
</template>
<script>
/* 扫码接收、扫码发放 */
import { soilSample } from '../../../api'
export default {
components: {},
data() {
return {
modalTitle: '',
showSubmitModal: false,
scanInfo: [],
num: '',
formObj: {
personId: '',
person: ''
}
}
},
methods: {
_open(title, data) {
if (title) {
this.modalTitle = title
} else {
this.modalTitle = '扫码接收'
}
if (data) {
this.formObj.person = data.realname
this.formObj.personId = data.userId
} else {
this.formObj = this.$serializeFormSearch(this.formObj)
}
this.showSubmitModal = true
this.num = ''
this.scanInfo = []
this._autoFocus()
},
_autoFocus() {
this.$nextTick(() => {
this.$refs.inputFocus.focus()
})
},
_cancel() {
this.showSubmitModal = false
},
_numBlur: async function() {
// 扫码发放
const param = {}
Object.assign(param, this.formObj, { num: this.num })
const result = await soilSample.scanTakeSample(this.num)
if (result) {
console.log(result)
this.num = ''
this.$Message.success('领样成功')
// this._resultChange(' 领样')
}
// this.$store
// .dispatch('FoodSample/scanSend', this.$serializeFormSearch(param))
// .then(() => {
// this._resultChange(' 发放')
// })
this._autoFocus()
},
_resultChange(msg) {
const returnNum = this.$store.state.FoodSample.success
if (returnNum) {
this.scanInfo.push('编号 ' + returnNum + msg + '成功!')
this.num = ''
} else {
this.num = ''
}
},
// 关闭弹框,刷新界面
_visibleChange(data) {
if (!data) {
this.$emit('on-result-change')
}
}
}
}
</script>
<style>
.scanInfo {
overflow: auto;
}
</style>
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
<!--打印(可填打印数量)--> <!--打印(可填打印数量)-->
<!--选择领样人--> <!--选择领样人-->
<UserInfo ref="userModal" @on-result-change="_userResult"></UserInfo> <UserInfo ref="userModal" @on-result-change="_userResult"></UserInfo>
<TakeByEwm ref="ewmModal"></TakeByEwm>
</div> </div>
</template> </template>
...@@ -66,10 +67,11 @@ ...@@ -66,10 +67,11 @@
import http from '../../../api/http' import http from '../../../api/http'
import UserInfo from '../../../components/user-info-single/assignPerson' import UserInfo from '../../../components/user-info-single/assignPerson'
import { soilEntrust, soilSample } from '../../../api' import { soilEntrust, soilSample } from '../../../api'
import TakeByEwm from './TakeByEwm'
export default { export default {
components: { components: {
UserInfo UserInfo,
TakeByEwm
}, },
data() { data() {
return { return {
...@@ -142,7 +144,10 @@ export default { ...@@ -142,7 +144,10 @@ export default {
{ title: '单位', key: 'unit', width: 130 } { title: '单位', key: 'unit', width: 130 }
], ],
searchOpen: false, searchOpen: false,
btn: [{ type: 'primary', id: '', name: '领样', componentName: '' }], btn: [
{ type: 'primary', id: '', name: '领样', componentName: '' },
{ type: 'primary', id: '', name: '扫码领样', componentName: '' }
],
selectIds: [], selectIds: [],
selectData: [], selectData: [],
currentComponent: '', currentComponent: '',
...@@ -207,11 +212,17 @@ export default { ...@@ -207,11 +212,17 @@ export default {
case '领样': case '领样':
this._sampleTake() this._sampleTake()
break break
case '扫码领样':
this._ewmTake()
break
default: default:
this._btnOption(msg, formTypeObj) this._btnOption(msg, formTypeObj)
} }
}) })
}, },
_ewmTake() {
this.$refs.ewmModal._open()
},
// btn操作 // btn操作
_btnOption(msg, formTypeObj) { _btnOption(msg, formTypeObj) {
switch (msg) { switch (msg) {
......
...@@ -101,30 +101,10 @@ export default { ...@@ -101,30 +101,10 @@ export default {
type: 'primary', type: 'primary',
id: '', id: '',
name: '完成处理' name: '完成处理'
}, }
{
type: 'primary',
id: 'food-sample-preparation-his-all',
name: '制备'
},
{
type: 'primary',
id: 'food-sample-preparation-his-no-pre',
name: '无需制备'
},
{
type: 'primary',
id: 'food-sample-preparation-his-scan-pre',
name: '扫码制备'
},
// { type: '', id: '', name: '填写存放信息' }, // { type: '', id: '', name: '填写存放信息' },
// { type: '', id: '', name: '申请处理' }, // { type: '', id: '', name: '申请处理' },
// { type: '', id: '', name: '导出' }, // { type: '', id: '', name: '导出' },
{
type: '',
id: 'food-sample-prepare-record-export',
name: '导出备样记录'
}
], ],
iconMsg: [ iconMsg: [
{ type: 'md-create', id: '', name: '编辑' }, // food-sample-prepare-edit { type: 'md-create', id: '', name: '编辑' }, // food-sample-prepare-edit
......
...@@ -78,11 +78,6 @@ export default { ...@@ -78,11 +78,6 @@ export default {
], ],
btn: [ btn: [
// { type: '', id: '', name: '导出' }, // { type: '', id: '', name: '导出' },
{
type: '',
id: 'food-sample-handle-already-export-sample-store',
name: '导出样品贮存表'
}
], ],
pageColumns: [ pageColumns: [
{ title: '试样编号', key: 'sampleCode', width: 150 }, { title: '试样编号', key: 'sampleCode', width: 150 },
......
...@@ -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="check">-->
<!-- <SampleBackupsManage ref="checkTabs"></SampleBackupsManage>-->
<!-- </el-tab-pane>-->
<!-- <el-tab-pane label="历史任务" name="checkHis">-->
<!-- <SampleBackupsQuery ref="checkHisTabs"></SampleBackupsQuery>-->
<!-- </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="check"> <el-tab-pane label="数据审核" name="check"></el-tab-pane>
<SampleBackupsManage ref="checkTabs"></SampleBackupsManage> <el-tab-pane label="历史任务" name="checkHis"></el-tab-pane>
</el-tab-pane>
<el-tab-pane label="历史任务" name="checkHis">
<SampleBackupsQuery ref="checkHisTabs"></SampleBackupsQuery>
</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 +28,37 @@ import SampleBackupsManage from './DataAudit' ...@@ -20,28 +28,37 @@ import SampleBackupsManage from './DataAudit'
import SampleBackupsQuery from './DataAuditHis' import SampleBackupsQuery from './DataAuditHis'
export default { export default {
components: { // eslint-disable-next-line vue/no-unused-components
SampleBackupsManage, components: { SampleBackupsManage, SampleBackupsQuery },
SampleBackupsQuery
},
data() { data() {
return { return {
activeName: 'check' activeName: 'check',
currentComponent: ''
} }
}, },
mounted() { mounted() {
this.activeName = 'check' this.activeName = 'check'
this.$refs.checkTabs._page() this._page()
}, },
methods: { methods: {
_changeTabs(tab, event) { _changeTabs(tab, event) {
if (tab.name === 'check') { if (tab.name === 'check') {
this.$refs.checkTabs._page() this._page()
} else if (tab.name === 'applyRecord') { } else if (tab.name === 'applyRecord') {
// this.$refs.applyRecordTabs._page() // this.$refs.applyRecordTabs._page()
} else { } else {
this.$refs.checkHisTabs._page() this.currentComponent = 'SampleBackupsQuery'
this.$nextTick(() => {
this.$refs.refModal._page()
})
} }
},
_page() {
this.currentComponent = 'SampleBackupsManage'
this.$nextTick(() => {
this.$refs.refModal._page()
})
// this.$refs.entrustTabs._page()
} }
} }
} }
......
...@@ -61,10 +61,14 @@ ...@@ -61,10 +61,14 @@
</div> </div>
<!--组件加载--> <!--组件加载-->
<!--选择领样人--> <!--选择领样人-->
<UserInfo ref="userModal" @on-result-change="_userResult"></UserInfo> <keep-alive>
<Operation ref="operation"></Operation> <!-- eslint-disable-next-line vue/require-component-is -->
<AuditDataModal ref="sampleManageModal" @on-result-change="_page"></AuditDataModal> <component ref="refModal" :is="currentComponent" @on-result-change="_componentResult"></component>
<FileManage ref="FileManage"></FileManage> </keep-alive>
<!-- <UserInfo ref="userModal" @on-result-change="_userResult"></UserInfo>-->
<!-- <Operation ref="operation"></Operation>-->
<!-- <AuditDataModal ref="sampleManageModal" @on-result-change="_page"></AuditDataModal>-->
<!-- <FileManage ref="FileManage"></FileManage>-->
</div> </div>
</template> </template>
<script> <script>
...@@ -73,12 +77,8 @@ import { soilTest } from '../../../api' ...@@ -73,12 +77,8 @@ import { soilTest } from '../../../api'
import Operation from '../../../components/operation/Operation' import Operation from '../../../components/operation/Operation'
import AuditDataModal from './AuditDataModal' import AuditDataModal from './AuditDataModal'
export default { export default {
components: {
UserInfo,
Operation,
// eslint-disable-next-line vue/no-unused-components // eslint-disable-next-line vue/no-unused-components
AuditDataModal components: { UserInfo, Operation, AuditDataModal },
},
data() { data() {
return { return {
formObj: { formObj: {
...@@ -108,7 +108,7 @@ export default { ...@@ -108,7 +108,7 @@ export default {
{ title: '水深(米)', key: 'waterDepth', width: 120 }, { title: '水深(米)', key: 'waterDepth', width: 120 },
{ title: '钻孔名称', key: 'boreholeName', width: 120 }, { title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '进度', key: 'progress', width: 120, status: true }, { title: '进度', key: 'progress', width: 120, status: true },
// { title: '工程号', key: 'projectNo', width: 120 }, // { title: '平均容重', key: 'projectNo', width: 120 },
// { title: '报告编号', key: 'reportCode', width: 120 }, // { title: '报告编号', key: 'reportCode', width: 120 },
{ title: '制表日期', key: 'tabulateDate', width: 120, date: true }, { title: '制表日期', key: 'tabulateDate', width: 120, date: true },
{ title: '制表人', key: 'tabulater', width: 120 }, { title: '制表人', key: 'tabulater', width: 120 },
...@@ -139,7 +139,7 @@ export default { ...@@ -139,7 +139,7 @@ export default {
} }
}, },
mounted() { mounted() {
this._page() // this._page()
// 样品接收是否选择人员 // 样品接收是否选择人员
// this.acceptSelectUserValue = localStorage.getItem('acceptSelectUserValue') // this.acceptSelectUserValue = localStorage.getItem('acceptSelectUserValue')
}, },
...@@ -365,7 +365,11 @@ export default { ...@@ -365,7 +365,11 @@ export default {
}) })
}, },
_editModal(id, type, name) { _editModal(id, type, name) {
this.$refs.sampleManageModal._open(id, type, '数据录入') this.currentComponent = 'AuditDataModal'
this.$nextTick(() => {
this.$refs.refModal._open(id, type, '数据录入')
})
// this.$refs.sampleManageModal._open(id, type, '数据录入')
}, },
_editModals(res, data) { _editModals(res, data) {
if (res === '登记协议') { if (res === '登记协议') {
...@@ -430,7 +434,11 @@ export default { ...@@ -430,7 +434,11 @@ export default {
}, },
_operationRecord(id) { _operationRecord(id) {
// 操作日志 // 操作日志
this.$refs.operation._open(id) this.currentComponent = 'Operation'
this.$nextTick(() => {
this.$refs.refModal._open(id)
})
// this.$refs.operation._open(id)
}, },
_resultChange(msg) { _resultChange(msg) {
if (this.$store.state.FoodContract.success) { if (this.$store.state.FoodContract.success) {
...@@ -441,7 +449,11 @@ export default { ...@@ -441,7 +449,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')
} }
} }
} }
......
...@@ -61,10 +61,14 @@ ...@@ -61,10 +61,14 @@
</div> </div>
<!--组件加载--> <!--组件加载-->
<!--选择领样人--> <!--选择领样人-->
<UserInfo ref="userModal" @on-result-change="_userResult"></UserInfo> <keep-alive>
<Operation ref="operation"></Operation> <!-- eslint-disable-next-line vue/require-component-is -->
<FileManage ref="FileManage"></FileManage> <component ref="refModal" :is="currentComponent" @on-result-change="_componentResult"></component>
<SoilSampleManageHis ref="sampleManageModal"></SoilSampleManageHis> </keep-alive>
<!-- <UserInfo ref="userModal" @on-result-change="_userResult"></UserInfo>-->
<!-- <Operation ref="operation"></Operation>-->
<!-- <FileManage ref="FileManage"></FileManage>-->
<!-- <SoilSampleManageHis ref="sampleManageModal"></SoilSampleManageHis>-->
</div> </div>
</template> </template>
<script> <script>
...@@ -73,11 +77,8 @@ import { soilTest } from '../../../api' ...@@ -73,11 +77,8 @@ 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: { // eslint-disable-next-line vue/no-unused-components
UserInfo, components: { UserInfo, Operation, SoilSampleManageHis },
Operation,
SoilSampleManageHis
},
data() { data() {
return { return {
formObj: { formObj: {
...@@ -92,7 +93,6 @@ export default { ...@@ -92,7 +93,6 @@ export default {
name: '管理样品' name: '管理样品'
}, },
{ type: 'md-cloud', id: '', name: '附件' }, { type: 'md-cloud', id: '', name: '附件' },
{ type: 'md-trash', id: '', name: '删除' },
{ {
type: 'ios-clock', type: 'ios-clock',
id: '', id: '',
...@@ -108,7 +108,7 @@ export default { ...@@ -108,7 +108,7 @@ export default {
{ title: '水深(米)', key: 'waterDepth', width: 120 }, { title: '水深(米)', key: 'waterDepth', width: 120 },
{ title: '钻孔名称', key: 'boreholeName', width: 120 }, { title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '进度', key: 'progress', width: 120, status: true }, { title: '进度', key: 'progress', width: 120, status: true },
{ title: '工程号', key: 'projectNo', width: 120 }, { title: '平均容重', key: 'projectNo', width: 120 },
{ title: '报告编号', key: 'reportCode', width: 120 }, { title: '报告编号', key: 'reportCode', width: 120 },
{ title: '制表日期', key: 'tabulateDate', width: 120, date: true }, { title: '制表日期', key: 'tabulateDate', width: 120, date: true },
{ title: '制表人', key: 'tabulater', width: 120 }, { title: '制表人', key: 'tabulater', width: 120 },
...@@ -139,7 +139,7 @@ export default { ...@@ -139,7 +139,7 @@ export default {
} }
}, },
mounted() { mounted() {
this._page() // this._page()
// 样品接收是否选择人员 // 样品接收是否选择人员
// this.acceptSelectUserValue = localStorage.getItem('acceptSelectUserValue') // this.acceptSelectUserValue = localStorage.getItem('acceptSelectUserValue')
}, },
...@@ -365,7 +365,11 @@ export default { ...@@ -365,7 +365,11 @@ export default {
}) })
}, },
_editModal(id, type, name) { _editModal(id, type, name) {
this.$refs.sampleManageModal._open(id, type, name) this.currentComponent = 'SoilSampleManageHis'
this.$nextTick(() => {
this.$refs.refModal._open(id, type, name)
})
// this.$refs.sampleManageModal._open(id, type, name)
}, },
_editModals(res, data) { _editModals(res, data) {
if (res === '登记协议') { if (res === '登记协议') {
...@@ -430,7 +434,11 @@ export default { ...@@ -430,7 +434,11 @@ export default {
}, },
_operationRecord(id) { _operationRecord(id) {
// 操作日志 // 操作日志
this.$refs.operation._open(id) this.currentComponent = 'Operation'
this.$nextTick(() => {
this.$refs.refModal._open(id)
})
// this.$refs.operation._open(id)
}, },
_resultChange(msg) { _resultChange(msg) {
if (this.$store.state.FoodContract.success) { if (this.$store.state.FoodContract.success) {
...@@ -440,8 +448,12 @@ export default { ...@@ -440,8 +448,12 @@ export default {
} }
}, },
_upload(id) { _upload(id) {
this.currentComponent = 'FileManage'
this.$nextTick(() => {
this.$refs.refModal._open(id, 'entrustId')
})
// 上传文件 // 上传文件
this.$refs.FileManage._open(id, 'entrustId') // this.$refs.FileManage._open(id, 'entrustId')
} }
} }
} }
......
...@@ -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="check">-->
<!-- <SampleBackupsManage ref="checkTabs"></SampleBackupsManage>-->
<!-- </el-tab-pane>-->
<!-- <el-tab-pane label="历史任务" name="checkHis">-->
<!-- <SampleBackupsQuery ref="checkHisTabs"></SampleBackupsQuery>-->
<!-- </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="check"> <el-tab-pane label="数据复核" name="check"></el-tab-pane>
<SampleBackupsManage ref="checkTabs"></SampleBackupsManage> <el-tab-pane label="历史任务" name="checkHis"></el-tab-pane>
</el-tab-pane>
<el-tab-pane label="历史任务" name="checkHis">
<SampleBackupsQuery ref="checkHisTabs"></SampleBackupsQuery>
</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 +28,37 @@ import SampleBackupsManage from './DataCheck' ...@@ -20,28 +28,37 @@ import SampleBackupsManage from './DataCheck'
import SampleBackupsQuery from './DataCheckHis' import SampleBackupsQuery from './DataCheckHis'
export default { export default {
components: { // eslint-disable-next-line vue/no-unused-components
SampleBackupsManage, components: { SampleBackupsManage, SampleBackupsQuery },
SampleBackupsQuery
},
data() { data() {
return { return {
activeName: 'check' activeName: 'check',
currentComponent: ''
} }
}, },
mounted() { mounted() {
this.activeName = 'check' this.activeName = 'check'
this.$refs.checkTabs._page() this._page()
}, },
methods: { methods: {
_changeTabs(tab, event) { _changeTabs(tab, event) {
if (tab.name === 'check') { if (tab.name === 'check') {
this.$refs.checkTabs._page() this._page()
} else if (tab.name === 'applyRecord') { } else if (tab.name === 'applyRecord') {
// this.$refs.applyRecordTabs._page() // this.$refs.applyRecordTabs._page()
} else { } else {
this.$refs.checkHisTabs._page() this.currentComponent = 'SampleBackupsQuery'
this.$nextTick(() => {
this.$refs.refModal._page()
})
} }
},
_page() {
this.currentComponent = 'SampleBackupsManage'
this.$nextTick(() => {
this.$refs.refModal._page()
})
// this.$refs.entrustTabs._page()
} }
} }
} }
......
...@@ -61,10 +61,14 @@ ...@@ -61,10 +61,14 @@
</div> </div>
<!--组件加载--> <!--组件加载-->
<!--选择领样人--> <!--选择领样人-->
<UserInfo ref="userModal" @on-result-change="_userResult"></UserInfo> <keep-alive>
<Operation ref="operation"></Operation> <!-- eslint-disable-next-line vue/require-component-is -->
<AuditDataModal ref="sampleManageModal" @on-result-change="_page"></AuditDataModal> <component ref="refModal" :is="currentComponent" @on-result-change="_componentResult"></component>
<FileManage ref="FileManage"></FileManage> </keep-alive>
<!-- <UserInfo ref="userModal" @on-result-change="_userResult"></UserInfo>-->
<!-- <Operation ref="operation"></Operation>-->
<!-- <AuditDataModal ref="sampleManageModal" @on-result-change="_page"></AuditDataModal>-->
<!-- <FileManage ref="FileManage"></FileManage>-->
</div> </div>
</template> </template>
<script> <script>
...@@ -73,12 +77,8 @@ import { soilTest } from '../../../api' ...@@ -73,12 +77,8 @@ import { soilTest } from '../../../api'
import Operation from '../../../components/operation/Operation' import Operation from '../../../components/operation/Operation'
import AuditDataModal from './CheckDataModal' import AuditDataModal from './CheckDataModal'
export default { export default {
components: {
UserInfo,
Operation,
// eslint-disable-next-line vue/no-unused-components // eslint-disable-next-line vue/no-unused-components
AuditDataModal components: { UserInfo, Operation, AuditDataModal },
},
data() { data() {
return { return {
formObj: { formObj: {
...@@ -108,7 +108,7 @@ export default { ...@@ -108,7 +108,7 @@ export default {
{ title: '水深(米)', key: 'waterDepth', width: 120 }, { title: '水深(米)', key: 'waterDepth', width: 120 },
{ title: '钻孔名称', key: 'boreholeName', width: 120 }, { title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '进度', key: 'progress', width: 120, status: true }, { title: '进度', key: 'progress', width: 120, status: true },
// { title: '工程号', key: 'projectNo', width: 120 }, // { title: '平均容重', key: 'projectNo', width: 120 },
// { title: '报告编号', key: 'reportCode', width: 120 }, // { title: '报告编号', key: 'reportCode', width: 120 },
{ title: '制表日期', key: 'tabulateDate', width: 120, date: true }, { title: '制表日期', key: 'tabulateDate', width: 120, date: true },
{ title: '制表人', key: 'tabulater', width: 120 }, { title: '制表人', key: 'tabulater', width: 120 },
...@@ -139,7 +139,7 @@ export default { ...@@ -139,7 +139,7 @@ export default {
} }
}, },
mounted() { mounted() {
this._page() // this._page()
// 样品接收是否选择人员 // 样品接收是否选择人员
// this.acceptSelectUserValue = localStorage.getItem('acceptSelectUserValue') // this.acceptSelectUserValue = localStorage.getItem('acceptSelectUserValue')
}, },
...@@ -365,7 +365,11 @@ export default { ...@@ -365,7 +365,11 @@ export default {
}) })
}, },
_editModal(id, type, name) { _editModal(id, type, name) {
this.$refs.sampleManageModal._open(id, type, '数据录入') this.currentComponent = 'AuditDataModal'
this.$nextTick(() => {
this.$refs.refModal._open(id, type, '数据录入')
})
// this.$refs.sampleManageModal._open(id, type, '数据录入')
}, },
_editModals(res, data) { _editModals(res, data) {
if (res === '登记协议') { if (res === '登记协议') {
...@@ -429,8 +433,12 @@ export default { ...@@ -429,8 +433,12 @@ export default {
this._page() this._page()
}, },
_operationRecord(id) { _operationRecord(id) {
this.currentComponent = 'Operation'
this.$nextTick(() => {
this.$refs.refModal._open(id)
})
// 操作日志 // 操作日志
this.$refs.operation._open(id) // this.$refs.operation._open(id)
}, },
_resultChange(msg) { _resultChange(msg) {
if (this.$store.state.FoodContract.success) { if (this.$store.state.FoodContract.success) {
...@@ -440,8 +448,12 @@ export default { ...@@ -440,8 +448,12 @@ export default {
} }
}, },
_upload(id) { _upload(id) {
this.currentComponent = 'FileManage'
this.$nextTick(() => {
this.$refs.refModal._open(id, 'entrustId')
})
// 上传文件 // 上传文件
this.$refs.FileManage._open(id, 'entrustId') // this.$refs.FileManage._open(id, 'entrustId')
} }
} }
} }
......
...@@ -61,10 +61,14 @@ ...@@ -61,10 +61,14 @@
</div> </div>
<!--组件加载--> <!--组件加载-->
<!--选择领样人--> <!--选择领样人-->
<UserInfo ref="userModal" @on-result-change="_userResult"></UserInfo> <keep-alive>
<Operation ref="operation"></Operation> <!-- eslint-disable-next-line vue/require-component-is -->
<FileManage ref="FileManage"></FileManage> <component ref="refModal" :is="currentComponent" @on-result-change="_componentResult"></component>
<SoilSampleManageHis ref="sampleManageModal"></SoilSampleManageHis> </keep-alive>
<!-- <UserInfo ref="userModal" @on-result-change="_userResult"></UserInfo>-->
<!-- <Operation ref="operation"></Operation>-->
<!-- <FileManage ref="FileManage"></FileManage>-->
<!-- <SoilSampleManageHis ref="sampleManageModal"></SoilSampleManageHis>-->
</div> </div>
</template> </template>
<script> <script>
...@@ -73,11 +77,8 @@ import { soilTest } from '../../../api' ...@@ -73,11 +77,8 @@ 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: { // eslint-disable-next-line vue/no-unused-components
UserInfo, components: { UserInfo, Operation, SoilSampleManageHis },
Operation,
SoilSampleManageHis
},
data() { data() {
return { return {
formObj: { formObj: {
...@@ -107,7 +108,7 @@ export default { ...@@ -107,7 +108,7 @@ export default {
{ title: '水深(米)', key: 'waterDepth', width: 120 }, { title: '水深(米)', key: 'waterDepth', width: 120 },
{ title: '钻孔名称', key: 'boreholeName', width: 120 }, { title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '进度', key: 'progress', width: 120, status: true }, { title: '进度', key: 'progress', width: 120, status: true },
{ title: '工程号', key: 'projectNo', width: 120 }, { title: '平均容重', key: 'projectNo', width: 120 },
{ title: '报告编号', key: 'reportCode', width: 120 }, { title: '报告编号', key: 'reportCode', width: 120 },
{ title: '制表日期', key: 'tabulateDate', width: 120, date: true }, { title: '制表日期', key: 'tabulateDate', width: 120, date: true },
{ title: '制表人', key: 'tabulater', width: 120 }, { title: '制表人', key: 'tabulater', width: 120 },
...@@ -138,7 +139,7 @@ export default { ...@@ -138,7 +139,7 @@ export default {
} }
}, },
mounted() { mounted() {
this._page() // this._page()
// 样品接收是否选择人员 // 样品接收是否选择人员
// this.acceptSelectUserValue = localStorage.getItem('acceptSelectUserValue') // this.acceptSelectUserValue = localStorage.getItem('acceptSelectUserValue')
}, },
...@@ -364,7 +365,11 @@ export default { ...@@ -364,7 +365,11 @@ export default {
}) })
}, },
_editModal(id, type, name) { _editModal(id, type, name) {
this.$refs.sampleManageModal._open(id, type, name) this.currentComponent = 'SoilSampleManageHis'
this.$nextTick(() => {
this.$refs.refModal._open(id, type, name)
})
// this.$refs.sampleManageModal._open(id, type, name)
}, },
_editModals(res, data) { _editModals(res, data) {
if (res === '登记协议') { if (res === '登记协议') {
...@@ -429,7 +434,11 @@ export default { ...@@ -429,7 +434,11 @@ export default {
}, },
_operationRecord(id) { _operationRecord(id) {
// 操作日志 // 操作日志
this.$refs.operation._open(id) this.currentComponent = 'Operation'
this.$nextTick(() => {
this.$refs.refModal._open(id)
})
// this.$refs.operation._open(id)
}, },
_resultChange(msg) { _resultChange(msg) {
if (this.$store.state.FoodContract.success) { if (this.$store.state.FoodContract.success) {
...@@ -440,7 +449,11 @@ export default { ...@@ -440,7 +449,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')
} }
} }
} }
......
...@@ -61,10 +61,14 @@ ...@@ -61,10 +61,14 @@
</div> </div>
<!--组件加载--> <!--组件加载-->
<!--选择领样人--> <!--选择领样人-->
<UserInfo ref="userModal" @on-result-change="_userResult"></UserInfo> <keep-alive>
<Operation ref="operation"></Operation> <!-- eslint-disable-next-line vue/require-component-is -->
<FileManage ref="FileManage"></FileManage> <component ref="refModal" :is="currentComponent" @on-result-change="_componentResult"></component>
<SoilSampleManageHis ref="sampleManageModal"></SoilSampleManageHis> </keep-alive>
<!-- <UserInfo ref="userModal" @on-result-change="_userResult"></UserInfo>-->
<!-- <Operation ref="operation"></Operation>-->
<!-- <FileManage ref="FileManage"></FileManage>-->
<!-- <SoilSampleManageHis ref="sampleManageModal"></SoilSampleManageHis>-->
</div> </div>
</template> </template>
<script> <script>
...@@ -73,11 +77,8 @@ import { soilTest } from '../../../api' ...@@ -73,11 +77,8 @@ 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: { // eslint-disable-next-line vue/no-unused-components
UserInfo, components: { UserInfo, Operation, SoilSampleManageHis },
Operation,
SoilSampleManageHis
},
data() { data() {
return { return {
formObj: { formObj: {
...@@ -89,7 +90,7 @@ export default { ...@@ -89,7 +90,7 @@ export default {
{ {
type: 'ios-beaker', type: 'ios-beaker',
id: '', id: '',
name: '审核数据' name: '管理样品'
}, },
{ type: 'md-cloud', id: '', name: '附件' }, { type: 'md-cloud', id: '', name: '附件' },
{ {
...@@ -107,7 +108,7 @@ export default { ...@@ -107,7 +108,7 @@ export default {
{ title: '水深(米)', key: 'waterDepth', width: 120 }, { title: '水深(米)', key: 'waterDepth', width: 120 },
{ title: '钻孔名称', key: 'boreholeName', width: 120 }, { title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '进度', key: 'progress', width: 120, status: true }, { title: '进度', key: 'progress', width: 120, status: true },
// { title: '工程号', key: 'projectNo', width: 120 }, // { title: '平均容重', key: 'projectNo', width: 120 },
// { title: '报告编号', key: 'reportCode', width: 120 }, // { title: '报告编号', key: 'reportCode', width: 120 },
{ title: '制表日期', key: 'tabulateDate', width: 120, date: true }, { title: '制表日期', key: 'tabulateDate', width: 120, date: true },
{ title: '制表人', key: 'tabulater', width: 120 }, { title: '制表人', key: 'tabulater', width: 120 },
...@@ -345,7 +346,7 @@ export default { ...@@ -345,7 +346,7 @@ export default {
console.log(res) console.log(res)
this.$nextTick(() => { this.$nextTick(() => {
switch (res) { switch (res) {
case '审核数据': case '管理样品':
this._editModal(data.id, data.type, data.cname) this._editModal(data.id, data.type, data.cname)
break break
case '项目管理': case '项目管理':
...@@ -364,7 +365,11 @@ export default { ...@@ -364,7 +365,11 @@ export default {
}) })
}, },
_editModal(id, type, name) { _editModal(id, type, name) {
this.$refs.sampleManageModal._open(id, type, '数据录入') this.currentComponent = 'SoilSampleManageHis'
this.$nextTick(() => {
this.$refs.refModal._open(id, type, '数据录入')
})
// this.$refs.sampleManageModal._open(id, type, '数据录入')
}, },
_editModals(res, data) { _editModals(res, data) {
if (res === '登记协议') { if (res === '登记协议') {
...@@ -429,7 +434,11 @@ export default { ...@@ -429,7 +434,11 @@ export default {
}, },
_operationRecord(id) { _operationRecord(id) {
// 操作日志 // 操作日志
this.$refs.operation._open(id) this.currentComponent = 'Operation'
this.$nextTick(() => {
this.$refs.refModal._open(id)
})
// this.$refs.operation._open(id)
}, },
_resultChange(msg) { _resultChange(msg) {
if (this.$store.state.FoodContract.success) { if (this.$store.state.FoodContract.success) {
...@@ -440,7 +449,11 @@ export default { ...@@ -440,7 +449,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')
} }
} }
} }
......
...@@ -61,10 +61,14 @@ ...@@ -61,10 +61,14 @@
</div> </div>
<!--组件加载--> <!--组件加载-->
<!--选择领样人--> <!--选择领样人-->
<UserInfo ref="userModal" @on-result-change="_userResult"></UserInfo> <keep-alive>
<Operation ref="operation"></Operation> <!-- eslint-disable-next-line vue/require-component-is -->
<SampleManage ref="sampleManageModal" @on-result-change="_page"></SampleManage> <component ref="refModal" :is="currentComponent" @on-result-change="_componentResult"></component>
<FileManage ref="FileManage"></FileManage> </keep-alive>
<!-- <UserInfo ref="userModal" @on-result-change="_userResult"></UserInfo>-->
<!-- <Operation ref="operation"></Operation>-->
<!-- <SampleManage ref="sampleManageModal" @on-result-change="_page"></SampleManage>-->
<!-- <FileManage ref="FileManage"></FileManage>-->
</div> </div>
</template> </template>
<script> <script>
...@@ -73,12 +77,8 @@ import { soilTest } from '../../../api' ...@@ -73,12 +77,8 @@ import { soilTest } from '../../../api'
import Operation from '../../../components/operation/Operation' import Operation from '../../../components/operation/Operation'
import SampleManage from './SampleManage' import SampleManage from './SampleManage'
export default { export default {
components: {
UserInfo,
Operation,
// eslint-disable-next-line vue/no-unused-components // eslint-disable-next-line vue/no-unused-components
SampleManage components: { UserInfo, Operation, SampleManage },
},
data() { data() {
return { return {
formObj: { formObj: {
...@@ -108,7 +108,7 @@ export default { ...@@ -108,7 +108,7 @@ export default {
{ title: '水深(米)', key: 'waterDepth', width: 120 }, { title: '水深(米)', key: 'waterDepth', width: 120 },
{ title: '钻孔名称', key: 'boreholeName', width: 120 }, { title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '进度', key: 'progress', width: 120, status: true }, { title: '进度', key: 'progress', width: 120, status: true },
// { title: '工程号', key: 'projectNo', width: 120 }, // { title: '平均容重', key: 'projectNo', width: 120 },
// { title: '报告编号', key: 'reportCode', width: 120 }, // { title: '报告编号', key: 'reportCode', width: 120 },
{ title: '制表日期', key: 'tabulateDate', width: 120, date: true }, { title: '制表日期', key: 'tabulateDate', width: 120, date: true },
{ title: '制表人', key: 'tabulater', width: 120 }, { title: '制表人', key: 'tabulater', width: 120 },
...@@ -139,7 +139,7 @@ export default { ...@@ -139,7 +139,7 @@ export default {
} }
}, },
mounted() { mounted() {
this._page() // this._page()
// 样品接收是否选择人员 // 样品接收是否选择人员
// this.acceptSelectUserValue = localStorage.getItem('acceptSelectUserValue') // this.acceptSelectUserValue = localStorage.getItem('acceptSelectUserValue')
}, },
...@@ -365,7 +365,11 @@ export default { ...@@ -365,7 +365,11 @@ export default {
}) })
}, },
_editModal(id, type, name) { _editModal(id, type, name) {
this.$refs.sampleManageModal._open(id, type, '数据录入') this.currentComponent = 'SampleManage'
this.$nextTick(() => {
this.$refs.refModal._open(id, type, '数据录入')
})
// this.$refs.sampleManageModal._open(id, type, '数据录入')
}, },
_editModals(res, data) { _editModals(res, data) {
if (res === '登记协议') { if (res === '登记协议') {
...@@ -429,8 +433,12 @@ export default { ...@@ -429,8 +433,12 @@ export default {
this._page() this._page()
}, },
_operationRecord(id) { _operationRecord(id) {
this.currentComponent = 'Operation'
this.$nextTick(() => {
this.$refs.refModal._open(id)
})
// 操作日志 // 操作日志
this.$refs.operation._open(id) // this.$refs.operation._open(id)
}, },
_resultChange(msg) { _resultChange(msg) {
if (this.$store.state.FoodContract.success) { if (this.$store.state.FoodContract.success) {
...@@ -441,7 +449,11 @@ export default { ...@@ -441,7 +449,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')
} }
} }
} }
......
...@@ -61,10 +61,14 @@ ...@@ -61,10 +61,14 @@
</div> </div>
<!--组件加载--> <!--组件加载-->
<!--选择领样人--> <!--选择领样人-->
<UserInfo ref="userModal" @on-result-change="_userResult"></UserInfo> <keep-alive>
<Operation ref="operation"></Operation> <!-- eslint-disable-next-line vue/require-component-is -->
<FileManage ref="FileManage"></FileManage> <component ref="refModal" :is="currentComponent" @on-result-change="_componentResult"></component>
<SoilSampleManageHis ref="sampleManageModal"></SoilSampleManageHis> </keep-alive>
<!-- <UserInfo ref="userModal" @on-result-change="_userResult"></UserInfo>-->
<!-- <Operation ref="operation"></Operation>-->
<!-- <FileManage ref="FileManage"></FileManage>-->
<!-- <SoilSampleManageHis ref="sampleManageModal"></SoilSampleManageHis>-->
</div> </div>
</template> </template>
<script> <script>
...@@ -73,11 +77,8 @@ import { soilTest } from '../../../api' ...@@ -73,11 +77,8 @@ 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: { // eslint-disable-next-line vue/no-unused-components
UserInfo, components: { UserInfo, Operation, SoilSampleManageHis },
Operation,
SoilSampleManageHis
},
data() { data() {
return { return {
formObj: { formObj: {
...@@ -107,7 +108,7 @@ export default { ...@@ -107,7 +108,7 @@ export default {
{ title: '水深(米)', key: 'waterDepth', width: 120 }, { title: '水深(米)', key: 'waterDepth', width: 120 },
{ title: '钻孔名称', key: 'boreholeName', width: 120 }, { title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '进度', key: 'progress', width: 120, status: true }, { title: '进度', key: 'progress', width: 120, status: true },
{ title: '工程号', key: 'projectNo', width: 120 }, { title: '平均容重', key: 'projectNo', width: 120 },
{ title: '报告编号', key: 'reportCode', width: 120 }, { title: '报告编号', key: 'reportCode', width: 120 },
{ title: '制表日期', key: 'tabulateDate', width: 120, date: true }, { title: '制表日期', key: 'tabulateDate', width: 120, date: true },
{ title: '制表人', key: 'tabulater', width: 120 }, { title: '制表人', key: 'tabulater', width: 120 },
...@@ -138,7 +139,7 @@ export default { ...@@ -138,7 +139,7 @@ export default {
} }
}, },
mounted() { mounted() {
this._page() // this._page()
// 样品接收是否选择人员 // 样品接收是否选择人员
// this.acceptSelectUserValue = localStorage.getItem('acceptSelectUserValue') // this.acceptSelectUserValue = localStorage.getItem('acceptSelectUserValue')
}, },
...@@ -364,7 +365,11 @@ export default { ...@@ -364,7 +365,11 @@ export default {
}) })
}, },
_editModal(id, type, name) { _editModal(id, type, name) {
this.$refs.sampleManageModal._open(id, type, name) this.currentComponent = 'SoilSampleManageHis'
this.$nextTick(() => {
this.$refs.refModal._open(id, type, name)
})
// this.$refs.sampleManageModal._open(id, type, name)
}, },
_editModals(res, data) { _editModals(res, data) {
if (res === '登记协议') { if (res === '登记协议') {
...@@ -429,7 +434,11 @@ export default { ...@@ -429,7 +434,11 @@ export default {
}, },
_operationRecord(id) { _operationRecord(id) {
// 操作日志 // 操作日志
this.$refs.operation._open(id) this.currentComponent = 'Operation'
this.$nextTick(() => {
this.$refs.refModal._open(id)
})
// this.$refs.operation._open(id)
}, },
_resultChange(msg) { _resultChange(msg) {
if (this.$store.state.FoodContract.success) { if (this.$store.state.FoodContract.success) {
...@@ -440,7 +449,11 @@ export default { ...@@ -440,7 +449,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')
} }
} }
} }
......
...@@ -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="wait">-->
<!-- <SampleBackupsManage ref="waitTabs"></SampleBackupsManage>-->
<!-- </el-tab-pane>-->
<!-- <el-tab-pane label="录入历史" name="query">-->
<!-- <SampleBackupsQuery ref="queryTabs"></SampleBackupsQuery>-->
<!-- </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="wait"> <el-tab-pane label="数据录入" name="waitTabs"></el-tab-pane>
<SampleBackupsManage ref="waitTabs"></SampleBackupsManage> <el-tab-pane label="录入历史" name="queryTabs"></el-tab-pane>
</el-tab-pane>
<el-tab-pane label="录入历史" name="query">
<SampleBackupsQuery ref="queryTabs"></SampleBackupsQuery>
</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 +28,37 @@ import SampleBackupsManage from './TestInput' ...@@ -20,28 +28,37 @@ import SampleBackupsManage from './TestInput'
import SampleBackupsQuery from './TestInputHis' import SampleBackupsQuery from './TestInputHis'
export default { export default {
components: { // eslint-disable-next-line vue/no-unused-components
SampleBackupsManage, components: { SampleBackupsManage, SampleBackupsQuery },
SampleBackupsQuery
},
data() { data() {
return { return {
activeName: 'wait' activeName: 'waitTabs',
currentComponent: ''
} }
}, },
mounted() { mounted() {
this.activeName = 'wait' this.activeName = 'waitTabs'
this.$refs.waitTabs._page() this._page()
}, },
methods: { methods: {
_changeTabs(tab, event) { _changeTabs(tab, event) {
if (tab.name === 'wait') { if (tab.name === 'waitTabs') {
this.$refs.waitTabs._page() this._page()
} else if (tab.name === 'applyRecord') { } else if (tab.name === 'applyRecord') {
// this.$refs.applyRecordTabs._page() // this.$refs.applyRecordTabs._page()
} else { } else {
this.$refs.queryTabs._page() this.currentComponent = 'SampleBackupsQuery'
this.$nextTick(() => {
this.$refs.refModal._page()
})
} }
},
_page() {
this.currentComponent = 'SampleBackupsManage'
this.$nextTick(() => {
this.$refs.refModal._page()
})
// this.$refs.entrustTabs._page()
} }
} }
} }
......
...@@ -59,11 +59,15 @@ ...@@ -59,11 +59,15 @@
</div> </div>
<!--组件加载--> <!--组件加载-->
<!--选择领样人--> <!--选择领样人-->
<UserInfo ref="userModal" @on-result-change="_userResult"></UserInfo> <!-- <UserInfo ref="userModal" @on-result-change="_userResult"></UserInfo>-->
<SampleManage ref="sampleManageModal" @on-result-change="_page"></SampleManage> <!-- <SampleManage ref="sampleManageModal" @on-result-change="_page"></SampleManage>-->
<ItemManage ref="itemManageModal" @on-result-change="_page"></ItemManage> <!-- <ItemManage ref="itemManageModal" @on-result-change="_page"></ItemManage>-->
<Operation ref="operation"></Operation> <!-- <Operation ref="operation"></Operation>-->
<FileManage ref="FileManage"></FileManage> <!-- <FileManage ref="FileManage"></FileManage>-->
<keep-alive>
<!-- eslint-disable-next-line vue/require-component-is -->
<component ref="refModal" :is="currentComponent" @on-result-change="_componentResult"></component>
</keep-alive>
</div> </div>
</template> </template>
<script> <script>
...@@ -73,12 +77,8 @@ import Operation from '../../../components/operation/Operation' ...@@ -73,12 +77,8 @@ import Operation from '../../../components/operation/Operation'
import SampleManage from './entrust-sample-manage/SampleManage' import SampleManage from './entrust-sample-manage/SampleManage'
import ItemManage from './ItemManage' import ItemManage from './ItemManage'
export default { export default {
components: { // eslint-disable-next-line vue/no-unused-components
UserInfo, components: { UserInfo, SampleManage, ItemManage, Operation },
SampleManage,
ItemManage,
Operation
},
data() { data() {
return { return {
formObj: { formObj: {
...@@ -200,7 +200,11 @@ export default { ...@@ -200,7 +200,11 @@ export default {
}) })
}, },
_editModal(id, type) { _editModal(id, type) {
this.$refs.sampleManageModal._open(id, type, '分配历史') this.currentComponent = 'SampleManage'
this.$nextTick(() => {
this.$refs.refModal._open(id, type, '分配历史')
})
// this.$refs.sampleManageModal._open(id, type, '分配历史')
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
...@@ -233,12 +237,20 @@ export default { ...@@ -233,12 +237,20 @@ export default {
}, },
_operationRecord(id) { _operationRecord(id) {
// 操作日志 // 操作日志
this.$refs.operation._open(id) this.currentComponent = 'Operation'
this.$nextTick(() => {
this.$refs.refModal._open(id)
})
// this.$refs.operation._open(id)
}, },
_resultChange(msg) {}, _resultChange(msg) {},
_upload(id) { _upload(id) {
this.currentComponent = 'FileManage'
this.$nextTick(() => {
this.$refs.refModal._open(id, 'entrustId')
})
// 上传文件 // 上传文件
this.$refs.FileManage._open(id, 'entrustId') // this.$refs.FileManage._open(id, 'entrustId')
} }
} }
} }
......
...@@ -39,7 +39,7 @@ export default { ...@@ -39,7 +39,7 @@ export default {
{ key: 'belongUnit', title: '归口单位' }, { key: 'belongUnit', title: '归口单位' },
{ key: 'publishUnit', title: '发布单位' } { key: 'publishUnit', title: '发布单位' }
], ],
modalTitle: '添加食品标准表', modalTitle: '收样位置选择',
formObj: { formObj: {
receiveLocation: '', receiveLocation: '',
locationId: '' locationId: ''
......
...@@ -61,11 +61,15 @@ ...@@ -61,11 +61,15 @@
</div> </div>
<!--组件加载--> <!--组件加载-->
<!--选择领样人--> <!--选择领样人-->
<UserInfo ref="userModal" @on-result-change="_userResult"></UserInfo> <keep-alive>
<SampleManage ref="sampleManageModal" @on-result-change="_page"></SampleManage> <!-- eslint-disable-next-line vue/require-component-is -->
<ItemManage ref="itemManageModal" @on-result-change="_page"></ItemManage> <component ref="refModal" :is="currentComponent" @on-result-change="_componentResult"></component>
<Operation ref="operation"></Operation> </keep-alive>
<FileManage ref="FileManage"></FileManage> <!-- <UserInfo ref="userModal" @on-result-change="_userResult"></UserInfo>-->
<!-- <SampleManage ref="sampleManageModal" @on-result-change="_page"></SampleManage>-->
<!-- <ItemManage ref="itemManageModal" @on-result-change="_page"></ItemManage>-->
<!-- <Operation ref="operation"></Operation>-->
<!-- <FileManage ref="FileManage"></FileManage>-->
</div> </div>
</template> </template>
<script> <script>
...@@ -76,9 +80,13 @@ import SampleManage from './entrust-sample-manage/SampleManage' ...@@ -76,9 +80,13 @@ import SampleManage from './entrust-sample-manage/SampleManage'
import ItemManage from './ItemManage' import ItemManage from './ItemManage'
export default { export default {
components: { components: {
// eslint-disable-next-line vue/no-unused-components
UserInfo, UserInfo,
// eslint-disable-next-line vue/no-unused-components
SampleManage, SampleManage,
// eslint-disable-next-line vue/no-unused-components
ItemManage, ItemManage,
// eslint-disable-next-line vue/no-unused-components
Operation Operation
}, },
data() { data() {
...@@ -362,7 +370,11 @@ export default { ...@@ -362,7 +370,11 @@ export default {
}) })
}, },
_editModal(id, type) { _editModal(id, type) {
this.$refs.sampleManageModal._open(id, type, '按委托分配') this.currentComponent = 'SampleManage'
this.$nextTick(() => {
this.$refs.refModal._open(id, type, '按委托分配')
})
// this.$refs.sampleManageModal._open(id, type, '按委托分配')
}, },
_editModals(res, data) { _editModals(res, data) {
if (res === '登记协议') { if (res === '登记协议') {
...@@ -426,7 +438,11 @@ export default { ...@@ -426,7 +438,11 @@ export default {
}, },
_operationRecord(id) { _operationRecord(id) {
// 操作日志 // 操作日志
this.$refs.operation._open(id) this.currentComponent = 'Operation'
this.$nextTick(() => {
this.$refs.refModal._open(id)
})
// this.$refs.operation._open(id)
}, },
_resultChange(msg) { _resultChange(msg) {
if (this.$store.state.FoodContract.success) { if (this.$store.state.FoodContract.success) {
...@@ -437,7 +453,11 @@ export default { ...@@ -437,7 +453,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')
} }
} }
} }
......
...@@ -39,7 +39,7 @@ export default { ...@@ -39,7 +39,7 @@ export default {
{ key: 'belongUnit', title: '归口单位' }, { key: 'belongUnit', title: '归口单位' },
{ key: 'publishUnit', title: '发布单位' } { key: 'publishUnit', title: '发布单位' }
], ],
modalTitle: '添加食品标准表', modalTitle: '收样位置选择',
formObj: { formObj: {
receiveLocation: '', receiveLocation: '',
locationId: '' locationId: ''
......
...@@ -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="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>
...@@ -21,13 +21,12 @@ import ReceiveByEntrust from './AllotByEntrust' ...@@ -21,13 +21,12 @@ import ReceiveByEntrust from './AllotByEntrust'
export default { export default {
name: 'MeterSummaryEntrustIndex', name: 'MeterSummaryEntrustIndex',
components: { // eslint-disable-next-line vue/no-unused-components
ReceiveByEntrust, components: { ReceiveByEntrust, ReceiveBySample },
ReceiveBySample
},
data() { data() {
return { return {
activeName: 'entrust' activeName: 'entrust',
currentComponent: ''
} }
}, },
mounted() { mounted() {
...@@ -39,11 +38,19 @@ export default { ...@@ -39,11 +38,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()
} }
} }
} }
......
...@@ -10,9 +10,11 @@ import ReviewEntrust from '../pages/meter-entrust/entrust-review/ReviewEntrust' ...@@ -10,9 +10,11 @@ import ReviewEntrust from '../pages/meter-entrust/entrust-review/ReviewEntrust'
import SampleReceiveIndex from '../pages/soil-sample-manage/sample-receive/SampleReceiveIndex' import SampleReceiveIndex from '../pages/soil-sample-manage/sample-receive/SampleReceiveIndex'
import SamplePreparationIndex from '../pages/soil-sample-manage/sample-preparation/SamplePreparationIndex' import SamplePreparationIndex from '../pages/soil-sample-manage/sample-preparation/SamplePreparationIndex'
import AddressManage from '../pages/soil-sample-manage/sample-address/AddressManage' import AddressManage from '../pages/soil-sample-manage/sample-address/AddressManage'
import KeepAdress from '../pages/soil-sample-manage/keep-address/AddressManage'
import BackupsManage from '../pages/soil-sample-manage/backups-manage/SampleBackupsIndex' import BackupsManage from '../pages/soil-sample-manage/backups-manage/SampleBackupsIndex'
import SampleTakeIndex from '../pages/soil-sample-manage/sample-take/SampleTakeIndex' import SampleTakeIndex from '../pages/soil-sample-manage/sample-take/SampleTakeIndex'
import SurplusManage from '../pages/soil-sample-manage/surplus-manage/SampleSurplusIndex' import SurplusManage from '../pages/soil-sample-manage/surplus-manage/SampleSurplusIndex'
import DuplicateManage from '../pages/soil-sample-manage/duplicate-manage/SampleduplicateIndex'
import TestTaskIndex from '../pages/soil-test-manage/test-task-manage/TestTaskIndex' import TestTaskIndex from '../pages/soil-test-manage/test-task-manage/TestTaskIndex'
import TestInputIndex from '../pages/soil-test-manage/test-input/TestInputIndex' import TestInputIndex from '../pages/soil-test-manage/test-input/TestInputIndex'
import CheckIndex from '../pages/soil-test-manage/test-data-check/CheckIndex' import CheckIndex from '../pages/soil-test-manage/test-data-check/CheckIndex'
...@@ -78,11 +80,21 @@ export default [ ...@@ -78,11 +80,21 @@ export default [
meta: { title: '备样管理' } meta: { title: '备样管理' }
}, },
{ {
path: 'keep',
component: KeepAdress,
meta: { title: '留存位置查询' }
},
{
path: 'surplus', path: 'surplus',
component: SurplusManage, component: SurplusManage,
meta: { title: '余样管理' } meta: { title: '余样管理' }
}, },
{ {
path: 'copy',
component: DuplicateManage,
meta: { title: '副样管理' }
},
{
path: 'dispose', path: 'dispose',
component: SampleDisposeIndex, component: SampleDisposeIndex,
meta: { title: '样品处理' } 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