Commit f4a52992 by lichengming

修改了发放高级试验,添加独立留存菜单

parent 18d104bf
......@@ -21,6 +21,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),
pageAloneKeep: data =>
http.post('soil/v1/entrust/page_alone_keep', data).then(res => res),
pageLocationEntrust: data =>
http
.post('soil/v1/entrust/page_receive_location_entrust', data)
......@@ -89,6 +91,8 @@ export default {
http.post('soil/v1/sample/sample_retain', data).then(res => res),
sendSample: data =>
http.post('soil/v1/sample/send_sample', data).then(res => res),
aloneKeepSample: data =>
http.post('soil/v1/sample/alone_keep_sample', data).then(res => res),
pagePrepare: data =>
http.post('soil/v1/sample/page_prepare', data).then(res => res),
pagePrepareCheck: data =>
......
......@@ -76,6 +76,11 @@ export default {
name: '查看'
},
{
type: 'ios-cloud',
id: '',
name: '附件'
},
{
type: 'ios-clock',
id: '',
name: '操作日志'
......@@ -242,7 +247,10 @@ export default {
_upload(id) {
// 上传文件
this.$refs.refModal._open(id, 'subcontractorId')
this.currentComponent = 'FileManage'
this.$nextTick(() => {
this.$refs.refModal._open(id, 'aloneSampleId')
})
},
_getById: async function(id) {
const result = await soilAptitude.getById(id)
......
......@@ -76,6 +76,11 @@ export default {
name: '查看'
},
{
type: 'ios-cloud',
id: '',
name: '附件'
},
{
type: 'ios-clock',
id: '',
name: '操作日志'
......@@ -240,7 +245,10 @@ export default {
_upload(id) {
// 上传文件
this.$refs.refModal._open(id, 'subcontractorId')
this.currentComponent = 'FileManage'
this.$nextTick(() => {
this.$refs.refModal._open(id, 'aloneSampleId')
})
},
_getById: async function(id) {
const result = await soilAptitude.getById(id)
......
......@@ -249,7 +249,7 @@ export default {
// 上传文件
this.currentComponent = 'FileManage'
this.$nextTick(() => {
this.$refs.refModal._open(id, 'sampleId')
this.$refs.refModal._open(id, 'aloneSampleId')
})
},
_getById: async function(id) {
......
<template>
<div>
<!--内容-->
<div class="layout-content-padding">
<div class="layout-content-main">
<Row>
<!--查询-->
<Col span="24">
<Form id="search-form" :label-width="70" v-show="searchOpen" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="委托商:">
<Input v-model="formObj.client" @on-enter="_formSearch" placeholder="请输入委托编号" clearable></Input>
</Form-item>
<Form-item class="search-item" label="委托编号:">
<Input v-model="formObj.entrustCode" @on-enter="_formSearch" placeholder="请输入委托单位" clearable></Input>
</Form-item>
<Form-item class="search-item" label="钻孔名称:">
<Input v-model="formObj.boreholeName" @on-enter="_formSearch" placeholder="请输入钻孔名称" clearable></Input>
</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">
<PTVXETable
ref="pageTable"
:tableHeight="tableHeight"
:getPage="getPage"
:iconMsg="iconMsg"
@on-result-change="_tableResultChange">
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:width="item.width"
:min-width="200"
:fixed="item.fixed?item.fixed:undefined"
sortable
>
<template slot-scope="scope">
<div v-if="item.detail"><a @click.stop="_detailModal(scope.row.id,scope.row.type)">{{scope.row[item.key]}}</a>
</div>
<span v-else-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.type">{{scope.row[item.key] === 0 ? '企业':scope.row[item.key] ===
1?'政府':scope.row[item.key] === 2?'食品类抽样单': ''}}
</div>
<div v-else>{{scope.row[item.key]}}</div>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
</div>
<!--组件加载-->
<!--选择领样人-->
<keep-alive>
<!-- eslint-disable-next-line vue/require-component-is -->
<component ref="refModal" :is="currentComponent" @on-result-change="_componentResult"></component>
</keep-alive>
</div>
</template>
<script>
import { soilEntrust } from '../../../api'
import Operation from '../../../components/operation/Operation'
import SampleManage from './entrust-sample-manage/SampleManage'
export default {
// eslint-disable-next-line vue/no-unused-components
components: { SampleManage, Operation },
data() {
return {
formObj: {
client: undefined,
entrustCode: undefined
},
typeList: [{ name: '企业', value: 0 }, { name: '政府', value: 1 }],
iconMsg: [
{
type: 'ios-beaker',
id: '',
name: '管理样品'
},
{ type: 'md-cloud', id: '', name: '附件' },
{
type: 'ios-clock',
id: '',
name: '操作日志'
}
],
getPage: {},
pageColumns: [
{ title: '委托商', key: 'client', width: 200 },
{ title: '委托编号', key: 'entrustCode', width: 120 },
{ title: '委托日期', key: 'entrustDate', width: 120, date: true },
{ title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '钻孔位置', key: 'boreholeLocation', width: 120 },
{ title: '水深(米)', key: 'waterDepth', width: 120 },
{ title: '进度', key: 'progress', width: 120, status: true },
{ title: '平均容重', key: 'projectNo', width: 120 },
{ title: '报告编号', key: 'reportCode', width: 120 },
{ title: '制表日期', key: 'tabulateDate', width: 120, date: true },
{ title: '制表人', key: 'tabulater', width: 120 },
{ title: '批准日期', key: 'approveDate', width: 120, date: true },
{ title: '批准人', key: 'approver', width: 120 },
{ title: '检验类别', key: 'testType', width: 120 }
],
searchOpen: false,
btn: [
{
type: 'primary',
id: 'ZBC',
name: '一键接收'
}
],
selectIds: [],
currentComponent: '',
acceptSelectUserValue: ''
}
},
computed: {
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('tabSearch')
} else {
return this.$tableHeight('tabNoSearch')
}
}
},
mounted() {},
methods: {
// 组件返回值
_componentResult(data, msg) {
switch (this.currentComponent) {
default:
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(() => {
switch (msg) {
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
_iconClick(res, data, currentComponent) {
this.currentComponent = currentComponent
console.log(res)
this.$nextTick(() => {
switch (res) {
case '管理样品':
this._editModal(data.id, data.type, data.entrustCode)
break
case '附件':
this._upload(data.id)
break
case '操作日志':
this._operationRecord(data.id)
break
}
})
},
_editModal(id, type, name) {
this.currentComponent = 'SampleManage'
this.$nextTick(() => {
this.$refs.refModal._open(id, type, name)
})
},
_tableResultChange(msg, data) {
switch (msg) {
case 'selectIds':
this.selectIds = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
case 'changeSize':
this._page()
break
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await soilEntrust.pageAloneKeep(
this.$serializeForm(this.formObj)
)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_search() {
this._page()
},
_operationRecord(id) {
this.currentComponent = 'Operation'
this.$nextTick(() => {
this.$refs.refModal._open(id)
})
// 操作日志
// this.$refs.operation._open(id)
},
_resultChange(msg) {
this._page()
this.$Message.success(msg)
this.selectIds = []
},
_upload(id) {
// 上传文件
this.currentComponent = 'FileManage'
this.$nextTick(() => {
this.$refs.refModal._open(id, 'entrustId')
})
// this.$refs.FileManage._open(id, 'entrustId')
}
}
}
</script>
<template>
<div>
<!--内容-->
<div class="layout-content-padding">
<div class="layout-content-main">
<Row>
<!--查询-->
<Col span="24">
<Form id="search-form" v-show="searchOpen" :label-width="70" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item class="search-item" label="委托商:">
<Input v-model="formObj.client" @on-enter="_formSearch" placeholder="请输入委托编号" clearable></Input>
</Form-item>
<Form-item class="search-item" label="委托编号:">
<Input v-model="formObj.entrustCode" @on-enter="_formSearch" placeholder="请输入委托单位" clearable></Input>
</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" :show-search-btn="true" @on-result-change="_btnClick"
class="contHide">
</btn-list>
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETable
ref="pageTable"
:table-height="tableHeight"
:get-page="getPage"
:icon-msg="iconMsg"
@on-result-change="_tableResultChange">
<vxe-table-column
v-for="item in pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:width="item.width"
:min-width="200"
:fixed="item.fixed?item.fixed:undefined"
sortable
>
<template slot-scope="scope">
<div v-if="item.detail"><a @click.stop="_detailModal(scope.row.id,scope.row.type)">{{scope.row[item.key]}}</a>
</div>
<span v-else-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.type">{{scope.row[item.key] === 0 ? '企业':scope.row[item.key] ===
1?'政府':scope.row[item.key] === 2?'食品类抽样单': ''}}
</div>
<div v-else>{{scope.row[item.key]}}</div>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
</div>
<!--组件加载-->
<!--选择领样人-->
<keep-alive>
<!-- eslint-disable-next-line vue/require-component-is -->
<component ref="refModal" :is="currentComponent" @on-result-change="_componentResult"></component>
</keep-alive>
<!-- <SampleManage ref="sampleManageModal" @on-result-change="_page"></SampleManage>-->
<!-- <Operation ref="operation"></Operation>-->
<!-- <FileManage ref="FileManage"></FileManage>-->
</div>
</template>
<script>
import { soilEntrust } from '../../../api'
import Operation from '../../../components/operation/Operation'
import SampleManage from './entrust-sample-manage/SampleManageHis'
export default {
// eslint-disable-next-line vue/no-unused-components
components: { SampleManage, Operation },
data() {
return {
formObj: {
client: undefined,
entrustCode: undefined
},
typeList: [{ name: '企业', value: 0 }, { name: '政府', value: 1 }],
iconMsg: [
{
type: 'ios-beaker',
id: '',
name: '管理样品'
},
{ type: 'md-cloud', id: '', name: '附件' },
{
type: 'ios-clock',
id: '',
name: '操作日志'
}
],
getPage: {},
pageColumns: [
{ title: '委托商', key: 'client', width: 200 },
{ title: '委托编号', key: 'entrustCode', width: 120 },
{ title: '委托日期', key: 'entrustDate', width: 120, date: true },
{ title: '钻孔位置', key: 'boreholeLocation', width: 120 },
{ title: '水深(米)', key: 'waterDepth', width: 120 },
{ title: '钻孔名称', key: 'boreholeName', width: 120 },
{ title: '进度', key: 'progress', width: 120, status: true },
{ title: '平均容重', key: 'projectNo', width: 120 },
{ title: '报告编号', key: 'reportCode', width: 120 },
{ title: '制表日期', key: 'tabulateDate', width: 120, date: true },
{ title: '制表人', key: 'tabulater', width: 120 },
{ title: '批准日期', key: 'approveDate', width: 120, date: true },
{ title: '批准人', key: 'approver', width: 120 },
{ title: '检验类别', key: 'testType', width: 120 }
],
searchOpen: false,
btn: [
{
type: 'primary',
id: 'ZBC',
name: '一键接收'
}
],
selectIds: [],
currentComponent: '',
acceptSelectUserValue: ''
}
},
computed: {
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('tabSearch')
} else {
return this.$tableHeight('tabNoSearch')
}
}
},
mounted() {
// 样品接收是否选择人员
// this.acceptSelectUserValue = localStorage.getItem('acceptSelectUserValue')
},
methods: {
// 一键接收并发放
// 组件返回值
_componentResult(data, msg) {
switch (this.currentComponent) {
default:
this._page()
}
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(() => {
switch (msg) {
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
// 扫码接收并发放
// 一键接收并发放
// 一键发放
// 一键接收
// 信息维护
_iconClick(res, data, currentComponent) {
this.currentComponent = currentComponent
console.log(res)
this.$nextTick(() => {
switch (res) {
case '管理样品':
this._editModal(data.id, data.type, data.entrustCode)
break
case '附件':
this._upload(data.id)
break
case '操作日志':
this._operationRecord(data.id)
break
}
})
},
_editModal(id, type, name) {
this.currentComponent = 'SampleManage'
this.$nextTick(() => {
this.$refs.refModal._open(id, type, name)
})
// this.$refs.sampleManageModal._open(id, type, name)
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodContract.page
break
case 'selectIds':
this.selectIds = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
case 'changeSize':
this._page()
break
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await soilEntrust.pageSampleReceiveHis(
this.$serializeForm(this.formObj)
)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_search() {
this._page()
},
_operationRecord(id) {
// 操作日志
this.currentComponent = 'Operation'
this.$nextTick(() => {
this.$refs.refModal._open(id)
})
// this.$refs.operation._open(id)
},
_resultChange(msg) {
if (this.$store.state.FoodContract.success) {
this._page()
this.$Message.success(msg)
this.selectIds = []
}
},
_upload(id) {
// 上传文件
this.currentComponent = 'FileManage'
this.$nextTick(() => {
this.$refs.refModal._open(id, 'entrustId')
})
// this.$refs.FileManage._open(id, 'entrustId')
}
}
}
</script>
<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="entrust"></el-tab-pane>
<el-tab-pane label="历史记录" name="sample"></el-tab-pane>
</el-tabs>
<keep-alive>
<!-- eslint-disable-next-line vue/require-component-is -->
<component ref="refModal" :is="currentComponent"></component>
</keep-alive>
</div>
</div>
</div>
</template>
<script>
import ReceiveByEntrust from './ReceiveByEntrust'
import ReceiveBySample from './ReceiveBySample'
export default {
name: 'MeterSummaryEntrustIndex',
components: {
// eslint-disable-next-line vue/no-unused-components
ReceiveByEntrust,
// eslint-disable-next-line vue/no-unused-components
ReceiveBySample
},
data() {
return {
activeName: 'entrust',
currentComponent: ''
}
},
mounted() {
this.activeName = 'entrust'
this._page()
},
methods: {
_changeTabs(tab, event) {
if (tab.name === 'entrust') {
this._page()
} else {
this.currentComponent = 'ReceiveBySample'
this.$nextTick(() => {
this.$refs.refModal._page()
})
// this.$refs.sampleTabs._page()
}
},
_page() {
this.currentComponent = 'ReceiveByEntrust'
this.$nextTick(() => {
this.$refs.refModal._page()
})
// this.$refs.entrustTabs._page()
}
}
}
</script>
<style scoped>
</style>
<template>
<div>
<Modal v-model="showEditModal" v-drag :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('收样成功!')
}
this._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>
<div>
<div>
<!--内容-->
<Row>
<!--查询-->
<Col span="24" style="padding-bottom: 5px">
<Form v-show="searchOpen" id="search-wait-scan" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="试样编号:" class="search-item">
<Input v-model="formObj.sampleCode" name="sampleCode" placeholder="请输入试样编号" clearable @on-enter="_formSearch"></Input>
<input name="entrustId" type="hidden">
</Form-item>
<Form-item class="search-btn">
<Button type="primary" @click="_formSearch">搜索</Button>
</Form-item>
</Form>
</Col>
<Col span="24">
<btn-list :msg="btn" :open="searchOpen" :show-search-btn="true" class="contHide" @on-result-change="_btnClick">
</btn-list>
</Col>
<Col span="24">
<PTVXETableHeight
ref="pageTable"
:table-height="tableHeight"
:get-page="getPage"
select-data
@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">
<div v-if="item.detail"><a @click.stop="_detailModal(scope.row.id)">{{scope.row[item.key]}}</a></div>
<div v-else-if="item.key ==='shape'">{{scope.row['shape']}} {{scope.row['shapeRemark']}}</div>
<div v-else-if="item.date">
{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd HH:MM:ss'):''}}
</div>
<div v-else>{{scope.row[item.key]}}</div>
</template>
</vxe-table-column>
</PTVXETableHeight>
</Col>
</Row>
</div>
<!--选择领样人-->
</div>
</template>
<script>
import { soilEntrust } from '../../../../api'
export default {
components: {},
data() {
return {
btn: [],
selectIds: [],
getPage: {},
pageColumns: [
{ title: '试样编号', key: 'sampleCode', width: 100, fixed: 'left' },
{ title: '试样深度', key: 'sampleDepth', width: 95 },
{ title: '现场编号', key: 'siteNo', width: 100 },
{ title: '接收人', key: 'receiver', width: 120 },
{ title: '接收时间', key: 'receiveTime', width: 145, date: true },
{ title: '收样存储位置', key: 'receiveLocation', width: 140 },
{ title: '发放人', key: 'sender', width: 120 },
{ title: '发放时间', key: 'sendTime', width: 144, date: true },
{ title: '土质描述', key: 'sampleDescribe', width: 185 },
{ title: '样品包装类型', key: 'samplePack', width: 120 }
],
iconMsg: [
{ type: 'md-create', id: '', name: '编辑' },
{ type: 'ios-copy', id: '', name: '复制' },
{ type: 'md-trash', id: '', name: '删除' },
{
type: 'ios-clock',
id: '',
name: '操作日志',
componentName: 'SampleRecord'
},
{ type: 'cloud', id: '', name: '附件', componentName: 'FileManage' }
],
type: '',
entrustId: '', // 合同id
selectData: [],
currentComponent: '',
formObj: {
sampleCode: undefined,
entrustId: undefined
},
searchOpen: true
}
},
computed: {
tableHeight: function() {
if (this.searchOpen) {
} else {
}
return this.$tableHeight('tableModal')
}
},
mounted() {
// this._getStdList()
// 样品接收是否选择人员
// this.acceptSelectUserValue = localStorage.getItem('acceptSelectUserValue')
},
methods: {
_userResult(data, msg) {
const sendData = {
ids: this.selectIds.join(',')
}
if (data) {
sendData.person = data.realname
sendData.personId = data.userId
}
switch (msg) {
case 'sampleSendMan':
// 发放
this.$store.dispatch('FoodSample/submitSend', sendData).then(() => {
this._resultChange('发放成功')
})
break
case 'sampleScanSend':
// 扫码接收并发放
this.$refs.refModal._open('扫码发放', data)
break
}
},
_selectSampleLink(data) {
console.log(data)
},
// 组件返回值
_componentResult(data, msg) {
switch (this.currentComponent) {
case 'SelectPrinter':
this._printerResult(data)
break
case 'ReceiveScan':
// 扫码接收
this._searchTop()
break
default:
this._search()
}
},
_open(entrustId, type) {
this.formObj = this.$resetFields(this.formObj)
$('input[name=entrustId]').val(entrustId)
this.formObj.entrustId = entrustId
this.$nextTick(() => {
this._page()
})
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilEntrust.pageSendHis(this.formObj)
console.log(this.formObj)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_iconClick(res, data, currentComponent) {
this.currentComponent = currentComponent
this.$nextTick(() => {
switch (res) {
case '编辑':
this._editModal(true, data)
break
case '操作日志':
this.$refs.refModal._open(data.id)
break
case '删除':
this._deleteById(data.id)
break
}
})
},
_btnClick(msg, currentComponent) {
this.currentComponent = currentComponent
this.$nextTick(() => {
switch (msg) {
case '打印标签':
this._selectPrinter('print-label')
break
case 'search':
this.searchOpen = !this.searchOpen
break
}
})
},
_resultChange(msg) {
this._page()
this.$Message.success(msg)
this.selectIds = []
},
_search() {
this._page()
},
// 刷新上级页面
_searchTop() {
this._page()
this.$emit('on-result-change')
},
_tableResultChange(msg, data) {
switch (msg) {
case 'selectData':
this.selectData = data
this.selectIds = []
for (let i = 0; i < data.length; i++) {
this.selectIds.push(data[i].id)
}
break
case 'iconClick':
this._iconClick(data.name, data.rowData, data.componentName)
break
case 'changeSize':
this._page()
break
}
},
_stdResult(msg, data) {
switch (msg) {
case 'select':
this.formObj.standard = data
break
case 'query':
this.formObj.standard = data
this._getStdList(data)
break
case 'focus':
this._getStdList()
break
}
}
}
}
</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="warehouse" style="width: 100%">
<Input v-model="formObj.warehouse" name="warehouse" placeholder="请选择库房号" style="width: 95%;"/>
<span @click="_storageModel()" style="font-size: 20px;color: #00b5ec">+</span>
</Form-item>
<Form-item label="架位号" prop="receiveLocation" style="width: 100%">
<Input v-model="formObj.receiveLocation" name="receiveLocation" placeholder="请选择架位号"/>
</Form-item>
<Form-item label="留存有效期:" prop="keepLimitTime" style="width: 100%">
<Date-picker v-model="formObj.keepLimitTime" @on-change="_ctimeChange" type="date" split-panels
placeholder="请选择留存有效期" name="keepLimitTime"></Date-picker>
</Form-item>
</Form>
</div>
<div slot="footer">
<ModalFooter ref="footerModal" @on-result-change="_footerResult" :footer="footerList"></ModalFooter>
</div>
</Modal>
<sampleKeep ref="storageModal" @on-result-change="_storageData"></sampleKeep>
</div>
</template>
<script>
/**
* 添加编辑
*/
import ModalFooter from '../../../../components/base/modalFooter'
import { soilAptitude, soilEntrust, soilSample } from '../../../../api'
import sampleKeep from '../sampleKeep'
export default {
components: {
ModalFooter,
sampleKeep
},
data() {
return {
formId: '',
modalTitle: '留存位置选择',
formObj: {
receiveLocation: undefined,
keepLimitTime: undefined,
locationId: undefined
},
ruleValidate: {},
showEditModal: false,
ids: '',
options: [],
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
}
},
_storageModel() {
this.$refs.storageModal._open()
},
_storageData(data) {
this.$forceUpdate()
this.formObj.locationId = data.id
this.formObj.warehouse = data.warehouse
this.formObj.receiveLocation = data.name
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
},
_resultChange(msg) {
this.showEditModal = false
this.$Message.success(msg)
this.$emit('on-result-change')
this._hideLoading()
},
_ctimeChange(data) {
this.formObj.keepLimitTime = data
},
_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('添加成功!')
}
},
_cancel() {
this._hideLoading()
this.showEditModal = false
},
_open(ids) {
this.formObj.receiveLocation = ''
this.formObj.warehouse = ''
this.formObj.keepLimitTime = undefined
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)
}
}
}
</script>
<!--检测项目编辑列表(添加、导入检测项目)-->
<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>
<template>
<div>
<Modal v-model="showSampleModal" v-drag @on-visible-change="_visibleChange" width="1100"
class="zIndex-900 modal-footer-none">
<p slot="header"> {{name}}--管理样品</p>
<div>
<el-tabs v-model="activeName" @tab-click="_changeTabs">
<el-tab-pane label="待接收样品" name="waitReceive">
<WaitReceive ref="waitReceiveModal" @on-result-change="_search"></WaitReceive>
</el-tab-pane>
<el-tab-pane label="待发放样品" name="waitScan">
<WaitScan ref="waitScanModal" @-result-change="_search"></WaitScan>
</el-tab-pane>
</el-tabs>
</div>
</Modal>
</div>
</template>
<script>
import WaitReceive from './WaitReceive'
import WaitScan from './WaitScan'
export default {
components: {
WaitReceive,
WaitScan
},
data() {
return {
type: '',
contractId: '', // 合同id
showSampleModal: false,
modalTitle: '',
selectIds: [],
activeName: 'waitReceive',
name: ''
}
},
methods: {
_initTab() {
if (this.$showBtn('food-wait-Issue-sample')) {
this.activeName = 'waitScan'
this._waitSend()
}
},
_open(contractId, type, name) {
this.type = type // 类型(采样或送样)
this.name = name
this.showSampleModal = true
this.entrustId = contractId // 合同id
this.activeName = 'waitReceive'
this.selectIds = []
this._waitPage()
},
// 待接收
_waitPage() {
this.$refs.waitReceiveModal._open(this.entrustId, this.type)
},
// 待发放
_waitSend() {
this.$refs.waitScanModal._open(this.contractId, this.type)
},
// 已接收
_issuedPage() {
this.$refs.alreadyIssuedModal._open(this.contractId, this.type)
},
_changeTabs(tab, event) {
if (tab.name === 'alreadyIssued') {
this._issuedPage()
} else if (tab.name === 'waitReceive') {
this._waitPage()
} else if (tab.name === 'waitScan') {
this._waitSend()
}
},
_search() {
this.$emit('on-result-change')
},
// 关闭弹框的时候刷新上个界面
_visibleChange(data) {
if (data === false) {
this._search()
}
}
}
}
</script>
<template>
<div>
<Modal v-model="showSampleModal" v-drag @on-visible-change="_visibleChange" width="1100"
class="zIndex-900 modal-footer-none">
<p slot="header"> {{name}}--管理样品</p>
<div>
<el-tabs v-model="activeName" @tab-click="_changeTabs">
<el-tab-pane label="接收历史" name="waitReceive">
<WaitReceive ref="waitReceiveModal" @on-result-change="_search"></WaitReceive>
</el-tab-pane>
<el-tab-pane label="发放历史" name="waitScan">
<WaitScan ref="waitScanModal" @-result-change="_search"></WaitScan>
</el-tab-pane>
</el-tabs>
</div>
</Modal>
</div>
</template>
<script>
import WaitReceive from './WaitReceiveHis'
import WaitScan from './AlreadyIssuedHis'
export default {
components: {
WaitReceive,
WaitScan
},
data() {
return {
type: '',
entrustId: '', // 合同id
showSampleModal: false,
modalTitle: '',
selectIds: [],
activeName: 'waitReceive',
name: ''
}
},
methods: {
_initTab() {
if (this.$showBtn('food-wait-Issue-sample')) {
this.activeName = 'waitScan'
this._waitSend()
}
},
_open(entrustId, type, name) {
this.type = type // 类型(采样或送样)
this.name = name
this.showSampleModal = true
this.entrustId = entrustId // 合同id
this.activeName = 'waitReceive'
this.selectIds = []
this._waitPage()
},
// 待接收
_waitPage() {
this.$refs.waitReceiveModal._open(this.entrustId, this.type)
},
// 待发放
_waitSend() {
this.$refs.waitScanModal._open(this.entrustId, this.type)
},
// 已接收
_issuedPage() {
this.$refs.alreadyIssuedModal._open(this.entrustId, this.type)
},
_changeTabs(tab, event) {
if (tab.name === 'alreadyIssued') {
this._issuedPage()
} else if (tab.name === 'waitReceive') {
this._waitPage()
} else if (tab.name === 'waitScan') {
this._waitSend()
}
},
_search() {
this.$emit('on-result-change')
},
// 关闭弹框的时候刷新上个界面
_visibleChange(data) {
if (data === false) {
this._search()
}
}
}
}
</script>
<!--检测项目编辑列表(添加、导入检测项目)-->
<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.warehouse" @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" :hide-checkbox="true" :is-radio="true" 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==='type'">
{{scope.row[item.key]===0?'待检':scope.row[item.key]===1?'备样':scope.row[item.key]===2?'备用': ''}}
</div>
<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 { soilEntrust, soilSample } from '../../../api'
export default {
components: {},
data() {
return {
formObj: {},
ids: '',
showModal: false,
searchOpen: false,
btn: [],
index: '',
iconMsg: [],
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '确定', type: 'primary' }
],
pageColumns: [
{ title: '库房名', key: 'warehouse', width: 140 },
{ title: '货架号', key: 'name', width: 140 },
{ title: '位置分类', key: 'type', width: 140 }
// { 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(ids) {
this.formObj = this.$resetFields(this.formObj)
this.showModal = true
this.getPage.records = []
this.$refs.pageTable._hideLoading()
this.selectData = {}
this.ids = ids
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() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilSample.aloneWarehouseLocation(
this.$serializeForm(this.formObj)
)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_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) {
console.log(msg, data)
switch (msg) {
case 'page':
this._page()
break
case 'selectData':
this.selectData = data
break
case 'singleSelect':
this.selectData = {}
this.selectData = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
case 'changeSize':
this._page()
break
}
},
_ok() {
const data = this.selectData
console.log('data', data)
if (data.id) {
this.showModal = false
this.$emit('on-result-change', data)
this._hideLoading()
} else {
this.$Message.warning('请选择收样位置')
this._hideLoading()
}
// const ids = []
// data.forEach(item => {
// ids.push(item.id)
// })
// console.log('this.selectData', this.formObj)
},
_receive: async function(data) {
const result = await soilEntrust.receiveSample(data)
if (result) {
this.$refs.footerModal._hideLoading()
this.showModal = false
this.$Message.success('成功收样')
this.$emit('on-result-change')
}
this._hideLoading()
},
_cancel() {
this.selectData = []
this.showModal = false
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
}
}
}
</script>
<!--检测项目编辑列表(添加、导入检测项目)-->
<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.warehouse" @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" :hide-checkbox="true" :is-radio="true" 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==='type'">
{{scope.row[item.key]===0?'待检':scope.row[item.key]===1?'备样':scope.row[item.key]===2?'备用': ''}}
</div>
<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 { soilEntrust, soilSample } from '../../../api'
export default {
components: {},
data() {
return {
formObj: {},
ids: '',
showModal: false,
searchOpen: false,
btn: [],
index: '',
iconMsg: [],
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '确定', type: 'primary' }
],
pageColumns: [
{ title: '库房名', key: 'warehouse', width: 140 },
{ title: '货架号', key: 'name', width: 140 },
{ title: '位置分类', key: 'type', width: 140 }
// { 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(ids) {
this.formObj = this.$resetFields(this.formObj)
this.showModal = true
this.getPage.records = []
this.$refs.pageTable._hideLoading()
this.selectData = {}
this.ids = ids
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() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilSample.aloneWarehouseLocation(
this.$serializeForm(this.formObj)
)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_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) {
console.log(msg, data)
switch (msg) {
case 'page':
this._page()
break
case 'selectData':
this.selectData = data
break
case 'singleSelect':
this.selectData = {}
this.selectData = data
break
case 'iconClick':
this._iconClick(data.name, data.rowData)
break
case 'changeSize':
this._page()
break
}
},
_ok() {
const data = this.selectData
console.log('data', data)
if (data.id) {
this.formObj.receiveLocation = data.name
this.formObj.warehouse = data.warehouse
this.formObj.locationId = data.id
this.formObj.ids = this.ids
this._receive(this.formObj)
} else {
this.$Message.warning('请选择收样位置')
this._hideLoading()
}
// const ids = []
// data.forEach(item => {
// ids.push(item.id)
// })
// console.log('this.selectData', this.formObj)
},
_receive: async function(data) {
const result = await soilEntrust.receiveSample(data)
if (result) {
this.$refs.footerModal._hideLoading()
this.showModal = false
this.$Message.success('成功收样')
this.$emit('on-result-change')
}
this._hideLoading()
},
_cancel() {
this.selectData = []
this.showModal = false
},
_hideLoading() {
this.$refs.footerModal._hideLoading()
}
}
}
</script>
......@@ -385,7 +385,29 @@ export default {
if (this.selectData.length === 0) {
this.$Message.warning('请至少选择一条数据')
} else {
console.log(this.selectData)
this._sendToAlone()
}
},
_sendToAlone() {
if (this.selectIds.length === 0) {
this.$message.warning('请至少选择一条数据!')
} else {
const data = {
ids: this.selectIds.join(',')
}
this.$Modal.confirm({
title: '提示',
content: '确定要发放这 ' + this.selectIds.length + ' 条数据?',
onOk: () => {
this._sendAloneKeep(data)
}
})
}
},
_sendAloneKeep: async function(data) {
const result = await soilEntrust.aloneKeepSample(data)
if (result) {
this._resultChange('发放成功')
}
},
_resultChange(msg) {
......
......@@ -13,6 +13,7 @@ import StorehousePlace from '../pages/soil-alone-sample-manage/storehouse-place-
import StorehouseSample from '../pages/soil-alone-sample-manage/storehouse-sample-manage/AddressManage'
import ReviewEntrust from '../pages/meter-entrust/entrust-review/ReviewEntrust'
import SampleReceiveIndex from '../pages/soil-sample-manage/sample-receive/SampleReceiveIndex'
import AloneKeepIndex from '../pages/soil-sample-manage/sample-alone-keep/SampleReceiveIndex'
import SamplePreparationIndex from '../pages/soil-sample-manage/sample-preparation/SamplePreparationIndex'
import SamplePreparationCheckIndex from '../pages/soil-sample-manage/sample-preparation-check/SamplePreparationIndex'
import AddressManage from '../pages/soil-sample-manage/sample-address/AddressManage'
......@@ -111,6 +112,11 @@ export default [
meta: { title: '样品分波' }
},
{
path: 'alone_keep',
component: AloneKeepIndex,
meta: { title: '独立留存' }
},
{
path: 'prepare',
component: SamplePreparationIndex,
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