Bläddra i källkod

Merge tag 'Hotfix-zh-13' into develop

Finish Hotfix-zh-13

# Conflicts:
#	src/views/supply/policy/components/retail_form.vue
howie 3 år sedan
förälder
incheckning
1902f9bbae

+ 6 - 6
src/utils/common.js

@@ -30,7 +30,7 @@ export const warningNotify = msg => {
  * 查询按钮权限
  * @param {*} value 当前按钮对应code
  * @param {*} btnRole 当前路由所有按钮权限
- * @returns 
+ * @returns
  */
 export const checkBtnRole = (value, btnRole) => {
   if(!btnRole) {return true}
@@ -47,8 +47,8 @@ export const checkBtnRole = (value, btnRole) => {
           item.sums1 = ['number'];
           item.sums2 = ['totalAmount', 'payAmount'];
         })
- * @param {*} param 
- * @returns 
+ * @param {*} param
+ * @returns
  */
 export const getSummaries = (param) => {
   const { columns, data } = param;
@@ -92,8 +92,8 @@ export const getSummaries = (param) => {
 
 /**
  * 保留2位小数点
- * @param {number} num 
- * @returns 
+ * @param {number} num
+ * @returns
  */
  export const numToFixed = (num) => {
 	if(!num) return '0.00';
@@ -109,4 +109,4 @@ export default {
   checkBtnRole,
   getSummaries,
   numToFixed
-}
+}

+ 98 - 33
src/views/supply/policy/components/retail_detail.vue

@@ -5,8 +5,13 @@
       <div class="title">提货进度</div>
     </div>
     <div class="progress-container">
-          <el-progress :text-inside="true" :stroke-width="26" :percentage="detailData.thjd ? (detailData.thjd * 1000 / 10).toFixed(2) : 0"></el-progress>
-
+      <el-progress
+        :text-inside="true"
+        :stroke-width="26"
+        :percentage="
+          detailData.thjd ? ((detailData.thjd * 1000) / 10).toFixed(2) : 0
+        "
+      ></el-progress>
     </div>
 
     <div class="main-title">
@@ -75,6 +80,8 @@
         highlight-current-row
         stripe
         max-height="400"
+        show-summary
+        :summary-method="$getSummaries"
       >
         <el-table-column
           align="center"
@@ -116,18 +123,23 @@
           prop="unit"
           min-width="100"
           show-overflow-tooltip
-        ></el-table-column>
+        >
+        </el-table-column>
         <el-table-column
           align="center"
           label="单价"
           prop="price"
           min-width="100"
           show-overflow-tooltip
-        ></el-table-column>
+        >
+          <template slot-scope="scope">
+            {{ scope.row.price | numToFixed }}
+          </template>
+        </el-table-column>
         <el-table-column
           align="center"
           label="数量"
-          prop="refundableQty"
+          prop="qty"
           min-width="100"
           show-overflow-tooltip
         ></el-table-column>
@@ -137,7 +149,11 @@
           prop="totalAmount"
           min-width="100"
           show-overflow-tooltip
-        ></el-table-column>
+        >
+          <template slot-scope="scope">
+            {{ scope.row.totalAmount | numToFixed }}
+          </template>
+        </el-table-column>
         <el-table-column
           align="center"
           label="返利类型"
@@ -146,14 +162,13 @@
           show-overflow-tooltip
         >
           <template slot-scope="scope">
-              <!-- v-for="item in scope.row.rebateWallets" -->
+            <!-- v-for="item in scope.row.rebateWallets" -->
             <el-tag
-            v-if="scope.row.customerWalletName2"
+              v-if="scope.row.customerWalletName2"
               type="success"
               size="small"
-
             >
-                {{ scope.row.customerWalletName2 }}
+              {{ scope.row.customerWalletName2 }}
             </el-tag>
           </template>
         </el-table-column>
@@ -163,14 +178,22 @@
           prop="payRebateAmount"
           min-width="100"
           show-overflow-tooltip
-        ></el-table-column>
+        >
+          <template slot-scope="scope">
+            {{ scope.row.payRebateAmount | numToFixed }}
+          </template>
+        </el-table-column>
         <el-table-column
           align="center"
           label="格力折扣"
           prop="totalDiscAmount"
           min-width="100"
           show-overflow-tooltip
-        ></el-table-column>
+        >
+          <template slot-scope="scope">
+            {{ scope.row.totalDiscAmount | numToFixed }}
+          </template>
+        </el-table-column>
         <el-table-column
           align="center"
           label="现金钱包"
@@ -179,12 +202,8 @@
           show-overflow-tooltip
         >
           <template slot-scope="scope">
-              <!-- v-for="item in scope.row.wallets" -->
-            <el-tag
-              type="success"
-              size="small"
-
-            >
+            <!-- v-for="item in scope.row.wallets" -->
+            <el-tag type="success" size="small">
               {{ scope.row.customerWalletName }}
             </el-tag>
           </template>
@@ -195,7 +214,11 @@
           prop="payAmount"
           min-width="100"
           show-overflow-tooltip
-        ></el-table-column>
+        >
+          <template slot-scope="scope">
+            {{ scope.row.payAmount | numToFixed }}
+          </template>
+        </el-table-column>
         <el-table-column
           align="center"
           label="是否直调"
@@ -215,7 +238,7 @@
           show-overflow-tooltip
         ></el-table-column>
 
-          <!-- <el-table-column
+        <!-- <el-table-column
           align="center"
           label="已退数量"
           prop="retiredQty"
@@ -247,8 +270,18 @@
     </div>
     <div class="page-footer">
       <div class="footer" :class="classObj">
-       <el-button :type="status?'info':'primary'" @click="openDeliverDialog" :disabled="detailData.examineStatus !== 'OK' || status">直调发货</el-button>
-        <el-button :type="status?'info':'primary'" @click="handleFinish" :disabled="detailData.examineStatus !== 'OK' || status">直调完成</el-button>
+        <el-button
+          :type="status ? 'info' : 'primary'"
+          @click="openDeliverDialog"
+          :disabled="detailData.examineStatus !== 'OK' || status"
+          >直调发货</el-button
+        >
+        <el-button
+          :type="status ? 'info' : 'primary'"
+          @click="handleFinish"
+          :disabled="detailData.examineStatus !== 'OK' || status"
+          >直调完成</el-button
+        >
         <!-- <el-button @click="goBack">关 闭</el-button> -->
       </div>
     </div>
@@ -352,6 +385,8 @@
           highlight-current-row
           stripe
           max-height="400"
+          show-summary
+          :summary-method="$getSummaries"
         >
           <el-table-column
             align="center"
@@ -430,21 +465,33 @@
             prop="price"
             min-width="100"
             show-overflow-tooltip
-          ></el-table-column>
+          >
+            <template slot-scope="scope">
+              {{ scope.row.price | numToFixed }}
+            </template>
+          </el-table-column>
           <el-table-column
             align="center"
             label="金额"
             prop="totalAmount"
             min-width="100"
             show-overflow-tooltip
-          ></el-table-column>
+          >
+            <template slot-scope="scope">
+              {{ scope.row.totalAmount | numToFixed }}
+            </template>
+          </el-table-column>
           <el-table-column
             align="center"
             label="返利"
             prop="payRebateAmount"
             min-width="100"
             show-overflow-tooltip
-          ></el-table-column>
+          >
+            <template slot-scope="scope">
+              {{ scope.row.payRebateAmount | numToFixed }}
+            </template>
+          </el-table-column>
 
           <el-table-column
             align="center"
@@ -511,7 +558,7 @@ export default {
       positionList: [],
 
       goodsList: [],
-        status:false
+      status: false,
     };
   },
 
@@ -546,18 +593,36 @@ export default {
     goBack() {
       this.$emit("backListFormDetail");
     },
-// 是否直调完成
-    directTransferStatus(val){
-      this.status =  val.retailOrderItemList.some(k=>{
-          return k.directTransferStatus == true
-        })
-        console.log(this.status,'4554545');
+    // 是否直调完成
+    directTransferStatus(val) {
+      this.status = val.retailOrderItemList.some((k) => {
+        return k.directTransferStatus == true;
+      });
+      console.log(this.status, "4554545");
     },
     // 获取详情
     getDetail() {
       getDetail({ id: this.listItem.id }).then((res) => {
+        if (res.data.retailOrderItemList) {
+          res.data.retailOrderItemList.forEach((item) => {
+            item.sums1 = [
+              "directTransferQty",
+              "qty",
+              "refundableQty",
+              "oldQty",
+            ];
+            item.sums2 = [
+              "totalAmount",
+              "payAmount",
+              "price",
+              "payRebateAmount",
+              "discAmount",
+              "totalDiscAmount",
+            ];
+          });
+        }
         this.detailData = res.data;
-           this.directTransferStatus(res.data)
+        this.directTransferStatus(res.data);
       });
     },
     // 直调完成

+ 1 - 1
src/views/supply/policy/components/retail_examine.vue

@@ -117,7 +117,7 @@
         <el-table-column
           align="center"
           label="数量"
-          prop="refundableQty"
+          prop="qty"
           min-width="100"
           show-overflow-tooltip
         ></el-table-column>

+ 26 - 14
src/views/supply/policy/components/retail_form.vue

@@ -221,8 +221,9 @@
         >
           <template slot-scope="scope">
             {{
-              (scope.row.price * scope.row.qty * (scope.row.rebateRate * 100)) /
-              100
+              ((scope.row.price * scope.row.qty * (scope.row.rebateRate * 100)) /
+              100)||0
+
             }}
           </template>
         </el-table-column>
@@ -433,6 +434,9 @@
           label-width="120px"
           size="small"
         >
+         <el-row v-if="factor.length" style="margin:0 0 20px 0">
+            引用销售政策说明:{{ factor.length ? factor[0].name : "" }}
+          </el-row>
           <el-row :gutter="20">
             <el-col :xs="24" :sm="6" :lg="6">
               <el-form-item label="销售政策">
@@ -444,6 +448,8 @@
                   :disabled="disabled"
                   style="width: 100%"
                 >
+                <el-option label="默认" :value="''"></el-option>
+
                   <el-option
                     v-for="(item, index) in policyList"
                     :key="index"
@@ -513,6 +519,9 @@
               @select-all="handleSelectionChange($event, 1, index)"
               @selection-change="handleSelectionChange($event, 1, index)"
               stripe
+              show-summary
+              :summary-method="$getSummaries"
+
             >
               <el-table-column
                 align="center"
@@ -593,6 +602,8 @@
             @select-all="handleSelectionChange"
             @selection-change="handleSelectionChange"
             stripe
+            show-summary
+            :summary-method="$getSummaries"
           >
             <el-table-column
               align="center"
@@ -1001,6 +1012,9 @@ export default {
       }
       for (let i = 0; i < data.records.length; i++) {
         data.records[i].qty = 1;
+
+        this.$set(data.records[i],'zong',data.records[i].qty * data.records[i].price)
+        data.records[i].sums1 = ['price', 'qty', 'zong'];
         // this.$set(data.records[i],'userList',this.userList)
       }
       if (fang) {
@@ -1008,7 +1022,6 @@ export default {
       } else {
         this.popDataArr.push(datas);
       }
-
       // consloe(this.popDataArr);
     },
     // 下一步获取某个政策条件比例数据
@@ -1099,11 +1112,10 @@ export default {
           this.$set(item, "userList", this.userList);
         });
 
-            if (this.goodsList.length && this.goodsList[0].wallets.length) {
-                this.mainForm.k3ServiceName = this.goodsList[0].wallets[0].serviceId;
-        this.mainForm.k3ServiceId = this.goodsList[0].wallets[0].serviceId;
-            }
-
+          if (this.goodsList.length &&  this.goodsList[0].wallets.length ) {
+              this.mainForm.k3ServiceName = this.goodsList[0].wallets[0].serviceId || '';
+             this.mainForm.k3ServiceId = this.goodsList[0].wallets[0].serviceId || '';
+          }
         this.cusIndex = 0;
         this.total = 0;
         this.popDataArr = [];
@@ -1126,10 +1138,10 @@ export default {
         } else {
           this.goodsList = arrData;
         }
-         if (this.goodsList.length && this.goodsList[0].wallets.length) {
-                this.mainForm.k3ServiceName = this.goodsList[0].wallets[0].serviceId;
-        this.mainForm.k3ServiceId = this.goodsList[0].wallets[0].serviceId;
-            }
+         if (this.goodsList.length &&  this.goodsList[0].wallets.length ) {
+              this.mainForm.k3ServiceName = this.goodsList[0].wallets[0].serviceId || '';
+             this.mainForm.k3ServiceId = this.goodsList[0].wallets[0].serviceId || '';
+          }
 
         this.goodsList.forEach((item) => {
           this.$set(item, "status1", "");
@@ -1504,7 +1516,8 @@ export default {
           //   ].dictValue;
           let params = {
             theTime: this.mainForm.date,
-
+            k3ServiceId:this.mainForm.k3ServiceId,
+            k3ServiceName:this.mainForm.k3ServiceName,
             remark: this.mainForm.remark,
             type: 2, // 1:普通零售单,2:政策零售单
             retailOrderItemList: this.goodsList,
@@ -1519,7 +1532,6 @@ export default {
             });
           } else {
             addData(params).then((res) => {
-              console.log(5585);
               this.$successMsg("添加成功");
               this.goBack();
               this.$parent.getList();

+ 5 - 1
src/views/supply/policy/policy_list.vue

@@ -252,7 +252,11 @@
               prop="price"
               min-width="100"
               show-overflow-tooltip
-            ></el-table-column>
+            >
+                <template slot-scope="scope">
+                {{ scope.row.price | numToFixed }}
+              </template>
+            </el-table-column>
             <el-table-column
               align="center"
               label="金额"