Commit ca9aa19c authored by shifangwuji's avatar shifangwuji

9/18(3)

parent ac9ddd57
......@@ -55,3 +55,12 @@ export function exporTable(params) {
responseType: 'blob'
})
}
// 根据key值查询数据字典数据
export function getDictData(params) {
return request({
url: '/wbapply/queryDict',
method: 'get',
params
})
}
\ No newline at end of file
......@@ -110,7 +110,7 @@
</el-table-column>
<el-table-column label="gx" prop="gx" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.gx || '-' }}
{{ replace(scope.row.gx) || '-' }}
</template>
</el-table-column>
<el-table-column
......@@ -225,7 +225,7 @@
</el-form-item>
<el-form-item label="gx:" prop="gx">
<el-input v-model.trim="singleDetails.gx" :readonly="true" />
<span>{{ replace(singleDetails.gx) }}</span>
</el-form-item>
<el-form-item label="操作人:" prop="createName">
......@@ -419,13 +419,14 @@ export default {
page: 1,
rows: 10,
pn: '',
key: 'GX_CODE',
ptype: ''
},
singleDetails: {
pn: '',
phd: '',
prank: '',
pgx: '',
gx: '',
pissb: '',
pstatus: '',
pnumber: '',
......@@ -438,6 +439,7 @@ export default {
}
},
created() {
this.getDict()
this.getList()
},
methods: {
......@@ -480,15 +482,6 @@ export default {
if (valid) {
// 校验通过
if (this.form.businessId !== undefined) {
if (this.jscode) {
// 如果 jscode 有值
if (!this.jbrank) {
// 如果 jbrank 为空
this.$message.error('如果填写 jscode,则必须填写 jbrank');
return;
}
}
updataInfo(this.form).then(res => {
if (res.code === 200) {
this.open = false
......@@ -557,6 +550,7 @@ export default {
this.title = '编辑基础信息表单'
const id = row.businessId
getDetailById(id).then(res => {
console.log("res",res);
this.form = res.data
this.open = true
})
......@@ -597,11 +591,12 @@ export default {
this.loading = true
queryList(this.queryParams).then(res => {
res.rows.updateDate = parseTime(res.rows.updateDate, '{y}-{m}-{d}')
this.total = res.total
this.basicinfoMationList = res.rows
this.loading = false
})
},
// 查询
handleQuery() {
this.queryParams.page = 1
......@@ -655,6 +650,20 @@ export default {
// this.download(response.msg);
})
},
replace(value) {
if (this.pissbList.length === 0) {
return value
}
let label = ''
if (this.pissbList.length > 0) {
this.pissbList.forEach(item => {
if (item.dictValue === value) {
label = item.dictLabel
}
})
}
return label
},
// 调数据字典查询
getDict() {
const obj = {
......
......@@ -119,7 +119,7 @@
</el-table-column> -->
<el-table-column label="gx" prop="gx" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.gx || '-' }}
{{ replace(scope.row.gx) || '-' }}
</template>
</el-table-column>
<el-table-column
......@@ -317,7 +317,8 @@ import {
getDetailById,
updataInfo,
deleteLogical,
exporTable
exporTable,
getDictData
} from '@/api/production/gxlog'
import { parseTime } from '@/utils'
......@@ -328,6 +329,8 @@ export default {
title: '',
open: false,
form: {},
// 数据字典列表
dictList: [],
rules: {
pn: [{ required: true, message: '请输入pn', trigger: 'blur' }],
ptype: [{ required: true, message: '请输入ptype', trigger: 'blur' }],
......@@ -366,6 +369,7 @@ export default {
}
},
created() {
this.getDict()
this.getList()
},
methods: {
......@@ -452,7 +456,7 @@ export default {
})
},
replace(value) {
/* if (this.dictList.length === 0) {
if (this.dictList.length === 0) {
return value
}
let label = ''
......@@ -463,7 +467,17 @@ export default {
}
})
}
return label */
return label
},
getDict() {
const obj = {
key: 'GX_CODE'
}
getDictData(obj).then(res => {
if (res.code === 200 && res.data !== null) {
this.dictList = res.data
}
})
},
// 编辑
handleUpdate(row) {
......
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