howie hace 3 años
padre
commit
07bbe16898

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

@@ -35,8 +35,6 @@ export function getConditionList(params) {
   })
 }
 
-
-
 export function updatePolicy(params) {
   return request({
     url: '/policy/update',
@@ -56,7 +54,7 @@ export function deletePolicy(params) {
 export function getConditionMaterialDetail(params) {
   return request({
     url: '/policy/condition/detail',
-    method: 'get',
+    method: 'post',
     params
   })
 }
@@ -96,6 +94,14 @@ export function getId(params) {
 }
 
 
+
+export function deleteCondition(params) {
+  return request({
+    url: '/policy/condition/delete',
+    method: 'post',
+    params
+  })
+}
 export function toExamine(params) {
   return request({
     url: '/policy/examine',
@@ -107,7 +113,6 @@ export function toExamine(params) {
 // /policy/material/import
 
 //政策货品列表
-
 export function getMaterialList(params) {
   return request({
     url: '/policy/material/list',

+ 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
 })

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

@@ -0,0 +1,34 @@
+import {
+  getId
+} from "@/api/supply/sales";
+
+const state = {
+  code: ''
+}
+
+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
+}

+ 478 - 30
src/views/sales_policy/components/AddCondition.vue

@@ -1,11 +1,15 @@
 <template>
   <el-container>
-    <el-header class="header">
+    <el-header height="50px" class="header">
+      <el-page-header @back="handleBack" content="详情页面">
+      </el-page-header>
+    </el-header>
+    <div class="line">
       <el-divider></el-divider>
       <h4>限定条件</h4>
       <el-divider></el-divider>
-    </el-header>
-    <el-main>
+    </div>
+    <el-main v-if="!id">
       <el-row>
         <el-row :gutter="50">
           <el-col
@@ -16,27 +20,44 @@
             v-for="(item, index) in conditionBox"
             :key="index"
           >
-            <el-row v-for="col in item">
+            <el-row>
               <el-row class="pdt">
                 <el-button
                   type="primary"
                   size="small"
-                  @click="centerDialogVisible = true"
+                  @click="(VisibleModle = true), getMaterialLists(index)"
                   >添加机型</el-button
                 >
 
-                <el-button type="primary" size="small" @click=""
+                <el-button
+                  type="primary"
+                  size="small"
+                  @click="handleDeleteRow(index)"
                   >删除机型</el-button
                 >
               </el-row>
               <el-row>
-                <el-table style="width: 100%" :data="col" border>
+                <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">
-                    <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="name" label="规格型号" align="center">
+                  <el-table-column
+                    prop="specification"
+                    label="规格型号"
+                    align="center"
+                  >
                   </el-table-column>
                 </el-table>
               </el-row>
@@ -48,18 +69,68 @@
             <el-row>
               <el-form-item label="配置比例设置"> </el-form-item>
             </el-row>
+
+            <el-col
+              :xs="24"
+              :sm="8"
+              :lg="8"
+              v-for="(len, index) in conditionBox"
+            >
+              <el-form-item :label="'配提' + (index + 1) + '比例'">
+                <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>
+    </el-main>
+    <el-main v-else>
+      <el-row>
+        <el-row :gutter="50">
+          <el-col
+            :xs="24"
+            :sm="24"
+            :lg="24"
+            class="mgb"
+            v-for="(item, index) in conditionBoxs"
+            :key="index"
+          >
+            <el-row >
+
+              <el-row>
+                <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" prop="materialName" >
+                    <template slot-scope="scope">{{ scope.row.date }}</template>
+                  </el-table-column>
+                  <el-table-column prop="specification" label="规格型号" align="center">
+                  </el-table-column>
+                </el-table>
+              </el-row>
+            </el-row>
+          </el-col>
+        </el-row>
+        <el-row v-if="conditionBoxs.length">
+          <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 size="small"></el-input>
               </el-form-item>
             </el-col>
-            <el-col :xs="24" :sm="8" :lg="8" v-for="len in conditionBox">
+            <el-col :xs="24" :sm="8" :lg="8" v-for="len in conditionBoxs">
               <el-form-item label="配提比例">
                 <el-input size="small"></el-input>
               </el-form-item>
             </el-col>
           </el-form>
-
           <el-col class="text_rihgt" v-if="false">
             <el-button type="primary" size="small" @click=""
               >添加限定条件</el-button
@@ -69,7 +140,6 @@
         <el-divider></el-divider>
       </el-row>
     </el-main>
-    {{id}}{{55}}
     <el-footer height="100px" v-if="!id">
       <el-row :gutter="20">
         <el-col :xs="24" :sm="12" :lg="12" :offset="0">
@@ -85,20 +155,210 @@
         </el-col>
       </el-row>
     </el-footer>
-    <AddModel :centerDialogVisible="centerDialogVisible" />
+    <el-dialog :visible.sync="VisibleModle" width="70%" center>
+      <div>
+        <el-container>
+          <el-header height="">
+            <el-form label-width="0" :inline="false" size="small">
+              <el-col :xs="24" :sm="8" :lg="8" :offset="0">
+                <el-form-item label="">
+                  <el-input
+                    v-model="saleTypeCode"
+                    placeholder="类型编号"
+                  ></el-input>
+                </el-form-item>
+              </el-col>
+            </el-form>
+          </el-header>
+          <el-main height="">
+            <el-row>
+              <el-row :gutter="50">
+                <el-col :xs="10" :ms="10" :lg="10">
+                  <el-row>
+                    <el-row> </el-row>
+                    <el-row>
+                      <el-row class="title"> 可选产品列表 </el-row>
+                      <el-table
+                        style="width: 100%"
+                        :data="conditList"
+                        border
+                        height="400"
+                        @select-all="handleSelectionAllChange"
+                        @selection-change="handleSelectionChange"
+                      >
+                        <el-table-column
+                          type="selection"
+                          width="55"
+                          align="center"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                          label="产品编码"
+                          prop="materialNumber"
+                          width="120"
+                          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="price"
+                          label="产品价格"
+                          align="center"
+                        >
+                        </el-table-column>
+                      </el-table>
+                      <el-row class="mg">
+                        <div>
+                          <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-row>
+                  </el-row>
+                </el-col>
+                <el-col :xs="4" :ms="4" :lg="4" class="middle">
+                  <el-row :gutter="20" justify="center" align="middle">
+                    <el-row class="btn">
+                      <el-button
+                        type="primary"
+                        size="small "
+                        @click="handleAllAdd"
+                        :disabled="type == 2"
+                        >全部添加</el-button
+                      >
+                    </el-row>
+                    <el-row class="btn">
+                      <el-button
+                        type="primary"
+                        size="small "
+                        @click="handleAdd"
+                        :disabled="type == 2"
+                        >增加</el-button
+                      >
+                    </el-row>
+                    <el-row class="btn">
+                      <el-button
+                        type="primary"
+                        size="small "
+                        @click="handleDelete"
+                        :disabled="type == 1"
+                        >删除</el-button
+                      ></el-row
+                    >
+                    <el-row class="btn"
+                      ><el-button
+                        :disabled="type == 1"
+                        type="primary"
+                        size="small  "
+                        @click="handleAllDelete"
+                        >全部删除</el-button
+                      ></el-row
+                    >
+                  </el-row>
+                </el-col>
+                <el-col :xs="10" :ms="10" :lg="10">
+                  <el-row>
+                    <el-row> </el-row>
+                    <el-row>
+                      <el-row class="title"> 已选产品列表 </el-row>
+                      <el-table
+                        style="width: 100%"
+                        :data="conditList2"
+                        @select-all="handleSelectionAllChange2"
+                        @selection-change="handleSelectionChange2"
+                        border
+                        height="400"
+                      >
+                        <el-table-column
+                          type="selection"
+                          width="55"
+                          align="center"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                          label="产品编码"
+                          prop="materialNumber"
+                          width="120"
+                          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="price"
+                          label="产品价格"
+                          align="center"
+                        >
+                        </el-table-column>
+                      </el-table>
+                      <el-row class="mg">
+                        <!-- <Pagination /> -->
+                      </el-row>
+                    </el-row>
+                  </el-row>
+                </el-col>
+              </el-row>
+            </el-row>
+          </el-main>
+        </el-container>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="VisibleModle = false">取 消</el-button>
+        <el-button type="primary" @click="handleDiaSubmit">确 定</el-button>
+      </span>
+    </el-dialog>
   </el-container>
 </template>
 
 <script>
-import { getId, addPoliyCondition,getConditionMaterialList,getConditionMaterialDetail } from "@/api/supply/sales";
-import { string } from "yargs";
+import {
+  getId,
+  addPoliyCondition,
+  getConditionMaterialList,
+  getMaterialList,
+  getConditionMaterialDetail,
+} from "@/api/supply/sales";
+import TabelTransfer from "./TabelTransfer.vue";
+import { mapState} from "vuex";
 import AddModel from "./AddModel";
+import Minxin from "@/mixin";
+import { join } from "path";
 export default {
-  props:{
-    id:{
-      type:String,
-      default:''
-    }
+  mixins: [Minxin],
+  props: {
+    id: {
+      type: String,
+      default: "",
+    },
   },
   data() {
     return {
@@ -122,24 +382,61 @@ export default {
         policyName: "",
         pop: "",
       },
-      centerDialogVisible: false,
-      conditionBox: [[{}], [{}]],
-
+      limit: "",
+      VisibleModle: false,
+      conditionBox: [[], []],
+      conditionBoxs: [],
       multipleSelection: [],
       searchForm: {
         code: "",
       },
+      pop: "",
+      conditList: [],
+      leftData: [],
+      rightData: [],
+      conditList2: [],
+      type: "",
+      saleTypeCode: "",
+      arrIndex: 0,
+      popArr: {},
     };
   },
   created() {
     this.getCommonApi();
+    console.log(this.$parent.codeId, "codeid");
   },
+   computed: mapState({
+    comCode: (state) => state.sales.code,
+  }),
+    updated() {
+
+    },
   methods: {
+    getList() {
+
+    },
+    handleBack(){
+      if (this.$parent.isShow==10) {
+          this.$parent.isShow = 8
+      }else{
+        this.$parent.isShow =2
+      }
+    },
     getCommonApi() {
-      getId().then((res) => {
-        console.log(res.data);
-        this.searchForm.code = res.data;
-      });
+      if (this.id) {
+        var i = 1;
+        getConditionMaterialDetail({ id: this.id }).then((res) => {
+          this.pop = res.data;
+          while (i <= 2) {
+            // getConditionMaterialList({pageNum:1,pageSize:10,policyConditionId:this.id,popType:i}).then((res) => {
+            //   console.log(res, "比值");
+            //   i++;
+            // });
+            console.log(res, "比值");
+            i++;
+          }
+        });
+      }
     },
     toggleSelection(rows) {
       if (rows) {
@@ -154,21 +451,142 @@ export default {
       this.conditionBox.push([{}]);
     },
     handleSubmit() {
-      addPoliyCondition().then((res) => {
-        console.log(res);
+      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: tableData,
+        policyId: this.comCode,
+        policyName: "",
+        pop: pop.join(":"),
+      };
+      addPoliyCondition(params).then((res) => {
+        this.$successMsg("添加成功");
+        this.$parent.isShow = 2
+        this.$parent.isFlag = 1
+        this.$emit('handleSubmitCon',this.comCode)
       });
     },
     handleSelectionChange(val) {
       this.multipleSelection = val;
     },
+    // 筛选全部数据
+    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(index) {
+      this.arrIndex = index;
+      getMaterialList({
+        pageNum: this.currentPage,
+        pageSize: this.pageSize,
+        saleTypeCode: this.saleTypeCode,
+        policyId: this.$parent.codeId,
+      }).then((res) => {
+        this.conditList = res.data.records;
+        console.log(4545, this.conditList);
+        this.listTotal = res.data.total;
+      });
+    },
+    handleSelectionAllChange(e) {
+      this.leftData = e;
+      this.type = 1;
+    },
+    handleSelectionChange(e) {
+      this.leftData = e;
+      this.type = 1;
+    },
+    handleSelectionAllChange2(e) {
+      this.rightData = e;
+      this.type = 2;
+    },
+    handleSelectionChange2(e) {
+      this.rightData = e;
+      this.type = 2;
+    },
+    handleAllAdd() {
+      this.conditList2 = this.leftData;
+      this.leftData = [];
+    },
+    handleAllDelete() {
+      this.conditList2 = [];
+    },
+    handleAdd() {
+      this.conditList2 = this.leftData;
+    },
+    handleDelete() {
+      if (this.type == 2) {
+        for (let k = 0; k < this.conditList2.length; k++) {
+          for (let i = 0; i < this.rightData.length; i++) {
+            if (this.rightData[i].id == this.rightData[k].id) {
+              this.conditList2.splice(i, 1);
+            }
+          }
+        }
+      }
+    },
+    handleDiaSubmit() {
+      if (this.conditList2.length) {
+        for (let i = 0; i < this.conditionBox.length; i++) {
+          console.log(this.conditionBox[i]);
+          if (i == this.arrIndex) {
+            this.$set(this.conditionBox, i, [
+              ...this.conditList2,
+              ...this.conditionBox[i],
+            ]);
+            console.log(this.conditionBox);
+          }
+        }
+        this.VisibleModle = false;
+        this.conditList2 = [];
+      } else {
+        this.$errorMsg("请选择内容");
+      }
+    },
   },
   components: {
     AddModel,
+    TabelTransfer,
   },
 };
 </script>
 
 <style lang="scss" scoped>
+.line {
+  margin: 0 20px;
+}
 .mgb {
   margin-bottom: 20px;
 }
@@ -184,4 +602,34 @@ export default {
 .el-main {
   overflow: hidden;
 }
+.btn {
+  margin: 20px 0;
+  text-align: center;
+}
+.query_btn {
+  margin-left: 0;
+}
+.mg {
+  margin: 20px;
+}
+.pdt {
+  margin: 20px 0;
+}
+.el-main {
+  overflow: hidden;
+}
+.middle {
+  height: 430px;
+  display: flex;
+  align-content: center;
+  justify-content: center;
+  align-items: center;
+}
+.title {
+  padding: 10px 0;
+  text-align: center;
+  border-left: 1px solid #ebeef5;
+  border-right: 1px solid #ebeef5;
+  border-top: 1px solid #ebeef5;
+}
 </style>

+ 2 - 16
src/views/sales_policy/components/AddModel.vue

@@ -1,19 +1,5 @@
 <template>
-  <el-dialog
-    :visible.sync="centerDialogVisible"
-    width="70%"
-    center
-  >
-    <div>
-      <TabelTransfer />
-    </div>
-    <span slot="footer" class="dialog-footer">
-      <el-button @click="centerDialogVisible = false">取 消</el-button>
-      <el-button type="primary" @click="centerDialogVisible = false"
-        >确 定</el-button
-      >
-    </span>
-  </el-dialog>
+
 </template>
 
 <script>
@@ -23,7 +9,7 @@ export default {
     return {};
   },
   props: {
-    centerDialogVisible: {
+    VisibleModle: {
       type: Boolean,
       default: false,
     },

+ 369 - 348
src/views/sales_policy/components/AddPolicy.vue

@@ -1,300 +1,321 @@
 <template>
-  <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="销售政策类型"
-                @change="hanleChange"
-                class="select_height"
-              >
-                <el-option
-                  v-for="item in typeOptions"
-                  :key="item.value"
-                  :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 in walletList"
-                  :key="item.mainId"
-                  :label="item.mainName"
-                  :value="item.mainId"
+  <div>
+    <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"
+        >
+          <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>
-              </el-select>
-            </el-form-item>
-          </el-col>
+                  <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="name">
-              <el-date-picker
-                v-model="searchForm.name"
-                type="date"
-                placeholder="制单日期"
-              >
-              </el-date-picker> </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="生效日期"
 
-          <el-col :xs="24" :ms="12" :lg="12">
-            <el-form-item label="生效日期" prop="startTime">
-              <el-date-picker
-                v-model="searchForm.startTime"
-                type="date"
-                placeholder="生效日期"
-              >
-              </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="date"
-                placeholder="失效日期"
-              >
-              </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">
+
+            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="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-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">
+                <el-upload
+                  class="avatar-uploader"
+                  action="https://jsonplaceholder.typicode.com/posts/"
+                  :show-file-list="false"
+
+                >
+                  <img v-if="imageUrl" :src="imageUrl" class="avatar" />
+                  <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+                </el-upload>
+              </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="avatar-uploader"
-                action="https://jsonplaceholder.typicode.com/posts/"
-                :show-file-list="false"
-                :on-success="handleAvatarSuccess"
-                :before-upload="beforeAvatarUpload"
+                class="import-btn"
+                :action="baseURL + 'student/import'"
+                :http-request="handleImport"
+                :file-list="importFileList"
               >
-                <img v-if="imageUrl" :src="imageUrl" class="avatar" />
-                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+                <el-button size="small">导入货品价格表</el-button>
               </el-upload>
-            </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"
-            >
-              <el-button size="small">导入货品价格表</el-button>
-            </el-upload>
-            <el-button size="small" @click="hanleDownloadFiles"
-              >下载模板</el-button
-            >
-          </el-col>
+              <el-button size="small" @click="hanleDownloadFiles"
+                >下载模板</el-button
+              >
+            </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-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
+          v-loading="listLoading"
+          :data="dataList"
+          element-loading-text="Loading"
+          border
+          fit
+          highlight-current-row
+          stripe
         >
-        </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-table-column>
-        <el-table-column fixed="right" label="操作" align="center">
-          <template slot-scope="scope">
-            <el-popconfirm
-              title="这是一段内容确定删除吗?"
-              @onConfirm="hnaleDelete(scope.row.id)"
-            >
-              <el-button slot="reference" size="small">删除</el-button>
-            </el-popconfirm>
-          </template>
-        </el-table-column>
-      </el-table>
+          <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-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 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>
-      <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="$parent.isShow = 3"
-              >管理条件</el-button
-            ></el-col
+        <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="$parent.isShow = 3"
+                >管理条件</el-button
+              ></el-col
+            >
+          </el-row>
+          <el-divider></el-divider>
         </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
+          v-loading="listLoading"
+          :data="conditionList"
+          element-loading-text="Loading"
+          border
+          fit
+          highlight-current-row
+          stripe
         >
-        </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>
-    </div>
-
-    <div>
-      <el-row>
-        <el-divider></el-divider>
-        <el-row type="flex" align="middle">
-          <el-col :span="2">
-            <h4>货品信息</h4>
-          </el-col>
+          <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>
+      </div>
+      <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" :dataL="customerList" />
+        <Transfer @handleAddPolicy="handleAddPolicy" />
+      </div>
     </div>
   </div>
 </template>
 
 <script>
 import {
-  getId,
+
   addPoliy,
   getTypeList,
   getWalletList,
   getMaterialList,
-  getConditionList,
-  getCrList,
+  getConditionList
 } from "@/api/supply/sales";
 import {
   downloadFiles,
@@ -304,6 +325,7 @@ import {
 import Minxin from "@/mixin";
 import Pagination from "@/components/Pagination";
 import Transfer from "./Transfer";
+import { mapState } from "vuex";
 export default {
   mixins: [Minxin],
   data() {
@@ -312,8 +334,6 @@ export default {
       baseURL: "",
       searchForm: {
         code: "",
-        name: "",
-        type: "",
         endTime: "",
         imgSrc: "",
         remark: "",
@@ -329,7 +349,7 @@ export default {
         ],
       },
       imageUrl: "",
-      dataList: [],
+
       importFileList: [],
       fileList: [],
       options: {},
@@ -338,7 +358,7 @@ export default {
       walletList: [],
       typeOptions: [
         {
-          vlaue: "PROVISION",
+          value: "PROVISION",
           label: "配提",
         },
         {
@@ -349,23 +369,39 @@ export default {
       conditionList: [],
     };
   },
+    computed: mapState({
+    comCode: (state) =>{
+      return state.sales.code
+    },
+  }),
+
   created() {
+        console.log(this.$parent.isFlag,'flag');
     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()
+    }
   },
-  mounted() {},
-  methods: {
+  updated() {
+     this.searchForm.code= this.comCode
+
+  },
+    methods: {
     //下载excel模板
     hanleDownloadFiles() {
       downloadFiles("/policy/download");
     },
-    //删除
-    hnaleDelete(id) {
-      deleteMaterialPolicy({ policyMaterialId: id }).then(() => {
-        this.$sccussMsg("删除成功");
-        this.handletwoList();
-      });
-    },
     getCommonApi() {
+      // this.handletwoList()
       const params = {
         pageNum: 1,
         pageSize: 10,
@@ -381,17 +417,6 @@ export default {
         saleTypeName: "",
         status: "",
       };
-      const customerParams = {
-        pageNum: 1,
-        pageSize: 10,
-        keyword: "",
-        region: "",
-      };
-      // 获取销售政策编号
-      getId().then((res) => {
-        console.log(res.data);
-        this.searchForm.code = res.data;
-      });
       // 获取销售类型列表
       getTypeList(params).then((res) => {
         this.typeList = res.data.records;
@@ -401,11 +426,6 @@ export default {
       getWalletList(walletParams).then((res) => {
         this.walletList = res.data.records;
       });
-      // 获取经销商列表
-      getCrList(customerParams).then((res) => {
-        this.customerList = res.data.records;
-        console.log(this.customerList, 12345797);
-      });
     },
     // 导入
     async handleImport(param) {
@@ -422,7 +442,7 @@ export default {
         this.$alert(result.message, "导入成功", {
           confirmButtonText: "确定",
         });
-        this.getList();
+        this.handletwoList();
       } else {
         this.$alert(result.message, "导入失败", {
           confirmButtonText: "确定",
@@ -430,74 +450,75 @@ export default {
       }
     },
     getList() {
-      const params = {
-        policyId: this.searchForm.code,
-      };
-      // 获取条件政策
-      getConditionList(params).then((res) => {
-        this.conditionList = res.data;
-      });
-      this.handletwoList();
-    },
-    //获取政策id调取货品信息
-    hanleChange() {
-      this.handletwoList();
     },
     // 获取货品信息
     handletwoList() {
-      const params = {
+      // this.searchForm.type
+      const paramss = {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
-        policyId: this.searchForm.code,
-        saleTypeCode: this.searchForm.type,
+        policyId: this.comCode,
+        saleTypeCode:'',
       };
-      getMaterialList(params)
+      console.log(45454);
+      getMaterialList(paramss)
         .then((result) => {
           this.dataList = result.data.records;
-          console.log(result);
+           this.listTotal = result.data.total;
+
         })
         .catch((err) => {
           console.error(err);
         });
     },
-    // 获取图片路径
-    beforeAvatarUpload() {},
-    handleAvatarSuccess() {},
     // 提交审核
     handleAddPolicy(policyCustomers) {
       console.log(policyCustomers, "选择的经销商");
+      if (policyCustomers.length) {
+      var arr = [];
+      policyCustomers.forEach((el) => {
+        arr.push({
+          customerId: "",
+          customerName: el.name,
+          customerNumber: el.number,
+          lastOrderTime: "",
+          limitTakeNum: 0,
+          policyId: this.comCode,
+          policyTitle: "",
+          remark: "",
+        });
+      });
       const params = {
         adminCompanyId: "",
-        code: this.searchForm.code,
+        code: "",
         customerCount: 0,
-        endTime: this.searchForm.endTime,
-        examineBy: this.searchForm.examineBy,
-        examineRemark: this.searchForm.examineRemark,
-        examineStatus: this.searchForm.examineStatus,
-        examineTime: this.searchForm.examineTime,
-        id: null,
-        imgSrc: this.searchForm.imgSrc,
-        policyCustomers: [
-          //       	{
-          // 	"customerId": "",
-          // 	"customerName": "",
-          // 	"customerNumber": "",
-          // 	"id": "",
-          // 	"lastOrderTime": "",
-          // 	"limitTakeNum": 0,
-          // 	"policyId": "",
-          // 	"policyTitle": "",
-          // 	"remark": "",
-          // }
-        ],
-        remark: this.searchForm.remark,
-        startTime: this.searchForm.startTime,
+        examineBy: "",
+        examineRemark: "",
+        examineStatus: "",
+        id: "",
+        imgSrc: "",
+        policyCustomers: arr,
+        remark: "",
         status: true,
-        title: this.searchForm.title,
-        type: this.searchForm.type,
+        title: "",
+        type: "",
+        ...this.searchForm,
       };
       addPoliy(params).then((res) => {
         console.log(res);
+        this.$successMsg('新增成功')
+        this.$parent.isShow=1
+      });
+      return
+      }
+      this.$errorMsg('选择经销商  ')
+    },
+    //删除
+    hanleDelete(id) {
+      const params = { policyMaterialId: id };
+      deleteMaterialPolicy(params).then((res) => {
+        this.$successMsg("删除成功");
+        this.handletwoList();
       });
     },
   },

+ 5 - 1
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,9 +282,12 @@ export default {
       }).then((res) => {
         this.$successMsg("编辑成功");
         this.dialogVisible = false;
+        this.remark = ''
+        this.limitTakeNum = ''
         this.getList();
       });
     },
+
   },
   components: {
     Transfer,

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

@@ -1,254 +1,314 @@
 <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=3">查看条件</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 == 6">
+          <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 +331,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 +398,9 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+.el-col {
+  overflow: hidden;
+}
 .descriptions {
   // border: #EBEEF5;
   border: 1px solid #ebeef5;
@@ -339,4 +421,7 @@ export default {
 .el-divider--horizontal {
   margin: 20px 0;
 }
+.col {
+  height: 100px;
+}
 </style>

+ 13 - 297
src/views/sales_policy/components/TabelTransfer.vue

@@ -1,127 +1,23 @@
 <template>
-  <el-container>
-    <el-header height="">
-      <el-form label-width="0" :inline="false" size="small">
-        <el-row :gutter="20">
-          <el-col :xs="24" :sm="8" :lg="8" :offset="0">
-            <el-form-item label="">
-              <el-input v-model="input" placeholder="产品编码"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="8" :lg="8" :offset="0">
-            <el-form-item label="">
-              <el-input v-model="input" placeholder="产品名称"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="8" :lg="8" :offset="0">
-            <el-form-item label="">
-              <el-input v-model="input" placeholder="产品型号"></el-input>
-            </el-form-item>
-          </el-col>
 
-          <!-- <el-col :xs="24" :sm="8" :lg="8" :offset="0">
-            <el-form-item label="" >
-              <el-date-picker
-                v-model="value1"
-                type="datetimerange"
-                range-separator="至"
-                start-placeholder="开始日期"
-                end-placeholder="结束日期"
-              >
-              </el-date-picker>
-            </el-form-item>
-          </el-col> -->
-          <el-form-item label="">
-            <el-button type="primary" size="small " @click="">查询</el-button>
-          </el-form-item>
-        </el-row>
-      </el-form>
-    </el-header>
-    <el-main height="">
-      <el-row>
-        <el-row :gutter="50">
-          <el-col :xs="10" :ms="10" :lg="10">
-            <el-row>
-              <el-row> </el-row>
-              <el-row>
-                <el-row class="title"> 可选产品列表 </el-row>
-
-                <el-table style="width: 100%" :data="tableData" border>
-                  <el-table-column type="selection" width="55" align="center">
-                  </el-table-column>
-                  <el-table-column label="日期" width="120" align="center">
-                    <template slot-scope="scope">{{ scope.row.date }}</template>
-                  </el-table-column>
-                  <el-table-column prop="name" label="姓名" align="center">
-                  </el-table-column>
-                </el-table>
-                <el-row class="mg">
-                  <Pagination />
-                </el-row>
-              </el-row>
-            </el-row>
-          </el-col>
-          <el-col :xs="4" :ms="4" :lg="4" class="middle">
-            <el-row :gutter="20" justify="center" align="middle">
-              <el-row class="btn">
-                <el-button type="primary" size="small " @click=""
-                  >全部添加</el-button
-                >
-              </el-row>
-              <el-row class="btn">
-                <el-button type="primary" size="small " @click=""
-                  >增加</el-button
-                >
-              </el-row>
-              <el-row class="btn">
-                <el-button type="primary" size="small " @click=""
-                  >删除</el-button
-                ></el-row
-              >
-              <el-row class="btn"
-                ><el-button type="primary" size="small  " @click=""
-                  >全部删除</el-button
-                ></el-row
-              >
-            </el-row>
-          </el-col>
-          <el-col :xs="10" :ms="10" :lg="10">
-            <el-row>
-              <el-row> </el-row>
-              <el-row>
-                <el-row class="title"> 已选产品列表 </el-row>
-                <el-table style="width: 100%" :data="tableData" border>
-                  <el-table-column type="selection" width="55" align="center">
-                  </el-table-column>
-                  <el-table-column label="日期" width="120" align="center">
-                    <template slot-scope="scope">{{ scope.row.date }}</template>
-                  </el-table-column>
-                  <el-table-column prop="name" label="姓名" align="center">
-                  </el-table-column>
-                </el-table>
-                <el-row class="mg">
-                  <Pagination />
-                </el-row>
-              </el-row>
-            </el-row>
-          </el-col>
-        </el-row>
-      </el-row>
-    </el-main>
-  </el-container>
 </template>
 
 <script>
 import Minxin from "@/mixin";
-import { getConditionMaterialList } from "@/api/supply/sales";
+import { getId, getMaterialList } from "@/api/supply/sales";
 import Pagination from "./Pagination";
 export default {
   mixins: [Minxin],
+  props: {
+    conditList: {
+      type: Array,
+      default: [],
+    },
+  },
   data() {
     return {
       input: "",
-      leftData: [],
-      rightData: [],
+
       centerDialogVisible: false,
       value1: [new Date(2000, 10, 10, 10, 10), new Date(2000, 10, 11, 10, 10)],
       tableData: [
@@ -130,167 +26,16 @@ export default {
           name: "王小虎",
           address: "上海市普陀区金沙江路 1518 弄",
         },
-        {
-          date: "2016-05-02",
-          name: "王小虎",
-          address: "上海市普陀区金沙江路 1518 弄",
-        },
-        {
-          date: "2016-05-04",
-          name: "王小虎",
-          address: "上海市普陀区金沙江路 1518 弄",
-        },
-        {
-          date: "2016-05-01",
-          name: "王小虎",
-          address: "上海市普陀区金沙江路 1518 弄",
-        },
-        {
-          date: "2016-05-08",
-          name: "王小虎",
-          address: "上海市普陀区金沙江路 1518 弄",
-        },
-        {
-          date: "2016-05-06",
-          name: "王小虎",
-          address: "上海市普陀区金沙江路 1518 弄",
-        },
-        {
-          date: "2016-05-07",
-          name: "王小虎",
-          address: "上海市普陀区金沙江路 1518 弄",
-        },
       ],
-      leftData: [],
-      dataL: [1, 3, 2],
-      dataR: [],
-      rightData: [],
-      multipleSelection: [],
+      type:''
     };
   },
+
   methods: {
     getList() {
-      const params = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
-        policyConditionId: "",
-        popType: "",
-      };
-      getConditionMaterialList(params)
-        .then((res) => {
-          console.log(res);
-        })
-        .catch((err) => {});
-    },
-    handelLeftCheck(e) {
-      console.log(e);
-    },
-    handelLeftCheck(direction) {},
-    //添加全部数据
-    handleAllData(direction) {
-      if (direction === "left") {
-        if (!this.dataL.length) return;
-        this.dataR = [...this.dataR, ...this.dataL];
-        this.dataL = [];
-        this.leftData = [];
-      } else {
-        if (!this.dataR.length) return;
-        this.dataL = [...this.dataL, ...this.dataR];
-        this.dataR = [];
-        this.rightData = [];
-      }
-    },
-    //添加部分或单个数据
-    handlePartData(direction) {
-      if (direction === "left") {
-        if (!this.dataL.length) return;
-        this.dataR = [...this.dataR, ...this.leftData];
-        this.dataL.forEach((k, d) => {
-          this.leftData.forEach((e) => {
-            if (e == k) {
-              this.dataL.splice(d, 1);
-              this.leftData = [];
-              return;
-            }
-          });
-        });
-      } else {
-        if (!this.dataL.length) return;
-        this.dataL = [...this.dataL, ...this.rightData];
-        this.dataR.forEach((k, d) => {
-          this.rightData.forEach((e) => {
-            if (e == k) {
-              this.dataR.splice(d, 1);
-              this.rightData = [];
-              return;
-            }
-          });
-        });
-      }
-    },
-    //删除全部数据
-    handleAllDelete(direction) {
-      if (direction === "left") {
-        if (!this.dataL.length) return;
-        this.dataL = [];
-        this.leftData = [];
-      } else {
-        if (!this.dataR.length) return;
-        this.dataR = [];
-        this.rightData = [];
-      }
-    },
-    //删除部分或单个数据
-    handlePartDelete(direction) {
-      if (direction === "left") {
-        this.dataL.forEach((k, d) => {
-          this.leftData.forEach((e) => {
-            if (e == k) {
-              this.dataL.splice(d, 1);
-              this.leftData = [];
-              return;
-            }
-          });
-        });
-      } else {
-        this.dataR.forEach((k, d) => {
-          this.rightData.forEach((e) => {
-            if (e == k) {
-              this.dataR.splice(d, 1);
-              this.rightData = [];
-              return;
-            }
-          });
-        });
-      }
-    },
-    // 判断能操作那边框
-    handleJudge(type) {
-      if (this.leftDisabled) {
-        // 左边框功能操作
-        this.hanleType(type, "left");
-      } else {
-        // 右边框功能操作
-        this.hanleType(type, "right");
-      }
-    },
-    // 获取事件类型
-    hanleType(type, direction) {
-      switch (type) {
-        case "AddAll":
-          this.handleAllData(direction);
-          break;
-        case "AddPart":
-          this.handlePartData(direction);
-          break;
-        case "DeleteAll":
-          this.handleAllDelete(direction);
-          break;
-        case "DeletePart":
-          this.handlePartDelete(direction);
-          break;
-      }
+      // this.getMaterialList();
     },
+
   },
   components: {
     Pagination,
@@ -299,34 +44,5 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-.btn {
-  margin: 20px 0;
-  text-align: center;
-}
-.query_btn {
-  margin-left: 0;
-}
-.mg {
-  margin: 20px;
-}
-.pdt {
-  margin: 20px 0;
-}
-.el-main {
-  overflow: hidden;
-}
-.middle {
-  height: 430px;
-  display: flex;
-  align-content: center;
-  justify-content: center;
-  align-items: center;
-}
-.title {
-  padding: 10px 0;
-  text-align: center;
-  border-left: 1px solid #ebeef5;
-  border-right: 1px solid #ebeef5;
-  border-top: 1px solid #ebeef5;
-}
+
 </style>

+ 107 - 173
src/views/sales_policy/components/Transfer.vue

@@ -2,7 +2,7 @@
   <div>
     <slot name="header">
       <el-row class="radio">
-        <el-radio-group v-model="radio">
+        <el-radio-group v-model="region">
           <el-radio label="0">全部经销商</el-radio>
           <el-radio label="1">地区</el-radio>
           <el-radio label="2">指定</el-radio>
@@ -11,62 +11,80 @@
       <el-row type="flex">
         <el-col>
           <el-input
-            v-model="value"
+            v-model="keyword"
             placeholder="查找经销商"
             size="small"
           ></el-input>
         </el-col>
-        <el-col><el-button size="small">确定</el-button></el-col>
+        <el-col
+          ><el-button size="small" @click="getcList">确定</el-button></el-col
+        >
       </el-row>
     </slot>
     <div>
       <el-row type="flex" align="moddle" class="transfer">
         <el-col class="left_box" :span="9">
-          <h4 class="transfer_title">可选经销商</h4>
-          <el-checkbox-group
-            v-model="leftData"
-            class="left_box_flex"
-            @change="handelLeftCheck"
-          >
-            <el-checkbox
-              v-for="(item, index) in dataL"
-              :key="index"
-              :label="item.customerName"
-              :disabled="rightDisabled"
-            ></el-checkbox>
-          </el-checkbox-group>
+          <div>
+            <h4 class="transfer_title">可选经销商</h4>
+            <el-checkbox-group
+              v-model="leftData"
+              class="left_box_flex"
+              @change="handleLeft"
+            >
+              <el-checkbox
+                v-for="(item, index) in dataL"
+                :key="index"
+                :label="item.id"
+              >
+                {{ item.name }}</el-checkbox
+              >
+            </el-checkbox-group>
+          </div>
+          <!-- 分页 -->
+          <div>
+            <el-pagination
+              @size-change="handleSizeChange"
+              @current-change="handleCurrentChange"
+              :current-page="currentPage"
+              :page-sizes="[10]"
+              :page-size="10"
+              layout="total, sizes, prev, pager, next, jumper"
+              :total="listTotal"
+            >
+            </el-pagination>
+          </div>
         </el-col>
         <el-col class="middle_box" :span="6">
           <el-row>
             <el-col>
               <el-button
-                :disabled="isDisabled"
                 size="small"
-                @click="handleJudge('AddAll')"
+                @click="handleAllAdd"
+                :disabled="type == 2 || !dataL.length"
                 >全部添加</el-button
               ></el-col
             >
             <el-col>
               <el-button
-                :disabled="isDisabled"
                 size="small"
-                @click="handleJudge('AddPart')"
+                @click="handleAdd"
+                :disabled="type == 2 || !dataL.length"
                 >增加</el-button
               ></el-col
             >
             <el-col>
               <el-button
-                :disabled="isDisabled"
                 size="small"
-                @click="handleJudge('DeletePart')"
+                :disabled="type == 1 || !dataR.length"
+                @click="handleDelete"
                 >删除</el-button
               ></el-col
             >
             <el-col>
               <el-button
-                :disabled="isDisabled"
                 size="small"
-                @click="handleJudge('DeleteAll')"
+                :disabled="type == 1 || !dataR.length"
+                @click="handleAllDelete"
                 >全部删除</el-button
               ></el-col
             >
@@ -74,13 +92,18 @@
         </el-col>
         <el-col class="right_box" :span="9">
           <h4 class="transfer_title">已选经销商</h4>
-          <el-checkbox-group v-model="rightData" class="right_box_flex">
+          <el-checkbox-group
+            v-model="rightData"
+            class="right_box_flex"
+            @change="handleRight"
+          >
             <el-checkbox
               v-for="(item, index) in dataR"
               :key="index"
-              :label="item"
-              :disabled="leftDisabled"
-            ></el-checkbox>
+              :label="item.id"
+            >
+              {{ item.name }}</el-checkbox
+            >
           </el-checkbox-group>
         </el-col>
       </el-row>
@@ -97,18 +120,16 @@
 </template>
 
 <script>
+import Minxin from "@/mixin";
+import { getCrList } from "@/api/supply/sales";
 export default {
-  props: {
-    dataL: {
-      type: Array,
-      default: [],
-    },
-  },
+  mixins: [Minxin],
   data() {
     return {
+      type: "",
       radio: "0",
       leftData: [],
-      // dataL: [],
+      dataL: [],
       dataR: [],
       rightData: [],
       options: [
@@ -116,158 +137,68 @@ export default {
           value: "选项1",
           label: "黄金糕",
         },
-        {
-          value: "选项2",
-          label: "双皮奶",
-        },
-        {
-          value: "选项3",
-          label: "蚵仔煎",
-        },
-        {
-          value: "选项4",
-          label: "龙须面",
-        },
-        {
-          value: "选项5",
-          label: "北京烤鸭",
-        },
       ],
       value: "",
+      region: "",
+      keyword: "",
     };
   },
-  computed: {
-    /**
-     * @return(bool)  isDisabled
-     *  禁用功能按钮
-     */
-    isDisabled() {
-      return !(this.leftData.length || this.rightData.length);
+  methods: {
+    getList() {
+      this.getcList();
     },
-    /**
-     * @return(bool)  leftDisabled
-     *  禁用左边框选择
-     */
-    leftDisabled() {
-      return this.leftData.some((i) => i !== "");
+    getcList() {
+      const customerParams = {
+        pageNum: this.currentPage,
+        pageSize: this.pageSize,
+        keyword: this.keyword,
+        region: this.region,
+      };
+
+      // 获取经销商列表
+      getCrList(customerParams).then((res) => {
+        this.dataL = res.data.records;
+        console.log(res,'获取经销商列表');
+        this.listTotal = res.data.total;
+      });
     },
-    /**
-     * @return(bool)  rightDisabled
-     *  禁用右边框选择
-     */
-    rightDisabled() {
-      return this.rightData.some((i) => i !== "");
+    handleLeft(e) {
+      this.type = 1;
     },
-  },
-  methods: {
-    handelLeftCheck(direction) {},
-    //添加全部数据
-    handleAllData(direction) {
-      if (direction === "left") {
-        if (!this.dataL.length) return;
-        this.dataR = [...this.dataR, ...this.dataL];
-        this.dataL = [];
-        this.leftData = [];
-      } else {
-        if (!this.dataR.length) return;
-        this.dataL = [...this.dataL, ...this.dataR];
-        this.dataR = [];
-        this.rightData = [];
-      }
+    handleRight(e) {
+      this.type = 2;
     },
-    //添加部分或单个数据
-    handlePartData(direction) {
-      if (direction === "left") {
-        if (!this.dataL.length) return;
-        this.dataR = [...this.dataR, ...this.leftData];
-        this.dataL.forEach((k, d) => {
-          this.leftData.forEach((e) => {
-            if (e == k) {
-              this.dataL.splice(d, 1);
-              this.leftData = [];
-              return;
-            }
-          });
-        });
-      } else {
-        if (!this.dataL.length) return;
-        this.dataL = [...this.dataL, ...this.rightData];
-        this.dataR.forEach((k, d) => {
-          this.rightData.forEach((e) => {
-            if (e == k) {
-              this.dataR.splice(d, 1);
-              this.rightData = [];
-              return;
-            }
-          });
-        });
-      }
+    handleAllAdd() {
+      this.dataR = this.dataL;
     },
-    //删除全部数据
-    handleAllDelete(direction) {
-      if (direction === "left") {
-        if (!this.dataL.length) return;
-        this.dataL = [];
-        this.leftData = [];
-      } else {
-        if (!this.dataR.length) return;
-        this.dataR = [];
-        this.rightData = [];
-      }
+    handleAllDelete() {
+      this.dataR = [];
     },
-    //删除部分或单个数据
-    handlePartDelete(direction) {
-      if (direction === "left") {
-        this.dataL.forEach((k, d) => {
-          this.leftData.forEach((e) => {
-            if (e == k) {
-              this.dataL.splice(d, this.leftData.length);
-              this.leftData = [];
-              return;
-            }
-          });
-        });
-      } else {
-        this.dataR.forEach((k, d) => {
-          this.rightData.forEach((e) => {
-            if (e == k) {
-              this.dataR.splice(d, 1);
-              this.rightData = [];
-              return;
+    handleAdd() {
+      if (this.type == 1) {
+        for (let i = 0; i < this.dataL.length; i++) {
+          for (let k = 0; k < this.leftData.length; k++) {
+            if (this.dataL[i].id == this.leftData[k]) {
+              this.dataR = [...new Set([this.dataL[i], ...this.dataR])];
             }
-          });
-        });
-      }
-    },
-    // 判断能操作那边框
-    handleJudge(type) {
-      if (this.leftDisabled) {
-        // 左边框功能操作
-        this.hanleType(type, "left");
-      } else {
-        // 右边框功能操作
-        this.hanleType(type, "right");
+          }
+        }
+        this.leftData = [];
       }
     },
-    // 获取事件类型
-    hanleType(type, direction) {
-      switch (type) {
-        case "AddAll":
-          this.handleAllData(direction);
-          break;
-        case "AddPart":
-          this.handlePartData(direction);
-          break;
-        case "DeleteAll":
-          this.handleAllDelete(direction);
-          break;
-        case "DeletePart":
-          this.handlePartDelete(direction);
-          break;
+    handleDelete() {
+      if (this.type == 2) {
+        for (let i = 0; i < this.dataR.length; i++) {
+          for (let k = 0; k < this.rightData.length; k++) {
+            if (this.dataR[i].id == this.rightData[k]) {
+              this.dataR.splice(i, 1);
+            }
+          }
+        }
       }
     },
     handleSubmit() {
-      this.$emit("handleAddPolicy", { x: 1 });
+      this.$emit("handleAddPolicy", this.dataR);
     },
   },
 };
@@ -281,7 +212,10 @@ export default {
     margin: 20px 20px 0 20px;
   }
   .left_box {
-    width: 430px;
+    display: flex;
+    flex-direction: column;
+    justify-content: space-between;
+    width: 440px;
     height: 450px;
     border: 1px solid #eee;
     &_flex {
@@ -294,7 +228,7 @@ export default {
     }
   }
   .right_box {
-    width: 430px;
+    width: 440px;
     height: 450px;
     border: 1px solid #eee;
     &_flex {

+ 40 - 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,46 +155,34 @@
     </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">
-      <el-table :data="dataList" border style="width: 100%" height="600">
+      <el-table :data="dataList" border style="width: 100%">
         <el-table-column fixed="left" label="操作" width="250" align="center">
           <template slot-scope="scope">
-            <el-button
+            <!-- <el-button
               type="text"
               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 = 6), (id = scope.row.id), (code = scope.row.code)
+              "
               size="small"
               >审核</el-button
             >
@@ -301,8 +289,8 @@
       </el-pagination>
     </div>
   </div>
-  <AddPolicy v-else-if="isShow == 2" />
-  <AddCondition v-else-if="isShow == 3" />
+  <AddPolicy v-else-if="isShow == 2"  />
+  <AddCondition v-else-if="isShow == 3 || isShow==10" :id="id" @handleSubmitCon='handleSubmitCon'/>
   <Examine v-else />
 </template>
 
@@ -313,6 +301,7 @@ import {
   deletePolicy,
   getpolicySubmit,
   toExamine,
+  getConditionList
 } from "@/api/supply/sales";
 import Minxin from "@/mixin";
 import { downloadFiles, handleImport } from "@/utils/util";
@@ -321,12 +310,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: "",
+      code: "",
+      codeId: "",
       isShow: 1,
       dataList: [],
       screenForm: {
@@ -369,9 +361,21 @@ 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,
@@ -467,6 +471,8 @@ export default {
         this.$errorMsg("未满足条件");
       }
     },
+
+
   },
   components: {
     Examine,
@@ -494,3 +500,11 @@ export default {
   margin: 0 10px;
 }
 </style>
+
+<style>
+.header {
+  display: flex;
+  height: 50px;
+  align-items: center;
+}
+</style>