Commit 1ac82c4b by wangweidong

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

parents 566d63c3 9241ce6a
...@@ -29,3 +29,4 @@ export { default as meterSample } from './meter/meter-sample' ...@@ -29,3 +29,4 @@ export { default as meterSample } from './meter/meter-sample'
export { default as soilAptitude } from './soil/soil-aptitude' export { default as soilAptitude } from './soil/soil-aptitude'
export { default as soilEntrust } from './soil/soil-entrust' export { default as soilEntrust } from './soil/soil-entrust'
export { default as soilSample } from './soil/soil-sample' export { default as soilSample } from './soil/soil-sample'
export { default as soilTest } from './soil/soil-test'
...@@ -8,6 +8,7 @@ import { https } from '../https' ...@@ -8,6 +8,7 @@ import { https } from '../https'
export default { export default {
// page // page
page: data => http.post('soil/v1/entrust/page', data).then(res => res), page: data => http.post('soil/v1/entrust/page', data).then(res => res),
pageItem: data => http.post('soil/v1/experiment/page', data).then(res => res),
pageReview: data => pageReview: data =>
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 =>
...@@ -68,5 +69,17 @@ export default { ...@@ -68,5 +69,17 @@ export default {
photoView: data => photoView: data =>
http http
.get('soil/v1/sample_photo/view?objectKey=' + data.objectKey) .get('soil/v1/sample_photo/view?objectKey=' + data.objectKey)
.then(res => res) .then(res => res),
// 试样制备表
preparePage: data =>
http
.post('soil/v1/sample/obtain_prepare_data?ids=' + data)
.then(res => res),
// 试样制备完成
savePrepare: data =>
https
.post('soil/v1/sample/prepare_ok', JSON.stringify(data))
.then(res => res),
// 试验室按样品分页列表
pageTake: data => http.post('soil/v1/sample/page_take', data).then(res => res)
} }
...@@ -18,5 +18,8 @@ export default { ...@@ -18,5 +18,8 @@ export default {
locationDeleteById: data => locationDeleteById: data =>
http.delete('soil/v1/receive_location/?ids=' + data).then(res => res), http.delete('soil/v1/receive_location/?ids=' + data).then(res => res),
locationEdit: data => locationEdit: data =>
http.put('soil/v1/receive_location/' + data.id, data.obj).then(res => res) http.put('soil/v1/receive_location/' + data.id, data.obj).then(res => res),
// 试验室领样操作
takeSample: data =>
http.post('soil/v1/sample/take_sample?ids=' + data).then(res => res)
} }
/**
* 工作台
*/
import http from '../http'
// import { https } from '../https'
export default {
// page
pageExpAllot: data =>
http.post('soil/v1/entrust/page_exp_allot', data).then(res => res)
}
...@@ -123,17 +123,17 @@ ...@@ -123,17 +123,17 @@
</Spin> </Spin>
</div> </div>
<!--图片预览--> <!--图片预览-->
<!-- <div>--> <div>
<!-- <vue-gallery-slideshow :images="imgViewList" :index="imgViewIndex"--> <vue-gallery-slideshow :images="imgViewList" :index="imgViewIndex"
<!-- @close="imgViewIndex = null"></vue-gallery-slideshow>--> @close="imgViewIndex = null"></vue-gallery-slideshow>
<!-- </div>--> </div>
</div> </div>
</template> </template>
<script> <script>
// import VueGallerySlideshow from 'vue-gallery-slideshow' // import VueGallerySlideshow from 'vue-gallery-slideshow'
import global from '../../../api/config' import global from '../../../api/config'
import { meterEntrust, soilEntrust } from '../../../api' import { meterEntrust } from '../../../api'
/** /**
* 公共组件modal 弹框(支持上传,下载,预览,删除附件等操作) * 公共组件modal 弹框(支持上传,下载,预览,删除附件等操作)
*/ */
...@@ -217,6 +217,7 @@ export default { ...@@ -217,6 +217,7 @@ export default {
this.idsObj = idsObj this.idsObj = idsObj
this.urlData = data this.urlData = data
this.action = global.baseURL + data.uploadFileUrl + data.id this.action = global.baseURL + data.uploadFileUrl + data.id
this.downloadFileUrlFile = data.downloadFileUrl
this.$nextTick(() => { this.$nextTick(() => {
this._page() this._page()
}) })
...@@ -294,14 +295,18 @@ export default { ...@@ -294,14 +295,18 @@ export default {
} }
}, },
// 预览图片(该合同下所有的) // 预览图片(该合同下所有的)
// _viewImg(data) { _viewImg(data) {
_viewImg: async function(data) { // _viewImg: async function(data) {
console.log(data) // console.log(data)
const viewKey = {} // const viewKey = {}
viewKey.objectKey = data.objectKey // viewKey.objectKey = data.objectKey
console.log(viewKey) // console.log(viewKey)
const result = await soilEntrust.photoView(viewKey) // const result = await soilEntrust.photoView(viewKey)
console.log(result) // console.log(result)
const imgViewList = []
imgViewList.push(global.baseURL + this.downloadFileUrlFile + data.id)
this.imgViewList = imgViewList
this.imgViewIndex = 0
// if (this.urlData.viewUri === '/meter/v1/entrust_attachment/preview/') { // if (this.urlData.viewUri === '/meter/v1/entrust_attachment/preview/') {
// const id = data.entrustId // const id = data.entrustId
// const result = await meterEntrust.entrustPreview(id) // const result = await meterEntrust.entrustPreview(id)
......
...@@ -261,6 +261,7 @@ export default { ...@@ -261,6 +261,7 @@ export default {
if (this.hideCheckbox === undefined || this.hideCheckbox === false) { if (this.hideCheckbox === undefined || this.hideCheckbox === false) {
const selData = data.selection const selData = data.selection
this.checkData = selData this.checkData = selData
console.log('checkData', this.checkData)
// 默认返回的是id数组 // 默认返回的是id数组
if (this.selectData === undefined) { if (this.selectData === undefined) {
const idList = [] const idList = []
......
...@@ -8,6 +8,12 @@ ...@@ -8,6 +8,12 @@
<Form-item label="试验名称" prop="name" class="width-48"> <Form-item label="试验名称" prop="name" class="width-48">
<Input v-model="formObj.name" name="name" placeholder="请输入试验名称"/> <Input v-model="formObj.name" name="name" placeholder="请输入试验名称"/>
</Form-item> </Form-item>
<Form-item label="检测科室" prop="groupName" class="width-48">
<Input v-model="formObj.groupName" name="groupName" placeholder="请输入试验名称"/>
</Form-item>
<Form-item label="检测依据" prop="testBasis" class="width-48">
<Input v-model="formObj.testBasis" name="testBasis" placeholder="请输入试验名称"/>
</Form-item>
<Form-item label="英文名称" prop="elName" class="width-48"> <Form-item label="英文名称" prop="elName" class="width-48">
<Input v-model="formObj.elName" name="elName" <Input v-model="formObj.elName" name="elName"
placeholder="请输入英文名称"/> placeholder="请输入英文名称"/>
...@@ -57,7 +63,9 @@ export default { ...@@ -57,7 +63,9 @@ export default {
shortName: '', shortName: '',
mainType: '', mainType: '',
smallType: '', smallType: '',
testMethod: '' testMethod: '',
groupName: '',
testBasis: ''
}, },
ruleValidate: { ruleValidate: {
name: [{ required: true, message: '项目名称不能为空', trigger: 'blur' }] name: [{ required: true, message: '项目名称不能为空', trigger: 'blur' }]
......
...@@ -9,16 +9,16 @@ ...@@ -9,16 +9,16 @@
<Row> <Row>
<!--查询--> <!--查询-->
<Col span="24"> <Col span="24">
<Form v-show="searchOpen" id="search-sample-company" inline onsubmit="return false" :label-width="90"> <Form id="search-sample-company" v-show="searchOpen" :label-width="90" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item label="检测项目:" class="search-item"> <Form-item label="检测项目:" class="search-item">
<Input v-model="formObj.name" placeholder="请输入检测项目" clearable @on-enter="_formSearch" /> <Input v-model="formObj.name" @on-enter="_formSearch" placeholder="请输入检测项目" clearable />
</Form-item> </Form-item>
<Form-item label="检测依据:" class="search-item"> <Form-item label="检测依据:" class="search-item">
<Input v-model="formObj.code" placeholder="请输入检测依据" clearable @on-enter="_formSearch" /> <Input v-model="formObj.code" @on-enter="_formSearch" placeholder="请输入检测依据" clearable />
</Form-item> </Form-item>
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button type="primary" @click="_formSearch"> <Button @click="_formSearch" type="primary">
搜索 搜索
</Button> </Button>
</Form-item> </Form-item>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</Col> </Col>
<!--操作--> <!--操作-->
<Col span="24"> <Col span="24">
<btn-list :msg="btn" class="contHide" :open="searchOpen" show-search-btn="true" @on-result-change="_btnClick"></btn-list> <btn-list :msg="btn" :open="searchOpen" @on-result-change="_btnClick" class="contHide" show-search-btn="true"></btn-list>
</Col> </Col>
<!-- 表格 --> <!-- 表格 -->
<Col span="24"> <Col span="24">
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
<a @click.stop="_detailModal(scope.row)">{{ scope.row[item.key] }}</a> <a @click.stop="_detailModal(scope.row)">{{ scope.row[item.key] }}</a>
</div> </div>
<div v-else-if="item.key==='epibolyItem'" @click.stop="_handleRow(scope)"> <div v-else-if="item.key==='epibolyItem'" @click.stop="_handleRow(scope)">
<el-select v-if="showOption" v-model="scope.row.epibolyItem" placeholder="请选择" @change="_optionChange(scope.row)"> <el-select v-if="showOption" v-model="scope.row.epibolyItem" @change="_optionChange(scope.row)" placeholder="请选择">
<el-option <el-option
v-for="(item,index) in subOptions" v-for="(item,index) in subOptions"
:key="index" :key="index"
...@@ -66,35 +66,35 @@ ...@@ -66,35 +66,35 @@
<div v-else-if="item.key==='code'" @click.stop="_handleRow(scope)"> <div v-else-if="item.key==='code'" @click.stop="_handleRow(scope)">
<el-input <el-input
v-model="scope.row.code" v-model="scope.row.code"
@blur="_codeEdit({id:scope.row.id, obj :{code:scope.row.code}})"
style="width: 130px;" style="width: 130px;"
blur blur
placeholder="请选择检测依据" placeholder="请选择检测依据"
@blur="_codeEdit({id:scope.row.id, obj :{code:scope.row.code}})"
/> />
<i style="cursor: pointer;font-size: 14px;" class="icons iconfont pt-search icon-search" @click.stop="_selectjudgeBasis(scope.row.id,scope.$index)"></i> <i @click.stop="_selectjudgeBasis(scope.row.id,scope.$index)" style="cursor: pointer;font-size: 14px;" class="icons iconfont pt-search icon-search"></i>
</div> </div>
<div v-else-if="item.key==='compareSymbol'" @click.stop="_handleRow(scope)"> <div v-else-if="item.key==='compareSymbol'" @click.stop="_handleRow(scope)">
<el-input <el-input
v-model="scope.row.compareSymbol" v-model="scope.row.compareSymbol"
@blur="_compareSymbolEdit({id:scope.row.id, obj :{compareSymbol:scope.row.compareSymbol}})"
blur blur
placeholder="请输入比较符" placeholder="请输入比较符"
@blur="_compareSymbolEdit({id:scope.row.id, obj :{compareSymbol:scope.row.compareSymbol}})"
/> />
</div> </div>
<div v-else-if="item.key==='limitValue'" @click.stop="_handleRow(scope)"> <div v-else-if="item.key==='limitValue'" @click.stop="_handleRow(scope)">
<el-input <el-input
v-model="scope.row.limitValue" v-model="scope.row.limitValue"
@blur="_limitValueEdit({id:scope.row.id, obj :{limitValue:scope.row.limitValue}})"
blur blur
placeholder="请输入限值" placeholder="请输入限值"
@blur="_limitValueEdit({id:scope.row.id, obj :{limitValue:scope.row.limitValue}})"
/> />
</div> </div>
<div v-else-if="item.key==='unit'" @click.stop="_handleRow(scope)"> <div v-else-if="item.key==='unit'" @click.stop="_handleRow(scope)">
<el-input <el-input
v-model="scope.row.unit" v-model="scope.row.unit"
@blur="_unitEdit({id:scope.row.id, obj :{unit:scope.row.unit}})"
blur blur
placeholder="请输入单位" placeholder="请输入单位"
@blur="_unitEdit({id:scope.row.id, obj :{unit:scope.row.unit}})"
/> />
</div> </div>
<div v-else> <div v-else>
...@@ -472,7 +472,9 @@ export default { ...@@ -472,7 +472,9 @@ export default {
Object.assign(this.formObj, this.$refs.pageTable._searchParams()) Object.assign(this.formObj, this.$refs.pageTable._searchParams())
this.formObj = this.$serializeForm(this.formObj) this.formObj = this.$serializeForm(this.formObj)
this.formObj.sampleId = this.sampleId this.formObj.sampleId = this.sampleId
const result = await soilEntrust.page(this.$serializeForm(this.formObj)) const result = await soilEntrust.pageItem(
this.$serializeForm(this.formObj)
)
if (result) { if (result) {
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
this.getPage = result this.getPage = result
......
...@@ -311,6 +311,7 @@ export default { ...@@ -311,6 +311,7 @@ export default {
console.log(this.getPage.records) console.log(this.getPage.records)
}, },
_cusNameChange(msg, data) { _cusNameChange(msg, data) {
console.log('选择')
// this.financeObj = {} // 清空维护发票信息的数据 // this.financeObj = {} // 清空维护发票信息的数据
if (this.$string(this.id).isEmpty()) { if (this.$string(this.id).isEmpty()) {
// 添加的时候选择单位 // 添加的时候选择单位
...@@ -763,7 +764,7 @@ export default { ...@@ -763,7 +764,7 @@ export default {
_getQueryList: async function(data) { _getQueryList: async function(data) {
const result = await meterEntrust.pageQueryList(data) const result = await meterEntrust.pageQueryList(data)
if (result) { if (result) {
console.log(result) console.log('委托商', result)
} }
}, },
_save: async function(data) { _save: async function(data) {
......
...@@ -79,6 +79,7 @@ ...@@ -79,6 +79,7 @@
</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> <DescribeDetailModal ref="writeDetailModal" @on-result-change="_page"></DescribeDetailModal>
<PreparationModal ref="preModal" @on-result-change="_page"></PreparationModal>
</div> </div>
</template> </template>
<script> <script>
...@@ -87,9 +88,10 @@ import { soilEntrust } from '../../api' ...@@ -87,9 +88,10 @@ 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' import DescribeDetailModal from './sample-preparation/DescribeDetailModal'
import PreparationModal from './sample-preparation/Preparation'
let LODOP let LODOP
export default { export default {
components: { SoilSampleItemManage, DescribeDetailModal }, components: { SoilSampleItemManage, DescribeDetailModal, PreparationModal },
data() { data() {
return { return {
formId: 'soilSampleManage', formId: 'soilSampleManage',
...@@ -244,6 +246,7 @@ export default { ...@@ -244,6 +246,7 @@ export default {
this._printLabel() this._printLabel()
break break
case '试样制备': case '试样制备':
this._samplePre()
break break
case '批量填写土质描述详情': case '批量填写土质描述详情':
this._writeDetail(this.selectIds) this._writeDetail(this.selectIds)
...@@ -266,6 +269,13 @@ export default { ...@@ -266,6 +269,13 @@ export default {
} }
}) })
}, },
_samplePre() {
if (this.selectIds.length === 0) {
this.$message.warning('至少选择一条数据')
} else {
this.$refs.preModal._open(this.selectIds.join(','))
}
},
_writeDetail(id) { _writeDetail(id) {
if (this.selectIds.length === 0) { if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!') this.$Message.warning('请至少选中一条样品数据!')
......
...@@ -60,7 +60,11 @@ import Operation from '../../../components/operation/Operation' ...@@ -60,7 +60,11 @@ import Operation from '../../../components/operation/Operation'
import SoilSampleManage from '../SoilSampleManage' import SoilSampleManage from '../SoilSampleManage'
import SamplePreparationEdit from './SamplePreparationEdit' import SamplePreparationEdit from './SamplePreparationEdit'
export default { export default {
components: { Operation, SamplePreparationEdit, SoilSampleManage }, components: {
Operation,
SamplePreparationEdit,
SoilSampleManage
},
data() { data() {
return { return {
currentComponent: '', currentComponent: '',
......
<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">
<ReceiveByEntrust ref="entrustTabs"></ReceiveByEntrust>
</el-tab-pane>
<el-tab-pane label="按样品领样" name="sample">
<ReceiveBySample ref="sampleTabs"></ReceiveBySample>
</el-tab-pane>
</el-tabs>
</div>
</div>
</div>
</template>
<script>
import ReceiveByEntrust from './TakeByEntrust'
import ReceiveBySample from './TakeBySample'
export default {
name: 'MeterSummaryEntrustIndex',
components: {
ReceiveByEntrust,
ReceiveBySample
},
data() {
return {
activeName: 'entrust'
}
},
mounted() {
this.activeName = 'entrust'
this._page()
},
methods: {
_changeTabs(tab, event) {
if (tab.name === 'entrust') {
this._page()
} else {
this.$refs.sampleTabs._page()
}
},
_page() {
this.$refs.entrustTabs._page()
}
}
}
</script>
<style scoped>
</style>
<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/SampleSurplusManage'
import SampleBackupsQuery from './tab/SampleSurplusQuery'
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>
<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>
<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">
<ReceiveByEntrust ref="entrustTabs"></ReceiveByEntrust>
</el-tab-pane>
<el-tab-pane label="按样品分配" name="sample">
<ReceiveBySample ref="sampleTabs"></ReceiveBySample>
</el-tab-pane>
</el-tabs>
</div>
</div>
</div>
</template>
<script>
import ReceiveByEntrust from './AllotByEntrust'
import ReceiveBySample from './ReceiveBySample'
export default {
name: 'MeterSummaryEntrustIndex',
components: {
ReceiveByEntrust,
ReceiveBySample
},
data() {
return {
activeName: 'entrust'
}
},
mounted() {
this.activeName = 'entrust'
this._page()
},
methods: {
_changeTabs(tab, event) {
if (tab.name === 'entrust') {
this._page()
} else {
this.$refs.sampleTabs._page()
}
},
_page() {
this.$refs.entrustTabs._page()
}
}
}
</script>
<style scoped>
</style>
<template>
<div>
<!--自动分配-->
<Modal v-model="showTimeModal">
<p slot="header">计划完成时间</p>
<div>
<Alert type="success" show-icon>{{ total }}</Alert>
<Form ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="150" inline>
<Form-item label="计划完成时间" prop="planDate" style="width:100%">
<Date-picker v-model="formObj.planDate" :editable="false" @on-change="_endDateChange"
type="date" placeholder="计划完成时间" format="yyyy-MM-dd"
style="width: 100%;"></Date-picker>
</Form-item>
</Form>
</div>
<div slot="footer">
<Button @click="_timeCancel" style="margin-left: 8px">取消</Button>
<Button @click="_timeOk" type="primary">提交</Button>
</div>
</Modal>
</div>
</template>
<script>
/**
*自动分配
*/
export default {
components: {},
data() {
return {
showTimeModal: false,
formObj: {
planDate: ''
},
planDate: '',
ruleValidate: {
planDate: [
{
required: true,
message: '请选择计划完成时间',
trigger: 'change',
type: 'date'
}
]
},
total: ''
}
},
methods: {
_open(num) {
this.showTimeModal = true
this.total = '可自动分配项目有 ' + num + ' 条'
},
_endDateChange(data) {
this.planDate = data
console.log(this.planDate, 123)
},
_timeCancel() {
this.showTimeModal = false
},
_timeOk() {
this.$refs.formObj.validate(valid => {
if (valid) {
this.$store.dispatch('FoodItem/autoAllot', this.planDate).then(() => {
this._resultChange('自动分配成功!')
})
} else {
this.$Message.error('表单验证失败!')
}
})
},
_resultChange(msg) {
if (this.$store.state.FoodItem.success) {
this.$Message.success(msg)
this.$emit('on-result-change')
this.showTimeModal = false
}
}
}
}
</script>
<template>
<div>
<Modal v-model="showSampleModal" @on-visible-change="_visibleChange" width="1200"
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 './item-tabs/ItemTabs'
import WaitScan from './sample-tabs/SampleTabs'
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()
},
// 待发放
_waitSend() {
this.$refs.waitScanModal._open()
},
// 已接收
_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>
<Row>
<!--查询-->
<Col span="24">
<Form id="task-assign-item-left" :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-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<Col span="24">
<btn-list :msg="btn" @on-result-change="_btnClick" class="contHide"></btn-list>
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :pageColumns="pageColumns" :table-name="tableName"
:tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" :rows="100" select-data>
<vxe-table-column
v-for="item in userColumns.length > 0 ?userColumns:pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:min-width="item.width"
:fixed="item.fixed?item.fixed:undefined"
sortable>
<template slot-scope="scope">
<a v-if="item.detail" @click.stop="_detailModal(scope.row)">{{scope.row[item.key]}}</a>
<span v-else-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
<VXESettingCol slot="setting" :pageColumns="pageColumns" :userColumns="userColumns"
@on-result-change="_resetColumn" :table-name="tableName"></VXESettingCol>
</PTVXETable>
</Col>
</Row>
<AutoAssignModal ref="autoAssignModal" @on-result-change="_page"></AutoAssignModal>
</div>
</template>
<script>
import { soilTest } from '../../../../../api'
import AutoAssignModal from '../AutoAssignModal'
export default {
components: { AutoAssignModal },
data() {
return {
currentComponent: '',
formObj: {},
tableName: 'food-task-assign-item-left',
// 用户自己选中的列
userColumns: [],
optionList: [
{ key: 'name', name: '检测项目', placeholder: '请输入检测项目' },
{ key: 'testBasis', name: '检测依据', placeholder: '请输入检测依据' }
],
btn: [{ id: '', name: '自动分配' }],
getPage: {},
pageColumns: [
{ title: '检测项目', key: 'name', width: 120 },
{ title: '检测依据', key: 'testBasis', width: 140 },
{ title: '检测依据名称', key: 'testBasisName', width: 200 }
]
}
},
computed: {
tableHeight: function() {
return this.$tableHeight('tabSearch')
}
},
methods: {
// 重置column
_resetColumn(colList) {
this.userColumns = colList
this.$refs.pageTable._loadColumn(colList)
},
_modalResult() {
if (this.currentComponent === 'AutoAssignModal') {
this._formSearch()
}
},
_selInputResult1(msg, data) {
switch (msg) {
case 'search':
this._formSearch()
break
}
},
_open() {
this._page()
},
_searchParams() {
const obj = {}
const obj1 = this.$refs.selInput1._getFormObj()
Object.assign(obj, obj1)
return obj
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj)
const result = await soilTest.pageExpAllot(
this.$serializeForm(this.formObj)
)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodItem.page
break
case 'selectData':
this.$emit('on-result-change', data)
break
case 'changeSize':
this._page()
break
case 'table-col':
// 用户选中的表格列
this.userColumns = data
break
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_btnClick(msg) {
switch (msg) {
case '自动分配':
this._autoAssign()
break
}
},
_autoAssign() {
this.$refs.autoAssignModal._open()
// this.$store.dispatch('FoodItem/autoAllotNum').then(() => {
// const num = this.$store.state.FoodItem.count
// if (num !== undefined) {
// this.$refs.refModal._open(num)
// }
// })
}
}
}
</script>
<template>
<div>
<TwoColumnPage>
<template slot="left">
<ItemLeftList ref="leftModal" @on-result-change="_leftResult"></ItemLeftList>
</template>
<template slot="right">
<ItemRightList ref="rightModal" @on-result-change="_rightResult"></ItemRightList>
</template>
</TwoColumnPage>
</div>
</template>
<script>
import TwoColumnPage from '../../../../../components/base/TwoColumnPage'
import ItemLeftList from './ItemLeftList'
import ItemRightList from './ItemRightList'
export default {
components: {
TwoColumnPage,
ItemLeftList,
ItemRightList
},
data() {
return {}
},
methods: {
_leftResult(data) {
this.$refs.rightModal._open(data)
},
_rightResult() {
this.$refs.leftModal._page()
},
_open() {
this.$refs.leftModal._open()
// this.$refs.rightModal._getColumn()
}
}
}
</script>
<template>
<div>
<Row>
<!--查询-->
<Col span="24">
<Form id="task-assign-sample-left" :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-btn">
<Button @click="_formSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</Col>
<Col span="24">
<btn-list :msg="btn" @on-result-change="_btnClick" class="contHide"></btn-list>
</Col>
<!-- 表格 -->
<Col span="24">
<PTVXETable ref="pageTable" :pageColumns="pageColumns" :table-name="tableName"
:tableHeight="tableHeight"
@on-result-change="_tableResultChange" :getPage="getPage" :rows="100" select-data>
<vxe-table-column
v-for="item in userColumns.length > 0 ?userColumns:pageColumns"
:key="item.key"
:field="item.key"
:title="item.title"
:min-width="item.width"
:fixed="item.fixed?item.fixed:undefined"
sortable>
<template slot-scope="scope">
<a v-if="item.detail" @click.stop="_detailModal(scope.row)">{{scope.row[item.key]}}</a>
<span v-else-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span>
<span v-else>{{scope.row[item.key]}}</span>
</template>
</vxe-table-column>
<VXESettingCol slot="setting" :pageColumns="pageColumns" :userColumns="userColumns"
@on-result-change="_resetColumn" :table-name="tableName"></VXESettingCol>
</PTVXETable>
</Col>
</Row>
</div>
</template>
<script>
import { soilTest } from '../../../../../api'
export default {
components: {},
data() {
return {
currentComponent: '',
formObj: {},
tableName: 'food-task-assign-item-left',
// 用户自己选中的列
userColumns: [],
optionList: [
{ key: 'name', name: '检测项目', placeholder: '请输入检测项目' },
{ key: 'testBasis', name: '检测依据', placeholder: '请输入检测依据' }
],
btn: [{ id: '', name: '自动分配' }],
getPage: {},
pageColumns: [
{ title: '检测项目', key: 'name', width: 120 },
{ title: '检测依据', key: 'testBasis', width: 140 },
{ title: '检测依据名称', key: 'testBasisName', width: 200 }
]
}
},
computed: {
tableHeight: function() {
return this.$tableHeight('tabSearch')
}
},
methods: {
// 重置column
_resetColumn(colList) {
this.userColumns = colList
this.$refs.pageTable._loadColumn(colList)
},
_modalResult() {
if (this.currentComponent === 'AutoAssignModal') {
this._formSearch()
}
},
_selInputResult1(msg, data) {
switch (msg) {
case 'search':
this._formSearch()
break
}
},
_open() {
this._page()
},
_searchParams() {
const obj = {}
const obj1 = this.$refs.selInput1._getFormObj()
Object.assign(obj, obj1)
return obj
},
_page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams())
const result = await soilTest.pageExpAllot(
this.$serializeForm(this.formObj)
)
if (result) {
this.$refs.pageTable._hideLoading()
this.getPage = result
}
},
_tableResultChange(msg, data) {
switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodItem.page
break
case 'selectData':
this.$emit('on-result-change', data)
break
case 'changeSize':
this._page()
break
case 'table-col':
// 用户选中的表格列
this.userColumns = data
break
}
},
_formSearch() {
this.$refs.pageTable._pageChange(1)
},
_btnClick(msg) {
switch (msg) {
case '自动分配':
this.currentComponent = 'AutoAssignModal'
this.$nextTick(function() {
this._autoAssign()
})
break
}
},
_autoAssign() {
this.$store.dispatch('FoodItem/autoAllotNum').then(() => {
const num = this.$store.state.FoodItem.count
if (num !== undefined) {
this.$refs.refModal._open(num)
}
})
}
}
}
</script>
<template>
<div>
<TwoColumnPage>
<template slot="left">
<ItemLeftList ref="SampleleftModal" @on-result-change="_leftResult"></ItemLeftList>
</template>
<template slot="right">
<ItemRightList ref="SamplerightModal" @on-result-change="_rightResult"></ItemRightList>
</template>
</TwoColumnPage>
</div>
</template>
<script>
import TwoColumnPage from '../../../../../components/base/TwoColumnPage'
import ItemLeftList from './SampleLeftList'
import ItemRightList from './SampleRightList'
export default {
components: {
TwoColumnPage,
ItemLeftList,
ItemRightList
},
data() {
return {}
},
methods: {
_leftResult(data) {
this.$refs.SamplerightModal._open(data)
},
_rightResult() {
this.$refs.SampleleftModal._page()
},
_open() {
console.log('按样品分配')
this.$refs.SampleleftModal._open()
// this.$refs.rightModal._getColumn()
}
}
}
</script>
...@@ -11,6 +11,9 @@ import SampleReceiveIndex from '../pages/soil-sample-manage/sample-receive/Sampl ...@@ -11,6 +11,9 @@ import SampleReceiveIndex from '../pages/soil-sample-manage/sample-receive/Sampl
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 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'
import TestTaskIndex from '../pages/soil-test-manage/test-task-manage/TestTaskIndex'
import Blank from '~/pages/blank' import Blank from '~/pages/blank'
export default [ export default [
{ {
...@@ -50,7 +53,7 @@ export default [ ...@@ -50,7 +53,7 @@ export default [
}, },
{ {
path: 'take', path: 'take',
component: workbench, component: SampleTakeIndex,
meta: { title: '试验室领样' } meta: { title: '试验室领样' }
}, },
{ {
...@@ -59,6 +62,11 @@ export default [ ...@@ -59,6 +62,11 @@ export default [
meta: { title: '备样管理' } meta: { title: '备样管理' }
}, },
{ {
path: 'surplus',
component: SurplusManage,
meta: { title: '余样管理' }
},
{
path: 'receive_location', path: 'receive_location',
component: AddressManage, component: AddressManage,
meta: { title: '收样位置管理' } meta: { title: '收样位置管理' }
...@@ -66,6 +74,22 @@ export default [ ...@@ -66,6 +74,22 @@ export default [
] ]
}, },
{ {
path: 'test',
component: Blank,
children: [
{
path: 'allot_task',
component: TestTaskIndex,
meta: { title: '试验任务分配' }
},
{
path: 'do_test',
component: ExperimentItemManage,
meta: { title: '试样检测' }
}
]
},
{
path: 'aptitude', path: 'aptitude',
component: Blank, component: Blank,
children: [ children: [
......
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