Commit 00c30bec by lichengming

修改了试样管理

parent 74165c8f
...@@ -127,5 +127,9 @@ export default { ...@@ -127,5 +127,9 @@ export default {
'&reason=' + '&reason=' +
data.remark data.remark
) )
.then(res => res) .then(res => res),
getDictList: data =>
http.post('res/v1/dict/dict_query?type=' + data).then(res => res),
editBackup: data =>
http.put('soil/v1/sample_backup/' + data.id, data.obj).then(res => res)
} }
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<!-- 表格 --> <!-- 表格 -->
<Col span="24"> <Col span="24">
<PTVXETableHeight ref="pageTable" :table-height="tableHeight" :loading="true" <PTVXETableHeight ref="pageTable" :table-height="tableHeight" :loading="true"
:get-page="getPage" @on-result-change="_tableResultChange"> :get-page="getPage" @on-result-change="_tableResultChange" select-data>
<vxe-table-column <vxe-table-column
v-for="item in pageColumns" v-for="item in pageColumns"
:key="item.key" :key="item.key"
...@@ -44,13 +44,13 @@ ...@@ -44,13 +44,13 @@
{{scope.row[item.key]}} {{scope.row[item.key]}}
</div> </div>
<div v-else> <div v-else>
<el-input v-model="scope.row.quantity" clearable></el-input> <Input :value="scope.row.quantity" @change.native="inputChange($event.target.value)" clearable placeholder="请输入备样数量"></Input>
</div> </div>
</div> </div>
<div v-else-if="item.key==='conditions'" @click.stop="_handleIndex(scope)"> <div v-else-if="item.key==='conditions'" @click.stop="_handleIndex(scope)">
<div v-if="editIndex!==scope.rowIndex">{{scope.row[item.key]}}</div> <div v-if="editIndex!==scope.rowIndex">{{scope.row[item.key]}}</div>
<div v-else> <div v-else>
<el-select v-model="scope.row.conditionList" clearable style="width:100%" size="small"> <el-select :value="scope.row.conditions" @change="selCondi" clearable style="width:100%" size="small">
<el-option v-for="item in conditionList" :value="item.name" :key="item.name">{{ item.name }} <el-option v-for="item in conditionList" :value="item.name" :key="item.name">{{ item.name }}
</el-option> </el-option>
</el-select> </el-select>
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
{{scope.row[item.key]}} {{scope.row[item.key]}}
</div> </div>
<div v-else> <div v-else>
<el-input v-model="scope.row.backupLocation" clearable></el-input> <Input :value="scope.row.backupLocation" @change.native="locaChange($event.target.value)" clearable placeholder="请输入备样位置"></Input>
</div> </div>
</div> </div>
<span v-else>{{scope.row[item.key]}}</span> <span v-else>{{scope.row[item.key]}}</span>
...@@ -202,9 +202,9 @@ export default { ...@@ -202,9 +202,9 @@ export default {
computed: { computed: {
tableHeight: function() { tableHeight: function() {
if (this.searchOpen) { if (this.searchOpen) {
return this.$tableHeight('', 250) return this.$tableHeight('', 255)
} else { } else {
return this.$tableHeight('', 210) return this.$tableHeight('', 220)
} }
}, },
colorComputed() { colorComputed() {
...@@ -225,7 +225,7 @@ export default { ...@@ -225,7 +225,7 @@ export default {
// 样品存储期限预警 // 样品存储期限预警
// this.sampleHandleValue = Number(localStorage.getItem('sampleHandleValue')) // this.sampleHandleValue = Number(localStorage.getItem('sampleHandleValue'))
// this._getLocList() // this._getLocList()
// this._getConditionList() this._getConditionList()
// this._getBackUpCount() // this._getBackUpCount()
}, },
methods: { methods: {
...@@ -260,23 +260,38 @@ export default { ...@@ -260,23 +260,38 @@ export default {
}, },
_save() { _save() {
this.$nextTick(function() { this.$nextTick(function() {
const data = { const tempData = {
ids: this.getPage.records[this.currentIndex].id, quantity: this.getPage.records[this.currentIndex].quantity,
backupPlace: this.getPage.records[this.currentIndex].backupPlace, conditions: this.getPage.records[this.currentIndex].conditions,
storageCondition: this.getPage.records[this.currentIndex] backupLocation: this.getPage.records[this.currentIndex].backupLocation
.storageCondition,
endDate: this.getPage.records[this.currentIndex].endDate,
handleQuantity: this.getPage.records[this.currentIndex].handleQuantity
} }
this.$store.dispatch('FoodSampleBackup/batchEdit', data).then(() => { this._saveOk({
if (this.$store.state.FoodSampleBackup.success) { id: this.getPage.records[this.currentIndex].id,
} else { obj: tempData
this.$msgTip('error', '保存失败!')
}
this._relPage()
}) })
// const data = {
// ids: this.getPage.records[this.currentIndex].id,
// backupPlace: this.getPage.records[this.currentIndex].backupPlace,
// storageCondition: this.getPage.records[this.currentIndex]
// .storageCondition,
// endDate: this.getPage.records[this.currentIndex].endDate,
// handleQuantity: this.getPage.records[this.currentIndex].handleQuantity
// }
// this.$store.dispatch('FoodSampleBackup/batchEdit', data).then(() => {
// if (this.$store.state.FoodSampleBackup.success) {
// } else {
// this.$msgTip('error', '保存失败!')
// }
// this._relPage()
// })
}) })
}, },
_saveOk: async function(data) {
const result = await soilSample.editBackup(data)
if (result) {
this.$Message.success('编辑成功')
}
},
_iconClick(res, data, componentName, index) { _iconClick(res, data, componentName, index) {
this.currentIndex = index this.currentIndex = index
switch (res) { switch (res) {
...@@ -287,16 +302,25 @@ export default { ...@@ -287,16 +302,25 @@ export default {
this._record(data.id) this._record(data.id)
break break
case '保存': case '保存':
console.log('保存')
// if (data.endDate !== '') { // if (data.endDate !== '') {
// // 非空情况下格式化赋值,如果不判断会格式化为当天的日期 // // 非空情况下格式化赋值,如果不判断会格式化为当天的日期
// this._endDateChange(this.$dateformat(data.endDate, 'yyyy-mm-dd')) // this._endDateChange(this.$dateformat(data.endDate, 'yyyy-mm-dd'))
// } // }
// this._save() this._save()
this.editIndex = -1 this.editIndex = -1
break break
} }
}, },
selCondi(data) {
this.$forceUpdate()
this.getPage.records[this.currentIndex].conditions = data
},
inputChange(data) {
this.getPage.records[this.currentIndex].quantity = data
},
locaChange(data) {
this.getPage.records[this.currentIndex].backupLocation = data
},
_record(id) { _record(id) {
this.$refs.recordModal._openBcakup(id) this.$refs.recordModal._openBcakup(id)
}, },
...@@ -323,10 +347,11 @@ export default { ...@@ -323,10 +347,11 @@ export default {
this.locList = this.$store.state.FoodSampleBackup.list this.locList = this.$store.state.FoodSampleBackup.list
}) })
}, },
_getConditionList() { _getConditionList: async function() {
this.$store.dispatch('LmsBaseDict/getItem', '保存方式').then(() => { const result = await soilSample.getDictList('存储条件')
this.conditionList = this.$store.state.LmsBaseDict.item if (result) {
}) this.conditionList = result
}
}, },
_exportReceiveRecord() { _exportReceiveRecord() {
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<!-- 表格 --> <!-- 表格 -->
<Col span="24"> <Col span="24">
<PTVXETableHeight ref="pageTable" :table-height="tableHeight" :loading="true" <PTVXETableHeight ref="pageTable" :table-height="tableHeight" :loading="true"
:get-page="getPage" @on-result-change="_tableResultChange"> :get-page="getPage" @on-result-change="_tableResultChange" select-data>
<vxe-table-column <vxe-table-column
v-for="item in pageColumns" v-for="item in pageColumns"
:key="item.key" :key="item.key"
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<!-- 表格 --> <!-- 表格 -->
<Col span="24"> <Col span="24">
<PTVXETableHeight ref="pageTable" :table-height="tableHeight" :loading="true" <PTVXETableHeight ref="pageTable" :table-height="tableHeight" :loading="true"
:get-page="getPage" @on-result-change="_tableResultChange"> :get-page="getPage" @on-result-change="_tableResultChange" select-data>
<vxe-table-column <vxe-table-column
v-for="item in pageColumns" v-for="item in pageColumns"
:key="item.key" :key="item.key"
...@@ -39,31 +39,6 @@ ...@@ -39,31 +39,6 @@
<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>
<span v-else-if="item.status">{{scope.row[item.key].display}}</span> <span v-else-if="item.status">{{scope.row[item.key].display}}</span>
<div v-else-if="item.key==='quantity'" @click.stop="_handleIndex(scope)">
<div v-if="editIndex!==scope.rowIndex">
{{scope.row[item.key]}}
</div>
<div v-else>
<el-input v-model="scope.row.quantity" clearable></el-input>
</div>
</div>
<div v-else-if="item.key==='conditions'" @click.stop="_handleIndex(scope)">
<div v-if="editIndex!==scope.rowIndex">{{scope.row[item.key]}}</div>
<div v-else>
<el-select v-model="scope.row.conditionList" clearable style="width:100%" size="small">
<el-option v-for="item in conditionList" :value="item.name" :key="item.name">{{ item.name }}
</el-option>
</el-select>
</div>
</div>
<div v-else-if="item.key==='backupLocation'" @click.stop="_handleIndex(scope)">
<div v-if="editIndex!==scope.rowIndex">
{{scope.row[item.key]}}
</div>
<div v-else>
<el-input v-model="scope.row.backupLocation" clearable></el-input>
</div>
</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>
...@@ -133,20 +108,14 @@ export default { ...@@ -133,20 +108,14 @@ export default {
], ],
iconMsgSave: [{ type: 'ios-checkmark', id: '', name: '保存' }], iconMsgSave: [{ type: 'ios-checkmark', id: '', name: '保存' }],
pageColumns: [ pageColumns: [
{ title: '委托商', key: 'client', width: 180 }, { title: '试样编号', key: 'sampleCode', width: 150 },
{ title: '委托编号', key: 'entrustCode', width: 100 }, { title: '状态', key: 'status', status: true, width: 100 },
{ title: '试样编号', key: 'sampleCode', width: 100 }, { title: '包装类型', key: 'samplePack', width: 100 },
{ title: '状态', key: 'status', width: 100, status: true }, { title: '保存容器', key: 'keepContainer', width: 100 },
{ title: '试样深度', key: 'sampleDepth', width: 100 }, { title: '制备数量', key: 'quantity', width: 100 },
{ title: '样品包装类型', key: 'samplePack', width: 120 }, { title: '单位', key: 'unit', width: 70 },
{ title: '现场编号', key: 'siteNo', width: 100 }, { title: '制备人', key: 'preparer', width: 130 },
{ title: '钻孔位置', key: 'boreholeLocation', width: 110 }, { title: '制备时间', key: 'prepareDate', date: true, width: 130 }
{ title: '钻孔名称', key: 'boreholeName', width: 160 },
{ title: '水深(米)', key: 'waterDepth', width: 100 },
{ title: '存储条件', key: 'conditions', width: 180 },
{ title: '备样位置', key: 'backupLocation', width: 180 },
{ title: '备样数量', key: 'quantity', width: 180 },
{ title: '备样人', key: 'backupUser', width: 140 }
/* {title: '处置方式', key: 'handleMethod', width: 120,}, */ /* {title: '处置方式', key: 'handleMethod', width: 120,}, */
], ],
conditionList: [], conditionList: [],
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<!-- 表格 --> <!-- 表格 -->
<Col span="24"> <Col span="24">
<PTVXETableHeight ref="pageTable" :table-height="tableHeight" :loading="true" <PTVXETableHeight ref="pageTable" :table-height="tableHeight" :loading="true"
:get-page="getPage" @on-result-change="_tableResultChange"> :get-page="getPage" @on-result-change="_tableResultChange" select-data>
<vxe-table-column <vxe-table-column
v-for="item in pageColumns" v-for="item in pageColumns"
:key="item.key" :key="item.key"
...@@ -34,31 +34,6 @@ ...@@ -34,31 +34,6 @@
<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>
<span v-else-if="item.status">{{scope.row[item.key].display}}</span> <span v-else-if="item.status">{{scope.row[item.key].display}}</span>
<div v-else-if="item.key==='quantity'" @click.stop="_handleIndex(scope)">
<div v-if="editIndex!==scope.rowIndex">
{{scope.row[item.key]}}
</div>
<div v-else>
<el-input v-model="scope.row.quantity" clearable></el-input>
</div>
</div>
<div v-else-if="item.key==='conditions'" @click.stop="_handleIndex(scope)">
<div v-if="editIndex!==scope.rowIndex">{{scope.row[item.key]}}</div>
<div v-else>
<el-select v-model="scope.row.conditionList" clearable style="width:100%" size="small">
<el-option v-for="item in conditionList" :value="item.name" :key="item.name">{{ item.name }}
</el-option>
</el-select>
</div>
</div>
<div v-else-if="item.key==='backupLocation'" @click.stop="_handleIndex(scope)">
<div v-if="editIndex!==scope.rowIndex">
{{scope.row[item.key]}}
</div>
<div v-else>
<el-input v-model="scope.row.backupLocation" clearable></el-input>
</div>
</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>
...@@ -88,20 +63,14 @@ export default { ...@@ -88,20 +63,14 @@ export default {
} }
], ],
pageColumns: [ pageColumns: [
{ title: '委托商', key: 'client', width: 180 }, { title: '试样编号', key: 'sampleCode', width: 150 },
{ title: '委托编号', key: 'entrustCode', width: 100 }, { title: '状态', key: 'status', status: true, width: 100 },
{ title: '试样编号', key: 'sampleCode', width: 100 }, { title: '包装类型', key: 'samplePack', width: 100 },
{ title: '状态', key: 'status', width: 100, status: true }, { title: '保存容器', key: 'keepContainer', width: 100 },
{ title: '试样深度', key: 'sampleDepth', width: 100 }, { title: '制备数量', key: 'quantity', width: 100 },
{ title: '样品包装类型', key: 'samplePack', width: 120 }, { title: '单位', key: 'unit', width: 70 },
{ title: '现场编号', key: 'siteNo', width: 100 }, { title: '制备人', key: 'preparer', width: 130 },
{ title: '钻孔位置', key: 'boreholeLocation', width: 110 }, { title: '制备时间', key: 'prepareDate', date: true, width: 130 }
{ title: '钻孔名称', key: 'boreholeName', width: 160 },
{ title: '水深(米)', key: 'waterDepth', width: 100 },
{ title: '存储条件', key: 'conditions', width: 180 },
{ title: '备样位置', key: 'backupLocation', width: 180 },
{ title: '备样数量', key: 'quantity', width: 180 },
{ title: '备样人', key: 'backupUser', width: 140 }
], ],
searchOpen: false, searchOpen: false,
getPage: {}, getPage: {},
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<!-- 表格 --> <!-- 表格 -->
<Col span="24"> <Col span="24">
<PTVXETableHeight ref="pageTable" :table-height="tableHeight" :loading="true" <PTVXETableHeight ref="pageTable" :table-height="tableHeight" :loading="true"
:get-page="getPage" @on-result-change="_tableResultChange"> :get-page="getPage" @on-result-change="_tableResultChange" select-data>
<vxe-table-column <vxe-table-column
v-for="item in pageColumns" v-for="item in pageColumns"
:key="item.key" :key="item.key"
......
...@@ -34,31 +34,6 @@ ...@@ -34,31 +34,6 @@
<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>
<span v-else-if="item.status">{{scope.row[item.key].display}}</span> <span v-else-if="item.status">{{scope.row[item.key].display}}</span>
<div v-else-if="item.key==='quantity'" @click.stop="_handleIndex(scope)">
<div v-if="editIndex!==scope.rowIndex">
{{scope.row[item.key]}}
</div>
<div v-else>
<el-input v-model="scope.row.quantity" clearable></el-input>
</div>
</div>
<div v-else-if="item.key==='conditions'" @click.stop="_handleIndex(scope)">
<div v-if="editIndex!==scope.rowIndex">{{scope.row[item.key]}}</div>
<div v-else>
<el-select v-model="scope.row.conditionList" clearable style="width:100%" size="small">
<el-option v-for="item in conditionList" :value="item.name" :key="item.name">{{ item.name }}
</el-option>
</el-select>
</div>
</div>
<div v-else-if="item.key==='backupLocation'" @click.stop="_handleIndex(scope)">
<div v-if="editIndex!==scope.rowIndex">
{{scope.row[item.key]}}
</div>
<div v-else>
<el-input v-model="scope.row.backupLocation" clearable></el-input>
</div>
</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>
......
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