DESKTOP-T5C0CIA\lhch 2 月之前
父节点
当前提交
af47c9d0e6

+ 4 - 4
admin-ui/.env.development

@@ -5,10 +5,10 @@ VUE_APP_TITLE = 一七管理系统
 ENV = 'development'
 
 
-VUE_APP_BASE_API_HOST = 'http://127.0.0.1:9801'
-VUE_APP_BASE_API = 'http://127.0.0.1:9801'
-# VUE_APP_BASE_API_HOST = 'http://139.224.65.227:8091/prod-api'
-# VUE_APP_BASE_API = 'http://139.224.65.227:8091/prod-api'
+# VUE_APP_BASE_API_HOST = 'http://127.0.0.1:9801'
+# VUE_APP_BASE_API = 'http://127.0.0.1:9801'
+VUE_APP_BASE_API_HOST = 'http://139.224.65.227:8091/prod-api'
+VUE_APP_BASE_API = 'http://139.224.65.227:8091/prod-api'
 # VUE_APP_BASE_API_HOST = 'http://192.168.98.9:9801'
 # VUE_APP_BASE_API = 'http://192.168.98.9:9801/'
 

+ 41 - 13
admin-ui/src/components/payStatusPopup/index.vue

@@ -114,6 +114,8 @@ import { getLodop } from '@/utils/lodopUtils'
 import { getClothItem, listOrderClothItem } from '@/api/order/clothItem'
 import { getMemberInfoById } from '@/api/app/user'
 import { clothOrderPay, getOrderPayResult } from '@/api/order/cloth'
+import { getUserProfile } from "@/api/system/user";
+import { getStore } from '@/api/system/store'
 
 export default {
   props: {
@@ -177,25 +179,29 @@ export default {
       this.show = true
     },
     open(type, info, appUserInfo = null) {
+      console.log(JSON.stringify(info))
       this.orderInfo = info
       this.type = type
       this.showPaySuccessBtn = false
-      console.log(this.type)
+      // this.pointerInfo = info
+      if (info.id && !this.hidePointer) {
+        this.getClothItemInfo(info)
+      }
+      console.log(this.type, appUserInfo)
+      if (appUserInfo) {
+          this.appUserInfo = appUserInfo
+        }
       if (type == 0) {
         //微信支付宝支付
         this.payType = 0
         this.authCode = info.authCode
         this.showPaySuccessBtn = false
-        if (appUserInfo) {
-          this.appUserInfo = appUserInfo
-        }
+       
         console.log('aasss', this.appUserInfo)
         this.pay()
       }
       if (type == 1) {
-        if (info.id && !this.hidePointer) {
-          this.getClothItemInfo(info)
-        }
+       
       }
       if (type == 2) {
         //现金支付
@@ -285,14 +291,36 @@ export default {
           p_name = pointer.printName
         }
       })
+      console.log(this.pointerList, p_name)
+      getStore(this.orderInfo.orgId).then(res => {
+        console.log("AAA", res)
+        this.pointerInfo.sysOrg = res.data
+        // this.pointerInfo.orgName = res.data.name
+        this.pointerInfo.memberPrice = this.appUserInfo.rechargeBalance
+        this.pointerInfo.orderClothPrice = this.orderInfo.orderClothPrice
+        this.pointerInfo.planSendToUserTime = this.orderInfo.planSendToUserTime
+        this.pointerInfo.contactName = this.orderInfo.contactName
+        this.pointerInfo.contactPhone = this.orderInfo.contactPhone
+        this.pointerInfo.payType = this.orderInfo.payType
+        this.pointerInfo.payTimeType = this.orderInfo.payTimeType
+        console.log(this.appUserInfo)
+        if (this.appUserInfo.defaultAddress) {
+          this.pointerInfo.province = this.appUserInfo.defaultAddress.province
+          this.pointerInfo.city = this.appUserInfo.defaultAddress.city
+          this.pointerInfo.area = this.appUserInfo.defaultAddress.area
+          this.pointerInfo.address = this.appUserInfo.defaultAddress.address
+          this.pointerInfo.addressDetail = this.appUserInfo.defaultAddress.addressDetail
+        }
+        if (type == 0) {
+          this.collectClothPrinter(this.LODOP, this.pointerInfo, p_name)
+        } else {
+          this.barCodePrinter(this.LODOP, this.pointerInfo, p_name)
+        }
 
-      if (type == 0) {
-        this.collectClothPrinter(this.LODOP, this.pointerInfo, p_name)
-      } else {
-        this.barCodePrinter(this.LODOP, this.pointerInfo, p_name)
-      }
+        // this.show = false
+      })
 
-      this.show = false
+     
     },
 
     // 获取打印数据

+ 26 - 18
admin-ui/src/utils/index.js

@@ -416,7 +416,7 @@ export function collectClothPrinter(LODOP, data, lodopName) {
   //这里3表示纵向打印且纸高“按内容的高度”;800表示纸宽80mm;45表示页底空白4.5mm
 
   // 设置打印内容
-  LODOP.ADD_PRINT_TEXT(30, 95, 150, 20, `一七生活 ${data.sysOrg.name}`);
+  LODOP.ADD_PRINT_TEXT(30, 95, 150, 20, `一七生活 ${data.orgName}`);
   LODOP.ADD_PRINT_TEXT(55, 135, 50, 20, '收衣单');
 
   // 开始绘制虚线
@@ -428,9 +428,9 @@ export function collectClothPrinter(LODOP, data, lodopName) {
   LODOP.ADD_PRINT_BARCODE(110, 30, 250, 80, '128B', data.orderNo);
   LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0);
 
-  LODOP.ADD_PRINT_TEXT(200, 50, 300, 20, `收衣日期:${data.takeClothTime?data.takeClothTime:'--'}`);
+  LODOP.ADD_PRINT_TEXT(200, 50, 300, 20, `收衣日期:${data.createTime?data.createTime:'--'}`);
 
-  LODOP.ADD_PRINT_TEXT(230, 50, 300, 20, `预计取衣时间:${data.planSendToUserTime?data.planSendToUserTime:'--'}`);
+  LODOP.ADD_PRINT_TEXT(230, 50, 300, 20, `预计取衣时间:${data.planSendClothTime?data.planSendClothTime:'--'}`);
 
   LODOP.ADD_PRINT_LINE(255, 10, 255, 295, 1, 1);
 
@@ -439,8 +439,8 @@ export function collectClothPrinter(LODOP, data, lodopName) {
   LODOP.ADD_PRINT_LINE(285, 10, 285, 295, 1, 1);
 
   const top = 305;
-  for(var i = 0; i < data.orderClothItemVOS.length; i++) {
-    let item = data.orderClothItemVOS[i];
+  for(var i = 0; i < data.orderClothDetails.length; i++) {
+    let item = data.orderClothDetails[i];
     let _name = ''
     item.orderClothColors.forEach(col_n=>{
       _name += '-'+col_n.clothColorName
@@ -448,24 +448,27 @@ export function collectClothPrinter(LODOP, data, lodopName) {
     _name = item.clothItemName+_name
     let _flaws = ''
     item.orderClothFlaws.forEach(item_n=>{
-      _flaws += item_n.clothFlawTypeName+';'
+      _flaws += item_n.clothFlawName+';'
     })
     LODOP.ADD_PRINT_TEXT(top + i * 30, 20, 50, 20, i+1);
     LODOP.ADD_PRINT_TEXT(top + i * 30, 45, 110, 20, _name);
-    LODOP.ADD_PRINT_TEXT(top + i * 30, 165, 40, 20, `${item.price}元`);
+    LODOP.ADD_PRINT_TEXT(top + i * 30, 165, 40, 20, `${item.totalPrice}元`);
     LODOP.ADD_PRINT_TEXT(top + i * 30, 200, 110, 20, _flaws);
   }
 
-  const height = top + (data.orderClothItemVOS.length+1)*20;
+  const height = top + (data.orderClothDetails.length+1)*20;
   // 合计
-  LODOP.ADD_PRINT_TEXT(height + 15, 10, 150, 20, `合计:${data.orderClothItemVOS.length}件`);
-  LODOP.ADD_PRINT_TEXT(height + 15, 160, 150, 20, `总金额:${data.orderClothPrice}元`);
+  LODOP.ADD_PRINT_TEXT(height + 15, 10, 150, 20, `合计:${data.orderClothDetails.length}件`);
+  LODOP.ADD_PRINT_TEXT(height + 15, 160, 150, 20, `总金额:${data.totalPrice}元`);
 
   LODOP.ADD_PRINT_LINE(height + 35, 10, height + 35, 295, 1, 1);
 
   //金额
   let payTypename = '';
-  if(data.payType == '0'){
+  let thisPrice = 0
+  if (data.payTimeType == 1) {
+    payTypename = '取衣付款 '
+  } else if(data.payType == '0'){
     payTypename = '微信 '
   }else if(data.payType == '1'){
     payTypename = '支付宝 '
@@ -473,29 +476,34 @@ export function collectClothPrinter(LODOP, data, lodopName) {
     payTypename = '现金 '
   }else if(data.payType == '3'){
     payTypename = '余额 '
+    thisPrice = data.payAmount
   }
 
+
+
   LODOP.ADD_PRINT_TEXT(height + 45, 10, 150, 20, `付款方式:${payTypename}`);
   LODOP.ADD_PRINT_TEXT(height + 45, 160, 150, 20, `会员金额:${data.memberPrice?data.memberPrice+'元':''}`);
-  LODOP.ADD_PRINT_TEXT(height + 75, 10, 150, 20, `本次扣款:${data.thisPrice?data.thisPrice+'元':''}`);
-  LODOP.ADD_PRINT_TEXT(height + 75, 160, 150, 20, `会员余额:${data.totalPrice?data.totalPrice-data.thisPrice?data.thisPrice:0 +'元':''}`);
+  LODOP.ADD_PRINT_TEXT(height + 75, 10, 150, 20, `本次扣款:${thisPrice?thisPrice+'元':''}`);
+  LODOP.ADD_PRINT_TEXT(height + 75, 160, 150, 20, `会员余额:${data.memberPrice?data.memberPrice-thisPrice?thisPrice:0 +'元':''}`);
 
   LODOP.ADD_PRINT_TEXT(height + 105, 10, 150, 20, `客户:${data.contactName}`);
   LODOP.ADD_PRINT_TEXT(height + 105, 160, 180, 20, `客户电话:${data.contactPhone}`);
   LODOP.ADD_PRINT_TEXT(height + 135, 10, 300, 20, `客户地址:${data.province+data.city+data.area+data.address+data.addressDetail}`);
 
   LODOP.ADD_PRINT_LINE(height + 160, 10, height + 160, 295, 1, 1);
-  LODOP.ADD_PRINT_TEXT(height + 170, 10, 300, 20, `本店地址:${data.sysOrg.address?+data.sysOrg.addressDetail:''}`);
+  LODOP.ADD_PRINT_TEXT(height + 170, 10, 300, 20, `本店地址:${data.sysOrg.address?data.sysOrg.address:''}${data.sysOrg.addressDetail?data.sysOrg.addressDetail:''}`);
   LODOP.ADD_PRINT_TEXT(height + 200, 10, 300, 20, `联系电话:${data.sysOrg.contactPhone}`);
 
-  LODOP.ADD_PRINT_TEXT(height + 230, 10, 180, 20, `营业时间:${data.sysOrg.time?data.sysOrg.time:''}`);
-  LODOP.ADD_PRINT_TEXT(height + 230, 200, 120, 20, `员工:${data.sysOrg.user?data.sysOrg.user:''}`);
+  LODOP.ADD_PRINT_TEXT(height + 230, 10, 180, 20, `营业时间:${data.sysOrg.businessStartTime?data.sysOrg.businessStartTime:''}-${data.sysOrg.businessEndTime?data.sysOrg.businessEndTime:''}`);
+  LODOP.ADD_PRINT_TEXT(height + 230, 200, 120, 20, `员工:${data.createBy?data.createBy:''}`);
 
   LODOP.ADD_PRINT_LINE(height + 255, 10, height + 255, 295, 1, 1);
   LODOP.ADD_PRINT_TEXT(height + 265, 10, 300, 20, `订单备注:${data.remark?data.remark:''}`);
   LODOP.ADD_PRINT_TEXT(height + 300, 10, 300, 50, `客户签名:`);
-
+  console.log('aaa', this.LODOP.SET_PRINTER_INDEXA(lodopName))
   if (this.LODOP.SET_PRINTER_INDEXA(lodopName))
+    console.log('aaa22')
+
   // this.LODOP.PREVIEW(); //打印预览
   this.LODOP.PRINT(); //直接打印
 }
@@ -654,7 +662,7 @@ export function barCodePrinter(LODOP, data, lodopName){
   // 设置打印模板
   LODOP.SET_PRINT_PAGESIZE(3, 1016, 45, '');
   //这里3表示纵向打印且纸高“按内容的高度”;800表示纸宽80mm;45表示页底空白4.5mm
-
+  console.log(data)
   const top = 20;
   for(var i = 0; i < data.orderClothDetails.length; i++) {
     let item = data.orderClothDetails[i];

+ 16 - 2
admin-ui/src/views/order/cloth/collectCloth.vue

@@ -543,6 +543,15 @@
                 </el-table-column>
             </el-table>
         </el-dialog>
+
+        <pay-status-popup
+                ref="payStatusPopup"
+                :hide-pointer="false"
+                :hide-user="false"
+                @pay-success="handlePaySuccess"
+                @confirm="handleConfirm"
+                @close="handleConfirm"
+            />
     </div>
 </template>
 
@@ -569,10 +578,12 @@ import { allBrand } from '../../../api/cloth/brand'
 import { getCouponItemlistByAppUserId, getDiscountByStoreId } from '../../../api/coupon/item'
 import { add, multi, minute, sub } from '../../../utils/math'
 import request from '@/utils/request'
+import PayStatusPopup from '@/components/payStatusPopup'
+
 
 export default {
     name: 'CollectCloth',
-    components: { CashCloth, payStatusPopup },
+    components: { CashCloth, payStatusPopup, PayStatusPopup },
     dicts: ['sys_yes_no', 'cloth_type', 'cloth_send_type'],
     data() {
         return {
@@ -1464,6 +1475,9 @@ export default {
         },
 
         async handleConfirmPay() {
+            // let obj = {"isSpecial":"Y","isAppointment":"N","authCode":"","payType":"2","appUserId":"82034","orderClothItemDTOS":[{"orderClothCraftDTOS":[{"clothCraftId":7,"clothCraftName":"毛毛领","price":20,"isSelect":true}],"orderClothAdjunctDTOS":[{"adjunctId":7,"num":1,"adjunctName":"毛领"}],"orderClothTypeDTOS":[],"clothTypeKeys":[],"specialPrice":0,"clothSpeedMultiple":1,"picNum":0,"isCustomPrice":"N","remark":"","defaultPrice":0,"clothWashModeId":2,"clothWashModeName":"水洗","clothItemId":7168,"id":7168,"name":"文胸","typeId":14,"washId":2,"washName":"水洗","unit":"件","isChangePrice":"N","isCalArea":"N","isSpecial":"N","plusPrice":0,"silkPrice":0,"sheepPrice":0,"childPrice":0,"orderClothColorDTOS":[{"clothColorId":1205,"clothColorName":"银色"}],"clothBrandId":16,"clothBrandName":"耐克","orderClothFlawDTOS":[{"clothFlawId":724,"clothFlawName":"油斑油迹"}],"isHedging":"N","clothSpeedId":1,"index":0,"deductAmount":0,"totalPrice":20,"clothItemName":"文胸"}],"orderCouponDTOS":[],"payTimeType":"0","createById":"105","createBy":"storeAdmin","createTime":"2025-04-10 23:09:18","id":"349","orderNo":"CL1107846939908640768","orderType":"0","orgId":"4","sourceType":"02","factoryId":"1","contactName":"赵策","contactPhone":"13312341234","orderAmount":20,"orderClothPrice":20,"orderClothCount":1,"payAmount":20,"payStatus":"0","orderSource":"OFFLINE","orderStatus":"4","setPriceTime":"2025-04-10 23:09:18","planSendToUserTime":"2025-04-15 23:09:18","takeClothWay":"0","cashDeductAmount":0,"clothSpeedId":"1","clothSpeedName":"普洗","deliveryAmount":0}
+            // this.$refs.payStatusPopup.open(1, obj, this.appUserInfo);
+            // return
             if (this.orderClothItemDTOS.length == 0) {
                 this.$message.error('请先添加衣服')
                 return
@@ -1501,7 +1515,7 @@ export default {
             this.orderForm.isSpecial = 'N'
             this.orderForm.authCode = ''
             this.orderForm.payType = ''
-            this.orderForm.sendClothWay = '0'
+            // this.orderForm.sendClothWay = '0'
             getDiscountByStoreId({ appUserId: this.appUserInfo.id }).then((res) => {
                 this.discountCouponVOS = res.data
                 params.discountWay = '0'

+ 14 - 5
admin-ui/src/views/order/cloth/component/cashCloth.vue

@@ -55,7 +55,8 @@
                         </el-card>
 
                         <!-- 支付方式选择 -->
-                        <el-card class="payment-card" v-if="orderForm.isAppointment === 'N'">
+                        <!-- v-if="orderForm.isAppointment === 'N'" -->
+                        <el-card class="payment-card" >
                             <div class="card-header">
                                 <span class="title">收款方式</span>
                             </div>
@@ -82,7 +83,8 @@
                     </div>
 
                     <!-- 右侧优惠信息区域 -->
-                    <div class="discount-section" v-if="orderForm.isAppointment === 'N'">
+                    <!-- v-if="orderForm.isAppointment === 'N'" -->
+                    <div class="discount-section" >
                         <el-card class="discount-card">
                             <el-tabs v-model="confirmCouponTabIndex" type="border-card">
                                 <!-- 优惠券 tab -->
@@ -767,17 +769,24 @@ export default {
                         background: 'rgba(0, 0, 0, 0.7)'
                     });
 
+                    console.log(params)
+                    console.log(JSON.stringify(params))
+                    
+                    console.log(this.orderForm)
+                    console.log(JSON.stringify(this.orderForm))
+
                     collectCloth(params)
                         .then(res => {
                             loading.close();
                             // 直接打开支付状态弹窗,不需要延时
                           //0=微信,1=支付宝,2=现金,3=余额
                             if (this.orderForm.payType === '0') {
-                                this.$refs.payStatusPopup.open(0, res.data, this.appUserInfo);
+                                res.data.authCode = this.orderForm.authCode
+                                this.$refs.payStatusPopup.open(0, {...params, ...res.data}, this.appUserInfo);
                             } else if (this.orderForm.payType === '2') {
-                                this.$refs.payStatusPopup.open(2, res.data);
+                                this.$refs.payStatusPopup.open(2, {...params, ...res.data});
                             } else if (this.orderForm.payType === '3') {
-                              this.$refs.payStatusPopup.open(3, res.data);
+                              this.$refs.payStatusPopup.open(3, {...params, ...res.data});
                             }
                         })
                         .catch(e => {