Selaa lähdekoodia

销售订单页面

莫绍宝 3 vuotta sitten
vanhempi
commit
9cb9a8d60e

+ 2 - 4
src/api/supply/sales.js

@@ -35,13 +35,11 @@ export function getConditionList(params) {
   })
 }
 
-
-
 export function updatePolicy(params) {
   return request({
     url: '/policy/update',
     method: 'post',
-    data:params
+    data: params
   })
 }
 
@@ -127,7 +125,7 @@ export function getpolicySubmit(params) {
   return request({
     url: '/policy/policy/submit',
     method: 'post',
-   params
+    params
   })
 }
 

+ 1 - 2
src/components/Common/image-upload.vue

@@ -96,7 +96,6 @@ export default {
       this.fileType.includes('excel') && (whiteList = whiteList.concat(excelList));
       this.fileType.includes('ppt') && (whiteList = whiteList.concat(pptList));
       this.fileType.includes('pdf') && (whiteList = whiteList.concat(pdfList));
-      
 			return whiteList.join(',');
 		},
 		previewImages() {
@@ -281,4 +280,4 @@ export default {
 	.uploader {
     height: 0;
   }
-</style>
+</style>

+ 4 - 1
src/mixin/index.js

@@ -9,6 +9,8 @@ export default {
       dataList: [], // 表格数据
       ids: [], // 多选数据id
       dialogVisible: false, // 弹框
+      conditionList: [],
+      dataList:[]
     }
   },
   created() {
@@ -50,7 +52,8 @@ export default {
     },
 
     // 筛选全部数据
-    hanleSelectAll(selection) {
+    hanleSelectAll(selection,index) {
+
       this.ids = selection.map((k) => {
         return k.id;
       });

+ 3 - 1
src/store/index.js

@@ -6,6 +6,7 @@ import settings from './modules/settings'
 import permission from './modules/permission'
 import tagsView from './modules/tagsView'
 import user from './modules/user'
+import sales from './modules/sales'
 
 Vue.use(Vuex)
 
@@ -15,7 +16,8 @@ const store = new Vuex.Store({
     settings,
     permission,
     tagsView,
-    user
+    user,
+    sales
   },
   getters
 })

+ 45 - 0
src/store/modules/sales.js

@@ -0,0 +1,45 @@
+import {
+  getId
+} from "@/api/supply/sales";
+
+const state = {
+  code: '',
+  searchForm: {
+    code: "",
+    endTime: "",
+    imgSrc: "",
+    remark: "",
+    startTime: "",
+    title: "",
+    type: "",
+  },
+  fileList:[]
+}
+
+const mutations = {
+  setId(state,id){
+       state.code = id
+       console.log('setId',id);
+  }
+
+}
+
+const actions = {
+  hanlenewInfo({
+    commit
+  }) {
+    return new Promise((resolve, reject) => {
+      getId().then(res=>{
+          commit('setId',res.data)
+          resolve()
+      })
+    })
+  }
+}
+
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions
+}

+ 1 - 0
src/utils/index.js

@@ -4,6 +4,7 @@
 
 /**
  * Parse the time to string
+ *
  * @param {(Object|string|number)} time
  * @param {string} cFormat
  * @returns {string | null}

+ 133 - 68
src/views/sales_policy/components/AddCondition.vue

@@ -1,7 +1,9 @@
 <template>
   <el-container>
     <el-header height="50px" class="header">
-      <el-page-header @back="$parent.isShow = 2" content="详情页面">
+
+      <el-page-header @back="handleBack" content="详情页面">
+
       </el-page-header>
     </el-header>
     <div class="line">
@@ -20,46 +22,60 @@
             v-for="(item, index) in conditionBox"
             :key="index"
           >
-            <el-row >
+
+            <el-row>
+
               <el-row class="pdt">
                 <el-button
                   type="primary"
                   size="small"
-                  @click="
-                    (VisibleModle = true), getMaterialLists(), (arrIndex = index)
-                  "
+
+                  @click="(VisibleModle = true), getMaterialLists(index)"
+
                   >添加机型</el-button
                 >
 
-                <el-button type="primary" size="small" @click="handleDeleteRow(), (arrIndex = index)"
+                <el-button
+                  type="primary"
+                  size="small"
+                  @click="handleDeleteRow(index)"
                   >删除机型</el-button
                 >
               </el-row>
               <el-row>
-                <el-table style="width: 100%" :data="item" border   @select="hanleSelectAll"
-          @select-all="hanleSelectAll">
+                <el-table
+                  style="width: 100%"
+                  :data="item"
+                  border
+                  @select="hanleSelectAll($event, index)"
+                  @select-all="hanleSelectAll($event, index)"
+                >
                   <el-table-column type="selection" width="55" align="center">
                   </el-table-column>
-                  <el-table-column label="货品名称" width="300" align="center"  prop="materialName">
-                    <template slot-scope="scope">{{ scope.row.date }}</template>
+                  <el-table-column
+                    label="货品名称"
+                    width="300"
+                    align="center"
+                    prop="materialName"
+                  >
                   </el-table-column>
-                  <el-table-column prop="specification" label="规格型号" align="center">
+                  <el-table-column
+                    prop="specification"
+                    label="规格型号"
+                    align="center"
+                  >
                   </el-table-column>
                 </el-table>
               </el-row>
             </el-row>
           </el-col>
         </el-row>
-        <el-row>
-          <el-form label-width="120px" :inline="false" size="small" >
+        <el-row >
+          <el-form label-width="120px" :inline="false" size="small">
             <el-row>
               <el-form-item label="配置比例设置"> </el-form-item>
             </el-row>
-            <el-col :xs="24" :sm="8" :lg="8">
-              <el-form-item label="限定机型">
-                <el-input v-model="limit" size="small"></el-input>
-              </el-form-item>
-            </el-col>
+
             <el-col
               :xs="24"
               :sm="8"
@@ -67,12 +83,13 @@
               v-for="(len, index) in conditionBox"
             >
               <el-form-item :label="'配提' + (index + 1) + '比例'">
-                <el-input size="small"  v-model="popArr['line_'+index]"></el-input>
+                <el-input
+                  size="small"
+                  v-model="popArr['line_' + index]"
+                ></el-input>
               </el-form-item>
             </el-col>
           </el-form>
-
-
         </el-row>
         <el-divider></el-divider>
       </el-row>
@@ -88,27 +105,16 @@
             v-for="(item, index) in conditionBoxs"
             :key="index"
           >
-            <el-row v-for="col in item">
-              <!-- <el-row class="pdt">
-                <el-button
-                  type="primary"
-                  size="small"
-                  @click="VisibleModle = true"
-                  >添加机型</el-button
-                >
+            <el-row >
 
-                <el-button type="primary" size="small" @click=""
-                  >删除机型</el-button
-                >
-              </el-row> -->
               <el-row>
-                <el-table style="width: 100%" :data="col" border>
+                <el-table style="width: 100%" :data="item" border>
                   <el-table-column type="selection" width="55" align="center">
                   </el-table-column>
-                  <el-table-column label="货品名称" width="300" align="center">
+                  <el-table-column label="货品名称" width="300" align="center" prop="materialName" >
                     <template slot-scope="scope">{{ scope.row.date }}</template>
                   </el-table-column>
-                  <el-table-column prop="name" label="规格型号" align="center">
+                  <el-table-column prop="specification" label="规格型号" align="center">
                   </el-table-column>
                 </el-table>
               </el-row>
@@ -349,8 +355,11 @@ import {
 } from "@/api/supply/sales";
 import TabelTransfer from "./TabelTransfer.vue";
 
+import { mapState} from "vuex";
 import AddModel from "./AddModel";
 import Minxin from "@/mixin";
+
+
 export default {
   mixins: [Minxin],
   props: {
@@ -381,7 +390,7 @@ export default {
         policyName: "",
         pop: "",
       },
-      limit:'',
+      limit: "",
       VisibleModle: false,
       conditionBox: [[], []],
       conditionBoxs: [],
@@ -397,15 +406,34 @@ export default {
       type: "",
       saleTypeCode: "",
       arrIndex: 0,
-      popArr:{}
+
+      popArr: {},
+
     };
   },
   created() {
     this.getCommonApi();
-    console.log(this.$parent.codeId,'codeid' );
+
+    console.log(this.$parent.codeId, "codeid");
+
   },
+   computed: mapState({
+    comCode: (state) => state.sales.code,
+  }),
+    updated() {
+
+    },
   methods: {
-    getList(){
+    getList() {
+
+    },
+    handleBack(){
+      if (this.$parent.isShow==10) {
+          this.$parent.isShow = 8
+      }else{
+        this.$parent.isShow =2
+      }
+
     },
     getCommonApi() {
       if (this.id) {
@@ -436,38 +464,67 @@ export default {
       this.conditionBox.push([{}]);
     },
     handleSubmit() {
-      console.log(this.popArr);
+
+      console.log(this.comCode);
+      var tableData = [];
+      for (let i = 0; i < this.conditionBox.length; i++) {
+        for (let j = 0; j < this.conditionBox[i].length; j++) {
+          this.conditionBox[i][j].popType = i + 1;
+               this.conditionBox[i][j].policyId = this.comCode
+               this.conditionBox[i][j].id = ''
+        }
+        tableData = [...tableData, ...this.conditionBox[i]];
+      }
+      if (!tableData.length) {
+        this.$errorMsg("请选择机型");
+        return;
+      }
+      var pop = [];
+      for (const key in this.popArr) {
+
+        pop.push(this.popArr[key]);
+      }
       const params = {
         id: "",
-        policyConditionMaterials: [
-          {
-            id: "",
-            materialId: "234",
-            materialName: "234",
-            materialNumber: "34",
-            policyConditionId: "23423",
-            policyId: "234",
-            policyMaterialId: "2342",
-            popType: 0,
-            specification: "2342",
-            walletType: "23423",
-          },
-        ],
-        policyId: this.$parent.codeId,
-        policyName: "hah",
-        pop: "1:2",
+        policyConditionMaterials: tableData,
+        policyId: this.comCode,
+        policyName: "",
+        pop: pop.join(":"),
       };
-      // addPoliyCondition(params).then((res) => {
-      //   this.$successMsg("添加成功");
-      // });
+      addPoliyCondition(params).then((res) => {
+        this.$successMsg("添加成功");
+        this.$parent.isShow = 2
+        this.$parent.isFlag = 1
+        this.$emit('handleSubmitCon',this.comCode)
+      });
+
     },
     handleSelectionChange(val) {
       this.multipleSelection = val;
     },
-    handleDeleteRow(){
-      console.log(this.arrIndex);
+    // 筛选全部数据
+    hanleSelectAll(selection, index) {
+      this.arrIndex = index;
+      this.ids = selection.map((k) => {
+        return k.id;
+      });
+      console.log(this.ids);
+    },
+    handleDeleteRow(index) {
+      if (this.arrIndex == index && this.ids.length) {
+        for (let i = 0; i < this.conditionBox[index].length; i++) {
+          for (let j = 0; j < this.ids.length; j++) {
+            if (this.conditionBox[index][i].id == this.ids[j]) {
+              this.conditionBox[index].splice(i, 1);
+            }
+          }
+        }
+      }
+      console.log(index, this.arrIndex);
     },
-    getMaterialLists() {
+    getMaterialLists(index) {
+      this.arrIndex = index;
+
       getMaterialList({
         pageNum: this.currentPage,
         pageSize: this.pageSize,
@@ -475,7 +532,9 @@ export default {
         policyId: this.$parent.codeId,
       }).then((res) => {
         this.conditList = res.data.records;
-        console.log(4545,this.conditList);
+
+        console.log(4545, this.conditList);
+
         this.listTotal = res.data.total;
       });
     },
@@ -497,7 +556,9 @@ export default {
     },
     handleAllAdd() {
       this.conditList2 = this.leftData;
-      this.leftData = []
+
+      this.leftData = [];
+
     },
     handleAllDelete() {
       this.conditList2 = [];
@@ -523,12 +584,16 @@ export default {
           if (i == this.arrIndex) {
             this.$set(this.conditionBox, i, [
               ...this.conditList2,
-              ...this.conditionBox[i]
+
+              ...this.conditionBox[i],
+
             ]);
             console.log(this.conditionBox);
           }
         }
-        this.VisibleModle = false
+        this.VisibleModle = false;
+        this.conditList2 = [];
+
       } else {
         this.$errorMsg("请选择内容");
       }

+ 116 - 106
src/views/sales_policy/components/AddPolicy.vue

@@ -1,7 +1,10 @@
 <template>
   <div>
     <el-header height="50px" class="header">
-      <el-page-header @back="$parent.isShow = 1" content="详情页面">
+      <el-page-header
+        @back="($parent.isShow = 1), ($parent.isFlag = '')"
+        content="详情页面"
+      >
       </el-page-header>
     </el-header>
     <div class="app-container">
@@ -40,12 +43,11 @@
                   size="small"
                   v-model="searchForm.type"
                   placeholder="销售政策类型"
-                  @change="hanleChange"
                   class="select_height"
                 >
                   <el-option
-                    v-for="item in typeOptions"
-                    :key="item.value"
+                    v-for="(item, index) in typeOptions"
+                    :key="index"
                     :label="item.label"
                     :value="item.value"
                   >
@@ -57,8 +59,8 @@
               <el-form-item label="支付钱包类型" prop="name">
                 <el-select v-model="value" placeholder="请选择">
                   <el-option
-                    v-for="item in walletList"
-                    :key="item.mainId"
+                    v-for="(item, index) in walletList"
+                    :key="index"
                     :label="item.mainName"
                     :value="item.mainId"
                   >
@@ -66,7 +68,6 @@
                 </el-select>
               </el-form-item>
             </el-col>
-
             <!-- <el-col :xs="24" :ms="12" :lg="12">
             <el-form-item label="制单日期" prop="name">
               <el-date-picker
@@ -83,10 +84,8 @@
                   v-model="searchForm.startTime"
                   type="datetime"
                   placeholder="生效日期"
-
-
-            default-time="00:00:00"
-            value-format="yyyy-MM-dd HH:mm:ss"
+                  default-time="00:00:00"
+                  value-format="yyyy-MM-dd HH:mm:ss"
                 >
                 </el-date-picker> </el-form-item
             ></el-col>
@@ -95,8 +94,9 @@
                 <el-date-picker
                   v-model="searchForm.endTime"
                   type="datetime"
-                  placeholder="失效日期"      default-time="00:00:00"
-            value-format="yyyy-MM-dd HH:mm:ss"
+                  placeholder="失效日期"
+                  default-time="00:00:00"
+                  value-format="yyyy-MM-dd HH:mm:ss"
                 >
                 </el-date-picker> </el-form-item
             ></el-col>
@@ -110,16 +110,7 @@
             </el-col>
             <el-col :xs="24" :ms="24" :lg="24">
               <el-form-item label="政策封面图" prop="imgSrc">
-                <el-upload
-                  class="avatar-uploader"
-                  action="https://jsonplaceholder.typicode.com/posts/"
-                  :show-file-list="false"
-                  :on-success="handleAvatarSuccess"
-                  :before-upload="beforeAvatarUpload"
-                >
-                  <img v-if="imageUrl" :src="imageUrl" class="avatar" />
-                  <i v-else class="el-icon-plus avatar-uploader-icon"></i>
-                </el-upload>
+                <ImageUpload :fileList="fileList" :multiple="false" />
               </el-form-item>
             </el-col>
           </el-row>
@@ -320,23 +311,21 @@
 </template>
 
 <script>
+import { mapState,mapMutations } from "vuex";
+import Minxin from "@/mixin";
 import {
-  getId,
   addPoliy,
   getTypeList,
   getWalletList,
   getMaterialList,
   getConditionList,
-  getCrList,
-} from "@/api/supply/sales";
-import {
-  downloadFiles,
-  handleImport,
   deleteMaterialPolicy,
-} from "@/utils/util";
-import Minxin from "@/mixin";
-import Pagination from "@/components/Pagination";
+} from "@/api/supply/sales";
+import { downloadFiles, handleImport } from "@/utils/util";
 import Transfer from "./Transfer";
+import Pagination from "@/components/Pagination";
+import ImageUpload from "@/components/Common/image-upload.vue";
+
 export default {
   mixins: [Minxin],
   data() {
@@ -359,8 +348,6 @@ export default {
           { min: 3, max: 5, message: "", trigger: "click" },
         ],
       },
-      imageUrl: "",
-      dataList: [],
       importFileList: [],
       fileList: [],
       options: {},
@@ -369,7 +356,7 @@ export default {
       walletList: [],
       typeOptions: [
         {
-          vlaue: "PROVISION",
+          value: "PROVISION",
           label: "配提",
         },
         {
@@ -378,19 +365,47 @@ export default {
         },
       ],
       conditionList: [],
-
     };
   },
+  computed: mapState({
+    comCode: (state) => {
+      return state.sales.code;
+    },
+    newForm:(state) => {
+      return state.sales.searchForm;
+    },
+    imgFile:(state) => {
+      return state.sales.fileList;
+    },
+  }),
   created() {
+    console.log("vshow");
     this.getCommonApi();
+    if (this.$parent.isFlag) {
+      const params = {
+        policyId: this.comCode,
+      };
+      // 获取条件政策
+      getConditionList(params).then((res) => {
+        this.conditionList = res.data;
+        console.log(789, "jsfdkljslkj");
+      });
+      // this.handletwoList()
+    }
+  },
+  updated() {
+    this.searchForm = this.newForm
+    this.searchForm.code = this.comCode;
+    this.fileList = this.imgFile
   },
-  mounted() {},
   methods: {
+    ...mapMutations('sales',['initData']),
     //下载excel模板
     hanleDownloadFiles() {
       downloadFiles("/policy/download");
     },
     getCommonApi() {
+      // this.handletwoList()
       const params = {
         pageNum: 1,
         pageSize: 10,
@@ -406,12 +421,6 @@ export default {
         saleTypeName: "",
         status: "",
       };
-      // 获取销售政策编号
-      getId().then((res) => {
-        console.log(res.data);
-        this.searchForm.code = res.data;
-        this.$parent.codeId = res.data
-      });
       // 获取销售类型列表
       getTypeList(params).then((res) => {
         this.typeList = res.data.records;
@@ -437,7 +446,7 @@ export default {
         this.$alert(result.message, "导入成功", {
           confirmButtonText: "确定",
         });
-        // this.getList();
+
         this.handletwoList();
       } else {
         this.$alert(result.message, "导入失败", {
@@ -446,91 +455,91 @@ export default {
       }
     },
     getList() {
-      const params = {
-        policyId: this.searchForm.code,
-      };
-      // 获取条件政策
-      getConditionList(params).then((res) => {
-        this.conditionList = res.data;
-      });
-    },
-    //获取政策id调取货品信息
-    hanleChange() {
-      // this.handletwoList();
+      if (this.$parent.isFlag) {
+        this.handletwoList();
+      }
     },
     // 获取货品信息
     handletwoList() {
+      // this.searchForm.type
+
       const paramss = {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
-        policyId: this.searchForm.code,
-        saleTypeCode: this.searchForm.type,
+        policyId: this.comCode,
+        saleTypeCode: "",
       };
       console.log(45454);
       getMaterialList(paramss)
         .then((result) => {
           this.dataList = result.data.records;
-          console.log(result, 9898989);
+
+          this.listTotal = result.data.total;
         })
         .catch((err) => {
           console.error(err);
         });
     },
-    // 获取图片路径
-    beforeAvatarUpload() {},
-    handleAvatarSuccess() {},
     // 提交审核
     handleAddPolicy(policyCustomers) {
+      //     console.log(this.fileList,'上传图片');
+      // return
       console.log(policyCustomers, "选择的经销商");
+      if (policyCustomers.length) {
+        var arr = [];
+        var arr = [
+          {
+            customerId: "",
+            customerName: "",
+            customerNumber: "",
+            id: "",
+            lastOrderTime: "",
+            limitTakeNum: 0,
+            policyId: "",
+            policyTitle: "",
+            remark: "",
+          },
+        ];
+        policyCustomers.forEach((el) => {
+          arr.push({
+            customerId: "",
+            customerName: el.name,
+            customerNumber: el.number,
+            lastOrderTime: "",
+            limitTakeNum: 0,
 
-      var arr = [
-        {
-          customerId: "",
-          customerName: "",
-          customerNumber: "",
-          id: "",
-          lastOrderTime: "",
-          limitTakeNum: 0,
-          policyId: "",
-          policyTitle: "",
-          remark: "",
-        },
-      ];
-      policyCustomers.forEach((el) => {
-        arr.push({
-          customerId: "",
-          customerName: el.name,
-          customerNumber: el.number,
-          lastOrderTime: "",
-          limitTakeNum: 0,
-          policyId: this.searchForm.code,
-          policyTitle: "",
-          remark: "",
+            policyId: this.comCode,
+            policyTitle: "",
+            remark: "",
+          });
         });
-      });
+        const params = {
+          adminCompanyId: "",
+          code: "",
+          customerCount: 0,
 
-      const params = {
-        adminCompanyId: "",
-        code: "",
-        customerCount: 0,
+          examineBy: "",
+          examineRemark: "",
+          examineStatus: "",
 
-        examineBy: "",
-        examineRemark: "",
-        examineStatus: "",
-
-        id: "",
-        imgSrc: "",
-        policyCustomers: arr,
-        remark: "",
-
-        status: true,
-        title: "",
-        type: "",
-        ...this.searchForm,
-      };
-      addPoliy(params).then((res) => {
-        console.log(res);
-      });
+          id: "",
+          imgSrc: this.fileList[0].url,
+          policyCustomers: arr,
+          remark: "",
+          status: true,
+          title: "",
+          type: "",
+          ...this.searchForm,
+        };
+        addPoliy(params).then((res) => {
+          console.log(res);
+          this.$successMsg("新增成功");
+          this.fileList = [];
+          this.$parent.isShow = 1;
+        });
+        return;
+      }
+      this.$errorMsg("选择经销商 ");
     },
     //删除
     hanleDelete(id) {
@@ -544,6 +553,7 @@ export default {
   components: {
     Transfer,
     Pagination,
+    ImageUpload,
   },
 };
 </script>

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

@@ -153,7 +153,7 @@
             >
               备注</el-button
             >
-            <el-button type="text" size="small">删除</el-button>
+            <!-- <el-button type="text" size="small">删除</el-button> -->
           </template>
         </el-table-column>
       </el-table>
@@ -227,6 +227,7 @@ export default {
       dataList: [],
       detail: {},
       radio: "",
+      type:'',
       typeOptions: [
         {
           vlaue: "PROVISION",
@@ -281,12 +282,12 @@ export default {
       }).then((res) => {
         this.$successMsg("编辑成功");
         this.dialogVisible = false;
+        this.remark = ''
+        this.limitTakeNum = ''
         this.getList();
       });
     },
-    hanleSelectAll(){
 
-    }
   },
   components: {
     Transfer,

+ 339 - 252
src/views/sales_policy/components/Examine.vue

@@ -1,254 +1,316 @@
 <template>
-  <div class="app-container">
-    <div class="descriptions">
-      <el-row>
-        <el-col :span="4">销售政策编号</el-col>
-        <el-col :span="4">{{ detail.code }}</el-col>
-        <el-col :span="4">销售政策说明</el-col>
-        <el-col :span="4">{{ detail.title }}</el-col>
-        <el-col :span="4">状态</el-col>
-        <el-col :span="4">{{
-          detail.status == 1 ? "已生效" : "未生效"
-        }}</el-col>
-      </el-row>
-      <el-row>
-        <el-col :span="4">销售政策类型</el-col>
-        <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"></el-col>
-        <el-col :span="4"></el-col>
-      </el-row>
-      <el-row>
-        <el-col :span="4">备注</el-col>
-        <el-col :span="20">{{ detail.remark }}</el-col>
-      </el-row>
-      <el-row>
-        <el-col :span="3">制单人</el-col>
-        <el-col :span="3">{{ detail.createBy }}</el-col>
-        <el-col :span="3">制单日期</el-col>
-        <el-col :span="3">{{ detail.createTime }}</el-col>
-        <el-col :span="3">生效日期</el-col>
-        <el-col :span="3">{{ detail.startTime }}</el-col>
-        <el-col :span="3">失败日期</el-col>
-        <el-col :span="3">{{ detail.endTime }}</el-col>
-      </el-row>
-      <el-row v-if="this.$parent.isShow == 4">
-        <el-col :span="3">审核人</el-col>
-        <el-col :span="3">{{ detail.examineBy }}</el-col>
-        <el-col :span="3">审核日期</el-col>
-        <el-col :span="3">{{ detail.examineTime }}</el-col>
-        <el-col :span="3">关闭人</el-col>
-        <el-col :span="3"></el-col>
-        <el-col :span="3">关闭日期</el-col>
-        <el-col :span="3"></el-col>
-      </el-row>
-    </div>
-    <div class="mymain-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-button size="small">查看</el-button> -->
-          </el-col>
-          <el-col :span="12" class="tr">
-              <el-button size="small"   @click="$parent.isShow=6">查看条件</el-button>
-          </el-col>
+
+  <div>
+    <el-header height="50px" class="header">
+      <el-page-header @back="$parent.isShow = 1,$parent.id=''" content="详情页面">
+      </el-page-header>
+    </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>
+          <el-col :span="4">销售政策说明</el-col>
+          <el-col :span="4">{{ detail.title }}</el-col>
+          <el-col :span="4">状态</el-col>
+          <el-col :span="4">{{
+            detail.status == 1 ? "已生效" : "未生效"
+          }}</el-col>
         </el-row>
-        <el-divider></el-divider>
-      </el-row>
-      <el-table :data="dataList" border style="width: 100%">
-        <el-table-column label="状态" width="120" align="center">
-          <template slot-scope="scope">
-            <el-tag v-if="scope.row.examineStatus == 'WAIT'">待审核</el-tag>
-            <el-tag v-else-if="scope.row.examineStatus == 'OK'">通过 </el-tag>
-            <el-tag v-else>失败</el-tag>
-          </template>
-        </el-table-column>
-        <el-table-column
-          prop="code"
-          label="销售政策编号"
-          width="120"
-          align="center"
-        >
-        </el-table-column>
-        <el-table-column
-          prop="title"
-          label="销售政策说明"
-          width="120"
-          align="center"
-        >
-        </el-table-column>
-        <el-table-column prop="address" label="部门" width="300" align="center">
-        </el-table-column>
-        <el-table-column
-          prop="remark"
-          label="表头备注"
-          width="120"
-          align="center"
-        >
-        </el-table-column>
-        <el-table-column
-          prop="startTime"
-          label="生效日期"
-          width="120"
-          align="center"
-        >
-        </el-table-column>
-        <el-table-column
-          prop="endTime"
-          label="结束日期"
-          width="120"
-          align="center"
-        >
-        </el-table-column>
-        <el-table-column
-          prop="examineBy"
-          label="制表人"
-          width="120"
-          align="center"
-        >
-        </el-table-column>
-        <el-table-column
-          prop="examineBy"
-          label="制表日期"
-          width="120"
-          align="center"
-        >
-        </el-table-column>
-        <el-table-column
-          prop="examineBy"
-          label="审核人"
-          width="120"
-          align="center"
-        >
-        </el-table-column>
-      </el-table>
-      <el-row>
-        <el-divider></el-divider>
-        <el-row type="flex">
-          <el-col :span="12">
-            <h4 style="display: inline-block; margin-right: 20px">条件信息</h4>
-          </el-col>
+        <el-row>
+          <el-col :span="4">销售政策类型</el-col>
+          <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"></el-col>
+          <el-col :span="4"></el-col>
         </el-row>
-        <el-divider></el-divider>
-      </el-row>
-      <el-table
-        :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">
-        </el-table-column>
-        <el-table-column fixed="right" width="150" label="操作" align="center">
-          <template slot-scope="scope">
-            <el-button type="text" size="small">删除</el-button>
-          </template>
-        </el-table-column>
-      </el-table>
-      <el-row>
-        <el-divider></el-divider>
-        <el-row type="flex">
-          <el-col :span="12">
-            <h4 style="display: inline-block; margin-right: 20px">
-              经销商使用范围
-            </h4>
-          </el-col>
+        <el-row>
+          <el-col :span="4">备注</el-col>
+          <el-col :span="20">{{ detail.remark }}</el-col>
         </el-row>
-        <el-divider></el-divider>
-      </el-row>
-      <el-table
-        v-loading="listLoading"
-        :data="custoList"
-        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="customerNumber"
-          label="经销商编码"
-          align="center"
-        >
-        </el-table-column>
-        <el-table-column prop="customerName" label="经销商名称" align="center">
-        </el-table-column>
-      </el-table>
-      <!-- <div class="descriptions">
         <el-row>
-          <el-col :span="8">审核人</el-col>
-          <el-col :span="8">{{ detail.code }}</el-col>
-          <el-col :span="8">审核结果</el-col>
-          <el-col :span="8">
-            <template>
-              <el-radio-group v-model="radio">
-                <el-radio :label="3">通过</el-radio>
-                <el-radio :label="6">驳回</el-radio>
-              </el-radio-group>
+          <el-col :span="3">制单人</el-col>
+          <el-col :span="3">{{ detail.createBy }}</el-col>
+          <el-col :span="3">制单日期</el-col>
+          <el-col :span="3">{{ detail.createTime }}</el-col>
+          <el-col :span="3">生效日期</el-col>
+          <el-col :span="3">{{ detail.startTime }}</el-col>
+          <el-col :span="3">失败日期</el-col>
+          <el-col :span="3">{{ detail.endTime }}</el-col>
+        </el-row>
+        <el-row v-if="this.$parent.isShow == 4">
+          <el-col :span="3">审核人</el-col>
+          <el-col :span="3">{{ detail.examineBy }}</el-col>
+          <el-col :span="3">审核日期</el-col>
+          <el-col :span="3">{{ detail.examineTime }}</el-col>
+          <el-col :span="3">关闭人</el-col>
+          <el-col :span="3"></el-col>
+          <el-col :span="3">关闭日期</el-col>
+          <el-col :span="3"></el-col>
+        </el-row>
+      </div>
+      <div class="mymain-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-button size="small">查看</el-button> -->
+            </el-col>
+            <el-col :span="12" class="tr">
+              <el-button size="small" @click="$parent.isShow = 10"
+                >查看条件</el-button
+              >
+            </el-col>
+          </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-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
+                type="danger"
+                size="small"
+                v-if="scope.row.walletCommonly == 1"
+              >
+                允许普通钱包
+              </el-tag>
+              <el-tag type="danger" size="small" v-else
+                >不允许使用普通钱包</el-tag
+              >
+              <el-tag
+                type="danger"
+                size="small"
+                v-if="scope.row.walletDeduct == 1"
+              >
+                允许抵扣钱包</el-tag
+              >
+              <el-tag type="danger" size="small" v-else>不允许抵扣钱包</el-tag>
+              <el-tag
+                type="danger"
+                size="small"
+                v-if="scope.row.walletRebate == 1"
+              >
+                允许返利钱包
+              </el-tag>
+              <el-tag type="danger" size="small" v-else>不允许返利钱包</el-tag>
+              <el-tag
+                type="danger"
+                size="small"
+                v-if="scope.row.walletSpecial == 1"
+                >允许特殊钱包</el-tag
+              >
+              <el-tag type="danger" size="small" v-else>
+                不允许特殊钱包
+              </el-tag>
             </template>
-          </el-col>
+          </el-table-column>
+        </el-table>
+        <!-- 分页 -->
+        <div style="margin: 20px 0">
+          <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-col>
+          </el-row>
+          <el-divider></el-divider>
         </el-row>
+        <el-table
+          :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">
+          </el-table-column>
+
+        </el-table>
         <el-row>
-          <el-col :span="4">审批说明</el-col>
-          <el-col :span="4">
-            <el-input
-              type="textarea"
-              autosize
-              placeholder="审批说明"
-              v-model="textarea1"
-            >
-            </el-input>
-          </el-col>
+          <el-divider></el-divider>
+          <el-row type="flex">
+            <el-col :span="12">
+              <h4 style="display: inline-block; margin-right: 20px">
+                经销商使用范围
+              </h4>
+            </el-col>
+          </el-row>
+          <el-divider></el-divider>
         </el-row>
-      </div> -->
+        <el-table
+          v-loading="listLoading"
+          :data="custoList"
+          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="customerNumber"
+            label="经销商编码"
+            align="center"
+          >
+          </el-table-column>
+          <el-table-column
+            prop="customerName"
+            label="经销商名称"
+            align="center"
+          >
+          </el-table-column>
+        </el-table>
+        <!-- 分页 -->
+        <div style="margin: 20px 0">
+          <el-pagination
+            @size-change="handleSizeChanges"
+            @current-change="handleCurrentChanges"
+            :current-page="currentPages"
+            :page-sizes="[10, 20, 30, 50]"
+            :page-size="10"
+            layout="total, sizes, prev, pager, next, jumper"
+            :total="clistTotal"
+          >
+          </el-pagination>
+        </div>
+        <div class="descriptions" v-if="$parent.isShow == 8 ">
+          <el-row>
+            <el-col :span="6">审核人</el-col>
+            <el-col :span="6">{{ detail.code }}</el-col>
+            <el-col :span="6">审核结果</el-col>
+            <el-col :span="6">
+              <template>
+                <el-radio-group v-model="examineStatus">
+                  <el-radio :label="'OK'">通过</el-radio>
+                  <el-radio :label="'FAIL'">驳回</el-radio>
+                </el-radio-group>
+              </template>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="4">审批说明</el-col>
+            <el-col :span="20" class="col" style="padding: 0">
+              <el-input
+                type="textarea"
+                style="height: 100%"
+                autosize
+                placeholder="请输入内容"
+                v-model="remark"
+              >
+              </el-input>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-button type="primary" size="small" @click="handleSubmit"
+              >审核</el-button
+            >
+          </el-row>
+        </div>
+      </div>
     </div>
   </div>
 </template>
 
 <script>
 import {
-  getList,
-  updatePolicy,
   getPolicyDetail,
+  getMaterialList,
   getCustomerList,
   getConditionList,
+  toExamine,
 } from "@/api/supply/sales";
 import Minxin from "@/mixin";
+import { ok } from "assert";
 
 export default {
   mixins: [Minxin],
   name: "examine",
   data() {
     return {
+      currentPages: 1, // 当前页码
+      pageSizes: 10, // 每页数量
+      clistTotal: 0,
       input: "",
+      remark: "",
       fileList: [],
       listLoading: false,
       imageUrl: "",
       dataList: [],
-      radio: "",
+      examineStatus: "OK",
       options: {},
       value: "",
       detail: {},
@@ -271,47 +333,66 @@ export default {
       custoList: [],
     };
   },
+  created() {},
   methods: {
     getList() {
+      this.listLoading = true;
       getPolicyDetail({ policyId: this.$parent.id }).then((res) => {
         this.detail = res.data;
-        console.log(this.dataList);
-      });
-      const params = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
-        code: this.screenForm.code,
-        createBy: this.screenForm.createBy,
-        endCreateTime: this.screenForm.endCreateTime,
-        endTime1: this.screenForm.endTime1,
-        endTime2: this.screenForm.endTime2,
-        examineBy: this.screenForm.examineBy,
-        remark: this.screenForm.remark,
-        startCreateTime: this.screenForm.startCreateTime,
-        startTime1: this.screenForm.startTime1,
-        startTime2: this.screenForm.startTime2,
-        status: this.screenForm.status,
-        title: this.screenForm.title,
-        type: this.screenForm.type,
-      };
-      getList(params).then((res) => {
-        this.dataList = res.data.records;
-      });
-      const condParams = {
-        policyId: this.$parent.id,
-      };
-      // 获取条件政策
-      getConditionList(condParams).then((res) => {
-        this.conditionList = res.data;
-        console.log(res, 46);
+        const condParams = {
+          policyId: this.detail.code,
+        };
+        // 获取条件政策
+        getConditionList(condParams).then((res) => {
+          this.conditionList = res.data;
+        });
+        const paramss = {
+          pageNum: this.currentPage,
+          pageSize: this.pageSize,
+          policyId: this.detail.code,
+          saleTypeCode: "",
+        };
+        getMaterialList(paramss).then((res) => {
+          this.dataList = res.data.records;
+          this.listTotal = res.data.total;
+          this.listLoading = false;
+        });
+
+        this.getCond();
       });
+    },
+    // 更改每页数量
+    handleSizeChanges(val) {
+      this.pageSizes = val;
+      this.currentPages = 1;
+      this.getCond();
+    },
+    // 更改当前页
+    handleCurrentChanges(val) {
+      this.currentPages = val;
+      this.getCond();
+    },
+    getCond() {
+      this.listLoading = true;
       const custoParams = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
-        policyId: this.$parent.id,
+        pageNum: this.currentPages,
+        pageSize: this.pageSizes,
+        policyId: this.detail.code,
       };
       getCustomerList(custoParams).then((res) => {
         this.custoList = res.data.records;
+        this.clistTotal = res.data.total;
+        this.listLoading = false;
+      });
+    },
+    handleSubmit() {
+      toExamine({
+        examineStatus: this.examineStatus,
+        policyId: this.$parent.id ,
+        examineRemark: this.remark,
+      }).then((res) => {
+        this.$successMsg("已提交审核");
+        this.isShow = 1;
       });
     },
   },
@@ -319,6 +400,9 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+.el-col {
+  overflow: hidden;
+}
 .descriptions {
   // border: #EBEEF5;
   border: 1px solid #ebeef5;
@@ -339,4 +423,7 @@ export default {
 .el-divider--horizontal {
   margin: 20px 0;
 }
+.col {
+  height: 100px;
+}
 </style>

+ 6 - 2
src/views/sales_policy/components/Transfer.vue

@@ -139,7 +139,8 @@ export default {
         },
       ],
       value: "",
-      region: "0",
+     region: "",
+
       keyword: "",
     };
   },
@@ -154,10 +155,13 @@ export default {
         keyword: this.keyword,
         region: this.region,
       };
-      console.log(555);
+
+
       // 获取经销商列表
       getCrList(customerParams).then((res) => {
         this.dataL = res.data.records;
+        console.log(res,'获取经销商列表');
+
         this.listTotal = res.data.total;
       });
     },

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

@@ -111,8 +111,8 @@
                   class="select_height"
                 >
                   <el-option
-                    v-for="item in statusOptions"
-                    :key="item.value"
+                    v-for="(item, index) in statusOptions"
+                    :key="index"
                     :label="item.label"
                     :value="item.value"
                   >
@@ -155,20 +155,9 @@
     </div>
     <div class="btn-group">
       <el-row type="flex">
-        <el-button type="primary" class="btn" size="small" @click="isShow = 2"
+        <el-button type="primary" class="btn" size="small" @click="hanlenewInfo"
           >新增</el-button
         >
-        <!-- <el-upload
-          class="import-btn"
-          :action="baseURL + 'student/import'"
-          :http-request="handleImport"
-          :file-list="importFileList"
-        >
-          <el-button type="primary" size="small">导入</el-button>
-        </el-upload>
-        <el-button type="primary" class="btn" size="small" @click="handleExport"
-          >导出</el-button
-        > -->
       </el-row>
     </div>
     <div class="mymain-container">
@@ -180,21 +169,21 @@
               size="small"
               @click="(isShow = 5), (id = scope.row.id)"
               >编辑</el-button
+
             > -->
             <el-button
               type="text"
               size="small"
-              @click="(isShow = 4), (id = scope.row.id)"
+              @click="
+                (isShow = 4), (id = scope.row.id), (code = scope.row.code)
+              "
               >详情</el-button
             >
-            <!-- <el-popconfirm
-              style="margin-left: 10px"
-              title="审核?"
-              @onConfirm="hanleExamine(scope.row)"
-            > -->
             <el-button
               type="text"
-              @click="(isShow = 6), (id = scope.row.id)"
+              @click="
+                (isShow = 8), (id = scope.row.id), (code = scope.row.code)
+              "
               size="small"
               >审核</el-button
             >
@@ -241,7 +230,7 @@
           align="center"
         >
         </el-table-column>
-        <el-table-column prop="address" label="部门" width="300" align="center">
+        <el-table-column prop="address" label="部门"  align="center">
         </el-table-column>
         <el-table-column
           prop="remark"
@@ -253,14 +242,14 @@
         <el-table-column
           prop="startTime"
           label="生效日期"
-          width="120"
+
           align="center"
         >
         </el-table-column>
         <el-table-column
           prop="endTime"
           label="结束日期"
-          width="120"
+
           align="center"
         >
         </el-table-column>
@@ -313,6 +302,7 @@ import {
   deletePolicy,
   getpolicySubmit,
   toExamine,
+  getConditionList,
 } from "@/api/supply/sales";
 import Minxin from "@/mixin";
 import { downloadFiles, handleImport } from "@/utils/util";
@@ -321,13 +311,15 @@ import AddModel from "./components/AddModel";
 import Pagination from "./components/Pagination";
 import AddCondition from "./components/AddCondition";
 import Examine from "./components/Examine";
+import { mapState } from "vuex";
 
 export default {
   mixins: [Minxin],
   data() {
     return {
       id: "",
-      codeId:'',
+      code: "",
+      codeId: "",
       isShow: 1,
       dataList: [],
       screenForm: {
@@ -370,9 +362,19 @@ export default {
       value: "",
       imageUrl: "",
       baseURL: "",
+      isFlag: "",
     };
   },
+  computed: mapState({
+    comCode: (state) => state.sales.code,
+  }),
+  created() {},
   methods: {
+    // ...mapActions("sales", ["hanlenewInfo"]),
+    hanlenewInfo() {
+      this.isShow = 2;
+      this.$store.dispatch("sales/hanlenewInfo");
+    },
     getList() {
       const params = {
         pageNum: this.currentPage,
@@ -406,7 +408,6 @@ export default {
       });
     },
     hanleDelete(id) {
-      console.log(555);
       this.hanleDeleteAllPromise(id).then((ids) => {
         deletePolicy({
           id: ids[0],

+ 15 - 0
src/views/supply/policy/policy_list.vue

@@ -0,0 +1,15 @@
+<template>
+  <div>
+
+  </div>
+</template>
+
+<script>
+  export default {
+
+  }
+</script>
+
+<style lang="scss" scoped>
+
+</style>