Browse Source

租户编码选择器绑定字典

dev^2
kilo 2 years ago
parent
commit
49c0f1be3c
  1. 142
      src/views/basic/coderule/basicTenantCode.vue
  2. 1
      src/views/basic/pda/basicPda.vue
  3. 2
      vue.config.js

142
src/views/basic/coderule/basicTenantCode.vue

@ -5,37 +5,33 @@
<!-- 查询模块 --> <!-- 查询模块 -->
<el-form :inline="true" :size="option.size" :model="query"> <el-form :inline="true" :size="option.size" :model="query">
<template> <template>
<el-form-item label="编码类型">
<el-select type="text" v-model="query.input" placeholder="请选择编码类型" >
<el-option
v-for="item in codeType"
:key="item.dictKey"
:label="item.dictValue"
:value="item.sort">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="展示类型" style="margin-left: 5px">
<el-select type="text" v-model="query.type" placeholder="请选择展示类型">
<el-option
v-for="item in showType"
:key="item.dictKey"
:label="item.dictValue"
:value="item.sort">
</el-option>
</el-select>
</el-form-item>
</template> </template>
<!-- 查询按钮 --> <!-- 查询按钮 -->
<el-form-item> <el-form-item>
<el-col span="8">
<!-- <el-input type="text" v-model="query.input" placeholder="请输入编码信息" style="width: 50%;margin-right:5px"></el-input>-->
<el-select type="text" v-model="query.input" placeholder="请选择编码类型" >
<el-option
v-for="item in codeType"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-col>
<el-col span="8">
<el-select type="text" v-model="query.type" placeholder="请选择展示类型" style="margin-left: 10px">
<el-option
v-for="item in showType"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-col>
<el-clo span = "8">
<el-button type="primary" icon="el-icon-search" @click="searchChange" style="margin-left: 20px">搜索</el-button>
<el-button icon="el-icon-delete" @click="searchReset()">清空</el-button>
</el-clo>
<el-button type="primary" icon="el-icon-search" @click="searchChange" style="margin-left: 20px" >搜索</el-button>
<el-button icon="el-icon-delete" @click="searchReset()">清空</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-row> </el-row>
<el-row> <el-row>
@ -99,23 +95,23 @@
<el-form :disabled="view" :size="option.size" ref="form" :model="form" label-width="80px"> <el-form :disabled="view" :size="option.size" ref="form" :model="form" label-width="80px">
<!-- 表单字段 --> <!-- 表单字段 -->
<el-form-item label="展示类型:" prop="codeType" > <el-form-item label="编码类型:" prop="codeType" >
<el-select v-model="form.codeType" clearable placeholder="请选择状态"> <el-select v-model="form.codeType" clearable placeholder="请选择状态">
<el-option <el-option
v-for="item in codeType" v-for="item in codeType"
:key="item.dictKey" :key="item.dictKey"
:label="item.label" :label="item.dictValue"
:value="item.value"> :value="item.sort">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="展示类型:" prop="state" > <el-form-item label="展示类型:" prop="showType" >
<el-select v-model="form.showType" clearable placeholder="请选择状态"> <el-select v-model="form.showType" clearable placeholder="请选择状态">
<el-option <el-option
v-for="item in showType" v-for="item in showType"
:key="item.dictKey" :key="item.dictKey"
:label="item.label" :label="item.dictValue"
:value="item.value"> :value="item.sort">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -137,7 +133,7 @@
import {getList, getDetail, add, update, remove} from "@/api/basic/basicTenantCode"; import {getList, getDetail, add, update, remove} from "@/api/basic/basicTenantCode";
import option from "@/option/basic/basicdataTenantCode"; import option from "@/option/basic/basicdataTenantCode";
import {mapGetters} from "vuex"; import {mapGetters} from "vuex";
// import {getDictionary} from '@/api/system/dict' import {getDictionaryBiz} from '@/api/system/dict'
export default { export default {
data() { data() {
@ -171,49 +167,16 @@ export default {
option: option, option: option,
// //
data: [], data: [],
codeType: [{ codeType: [],
value: '1', showType: [],
label: '运单码'
},
{
value: '2',
label: '订单码'
},
{
value: '3',
label: '配送清单码'
} ,
{
value: '4',
label: '配载计划码'
},
{
value: '5',
label: '库位码'
},
{
value: '6',
label: '托盘码'
},
{
value: '7',
label: '包件码'
}],
showType: [
{
value: '1',
label: '二维码'
},
{
value: '2',
label: '条形码'
}],
} }
}, },
created() {
this.onLoad(this.page);
},
mounted() { mounted() {
this.init(); this.init();
this.onLoad(this.page);
}, },
computed: { computed: {
@ -228,6 +191,12 @@ export default {
}, },
methods: { methods: {
init() { init() {
getDictionaryBiz("basic_tenant_code").then(res=>{
this.codeType = res.data.data
})
getDictionaryBiz("basic_tenant_code_show").then(res=>{
this.showType = res.data.data
})
}, },
searchHide() { searchHide() {
this.search = !this.search; this.search = !this.search;
@ -271,6 +240,9 @@ export default {
this.box = true this.box = true
getDetail(row.id).then(res => { getDetail(row.id).then(res => {
this.form = res.data.data; this.form = res.data.data;
res.data.data.codeType = parseInt(res.data.data.codeType);
res.data.data.showType = parseInt(res.data.data.showType);
this.form = res.data.data;
}); });
}, },
handleView(row) { handleView(row) {
@ -278,13 +250,11 @@ export default {
this.view = true; this.view = true;
this.box = true; this.box = true;
getDetail(row.id).then(res => { getDetail(row.id).then(res => {
res.data.data.codeType = parseInt(res.data.data.codeType);
console.log(res) res.data.data.showType = parseInt(res.data.data.showType);
console.log(res.data.data.showType)
if (res.data.data.showType){
this.options.value = res.data.data.showType;
}
this.form = res.data.data; this.form = res.data.data;
}); });
}, },
handleDelete() { handleDelete() {
@ -351,12 +321,28 @@ export default {
console.log(this.query) console.log(this.query)
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data; const data = res.data.data;
this.codeType.forEach(item=>{
data.records.forEach(code=>{
if (item.dictKey === code.codeType){
code.codeType = item.dictValue;
}
})
})
this.showType.forEach(item=>{
data.records.forEach(show=>{
if (item.dictKey === show.showType){
show.showType = item.dictValue;
}
})
})
this.page.total = data.total; this.page.total = data.total;
this.data = data.records; this.data = data.records;
this.loading = false; this.loading = false;
this.selectionClear(); this.selectionClear();
}); });
} },
} }
}; };
</script> </script>

1
src/views/basic/pda/basicPda.vue

@ -189,7 +189,6 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="11"> <el-col :span="11">
<el-form-item label="保修截止时间" prop="warrantyPeriodEndTime" label-width="80px"> <el-form-item label="保修截止时间" prop="warrantyPeriodEndTime" label-width="80px">
<el-date-picker v-model="form.warrantyPeriodEndTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择保修截止时间"></el-date-picker> <el-date-picker v-model="form.warrantyPeriodEndTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择保修截止时间"></el-date-picker>

2
vue.config.js

@ -26,7 +26,7 @@ module.exports = {
proxy: { proxy: {
'/api': { '/api': {
//本地服务接口地址 //本地服务接口地址
target: 'http://localhost:8888', target: 'http://localhost:13000',
//远程演示服务地址,可用于直接启动项目 //远程演示服务地址,可用于直接启动项目
// target: 'https://saber.bladex.vip/api', // target: 'https://saber.bladex.vip/api',
ws: true, ws: true,

Loading…
Cancel
Save