Commit 8abc2808 by wangweidong

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

parents 8b869e4f 5bf063d1
...@@ -12,6 +12,8 @@ export default { ...@@ -12,6 +12,8 @@ export default {
http.post('soil/v1/entrust/page_review', data).then(res => res), http.post('soil/v1/entrust/page_review', data).then(res => res),
pageSampleReceive: data => pageSampleReceive: data =>
http.post('soil/v1/entrust/page_sample_receive', data).then(res => res), http.post('soil/v1/entrust/page_sample_receive', data).then(res => res),
pageSamplePrepare: data =>
http.post('soil/v1/entrust/page_sample_prepare', 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 =>
...@@ -42,5 +44,19 @@ export default { ...@@ -42,5 +44,19 @@ export default {
http.post('soil/v1/entrust/review_pass?ids=' + data).then(res => res), http.post('soil/v1/entrust/review_pass?ids=' + data).then(res => res),
samplePage: data => http.post('soil/v1/sample/page', data).then(res => res), samplePage: data => http.post('soil/v1/sample/page', data).then(res => res),
pageReceive: data => pageReceive: data =>
http.post('soil/v1/sample/page_receive', data).then(res => res) http.post('soil/v1/sample/page_receive', data).then(res => res),
pageSend: data =>
http.post('soil/v1/sample/page_send', data).then(res => res),
receiveSample: data =>
http.post('soil/v1/sample/receive_sample', data).then(res => res),
sendSample: data =>
http.post('soil/v1/sample/send_sample', data).then(res => res),
pagePrepare: data =>
http.post('soil/v1/sample/page_prepare', data).then(res => res),
sampleEdit: data =>
http.put(
'soil/v1/sample/' + data.id + '?describeDetail=' + data.describeDetail
),
weiteSoilDetail: data =>
http.post('soil/v1/sample/write_soil_detail', data).then(res => res)
} }
...@@ -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),
locationList: data =>
http.post('soil/v1/receive_location/list', data).then(res => res),
locationGetById: data => locationGetById: data =>
http.get('soil/v1/receive_location/' + data).then(res => res), http.get('soil/v1/receive_location/' + data).then(res => res),
locationSave: data => locationSave: data =>
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,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" :icon-msg="iconMsg" @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"
...@@ -61,6 +61,9 @@ ...@@ -61,6 +61,9 @@
<div v-else-if="item.date"> <div v-else-if="item.date">
{{ scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):'' }} {{ scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):'' }}
</div> </div>
<div v-else-if="item.key==='describeDetail'" @click.stop="_handleRow(scope)">
<el-input v-model="scope.row.describeDetail" @change="_inputChange(scope.row)"></el-input>
</div>
<div v-else> <div v-else>
{{ scope.row[item.key] }} {{ scope.row[item.key] }}
</div> </div>
...@@ -75,6 +78,7 @@ ...@@ -75,6 +78,7 @@
</div> </div>
</Modal> </Modal>
<SoilSampleItemManage ref="sampleItemManage" @on-result-change="_page"></SoilSampleItemManage> <SoilSampleItemManage ref="sampleItemManage" @on-result-change="_page"></SoilSampleItemManage>
<DescribeDetailModal ref="writeDetailModal" @on-result-change="_page"></DescribeDetailModal>
</div> </div>
</template> </template>
<script> <script>
...@@ -82,9 +86,10 @@ import http from '../../api/http' ...@@ -82,9 +86,10 @@ import http from '../../api/http'
import { soilEntrust } from '../../api' import { soilEntrust } from '../../api'
import { getLodop } from '../../plugins/clodop/LodopFuncs' import { getLodop } from '../../plugins/clodop/LodopFuncs'
import SoilSampleItemManage from './SoilSampleItemManage' import SoilSampleItemManage from './SoilSampleItemManage'
import DescribeDetailModal from './sample-preparation/DescribeDetailModal'
let LODOP let LODOP
export default { export default {
components: { SoilSampleItemManage }, components: { SoilSampleItemManage, DescribeDetailModal },
data() { data() {
return { return {
formId: 'soilSampleManage', formId: 'soilSampleManage',
...@@ -104,6 +109,11 @@ export default { ...@@ -104,6 +109,11 @@ export default {
type: 'success', type: 'success',
id: '', id: '',
name: '打印标签' name: '打印标签'
},
{
type: 'success',
id: '',
name: '批量填写土质描述详情'
} }
], ],
itemList: [], itemList: [],
...@@ -129,15 +139,9 @@ export default { ...@@ -129,15 +139,9 @@ export default {
selectData: {}, selectData: {},
getPage: {}, getPage: {},
pageColumns: [ pageColumns: [
{
title: '样品编号',
key: 'num',
width: 180,
detail: true,
fixed: 'left'
},
{ title: '试样编号', key: 'sampleCode', width: 160, fixed: 'left' }, { title: '试样编号', key: 'sampleCode', width: 160, fixed: 'left' },
{ title: '试样深度', key: 'sampleDepth', width: 160 }, { title: '试样深度', key: 'sampleDepth', width: 160 },
{ title: '土质描述详情', key: 'describeDetail', width: 160 },
{ title: '土质描述', key: 'sampleDescribe', width: 160 }, { title: '土质描述', key: 'sampleDescribe', width: 160 },
{ title: '样品包装类型', key: 'samplePack', width: 160 }, { title: '样品包装类型', key: 'samplePack', width: 160 },
{ title: '现场编号', key: 'siteNo', width: 130 } { title: '现场编号', key: 'siteNo', width: 130 }
...@@ -156,6 +160,19 @@ export default { ...@@ -156,6 +160,19 @@ export default {
} }
}, },
methods: { 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) { _footerResult(name) {
switch (name) { switch (name) {
case '取消': case '取消':
...@@ -231,6 +248,9 @@ export default { ...@@ -231,6 +248,9 @@ export default {
case '打印标签': case '打印标签':
this._printLabel() this._printLabel()
break break
case '批量填写土质描述详情':
this._writeDetail(this.selectIds)
break
case '复制历史样品检测项目': case '复制历史样品检测项目':
this._copyHisItem() this._copyHisItem()
break break
...@@ -249,6 +269,14 @@ export default { ...@@ -249,6 +269,14 @@ export default {
} }
}) })
}, },
_writeDetail(id) {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
const ids = id.join(',')
this.$refs.writeDetailModal._open(ids)
}
},
_exportSample() { _exportSample() {
if (this.selectIds.length === 0) { if (this.selectIds.length === 0) {
this.$Message.warning('请至少选择一条样品') this.$Message.warning('请至少选择一条样品')
...@@ -355,7 +383,7 @@ export default { ...@@ -355,7 +383,7 @@ export default {
_page: async function() { _page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams()) Object.assign(this.formObj, this.$refs.pageTable._searchParams())
this.formObj.entrustId = this.contractId this.formObj.entrustId = this.contractId
const result = await soilEntrust.samplePage( const result = await soilEntrust.pagePrepare(
this.$serializeForm(this.formObj) this.$serializeForm(this.formObj)
) )
if (result) { if (result) {
...@@ -421,8 +449,8 @@ export default { ...@@ -421,8 +449,8 @@ export default {
this._page() this._page()
}, },
_resultChange(msg) { _resultChange(msg) {
this._page()
this.$Message.success(msg) this.$Message.success(msg)
this._page()
}, },
_copy(data) { _copy(data) {
this.$refs.copyModal._open(data.id, data.type) this.$refs.copyModal._open(data.id, data.type)
......
<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/SampleBackupsManage'
import SampleBackupsQuery from './tab/SampleBackupsQuery'
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>
...@@ -121,7 +121,6 @@ export default { ...@@ -121,7 +121,6 @@ export default {
{ title: '位置编号', key: 'code' }, { title: '位置编号', key: 'code' },
{ title: '位置管理人', key: 'manager' }, { title: '位置管理人', key: 'manager' },
{ title: '收样存储位置', key: 'name' }, { title: '收样存储位置', key: 'name' },
{ title: '位置分类', key: 'type' },
{ title: '备注说明', key: 'remark' } { title: '备注说明', key: 'remark' }
// { title: '标准状态', key: 'status', width: 120 }, // { title: '标准状态', key: 'status', width: 120 },
// { title: '标准分类', key: 'classify' }, // { title: '标准分类', key: 'classify' },
......
...@@ -10,13 +10,6 @@ ...@@ -10,13 +10,6 @@
<Form-item label="收样存储位置" prop="name" style="width: 100%"> <Form-item label="收样存储位置" prop="name" style="width: 100%">
<Input v-model="formObj.name" name="name" placeholder="请输入收样存储位置"/> <Input v-model="formObj.name" name="name" placeholder="请输入收样存储位置"/>
</Form-item> </Form-item>
<Form-item label="位置分类" prop="type" style="width: 100%">
<Select v-model="formObj.type" name="type">
<Option v-for="(item,index) in options" :key="item.name" :value="index">
{{ item.name }}
</Option>
</Select>
</Form-item>
<Form-item label="位置管理人" prop="manager" style="width: 100%"> <Form-item label="位置管理人" prop="manager" style="width: 100%">
<Input v-model="formObj.manager" @click.native="_selectStaff" name="manager" readonly/> <Input v-model="formObj.manager" @click.native="_selectStaff" name="manager" readonly/>
</Form-item> </Form-item>
...@@ -62,7 +55,6 @@ export default { ...@@ -62,7 +55,6 @@ export default {
formObj: { formObj: {
name: '', name: '',
code: '', code: '',
type: '',
remark: '', remark: '',
manager: '', manager: '',
managerId: '' managerId: ''
......
<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="detail " style="width: 100%">
<el-input v-model="formObj.detail " name="detail "></el-input>
</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: {
detail: ''
},
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.weiteSoilDetail(data)
if (result) {
this._resultChange('填写成功!')
}
},
_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.detail = ''
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>
...@@ -100,6 +100,11 @@ export default { ...@@ -100,6 +100,11 @@ export default {
// name: '管理样品' // name: '管理样品'
// }, // },
{ {
type: 'ios-camera-outline',
id: '',
name: '试样照片'
},
{
type: 'md-cloud', type: 'md-cloud',
id: '', id: '',
name: '附件' name: '附件'
...@@ -187,6 +192,9 @@ export default { ...@@ -187,6 +192,9 @@ export default {
case '试样列表': case '试样列表':
this._sampleManage(data.id) this._sampleManage(data.id)
break break
case '试样照片':
this._upload(data.id)
break
case '附件': case '附件':
this._upload(data.id) this._upload(data.id)
break break
...@@ -278,7 +286,9 @@ export default { ...@@ -278,7 +286,9 @@ 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.page(this.formObj) const result = await soilEntrust.pageSamplePrepare(
this.$serializeForm(this.formObj)
)
if (result) { if (result) {
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
this.getPage = result this.getPage = result
......
...@@ -135,39 +135,11 @@ export default { ...@@ -135,39 +135,11 @@ export default {
getPage: {}, getPage: {},
pageColumns: [ pageColumns: [
{ { title: '试样编号', key: 'sampleCode', width: 160, fixed: 'left' },
title: '样品编号', { title: '试样深度', key: 'sampleDepth', width: 160 },
key: 'num', { title: '土质描述', key: 'sampleDescribe', width: 160 },
width: 180, { title: '样品包装类型', key: 'samplePack', width: 160 },
sampleDetail: true, { title: '现场编号', key: 'siteNo', width: 130 }
fixed: 'left'
},
{ title: '样品名称', key: 'name', width: 160, fixed: 'left' },
{ title: '执行标准', key: 'standard', width: 160 },
{ title: '大类', key: 'firstClass', width: 130 },
{ title: '细类', key: 'detectType', width: 200 },
{ title: '抽样单编号', key: 'samplingNum', width: 200 },
{ title: '检测项目', key: 'itemName', width: 160 },
{ title: '规格型号', key: 'specification', width: 160 },
{ title: '质量等级', key: 'qualityGrade', width: 160 },
{ title: '样品数量', key: 'quantity', width: 160 },
{ title: '单位', key: 'unit', width: 100 },
{ title: '抽样环节', key: 'samplingLink', width: 160 },
{ title: '备样数量', key: 'backupQuanity', width: 100 },
{ title: '保存条件', key: 'keepCondition', width: 160 },
{ title: '抽样地点', key: 'samplingPlace', width: 160 },
{ title: '抽样地点(其他)', key: 'samplingPlaceRemark', width: 200 },
{ title: '抽样日期', key: 'samplingDate', width: 200, date: true },
{ title: '日期类型', key: 'dateType', width: 160 },
{ title: '日期', key: 'dateTimeString', width: 120 },
{ title: '委托单位', key: 'cname' },
{ title: '委托编号', key: 'code', width: 180, detail: true },
{ title: '检测类型', key: 'contractDetectType', width: 130 },
{ title: '签订日期', key: 'signDate', date: true, width: 120 },
{ title: '制单人', key: 'contractUname', width: 120 },
{ title: '制单日期', key: 'contractCtime', date: true, width: 120 },
{ title: '样品备注', key: 'remark' },
{ title: '委托备注', key: 'contractRemark' }
], ],
searchOpen: false, searchOpen: false,
btn: [ btn: [
......
<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.receiveSample(data)
if (result) {
this._resultChange('收样成功!')
}
},
_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>
...@@ -59,26 +59,21 @@ ...@@ -59,26 +59,21 @@
</Row> </Row>
</div> </div>
<!--选择领样人--> <!--选择领样人-->
<SampleReceiveModal ref="locationModal" @on-result-change="_page()"></SampleReceiveModal>
</div> </div>
</template> </template>
<script> <script>
import { soilEntrust } from '../../../../api' import { soilEntrust } from '../../../../api'
import SampleReceiveModal from '../SampleReceiveModal'
export default { export default {
components: {}, components: { SampleReceiveModal },
data() { data() {
return { return {
btn: [{ type: 'primary', id: '', name: '收样室收样' }], btn: [{ type: 'primary', id: '', name: '收样室收样' }],
selectIds: [], selectIds: [],
getPage: {}, getPage: {},
pageColumns: [ pageColumns: [
{
title: '样品编号',
key: 'num',
width: 180,
detail: true,
fixed: 'left'
},
{ title: '试样编号', key: 'sampleCode', width: 160, fixed: 'left' }, { title: '试样编号', key: 'sampleCode', width: 160, fixed: 'left' },
{ title: '试样深度', key: 'sampleDepth', width: 160 }, { title: '试样深度', key: 'sampleDepth', width: 160 },
{ title: '土质描述', key: 'sampleDescribe', width: 160 }, { title: '土质描述', key: 'sampleDescribe', width: 160 },
...@@ -278,7 +273,7 @@ export default { ...@@ -278,7 +273,7 @@ export default {
this._copyHisItem() this._copyHisItem()
break break
case '收样室收样': case '收样室收样':
this._sampleReceive() this._sampleReceive(this.selectIds)
break break
case '打印标签': case '打印标签':
this._selectPrinter('print-label') this._selectPrinter('print-label')
...@@ -515,20 +510,22 @@ export default { ...@@ -515,20 +510,22 @@ export default {
}, },
// 样品接收 // 样品接收
_sampleReceive() { _sampleReceive(id) {
if (this.selectIds.length === 0) { if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!') this.$Message.warning('请至少选中一条样品数据!')
} else { } else {
const tempData = { const ids = id.join(',')
ids: this.selectIds.join(',') this.$refs.locationModal._open(ids)
} // const tempData = {
this.$Modal.confirm({ // ids: this.selectIds.join(',')
title: '提示', // }
content: '确定要接收这 ' + this.selectIds.length + ' 条数据?', // this.$Modal.confirm({
onOk: () => { // title: '提示',
console.log(tempData) // content: '确定要接收这 ' + this.selectIds.length + ' 条数据?',
} // onOk: () => {
}) // console.log(tempData)
// }
// })
} }
}, },
......
...@@ -68,37 +68,15 @@ export default { ...@@ -68,37 +68,15 @@ export default {
components: {}, components: {},
data() { data() {
return { return {
btn: [{ type: 'primary', id: 'ZBC', name: '发放' }], btn: [{ type: 'primary', id: '', name: '发放' }],
selectIds: [], selectIds: [],
getPage: {}, getPage: {},
pageColumns: [ pageColumns: [
{ { title: '试样编号', key: 'sampleCode', width: 160, fixed: 'left' },
title: '样品编号', { title: '试样深度', key: 'sampleDepth', width: 160 },
key: 'num', { title: '土质描述', key: 'sampleDescribe', width: 160 },
width: 180, { title: '样品包装类型', key: 'samplePack', width: 160 },
detail: true, { title: '现场编号', key: 'siteNo', width: 130 }
fixed: 'left'
},
{ title: '样品名称', key: 'name', width: 160, fixed: 'left' },
{ title: '执行标准', key: 'standard', width: 160 },
{ title: '大类', key: 'firstClass', width: 130 },
{ title: '细类', key: 'detectType', width: 200 },
{ title: '抽样单编号', key: 'samplingNum', width: 200 },
{ title: '检测项目', key: 'itemName', width: 160 },
{ title: '规格型号', key: 'specification', width: 160 },
{ title: '质量等级', key: 'qualityGrade', width: 160 },
{ title: '样品数量', key: 'quantity', width: 100 },
{ title: '单位', key: 'unit', width: 90 },
{ title: '抽样环节', key: 'samplingLink', width: 160 },
{ title: '备样数量', key: 'backupQuanity', width: 100 },
{ title: '保存条件', key: 'keepCondition', width: 160 },
{ title: '抽样地点', key: 'samplingPlace', width: 160 },
{ title: '抽样地点(其他)', key: 'samplingPlaceRemark', width: 200 },
{ title: '抽样日期', key: 'samplingDate', width: 200, date: true },
{ title: '日期类型', key: 'dateType', width: 160 },
{ title: '日期', key: 'dateTime', width: 120, date: true },
{ title: '样品形态', key: 'shape', width: 100 },
{ title: '备注', key: 'remark' }
], ],
iconMsg: [ iconMsg: [
{ type: 'md-create', id: '', name: '编辑' }, { type: 'md-create', id: '', name: '编辑' },
...@@ -212,7 +190,7 @@ export default { ...@@ -212,7 +190,7 @@ export default {
_open(contractId, type) { _open(contractId, type) {
this.formObj = this.$resetFields(this.formObj) this.formObj = this.$resetFields(this.formObj)
$('input[name=contractId]').val(contractId) $('input[name=contractId]').val(contractId)
this.contractId = contractId this.entrustId = contractId
this.type = type this.type = type
this.selectIds = [] this.selectIds = []
this.$nextTick(() => { this.$nextTick(() => {
...@@ -221,8 +199,10 @@ export default { ...@@ -221,8 +199,10 @@ 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) this.formObj.entrustId = this.entrustId
const result = await soilEntrust.page(this.$serializeForm(this.formObj)) const result = await soilEntrust.pageSend(
this.$serializeForm(this.formObj)
)
if (result) { if (result) {
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
this.getPage = result this.getPage = result
...@@ -326,7 +306,7 @@ export default { ...@@ -326,7 +306,7 @@ export default {
// 发放 // 发放
_submitSend() { _submitSend() {
if (this.selectIds.length === 0) { if (this.selectIds.length === 0) {
this.$msgTip('warning', '请至少选择一条数据!') this.$message.warning('请至少选择一条数据!')
} else { } else {
// 一键发放判断是否选人 // 一键发放判断是否选人
// eslint-disable-next-line no-lonely-if // eslint-disable-next-line no-lonely-if
...@@ -345,20 +325,27 @@ export default { ...@@ -345,20 +325,27 @@ export default {
const data = { const data = {
ids: this.selectIds.join(',') ids: this.selectIds.join(',')
} }
// 发放 this.$Modal.confirm({
this.$store.dispatch('FoodSample/submitSend', data).then(() => { title: '提示',
this._resultChange('发放成功') content: '确定要发放这 ' + this.selectIds.length + ' 条数据?',
onOk: () => {
this._sendSample(data)
}
}) })
} }
} }
}, },
_resultChange(msg) { _sendSample: async function(data) {
if (this.$store.state.FoodSample.success) { const result = await soilEntrust.sendSample(data)
this._page() if (result) {
this.$Message.success(msg) this._resultChange('发放成功')
this.selectIds = []
} }
}, },
_resultChange(msg) {
this._page()
this.$Message.success(msg)
this.selectIds = []
},
_exportReceiveRecord() { _exportReceiveRecord() {
// 导出交接记录 // 导出交接记录
......
...@@ -10,6 +10,7 @@ import ReviewEntrust from '../pages/meter-entrust/entrust-review/ReviewEntrust' ...@@ -10,6 +10,7 @@ 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 BackupsManage from '../pages/soil-sample-manage/backups-manage/SampleBackupsIndex'
import Blank from '~/pages/blank' import Blank from '~/pages/blank'
export default [ export default [
{ {
...@@ -54,7 +55,7 @@ export default [ ...@@ -54,7 +55,7 @@ export default [
}, },
{ {
path: 'backups', path: 'backups',
component: workbench, component: BackupsManage,
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