Browse Source

fix: 销售政策

zh 2 years ago
parent
commit
14c75c2cc6

+ 15 - 0
src/api/policy_list.js

@@ -597,3 +597,18 @@ export function saveLimit(params) {
     data: params
   })
 }
+
+export function delLimitGroup(params) {
+  return request({
+    url: '/policy/limit/group/delete',
+    method: 'post',
+    params
+  })
+}
+export function saveLimitGroup(params) {
+  return request({
+    url: '/policy/limit/group/save',
+    method: 'post',
+    data: params
+  })
+}

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

@@ -497,7 +497,7 @@
                   {{ scope.row.materialNumber }}
                 </template>
               </el-table-column>
-              <el-table-column prop="specification" label="物料编号" align="left" min-width="200">
+              <el-table-column prop="specification" label="规格型号" align="left" min-width="200">
                 <template slot-scope="scope">
                   {{ scope.row.specification }}
                 </template>
@@ -612,7 +612,16 @@
                         </template>
                       </el-table-column>
                     </template>
-                    <!-- <el-table-column prop="orderNums" label="配提上限已下订单数" align="left" width="200">
+                    <el-table-column prop="orderNums" label="已下订单数" align="left" min-width="200">
+                      <template slot-scope="scope">
+                        {{ scope.row.orderNums }}
+                      </template>
+                    </el-table-column>
+                    <el-table-column prop="examineOrderNums" label="已审订单数" align="left" min-width="200">
+                      <template slot-scope="scope">
+                        {{ scope.row.examineOrderNums }}
+                      </template>
+                      <!-- <el-table-column prop="orderNums" label="配提上限已下订单数" align="left" width="200">
                       <template slot-scope="scope">
                         {{ scope.row.orderNums }}
                       </template>
@@ -622,7 +631,7 @@
                         {{ scope.row.examineOrderNums }}
                       </template>
                     </el-table-column> -->
-                  </el-table>
+                    </el-table-column></el-table>
                 </div>
                 <!-- 分页 -->
                 <div style="margin: 20px 0">

+ 267 - 161
src/views/sales_policy/components/LinitVisible.vue

@@ -1,21 +1,14 @@
 <template>
   <el-dialog
-    title="上限"
+    title="经销商上限"
     :visible.sync="linitVisible"
     width="60%"
     :show-close="false"
     :append-to-body="true"
+    :close-on-click-modal="false"
     @close="onCancel"
   >
     <div>
-      <!-- <div style="margin: 20px 0">
-        <el-button
-          v-if="!linitType || linitType === 'add'"
-          size="mini"
-          type="primary"
-          @click="handleAddItmeData"
-        >添加</el-button>
-      </div> -->
       <zj-table :table-attributes="tableAttributes" :is-drop="true" :columns="columns" :table-data="dataList" />
     </div>
     <span slot="footer">
@@ -28,9 +21,17 @@
 <script>
 import { getMaterialListV2 } from '@/api/basic_data/material'
 import { getDealerListV2 } from '@/api/basic_data/dealer'
-
+import { getCustomerList, getMaterialList } from '@/api/policy_list'
 export default {
   props: {
+    operationType: {
+      type: String,
+      default: null
+    },
+    detailType: {
+      type: String,
+      default: null
+    },
     linitVisible: {
       type: Boolean,
       default: false
@@ -59,7 +60,7 @@ export default {
       dealerList: [],
       tableAttributes: {
         border: true,
-        maxheight: '600px',
+        maxHeight: '600px',
         headerCellClassName: 'headerRowColor',
         size: 'mini'
       }
@@ -81,17 +82,15 @@ export default {
                   style='width:100%'
                   value={row.customerNumber}
                   onInput={e => (row.customerNumber = e)}
-                  onChange={ e => this.handleChange(e, row)}
+                  onChange={e => this.handleChange(e, row)}
                   filterable
+                  disabled={this.linitType === 'edit'}
                   size='mini'
-                  remote
-                  reserve-keyword
                   placeholder='请输入经销商编号'
-                  remote-method={e => this.remoteMethod2(e, 'number')}
                   loading={this.loading}
                 >
                   {this.dealerList.map(k => {
-                    return <el-option key={k.id} label={k.number} value={k.id}></el-option>
+                    return <el-option key={k.id} label={k.customerNumber} value={k.id}></el-option>
                   })}
                 </el-select>
               </div>
@@ -111,139 +110,204 @@ export default {
                   style='width:100%'
                   value={row.customerName}
                   onInput={e => (row.customerName = e)}
-                  onChange={ e => this.handleChange(e, row)}
+                  onChange={e => this.handleChange(e, row)}
                   filterable
+                  disabled={this.linitType === 'edit'}
                   size='mini'
-                  remote
-                  reserve-keyword
                   placeholder='请输入经销商名称'
-                  remote-method={e => this.remoteMethod2(e, 'name')}
                   loading={this.loading}
                 >
                   {this.dealerList.map(k => {
-                    return <el-option key={k.id} label={k.name} value={k.id}></el-option>
+                    return <el-option key={k.id} label={k.customerName} value={k.id}></el-option>
                   })}
                 </el-select>
               </div>
             )
           }
         },
-        {
-          columnAttributes: {
-            label: '物料名称',
-            prop: 'materialName',
-            'min-width': '200px'
-          },
-          render: (h, { column, row, index }) => {
-            return (
-              <div style='margin:0 10px'>
-                <el-select
-                  style='width:100%'
-                  value={row.materialName}
-                  onInput={e => (row.materialName = e)}
-                  onChange={ e => this.handleChange2(e, row)}
-                  filterable
-                  size='mini'
-                  remote
-                  reserve-keyword
-                  placeholder='请输入物料名称'
-                  remote-method={e => this.remoteMethod(e, 'name')}
-                  loading={this.loading}
-                >
-                  {this.k3List.map(k => {
-                    return <el-option key={k.id} label={k.materialName} value={k.id}></el-option>
-                  })}
-                </el-select>
-              </div>
-            )
-          }
-        },
-        {
-          columnAttributes: {
-            label: '物料编号',
-            prop: 'materialNumber',
-            'min-width': '200px'
-          },
-          render: (h, { column, row, index }) => {
-            return (
-              <div style='margin:0 10px'>
-                <el-select
-                  style='width:100%'
-                  value={row.materialNumber}
-                  onInput={e => (row.materialNumber = e)}
-                  onChange={ e => this.handleChange2(e, row)}
-
-                  filterable
-                  size='mini'
-                  remote
-                  reserve-keyword
-                  placeholder='请输入物料编号'
-                  remote-method={e => this.remoteMethod(e, 'number')}
-                  loading={this.loading}
-                >
-                  {this.k3List.map(k => {
-                    return <el-option key={k.id} label={k.materialNumber} value={k.id}></el-option>
-                  })}
-                </el-select>
-              </div>
-            )
-          }
-        },
-        {
-          columnAttributes: {
-            label: '规格型号',
-            prop: 'specification',
-            'min-width': '200px'
-          },
-          render: (h, { column, row, index }) => {
-            return (
-              <div style='margin:0 10px'>
-                <el-select
-                  style='width:100%'
-                  value={row.specification}
-                  onInput={e => (row.specification = e)}
-                  onChange={ e => this.handleChange2(e, row)}
-
-                  filterable
-                  size='mini'
-                  remote
-                  reserve-keyword
-                  placeholder='请输入规格型号'
-                  remote-method={e => this.remoteMethod(e, 'specification')}
-                  loading={this.loading}
-                >
-                  {this.k3List.map(k => {
-                    return <el-option key={k.id} label={k.specification} value={k.id}></el-option>
-                  })}
-                </el-select>
-              </div>
-            )
-          }
-        },
-        {
-          columnAttributes: {
-            label: '订货上限',
-            prop: 'limitQty'
-          },
-          render: (h, { column, row, index }) => {
-            return (
-              <div style='margin:0 10px'>
-                <el-input
-                  type='number'
-                  value={row.limitQty}
-                  onInput={e => (row.limitQty = e)}
-                  placeholder='请输入'
-                  size='mini'
-                  clearable
-                ></el-input>
-              </div>
-            )
-          }
-        },
+        ...(() => {
+          return !this.operationType
+            ? [
+              {
+                columnAttributes: {
+                  label: '物料名称',
+                  prop: 'materialName',
+                  'min-width': '200px'
+                },
+                render: (h, { column, row, index }) => {
+                  return (
+                    <div style='margin:0 10px'>
+                      <el-select
+                        style='width:100%'
+                        value={row.materialName}
+                        onInput={e => (row.materialName = e)}
+                        onChange={e => this.handleChange2(e, row)}
+                        filterable
+                        size='mini'
+                        disabled={this.linitType === 'edit'}
+                        placeholder='请输入物料名称'
+                        loading={this.loading}
+                      >
+                        {this.k3List.map(k => {
+                          return <el-option key={k.id} label={k.materialName} value={k.id}></el-option>
+                        })}
+                      </el-select>
+                    </div>
+                  )
+                }
+              },
+              {
+                columnAttributes: {
+                  label: '物料编号',
+                  prop: 'materialNumber',
+                  'min-width': '200px'
+                },
+                render: (h, { column, row, index }) => {
+                  return (
+                    <div style='margin:0 10px'>
+                      <el-select
+                        style='width:100%'
+                        value={row.materialNumber}
+                        onInput={e => (row.materialNumber = e)}
+                        onChange={e => this.handleChange2(e, row)}
+                        disabled={this.linitType === 'edit'}
+                        filterable
+                        size='mini'
+                        placeholder='请输入物料编号'
+                        loading={this.loading}
+                      >
+                        {this.k3List.map(k => {
+                          return <el-option key={k.id} label={k.materialNumber} value={k.id}></el-option>
+                        })}
+                      </el-select>
+                    </div>
+                  )
+                }
+              },
+              {
+                columnAttributes: {
+                  label: '规格型号',
+                  prop: 'specification',
+                  'min-width': '200px'
+                },
+                render: (h, { column, row, index }) => {
+                  return (
+                    <div style='margin:0 10px'>
+                      <el-select
+                        style='width:100%'
+                        value={row.specification}
+                        onInput={e => (row.specification = e)}
+                        onChange={e => this.handleChange2(e, row)}
+                        disabled={this.linitType === 'edit'}
+                        filterable
+                        size='mini'
+                        placeholder='请输入规格型号'
+                        loading={this.loading}
+                      >
+                        {this.k3List.map(k => {
+                          return <el-option key={k.id} label={k.specification} value={k.id}></el-option>
+                        })}
+                      </el-select>
+                    </div>
+                  )
+                }
+              },
+              {
+                columnAttributes: {
+                  label: '订货上限',
+                  prop: 'limitQty',
+                  'min-width': '100px'
+                },
+                render: (h, { column, row, index }) => {
+                  return (
+                    <div style='margin:0 10px'>
+                      <el-input
+                        type='number'
+                        value={row.limitQty}
+                        onInput={e => (row.limitQty = e)}
+                        placeholder='请输入'
+                        size='mini'
+                        clearable
+                      ></el-input>
+                    </div>
+                  )
+                }
+              }
+            ]
+            : this.detailType === 'LIMIT'
+              ? [
+                {
+                  columnAttributes: {
+                    label: '最小提货数量',
+                    prop: 'minBuyNum',
+                    'min-width': '100px'
+                  },
+                  render: (h, { column, row, index }) => {
+                    return (
+                      <div style='margin:0 10px'>
+                        <el-input
+                          type='number'
+                          value={row.minBuyNum}
+                          onInput={e => (row.minBuyNum = e)}
+                          placeholder='请输入'
+                          size='mini'
+                          clearable
+                        ></el-input>
+                      </div>
+                    )
+                  }
+                },
+                {
+                  columnAttributes: {
+                    label: '最大提货组数',
+                    prop: 'maxBuyNum',
+                    'min-width': '100px'
+                  },
+                  render: (h, { column, row, index }) => {
+                    return (
+                      <div style='margin:0 10px'>
+                        <el-input
+                          type='number'
+                          value={row.maxBuyNum}
+                          onInput={e => (row.maxBuyNum = e)}
+                          placeholder='请输入'
+                          size='mini'
+                          clearable
+                        ></el-input>
+                      </div>
+                    )
+                  }
+                }
+              ]
+              : [
+                {
+                  columnAttributes: {
+                    label: '配提上限组数',
+                    prop: 'groupLimitNum',
+                    'min-width': '100px'
+                  },
+                  render: (h, { column, row, index }) => {
+                    return (
+                      <div style='margin:0 10px'>
+                        <el-input
+                          type='number'
+                          value={row.groupLimitNum}
+                          onInput={e => (row.groupLimitNum = e)}
+                          placeholder='请输入'
+                          size='mini'
+                          clearable
+                        ></el-input>
+                      </div>
+                    )
+                  }
+                }
+              ]
+        })(),
         {
           columnAttributes: {
             label: '已下订单数',
-            prop: 'orderNums'
+            prop: 'orderNums',
+            'min-width': '100px'
           },
           render: (h, { column, row, index }) => {
             return (
@@ -251,6 +315,7 @@ export default {
                 <el-input
                   type='number'
                   value={row.orderNums}
+                  disabled={this.linitType === 'edit'}
                   onInput={e => (row.orderNums = e)}
                   placeholder='请输入'
                   size='mini'
@@ -263,7 +328,8 @@ export default {
         {
           columnAttributes: {
             label: '已审订单数',
-            prop: 'examineOrderNums'
+            prop: 'examineOrderNums',
+            'min-width': '100px'
           },
           render: (h, { column, row, index }) => {
             return (
@@ -272,6 +338,7 @@ export default {
                   type='number'
                   value={row.examineOrderNums}
                   onInput={e => (row.examineOrderNums = e)}
+                  disabled={this.linitType === 'edit'}
                   placeholder='请输入'
                   size='mini'
                   clearable
@@ -283,26 +350,48 @@ export default {
       ]
     }
   },
-
   mounted() {
-    if (this.linitType === 'add') {
-      this.dataList.push({
-        customerId: '',
-        id: '',
-        limitQty: 0,
-        materialId: '',
-        policyId: this.policyId,
-        customerName: '',
-        customerNumber: '',
-        examineOrderNums: 0,
-        materialName: '',
-        materialNumber: '',
-        orderNums: 0,
-        policyType: '',
-        specification: ''
-      })
+    if (!this.operationType) {
+      if (this.linitType === 'add') {
+        this.dataList.push({
+          customerId: '',
+          id: '',
+          limitQty: null,
+          materialId: '',
+          policyId: this.policyId,
+          customerName: '',
+          customerNumber: '',
+          examineOrderNums: null,
+          materialName: '',
+          materialNumber: '',
+          orderNums: null,
+          policyType: '',
+          specification: ''
+        })
+      }
+    } else {
+      if (this.linitType === 'add') {
+        this.dataList.push({
+          customerId: '',
+          id: '',
+          minBuyNum: null,
+          maxBuyNum: null,
+          groupLimitNum: null,
+          policyId: this.policyId,
+          customerName: '',
+          customerNumber: '',
+          examineOrderNums: null,
+          orderNums: null,
+          policyType: '',
+          specification: ''
+        })
+      }
     }
   },
+  created() {
+    this.getCustomerList()
+    this.getMaterialList()
+  },
   methods: {
     remoteMethod(query, name) {
       const params = []
@@ -371,24 +460,41 @@ export default {
         })
       }
     },
-    handleAddItmeData() {
-
+    getCustomerList() {
+      getCustomerList({
+        pageNum: 1,
+        pageSize: -1,
+        policyId: this.policyId
+      }).then(res => {
+        this.dealerList = res.data.records
+        this.loading = false
+      })
+    },
+    getMaterialList() {
+      getMaterialList({
+        pageNum: 1,
+        pageSize: -1,
+        policyId: this.policyId
+      }).then(res => {
+        this.k3List = res.data.records
+        this.loading = false
+      })
     },
     handleChange(e, row) {
       const item = this.dealerList.find(k => k.id === e)
-      this.$set(row, 'customerId', item.id)
-      this.$set(row, 'customerName', item.name)
-      this.$set(row, 'customerNumber', item.number)
+      this.$set(row, 'customerId', item.customerId)
+      this.$set(row, 'customerName', item.customerName)
+      this.$set(row, 'customerNumber', item.customerNumber)
     },
     handleChange2(e, row) {
       const item = this.k3List.find(k => k.id === e)
-      this.$set(row, 'materialId', item.id)
-      this.$set(row, 'materialName', item.name)
-      this.$set(row, 'materialNumber', item.number)
+      this.$set(row, 'materialId', item.materialId)
+      this.$set(row, 'materialName', item.materialName)
+      this.$set(row, 'materialNumber', item.materialNumber)
       this.$set(row, 'specification', item.specification)
     },
     onSbumit() {
-      this.$emit('sbumit', { dataList: this.dataList, type: this.linitType })
+      this.$emit('sbumit', { dataList: this.dataList, type: this.linitType, operationType: this.operationType })
     },
     onCancel() {
       this.$emit('cancel')

+ 4 - 60
src/views/sales_policy/components/TabelTransfer.vue

@@ -149,16 +149,7 @@
             <el-button type="primary" size="mini">导入经销商</el-button>
           </el-upload>
           <el-button type="primary" size="mini" @click="hanleDownloadFilesPolicy">下载模板</el-button>
-          <el-button
-            type="primary"
-            size="mini"
-            @click="
-              linitVisible = true,
-              linitType = 'add',
-              recordSelected = [],
-              $refs.multipleTable.clearSelection();
-            "
-          >添加</el-button>
+
         </div>
         <el-row style="margin: 20px 0">
           <el-col :span="12">
@@ -176,7 +167,6 @@
       <div>
         <div class="table">
           <el-table
-            ref="multipleTable"
             v-loading="clistLoading"
             :data="list"
             element-loading-text="Loading"
@@ -184,7 +174,6 @@
             fit
             highlight-current-row
             stripe
-            @selection-change="hanldeSelectionChange"
           >
             <el-table-column
               type="selection"
@@ -239,30 +228,7 @@
                 {{ scope.row.limitQty }}
               </template>
             </el-table-column>
-            <el-table-column
-              fixed="right"
-              label="操作"
-              width="120"
-            >
-              <template slot-scope="scope">
-                <el-button
-                  type="text"
-                  size="mini"
-                  @click="
-                    linitVisible = true,
-                    linitType = 'edit',
-                    recordSelected = [scope.row]
-                  "
-                >编辑</el-button>
-                <el-popconfirm
-                  style="margin-left: 10px;"
-                  title="是否确定需要克隆该项内容?"
-                  @onConfirm="handleDelLinit(scope.row.id)"
-                >
-                  <el-button slot="reference" type="text" size="mini">删除</el-button>
-                </el-popconfirm>
-              </template>
-            </el-table-column>
+
           </el-table>
         </div>
         <!-- 分页 -->
@@ -300,7 +266,6 @@
             :ex-params="{ policyId: comCode || code }"
           />
           <el-button type="primary" size="mini" @click="hanleDownloadFilesPolicyLimitGroupPolicy">下载模板</el-button>
-          <el-button type="primary" size="mini">添加</el-button>
         </div>
         <el-row style="margin: 20px 0">
           <el-col :span="12">
@@ -391,7 +356,6 @@
         <el-button type="primary" size="mini" @click="handleReset">重置</el-button>
       </el-row>
     </slot>
-    <LinitVisible v-if="linitVisible" :policy-id="comCode || code" :linit-visible="linitVisible" :data-list="recordSelected" :linit-type="linitType" @cancel="linitVisible=false" @sbumit="handleLinitSave" />
   </div>
 </template>
 
@@ -405,12 +369,10 @@ import {
   getPolicyList,
   updateLimitGrouppdate,
   updateLimitBatchupdate,
-  getPolicyLimitGroupList,
-  delLimit,
-  saveLimit
+  getPolicyLimitGroupList
+
 } from '@/api/policy_list'
 import { downloadFiles, handleImport } from '@/utils/util'
-import LinitVisible from './LinitVisible.vue'
 import ImageUpload from '@/components/Common/image-upload.vue'
 import Minxin from '@/mixin'
 
@@ -419,7 +381,6 @@ export default {
   components: {
     // eslint-disable-next-line vue/no-unused-components
     ImageUpload,
-    LinitVisible
   },
   mixins: [Minxin],
   // eslint-disable-next-line vue/require-prop-types
@@ -1117,23 +1078,6 @@ export default {
       this.limitCurrentPages = 1
       this.limitTotal = 0
       this.limitPageSizes = 10
-    },
-    hanldeSelectionChange(data) {
-      this.recordSelected = JSON.parse(JSON.stringify(data))
-    },
-    handleDelLinit(id) {
-      delLimit({ id }).then(res => {
-        this.$successMsg('删除成功')
-        this.resetScreenForm2()
-      })
-    },
-    handleLinitSave({ dataList, type }) {
-      this.linitType = false
-      saveLimit(dataList[0]).then(res => {
-        this.$successMsg(type === 'add' ? '新增成功' : '修改成功')
-        this.linitVisible = false
-        this.resetScreenForm2()
-      })
     }
   }
 }

+ 153 - 27
src/views/sales_policy/components/details.vue

@@ -506,17 +506,29 @@
                   }"
                 >批量修改</el-button> -->
                 <template v-if="detail.type !== 'LIMIT'">
-
                   <el-button
                     v-if="list.length"
                     type="primary"
                     size="mini"
-                    @click="()=>{
-                      visible = true
-                      handelBatchData()
-                    }"
+                    @click="
+                      () => {
+                        visible = true
+                        handelBatchData()
+                      }
+                    "
                   >批量修改上限</el-button>
                 </template>
+                <el-button
+                  v-if="detail.flag == 0"
+                  type="primary"
+                  size="mini"
+                  @click="
+                    operationType = null
+                    linitVisible = true
+                    linitType = 'add'
+                    recordSelected = []
+                  "
+                >添加</el-button>
                 <el-divider />
               </div>
               <div>
@@ -529,8 +541,7 @@
                     fit
                     highlight-current-row
                     stripe
-                    @select-all="handleSelectionAllChange2"
-                    @selection-change="handleSelectionChange2"
+                    @selection-change="hanldeSelectionChange"
                   >
                     <el-table-column type="index" width="50" />
                     <el-table-column
@@ -561,7 +572,7 @@
                         {{ scope.row.materialNumber }}
                       </template>
                     </el-table-column>
-                    <el-table-column prop="specification" label="物料编号" align="left" min-width="200">
+                    <el-table-column prop="specification" label="规格型号" align="left" min-width="200">
                       <template slot-scope="scope">
                         {{ scope.row.specification }}
                       </template>
@@ -581,6 +592,22 @@
                         {{ scope.row.examineOrderNums }}
                       </template>
                     </el-table-column>
+                    <el-table-column fixed="right" label="操作" width="120">
+                      <template slot-scope="scope">
+                        <el-button
+                          type="text"
+                          size="mini"
+                          @click="operationType = null , (linitVisible = true), (linitType = 'edit'), (recordSelected = [scope.row])"
+                        >编辑</el-button>
+                        <el-popconfirm
+                          style="margin-left: 10px"
+                          title="是否确定需要克隆该项内容?"
+                          @onConfirm="handleDelLinit(scope.row.id)"
+                        >
+                          <el-button slot="reference" type="text" size="mini">删除</el-button>
+                        </el-popconfirm>
+                      </template>
+                    </el-table-column>
                   </el-table>
                 </div>
                 <!-- 分页 -->
@@ -600,7 +627,7 @@
 
             <div>
               <div>
-                <h4 style="display: inline-block; margin-right: 20px"> 经销商提货上限</h4>
+                <h4 style="display: inline-block; margin-right: 20px">经销商提货上限</h4>
                 <el-divider />
               </div>
               <div style="margin: 20px 0">
@@ -624,10 +651,12 @@
                     v-if="policyLimitGroupList.length"
                     type="primary"
                     size="mini"
-                    @click="()=>{
-                      limitGroupvisible = true
-                      handelLimitGroupData()
-                    }"
+                    @click="
+                      () => {
+                        limitGroupvisible = true
+                        handelLimitGroupData()
+                      }
+                    "
                   >批量修改配提套数上限</el-button>
                 </template>
                 <template v-else>
@@ -635,12 +664,25 @@
                     v-if="policyLimitGroupList.length"
                     type="primary"
                     size="mini"
-                    @click="()=>{
-                      buyNumvisible = true
-                      handelLimitGroupData()
-                    }"
+                    @click="
+                      () => {
+                        buyNumvisible = true
+                        handelLimitGroupData()
+                      }
+                    "
                   >批量修改上限</el-button>
                 </template>
+                <el-button
+                  v-if="detail.flag == 0"
+                  type="primary"
+                  size="mini"
+                  @click="
+                    operationType = 'group'
+                    linitVisible = true
+                    linitType = 'add'
+                    recordSelected = []
+                  "
+                >添加</el-button>
                 <!-- <el-button type="primary" size="mini" @click="hanleDownloadFilesPolicyLimitGroupPolicy"
                   >下载模板</el-button
                 > -->
@@ -703,16 +745,32 @@
                         </template>
                       </el-table-column>
                     </template>
-                    <!-- <el-table-column prop="orderNums" label="配提上限已下订单数" align="left" width="200">
+                    <el-table-column prop="orderNums" label="已下订单数" align="left" min-width="200">
                       <template slot-scope="scope">
                         {{ scope.row.orderNums }}
                       </template>
                     </el-table-column>
-                    <el-table-column prop="examineOrderNums" label="配提上限已审订单数" align="left" width="200">
+                    <el-table-column prop="examineOrderNums" label="已审订单数" align="left" min-width="200">
                       <template slot-scope="scope">
                         {{ scope.row.examineOrderNums }}
                       </template>
-                    </el-table-column> -->
+                    </el-table-column>
+                    <el-table-column fixed="right" label="操作" width="120">
+                      <template slot-scope="scope">
+                        <el-button
+                          type="text"
+                          size="mini"
+                          @click="operationType = 'group' , (linitVisible = true), (linitType = 'edit'), (recordSelected = [scope.row])"
+                        >编辑</el-button>
+                        <el-popconfirm
+                          style="margin-left: 10px"
+                          title="是否确定需要克隆该项内容?"
+                          @onConfirm="handleDelLimitGroup(scope.row.id)"
+                        >
+                          <el-button slot="reference" type="text" size="mini">删除</el-button>
+                        </el-popconfirm>
+                      </template>
+                    </el-table-column>
                   </el-table>
                 </div>
                 <!-- 分页 -->
@@ -777,7 +835,12 @@
           <el-col :span="24" :offset="0" style="margin-bottom: 20px">
             <div style="display: flex">
               <el-input v-model="limitQtyKeyWord" placeholder="输入关键字搜索" size="mini" />
-              <el-button style="margin-left: 20px" type="primary" size="mini" @click="handelBatchData('search')">查询</el-button>
+              <el-button
+                style="margin-left: 20px"
+                type="primary"
+                size="mini"
+                @click="handelBatchData('search')"
+              >查询</el-button>
               <el-button size="mini" @click="onReset">重置</el-button>
             </div>
           </el-col>
@@ -803,7 +866,7 @@
         </div>
         <span slot="footer">
           <el-button @click="handleDialogVisible">取消</el-button>
-          <el-button type="primary" @click="onSubmit($event,'limit')">确定</el-button>
+          <el-button type="primary" @click="onSubmit($event, 'limit')">确定</el-button>
         </span>
       </el-dialog>
       <el-dialog
@@ -817,12 +880,22 @@
         <el-row :gutter="20">
           <el-col :span="24" style="display: flex; align-items: center; margin-bottom: 20px">
             <el-col :span="4" :offset="0"> 配提套数上限 </el-col>
-            <el-col :span="8" :offset="0"> <el-input v-model.number="limitGroupNum" type="number" size="mini" /></el-col>
+            <el-col :span="8" :offset="0">
+              <el-input
+                v-model.number="limitGroupNum"
+                type="number"
+                size="mini"
+              /></el-col>
           </el-col>
           <el-col :span="24" :offset="0" style="margin-bottom: 20px">
             <div style="display: flex">
               <el-input v-model="limitGroupKeyWord" placeholder="输入关键字搜索" size="mini" />
-              <el-button style="margin-left: 20px" type="primary" size="mini" @click="handelLimitGroupData('search')">查询</el-button>
+              <el-button
+                style="margin-left: 20px"
+                type="primary"
+                size="mini"
+                @click="handelLimitGroupData('search')"
+              >查询</el-button>
               <el-button size="mini" @click="onLimitReset">重置</el-button>
             </div>
           </el-col>
@@ -911,6 +984,17 @@
       @close="handleConditionClose"
       @back="handleBack"
     />
+    <LinitVisible
+      v-if="linitVisible"
+      :policy-id="id || detail.code"
+      :linit-visible="linitVisible"
+      :data-list="recordSelected"
+      :linit-type="linitType"
+      :detail-type="detail.type"
+      :operation-type="operationType"
+      @cancel="linitVisible = false"
+      @sbumit="handleLinitSave"
+    />
   </div>
 </template>
 
@@ -928,12 +1012,17 @@ import {
   getPolicyList,
   updateLimitBatchupdate,
   getPolicyLimitGroupList,
-  updateLimitGrouppdate
+  updateLimitGrouppdate,
+  delLimit,
+  saveLimit,
+  delLimitGroup,
+  saveLimitGroup
 } from '@/api/policy_list'
 import { downloadFiles, handleImport } from '@/utils/util'
 import AddCondition from './AddCondition'
 import ImageUpload from '@/components/Common/image-upload.vue'
 import OperationRecords from './OperationRecords.vue'
+import LinitVisible from './LinitVisible.vue'
 
 import Minxin from '@/mixin'
 
@@ -942,7 +1031,8 @@ export default {
   components: {
     AddCondition,
     ImageUpload,
-    OperationRecords
+    OperationRecords,
+    LinitVisible
   },
   mixins: [Minxin],
   props: ['id', 'isShow'],
@@ -1046,7 +1136,11 @@ export default {
       limitPageSizes: 10,
       limitTableData: [],
       buyNumvisible: false,
-      minBuyNum: null
+      minBuyNum: null,
+      linitVisible: false,
+      linitType: null,
+      recordSelected: [],
+      operationType: null
     }
   },
   computed: {
@@ -1681,6 +1775,38 @@ export default {
       this.minBuyNum = null
       this.limitQtyKeyWord = ''
       this.maxBuyNumKeyWord = ''
+    },
+    hanldeSelectionChange(data) {
+      this.recordSelected = JSON.parse(JSON.stringify(data))
+    },
+    handleDelLinit(id) {
+      delLimit({ id }).then(res => {
+        this.$successMsg('删除成功')
+        this.getPolicyList()
+      })
+    },
+    handleDelLimitGroup(id) {
+      delLimitGroup({ id }).then(res => {
+        this.$successMsg('删除成功')
+        this.getPolicyLimitGroupList()
+      })
+    },
+    handleLinitSave({ dataList, type, operationType }) {
+      if (!operationType) {
+        saveLimit(dataList[0]).then(res => {
+          this.$successMsg(type === 'add' ? '新增成功' : '修改成功')
+          this.getPolicyList()
+          this.linitVisible = false
+        })
+      } else {
+        saveLimitGroup(dataList[0]).then(res => {
+          this.$successMsg(type === 'add' ? '新增成功' : '修改成功')
+          this.getPolicyLimitGroupList()
+          this.linitVisible = false
+        })
+      }
+      this.linitType = 'add'
+      this.operationType = null
     }
   }
 }