Browse Source

订单商品添加总价及折扣

yangg 1 year ago
parent
commit
5bc83423d2
35 changed files with 122 additions and 90 deletions
  1. 1 1
      manager-admin/dist/index.html
  2. 0 0
      manager-admin/dist/static/js/36.dde7c135eb1bc0a1a4f5.js
  3. BIN
      manager-admin/dist/static/js/36.f344dff53a11dc70891d.js.gz
  4. 0 0
      manager-admin/dist/static/js/37.161c8a81b2c2bca51cf1.js
  5. 0 0
      manager-admin/dist/static/js/38.fc15c95b20fb51fa43c0.js
  6. 0 0
      manager-admin/dist/static/js/39.c54c60e23a7c287493f7.js
  7. BIN
      manager-admin/dist/static/js/39.c54c60e23a7c287493f7.js.gz
  8. 0 0
      manager-admin/dist/static/js/40.1f396f6928fa20157a79.js
  9. BIN
      manager-admin/dist/static/js/40.1f396f6928fa20157a79.js.gz
  10. BIN
      manager-admin/dist/static/js/40.64f5a5b8a710eef71f8f.js.gz
  11. 0 0
      manager-admin/dist/static/js/41.0b358b3d6e093c51d194.js
  12. 0 0
      manager-admin/dist/static/js/42.aa37b232d98377dbe6f4.js
  13. 0 0
      manager-admin/dist/static/js/43.3a4ee6888fb37de68bda.js
  14. BIN
      manager-admin/dist/static/js/43.3a4ee6888fb37de68bda.js.gz
  15. 0 0
      manager-admin/dist/static/js/44.ca6f24b90a3f62093c21.js
  16. BIN
      manager-admin/dist/static/js/44.ca6f24b90a3f62093c21.js.gz
  17. BIN
      manager-admin/dist/static/js/45.35c5b8fc799ddf2c42d8.js.gz
  18. 0 0
      manager-admin/dist/static/js/45.e0c735ab8c8de19f8130.js
  19. BIN
      manager-admin/dist/static/js/45.e0c735ab8c8de19f8130.js.gz
  20. 0 0
      manager-admin/dist/static/js/46.2a923d564f5bcc358812.js
  21. BIN
      manager-admin/dist/static/js/46.2a923d564f5bcc358812.js.gz
  22. BIN
      manager-admin/dist/static/js/46.7418b356c5279c486cbc.js.gz
  23. 0 0
      manager-admin/dist/static/js/47.98220d84da52a6770638.js
  24. 0 0
      manager-admin/dist/static/js/48.262b29fb48a4876e2118.js
  25. BIN
      manager-admin/dist/static/js/48.262b29fb48a4876e2118.js.gz
  26. 1 1
      manager-admin/dist/static/js/49.123ba9fbcdf6f4e3d03a.js
  27. BIN
      manager-admin/dist/static/js/49.55335791aa1da3bdaaf5.js.gz
  28. 0 0
      manager-admin/dist/static/js/50.52413dfd22f587a1eb21.js
  29. BIN
      manager-admin/dist/static/js/50.52413dfd22f587a1eb21.js.gz
  30. 0 0
      manager-admin/dist/static/js/app.f1cefa70485a89b299a1.js
  31. BIN
      manager-admin/dist/static/js/app.f1cefa70485a89b299a1.js.gz
  32. 0 0
      manager-admin/dist/static/js/manifest.a7770dd48e8129935f9f.js
  33. 46 6
      manager-admin/src/components/payType.vue
  34. 45 67
      manager-admin/src/views/stock/orderAdd.vue
  35. 29 15
      manager-admin/src/views/stock/orderCheck.vue

+ 1 - 1
manager-admin/dist/index.html

@@ -1,3 +1,3 @@
 <!DOCTYPE html><html><head><meta charset=utf-8><script>var ua = window.navigator.userAgent
     var isIe = /MSIE|Trident/.test(ua)
-    // if (isIe) window.location.href = 'http://support.dmeng.net/upgrade-your-browser.html?referrer=' + encodeURIComponent(window.location.href)</script><script src=/static/js/envs.js></script><meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1"><meta name=renderer content=webkit><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><title>erp</title><link rel="shortcut icon" href=/favicon.ico><link href=/static/css/app.2504f4a014a0e06a9efabe33f1571f70.css rel=stylesheet></head><body><div id=app><div style="display: flex;width: 100vw;height: 100vh;justify-content:center;align-items:center"><img src=/static/img/index.ripple-radio-preloader.gif alt=""></div></div><script src=/static/js/jquery.min.js></script><script src=/static/js/xlsx.full.min.js></script><script src=/static/js/echarts.min.js></script><script src=/static/js/base64.min.js></script><script src=/static/js/psl.min.js></script><script src=/static/UE/ueditor.config.js></script><script src=/static/UE/ueditor.all.js></script><script src=/static/UE/lang/zh-cn/zh-cn.js></script><script src=/static/UE/ueditor.parse.js></script><script src="//webapi.amap.com/maps?v=2.0&key=a4553619077791eb0a6df2f450b9a03b&plugin=AMap.CircleEditor"></script><script src=//webapi.amap.com/ui/1.1/main.js></script><script type=text/javascript src=/static/js/manifest.f3b78f0d1b48c1ade883.js></script><script type=text/javascript src=/static/js/vendor.4b8436f4db68c4fe04db.js></script><script type=text/javascript src=/static/js/app.3eb214211646e89cc65f.js></script></body></html>
+    // if (isIe) window.location.href = 'http://support.dmeng.net/upgrade-your-browser.html?referrer=' + encodeURIComponent(window.location.href)</script><script src=/static/js/envs.js></script><meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1"><meta name=renderer content=webkit><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><title>erp</title><link rel="shortcut icon" href=/favicon.ico><link href=/static/css/app.2504f4a014a0e06a9efabe33f1571f70.css rel=stylesheet></head><body><div id=app><div style="display: flex;width: 100vw;height: 100vh;justify-content:center;align-items:center"><img src=/static/img/index.ripple-radio-preloader.gif alt=""></div></div><script src=/static/js/jquery.min.js></script><script src=/static/js/xlsx.full.min.js></script><script src=/static/js/echarts.min.js></script><script src=/static/js/base64.min.js></script><script src=/static/js/psl.min.js></script><script src=/static/UE/ueditor.config.js></script><script src=/static/UE/ueditor.all.js></script><script src=/static/UE/lang/zh-cn/zh-cn.js></script><script src=/static/UE/ueditor.parse.js></script><script src="//webapi.amap.com/maps?v=2.0&key=a4553619077791eb0a6df2f450b9a03b&plugin=AMap.CircleEditor"></script><script src=//webapi.amap.com/ui/1.1/main.js></script><script type=text/javascript src=/static/js/manifest.a7770dd48e8129935f9f.js></script><script type=text/javascript src=/static/js/vendor.4b8436f4db68c4fe04db.js></script><script type=text/javascript src=/static/js/app.f1cefa70485a89b299a1.js></script></body></html>

File diff suppressed because it is too large
+ 0 - 0
manager-admin/dist/static/js/36.dde7c135eb1bc0a1a4f5.js


BIN
manager-admin/dist/static/js/36.f344dff53a11dc70891d.js.gz


File diff suppressed because it is too large
+ 0 - 0
manager-admin/dist/static/js/37.161c8a81b2c2bca51cf1.js


File diff suppressed because it is too large
+ 0 - 0
manager-admin/dist/static/js/38.fc15c95b20fb51fa43c0.js


File diff suppressed because it is too large
+ 0 - 0
manager-admin/dist/static/js/39.c54c60e23a7c287493f7.js


BIN
manager-admin/dist/static/js/39.c54c60e23a7c287493f7.js.gz


File diff suppressed because it is too large
+ 0 - 0
manager-admin/dist/static/js/40.1f396f6928fa20157a79.js


BIN
manager-admin/dist/static/js/41.105519940ff667762160.js.gz → manager-admin/dist/static/js/40.1f396f6928fa20157a79.js.gz


BIN
manager-admin/dist/static/js/40.64f5a5b8a710eef71f8f.js.gz


File diff suppressed because it is too large
+ 0 - 0
manager-admin/dist/static/js/41.0b358b3d6e093c51d194.js


File diff suppressed because it is too large
+ 0 - 0
manager-admin/dist/static/js/42.aa37b232d98377dbe6f4.js


File diff suppressed because it is too large
+ 0 - 0
manager-admin/dist/static/js/43.3a4ee6888fb37de68bda.js


BIN
manager-admin/dist/static/js/44.b140ab3ae2a59996b3a3.js.gz → manager-admin/dist/static/js/43.3a4ee6888fb37de68bda.js.gz


File diff suppressed because it is too large
+ 0 - 0
manager-admin/dist/static/js/44.ca6f24b90a3f62093c21.js


BIN
manager-admin/dist/static/js/44.ca6f24b90a3f62093c21.js.gz


BIN
manager-admin/dist/static/js/45.35c5b8fc799ddf2c42d8.js.gz


File diff suppressed because it is too large
+ 0 - 0
manager-admin/dist/static/js/45.e0c735ab8c8de19f8130.js


BIN
manager-admin/dist/static/js/45.e0c735ab8c8de19f8130.js.gz


File diff suppressed because it is too large
+ 0 - 0
manager-admin/dist/static/js/46.2a923d564f5bcc358812.js


BIN
manager-admin/dist/static/js/47.c17c770acd8d959a87d3.js.gz → manager-admin/dist/static/js/46.2a923d564f5bcc358812.js.gz


BIN
manager-admin/dist/static/js/46.7418b356c5279c486cbc.js.gz


File diff suppressed because it is too large
+ 0 - 0
manager-admin/dist/static/js/47.98220d84da52a6770638.js


File diff suppressed because it is too large
+ 0 - 0
manager-admin/dist/static/js/48.262b29fb48a4876e2118.js


BIN
manager-admin/dist/static/js/48.262b29fb48a4876e2118.js.gz


+ 1 - 1
manager-admin/dist/static/js/50.2ad874b7bed510a80191.js → manager-admin/dist/static/js/49.123ba9fbcdf6f4e3d03a.js

@@ -1 +1 @@
-webpackJsonp([50],{P95X:function(n,t,e){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=e("hky6"),i={data:function(){return{scanSource:"未知扫码来源",sn:"",price:"",payUrl:""}},methods:{goPay:function(){r.v({order_id:this.$route.query.id,pay_type:this.scanSource}).then(function(n){window.open(n)})},detectScanSource:function(){this.price=this.$route.query.price,this.sn=this.$route.query.sn;var n=window.navigator.userAgent.toLowerCase();"micromessenger"==n.match(/MicroMessenger/i)?this.scanSource="wx":"alipayclient"==n.match(/AlipayClient/i)?this.scanSource="ali":this.scanSource="unknown"}},mounted:function(){this.detectScanSource()}},a=e("XyMi");var s=function(n){e("wsQH")},o=Object(a.a)(i,function(){var n=this,t=n.$createElement,e=n._self._c||t;return e("div",{staticClass:"center"},[e("div",{staticClass:"header_info"},[e("p",[n._v("订单编号: "),e("span",[n._v(n._s(n.sn))])]),n._v(" "),e("p",[n._v("付款金额:"),e("span",[n._v(" ¥")]),e("span",[n._v(n._s(n.price))])])]),n._v(" "),e("div",{staticClass:"btn"},[e("el-button",{staticStyle:{width:"100%","font-size":"18px"},attrs:{type:"primary"},on:{click:n.goPay}},[n._v("\n            确认支付\n        ")])],1)])},[],!1,s,"data-v-5b7fdbb8",null);t.default=o.exports},bfTO:function(n,t,e){(n.exports=e("FZ+f")(!1)).push([n.i,"\n.center[data-v-5b7fdbb8] {\r\n    width: 100%;\r\n    padding: 15px;\n}\n.header_info[data-v-5b7fdbb8] {\r\n    border-radius: 10px;\r\n    padding: 10px;\r\n    width: 100%;\r\n    background-color: #fff;\n}\np[data-v-5b7fdbb8] {\r\n    padding-top: 5px;\r\n    padding-bottom: 5px;\n}\n.btn[data-v-5b7fdbb8] {\r\n    width: 100%;\r\n    margin-top: 80px;\n}\r\n",""])},wsQH:function(n,t,e){var r=e("bfTO");"string"==typeof r&&(r=[[n.i,r,""]]),r.locals&&(n.exports=r.locals);e("rjj0")("9e3ee174",r,!0)}});
+webpackJsonp([49],{P95X:function(n,t,e){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=e("hky6"),i={data:function(){return{scanSource:"未知扫码来源",sn:"",price:"",payUrl:""}},methods:{goPay:function(){r.v({order_id:this.$route.query.id,pay_type:this.scanSource}).then(function(n){window.open(n)})},detectScanSource:function(){this.price=this.$route.query.price,this.sn=this.$route.query.sn;var n=window.navigator.userAgent.toLowerCase();"micromessenger"==n.match(/MicroMessenger/i)?this.scanSource="wx":"alipayclient"==n.match(/AlipayClient/i)?this.scanSource="ali":this.scanSource="unknown"}},mounted:function(){this.detectScanSource()}},a=e("XyMi");var s=function(n){e("wsQH")},o=Object(a.a)(i,function(){var n=this,t=n.$createElement,e=n._self._c||t;return e("div",{staticClass:"center"},[e("div",{staticClass:"header_info"},[e("p",[n._v("订单编号: "),e("span",[n._v(n._s(n.sn))])]),n._v(" "),e("p",[n._v("付款金额:"),e("span",[n._v(" ¥")]),e("span",[n._v(n._s(n.price))])])]),n._v(" "),e("div",{staticClass:"btn"},[e("el-button",{staticStyle:{width:"100%","font-size":"18px"},attrs:{type:"primary"},on:{click:n.goPay}},[n._v("\n            确认支付\n        ")])],1)])},[],!1,s,"data-v-5b7fdbb8",null);t.default=o.exports},bfTO:function(n,t,e){(n.exports=e("FZ+f")(!1)).push([n.i,"\n.center[data-v-5b7fdbb8] {\r\n    width: 100%;\r\n    padding: 15px;\n}\n.header_info[data-v-5b7fdbb8] {\r\n    border-radius: 10px;\r\n    padding: 10px;\r\n    width: 100%;\r\n    background-color: #fff;\n}\np[data-v-5b7fdbb8] {\r\n    padding-top: 5px;\r\n    padding-bottom: 5px;\n}\n.btn[data-v-5b7fdbb8] {\r\n    width: 100%;\r\n    margin-top: 80px;\n}\r\n",""])},wsQH:function(n,t,e){var r=e("bfTO");"string"==typeof r&&(r=[[n.i,r,""]]),r.locals&&(n.exports=r.locals);e("rjj0")("9e3ee174",r,!0)}});

BIN
manager-admin/dist/static/js/49.55335791aa1da3bdaaf5.js.gz


File diff suppressed because it is too large
+ 0 - 0
manager-admin/dist/static/js/50.52413dfd22f587a1eb21.js


BIN
manager-admin/dist/static/js/50.52413dfd22f587a1eb21.js.gz


File diff suppressed because it is too large
+ 0 - 0
manager-admin/dist/static/js/app.f1cefa70485a89b299a1.js


BIN
manager-admin/dist/static/js/app.3eb214211646e89cc65f.js.gz → manager-admin/dist/static/js/app.f1cefa70485a89b299a1.js.gz


File diff suppressed because it is too large
+ 0 - 0
manager-admin/dist/static/js/manifest.a7770dd48e8129935f9f.js


+ 46 - 6
manager-admin/src/components/payType.vue

@@ -24,18 +24,58 @@ export default {
         };
     },
     methods: {
+        goWx() {
+            window.location.href = this.wxUrl
+        },
         goPay() {
             API_Setting.getPayUrl({ order_id: this.$route.query.id, pay_type: this.scanSource }).then(res => {
-               /*  this.payUrl = res */
-               window.open(res) 
+                if (this.scanSource == 'wx') {
+                    alert(res)
+                    this.invokeWeChatPay(res);
+                } else {
+                    window.open(res)
+                }
                 /* document.write(res) */
-              /*   const form = document.querySelector('form[name="punchout_form"]');
-                if (form) {
-                    form.submit();
-                } */
+                /*   const form = document.querySelector('form[name="punchout_form"]');
+                  if (form) {
+                      form.submit();
+                  } */
 
             })
         },
+        invokeWeChatPay(params) {
+            if (typeof WeixinJSBridge === "undefined") {
+                if (document.addEventListener) {
+                    document.addEventListener('WeixinJSBridgeReady', () => this.onBridgeReady(params), false);
+                } else if (document.attachEvent) {
+                    document.attachEvent('WeixinJSBridgeReady', () => this.onBridgeReady(params));
+                    document.attachEvent('onWeixinJSBridgeReady', () => this.onBridgeReady(params));
+                }
+            } else {
+                this.onBridgeReady(params);
+            }
+        },
+        onBridgeReady(params) {
+            WeixinJSBridge.invoke(
+                'getBrandWCPayRequest', {
+                "appId": params.appId,     // 公众号名称,由商户传入
+                "timeStamp": params.timeStamp, // 时间戳,自1970年以来的秒数
+                "nonceStr": params.nonceStr, // 随机串
+                "package": params.package,
+                "signType": params.signType, // 微信签名方式:
+                "paySign": params.paySign // 微信签名
+            },
+                function (res) {
+                    if (res.err_msg == "get_brand_wcpay_request:ok") {
+                        // 使用以上方式判断前端返回,微信团队郑重提示:
+                        // res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
+                        alert('支付成功');
+                    } else {
+                        alert('支付失败');
+                    }
+                }
+            );
+        },
         detectScanSource() {
             this.price = this.$route.query.price
             this.sn = this.$route.query.sn

+ 45 - 67
manager-admin/src/views/stock/orderAdd.vue

@@ -122,6 +122,16 @@
             </el-select>
           </el-form-item>
         </el-col>
+        <el-col :span="10">
+          <el-form-item label="税点:" prop="tax_rate" :rules="rules.tax_rate">
+            <el-select v-model="OrderForm.tax_rate" clearable :disabled="type == 'pone'">
+              <el-option label="0" :value="0" />
+              <el-option label="1%" :value="1" />
+              <el-option label="6%" :value="6" />
+              <el-option label="13%" :value="13" />
+            </el-select>
+          </el-form-item>
+        </el-col>
         <el-col :span="24">
           <div class="redClass">
             <el-form-item label="备注:" prop="remark">
@@ -163,11 +173,11 @@
               </el-popover>
             </template>
           </el-table-column>
-          <el-table-column label="商品编号">
+          <!-- <el-table-column label="商品编号">
             <template slot-scope="scope">
               {{ scope.row.goods_vo.sn }}
             </template>
-          </el-table-column>
+          </el-table-column> -->
           <el-table-column label="商品名称">
             <template slot-scope="scope">
               {{ scope.row.goods_vo.name }}
@@ -202,9 +212,14 @@
               <el-input v-model="scope.row.num" type="number" :min="0" :maxlength="20"></el-input>
             </template>
           </el-table-column>
-          <el-table-column label="库存数量">
+          <el-table-column label="日租金" v-if="OrderForm.type == 'TO_C'">
             <template slot-scope="scope">
-              {{ scope.row.usable_stock }}
+              {{ scope.row.product_vo.day_price }}
+            </template>
+          </el-table-column>
+          <el-table-column label="折扣">
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.reduction" type="number" :min="0" :maxlength="20"></el-input>
             </template>
           </el-table-column>
           <el-table-column label="租赁天数" v-if="OrderForm.type == 'TO_C'">
@@ -212,6 +227,11 @@
               <el-input v-model="scope.row.day_num" type="number" :min="0" :maxlength="20"></el-input>
             </template>
           </el-table-column>
+          <el-table-column label="总价">
+            <template slot-scope="scope">
+              {{ scope.row.item_money }}
+            </template>
+          </el-table-column>
           <!-- <el-table-column label="结束时间" width="200" v-if="OrderForm.type == 'TO_C'">
             <template slot-scope="scope">
               <el-date-picker style="width: 170px;" v-model="scope.row.end_time" type="datetime" placeholder="选择日期时间"
@@ -293,7 +313,7 @@
         </el-col>
         <el-col :span="8">
           <el-form-item label="折扣:" prop="">
-            <el-input placeholder="请输入" v-model="discount" @blur="handleBlur" :disabled="type == 'pone'">
+            <el-input placeholder="请输入" v-model="discount" @blur="handleBlur" :disabled="true">
               <template slot="append">折</template>
             </el-input>
           </el-form-item>
@@ -438,7 +458,8 @@
         <el-table-column prop="money" label="金额"> </el-table-column>
         <el-table-column prop="file_url" label="图片">
           <template slot-scope="scope">
-            <img :src="scope.row.file_url" alt="" @click="showImage(scope.row.file_url)" 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-column label="操作">
@@ -585,6 +606,7 @@ export default {
         payment_status: [this.MixinRequired("支付状态不能为空", "change")],
         payment_time: [this.MixinRequired("支付时间不能为空", "change")],
         real_price: [this.MixinRequired("请输入实付金额", "blur")],
+        tax_rate: [this.MixinRequired("请选择税点", "change")],
         // delivery_type: [this.MixinRequired("请选择配送方式", "change")],
         product_list: {
           num: [
@@ -750,7 +772,7 @@ export default {
         options: [],
       },
       //折扣
-      discount: 0,
+      discount: 10,
       pickerOptions: {
         disabledDate(v) {
           return v.getTime() < new Date().getTime() - 86400000;//  - 86400000是否包括当天
@@ -1501,13 +1523,13 @@ export default {
         if (!this.OrderForm.product_list) return
         if (!this.id) {
           if (this.OrderForm.type == "TO_C") {
-            /*   var start = new Date(this.OrderForm.start_time); // 将起始日期字符串转换为Date对象
-                this.OrderForm.product_list.map((item) => {
-                  var end = new Date(item.end_time); // 将结束日期字符串转换为Date对象
-                  var timeDiff = Math.abs(end.getTime() - start.getTime()); // 获取时间差(单位:毫秒)
-                  var monthDiff = Math.ceil(timeDiff / (24 * 60 * 60 * 1000)); // 根据每个月平均天数进行近似计算
-                  total += item.product_vo.day_price * item.num * monthDiff;
-                }); */
+            // var start = new Date(this.OrderForm.start_time); // 将起始日期字符串转换为Date对象
+            //   this.OrderForm.product_list.map((item) => {
+            //     var end = new Date(item.end_time); // 将结束日期字符串转换为Date对象
+            //     var timeDiff = Math.abs(end.getTime() - start.getTime()); // 获取时间差(单位:毫秒)
+            //     var monthDiff = Math.ceil(timeDiff / (24 * 60 * 60 * 1000)); // 根据每个月平均天数进行近似计算
+            //     total += item.product_vo.day_price * item.num * monthDiff;
+            //   });
             var start = new Date(this.time[1]); // 将起始日期字符串转换为Date对象
             var end = new Date(this.time[0]); // 将结束日期字符串转换为Date对象
             var timeDiff = Math.abs(end.getTime() - start.getTime()); // 获取时间差(单位:毫秒)
@@ -1542,42 +1564,6 @@ export default {
       },
       set(newValue) {
         this.OrderForm.real_price = newValue;
-        /*  let total = 0;
-         if (!this.OrderForm.product_list) return
-         if (!this.id) {
-           if (this.OrderForm.type == "TO_C") {
-             var start = new Date(this.OrderForm.start_time); // 将起始日期字符串转换为Date对象
-             this.OrderForm.product_list.map((item) => {
-               var end = new Date(item.end_time); // 将结束日期字符串转换为Date对象
-               var timeDiff = Math.abs(end.getTime() - start.getTime()); // 获取时间差(单位:毫秒)
-               var monthDiff = Math.ceil(timeDiff / (24 * 60 * 60 * 1000)); // 根据每个月平均天数进行近似计算
-               total += item.product_vo.day_price * item.num * monthDiff;
-             });
- 
-             return total;
-           } else {
-             this.OrderForm.product_list.map((item) => {
-               total += item.product_vo.price * item.num;
-             });
-             return total;
-           }
-         } else {
-           if (this.OrderForm.type == "TO_C") {
-             var start = new Date(this.time[1]); // 将起始日期字符串转换为Date对象
-             var end = new Date(this.time[0]); // 将结束日期字符串转换为Date对象
-             var timeDiff = Math.abs(end.getTime() - start.getTime()); // 获取时间差(单位:毫秒)
-             var monthDiff = Math.ceil(timeDiff / (24 * 60 * 60 * 1000)); // 根据每个月平均天数进行近似计算
-             this.OrderForm.product_list.map((item) => {
-               total += item.product_vo.day_price * item.num * monthDiff;
-             });
-             return total;
-           } else {
-             this.OrderForm.product_list.map((item) => {
-               total += item.product_vo.price * item.num;
-             });
-             return total;
-           }
-         } */
       }
     },
   },
@@ -1605,24 +1591,16 @@ export default {
     "OrderForm.product_list": {
       deep: true,
       handler(newVal) {
-        newVal.forEach((item) => {
-          /* item.sum=item.price*item.num
-          return  */
+        let totalItemMoney = 0;
+        newVal.forEach(item => {
+          if (this.OrderForm.type == "TO_C") {
+            item.item_money = item.product_vo.day_price * item.num * item.day_num * (item.reduction / 10);
+          } else {
+            item.item_money = item.product_vo.price * item.num * (item.reduction / 10);
+          }
+          totalItemMoney += item.item_money;
         });
-        /* this.OrderForm.total_price = newVal.reduce(
-          (sum, item) => sum + item.total_price,
-          0
-        );    // 税额(总)
-          item.tax_price = item.total_price * item.tax_rate * 0.01;
-          // 合计
-        this.OrderForm.discount_price = newVal.reduce(
-          (sum, item) => sum + item.discount_price * 1,
-          0
-        );
-        this.OrderForm.tax_price = newVal.reduce(
-          (sum, item) => sum + item.tax_price,
-          0
-        ); */
+        this.OrderForm.real_price = totalItemMoney;
       },
     },
     /* "OrderForm.payment_list": {

+ 29 - 15
manager-admin/src/views/stock/orderCheck.vue

@@ -135,11 +135,11 @@
                                 </el-popover>
                             </template>
                         </el-table-column>
-                        <el-table-column label="商品编号">
+                       <!--  <el-table-column label="商品编号">
                             <template slot-scope="scope">
                                 {{ scope.row.goods_vo.sn }}
                             </template>
-                        </el-table-column>
+                        </el-table-column> -->
                         <el-table-column label="商品名称">
                             <template slot-scope="scope">
                                 {{ scope.row.goods_vo.name }}
@@ -174,11 +174,11 @@
                                 {{ scope.row.num }}
                             </template>
                         </el-table-column>
-                        <el-table-column label="库存数量">
+                       <!--  <el-table-column label="库存数量">
                             <template slot-scope="scope">
                                 {{ scope.row.usable_stock }}
                             </template>
-                        </el-table-column>
+                        </el-table-column> -->
                         <el-table-column label="售后数量">
                             <template slot-scope="scope">
                                 {{ scope.row.return_num }}
@@ -189,6 +189,21 @@
                                 {{ scope.row.day_num }}
                             </template>
                         </el-table-column>
+                        <el-table-column label="日租金" v-if="OrderForm.type == 'TO_C'">
+                            <template slot-scope="scope">
+                                {{ scope.row.product_vo.day_price }}
+                            </template>
+                        </el-table-column>
+                        <el-table-column label="折扣">
+                            <template slot-scope="scope">
+                              {{  scope.row.reduction}}
+                            </template>
+                        </el-table-column>
+                        <el-table-column label="总价" v-if="OrderForm.type == 'TO_C'">
+                            <template slot-scope="scope">
+                                {{ scope.row.item_money }}
+                            </template>
+                        </el-table-column>
                         <!-- <el-table-column label="结束时间" width="200" v-if="OrderForm.type == 'TO_C'">
                         <template slot-scope="scope">
                             <el-date-picker style="width: 170px;" v-model="scope.row.end_time" type="datetime"
@@ -213,7 +228,7 @@
                         </el-form-item>
                     </el-col>
                     <el-col :span="8">
-                        <el-form-item label="实付金额:" prop="real_price" :rules="rules.pay_price">
+                        <el-form-item label="商品金额:" prop="real_price" :rules="rules.pay_price">
                             {{ OrderForm.real_price }}
                             <!-- <el-input v-model="OrderForm.real_price" placeholder="请输入"
                             :disabled="type == 'pone'"></el-input>  style="display: flex;justify-content: center;" -->
@@ -231,7 +246,7 @@
                             <el-button @click="reimList">查看明细</el-button>
                         </el-form-item>
                     </el-col>
-                    <el-col :span="12">
+                    <el-col :span="10">
                         <el-form-item label="抬头:" :rules="rules.pay_price" v-if="OrderForm.merchant_pay_info.invoice">
                             {{ OrderForm.merchant_pay_info.invoice }}
                         </el-form-item>
@@ -241,7 +256,7 @@
                             {{ OrderForm.merchant_pay_info.duty_paragraph }}
                         </el-form-item>
                     </el-col>
-                    <el-col :span="12">
+                    <el-col :span="10">
                         <el-form-item label="开户行:" :rules="rules.pay_price">
                             {{ OrderForm.merchant_pay_info.bank }}
                         </el-form-item>
@@ -694,12 +709,12 @@ export default {
         // 二维码生成
         creatQrCode() {
             this.$nextTick(() => {
-                if (this.OrderForm.type == 'TO_C') {
+                /* if (this.OrderForm.type == 'TO_C') {
                     this.OrderForm.real_price = this.totalAmount
-                }
+                } */
                 this.$refs.qrCodeDiv.innerHTML = "";
                 new QRCode(this.$refs.qrCodeDiv, {
-                    text: this.payurl + '#/payType?id=' + this.id + '&sn=' + this.barcodeValue + '&price=' + this.OrderForm.real_price,
+                    text: this.payurl + '#/payType?id=' + this.id + '&sn=' + this.barcodeValue + '&price=' + this.totalAmount,
                     width: 200,
                     height: 200,
                     colorDark: "#333333", //二维码颜色
@@ -1311,7 +1326,7 @@ export default {
         /** 获取订单详情 */
         GET_OrderDetail() {
             API_Order.getOrderDetail(this.id).then((response) => {
-          /**/ this.price = response.pay_price;
+                this.price = response.pay_price;
                 this.barcodeValue = response.sn
                 this.discount = response.reduction
                 response.product_list = response.item_list.map(el => {
@@ -1326,7 +1341,6 @@ export default {
                     this.TO_Cmoney = moneyToc
                     this.totalAmount = moneyToc + response.real_price
                 }
-
                 this.OrderForm = response;
                 if (response.type == "TO_C") {
                     const dateTime = response.start_time
@@ -1371,7 +1385,7 @@ export default {
                     }
                 } else {
                     if (this.OrderForm.type == "TO_C") {
-                        var start = new Date(this.time[1]); // 将起始日期字符串转换为Date对象
+                        var start = new Date(this.time[1]); // 将起始日期字符串转换为Date对象 税点:0,1,6,8
                         var end = new Date(this.time[0]); // 将结束日期字符串转换为Date对象
                         var timeDiff = Math.abs(end.getTime() - start.getTime()); // 获取时间差(单位:毫秒)
                         var monthDiff = Math.ceil(timeDiff / (24 * 60 * 60 * 1000)); // 根据每个月平均天数进行近似计算
@@ -1393,7 +1407,7 @@ export default {
         },
     },
     watch: {
-        discount: {
+        /* discount: {
             deep: true,
             handler(newVal) {
                 if (newVal) {
@@ -1412,7 +1426,7 @@ export default {
                     this.totalAmount = this.TO_Cmoney + this.OrderForm.real_price
                 }
             },
-        },
+        }, */
         "OrderForm.product_list": {
             deep: true,
             handler(newVal) {

Some files were not shown because too many files changed in this diff