Commit e309d18b by wangweidong

土工试验Lims

parent addfc842
...@@ -15,8 +15,12 @@ export default { ...@@ -15,8 +15,12 @@ export default {
http.post('soil/v1/entrust/page_review', data).then(res => res), http.post('soil/v1/entrust/page_review', data).then(res => res),
pageSampleReceive: data => pageSampleReceive: data =>
http.post('soil/v1/entrust/page_sample_receive', data).then(res => res), http.post('soil/v1/entrust/page_sample_receive', data).then(res => res),
pageSampleReceiveHis: data =>
http.post('soil/v1/entrust/page_sample_receive_his', data).then(res => res),
pageSamplePrepare: data => pageSamplePrepare: data =>
http.post('soil/v1/entrust/page_sample_prepare', data).then(res => res), http.post('soil/v1/entrust/page_sample_prepare', data).then(res => res),
pageSamplePrepareHis: data =>
http.post('soil/v1/entrust/page_sample_prepare_his', data).then(res => res),
getById: data => http.get('soil/v1/entrust/' + data).then(res => res), getById: data => http.get('soil/v1/entrust/' + data).then(res => res),
getVOById: data => http.get('soil/v1/entrust/vo/' + data).then(res => res), getVOById: data => http.get('soil/v1/entrust/vo/' + data).then(res => res),
deleteById: data => deleteById: data =>
...@@ -48,14 +52,20 @@ export default { ...@@ -48,14 +52,20 @@ export default {
samplePage: data => http.post('soil/v1/sample/page', data).then(res => res), samplePage: data => http.post('soil/v1/sample/page', data).then(res => res),
pageReceive: data => pageReceive: data =>
http.post('soil/v1/sample/page_receive', data).then(res => res), http.post('soil/v1/sample/page_receive', data).then(res => res),
pageReceiveHis: data =>
http.post('soil/v1/sample/page_receive_his', data).then(res => res),
pageSend: data => pageSend: data =>
http.post('soil/v1/sample/page_send', data).then(res => res), http.post('soil/v1/sample/page_send', data).then(res => res),
pageSendHis: data =>
http.post('soil/v1/sample/page_send_his', data).then(res => res),
receiveSample: data => receiveSample: data =>
http.post('soil/v1/sample/receive_sample', data).then(res => res), http.post('soil/v1/sample/receive_sample', data).then(res => res),
sendSample: data => sendSample: data =>
http.post('soil/v1/sample/send_sample', data).then(res => res), http.post('soil/v1/sample/send_sample', data).then(res => res),
pagePrepare: data => pagePrepare: data =>
http.post('soil/v1/sample/page_prepare', data).then(res => res), http.post('soil/v1/sample/page_prepare', data).then(res => res),
pagePrepareHis: data =>
http.post('soil/v1/sample/page_prepare_his', data).then(res => res),
sampleEdit: data => sampleEdit: data =>
http.put( http.put(
'soil/v1/sample/' + data.id + '?describeDetail=' + data.describeDetail 'soil/v1/sample/' + data.id + '?describeDetail=' + data.describeDetail
......
...@@ -9,28 +9,13 @@ ...@@ -9,28 +9,13 @@
<Row> <Row>
<!--查询--> <!--查询-->
<Col span="24"> <Col span="24">
<Form id="search-sample-company" v-show="searchOpen" :label-width="80" inline onsubmit="return false"> <Form v-show="searchOpen" id="search-sample-company" :label-width="80" inline onsubmit="return false">
<label class="label-sign"></label> <label class="label-sign"></label>
<Form-item label="样品名称:" class="search-item">
<Input v-model="formObj.name" @on-enter="_formSearch" placeholder="请输入样品名称" clearable />
</Form-item>
<Form-item label="样品编号:" class="search-item"> <Form-item label="样品编号:" class="search-item">
<Input v-model="formObj.sampleCode" @on-enter="_formSearch" placeholder="请输入样品编号" clearable /> <Input v-model="formObj.sampleCode" placeholder="请输入样品编号" clearable @on-enter="_formSearch" />
</Form-item> </Form-item>
<!-- <Form-item label="制单日期:" style="width: 25%">-->
<!-- <Date-picker-->
<!-- v-model="dateList"-->
<!-- type="daterange"-->
<!-- placeholder="制单日期"-->
<!-- format="yyyy-MM-dd"-->
<!-- :editable="false"-->
<!-- style="width:100%"-->
<!-- placement="bottom-end"-->
<!-- @on-change="_dateChange"-->
<!-- ></Date-picker>-->
<!-- </Form-item>-->
<Form-item class="search-btn"> <Form-item class="search-btn">
<Button @click="_page" type="primary"> <Button type="primary" @click="_page">
搜索 搜索
</Button> </Button>
</Form-item> </Form-item>
...@@ -38,12 +23,12 @@ ...@@ -38,12 +23,12 @@
</Col> </Col>
<!--操作--> <!--操作-->
<Col span="24"> <Col span="24">
<btn-list :msg="btn" :open="searchOpen" @on-result-change="_btnClick" class="contHide" show-search-btn="true"></btn-list> <btn-list :msg="btn" :open="searchOpen" class="contHide" show-search-btn="true" @on-result-change="_btnClick"></btn-list>
</Col> </Col>
<!-- 表格 --> <!-- 表格 -->
<Col span="24"> <Col span="24">
<PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true" <PTVXETable ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true"
:get-page="getPage" :icon-msg="iconMsg" @on-result-change="_tableResultChange" select-data> :get-page="getPage" :icon-msg="iconMsg" select-data @on-result-change="_tableResultChange">
<vxe-table-column <vxe-table-column
v-for="item in pageColumns" v-for="item in pageColumns"
:key="item.key" :key="item.key"
...@@ -61,9 +46,6 @@ ...@@ -61,9 +46,6 @@
<div v-else-if="item.date"> <div v-else-if="item.date">
{{ scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):'' }} {{ scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):'' }}
</div> </div>
<div v-else-if="item.key==='describeDetail'" @click.stop="_handleRow(scope)">
<el-input v-model="scope.row.describeDetail" @change="_inputChange(scope.row)"></el-input>
</div>
<div v-else> <div v-else>
{{ scope.row[item.key] }} {{ scope.row[item.key] }}
</div> </div>
...@@ -97,21 +79,11 @@ export default { ...@@ -97,21 +79,11 @@ export default {
formId: 'soilSampleManage', formId: 'soilSampleManage',
currentComponent: '', currentComponent: '',
btn: [ btn: [
// {
// type: 'success',
// id: '',
// name: '试样制备'
// },
{ {
type: 'success', type: 'success',
id: 'ZBC', id: 'ZBC',
name: '打印标签' name: '打印标签'
} }
// {
// type: 'success',
// id: '',
// name: '批量填写土质描述详情'
// }
], ],
itemList: [], itemList: [],
indexList: [], indexList: [],
...@@ -127,7 +99,7 @@ export default { ...@@ -127,7 +99,7 @@ export default {
} }
// { type: 'md-trash', id: '', name: '删除' } // { type: 'md-trash', id: '', name: '删除' }
], ],
contractId: '', // 委托id entrustId: '', // 委托id
showModal: false, showModal: false,
recordHis: false, recordHis: false,
searchOpen: true, searchOpen: true,
...@@ -146,7 +118,7 @@ export default { ...@@ -146,7 +118,7 @@ export default {
sampleId: '', sampleId: '',
dateList: [], dateList: [],
formObj: { formObj: {
name: undefined, entrustId: undefined,
sampleCode: undefined sampleCode: undefined
} }
} }
...@@ -302,7 +274,7 @@ export default { ...@@ -302,7 +274,7 @@ export default {
} }
}, },
_copyHisSample() { _copyHisSample() {
this.$refs.refModal._open(this.contractId) this.$refs.refModal._open(this.entrustId)
}, },
_iconClick(res, data, componentName, index) { _iconClick(res, data, componentName, index) {
...@@ -369,8 +341,8 @@ export default { ...@@ -369,8 +341,8 @@ export default {
this.formObj = this.$resetFields(this.formObj) this.formObj = this.$resetFields(this.formObj)
this.dateList = [] this.dateList = []
this.showModal = true this.showModal = true
this.contractId = id // 委托id this.formObj.entrustId = id // 委托id
console.log(this.contractId) console.log(this.entrustId)
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
this._page() this._page()
}, },
...@@ -378,8 +350,8 @@ export default { ...@@ -378,8 +350,8 @@ export default {
this.formObj = this.$resetFields(this.formObj) this.formObj = this.$resetFields(this.formObj)
this.dateList = [] this.dateList = []
this.showModal = true this.showModal = true
this.contractId = id // 委托id this.formObj.entrustId = id // 委托id
console.log(this.contractId) console.log(this.entrustId)
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
this.recordHis = true this.recordHis = true
this._page() this._page()
...@@ -388,11 +360,7 @@ export default { ...@@ -388,11 +360,7 @@ export default {
this.$refs.pageTable._pageChange(1) this.$refs.pageTable._pageChange(1)
}, },
_page: async function() { _page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams()) const result = await soilEntrust.pagePrepareHis(this.formObj)
this.formObj.entrustId = this.contractId
const result = await soilEntrust.pagePrepare(
this.$serializeForm(this.formObj)
)
if (result) { if (result) {
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
this.getPage = result this.getPage = result
...@@ -438,7 +406,7 @@ export default { ...@@ -438,7 +406,7 @@ export default {
this.$refs.sampleManageEdit._open(data) this.$refs.sampleManageEdit._open(data)
} else { } else {
// 添加 // 添加
this.$refs.refModal._open('', this.contractId) this.$refs.refModal._open('', this.entrustId)
} }
}, },
// 添加编辑模拟样品 // 添加编辑模拟样品
...@@ -446,10 +414,10 @@ export default { ...@@ -446,10 +414,10 @@ export default {
if (edit) { if (edit) {
// 模拟样品的编辑 // 模拟样品的编辑
const tempData = JSON.parse(JSON.stringify(data)) // 深拷贝 const tempData = JSON.parse(JSON.stringify(data)) // 深拷贝
this.$refs.imitateModal._open(tempData, this.contractId) this.$refs.imitateModal._open(tempData, this.entrustId)
} else { } else {
// 模拟样品的添加 // 模拟样品的添加
this.$refs.imitateModal._open('', this.contractId) this.$refs.imitateModal._open('', this.entrustId)
} }
}, },
_search() { _search() {
...@@ -497,15 +465,6 @@ export default { ...@@ -497,15 +465,6 @@ export default {
} }
}) })
}, },
// 导入样品
_importSample() {
const data = {
importUrl: '/food/v1/sample/company/import_' + this.contractId,
downloadUrl: '/food/v1/excel/template/FoodSampleCompany',
title: '导入'
}
this.$refs.refModal._open(data)
},
// 导入检测项目 // 导入检测项目
_importItem() { _importItem() {
if (this.selectIds.length === 0) { if (this.selectIds.length === 0) {
......
...@@ -38,6 +38,9 @@ ...@@ -38,6 +38,9 @@
:fixed="item.fixed?item.fixed:undefined" sortable> :fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span> <span v-if="item.date">{{scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):''}}</span>
<div v-else-if="item.status">
{{ scope.row[item.key].display }}
</div>
<span v-else>{{scope.row[item.key]}}</span> <span v-else>{{scope.row[item.key]}}</span>
</template> </template>
</vxe-table-column> </vxe-table-column>
...@@ -193,7 +196,7 @@ export default { ...@@ -193,7 +196,7 @@ export default {
_page: async function() { _page: async function() {
Object.assign(this.formObj, this.$refs.pageTable._searchParams()) Object.assign(this.formObj, this.$refs.pageTable._searchParams())
console.log('this.formObj', this.formObj) console.log('this.formObj', this.formObj)
const result = await soilEntrust.pageSamplePrepare(this.formObj) const result = await soilEntrust.pageSamplePrepareHis(this.formObj)
if (result) { if (result) {
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
this.getPage = result this.getPage = result
......
<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">
<!--<template slot="processTask">-->
<!--<div class="fr process-task">-->
<!--<Button @click="_exportReceiveRecord">导出交接记录</Button>-->
<!--</div>-->
<!--</template>-->
</btn-list>
</Col>
<Col span="24">
<PTVXETable
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'):''}}
</div>
<div v-else>{{scope.row[item.key]}}</div>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
<!--选择领样人-->
</div>
</template>
<script>
import { soilEntrust } from '../../../../api'
export default {
components: {},
data() {
return {
btn: [],
selectIds: [],
getPage: {},
pageColumns: [
{ title: '试样编号', key: 'sampleCode', width: 160, fixed: 'left' },
{ title: '试样深度', key: 'sampleDepth', width: 160 },
{ title: '土质描述', key: 'sampleDescribe', width: 160 },
{ title: '样品包装类型', key: 'samplePack', width: 160 },
{ title: '现场编号', key: 'siteNo', width: 130 }
],
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() {
const result = await soilEntrust.pageSendHis(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>
...@@ -11,9 +11,6 @@ ...@@ -11,9 +11,6 @@
<el-tab-pane label="待发放样品" name="waitScan"> <el-tab-pane label="待发放样品" name="waitScan">
<WaitScan ref="waitScanModal" @-result-change="_search"></WaitScan> <WaitScan ref="waitScanModal" @-result-change="_search"></WaitScan>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="已接样样品" name="alreadyIssued">
<AlreadyIssued ref="alreadyIssuedModal"></AlreadyIssued>
</el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
</Modal> </Modal>
...@@ -21,13 +18,11 @@ ...@@ -21,13 +18,11 @@
</template> </template>
<script> <script>
import WaitReceive from './WaitReceive' import WaitReceive from './WaitReceive'
import AlreadyIssued from './AlreadyIssued'
import WaitScan from './WaitScan' import WaitScan from './WaitScan'
export default { export default {
components: { components: {
WaitReceive, WaitReceive,
AlreadyIssued,
WaitScan WaitScan
}, },
data() { data() {
......
<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 './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>
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