Переглянути джерело

销售政策新增编辑页

howie 3 роки тому
батько
коміт
80165ecd84

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

@@ -101,7 +101,7 @@
             </el-col>
           </el-row>
           <el-row v-if="detail.imgSrc && $parent.isShow !== 5" class="img-box">
-            <el-col :span="8" class="item">
+            <el-col :span="24" class="item">
               <div class="label" style="height: 150px">政策封面图</div>
               <div class="value" style="height: 150px">
                 <el-image

+ 141 - 149
src/views/sales_policy/components/TabelTransfer.vue

@@ -1,6 +1,41 @@
 <template>
   <div>
-
+    <slot name="header">
+      <el-row class="radio">
+        <el-radio-group v-model="region">
+          <el-radio label="">全部经销商</el-radio>
+          <!--          <el-radio label="1">地区</el-radio>-->
+          <!--          <el-radio label="2">指定</el-radio>-->
+        </el-radio-group>
+        <el-upload
+          class="import-btn"
+          :action="baseURL + 'student/import'"
+          :http-request="handleImport"
+          :file-list="importFileList"
+          :show-file-list="false"
+        >
+          <el-button
+            type="primary"
+            size="small"
+          >导入经销商</el-button>
+        </el-upload>
+        <el-button
+          type="primary"
+          size="small"
+          @click="hanleDownloadFiles"
+        >下载模板</el-button>
+      </el-row>
+      <el-row type="flex">
+        <el-col>
+          <el-input
+            v-model="keyword"
+            placeholder="查找经销商"
+            size="small"
+          />
+        </el-col>
+        <el-col style="margin-left: 10px"><el-button size="small" @click="getList">确定</el-button></el-col>
+      </el-row>
+    </slot>
     <el-row :gutter="20">
       <el-col :span="10" :offset="0">
         <h5>未选经销商</h5>
@@ -109,14 +144,16 @@
         </el-table>
       </el-col>
     </el-row>
-    <div>
-      <el-button
-        v-if="$parent.isShow == 5"
-        type="primary"
-        size="default"
-        @click="handleSave"
-      >保存</el-button>
-    </div>
+    <slot name="footer">
+      <el-row style="margin:20px  0 0 0;">
+        <el-button
+          type="primary"
+          size="small"
+          @click="handleSave"
+        >提交审核</el-button>
+        <el-button type="primary" size="small" @click="handleReset">重置</el-button>
+      </el-row>
+    </slot>
 
   </div>
 </template>
@@ -128,17 +165,13 @@ import {
   getConditionList,
   getCrList,
   getCustomerList,
-  getMaterialList,
-  getPolicyDetail,
-  toExamine,
-  updatePolicy
+  toExamine
 } from '@/api/policy_list'
+import { downloadFiles, handleImport } from '@/utils/util'
 import EditCondition from './EditCondition'
 import ImageUpload from '@/components/Common/image-upload.vue'
-
-import { handleImport } from '@/utils/util'
-
 import Minxin from '@/mixin'
+import { mapState } from 'vuex'
 
 export default {
   name: 'Examine',
@@ -149,13 +182,14 @@ export default {
   mixins: [Minxin],
   data() {
     return {
+      keyword:'',
+      region:'',
       baseURL: '',
       dcurrentPage: 1,
       dpageSize: 10,
       dlistTotal: 0,
       currentPages: 1, // 当前页码
       pageSizes: 10, // 每页数量
-      clistTotal: 0,
       input: '',
       remark: '',
       fileList: [],
@@ -191,7 +225,6 @@ export default {
       clistTotal: 0,
       clistTotals: 0,
       type: 1,
-      fileList: [],
       importFileList: [],
       leftData: [],
       rightData: [],
@@ -208,64 +241,36 @@ export default {
     }
   },
   computed: {
-    comTitle() {
-      let title = '详情页'
-      if (this.$parent.isShow == 5) {
-        title = '编辑页'
-      } else if (this.$parent.isShow == 8) {
-        title = '审核页'
-      } else {
-        title = '详情页'
-      }
-      return title
-    }
+    ...mapState({
+      comCode: (state) => state.sales.code ,
+    }),
   },
-  created() {},
   methods: {
     getList() {
-      this.listLoading = true
-      getPolicyDetail({ policyId: this.$parent.id }).then((res) => {
-        this.detail = res.data
-        this.srcList = [this.$imageUrl + this.detail.imgSrc]
-        if (this.$parent.isShow == 5 && this.detail.imgSrc) {
-          this.fileList = [
-            {
-              hover: '',
-              url: this.detail.imgSrc
-            }
-          ]
-        }
-        this.handletwoList()
-        // 获取条件政策
-        this.getConditionList()
-        this.getCond()
-      })
+      this.getCrList()
     },
-
     getCrList() {
       const customerParams = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
-        keyword: this.region == 1 || this.region == '' ? '' : this.keyword,
-        region: this.region == 1 ? this.keyword : ''
+        pageNum: this.currentPages,
+        pageSize: this.pageSizes,
+        keyword: this.keyword,
+        region: ''
       }
       // 获取经销商列表
       getCrList(customerParams).then((res) => {
+        this.dataL = res.data.records
         for (let j = 0; j < this.custoList.length; j++) {
           for (let i = 0; i < res.data.records.length; i++) {
-            if (res.data.records[i].id == this.custoList[j].customerId) {
+            if (res.data.records[i].id === this.custoList[j].customerId) {
               res.data.records[i].disabled = true
             }
           }
         }
-        this.dataL = res.data.records
         for (let k = 0; k < this.dataL.length; k++) {
           (this.dataL[k].customerId = this.dataL[k].id),
           (this.dataL[k].customerName = this.dataL[k].name),
           (this.dataL[k].customerNumber = this.dataL[k].number)
         }
-
-        console.log(this.dataL, '获取经销商列表')
         this.clistTotal = res.data.total
       })
     },
@@ -273,30 +278,64 @@ export default {
     handleSizeChanges(val) {
       this.pageSizes = val
       this.currentPages = 1
-      this.getCond()
+      this.getCrList()
     },
     // 更改当前页
     handleCurrentChanges(val) {
       this.currentPages = val
-      this.getCond()
+      this.getCrList()
     },
-    // 更改每页数量
-    handleSizeChange2(val) {
-      this.dpageSize = val
-      this.dcurrentPage = 1
-      this.handletwoList()
+    // 去掉相同数据
+    resArr(arr1, arr2) {
+      return arr1.filter((v) => arr2.every((val) => val.id !== v.id))
     },
-    // 更改当前页
-    handleCurrentChange2(val) {
-      this.dcurrentPage = val
-      this.handletwoList()
+    // 导入经销商模板
+    async handleImport(param) {
+      this.importLoading = true
+      const file = param.file
+      const formData = new FormData()
+      formData.append('file', file)
+      // formData.append('policyId', this.searchForm.code)
+      // formData.append("mainId", this.searchForm.mainId);
+      const result = await handleImport('/policy/importCustomer', formData)
+      console.log(result)
+      this.importLoading = false
+      this.importFileList = []
+      if (result.code === 200) {
+        await this.$alert(result.message, '导入成功', {
+          confirmButtonText: '确定'
+        })
+        for (let i = 0; i < result.data.length; i++) {
+          result.data[i].customerNumber =  result.data[i].number
+          result.data[i].customerName = result.data[i].name
+        }
+        if (this.custoList.length) {
+
+          this.custoList = [...this.custoList, ...this.resArr(this.custoList, result.data)]
+
+        } else {
+          this.custoList = result.data
+        }
+      } else {
+        await this.$alert(result.message, '导入失败', {
+          confirmButtonText: '确定'
+        })
+      }
+    },
+    // 下载经销商模板
+    hanleDownloadFiles() {
+      downloadFiles('/policy/customer_count/export', {
+        code: '',
+        remark: '',
+        title: ''
+      })
     },
     getCommonApi(row) {
       (this.isEdit = 2), (this.cid = row.id), (this.cpolicyId = row.policyId)
       console.log(
         this.cpolicyId,
-        this.detail.code,
-        this.cpolicyId == this.detail.code
+        this.comCode,
+        this.cpolicyId == this.comCode
       )
     },
     getCond() {
@@ -304,13 +343,14 @@ export default {
       const custoParams = {
         pageNum: this.currentPages,
         pageSize: this.pageSizes,
-        policyId: this.detail.code
+        policyId: this.comCode
       }
       getCustomerList(custoParams).then((res) => {
         this.custoList = res.data.records
+        console.log(this.custoList,'已选的')
         this.clistTotals = res.data.total
         this.listLoading = false
-        this.getCrList()
+        // this.getCrList()
       })
     },
     handleSubmit() {
@@ -324,49 +364,7 @@ export default {
         this.$parent.getList()
       })
     },
-    // 获取货品信息
-    handletwoList() {
-      // this.searchForm.type
-      const paramss = {
-        pageNum: this.dcurrentPage,
-        pageSize: this.dpageSize,
-        policyId: this.detail.code,
-        saleTypeCode: ''
-      }
-      getMaterialList(paramss)
-        .then((result) => {
-          this.dataList = result.data.records
-          this.dlistTotal = result.data.total
-          this.listLoading = false
-        })
-        .catch((err) => {
-          console.error(err)
-        })
-    },
-    // 导入
-    async handleImport(param) {
-      this.importLoading = true
-      const file = param.file
-      console.log(file, 123)
-      const formData = new FormData()
-      formData.append('file', file)
-      formData.append('policyId', this.detail.code)
-      // formData.append("mainId", this.detail.mainId);
-      const result = await handleImport('/policy/material/import', formData)
-      this.importLoading = false
-      this.importFileList = []
-      if (result.code == 200) {
-        this.$alert(result.message, '导入成功', {
-          confirmButtonText: '确定'
-        })
 
-        this.handletwoList()
-      } else {
-        this.$alert(result.message, '导入失败', {
-          confirmButtonText: '确定'
-        })
-      }
-    },
     handleCondition(id, index) {
       deleteCondition({ id }).then((res) => {
         // this.conditionList.splice(index, 1);
@@ -380,7 +378,7 @@ export default {
     },
     getConditionList() {
       const condParams = {
-        policyId: this.detail.code
+        policyId: this.comCode
       }
       getConditionList(condParams).then((res) => {
         this.conditionList = res.data
@@ -391,7 +389,7 @@ export default {
       const params = { policyMaterialId: id }
       deleteMaterialPolicy(params).then((res) => {
         this.$successMsg('删除成功')
-        this.handletwoList()
+
       })
     },
     /**
@@ -450,11 +448,12 @@ export default {
       }
     },
     handleAllDelete() {
-      if (this.type == 2 && this.rightData.length) {
+      if (this.type === 2 && this.rightData.length) {
         for (let i = 0; i < this.dataL.length; i++) {
           for (let j = 0; j < this.rightData.length; j++) {
-            if (this.dataL[i].id == this.rightData[j].customerId) {
+            if (this.dataL[i].id === this.rightData[j].customerId) {
               this.$set(this.dataL[i], 'disabled', false)
+              // this.dataL[i].disabled = false
             }
           }
         }
@@ -465,10 +464,10 @@ export default {
       }
     },
     handleAdd() {
-      if (this.type == 1 && this.leftData.length) {
+      if (this.type === 1 && this.leftData.length) {
         for (let i = 0; i < this.dataL.length; i++) {
           for (let j = 0; j < this.leftData.length; j++) {
-            if (this.dataL[i].id == this.leftData[j].id) {
+            if (this.dataL[i].id === this.leftData[j].id) {
               this.dataL[i].disabled = true
             }
           }
@@ -481,59 +480,52 @@ export default {
       }
     },
     handleDelete() {
-      if (this.type == 2 && this.rightData.length) {
+      if (this.type === 2 && this.rightData.length) {
         for (let i = 0; i < this.dataL.length; i++) {
           for (let j = 0; j < this.rightData.length; j++) {
-            if (this.dataL[i].id == this.rightData[j].customerId) {
+            if (this.dataL[i].id === this.rightData[j].customerId) {
               this.$set(this.dataL[i], 'disabled', false)
+              // this.dataL[i].disabled = false
             }
+
           }
         }
         const arr = this.resArr(this.custoList, this.rightData)
         this.custoList = arr
+
       } else {
         this.$errorMsg('请选择要删除的经销商')
       }
     },
     // 去掉相同数据
     resArr(arr1, arr2) {
-      return arr1.filter((v) => arr2.every((val) => val.id != v.id))
+      return arr1.filter((v) => arr2.every((val) => val.id !== v.id))
     },
-    async handleSave() {
-      if (this.custoList.length) {
-        var arr = []
-        this.custoList.forEach((el) => {
-          arr.push({
-            customerId: el.customerId,
-            customerName: el.customerName,
-            customerNumber: el.customerNumber,
-            lastOrderTime: '',
-            limitTakeNum: 0,
-            policyId: this.detail.code,
-            policyTitle: '',
-            remark: ''
-          })
-        })
+    // 提交数据
 
-        const params = {
-          ...this.detail,
-          policyCustomers: arr,
-          imgSrc: this.fileList.length ? this.fileList[0].url : ''
-        }
-        await updatePolicy(params)
-        await this.getCond()
-        this.$successMsg('编辑成功')
-        this.fileList = []
-        this.$parent.isShow = 1
-      }
+    async handleSave() {
+        this.$emit('handlEditPolicy', this.custoList)
+    },
+    handleReset() {
+      this.dataR = this.rightData = []
+      this.keyword = ''
+      this.$emit('handleReset')
     }
   }
 }
 </script>
 
 <style lang="scss" scoped>
+.radio{
+  display: flex;
+  align-items: center;
+  margin: 0 0  20px 0;
+}
+.import-btn{
+  margin:0 10px;
+}
 .el-col {
-  overflow: hidden;
+  //overflow: hidden;
 }
 .value{
   ::v-deep .el-input__prefix{

+ 8 - 9
src/views/sales_policy/components/editPolicy.vue

@@ -405,8 +405,7 @@
             </el-row>
             <el-divider />
           </el-row>
-<!--          <TabelTransfer />-->
-<!--          <Transfer @handleAddPolicy="handleAddPolicy" @handleReset="handleReset" />-->
+          <TabelTransfer @handlEditPolicy="handlEditPolicy" @handleReset="handleReset"/>
         </div>
       </div>
     </div>
@@ -421,7 +420,6 @@
 import { mapGetters, mapMutations } from 'vuex'
 import Minxin from '@/mixin'
 import {
-  addPoliy,
   deleteCondition,
   deleteMaterialPolicy,
   getConditionList,
@@ -431,7 +429,8 @@ import {
   getPolicyDetail,
   getTypeList,
   savePolicy,
-  updateCondition
+  updateCondition,
+  updatePolicy
 } from '@/api/policy_list'
 import { downloadFiles, handleImport } from '@/utils/util'
 // import Transfer from './Transfer'
@@ -780,7 +779,7 @@ export default {
         })
     },
     // 提交审核
-    handleAddPolicy(policyCustomers) {
+    handlEditPolicy(policyCustomers) {
       if (!this.searchForm.title) {
         this.$errorMsg('请输入说明')
         return
@@ -820,7 +819,7 @@ export default {
           examineBy: '',
           examineRemark: '',
           examineStatus: '',
-          id: '',
+          id: this.detail.id,
           policyCustomers: arr,
           remark: '',
           status: true,
@@ -831,9 +830,9 @@ export default {
           imgSrc: this.fileList.length ? this.fileList[0].url : ''
         }
         console.log(this.fileList)
-        addPoliy(params).then((res) => {
+        updatePolicy(params).then((res) => {
           console.log(res)
-          this.$successMsg('新增成功')
+          this.$successMsg('编辑成功')
           this.$parent.getList()
           this.$parent.isShow = 1
         })
@@ -928,7 +927,7 @@ export default {
     }
   },
   components: {
-    Transfer,
+    // Transfer,
     AddCondition,
     ImageUpload,
     TabelTransfer

+ 199 - 198
src/views/sales_policy/policy_list.vue

@@ -1,7 +1,7 @@
 <template>
-  <div class="app-container" v-if="isShow == 1">
+  <div v-if="isShow === 1" class="app-container">
     <div class="screen-container">
-      <el-form :model="screenForm" ref="screenForm" :inline="false">
+      <el-form ref="screenForm" :model="screenForm" :inline="false">
         <el-row>
           <el-row :gutter="20">
             <el-col :xs="24" :ms="6" :lg="6">
@@ -10,7 +10,7 @@
                   v-model="screenForm.code"
                   placeholder="销售政策编号"
                   size="small"
-                ></el-input>
+                />
               </el-form-item>
             </el-col>
 
@@ -20,7 +20,7 @@
                   v-model="screenForm.title"
                   placeholder="销售政策说明"
                   size="small"
-                ></el-input>
+                />
               </el-form-item>
             </el-col>
 
@@ -30,7 +30,7 @@
                   v-model="screenForm.remark"
                   placeholder="表头备注"
                   size="small"
-                ></el-input>
+                />
               </el-form-item>
             </el-col>
 
@@ -42,8 +42,7 @@
                   size="small"
                   placeholder="生效日期"
                   value-format="yyyy-MM-dd HH:mm:ss"
-                >
-                </el-date-picker>
+                />
               </el-form-item>
             </el-col>
           </el-row>
@@ -56,8 +55,7 @@
                   size="small"
                   placeholder="结束日期"
                   value-format="yyyy-MM-dd HH:mm:ss"
-                >
-                </el-date-picker>
+                />
               </el-form-item>
             </el-col>
 
@@ -69,8 +67,7 @@
                   size="small"
                   placeholder="制表日期"
                   value-format="yyyy-MM-dd HH:mm:ss"
-                >
-                </el-date-picker>
+                />
               </el-form-item>
             </el-col>
 
@@ -80,7 +77,7 @@
                   v-model="screenForm.createBy"
                   placeholder="制表人"
                   size="small"
-                ></el-input>
+                />
               </el-form-item>
             </el-col>
 
@@ -90,7 +87,7 @@
                   v-model="screenForm.examineBy"
                   placeholder="审核人"
                   size="small"
-                ></el-input>
+                />
               </el-form-item>
             </el-col>
           </el-row>
@@ -98,8 +95,8 @@
             <el-col :xs="24" :ms="6" :lg="6">
               <el-form-item label="" prop="status">
                 <el-select
-                  size="small"
                   v-model="screenForm.status"
+                  size="small"
                   placeholder="状态"
                   class="select_height"
                 >
@@ -108,8 +105,7 @@
                     :key="index"
                     :label="item.label"
                     :value="item.value"
-                  >
-                  </el-option>
+                  />
                 </el-select>
               </el-form-item>
             </el-col>
@@ -117,8 +113,8 @@
             <el-col :xs="24" :ms="6" :lg="6">
               <el-form-item label="" prop="type">
                 <el-select
-                  size="small"
                   v-model="screenForm.type"
+                  size="small"
                   placeholder="销售政策类型"
                   class="select_height"
                 >
@@ -127,20 +123,22 @@
                     :key="item.value"
                     :label="item.label"
                     :value="item.value"
-                  >
-                  </el-option>
+                  />
                 </el-select>
               </el-form-item>
             </el-col>
-            <el-col :xs="24" :ms="6" :lg="6"> </el-col>
+            <el-col :xs="24" :ms="6" :lg="6" />
             <el-col :xs="24" :ms="6" :lg="12" class="tr">
               <el-form-item>
-                <el-button type="primary" size="small" @click="submitScreenForm"
-                  >查询</el-button
-                >
-                <el-button size="small" @click="resetScreenForm"
-                  >重置</el-button
-                >
+                <el-button
+                  type="primary"
+                  size="small"
+                  @click="submitScreenForm"
+                >查询</el-button>
+                <el-button
+                  size="small"
+                  @click="resetScreenForm"
+                >重置</el-button>
               </el-form-item>
             </el-col>
           </el-row>
@@ -150,13 +148,12 @@
     <div class="btn-group">
       <el-row type="flex">
         <el-button
+          v-if="$checkBtnRole('add', $route.meta.roles)"
           size="small"
           type="primary"
           icon="el-icon-plus"
           @click="hanlenewInfo"
-          v-if="$checkBtnRole('add', $route.meta.roles)"
-          >新增</el-button
-        >
+        >新增</el-button>
       </el-row>
     </div>
     <div class="mymain-container">
@@ -169,36 +166,33 @@
         >
           <template slot-scope="scope">
             <el-button
+              v-if="scope.row.examineStatus == 'SAVE'"
               type="text"
               size="small"
-              v-if="scope.row.examineStatus == 'SAVE'"
               @click="(isShow = 5), (id = scope.row.id)"
-              >编辑</el-button
-            >
+            >编辑</el-button>
             <el-button
               type="text"
               size="small"
               @click="
                 (isShow = 4), (id = scope.row.id), (code = scope.row.code)
               "
-              >详情</el-button
-            >
+            >详情</el-button>
 
             <el-button
-              type="text"
               v-if="
                 scope.row.examineStatus == 'WAIT' &&
-                $checkBtnRole('examine', $route.meta.roles)
+                  $checkBtnRole('examine', $route.meta.roles)
               "
+              type="text"
+              size="small"
               @click="
                 (isShow = 8),
-                  (id = scope.row.id),
-                  (policyId = scope.row.policyId),
-                  (code = scope.row.code)
+                (id = scope.row.id),
+                (policyId = scope.row.policyId),
+                (code = scope.row.code)
               "
-              size="small"
-              >审核</el-button
-            >
+            >审核</el-button>
             <!-- </el-popconfirm> -->
             <el-popconfirm
               v-if="scope.row.examineStatus == 'SAVE'"
@@ -206,30 +200,36 @@
               title="提审?"
               @onConfirm="handlesubmit(scope.row)"
             >
-              <el-button type="text" size="small" slot="reference"
-                >提审</el-button
-              >
+              <el-button
+                slot="reference"
+                type="text"
+                size="small"
+              >提审</el-button>
             </el-popconfirm>
-              <el-popconfirm
+            <el-popconfirm
               v-if="scope.row.endTime || (scope.row.endTime && scope.row.startTime)"
               style="margin-left: 10px"
               title="作废?"
               @onConfirm="handleNullify(scope.row)"
             >
-              <el-button type="text" size="small" slot="reference"
-                >作废</el-button
-              >
+              <el-button
+                slot="reference"
+                type="text"
+                size="small"
+              >作废</el-button>
             </el-popconfirm>
-                <el-popconfirm
+            <el-popconfirm
               v-if="$checkBtnRole('examine', $route.meta.roles)"
               style="margin-left: 10px"
               title="克隆?"
               @onConfirm="handleClone(scope.row)"
             >
-                <!--  -->
-              <el-button type="text" size="small" slot="reference"
-                >克隆</el-button
-              >
+              <!--  -->
+              <el-button
+                slot="reference"
+                type="text"
+                size="small"
+              >克隆</el-button>
             </el-popconfirm>
             <el-popconfirm
               v-if="scope.row.examineStatus != 'OK' "
@@ -237,9 +237,11 @@
               title="删除吗?"
               @onConfirm="hanleDelete(scope.row.id)"
             >
-              <el-button type="text" slot="reference" size="small"
-                >删除</el-button
-              >
+              <el-button
+                slot="reference"
+                type="text"
+                size="small"
+              >删除</el-button>
             </el-popconfirm>
           </template>
         </el-table-column>
@@ -252,8 +254,9 @@
         <el-table-column label="审核状态" width="120" align="center">
           <template slot-scope="scope">
             <el-tag v-if="scope.row.examineStatus == 'SAVE'">保存</el-tag>
-            <el-tag v-else-if="scope.row.examineStatus == 'WAIT'"
-              >待审核
+            <el-tag
+              v-else-if="scope.row.examineStatus == 'WAIT'"
+            >待审核
             </el-tag>
             <el-tag v-else-if="scope.row.examineStatus == 'OK'">通过 </el-tag>
             <el-tag v-else>不通过 </el-tag>
@@ -264,15 +267,13 @@
           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="mainName"
           label="产品品类"
@@ -283,156 +284,152 @@
           label="表头备注"
           width="120"
           align="center"
-        >
-        </el-table-column>
-        <el-table-column prop="startTime" label="生效日期" align="center">
-        </el-table-column>
-        <el-table-column prop="endTime" label="结束日期" align="center">
-        </el-table-column>
+        />
+        <el-table-column prop="startTime" label="生效日期" align="center" />
+        <el-table-column prop="endTime" label="结束日期" align="center" />
         <el-table-column
           prop="createBy"
           label="制表人"
           width="120"
           align="center"
-        >
-        </el-table-column>
+        />
         <el-table-column
           prop="createTime"
           label="制表日期"
           width="120"
           align="center"
-        >
-        </el-table-column>
+        />
         <el-table-column
           prop="examineBy"
           label="审核人"
           width="120"
           align="center"
-        >
-        </el-table-column>
+        />
       </el-table>
+      <!-- 分页 -->
+      <div class="fr">
+        <el-pagination
+          :current-page="currentPage"
+          :page-sizes="[10, 20, 30, 50]"
+          :page-size="10"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="listTotal"
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+        />
+      </div>
     </div>
-    <!-- 分页 -->
-    <div class="fr">
-      <el-pagination
-        @size-change="handleSizeChange"
-        @current-change="handleCurrentChange"
-        :current-page="currentPage"
-        :page-sizes="[10, 20, 30, 50]"
-        :page-size="10"
-        layout="total, sizes, prev, pager, next, jumper"
-        :total="listTotal"
-      >
-      </el-pagination>
-    </div>
+
   </div>
-  <AddPolicy v-else-if="isShow == 2" />
-  <AddCondition v-else-if="isShow == 10" :id="id" :policyId="policyId" />
+  <AddPolicy v-else-if="isShow === 2" />
+  <AddCondition v-else-if="isShow === 10" :id="id" :policy-id="policyId" />
+  <EditPolicy v-else-if="isShow===5" />
   <Examine v-else />
 </template>
 
 <script>
 import {
-  getId,
-  getList,
-  getTypeList,
   cancelPolicy,
+  cloneList,
   deletePolicy,
+  getId,
+  getList,
   getpolicySubmit,
-  toExamine,
-  cloneList
-} from "@/api/policy_list";
-import Minxin from "@/mixin";
-import { downloadFiles, handleImport } from "@/utils/util";
-import AddPolicy from "./components/AddPolicy";
-import AddModel from "./components/AddModel";
-import Pagination from "./components/Pagination";
-import AddCondition from "./components/AddCondition";
-import Examine from "./components/Examine";
-import { mapState } from "vuex";
+  getTypeList,
+  toExamine
+} from '@/api/policy_list'
+import Minxin from '@/mixin'
+import { downloadFiles, handleImport } from '@/utils/util'
+import AddPolicy from './components/AddPolicy'
+import EditPolicy from './components/editPolicy'
+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: "",
+      id: '',
+      code: '',
+      codeId: '',
       listLoading: false,
-      policyId: "",
+      policyId: '',
 
       isShow: 1,
       dataList: [],
       screenForm: {
-        code: "",
-        createBy: "",
-        endCreateTime: "",
-        endTime1: "",
-        endTime2: "",
-        examineBy: "",
-        remark: "",
-        startCreateTime: "",
-        startTime1: "",
-        startTime2: "",
-        status: "",
-        title: "",
-        type: "",
+        code: '',
+        createBy: '',
+        endCreateTime: '',
+        endTime1: '',
+        endTime2: '',
+        examineBy: '',
+        remark: '',
+        startCreateTime: '',
+        startTime1: '',
+        startTime2: '',
+        status: '',
+        title: '',
+        type: ''
       },
       fileList: [],
       statusOptions: [
         {
-          vlaue: "",
-          label: "全部",
+          vlaue: '',
+          label: '全部'
         },
         {
           value: true,
-          label: "已生效",
+          label: '已生效'
         },
         {
           value: false,
-          label: "未生效",
-        },
+          label: '未生效'
+        }
       ],
       typeOptions: [
         {
-          vlaue: "",
-          label: "全部",
+          vlaue: '',
+          label: '全部'
         },
         {
-          vlaue: "PROVISION",
-          label: "配提",
+          vlaue: 'PROVISION',
+          label: '配提'
         },
         {
-          value: "LIMIT",
-          label: "限量",
-        },
+          value: 'LIMIT',
+          label: '限量'
+        }
       ],
       typeList: [],
-      value: "",
-      imageUrl: "",
-      baseURL: "",
-      isFlag: "",
-    };
+      value: '',
+      imageUrl: '',
+      baseURL: '',
+      isFlag: ''
+    }
   },
   computed: mapState({
-    comCode: (state) => state.sales.code,
+    comCode: (state) => state.sales.code
   }),
   methods: {
     hanlenewInfo() {
-      console.log();
+      console.log()
       getId().then((res) => {
-        this.$store.commit("sales/setId", res.data);
-        this.isShow = 2;
-      });
+        this.$store.commit('sales/setId', res.data)
+        this.isShow = 2
+      })
     },
-    handleClone(row){
-      cloneList({policyId:row.id}).then(res=>{
+    handleClone(row) {
+      cloneList({ policyId: row.id }).then(res => {
         this.$successMsg('克隆成功')
         this.getList()
       })
     },
     getList() {
-      this.listLoading = true;
+      this.listLoading = true
       const params = {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
@@ -448,100 +445,101 @@ export default {
         startTime1: this.screenForm.startTime1,
         startTime2: this.screenForm.startTime2,
         status: this.screenForm.status,
-        title: this.screenForm.title,
-      };
+        title: this.screenForm.title
+      }
       getList(params).then((res) => {
-        this.dataList = res.data.records;
-        console.log(this.dataList);
-        this.listTotal = res.data.total;
-        this.listLoading = false;
-      });
+        this.dataList = res.data.records
+        console.log(this.dataList)
+        this.listTotal = res.data.total
+        this.listLoading = false
+      })
       const paramsType = {
         pageNum: 1,
         pageSize: 10,
-        saleCdoe: "",
-        saleName: "",
-        stauts: "",
-      };
+        saleCdoe: '',
+        saleName: '',
+        stauts: ''
+      }
       getTypeList(paramsType).then((res) => {
-        this.typeList = res.data.records;
-      });
+        this.typeList = res.data.records
+      })
     },
     hanleDelete(id) {
       this.hanleDeleteAllPromise(id).then((ids) => {
         deletePolicy({
-          id: ids[0],
+          id: ids[0]
         }).then((res) => {
-          this.$successMsg("删除成功");
-          this.getList();
-        });
-      });
+          this.$successMsg('删除成功')
+          this.getList()
+        })
+      })
     },
     // 作废
-    handleNullify(row){
-      cancelPolicy({id:row.id}).then(res=>{
+    handleNullify(row) {
+      cancelPolicy({ id: row.id }).then(res => {
         this.$successMsg('已作废')
         this.getList()
       })
     },
     // 导出文档
     handleExport() {
-      let screenData = {
+      const screenData = {
         customerTel: this.diaLogForm.customerTel,
-        logisticsCompany: this.diaLogForm.logisticsCompany,
-      };
-      downloadFiles("/policy/export", screenData);
+        logisticsCompany: this.diaLogForm.logisticsCompany
+      }
+      downloadFiles('/policy/export', screenData)
     },
 
     // 导入
     async handleImport(param) {
-      this.importLoading = true;
-      const file = param.file;
-      console.log(file, 123);
-      const formData = new FormData();
-      formData.append("file", file);
-      let result = await handleImport("/policy/material/import", formData);
-      this.importLoading = false;
-      this.importFileList = [];
+      this.importLoading = true
+      const file = param.file
+      console.log(file, 123)
+      const formData = new FormData()
+      formData.append('file', file)
+      const result = await handleImport('/policy/material/import', formData)
+      this.importLoading = false
+      this.importFileList = []
       if (result.code == 200) {
-        this.$alert('导入成功', "导入成功", {
-          confirmButtonText: "确定",
-        });
-        this.getList();
+        this.$alert('导入成功', '导入成功', {
+          confirmButtonText: '确定'
+        })
+        this.getList()
       } else {
-        this.$alert('导入失败', "导入失败", {
-          confirmButtonText: "确定",
-        });
+        this.$alert('导入失败', '导入失败', {
+          confirmButtonText: '确定'
+        })
       }
     },
     handlesubmit(e) {
       getpolicySubmit({ policyId: e.id }).then((res) => {
-        this.$successMsg("已提交");
-        this.getList();
-      });
+        this.$successMsg('已提交')
+        this.getList()
+      })
     },
     hanleExamine(e) {
-      if (e.examineStatus == "WAIT") {
+      if (e.examineStatus == 'WAIT') {
         toExamine({
           examineRemark: e.id,
-          examineStatus: "WAIT",
-          policyId: e.id,
+          examineStatus: 'WAIT',
+          policyId: e.id
         }).then((res) => {
-          this.$successMsg("已提交");
-        });
+          this.$successMsg('已提交')
+        })
       } else {
-        this.$errorMsg("未满足条件");
+        this.$errorMsg('未满足条件')
       }
-    },
+    }
   },
   components: {
     Examine,
     AddModel,
     AddPolicy,
+    EditPolicy,
     Pagination,
-    AddCondition,
-  },
-};
+    AddCondition
+  }
+}
 </script>
 
 <style lang="scss" scoped>
@@ -567,4 +565,7 @@ export default {
   height: 50px;
   align-items: center;
 }
+.fr{
+  margin: 20px 0;
+}
 </style>