Commit b2f7a5d3 by wangweidong

土工试验Lims

parent 07d3a493
<template> <template>
<div> <div>
<Modal v-model="showModal" width="1200" class="modal-footer-none"> <Modal v-model="showModal" width="1030" class="modal-footer-none">
<p slot="header"> <p slot="header">
{{ modalTitle }} {{ modalTitle }}
</p> </p>
...@@ -9,16 +9,16 @@ ...@@ -9,16 +9,16 @@
<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"> <Form-item label="试样编号:" class="search-item">
<Input v-model="formObj.client" @on-enter="_formSearch" placeholder="请输入委托商" clearable /> <Input v-model="formObj.sampleCode" placeholder="请输入试样编号" clearable @on-enter="_formSearch" />
</Form-item> </Form-item>
<Form-item label="委托编号:" class="search-item"> <Form-item label="现场编号:" class="search-item">
<Input v-model="formObj.entrustCode" @on-enter="_formSearch" placeholder="请输入委托编号" clearable /> <Input v-model="formObj.siteNo" placeholder="请输入现场编号" clearable @on-enter="_formSearch" />
</Form-item> </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>
...@@ -26,12 +26,12 @@ ...@@ -26,12 +26,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" :iconMsg="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"
...@@ -40,18 +40,15 @@ ...@@ -40,18 +40,15 @@
:width="item.width?item.width:200" :width="item.width?item.width:200"
:fixed="item.fixed?item.fixed:undefined" sortable> :fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="item.detail"> <div v-if="item.status">
<a @click.stop="_detailModal(scope.row)">{{ scope.row[item.key] }}</a>
</div>
<div v-else-if="item.status">
{{ scope.row[item.key].display }} {{ scope.row[item.key].display }}
</div> </div>
<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> <span v-else>
{{ scope.row[item.key] }} {{ scope.row[item.key] }}
</div> </span>
</template> </template>
</vxe-table-column> </vxe-table-column>
</PTVXETable> </PTVXETable>
...@@ -62,22 +59,34 @@ ...@@ -62,22 +59,34 @@
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult" /> <modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult" />
</div> </div>
</Modal> </Modal>
<SoilSampleItemManage ref="sampleItemManage" @on-result-change="_page"></SoilSampleItemManage>
</div> </div>
</template> </template>
<script> <script>
import { soilEntrust } from '../../../api' import { soilEntrust } from '../../../api'
import SoilSampleItemManage from './ViewSample'
export default { export default {
components: {}, components: { SoilSampleItemManage },
data() { data() {
return { return {
formId: 'soilSampleManage', formId: 'soilSampleManage',
currentComponent: '', currentComponent: '',
btn: [ btn: [
{ // {
type: 'success', // type: 'success',
id: 'ZBC', // id: '',
name: '打印标签' // name: '导入检测项目'
} // }
// {
// type: 'success',
// id: '',
// name: '导入检测项目包'
// },
// {
// type: 'success',
// id: '',
// name: '打印标签'
// }
], ],
itemList: [], itemList: [],
indexList: [], indexList: [],
...@@ -85,11 +94,17 @@ export default { ...@@ -85,11 +94,17 @@ export default {
{ id: '', name: '取消', type: '' }, { id: '', name: '取消', type: '' },
{ id: '', name: '确定', type: 'primary' } { id: '', name: '确定', type: 'primary' }
], ],
entrustId: '', // 委托id iconMsg: [
{
type: 'ios-beaker',
id: '',
name: '查看试样'
}
],
contractId: '', // 委托id
showModal: false, showModal: false,
recordHis: false,
searchOpen: true, searchOpen: true,
modalTitle: '位置委托单列表', modalTitle: '管理样品',
selectIds: [], selectIds: [],
selectData: {}, selectData: {},
getPage: {}, getPage: {},
...@@ -104,38 +119,20 @@ export default { ...@@ -104,38 +119,20 @@ export default {
{ title: '平均容重', key: 'projectNo', width: 120 }, { title: '平均容重', key: 'projectNo', width: 120 },
{ title: '检验类别', key: 'testType', width: 120 } { title: '检验类别', key: 'testType', width: 120 }
], ],
sampleId: '',
dateList: [],
formObj: { formObj: {
receiveLocation: undefined, receiveLocation: undefined,
client: undefined, entrustCode: undefined,
entrustCode: undefined client: undefined
} },
receiveLocation: ''
} }
}, },
computed: { computed: {
tableHeight: function() { tableHeight: function() {
if (this.searchOpen) { return this.$tableHeight('tableModal')
return this.$tableHeight('search')
} else {
return this.$tableHeight('noSearch')
}
} }
}, },
methods: { methods: {
_inputChange: async function(info) {
const result = await soilEntrust.sampleEdit({
id: info.id,
describeDetail: info.describeDetail
})
if (result) {
this._resultChange('修改成功')
}
},
_handleRow(data) {
this.currentRow = data.row
this.currentIndex = data.rowIndex
},
_footerResult(name) { _footerResult(name) {
switch (name) { switch (name) {
case '取消': case '取消':
...@@ -149,13 +146,6 @@ export default { ...@@ -149,13 +146,6 @@ export default {
_cancel() { _cancel() {
this.showModal = false this.showModal = false
}, },
iconMsg: [
{
type: 'md-apps',
id: '',
name: '查看试样'
}
],
_ok() { _ok() {
this.showModal = false this.showModal = false
this.$refs.footerModal._hideLoading() this.$refs.footerModal._hideLoading()
...@@ -181,48 +171,32 @@ export default { ...@@ -181,48 +171,32 @@ export default {
} }
}) })
}, },
_samplePre() { _copyHisSample() {
if (this.selectIds.length === 0) { this.$refs.refModal._open(this.contractId)
this.$message.warning('至少选择一条数据')
} else {
this.$refs.preModal._open(this.selectIds.join(','))
}
},
_writeDetail(id) {
if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!')
} else {
const ids = id.join(',')
this.$refs.writeDetailModal._open(ids)
}
}, },
_iconClick(res, data, componentName, index) { _iconClick(res, data, componentName, index) {
this.currentComponent = componentName this.currentComponent = componentName
this.$nextTick(function() { this.$nextTick(function() {
switch (res) { switch (res) {
case '管理检测项目': case '查看试样':
this._itemManage(data.id) this._itemManage(data.id)
break break
case '编辑': case '编辑':
this._editModal(true, data) this._editModal(true, data)
break break
case '复制':
this._copy(data)
break
case '删除': case '删除':
console.log(index) console.log(index)
this._deleteById(data.id) this._deleteById(data.id)
break break
case '附件':
this.$refs.refModal._open(data.id, 'sampleId')
break
} }
}) })
}, },
_itemManage(data) { _itemManage(data) {
// 管理检测项目 this.$refs.sampleItemManage._open(data, this.receiveLocation)
if (this.recordHis) {
this.$refs.sampleItemManage._openRecord(data)
} else {
this.$refs.sampleItemManage._open(data)
}
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
const selectIds = [] const selectIds = []
...@@ -235,7 +209,6 @@ export default { ...@@ -235,7 +209,6 @@ export default {
this.selectData = data this.selectData = data
break break
case 'allSelect': case 'allSelect':
console.log('123465798', data)
this.allSelect(data) this.allSelect(data)
break break
case 'iconClick': case 'iconClick':
...@@ -248,9 +221,9 @@ export default { ...@@ -248,9 +221,9 @@ export default {
}, },
_open(name) { _open(name) {
this.formObj = this.$resetFields(this.formObj) this.formObj = this.$resetFields(this.formObj)
this.dateList = [] this.formObj.receiveLocation = name
this.receiveLocation = name
this.showModal = true this.showModal = true
this.formObj.receiveLocation = name // 委托id
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
this._page() this._page()
}, },
...@@ -258,7 +231,11 @@ export default { ...@@ -258,7 +231,11 @@ export default {
this.$refs.pageTable._pageChange(1) this.$refs.pageTable._pageChange(1)
}, },
_page: async function() { _page: async function() {
const result = await soilEntrust.pageLocationEntrust(this.formObj) Object.assign(this.formObj, this.$refs.pageTable._searchParams())
this.formObj.entrustId = this.contractId
const result = await soilEntrust.pageLocationEntrust(
this.$serializeForm(this.formObj)
)
if (result) { if (result) {
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
this.getPage = result this.getPage = result
...@@ -287,21 +264,21 @@ export default { ...@@ -287,21 +264,21 @@ export default {
this._deleteByIds(ids, '确定删除 ' + ids.length + ' 条记录?') this._deleteByIds(ids, '确定删除 ' + ids.length + ' 条记录?')
} }
}, },
_detailModal(data) {},
_editModal(edit, data) { _editModal(edit, data) {
if (edit) { if (edit) {
console.log(data)
this.$refs.sampleManageEdit._open(data) this.$refs.sampleManageEdit._open(data)
} else { } else {
// 添加 // 添加
this.$refs.refModal._open('', this.entrustId) this.$refs.refModal._open('', this.contractId)
} }
}, },
_search() { _search() {
this._page() this._page()
}, },
_resultChange(msg) { _resultChange(msg) {
this.$Message.success(msg)
this._page() this._page()
this.$Message.success(msg)
}, },
_operationRecord(id) { _operationRecord(id) {
// 操作日志 // 操作日志
......
...@@ -9,13 +9,13 @@ ...@@ -9,13 +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"> <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 class="search-btn"> <Form-item class="search-btn">
<Button @click="_page" type="primary"> <Button type="primary" @click="_page">
搜索 搜索
</Button> </Button>
</Form-item> </Form-item>
...@@ -23,12 +23,12 @@ ...@@ -23,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">
<PTVXETableHeight ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true" <PTVXETableHeight ref="pageTable" :table-height="tableHeight" :form-id="formId" :loading="true"
:get-page="getPage" @on-result-change="_tableResultChange" select-data> :get-page="getPage" 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"
...@@ -104,7 +104,7 @@ export default { ...@@ -104,7 +104,7 @@ export default {
dateList: [], dateList: [],
formObj: { formObj: {
receiveLocation: undefined, receiveLocation: undefined,
sampleCode: undefined entrustId: undefined
} }
} }
}, },
...@@ -149,10 +149,6 @@ export default { ...@@ -149,10 +149,6 @@ export default {
this.$refs.footerModal._hideLoading() this.$refs.footerModal._hideLoading()
console.log(this.getPage) console.log(this.getPage)
}, },
_dateChange(data) {
this.formObj.ctimeBegin = data[0]
this.formObj.ctimeEnd = data[1]
},
_btnClick(msg, componentName) { _btnClick(msg, componentName) {
this.currentComponent = componentName this.currentComponent = componentName
this.$nextTick(function() { this.$nextTick(function() {
...@@ -241,22 +237,13 @@ export default { ...@@ -241,22 +237,13 @@ export default {
} }
console.log('索引', this.indexList) console.log('索引', this.indexList)
}, },
_open(id) { _open(id, name) {
this.formObj = this.$resetFields(this.formObj) this.formObj = this.$resetFields(this.formObj)
this.dateList = [] this.dateList = []
this.showModal = true this.showModal = true
this.formObj.entrustId = id // 委托id this.formObj.entrustId = id // 委托id
console.log(this.entrustId) this.formObj.receiveLocation = name // 委托id
this.$refs.pageTable._hideLoading()
this._page()
},
_openHis(adress) {
this.formObj = this.$resetFields(this.formObj)
this.dateList = []
this.showModal = true
this.formObj.receiveLocation = adress // 委托id
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
this.recordHis = true
this._page() this._page()
}, },
_formSearch() { _formSearch() {
......
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