diff --git a/src/views/aftersales/aftersalesWorkOrder.vue b/src/views/aftersales/aftersalesWorkOrder.vue index db3680c7..59756e03 100644 --- a/src/views/aftersales/aftersalesWorkOrder.vue +++ b/src/views/aftersales/aftersalesWorkOrder.vue @@ -218,6 +218,7 @@ { const searchHide = () => { console.log(details); details.search = !details.search; + const _node = document.querySelectorAll('.tableNode'); + setNodeHeight(_node, '', true); }; // 异常工单号点击查看 diff --git a/src/views/aftersales/aftersalesWorkOrderAddTemp.vue b/src/views/aftersales/aftersalesWorkOrderAddTemp.vue index f1b7f458..ae8dba40 100644 --- a/src/views/aftersales/aftersalesWorkOrderAddTemp.vue +++ b/src/views/aftersales/aftersalesWorkOrderAddTemp.vue @@ -4,12 +4,12 @@
- - + +
@@ -78,6 +78,7 @@
{{ index + 1 }} - - - 新增包件 - - 移除包件 -
- 查看历史包件 + + 新增包件 + + 移除包件 +
+ 查看历史包件 +
@@ -191,14 +196,29 @@ placeholder="请选择车次号" style="width: 100%" clearable - @change="DeliveryTrainnumber(form.trainNumber)" + @change="DeliveryTrainnumber" > - + + + + + @@ -212,7 +232,7 @@ style="width: 100%" type="datetime" format="YYYY-MM-DD" - value-format="YYYY-MM-DD" + value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择配送时间" /> @@ -251,7 +271,7 @@ style="width: 100%" type="datetime" format="YYYY-MM-DD" - value-format="YYYY-MM-DD" + value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择发货时间" /> @@ -266,7 +286,7 @@ style="width: 100%" type="datetime" format="YYYY-MM-DD" - value-format="YYYY-MM-DD" + value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择入库时间" /> @@ -281,7 +301,7 @@ style="width: 100%" type="datetime" format="YYYY-MM-DD" - value-format="YYYY-MM-DD" + value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择发现时间" /> @@ -356,6 +376,7 @@ class="demo-tabs responsibilities" @tab-click="handleClick" v-loading="form.Packageloading" + v-if="form.basis.discoveryNode != 3" >
@@ -610,6 +631,7 @@ class="demo-tabs responsibilities" @tab-click="handleClick" v-loading="form.Packageloading" + v-if="['1', '3'].includes(form.basis.discoveryNode)" > @@ -619,6 +641,8 @@ :headers="headers" :on-success="ImgSuccess" :before-upload="beforeAvatarUpload" + drag + multiple list-type="picture-card" > @@ -629,7 +653,10 @@
重置 - 保存 + 提交 + 处理完毕
@@ -682,9 +709,10 @@ import error from '@/error'; const $router = useRouter(); const formCopy = ref({}); //用于重置表单 const form = ref({ - basis: {}, //基础信息 + basis: { + TabactiveName: 1, //工单类型菜单 + }, //基础信息 Totalamount: 0, //总金额 - TabactiveName: '0', //工单类型菜单 activPackage: '0', //包件信息菜单 responsibilities: '0', //内部责任菜单 ProcessingTab: '0', //处理结果菜单 @@ -694,6 +722,7 @@ const form = ref({ groundlineType: 0, //发现节点 Proportion: 100, //公司占比 totalMax: 100, //公司占比最大值 + Processed: false, //是可以填写处理结果 // 包件列表 PackageList: [ { @@ -727,7 +756,8 @@ const form = ref({ ], }, ], - Trainoptions: [], //车次号 + Trainoptions: [], //干线车次号 + deliver: [], //配送车次号 // 理赔金额 Claimamount: [], fileList: [], //照片 @@ -784,8 +814,6 @@ const Processingoptions = ref([]); const Paymentmethodoptions = ref([]); // 处理结果 const Processingresultsoptions = ref([]); -// 车次号 -const Trainoptions = ref([]); // 字典公共函数 async function updateDictionary(targetArray, dictionaryType) { await getDictionaryBiz(dictionaryType).then(res => { @@ -815,9 +843,9 @@ const Handling = async () => { }); }; // 内部责任划分初始化 -const responsibilities = () => { +const responsibilities = async () => { // 内部责任划分处理 - form.value.responsibilitiesList = [ + form.value.responsibilitiesList = await [ { businessId: '', //责任方 personResponsibleId: '', //责任人 @@ -840,16 +868,10 @@ const responsibilities = () => { }, ]; }; - -// 页面初始化数据处理 -const PageState = () => { - if (localStorage.getItem('my_data')) { - myData.value = JSON.parse(localStorage.getItem('my_data')); //获取本地仓库信息 - } - // 内部责任划分初始化 - responsibilities(); +// 包件列表重置 +const PackageListReset = async () => { //包件列表 - form.value.PackageList = [ + form.value.PackageList = await [ { packageCode: '', //包条码 waybillNumber: '', //运单号 @@ -861,19 +883,17 @@ const PageState = () => { id: 1, }, ]; +}; +// 页面初始化数据处理 +const PageState = () => { + if (localStorage.getItem('my_data')) { + myData.value = JSON.parse(localStorage.getItem('my_data')); //获取本地仓库信息 + } + // 内部责任划分初始化 + responsibilities(); + //包件列表初始化 + PackageListReset(); formCopy.value = deepClone(form.value); //用于拷贝一份重置数据 - //理赔金额 - - // form.value.Claimamount = [ - // { - // title: '', //标题 - // money: 0, //金额 - // paymentUnit: '', //支付单位 - // compensationTime: '', //理赔支付时间 - // compensationMethod: '', //支付方式 - // Paymentmethod: [...Paymentmethodoptions.value], - // }, - // ]; }; // 页面必要初始化请求 const onLoad = async () => { @@ -906,28 +926,30 @@ const handleClick = (tab, event) => { console.log(tab, event); }; // 发现节点事件 -const DiscoveringNodesChange = value => { - console.log(value); +const DiscoveringNodesChange = async value => { + console.log(value, 'value'); form.value.groundlineType = value; form.value.basis = { - workOrderType: form.value.basis.workOrderType, - discoveryNode: form.value.basis.discoveryNode, - workOrderNumber: form.value.basis.workOrderNumber, - typeServiceName: form.value.basis.typeServiceName, - waybillMall: form.value.basis.waybillMall, + workOrderType: form.value.basis.workOrderType, //异常类型 + discoveryNode: form.value.basis.discoveryNode, //发现节点 + typeServiceName: form.value.basis.typeServiceName, //合作模式 + TabactiveName: 1, //订单类型 }; + console.log(form.value.basis, 'form.value.basis'); // 公司占比重置 form.value.Proportion = 0; // 内部责任化初始值 - responsibilities(); + await responsibilities(); + // 包件重置 + await PackageListReset(); ruleFormRef.value.clearValidate(); }; // 菜单切换显示输入框 const displaySettings = computed(() => { return { - trainNumber: ['3', '5', '7', '6'].includes(form.value.groundlineType), //车次号 - deliveryTime: ['5', '7', '6'].includes(form.value.groundlineType), //配送时间 - deliveryDriver: ['5', '7', '6'].includes(form.value.groundlineType), //配送司机 + trainNumber: ['3', '5', '6', '7'].includes(form.value.groundlineType), //车次号 + deliveryTime: ['5', '6', '7'].includes(form.value.groundlineType), //配送时间 + deliveryDriver: ['5', '6', '7'].includes(form.value.groundlineType), //配送司机 vehicleRoute: ['3'].includes(form.value.groundlineType), //车辆线路 deliverGoodsTime: ['2'].includes(form.value.groundlineType), //发货时间 warehousingTime: ['4'].includes(form.value.groundlineType), //入库时间 @@ -1142,6 +1164,16 @@ const ChangePackageInfo = async item => { form.value.basis.typeServiceName = ''; //合作模式 } return; + } else if (item.packageCode) { + item.waybillNumber = ''; //运单号 + item.orderCode = ''; //订单自编码 + item.first = ''; //一级品 + item.secondary = ''; //二级品 + item.brandName = ''; //品牌 + if (form.value.PackageList == 1) { + form.value.basis.waybillMall = ''; //运单商场 + form.value.basis.typeServiceName = ''; //合作模式 + } } // 判断输入的包条码是否一样 if (form.value.PackageList.length > 1) { @@ -1177,10 +1209,10 @@ const ChangePackageInfo = async item => { if (state) { if ( state.orderCode != packageData.orderCode || - state.brandName != packageData.brandName + state.waybillNumber != packageData.waybillNumber ) { ElMessage({ - message: '请选择相同订单自编号和品牌!', + message: '请选择相同订单自编和运单号的包条码', type: 'warning', }); return; @@ -1208,9 +1240,9 @@ const ChangePackageInfo = async item => { } else { item.history = false; } - + console.log(form.value.basis.discoveryNode, 'form.value.discoveryNode'); // 判断发现节点(干线车次号、车辆线路处理) - if (form.value.discoveryNode == '3') { + if (['3'].includes(form.value.basis.discoveryNode)) { let addedTrainNumbers = []; // 临时变量存储已经添加过的车次号 res.data.data.forEach(item => { if (item.trunklines && item.trunklines.length) { @@ -1225,6 +1257,26 @@ const ChangePackageInfo = async item => { }); } }); + console.log(form.value.Trainoptions, 'form.value.Trainoptions'); + } + // 配送环节车次号处理 + if (['5'].includes(form.value.basis.discoveryNode)) { + let addedTrainNumbers = []; // 临时变量存储已经添加过的车次号 + res.data.data.forEach(item => { + if (item.deliver && item.deliver.length) { + item.deliver.forEach(itemChid => { + if (!addedTrainNumbers.includes(itemChid.trainNumber)) { + form.value.deliver.push({ + driverName: itemChid.driverName, // 主司机 + taskTime: itemChid.taskTime, // 配送时间 + trainNumber: itemChid.trainNumber, //车次号 + }); + addedTrainNumbers.push(itemChid.trainNumber); + } + }); + } + }); + console.log(form.value.Trainoptions, 'form.value.Trainoptions'); } } else { form.value.Pageloading = false; //关闭页面加载 @@ -1290,13 +1342,41 @@ const ResponsiblePartychange = item => { // 车次号带出车辆线路 const DeliveryTrainnumber = value => { + console.log(value, '接收的参数值'); if (value) { - if (form.value.Trainoptions.length) { - let data = form.value.Trainoptions.find(res => res.trainNumber == value); - form.value.vehicleRoute = data.vehicleRoute; + if (form.value.basis.discoveryNode == '3') { + if (form.value.Trainoptions && form.value.Trainoptions.length) { + let data = form.value.Trainoptions.find(res => res.trainNumber == value); + if (data) { + form.value.basis.vehicleRoute = data.vehicleRoute; //车辆线路 + } + } + } else if (['5', '6', '7'].includes(form.value.basis.discoveryNode)) { + if (form.value.deliver && form.value.deliver.length) { + let data = form.value.deliver.find(res => res.trainNumber == value); + if (data) { + form.value.basis.deliveryDriver = data.driverName; //司机 + form.value.basis.deliveryTime = data.taskTime; //配送时间 + } + } } } }; + +// 是否显示处理完毕按钮 +const allFieldsFilled = computed(() => { + const claimAmount = form.value.Claimamount; + if (!claimAmount.length) { + form.value.Processed = false; + return false; + } + const allFilled = claimAmount.every( + item => item.compensationMethod && item.compensationTime && item.paymentUnit + ); + + form.value.Processed = allFilled; + return allFilled; +}); // 提交 const onSubmit = () => { console.log(form.value); @@ -1340,6 +1420,7 @@ const onSubmit = () => { let submitData = { ...form.value.basis, + identifying: form.value.basis.TabactiveName, //1订单2零担3库存品 }; // 包件处理 if (form.value.PackageList.length) { @@ -1382,34 +1463,38 @@ const onSubmit = () => { }); } // 内部责任划分 - if (form.value.responsibilitiesList.length) { - submitData.personResponsibleDTO = []; - form.value.responsibilitiesList.forEach(item => { - console.log(item); - let data = { - responsibilityRatio: item.responsibilityRatio, //责任占比 - tripartite: item.tripartite, //三方责任人 - description: item.description, //说明 - }; - if (form.value.groundlineType == '1') { - data.personResponsibleName = item.personResponsibleId; //责任人名称 - data.businessName = item.Processingoptions.find( - res => res.value == item.businessId - ).label; //责任方 - data.businessId = item.businessId; //责任方id - } else { - data.personResponsibleId = item.personResponsibleId; //责任人id - (data.personResponsibleName = item.ResponsibleoNameptions.find( - res => res.id == item.personResponsibleId - ).name), //责任人名称 - (data.businessName = item.Responsibleoptions.find( + if (form.value.basis.discoveryNode != 3) { + // 干线卸车环节不需要内部责任划分 + if (form.value.responsibilitiesList.length) { + submitData.personResponsibleDTO = []; + form.value.responsibilitiesList.forEach(item => { + console.log(item); + let data = { + responsibilityRatio: item.responsibilityRatio, //责任占比 + tripartite: item.tripartite, //三方责任人 + description: item.description, //说明 + }; + if (form.value.groundlineType == '1') { + data.personResponsibleName = item.personResponsibleId; //责任人名称 + data.businessName = item.Processingoptions.find( res => res.value == item.businessId - ).label); //责任方 - data.businessId = item.businessId; //责任方id - } - submitData['personResponsibleDTO'].push(data); - }); + ).label; //责任方 + data.businessId = item.businessId; //责任方id + } else { + data.personResponsibleId = item.personResponsibleId; //责任人id + (data.personResponsibleName = item.ResponsibleoNameptions.find( + res => res.id == item.personResponsibleId + ).name), //责任人名称 + (data.businessName = item.Responsibleoptions.find( + res => res.value == item.businessId + ).label); //责任方 + data.businessId = item.businessId; //责任方id + } + submitData['personResponsibleDTO'].push(data); + }); + } } + // 图片处理 if ( form.value.fileList.length && @@ -1469,6 +1554,11 @@ const onSubmit = () => { console.log(submitData, '处理好的参数'); form.value.Pageloading = true; //关闭页面加载 + + //是否直接提交到处理结果 + if (form.value.Processed) { + submitData.workOrderStatus = 30; + } $_submit(submitData) .then(res => { ElMessage({ @@ -1486,6 +1576,7 @@ const onSubmit = () => { form.value = await deepClone(formCopy.value); //用于拷贝一份重置数据 await PageState(); await ruleFormRef.value.resetFields(); + form.value.Pageloading = false; //关闭页面加载 }) .catch(() => { $store.commit('DEL_TAG_CURRENT'); //关闭当前页面 @@ -1630,7 +1721,7 @@ const TabactiveClick = (a, b) => { display: flex; flex-wrap: wrap; :deep(.el-form-item) { - width: 15%; + width: 10.5%; margin-right: 6px; .el-form-item__content { .el-input { @@ -1647,7 +1738,7 @@ const TabactiveClick = (a, b) => { .el_Basic { flex: 1; display: flex; - min-width: 38%; + min-width: 32%; .el_Processing { min-width: 50%; } @@ -1664,6 +1755,11 @@ const TabactiveClick = (a, b) => { } } .responsibilities { + :deep(.el-upload-dragger) { + display: flex; + align-items: center; + justify-content: center; + } .el_responsibilities { display: flex; flex-wrap: wrap; diff --git a/src/views/aftersales/aftersalesWorkOrderInfo.vue b/src/views/aftersales/aftersalesWorkOrderInfo.vue index ba472267..73975941 100644 --- a/src/views/aftersales/aftersalesWorkOrderInfo.vue +++ b/src/views/aftersales/aftersalesWorkOrderInfo.vue @@ -1,53 +1,47 @@