diff --git a/src/api/basicdata/basicdataGoodsShelfView.ts b/src/api/basicdata/basicdataGoodsShelfView.ts index d802b2c5..62b69226 100644 --- a/src/api/basicdata/basicdataGoodsShelfView.ts +++ b/src/api/basicdata/basicdataGoodsShelfView.ts @@ -87,3 +87,12 @@ export const $_locationsnub = (params) => { params }) } + +// 启用货位 +export const $_enable = (params) => { + return request({ + url: '/api/logpm-basicdata/goodsAllocation/enable', + method: 'post', + params + }) +} \ No newline at end of file diff --git a/src/views/basicdata/brand/basicdataFreightFrom.vue b/src/views/basicdata/brand/basicdataFreightFrom.vue index f78d4aa4..27e40a81 100644 --- a/src/views/basicdata/brand/basicdataFreightFrom.vue +++ b/src/views/basicdata/brand/basicdataFreightFrom.vue @@ -1,98 +1,111 @@ @@ -202,9 +295,9 @@ import { getDictionaryBiz } from '@/api/system/dict'; import { getDeptLazyTree } from '@/api/basicdata/basicdataCategory'; import { selectName } from '@/api/basicdata/basicClient'; -import {getListIdsName} from "@/api/basicdata/basicdataStoreBrand"; +import { getListIdsName } from '@/api/basicdata/basicdataStoreBrand'; import { mapGetters } from 'vuex'; -import { getDetail, add, update } from "@/api/basicdata/basicdataFreight"; +import { getDetail, add, update } from '@/api/basicdata/basicdataFreight'; export default { name: 'basicdataFreightFrom', @@ -214,13 +307,19 @@ export default { bin: '', allocate: '', options: [], + DryWarehouseDistributionA: [], //干 + DryWarehouseDistributionB: [], //仓 + DryWarehouseDistributionC: [], //配 + DryWarehouseDistributionAID: '', //干线ID + DryWarehouseDistributionBID: '', //仓库ID + DryWarehouseDistributionCID: '', //配送ID clientOptions: [], //客户集合 activeName: 'second', // 分页信息 page: { currentPage: 1, pageSize: 30, - total: 40 + total: 40, }, // 是否显示查询 search: true, @@ -260,7 +359,7 @@ export default { lazy: true, multiple: true, checkStrictly: true, - lazyLoad (node, resolve) { + lazyLoad(node, resolve) { const { level } = node; setTimeout(async () => { // console.log("node/////////",node); @@ -268,190 +367,212 @@ export default { // console.log("par",parentId); let shuju = await getDeptLazyTree(parentId); // console.log(")))))))))))",shuju); - const nodes = Array.from(shuju.data.data) - .map(item => ({ - value: item.id, - label: item.title, - leaf: !item.hasChildren - })); + const nodes = Array.from(shuju.data.data).map(item => ({ + value: item.id, + label: item.title, + leaf: !item.hasChildren, + })); // console.log("////////////",nodes); // 通过调用resolve将子节点数据返回,通知组件数据加载完成 resolve(nodes); }, 500); - } + }, }, // 选择行 selectionList: [], }; }, - watch:{ - - }, - mounted() { - - }, + watch: {}, + mounted() {}, computed: { - ...mapGetters(["permission",'tagWel','tagList']), - ids () { + ...mapGetters(['permission', 'tagWel', 'tagList']), + ids() { let ids = []; this.selectionList.forEach(ele => { ids.push(ele.id); }); - return ids.join(","); - } + return ids.join(','); + }, }, created() { this.init(); }, - methods:{ - bianLier(costListName,clientType,costList,fei){ //获取费用价格 - console.log(">>>>>>>>>",costListName,clientType,costList,fei); + methods: { + bianLier(costListName, clientType, costList, fei) { + //获取费用价格 + console.log('>>>>>>>>>', costListName, clientType, costList, fei); this.pan = false; // fei = []; - for (let i = 0;i< costListName.length;i++){ - if(!costList){ this.pan = true; return } - for(let a = 0;a < clientType.length;a++){ + for (let i = 0; i < costListName.length; i++) { + if (!costList) { + this.pan = true; + return; + } + for (let a = 0; a < clientType.length; a++) { // console.log("进来了",clientType[a].dictKey , costListName[i]); - if(clientType[a].dictKey == costListName[i]){ + if (clientType[a].dictKey == costListName[i]) { // console.log("进来了",clientType[a].dictKey , costListName[i]); let zhi = costList[costListName[i]]; // console.log("zhi>>",zhi); - if(!zhi){ + if (!zhi) { this.pan = true; continue; - }else{ + } else { //2.添加 - console.log("clientType[a].dictKey,zhi",clientType[a].dictKey,zhi); - fei.set(clientType[a].dictKey,zhi); + console.log('clientType[a].dictKey,zhi', clientType[a].dictKey, zhi); + fei.set(clientType[a].dictKey, zhi); } - } } - } }, //整合数据 - integratedData(){ - this.form.typeService.forEach(async i =>{ - switch (i){ + integratedData() { + this.form.typeService.forEach(async i => { + switch (i) { case '1': let fe = new Map(); - await this.bianLier(this.arteryListName,this.artery,this.arteryList,fe); - if(!this.pan){ + await this.bianLier(this.arteryListName, this.artery, this.arteryList, fe); + if (!this.pan) { this.form.arter = fe; } break; case '2': let fei2 = new Map(); - await this.bianLier(this.entrepotListName,this.entrepot,this.entrepotList,fei2); - if(!this.pan){ + await this.bianLier(this.entrepotListName, this.entrepot, this.entrepotList, fei2); + if (!this.pan) { this.form.entrepots = fei2; } break; case '3': let fei3 = new Map(); - await this.bianLier(this.deliveryListName,this.delivery,this.deliveryList,fei3); - if(!this.pan){ + await this.bianLier(this.deliveryListName, this.delivery, this.deliveryList, fei3); + if (!this.pan) { this.form.deliverys = fei3; } break; } - }) - + }); }, - handleSubmit (from) { //提交修改 - this.$refs[from].validate(async (valid) => { + handleSubmit(from) { + //提交修改 + this.$refs[from].validate(async valid => { if (valid) { if (!this.form.id) { let fei = new Map(); await this.integratedData(); - if(this.pan){ - this.$message.warning("请填写完整已勾选的数据费用"); - return + if (this.pan) { + this.$message.warning('请填写完整已勾选的数据费用'); + return; } this.form.arterys = fei; + this.form.clientIds = this.form.clientIds; + this.form.brand = this.form.brand; - console.log("提交的数据》》》",this.form); - - /* add(this.form).then(() => { + this.form.category = this.form.category ? this.form.category.flat().join(',') : null; + console.log(this.DryWarehouseDistributionA, '干选择'); + console.log(this.DryWarehouseDistributionB, '仓选择'); + console.log(this.DryWarehouseDistributionC, '配选择'); + // this.DryWarehouseDistributionB, + // this.form.details = this.DryWarehouseDistributionB; + this.form.details = [].concat(...this.DryWarehouseDistributionA, ...this.DryWarehouseDistributionB, ...this.DryWarehouseDistributionC); + console.log('提交的数据》》》', this.form); + add(this.form).then(() => { + this.$store.commit('DEL_TAG_CURRENT'); //关闭当前页面 + this.$router.push('/basicdata/brand/basicdataFreight'); //添加成功跳转到列表 this.box = false; this.onLoad(this.page); this.$message({ - type: "success", - message: "操作成功!" + type: 'success', + message: '操作成功!', }); this.contextmenuFlag = false; - this.$store.commit('DEL_TAG_CURRENT'); - this.$router.push(this.tagWel); - });*/ + + }); } else { - console.log("====>>>",this.form); - /* update(this.form).then(() => { + this.form.clientIds = this.form.clientIds; + this.form.brand = this.form.brand; + console.log('====>>>', this.form); + + update(this.form).then(() => { this.box = false; this.onLoad(this.page); this.$message({ - type: "success", - message: "操作成功!" + type: 'success', + message: '操作成功!', }); this.contextmenuFlag = false; - this.$store.commit('DEL_TAG_CURRENT'); - this.$router.push(this.tagWel); - })*/ + this.$store.commit('DEL_TAG_CURRENT'); //关闭当前页面 + this.$router.push('/basicdata/brand/basicdataFreight'); //添加成功跳转到列表 + }); } } - }) - + }); }, coverCharge(num) { + console.log(num, '仓配选择'); + console.log(this.freightType, 'freightType'); + // = this.freightType.find(res=>res.dictKey).id // console.log(num); this.dry = false; this.cabin = false; this.match = false; - num.forEach(it =>{ + num.forEach(it => { switch (it) { - case '1': - this.dry = true; - this.able = '干'; - this.activeName = '干'; - break; - case '2': - this.cabin = true; - this.bin = '仓'; - this.activeName = '仓'; - break; - case '3': - this.match = true; - this.allocate= '配'; - this.activeName = '配'; - break; - + case '1': + this.dry = true; + this.able = '干'; + this.activeName = '干'; + this.DryWarehouseDistributionAID = ''; //先置空 + console.log(it,'it====='); + this.DryWarehouseDistributionAID = this.freightType.find(res => res.dictKey == it).id; + break; + case '2': + console.log(num,'num'); + this.cabin = true; + this.bin = '仓'; + this.activeName = '仓'; + this.DryWarehouseDistributionBID = ''; //先置空 + this.DryWarehouseDistributionBID = this.freightType.find(res => res.dictKey == it).id; + break; + case '3': + this.match = true; + this.allocate = '配'; + this.activeName = '配'; + this.DryWarehouseDistributionCID = ''; //先置空 + this.DryWarehouseDistributionCID = this.freightType.find(res => res.dictKey == it).id; + + break; } - }) - + }); }, - handleClick(tab, event) { //tab 选择 + handleClick(tab, event) { + //tab 选择 // console.log(tab, event); }, - choice(a){ //一口价选择 + choice(a) { + //一口价选择 console.log(a); - if(a == '2'){ + if (a == '2') { this.buyNow = false; - }else{ + } else { this.buyNow = true; } }, - choiceRide(a){ //一口价选择 + choiceRide(a) { + //一口价选择 console.log(a); - if(a == '2'){ + if (a == '2') { this.eachRide = false; - }else{ + } else { this.eachRide = true; } }, - remoteMethodBrand(query) { //客户下拉 - console.log("客户ID=====",this.form.clientId); + remoteMethodBrand(query) { + //客户下拉 + console.log('客户ID=====', this.form.clientIds); if (query !== '') { this.loading = true; setTimeout(async () => { @@ -459,17 +580,21 @@ export default { // this.options = this.list.filter(item => { // return item.label.toLowerCase().indexOf(query.toLowerCase()) > -1; // }); - let a = await getListIdsName(this.page.currentPage, this.page.pageSize, { brandName: query,ids: this.form.clientId.join(',') }); - console.log(">>>>>>>>>>",a.data.data); - this.options = a.data.data.filter((item) => { - return item.brandName.toLowerCase().includes(query.toLowerCase()) - }) + let a = await getListIdsName(this.page.currentPage, this.page.pageSize, { + brandName: query, + ids: this.form.clientIds, + }); + console.log('>>>>>>>>>>', a.data.data); + this.options = a.data.data.filter(item => { + return item.brandName.toLowerCase().includes(query.toLowerCase()); + }); }, 200); } else { this.options = []; } }, - remoteMethod(query) { //客户下拉 + remoteMethod(query) { + //客户下拉 if (query !== '') { this.loading = true; setTimeout(async () => { @@ -477,57 +602,200 @@ export default { // this.options = this.list.filter(item => { // return item.label.toLowerCase().indexOf(query.toLowerCase()) > -1; // }); - let a = await selectName(this.page.currentPage, this.page.pageSize, { clientName: query }); - console.log(">>>>>>>>>>",a.data.data.records); - this.clientOptions = a.data.data.records.filter((item) => { - return item.clientName.toLowerCase().includes(query.toLowerCase()) - }) + let a = await selectName(this.page.currentPage, this.page.pageSize, { + clientName: query, + }); + console.log('>>>>>>>>>>', a.data.data.records); + this.clientOptions = a.data.data.records.filter(item => { + return item.clientName.toLowerCase().includes(query.toLowerCase()); + }); }, 200); } else { this.clientOptions = []; } }, - textbox(e,index,ole) { //费用价格填写 + textbox(e, index, ole) { + //费用价格填写 // console.log("e,index",e,index); + console.log(e, 'e'); + console.log(index + 1, 'index'); + console.log(ole, 'ole'); switch (ole) { - case '1': - this.arteryList[index+1] = e; - break; - case '2': - this.entrepotList[index+1] = e; - break; - case '3': - this.deliveryList[index+1] = e; - break; + case '1': + console.log(this.artery, 'this.artery'); + let resDataIdA = this.artery.find(item => item.dictKey == index + 1); //筛选ID匹配的数据 + console.log(resDataIdA, 'resDataIdA'); + console.log(this.DryWarehouseDistributionA, 'this.DryWarehouseDistributionA'); + + let tmpData = this.DryWarehouseDistributionA.find( + res => res.itemName == resDataIdA.dictValue + ); + console.log(tmpData,'tmpData'); + tmpData.cost = e; //价格重新赋值 + console.log(this.DryWarehouseDistributionA, 'this.DryWarehouseDistributionA'); + console.log(this.DryWarehouseDistributionA, '处理好的仓库数据'); + + + + + this.arteryList[index + 1] = e; + break; + case '2': + console.log(this.entrepot, 'this.entrepot'); + let resDataIdB = this.entrepot.find(item => item.dictKey == index + 1); //筛选ID匹配的数据 + console.log(resDataIdB, 'resDataIdB'); + + let tmpDatb = this.DryWarehouseDistributionB.find( + res => res.itemName == resDataIdB.dictValue + ); + tmpDatb.cost = e; //价格重新赋值 + console.log(this.DryWarehouseDistributionB, 'this.DryWarehouseDistributionB'); + console.log(this.DryWarehouseDistributionB, '处理好的仓库数据'); + + this.entrepotList[index + 1] = e; + + break; + case '3': + + console.log(this.delivery, 'this.delivery'); + let resDataIdC = this.delivery.find(item => item.dictKey == index + 1); //筛选ID匹配的数据 + console.log(resDataIdC, 'resDataIdB'); + + let tmpDatC = this.DryWarehouseDistributionC.find( + res => res.itemName == resDataIdC.dictValue + ); + tmpDatC.cost = e; //价格重新赋值 + console.log(this.DryWarehouseDistributionC, 'this.DryWarehouseDistributionC'); + console.log(this.DryWarehouseDistributionC, '处理好的仓库数据'); + + + + this.deliveryList[index + 1] = e; + break; } }, - handleCheckedCitiesChange(value,index) { //费用选择 - console.log(">>>>>>>",value,index ); - switch (index){ + // 单位筛选 + unitSelection(e, index, ole) { + console.log(e, 'e====>'); + switch (ole) { case '1': - if(value.length < 1){ + + console.log(this.artery, 'this.artery'); + let resDataIdA = this.artery.find(item => item.dictValue == e.dictValue); //筛选ID匹配的数据 + console.log(resDataIdA, 'resDataIdB筛选出来的'); + let resulta = this.DryWarehouseDistributionA.find( + item => item.itemName == resDataIdA.dictValue + ); //筛选ID匹配的数据 + resulta.formulaMode = this.freight.find(res => res.dictKey == e.formulaMode).id; + resulta.formulaModeName = this.freight.find( + res => res.dictKey == e.formulaMode + ).dictValue; + break; + case '2': + // console.log(this.entrepot,'this.entrepot'); + // console.log(e,'e'); + console.log(index + 1, 'index'); + // console.log(ole,'ole'); + + let resDataIdB = this.entrepot.find(item => item.dictValue == e.dictValue); //筛选ID匹配的数据 + console.log(resDataIdB, 'resDataIdB筛选出来的'); + console.log(this.DryWarehouseDistributionB, 'this.DryWarehouseDistributionB'); + let resultb = this.DryWarehouseDistributionB.find( + item => item.itemName == resDataIdB.dictValue + ); //筛选ID匹配的数据 + console.log(resultb, 'resultb'); + resultb.formulaMode = this.freight.find(res => res.dictKey == e.formulaMode).id; + resultb.formulaModeName = this.freight.find( + res => res.dictKey == e.formulaMode + ).dictValue; + console.log(this.DryWarehouseDistributionB, '处理好的仓库数据'); + + break; + case '3': + + + let resDataIdC = this.delivery.find(item => item.dictValue == e.dictValue); //筛选ID匹配的数据 + let resultc = this.DryWarehouseDistributionC.find( + item => item.itemName == resDataIdC.dictValue + ); //筛选ID匹配的数据 + + resultc.formulaMode = this.freight.find(res => res.dictKey == e.formulaMode).id; + resultc.formulaModeName = this.freight.find( + res => res.dictKey == e.formulaMode + ).dictValue; + break; + } + }, + + handleCheckedCitiesChange(value, index) { + //费用选择 + console.log('>>>>>>>', value, index); + switch (index) { + case '1': + if (value.length < 1) { // console.log("111进来了》》》"); this.arteryList = []; this.arteryListName = []; } - this.artery.forEach(i =>{ + console.log(this.artery,'this.artery.'); + + console.log(value, 'value===='); + let resulta = this.artery.filter(item => value.includes(item.dictKey)); + console.log(resulta, '勾选的数据'); + console.log(this.artery, 'artery'); + resulta.forEach(item => { + // 检查该项是否已经在数组中存在 + if (!this.DryWarehouseDistributionA.some(b => b.itemId === item.dictKey)) { + this.DryWarehouseDistributionA.push({ + cost: item.remark, // 费用 + itemName: item.dictValue, // 费用名称 + itemId: item.dictKey, // 费用名称ID + typeId: this.DryWarehouseDistributionAID ? this.DryWarehouseDistributionAID : null, + typeName: '干线', + }); + } + }); + console.log(this.DryWarehouseDistributionA, '勾选处理好的数据'); + + + + + this.artery.forEach(i => { // console.log("value.includes(i.dictkey)",value,i.dictKey); - if(value.includes(i.dictKey)){ - console.log("干",index,i); + if (value.includes(i.dictKey)) { + console.log('干', index, i); // i.pitch = true; this.arteryListName = value; } }); break; case '2': - if(value.length < 1){ + if (value.length < 1) { // console.log("222进来了》》》"); this.entrepotList = []; this.entrepotListName = []; } - this.entrepot.forEach(i =>{ + // this.DryWarehouseDistributionB=[];//置空已经选择的 + console.log(value, 'value===='); + let resultb = this.entrepot.filter(item => value.includes(item.dictKey)); + console.log(resultb, '勾选的数据'); + console.log(this.entrepot, 'entrepot'); + resultb.forEach(item => { + // 检查该项是否已经在数组中存在 + if (!this.DryWarehouseDistributionB.some(b => b.itemId === item.dictKey)) { + this.DryWarehouseDistributionB.push({ + cost: item.remark, // 费用 + itemName: item.dictValue, // 费用名称 + itemId: item.dictKey, // 费用名称ID + typeId: this.DryWarehouseDistributionBID ? this.DryWarehouseDistributionBID : null, + typeName: '仓库', + }); + } + }); + console.log(this.DryWarehouseDistributionB, '勾选处理好的数据'); + this.entrepot.forEach(i => { // console.log("value.includes(i.dictkey)",value,i.dictKey); - if(value.includes(i.dictKey)){ + if (value.includes(i.dictKey)) { // console.log("仓",index,i); // i.pitch = true; this.entrepotListName = value; @@ -535,14 +803,35 @@ export default { }); break; case '3': - if(value.length < 1){ + if (value.length < 1) { // console.log("333进来了》》》"); this.deliveryList = []; this.deliveryListName = []; } - this.delivery.forEach(i =>{ + + + + console.log(value, 'value===='); + let resultc = this.delivery.filter(item => value.includes(item.dictKey)); + resultc.forEach(item => { + // 检查该项是否已经在数组中存在 + if (!this.DryWarehouseDistributionC.some(b => b.itemId === item.dictKey)) { + this.DryWarehouseDistributionC.push({ + cost: item.remark, // 费用 + itemName: item.dictValue, // 费用名称 + itemId: item.dictKey, // 费用名称ID + typeId: this.DryWarehouseDistributionCID ? this.DryWarehouseDistributionCID : null, + typeName: '配送', + }); + } + }); + console.log(this.DryWarehouseDistributionB, '勾选处理好的数据'); + + + + this.delivery.forEach(i => { // console.log("value.includes(i.dictkey)",value,i.dictKey); - if(value.includes(i.dictKey)){ + if (value.includes(i.dictKey)) { // console.log("配",index,i); // i.pitch = true; this.deliveryListName = value; @@ -551,7 +840,7 @@ export default { break; } }, - init () { + init() { this.height = this.setPx(document.body.clientHeight - 155); //字典 // getDictionaryBiz('jg_freight_mark').then(res => { @@ -568,32 +857,34 @@ export default { // console.log("字典》》》",res); this.freightType = res.data.data; }); - getDictionaryBiz('artery').then(res => { //干线 + getDictionaryBiz('artery').then(res => { + //干线 // console.log("字典》》》",res); this.artery = res.data.data; }); - getDictionaryBiz('entrepot').then(res => { //仓 + getDictionaryBiz('entrepot').then(res => { + //仓 // console.log("字典》》》",res); this.entrepot = res.data.data; }); - getDictionaryBiz('delivery').then(res => { // 配 + getDictionaryBiz('delivery').then(res => { + // 配 // console.log("字典》》》",res); this.delivery = res.data.data; }); - }, - } + }, }; - diff --git a/src/views/basicdata/warehouse/goodsShelf/basicdataGoodsShelfView.vue b/src/views/basicdata/warehouse/goodsShelf/basicdataGoodsShelfView.vue index 8f95d6bb..89c35cd6 100644 --- a/src/views/basicdata/warehouse/goodsShelf/basicdataGoodsShelfView.vue +++ b/src/views/basicdata/warehouse/goodsShelf/basicdataGoodsShelfView.vue @@ -110,7 +110,7 @@ :class="ite.enableStatus == 2 ? 'itemmibox rotate' : 'itemmibox'" v-for="ite in item" > -
禁用货位
+
禁用货位
{ console.log(scope); details.checkselectchangearr = scope; }; +// 是否启用货位 +const EnableStoragelocation=(item)=>{ + + + ElMessageBox.confirm( + '是否启用货位?', + '提示', + { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning', + } + ) + .then(() => { + exprloading.value=true + console.log(item); + let data={ + ids:item.id, + } + $_enable(data).then(res=>{ + exprloading.value=false + console.log(res); + checkshelves() + ElMessage({ + message: '启用成功', + type: 'success', + }) + }).catch(()=>{ + exprloading.value=false + }) + + }) + .catch(() => { + ElMessage({ + type: 'info', + message: '已经取消', + }) + }) +}; const checkitem = ite => { details.inputtxts = ''; details.inputtxts1 = ''; @@ -2786,6 +2828,17 @@ const { border: 1px solid #ff0000 !important; background-color: #bd3a52 !important; color: #fff; + + +} +.mabx .contentbx .itemwbox .rotate{ + div{ + width: 100%; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + } } .el-input__inner { background-color: transparent !important;