Commit eb4068ee authored by CenXinYi's avatar CenXinYi

fixed: 增加字典

Signed-off-by: 's avatarCenXinYi <2810162984@qq.com>
parent d52119fc
...@@ -75,8 +75,7 @@ ...@@ -75,8 +75,7 @@
</el-table-column> </el-table-column>
<el-table-column label="pgx" prop="pgx"> <el-table-column label="pgx" prop="pgx">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.pgx === '001'">压缩</span> {{ replaced(scope.row.pgx) }}
<span v-if="scope.row.pgx === '002'">排水</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="pnumber" prop="pnumber"> <el-table-column label="pnumber" prop="pnumber">
...@@ -156,7 +155,7 @@ ...@@ -156,7 +155,7 @@
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="pgx:" prop="pgx"> <el-form-item label="pgx:" prop="pgx">
<el-input v-model.trim="singleDetails.pgx" :readonly="true" /> {{ replaced(singleDetails.pgx) }}
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
...@@ -249,7 +248,7 @@ ...@@ -249,7 +248,7 @@
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="pgx:" prop="pgx"> <el-form-item label="pgx:" prop="pgx">
<el-input v-model.trim="singleDetails.pgx" :readonly="true" /> {{ replaced(singleDetails.pgx) }}
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
...@@ -396,11 +395,13 @@ import { ...@@ -396,11 +395,13 @@ import {
checkPermission checkPermission
} from '@/api/equipment/draw' } from '@/api/equipment/draw'
import { parseTime } from '@/utils' import { parseTime } from '@/utils'
import { getEquipment } from '@/api/equipment/application' import { getDictData, getEquipment } from '@/api/equipment/application'
export default { export default {
name: 'Draw', name: 'Draw',
data() { data() {
return { return {
// 字典数据
dictList: [],
number: '', number: '',
monthDate: false, monthDate: false,
// 是否切换库 // 是否切换库
...@@ -510,6 +511,7 @@ export default { ...@@ -510,6 +511,7 @@ export default {
next() next()
}, },
created() { created() {
this.getDict()
this.getList() this.getList()
}, },
methods: { methods: {
...@@ -521,7 +523,7 @@ export default { ...@@ -521,7 +523,7 @@ export default {
// 判断时间范围 是否是一个月以内的的时间 // 判断时间范围 是否是一个月以内的的时间
isWithinLastMonth(dateToCheck) { isWithinLastMonth(dateToCheck) {
// 获取当前日期 // 获取当前日期
const currentDate = new Date(); const currentDate = new Date()
// 获取当前日期的年份和月份 // 获取当前日期的年份和月份
const currentYear = currentDate.getFullYear() const currentYear = currentDate.getFullYear()
const currentMonth = currentDate.getMonth() const currentMonth = currentDate.getMonth()
...@@ -833,6 +835,29 @@ export default { ...@@ -833,6 +835,29 @@ export default {
default: default:
return '' return ''
} }
},
replaced(value) {
let label = ''
if (this.dictList.length > 0) {
this.dictList.forEach(item => {
if (item.dictValue === value) {
label = item.dictLabel
}
})
}
return label
},
getDict() {
const obj = {
key: 'GX_CODE'
}
getDictData(obj).then(res => {
console.log('res', res)
if (res.code === 200 && res.data !== null) {
this.dictList = res.data
console.log(this.dictList)
}
})
} }
} }
} }
......
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