Commit 846d55c6 by lichengming

修改了留存位置查询

parent 11453f3c
......@@ -67,6 +67,8 @@ export default {
http.post('soil/v1/sample/page_send_his', data).then(res => res),
receiveSample: data =>
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 =>
http.post('soil/v1/sample/send_sample', data).then(res => res),
pagePrepare: data =>
......
......@@ -9,6 +9,8 @@ export default {
// page
locationPage: data =>
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 =>
http.post('soil/v1/receive_location/list', data).then(res => res),
locationGetById: data =>
......
......@@ -69,7 +69,7 @@ export default {
{ key: 'belongUnit', title: '归口单位' },
{ key: 'publishUnit', title: '发布单位' }
],
modalTitle: '添加食品标准表',
modalTitle: '收样位置选择',
formObj: {
code: '',
name: ''
......
......@@ -18,7 +18,7 @@
</Form-item>
<Form-item label="备样人:">
<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-select>
</Form-item>
......
<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>
......@@ -9,7 +9,7 @@
<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.code" name="code" placeholder="请输入检测依据" clearable/>
<Input @on-enter="_formSearch" v-model="formObj.code" name="code" placeholder="请输入位置编号" clearable/>
</Form-item>
<Form-item class="search-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
......
......@@ -51,7 +51,7 @@ export default {
{ key: 'belongUnit', title: '归口单位' },
{ key: 'publishUnit', title: '发布单位' }
],
modalTitle: '添加食品标准表',
modalTitle: '收样位置选择',
formObj: {
name: '',
code: '',
......
......@@ -35,7 +35,7 @@ export default {
{ key: 'belongUnit', title: '归口单位' },
{ key: 'publishUnit', title: '发布单位' }
],
modalTitle: '添加食品标准表',
modalTitle: '收样位置选择',
formObj: {
detail: ''
},
......
......@@ -39,7 +39,7 @@ export default {
{ key: 'belongUnit', title: '归口单位' },
{ key: 'publishUnit', title: '发布单位' }
],
modalTitle: '添加食品标准表',
modalTitle: '收样位置选择',
formObj: {
receiveLocation: '',
locationId: ''
......@@ -112,6 +112,7 @@ export default {
if (result) {
this._resultChange('收样成功!')
}
this._hideLoading()
},
_save: async function(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>
......@@ -5,11 +5,16 @@
<Row>
<!--查询-->
<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>
<Form-item label="试样编号:" class="search-item">
<Input @on-enter="_formSearch" v-model="formObj.sampleCode" name="sampleCode" placeholder="请输入试样编号" clearable></Input>
</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">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
......@@ -52,19 +57,34 @@
<!--选择领样人-->
<SampleReceiveModal ref="locationModal" @on-result-change="_page()"></SampleReceiveModal>
<SoilSampleItemManage ref="sampleItemManage" @on-result-change="_page"></SoilSampleItemManage>
<KeepAdress ref="keepAdressModal" @on-result-change="_page"></KeepAdress>
</div>
</template>
<script>
import { soilEntrust } from '../../../../api'
import SampleReceiveModal from '../SampleReceiveModal'
import SoilSampleItemManage from './SoilSampleItemManage'
import KeepAdress from './KeepAdress'
export default {
components: { SampleReceiveModal, SoilSampleItemManage },
components: { SampleReceiveModal, SoilSampleItemManage, KeepAdress },
data() {
return {
btn: [{ type: 'primary', id: '', name: '收样室收样' }],
btn: [
{ type: 'primary', id: '', name: '收样室收样' },
{ type: 'primary', id: '', name: '样品留存' }
],
selectIds: [],
getPage: {},
itemData: [
{
name: '是',
value: 1
},
{
name: '否',
value: 0
}
],
pageColumns: [
{ title: '试样编号', key: 'sampleCode', width: 120, fixed: 'left' },
{ title: '试样深度', key: 'sampleDepth', width: 100 },
......@@ -85,7 +105,8 @@ export default {
num: '',
detectType: '',
standard: '',
samplingLinkList: []
samplingLinkList: [],
haveExp: undefined
},
stdList: [],
sampleLinkList: [
......@@ -269,6 +290,9 @@ export default {
case '收样室收样':
this._sampleReceive(this.selectIds)
break
case '样品留存':
this._sampleKeep(this.selectIds)
break
case '打印标签':
this._selectPrinter('print-label')
break
......@@ -502,7 +526,14 @@ export default {
break
}
},
_sampleKeep(id) {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
const ids = id.join(',')
this.$refs.keepAdressModal._open(ids)
}
},
// 样品接收
_sampleReceive(id) {
if (this.selectIds.length === 0) {
......
......@@ -39,7 +39,7 @@ export default {
{ key: 'belongUnit', title: '归口单位' },
{ key: 'publishUnit', title: '发布单位' }
],
modalTitle: '添加食品标准表',
modalTitle: '收样位置选择',
formObj: {
receiveLocation: '',
locationId: ''
......
......@@ -39,7 +39,7 @@ export default {
{ key: 'belongUnit', title: '归口单位' },
{ key: 'publishUnit', title: '发布单位' }
],
modalTitle: '添加食品标准表',
modalTitle: '收样位置选择',
formObj: {
receiveLocation: '',
locationId: ''
......
......@@ -10,6 +10,7 @@ import ReviewEntrust from '../pages/meter-entrust/entrust-review/ReviewEntrust'
import SampleReceiveIndex from '../pages/soil-sample-manage/sample-receive/SampleReceiveIndex'
import SamplePreparationIndex from '../pages/soil-sample-manage/sample-preparation/SamplePreparationIndex'
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 SampleTakeIndex from '../pages/soil-sample-manage/sample-take/SampleTakeIndex'
import SurplusManage from '../pages/soil-sample-manage/surplus-manage/SampleSurplusIndex'
......@@ -79,6 +80,11 @@ export default [
meta: { title: '备样管理' }
},
{
path: 'keep',
component: KeepAdress,
meta: { title: '留存位置查询' }
},
{
path: 'surplus',
component: SurplusManage,
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