Browse Source

修改支付logo,出库单

yangg 1 year ago
parent
commit
d6991ef01f

+ 12 - 0
manager-admin/src/views/basicSetting/collectingAccount/index.vue

@@ -78,6 +78,18 @@
         <el-form-item label="名称" prop="name">
           <el-input v-model="collectingAccountForm.name" :maxlength="20" clearable placeholder="请输入支付方式名称"></el-input>
         </el-form-item>
+        <el-form-item label="抬头" prop="invoice">
+          <el-input v-model="collectingAccountForm.invoice" :maxlength="20" clearable placeholder="请输入抬头"></el-input>
+        </el-form-item>
+        <el-form-item label="税号" prop="duty_paragraph">
+          <el-input v-model="collectingAccountForm.duty_paragraph" :maxlength="20" clearable placeholder="请输入税号"></el-input>
+        </el-form-item>
+        <el-form-item label="开户行" prop="bank">
+          <el-input v-model="collectingAccountForm.bank" :maxlength="20" clearable placeholder="请输入开户行"></el-input>
+        </el-form-item>
+        <el-form-item label="银行账号" prop="bank_no">
+          <el-input v-model="collectingAccountForm.bank_no" :maxlength="20" clearable placeholder="请输入银行账号"></el-input>
+        </el-form-item>
         <el-form-item label="是否默认" prop="default_flag">
           <el-radio-group v-model="collectingAccountForm.default_flag">
             <el-radio :label="true">是</el-radio>

+ 10 - 5
manager-admin/src/views/basicSetting/goods/index.vue

@@ -180,13 +180,8 @@ export default {
     };
   },
   mounted() {
-    //this.rowDrop();
     this.GET_ProductList();
     this.GET_Category();
-    this.$nextTick(() => {
-      // 确保组件已渲染
-      console.log(this.$refs.categoryTree);
-    });
     this.timer = setInterval(function () {
       document.querySelectorAll(".el-cascader-node__label").forEach((el) => {
         el.onclick = function () {
@@ -488,6 +483,16 @@ export default {
       });
     },
   },
+  watch: {
+    $route: {
+      immediate: true,
+      handler(newVal) {
+        if (newVal.name === "productFile") {
+          this.GET_ProductList();
+        }
+      },
+    },
+  },
 };
 </script>
 

+ 112 - 54
manager-admin/src/views/stock/goodsExchange/addInventory.vue

@@ -3,12 +3,13 @@
     <el-form ref="goodsExchangeAddForm" :model="goodsExchangeAddForm" :rules="goodsExchangeAddFormRule"
       label-width="160px" inline class="change-form">
       <el-form-item label="订单" prop="order_id" class="change-form-item">
-        <span>
+        {{ goodsExchangeAddForm.sn }}
+        <!-- <span>
           <el-input v-model="goodsExchangeAddForm.sn" ref="order" @keyup.enter.native="blurUsername()">
           </el-input>
           <el-button @click="blurUsername()">搜索</el-button>
           <el-button @click="orderBtn">订单列表</el-button>
-        </span>
+        </span> -->
       </el-form-item>
       <el-form-item prop="warehouse_id" label="入库仓库" class="change-form-item">
         <el-select v-model="goodsExchangeAddForm.warehouse_id" clearable
@@ -33,7 +34,8 @@
         <h3>商品明细</h3>
         <el-button class="button" size="mini" type="primary" v-if="type !== 'detail' && type !== 'audit'"
           @click="scanCode">扫码入库</el-button>
-        <el-button class="button" size="mini" type="primary" v-if="type !== 'detail' && type !== 'audit'"
+        <el-button class="button" size="mini" type="primary"
+          v-if="type !== 'detail' && type !== 'audit' && goodsExchangeAddForm.type !== 'TRANSFER_ENTRY' && goodsExchangeAddForm.type !== 'HAIL_ENTRY' && goodsExchangeAddForm.type !== 'SALE_AFTER'"
           @click="handleSelectWarehouseEntryBatch">选择</el-button>
       </div>
       <div style="width: 100%; display: block">
@@ -92,13 +94,24 @@
                 <span v-else>{{ scope.row.product_vo.unit }}</span>
               </template>
             </el-table-column>
-            <!--  <el-table-column label="订单数量">
 
-            </el-table-column> -->
-            <el-table-column label="入库数量">
+
+            <el-table-column label="入库数量" width="155">
               <template slot-scope="scope">
                 <el-input-number v-model="scope.row.num" type="number" :min="0" :maxlength="20"
-                  :disabled="type === 'detail' || type === 'audit'"></el-input-number>
+                  :disabled="type === 'detail' || type === 'audit' || goodsExchangeAddForm.type == 'TRANSFER_ENTRY' || goodsExchangeAddForm.type == 'HAIL_ENTRY' || goodsExchangeAddForm.type == 'SALE_AFTER'"></el-input-number>
+              </template>
+            </el-table-column>
+            <el-table-column prop="entry_num" label="已入库数量"
+              v-if="goodsExchangeAddForm.type == 'TRANSFER_ENTRY' || goodsExchangeAddForm.type == 'HAIL_ENTRY' || goodsExchangeAddForm.type == 'SALE_AFTER'">
+              <template slot-scope="scope">
+                {{ scope.row.entry_num }}
+              </template>
+            </el-table-column>
+            <el-table-column prop="not_entry_num" label="未入库数量"
+              v-if="goodsExchangeAddForm.type == 'TRANSFER_ENTRY' || goodsExchangeAddForm.type == 'HAIL_ENTRY' || goodsExchangeAddForm.type == 'SALE_AFTER'">
+              <template slot-scope="scope">
+                {{ scope.row.not_entry_num }}
               </template>
             </el-table-column>
             <el-table-column label="订单数量"
@@ -121,10 +134,11 @@
               <template slot-scope="scope">
                 <span v-if="scope.row.order_num">{{
                   scope.row.num - scope.row.order_num || 0
-                }}</span>
+                  }}</span>
               </template>
             </el-table-column>
-            <el-table-column label="操作" v-if="type !== 'detail' && type !== 'audit'">
+            <el-table-column label="操作"
+              v-if="type !== 'detail' && type !== 'audit' && goodsExchangeAddForm.type !== 'TRANSFER_ENTRY' && goodsExchangeAddForm.type !== 'HAIL_ENTRY' && goodsExchangeAddForm.type !== 'SALE_AFTER'">
               <template slot-scope="scope">
                 <!-- <el-button
                   size="mini"
@@ -145,8 +159,9 @@
       </el-button>
       <el-button v-if="type === 'audit'" type="danger" @click="dialogVisible = true">审核驳回
       </el-button> -->
-      <el-button v-if="type !== 'audit' && type !== 'detail' && checkPermission(['warehouseEntry2:add'])" type="primary"
-        @click="savegoodsExchangeAddForm">保存
+      <el-button
+        v-if="type !== 'audit' && type !== 'detail' && checkPermission(['warehouseEntry2:add']) && goodsExchangeAddForm.type !== 'TRANSFER_ENTRY' && goodsExchangeAddForm.type !== 'HAIL_ENTRY' && goodsExchangeAddForm.type !== 'SALE_AFTER'"
+        type="primary" @click="savegoodsExchangeAddForm">保存
       </el-button>
       <el-button v-if="type !== 'audit' && type !== 'detail' && checkPermission(['warehouseEntry:update'])"
         type="primary" @click="submitgoodsExchangeAddForm">入库
@@ -239,7 +254,7 @@
         <el-table-column prop="order_time" label="下单时间">
           <template slot-scope="scope">{{
             scope.row.order_time | unixToDate
-          }}</template>
+            }}</template>
         </el-table-column>
         <el-table-column prop="" label="仓库名称">
           <template slot-scope="scope">
@@ -249,7 +264,7 @@
         <el-table-column prop="" label="配送方式">
           <template slot-scope="scope">{{
             deliveryType(scope.row.send_type)
-          }}</template>
+            }}</template>
         </el-table-column>
         <!-- <el-table-column prop="pay_type" label="付款方式">
           <template slot-scope="scope">{{
@@ -259,7 +274,7 @@
         <el-table-column prop="" label="实付金额">
           <template slot-scope="scope">{{
             "¥" + scope.row.pay_price
-          }}</template>
+            }}</template>
         </el-table-column>
         <!-- <el-table-column prop="" label="订单状态">
           <template slot-scope="scope">
@@ -466,9 +481,9 @@ export default {
     };
   },
   mounted() {
-    this.$nextTick(() => {
+    /* this.$nextTick(() => {
       this.$refs.order.focus();
-    });
+    }); */
     this.routeName = this.$route.name;
     this.sttorageType = this.$route.params.type;
     this.GET_WarehouseList();
@@ -582,6 +597,9 @@ export default {
         if (this.TO_BE_RETURN == 'TO_BE_RETURN') {
           if (this.goodsExchangeAddForm.product_list[this.index].num >= this.goodsExchangeAddForm.product_list[this.index].stock_num) return this.$message.warning("录入数量大于在途库存!")
         }
+        if (this.goodsExchangeAddForm.type == 'TRANSFER_ENTRY' || this.goodsExchangeAddForm.type == 'HAIL_ENTRY' || this.goodsExchangeAddForm.type == 'SALE_AFTER') {
+          if (this.goodsExchangeAddForm.product_list[this.index].num >= this.goodsExchangeAddForm.product_list[this.index].not_entry_num) return this.$message.warning("录入数量大于未入库数量!")
+        }
         this.goodsExchangeAddForm.product_list[this.index].num =
           this.goodsExchangeAddForm.product_list[
             this.index
@@ -840,44 +858,72 @@ export default {
     },
     // 打印功能
     printIng() { },
-    /* 扫条码 */
+    /* 扫SKU */
     toSearch() {
       API_GoodsExchange.getProduct(
         this.goodsExchangeAddForm.warehouse_id,
         this.scanGoodsForm.bar_code.replace(/\s+/g, '')
       ).then((res) => {
+        if (!res) {
+          return this.$message.error("未找到商品信息");
+        }
+
         res.sn_code_list = [];
         this.sku = res.product_vo.sku;
+
         // 查找当前商品是否已存在于列表中
-        const indexs = this.goodsExchangeAddForm.product_list.findIndex(
-          (el) => {
-            console.log("Comparing with:", el);
-            return (
-              el.goods_id === res.goods_id &&
-              el.product_id === res.product_id &&
-              el.warehouse_id === res.warehouse_id &&
-              el.product_vo.sku === res.product_vo.sku
-            );
-          }
-        );
+        const indexs = this.goodsExchangeAddForm.product_list.findIndex((el) => {
+          return (
+            el.goods_id === res.goods_id &&
+            el.product_id === res.product_id &&
+            el.product_vo.sku === res.product_vo.sku
+          );
+        });
+
         // 如果商品不存在,则添加到列表
         if (indexs === -1) {
           this.index = this.goodsExchangeAddForm.product_list.length;
-          this.goodsExchangeAddForm.product_list.push(res);
+          if (
+            this.goodsExchangeAddForm.type === 'TRANSFER_ENTRY' ||
+            this.goodsExchangeAddForm.type === 'HAIL_ENTRY' ||
+            this.goodsExchangeAddForm.type === 'SALE_AFTER'
+          ) {
+            this.goodsExchangeAddForm.product_list.push({ ...res, num: 1 });
+          } else {
+            return this.$message.warning("请扫描订单内的商品!");
+          }
         } else {
           this.index = indexs;
         }
+
         if (res.product_vo.have_sn) {
           this.$nextTick(() => {
             this.$refs.sn_input.focus();
           });
         } else {
-          if (this.TO_BE_RETURN == 'TO_BE_RETURN') {
-            if (this.goodsExchangeAddForm.product_list[this.index].num >= this.goodsExchangeAddForm.product_list[this.index].stock_num) return this.$message.warning("录入数量大于在途库存!")
+          const currentProduct = this.goodsExchangeAddForm.product_list[this.index];
+
+          if (this.TO_BE_RETURN === 'TO_BE_RETURN') {
+            if (currentProduct.num >= currentProduct.stock_num) {
+              return this.$message.warning("录入数量大于在途库存!");
+            }
           }
-          this.goodsExchangeAddForm.product_list[this.index].num += 1
-          /* this.scanDialogVisible = false; */
+
+          if (
+            this.goodsExchangeAddForm.type === 'TRANSFER_ENTRY' ||
+            this.goodsExchangeAddForm.type === 'HAIL_ENTRY' ||
+            this.goodsExchangeAddForm.type === 'SALE_AFTER'
+          ) {
+            if (currentProduct.num >= currentProduct.not_entry_num) {
+              return this.$message.warning("录入数量大于未入库数量!");
+            }
+          }
+
+          this.$set(this.goodsExchangeAddForm.product_list[this.index], 'num', currentProduct.num + 1);
         }
+      }).catch((error) => {
+        console.error("API 调用失败:", error);
+        this.$message.error("获取商品信息失败");
       });
     },
     // 扫码入库
@@ -1062,8 +1108,10 @@ export default {
     },
     //入库
     submitgoodsExchangeAddForm() {
+
       this.$refs["goodsExchangeAddForm"].validate((valid) => {
         if (valid) {
+
           const { id } = this.goodsExchangeAddForm;
           const params = this.MixinClone(this.goodsExchangeAddForm);
           params.handled_by = this.deptListAll;
@@ -1090,12 +1138,14 @@ export default {
             this.$message.error("请选择商品!");
             return;
           }
-          params.product_list.map((el) => {
-            el.product_stock_id = el.id;
-            el.product_id = el.product_vo.id;
-            el.id = "";
-          });
-          /* */ if (this.$route.name === "editInventory") {
+          /* let numReturn = false
+          params.product_list.map(el => {
+            if (el.num > el.not_entry_num) {
+              numReturn = true
+            }
+          })
+          if(numReturn) return */
+          if (this.$route.name === "editInventory") {
             /* params.contract_product_list.map(el=>{
             el.product_id=el.id
             el.goods_id=el.id
@@ -1120,6 +1170,11 @@ export default {
               }
             );
           } else if (this.$route.name === "addInventory") {
+            params.product_list.map((el) => {
+              el.product_stock_id = el.id;
+              el.product_id = el.product_vo.id;
+              el.id = "";
+            });
             // 新增入库
             API_GoodsExchange.warehouseEntry(params).then(() => {
               this.$message.success("添加成功!");
@@ -1285,25 +1340,28 @@ export default {
             this.goodsExchangeAddForm.change_time * 1000
           );
           /* 获取缓存数据 */
-          API_GoodsExchange.skuRedis({ send_order_id: this.id, type: 'enter' }).then(response => {
-            response.product_list.map((el) => {
+          response.product_list.map((el) => {
+            if (response.type !== 'SALE_AFTER') {
               el.return_num = el.num
-              Object.keys(response).map(item => {
-                if (el.id == item) {
-                  el.sn_code_list = response[item]
-                  el.num = el.sn_code_list.length
-                }
-              })
-              if (!el.sn_code_list) {
-                el.sn_code_list = [];
-              }/*  else {
+            }
+
+            /* Object.keys(response).map(item => {
+              if (el.id == item) {
+                el.sn_code_list = response[item]
                 el.num = el.sn_code_list.length
-              } */
-            });
-          })
+              }
+            }) */
+            el.num = 0
+            if (!el.sn_code_list) {
+              el.sn_code_list = [];
+            } else {
+              el.num = el.sn_code_list.length
+            }
+          });
+          console.log(response.product_list);
           this.goodsExchangeAddForm.distribution_name = response.staff_name;
           this.goodsExchangeAddForm.product_list = response.product_list;
-          /* .map((item) => {
+          /* .map((item) => {SALE_AFTER
               //change_list
               item.name=item.goods_do.name
               item.sn=item.goods_do.sn

+ 7 - 1
manager-admin/src/views/stock/goodsExchange/checkInventory.vue

@@ -40,7 +40,8 @@
                     <div>
                       <p v-for="item in scope.row.area_stock_list" :key="item.id">{{ item.warehouse_area_name }}</p>
                     </div>
-                    <span slot="reference" v-if="scope.row.area_stock_list.length!==0">{{ scope.row.area_stock_list[0].warehouse_area_name }}</span>
+                    <span slot="reference" v-if="scope.row.area_stock_list.length !== 0">{{
+                      scope.row.area_stock_list[0].warehouse_area_name }}</span>
                   </el-popover>
                 </template>
               </el-table-column>
@@ -106,6 +107,11 @@
                   ></el-input> -->
                 </template>
               </el-table-column>
+              <el-table-column prop="entry_num" label="已入库数量"
+                v-if="(goodsExchangeAddForm.type == 'TRANSFER_ENTRY' || goodsExchangeAddForm.type == 'HAIL_ENTRY' || goodsExchangeAddForm.type == 'SALE_AFTER') &&checkType !== 'first' "></el-table-column>
+              <el-table-column prop="not_entry_num" label="未入库数量"
+                v-if="(goodsExchangeAddForm.type == 'TRANSFER_ENTRY' || goodsExchangeAddForm.type == 'HAIL_ENTRY' || goodsExchangeAddForm.type == 'SALE_AFTER') &&checkType !== 'first'">
+              </el-table-column>
               <el-table-column label="可用库存">
                 <template slot-scope="scope">
                   {{ scope.row.usable_stock }}

+ 5 - 2
manager-admin/src/views/stock/goodsExchange/goodsExchange.vue

@@ -129,8 +129,11 @@
             <el-button size="mini" v-if="checkPermission(['checkInventory'])"
               @click="handleAuditGoodsExchange(scope.row)">查看</el-button>
             <el-button size="mini"
-              v-if="scope.row.has_submit == 'N' && checkPermission(['editInventory']) && checkPermission(['goodsExchangeEdit'])"
-              @click="handleEditGoodsExchange(scope.row)">编辑</el-button>
+              v-if="scope.row.has_submit == 'N' && checkPermission(['editInventory']) && checkPermission(['goodsExchangeEdit']) && activeName == 'first'"
+              @click="handleEditGoodsExchange(scope.row)">出库</el-button>
+              <el-button size="mini"
+              v-if="scope.row.has_submit == 'N' && checkPermission(['editInventory']) && checkPermission(['goodsExchangeEdit']) && activeName == 'second'"
+              @click="handleEditGoodsExchange(scope.row)">入库</el-button>
           </template>
         </el-table-column>
       </template>

+ 51 - 16
manager-admin/src/views/stock/order.vue

@@ -112,12 +112,12 @@
         <el-table-column label="客户">
           <template slot-scope="scope">{{
             memberType(scope.row.member_id)
-            }}</template>
+          }}</template>
         </el-table-column>
         <el-table-column label="下单时间">
           <template slot-scope="scope">{{
             scope.row.create_time | unixToDate
-            }}</template>
+          }}</template>
         </el-table-column>
         <el-table-column prop="warehouse_id" label="仓库名称">
           <template slot-scope="scope">
@@ -127,17 +127,17 @@
         <el-table-column prop="send_type" label="配送方式">
           <template slot-scope="scope">{{
             deliveryType(scope.row.send_type)
-            }}</template>
+          }}</template>
         </el-table-column>
         <el-table-column prop="pay_type" label="付款方式">
           <template slot-scope="scope">{{
             payType(scope.row.pay_type)
-            }}</template>
+          }}</template>
         </el-table-column>
         <el-table-column prop="status" label="实付金额">
           <template slot-scope="scope">{{
             "¥" + scope.row.pay_price
-            }}</template>
+          }}</template>
         </el-table-column>
         <el-table-column prop="status" label="订单状态">
           <template slot-scope="scope">
@@ -185,11 +185,8 @@
     <el-dialog title="扫码支付(支付宝)" :visible.sync="payVisible" width="30%" :close-on-click-modal="false"
       @close="closeDialog">
 
-      <div id="qrCode" style="display:  flex;justify-content: center;" ref="qrCodeDiv">
-        <!-- 二维码容器 -->
-        <div class="qr-code"></div>
-        <!-- Logo 图片 -->
-        <div ref="qrCodeDiv1"></div>
+      <div id="qrCode" style="display: flex; justify-content: center;" ref="qrCodeDiv">
+        <canvas ref="qrCodeCanvas"></canvas>
       </div>
     </el-dialog>
     <el-dialog title="交通费信息" :visible.sync="reimburVisible" :modal-append-to-body="false" :close-on-click-modal="false"
@@ -220,9 +217,10 @@
           <el-table ref="table" :data="order_customer_fees" border style="width: 100%">
             <!--  <el-table-column type="selection" width="55" /> -->
             <el-table-column prop="money" label="金额"> </el-table-column>
-            <el-table-column prop="file_url" label="图片" >
+            <el-table-column prop="file_url" label="图片">
               <template slot-scope="scope">
-                <img :src="scope.row.file_url" alt="" style="width: 60px;height: 60px">
+                <img :src="scope.row.file_url" alt="" @click="showImage(scope.row.file_url)"
+                  style="width: 60px;height: 60px">
               </template>
             </el-table-column>
           </el-table>
@@ -233,6 +231,9 @@
         <el-button type="primary" @click="addReimburForm">确 定</el-button>
       </span>
     </el-dialog>
+    <el-dialog :visible.sync="imgDialogVisible" width="50%">
+      <img :src="currentImage" alt="" style="width: 100%">
+    </el-dialog>
   </div>
 </template>
 
@@ -291,7 +292,11 @@ export default {
         file_url: ''
       },
       //交通费明细
-      order_customer_fees: []
+      order_customer_fees: [],
+      /* 查看大图 */
+      imgDialogVisible: false,
+      currentImage: '',
+      logoUrl: 'https://ts1.cn.mm.bing.net/th/id/R-C.d92375244b2aa72cb0a908ced5f3b82f?rik=Vp1gcK%2fgp9RwKw&riu=http%3a%2f%2fwww.kuaipng.com%2fUploads%2fpic%2fw%2f2020%2f03-29%2f76002%2fwater_76002_698_698_.png&ehk=PC1tAFEArlnKJy20uawSNpn175%2bYYM8ywnhX8ej%2bpJ0%3d&risl=&pid=ImgRaw&r=0',
     };
   },
   mounted() {
@@ -319,6 +324,10 @@ export default {
     next();
   },
   methods: {
+    showImage(url) {
+      this.currentImage = url;
+      this.imgDialogVisible = true;
+    },
     //提交报销单
     addReimburForm() {
       API_order.addOrderCustomerFee(this.reimburForm).then(res => {
@@ -347,7 +356,7 @@ export default {
     reimbursement(row) {
       this.reimburForm.order_id = row.id
       API_order.getOrderDetail(row.id).then((response) => {
-        this.order_customer_fees=response.order_customer_fees
+        this.order_customer_fees = response.order_customer_fees
         this.reimburVisible = true
       })
     },
@@ -392,8 +401,34 @@ export default {
           colorLight: "#ffffff", //二维码背景色
           correctLevel: QRCode.CorrectLevel.L//容错率,L/M/H
         })
-
-        /* this.positionLogo() */
+        // 等待二维码生成完成
+        setTimeout(() => {
+          // 获取生成的二维码 canvas
+          const qrCodeCanvas = this.$refs.qrCodeDiv.querySelector('canvas');
+
+          // 创建一个新的 canvas 用于叠加 logo
+          const canvas = document.createElement('canvas');
+          const ctx = canvas.getContext('2d');
+          canvas.width = qrCodeCanvas.width;
+          canvas.height = qrCodeCanvas.height;
+
+          // 绘制二维码到新的 canvas
+          ctx.drawImage(qrCodeCanvas, 0, 0);
+
+          // 加载 logo 图片
+          const logo = new Image();
+          logo.src = this.logoUrl;
+          logo.onload = () => {
+            const logoSize = 50; // logo 大小
+            const x = (canvas.width - logoSize) / 2;
+            const y = (canvas.height - logoSize) / 2;
+            ctx.drawImage(logo, x, y, logoSize, logoSize);
+
+            // 将生成的二维码添加到 DOM
+            this.$refs.qrCodeDiv.innerHTML = '';
+            this.$refs.qrCodeDiv.appendChild(canvas);
+          };
+        }, 100); // 等待二维码生成完成
       }, 500);
     },
     positionLogo() {

+ 17 - 5
manager-admin/src/views/stock/orderAdd.vue

@@ -154,11 +154,12 @@
           </el-table-column>
           <el-table-column label="库位号">
             <template slot-scope="scope">
-              <el-popover placement="right"  trigger="click" v-if="scope.row.area_stock_list">
+              <el-popover placement="right" trigger="click" v-if="scope.row.area_stock_list">
                 <div>
                   <p v-for="item in scope.row.area_stock_list" :key="item.id">{{ item.warehouse_area_name }}</p>
                 </div>
-                <span slot="reference" v-if="scope.row.area_stock_list.length!==0">{{ scope.row.area_stock_list[0].warehouse_area_name }}</span>
+                <span slot="reference" v-if="scope.row.area_stock_list.length !== 0">{{
+                  scope.row.area_stock_list[0].warehouse_area_name }}</span>
               </el-popover>
             </template>
           </el-table-column>
@@ -480,6 +481,9 @@
         <el-button type="primary" @click="addReimburForm">确 定</el-button>
       </span>
     </el-dialog>
+    <el-dialog :visible.sync="imgDialogVisible" width="50%">
+      <img :src="currentImage" alt="" style="width: 100%">
+    </el-dialog>
   </div>
 </template>
 
@@ -777,7 +781,10 @@ export default {
         money: "",
         file_url: ''
       },
-      TO_Cmoney: 0//交通费汇总
+      TO_Cmoney: 0,//交通费汇总
+      /* 查看大图 */
+      imgDialogVisible: false,
+      currentImage: ''
     };
   },
   computed: {
@@ -796,6 +803,11 @@ export default {
     this.OrderForm.marketing_id = JSON.parse(JSON.parse(localStorage.getItem("admin_user")).data).uid
   },
   methods: {
+    /* 查看大图 */
+    showImage(url) {
+      this.currentImage = url;
+      this.imgDialogVisible = true;
+    },
     //提交报销单
     addReimburForm() {
       API_Order.editOrderCustomerFee(this.reimburForm, this.reimburForm.id).then(res => {
@@ -1461,7 +1473,7 @@ export default {
           this.totalAmount = moneyToc + response.real_price
         }
 
-       
+
         this.OrderForm = response;
         /* this.fileList = response.attachment
           ? [{ name: "附件", url: response.attachment }]
@@ -1473,7 +1485,7 @@ export default {
           this.time.push(response.start_time);
           this.time.push(response.end_time);
         }
-         this.selectedOptions = response.province_city_area.split(",");
+        this.selectedOptions = response.province_city_area.split(",");
         /* if (this.OrderForm.payment_time) {
           this.OrderForm.payment_time = Math.floor(
             this.OrderForm.payment_time * 1000

+ 43 - 2
manager-admin/src/views/stock/orderCheck.vue

@@ -33,7 +33,7 @@
                 </el-col>
                 <el-col :span="10">
                     <el-form-item label="起始时间:" prop="time" :rules="rules.start_time" v-if="OrderForm.type == 'TO_C'">
-                        {{ OrderForm.start_time +'-'+OrderForm.end_time}}
+                        {{ OrderForm.start_time + '-' + OrderForm.end_time }}
                     </el-form-item>
                 </el-col>
                 <el-col :span="10">
@@ -319,6 +319,9 @@
         <el-button type="primary" @click="submitGoosData()">确 定</el-button>
       </span> -->
         </el-dialog>
+        <el-dialog :visible.sync="imgDialogVisible" width="50%">
+            <img :src="currentImage" alt="" style="width: 100%">
+        </el-dialog>
     </div>
 </template>
 
@@ -612,6 +615,11 @@ export default {
             TO_Cmoney: 0,//交通费汇总
             reimListVisible: false,
             reimburVisible: false,
+            /* 查看大图 */
+            imgDialogVisible: false,
+            currentImage: '',
+            logoUrl: 'https://ts1.cn.mm.bing.net/th/id/R-C.d92375244b2aa72cb0a908ced5f3b82f?rik=Vp1gcK%2fgp9RwKw&riu=http%3a%2f%2fwww.kuaipng.com%2fUploads%2fpic%2fw%2f2020%2f03-29%2f76002%2fwater_76002_698_698_.png&ehk=PC1tAFEArlnKJy20uawSNpn175%2bYYM8ywnhX8ej%2bpJ0%3d&risl=&pid=ImgRaw&r=0',
+
         };
     },
     computed: {
@@ -632,6 +640,11 @@ export default {
 
     },
     methods: {
+        /* 查看大图 */
+        showImage(url) {
+            this.currentImage = url;
+            this.imgDialogVisible = true;
+        },
         /* 交通费明细 */
         reimList() {
             this.reimListVisible = true
@@ -652,6 +665,34 @@ export default {
                     colorLight: "#ffffff", //二维码背景色
                     correctLevel: QRCode.CorrectLevel.L//容错率,L/M/H
                 })
+                // 等待二维码生成完成
+                setTimeout(() => {
+                    // 获取生成的二维码 canvas
+                    const qrCodeCanvas = this.$refs.qrCodeDiv.querySelector('canvas');
+
+                    // 创建一个新的 canvas 用于叠加 logo
+                    const canvas = document.createElement('canvas');
+                    const ctx = canvas.getContext('2d');
+                    canvas.width = qrCodeCanvas.width;
+                    canvas.height = qrCodeCanvas.height;
+
+                    // 绘制二维码到新的 canvas
+                    ctx.drawImage(qrCodeCanvas, 0, 0);
+
+                    // 加载 logo 图片
+                    const logo = new Image();
+                    logo.src = this.logoUrl;
+                    logo.onload = () => {
+                        const logoSize = 50; // logo 大小
+                        const x = (canvas.width - logoSize) / 2;
+                        const y = (canvas.height - logoSize) / 2;
+                        ctx.drawImage(logo, x, y, logoSize, logoSize);
+
+                        // 将生成的二维码添加到 DOM
+                        this.$refs.qrCodeDiv.innerHTML = '';
+                        this.$refs.qrCodeDiv.appendChild(canvas);
+                    };
+                }, 100); // 等待二维码生成完成
             }, 500);
         },
         cleanUrl(url) {
@@ -1245,7 +1286,7 @@ export default {
                     this.TO_Cmoney = moneyToc
                     this.totalAmount = moneyToc + response.real_price
                 }
-                
+
                 this.OrderForm = response;
                 if (response.type == "TO_C") {
                     this.time.push(response.start_time);

+ 15 - 6
manager-admin/src/views/stock/orderReturnAdd.vue

@@ -54,7 +54,7 @@
             </el-table-column>
             <el-table-column label="购买数量">
               <template slot-scope="scope">
-                <span v-if="!id">{{ scope.row.num }}</span>
+                <span v-if="id">{{ scope.row.num }}</span>
                 <span v-else>{{ scope.row.order_num }}</span>
               </template>
             </el-table-column>
@@ -64,6 +64,7 @@
                   :disabled="type === 'detail' || type === 'audit'" />
               </template>
             </el-table-column>
+            <el-table-column prop="not_return_num" label="未退数量"></el-table-column>
             <el-table-column label="操作">
               <template slot-scope="scope">
                 <el-button size="mini" :disabled="type === 'detail' || type === 'audit'" type="danger"
@@ -278,15 +279,20 @@ export default {
       const { id } = this.orderReturnAddForm
       const params = this.MixinClone(this.orderReturnAddForm)
       const mapList = {}
+      let notRteurn=false
       params.order_id=this.id
       params.order_sn = params.sn
       params.item_list = params.item_list.map(el => {
-        mapList.order_item_id = el.id
-        mapList.order_num = el.num
-        mapList.product_id = el.product_id
-        mapList.return_num = el.return_num
-        return mapList
+        el.order_item_id = el.id
+        el.order_num = el.num
+        el.product_id = el.product_id
+        el.return_num = el.return_num
+        if(el.return_num>el.not_return_num){
+          notRteurn=true
+        }
+        return el
       })
+      if(notRteurn) return this.$message.error("退货数量大于未退数量!")
       if (id) {
         API_orderReturn.editorderReturn(id, params).then(response => {
           this.$message.success('修改成功!')
@@ -356,6 +362,9 @@ export default {
             el.video=el.goods_vo.video
             return el
           }) **/
+          response.item_list.map(el=>{
+            el.return_num=0
+          })
         this.orderReturnAddForm = response
         this.GET_WarehouseList({ dept_id: response.dept_id })
       })