Bläddra i källkod

销售页面修改

howie 3 år sedan
förälder
incheckning
b186a8a1d4

+ 11 - 1
src/store/modules/sales.js

@@ -1,6 +1,16 @@
+/*
+ * @Author: howie
+ * @Date: 2022-06-18 14:33:08
+ * @LastEditors: howie
+ * @LastEditTime: 2022-06-29 10:03:21
+ * @FilePath: \supply-front\src\store\modules\sales.js
+ * @Description:
+ *
+ * Copyright (c) 2022, All Rights Reserved.
+ */
 import {
   getId
-} from "@/api/supply/sales";
+} from "@/api/policy_list";
 
 const state = {
   code: '',

+ 2 - 2
src/views/basic_data/material/modify_list.vue

@@ -179,7 +179,7 @@
 
             <el-table-column
               align="center"
-              label="零售价"
+              label="格力折扣"
               prop="retailPrice"
               min-width="160"
               show-overflow-tooltip
@@ -212,7 +212,7 @@
             </el-table-column>
             <el-table-column
               align="center"
-              label="支付钱包"
+              label="现金钱包"
               prop="modifyPriceDepartment"
               min-width="160"
               show-overflow-tooltip

+ 7 - 75
src/views/basic_data/material/price_list.vue

@@ -106,7 +106,6 @@
           element-loading-text="Loading"
           border
           fit
-          highlight-current-row
           stripe
         >
           <el-table-column type="selection" align="center"></el-table-column>
@@ -120,18 +119,17 @@
           <el-table-column
             align="center"
             label="存货编码"
-            prop="categoryNumber"
+            prop="number"
             min-width="160"
             show-overflow-tooltip
           ></el-table-column>
           <el-table-column
             align="center"
             label="存货名称"
-            prop="categoryName"
+            prop="name"
             min-width="160"
             show-overflow-tooltip
           ></el-table-column>
-
           <el-table-column
             align="center"
             label="规格型号"
@@ -251,77 +249,7 @@ export default {
       currentPage: 1, // 当前页码
       pageSize: 10, // 每页数量
       listTotal: 0, // 列表总数
-
-      dataList: [
-        {
-          productCategory: "家用空调",
-          code: "2022051775",
-          name: "夏之凉变频1",
-          number: "",
-          specs: "DAD-26GW/",
-          salesType: "*一票机*",
-          company: "套",
-          lowerLimit: "",
-          rebateRatio: "",
-          effectiveDate: "",
-          ExpiryDate: "",
-          isPromote: "",
-          cancellation: "",
-          wholesaleOne: "3,299.00",
-          remarks: "*常规机*",
-        },
-        {
-          productCategory: "家用空调",
-          code: "2022051775",
-          name: "夏之凉变频1",
-          number: "",
-          specs: "DAD-26GW/",
-          salesType: "*一票机*",
-          company: "套",
-          lowerLimit: "",
-          rebateRatio: "",
-          effectiveDate: "",
-          ExpiryDate: "",
-          promotion: "",
-          cancellation: "",
-          wholesaleOne: "3,299.00",
-          remarks: "*常规机*",
-        },
-        {
-          productCategory: "家用空调",
-          code: "2022051775",
-          name: "夏之凉变频1",
-          number: "",
-          specs: "DAD-26GW/",
-          salesType: "*一票机*",
-          company: "套",
-          lowerLimit: "",
-          rebateRatio: "",
-          effectiveDate: "",
-          ExpiryDate: "",
-          promotion: "",
-          cancellation: "",
-          wholesaleOne: "3,299.00",
-          remarks: "*常规机*",
-        },
-        {
-          productCategory: "家用空调",
-          code: "2022051775",
-          name: "夏之凉变频1",
-          number: "",
-          specs: "DAD-26GW/",
-          salesType: "*一票机*",
-          company: "套",
-          lowerLimit: "",
-          rebateRatio: "",
-          effectiveDate: "",
-          ExpiryDate: "",
-          promotion: "",
-          cancellation: "",
-          wholesaleOne: "3,299.00",
-          remarks: "*常规机*",
-        },
-      ],
+      dataList: [],
       screenForm: {
         categoryId: "",
         endDate: "",
@@ -358,6 +286,7 @@ export default {
       };
       getProductPriceList(params).then((res) => {
         this.dataList = res.data.records;
+        console.log(res.data.records);
         this.listTotal = res.data.total;
         this.listLoading = false;
       });
@@ -370,4 +299,7 @@ export default {
 ::v-deep .el-select--small {
   width: 100%;
 }
+::v-deep .el-date-editor{
+  width: 100%;
+}
 </style>

+ 53 - 53
src/views/basic_data/material/relation_list.vue

@@ -12,12 +12,11 @@
         <el-row :gutter="20">
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="产品名称" prop="name">
-
               <el-input
                 placeholder="请输入产品名称"
                 v-model="screenForm.name"
               ></el-input>
-<!--
+              <!--
               <el-select placeholder="请选择产品品类" v-model="screenForm.name">
               <el-option label="默认" value=""></el-option>
                 <el-option
@@ -261,7 +260,7 @@
               <el-button
                 type="text"
                 class="textColor"
-                @click="editFn(scope.row.id, scope.row,scope.$index)"
+                @click="editFn(scope.row.id, scope.row, scope.$index)"
                 >编辑</el-button
               >
               <el-popconfirm
@@ -407,8 +406,10 @@ import {
   getMachineLlist,
   getMaterialList,
   getDistList,
+  getProductDetail,
 } from "@/api/basic_data/material";
 import { number } from "yargs";
+import { detailed } from "yargs-parser";
 export default {
   mixins: [Mixin],
   data() {
@@ -585,7 +586,10 @@ export default {
     },
 
     hanleType(e) {
-      console.log(e,'type');
+      console.log(e, this.DistType);
+      this.getMachineLlist(e);
+    },
+    getMachineLlist(e) {
       let params2 = {
         pageNum: this.machinePei.currentPage,
         pageSize: -1,
@@ -599,9 +603,8 @@ export default {
         this.machineList = res.data.records;
       });
     },
-
     hanleCode(e, i) {
-      console.log(e,'code');
+      console.log(e, "code");
       this.machineList.find((l) => {
         if (l.id == e) {
           this.$set(this.diaLogForm.items, i, {
@@ -611,7 +614,7 @@ export default {
             innerOutsideMachineId: l.id,
             model: l.model,
             name: l.name,
-            number: l.number ||'',
+            number: l.number || "",
             type: l.type,
             volume: l.volume,
           });
@@ -622,7 +625,6 @@ export default {
     hanleName(e) {
       this.materialLis.find((k) => {
         if (k.id == e) {
-          console.log(k.number, 4546);
           this.diaLogForm.productModel = k.specification;
           this.diaLogForm.productNumber = k.number;
           this.diaLogForm.volume = k.volume;
@@ -652,55 +654,53 @@ export default {
         this.listLoading = false;
       });
     },
-    editFn(id, row,index) {
-      this.hanleMachine();
-      this.type = 2;
-      this.diaLogForm = {
-        ...this.diaLogForm,
-        id,
-        adminCompanyId: row.adminCompanyId,
-        materialId: row.materialId,
-        type:row.type,
-      };
-      console.log(this.diaLogForm);
-      this.materialLis.find((k) => {
-        if (k.id == row.materialId) {
-          this.diaLogForm.productModel = k.specification;
-          this.diaLogForm.productNumber = k.number;
-          this.diaLogForm.volume = k.volume;
-        }
-      });
-        let params2 = {
-        pageNum: this.machinePei.currentPage,
-        pageSize: this.machinePei.pageSize,
-        model: this.machinePei.model,
-        name: this.machinePei.name,
-        number: this.machinePei.number,
-        type: row.type,
-        volume: this.machinePei.volume,
-      };
-      getMachineLlist(params2).then((res) => {
-        console.log(res.data.records,'kkk');
-        res.data.records.find((l) => {
-        if (l.id == row.number) {
+    editFn(id, row, index) {
+      let dateils = null;
+      getProductDetail({ id: id }).then((res) => {
+        dateils = res.data;
+        console.log(dateils);
+        this.diaLogForm.materialId = dateils.materialId;
+        this.materialLis.find((k) => {
+          if (k.id == dateils.materialId) {
+            this.diaLogForm.productModel = k.specification;
+            this.diaLogForm.productNumber = k.number;
+            this.diaLogForm.volume = k.volume;
+          }
+        });
 
-          this.$set(this.diaLogForm.items, index, {
-            id: "",
-            machineConfigureId: l.id,
-            parentId: "",
-            innerOutsideMachineId: l.id,
-            model: l.model,
-            name: l.name,
-            number: l.number,
-            type: l.type,
-            volume: l.volume,
+        getDistList({ sysDictEnum: "MACHINE_CONFIGURE" }).then((disType) => {
+          disType.data.find((q) => {
+            if (q.dictCode == dateils.items[0].type) {
+              this.diaLogForm.type = q.dictCode;
+              this.getMachineLlist(q.dictCode);
+              this.machineList.map((l) => {
+              console.log(l.id == dateils.items[0].machineConfigureId);
+                if (l.id == dateils.items[0].machineConfigureId) {
+                  this.$set(this.diaLogForm.items, 0, {
+                    id: "",
+                    machineConfigureId: l.id,
+                    parentId: "",
+                    innerOutsideMachineId: l.id,
+                    model: l.model,
+                    name: l.name,
+                    number: l.number || "",
+                    type: l.type,
+                    volume: l.volume,
+                  });
+                  return;
+                }
+              });
+            }
           });
-        }
-      });
-      });
 
-      this.showDialogForm = true;
+          this.DistType = disType.data;
+        });
+
+        //  const machineObj =   this.getMachineLlist(dateils.items[0].type)
+        console.log(this.diaLogForm, "lll");
 
+        this.showDialogForm = true;
+      });
     },
     hanleInfo() {
       if (this.type === 1) {

+ 5 - 3
src/views/sales_policy/codealer_list.vue

@@ -51,8 +51,8 @@
     <el-main>
       <el-table :data="dataList" border style="width: 100%">
         <el-table-column prop="name" label="操作" width="120" align="center">
-          <template slot-scope>
-            <el-button type="text" size="small" @click="">详情</el-button>
+          <template slot-scope="scope">
+            <el-button type="text" size="small" @click=" id = scope.row.id ,isShow=false">详情</el-button>
           </template>
         </el-table-column>
         <el-table-column prop="status" label="状态" width="120" align="center">
@@ -110,7 +110,7 @@
       </el-pagination>
     </div>
   </el-container>
-  <Distributor v-else />
+  <Distributor v-else :cid='id' />
 </template>
 
 <script>
@@ -122,6 +122,7 @@ export default {
   data() {
     return {
       isShow: true,
+      id:'',
       input: "",
       dataList: [],
       searchForm: {
@@ -133,6 +134,7 @@ export default {
   },
   methods: {
     getList() {
+
       this.listLoading = true;
       const params = {
         pageNum: this.currentPage,

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

@@ -171,12 +171,13 @@
           <el-button type="primary" size="small" @click="handleSubmit"
             >保存</el-button
           >
-          <el-button type="primary" size="small" @click="">重置</el-button>
+
         </el-col>
         <el-col :xs="24" :sm="12" :lg="12" :offset="0" class="tr">
           <el-button type="primary" size="small" @click="hanleAddModel"
             >添加</el-button
           >
+            <el-button type="primary" size="small" @click="handleresale">重置</el-button>
         </el-col>
       </el-row>
     </el-footer>
@@ -428,7 +429,6 @@ export default {
       type: "",
       saleTypeCode: "",
       arrIndex: 0,
-
       popArr: {},
     };
   },
@@ -623,6 +623,9 @@ export default {
         this.$errorMsg("请选择内容");
       }
     },
+    handleresale(){
+     Object.assign(this.$data, this.$options.data());
+    }
   },
   components: {
     AddModel,

+ 300 - 274
src/views/sales_policy/components/AddPolicy.vue

@@ -1,280 +1,306 @@
 <template>
   <div>
-    <div v-show="isCondition==0">
-    <el-header height="50px" class="header">
-      <el-page-header
-        @back="($parent.isShow = 1), ($parent.isFlag = '')"
-        content="详情页面"
-      >
-      </el-page-header>
-    </el-header>
-    <div class="app-container">
-      <div class="screen-container">
-        <h4>销售政策信息</h4>
-        <el-divider></el-divider>
-        <el-form
-          :model="searchForm"
-          :rules="rules"
-          ref="searchForm"
-          label-width="120px"
-          size="small"
-          class="demo-searchForm"
+    <div v-show="isCondition == 0">
+      <el-header height="50px" class="header">
+        <el-page-header
+          @back="($parent.isShow = 1), ($parent.isFlag = '')"
+          content="详情页面"
         >
-          <el-row>
-            <el-col :xs="24" :ms="12" :lg="12">
-              <el-form-item label="销售政策编号" prop="code">
-                <el-input
-                  disabled
-                  v-model="searchForm.code"
-                  placeholder="如未填写,则系统自动生成"
-                ></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :xs="24" :ms="12" :lg="12">
-              <el-form-item label="销售政策说明" prop="title">
-                <el-input
-                  v-model="searchForm.title"
-                  placeholder="销售政策说明"
-                ></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :xs="24" :ms="12" :lg="12">
-              <el-form-item label="销售政策类型" prop="type">
-                <el-select
-                  size="small"
-                  v-model="searchForm.type"
-                  placeholder="销售政策类型"
-                  class="select_height"
-                >
-                  <el-option
-                    v-for="(item, index) in typeOptions"
-                    :key="index"
-                    :label="item.label"
-                    :value="item.value"
+        </el-page-header>
+      </el-header>
+      <div class="app-container">
+        <div class="screen-container">
+          <h4>销售政策信息</h4>
+          <el-divider></el-divider>
+          <el-form
+            :model="searchForm"
+            :rules="rules"
+            ref="searchForm"
+            label-width="120px"
+            size="small"
+            class="demo-searchForm"
+          >
+            <el-row>
+              <el-col :xs="24" :ms="12" :lg="12">
+                <el-form-item label="销售政策编号" prop="code">
+                  <el-input
+                    disabled
+                    v-model="searchForm.code"
+                    placeholder="如未填写,则系统自动生成"
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :xs="24" :ms="12" :lg="12">
+                <el-form-item label="销售政策说明" prop="title">
+                  <el-input
+                    v-model="searchForm.title"
+                    placeholder="销售政策说明"
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :xs="24" :ms="12" :lg="12">
+                <el-form-item label="销售政策类型" prop="type">
+                  <el-select
+                    size="small"
+                    v-model="searchForm.type"
+                    placeholder="销售政策类型"
+                    class="select_height"
+                  >
+                    <el-option
+                      v-for="(item, index) in typeOptions"
+                      :key="index"
+                      :label="item.label"
+                      :value="item.value"
+                    >
+                    </el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :xs="24" :ms="12" :lg="12">
+                <el-form-item label="产品品类" prop="name">
+                  <el-select v-model="value" placeholder="请选择">
+                    <el-option
+                      v-for="(item, index) in walletList"
+                      :key="index"
+                      :label="item.mainName"
+                      :value="item.mainId"
+                    >
+                    </el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+              <el-col :xs="24" :ms="12" :lg="12">
+                <el-form-item label="生效日期" prop="startTime">
+                  <el-date-picker
+                    v-model="searchForm.startTime"
+                    type="datetime"
+                    placeholder="生效日期"
+                    default-time="00:00:00"
+                    value-format="yyyy-MM-dd HH:mm:ss"
                   >
-                  </el-option>
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :xs="24" :ms="12" :lg="12">
-              <el-form-item label="产品品类" prop="name">
-                <el-select v-model="value" placeholder="请选择">
-                  <el-option
-                    v-for="(item, index) in walletList"
-                    :key="index"
-                    :label="item.mainName"
-                    :value="item.mainId"
+                  </el-date-picker> </el-form-item
+              ></el-col>
+              <el-col :xs="24" :ms="12" :lg="12">
+                <el-form-item label="失效日期" prop="endTime">
+                  <el-date-picker
+                    v-model="searchForm.endTime"
+                    type="datetime"
+                    placeholder="失效日期"
+                    default-time="00:00:00"
+                    value-format="yyyy-MM-dd HH:mm:ss"
                   >
-                  </el-option>
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :xs="24" :ms="12" :lg="12">
-              <el-form-item label="生效日期" prop="startTime">
-                <el-date-picker
-                  v-model="searchForm.startTime"
-                  type="datetime"
-                  placeholder="生效日期"
-                  default-time="00:00:00"
-                  value-format="yyyy-MM-dd HH:mm:ss"
+                  </el-date-picker> </el-form-item
+              ></el-col>
+              <el-col :xs="24" :ms="24" :lg="24">
+                <el-form-item label="表头备注" prop="remark">
+                  <el-input
+                    v-model="searchForm.remark"
+                    placeholder="新风机变频挂机。按提货数量1:3开单"
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :xs="24" :ms="24" :lg="24">
+                <el-form-item label="政策封面图" prop="imgSrc">
+                  <ImageUpload :fileList="fileList" :multiple="false" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </el-form>
+        </div>
+        <div class="mymian-container">
+          <el-row>
+            <el-divider></el-divider>
+            <el-row type="flex">
+              <el-col :span="12">
+                <h4 style="display: inline-block; margin-right: 20px">
+                  货品信息
+                </h4>
+                <el-upload
+                  class="import-btn"
+                  :action="baseURL + 'student/import'"
+                  :http-request="handleImport"
+                  :file-list="importFileList"
+                  :show-file-list="false"
                 >
-                </el-date-picker> </el-form-item
-            ></el-col>
-            <el-col :xs="24" :ms="12" :lg="12">
-              <el-form-item label="失效日期" prop="endTime">
-                <el-date-picker
-                  v-model="searchForm.endTime"
-                  type="datetime"
-                  placeholder="失效日期"
-                  default-time="00:00:00"
-                  value-format="yyyy-MM-dd HH:mm:ss"
+                  <el-button size="small">导入货品价格表</el-button>
+                </el-upload>
+                <el-button size="small" @click="hanleDownloadFiles"
+                  >下载模板</el-button
                 >
-                </el-date-picker> </el-form-item
-            ></el-col>
-            <el-col :xs="24" :ms="24" :lg="24">
-              <el-form-item label="表头备注" prop="remark">
-                <el-input
-                  v-model="searchForm.remark"
-                  placeholder="新风机变频挂机。按提货数量1:3开单"
-                ></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :xs="24" :ms="24" :lg="24">
-              <el-form-item label="政策封面图" prop="imgSrc">
-                <ImageUpload :fileList="fileList" :multiple="false" />
-              </el-form-item>
-            </el-col>
+              </el-col>
+            </el-row>
+            <el-divider></el-divider>
           </el-row>
-        </el-form>
-      </div>
-      <div class="mymian-container">
-        <el-row>
-          <el-divider></el-divider>
-          <el-row type="flex">
-            <el-col :span="12">
-              <h4 style="display: inline-block; margin-right: 20px">
-                货品信息
-              </h4>
-              <el-upload
-                class="import-btn"
-                :action="baseURL + 'student/import'"
-                :http-request="handleImport"
-                :file-list="importFileList"
-                :show-file-list="false"
-              >
-                <el-button size="small">导入货品价格表</el-button>
-              </el-upload>
-              <el-button size="small" @click="hanleDownloadFiles"
-                >下载模板</el-button
+          <el-table
+            v-loading="listLoading"
+            :data="dataList"
+            element-loading-text="Loading"
+            border
+            fit
+            highlight-current-row
+            stripe
+          >
+            <el-table-column
+              fixed
+              prop="num"
+              label="序号"
+              width="50"
+              align="center"
+            >
+            </el-table-column>
+            <el-table-column
+              prop="materialNumber"
+              label="货品编码"
+              align="center"
+            >
+            </el-table-column>
+            <el-table-column
+              prop="materialName"
+              label="货品名称"
+              align="center"
+            >
+            </el-table-column>
+            <el-table-column
+              prop="specification"
+              label="规格型号"
+              align="center"
+            >
+            </el-table-column>
+            <el-table-column
+              prop="saleTypeCode"
+              label="销售类型编码"
+              width="500"
+              align="center"
+            >
+            </el-table-column>
+            <el-table-column
+              prop="saleTypeName"
+              label="销售类型"
+              align="center"
+            >
+            </el-table-column>
+            <el-table-column prop="price" label="单价" align="center">
+            </el-table-column>
+            <el-table-column label="支付钱包" align="center">
+              <template slot-scope="scope">
+                <el-tag
+                  style="margin: 5px"
+                  type="success"
+                  size="small"
+                  v-for="item in scope.row.walletRelaList"
+                  >{{ item.walletName }}</el-tag
+                >
+              </template>
+            </el-table-column>
+            <el-table-column fixed="right" label="操作" align="center">
+              <template slot-scope="scope">
+                <el-popconfirm
+                  confirm-button-text="好的"
+                  cancel-button-text="不用了"
+                  icon="el-icon-info"
+                  icon-color="red"
+                  title="内容确定删除吗?"
+                  @onConfirm="hanleDelete(scope.row.id)"
+                >
+                  <el-button
+                    slot="reference"
+                    type="text"
+                    class="textColor el-popover-left"
+                    >删除</el-button
+                  >
+                </el-popconfirm>
+              </template>
+            </el-table-column>
+          </el-table>
+          <!-- 分页 -->
+          <div style="margin: 20px">
+            <el-pagination
+              @size-change="handleSizeChange"
+              @current-change="handleCurrentChange"
+              :current-page="currentPage"
+              :page-sizes="[10, 20, 30, 50]"
+              :page-size="10"
+              layout="total, sizes, prev, pager, next, jumper"
+              :total="listTotal"
+            >
+            </el-pagination>
+          </div>
+          <el-row>
+            <el-divider></el-divider>
+            <el-row type="flex">
+              <el-col :span="12">
+                <h4 style="display: inline-block; margin-right: 20px">
+                  条件信息
+                </h4>
+                <el-button size="small" @click="isCondition = 1"
+                  >添加</el-button
+                ></el-col
               >
-            </el-col>
+            </el-row>
+            <el-divider></el-divider>
           </el-row>
-          <el-divider></el-divider>
-        </el-row>
-        <el-table
-          v-loading="listLoading"
-          :data="dataList"
-          element-loading-text="Loading"
-          border
-          fit
-          highlight-current-row
-          stripe
-        >
-          <el-table-column
-            fixed
-            prop="num"
-            label="序号"
-            width="50"
-            align="center"
-          >
-          </el-table-column>
-          <el-table-column
-            prop="materialNumber"
-            label="货品编码"
-            align="center"
+          <el-table
+            v-loading="listLoading"
+            :data="conditionList"
+            element-loading-text="Loading"
+            border
+            fit
+            highlight-current-row
+            stripe
           >
-          </el-table-column>
-          <el-table-column prop="materialName" label="货品名称" align="center">
-          </el-table-column>
-          <el-table-column prop="specification" label="规格型号" align="center">
-          </el-table-column>
-          <el-table-column
-            prop="saleTypeCode"
-            label="销售类型编码"
-            width="500"
-            align="center"
-          >
-          </el-table-column>
-          <el-table-column prop="saleTypeName" label="销售类型" align="center">
-          </el-table-column>
-          <el-table-column prop="price" label="单价" align="center">
-          </el-table-column>
-          <el-table-column label="支付钱包" align="center">
-            <template slot-scope="scope">
-                <el-tag style="margin:5px" type="success" size="small" v-for=" item  in  scope.row.walletRelaList">{{item.walletName}}</el-tag>
-            </template>
-          </el-table-column>
-          <el-table-column fixed="right" label="操作" align="center">
-            <template slot-scope="scope">
-              <el-popconfirm
-                confirm-button-text="好的"
-                cancel-button-text="不用了"
-                icon="el-icon-info"
-                icon-color="red"
-                title="内容确定删除吗?"
-                @onConfirm="hanleDelete(scope.row.id)"
-              >
+            <el-table-column
+              fixed
+              type="index"
+              label="序号"
+              width="50"
+              align="center"
+            >
+            </el-table-column>
+            <el-table-column prop="name" label="限定条件" align="center">
+              <template slot-scope="scope">
+                限定条件{{ scope.$index + 1 }}
+              </template>
+            </el-table-column>
+            <el-table-column
+              fixed="right"
+              width="150"
+              label="操作"
+              align="center"
+            >
+              <template slot-scope="scope">
                 <el-button
-                  slot="reference"
                   type="text"
-                  class="textColor el-popover-left"
+                  size="small"
+                  @click="handleCondition(scope.row.id, scope.$index)"
                   >删除</el-button
                 >
-              </el-popconfirm>
-            </template>
-          </el-table-column>
-        </el-table>
-        <!-- 分页 -->
-        <div style="margin: 20px">
-          <el-pagination
-            @size-change="handleSizeChange"
-            @current-change="handleCurrentChange"
-            :current-page="currentPage"
-            :page-sizes="[10, 20, 30, 50]"
-            :page-size="10"
-            layout="total, sizes, prev, pager, next, jumper"
-            :total="listTotal"
-          >
-          </el-pagination>
+              </template>
+            </el-table-column>
+          </el-table>
         </div>
-        <el-row>
-          <el-divider></el-divider>
-          <el-row type="flex">
-            <el-col :span="12">
-              <h4 style="display: inline-block; margin-right: 20px">
-                条件信息
-              </h4>
-              <el-button size="small" @click="isCondition=1"
-                >添加</el-button
-              ></el-col
-            >
-          </el-row>
-          <el-divider></el-divider>
-        </el-row>
-        <el-table
-          v-loading="listLoading"
-          :data="conditionList"
-          element-loading-text="Loading"
-          border
-          fit
-          highlight-current-row
-          stripe
-        >
-          <el-table-column
-            fixed
-            type="index"
-            label="序号"
-            width="50"
-            align="center"
-          >
-          </el-table-column>
-          <el-table-column prop="name" label="限定条件" align="center">
-            <template slot-scope="scope">
-              限定条件{{scope.$index+1}}
-            </template>
-          </el-table-column>
-          <el-table-column
-            fixed="right"
-            width="150"
-            label="操作"
-            align="center"
-          >
-            <template slot-scope="scope">
-              <el-button type="text" size="small" @click="handleCondition(scope.row.id,scope.$index)">删除</el-button>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <div>
-        <el-row>
-          <el-divider></el-divider>
-          <el-row type="flex" align="middle">
-            <el-col :span="2">
-              <h4>经销商信息</h4>
-            </el-col>
+        <div>
+          <el-row>
+            <el-divider></el-divider>
+            <el-row type="flex" align="middle">
+              <el-col :span="2">
+                <h4>经销商信息</h4>
+              </el-col>
+            </el-row>
+            <el-divider></el-divider>
           </el-row>
-          <el-divider></el-divider>
-        </el-row>
-        <Transfer @handleAddPolicy="handleAddPolicy" />
+          <Transfer @handleAddPolicy="handleAddPolicy" />
+        </div>
       </div>
     </div>
-  </div>
-  <AddCondition v-show="isCondition==1"  @handleSubmitCon="handleSubmitCon"/>
+    <AddCondition
+      v-show="isCondition == 1"
+      @handleSubmitCon="handleSubmitCon"
+    />
   </div>
 </template>
 
 <script>
-import { mapState,mapMutations } from "vuex";
+import { mapState, mapMutations } from "vuex";
 import Minxin from "@/mixin";
 import {
   addPoliy,
@@ -296,7 +322,7 @@ export default {
     return {
       input: "",
       baseURL: "",
-      isCondition:0,
+      isCondition: 0,
       searchForm: {
         code: "",
         endTime: "",
@@ -334,6 +360,7 @@ export default {
   },
   computed: mapState({
     comCode: (state) => {
+      console.log(state, "kkkk");
       return state.sales.code;
     },
     // newForm:(state) => {
@@ -343,32 +370,31 @@ export default {
     //   return state.sales.fileList;
     // },
   }),
-  beforeUpdate() {
-    this.searchForm.code = this.comCode
+  mounted() {
+    // console.log(this.comCode, "kkjk");
+    this.searchForm.code = this.comCode;
+  },
+  updated() {
+        console.log(this.comCode, "kkjk");
+    this.searchForm.code = this.comCode;
   },
   created() {
-
     this.getCommonApi();
     if (this.$parent.isFlag) {
-
       // this.handletwoList()
     }
   },
-
-  updated() {
-
-  },
   methods: {
-    ...mapMutations('sales',['initData']),
+    ...mapMutations("sales", ["initData"]),
     //下载excel模板
     hanleDownloadFiles() {
       downloadFiles("/policy/download");
     },
-    handleCondition(id,index){
-      deleteCondition({id}).then(res=>{
-            this.conditionList.splice(index,1)
-        this.$successMsg('删除成功')
-      })
+    handleCondition(id, index) {
+      deleteCondition({ id }).then((res) => {
+        this.conditionList.splice(index, 1);
+        this.$successMsg("删除成功");
+      });
     },
     getCommonApi() {
       // this.handletwoList()
@@ -397,15 +423,15 @@ export default {
         this.walletList = res.data.records;
       });
     },
-     handleSubmitCon(){
-       const params = {
+    handleSubmitCon() {
+      const params = {
         policyId: this.comCode,
       };
       // 获取条件政策
       getConditionList(params).then((res) => {
         this.conditionList = res.data;
       });
-  },
+    },
     // 导入
     async handleImport(param) {
       this.importLoading = true;
@@ -486,7 +512,7 @@ export default {
           examineStatus: "",
 
           id: "",
-          imgSrc: this.fileList.length?this.fileList[0].url:'',
+          imgSrc: this.fileList.length ? this.fileList[0].url : "",
           policyCustomers: arr,
           remark: "",
           status: true,
@@ -498,7 +524,7 @@ export default {
           console.log(res);
           this.$successMsg("新增成功");
           this.fileList = [];
-          this.$parent.getList()
+          this.$parent.getList();
           this.$parent.isShow = 1;
         });
         return;

+ 15 - 4
src/views/sales_policy/components/Distributor.vue

@@ -138,7 +138,7 @@
           align="center"
         >
         </el-table-column>
-        <el-table-column fixed="right" label="操作" align="center" width="200">
+        <el-table-column v-if="!$store.getters.customerId" fixed="right" label="操作" align="center" width="200">
           <template slot-scope="scope">
             <el-button
               type="text"
@@ -210,6 +210,12 @@ import Minxin from "@/mixin";
 
 export default {
   mixins: [Minxin],
+  props:{
+    cid:{
+      type:String,
+      default:''
+    }
+  },
   data() {
     return {
       dialogVisible: false,
@@ -224,6 +230,7 @@ export default {
         title: "",
       },
       id: "",
+      ids:[],
       dataList: [],
       detail: {},
       radio: "",
@@ -246,11 +253,12 @@ export default {
       console.log(e);
     },
     getList() {
-      this.listLoading = true;
+      if (this.cid) {
+         this.listLoading = true;
       const params = {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
-        policyId: "",
+        policyId: this.cid,
       };
       getCustomerList(params).then((res) => {
         this.dataList = res.data.records;
@@ -260,6 +268,7 @@ export default {
       //   this.ruleForm = res.data;
       // });
       // this.listLoading = false;
+      }
     },
     handleEdit() {
       if (this.ids.length) {
@@ -273,8 +282,10 @@ export default {
       done();
     },
     hanleDelete() {},
+
     handleInfo() {
-      let ids = this.id ? [this.id] : this.ids;
+
+      let ids = this.id && typeof this.id != Array ? [this.id] : this.ids;
       eidtBatch({
         policyCustomerIds: ids.join(","),
         limitTakeNum: this.limitTakeNum,

+ 1 - 0
src/views/sales_policy/components/Examine.vue

@@ -367,6 +367,7 @@ export default {
       }).then((res) => {
         this.$successMsg("已提交审核");
         this.isShow = 1;
+        this.$parent.getList()
       });
     },
   },

+ 57 - 23
src/views/sales_rebate/rebate_list.vue

@@ -131,10 +131,22 @@
           </template>
         </el-table-column>
       </el-table>
-      <Pagination />
+      <!-- 分页 -->
+      <div class="fr">
+        <el-pagination
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :current-page="currentPage"
+          :page-sizes="[10, 20, 30, 50]"
+          :page-size="10"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="listTotal"
+        >
+        </el-pagination>
+      </div>
     </div>
     <div>
-      <el-dialog :visible.sync="dialogVisible" width="50%" @close="hanelclose">
+      <el-dialog :visible.sync="dialogVisible" width="50%" @close="hanelclose" title="返利类型">
         <el-form
           :model="dialogForm"
           ref="dialogForm"
@@ -145,31 +157,17 @@
           <el-form-item label="返利使用钱包" prop="name">
             <el-input
               v-model="dialogForm.name"
-              :disabled="type == 3"
+              :readonly="type == 3"
             ></el-input>
           </el-form-item>
-          <el-form-item label="产品使用品类" prop="mainName">
-            <el-select
-              v-model="dialogForm.mainName"
-              :disabled="type == 3"
-              placeholder="请选择品类"
-              size="small"
-            >
-              <el-option
-                v-for="item in dictListData"
-                :key="item.dictCode"
-                :label="item.dictValue"
-                :value="item.dictCode"
-              >
-              </el-option>
-            </el-select>
-          </el-form-item>
+
           <el-form-item label="销售类型编码" prop="saleTypeCode">
             <el-select
               v-model="dialogForm.saleTypeCode"
               :disabled="type == 3"
+              @change="handleChange"
               placeholder="请选择类型编码"
-              size="small"
+
             >
               <el-option
                 v-for="item in typeList"
@@ -182,14 +180,28 @@
           </el-form-item>
           <el-form-item label="销售类型名称" prop="saleTypeName">
             <el-input
+
               v-model="dialogForm.saleTypeName"
-              :disabled="type == 3"
+              :readonly="type == 3"
             ></el-input>
           </el-form-item>
+           <el-form-item label="产品使用品类" prop="mainName">
+            <el-input v-model="dialogForm.mainName"  :readonly="type == 3" ></el-input>
+
+          <!-- <el-select v-model="dialogForm.mainId" @change="handleChange">
+              <el-option
+                v-for="(item, index) in productList"
+                :key="index"
+                :label="item.productCategoryName"
+                :value="item.productCategoryNumber"
+              >
+              </el-option>
+            </el-select> -->
+          </el-form-item>
           <el-form-item label="返利折扣比例" prop="rabateRate">
             <el-input
               placeholder="例如:0.1=1折"
-              :disabled="type == 3"
+              :readonly="type == 3"
               v-model="dialogForm.rabateRate"
             ></el-input>
           </el-form-item>
@@ -225,6 +237,7 @@ import {
   updateWallet,
   getWalletList,
   getWalletDetail,
+  getProductList
 } from "@/api/policy_list";
 
 export default {
@@ -326,8 +339,26 @@ export default {
       };
       getWalletList(params).then((res) => {
         this.dataList = res.data.records;
+               this.listTotal = res.data.total;
         this.listLoading = false;
       });
+       getProductList({
+        productCategoryName: "",
+        productCategoryNumber: "",
+      }).then((res) => {
+        this.productList = res.data;
+      });
+    },
+    handleChange(e){
+      console.log(e,this.typeList);
+
+        this.typeList.find(k=>{
+              if (e == k.saleCode) {
+                 this.dialogForm.saleTypeName = k.saleName
+                  this.dialogForm.mainId = k.mainId
+                  this.dialogForm.mainName = k.mainName
+              }
+        })
     },
      handleSwitch(e,walletRebateId){
         updateWallet({
@@ -335,7 +366,7 @@ export default {
         status: e,
        }).then((res) => {
           this.$successMsg("状态已更改");
-          this.hanleReset();
+          // this.hanleReset();
         });
     },
     hanleEdit(item) {
@@ -444,4 +475,7 @@ export default {
 .el-switch.is-disabled {
   opacity: inherit;
 }
+::v-deep .el-select{
+  width: 100%;
+}
 </style>

+ 27 - 18
src/views/sales_rebate/salestype_list.vue

@@ -89,7 +89,7 @@
               <div style="z-index: 99">
                 <el-switch
                   v-model="scope.row.status"
-                  @change="handleSwitch($event,scope.row.id)"
+                  @change="handleSwitch($event, scope.row.id)"
                   :active-text="scope.row.status ? '已启用' : '已禁用'"
                 >
                 </el-switch>
@@ -121,12 +121,9 @@
             <el-popconfirm
               title="这是一段内容确定删除吗?"
               style="margin-left: 10px"
+              @onConfirm="hanleDatele(scope.row.id)"
             >
-              <el-button
-                slot="reference"
-                type="text"
-                size="small"
-                @click="hanleDatele(scope.row.id)"
+              <el-button slot="reference" type="text" size="small"
                 >删除</el-button
               >
             </el-popconfirm>
@@ -167,13 +164,13 @@
           <el-form-item label="销售类型名称" prop="saleName">
             <el-input v-model="dialogForm.saleName"></el-input>
           </el-form-item>
-          <el-form-item label="品类" prop="mainName">
-            <el-select v-model="dialogForm.mainName">
+          <el-form-item label="产品大类" prop="mainId">
+            <el-select v-model="dialogForm.mainId" @change="handleChange">
               <el-option
                 v-for="(item, index) in productList"
                 :key="index"
                 :label="item.productCategoryName"
-                :value="item.productCategoryName"
+                :value="item.productCategoryNumber"
               >
               </el-option>
             </el-select>
@@ -211,10 +208,8 @@ import {
   updateType,
   getDetail,
   getProductList,
-
 } from "@/api/policy_list";
 
-
 export default {
   mixins: [Mixin],
   data() {
@@ -223,6 +218,7 @@ export default {
       screenForm: {
         saleCode: "",
         saleName: "",
+        mainId: "",
         status: "",
       },
       dialogForm: {
@@ -230,7 +226,8 @@ export default {
         saleCode: "",
         saleName: "",
         mainName: "",
-        status: true,
+        mainId: "",
+        status: "",
       },
       dataList: [
         {
@@ -319,6 +316,7 @@ export default {
         pageSize: this.pageSize,
         saleCode: this.screenForm.saleCode,
         saleName: this.screenForm.saleName,
+        mainId: "",
         status: this.screenForm.status,
       };
       getTypeList(params).then((res) => {
@@ -333,6 +331,16 @@ export default {
         this.productList = res.data;
       });
     },
+    handleChange(e) {
+      this.productList.find((k) => {
+        if (k.productCategoryNumber == e) {
+          this.dialogForm.mainId = k.productCategoryNumber;
+          this.dialogForm.mainName = k.productCategoryName;
+          this.screenForm.mainId = k.productCategoryNumber;
+          this.screenForm.mainName = k.productCategoryName;
+        }
+      });
+    },
     hanleDatele(id) {
       this.hanleDeleteAllPromise(id).then((ids) => {
         delTypeData({
@@ -362,14 +370,14 @@ export default {
       this.type = 3;
     },
 
-    handleSwitch(e,id){
-        updateType({
+    handleSwitch(e, id) {
+      updateType({
         id,
         status: e,
-       }).then((res) => {
-          this.$successMsg("状态已更改");
-          this.hanleReset();
-        });
+      }).then((res) => {
+        this.$successMsg("状态已更改");
+        // this.hanleReset();
+      });
     },
 
     handelInfo() {
@@ -411,6 +419,7 @@ export default {
         saleCode: "",
         saleName: "",
         mainName: "",
+        mainId: "",
         status: true,
       };
       // this.$refs.dialogForm.resetFields()

+ 1 - 1
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="progress || 0"></el-progress>
+      <el-progress :text-inside="true" :stroke-width="26" :percentage="detailData.thjd || 0"></el-progress>
     </div>
 
     <div class="main-title">

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 459 - 562
src/views/supply/policy/components/retail_form.vue


+ 2 - 2
src/views/supply/policy/policy_list.vue

@@ -131,7 +131,7 @@
             highlight-current-row
             stripe
           >
-            <el-table-column
+            <!-- <el-table-column
               align="center"
               label="提货进度"
               prop="thjd"
@@ -141,7 +141,7 @@
               <template slot-scope="scope">
                 <el-progress :percentage="scope.row.thjd || 0"></el-progress>
               </template>
-            </el-table-column>
+            </el-table-column> -->
             <el-table-column
               align="center"
               label="订单号"

Vissa filer visades inte eftersom för många filer har ändrats