From 7db491745762b16d4b14d92c1cf999ae36fcb7cb Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期一, 13 十月 2025 16:25:31 +0800
Subject: [PATCH] 显示调整

---
 seller/src/views/order/order/orderDetail.vue |  244 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 239 insertions(+), 5 deletions(-)

diff --git a/seller/src/views/order/order/orderDetail.vue b/seller/src/views/order/order/orderDetail.vue
index fbfd09b..9949108 100644
--- a/seller/src/views/order/order/orderDetail.vue
+++ b/seller/src/views/order/order/orderDetail.vue
@@ -146,7 +146,67 @@
             }}
           </div>
         </div>
+
         </Col>
+        <Col span="24">
+          <!-- 澶栧眰瀹瑰櫒锛氬惊鐜亶鍘� userCheckTemplates 闆嗗悎 -->
+          <div class="check-template-list">
+              <div class="template-item" v-for="(item, index) in orderInfo.userCheckTemplates" :key="item.id">
+                <!-- 2. 妯℃澘鏍囬锛氫粎绗竴涓惊鐜」鏄剧ず templateName锛坕ndex===0 鎺у埗锛� -->
+                <div class="div-item" > <!-- 鍏抽敭锛氫粎棣栭」娓叉煋 -->
+                  <div class="div-item-left">鍟嗗搧妯℃澘锛�</div>
+                  <div class="div-item-right">
+                    {{ item.templateName || '鏃犳ā鏉挎爣棰�' }} <!-- 澶勭悊绌哄�奸粯璁ゆ樉绀� -->
+                  </div>
+                </div>
+                <!-- 4. 閫夋嫨鍥剧墖锛氭覆鏌� chooseImg 瀛楁锛堝鐞� null/绌哄�硷級 -->
+                <div class="div-item">
+                  <div class="div-item-left">妯℃澘鍥剧墖锛�</div>
+                  <div class="div-item-right">
+                    <img
+                      v-if="item.chooseImg"
+                      :src="item.chooseImg"
+                      alt="閫夋嫨鐨勫浘鐗�"
+                      class="selected-img"
+                      style="max-width: 200px; max-height: 150px;"
+                    >
+                    <span v-else>鏃犻�夋嫨鍥剧墖</span> <!-- 鏃犲浘鐗囨椂榛樿鏂囨湰 -->
+                  </div>
+                </div>
+            <!-- 1. 鍟嗗搧妯℃澘锛氭瘡涓惊鐜」閮芥樉绀� subName -->
+            <div class="div-item">
+              <div class="div-item-left">妯℃澘鏍囬锛�</div>
+              <div class="div-item-right">
+                {{ item.subName || '鏃犲晢鍝佹ā鏉垮悕绉�' }} <!-- 澶勭悊绌哄�奸粯璁ゆ樉绀� -->
+              </div>
+            </div>
+
+
+
+            <!-- 3. 鏂囨湰鍐呭锛氬垽鏂� content 鏄�屽浘鐗嘦RL銆嶈繕鏄�岀函鏂囨湰銆� -->
+            <div class="div-item">
+              <div class="div-item-left">{{isUrl(item.content)? '鍥剧墖锛�':'鏂囨湰鍐呭'}}</div>
+              <div class="div-item-right">
+                <!-- 姝e垯鍒ゆ柇锛歝ontent 浠� http/https 寮�澶� 鈫� 娓叉煋鍥剧墖锛涘惁鍒欐覆鏌撴枃鏈� -->
+                <img
+                  v-if="isUrl(item.content)"
+                  :src="item.content"
+                  alt="鍐呭鍥剧墖"
+                  class="content-img"
+                  style="max-width: 200px; max-height: 150px;"
+                >
+                <span v-else>{{ item.content || '鏃犳枃鏈唴瀹�' }}</span> <!-- 绾枃鏈�/绌哄�煎鐞� -->
+              </div>
+            </div>
+
+
+
+            <!-- 鍙�夛細寰幆椤瑰垎闅旂嚎锛屼紭鍖栬瑙� -->
+            <hr v-if="index !== orderInfo.userCheckTemplates.length - 1" style="margin: 15px 0; border: none; border-top: 1px solid #eee;">
+          </div>
+          </div>
+        </Col>
+
       </Row>
     </Card>
 
@@ -527,7 +587,7 @@
       </div>
     </Modal>
     <!--璁㈠崟鍒嗗寘瑁瑰彂璐�-->
-    <Modal v-model="groupShipModal" :loading="shipLoading" title="鍒嗗寘瑁瑰彂蹇��" width="1000">
+    <Modal v-model="groupShipModal" :loading="shipLoading" title="鍒嗗寘瑁瑰彂蹇��" width="1300">
       <div>
         <Form ref="groupOrderDeliveryForm" :model="groupOrderDeliveryForm" :label-width="90" :rules="groupOrderDeliverFormValidate" style="position: relative">
           <FormItem label="鐗╂祦鍏徃" prop="logisticsId">
@@ -571,7 +631,7 @@
           </div>
         </template>
         <template slot="numSlot" slot-scope="{ row, index }">
-          <InputNumber :min="0" :max="row.___num - row.deliverNumber" v-model="data[index].canNum">
+          <InputNumber :min="0" :max="row.___num - row.deliverNumber - row.returnGoodsNumber" v-model="data[index].canNum">
           </InputNumber>
         </template>
       </Table>
@@ -600,6 +660,10 @@
   },
   data () {
     return {
+      // isPreviewVisible: false,
+      // currentPreviewImage: '',
+      // currentPreviewIndex: 0,
+
       loading:false,
       typeList: [],
       showPrices: false,
@@ -760,7 +824,6 @@
             );
           },
         },
-
         {
           title: "鏁伴噺",
           key: "num",
@@ -776,6 +839,55 @@
               this.$options.filters.unitPrice(params.row.flowPrice, "锟�")
             );
           },
+        },
+        {
+          title: "閫�娆炬暟閲�",
+          key: "returnGoodsNumber",
+          minWidth: 80,
+        },
+        {
+          title: "閫�娆鹃噾棰�",
+          key: "refundPrice",
+          minWidth: 80,
+        },
+        {
+          title: "閫�娆剧姸鎬�",
+          key: "isRefund",
+          minWidth: 80,
+          render:(h, params) => {
+            if(params.row.isRefund==='NO_REFUND'){
+              return h(
+                "div",
+                "鏈��娆�"
+              );
+            }else if(params.row.isRefund==='ALL_REFUND'){
+              return h(
+                "div",
+                { style: {color:"red"} },
+                "鍏ㄩ儴閫�娆�"
+              );
+            }else if(params.row.isRefund==='PART_REFUND'){
+              return h(
+                "div",
+                { style: {color:"red"} },
+                "閮ㄥ垎閫�娆�"
+              );
+            }else if(params.row.isRefund==='REFUNDING'){
+              return h(
+                "div",
+                { style: {color:"red"} },
+                "閫�娆句腑"
+              );
+            }
+            else {
+              return h(
+                "div",
+                { style: {color:"red"} },
+                "鏈煡鐘舵��"
+              );
+            }
+
+          }
         },
       ],
       data: [], // 鍟嗗搧琛ㄥ崟鏁版嵁
@@ -807,6 +919,7 @@
 
       // 鍒嗗寘瑁瑰彂璐�
       groupShipModal: false,
+      groupShipModalOpened: false, // 鏍囪瘑鍒嗗寘瑁瑰彂璐у脊绐楁槸鍚﹀凡鎵撳紑杩�
       shipLoading: true,
       groupOrderDeliveryForm: {
         logisticsNo: "", //鍙戣揣鍗曞彿
@@ -849,19 +962,87 @@
             return h("div", this.$options.filters.unitPrice(params.row.subTotal, "锟�"));
           },
         },
+        {
+          title: "閫�娆炬暟閲�",
+          key: "returnGoodsNumber",
+          minWidth: 80,
+        },
+        {
+          title: "閫�娆鹃噾棰�",
+          key: "refundPrice",
+          minWidth: 80,
+        },
+        {
+          title: "閫�娆剧姸鎬�",
+          key: "isRefund",
+          minWidth: 80,
+          render:(h, params) => {
+            if(params.row.isRefund==='NO_REFUND'){
+              return h(
+                "div",
+                "鏈��娆�"
+              );
+            }else if(params.row.isRefund==='ALL_REFUND'){
+              return h(
+                "div",
+                { style: {color:"red"} },
+                "鍏ㄩ儴閫�娆�"
+              );
+            }else if(params.row.isRefund==='PART_REFUND'){
+              return h(
+                "div",
+                { style: {color:"red"} },
+                "閮ㄥ垎閫�娆�"
+              );
+            }else if(params.row.isRefund==='REFUNDING'){
+              return h(
+                "div",
+                { style: {color:"red"} },
+                "閫�娆句腑"
+              );
+            }
+            else {
+              return h(
+                "div",
+                { style: {color:"red"} },
+                "鏈煡鐘舵��"
+              );
+            }
+
+          }
+        },
       ],
       orderPackage: [],
       packageTraceList: []
     };
   },
   methods: {
+    isUrl(str) {
+      if (!str) return false; // 绌哄�肩洿鎺ヨ繑鍥瀎alse
+      // 姝e垯璇存槑锛�
+      // 1. https?:// 锛氭敮鎸乭ttp/https鍗忚
+      // 2. ([\w-]+\.)+ 锛氬厑璁稿瓙鍩熷悕鍖呭惈鐭í绾匡紙濡俵mk-1356772813锛�
+      // 3. [a-zA-Z]{2,} 锛氶《绾у煙鍚嶏紙濡俢om銆乧n锛岃嚦灏�2涓瓧姣嶏級
+      // 4. (\w-./?%&=)* 锛歎RL璺緞/鍙傛暟閮ㄥ垎锛屾敮鎸佸父瑙佸瓧绗�
+      // 5. \.(jpg|jpeg|png|gif|bmp|webp)$ 锛氫粎鍖归厤甯歌鍥剧墖鍚庣紑锛屽拷鐣ュぇ灏忓啓锛坕鏍囧織锛�
+      const imgReg = /^https?:\/\/([\w-]+\.)+[a-zA-Z]{2,}(\/[\w-./?%&=]*)*\.(jpg|jpeg|png|gif|bmp|webp)$/i;
+      return imgReg.test(str);
+    },
     // 閫変腑
     selectGroupShipGoodsMethods (selected) {
+      console.log('selectGroupShipGoodsMethods琚皟鐢�, selected:', JSON.stringify(selected));
+      // 绠�鍖栭�昏緫锛岀洿鎺ヤ繚瀛橀�変腑鐨勫晢鍝侊紝鏁伴噺鍦ㄦ彁浜ゆ椂浠巇ata鏁扮粍鑾峰彇
       this.selectGroupShipGoods = selected;
+      console.log('selectGroupShipGoods宸叉洿鏂�');
     },
     // 鍒嗗寘瑁瑰彂璐�
     groupShip () {
       this.groupShipModal = true;
+      this.groupShipModalOpened = true; // 鏍囪寮圭獥宸叉墦寮�
+      this.groupOrderDeliveryForm = {
+        logisticsNo: "", //鍙戣揣鍗曞彿
+        logisticsId: "", //鐗╂祦鍏徃
+      }
       this.getLogisticsList();
     },
     // 鍒嗛〉鑾峰彇鐗╂祦鍏徃
@@ -874,6 +1055,7 @@
     },
     // 鍒嗗寘瑁瑰彂璐�
     confirmShipGroupGoods () {
+      console.log('琛ㄥ崟鍘熷鏁版嵁--------------------------銆�',JSON.stringify(this.selectGroupShipGoods))
       this.$refs.groupOrderDeliveryForm.validate(async (valid) => {
         if (valid) {
           if (this.selectGroupShipGoods.length) {
@@ -881,16 +1063,33 @@
               ...this.groupOrderDeliveryForm,
               orderSn: this.sn,
               partDeliveryDTOList: this.selectGroupShipGoods.map((item) => {
+                // 鐩存帴浠巇ata鏁扮粍涓幏鍙栨渶鏂扮殑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,
+                  dataCanNum: currentDataItem?.canNum,
+                  num: item.num,
+                  finalDeliveryNum: finalDeliveryNum
+                });
+
                 return {
                   orderItemId: item.id,
-                  deliveryNum: item.canNum ? item.canNum : item.num,
+                  deliveryNum: finalDeliveryNum,
                 };
               }),
             };
+            console.log('---------------------->',JSON.stringify(submit));
             const res = await API_Order.partDelivery(this.sn, submit);
             if (res.success) {
               this.$Message.success("鍙戣揣鎴愬姛!");
               this.shipLoading = false;
+              // 娓呯┖閫変腑鐨勫晢鍝佹暟鎹紝閬垮厤鏁版嵁娈嬬暀
+              this.selectGroupShipGoods = [];
+              // 閲嶇疆寮圭獥鎵撳紑鏍囪瘑锛屼笅娆℃墦寮�鏃舵樉绀洪粯璁ゅ��
+              this.groupShipModalOpened = false;
               this.getDataDetail();
               this.getOrderPackage();
               this.groupShipModal = false;
@@ -987,13 +1186,21 @@
           this.allowOperation = res.result.allowOperationVO;
           if (res.result.orderItems.length) {
             this.data = res.result.orderItems.map((item) => {
+              // 鍙湪寮圭獥鎵撳紑鐘舵�佷笅鎵嶄繚鐣欑敤鎴蜂慨鏀圭殑canNum鍊�
+              const existingItem = this.groupShipModalOpened ? this.data.find(d => d.id === item.id) : null;
+              const defaultCanNum = item.num - item.deliverNumber - item.returnGoodsNumber;
+
               return {
                 ...item,
                 ___num: item.num,
                 _disabled: item.deliverNumber >= item.num,
-                canNum: item.num - item.deliverNumber
+                // 濡傛灉寮圭獥宸叉墦寮�涓旂敤鎴峰凡缁忎慨鏀硅繃canNum涓斿�煎悎鐞嗭紝鍒欎繚鐣欙紱鍚﹀垯浣跨敤榛樿鍊�
+                canNum: (existingItem && existingItem.canNum !== undefined && existingItem.canNum <= defaultCanNum)
+                  ? existingItem.canNum
+                  : defaultCanNum
               };
             });
+            console.log('---------------------->璁㈠崟璇︽儏',this.data)
           }
           this.orderLogData = res.result.orderLogs;
           this.typeList = JSON.parse(JSON.stringify(res.result.order.priceDetailDTO.discountPriceDetail));
@@ -1071,6 +1278,7 @@
       }
     },
     logisticsList () {
+      this.packageTraceList = []
       this.logisticsModal = true;
       API_Order.getPackage(this.sn).then((res) => {
         if (res.success && res.result != null) {
@@ -1447,4 +1655,30 @@
     height: inherit;
   }
 }
+.check-template-list {
+  display: flex;
+  flex-wrap: wrap; // 鍏抽敭锛氬浣欏瓙椤硅嚜鍔ㄦ崲琛�
+  gap: 15px; // 瀛愰」涔嬮棿鐨勯棿璺濓紙姘村钩+鍨傜洿锛�
+  padding: 10px 0; // 涓婁笅鍐呰竟璺濓紝閬垮厤璐磋竟
+  width: 100%; // 鍗犳弧鐖跺鍣紙Col span="12"锛�
+}
+
+// 2. 姣忎釜妯℃澘椤癸細鎺у埗瀹藉害鍜屽崱鐗囨牱寮�
+.template-item {
+  min-width: 280px; // 鏈�灏忓搴︼紝閬垮厤杩囩獎
+  max-width: 350px; // 鏈�澶у搴︼紝闃叉杩囧
+  flex: 1; // 鍚屼竴琛屽瓙椤瑰潎鍖�鍒嗛厤瀹藉害
+  padding: 12px;
+  border: 1px solid #eee;
+  border-radius: 6px;
+  background-color: #fafafa;
+  box-sizing: border-box; // 闃叉padding鎾戝ぇ瀹藉害
+}
+.content-img,
+.selected-img {
+  max-width: 100%; // 閫傚簲瀛愰」瀹藉害
+  max-height: 150px; // 闄愬埗鏈�澶ч珮搴�
+  border-radius: 4px;
+  object-fit: cover; // 淇濇寔鍥剧墖姣斾緥锛屼笉鎷変几
+}
 </style>

--
Gitblit v1.8.0