Browse Source

修复已知bug

dev-xx
马远东 11 months ago
parent
commit
4cbd748d77
  1. 23
      src/views/distribution/deliverylist/distributionDeliveryListdis.vue
  2. 59
      src/views/distribution/deliverylist/distributionDeliveryListedt.vue
  3. 97
      src/views/distribution/reservation/reservationAddFrom.vue
  4. 4
      src/views/distribution/stockup/distributionStockupSelf.vue
  5. 16
      src/views/distribution/turndelivery/deliveryDiscuss.vue
  6. 480
      src/views/financialsector/Financialse/FinancialDelivery.vue

23
src/views/distribution/deliverylist/distributionDeliveryListdis.vue

@ -148,7 +148,7 @@
<el-text size="small" @click="editmap(slotProps.scope)"> </el-text> <el-text size="small" @click="editmap(slotProps.scope)"> </el-text>
<el-text <el-text
size="small" size="small"
v-if="slotProps.scope.row.deliveryStatus == 1" v-if="!slotProps.scope.row.signingNumber && !slotProps.scope.row.scannedNumber"
@click="CancelDelivery(slotProps.scope)" @click="CancelDelivery(slotProps.scope)"
>取消配送</el-text >取消配送</el-text
> >
@ -808,13 +808,16 @@ export default {
getDriverList().then(res => { getDriverList().then(res => {
const data = res.data.data; const data = res.data.data;
let po = []; let po = [];
data.forEach(item => { if(data && data.length){
data.forEach(item => {
let a = { let a = {
dictKey: item.id, dictKey: item.id,
dictValue: item.name, dictValue: item.name,
}; };
po.push(a); po.push(a);
}); });
}
this.driverData = po; this.driverData = po;
console.log('===============>', res.data.data); console.log('===============>', res.data.data);
rv(res.data.data); rv(res.data.data);
@ -871,6 +874,14 @@ export default {
}, },
// //
CancelDelivery(scope) { CancelDelivery(scope) {
if(!JSON.parse(localStorage.getItem('my_data'))){
ElMessage({
message: '请选择仓库!',
type: 'warning',
})
return
}
console.log(scope, 'scope'); console.log(scope, 'scope');
let data = { let data = {
deliveryId: scope.row.id, deliveryId: scope.row.id,
@ -1114,6 +1125,14 @@ export default {
this.box = true; this.box = true;
}, },
handleEdit(scope) { handleEdit(scope) {
if(!JSON.parse(localStorage.getItem('my_data'))){
ElMessage({
message: '请选择仓库!',
type: 'warning',
})
return
}
const { row } = scope; const { row } = scope;
this.$store.commit('DEL_ONCE_TAG', 'deliveryDiscuss'); this.$store.commit('DEL_ONCE_TAG', 'deliveryDiscuss');
this.$router.push({ this.$router.push({

59
src/views/distribution/deliverylist/distributionDeliveryListedt.vue

@ -510,8 +510,10 @@
> >
<el-text <el-text
v-if=" v-if="
slotProps.scope.row.orderPackageStatus !== '70' || (slotProps.scope.row.orderPackageStatus !== '70' ||
slotProps.scope.row.orderPackageStatusName !== '已签收' slotProps.scope.row.orderPackageStatusName !== '已签收') &&
(slotProps.scope.row.orderPackageLoadingStatusName !== '已装车' ||
slotProps.scope.row.orderPackageLoadingStatus !== '20')
" "
size="small" size="small"
@click="cancelReservationPackage(slotProps.scope.row)" @click="cancelReservationPackage(slotProps.scope.row)"
@ -519,8 +521,8 @@
> >
<el-text <el-text
v-if=" v-if="
slotProps.scope.row.orderPackageLoadingStatus != '70' || slotProps.scope.row.orderPackageStatus != '70' ||
slotProps.scope.row.orderPackageLoadingStatusName !== '已签收' slotProps.scope.row.orderPackageStatusName !== '已签收'
" "
size="small" size="small"
@click="signingReservationPackage(slotProps.scope.row)" @click="signingReservationPackage(slotProps.scope.row)"
@ -4357,6 +4359,17 @@ export default {
} }
}, },
cancelReservationPackage(row) { cancelReservationPackage(row) {
ElMessageBox.confirm(
'是否确认取消?',
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
console.log('row', row); console.log('row', row);
console.log('deliveryId', this.deliveryId); console.log('deliveryId', this.deliveryId);
console.log('reservationId', this.wid); console.log('reservationId', this.wid);
@ -4366,13 +4379,20 @@ export default {
type: 1, type: 1,
packageIds: row.id, packageIds: row.id,
}; };
this.loading=true
cancelReservationPackage(data).then(res => { cancelReservationPackage(data).then(res => {
if (res.data.code === 200) { if (res.data.code === 200) {
this.$message.success(res.data.msg); this.$message.success(res.data.msg);
this.getWrapdetails(this.page); this.getWrapdetails(this.page);
} }
}).catch(()=>{
this.loading=false
}); });
})
}, },
ViewingTrajectories(val) { ViewingTrajectories(val) {
this.$router.push({ this.$router.push({
@ -4400,14 +4420,23 @@ export default {
this.getReservationInventoryPackageListInfo(this.page); this.getReservationInventoryPackageListInfo(this.page);
} }
}) })
.catch(res => {}) .catch(res => { this.loading = false;})
.finally(() => {
this.loading = false;
});
}) })
.catch(() => {}); .catch(() => {});
}, },
signingReservationPackage(row) { signingReservationPackage(row) {
ElMessageBox.confirm(
'是否确认签收?',
'提示',
{
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
this.loading=true
console.log('row', row); console.log('row', row);
console.log('wid', this.wid); console.log('wid', this.wid);
console.log('deliveryId', this.deliveryId); console.log('deliveryId', this.deliveryId);
@ -4420,12 +4449,18 @@ export default {
deliverySign(data).then(res => { deliverySign(data).then(res => {
console.log('res>>>>>>>>>>>>>>>>>>>>>>>', res); console.log('res>>>>>>>>>>>>>>>>>>>>>>>', res);
if (res.data.code === 200) { if (res.data.code === 200) {
this.$message.success(res.data.msg); this.$message.success(res.data.msg);
this.getWrapdetails(this.page); this.getWrapdetails(this.page);
} }
}); }).catch(res=>{
// this.$message.warning('...'); this.loading=false
// return; })
})
}, },
signingReservationInventoryPackage(row) { signingReservationInventoryPackage(row) {
console.log('row', row); console.log('row', row);

97
src/views/distribution/reservation/reservationAddFrom.vue

@ -493,6 +493,7 @@ import {
getReservationInfo, getReservationInfo,
getReservationZeroOrderDetail, getReservationZeroOrderDetail,
getReservationPackageListByOrderId, getReservationPackageListByOrderId,
cancelReservation,
} from '@/api/distribution/distributionReservation'; } from '@/api/distribution/distributionReservation';
import { import {
getStockArticleList, getStockArticleList,
@ -503,6 +504,7 @@ import {
updateClient, updateClient,
$_updateBatchClient, $_updateBatchClient,
} from '@/api/distribution/distributionStockArticle'; } from '@/api/distribution/distributionStockArticle';
import { getDetailDelivery } from '@/api/distribution/distributionDelivery'; import { getDetailDelivery } from '@/api/distribution/distributionDelivery';
import { getInventoryList, selectInventoryDetail } from '@/api/distribution/distributionStockList'; import { getInventoryList, selectInventoryDetail } from '@/api/distribution/distributionStockList';
import option from '@/option/distribution/distributionStockArticle'; import option from '@/option/distribution/distributionStockArticle';
@ -512,6 +514,7 @@ import dayjs from 'dayjs';
import { entryNum, updateEntryNum } from '@/api/distribution/distributionParcelNumber'; import { entryNum, updateEntryNum } from '@/api/distribution/distributionParcelNumber';
import { setNodeHeight, removeZeroWidth } from '@/utils/util.js'; import { setNodeHeight, removeZeroWidth } from '@/utils/util.js';
import { ElMessage, ElMessageBox } from 'element-plus' import { ElMessage, ElMessageBox } from 'element-plus'
import error from '@/error';
export default { export default {
name: '/distribution/reservation/reservationAddFrom', name: '/distribution/reservation/reservationAddFrom',
data() { data() {
@ -2556,9 +2559,7 @@ this.$refs.ruleForm.validate(async valid => {
return; return;
} }
} }
// loading
this.loadingObj.submitBtnLoading = true;
this.reservationloading = true; //
// //
if (!this.form.reservationDate) { if (!this.form.reservationDate) {
this.$message({ this.$message({
@ -2644,8 +2645,72 @@ this.$refs.ruleForm.validate(async valid => {
// this.form.stockArticleList = this.packageList; // this.form.stockArticleList = this.packageList;
console.log('>>>>>>>>', this.form); console.log('>>>>>>>>', this.form);
if (this.reservationId) { if (this.reservationId) {
this.form.id = this.reservationId; //
const res = await update(this.form); const checkInfoValues = this.form.stockArticleList.every(item => !item.packageListInfo || !item.packageListInfo.length);
if(checkInfoValues){
ElMessageBox.prompt('当前所有订单都没有选择包件是否确认"取消本次计划"?', '请填写取消原因', {
confirmButtonText: '确认',
cancelButtonText: '关闭',
inputPattern: /^\S+$/,
inputErrorMessage: '请填写取消原因',
})
.then((value) => {
let data={
cancelReason:value.value,
id:this.$route.query.reservationId
}
this.reservationloading=true
cancelReservation(data).then(res=>{
console.log(res);
if(res.data.code ==200){
ElMessage({
message: res.data.msg,
type: 'success',
})
this.$router.push('/distribution/reservation/reservation');
this.$store.commit('DEL_TAG_CURRENT');
}
}).catch((error)=>{
this.reservationloading=false
console.log(error);
})
console.log(data,'要提交的数据');
})
.catch(() => {
})
}else{
for(let i=0;i< this.form.stockArticleList.length;i++){
if(!this.form.stockArticleList[i].packageListInfo || !this.form.stockArticleList[i].packageListInfo.length ){
ElMessageBox.confirm(
`订单自编号:${this.form.stockArticleList[i].orderCode}没有选择包件是否移除!`,
'提示',
{
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
this.renderOrderData.splice(i, 1);
this.form.stockArticleList.splice(i,1)
})
.catch(() => {
})
return
}
}
}
// loading
this.loadingObj.submitBtnLoading = true;
this.reservationloading = true; //
this.form.id = this.reservationId;
const res = await update(this.form);
console.log('res :>> ', res); console.log('res :>> ', res);
if (res.data.code !== 200) return; if (res.data.code !== 200) return;
this.$message({ this.$message({
@ -2654,6 +2719,9 @@ this.$refs.ruleForm.validate(async valid => {
}); });
this.back(); this.back();
} else { } else {
// loading
this.loadingObj.submitBtnLoading = true;
this.reservationloading = true; //
this.form.reservationStatus = '20'; this.form.reservationStatus = '20';
const res = await autonomouslySave(this.form); const res = await autonomouslySave(this.form);
console.log('res :>> ', res); console.log('res :>> ', res);
@ -3372,7 +3440,14 @@ console.log(this.orderList,'');
this.form.collectionFee = 0; this.form.collectionFee = 0;
this.form.isUrgent = '1'; this.form.isUrgent = '1';
// this.form.reservationDate = new Date(); // this.form.reservationDate = new Date();
if (this.orderIds) { if (this.orderIds) {
this.reservationloading=true
if(res.data.code !==200){
this.reservationloading=false
return
}
getStockArticleList(this.orderIds).then(res => { getStockArticleList(this.orderIds).then(res => {
console.log(res.data.data); console.log(res.data.data);
const data = res.data.data; const data = res.data.data;
@ -3396,11 +3471,18 @@ console.log(this.orderList,'');
this.form.deliveryAddress = address; this.form.deliveryAddress = address;
this.orderData = data; this.orderData = data;
this.renderOrderData = [...this.orderData]; this.renderOrderData = [...this.orderData];
}); this.reservationloading=false
})
} }
if (this.reservationId) { if (this.reservationId) {
this.reservationloading=true
this.inventoryShow = true; this.inventoryShow = true;
getReservationInfo(this.reservationId).then(res => { getReservationInfo(this.reservationId).then(res => {
if(res.data.code !==200){
this.reservationloading=false
return
}
const reservation = res.data.data; const reservation = res.data.data;
const stockArticleListInfo = res.data.data.stockArticleList; const stockArticleListInfo = res.data.data.stockArticleList;
// stockArticleListInfo.forEach(item=>{ // stockArticleListInfo.forEach(item=>{
@ -3426,7 +3508,8 @@ console.log(this.orderList,'');
}); });
} }
this.form = reservation; this.form = reservation;
}); this.reservationloading=false
})
} else { } else {
this.form.deliveryType = '2'; this.form.deliveryType = '2';
} }

4
src/views/distribution/stockup/distributionStockupSelf.vue

@ -141,7 +141,7 @@
<!-- </el-option>--> <!-- </el-option>-->
<!-- </el-select>--> <!-- </el-select>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<el-form-item label="备货区域" :label-width="formLabelWidth"> <!-- <el-form-item label="备货区域" :label-width="formLabelWidth">
<el-select <el-select
v-model="form.goodsAreaId" v-model="form.goodsAreaId"
clearable clearable
@ -156,7 +156,7 @@
> >
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item> -->
<el-form-item <el-form-item
label="出库时间" label="出库时间"
prop="outboundDate" prop="outboundDate"

16
src/views/distribution/turndelivery/deliveryDiscuss.vue

@ -1154,7 +1154,7 @@ const menuData = ref([
label: '服务号', label: '服务号',
type: 2, type: 2,
values: '', values: '',
width: '160', width: '200',
checkarr: [], checkarr: [],
fixed: true, fixed: true,
sortable: true, sortable: true,
@ -1165,7 +1165,7 @@ const menuData = ref([
label: '运单号', label: '运单号',
type: 2, type: 2,
values: '', values: '',
width: '160', width: '150',
checkarr: [], checkarr: [],
fixed: true, fixed: true,
sortable: true, sortable: true,
@ -1176,7 +1176,7 @@ const menuData = ref([
label: '订单自编号', label: '订单自编号',
type: 2, type: 2,
values: '', values: '',
width: '160', width: '200',
checkarr: [], checkarr: [],
fixed: false, fixed: false,
sortable: true, sortable: true,
@ -1187,7 +1187,7 @@ const menuData = ref([
label: '是否零担', label: '是否零担',
type: 3, type: 3,
values: '', values: '',
width: '160', width: '100',
checkarr: [ checkarr: [
{ label: '否', value: 0 }, { label: '否', value: 0 },
{ label: '是', value: 1 }, { label: '是', value: 1 },
@ -1212,7 +1212,7 @@ const menuData = ref([
label: '订单总件数', label: '订单总件数',
type: 2, type: 2,
values: '', values: '',
width: '140', width: '110',
checkarr: [], checkarr: [],
fixed: false, fixed: false,
sortable: true, sortable: true,
@ -1225,7 +1225,7 @@ const menuData = ref([
label: '在库件数', label: '在库件数',
type: 1, type: 1,
values: '', values: '',
width: '130', width: '110',
checkarr: [], checkarr: [],
fixed: false, fixed: false,
sortable: true, sortable: true,
@ -1404,7 +1404,7 @@ const menuData = ref([
label: '品牌', label: '品牌',
type: 2, type: 2,
values: '', values: '',
width: '130', width: '100',
checkarr: [], checkarr: [],
fixed: false, fixed: false,
sortable: true, sortable: true,
@ -1438,7 +1438,7 @@ const menuData = ref([
label: '顾客名字', label: '顾客名字',
type: 2, type: 2,
values: '', values: '',
width: '130', width: '100',
checkarr: [], checkarr: [],
fixed: false, fixed: false,
sortable: true, sortable: true,

480
src/views/financialsector/Financialse/FinancialDelivery.vue

@ -550,19 +550,19 @@ const MinimumChange = val => {
console.log(val); console.log(val);
if (val) { if (val) {
form.value.dispatchMinCostMode = 1; form.value.dispatchMinCostMode = 1;
form.value.dispatchMinCostType=1 form.value.dispatchMinCostType = 1;
form.value.dispatchIsUpwardJudgment = 0; form.value.dispatchIsUpwardJudgment = 0;
} else { } else {
form.value.dispatchMinCostMode = 0; form.value.dispatchMinCostMode = 0;
form.value.dispatchIsUpwardJudgment = 0; // form.value.dispatchIsUpwardJudgment = 0; //
form.value.dispatchMinCostType=null form.value.dispatchMinCostType = null;
} }
}; };
// //
const CommercialcialDisplay = id => { const CommercialcialDisplay = async id => {
let data = ServiceList.value.find(res => res.value == id); let data = await ServiceList.value.find(res => res.value == id);
console.log(ServiceList.value, 'ServiceList.value'); console.log(ServiceList.value, 'ServiceList.value');
if (data.value == 1) { if (data.value == 1) {
form.value.dispatchPieceCategoryState = true; // form.value.dispatchPieceCategoryState = true; //
@ -622,30 +622,43 @@ const CommercialcialDisplay = id => {
}; };
// //
const isChecked = item => { const isChecked = async item => {
console.log(item.value, '点击菜单value'); console.log(item.value, '点击菜单value');
console.log(item, 'item=');
if (!form.value.WarehousebillingmodeTitle) { if (!form.value.WarehousebillingmodeTitle) {
ElMessage({ ElMessage({
message: '请先选择仓储计费类型', message: '请先选择仓储计费类型',
type: 'warning', type: 'warning',
}); });
form.value.dispatchPricingType = []; // form.value.dispatchPricingType = []; //
item.check = false; // item.check = false; //
return; return;
} }
CommercialcialDisplay(item.value); // await CommercialcialDisplay(item.value); //
Timedelive(); // if (form.value.dispatchPricingType && form.value.dispatchPricingType.length) {
form.value.dispatchPricingType.forEach(id => {
console.log(item, 'item');
let data = ServiceList.value.find(res => res.value == id);
if (data) {
data.check = true;
} else {
data.check = false;
}
});
}
}; };
// //
const removeTag = value => { const removeTag = value => {
console.log(value, '点击移除value'); console.log(value, '点击移除value');
Deliveryloading.value = true; Deliveryloading.value = true;
// //
if (ServiceList.value.length) {
let data = ServiceList.value.find(res => res.value == value); let data = ServiceList.value.find(res => res.value == value);
data.check = false; if (data) {
data.state = false; data.check = false;
data.state = false;
}
}
CommercialcialDisplay(value); // CommercialcialDisplay(value); //
Timedelive(); // Timedelive(); //
}; };
@ -655,12 +668,11 @@ function removeItemById(array, id) {
const index = array.findIndex(item => item.index === id); const index = array.findIndex(item => item.index === id);
if (index !== -1) { if (index !== -1) {
array.splice(index, 1); array.splice(index, 1);
if(array.length){ if (array.length) {
array.forEach((item, index) => { array.forEach((item, index) => {
item.index = index + 1; item.index = index + 1;
}); });
} }
} }
} }
// //
@ -717,12 +729,11 @@ function FmremoveItemById(array, id) {
const index = array.findIndex(item => item.id === id); const index = array.findIndex(item => item.id === id);
if (index !== -1) { if (index !== -1) {
array.splice(index, 1); array.splice(index, 1);
if(array.length){ if (array.length) {
array.forEach((item, index) => { array.forEach((item, index) => {
item.id = index + 1; item.id = index + 1;
}); });
} }
} }
let timerId = setTimeout(() => { let timerId = setTimeout(() => {
goriesloading.value = false; goriesloading.value = false;
@ -760,41 +771,37 @@ async function updateDictionary(targetArray, dictionaryType) {
// //
if (dictionaryType === 'dispatch_pricing_type') { if (dictionaryType === 'dispatch_pricing_type') {
Commercialcial.value = []; // Commercialcial.value = []; //
if(res.data.data && res.data.data.length){ if (res.data.data && res.data.data.length) {
res.data.data.forEach(res => { res.data.data.forEach(res => {
let data = { let data = {
title: res.dictValue, // title: res.dictValue, //
id: Number(res.dictKey), //ID id: Number(res.dictKey), //ID
state: false, // state: false, //
Storageloading: false, // Storageloading: false, //
sequence: [ sequence: [
// //
{ {
id: 1, // id: 1, //
plus: true, // plus: true, //
reduce: false, // reduce: false, //
Additionalcategories: [], // Additionalcategories: [], //
Warehousecategory: '', // Warehousecategory: '', //
StateName: 'storage', // StateName: 'storage', //
}, },
], ],
}; };
Commercialcial.value.push({ Commercialcial.value.push({
...data, ...data,
});
}); });
});
} }
CommercialcialCopy.value = deepClone(Commercialcial.value); CommercialcialCopy.value = deepClone(Commercialcial.value);
// //
console.log(form.value.dispatchServiceType,'服务类型aa'); console.log(form.value.dispatchServiceType, '服务类型aa');
} }
// //
if (dictionaryType == 'price_yes_no') { if (dictionaryType == 'price_yes_no') {
Leftoverparts.value = { ...Distinguishcategories.value }; // Leftoverparts.value = { ...Distinguishcategories.value }; //
@ -834,29 +841,28 @@ const search = val => {
let data = null; let data = null;
SelectData.value.options = []; // SelectData.value.options = []; //
console.log(SelectData.value.StateName, 'SelectData.value.StateName'); console.log(SelectData.value.StateName, 'SelectData.value.StateName');
if(res.data.data && res.data.data.length){ if (res.data.data && res.data.data.length) {
res.data.data.forEach(item => { res.data.data.forEach(item => {
if (SelectData.value.StateName == 'storage') { if (SelectData.value.StateName == 'storage') {
// //
concatdata = form.value.dispatchCubeCategoryData.concat( concatdata = form.value.dispatchCubeCategoryData.concat(
form.value.dispatchWeightCategoryData, form.value.dispatchWeightCategoryData,
form.value.dispatchPieceCategoryData form.value.dispatchPieceCategoryData
); );
data = concatdata.find(res => res.Warehousecategory == item.goodsId); data = concatdata.find(res => res.Warehousecategory == item.goodsId);
} else if (SelectData.value.StateName == 'Commercialcial') { } else if (SelectData.value.StateName == 'Commercialcial') {
// //
data = form.value.dispatchSubjoinCategoryData.find( data = form.value.dispatchSubjoinCategoryData.find(
res => res.Warehousecategory == item.goodsId res => res.Warehousecategory == item.goodsId
); );
} }
SelectData.value.options.push({ SelectData.value.options.push({
label: item.goodsName, label: item.goodsName,
value: item.goodsId, value: item.goodsId,
disabled: data ? true : false, disabled: data ? true : false,
});
}); });
});
} }
} }
} }
}) })
@ -868,47 +874,51 @@ const search = val => {
}; };
function updateOptions(allDropdowns) { function updateOptions(allDropdowns) {
// //
let dropdowns = [].concat(...allDropdowns); let dropdowns = [].concat(...allDropdowns);
// //
dropdowns.forEach((dropdown, index, self) => { dropdowns.forEach((dropdown, index, self) => {
// //
let selectedValue = dropdown.Warehousecategory; let selectedValue = dropdown.Warehousecategory;
// options // options
self.forEach(otherDropdown => { self.forEach(otherDropdown => {
if (dropdown !== otherDropdown) { // if (dropdown !== otherDropdown) {
otherDropdown.options.forEach(option => { //
// otherDropdown.options.forEach(option => {
if (option.value === selectedValue) { //
option.disabled = true; if (option.value === selectedValue) {
} else { option.disabled = true;
// } else {
let isSelectedSomewhereElse = self.some(d => d !== otherDropdown && d.Warehousecategory === option.value); //
option.disabled = isSelectedSomewhereElse; let isSelectedSomewhereElse = self.some(
} d => d !== otherDropdown && d.Warehousecategory === option.value
}); );
} option.disabled = isSelectedSomewhereElse;
}
}); });
}
}); });
});
} }
// //
// //
const selectChange = data => { const selectChange = data => {
// console.log(data, 'data'); // console.log(data, 'data');
// console.log(form.value.dispatchCubeCategoryData,'dispatchCubeCategoryData111'); // console.log(form.value.dispatchCubeCategoryData,'dispatchCubeCategoryData111');
// console.log(form.value.dispatchWeightCategoryData,'dispatchWeightCategoryData222'); // console.log(form.value.dispatchWeightCategoryData,'dispatchWeightCategoryData222');
// console.log(form.value.dispatchPieceCategoryData,'dispatchPieceCategoryData333'); // console.log(form.value.dispatchPieceCategoryData,'dispatchPieceCategoryData333');
let allDropdowns = [form.value.dispatchCubeCategoryData, form.value.dispatchWeightCategoryData, form.value.dispatchPieceCategoryData]; let allDropdowns = [
// form.value.dispatchCubeCategoryData,
updateOptions(allDropdowns); form.value.dispatchWeightCategoryData,
form.value.dispatchPieceCategoryData,
];
//
updateOptions(allDropdowns);
}; };
const categoriesSearchfocus = item => { const categoriesSearchfocus = item => {
console.log(item, 'item'); console.log(item, 'item');
@ -918,16 +928,16 @@ const categoriesSearchfocus = item => {
const SurchargeChange = val => { const SurchargeChange = val => {
if (val) { if (val) {
form.value.dispatchSubjoinCategoryData = [ form.value.dispatchSubjoinCategoryData = [
{ {
index: 1, index: 1,
Warehousecategory: '', Warehousecategory: '',
options: [], options: [],
plus: true, plus: true,
reduce: false, reduce: false,
StateName: 'Commercialcial', StateName: 'Commercialcial',
loading: false, loading: false,
}, },
]; ];
} }
}; };
@ -948,20 +958,19 @@ const resetFormData = () => {
if ($route.query.id) { if ($route.query.id) {
console.log(form.value.dispatchPricingType, 'form.value.dispatchPricingType'); console.log(form.value.dispatchPricingType, 'form.value.dispatchPricingType');
form.value = await deepClone(formedit.value); form.value = await deepClone(formedit.value);
if(ServiceList.value.length){ if (ServiceList.value.length) {
ServiceList.value.forEach((res, index) => { ServiceList.value.forEach((res, index) => {
console.log(res); console.log(res);
if (form.value.dispatchPricingType.includes(res.value)) { if (form.value.dispatchPricingType.includes(res.value)) {
console.log(res, '选中的'); console.log(res, '选中的');
res.check = true; res.check = true;
} else { } else {
console.log(res, '未选中的'); console.log(res, '未选中的');
res.check = false; res.check = false;
} }
}); });
} }
} else { } else {
clink(); clink();
Commercialcial.value = deepClone(CommercialcialCopy.value); Commercialcial.value = deepClone(CommercialcialCopy.value);
@ -995,22 +1004,21 @@ const onLoad = async () => {
form.value.dispatchPricingType = request.value.dispatchPricingType form.value.dispatchPricingType = request.value.dispatchPricingType
? request.value.dispatchPricingType.split(',').map(Number) ? request.value.dispatchPricingType.split(',').map(Number)
: []; // : []; //
if(ServiceList.value.length){ if (ServiceList.value.length) {
ServiceList.value.forEach(dataItem => { ServiceList.value.forEach(dataItem => {
if (form.value.dispatchPricingType.includes(dataItem.value)) { if (form.value.dispatchPricingType.includes(dataItem.value)) {
dataItem.check = true; dataItem.check = true;
if (dataItem.value == 1) { if (dataItem.value == 1) {
form.value.dispatchPieceCategoryState = true; // form.value.dispatchPieceCategoryState = true; //
} else if (dataItem.value == 2) { } else if (dataItem.value == 2) {
form.value.dispatchWeightCategoryState = true; // form.value.dispatchWeightCategoryState = true; //
} else if (dataItem.value == 3) { } else if (dataItem.value == 3) {
form.value.dispatchCubeCategoryState = true; // form.value.dispatchCubeCategoryState = true; //
}
} }
} });
});
} }
StateDelivery.value = true; // StateDelivery.value = true; //
form.value.dispatchPieceCategoryData = []; form.value.dispatchPieceCategoryData = [];
if (request.value.dispatchPieceCategory) { if (request.value.dispatchPieceCategory) {
@ -1140,14 +1148,13 @@ const onLoad = async () => {
loading: false, loading: false,
}, },
]; ];
} }
} }
if (form.value.dispatchServiceType) { if (form.value.dispatchServiceType) {
form.value.WarehousebillingmodeTitle = Warehousebillingmode.value.find( form.value.WarehousebillingmodeTitle = Warehousebillingmode.value.find(
res => res.value == form.value.dispatchServiceType res => res.value == form.value.dispatchServiceType
).label; ).label;
} }
} }
formedit.value = await deepClone(form.value); formedit.value = await deepClone(form.value);
pageLoading.value = false; pageLoading.value = false;
@ -1194,87 +1201,86 @@ const handleSubmit = async () => {
return; return;
} }
form.value.serviceType = props.templateData.ServiceType.join(','); //
//
const Submit = deepClone(form.value); //
form.value.serviceType = props.templateData.ServiceType.join(','); // Submit.dispatchPricingType = Submit.dispatchPricingType.join(','); //
//
const Submit = deepClone(form.value); //
Submit.dispatchPricingType = Submit.dispatchPricingType.join(','); //
//
if (form.value.dispatchIsByCategory) {
console.log('区分品类了');
if (!form.value.dispatchPricingType.includes(1)) {
Submit.dispatchPieceCategory = '';
} else {
if (form.value.dispatchPieceCategoryData.find(res => !res.Warehousecategory)) {
ElMessage({
message: '请填写完整按件计费品类',
type: 'warning',
});
return;
}
Submit.dispatchPieceCategory = form.value.dispatchPieceCategoryData
.map(res => res.Warehousecategory)
.join(',');
// dispatchPieceCategoryData
// dispatchWeightCategoryData
// dispatchCubeCategoryData
}
if (!form.value.dispatchPricingType.includes(2)) {
Submit.dispatchWeightCategory = '';
} else {
if (form.value.dispatchWeightCategoryData.find(res => !res.Warehousecategory)) {
ElMessage({
message: '请填写完整按重量计费品类',
type: 'warning',
});
console.log(form.value.dispatchWeightCategoryData, 'cascasdasd=>>');
return;
}
Submit.dispatchWeightCategory = form.value.dispatchWeightCategoryData
.map(res => res.Warehousecategory)
.join(',');
}
if (!form.value.dispatchPricingType.includes(3)) {
Submit.dispatchCubeCategory = '';
} else {
if (form.value.dispatchCubeCategoryData.find(res => !res.Warehousecategory)) {
ElMessage({
message: '请填写完整按方计费品类',
type: 'warning',
});
return;
}
Submit.dispatchCubeCategory = form.value.dispatchCubeCategoryData //
.map(res => res.Warehousecategory) if (form.value.dispatchIsByCategory) {
.join(','); console.log('区分品类了');
} if (!form.value.dispatchPricingType.includes(1)) {
} else {
Submit.dispatchPieceCategory = ''; Submit.dispatchPieceCategory = '';
Submit.dispatchWeightCategory = ''; } else {
Submit.dispatchCubeCategory = ''; if (form.value.dispatchPieceCategoryData.find(res => !res.Warehousecategory)) {
ElMessage({
message: '请填写完整按件计费品类',
type: 'warning',
});
return;
}
Submit.dispatchPieceCategory = form.value.dispatchPieceCategoryData
.map(res => res.Warehousecategory)
.join(',');
// dispatchPieceCategoryData
// dispatchWeightCategoryData
// dispatchCubeCategoryData
} }
if (!form.value.dispatchPricingType.includes(2)) {
// Submit.dispatchWeightCategory = '';
if (form.value.dispatchIsCategorySubjoin) { } else {
Submit.dispatchSubjoinCategory = form.value.dispatchSubjoinCategoryData if (form.value.dispatchWeightCategoryData.find(res => !res.Warehousecategory)) {
ElMessage({
message: '请填写完整按重量计费品类',
type: 'warning',
});
console.log(form.value.dispatchWeightCategoryData, 'cascasdasd=>>');
return;
}
Submit.dispatchWeightCategory = form.value.dispatchWeightCategoryData
.map(res => res.Warehousecategory) .map(res => res.Warehousecategory)
.join(','); // .join(',');
}
if (!form.value.dispatchPricingType.includes(3)) {
Submit.dispatchCubeCategory = '';
} else { } else {
if (Submit.dispatchSubjoinCategory) { if (form.value.dispatchCubeCategoryData.find(res => !res.Warehousecategory)) {
Submit.dispatchSubjoinCategory = ''; ElMessage({
message: '请填写完整按方计费品类',
type: 'warning',
});
return;
} }
Submit.dispatchCubeCategory = form.value.dispatchCubeCategoryData
.map(res => res.Warehousecategory)
.join(',');
} }
} else {
Submit.dispatchPieceCategory = '';
Submit.dispatchWeightCategory = '';
Submit.dispatchCubeCategory = '';
}
//
if (form.value.dispatchIsCategorySubjoin) {
Submit.dispatchSubjoinCategory = form.value.dispatchSubjoinCategoryData
.map(res => res.Warehousecategory)
.join(','); //
} else {
if (Submit.dispatchSubjoinCategory) {
Submit.dispatchSubjoinCategory = '';
}
}
console.log(Submit, '要提交的数据'); console.log(Submit, '要提交的数据');
ElMessageBox.confirm('是否保存?', '提示', { ElMessageBox.confirm('是否保存?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
}).then(async () => { }).then(async () => {
pageLoading.value=true pageLoading.value = true;
if (props.templateData.code || $route.query.id) { if (props.templateData.code || $route.query.id) {
console.log('走编辑接口'); console.log('走编辑接口');
// //
@ -1283,39 +1289,45 @@ const handleSubmit = async () => {
...Submit, ...Submit,
checkType: 4, // checkType: 4, //
}; };
$_putpriceTemplate(data).then(res => { $_putpriceTemplate(data)
console.log(res, '提交成功后返回值'); .then(res => {
if (res.data.code == 200) { console.log(res, '提交成功后返回值');
ElMessage({ if (res.data.code == 200) {
message: res.data.msg, ElMessage({
type: 'success', message: res.data.msg,
}); type: 'success',
} });
}).catch(res=>{ }
console.log(res,'错误信息'); })
}).finally(()=>{ .catch(res => {
pageLoading.value=false console.log(res, '错误信息');
}); })
.finally(() => {
pageLoading.value = false;
});
} else { } else {
// //
let data = { let data = {
...Submit, ...Submit,
}; };
console.log('走新增接口'); console.log('走新增接口');
$_priceTemplate(data).then(res => { $_priceTemplate(data)
console.log(res, '提交成功后返回值'); .then(res => {
if (res.data.code == 200) { console.log(res, '提交成功后返回值');
ElMessage({ if (res.data.code == 200) {
message: res.data.msg, ElMessage({
type: 'success', message: res.data.msg,
}); type: 'success',
emit('request-data', res.data.data); // });
} emit('request-data', res.data.data); //
}).catch(res=>{ }
console.log(res,'错误信息'); })
}).finally(()=>{ .catch(res => {
pageLoading.value=false console.log(res, '错误信息');
});; })
.finally(() => {
pageLoading.value = false;
});
} }
}); });
}; };

Loading…
Cancel
Save