| | |
| | | console.log("to:",to.fullPath) |
| | | console.log("form:",from.fullPath) |
| | | // 正确打印路由对象的方法 |
| | | if(from.fullPath === "/orderList" && to.fullPath.includes("/order-detail")){ |
| | | if((from.fullPath === "/orderList"|| from.fullPath === "/fictitiousOrderList" ||from.fullPath === "/orderStatistics") && to.fullPath.includes("/order-detail")){ |
| | | this.sn = this.$route.query.sn; |
| | | this.getDataList(); |
| | | this.getOrderPackage(); |
| | |
| | | // 获取订单详情 |
| | | getDataList () { |
| | | this.loading = true; |
| | | console.log("执行获取订单信息操作") |
| | | API_Order.orderDetail(this.sn).then((res) => { |
| | | this.loading = false; |
| | | if (res.success) { |
| | |
| | | ) |
| | | ); |
| | | } |
| | | // 根据订单状态为'PAID'时显示额外操作按钮 |
| | | if (params.row.deliverStatus === 'UNDELIVERED') { |
| | | buttons.push( |
| | | h( |
| | | "Button", |
| | | { |
| | | props: { type: "primary", size: "small" }, |
| | | style: { marginRight: "5px" }, |
| | | on: { |
| | | click: () => { |
| | | this.handlerEditorQrcode(params.row); |
| | | }, |
| | | }, |
| | | }, |
| | | "修改地址二维码" |
| | | ) |
| | | ); |
| | | } |
| | | // // 根据订单状态为'PAID'时显示额外操作按钮 |
| | | // if (params.row.deliverStatus === 'UNDELIVERED') { |
| | | // buttons.push( |
| | | // h( |
| | | // "Button", |
| | | // { |
| | | // props: { type: "primary", size: "small" }, |
| | | // style: { marginRight: "5px" }, |
| | | // on: { |
| | | // click: () => { |
| | | // this.handlerEditorQrcode(params.row); |
| | | // }, |
| | | // }, |
| | | // }, |
| | | // "修改地址二维码" |
| | | // ) |
| | | // ); |
| | | // } |
| | | |
| | | return h('div', buttons); |
| | | }, |
| | |
| | | closeGeneralQrCode(){ |
| | | this.showGeneralQrCode = false; |
| | | }, |
| | | handlerEditorQrcode(row){ |
| | | this.QRCodeUrl = ''; |
| | | this.showGeneralQrCode = true |
| | | this.codeLoading = true; |
| | | |
| | | //获得商品对应的第一个skuid |
| | | this.codeLoading = false; |
| | | this.QRCodeUrl = this.QRcodeBaseUrl+ '/scanpage/editOrderAddress'+'?orderSn='+row.sn |
| | | console.log(this.QRCodeUrl); |
| | | |
| | | }, |
| | | // handlerEditorQrcode(row){ |
| | | // this.QRCodeUrl = ''; |
| | | // this.showGeneralQrCode = true |
| | | // this.codeLoading = true; |
| | | // |
| | | // //获得商品对应的第一个skuid |
| | | // this.codeLoading = false; |
| | | // this.QRCodeUrl = this.QRcodeBaseUrl+ '/scanpage/editOrderAddress'+'?orderSn='+row.sn |
| | | // console.log(this.QRCodeUrl); |
| | | // |
| | | // }, |
| | | // 选中的图片 |
| | | callbackSelected(val) { |
| | | console.log(val) |
| | |
| | | // 直接从data数组中获取最新的canNum值,而不依赖选择时的数据 |
| | | const currentDataItem = this.data.find(d => d.id === item.id); |
| | | const finalDeliveryNum = currentDataItem ? currentDataItem.canNum : item.num; |
| | | |
| | | |
| | | console.log('处理商品项:', { |
| | | id: item.id, |
| | | selectedCanNum: item.canNum, |
| | |
| | | num: item.num, |
| | | finalDeliveryNum: finalDeliveryNum |
| | | }); |
| | | |
| | | |
| | | return { |
| | | orderItemId: item.id, |
| | | deliveryNum: finalDeliveryNum, |
| | |
| | | // 只在弹窗打开状态下才保留用户修改的canNum值 |
| | | const existingItem = this.groupShipModalOpened ? this.data.find(d => d.id === item.id) : null; |
| | | const defaultCanNum = item.num - item.deliverNumber; |
| | | |
| | | |
| | | return { |
| | | ...item, |
| | | ___num: item.num, |
| | | _disabled: item.deliverNumber >= item.num, |
| | | // 如果弹窗已打开且用户已经修改过canNum且值合理,则保留;否则使用默认值 |
| | | canNum: (existingItem && existingItem.canNum !== undefined && existingItem.canNum <= defaultCanNum) |
| | | ? existingItem.canNum |
| | | canNum: (existingItem && existingItem.canNum !== undefined && existingItem.canNum <= defaultCanNum) |
| | | ? existingItem.canNum |
| | | : defaultCanNum |
| | | }; |
| | | }); |