Browse Source

修改基础信息

test
caoyizhong 2 years ago
parent
commit
2eac332110
  1. 55
      src/api/basicdata/globalc.js
  2. 2
      src/main.js
  3. 2
      src/option/basicdata/basicClient.js
  4. 63
      src/views/basicdata/brand/basicClient.vue

55
src/api/basicdata/globalc.js

@ -1,13 +1,46 @@
import request from '@/axios';
export const getList = (current, size, params) => {
return request({
url: '/api/logpm-basicdata/basicdataBrand/list',
method: 'get',
params: {
...params,
current,
size,
import { getSelect } from '@/api/base/region';
let optioner = [];
export async function useGetGlobalProperties (){
let shu = [];
let bb = await getSelect('');
for (const it of bb.data.data) {
let a = {
value: it.code,
label: it.name,
children: []
};
let res = await getSelect(it.code)
let shi = [];
for (const i of res.data.data){
let b ={
value: i.code,
label: i.name,
children: []
}
let er = [];
let res = await getSelect(i.code);
res.data.data.forEach( l =>{
let a ={
value: l.code,
label: l.name,
}
er.push(a);
})
b.children = er;
shi.push(b);
}
})
a.children= shi;
shu.push(a);
}
optioner = shu;
return shu;
}
export default { useGetGlobalProperties , optioner} ;

2
src/main.js

@ -11,7 +11,7 @@ import 'element-plus/dist/index.css';
import Avue from '@smallwei/avue';
import '@smallwei/avue/lib/index.css';
import crudCommon from '@/mixins/crud.js';
import globalc from '@/api/basicdata/globalc'
import globalc from '@/api/basicdata/globalc.js'
import { getScreen } from './utils/util';
import './permission';
import error from './error';

2
src/option/basicdata/basicClient.js

@ -13,7 +13,7 @@ export default {
{
label: "创建人",
prop: "createUser",
display: false,
display: true,
hide: true,
},
{

63
src/views/basicdata/brand/basicClient.vue

@ -20,7 +20,7 @@
</el-form-item>
<el-form-item label="地址:">
<!-- <el-input v-model="query.bladeRegionProvinceId" placeholder="请输入省份"></el-input>-->
<el-cascader :options="optioner">
<el-cascader :options="optioner" v-model="query.bladeRegionProvinceId">
<template #default="{ node, data }">
<span>{{ data.label }}</span>
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
@ -245,6 +245,8 @@ import BasicShopSub from "@/views/basicdata/brand/basicShopSub.vue";
import { getDictionaryBiz } from '@/api/system/dict'
import { getSelect,getLazyTree,getLazyList } from '@/api/base/region';
import { getToken } from '@/utils/auth';
import globalc from '@/api/basicdata/globalc';
export default {
components:{
@ -373,42 +375,19 @@ export default {
getDictionaryBiz('client_type').then(res => {
this.clientType = res.data.data;
});
// console.log("globalc.optioner===",globalc.optioner);
let optioner = JSON.parse(localStorage.getItem('optioner'));
// console.log("-=-=-=-=",optioner);
if(optioner.length > 0){
this.optioner = optioner
}else{
globalc.useGetGlobalProperties().then(res =>{
this.optioner = res;
localStorage.setItem("optioner",JSON.stringify(globalc.optioner))
});
}
let shu = [];
let bb = await getSelect('');
for (const it of bb.data.data) {
let a = {
value: it.code,
label: it.name,
children: []
};
let res = await getSelect(it.code)
let shi = [];
for (const i of res.data.data){
let b ={
value: i.code,
label: i.name,
children: []
}
// let er = [];
// let res = await getSelect(i.code);
// // console.log("",res);
// res.data.data.forEach( l =>{
// let a ={
// value: l.code,
// label: l.name,
// }
// er.push(a);
// })
// b.children = er;
shi.push(b);
}
a.children= shi;
shu.push(a);
}
this.optioner = shu;
// console.log('111', this.optioner);
this.height = this.setPx(document.body.clientHeight - 340);
},
@ -420,6 +399,7 @@ export default {
},
searchReset () {
this.query = {};
this.dataShi = '';
this.page.currentPage = 1;
this.onLoad(this.page);
},
@ -459,7 +439,10 @@ export default {
this.title = '编辑'
this.box = true
getDetail(row.id).then(res => {
res.data.data.typeService = res.data.data.typeService.toString();
console.log(res.data.data);
this.form = res.data.data;
console.log( this.form);
});
},
handleView (row) {
@ -467,6 +450,7 @@ export default {
this.view = true;
this.box = true;
getDetail(row.id).then(res => {
res.data.data.typeService = res.data.data.typeService.toString();
this.form = res.data.data;
});
},
@ -539,9 +523,16 @@ export default {
},
onLoad (page, params = {}) {
this.loading = true;
console.log( "-=-=",this.query);
if(this.dataShi.length > 0){
console.log( "-=-=",this.dataShi);
this.query.contractStartTime = this.dataShi[0];
this.query.contractEntTime = this.dataShi[1];
}
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data;
console.log(data);
// console.log(data);
this.clientType.forEach(it =>{
data.records.forEach(i =>{
if(parseInt( it.dictKey ) == parseInt(i.typeService)){

Loading…
Cancel
Save