Commit 3341cea8 by lichengming

修改收样室收样页面和开土制备页面

parent 7f85543a
......@@ -12,6 +12,8 @@ export default {
http.post('soil/v1/entrust/page_review', data).then(res => res),
pageSampleReceive: data =>
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),
getVOById: data => http.get('soil/v1/entrust/vo/' + data).then(res => res),
deleteById: data =>
......@@ -43,5 +45,12 @@ export default {
samplePage: data => http.post('soil/v1/sample/page', data).then(res => res),
pageReceive: data =>
http.post('soil/v1/sample/page_receive', data).then(res => res),
pageSend: data => http.post('soil/v1/sample/page_send', 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)
}
......@@ -9,6 +9,8 @@ export default {
// page
locationPage: data =>
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 =>
http.get('soil/v1/receive_location/' + data).then(res => res),
locationSave: data =>
......
......@@ -129,13 +129,6 @@ export default {
selectData: {},
getPage: {},
pageColumns: [
{
title: '样品编号',
key: 'num',
width: 180,
detail: true,
fixed: 'left'
},
{ title: '试样编号', key: 'sampleCode', width: 160, fixed: 'left' },
{ title: '试样深度', key: 'sampleDepth', width: 160 },
{ title: '土质描述', key: 'sampleDescribe', width: 160 },
......@@ -355,7 +348,7 @@ export default {
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
this.formObj.entrustId = this.contractId
const result = await soilEntrust.samplePage(
const result = await soilEntrust.pagePrepare(
this.$serializeForm(this.formObj)
)
if (result) {
......
......@@ -121,7 +121,6 @@ export default {
{ title: '位置编号', key: 'code' },
{ title: '位置管理人', key: 'manager' },
{ title: '收样存储位置', key: 'name' },
{ title: '位置分类', key: 'type' },
{ title: '备注说明', key: 'remark' }
// { title: '标准状态', key: 'status', width: 120 },
// { title: '标准分类', key: 'classify' },
......
......@@ -10,13 +10,6 @@
<Form-item label="收样存储位置" prop="name" style="width: 100%">
<Input v-model="formObj.name" name="name" placeholder="请输入收样存储位置"/>
</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%">
<Input v-model="formObj.manager" @click.native="_selectStaff" name="manager" readonly/>
</Form-item>
......@@ -62,7 +55,6 @@ export default {
formObj: {
name: '',
code: '',
type: '',
remark: '',
manager: '',
managerId: ''
......
......@@ -278,7 +278,9 @@ export default {
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await soilEntrust.page(this.formObj)
const result = await soilEntrust.pageSamplePrepare(
this.$serializeForm(this.formObj)
)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
......
......@@ -135,39 +135,11 @@ export default {
getPage: {},
pageColumns: [
{
title: '样品编号',
key: 'num',
width: 180,
sampleDetail: true,
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' }
{ title: '试样编号', key: 'sampleCode', width: 160, fixed: 'left' },
{ title: '试样深度', key: 'sampleDepth', width: 160 },
{ title: '土质描述', key: 'sampleDescribe', width: 160 },
{ title: '样品包装类型', key: 'samplePack', width: 160 },
{ title: '现场编号', key: 'siteNo', width: 130 }
],
searchOpen: false,
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 @@
</Row>
</div>
<!--选择领样人-->
<SampleReceiveModal ref="locationModal" @on-result-change="_page()"></SampleReceiveModal>
</div>
</template>
<script>
import { soilEntrust } from '../../../../api'
import SampleReceiveModal from '../SampleReceiveModal'
export default {
components: {},
components: { SampleReceiveModal },
data() {
return {
btn: [{ type: 'primary', id: '', name: '收样室收样' }],
selectIds: [],
getPage: {},
pageColumns: [
{
title: '样品编号',
key: 'num',
width: 180,
detail: true,
fixed: 'left'
},
{ title: '试样编号', key: 'sampleCode', width: 160, fixed: 'left' },
{ title: '试样深度', key: 'sampleDepth', width: 160 },
{ title: '土质描述', key: 'sampleDescribe', width: 160 },
......@@ -278,7 +273,7 @@ export default {
this._copyHisItem()
break
case '收样室收样':
this._sampleReceive()
this._sampleReceive(this.selectIds)
break
case '打印标签':
this._selectPrinter('print-label')
......@@ -515,20 +510,22 @@ export default {
},
// 样品接收
_sampleReceive() {
_sampleReceive(id) {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
const tempData = {
ids: this.selectIds.join(',')
}
this.$Modal.confirm({
title: '提示',
content: '确定要接收这 ' + this.selectIds.length + ' 条数据?',
onOk: () => {
console.log(tempData)
}
})
const ids = id.join(',')
this.$refs.locationModal._open(ids)
// const tempData = {
// ids: this.selectIds.join(',')
// }
// this.$Modal.confirm({
// title: '提示',
// content: '确定要接收这 ' + this.selectIds.length + ' 条数据?',
// onOk: () => {
// console.log(tempData)
// }
// })
}
},
......
......@@ -68,17 +68,10 @@ export default {
components: {},
data() {
return {
btn: [{ type: 'primary', id: 'ZBC', name: '发放' }],
btn: [{ type: 'primary', id: '', name: '发放' }],
selectIds: [],
getPage: {},
pageColumns: [
{
title: '样品编号',
key: 'num',
width: 180,
detail: true,
fixed: 'left'
},
{ title: '试样编号', key: 'sampleCode', width: 160, fixed: 'left' },
{ title: '试样深度', key: 'sampleDepth', width: 160 },
{ title: '土质描述', key: 'sampleDescribe', width: 160 },
......@@ -313,7 +306,7 @@ export default {
// 发放
_submitSend() {
if (this.selectIds.length === 0) {
this.$msgTip('warning', '请至少选择一条数据!')
this.$message.warning('请至少选择一条数据!')
} else {
// 一键发放判断是否选人
// eslint-disable-next-line no-lonely-if
......@@ -332,20 +325,27 @@ export default {
const data = {
ids: this.selectIds.join(',')
}
// 发放
this.$store.dispatch('FoodSample/submitSend', data).then(() => {
this._resultChange('发放成功')
this.$Modal.confirm({
title: '提示',
content: '确定要发放这 ' + this.selectIds.length + ' 条数据?',
onOk: () => {
this._sendSample(data)
}
})
}
}
},
_resultChange(msg) {
if (this.$store.state.FoodSample.success) {
this._page()
this.$Message.success(msg)
this.selectIds = []
_sendSample: async function(data) {
const result = await soilEntrust.sendSample(data)
if (result) {
this._resultChange('发放成功')
}
},
_resultChange(msg) {
this._page()
this.$Message.success(msg)
this.selectIds = []
},
_exportReceiveRecord() {
// 导出交接记录
......
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