Browse Source

Merge branch 'pre-production'

master
pref_mail@163.com 5 months ago
parent
commit
b150b304c3
  1. 9
      src/api/HidePage/index.js
  2. 19
      src/router/views/index.js
  3. 4
      src/utils/print.js
  4. 28
      src/views/HidePage/DataRecovery.vue
  5. 1
      src/views/distribution/artery/TripartiteTransfer.vue
  6. 8
      src/views/distribution/artery/TripartiteTransferDetails.vue
  7. 1
      src/views/distribution/artery/VehicleArrivalManagement.vue
  8. 2
      src/views/distribution/artery/VehicleStowage.vue
  9. 29
      src/views/distribution/artery/VehicleStowageDetails.vue
  10. 351
      src/views/distribution/inventory/CreateOrder.vue
  11. 16
      src/views/finance/ReconciliationDepositSlip.vue
  12. 272
      src/views/waybill/CreateZeroOrder.vue

9
src/api/HidePage/index.js

@ -0,0 +1,9 @@
import request from '@/axios';
// 数据修复
export const $_syncUnloadData = data => {
return request({
url: '/api/logpm-trunkline/carsLoad/syncUnloadData',
method: 'POST',
data,
});
};

19
src/router/views/index.js

@ -251,6 +251,7 @@ export default [
name: '中转详情', name: '中转详情',
meta: { meta: {
i18n: 'data', i18n: 'data',
keepAlive: true,
}, },
component: () => component: () =>
import( import(
@ -262,6 +263,7 @@ export default [
name: '配载详情', name: '配载详情',
meta: { meta: {
i18n: 'data', i18n: 'data',
keepAlive: true,
}, },
component: () => component: () =>
import( import(
@ -1857,4 +1859,21 @@ export default [
}, },
], ],
}, },
// 数据修复(进入页面自动执行)
{
path: '/HidePage/DataRecovery',
component: Layout,
redirect: '/HidePage/DataRecovery',
children: [
{
meta: {
i18n: 'dict',
keepAlive: false,
},
path: '/HidePage/DataRecovery',
name: '数据修复',
component: () => import('@/views/HidePage/DataRecovery.vue'),
},
],
},
]; ];

4
src/utils/print.js

@ -25,7 +25,7 @@ const handleDeliveryPrint = (LODOP, templateData) => {
// LODOP.SET_PRINT_STYLE('FontColor', '#000000'); // LODOP.SET_PRINT_STYLE('FontColor', '#000000');
// // 设置打印整宽且不变形 // // 设置打印整宽且不变形
LODOP.SET_PRINT_MODE('PRINT_PAGE_PERCENT', '100%'); LODOP.SET_PRINT_MODE('PRINT_PAGE_PERCENT', '100%');
LODOP.SET_PRINT_PAGESIZE(1, 2160, 1396.5, ''); LODOP.SET_PRINT_PAGESIZE(1, '216.0mm', '139.7mm', '');
// LODOP.SET_PRINT_PAGESIZE(1, 240 + 'mm', 139.7 + 'mm', ''); // LODOP.SET_PRINT_PAGESIZE(1, 240 + 'mm', 139.7 + 'mm', '');
// // 设置打印后自动关闭 // // 设置打印后自动关闭
LODOP.SET_PRINT_MODE('AUTO_CLOSE_PREWINDOW', 1); LODOP.SET_PRINT_MODE('AUTO_CLOSE_PREWINDOW', 1);
@ -56,7 +56,7 @@ const print = (nodeList, type = 'deliveryPrint') => {
if (type === 'titlePrint') handleTitlePrint(LODOP, templateData); if (type === 'titlePrint') handleTitlePrint(LODOP, templateData);
else handleDeliveryPrint(LODOP, templateData); else handleDeliveryPrint(LODOP, templateData);
// LODOP.NewPage() // LODOP.NewPage();
LODOP.PRINT(); //直接打印 LODOP.PRINT(); //直接打印
// LODOP.PRINT_DESIGN(); // LODOP.PRINT_DESIGN();
}); });

28
src/views/HidePage/DataRecovery.vue

@ -0,0 +1,28 @@
<template></template>
<script setup>
import { ElMessage } from 'element-plus';
import { $_syncUnloadData } from '@/api/HidePage/index';
const onLoad = async () => {
let User = JSON.parse(localStorage.getItem('TWMS-userInfo'));
if (User.content.role_name != 'admin') {
ElMessage.error('访问错误...');
return;
}
ElMessage({
message: '执行中...',
type: 'warning',
});
let _res = await $_syncUnloadData();
if (_res.data.code == 200) {
ElMessage({
message: '执行成功',
type: 'success',
});
}
};
onLoad();
</script>
<style scoped lang="scss"></style>

1
src/views/distribution/artery/TripartiteTransfer.vue

@ -1231,6 +1231,7 @@ const handleCancelStartCar = () => {
/** 查看详情 */ /** 查看详情 */
const handleGoDetils = ({ row }) => { const handleGoDetils = ({ row }) => {
$store.commit('DEL_ONCE_TAG', '/distribution/artery/TripartiteTransferDetails');
$router.push({ $router.push({
path: '/distribution/artery/TripartiteTransferDetails', path: '/distribution/artery/TripartiteTransferDetails',
query: { query: {

8
src/views/distribution/artery/TripartiteTransferDetails.vue

@ -825,10 +825,10 @@ const handleGoWayBillDetail = ({ row }) => {
}); });
}; };
watch($route, () => { // watch($route, () => {
if ($route.path !== '/distribution/artery/TripartiteTransferDetails') return; // if ($route.path !== '/distribution/artery/TripartiteTransferDetails') return;
onLoad(); // });
}); onLoad();
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.fo-fl { .fo-fl {

1
src/views/distribution/artery/VehicleArrivalManagement.vue

@ -1222,6 +1222,7 @@ const handleEditStowage = ({ row }) => {
/** 前往配载详情 */ /** 前往配载详情 */
const handleGoWaybill = ({ row }) => { const handleGoWaybill = ({ row }) => {
console.log('row :>> ', row); console.log('row :>> ', row);
$store.commit('DEL_ONCE_TAG', '/distribution/artery/VehicleStowageDetails');
$router.push({ $router.push({
path: '/distribution/artery/VehicleStowageDetails', path: '/distribution/artery/VehicleStowageDetails',
query: { query: {

2
src/views/distribution/artery/VehicleStowage.vue

@ -1209,6 +1209,8 @@ const handleDirectGoMarketDetails = ({ row }) => {
/** 前往配载详情 */ /** 前往配载详情 */
const handleGoWaybill = ({ row }) => { const handleGoWaybill = ({ row }) => {
console.log('row :>> ', row); console.log('row :>> ', row);
$store.commit('DEL_ONCE_TAG', '/distribution/artery/VehicleStowageDetails');
$router.push({ $router.push({
path: '/distribution/artery/VehicleStowageDetails', path: '/distribution/artery/VehicleStowageDetails',
query: { query: {

29
src/views/distribution/artery/VehicleStowageDetails.vue

@ -429,6 +429,12 @@
</edittablehead> </edittablehead>
</template> </template>
<script lang="ts">
export default {
name: '/distribution/artery/VehicleStowageDetails',
};
</script>
<script setup lang="ts"> <script setup lang="ts">
import { import {
ref, ref,
@ -1149,17 +1155,18 @@ const handleExport = () => {
exportExcelByDom(exportColumnListNode.value.$el, `${details.form.carsNo} - ${dateNow()}.xlsx`); exportExcelByDom(exportColumnListNode.value.$el, `${details.form.carsNo} - ${dateNow()}.xlsx`);
}; };
watch( // watch(
() => $route.query, // () => $route.query,
() => { // () => {
console.log('1231 :>> ', 1231); // console.log('1231 :>> ', 1231);
if ($route.path !== '/distribution/artery/VehicleStowageDetails') return; // if ($route.path !== '/distribution/artery/VehicleStowageDetails') return;
onLoad(); // onLoad();
}, // },
{ // {
immediate: true, // immediate: true,
} // }
); // );
onLoad();
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

351
src/views/distribution/inventory/CreateOrder.vue

@ -3648,226 +3648,229 @@ const handleSubmit = (formEl: FormInstance | undefined) => {
if (!formEl) return; if (!formEl) return;
formEl.validate(async valid => { formEl.validate(async valid => {
if (!valid) return false; if (!valid) return false;
try { // loading
// loading details.loadingObj.submitLoadingBtn = true;
details.loadingObj.submitLoadingBtn = true;
//
const _flag = details.goodsList.every(val => {
if (!val.goodsName || !isNumber(val.num) || val.num === 0) return false;
return true;
});
if (!_flag) { const timer = setTimeout(async () => {
return ElMessage({ try {
type: 'warning', //
message: '请填写正确的货物名称和件数', const _flag = details.goodsList.every(val => {
if (!val.goodsName || !isNumber(val.num) || val.num === 0) return false;
return true;
}); });
}
// if (!(details.query.totalFreight > 0)) { if (!_flag) {
// return ElMessage.warning(''); return ElMessage({
// } type: 'warning',
if (totalCost.value === 0) return ElMessage.warning('合计费用不能等于0'); message: '请填写正确的货物名称和件数',
});
}
const submitData = { // if (!(details.query.totalFreight > 0)) {
...details.totalObj, // return ElMessage.warning('');
...details.query, // }
waybillDetailList: details.goodsList, if (totalCost.value === 0) return ElMessage.warning('合计费用不能等于0');
advanceIds: info.value.advanceIds,
huilaiPay: 1, const submitData = {
addList: [], ...details.totalObj,
removeList: [], ...details.query,
}; waybillDetailList: details.goodsList,
advanceIds: info.value.advanceIds,
huilaiPay: 1,
addList: [],
removeList: [],
};
submitData.customerTrain = details.query.trainNumber; submitData.customerTrain = details.query.trainNumber;
const { destination, departure } = submitData; const { destination, departure } = submitData;
if (destination.length === 1) { if (destination.length === 1) {
return ElMessage({ message: '请选择正确到站地址', type: 'warning' }); return ElMessage({ message: '请选择正确到站地址', type: 'warning' });
} }
if (departure.length === 1) { if (departure.length === 1) {
return ElMessage({ message: '请选择正确发站地址', type: 'warning' }); return ElMessage({ message: '请选择正确发站地址', type: 'warning' });
} }
// //
const _findeLocation = details.regionOptione const _findeLocation = details.regionOptione
.find(val => val.value === destination[0]) .find(val => val.value === destination[0])
.children.find(val => val.value === destination[1]); .children.find(val => val.value === destination[1]);
let _item: any = {}; let _item: any = {};
if (destination.length === 2) { if (destination.length === 2) {
_item = _findeLocation; _item = _findeLocation;
} else { } else {
_item = _findeLocation.children.find(val => val.value === destination[2]); _item = _findeLocation.children.find(val => val.value === destination[2]);
} }
submitData.destination = _item.label; submitData.destination = _item.label;
submitData.destinationCode = _item.value; submitData.destinationCode = _item.value;
// //
const _findeDeparture = details.regionOptione const _findeDeparture = details.regionOptione
.find(val => val.value === departure[0]) .find(val => val.value === departure[0])
.children.find(val => val.value === departure[1]); .children.find(val => val.value === departure[1]);
let _itemDeparture: any = {}; let _itemDeparture: any = {};
if (departure.length === 2) { if (departure.length === 2) {
_itemDeparture = _findeDeparture; _itemDeparture = _findeDeparture;
} else { } else {
_itemDeparture = _findeDeparture.children.find(val => val.value === departure[2]); _itemDeparture = _findeDeparture.children.find(val => val.value === departure[2]);
} }
submitData.departure = _itemDeparture.label; submitData.departure = _itemDeparture.label;
submitData.departureCode = _itemDeparture.value; submitData.departureCode = _itemDeparture.value;
console.log('submitData :>> ', submitData); console.log('submitData :>> ', submitData);
// let numFlag = false; // let numFlag = false;
// for (const iterator of details.goodsList) { // for (const iterator of details.goodsList) {
// if (iterator.subtotalFreight <= 0 || !iterator.subtotalFreight) { // if (iterator.subtotalFreight <= 0 || !iterator.subtotalFreight) {
// numFlag = true; // numFlag = true;
// break; // break;
// } // }
// } // }
// if (numFlag) return ElMessage.warning(''); // if (numFlag) return ElMessage.warning('');
const _content = handleDetectionPayWay(); const _content = handleDetectionPayWay();
if (_content) { if (_content) {
return ElMessage.warning(_content); return ElMessage.warning(_content);
} }
submitData.goodsName = submitData.waybillDetailList.map(val => val.goodsName).join(','); submitData.goodsName = submitData.waybillDetailList.map(val => val.goodsName).join(',');
let res: any = {}; let res: any = {};
// //
if (details.pageInfo.type !== 'edit') { if (details.pageInfo.type !== 'edit') {
submitData.addList = deepClone(details.goodsList); submitData.addList = deepClone(details.goodsList);
submitData.removeList = []; submitData.removeList = [];
delete submitData.goodsList; delete submitData.goodsList;
submitData.waybillType = 1; submitData.waybillType = 1;
if (getObjType(submitData.receipt) === 'array') if (getObjType(submitData.receipt) === 'array')
submitData.receipt = submitData.receipt.join(','); submitData.receipt = submitData.receipt.join(',');
submitData.updateAdvanceDetailList = []; submitData.updateAdvanceDetailList = [];
for (let i = 0; i < details.package.data.length; i++) { for (let i = 0; i < details.package.data.length; i++) {
const value = details.package.data[i]; const value = details.package.data[i];
const _obj = {
...value,
id: value.advanceDetailId,
incomeCategoryId: value.confirmIncomeCategoryId,
incomeCategoryName: value.confirmIncomeCategoryName,
costCategoryId: value.confirmCostCategoryId,
costCategoryName: value.confirmCostCategoryName,
};
submitData.updateAdvanceDetailList.push(_obj); const _obj = {
} ...value,
console.log('submitData :>> ', submitData); id: value.advanceDetailId,
handleComputedPlanPrice(submitData); incomeCategoryId: value.confirmIncomeCategoryId,
incomeCategoryName: value.confirmIncomeCategoryName,
costCategoryId: value.confirmCostCategoryId,
costCategoryName: value.confirmCostCategoryName,
};
// submitData.updateAdvanceDetailList.push(_obj);
}
console.log('submitData :>> ', submitData);
handleComputedPlanPrice(submitData);
if (details.submitType === 'haveData') res = await postOpenOrderOpenWaybill(submitData); //
else {
submitData.waybillType = 2;
res = await postOpenOrderOpenZeroWaybill(submitData); if (details.submitType === 'haveData') res = await postOpenOrderOpenWaybill(submitData);
} else {
const { code, data, msg } = res.data; submitData.waybillType = 2;
if (code !== 200) return;
if (msg) ElMessage.success(msg);
details.waybillId = getObjType(data) === 'object' ? data.waybillId || '' : ''; res = await postOpenOrderOpenZeroWaybill(submitData);
}
const { code, data, msg } = res.data;
if (code !== 200) return;
if (msg) ElMessage.success(msg);
// , details.waybillId = getObjType(data) === 'object' ? data.waybillId || '' : '';
if (details.pageInfo.type === 'add') details.popUpShow.titleVisited = true;
} else { // ,
submitData.waybillId = details.pageInfo.id; if (details.pageInfo.type === 'add') details.popUpShow.titleVisited = true;
} else {
submitData.waybillId = details.pageInfo.id;
const oldGoodsList = [...details.deepCloneGoodsList]; const oldGoodsList = [...details.deepCloneGoodsList];
for (let iterator of details.goodsList) { for (let iterator of details.goodsList) {
// Id updateType: 1; 2 // Id updateType: 1; 2
if (iterator.id) { if (iterator.id) {
// //
// , // ,
const _item = oldGoodsList.splice( const _item = oldGoodsList.splice(
oldGoodsList.findIndex(val => val.id === iterator.id), oldGoodsList.findIndex(val => val.id === iterator.id),
1 1
); );
// //
let _flag = false; let _flag = false;
for (const key in iterator) { for (const key in iterator) {
_flag = iterator[key] !== _item[key]; _flag = iterator[key] !== _item[key];
// 退 // 退
if (_flag) break; if (_flag) break;
} }
if (_flag) submitData.addList.push({ ...iterator, updateType: 2 }); if (_flag) submitData.addList.push({ ...iterator, updateType: 2 });
} else { } else {
submitData.addList.push({ ...iterator, updateType: 1 }); submitData.addList.push({ ...iterator, updateType: 1 });
}
} }
}
submitData.removeList = oldGoodsList; submitData.removeList = oldGoodsList;
delete submitData.goodsList; delete submitData.goodsList;
submitData.waybillType = 1; submitData.waybillType = 1;
if (getObjType(submitData.receipt) === 'array') if (getObjType(submitData.receipt) === 'array')
submitData.receipt = submitData.receipt.join(','); submitData.receipt = submitData.receipt.join(',');
submitData.updateAdvanceDetailList = []; submitData.updateAdvanceDetailList = [];
for (let i = 0; i < details.package.data.length; i++) { for (let i = 0; i < details.package.data.length; i++) {
const value = details.package.data[i]; const value = details.package.data[i];
if (
value.cloneCostCategoryId === value.confirmCostCategoryId &&
value.cloneIncomeCategoryId === value.confirmIncomeCategoryId
)
continue;
const _obj = {
id: value.advanceDetailId,
incomeCategoryId: value.confirmIncomeCategoryId,
incomeCategoryName: value.confirmIncomeCategoryName,
costCategoryId: value.confirmCostCategoryId,
costCategoryName: value.confirmCostCategoryName,
};
submitData.updateAdvanceDetailList.push(_obj); if (
} value.cloneCostCategoryId === value.confirmCostCategoryId &&
handleComputedPlanPrice(submitData); value.cloneIncomeCategoryId === value.confirmIncomeCategoryId
)
continue;
// const _obj = {
details.submitData = submitData; id: value.advanceDetailId,
const response = await postUpdateWaybillVerify(submitData); incomeCategoryId: value.confirmIncomeCategoryId,
if (response.data.code !== 200) return; incomeCategoryName: value.confirmIncomeCategoryName,
costCategoryId: value.confirmCostCategoryId,
costCategoryName: value.confirmCostCategoryName,
};
if (!response.data.data || response.data.data.length === 0) submitData.updateAdvanceDetailList.push(_obj);
return ElMessage.warning('没有更改的数据'); }
handleComputedPlanPrice(submitData);
details.changeData = response.data.data; //
details.popUpShow.causeVisited = true; details.submitData = submitData;
await nextTick(); const response = await postUpdateWaybillVerify(submitData);
if (response.data.code !== 200) return;
setNodeHeight(tableNode.value.$el, '40vh'); if (!response.data.data || response.data.data.length === 0)
return ElMessage.warning('没有更改的数据');
details.changeData = response.data.data;
details.popUpShow.causeVisited = true;
await nextTick();
setNodeHeight(tableNode.value.$el, '40vh');
}
} catch (error) {
console.log('error :>> ', error);
} finally {
clearTimeout(timer);
$store.commit('EDIT_REFRESHITEM', { title: 'TemporaryStorageList', status: true });
details.loadingObj.submitLoadingBtn = false;
} }
} catch (error) { }, 500);
console.log('error :>> ', error);
} finally {
$store.commit('EDIT_REFRESHITEM', { title: 'TemporaryStorageList', status: true });
details.loadingObj.submitLoadingBtn = false;
}
}); });
}; };

16
src/views/finance/ReconciliationDepositSlip.vue

@ -235,7 +235,11 @@ import {
handleTranslationDataSeclect, handleTranslationDataSeclect,
getObjType, getObjType,
} from '@/utils/util'; } from '@/utils/util';
import { columnList, confirmColumnList,columnListB } from '@/option/finance/ReconciliationDepositSlip'; import {
columnList,
confirmColumnList,
columnListB,
} from '@/option/finance/ReconciliationDepositSlip';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { deepClone } from '@/utils/util'; import { deepClone } from '@/utils/util';
import { ElMessage, ElMessageBox } from 'element-plus'; import { ElMessage, ElMessageBox } from 'element-plus';
@ -460,9 +464,9 @@ const searchChange = () => {
/** 清空表单 */ /** 清空表单 */
const searchReset = () => { const searchReset = () => {
// details.query = {}; // details.query = {};
console.log(details,'details'); console.log(details, 'details');
details.pageStatus == 1 ? (details.pageInfo[0].query={}) : (details.pageInfo[1].query={}); details.pageStatus == 1 ? (details.pageInfo[0].query = {}) : (details.pageInfo[1].query = {});
details.page.pageNum = 1; details.page.pageNum = 1;
handleClearTableQuery(details.pageStatus === 1 ? details.columnList1 : details.columnList2); handleClearTableQuery(details.pageStatus === 1 ? details.columnList1 : details.columnList2);
initOnLoad(); initOnLoad();
@ -563,6 +567,7 @@ const handleFullScrean = (_type: 'open' | 'close', _name: string) => {
/** 生成对账单 */ /** 生成对账单 */
const handleConfirm = async () => { const handleConfirm = async () => {
await nextTick();
if (details.selectionList.length === 0) return ElMessage.warning('请选择需要确认的数据'); if (details.selectionList.length === 0) return ElMessage.warning('请选择需要确认的数据');
const _errorArr = []; const _errorArr = [];
@ -583,7 +588,8 @@ const handleConfirm = async () => {
return ElMessage.warning(`收货单位不一致,请移除不一致数据`); return ElMessage.warning(`收货单位不一致,请移除不一致数据`);
if (value.destinationWarehouseName !== _destinationWarehouseName) if (value.destinationWarehouseName !== _destinationWarehouseName)
return ElMessage.warning(`目的仓不一致,请移除不一致数据`); return ElMessage.warning(`目的仓不一致,请移除不一致数据`);
if (Number(value.signStatus) !== 2) return ElMessage.warning(`存在未签收完成的数据`); if (details.pageStatus === 2 && Number(value.signStatus) !== 2)
return ElMessage.warning(`存在未签收完成的数据`);
} }
details.popUpShow.confirmVisited = true; details.popUpShow.confirmVisited = true;

272
src/views/waybill/CreateZeroOrder.vue

@ -2857,185 +2857,189 @@ const handleSubmit = async (formEl: FormInstance | undefined) => {
await nextTick(); await nextTick();
if (!formEl) return; if (!formEl) return;
formEl.validate(async valid => { formEl.validate(valid => {
if (valid) { if (valid) {
try { details.loadingObj.submitLoadingBtn = true;
details.loadingObj.submitLoadingBtn = true;
let _arr = []; const timer = setTimeout(async () => {
try {
let _arr = [];
for (let i = 0; i < details.goodsList.length; i++) { for (let i = 0; i < details.goodsList.length; i++) {
const val = details.goodsList[i]; const val = details.goodsList[i];
// //
if (!val.goodsName || !isNumber(val.num) || val.num === 0) if (!val.goodsName || !isNumber(val.num) || val.num === 0)
return ElMessage.warning('请填写正确的货物名称和件数'); return ElMessage.warning('请填写正确的货物名称和件数');
if (_arr.includes(val.goodsName)) return ElMessage.warning('存在重复的货物名称,请移除'); if (_arr.includes(val.goodsName))
} return ElMessage.warning('存在重复的货物名称,请移除');
}
// if (!(details.query.totalFreight > 0)) return ElMessage.warning(''); // if (!(details.query.totalFreight > 0)) return ElMessage.warning('');
if (totalCost.value === 0) return ElMessage.warning('合计费用不能等于0'); if (totalCost.value === 0) return ElMessage.warning('合计费用不能等于0');
console.log('submit!'); console.log('submit!');
const submitData = { const submitData = {
...details.totalObj, ...details.totalObj,
...details.query, ...details.query,
advanceIds: details.info.advanceIds, advanceIds: details.info.advanceIds,
huilaiPay: 1, huilaiPay: 1,
addList: [], addList: [],
removeList: [], removeList: [],
}; };
submitData.customerTrain = details.query.trainNumber; submitData.customerTrain = details.query.trainNumber;
const { destination, departure } = submitData; const { destination, departure } = submitData;
console.log('destination :>> ', destination); console.log('destination :>> ', destination);
if (destination.length === 1) { if (destination.length === 1) {
return ElMessage({ message: '请选择正确到站地址', type: 'warning' }); return ElMessage({ message: '请选择正确到站地址', type: 'warning' });
} }
if (departure.length === 1) if (departure.length === 1)
return ElMessage({ message: '请选择正确发站地址', type: 'warning' }); return ElMessage({ message: '请选择正确发站地址', type: 'warning' });
// //
const _findeLocation = details.regionOptione const _findeLocation = details.regionOptione
.find(val => val.value === destination[0]) .find(val => val.value === destination[0])
.children.find(val => val.value === destination[1]); .children.find(val => val.value === destination[1]);
let _item: any = {}; let _item: any = {};
if (destination.length === 2) { if (destination.length === 2) {
_item = _findeLocation; _item = _findeLocation;
} else { } else {
_item = _findeLocation.children.find(val => val.value === destination[2]); _item = _findeLocation.children.find(val => val.value === destination[2]);
} }
submitData.destination = _item.label; submitData.destination = _item.label;
submitData.destinationCode = _item.value; submitData.destinationCode = _item.value;
// //
const _findeDeparture = details.regionOptione const _findeDeparture = details.regionOptione
.find(val => val.value === departure[0]) .find(val => val.value === departure[0])
.children.find(val => val.value === departure[1]); .children.find(val => val.value === departure[1]);
let _itemDeparture: any = {}; let _itemDeparture: any = {};
if (departure.length === 2) { if (departure.length === 2) {
_itemDeparture = _findeDeparture; _itemDeparture = _findeDeparture;
} else { } else {
_itemDeparture = _findeDeparture.children.find(val => val.value === departure[2]); _itemDeparture = _findeDeparture.children.find(val => val.value === departure[2]);
} }
submitData.departure = _itemDeparture.label; submitData.departure = _itemDeparture.label;
submitData.departureCode = _itemDeparture.value; submitData.departureCode = _itemDeparture.value;
// let numFlag = false; // let numFlag = false;
// for (const iterator of details.goodsList) { // for (const iterator of details.goodsList) {
// if (iterator.subtotalFreight <= 0 || !iterator.subtotalFreight) { // if (iterator.subtotalFreight <= 0 || !iterator.subtotalFreight) {
// numFlag = true; // numFlag = true;
// break; // break;
// } // }
// } // }
// if (numFlag) return ElMessage.warning(''); // if (numFlag) return ElMessage.warning('');
const _content = handleDetectionPayWay(); const _content = handleDetectionPayWay();
if (_content) return ElMessage.warning(_content); if (_content) return ElMessage.warning(_content);
submitData.goodsName = details.goodsList.map(val => val.goodsName).join(','); submitData.goodsName = details.goodsList.map(val => val.goodsName).join(',');
let res: any = {}; let res: any = {};
// //
if (details.pageInfo.type !== 'edit') { if (details.pageInfo.type !== 'edit') {
submitData.addList = details.goodsList; submitData.addList = details.goodsList;
submitData.removeList = []; submitData.removeList = [];
if (typeof submitData.receipt === 'object') if (typeof submitData.receipt === 'object')
submitData.receipt = submitData.receipt.join(','); submitData.receipt = submitData.receipt.join(',');
// //
details.submitData = submitData; details.submitData = submitData;
// -- 2 // -- 2
submitData.waybillType = 2; submitData.waybillType = 2;
handleComputedPlanPrice(submitData); handleComputedPlanPrice(submitData);
console.log('submitData :>> ', submitData); console.log('submitData :>> ', submitData);
res = await postOpenOrderOpenZeroWaybill(submitData); res = await postOpenOrderOpenZeroWaybill(submitData);
const { code, data, msg } = res.data; const { code, data, msg } = res.data;
if (code !== 200) return; if (code !== 200) return;
ElMessage({ ElMessage({
message: msg, message: msg,
type: 'success', type: 'success',
}); });
details.waybillId = getObjType(data) === 'object' ? data.waybillId || '' : ''; details.waybillId = getObjType(data) === 'object' ? data.waybillId || '' : '';
// , // ,
if (details.pageInfo.type !== 'edit') details.popUpShow.titleVisited = true; if (details.pageInfo.type !== 'edit') details.popUpShow.titleVisited = true;
} else { } else {
submitData.waybillId = details.pageInfo.id; submitData.waybillId = details.pageInfo.id;
const oldGoodsList = [...details.deepCloneGoodsList]; const oldGoodsList = [...details.deepCloneGoodsList];
for (let iterator of details.goodsList) { for (let iterator of details.goodsList) {
// Id updateType: 1; 2 // Id updateType: 1; 2
if (iterator.id) { if (iterator.id) {
// //
// , // ,
const _item = oldGoodsList.splice( const _item = oldGoodsList.splice(
oldGoodsList.findIndex(val => val.id === iterator.id), oldGoodsList.findIndex(val => val.id === iterator.id),
1 1
); );
// //
let _flag = false; let _flag = false;
for (const key in iterator) { for (const key in iterator) {
_flag = iterator[key] !== _item[key]; _flag = iterator[key] !== _item[key];
// 退 // 退
if (_flag) break; if (_flag) break;
} }
if (_flag) submitData.addList.push({ ...iterator, updateType: 2 }); if (_flag) submitData.addList.push({ ...iterator, updateType: 2 });
} else { } else {
submitData.addList.push({ ...iterator, updateType: 1 }); submitData.addList.push({ ...iterator, updateType: 1 });
}
} }
}
submitData.removeList = oldGoodsList; submitData.removeList = oldGoodsList;
delete submitData.goodsList; delete submitData.goodsList;
submitData.waybillType = 1; submitData.waybillType = 1;
if (typeof submitData.receipt === 'object') if (typeof submitData.receipt === 'object')
submitData.receipt = submitData.receipt.join(','); submitData.receipt = submitData.receipt.join(',');
console.log('submitData :>> ', submitData); console.log('submitData :>> ', submitData);
handleComputedPlanPrice(submitData); handleComputedPlanPrice(submitData);
// //
details.submitData = submitData; details.submitData = submitData;
const response = await postUpdateWaybillVerify(submitData); const response = await postUpdateWaybillVerify(submitData);
if (response.data.code !== 200) return; if (response.data.code !== 200) return;
if (!response.data.data || response.data.data.length === 0) if (!response.data.data || response.data.data.length === 0)
return ElMessage.warning('没有更改的数据'); return ElMessage.warning('没有更改的数据');
details.changeData = response.data.data; details.changeData = response.data.data;
details.popUpShow.causeVisited = true; details.popUpShow.causeVisited = true;
await nextTick(); await nextTick();
setNodeHeight(tableNode.value.$el, '40vh'); setNodeHeight(tableNode.value.$el, '40vh');
}
} catch (error) {
console.log('error :>> ', error);
} finally {
clearTimeout(timer);
// laoding
details.loadingObj.submitLoadingBtn = false;
} }
} catch (error) { }, 500);
console.log('error :>> ', error);
} finally {
// laoding
details.loadingObj.submitLoadingBtn = false;
}
} else { } else {
console.log('error submit!'); console.log('error submit!');
return false; return false;

Loading…
Cancel
Save