Commit b2f7a5d3 by wangweidong

土工试验Lims

parent 07d3a493
<template>
<div>
<Modal v-model="showModal" width="1200" class="modal-footer-none">
<Modal v-model="showModal" width="1030" class="modal-footer-none">
<p slot="header">
{{ modalTitle }}
</p>
......@@ -9,29 +9,29 @@
<Row>
<!--查询-->
<Col span="24">
<Form id="search-sample-company" v-show="searchOpen" :label-width="80" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="委托商:" class="search-item">
<Input v-model="formObj.client" @on-enter="_formSearch" placeholder="请输入委托商" clearable />
</Form-item>
<Form-item label="委托编号:" class="search-item">
<Input v-model="formObj.entrustCode" @on-enter="_formSearch" placeholder="请输入委托编号" clearable />
</Form-item>
<Form-item class="search-btn">
<Button @click="_page" type="primary">
搜索
</Button>
</Form-item>
</Form>
<Form v-show="searchOpen" id="search-sample-company" :label-width="80" inline onsubmit="return false">
<label class="label-sign"></label>
<Form-item label="试样编号:" class="search-item">
<Input v-model="formObj.sampleCode" placeholder="请输入试样编号" clearable @on-enter="_formSearch" />
</Form-item>
<Form-item label="现场编号:" class="search-item">
<Input v-model="formObj.siteNo" placeholder="请输入现场编号" clearable @on-enter="_formSearch" />
</Form-item>
<Form-item class="search-btn">
<Button type="primary" @click="_page">
搜索
</Button>
</Form-item>
</Form>
</Col>
<!--操作-->
<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 span="24">
<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
v-for="item in pageColumns"
:key="item.key"
......@@ -39,22 +39,19 @@
:title="item.title"
: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)">{{ scope.row[item.key] }}</a>
</div>
<div v-else-if="item.status">
{{ scope.row[item.key].display }}
</div>
<div v-else-if="item.date">
{{ scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):'' }}
</div>
<div v-else>
<template slot-scope="scope">
<div v-if="item.status">
{{ scope.row[item.key].display }}
</div>
<div v-else-if="item.date">
{{ scope.row[item.key]?$dateformat(scope.row[item.key],'yyyy-mm-dd'):'' }}
</div>
<span v-else>
{{ scope.row[item.key] }}
</div>
</template>
</vxe-table-column>
</PTVXETable>
</span>
</template>
</vxe-table-column>
</PTVXETable>
</Col>
</Row>
</div>
......@@ -62,22 +59,34 @@
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult" />
</div>
</Modal>
<SoilSampleItemManage ref="sampleItemManage" @on-result-change="_page"></SoilSampleItemManage>
</div>
</template>
<script>
import { soilEntrust } from '../../../api'
import SoilSampleItemManage from './ViewSample'
export default {
components: {},
components: { SoilSampleItemManage },
data() {
return {
formId: 'soilSampleManage',
currentComponent: '',
btn: [
{
type: 'success',
id: 'ZBC',
name: '打印标签'
}
// {
// type: 'success',
// id: '',
// name: '导入检测项目'
// }
// {
// type: 'success',
// id: '',
// name: '导入检测项目包'
// },
// {
// type: 'success',
// id: '',
// name: '打印标签'
// }
],
itemList: [],
indexList: [],
......@@ -85,11 +94,17 @@ export default {
{ id: '', name: '取消', type: '' },
{ id: '', name: '确定', type: 'primary' }
],
entrustId: '', // 委托id
iconMsg: [
{
type: 'ios-beaker',
id: '',
name: '查看试样'
}
],
contractId: '', // 委托id
showModal: false,
recordHis: false,
searchOpen: true,
modalTitle: '位置委托单列表',
modalTitle: '管理样品',
selectIds: [],
selectData: {},
getPage: {},
......@@ -104,38 +119,20 @@ export default {
{ title: '平均容重', key: 'projectNo', width: 120 },
{ title: '检验类别', key: 'testType', width: 120 }
],
sampleId: '',
dateList: [],
formObj: {
receiveLocation: undefined,
client: undefined,
entrustCode: undefined
}
entrustCode: undefined,
client: undefined
},
receiveLocation: ''
}
},
computed: {
tableHeight: function() {
if (this.searchOpen) {
return this.$tableHeight('search')
} else {
return this.$tableHeight('noSearch')
}
return this.$tableHeight('tableModal')
}
},
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) {
switch (name) {
case '取消':
......@@ -149,13 +146,6 @@ export default {
_cancel() {
this.showModal = false
},
iconMsg: [
{
type: 'md-apps',
id: '',
name: '查看试样'
}
],
_ok() {
this.showModal = false
this.$refs.footerModal._hideLoading()
......@@ -181,48 +171,32 @@ export default {
}
})
},
_samplePre() {
if (this.selectIds.length === 0) {
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)
}
_copyHisSample() {
this.$refs.refModal._open(this.contractId)
},
_iconClick(res, data, componentName, index) {
this.currentComponent = componentName
this.$nextTick(function() {
switch (res) {
case '管理检测项目':
case '查看试样':
this._itemManage(data.id)
break
case '编辑':
this._editModal(true, data)
break
case '复制':
this._copy(data)
break
case '删除':
console.log(index)
this._deleteById(data.id)
break
case '附件':
this.$refs.refModal._open(data.id, 'sampleId')
break
}
})
},
_itemManage(data) {
// 管理检测项目
if (this.recordHis) {
this.$refs.sampleItemManage._openRecord(data)
} else {
this.$refs.sampleItemManage._open(data)
}
this.$refs.sampleItemManage._open(data, this.receiveLocation)
},
_tableResultChange(msg, data) {
const selectIds = []
......@@ -235,7 +209,6 @@ export default {
this.selectData = data
break
case 'allSelect':
console.log('123465798', data)
this.allSelect(data)
break
case 'iconClick':
......@@ -248,9 +221,9 @@ export default {
},
_open(name) {
this.formObj = this.$resetFields(this.formObj)
this.dateList = []
this.formObj.receiveLocation = name
this.receiveLocation = name
this.showModal = true
this.formObj.receiveLocation = name // 委托id
this.$refs.pageTable._hideLoading()
this._page()
},
......@@ -258,7 +231,11 @@ export default {
this.$refs.pageTable._pageChange(1)
},
_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) {
this.$refs.pageTable._hideLoading()
this.getPage = result
......@@ -287,21 +264,21 @@ export default {
this._deleteByIds(ids, '确定删除 ' + ids.length + ' 条记录?')
}
},
_detailModal(data) {},
_editModal(edit, data) {
if (edit) {
console.log(data)
this.$refs.sampleManageEdit._open(data)
} else {
// 添加
this.$refs.refModal._open('', this.entrustId)
this.$refs.refModal._open('', this.contractId)
}
},
_search() {
this._page()
},
_resultChange(msg) {
this.$Message.success(msg)
this._page()
this.$Message.success(msg)
},
_operationRecord(id) {
// 操作日志
......
......@@ -9,13 +9,13 @@
<Row>
<!--查询-->
<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>
<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 class="search-btn">
<Button @click="_page" type="primary">
<Button type="primary" @click="_page">
搜索
</Button>
</Form-item>
......@@ -23,12 +23,12 @@
</Col>
<!--操作-->
<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 span="24">
<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
v-for="item in pageColumns"
:key="item.key"
......@@ -104,7 +104,7 @@ export default {
dateList: [],
formObj: {
receiveLocation: undefined,
sampleCode: undefined
entrustId: undefined
}
}
},
......@@ -149,10 +149,6 @@ export default {
this.$refs.footerModal._hideLoading()
console.log(this.getPage)
},
_dateChange(data) {
this.formObj.ctimeBegin = data[0]
this.formObj.ctimeEnd = data[1]
},
_btnClick(msg, componentName) {
this.currentComponent = componentName
this.$nextTick(function() {
......@@ -241,22 +237,13 @@ export default {
}
console.log('索引', this.indexList)
},
_open(id) {
_open(id, name) {
this.formObj = this.$resetFields(this.formObj)
this.dateList = []
this.showModal = true
this.formObj.entrustId = id // 委托id
console.log(this.entrustId)
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.formObj.receiveLocation = name // 委托id
this.$refs.pageTable._hideLoading()
this.recordHis = true
this._page()
},
_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