shish 5 цаг өмнө
parent
commit
e72b0a1fc0

+ 84 - 6
ghsApp/src/admin/home/components/OrderItem.vue

@@ -165,12 +165,23 @@
 
     <uni-popup ref="morePopup" background-color="#fff" type="center" :animation="true" class="class-popup-style">
       <view class="more-popup-body">
-        <view class="text-center"><button class="admin-button-com" @click="openPrintLog(item)">打印时间</button></view>
         <view class="text-center"><button class="admin-button-com" @click="openRemarkEdit(item)">备注</button></view>
         <!-- 待付款/已取消不可发起售后,其余跳转售后页 -->
         <view class="text-center" v-if="item.status != 1 && item.status != 5">
           <button class="admin-button-com" @click="goRefund(item)">发起售后</button>
         </view>
+        <!-- 与订单详情一致:待付款/已取消外可无价打印 -->
+        <view class="text-center" v-if="item.status != 1 && item.status != 5">
+          <button class="admin-button-com" @click="printNoPrice(item)">无价打印</button>
+        </view>
+        <!-- 跳转该订单售后记录列表 -->
+        <view class="text-center">
+          <button class="admin-button-com" @click="goRefundList(item)">售后记录</button>
+        </view>
+        <!-- 复制客户地址,文案格式对齐详情页 -->
+        <view class="text-center">
+          <button class="admin-button-com" @click="copyCustom(item)">复制地址</button>
+        </view>
         <block v-if="item.sendStatus == -4 && item.status == 2">
           <view class="text-center"><button class="admin-button-com" @click="callIntraCity(item)">呼叫跑腿</button></view>
         </block>
@@ -180,11 +191,7 @@
         <block v-else-if="[-1, -2].includes(Number(item.sendStatus)) && [2, 3].includes(Number(item.status))">
           <view class="text-center"><button class="admin-button-com" @click="callIntraCity(item)">重叫跑腿</button></view>
         </block>
-        <!--
-        <view class="text-center"><button class="admin-button-com" @click="addExpress(item)">顺丰下单</button></view>
-        <view class="text-center"><button class="admin-button-com" @click="cancelExpress(item)">取消顺丰订单</button></view>
-        <view class="text-center"><button class="admin-button-com" @click="fillNoFh(item)">填单发货</button></view>
-        -->
+        <view class="text-center"><button class="admin-button-com" @click="openPrintLog(item)">打印时间</button></view>
         <view class="text-center"><button class="admin-button-com default" @click="closeMore">取消</button></view>
       </view>
     </uni-popup>
@@ -455,6 +462,77 @@ export default {
       }
       this.$util.pageTo({ url: '/pagesOrder/refund?id=' + item.id });
     },
+    /**
+     * 列表「更多」→ 无价打印。
+     * 与详情页一致传 showPrice:0,不打印金额;已打印过则二次确认补打。
+     */
+    printNoPrice(item) {
+      this.closeMore();
+      if (!item || !item.id) {
+        return;
+      }
+      const that = this;
+      const doPrint = () => {
+        uni.showLoading({ title: '打印中...' });
+        cloudPrintOrder({ id: item.id, showPrice: 0 }).then((res) => {
+          uni.hideLoading();
+          if (res.code == 1) {
+            if (res.data && res.data.hasNoPrint == 1) {
+              that.$util.confirmModal({ content: '请先设置打印机' }, () => {
+                that.$util.pageTo({ url: '/admin/shop/print' });
+              });
+            } else {
+              that.bumpItemCount(item, 'printNum');
+            }
+          }
+        }).catch(() => {
+          uni.hideLoading();
+        });
+      };
+      if (item.printNum && Number(item.printNum) > 0) {
+        this.$util.confirmModal({ content: '确认补打小票?' }, doPrint);
+      } else {
+        doPrint();
+      }
+    },
+    /** 列表「更多」→ 售后记录:按订单号进入售后列表 */
+    goRefundList(item) {
+      this.closeMore();
+      if (!item || !item.orderSn) {
+        return;
+      }
+      this.$util.pageTo({
+        url: '/pagesOrder/refundList',
+        query: { orderSn: item.orderSn }
+      });
+    },
+    /**
+     * 列表「更多」→ 复制地址。
+     * 文案与详情 copyCustom 一致:地址(+展示地址) 客户名 / 店长 手机号。
+     */
+    copyCustom(item) {
+      this.closeMore();
+      if (!item) {
+        return;
+      }
+      const customName = item.customName || '';
+      const customMobile = item.customMobile || '';
+      const customSuper = (item.customSuper && item.customSuper.name)
+        ? item.customSuper.name
+        : (item.customSuperName || '');
+      let address = item.customAddress || item.fullAddress || '';
+      if (!this.$util.isEmpty(item.showAddress) && address != item.showAddress) {
+        address += '(' + item.showAddress + ')';
+      }
+      const val = address + ' ' + customName + '\n' + customSuper + ' ' + customMobile;
+      const self = this;
+      uni.setClipboardData({
+        data: val,
+        success() {
+          self.$msg('复制成功');
+        }
+      });
+    },
     openPrintLog(item) {
       this.closeMore();
       uni.showLoading({ title: '加载中...' });