howie 3 jaren geleden
bovenliggende
commit
7bf5a0be77

+ 7 - 0
src/api/basic_data/material.js

@@ -33,6 +33,13 @@ export function getMaterialDetail(params) {
   })
 }
 
+export function getProductDelete(params) {
+  return request({
+    url: '/product-price/delete',
+    method: 'post',
+    params: {ids:params.join(',')}
+  })
+}
 
 export function getMachineLlist(params) {
   return request({

+ 41 - 4
src/views/basic_data/material/price_list.vue

@@ -50,10 +50,20 @@
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="销售类型" prop="saleTypeId">
-              <el-input
-                placeholder="请输入销售类型"
+              <el-select
                 v-model="screenForm.saleTypeId"
-              ></el-input>
+                filterable
+                placeholder="选择销售类型"
+                style="width: 100%"
+              >
+                <el-option label="全部" value=""></el-option>
+                <el-option
+                  v-for="item in ztypeList"
+                  :key="item.id"
+                  :label="item.saleName"
+                  :value="item.id"
+                ></el-option>
+              </el-select>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="12" :lg="6">
@@ -250,6 +260,13 @@
           ></el-table-column>
           <el-table-column
             align="center"
+            label="格力折扣"
+            prop="discAmount"
+            min-width="160"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            align="center"
             label="备注"
             prop="remark"
             min-width="160"
@@ -268,7 +285,12 @@
                 @click="handleRevoke(scope.row.id)"
                 >作废</el-button
               >
-              <el-button type="text" size="small" @click="">删除</el-button>
+              <el-button
+                type="text"
+                size="small"
+                @click="handleDelete(scope.row.id)"
+                >删除</el-button
+              >
             </template>
           </el-table-column>
         </el-table>
@@ -295,6 +317,8 @@ import Mixin from "@/mixin/index";
 import {
   getProductPriceList,
   handlePriceRevoke,
+  getProductDelete,
+  getTypeList,
 } from "@/api/basic_data/material";
 import { getDictList } from "@/api/common";
 import { downloadFiles, parseTime } from "@/utils/util";
@@ -315,6 +339,7 @@ export default {
         specification: "",
         startDate: "",
       },
+      ztypeList: [],
       dictList: {},
     };
   },
@@ -327,6 +352,14 @@ export default {
     addFn() {
       this.showDialogForm = true;
     },
+    handleDelete(id) {
+      this.hanleDeleteAllPromise(id).then((ids) => {
+        getProductDelete(ids).then((res) => {
+          this.$successMsg("删除成功");
+          this.getList();
+        });
+      });
+    },
     getList() {
       this.listLoading = true;
       let params = {
@@ -346,6 +379,10 @@ export default {
         this.listTotal = res.data.total;
         this.listLoading = false;
       });
+      getTypeList(params).then((res) => {
+        this.ztypeList = res.data.records;
+        // console.log(this.ztypeList, "type1111");
+      });
     },
     handleRevoke(id) {
       handlePriceRevoke({ id }).then((res) => {

+ 4 - 2
src/views/sales_policy/components/AddCondition.vue

@@ -510,7 +510,7 @@ export default {
       }
     },
     hanleAddModel() {
-      this.conditionBox.push([{}]);
+      this.conditionBox.push([]);
     },
     handleSubmit() {
       var tableData = [];
@@ -543,6 +543,7 @@ export default {
         this.$successMsg("添加成功");
         this.$parent.isCondition = 0;
         this.$parent.isFlag = 1;
+        Object.assign(this.$data,this.$options.data())
         this.$emit("handleSubmitCon", this.comCode);
       });
     },
@@ -594,11 +595,12 @@ export default {
               for (let k = 0; k < datas.length; k++) {
                 if (datas[k].id == this.conditList[i].id) {
                   this.conditList.splice(i,1)
+
                 }
               }
           }
         }
-
+         this.listTotal = this.conditList.length;
       }
     },
     handleSelectionAllChange(e) {

+ 1 - 3
src/views/sales_policy/components/AddPolicy.vue

@@ -400,9 +400,7 @@ export default {
     handleCondition(id, index) {
       deleteCondition({ id }).then((res) => {
         this.conditionList.splice(index, 1);
-        this.$children[9].conditionBox= [[], []]
-         this.$children[9].conditionBox.limit= ''
-          this.$children[9].conditionBox.popArr ={}
+        Object.assign(this.$children[9].$data,this.$children[9].$options.data())
         this.$successMsg("删除成功");
       });
     },

+ 2 - 3
src/views/sales_policy/components/Examine.vue

@@ -7,7 +7,6 @@
     </el-header>
     <div class="app-container">
       <div class="descriptions">
-
         <el-row>
           <el-col :span="4">销售政策编号</el-col>
           <el-col :span="4">{{ detail.code }}</el-col>
@@ -23,9 +22,9 @@
           <el-col :span="4">{{
             detail.type == "PROVISION" ? "配提" : "限量"
           }}</el-col>
-          <el-col :span="4">现金钱包</el-col>
-          <el-col :span="4"></el-col>
+          <el-col :span="4" style="background-color:#fff"></el-col>
           <el-col :span="4"></el-col>
+          <el-col :span="4" style="background-color:#fff"></el-col>
           <el-col :span="4"></el-col>
         </el-row>
         <el-row>

+ 27 - 18
src/views/sales_policy/policy_list.vue

@@ -41,6 +41,7 @@
                   type="datetime"
                   size="small"
                   placeholder="生效日期"
+                   value-format="yyyy-MM-dd HH:mm:ss"
                 >
                 </el-date-picker>
               </el-form-item>
@@ -48,12 +49,13 @@
           </el-row>
           <el-row :gutter="20">
             <el-col :xs="24" :ms="6" :lg="6">
-              <el-form-item label="" prop="startTime2">
+              <el-form-item label="" prop="endTime1">
                 <el-date-picker
-                  v-model="screenForm.startTime2"
+                  v-model="screenForm.endTime1"
                   type="datetime"
                   size="small"
                   placeholder="结束日期"
+                   value-format="yyyy-MM-dd HH:mm:ss"
                 >
                 </el-date-picker>
               </el-form-item>
@@ -66,6 +68,7 @@
                   type="datetime"
                   size="small"
                   placeholder="制表日期"
+                   value-format="yyyy-MM-dd HH:mm:ss"
                 >
                 </el-date-picker>
               </el-form-item>
@@ -92,15 +95,7 @@
             </el-col>
           </el-row>
           <el-row :gutter="20">
-            <el-col :xs="24" :ms="6" :lg="6">
-              <el-form-item label="" prop="inpu">
-                <el-input
-                  v-model="screenForm.input"
-                  placeholder="关闭人"
-                  size="small"
-                ></el-input>
-              </el-form-item>
-            </el-col>
+
 
             <el-col :xs="24" :ms="6" :lg="6">
               <el-form-item label="" prop="status">
@@ -139,6 +134,9 @@
                 </el-select>
               </el-form-item>
             </el-col>
+            <el-col :xs="24" :ms="6" :lg="6">
+
+            </el-col>
             <el-col :xs="24" :ms="6" :lg="6" class="tr">
               <el-form-item>
                 <el-button type="primary" size="small" @click="submitScreenForm"
@@ -246,8 +244,8 @@
           align="center"
         >
         </el-table-column>
-        <el-table-column prop="address" label="部门" align="center">
-        </el-table-column>
+        <!-- <el-table-column prop="address" label="部门" align="center"></el-table-column> -->
+
         <el-table-column
           prop="remark"
           label="表头备注"
@@ -327,7 +325,7 @@ export default {
       id: "",
       code: "",
       codeId: "",
-
+listLoading:false,
       policyId: "",
 
       isShow: 1,
@@ -350,16 +348,24 @@ export default {
       fileList: [],
       statusOptions: [
         {
-          value: 1,
+          vlaue: "",
+          label: "全部",
+        },
+        {
+          value: true,
           label: "已生效",
         },
         {
-          value: 0,
+          value: false,
           label: "未生效",
         },
       ],
       typeOptions: [
         {
+          vlaue: "",
+          label: "全部",
+        },
+        {
           vlaue: "PROVISION",
           label: "配提",
         },
@@ -386,10 +392,12 @@ export default {
       this.$store.dispatch("sales/hanlenewInfo");
     },
     getList() {
+        this.listLoading = true
       const params = {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
         code: this.screenForm.code,
+        type: this.screenForm.type,
         createBy: this.screenForm.createBy,
         endCreateTime: this.screenForm.endCreateTime,
         endTime1: this.screenForm.endTime1,
@@ -401,12 +409,13 @@ export default {
         startTime2: this.screenForm.startTime2,
         status: this.screenForm.status,
         title: this.screenForm.title,
-        type: this.screenForm.type,
+
       };
+      console.log(params,123);
       getList(params).then((res) => {
         this.dataList = res.data.records;
-
         this.listTotal = res.data.total;
+        this.listLoading = false
 
       });
       const paramsType = {

+ 32 - 5
src/views/supply/policy/components/retail_detail.vue

@@ -5,7 +5,7 @@
       <div class="title">提货进度</div>
     </div>
     <div class="progress-container">
-      <el-progress :text-inside="true" :stroke-width="26" :percentage="detailData.thjd || 0"></el-progress>
+      <el-progress :text-inside="true" :stroke-width="26" :percentage="detailData.thjd ? (detailData.thjd * 1000 / 10) : 0"></el-progress>
     </div>
 
     <div class="main-title">
@@ -76,8 +76,15 @@
         <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="订单金额" prop="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="返利类型" prop="customerWalletName2" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="返利金额" prop="rebateAmount" min-width="100" show-overflow-tooltip></el-table-column>
+<el-table-column align="center" label="返利类型" prop="customerWalletName2" min-width="100" show-overflow-tooltip>
+                <template slot-scope="scope">
+
+                  <el-tag type="success" size="small"  v-if="scope.row.customerWalletName2">
+                      {{scope.row.customerWalletName2}}
+                  </el-tag>
+
+                </template>
+               </el-table-column>        <el-table-column align="center" label="返利金额" prop="rebateAmount" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="格力折扣" prop="discAmount" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="现金钱包" prop="customerWalletName" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
@@ -92,7 +99,13 @@
         <el-table-column align="center" label="税率" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
       </el-table>
     </div>
-
+  <div class="page-footer">
+      <div class="footer" :class="classObj">
+        <!-- <el-button type="primary" @click="openDeliverDialog" :disabled="detailData.examineStatus !== 'OK'">直调发货</el-button> -->
+        <el-button type="primary" @click="handleFinish" :disabled="detailData.examineStatus !== 'OK'">直调完成</el-button>
+        <!-- <el-button @click="goBack">关 闭</el-button> -->
+      </div>
+    </div>
     <div v-if="isExamine">
       <div class="main-title">
         <div class="title">审批记录</div>
@@ -259,7 +272,21 @@ export default {
         this.detailData = res.data;
       })
     },
-
+ // 直调完成
+    handleFinish() {
+      this.$confirm('此操作将直调完成, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        finishData({
+          id: this.listItem.id
+        }).then(res => {
+          this.$successMsg();
+          this.getDetail();
+        })
+      }).catch(() => {});
+    },
     // 打开 直调发货
     openDeliverDialog() {
       this.isShowDeliverDialog = true;

+ 89 - 65
src/views/supply/policy/components/retail_form.vue

@@ -54,8 +54,10 @@
           <el-form-item label="单据日期" prop="date">
             <el-date-picker
               v-model="mainForm.date"
-              type="date"
-              value-format="yyyy-MM-dd"
+              type="datetime"
+
+              :picker-options="pickerOptions"
+                value-format="yyyy-MM-dd HH:mm:ss"
               style="width: 100%"
               placeholder="选择日期"
             >
@@ -222,14 +224,14 @@
         ></el-table-column>
         <el-table-column
           align="center"
-          label="数量"
+          label="数量"
           prop="qty"
           min-width="100"
           show-overflow-tooltip
         >
-          <template slot-scope="scope">
+          <!-- <template slot-scope="scope">
             <el-input v-model="scope.row.qty" size="small"></el-input>
-          </template>
+          </template> -->
         </el-table-column>
         <el-table-column
           align="center"
@@ -343,7 +345,7 @@
             <el-checkbox v-model="scope.row.isDirectTransfer"></el-checkbox>
           </template>
         </el-table-column>
-        <el-table-column
+        <!-- <el-table-column
           align="center"
           label="直调数量"
           prop="directTransferQty"
@@ -355,7 +357,7 @@
               size="small"
             ></el-input>
           </template>
-        </el-table-column>
+        </el-table-column> -->
         <el-table-column
           align="center"
           label="备注"
@@ -550,7 +552,7 @@
             :page-sizes="[10]"
             :page-size="10"
             layout="total, sizes, prev, pager, next, jumper"
-            :total="dataList.length"
+            :total="total"
           >
           </el-pagination>
         </div>
@@ -613,11 +615,10 @@
             </el-col>
           </el-row>
         </el-form>
-        <el-row type="flex" :gutter="20" style="margin: 10px 0">
-          <el-col>已选择限定机型</el-col>
-          <el-col>{{ comText("mainName") }}</el-col>
-          <el-col>{{ comText("specification") }}</el-col>
-          <el-col></el-col>
+        <el-row type="flex" :gutter="30" style="margin: 10px 0">
+          <el-col :span="10">已选择限定机型</el-col>
+          <el-col :span="8" class="ellipsis">{{ comText("materialName") }}</el-col>
+          <el-col :span="12" class="ellipsis">{{ comText("specification") }}</el-col>
           <el-col style="text-align: right">配提比例:{{ pop }}</el-col>
         </el-row>
         <template v-for="(item, index) in popArr">
@@ -635,7 +636,14 @@
               ><template slot-scope="scope">
                 <el-radio
                   v-model="radioObj['radio' + cusIndex]"
-                  :label="scope.row.id"
+                  :label=" scope.row.id +
+                  '&' +
+                  scope.row.policyId +
+                  '&' +
+                  scope.row.materialId +
+                  '&' +
+                  scope.row.policyConditionId
+                ""
                   >{{ "" }}</el-radio
                 >
               </template>
@@ -677,15 +685,10 @@
             </template>
           </el-table>
           <!-- 分页 -->
-          <div style="margin: 10px 0">
+          <div style="margin: 10px 0"   v-if="index + 1 == cusIndex">
             <el-pagination
-              @size-change="handleSizeChange"
-              @current-change="handleCurrentChange"
-              :current-page="currentPage"
-              :page-sizes="[10]"
-              :page-size="10"
-              layout="total, sizes, prev, pager, next, jumper"
-              :total="popDataArr[cusIndex - 1].length || 0"
+              layout="total"
+              :total="popDataArr[cusIndex - 1]?popDataArr[cusIndex - 1].length:0"
             >
             </el-pagination>
           </div>
@@ -694,7 +697,7 @@
           <el-button type="primary" @click="cusIndex -= 1">上一步</el-button>
           <el-button
             type="primary"
-            @click="handleCondition()"
+            @click="handleCondition"
             v-if="popArr.length != cusIndex"
             >下一步</el-button
           >
@@ -750,6 +753,7 @@ export default {
       pageSize: 10, // 每页数量
       listTotal: 0, // 列表总数
       cusIndex: 0,
+      total:0,
       radio: "",
       pop: "",
       popArr: [],
@@ -828,6 +832,7 @@ export default {
       popDataArr: [],
       radioObj: {},
       step: 0,
+      policyId:''
     };
   },
 
@@ -858,20 +863,32 @@ export default {
     },
     comText() {
       return (val) => {
-        const params = this.radio.split("&");
-        if (this.cusIndex - 1 == 0) {
+        if (this.cusIndex-1 ==0) {
+           const params = this.radio.split("&");
           return this.dataList.filter((k) => {
-            console.log(k, params[0]);
             return k.id == params[0];
-          })[0][val];
-        } else {
-          return this.popDataArr[this.cusIndex - 1].filter((k) => {
-            return k.id == params[0];
-          })[0][val];
+          })[0][val]
+
+        }else{
+          const  params =  this.radioObj['radio' + (this.cusIndex-1)].split("&")
+          return this.popDataArr[this.cusIndex - 2].filter(k=>{
+            return k.id == params[0]
+           })[0][val]
+
         }
+
+
       };
-      // console.log();
     },
+      pickerOptions({ $props }) {
+            return {
+               disabledDate: (time) => {
+            return time.getTime() < Date.now()-1 * 24 * 60 * 60 * 1000
+          }
+            };
+        }
+
+
   },
 
   created() {
@@ -884,9 +901,7 @@ export default {
       this.getDetail();
     }
   },
-  beforeUpdate() {
-
-  },
+  beforeUpdate() {},
   methods: {
     // 返回列表
     goBack() {
@@ -913,8 +928,10 @@ export default {
         pageSize: -1,
       }).then((res) => {
         console.log(res, "tyep");
-        this.policyList = res.data.records;
         this.screenForm.policyId = res.data.records[0].code;
+        this.policyList = res.data.records;
+        console.log(this.policyList,'policyList');
+
       });
     },
     getTypeList() {
@@ -957,6 +974,7 @@ export default {
           res.data.records[i].qty = 1;
         }
         this.dataList = res.data.records;
+        this.total = res.data.total
         console.log(this.dataList, "kkkk");
       });
     },
@@ -974,7 +992,7 @@ export default {
     },
     handleShow() {
       this.isShowDialog = true;
-      this.getPolicyList()
+      this.getPolicyList();
     },
     // 获取钱包列表
     getWalletList() {
@@ -1133,13 +1151,11 @@ export default {
           this.pop = res.data.pop;
           this.popArr = res.data.pop.split(":");
           this.popArr.splice(0, 1);
-          console.log(this.popArr);
-          console.log;
           for (let i = 0; i < this.popArr.length; i++) {
             this.$set(this.radioObj, "radio" + (i + 1), "");
           }
           this.step = this.cusIndex + 1;
-          this.screenForm.policyId = "";
+
           this.getConditionList(params[3], this.step);
         });
       } else {
@@ -1162,51 +1178,53 @@ export default {
       this.getConditionList(params[3], this.step);
     },
     getConditionList(policyConditionId, popType) {
-      let arr = []
+
       getConditionList({
         pageNum: this.currentPage,
         pageSize: this.pageSize,
         policyConditionId,
         popType,
       }).then((res) => {
-        console.log(this.cusIndex);
-         const datas = res.data.records
+
+        const datas = res.data.records;
         for (let i = 0; i < res.data.records.length; i++) {
           res.data.records[i].qty = 1;
         }
         if (this.popDataArr.length) {
+
           this.popDataArr.splice(this.cusIndex - 1, 1);
         }
         if (this.cusIndex == 0) {
+
           this.popDataArr = [];
         }
-
+    // this.popDataArr.push(datas)
         if (this.cusIndex == 1) {
-          for (let l = 0; l < this.dataList.length; l++) {
+           const params = this.radio.split("&");
+            for (let k = 0; k < datas.length; k++) {
 
-              for (let k = 0; k < datas.length; k++) {
-                            console.log(this.dataList[l].id == datas[k].id,'hahah',datas,this.dataList);
-                      if (this.dataList[l].id == datas[k].id) {
-                          datas.splice(k,1)
-                      }
+              if (params[2]== datas[k].materialId) {
+                datas.splice(k, 1);
               }
-          }
-           this.popDataArr.push(datas);
-        }else{
 
-          for (let j = 0; j <  this.popDataArr[this.cusIndex-1].length; j++) {
-             for (let k = 0; k < datas.length; k++) {
+            }
 
-                      if (this.dataList[l].id == datas[k].id) {
-                            datas.splice(k,1)
-                      }
-              }
+          this.popDataArr.push(datas);
 
+        } else {
+
+            const  params =  this.radioObj['radio' + (this.cusIndex-1)].split("&")
+            for (let k = 0; k < datas.length; k++) {
+              if (params[2] == datas[k].id) {
+                datas.splice(k, 1);
+              }
           }
+
           this.popDataArr.push(datas);
+
+
         }
 
-        // this.popDataArr.push(res.data.records);
 
       });
     },
@@ -1219,8 +1237,10 @@ export default {
 
         for (let j = 0; j < arrData.length; j++) {
           for (const key in this.radioObj) {
-            if (arrData[j].id == this.radioObj[key]) {
-              console.log(arrData[j], "xxxx");
+                  const params = this.radioObj[key].split("&");
+                  console.log(params);
+            if (arrData[j].id == params[0]) {
+
               this.goodsList = [...this.goodsList, arrData[j]];
             }
           }
@@ -1244,9 +1264,8 @@ export default {
         this.cusIndex = 0;
         this.radio = "";
         this.dataList = [];
-        this.screenForm.policyId = "";
-        this.screenForm.saleTypeCode = "";
 
+        this.policyId =this.screenForm.policyId
         this.isShowDialog = false;
       } else {
         this.$errorMsg("请选择");
@@ -1325,7 +1344,7 @@ export default {
             remark: this.mainForm.remark,
             type: 2, // 1:普通零售单,2:政策零售单
             retailOrderItemList: this.goodsList,
-            policyId: this.screenForm.policyId,
+            policyId:this.policyId,
           };
           if (this.listItem) {
             params.id = this.listItem.id;
@@ -1389,4 +1408,9 @@ export default {
     }
   }
 }
+.ellipsis{
+  overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+}
 </style>

+ 28 - 8
src/views/supply/policy/policy_list.vue

@@ -223,7 +223,7 @@
             <el-table-column
               align="center"
               label="总数量"
-              prop="totalQty"
+              prop="qty"
               min-width="100"
               show-overflow-tooltip
             ></el-table-column>
@@ -244,11 +244,22 @@
             ></el-table-column>
             <el-table-column
               align="center"
-              label="返利使用比例"
-              prop="rebateRate"
-              min-width="110"
+              label="返利类型"
+              prop="customerWalletName2"
+              min-width="100"
               show-overflow-tooltip
-            ></el-table-column>
+            >
+              <template slot-scope="scope">
+                <el-tag
+                  type="success"
+                  size="small"
+                  v-if="scope.row.customerWalletName2"
+                >
+                  {{ scope.row.customerWalletName2 }}
+                </el-tag>
+              </template>
+            </el-table-column>
+
             <el-table-column
               align="center"
               label="返利"
@@ -323,15 +334,24 @@
               fixed="right"
             >
               <template slot-scope="scope">
-                     <el-popconfirm
+                <el-popconfirm
                   v-if="scope.row.examineStatus === 'SAVE'"
                   style="margin-right: 10px"
-                  title="确定撤回?"
+                  title="确定提审?"
                   @onConfirm="handleSubmit(scope.row.id)"
                 >
                   <el-button slot="reference" type="text">提审</el-button>
                 </el-popconfirm>
-                <el-button type="text" @click="toForm(scope.row)"
+                <el-button
+                  v-if="scope.row.examineStatus == 'WAIT'"
+                  type="text"
+                  @click="toExamine(scope.row)"
+                  >审核</el-button
+                >
+                <el-button
+                  type="text"
+                  v-if="scope.row.examineStatus === 'SAVE'"
+                  @click="toForm(scope.row)"
                   >编辑</el-button
                 >
                 <el-popconfirm