Commit b81ffddd by wangweidong

Merge remote-tracking branch 'origin/dev' into dev

parents e720d7ce 06524e7b
...@@ -31,8 +31,16 @@ export default { ...@@ -31,8 +31,16 @@ export default {
http.post('soil/v1/entrust/page_sample_receive_his', data).then(res => res), http.post('soil/v1/entrust/page_sample_receive_his', data).then(res => res),
pageSamplePrepare: data => pageSamplePrepare: data =>
http.post('soil/v1/entrust/page_sample_prepare', data).then(res => res), http.post('soil/v1/entrust/page_sample_prepare', data).then(res => res),
pageSamplePrepareCheck: data =>
http
.post('soil/v1/entrust/page_sample_prepare_check', data)
.then(res => res),
pageSamplePrepareHis: data => pageSamplePrepareHis: data =>
http.post('soil/v1/entrust/page_sample_prepare_his', data).then(res => res), http.post('soil/v1/entrust/page_sample_prepare_his', data).then(res => res),
pageSamplePrepareCheckHis: data =>
http
.post('soil/v1/entrust/page_sample_prepare_check_his', data)
.then(res => res),
getById: data => http.get('soil/v1/entrust/' + data).then(res => res), getById: data => http.get('soil/v1/entrust/' + data).then(res => res),
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 =>
...@@ -81,6 +89,8 @@ export default { ...@@ -81,6 +89,8 @@ export default {
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 =>
http.post('soil/v1/sample/page_prepare', data).then(res => res), http.post('soil/v1/sample/page_prepare', data).then(res => res),
pagePrepareCheck: data =>
http.post('soil/v1/sample/page_prepare_check', data).then(res => res),
pagePrepareHis: data => pagePrepareHis: data =>
http.post('soil/v1/sample/page_prepare_his', data).then(res => res), http.post('soil/v1/sample/page_prepare_his', data).then(res => res),
pagePrepareDetailHis: data => pagePrepareDetailHis: data =>
......
...@@ -179,5 +179,20 @@ export default { ...@@ -179,5 +179,20 @@ export default {
pageSecondaryHis: data => pageSecondaryHis: data =>
http.post('soil/v1/prepare/page_secondary_his', data).then(res => res), http.post('soil/v1/prepare/page_secondary_his', data).then(res => res),
sampleDeleteById: data => sampleDeleteById: data =>
http.delete('soil/v1/sample/?ids=' + data).then(res => res) http.delete('soil/v1/sample/?ids=' + data).then(res => res),
// 制备审核通过
prepareCheckOk: data =>
http.post('soil/v1/sample/prepare_check_ok?ids=' + data).then(res => res),
// 制备审核驳回
prepareCheckBack: data =>
http
.post(
'soil/v1/sample/prepare_check_back?ids=' +
data.ids +
'&remark=' +
data.remark
)
.then(res => res),
sampleBringOut: data =>
http.post('soil/v1/sample/sample_bring_out?ids=' + data).then(res => res)
} }
...@@ -14,6 +14,9 @@ ...@@ -14,6 +14,9 @@
<Form-item class="search-item" label="试样编号:"> <Form-item class="search-item" label="试样编号:">
<Input @on-enter="_formSearch" v-model="formObj.sampleCode" name="sampleCode" placeholder="请输入试样编号" clearable/> <Input @on-enter="_formSearch" v-model="formObj.sampleCode" name="sampleCode" placeholder="请输入试样编号" clearable/>
</Form-item> </Form-item>
<Form-item class="search-item" label="钻孔名称:">
<Input @on-enter="_formSearch" v-model="formObj.boreholeName" name="boreholeName" placeholder="请输入钻孔名称" clearable/>
</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>
...@@ -89,9 +92,15 @@ export default { ...@@ -89,9 +92,15 @@ export default {
formObj: { formObj: {
entrustCode: undefined, entrustCode: undefined,
sampleCode: undefined, sampleCode: undefined,
name: undefined name: undefined,
boreholeName: undefined
}, },
btn: [ btn: [
{
type: 'success',
id: '',
name: '调出'
}
// { // {
// type: 'success', // type: 'success',
// id: '', // id: '',
...@@ -107,6 +116,7 @@ export default { ...@@ -107,6 +116,7 @@ export default {
{ title: '委托商', key: 'client', width: 200 }, { title: '委托商', key: 'client', width: 200 },
{ title: '委托编号', key: 'entrustCode', width: 120 }, { title: '委托编号', key: 'entrustCode', width: 120 },
{ title: '试样编号', key: 'sampleCode', width: 100 }, { title: '试样编号', key: 'sampleCode', width: 100 },
{ title: '钻孔名称', key: 'boreholeName', width: 100 },
{ title: '试样深度', key: 'sampleDepth', width: 95 }, { title: '试样深度', key: 'sampleDepth', width: 95 },
{ title: '现场编号', key: 'siteNo', width: 100 }, { title: '现场编号', key: 'siteNo', width: 100 },
{ title: '接收人', key: 'receiver', width: 120 }, { title: '接收人', key: 'receiver', width: 120 },
...@@ -188,6 +198,9 @@ export default { ...@@ -188,6 +198,9 @@ export default {
case '导出': case '导出':
// this._export() // this._export()
break break
case '调出':
this._callout()
break
// 收起搜索 // 收起搜索
case 'search': case 'search':
this.searchOpen = !this.searchOpen this.searchOpen = !this.searchOpen
...@@ -223,6 +236,27 @@ export default { ...@@ -223,6 +236,27 @@ export default {
} }
}) })
}, },
_callout() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
this.$Modal.confirm({
title: '提示',
content: '确定调出这' + this.selectIds.length + '条记录?',
onOk: () => {
this._calloutOk()
}
})
}
},
_calloutOk() {
console.log(this.selectIds)
const result = soilSample.sampleBringOut(this.selectIds)
if (result) {
this.$Message.success('调出成功')
this._page()
}
},
_upload(id) { _upload(id) {
const obj = { const obj = {
importUrl: '/soil/v1/standard_annex/upload/' + id importUrl: '/soil/v1/standard_annex/upload/' + id
......
...@@ -4,14 +4,7 @@ ...@@ -4,14 +4,7 @@
class="zIndex-900 modal-footer-none"> class="zIndex-900 modal-footer-none">
<p slot="header">管理样品</p> <p slot="header">管理样品</p>
<div> <div>
<el-tabs v-model="activeName" @tab-click="_changeTabs"> <SoilSampleManage ref="prepareManage"></SoilSampleManage>
<el-tab-pane label="制备管理" name="prepareManage">
<SoilSampleManage ref="prepareManage"></SoilSampleManage>
</el-tab-pane>
<el-tab-pane label="原始记录填写" name="recordModal">
<RecordWrite ref="recordModal"></RecordWrite>
</el-tab-pane>
</el-tabs>
<!-- <keep-alive>--> <!-- <keep-alive>-->
<!-- &lt;!&ndash; eslint-disable-next-line vue/require-component-is &ndash;&gt;--> <!-- &lt;!&ndash; eslint-disable-next-line vue/require-component-is &ndash;&gt;-->
<!-- <component ref="refModal" :is="currentComponent"></component>--> <!-- <component ref="refModal" :is="currentComponent"></component>-->
...@@ -21,12 +14,10 @@ ...@@ -21,12 +14,10 @@
</div> </div>
</template> </template>
<script> <script>
import SoilSampleManage from '../SoilSampleManageTab' import SoilSampleManage from './SoilSampleManage'
import RecordWrite from './sample-preparation-record/RecordIndex'
export default { export default {
components: { components: {
SoilSampleManage, SoilSampleManage
RecordWrite
}, },
data() { data() {
return { return {
...@@ -36,9 +27,7 @@ export default { ...@@ -36,9 +27,7 @@ export default {
showSampleModal: false, showSampleModal: false,
modalTitle: '', modalTitle: '',
selectIds: [], selectIds: [],
activeName: 'prepareManage', name: ''
name: '',
currentComponent: ''
} }
}, },
mounted() {}, mounted() {},
...@@ -48,7 +37,6 @@ export default { ...@@ -48,7 +37,6 @@ export default {
this.name = name this.name = name
this.showSampleModal = true this.showSampleModal = true
this.entrustId = entrustId // 委托id this.entrustId = entrustId // 委托id
this.activeName = 'prepareManage'
this.selectIds = [] this.selectIds = []
this._preparePage() this._preparePage()
}, },
...@@ -56,23 +44,8 @@ export default { ...@@ -56,23 +44,8 @@ export default {
_preparePage() { _preparePage() {
this.$refs.prepareManage._open(this.entrustId) this.$refs.prepareManage._open(this.entrustId)
}, },
// 原始记录填写
_recordPage() {
this.$refs.recordModal._open(this.entrustId)
},
_changeTabs(tab, event) {
if (tab.name === 'prepareManage') {
// this._issuedPage()
this.$refs.prepareManage._open(this.entrustId)
this.$refs.recordModal._clearTable()
} else {
this.$refs.recordModal._open(this.entrustId)
}
},
// 关闭弹框的时候刷新上个界面
_visibleChange(data) { _visibleChange(data) {
if (data === false) { this.$emit('on-result-change')
}
} }
} }
} }
......
...@@ -60,8 +60,6 @@ import Operation from '../../../components/operation/Operation' ...@@ -60,8 +60,6 @@ import Operation from '../../../components/operation/Operation'
import global from '../../../api/config' import global from '../../../api/config'
import SampleManage from './SampleManage' import SampleManage from './SampleManage'
import SamplePreparationEdit from './SamplePreparationEdit' import SamplePreparationEdit from './SamplePreparationEdit'
import SoilSampleItemManageEdit from './SoilSampleItemManageEdit'
import SoilEntrustItemNum from './SoilItemNum'
export default { export default {
components: { components: {
// eslint-disable-next-line vue/no-unused-components // eslint-disable-next-line vue/no-unused-components
...@@ -69,11 +67,7 @@ export default { ...@@ -69,11 +67,7 @@ export default {
// eslint-disable-next-line vue/no-unused-components // eslint-disable-next-line vue/no-unused-components
SamplePreparationEdit, SamplePreparationEdit,
// eslint-disable-next-line vue/no-unused-components // eslint-disable-next-line vue/no-unused-components
SampleManage, SampleManage
// eslint-disable-next-line vue/no-unused-components
SoilSampleItemManageEdit,
// eslint-disable-next-line vue/no-unused-components
SoilEntrustItemNum
}, },
data() { data() {
return { return {
...@@ -88,16 +82,6 @@ export default { ...@@ -88,16 +82,6 @@ export default {
name: '试样列表' name: '试样列表'
}, },
{ {
type: 'ios-apps',
id: '',
name: '试验项目列表'
},
{
type: 'ios-calculator-outline',
id: '',
name: '项目量统计'
},
{
type: 'ios-download', type: 'ios-download',
id: '', id: '',
name: '导出开土制备记录' name: '导出开土制备记录'
...@@ -182,12 +166,6 @@ export default { ...@@ -182,12 +166,6 @@ export default {
case '编辑': case '编辑':
this._editModal(true, data.id) this._editModal(true, data.id)
break break
case '试验项目列表':
this._itemManage(data.id)
break
case '项目量统计':
this._itemNumManage(data.id)
break
case '导出开土制备记录': case '导出开土制备记录':
this._exportPrepare(data.id) this._exportPrepare(data.id)
break break
...@@ -315,7 +293,7 @@ export default { ...@@ -315,7 +293,7 @@ export default {
_page: async function() { _page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams()) Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj) console.log('this.formObj', this.formObj)
const result = await soilEntrust.pageSamplePrepare( const result = await soilEntrust.pageSamplePrepareCheck(
this.$serializeForm(this.formObj) this.$serializeForm(this.formObj)
) )
if (result) { if (result) {
...@@ -346,20 +324,6 @@ export default { ...@@ -346,20 +324,6 @@ export default {
this.$refs.editModal._open() this.$refs.editModal._open()
} }
}, },
// 追加项目
_itemManage(data) {
this.currentComponent = 'SoilSampleItemManageEdit'
this.$nextTick(() => {
this.$refs.refModal._openByEntrustId(data)
})
// this.$refs.itemManageModal._openByEntrustId(data)
},
_itemNumManage(data) {
this.currentComponent = 'SoilEntrustItemNum'
this.$nextTick(() => {
this.$refs.refModal._open(data)
})
},
_uploadPhoto(data) { _uploadPhoto(data) {
// 上传照片文件 // 上传照片文件
this.currentComponent = 'PhotoManage' this.currentComponent = 'PhotoManage'
......
...@@ -250,7 +250,7 @@ export default { ...@@ -250,7 +250,7 @@ export default {
_page: async function() { _page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams()) Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj) console.log('this.formObj', this.formObj)
const result = await soilEntrust.pageSamplePrepareHis(this.formObj) const result = await soilEntrust.pageSamplePrepareCheckHis(this.formObj)
if (result) { if (result) {
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
this.getPage = result this.getPage = result
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
placeholder="输入或选择制备方式"></AutoComplete> placeholder="输入或选择制备方式"></AutoComplete>
</div> </div>
<div v-else-if="item.key==='printNum'" @click="_handleRow(scope)"> <div v-else-if="item.key==='printNum'" @click="_handleRow(scope)">
<el-input v-model="scope.row.printNum" name="printNum" placeholder="输入打印数量"> <el-input v-model="scope.row.printNum" @input="inputChange(scope)" name="printNum" placeholder="输入打印数量">
</el-input> </el-input>
</div> </div>
<div v-else-if="item.key==='unit'" @click="_handleRow(scope)"> <div v-else-if="item.key==='unit'" @click="_handleRow(scope)">
...@@ -149,6 +149,7 @@ export default { ...@@ -149,6 +149,7 @@ export default {
getPage: { getPage: {
records: [] records: []
}, },
currentIndex: -1,
selectData: [], selectData: [],
selectIds: [], selectIds: [],
pageColumns: [ pageColumns: [
...@@ -206,6 +207,10 @@ export default { ...@@ -206,6 +207,10 @@ export default {
this.$refs.pageTable._showLoading() this.$refs.pageTable._showLoading()
}, },
methods: { methods: {
inputChange(data) {
this.$forceUpdate()
this.getPage.records[data.$rowIndex].printNum = data.row.printNum
},
// 获取存储位置 // 获取存储位置
_locationChange(msg, data, handleObj) { _locationChange(msg, data, handleObj) {
this.currentRow = handleObj this.currentRow = handleObj
...@@ -332,6 +337,7 @@ export default { ...@@ -332,6 +337,7 @@ export default {
console.log(result[j].prepareDate) console.log(result[j].prepareDate)
console.log(new Date(result[j].prepareDate)) console.log(new Date(result[j].prepareDate))
this.getPage.records[j].prepareDate = new Date(result[j].prepareDate) this.getPage.records[j].prepareDate = new Date(result[j].prepareDate)
this.getPage.records[j].printNum = 1
} }
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
} }
......
<!--检测项目编辑列表(添加、导入检测项目)-->
<template>
<div>
<Modal
v-model="showModal"
:mask-closable="false"
:width="690"
title="检测项目管理"
>
<Row>
<Col span="24">
<Form v-model="formObj" :label-width="90" inline onsubmit="return false">
<Form-item class="search-item" label="试验名称:" style="margin-left: -25px">
<Input v-model="formObj.name" @on-enter="_formSearch" placeholder="请输入试验名称" clearable />
</Form-item>
<!-- <Form-item class="search-item" label="检测依据:">-->
<!-- <Input v-model="formObj.code" placeholder="请输入检测依据名称" clearable @on-enter="_formSearch" />-->
<!-- </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" />
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :loading="true"
:get-page="getPage" :icon-msg="iconMsg" @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.key==='judged'">
{{ scope.row[item.key]===1?'是':'否' }}
</span>
<div v-else-if="item.key==='compareSymbol'" @click.stop="_handleRow(scope)">
<el-input
v-model="scope.row.compareSymbol"
placeholder="请输入比较符"
/>
</div>
<div v-else-if="item.key==='limitValue'" @click.stop="_handleRow(scope)">
<el-input
v-model="scope.row.limitValue"
placeholder="请输入限值"
/>
</div>
<div v-else-if="item.key==='unit'" @click.stop="_handleRow(scope)">
<el-input
v-model="scope.row.unit"
placeholder="请输入单位"
/>
</div>
<div v-else-if="item.key==='code'" @click.stop="_handleRow(scope)">
<el-input
v-model="scope.row.code"
style="width: 130px;"
blur
placeholder="请选择检测依据"
/>
<i @click.stop="_selectjudgeBasis(scope.$index)" style="cursor: pointer;font-size: 14px;" class="icons iconfont pt-search icon-search"></i>
</div>
<span v-else>
{{ scope.row[item.key] }}
</span>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
<div slot="footer">
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult" />
</div>
</Modal>
</div>
</template>
<script>
import { soilAptitude } from '../../../../api'
export default {
components: {},
data() {
return {
formObj: {
catalogueId: '',
name: '',
code: '',
standardCode: '',
standardName: ''
},
showModal: false,
searchOpen: false,
btn: [],
index: '',
iconMsg: [],
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '保存', type: 'primary' }
],
pageColumns: [
{ title: '试验名称', key: 'name', width: 140 },
{ title: '大类', key: 'mainType', width: 140 },
{ title: '小类', key: 'smallType', width: 140 },
{ title: '方法', key: 'testMethod', width: 180 }
// { title: '设备', key: 'device', width: 180 },
// { title: '检测依据', key: 'code', width: 180 },
// { title: '检测科室', key: 'groupName', width: 110 },
// { title: '比较符', key: 'compareSymbol', width: 120 },
// { title: '限值', key: 'limitValue' },
// { title: '单位', key: 'unit' },
// { title: '是否系统判定', key: 'judged', width: 120, judged: true },
// { title: '备注', key: 'remark' }
],
catalogueId: '',
getPage: {},
selectData: []
}
},
methods: {
_open(catalogueId, label) {
this.formObj = this.$resetFields(this.formObj)
this.showModal = true
this.catalogueId = catalogueId
this.formObj.catalogueId = catalogueId
this.getPage.records = []
this.$refs.pageTable._hideLoading()
this._page()
// if (catalogueId) {
// this._page()
// }
},
_handleRow(scope) {
console.log(scope)
},
_selectjudgeBasis(index) {
console.log(index)
this.index = index
this.$refs.EditModal._open()
},
_backData(data) {
console.log(typeof this.index)
this.getPage.records[this.index].code = data.code
this.$set(
this.getPage.records,
this.index,
this.getPage.records[this.index]
)
console.log(this.getPage.records)
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '保存':
this._ok()
break
}
},
_page: async function() {
// this.$refs.pageTable._page('search-form-package', 'FoodJudgeBasis/page')
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilAptitude.page(this.$serializeForm(this.formObj))
if (result) {
console.log(result)
this.getPage = result
this.$refs.pageTable._hideLoading()
}
},
_btnClick(msg) {
switch (msg) {
case '导入检测项目':
this.$refs.relItemModal._open(this.catalogueId)
break
}
},
// 操作列操作
_iconClick(res, data) {
switch (res) {
case '删除':
this._deleteById(data.relPackageId)
break
}
},
// 删除
_deleteById(id) {
this.$Modal.confirm({
title: '提示',
content: '确定删除该数据?',
onOk: () => {
this._deleteOk(id)
}
})
},
// _deleteOk: async function(id) {
// // const result = await drugCatalogueItem.deleteById(id)
// if (result) {
// this.$Message.success('删除成功')
// this._page()
// }
// },
// table结果 返回整行
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this._page()
break
case 'selectData':
this.selectData = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
case 'changeSize':
this._page()
break
}
},
_ok() {
const data = this.selectData
if (data.length === 0) {
this._hideLoading()
this.$Message.warning('请选择至少一条数据!')
}
const ids = []
data.forEach(item => {
ids.push(item.id)
})
this._saveCatalogueItem(data)
},
_saveCatalogueItem(data) {
this.showModal = false
this._hideLoading()
this.$emit('on-result-change', data)
console.log('data------', data)
this._hideLoading()
},
_cancel() {
this.selectData = []
this.showModal = false
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
}
}
}
</script>
...@@ -11,13 +11,16 @@ ...@@ -11,13 +11,16 @@
<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"> <Form-item label="是否有试验项目:" class="search-item">
<Select v-model="formObj.haveExp" clearable name="groupId" style="width:150px" placeholder="请选择检测科室"> <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> <Option v-for="(item,index) in itemData" :value="item.value" :key="index">{{item.name}}</Option>
</Select> </Select>
</Form-item> </Form-item>
<Form-item label="筛选试样:" class="search-item"> <Form-item label="筛选试样:" class="search-item">
<Input @on-enter="_formSearch" v-model="formObj.experimentNames" name="experimentNames" placeholder="请输入试验项目" clearable></Input> <Input @on-enter="_formSearch" v-model="formObj.experimentNames" name="experimentNames" placeholder="请输入试验项目" clearable></Input>
</Form-item> </Form-item>
<Form-item label="试验科室:" class="search-item">
<Input @on-enter="_formSearch" v-model="formObj.groupName" name="groupName" placeholder="请输入试验科室" clearable></Input>
</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>
...@@ -61,20 +64,28 @@ ...@@ -61,20 +64,28 @@
<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> <KeepAdress ref="keepAdressModal" @on-result-change="_page"></KeepAdress>
<SampleItemSelect ref="sampleItemSelectModal" @on-result-change="_itemImportBack" is-change />
</div> </div>
</template> </template>
<script> <script>
import { soilEntrust } from '../../../../api' import { soilEntrust, soilSample } from '../../../../api'
import SampleReceiveModal from '../SampleReceiveModal' import SampleReceiveModal from '../SampleReceiveModal'
import SampleItemSelect from './SampleItemSelect'
import SoilSampleItemManage from './SoilSampleItemManage' import SoilSampleItemManage from './SoilSampleItemManage'
import KeepAdress from './KeepAdress' import KeepAdress from './KeepAdress'
export default { export default {
components: { SampleReceiveModal, SoilSampleItemManage, KeepAdress }, components: {
SampleReceiveModal,
SoilSampleItemManage,
KeepAdress,
SampleItemSelect
},
data() { data() {
return { return {
btn: [ btn: [
{ type: 'primary', id: '', name: '收样室收样' }, { type: 'primary', id: '', name: '收样室收样' },
{ type: 'primary', id: '', name: '样品留存' } { type: 'primary', id: '', name: '样品留存' },
{ type: 'primary', id: '', name: '导入试验项目' }
], ],
selectIds: [], selectIds: [],
getPage: {}, getPage: {},
...@@ -102,6 +113,7 @@ export default { ...@@ -102,6 +113,7 @@ export default {
contractId: '', // 合同id contractId: '', // 合同id
selectData: [], selectData: [],
currentComponent: '', currentComponent: '',
indexList: [],
formObj: { formObj: {
samplingNum: '', samplingNum: '',
name: '', name: '',
...@@ -109,7 +121,8 @@ export default { ...@@ -109,7 +121,8 @@ export default {
detectType: '', detectType: '',
standard: '', standard: '',
samplingLinkList: [], samplingLinkList: [],
haveExp: undefined haveExp: undefined,
groupName: undefined
}, },
stdList: [], stdList: [],
sampleLinkList: [ sampleLinkList: [
...@@ -281,12 +294,6 @@ export default { ...@@ -281,12 +294,6 @@ export default {
this.$refs.refModal._open('扫码接收发放') this.$refs.refModal._open('扫码接收发放')
} }
break break
case '导入检测项目':
this._importItem()
break
case '导入检测项目包':
this._importItemPackage()
break
case '复制历史样品检测项目': case '复制历史样品检测项目':
this._copyHisItem() this._copyHisItem()
break break
...@@ -296,6 +303,9 @@ export default { ...@@ -296,6 +303,9 @@ export default {
case '样品留存': case '样品留存':
this._sampleKeep(this.selectIds) this._sampleKeep(this.selectIds)
break break
case '导入试验项目':
this._importItem()
break
case '打印标签': case '打印标签':
this._selectPrinter('print-label') this._selectPrinter('print-label')
break break
...@@ -312,6 +322,33 @@ export default { ...@@ -312,6 +322,33 @@ export default {
} }
}) })
}, },
_importItem() {
if (this.selectIds.length === 0) {
this.$Message.warning('请选择至少一条数据!')
} else {
this.$refs.sampleItemSelectModal._open()
}
},
_itemImportBack(data) {
console.log(data)
if (data.length > 0) {
const ids = []
for (let i = 0; i < data.length; i++) {
ids.push(data[i].id)
}
this._importItemOk(ids)
}
},
_importItemOk: async function(ids) {
const result = await soilSample.importExperiments({
aptitudeIds: ids,
ids: this.selectIds
})
if (result) {
this.$Message.success('导入成功')
this._page()
}
},
// 1.自定义打印,除检样、备样、留样 增加制备标签,需要单独的查询制备标签的数据, // 1.自定义打印,除检样、备样、留样 增加制备标签,需要单独的查询制备标签的数据,
// 2.样品接收位置的制备用制备的的接口,将当前的保存方式置空,打印出来手动填写 // 2.样品接收位置的制备用制备的的接口,将当前的保存方式置空,打印出来手动填写
_cusTomePrint() { _cusTomePrint() {
...@@ -512,7 +549,7 @@ export default { ...@@ -512,7 +549,7 @@ export default {
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page': case 'page':
this.getPage = this.$store.state.FoodSample.page this._page()
break break
case 'selectData': case 'selectData':
this.selectData = data this.selectData = data
...@@ -556,27 +593,6 @@ export default { ...@@ -556,27 +593,6 @@ export default {
// }) // })
} }
}, },
// 导入检测项目包
_importItemPackage() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
this.$nextTick(() => {
this.$refs.refModal._open(this.selectIds)
})
}
},
// 导入检测项目
_importItem() {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
this.$nextTick(() => {
this.$refs.refModal._open(this.selectIds, this.selectData[0])
})
}
},
_copyHisItem() { _copyHisItem() {
if (this.selectIds.length === 0) { if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!') this.$Message.warning('请至少选中一条样品数据!')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment