Commit f67c9d17 by lichengming

修改了收样室试验科室下拉菜单

parent b1946a80
......@@ -41,6 +41,7 @@
:field="item.key"
:title="item.title"
:min-width="item.width?item.width:200"
:edit-render="item.editCell?{autofocus: 'input'}:null"
:fixed="item.fixed?item.fixed:undefined" sortable>
<template slot-scope="scope">
<div v-if="item.detail">
......@@ -57,6 +58,11 @@
</el-select>
<span v-if="!showOption">{{ scope.row[item.key]===0? '否':'是' }}</span>
</div>
<div v-else-if="item.key==='groupName'" @click="_handleRow(scope)">
<AutoCompletes v-model="scope.row.groupName" :handle-obj="scope.row" :down-data="groupoptions" @on-result-change="_selGroup"
style="editable:false" clearable
placeholder="请选择试验室" show-key="name"></AutoCompletes>
</div>
<div v-else-if="item.key==='status'">
{{ scope.row[item.key].display }}
</div>
......@@ -117,9 +123,10 @@
</template>
<script>
import http from '../../../../api/http'
import { soilEntrust } from '../../../../api'
import AutoCompletes from '../../../../components/base/AutoCompletes'
import { soilAptitude, soilEntrust } from '../../../../api'
export default {
components: {},
components: { AutoCompletes },
data() {
return {
formId: 'SampleItemManage',
......@@ -130,6 +137,7 @@ export default {
showModal: false,
modalTitle: '管理检测项目',
selectIds: [],
groupoptions: [],
itemId: '',
index: '',
showOption: true,
......@@ -145,6 +153,7 @@ export default {
pageColumns: [
{ title: '试验名称', key: 'name', width: 160 },
{ title: '试验项目英文简写', key: 'shortName', width: 140 },
{ title: '试验科室', key: 'groupName', width: 140, editCell: true },
{ title: '大类', key: 'mainType', width: 140 },
{ title: '小类', key: 'smallType' },
{ title: '检测依据', key: 'testBasis', width: 180 },
......@@ -177,6 +186,31 @@ export default {
}
},
methods: {
_getGroupList: async function() {
const result = await soilAptitude.getGroupList()
if (result) {
this.groupoptions = result
}
},
_selGroup(msg, data, handleObj) {
console.log(handleObj)
if (msg === 'select') {
this.getPage.records[this.currentIndex].groupName = data.name
this.getPage.records[this.currentIndex].groupId = data.id
const tempData = {}
tempData.groupName = data.name
tempData.groupId = data.id
this._editItem(handleObj.id, tempData)
}
},
_editItem: async function(id, obj) {
const result = await soilEntrust.editItem({ id: id, obj: obj })
if (result) {
this.$Message.success('修改成功')
} else {
this.$Message.warning('修改失败')
}
},
_selectjudgeBasis(id, index) {
console.log(id)
this.itemId = id
......@@ -451,6 +485,7 @@ export default {
this.showModal = true
this.sampleId = id // 委托id
this.$refs.pageTable._hideLoading()
this._getGroupList()
this._page()
},
_openRecord(id) {
......
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