Browse Source

增值服务修复bug

fix_bug_pro20231227
13208366016 1 year ago
parent
commit
06b5d0fa8f
  1. 170
      src/views/distribution/signfor/distributionSignforedt.vue

170
src/views/distribution/signfor/distributionSignforedt.vue

@ -420,7 +420,7 @@
<div class="BatchDelete">
<el-button type="primary" @click="newlyAdded(item.name)"> 新增 </el-button>
<el-button :disabled="ZcBtnDis" type="primary" @click="BatchDelete(item.name)">
批量
批量
</el-button>
</div>
<template v-for="(item, index) in TabTitle" :key="index">
@ -521,7 +521,7 @@
</el-collapse>
<!-- 增值服务弹窗信息 -->
<el-dialog v-model="dialogBatchDelete" :title="TcServices" width="80%">
<el-dialog @close="TzClose" v-model="dialogBatchDelete" :title="TcServices" width="80%">
<!-- 搜索功能 -->
<el-form v-if="tcSo" :inline="true" :model="TcSoInput" style="display: flex">
<el-form-item label="订单自编号:">
@ -563,7 +563,7 @@
@select-all="selectAll"
@select="selectChange"
>
<el-table-column type="selection" width="55" fixed />
<el-table-column type="selection" width="55" fixed :selectable="selectable" />
<el-table-column type="index" fixed width="50" height="100" label="#" align="center" />
<!--
@ -625,7 +625,7 @@
/> -->
<span></span>
<span class="dialog-footer">
<el-button @click="dialogBatchDelete">取消</el-button>
<el-button @click="TCdialogBatchDelete">取消</el-button>
<el-button type="primary" @click="addedSubmission"> 提交 </el-button>
</span>
</div>
@ -713,14 +713,15 @@ const route = useRoute();
const router = useRouter(); //ID
const dataAdded = ref([]); //
const TcDataAdded = ref([]); //
const TabIndex = ref(0); //
// const TabIndex = ref(0); //
const TCeditLoading = ref(false); //Load
const dialogBatchDelete = ref(false);
const TcSoInput = ref({}); //
const TcServices = ref('上楼'); //
const TcIndex = ref(1); //Tab
const tcSo = ref(false); //
const ZcBtnDis = ref(true); //
const ConfirmationInformation = ref(false); //
const ConfirmationInformation = ref(false); //
const TcZcInput = ref({}); //
const TcTemp = ref([]); //
const TcData = ref([]); //
@ -728,6 +729,7 @@ const state = ref(false); //状态表格勾选
const ServiceRadioSelection = ref([]); //
const TabInfo = ref(null); //
const addvalueDetailId = ref(null); //
const TcBtn = ref(false); //
const enlargeImage = (dialogImageUrl, dialogVisible) => {
return uploadFile => {
console.log(uploadFile, '点击放大的内容');
@ -1438,7 +1440,7 @@ const menuDataB1 = ref([
label: '订单自编号',
type: 4,
values: '',
width: '200',
width: '300',
checkarr: [],
fixed: false,
sortable: true,
@ -1586,6 +1588,17 @@ const headers = computed(() => {
const doubledCount = computed(() => {
return '/api/blade-resource/oss/endpoint/put-file';
});
const findIndexById = (A, B) => {
const indexArray = [];
for (const itemA of A) {
const matchingItem = B.find(itemB => itemB.packageId === itemA.packageId);
if (matchingItem) {
indexArray.push(B.indexOf(matchingItem));
}
}
return indexArray;
};
//
const ValueAddedFunction = val => {
TCeditLoading.value = true; //load
@ -1596,35 +1609,38 @@ const ValueAddedFunction = val => {
total.value = res.data.total; //
res.data.records.forEach(item => {
item.checkbox = true; //
item.zeroQuantity = 0; //
});
console.log(res.data.records, '处理好的值');
//
// const setIn = setTimeout(() => {
// let dataX = findIndexById(dataAdded.value, TcDataAdded.value);
// console.log(dataX, '');
// //
// TcDataAdded.value.forEach((row, i) => {
// const dataIndex = dataX[i];
// if (typeof dataIndex !== 'undefined') {
// TcDataAdded.value[i] = TcDataAdded.value[dataIndex];
// tableRefs.value.toggleRowSelection(TcDataAdded.value[i], true);
// TcDataAdded.value[i].checkbox = false; //
// console.log(row, '');
// }
// });
// clearTimeout(setIn);
// }, 0);
});
};
// ID
function findIndexes(targetArray, searchArray) {
const indexes = [];
for (let i = 0; i < targetArray.length; i++) {
const targetId = targetArray[i];
for (let j = 0; j < searchArray.length; j++) {
const searchId = searchArray[j].id;
if (targetId === searchId) {
indexes.push(j);
break;
}
}
//
const selectable = (row, index) => {
if (!row.checkbox) {
return false; //
} else {
return true; //
}
return indexes;
}
};
//
const newlyAdded = val => {
console.log(tableRefs.value, 'tableRefs.value');
menuDataB.value = menuDataB1.value; //
let menData = menuDataB1.value.slice(0, -1); //menuDataB1.value
menuDataB.value = menData; //
dialogBatchDelete.value = true; //
//
ValueAddedFunction({
@ -1632,14 +1648,6 @@ const newlyAdded = val => {
current: currentPage.value,
size: pageSize.value,
});
//
// const setIn = setTimeout(() => {
// TcDataAdded.forEach((row, i) => {
// tableRefs.value.toggleRowSelection(TcDataAdded[i], true);
// });
// clearTimeout(setIn);
// }, 0);
};
//
const ServiceReset = val => {
@ -1650,16 +1658,24 @@ const ServiceReset = val => {
reservationId: RouterReservationId.value,
});
};
//
const TCdialogBatchDelete = () => {
dialogBatchDelete.value = false; //
};
//
const addedSubmission = val => {
console.log(TcDataAdded.value);
if (!TcTemp.value.length) {
ElMessage({
message: '暂未选择包件',
type: 'warning',
});
return;
}
ConfirmationInformation.value = true; //
};
//
const cancellation = val => {
console.log(Array.isArray(val), 'Array.isArray(val)');
if (!Array.isArray(val)) {
//
let Read = [];
@ -1675,6 +1691,7 @@ const cancellation = val => {
DataInfo.reservationId = RouterReservationId.value; //ID
DataInfo.addvalueDetailId = addvalueDetailId.value; //ID
DataInfo.packageEntityList = data; //
DataInfo.addvalueType = TcIndex.value; //
$_cancelSignAddValuePackage(DataInfo).then(res => {
console.log(res, '删除之后的返回值');
if (res.data.code == 200) {
@ -1682,6 +1699,7 @@ const cancellation = val => {
message: res.data.msg,
type: 'success',
});
valueAddedServices(TcIndex.value);
ZcBtnDis.value = true; //使
//
TcData.value = []; //
@ -1701,6 +1719,10 @@ const BatchDelete = row => {
// catch error
});
};
//
const TzClose = () => {
menuDataB.value = menuDataB1.value;
};
//
const DeleteEvent = row => {
cancellation(row); //
@ -1734,19 +1756,41 @@ const ZcSelectChange = (select, val) => {
}
console.log(select, val);
};
//
const TcIReset = () => {
TcData.value = []; //
TcTemp.value = []; //
ConfirmationInformation.value = false; //
dialogBatchDelete.value = false; //
TcZcInput.value = {};
ElMessage({
message: '操作成功',
type: 'success',
});
menuDataB.value = menuDataB1.value; //menuDataB1.value
};
//
const ConfirmSubmission = () => {
//
let state = true;
TcTemp.value.forEach(item => {
console.log(item, '零担数据处理');
if (item.conditions == 3) {
//
if (item.zeroQuantity) {
console.log(item.firsts + '没有输入数量');
item.quantity = item.zeroQuantity; //quantity
if (!item.zeroQuantity) {
ElMessage({
message: item.firsts + '没有输入数量',
type: 'warning',
});
state = false;
}
}
});
//
if (!state) {
return;
}
TcData.value = TcTemp.value; //
TcZcInput.value.num = TcTemp.value.length; //
let data = JSON.parse(JSON.stringify(TcData.value));
@ -1756,7 +1800,7 @@ const ConfirmSubmission = () => {
};
DataInfo.reservationId = RouterReservationId.value; //ID
DataInfo.deliveryId = RouterId.value; //ID
DataInfo.addvalueType = 1; //
DataInfo.addvalueType = TcIndex.value; //
DataInfo.packageEntityList = data; //
console.log(DataInfo, '最后要提交的值');
@ -1766,20 +1810,15 @@ const ConfirmSubmission = () => {
//
DataInfo.addvalueDetailId = addvalueDetailId.value; //ID
$_updateSignAddValuePackage(DataInfo).then(res => {
console.log(res, '返回成功的值');
TcData.value = []; //
TcTemp.value = []; //
ConfirmationInformation.value = false; //
dialogBatchDelete.value = false; //
TcIReset();
valueAddedServices(TcIndex.value);
});
} else {
//
$_saveSignAddValuePackage(DataInfo).then(res => {
console.log(res, '提交之后返回的值');
TcData.value = []; //
TcTemp.value = []; //
ConfirmationInformation.value = false; //
dialogBatchDelete.value = false; //
TcIReset();
valueAddedServices(TcIndex.value);
});
}
};
@ -1896,7 +1935,10 @@ const tabClick = val => {
};
//
const valueAddedServices = val => {
dataAdded.value = []; //
addvalueDetailId.value = null; //
console.log(addvalueDetailId.value, '当前是否为新增还是编辑');
addvalueInfoList({
addvalueId: val,
signforId: RouterId.value,
@ -1909,7 +1951,6 @@ const valueAddedServices = val => {
addvalueDetailId.value = res.data.data.addvalueDetailId;
console.log('当前不是第一次,为新增操作');
}
res.data.data.packageEntityList.forEach(item => {
item.checkbox = true;
console.log(item);
@ -1923,14 +1964,20 @@ const valueAddedServices = val => {
}
});
};
//
const ServiceChange = val => {
console.log(val, '增值服务点击');
menuDataB.value = menuDataB1.value;
setTimeout(() => {
valueAddedServices(1);
}, 0);
};
//
const TitleBarSwitch = data => {
TcServices.value = data.props.label; //
TcIndex.value = Number(data.props.name); //tab
TcIndex.value++;
console.log(TcIndex.value, '当前的tab下标');
editLoading.value = true; //
TabIndex.value = data.props.name;
if (data.props.name == 0) {
menuDataB.value = menuDataB1.value;
valueAddedServices(1);
@ -1958,7 +2005,6 @@ const TitleBarSwitch = data => {
};
// tab
const tabClickB = val => {
console.log(val, 'val当前信息');
TabInfo.value = val; //
TitleBarSwitch(val);
};
@ -1974,13 +2020,11 @@ const selectAll = val => {
};
//
const selectChange = (selection, row) => {
console.log(row, '表格单选触发');
row.checkbox = !row.checkbox;
// 1.selection
// 2.row
console.log(selection);
console.log(row, '当前选中的');
TcTemp.value = selection; //
console.log(TcTemp.value, '准备提交的数据');
};
//
const PageSizeChange = val => {

Loading…
Cancel
Save