Sfoglia il codice sorgente

Merge branch 'dev_v2' of https://gogs.zfire.top/zfire-front/supply-front into dev_v2

zh 2 anni fa
parent
commit
a6cfd1efc6
30 ha cambiato i file con 2214 aggiunte e 1850 eliminazioni
  1. 3 3
      package-lock.json
  2. 1 1
      package.json
  3. 65 0
      src/api/dataDictionary2.js
  4. 75 2
      src/api/policy_list.js
  5. 20 1
      src/api/supply/engin.js
  6. 32 9
      src/components/template/template-page-1.vue
  7. 55 0
      src/views/basic_data/wallet/wallet_list.vue
  8. 87 113
      src/views/sales_policy/codealer_list.vue
  9. 10 10
      src/views/sales_policy/components/AddCondition.vue
  10. 57 56
      src/views/sales_policy/components/AddPolicy.vue
  11. 2 2
      src/views/sales_policy/components/Distributor.vue
  12. 2 1
      src/views/sales_policy/components/EditCondition.vue
  13. 85 75
      src/views/sales_policy/components/Examine.vue
  14. 77 70
      src/views/sales_policy/components/editPolicy.vue
  15. 211 379
      src/views/sales_policy/policy_list.vue
  16. 119 177
      src/views/sales_rebate/rebate_list.vue
  17. 112 145
      src/views/sales_rebate/rebate_list_type.vue
  18. 139 156
      src/views/sales_rebate/salestype_list.vue
  19. 205 0
      src/views/setting/components/addDataDictionary.vue
  20. 138 0
      src/views/setting/dataDictionary.vue
  21. 93 14
      src/views/supply/deliver/sum_list.vue
  22. 4 6
      src/views/supply/engin/components/engin_detail.vue
  23. 1 1
      src/views/supply/engin/components/engin_examine.vue
  24. 2 2
      src/views/supply/engin/components/engin_form.vue
  25. 278 561
      src/views/supply/engin/engin_list.vue
  26. 89 1
      src/views/supply/engin/home_list.vue
  27. 64 27
      src/views/supply/implement/implement_list.vue
  28. 65 28
      src/views/supply/implement/implement_total_list.vue
  29. 58 7
      src/views/supply/implement/nsales_list.vue
  30. 65 3
      src/views/supply/policy/policy_list.vue

+ 3 - 3
package-lock.json

@@ -4267,9 +4267,9 @@
       "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ=="
     },
     "@zjlib/element-plugins": {
-      "version": "2.1.10",
-      "resolved": "http://121.41.110.30:4873/@zjlib%2felement-plugins/-/element-plugins-2.1.10.tgz",
-      "integrity": "sha512-2QPgAUUDifjEGY/hEhwDEMr6nNo/eOA9SFiM/zvKBJ4JWRpfKxtzE0/7AaNXLiWpovCq/XmtFgfksQ3rg1FrtA==",
+      "version": "2.1.12",
+      "resolved": "http://121.41.110.30:4873/@zjlib%2felement-plugins/-/element-plugins-2.1.12.tgz",
+      "integrity": "sha512-5rAfcIlAJZsHtl8kog0iln97YAZJLwzD/3iSUT8llIBrsxtjLofl1Xs48405caoilJy4WMpiCX3W22lxkEuoiw==",
       "requires": {
         "@turf/turf": "^6.5.0",
         "@vuemap/vue-amap": "^0.1.12",

+ 1 - 1
package.json

@@ -15,7 +15,7 @@
     "test:ci": "npm run lint && npm run test:unit"
   },
   "dependencies": {
-    "@zjlib/element-plugins": "^2.1.10",
+    "@zjlib/element-plugins": "^2.1.12",
     "axios": "0.18.1",
     "clipboard": "^2.0.8",
     "concurrent-tasks": "^1.0.7",

+ 65 - 0
src/api/dataDictionary2.js

@@ -0,0 +1,65 @@
+import request, { postBlob } from '@/utils/request'
+
+export function getDataDictionary(data) {
+  return request({
+    url: `/dict/page?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function getDataDictionaryExport(data, name) {
+  return postBlob({
+    url: '/dict/page/export',
+    data,
+    name
+  })
+}
+
+export function addDataDictionary(data) {
+  return request({
+    url: `/dict/add`,
+    method: 'post',
+    data
+  })
+}
+
+export function updateDataDictionary(data) {
+  return request({
+    url: `/dict/update`,
+    method: 'post',
+    data
+  })
+}
+
+export function delDataDictionary(params) {
+  return request({
+    url: `/dict/del`,
+    method: 'post',
+    params
+  })
+}
+
+export function dictDetail(params) {
+  return request({
+    url: `/dict/detail`,
+    method: 'post',
+    params
+  })
+}
+
+export function dictListDict(params) {
+  return request({
+    url: `/dict/listDict`,
+    method: 'post',
+    params
+  })
+}
+
+export function dictTypeList(data) {
+  return request({
+    url: `/dict/type/list`,
+    method: 'post',
+    data
+  })
+}

+ 75 - 2
src/api/policy_list.js

@@ -1,4 +1,23 @@
-import request from '@/utils/request'
+import request, { postBlob, handleImport, getBlob } from '@/utils/request'
+
+// 政策-列表V2
+export function policyListV2(data) {
+  return request({
+    url: `/policy/list/v2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+//政策列表V2-导出
+export function policyListV2Export(data, name) {
+  return postBlob({
+    url: '/policy/list/v2/export',
+    method: 'post',
+    data,
+    name
+  })
+}
 
 // 销售政策
 export function getList(params) {
@@ -199,8 +218,16 @@ export function getPolicyDetail(params) {
   })
 }
 
-// 对应经销商
+// 政策-列表V2
+export function policyCustomerCountListV2(data) {
+  return request({
+    url: `/policy/customer_count/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
 
+// 对应经销商
 export function getCustomerlist(params) {
   return request({
     url: '/policy/customer_count/list',
@@ -219,6 +246,24 @@ export function eidtBatch(params) {
 
 // 销售类型
 
+// 销售类型列表V2
+export function saleTypeRebateListV2(data) {
+  return request({
+    url: `/sale/type/rebate/list/v2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+//销售类型列表V2-导出
+export function saleTypeRebateListV2Export(data, name) {
+  return postBlob({
+    url: '/sale/type/list/v2/export',
+    method: 'post',
+    data,
+    name
+  })
+}
+
 export function getTypeList(params) {
   return request({
     url: '/sale/type/list',
@@ -268,7 +313,15 @@ export function updateType(params) {
 }
 
 // 返利钱包列表
+export function walletRebateListV2(data) {
+  return request({
+    url: `/wallet/rebate/list/v2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
 
+// 返利钱包列表
 export function getWalletList(params) {
   return request({
     url: '/wallet/rebate/list',
@@ -390,6 +443,26 @@ export function getCompanyList(params) {
     params
   })
 }
+
+// 返利钱包销售类型V2
+export function walletRebateSaletypeListV2(data) {
+  return request({
+    url: `/wallet/rebate_saletype/list/v2?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+//返利钱包销售类型V2-导出
+export function walletRebateSaletypeListV2Export(data, name) {
+  return postBlob({
+    url: '/wallet/rebate_saletype/list/v2/export',
+    method: 'post',
+    data,
+    name
+  })
+}
+
 // 返利钱包销售类型-列表
 export function getWalletRebateSaletypelist(params) {
   return request({

+ 20 - 1
src/api/supply/engin.js

@@ -1,4 +1,4 @@
-import request from '@/utils/request'
+import request, { postBlob, handleImport, getBlob } from '@/utils/request'
 
 // 获取列表
 export function getList(params) {
@@ -46,6 +46,25 @@ export function getPositionList(params) {
 }
 
 // 工程信息单 - 获取列表
+export function v2EnginInfoOrderList(data) {
+  return request({
+    url: `/v2/engin-info-order/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+//工程信息单-导出
+export function v2EnginInfoOrderListExport(data, name) {
+  return postBlob({
+    url: '/v2/engin-info-order/list/export',
+    method: 'post',
+    data,
+    name
+  })
+}
+
+// 工程信息单 - 获取列表
 export function getEnginList(params) {
   return request({
     url: '/engin-info-order/list',

+ 32 - 9
src/components/template/template-page-1.vue

@@ -10,8 +10,8 @@
       :columnParsing="columnParsing"
       :reduction="reduction"
       :plan="[...defaultPlan, ...morePlan]"
-      :operation="caozuojl"
-      :operationColumnWidth="operationColumnWidth + 50"
+      :operation="operationShow ? caozuojl : operation"
+      :operationColumnWidth="(operation ? operationColumnWidth : 0) + (operationShow ? 70 : 0)"
       :showTable="showTable"
       :codeGather="codeGather"
       :loading="loading"
@@ -69,28 +69,44 @@ export default {
     exportList: {
       type: Function
     },
+    // 更多方案
     morePlan: {
       type: Array,
       default: () => []
     },
+    // 操作按钮
     operation: {
       type: Function
     },
+    // 是否显示操作记录
+    operationShow: {
+      type: Boolean,
+      default: true
+    },
+    // 获取操作记录的主键字段
     operationRecordkey: {
       type: String,
-      default: 'id'
-    },
-    cstomClumn: {
-      type: Function
+      default: ''
     },
+    // 操作按钮单元格宽度
     operationColumnWidth: {
       type: Number,
       default: 140
     },
+    // 自定义列
+    cstomClumn: {
+      type: Function
+    },
+    // 结构数据钩子
+    fieldBeansHook: {
+      type: Function
+    },
+    // 菜单名称
     customModuleName: {
       type: String,
       default: ''
     },
+    // 默认方案
     defaultPlan: {
       type: Array,
       default: () => [
@@ -123,7 +139,8 @@ export default {
       columnList: [],
       showTable: false,
       codeGather: {},
-      frontCodes: []
+      frontCodes: [],
+      pk: ''
     }
   },
   computed: {
@@ -152,12 +169,12 @@ export default {
             size="mini"
             type="text"
             onClick={() => {
-              console.log(row[this.operationRecordkey])
+              console.log(row[this.operationRecordkey || this.pk || 'id'])
             }}
           >
             操作记录
           </el-button>
-          {this.operation(h, { row, index, column })}
+          {this.operation ? this.operation(h, { row, index, column }) : null}
         </div>
       )
     },
@@ -216,7 +233,13 @@ export default {
               this.showTable = true
             })
           }
+          if (this.fieldBeansHook) {
+            res.fieldBeans = this.fieldBeansHook(res.fieldBeans) || res.fieldBeans
+          }
           for (var item of res.fieldBeans) {
+            if (item.pk) {
+              this.pk = item.colName
+            }
             if (item.frontCode && !~this.frontCodes.indexOf(item.frontCode)) {
               this.frontCodes.push(item.frontCode)
             }

+ 55 - 0
src/views/basic_data/wallet/wallet_list.vue

@@ -136,13 +136,44 @@
       </div>
     </el-dialog>
   </div>
+  <!-- <template-page
+    ref="pageRef"
+    :getList="getList"
+    :operation="operation()"
+    :optionsEvensGroup="optionsEvensGroup"
+    :exportList="exportList"
+    :columnParsing="columnParsing"
+    :tableAttributes="tableAttributes"
+    :tableEvents="tableEvents"
+  >
+    
+  </template-page> -->
 </template>
 
 <script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+
 import { getWalletList, getProductCategory, getWalletBiandMain, getWalletDetail } from '@/api/basic_data/wallet_list'
 export default {
+  components: {
+    TemplatePage
+  },
   data() {
     return {
+      // 事件组合
+      optionsEvensGroup: [],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+
+      //
       listLoading: false, // 列表加载loading
       searchForm: {
         walletName: '',
@@ -169,6 +200,30 @@ export default {
     // this.getCategoryList();
   },
   methods: {
+    // 列表请求函数
+    // getList: levelList,
+    // 列表导出函数
+    // exportList: exportLevelList,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class="operation-btns">
+            <el-button size="mini" type="text" onClick={async () => {}}>
+              详情
+            </el-button>
+          </div>
+        )
+      }
+    },
+
     //确定
     async btnOK() {
       console.log(this.addForm)

+ 87 - 113
src/views/sales_policy/codealer_list.vue

@@ -1,111 +1,52 @@
 <template>
-  <div class="app-container" v-if="isShow">
-    <div class="screen-container">
-      <Collapse :screen-form="screenForm">
-        <template #right_btn>
-          <el-button size="mini" @click="resetScreenForm">清空</el-button>
-          <el-button type="primary" size="mini" @click="submitScreenForm">搜索</el-button>
-        </template>
-        <template #search>
-          <el-form
-            size="mini"
-            :model="screenForm"
-            ref="screenForm"
-            :inline="false"
-            label-position="left"
-            label-width="120px"
-          >
-            <el-row :gutter="20">
-              <el-col :xs="24" :sm="8" :lg="8">
-                <el-form-item prop="code" label="销售政策编号">
-                  <el-input size="mini" v-model="screenForm.code" placeholder="销售政策编号"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="8" :lg="8">
-                <el-form-item prop="remark" label="销售政策说明">
-                  <el-input size="mini" v-model="screenForm.remark" placeholder="销售政策说明"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="8" :lg="8">
-                <el-form-item prop="title" label="表头备注">
-                  <el-input size="mini" v-model="screenForm.title" placeholder="表头备注"></el-input>
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </el-form>
-        </template>
-      </Collapse>
-    </div>
-    <!--    <div class="btn-group">-->
-    <!--      <el-row type="flex">-->
-    <!--        <el-button type="primary" size="mini" @click="">导出</el-button>-->
-    <!--      </el-row>-->
-    <!--    </div>-->
-    <div class="mymain-container">
-      <div class="table">
-        <el-table :data="dataList" border>
-          <el-table-column prop="name" label="操作" width="120" align="center" class="table">
-            <template slot-scope="scope">
-              <el-button type="text" size="mini" @click=";(id = scope.row.id), (isShow = false)">详情</el-button>
-            </template>
-          </el-table-column>
-          <el-table-column prop="status" label="状态" width="120" align="left">
-            <template slot-scope="scope">
-              <el-tag type="success" size="mini" v-if="scope.row.status == 1">已生效</el-tag>
-              <el-tag type="danger" size="mini" v-else>未生效</el-tag>
-            </template>
-          </el-table-column>
-          <el-table-column show-overflow-tooltip min-width="200" prop="code" label="销售政策编号" align="left">
-          </el-table-column>
-          <el-table-column show-overflow-tooltip min-width="150" prop="title" label="销售政策说明" align="left">
-          </el-table-column>
-          <el-table-column show-overflow-tooltip min-width="150" prop="title" label="表头备注" align="left">
-          </el-table-column>
-          <el-table-column
-            show-overflow-tooltip
-            min-width="150"
-            prop="customerCount"
-            label="关联经销商"
-            width="150"
-            align="left"
-          >
-          </el-table-column>
-          <el-table-column show-overflow-tooltip min-width="200" prop="startTime" label="生效日期" align="left">
-          </el-table-column>
-          <el-table-column show-overflow-tooltip min-width="200" prop="endTime" label="结束日期" align="left">
-          </el-table-column>
-          <el-table-column show-overflow-tooltip min-width="200" prop="createBy" label="制表人" align="left">
-          </el-table-column>
-          <el-table-column show-overflow-tooltip min-width="200" prop="createTime" label="制表日期" align="left">
-          </el-table-column>
-        </el-table>
-      </div>
-      <!-- 分页 -->
-      <div class="fr">
-        <el-pagination
-          :current-page="currentPage"
-          :page-sizes="[10, 20, 30, 50, 500]"
-          :page-size="10"
-          layout="total, sizes, prev, pager, next, jumper"
-          :total="listTotal"
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
-        />
-      </div>
-    </div>
-  </div>
-  <Distributor v-else :cid="id" />
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :operation="operation()"
+    :optionsEvensGroup="optionsEvensGroup"
+    :columnParsing="columnParsing"
+    :tableAttributes="tableAttributes"
+    :tableEvents="tableEvents"
+  >
+    <Popu v-if="!isShow">
+      <el-page-header slot="head" :content="content" @back="handleClose" />
+      <Distributor :cid="id" />
+    </Popu>
+  </template-page>
 </template>
 
 <script>
-import { getCustomerlist } from '@/api/policy_list'
-import Minxin from '@/mixin'
+import TemplatePage from '@/components/template/template-page-1.vue'
+import Popu from '@/components/template/popu.vue'
+
+import { getCustomerlist, policyCustomerCountListV2 } from '@/api/policy_list'
+// import Minxin from '@/mixin'
 import Distributor from './components/Distributor'
 
 export default {
-  mixins: [Minxin],
+  mixins: [],
   data() {
     return {
+      content: '详情',
+      // 关闭新增弹窗
+      handleClose: () => {
+        this.isShow = true
+        this.$refs.pageRef.refreshList()
+      },
+      // 事件组合
+      optionsEvensGroup: [],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: false
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+
+      //
       isCollapse: true,
       isShow: true,
       id: '',
@@ -119,24 +60,57 @@ export default {
     }
   },
   methods: {
-    getList() {
-      this.listLoading = true
-      const params = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
-        code: this.screenForm.code,
-        remark: this.screenForm.remark,
-        title: this.screenForm.title
+    // 列表请求函数
+    getList: policyCustomerCountListV2,
+    // 列表导出函数
+    // exportList: exportLevelList,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class="operation-btns">
+            <el-button
+              size="mini"
+              type="text"
+              onClick={async () => {
+                this.id = row.id
+                this.isShow = false
+              }}
+            >
+              详情
+            </el-button>
+          </div>
+        )
       }
-      getCustomerlist(params).then(res => {
-        console.log(res)
-        this.dataList = res.data.records
-        this.listTotal = res.data.total
-        this.listLoading = false
-      })
     }
+
+    // getList() {
+    //   this.listLoading = true
+    //   const params = {
+    //     pageNum: this.currentPage,
+    //     pageSize: this.pageSize,
+    //     code: this.screenForm.code,
+    //     remark: this.screenForm.remark,
+    //     title: this.screenForm.title
+    //   }
+    //   getCustomerlist(params).then(res => {
+    //     console.log(res)
+    //     this.dataList = res.data.records
+    //     this.listTotal = res.data.total
+    //     this.listLoading = false
+    //   })
+    // }
   },
   components: {
+    TemplatePage,
+    Popu,
     Distributor
   }
 }

+ 10 - 10
src/views/sales_policy/components/AddCondition.vue

@@ -436,12 +436,12 @@ export default {
   methods: {
     getList() {},
     handleBack() {
-      if (this.$parent.isShow == 10) {
-        this.$parent.isShow = 8
-      } else if (this.$parent.isShow == 12) {
-        this.$parent.isShow = 4
+      if (this.$parent.$parent.$parent.isShow == 10) {
+        this.$parent.$parent.$parent.isShow = 8
+      } else if (this.$parent.$parent.$parent.isShow == 12) {
+        this.$parent.$parent.$parent.isShow = 4
       } else {
-        this.$parent.isCondition = 0
+        this.$parent.$parent.$parent.isCondition = 0
         Object.assign(this.$data, this.$options.data())
       }
     },
@@ -523,7 +523,7 @@ export default {
       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.$parent.searchForm.code || this.comCode
+          this.conditionBox[i][j].policyId = this.$parent.$parent.$parent.searchForm.code || this.comCode
           this.conditionBox[i][j].id = ''
           //  this.conditionBox[i][j].policyMaterialId =this.conditionBox[i][j].materialId
         }
@@ -542,7 +542,7 @@ export default {
       const params = {
         id: '',
         policyConditionMaterials: tableData,
-        policyId: this.$parent.searchForm.code || this.comCode,
+        policyId: this.$parent.$parent.$parent.searchForm.code || this.comCode,
         policyName: '',
         pop: pop.join(':')
       }
@@ -554,8 +554,8 @@ export default {
         this.limit = ''
         this.pop = ''
         this.popArr = {}
-        this.$parent.isCondition = 0
-        this.$parent.isFlag = 1
+        this.$parent.$parent.$parent.isCondition = 0
+        this.$parent.$parent.$parent.isFlag = 1
         // Object.assign(this.$data, this.$options.data());
         this.$emit('handleSubmitCon', this.$parent.searchForm.code || this.comCode)
       })
@@ -607,7 +607,7 @@ export default {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
         saleTypeCode: this.saleTypeCode,
-        policyId: this.$parent.searchForm.code || this.comCode
+        policyId: this.$parent.$parent.$parent.searchForm.code || this.comCode
       }).then(res => {
         let datas = []
 

+ 57 - 56
src/views/sales_policy/components/AddPolicy.vue

@@ -1,9 +1,9 @@
 <template>
   <div class="app-container">
     <div v-show="isCondition == 0">
-      <el-header height="50px" class="header">
+      <!-- <el-header height="50px" class="header">
         <el-page-header content="新增" @back=";($parent.isShow = 1), ($parent.isFlag = '')" />
-      </el-header>
+      </el-header> -->
       <div>
         <div class="screen-container">
           <h4>销售政策信息</h4>
@@ -84,7 +84,7 @@
               </el-col>
               <el-col :xs="24" :ms="24" :lg="24">
                 <el-form-item label="政策封面图">
-                  <ImageUpload :file-list="fileList" multiple :limit="3"/>
+                  <ImageUpload :file-list="fileList" multiple :limit="3" />
                 </el-form-item>
               </el-col>
             </el-row>
@@ -386,7 +386,7 @@
           <div style="margin: 20px 20px 20px 0; display: flex; justify-content: space-between">
             <div>
               <el-button type="primary" size="mini" @click="handleNewInfo">添加</el-button>
-              <el-button type="primary" size="mini" @click="handleSave"  v-loading="fullscreenLoading">保存</el-button>
+              <el-button type="primary" size="mini" @click="handleSave" v-loading="fullscreenLoading">保存</el-button>
             </div>
             <!--            <el-pagination-->
             <!--              :current-page="dcurrentPage"-->
@@ -560,7 +560,7 @@ export default {
       dpageSize: 10,
       dcurrentPage: 1,
       rebateList: [],
-      fullscreenLoading:false
+      fullscreenLoading: false
     }
   },
   computed: {
@@ -631,13 +631,13 @@ export default {
         this.k3List = [...this.k3List, ...res.data.records]
       })
     },
-    async remoteMethodType(query, type){
+    async remoteMethodType(query, type) {
       console.log(111)
       // 获取销售类型列表
       const params = {
         pageNum: 1,
-        pageSize:-1,
-        saleCode:query,
+        pageSize: -1,
+        saleCode: query,
         saleName: '',
         status: ''
       }
@@ -856,26 +856,26 @@ export default {
         return
       }
 
-      const fomrtData = (type) => {
+      const fomrtData = type => {
         var arr = []
         if (type != 'assign') {
           policyCustomers.forEach(el => {
-          arr.push({
-            customerId: el.id,
-            customerName: el.name,
-            customerNumber: el.number,
-            lastOrderTime: '',
-            limitTakeNum: 0,
-            policyId: this.searchForm.code || this.comCode,
-            policyTitle: '',
-            remark: ''
+            arr.push({
+              customerId: el.id,
+              customerName: el.name,
+              customerNumber: el.number,
+              lastOrderTime: '',
+              limitTakeNum: 0,
+              policyId: this.searchForm.code || this.comCode,
+              policyTitle: '',
+              remark: ''
+            })
           })
-        })
-        } 
+        }
 
         let imgUrl = []
-        this.fileList.forEach(k=>{
-              imgUrl.push(k.url)
+        this.fileList.forEach(k => {
+          imgUrl.push(k.url)
         })
         const params = {
           adminCompanyId: '',
@@ -899,8 +899,9 @@ export default {
         addPoliy(params).then(res => {
           console.log(res)
           this.$successMsg('新增成功')
-          this.$parent.getList()
-          this.$parent.isShow = 1
+          // this.$parent.getList()
+          this.$parent.$parent.$refs.pageRef.refreshList()
+          this.$parent.$parent.isShow = 1
         })
       }
 
@@ -929,28 +930,27 @@ export default {
     },
     handleNewInfo() {
       // 物料列表
-    this.$nextTick(()=>{
-      this.dataList.push({
-        id: '',
-        discAmount: 0,
-        materialId: '',
-        materialName: '',
-        materialNumber: '',
-        policyId: this.comCode,
-        price: '',
-        remark: '',
-        saleTypeCode: '',
-        saleTypeId: '',
-        saleTypeName: '',
-        specification: '',
-        rebateWalletIds: [],
-        walletIds: [this.NoRebateWalletList[0].id],
-        walletRelaList: [],
-        
+      this.$nextTick(() => {
+        this.dataList.push({
+          id: '',
+          discAmount: 0,
+          materialId: '',
+          materialName: '',
+          materialNumber: '',
+          policyId: this.comCode,
+          price: '',
+          remark: '',
+          saleTypeCode: '',
+          saleTypeId: '',
+          saleTypeName: '',
+          specification: '',
+          rebateWalletIds: [],
+          walletIds: [this.NoRebateWalletList[0].id],
+          walletRelaList: []
+        })
+        this.sleectBox.currentPage = 1
       })
-      this.sleectBox.currentPage = 1
-    })
-     
+
       // this.listTotal += 1;
       // this.dataList.push(this.addList[this.addList.length-1])
     },
@@ -980,19 +980,20 @@ export default {
           return
         }
       }
-      savePolicy(this.dataList).then(res => {
-        this.dataList = []
-        this.dcurrentPage = 1
-        this.sleectBox.currentPage = 1
-        this.fullscreenLoading = false
+      savePolicy(this.dataList)
+        .then(res => {
+          this.dataList = []
+          this.dcurrentPage = 1
+          this.sleectBox.currentPage = 1
+          this.fullscreenLoading = false
 
-        this.$successMsg('保存成功')
+          this.$successMsg('保存成功')
 
-        this.handletwoList()
-      }).finally(()=>{
-        this.fullscreenLoading = false
-
-      })
+          this.handletwoList()
+        })
+        .finally(() => {
+          this.fullscreenLoading = false
+        })
     },
     handleK3List(e, row, index, name) {
       const item = this.k3List.filter(k => {

+ 2 - 2
src/views/sales_policy/components/Distributor.vue

@@ -1,8 +1,8 @@
 <template>
   <el-container>
-    <el-header height="50px" class="header">
+    <!-- <el-header height="50px" class="header">
       <el-page-header @back="$parent.isShow = 1" :content="'详情页面'"> </el-page-header>
-    </el-header>
+    </el-header> -->
     <el-header height="" class="pdt">
       <el-form
         :model="details"

+ 2 - 1
src/views/sales_policy/components/EditCondition.vue

@@ -305,8 +305,9 @@ export default {
   methods: {
     getList() {},
     handleBack() {
+      console.log(this.$parent)
       console.log(this.id, this.policyId)
-      this.$parent.isEdit = 1
+      // this.$parent.isEdit = 1
     },
     /**
      * 根据条件禁用行复选框

+ 85 - 75
src/views/sales_policy/components/Examine.vue

@@ -1,9 +1,9 @@
 <template>
   <div class="app-container">
     <div v-if="isEdit == 1">
-      <el-header height="50px" class="header">
+      <!-- <el-header height="50px" class="header">
         <el-page-header :content="funTitle()" @back=";($parent.isShow = 1), ($parent.id = '')" />
-      </el-header>
+      </el-header> -->
       <div>
         <div class="diy-table-1">
           <el-row>
@@ -86,7 +86,7 @@
             </el-col>
           </el-row>
 
-          <el-row v-if="detail.imgSrc && $parent.isShow !== 5" class="img-box">
+          <el-row v-if="detail.imgSrc && $parent.$parent.$parent.isShow !== 5" class="img-box">
             <el-col :span="24" class="item">
               <div class="label" style="height: 150px">政策封面图</div>
               <div class="value" style="height: 150px">
@@ -116,7 +116,7 @@
               </div>
             </el-col>
           </el-row>
-          <el-row v-if="$parent.isShow == 5">
+          <el-row v-if="$parent.$parent.$parent.isShow == 5">
             <el-col :span="24" class="item">
               <div class="label" style="height: 150px">政策封面图</div>
               <div class="value" style="height: 150px">
@@ -124,7 +124,7 @@
               </div>
             </el-col>
           </el-row>
-          <el-row v-if="this.$parent.isShow == 4">
+          <el-row v-if="this.$parent.$parent.$parent.isShow == 4">
             <el-col :span="8" class="item">
               <div class="label">审核人</div>
               <div class="value">{{ detail.examineBy }}</div>
@@ -168,7 +168,7 @@
               <el-col :span="12">
                 <h4 style="display: inline-block; margin-right: 20px">货品信息</h4>
                 <ExportButton
-                  v-if="$parent.isShow === 4"
+                  v-if="$parent.$parent.$parent.isShow === 4"
                   style="display: inline-block"
                   :ex-url="'policy/material/export'"
                   ex-text="导出货品"
@@ -176,7 +176,7 @@
                 />
 
                 <el-upload
-                  v-if="$parent.isShow == 5"
+                  v-if="$parent.$parent.$parent.isShow == 5"
                   class="import-btn"
                   :action="baseURL + 'student/import'"
                   :http-request="handleImport"
@@ -321,7 +321,7 @@
             </el-table-column>
             <el-table-column label="操作" align="left" width="150">
               <template slot-scope="scope">
-                <template v-if="$parent.isShow == 5">
+                <template v-if="$parent.$parent.$parent.isShow == 5">
                   <el-button type="text" size="small" @click="getCommonApi(scope.row)">编辑</el-button>
                   <el-popconfirm
                     confirm-button-text="好的"
@@ -339,9 +339,9 @@
                   type="text"
                   size="small"
                   @click="
-                    ;($parent.isShow = 10),
-                      ($parent.policyId = scope.row.id),
-                      $parent.isShow === 8 ? (detailFang = false) : (detailFang = true)
+                    ;($parent.$parent.$parent.isShow = 10),
+                      ($parent.$parent.$parent.policyId = scope.row.id),
+                      $parent.$parent.$parent.isShow === 8 ? (detailFang = false) : (detailFang = true)
                   "
                   >查看条件</el-button
                 >
@@ -355,14 +355,13 @@
                 <h4 style="display: inline-block; margin-right: 20px">经销商使用范围</h4>
                 <template v-if="detail.flag == 0">
                   <ExportButton
-                  v-if="$parent.isShow === 4"
-                  style="display: inline-block"
-                  :ex-url="'policy/customer/export'"
-                  ex-text="导出经销商"
-                  :ex-params="{ policyId: detail.code }"
-                />
+                    v-if="$parent.$parent.$parent.isShow === 4"
+                    style="display: inline-block"
+                    :ex-url="'policy/customer/export'"
+                    ex-text="导出经销商"
+                    :ex-params="{ policyId: detail.code }"
+                  />
                 </template>
-               
               </el-col>
             </el-row>
             <el-divider />
@@ -374,45 +373,45 @@
               <el-radio label="2" :disabled="detail.flag != 2">佛山经销商</el-radio>
             </el-radio-group>
           </div>
-      
-          <template v-if="$parent.isShow != 5">
+
+          <template v-if="$parent.$parent.$parent.isShow != 5">
             <template v-if="detail.flag == 0">
-            <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="left" />
-              <el-table-column prop="customerNumber" label="经销商编码" align="left">
-                <template slot-scope="scope">
-                  <CopyButton :copy-text="scope.row.customerNumber" />
-                  <span>{{ scope.row.customerNumber }}</span>
-                </template></el-table-column
+              <el-table
+                v-loading="listLoading"
+                :data="custoList"
+                element-loading-text="Loading"
+                border
+                fit
+                highlight-current-row
+                stripe
               >
-              <el-table-column prop="customerName" label="经销商名称" align="left">
-                <template slot-scope="scope">
-                  <CopyButton :copy-text="scope.row.customerName" />
-                  <span>{{ scope.row.customerName }}</span>
-                </template>
-              </el-table-column>
-            </el-table>
-            <!-- 分页 -->
-            <div style="margin: 20px 0">
-              <el-pagination
-                :current-page="currentPages"
-                :page-sizes="[10, 20, 30, 50]"
-                :page-size="10"
-                layout="total, sizes, prev, pager, next, jumper"
-                :total="clistTotals"
-                @size-change="handleSizeChanges"
-                @current-change="handleCurrentChanges"
-              />
-            </div>
-          </template>
+                <el-table-column fixed type="index" label="序号" width="50" align="left" />
+                <el-table-column prop="customerNumber" label="经销商编码" align="left">
+                  <template slot-scope="scope">
+                    <CopyButton :copy-text="scope.row.customerNumber" />
+                    <span>{{ scope.row.customerNumber }}</span>
+                  </template></el-table-column
+                >
+                <el-table-column prop="customerName" label="经销商名称" align="left">
+                  <template slot-scope="scope">
+                    <CopyButton :copy-text="scope.row.customerName" />
+                    <span>{{ scope.row.customerName }}</span>
+                  </template>
+                </el-table-column>
+              </el-table>
+              <!-- 分页 -->
+              <div style="margin: 20px 0">
+                <el-pagination
+                  :current-page="currentPages"
+                  :page-sizes="[10, 20, 30, 50]"
+                  :page-size="10"
+                  layout="total, sizes, prev, pager, next, jumper"
+                  :total="clistTotals"
+                  @size-change="handleSizeChanges"
+                  @current-change="handleCurrentChanges"
+                />
+              </div>
+            </template>
           </template>
           <template v-else>
             <el-row :gutter="20">
@@ -513,8 +512,7 @@
                 </div> -->
               </el-col>
             </el-row>
-    
-        </template>
+          </template>
           <div>
             <h4 style="display: inline-block; margin-right: 20px">经销商上限</h4>
             <el-divider />
@@ -609,7 +607,10 @@
               />
             </div>
           </div>
-          <div v-if="$parent.isShow == 8 && detail.examineStatus == 'WAIT'" class="descriptions diy-table-1">
+          <div
+            v-if="$parent.$parent.$parent.isShow == 8 && detail.examineStatus == 'WAIT'"
+            class="descriptions diy-table-1"
+          >
             <el-row>
               <el-col :span="6">审核人</el-col>
               <el-col :span="6">{{ $store.getters.name }}</el-col>
@@ -635,7 +636,9 @@
           </div>
         </div>
         <div>
-          <el-button v-if="$parent.isShow == 5" type="primary" size="default" @click="handleSave">保存</el-button>
+          <el-button v-if="$parent.$parent.$parent.isShow == 5" type="primary" size="default" @click="handleSave"
+            >保存</el-button
+          >
         </div>
       </div>
     </div>
@@ -665,6 +668,12 @@ import Minxin from '@/mixin'
 
 export default {
   name: 'Examine',
+  props: {
+    id: {
+      type: String,
+      default: ''
+    }
+  },
   components: {
     EditCondition,
     ImageUpload
@@ -746,9 +755,9 @@ export default {
     comTitle() {
       console.log(this.detailFang, 'kkk')
       let title = '详情页'
-      if (this.$parent.isShow == 5) {
+      if (this.$parent.$parent.$parent.isShow == 5) {
         title = '编辑页'
-      } else if (this.$parent.isShow == 8 && !this.detailFang) {
+      } else if (this.$parent.$parent.$parent.isShow == 8 && !this.detailFang) {
         title = '审核页'
       } else {
         title = '详情页'
@@ -761,9 +770,9 @@ export default {
     funTitle() {
       console.log()
       let title = '详情页'
-      if (this.$parent.isShow == 5) {
+      if (this.$parent.$parent.$parent.isShow == 5) {
         title = '编辑页'
-      } else if (this.$parent.isShow == 8 && !this.detailFang) {
+      } else if (this.$parent.$parent.$parent.isShow == 8 && !this.detailFang) {
         title = '审核页'
       } else {
         title = '详情页'
@@ -772,13 +781,13 @@ export default {
     },
     getList() {
       this.listLoading = true
-      getPolicyDetail({ policyId: this.$parent.id }).then(res => {
+      getPolicyDetail({ policyId: this.$parent.$parent.$parent.id }).then(res => {
         this.detail = res.data
-          this.detail.imgSrc = this.detail.imgSrc.split(',')
-        this.detail.imgSrc.forEach(k=>{
-          this.srcList.push(this.$imageUrl+k)
+        this.detail.imgSrc = this.detail.imgSrc.split(',')
+        this.detail.imgSrc.forEach(k => {
+          this.srcList.push(this.$imageUrl + k)
         })
-        if (this.$parent.isShow == 5 && this.detail.imgSrc) {
+        if (this.$parent.$parent.$parent.isShow == 5 && this.detail.imgSrc) {
           this.fileList = [
             {
               hover: '',
@@ -798,7 +807,7 @@ export default {
       getPolicyList({
         pageNum: this.policyList.currentPages,
         pageSize: this.policyList.pageSize,
-        policyId: this.$parent.id,
+        policyId: this.$parent.$parent.$parent.id,
         keyword: this.policyList.keyword
       }).then(res => {
         this.list = res.data.records
@@ -851,8 +860,8 @@ export default {
       this.currentPages = 1
       this.getCond()
     },
-       // 检查文件类型
-       checkFileType(url) {
+    // 检查文件类型
+    checkFileType(url) {
       if (!url) return ''
       const fileSuffix = url.substring(url.lastIndexOf('.') + 1)
 
@@ -912,12 +921,13 @@ export default {
     handleSubmit() {
       toExamine({
         examineStatus: this.examineStatus,
-        policyId: this.$parent.id,
+        policyId: this.$parent.$parent.$parent.id,
         examineRemark: this.remark
       }).then(res => {
         this.$successMsg('已提交审核')
-        this.$parent.isShow = 1
-        this.$parent.getList()
+        this.$parent.$parent.$parent.isShow = 1
+        // this.$parent.getList()
+        this.$parent.$parent.$parent.$refs.pageRef.refreshList()
       })
     },
     // 获取货品信息
@@ -1120,7 +1130,7 @@ export default {
         await this.getCond()
         this.$successMsg('编辑成功')
         this.fileList = []
-        this.$parent.isShow = 1
+        this.$parent.$parent.$parent.isShow = 1
       }
     }
   }

+ 77 - 70
src/views/sales_policy/components/editPolicy.vue

@@ -1,9 +1,9 @@
 <template>
   <div>
     <div v-show="isCondition == 0" class="app-container mymain-container">
-      <el-header height="50px" class="header">
+      <!-- <el-header height="50px" class="header">
         <el-page-header content="编辑" @back=";($parent.isShow = 1), ($parent.isFlag = '')" />
-      </el-header>
+      </el-header> -->
       <div>
         <div class="screen-container">
           <h4>销售政策信息</h4>
@@ -87,7 +87,7 @@
               </el-col>
               <el-col :xs="24" :ms="24" :lg="24">
                 <el-form-item label="政策封面图">
-                  <ImageUpload :file-list="fileList" multiple :limit="3"/>
+                  <ImageUpload :file-list="fileList" multiple :limit="3" />
                 </el-form-item>
               </el-col>
             </el-row>
@@ -201,7 +201,7 @@
                     filterable
                     @change="handleSalesType($event, scope.row, scope.$index, 'saleTypeId')"
                   >
-                    <el-option v-for="(item,index) in typeList" :key="index" :label="item.saleName" :value="item.id" />
+                    <el-option v-for="(item, index) in typeList" :key="index" :label="item.saleName" :value="item.id" />
                   </el-select>
                 </template>
               </pl-table-column>
@@ -389,7 +389,7 @@
           <div style="margin: 20px 20px 20px 0; display: flex; justify-content: space-between">
             <div>
               <el-button type="primary" size="mini" @click="handleNewInfo">添加</el-button>
-              <el-button type="primary" size="mini" @click="handleSave"   v-loading="fullscreenLoading">保存</el-button>
+              <el-button type="primary" size="mini" @click="handleSave" v-loading="fullscreenLoading">保存</el-button>
             </div>
             <!--            <el-pagination-->
             <!--              :current-page="dcurrentPage"-->
@@ -494,6 +494,12 @@ import ImageUpload from '@/components/Common/image-upload.vue'
 import { PlTable, PlTableColumn } from 'pl-table'
 
 export default {
+  props: {
+    id: {
+      type: String,
+      default: ''
+    }
+  },
   directives: {
     'el-select-loadmore': {
       bind(el, binding) {
@@ -574,8 +580,8 @@ export default {
       cid: '',
       cpolicyId: '',
       region: 0,
-      fullscreenLoading:false,
-      srcList:[]
+      fullscreenLoading: false,
+      srcList: []
     }
   },
   computed: {
@@ -648,13 +654,13 @@ export default {
         this.k3List = [...this.k3List, ...res.data.records]
       })
     },
-    async remoteMethodType(query, type){
+    async remoteMethodType(query, type) {
       console.log(111)
       // 获取销售类型列表
       const params = {
         pageNum: 1,
-        pageSize:-1,
-        saleCode:query,
+        pageSize: -1,
+        saleCode: query,
         saleName: '',
         status: ''
       }
@@ -708,30 +714,30 @@ export default {
 
       this.typeList = typeData.data.records
     },
-    handleSalesType(e, row, index, name) { 
+    handleSalesType(e, row, index, name) {
       let item
       try {
-        item= this.typeList.filter(k => {
-        return k.id === e
-      })[0]
-  
-      const linshi = []
-      const rebateList = []
-      this.rebateList.forEach(k => {
-        k.saleTypes.forEach(j => {
-          if (!linshi.includes(j.saleTypeId) && j.saleTypeId === e) {
-            rebateList.push(k)
-            linshi.push(j.saleTypeId)
-          }
+        item = this.typeList.filter(k => {
+          return k.id === e
+        })[0]
+
+        const linshi = []
+        const rebateList = []
+        this.rebateList.forEach(k => {
+          k.saleTypes.forEach(j => {
+            if (!linshi.includes(j.saleTypeId) && j.saleTypeId === e) {
+              rebateList.push(k)
+              linshi.push(j.saleTypeId)
+            }
+          })
         })
-      })
 
-      if (rebateList.length) {
-        this.dataList[index].rebateWalletIds = [...new Set([...row.rebateWalletIds, rebateList[0].walletRebateId])]
-        this.$set(row, 'rebateWalletIds', [...new Set([...row.rebateWalletIds, rebateList[0].walletRebateId])])
-      }
+        if (rebateList.length) {
+          this.dataList[index].rebateWalletIds = [...new Set([...row.rebateWalletIds, rebateList[0].walletRebateId])]
+          this.$set(row, 'rebateWalletIds', [...new Set([...row.rebateWalletIds, rebateList[0].walletRebateId])])
+        }
       } catch (error) {
-        console.log(error);
+        console.log(error)
       }
       this.dataList[index][name] = row[name]
       this.dataList[index].saleTypeCode = item.saleCode
@@ -799,9 +805,9 @@ export default {
     },
     async getList() {
       await this.getCommonApi()
-      await getPolicyDetail({ policyId: this.$parent.id }).then(async res => {
+      await getPolicyDetail({ policyId: this.id }).then(async res => {
         this.detail = res.data
-        ;(this.searchForm = {
+        this.searchForm = {
           code: this.detail.code,
           endTime: this.detail.endTime,
           imgSrc: this.detail.imgSrc,
@@ -811,19 +817,18 @@ export default {
           type: this.detail.type,
           isFullRebate: this.detail.isFullRebate,
           commercialType: this.detail.commercialType
-        }),
-          (this.region = res.data.flag)
+        }
+        this.region = res.data.flag
 
         // this.srcList = [this.$imageUrl + this.detail.imgSrc]
-        if (this.$parent.isShow === 5 && this.detail.imgSrc) {
-          this.detail.imgSrc.split(',').forEach(k=>{
+        if (this.isShow === 5 && this.detail.imgSrc) {
+          this.detail.imgSrc.split(',').forEach(k => {
             this.fileList.push({
               hover: '',
-              url:k
+              url: k
             })
-            this.srcList.push(this.$imageUrl+k)
+            this.srcList.push(this.$imageUrl + k)
           })
-
         }
         await this.handletwoList()
         // 获取条件政策
@@ -934,7 +939,7 @@ export default {
         //   }
         // });
         let imgUrl = []
-        this.fileList.forEach(k=>{
+        this.fileList.forEach(k => {
           imgUrl.push(k.url)
         })
         const params = {
@@ -949,8 +954,9 @@ export default {
         updatePolicy(params).then(res => {
           console.log(res)
           this.$successMsg('编辑成功')
-          this.$parent.getList()
-          this.$parent.isShow = 1
+          // this.$parent.getList()
+          this.$parent.$parent.$parent.$refs.pageRef.refreshList()
+          this.isShow = 1
         })
       }
 
@@ -984,25 +990,25 @@ export default {
     handleNewInfo() {
       // 物料列表
 
-      this.$nextTick(()=>{
+      this.$nextTick(() => {
         this.dataList.push({
-        id: '',
-        discAmount: '',
-        materialId: '',
-        materialName: '',
-        materialNumber: '',
-        policyId: this.searchForm.code,
-        price: '',
-        remark: '',
-        saleTypeCode: '',
-        saleTypeId: '',
-        saleTypeName: '',
-        specification: '',
-        walletIds: [this.NoRebateWalletList[0].id],
-        walletRelaList: [],
-        rebateWalletIds:[]
-      })
-      this.sleectBox.currentPage = 1
+          id: '',
+          discAmount: '',
+          materialId: '',
+          materialName: '',
+          materialNumber: '',
+          policyId: this.searchForm.code,
+          price: '',
+          remark: '',
+          saleTypeCode: '',
+          saleTypeId: '',
+          saleTypeName: '',
+          specification: '',
+          walletIds: [this.NoRebateWalletList[0].id],
+          walletRelaList: [],
+          rebateWalletIds: []
+        })
+        this.sleectBox.currentPage = 1
       })
       // this.listTotal += 1;
       // this.dataList.push(this.addList[this.addList.length-1])
@@ -1033,18 +1039,19 @@ export default {
         }
       }
 
-      savePolicy(this.dataList).then(res => {
-        this.dataList = []
-        this.sleectBox.currentPage = 1
-        this.dcurrentPage = 1
-        this.fullscreenLoading = false
-
-        this.$successMsg('保存成功')
-        this.handletwoList()
-      }).finally(()=>{
-        this.fullscreenLoading = false
+      savePolicy(this.dataList)
+        .then(res => {
+          this.dataList = []
+          this.sleectBox.currentPage = 1
+          this.dcurrentPage = 1
+          this.fullscreenLoading = false
 
-      })
+          this.$successMsg('保存成功')
+          this.handletwoList()
+        })
+        .finally(() => {
+          this.fullscreenLoading = false
+        })
     },
     handleK3List(e, row, index, name) {
       const item = this.k3List.filter(k => {

+ 211 - 379
src/views/sales_policy/policy_list.vue

@@ -1,296 +1,11 @@
 <template>
-  <div v-if="isShow === 1" class="app-container">
-    <div class="screen-container">
-      <Collapse :screen-form="screenForm">
-        <template #right_btn>
-          <el-button size="mini" @click="resetScreenForm">清空</el-button>
-          <el-button type="primary" size="mini" @click="submitScreenForm">搜索</el-button>
-        </template>
-        <template #search>
-          <el-form
-            ref="screenForm"
-            size="mini"
-            :model="screenForm"
-            :inline="false"
-            label-width="120px"
-            label-position="left"
-          >
-            <el-row>
-              <el-row :gutter="20">
-                <el-col :xs="24" :ms="6" :lg="6">
-                  <el-form-item label="销售政策编号" prop="code">
-                    <el-input v-model="screenForm.code" placeholder="销售政策编号" size="mini" />
-                  </el-form-item>
-                </el-col>
-
-                <el-col :xs="24" :ms="6" :lg="6">
-                  <el-form-item label="销售政策说明" prop="title">
-                    <el-input v-model="screenForm.title" placeholder="销售政策说明" size="mini" />
-                  </el-form-item>
-                </el-col>
-
-                <el-col :xs="24" :ms="6" :lg="6">
-                  <el-form-item label="表头备注" prop="remark">
-                    <el-input v-model="screenForm.remark" placeholder="表头备注" size="mini" />
-                  </el-form-item>
-                </el-col>
-
-                <el-col :xs="24" :ms="6" :lg="6">
-                  <el-form-item label="生效日期" prop="startTime1">
-                    <el-date-picker
-                      v-model="screenForm.startTime1"
-                      type="datetime"
-                      size="mini"
-                      placeholder="生效日期"
-                      value-format="yyyy-MM-dd HH:mm:ss"
-                    />
-                  </el-form-item>
-                </el-col>
-              </el-row>
-              <el-row :gutter="20">
-                <el-col :xs="24" :ms="6" :lg="6">
-                  <el-form-item label="结束日期" prop="endTime1">
-                    <el-date-picker
-                      v-model="screenForm.endTime1"
-                      type="datetime"
-                      size="mini"
-                      placeholder="结束日期"
-                      value-format="yyyy-MM-dd HH:mm:ss"
-                    />
-                  </el-form-item>
-                </el-col>
-
-                <el-col :xs="24" :ms="6" :lg="6">
-                  <el-form-item label="制表日期" prop="startCreateTime">
-                    <el-date-picker
-                      v-model="screenForm.startCreateTime"
-                      type="datetime"
-                      size="mini"
-                      placeholder="制表日期"
-                      value-format="yyyy-MM-dd HH:mm:ss"
-                    />
-                  </el-form-item>
-                </el-col>
-
-                <el-col :xs="24" :ms="6" :lg="6">
-                  <el-form-item label="制表人" prop="createBy">
-                    <el-input v-model="screenForm.createBy" placeholder="制表人" size="mini" />
-                  </el-form-item>
-                </el-col>
-
-                <el-col :xs="24" :ms="6" :lg="6">
-                  <el-form-item label="审核人" prop="examineBy">
-                    <el-input v-model="screenForm.examineBy" placeholder="审核人" size="mini" />
-                  </el-form-item>
-                </el-col>
-              </el-row>
-              <el-row :gutter="20">
-                <el-col :xs="24" :ms="6" :lg="6">
-                  <el-form-item label="状态" prop="status">
-                    <el-select
-                      v-model="screenForm.status"
-                      clearable
-                      size="mini"
-                      placeholder="状态"
-                      class="select_height"
-                    >
-                      <el-option
-                        v-for="(item, index) in statusOptions"
-                        :key="index"
-                        :label="item.label"
-                        :value="item.value"
-                      />
-                    </el-select>
-                  </el-form-item>
-                </el-col>
-
-                <el-col :xs="24" :ms="6" :lg="6">
-                  <el-form-item label="销售政策类型" prop="type">
-                    <el-select
-                      v-model="screenForm.type"
-                      size="mini"
-                      clearable
-                      placeholder="销售政策类型"
-                      class="select_height"
-                    >
-                      <el-option
-                        v-for="item in typeOptions"
-                        :key="item.value"
-                        :label="item.label"
-                        :value="item.value"
-                      />
-                    </el-select>
-                  </el-form-item>
-                </el-col>
-                <el-col :xs="24" :ms="6" :lg="6">
-                  <el-form-item label="经销商名称" prop="customerId">
-                    <el-select
-                      v-model="screenForm.customerId"
-                      size="mini"
-                      filterable
-                      clearable
-                      placeholder="经销商名称"
-                      class="select_height"
-                    >
-                      <el-option v-for="item in CrList" :key="item.id" :label="item.name" :value="item.id" />
-                    </el-select>
-                  </el-form-item>
-                </el-col>
-                <el-col :xs="24" :ms="6" :lg="6">
-                  <el-form-item label="经销商编码" prop="customerNumber">
-                    <el-select
-                      v-model="screenForm.customerNumber"
-                      size="mini"
-                      filterable
-                      clearable
-                      placeholder="经销商编码"
-                      class="select_height"
-                    >
-                      <el-option v-for="item in CrList" :key="item.id" :label="item.number" :value="item.number" />
-                    </el-select>
-                  </el-form-item>
-                </el-col>
-
-                <el-col :xs="24" :ms="6" :lg="6">
-                  <el-form-item label="机型" prop="specification">
-                    <el-input v-model="screenForm.specification" placeholder="机型" size="mini" />
-                  </el-form-item>
-                </el-col>
-              </el-row>
-            </el-row>
-          </el-form>
-        </template>
-      </Collapse>
-    </div>
-    <div class="btn-group">
-      <el-row type="flex">
-        <el-button
-          v-if="$checkBtnRole('add', $route.meta.roles)"
-          size="mini"
-          type="primary"
-          icon="el-icon-plus"
-          @click="hanlenewInfo"
-          >新增</el-button
-        >
-      </el-row>
-    </div>
-    <div class="mymain-container">
-      <div class="table">
-        <el-table :data="dataList" :row-class-name="tableRowClassName" border style="width: 100%">
-          <el-table-column fixed="left" label="操作" min-width="250" align="center">
-            <template slot-scope="scope">
-              <el-button
-                v-if="scope.row.examineStatus == 'SAVE'"
-                type="text"
-                size="mini"
-                @click=";(isShow = 5), (id = scope.row.id)"
-                >编辑</el-button
-              >
-              <el-button type="text" size="mini" @click=";(isShow = 4), (id = scope.row.id), (code = scope.row.code)"
-                >详情</el-button
-              >
-
-              <el-button
-                v-if="scope.row.examineStatus == 'WAIT' && $checkBtnRole('examine', $route.meta.roles)"
-                type="text"
-                size="mini"
-                @click=";(isShow = 8), (id = scope.row.id), (policyId = scope.row.policyId), (code = scope.row.code)"
-                >审核</el-button
-              >
-              <!-- </el-popconfirm> -->
-              <el-popconfirm
-                v-if="scope.row.examineStatus == 'SAVE'"
-                style="margin-left: 10px"
-                title="提审?"
-                @onConfirm="handlesubmit(scope.row)"
-              >
-                <el-button slot="reference" type="text" size="mini">提审</el-button>
-              </el-popconfirm>
-              <el-popconfirm
-                v-if="scope.row.examineStatus === 'OK' && scope.row.status"
-                style="margin-left: 10px"
-                title="作废?"
-                @onConfirm="handleNullify(scope.row)"
-              >
-                <el-button slot="reference" type="text" size="mini">作废</el-button>
-              </el-popconfirm>
-              <el-popconfirm
-                v-if="scope.row.examineStatus === 'OK'"
-                style="margin-left: 10px"
-                title="克隆?"
-                @onConfirm="handleClone(scope.row)"
-              >
-                <!--  -->
-                <el-button slot="reference" type="text" size="mini">克隆</el-button>
-              </el-popconfirm>
-              <el-popconfirm
-                v-if="scope.row.examineStatus != 'OK'"
-                style="margin-left: 10px"
-                title="删除吗?"
-                @onConfirm="hanleDelete(scope.row.id)"
-              >
-                <el-button slot="reference" type="text" size="mini">删除</el-button>
-              </el-popconfirm>
-              <el-popconfirm
-                v-if="scope.row.examineStatus == 'OK'"
-                style="margin-left: 10px"
-                title="弃审吗?"
-                @onConfirm="hanleAbandon(scope.row.id)"
-              >
-                <el-button slot="reference" type="text" size="mini">弃审</el-button>
-              </el-popconfirm>
-            </template>
-          </el-table-column>
-          <el-table-column label="状态" width="120" align="left">
-            <template slot-scope="scope">
-              <el-tag size="mini" type="success" v-if="scope.row.status == '1'">已生效</el-tag>
-              <el-tag size="mini" type="danger" v-else-if="scope.row.status == '0'">未生效 </el-tag>
-            </template>
-          </el-table-column>
-          <el-table-column label="审核状态" width="120" align="left">
-            <template slot-scope="scope">
-              <el-tag size="mini" v-if="scope.row.examineStatus == 'SAVE'">保存</el-tag>
-              <el-tag size="mini" type="warning" v-else-if="scope.row.examineStatus == 'WAIT'">待审核 </el-tag>
-              <el-tag size="mini" type="success" v-else-if="scope.row.examineStatus == 'OK'">通过 </el-tag>
-              <el-tag size="mini" type="danger" v-else>不通过 </el-tag>
-            </template>
-          </el-table-column>
-          <el-table-column prop="code" label="销售政策编号" show-overflow-tooltip min-width="200" align="left" />
-          <el-table-column show-overflow-tooltip prop="title" label="销售政策名称" min-width="150" align="left" />
-          <!-- <el-table-column
-          prop="mainName"
-          label="产品类别"
-          align="left"
-        ></el-table-column> -->
-          <el-table-column show-overflow-tooltip prop="remark" label="销售政策说明" min-width="150" align="left" />
-          <el-table-column min-width="200" show-overflow-tooltip prop="startTime" label="生效日期" align="left" />
-          <el-table-column min-width="200" show-overflow-tooltip prop="endTime" label="结束日期" align="left" />
-          <el-table-column show-overflow-tooltip prop="createBy" label="制表人" min-width="200" align="left" />
-          <el-table-column show-overflow-tooltip prop="createTime" label="制表日期" min-width="200" align="left" />
-          <el-table-column show-overflow-tooltip prop="examineBy" label="审核人" min-width="200" align="left" />
-        </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>
-  </div>
-  <AddPolicy v-else-if="isShow === 2" />
+  <!-- <AddPolicy v-else-if="isShow === 2" />
   <AddCondition v-else-if="isShow === 10 || isShow === 12" :id="id" :policy-id="policyId" />
   <EditPolicy v-else-if="isShow === 5" />
   <Details v-else-if="isShow === 4" />
-  <Examine v-else />
+  <Examine v-else /> -->
 
-  <!-- <template-page
+  <template-page
     ref="pageRef"
     :getList="getList"
     :operation="operation()"
@@ -300,8 +15,15 @@
     :tableAttributes="tableAttributes"
     :tableEvents="tableEvents"
   >
-    
-  </template-page> -->
+    <Popu v-if="isShow !== 1">
+      <el-page-header slot="head" :content="content" @back="handleClose" />
+      <AddPolicy v-if="isShow === 2" />
+      <AddCondition v-if="isShow === 10 || isShow === 12" :id="id" :policy-id="policyId" />
+      <EditPolicy v-if="isShow === 5" :id="id" />
+      <Details v-if="isShow === 4" />
+      <Examine v-if="isShow === 8" />
+    </Popu>
+  </template-page>
 </template>
 
 <script>
@@ -319,9 +41,11 @@ import {
   getpolicySubmit,
   getTypeList,
   toExamine,
-  setAbandon
+  setAbandon,
+  policyListV2,
+  policyListV2Export
 } from '@/api/policy_list'
-import Minxin from '@/mixin'
+// import Minxin from '@/mixin'
 import { downloadFiles, handleImport } from '@/utils/util'
 import AddPolicy from './components/AddPolicy'
 import EditPolicy from './components/editPolicy'
@@ -333,16 +57,32 @@ import Examine from './components/Examine'
 import { mapState } from 'vuex'
 
 export default {
-  mixins: [Minxin, add_callback_mixin],
+  mixins: [add_callback_mixin],
   data() {
     return {
+      showPage: true,
+      content: '商用工程信息单',
+      // 关闭新增弹窗
+      handleClose: this.addOff(() => {
+        if (this.isShow === 2 || this.isShow === 5) {
+          this.isShow = 1
+        }
+        if (this.isShow === 8) {
+          this.isShow = 1
+          this.id = ''
+        }
+        this.showPage = true
+        this.$refs.pageRef.refreshList()
+      }),
       // 事件组合
       optionsEvensGroup: [
         [
           [
             {
               name: '新增',
-              click: this.addOn(() => {})
+              click: this.addOn(() => {
+                this.hanlenewInfo()
+              })
             }
           ]
         ]
@@ -350,7 +90,7 @@ export default {
       // 表格属性
       tableAttributes: {
         // 启用勾选列
-        selectColumn: true
+        selectColumn: false
       },
       // 表格事件
       tableEvents: {
@@ -431,9 +171,9 @@ export default {
   }),
   methods: {
     // 列表请求函数
-    // getList: levelList,
+    getList: policyListV2,
     // 列表导出函数
-    // exportList: exportLevelList,
+    exportList: policyListV2Export,
     // 表格列解析渲染数据更改
     columnParsing(item, defaultData) {
       return defaultData
@@ -446,42 +186,124 @@ export default {
       return (h, { row, index, column }) => {
         return (
           <div class="operation-btns">
-            <el-button size="mini" type="text" onClick={async () => {}}>
-              详情
-            </el-button>
-            <el-popconfirm
-              onConfirm={async () => {
-                this.$refs.pageRef.refreshList()
-                this.$message.success('作废成功')
-              }}
-              title="是否确定需要作废该项内容?"
-            >
-              <el-button slot="reference" size="mini" type="text">
-                作废
-              </el-button>
-            </el-popconfirm>
-            <el-popconfirm
-              onConfirm={async () => {
-                this.$refs.pageRef.refreshList()
-                this.$message.success('克隆成功')
-              }}
-              title="是否确定需要克隆该项内容?"
-            >
-              <el-button slot="reference" size="mini" type="text">
-                克隆
+            {row.examineStatus == '保存' ? (
+              <el-button
+                size="mini"
+                type="text"
+                onClick={async () => {
+                  this.isShow = 5
+                  this.id = row.id
+                }}
+              >
+                编辑
               </el-button>
-            </el-popconfirm>
-            <el-popconfirm
-              onConfirm={async () => {
-                this.$refs.pageRef.refreshList()
-                this.$message.success('弃审成功')
+            ) : (
+              ''
+            )}
+
+            <el-button
+              size="mini"
+              type="text"
+              onClick={async () => {
+                this.isShow = 4
+                this.id = row.id
+                this.code = row.code
               }}
-              title="是否确定需要弃审该项内容?"
             >
-              <el-button slot="reference" size="mini" type="text">
-                弃审
+              详情
+            </el-button>
+
+            {row.examineStatus == '待审核' && this.$checkBtnRole('examine', this.$route.meta.roles) ? (
+              <el-button
+                size="mini"
+                type="text"
+                onClick={async () => {
+                  this.isShow = 8
+                  this.id = row.id
+                  this.code = row.code
+                  this.policyId = row.policyId
+                }}
+              >
+                审核
               </el-button>
-            </el-popconfirm>
+            ) : (
+              ''
+            )}
+
+            {row.examineStatus == '保存' ? (
+              <el-popconfirm
+                onOnConfirm={async () => {
+                  this.handlesubmit(row)
+                }}
+                title="是否确定需要提审该项内容?"
+              >
+                <el-button slot="reference" size="mini" type="text">
+                  提审
+                </el-button>
+              </el-popconfirm>
+            ) : (
+              ''
+            )}
+
+            {row.examineStatus == '审核通过' && row.status ? (
+              <el-popconfirm
+                onOnConfirm={async () => {
+                  this.handleNullify(row)
+                }}
+                title="是否确定需要作废该项内容?"
+              >
+                <el-button slot="reference" size="mini" type="text">
+                  作废
+                </el-button>
+              </el-popconfirm>
+            ) : (
+              ''
+            )}
+
+            {row.examineStatus == '审核通过' ? (
+              <el-popconfirm
+                onOnConfirm={async () => {
+                  this.handleClone(row)
+                }}
+                title="是否确定需要克隆该项内容?"
+              >
+                <el-button slot="reference" size="mini" type="text">
+                  克隆
+                </el-button>
+              </el-popconfirm>
+            ) : (
+              ''
+            )}
+
+            {row.examineStatus != '审核通过' ? (
+              <el-popconfirm
+                onOnConfirm={async () => {
+                  this.hanleDelete(row.id)
+                }}
+                title="是否确定需要删除该项内容?"
+              >
+                <el-button slot="reference" size="mini" type="text">
+                  删除
+                </el-button>
+              </el-popconfirm>
+            ) : (
+              ''
+            )}
+
+            {row.examineStatus == '审核通过' ? (
+              <el-popconfirm
+                onOnConfirm={async () => {
+                  this.hanleAbandon(row.id)
+                }}
+                title="是否确定需要弃审该项内容?"
+              >
+                <el-button slot="reference" size="mini" type="text">
+                  弃审
+                </el-button>
+              </el-popconfirm>
+            ) : (
+              ''
+            )}
           </div>
         )
       }
@@ -503,54 +325,54 @@ export default {
     },
     handleClone(row) {
       cloneList({ policyId: row.id }).then(res => {
-        this.$successMsg('克隆成功')
-        this.getList()
+        this.$refs.pageRef.refreshList()
+        this.$message.success('克隆成功')
       })
     },
-    getList() {
-      this.listLoading = true
-      const params = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
-        code: this.screenForm.code,
-        type: this.screenForm.type,
-        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,
-        customerId: this.screenForm.customerId,
-        customerNumber: this.screenForm.customerNumber,
-        specification: this.screenForm.specification
-      }
-      getList(params).then(res => {
-        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: ''
-      // }
-      // getTypeList(paramsType).then(res => {
-      //   this.typeList = res.data.records
-      // })
-    },
+    // getList() {
+    //   this.listLoading = true
+    //   const params = {
+    //     pageNum: this.currentPage,
+    //     pageSize: this.pageSize,
+    //     code: this.screenForm.code,
+    //     type: this.screenForm.type,
+    //     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,
+    //     customerId: this.screenForm.customerId,
+    //     customerNumber: this.screenForm.customerNumber,
+    //     specification: this.screenForm.specification
+    //   }
+    //   getList(params).then(res => {
+    //     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: ''
+    //   // }
+    //   // getTypeList(paramsType).then(res => {
+    //   //   this.typeList = res.data.records
+    //   // })
+    // },
     hanleAbandon(id) {
       setAbandon({ policyId: id }).then(res => {
-        this.$successMsg('弃审成功')
-        this.getList()
+        this.$refs.pageRef.refreshList()
+        this.$message.success('弃审成功')
       })
     },
     hanleDelete(id) {
@@ -558,16 +380,26 @@ export default {
         deletePolicy({
           id: ids[0]
         }).then(res => {
-          this.$successMsg('删除成功')
-          this.getList()
+          this.$refs.pageRef.refreshList()
+          this.$message.success('删除成功')
         })
       })
     },
+    hanleDeleteAllPromise(id) {
+      return new Promise((resolve, reject) => {
+        const ids = id ? [id] : this.ids
+        if (!ids.length) {
+          this.$errorMsg('请选择删除内容')
+          return
+        }
+        resolve(ids)
+      })
+    },
     // 作废
     handleNullify(row) {
       cancelPolicy({ id: row.id }).then(res => {
-        this.$successMsg('已作废')
-        this.getList()
+        this.$refs.pageRef.refreshList()
+        this.$message.success('作废成功')
       })
     },
     // 导出文档
@@ -602,8 +434,8 @@ export default {
     },
     handlesubmit(e) {
       getpolicySubmit({ policyId: e.id }).then(res => {
-        this.$successMsg('已提交')
-        this.getList()
+        this.$refs.pageRef.refreshList()
+        this.$message.success('提审成功')
       })
     },
     hanleExamine(e) {

+ 119 - 177
src/views/sales_rebate/rebate_list.vue

@@ -1,150 +1,14 @@
 <template>
-  <div class="app-container">
-    <div class="screen-container">
-      <Collapse :screen-form="screenForm">
-        <template #right_btn>
-          <el-button icon="el-icon-search" type="primary" size="mini" @click="submitScreenForm">搜索</el-button>
-          <el-button type="primary" size="mini" @click="resetScreenForm">清空</el-button>
-        </template>
-        <template #search>
-          <el-form ref="screenForm" :model="screenForm" size="mini" label-position="left" label-width="120px">
-            <el-row :gutter="20">
-              <!-- <el-col :xs="24" :ms="6" :lg="6">
-                <el-form-item label="" prop="mainName">
-                  <el-input
-                    v-model="screenForm.mainName"
-                    placeholder="返利品类"
-                    size="mini"
-                  ></el-input>
-                </el-form-item>
-              </el-col> -->
-              <el-col :xs="24" :ms="6" :lg="6">
-                <el-form-item label="销售类型编码" prop="saleTypeCode">
-                  <el-input v-model="screenForm.saleTypeCode" placeholder="销售类型编码" size="mini"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :ms="6" :lg="6">
-                <el-form-item label="销售类型名称" prop="saleTypeName">
-                  <el-input v-model="screenForm.saleTypeName" placeholder="销售类型名称" size="mini"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :ms="6" :lg="6">
-                <el-form-item prop="status" label="状态">
-                  <el-select v-model="screenForm.status" placeholder="请选择" size="mini">
-                    <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
-                    </el-option>
-                  </el-select>
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </el-form>
-        </template>
-      </Collapse>
-      <div>
-        <el-button
-          type="primary"
-          size="mini"
-          icon="el-icon-plus"
-          v-if="$checkBtnRole('add', $route.meta.roles)"
-          @click=";(dialogVisible = true), (type = 1), getDictList()"
-          >新增</el-button
-        >
-
-        <!-- <el-button type="primary" size="mini" @click="delfn"
-              >批量删除</el-button
-            > -->
-        <el-popconfirm
-          v-if="$checkBtnRole('del', $route.meta.roles)"
-          class="delClass"
-          @onConfirm="delfn"
-          title="这是一段内容确定删除吗?"
-        >
-          <el-button :disabled="ids.length < 1" slot="reference" type="danger" icon="el-icon-minus" size="mini"
-            >批量删除</el-button
-          >
-        </el-popconfirm>
-
-        <ExportButton
-          style="display: inline-block; margin-left: 10px"
-          :exUrl="'wallet/rebate_saletype/export'"
-          :exParams="exParams"
-        />
-      </div>
-    </div>
-
-    <div class="mymain-container">
-      <div class="table">
-        <el-table
-          v-loading="listLoading"
-          :data="dataList"
-          element-loading-text="Loading"
-          border
-          fit
-          highlight-current-row
-          stripe
-          @selection-change="selectionhangeFn"
-        >
-          <!-- <div v-for="(col, i) in columns" :key="i"> -->
-          <el-table-column type="selection" width="55" align="center"> </el-table-column>
-          <template v-for="col in columns">
-            <el-table-column
-              align="left"
-              :label="col.lable"
-              :prop="col.prop"
-              :min-width="col.widht"
-              show-overflow-tooltip
-              v-if="col.prop == 'status'"
-            >
-              <template slot-scope="scope">
-                <el-switch
-                  v-model="scope.row.status"
-                  @change="handleSwitch($event, scope.row.walletRebateSaleTypeId)"
-                  :active-text="scope.row.status ? '已启用' : '已禁用'"
-                >
-                </el-switch>
-              </template>
-            </el-table-column>
-            <el-table-column
-              v-else
-              align="left"
-              :label="col.lable"
-              :prop="col.prop"
-              :min-width="col.widht"
-              show-overflow-tooltip
-            >
-            </el-table-column>
-          </template>
-          <!-- </div> -->
-
-          <el-table-column align="center" fixed="right" label="操作" min-width="160">
-            <template slot-scope="scope">
-              <el-button type="text" size="mini" @click="hanleDateil(scope.row)">查看</el-button>
-              <el-button
-                type="text"
-                size="mini"
-                @click="hanleEdit(scope.row)"
-                v-if="$checkBtnRole('edit', $route.meta.roles)"
-                >编辑</el-button
-              >
-              <!-- <el-button type="text" size="mini">编辑</el-button> -->
-            </template>
-          </el-table-column>
-        </el-table>
-      </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>
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :operation="operation()"
+    :optionsEvensGroup="optionsEvensGroup"
+    :exportList="exportList"
+    :columnParsing="columnParsing"
+    :tableAttributes="tableAttributes"
+    :tableEvents="tableEvents"
+  >
     <div>
       <el-dialog :visible.sync="dialogVisible" width="30%" @close="hanelclose" title="返利类型">
         <el-form :model="dialogForm" ref="dialogForm" :rules="rules" label-width="120px" :inline="false" size="normal">
@@ -175,9 +39,12 @@
             </el-select>
           </el-form-item>
           <el-form-item label="销售类型编码" prop="saleTypeCode">
-          <el-input disabled type="text" v-model="dialogForm.saleTypeCode"
-                    placeholder="选择销售类型自动获取销售编码"
-          />
+            <el-input
+              disabled
+              type="text"
+              v-model="dialogForm.saleTypeCode"
+              placeholder="选择销售类型自动获取销售编码"
+            />
           </el-form-item>
 
           <el-form-item label="返利折扣比例" prop="rebateRate">
@@ -219,12 +86,15 @@
         </template>
       </el-dialog>
     </div>
-  </div>
+  </template-page>
 </template>
 
 <script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+// import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+
 import Mixin from '@/mixin/index'
-import Pagination from '@/components/Pagination'
+// import Pagination from '@/components/Pagination'
 import {
   getDictList,
   getTypeList,
@@ -232,13 +102,57 @@ import {
   getWalletRebateSaletypeAdd,
   getWalletRebateSaletypeDelete,
   getWalletRebateSaletypelist,
-  getWalletRebateSaletypeUpdate
+  getWalletRebateSaletypeUpdate,
+  walletRebateSaletypeListV2,
+  walletRebateSaletypeListV2Export
 } from '@/api/policy_list'
 
 export default {
-  mixins: [Mixin],
+  mixins: [],
   data() {
     return {
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '新增',
+              click: () => {}
+            }
+          ]
+        ],
+        [
+          [
+            {
+              name: '批量删除',
+              click: async () => {
+                if (this.recordSelected.length === 0) {
+                  this.$message.error('请选择需要删除的数据')
+                  return
+                }
+                let messengerLevelId = this.recordSelected.map(v => {
+                  return v.messengerLevelId
+                })
+                let params = messengerLevelId
+                await levelDel(params)
+                this.$refs.pageRef.refreshList()
+                this.$message.success('批量删除成功')
+              }
+            }
+          ]
+        ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+
       ids: [],
       walletList: [],
       type: 0, // 0 1
@@ -253,7 +167,7 @@ export default {
         rebateRate: '',
         saleTypeId: '',
         status: '',
-        saleTypeCode:''
+        saleTypeCode: ''
       },
       dataList: [],
       columns: [
@@ -341,6 +255,34 @@ export default {
     }
   },
   methods: {
+    // 列表请求函数
+    getList: walletRebateSaletypeListV2,
+    // 列表导出函数
+    exportList: walletRebateSaletypeListV2Export,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class="operation-btns">
+            {' '}
+            <el-button size="mini" type="text" onClick={async () => {}}>
+              查看
+            </el-button>
+            <el-button size="mini" type="text" onClick={async () => {}}>
+              编辑
+            </el-button>
+          </div>
+        )
+      }
+    },
+
     //
     selectionhangeFn(value) {
       console.log(value)
@@ -366,29 +308,29 @@ export default {
       })
       this.walletList = res.data.records
     },
-    getList() {
-      this.listLoading = true
-      const params = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
-        // mainName: this.screenForm.mainName,
-        saleTypeCode: this.screenForm.saleTypeCode,
-        saleTypeName: this.screenForm.saleTypeName,
-        status: this.screenForm.status
-      }
+    // getList() {
+    //   this.listLoading = true
+    //   const params = {
+    //     pageNum: this.currentPage,
+    //     pageSize: this.pageSize,
+    //     // mainName: this.screenForm.mainName,
+    //     saleTypeCode: this.screenForm.saleTypeCode,
+    //     saleTypeName: this.screenForm.saleTypeName,
+    //     status: this.screenForm.status
+    //   }
 
-      getWalletRebateSaletypelist(params).then(res => {
-        this.dataList = res.data.records
-        this.listTotal = res.data.total
-        this.listLoading = false
-      })
-      // getProductList({
-      //   productCategoryName: "",
-      //   productCategoryNumber: "",
-      // }).then((res) => {
-      //   this.productList = res.data;
-      // });
-    },
+    //   getWalletRebateSaletypelist(params).then(res => {
+    //     this.dataList = res.data.records
+    //     this.listTotal = res.data.total
+    //     this.listLoading = false
+    //   })
+    //   // getProductList({
+    //   //   productCategoryName: "",
+    //   //   productCategoryNumber: "",
+    //   // }).then((res) => {
+    //   //   this.productList = res.data;
+    //   // });
+    // },
 
     handleChange(e) {
       console.log(e, this.typeList)
@@ -532,7 +474,7 @@ export default {
     this.getWalletList()
   },
   components: {
-    Pagination
+    TemplatePage
   }
 }
 </script>

+ 112 - 145
src/views/sales_rebate/rebate_list_type.vue

@@ -1,121 +1,13 @@
 <template>
-  <div class="app-container">
-    <div class="screen-container">
-      <Collapse :screen-form="screenForm">
-        <template #right_btn>
-          <el-button type="primary" size="mini" icon="el-icon-search" @click="submitScreenForm">查询</el-button>
-          <el-button type="primary" size="mini" @click="resetScreenForm">重置</el-button>
-        </template>
-        <template #search>
-          <el-form ref="screenForm" :model="screenForm" size="mini" label-width="100px" label-position="left">
-            <el-row :gutter="20">
-              <el-col :xs="24" :ms="6" :lg="6">
-                <el-form-item label="返利类型" prop="name">
-                  <el-input v-model="screenForm.name" placeholder="请输入返利类型" size="mini"></el-input>
-                </el-form-item>
-              </el-col>
-
-              <!-- <el-col :xs="24" :ms="6" :lg="6">
-                <el-form-item prop="status">
-                  <el-select
-                    v-model="screenForm.status"
-                    placeholder="请选择"
-                    size="small"
-                  >
-                    <el-option
-                      v-for="item in options"
-                      :key="item.value"
-                      :label="item.label"
-                      :value="item.value"
-                    >
-                    </el-option>
-                  </el-select>
-                </el-form-item>
-              </el-col> -->
-            </el-row>
-          </el-form>
-        </template>
-      </Collapse>
-      <el-button
-        type="primary"
-        size="mini"
-        icon="el-icon-plus"
-        v-if="$checkBtnRole('add', $route.meta.roles)"
-        @click=";(dialogVisible = true), (type = 1), getDictList()"
-        >新增</el-button
-      >
-    </div>
-
-    <div class="mymain-container">
-      <div class="table">
-        <el-table
-          v-loading="listLoading"
-          :data="dataList"
-          element-loading-text="Loading"
-          border
-          fit
-          highlight-current-row
-          stripe
-        >
-          <el-table-column type="selection" width="55" align="center"> </el-table-column>
-          <template v-for="col in columns">
-            <el-table-column
-              align="left"
-              :label="col.lable"
-              :prop="col.prop"
-              :min-width="col.widht"
-              show-overflow-tooltip
-              v-if="col.prop == 'status'"
-            >
-              <template slot-scope="scope">
-                <el-switch
-                  v-model="scope.row.status"
-                  @change="handleSwitch($event, scope.row.walletRebateId)"
-                  :active-text="scope.row.status ? '已启用' : '已禁用'"
-                >
-                </el-switch>
-              </template>
-            </el-table-column>
-            <el-table-column
-              v-else
-              align="left"
-              :label="col.lable"
-              :prop="col.prop"
-              :min-width="col.widht"
-              show-overflow-tooltip
-            >
-            </el-table-column>
-          </template>
-
-          <el-table-column align="center" fixed="right" label="操作" min-width="160">
-            <template slot-scope="scope">
-              <el-button type="text" size="small" @click="hanleDateil(scope.row)">查看</el-button>
-              <el-button
-                type="text"
-                size="small"
-                @click="hanleEdit(scope.row)"
-                v-if="$checkBtnRole('edit', $route.meta.roles)"
-                >编辑</el-button
-              >
-              <!-- <el-button type="text" size="small">编辑</el-button> -->
-            </template>
-          </el-table-column>
-        </el-table>
-      </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>
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :operation="operation()"
+    :optionsEvensGroup="optionsEvensGroup"
+    :columnParsing="columnParsing"
+    :tableAttributes="tableAttributes"
+    :tableEvents="tableEvents"
+  >
     <div>
       <el-dialog
         v-loading="addLoading"
@@ -163,18 +55,48 @@
         </template>
       </el-dialog>
     </div>
-  </div>
+  </template-page>
 </template>
 
 <script>
-import Mixin from '@/mixin/index'
-import Pagination from '@/components/Pagination'
-import { addWallet, getDictList, getTypeList, getWalletList, updateWallet } from '@/api/policy_list'
+import TemplatePage from '@/components/template/template-page-1.vue'
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+
+// import Mixin from '@/mixin/index'
+// import Pagination from '@/components/Pagination'
+import { addWallet, getDictList, getTypeList, getWalletList, updateWallet, walletRebateListV2 } from '@/api/policy_list'
 
 export default {
-  mixins: [Mixin],
+  mixins: [add_callback_mixin],
   data() {
     return {
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '新增',
+              click: () => {
+                this.dialogVisible = true
+                this.type = 1
+                this.getDictList()
+              },
+              isRole: this.$checkBtnRole('add', this.$route.meta.roles)
+            }
+          ]
+        ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: false
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+
       addLoading: false,
       listLoading: false,
       type: 0, // 0 1
@@ -184,6 +106,7 @@ export default {
         saleTypeName: '',
         status: ''
       },
+      dialogVisible: false,
       dialogForm: {
         name: ''
         // mainName: "",
@@ -260,30 +183,74 @@ export default {
     }
   },
   methods: {
-    getList() {
-      this.listLoading = true
-      const params = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
-        name: this.screenForm.name,
-        // saleTypeCode: this.screenForm.saleTypeCode,
-        // saleTypeName: this.screenForm.saleTypeName,
-        status: this.screenForm.status
-      }
+    // 列表请求函数
+    getList: walletRebateListV2,
+    // 列表导出函数
+    // exportList: exportLevelList,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class="operation-btns">
+            {this.$checkBtnRole('edit', this.$route.meta.roles) ? (
+              <el-button
+                size="mini"
+                type="text"
+                onClick={async () => {
+                  this.hanleEdit(row)
+                }}
+              >
+                编辑
+              </el-button>
+            ) : (
+              ''
+            )}
 
-      getWalletList(params).then(res => {
-        this.dataList = res.data.records
-        this.listTotal = res.data.total
-        this.listLoading = false
-      })
-      // getProductList({
-      //   productCategoryName: "",
-      //   productCategoryNumber: "",
-      // }).then((res) => {
-      //   this.productList = res.data;
-      // });
+            <el-button
+              size="mini"
+              type="text"
+              onClick={async () => {
+                this.hanleDateil(row)
+              }}
+            >
+              查看
+            </el-button>
+          </div>
+        )
+      }
     },
 
+    // getList() {
+    //   this.listLoading = true
+    //   const params = {
+    //     pageNum: this.currentPage,
+    //     pageSize: this.pageSize,
+    //     name: this.screenForm.name,
+    //     // saleTypeCode: this.screenForm.saleTypeCode,
+    //     // saleTypeName: this.screenForm.saleTypeName,
+    //     status: this.screenForm.status
+    //   }
+
+    //   getWalletList(params).then(res => {
+    //     this.dataList = res.data.records
+    //     this.listTotal = res.data.total
+    //     this.listLoading = false
+    //   })
+    //   // getProductList({
+    //   //   productCategoryName: "",
+    //   //   productCategoryNumber: "",
+    //   // }).then((res) => {
+    //   //   this.productList = res.data;
+    //   // });
+    // },
+
     handleChange(e) {
       console.log(e, this.typeList)
 
@@ -409,7 +376,7 @@ export default {
       }
       // this.$refs.dialogForm.resetFields()
       this.dialogVisible = false
-      this.getList()
+      this.$refs.pageRef.refreshList()
     },
     hanleCancel() {
       // this.type = "";
@@ -427,7 +394,7 @@ export default {
     }
   },
   components: {
-    Pagination
+    TemplatePage
   }
 }
 </script>

+ 139 - 156
src/views/sales_rebate/salestype_list.vue

@@ -1,133 +1,17 @@
 <template>
-  <div class="app-container">
-    <div class="screen-container">
-      <Collapse :screen-form="screenForm">
-        <template #right_btn>
-          <el-button type="primary" size="mini" @click="submitScreenForm">搜索</el-button>
-          <el-button type="primary" size="mini" @click="resetScreenForm">清空</el-button>
-        </template>
-        <template #search>
-          <el-form ref="screenForm" :model="screenForm" size="mini" label-position="left" label-width="120px">
-            <el-row :gutter="20">
-              <el-col :xs="24" :ms="6" :lg="6">
-                <el-form-item prop="saleCode" label="销售类型编码">
-                  <el-input v-model="screenForm.saleCode" placeholder="销售类型编码" size="small"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :ms="6" :lg="6">
-                <el-form-item prop="saleName" label="销售类型名称">
-                  <el-input v-model="screenForm.saleName" placeholder="销售类型名称" size="small"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :ms="6" :lg="6">
-                <el-form-item prop="status" label="状态">
-                  <el-select v-model="screenForm.status" placeholder="状态" size="small">
-                    <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
-                    </el-option>
-                  </el-select>
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </el-form>
-        </template>
-      </Collapse>
-    </div>
-    <div class="btn-group clearfix">
-      <div class="fl">
-        <el-button
-          type="primary"
-          size="mini"
-          v-if="$checkBtnRole('add', $route.meta.roles)"
-          @click=";(dialogVisible = true), (type = 1)"
-          >新增</el-button
-        >
-      </div>
-      <div class="fr">
-        <ExportButton :exUrl="'sale/type/export'" :exParams="exParams" />
-      </div>
-    </div>
-    <div class="mymain-container">
-      <div class="table">
-        <el-table
-          v-loading="listLoading"
-          :data="dataList"
-          element-loading-text="Loading"
-          border
-          fit
-          highlight-current-row
-          stripe
-        >
-          <el-table-column type="selection" width="55" align="center"> </el-table-column>
-          <template v-for="col in columns">
-            <el-table-column
-              align="left"
-              :label="col.lable"
-              :prop="col.prop"
-              :min-width="col.widht"
-              show-overflow-tooltip
-              v-if="col.prop == 'status'"
-            >
-              <template slot-scope="scope">
-                <div style="z-index: 99">
-                  <el-switch
-                    v-model="scope.row.status"
-                    @change="handleSwitch($event, scope.row.id)"
-                    :active-text="scope.row.status ? '已启用' : '已禁用'"
-                  >
-                  </el-switch>
-                </div>
-              </template>
-            </el-table-column>
-            <el-table-column
-              v-else
-              align="left"
-              :label="col.lable"
-              :prop="col.prop"
-              :min-width="col.widht"
-              show-overflow-tooltip
-            >
-            </el-table-column>
-          </template>
-
-          <el-table-column align="center" fixed="right" label="操作" min-width="160">
-            <template slot-scope="scope">
-              <el-button
-                type="text"
-                size="small"
-                @click="hanleEdit(scope.row)"
-                v-if="$checkBtnRole('edit', $route.meta.roles)"
-                >编辑</el-button
-              >
-              <!-- <el-button type="text" size="small" @click="hanleDateil(scope.row)">详情</el-button> -->
-              <el-popconfirm
-                title="这是一段内容确定删除吗?"
-                style="margin-left: 10px"
-                v-if="$checkBtnRole('del', $route.meta.roles)"
-                @onConfirm="hanleDatele(scope.row.id)"
-              >
-                <el-button slot="reference" type="text" size="small">删除</el-button>
-              </el-popconfirm>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <!-- 分页 -->
-      <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>
-    </div>
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :operation="operation()"
+    :optionsEvensGroup="optionsEvensGroup"
+    :exportList="exportList"
+    :columnParsing="columnParsing"
+    :tableAttributes="tableAttributes"
+    :tableEvents="tableEvents"
+  >
     <div>
       <el-dialog :visible.sync="dialogVisible" width="50%" @close="resetForm" :close-on-click-modal="false">
-        <el-form ref="dialogForm" :model="dialogForm" :rules="type == 1 ? rules : ''" label-width="120px" size="normal">
+        <el-form ref="dialogForm" :model="dialogForm" :rules="type == 1 ? rules : {}" label-width="120px" size="normal">
           <el-form-item label="销售类型编码" prop="saleCode">
             <el-input v-model="dialogForm.saleCode"></el-input>
           </el-form-item>
@@ -163,18 +47,55 @@
         </span>
       </el-dialog>
     </div>
-  </div>
+  </template-page>
 </template>
 
 <script>
-import Mixin from '@/mixin/index'
-import Pagination from '@/components/Pagination'
-import { addData, delTypeData, getProductList, getTypeList, updateType } from '@/api/policy_list'
+import TemplatePage from '@/components/template/template-page-1.vue'
+// import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+
+// import Mixin from '@/mixin/index'
+// import Pagination from '@/components/Pagination'
+import {
+  addData,
+  delTypeData,
+  getProductList,
+  getTypeList,
+  updateType,
+  saleTypeRebateListV2,
+  saleTypeRebateListV2Export
+} from '@/api/policy_list'
 
 export default {
-  mixins: [Mixin],
+  mixins: [],
   data() {
     return {
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '新增',
+              click: () => {
+                this.dialogVisible = true
+                this.type = 1
+              },
+              isRole: this.$checkBtnRole('add', this.$route.meta.roles)
+            }
+          ]
+        ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: false
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+
       type: 0, // 0,1
       screenForm: {
         saleCode: '',
@@ -182,6 +103,7 @@ export default {
         mainId: '',
         status: ''
       },
+      dialogVisible: false,
       dialogForm: {
         id: '',
         saleCode: '',
@@ -269,28 +191,77 @@ export default {
   },
 
   methods: {
-    getList() {
-      this.listLoading = true
-      const params = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
-        saleCode: this.screenForm.saleCode,
-        saleName: this.screenForm.saleName,
-        mainId: '',
-        status: this.screenForm.status
+    // 列表请求函数
+    getList: saleTypeRebateListV2,
+    // 列表导出函数
+    exportList: saleTypeRebateListV2Export,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class="operation-btns">
+            {this.$checkBtnRole('edit', this.$route.meta.roles) ? (
+              <el-button
+                size="mini"
+                type="text"
+                onClick={async () => {
+                  this.hanleEdit(row)
+                }}
+              >
+                编辑
+              </el-button>
+            ) : (
+              ''
+            )}
+
+            {this.$checkBtnRole('del', this.$route.meta.roles) ? (
+              <el-popconfirm
+                onOnConfirm={async () => {
+                  this.hanleDatele(row.id)
+                }}
+                title="是否确定需要删除该项内容?"
+              >
+                <el-button slot="reference" size="mini" type="text">
+                  删除
+                </el-button>
+              </el-popconfirm>
+            ) : (
+              ''
+            )}
+          </div>
+        )
       }
-      getTypeList(params).then(res => {
-        this.dataList = res.data.records
-        this.listTotal = res.data.total
-        this.listLoading = false
-      })
-      getProductList({
-        productCategoryName: '',
-        productCategoryNumber: ''
-      }).then(res => {
-        this.productList = res.data
-      })
     },
+
+    // getList() {
+    //   this.listLoading = true
+    //   const params = {
+    //     pageNum: this.currentPage,
+    //     pageSize: this.pageSize,
+    //     saleCode: this.screenForm.saleCode,
+    //     saleName: this.screenForm.saleName,
+    //     mainId: '',
+    //     status: this.screenForm.status
+    //   }
+    //   getTypeList(params).then(res => {
+    //     this.dataList = res.data.records
+    //     this.listTotal = res.data.total
+    //     this.listLoading = false
+    //   })
+    //   getProductList({
+    //     productCategoryName: '',
+    //     productCategoryNumber: ''
+    //   }).then(res => {
+    //     this.productList = res.data
+    //   })
+    // },
     handleChange(e) {
       this.productList.find(k => {
         if (k.productCategoryNumber == e) {
@@ -307,17 +278,28 @@ export default {
           id: ids[0]
         }).then(res => {
           this.$successMsg('删除成功')
-          this.getList()
+          this.$refs.pageRef.refreshList()
+          // this.getList()
         })
       })
     },
+    hanleDeleteAllPromise(id) {
+      return new Promise((resolve, reject) => {
+        const ids = id ? [id] : this.ids
+        if (!ids.length) {
+          this.$errorMsg('请选择删除内容')
+          return
+        }
+        resolve(ids)
+      })
+    },
     hanleEdit(item) {
       this.dialogForm = {
         id: item.id,
         saleCode: item.saleCode,
         saleName: item.saleName,
         mainName: item.mainName,
-        status: item.status
+        status: item.status === '有效' ? true : false
       }
       this.type = 0
       this.dialogVisible = true
@@ -383,11 +365,12 @@ export default {
       }
       // this.$refs.dialogForm.resetFields()
       this.dialogVisible = false
-      this.getList()
+      // this.getList()
+      this.$refs.pageRef.refreshList()
     }
   },
   components: {
-    Pagination
+    TemplatePage
   }
 }
 </script>

+ 205 - 0
src/views/setting/components/addDataDictionary.vue

@@ -0,0 +1,205 @@
+<template>
+  <el-dialog
+    title="数据字典"
+    :visible.sync="dialogVisible"
+    width="460px"
+    :before-close="handleClose"
+    :destroy-on-close="true"
+  >
+    <el-form
+      v-if="visible"
+      size="mini"
+      :model="ruleForm"
+      :rules="rules"
+      ref="ruleForm"
+      label-width="100px"
+      class="demo-ruleForm"
+    >
+      <el-form-item label="父字典类型" prop="parentDictType">
+        <el-select v-model="ruleForm.parentDictType" placeholder="请选择" style="width: 100%" @change="updatedata">
+          <el-option
+            v-for="(item, index) in typeList"
+            :key="index"
+            :label="item.remark"
+            :value="item.dictType"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="父字典值" prop="parentDictCode">
+        <el-select v-model="ruleForm.parentDictCode" placeholder="请选择" style="width: 100%">
+          <el-option
+            v-for="(item, index) in parentDict"
+            :key="index"
+            :label="item.dictValue"
+            :value="item.dictCode"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="父字典编码" prop="parentDictCode">
+        <el-input
+          :disabled="true"
+          :value="
+            ruleForm.parentDictCode
+              ? (parentDict.find(item => item.dictCode === ruleForm.parentDictCode) || {}).dictCode
+              : ''
+          "
+        ></el-input>
+      </el-form-item>
+      <el-form-item label="字典类型" prop="dictType">
+        <el-select v-model="ruleForm.dictType" placeholder="请选择" style="width: 100%">
+          <el-option
+            v-for="(item, index) in typeList"
+            :key="index"
+            :label="item.remark"
+            :value="item.dictType"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="字典值" prop="dictValue">
+        <el-input v-model="ruleForm.dictValue"></el-input>
+      </el-form-item>
+      <el-form-item label="字典编码" prop="dictCode">
+        <el-input v-model="ruleForm.dictCode"></el-input>
+      </el-form-item>
+      <el-form-item label="排序">
+        <el-input v-model="ruleForm.sortNum"></el-input>
+      </el-form-item>
+      <el-form-item label="说明">
+        <el-input v-model="ruleForm.remark"></el-input>
+      </el-form-item>
+      <el-form-item label="状态" prop="status">
+        <el-switch
+          v-model="ruleForm.status"
+          active-value="ON"
+          inactive-value="OFF"
+          active-color="#13ce66"
+          inactive-color="#ff4949"
+        >
+        </el-switch>
+      </el-form-item>
+      <el-form-item>
+        <el-button size="mini" type="primary" @click="submitForm('ruleForm')">确定</el-button>
+        <el-button size="mini" @click="resetForm('ruleForm')">取消</el-button>
+      </el-form-item>
+    </el-form>
+  </el-dialog>
+</template>
+
+<script>
+import {
+  dictTypeList,
+  dictDetail,
+  addDataDictionary,
+  updateDataDictionary,
+  dictListDict
+} from '@/api/dataDictionary2.js'
+export default {
+  props: {
+    item: {
+      type: Object,
+      default: null
+    },
+    visible: {
+      type: Boolean,
+      default: false
+    }
+  },
+  data() {
+    return {
+      dialogVisible: this.visible,
+      typeList: [],
+      parentDict: [],
+      ruleForm: {
+        dictValue: '',
+        dictCode: '',
+        dictType: '',
+        parentDictCode: '',
+        parentDictType: '',
+        sortNum: '',
+        remark: '',
+        status: 'ON'
+      },
+      rules: {
+        dictValue: [{ required: true, message: '必填', trigger: 'blur' }],
+        dictCode: [{ required: true, message: '必填', trigger: 'blur' }],
+        dictType: [{ required: true, message: '必填', trigger: 'blur' }],
+        status: [{ required: true, message: '必填', trigger: 'blur' }]
+      }
+    }
+  },
+  watch: {
+    item() {
+      if (this.item !== null) {
+        dictDetail({ id: this.item.sysDictId }).then(res => {
+          for (var key in this.ruleForm) {
+            this.ruleForm[key] = res.data[key]
+            if (key === 'parentDictType' && res.data[key]) {
+              this.updatedata('nolo')
+            }
+          }
+        })
+      }
+    },
+    visible() {
+      if (this.visible) {
+        dictTypeList().then(res => {
+          this.typeList = res.data
+        })
+      }
+      this.dialogVisible = this.visible
+    },
+    dialogVisible() {
+      this.$emit('setVisible', this.dialogVisible)
+      if (!this.dialogVisible) {
+        this.$nextTick(() => {
+          Object.assign(this.$data, this.$options.data())
+        })
+      }
+    }
+  },
+  methods: {
+    updatedata(type) {
+      if (type !== 'nolo') {
+        this.ruleForm.parentDictCode = ''
+      }
+      if (this.ruleForm.parentDictType) {
+        dictListDict({ dictType: this.ruleForm.parentDictType }).then(res => {
+          this.parentDict = res.data
+        })
+      }
+    },
+    handleClose(done) {
+      done()
+    },
+    submitForm(formName) {
+      this.$refs[formName].validate(valid => {
+        if (valid) {
+          ;[addDataDictionary, updateDataDictionary]
+            [this.item ? 1 : 0]({
+              ...this.ruleForm,
+              sysDictId: this.item ? this.item.sysDictId : undefined
+            })
+            .then(res => {
+              this.$emit('success')
+              this.$message({
+                type: 'success',
+                message: `保存成功!`
+              })
+              this.dialogVisible = false
+            })
+            .catch(err => {
+              console.log(err)
+            })
+        } else {
+          return false
+        }
+      })
+    },
+    resetForm(formName) {
+      this.dialogVisible = false
+    }
+  }
+}
+</script>
+
+<style></style>

+ 138 - 0
src/views/setting/dataDictionary.vue

@@ -0,0 +1,138 @@
+<template>
+  <!-- :exportList="exportList" -->
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :columnParsing="columnParsing"
+    :optionsEvensGroup="optionsEvensGroup"
+    :tableAttributes="tableAttributes"
+    :tableEvents="tableEvents"
+    :operationColumnWidth="200"
+    :operation="operation()"
+  >
+    <AddDataDictionary
+      :visible="visible"
+      :item="item"
+      @setVisible="
+        bool => {
+          visible = bool
+          if (!bool && item) {
+            item = null
+          }
+        }
+      "
+      @success="
+        () => {
+          $refs.pageRef.refreshList()
+        }
+      "
+    />
+  </template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import AddDataDictionary from './components/addDataDictionary.vue'
+import { getDataDictionaryExport, getDataDictionary, delDataDictionary } from '@/api/dataDictionary2.js'
+export default {
+  components: {
+    TemplatePage,
+    AddDataDictionary
+  },
+  data() {
+    return {
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '新增',
+              click: () => {
+                this.visible = true
+              }
+            }
+          ]
+        ]
+      ],
+      // 表格属性
+      tableAttributes: {},
+      // 表格事件
+      tableEvents: {},
+      visible: false,
+      item: null
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList: getDataDictionary,
+    // 列表导出函数
+    exportList: getDataDictionaryExport,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    operation() {
+      if (true) {
+        return (h, { row, index, column }) => {
+          return (
+            <div class="operation-btns">
+              {true ? (
+                <zj-button
+                  useLoading={false}
+                  parameter={[row]}
+                  buttonAttributes={{
+                    size: 'mini',
+                    type: 'primary'
+                  }}
+                  buttonEvents={{
+                    click: (...p) => {
+                      var [row] = p
+                      this.item = row
+                      this.visible = true
+                    }
+                  }}
+                >
+                  编辑
+                </zj-button>
+              ) : null}
+              {true ? (
+                <el-popconfirm
+                  icon="el-icon-info"
+                  icon-color="red"
+                  title="这是一段内容确定删除吗?"
+                  onConfirm={() => {
+                    delDataDictionary({ id: row.sysDictId })
+                      .then(res => {
+                        this.$refs.pageRef.refreshList()
+                        this.$message({
+                          type: 'success',
+                          message: `删除成功!`
+                        })
+                      })
+                      .catch(err => {
+                        console.log(err)
+                      })
+                  }}
+                >
+                  <zj-button
+                    slot="reference"
+                    buttonAttributes={{
+                      size: 'mini',
+                      type: 'danger'
+                    }}
+                  >
+                    删除
+                  </zj-button>
+                </el-popconfirm>
+              ) : null}
+            </div>
+          )
+        }
+      }
+      return undefined
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 93 - 14
src/views/supply/deliver/sum_list.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <div v-if="isShow ===1">
+    <div v-if="isShow === 1">
       <!-- 筛选条件 -->
       <div class="screen-container">
         <Collapse :screen-form="screenForm">
@@ -36,7 +36,7 @@
                     <el-date-picker
                       v-model="screenForm.createDate"
                       type="datetimerange"
-:default-time="['00:00:00','23:59:59']"
+                      :default-time="['00:00:00', '23:59:59']"
                       range-separator="至"
                       style="width: 100%"
                       value-format="yyyy-MM-dd HH:mm:ss"
@@ -50,7 +50,7 @@
                     <el-date-picker
                       v-model="screenForm.deliverDate"
                       type="datetimerange"
-:default-time="['00:00:00','23:59:59']"
+                      :default-time="['00:00:00', '23:59:59']"
                       range-separator="至"
                       style="width: 100%"
                       value-format="yyyy-MM-dd HH:mm:ss"
@@ -147,7 +147,7 @@
                     <el-date-picker
                       v-model="screenForm.approvaTime"
                       type="datetimerange"
-:default-time="['00:00:00','23:59:59']"
+                      :default-time="['00:00:00', '23:59:59']"
                       range-separator="至"
                       style="width: 100%"
                       value-format="yyyy-MM-dd HH:mm:ss"
@@ -239,7 +239,7 @@
               >打印发货单
             </el-button>
             <div v-if="totalNum" class="num">当前列表总发货数量:{{ totalNum.invoiceNumber }}</div>
-            <div v-if="totalNum" class="num">总含税金额:{{ totalNum.payAmount |toThousandFilter }}</div>
+            <div v-if="totalNum" class="num">总含税金额:{{ totalNum.payAmount | toThousandFilter }}</div>
           </div>
           <!--  -->
           <div class="fr" style="display: flex">
@@ -727,8 +727,8 @@
         </div>
       </div>
     </div>
-    <apply-return-form v-if="isShow ===2" @backListFormDetail="backList"/>
-    <engin-return-form v-if="isShow ===3" @backListFormDetail="backList"/>
+    <apply-return-form v-if="isShow === 2" @backListFormDetail="backList" />
+    <engin-return-form v-if="isShow === 3" @backListFormDetail="backList" />
     <print-preview ref="preView" />
 
     <el-dialog
@@ -782,24 +782,40 @@
       </span>
     </el-dialog>
   </div>
+  <!-- <template-page
+    ref="pageRef"
+    :getList="getList"
+    :operation="operation()"
+    :optionsEvensGroup="optionsEvensGroup"
+    :exportList="exportList"
+    :columnParsing="columnParsing"
+    :tableAttributes="tableAttributes"
+    :tableEvents="tableEvents"
+  >
+  </template-page> -->
 </template>
 
 <script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import Popu from '@/components/template/popu.vue'
+
 import { getSumList } from '@/api/supply/deliver'
 import print from '@/mixin/print'
 import { checkPassword, getListInvoiceNumber } from '@/api/supply/pickup'
 import { getCategoryList, getSalesmanList } from '@/api/common'
 import SumPrint from '@/views/supply/deliver/components/sum_print'
 import { getWarehouseList } from '@/api/supply/apply'
-import ApplyReturnForm from './components/apply_return_form.vue';
-import EnginReturnForm from './components/engin_return_form.vue';
+import ApplyReturnForm from './components/apply_return_form.vue'
+import EnginReturnForm from './components/engin_return_form.vue'
 import printPreview from './components/design/preview.vue'
 export default {
   components: {
     SumPrint,
     ApplyReturnForm,
     EnginReturnForm,
-    printPreview
+    printPreview,
+    TemplatePage,
+    Popu
   },
   filters: {
     orderTypeFilter(val) {
@@ -823,6 +839,45 @@ export default {
   mixins: [print],
   data() {
     return {
+      // 事件组合
+      // optionsEvensGroup: [
+      //   [
+      //     [
+      //       {
+      //         name: '打印发货单',
+      //         click: () => {}
+      //       }
+      //     ]
+      //   ],
+      //   [
+      //     [
+      //       {
+      //         name: '零售退货申请',
+      //         click: () => {}
+      //       }
+      //     ]
+      //   ],
+      //   [
+      //     [
+      //       {
+      //         name: '工程退货申请',
+      //         click: () => {}
+      //       }
+      //     ]
+      //   ],
+
+      // ],
+      // // 表格属性
+      // tableAttributes: {
+      //   // 启用勾选列
+      //   selectColumn: true
+      // },
+      // // 表格事件
+      // tableEvents: {
+      //   'selection-change': this.selectionChange
+      // },
+      // recordSelected: [],
+
       currentPage: 1, // 当前页码
       pageSize: 10, // 每页数量
       listTotal: 0, // 列表总数
@@ -897,7 +952,7 @@ export default {
       checkAll: false,
       isCollapse: true,
       isIndeterminate: false,
-      isShow:1
+      isShow: 1
     }
   },
   computed: {
@@ -967,6 +1022,30 @@ export default {
     this.initPrint()
   },
   methods: {
+    // 列表请求函数
+    // getList: levelList,
+    // 列表导出函数
+    // exportList: exportLevelList,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class="operation-btns">
+            <el-button size="mini" type="text" onClick={async () => {}}>
+              详情
+            </el-button>
+          </div>
+        )
+      }
+    },
+
     handleFilterData() {
       this.dialogVisible = true
     },
@@ -1108,7 +1187,7 @@ export default {
 
     // 重置筛选表单
     resetScreenForm() {
-        this.$refs.screenForm.resetFields()
+      this.$refs.screenForm.resetFields()
       this.currentPage = 1
       this.getList()
     },
@@ -1198,8 +1277,8 @@ export default {
       return currentdate
     },
 
-    backList(){
-      this.isShow =1
+    backList() {
+      this.isShow = 1
     }
   }
 }

+ 4 - 6
src/views/supply/engin/components/engin_detail.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="detail-container">
-    <el-page-header @back="goBack" content="详情"></el-page-header>
+    <!-- <el-page-header @back="goBack" content="详情"></el-page-header> -->
 
     <div class="main-title">
       <div class="title">工程信息单</div>
@@ -253,9 +253,8 @@
           @click="overData"
           v-if="!isDealer"
           :disabled="detailData.examineStatus !== 'OK' || detailData.directTransferStatus"
-        >直调完结
-        </el-button
-        >
+          >直调完结
+        </el-button>
         <el-button @click="goBack">返回列表</el-button>
       </div>
     </div>
@@ -345,8 +344,7 @@ export default {
             this.getDetail()
           })
         })
-        .catch(() => {
-        })
+        .catch(() => {})
     }
   }
 }

+ 1 - 1
src/views/supply/engin/components/engin_examine.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="detail-container">
-    <el-page-header content="审批" @back="goBack" />
+    <!-- <el-page-header content="审批" @back="goBack" /> -->
 
     <div class="main-title">
       <div class="title">工程信息单</div>

+ 2 - 2
src/views/supply/engin/components/engin_form.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="detail-container">
-    <el-page-header :content="listItem ? '编辑' : '新增'" @back="goBack" />
+    <!-- <el-page-header :content="listItem ? '编辑' : '新增'" @back="goBack" /> -->
 
     <div class="main-title">
       <div class="title">工程信息单</div>
@@ -906,7 +906,7 @@ export default {
               return
             }
 
-            console.log(this.goodsList[i].qty );
+            console.log(this.goodsList[i].qty)
             if (this.goodsList[i].qty == null || this.goodsList[i].qty === '' || Number(this.goodsList[i].qty) < 0) {
               this.$errorMsg('数量不能为空或者小于0')
 

+ 278 - 561
src/views/supply/engin/engin_list.vue

@@ -1,482 +1,40 @@
 <template>
-  <div class="app-container">
-    <div v-show="!isShowDetail && !isShowForm && !isShowExamine">
-      <!-- 筛选条件 -->
-      <div class="screen-container">
-        <Collapse :screen-form="screenForm">
-          <template #right_btn>
-            <el-button size="mini" @click="resetScreenForm">清空</el-button>
-            <el-button size="mini" type="primary" @click="submitScreenForm">搜索</el-button>
-          </template>
-          <template #left_btn>
-            <el-radio-group size="mini" v-model="screenForm.examineStatus" @change="getList">
-              <el-radio-button label="">全部</el-radio-button>
-              <el-radio-button v-for="(item, index) in statusList" :key="index" :label="item.value"
-                >{{ item.label }}
-              </el-radio-button>
-            </el-radio-group>
-          </template>
-          <template #search>
-            <el-form ref="screenForm" :model="screenForm" label-width="100px" size="mini" label-position="left">
-              <el-row :gutter="20">
-                <el-col :xs="24" :sm="12" :lg="6">
-                  <el-form-item label="工程登录编号" prop="orderNum">
-                    <el-input v-model="screenForm.orderNum" placeholder="请输入工程登录编号"></el-input>
-                  </el-form-item>
-                </el-col>
-                <el-col :xs="24" :sm="12" :lg="6">
-                  <el-form-item label="工程编码" prop="enginNum">
-                    <el-input v-model="screenForm.enginNum" placeholder="请输入工程编码"></el-input>
-                  </el-form-item>
-                </el-col>
-                <!-- <el-col :xs="24" :sm="12" :lg="6">
-                  <el-form-item label="工程登录编号" prop="loginNum">
-                    <el-input v-model="screenForm.loginNum" placeholder="请输入工程登录编号"></el-input>
-                  </el-form-item>
-                </el-col> -->
-                <el-col :xs="24" :sm="12" :lg="6">
-                  <el-form-item label="项目名称" prop="enginName">
-                    <el-input v-model="screenForm.enginName" placeholder="请输入项目名称"></el-input>
-                  </el-form-item>
-                </el-col>
-                <el-col :xs="24" :sm="12" :lg="6">
-                  <el-form-item label="单据日期" prop="date">
-                    <el-date-picker
-                      v-model="screenForm.orderDate"
-                      type="datetimerange"
-                      :default-time="['00:00:00', '23:59:59']"
-                      range-separator="至"
-                      style="width: 100%"
-                      value-format="yyyy-MM-dd HH:mm:ss"
-                      start-placeholder="开始日期"
-                      end-placeholder="结束日期"
-                    >
-                    </el-date-picker>
-                  </el-form-item>
-                </el-col>
-                <el-col :xs="24" :sm="12" :lg="6">
-                  <el-form-item label="经销商" prop="dealer">
-                    <el-input v-model="screenForm.dealer" placeholder="请输入经销商"></el-input>
-                  </el-form-item>
-                </el-col>
-                <el-col :xs="24" :sm="12" :lg="6">
-                  <el-form-item label="使用单位" prop="company">
-                    <el-input v-model="screenForm.company" placeholder="请输入使用单位"></el-input>
-                  </el-form-item>
-                </el-col>
-                <el-col :xs="24" :sm="12" :lg="6">
-                  <el-form-item label="制表人" prop="createMan">
-                    <el-input v-model="screenForm.createMan" placeholder="请输入制表人"></el-input>
-                  </el-form-item>
-                </el-col>
-                <el-col :xs="24" :sm="12" :lg="6">
-                  <el-form-item label="审核人" prop="examineMan">
-                    <el-input v-model="screenForm.examineMan" placeholder="请输入审核人"></el-input>
-                  </el-form-item>
-                </el-col>
-                <el-col :xs="24" :sm="12" :lg="6">
-                  <el-form-item label="业务员" prop="salesMan">
-                    <el-select
-                      v-model="screenForm.salesMan"
-                      placeholder="选择业务员"
-                      clearable
-                      filterable
-                      style="width: 100%"
-                    >
-                      <el-option
-                        v-for="item in salesmanList"
-                        :key="item.adminUserId"
-                        :label="item.nickName"
-                        :value="item.adminUserId"
-                      >
-                      </el-option>
-                    </el-select>
-                  </el-form-item>
-                </el-col>
-                <el-col :xs="24" :sm="12" :lg="6">
-                  <el-form-item label="规格型号" prop="model">
-                    <el-input v-model="screenForm.model" placeholder="请输入规格型号"></el-input>
-                  </el-form-item>
-                </el-col>
-                <el-col :xs="24" :sm="12" :lg="6">
-                  <el-form-item label="是否直调" prop="isDirectTransfer">
-                    <el-select
-                      v-model="screenForm.isDirectTransfer"
-                      placeholder="选择是否直"
-                      clearable
-                      style="width: 100%"
-                    >
-                      <el-option :value="null" label="默认"></el-option>
-                      <el-option v-for="item in transfer" :key="item.value" :label="item.label" :value="item.value">
-                      </el-option>
-                    </el-select>
-                  </el-form-item>
-                </el-col>
-                <el-col :xs="24" :sm="12" :lg="6">
-                  <el-form-item label="是否关闭" prop="isClose">
-                    <el-select v-model="screenForm.isClose" placeholder="是否关闭" clearable style="width: 100%">
-                      <el-option label="是" :value="true"> </el-option>
-                      <el-option label="否" :value="false"> </el-option>
-                    </el-select>
-                  </el-form-item>
-                </el-col>
-              </el-row>
-            </el-form>
-          </template>
-        </Collapse>
-      </div>
-
-      <div class="mymain-container">
-        <div class="btn-group clearfix">
-          <div class="fl">
-            <el-button
-              v-if="$checkBtnRole('add', $route.meta.roles)"
-              size="mini"
-              type="primary"
-              icon="el-icon-plus"
-              @click="toForm()"
-              >新增
-            </el-button>
-          </div>
-          <div class="fr">
-            <ExportButton :ex-url="'engin-info-order/export'" :ex-params="exParams" />
-          </div>
-        </div>
-        <div class="table">
-          <el-table
-            v-loading="listLoading"
-            :data="dataList"
-            element-loading-text="Loading"
-            border
-            fit
-            highlight-current-row
-            stripe
-            show-summary
-            :summary-method="$getSummaries"
-          >
-            <el-table-column
-              align="left"
-              label="审核状态"
-              sortable
-              prop="examineStatus"
-              min-width="100"
-              show-overflow-tooltip
-            >
-              <template slot-scope="scope">
-                {{ scope.row.examineStatus | statusFilter }}
-              </template>
-            </el-table-column>
-            <!--            <el-table-column align="left" label="数量" sortable prop="qty" min-width="160" show-overflow-tooltip />-->
-            <!--            <el-table-column align="left" label="金额" sortable prop="price" min-width="160" show-overflow-tooltip />-->
-            <el-table-column
-              align="left"
-              label="工程登录编号"
-              sortable
-              prop="enginInfoNo"
-              min-width="150"
-              show-overflow-tooltip
-            >
-              <template slot-scope="scope">
-                <CopyButton :copy-text="scope.row.enginInfoNo" />
-                <span>{{ scope.row.enginInfoNo }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column
-              align="left"
-              label="订单日期"
-              sortable
-              prop="orderDate"
-              min-width="120"
-              show-overflow-tooltip
-            >
-              <template slot-scope="scope">
-                <div>
-                  <span>{{ scope.row.orderDate | dateToDayFilter }}</span>
-                  <el-button
-                    v-if="
-                      $checkBtnRole('date', $route.meta.roles) &&
-                      (scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'WAIT')
-                    "
-                    type="text"
-                    icon="el-icon-edit"
-                    style="padding: 0; margin-left: 6px"
-                    @click="editDate(scope.row)"
-                  />
-                </div>
-              </template>
-            </el-table-column>
-
-            <el-table-column
-              align="left"
-              label="经销商编码"
-              sortable
-              prop="customerNumber"
-              min-width="120"
-              show-overflow-tooltip
-            >
-              <template slot-scope="scope">
-                <CopyButton :copy-text="scope.row.customerNumber" />
-                <span>{{ scope.row.customerNumber }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column
-              align="left"
-              label="经销商名称"
-              sortable
-              prop="customerName"
-              min-width="250"
-              show-overflow-tooltip
-            >
-              <template slot-scope="scope">
-                <CopyButton :copy-text="scope.row.customerName" />
-                <span>{{ scope.row.customerName }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column
-              align="left"
-              label="项目名称"
-              sortable
-              prop="projectName"
-              min-width="160"
-              show-overflow-tooltip
-            />
-            <el-table-column
-              align="left"
-              label="使用单位"
-              sortable
-              prop="useUnit"
-              min-width="160"
-              show-overflow-tooltip
-            />
-            <el-table-column
-              align="left"
-              label="安装地址"
-              sortable
-              prop="installAddress"
-              min-width="160"
-              show-overflow-tooltip
-            />
-            <el-table-column
-              align="left"
-              label="物料编码"
-              sortable
-              prop="materialNumber"
-              min-width="120"
-              show-overflow-tooltip
-            >
-              <template slot-scope="scope">
-                <CopyButton :copy-text="scope.row.materialNumber" />
-                <span>{{ scope.row.materialNumber }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column
-              align="left"
-              label="产品编码"
-              sortable
-              prop="materialOldNumber"
-              min-width="140"
-              show-overflow-tooltip
-            >
-              <template slot-scope="scope">
-                <CopyButton :copy-text="scope.row.materialOldNumber" />
-                <span>{{ scope.row.materialOldNumber }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column
-              align="left"
-              label="产品名称"
-              sortable
-              prop="materialName"
-              min-width="160"
-              show-overflow-tooltip
-            >
-              <template slot-scope="scope">
-                <CopyButton :copy-text="scope.row.materialName" />
-                <span>{{ scope.row.materialName }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column
-              align="left"
-              label="规格型号"
-              sortable
-              prop="specification"
-              min-width="350"
-              show-overflow-tooltip
-            >
-              <template slot-scope="scope">
-                <CopyButton :copy-text="scope.row.specification" />
-                <span>{{ scope.row.specification }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip />
-            <el-table-column align="right" label="数量" prop="qty" min-width="100" sortable show-overflow-tooltip />
-            <el-table-column align="right" label="已订数量" prop="hasOrderQty" min-width="100" show-overflow-tooltip />
-            <el-table-column align="right" label="可订数量" prop="compute_kdQty" min-width="100" show-overflow-tooltip>
-              <template slot-scope="scope">
-                {{ computeAllowQty(scope.row.qty, scope.row.hasOrderQty) }}
-              </template>
-            </el-table-column>
-            <el-table-column
-              align="right"
-              label="出库数量"
-              prop="hasDeliverQty"
-              min-width="100"
-              show-overflow-tooltip
-            />
-            <el-table-column align="right" label="发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip />
-            <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
-              <template slot-scope="scope">
-                {{ scope.row.price | numToFixed }}
-              </template>
-            </el-table-column>
-            <el-table-column
-              align="right"
-              label="金额"
-              prop="totalAmount"
-              min-width="100"
-              sortable
-              show-overflow-tooltip
-            >
-              <template slot-scope="scope">
-                {{ scope.row.totalAmount | numToFixed }}
-              </template>
-            </el-table-column>
-            <el-table-column
-              align="left"
-              label="表体业务员"
-              sortable
-              prop="itemServiceName"
-              min-width="110"
-              show-overflow-tooltip
-            />
-            <el-table-column
-              align="left"
-              label="表头业务员"
-              sortable
-              prop="serviceName"
-              min-width="110"
-              show-overflow-tooltip
-            />
-            <el-table-column align="left" label="备注" sortable prop="remark" min-width="160" show-overflow-tooltip />
-            <el-table-column
-              align="left"
-              label="制表人"
-              sortable
-              prop="createName"
-              min-width="100"
-              show-overflow-tooltip
-            />
-            <el-table-column
-              align="left"
-              label="制表日期"
-              sortable
-              prop="createTime"
-              min-width="160"
-              show-overflow-tooltip
-            />
-            <el-table-column
-              align="left"
-              label="审核人"
-              sortable
-              prop="confirmName"
-              min-width="100"
-              show-overflow-tooltip
-            />
-            <el-table-column
-              align="left"
-              label="审核日期"
-              sortable
-              prop="confirmTime"
-              min-width="160"
-              show-overflow-tooltip
-            />
-            <el-table-column align="left" label="状态" sortable prop="isClose" min-width="160" show-overflow-tooltip>
-              <template v-slot="{ row }">
-                {{ row.isClose ? '关闭' : '启用' }}
-              </template>
-            </el-table-column>
-            <el-table-column align="center" label="操作" width="210" fixed="right">
-              <template slot-scope="scope">
-                <el-popconfirm
-                  v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'SAVE'"
-                  style="margin-right: 10px"
-                  title="确定申请吗?"
-                  @onConfirm="handleSubmit(scope.row.enginInfoId)"
-                >
-                  <el-button slot="reference" type="text">申请</el-button>
-                </el-popconfirm>
-                <el-popconfirm
-                  v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'WAIT'"
-                  style="margin-right: 10px"
-                  title="确定撤回吗?"
-                  @onConfirm="handleWithdraw(scope.row.enginInfoId)"
-                >
-                  <el-button slot="reference" type="text">撤回</el-button>
-                </el-popconfirm>
-                <el-popconfirm
-                  v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'"
-                  style="margin-right: 10px"
-                  title="确定弃审吗?"
-                  @onConfirm="handleAbandon(scope.row.enginInfoId)"
-                >
-                  <el-button slot="reference" type="text">弃审</el-button>
-                </el-popconfirm>
-                <el-button
-                  v-if="
-                    $checkBtnRole('edit', $route.meta.roles) &&
-                    (!isDealer || (isDealer && scope.row.examineStatus === 'SAVE'))
-                  "
-                  type="text"
-                  @click="toForm(scope.row)"
-                >
-                  编辑
-                </el-button>
-                <el-button
-                  v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'"
-                  type="text"
-                  @click="toExamine(scope.row)"
-                >
-                  审批
-                </el-button>
-                <el-button type="text" @click="toDetail(scope.row)"> 详情</el-button>
-                <el-popconfirm
-                  v-if="$checkBtnRole('del', $route.meta.roles) && scope.row.examineStatus !== 'OK'"
-                  style="margin-left: 10px"
-                  title="确定删除吗?"
-                  @onConfirm="handleDelete(scope.row.enginInfoId)"
-                >
-                  <el-button slot="reference" type="text" style="color: #f56c6c">删除</el-button>
-                </el-popconfirm>
-              </template>
-            </el-table-column>
-          </el-table>
-        </div>
-      </div>
-      <div class="pagination clearfix">
-        <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>
-
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :operation="operation()"
+    :optionsEvensGroup="optionsEvensGroup"
+    :exportList="exportList"
+    :columnParsing="columnParsing"
+    :tableAttributes="tableAttributes"
+    :tableEvents="tableEvents"
+    :operationColumnWidth="200"
+  >
     <EditDateDialog :is-show.sync="isShowEditDateDialog" :date-form.sync="dateForm" />
-
-    <EnginDetail v-if="isShowDetail" :list-item="queryItem" @backListFormDetail="backList" />
-    <EnginForm v-if="isShowForm" :list-item="queryItem" @backListFormDetail="backList" />
-    <EnginExamine v-if="isShowExamine" :list-item="queryItem" @backListFormDetail="backList" />
-  </div>
+    <Popu v-if="!showPage">
+      <el-page-header slot="head" :content="content" @back="handleClose" />
+      <EnginDetail v-if="isShowDetail" :list-item="queryItem" @backListFormDetail="backList" />
+      <EnginForm v-if="isShowForm" :list-item="queryItem" @backListFormDetail="backList" />
+      <EnginExamine v-if="isShowExamine" :list-item="queryItem" @backListFormDetail="backList" />
+    </Popu>
+  </template-page>
 </template>
 
 <script>
-import { getEnginList, applyEngin, withdrawEngin, deleteEngin, editDateEngin, abandonEngin } from '@/api/supply/engin'
+import TemplatePage from '@/components/template/template-page-1.vue'
+import Popu from '@/components/template/popu.vue'
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+
+import {
+  getEnginList,
+  applyEngin,
+  withdrawEngin,
+  deleteEngin,
+  editDateEngin,
+  abandonEngin,
+  v2EnginInfoOrderList,
+  v2EnginInfoOrderListExport
+} from '@/api/supply/engin'
 import { getSalesmanList, getTypeList } from '@/api/common'
 import EnginDetail from '@/views/supply/engin/components/engin_detail'
 import EnginForm from '@/views/supply/engin/components/engin_form'
@@ -486,11 +44,15 @@ import { getNoRebateWalletList } from '@/api/policy_list'
 
 let that
 export default {
+  mixins: [add_callback_mixin],
   components: {
     EnginDetail,
     EnginForm,
     EnginExamine,
-    EditDateDialog
+    EditDateDialog,
+    TemplatePage,
+    Popu,
+    add_callback_mixin
   },
   filters: {
     statusFilter(val) {
@@ -500,6 +62,38 @@ export default {
   },
   data() {
     return {
+      showPage: true,
+      content: '商用工程信息单',
+      // 关闭新增弹窗
+      handleClose: this.addOff(() => {
+        this.showPage = true
+        this.isShowForm = false
+        this.$refs.pageRef.refreshList()
+      }),
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '新增',
+              click: this.addOn(() => {
+                this.toForm()
+              })
+            }
+          ]
+        ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+
       currentPage: 1, // 当前页码
       pageSize: 10, // 每页数量
       listTotal: 0, // 列表总数
@@ -555,28 +149,28 @@ export default {
   computed: {
     isDealer() {
       return JSON.parse(localStorage.getItem('supply_user')).isCustomer
-    },
-    exParams() {
-      return {
-        enginInfoNo: this.screenForm.orderNum,
-        projectNo: this.screenForm.enginNum,
-        enginSignType: this.screenForm.loginNum,
-        projectName: this.screenForm.enginName,
-        startOrderDate: this.screenForm.orderDate ? this.screenForm.orderDate[0] : '',
-        endOrderDate: this.screenForm.orderDate ? this.screenForm.orderDate[1] : '',
-        startContractExpireDate: this.screenForm.date ? this.screenForm.date[0] : '',
-        endContractExpireDate: this.screenForm.date ? this.screenForm.date[1] : '',
-        customerKeyword: this.screenForm.dealer,
-        useUnit: this.screenForm.company,
-        createName: this.screenForm.createMan,
-        confirmName: this.screenForm.examineMan,
-        examineStatus: this.screenForm.examineStatus,
-        isClose: this.screenForm.isClose,
-        serviceId: this.screenForm.salesMan,
-        specification: this.screenForm.model,
-        isDirectTransfer: this.screenForm.isDirectTransfer
-      }
     }
+    // exParams() {
+    //   return {
+    //     enginInfoNo: this.screenForm.orderNum,
+    //     projectNo: this.screenForm.enginNum,
+    //     enginSignType: this.screenForm.loginNum,
+    //     projectName: this.screenForm.enginName,
+    //     startOrderDate: this.screenForm.orderDate ? this.screenForm.orderDate[0] : '',
+    //     endOrderDate: this.screenForm.orderDate ? this.screenForm.orderDate[1] : '',
+    //     startContractExpireDate: this.screenForm.date ? this.screenForm.date[0] : '',
+    //     endContractExpireDate: this.screenForm.date ? this.screenForm.date[1] : '',
+    //     customerKeyword: this.screenForm.dealer,
+    //     useUnit: this.screenForm.company,
+    //     createName: this.screenForm.createMan,
+    //     confirmName: this.screenForm.examineMan,
+    //     examineStatus: this.screenForm.examineStatus,
+    //     isClose: this.screenForm.isClose,
+    //     serviceId: this.screenForm.salesMan,
+    //     specification: this.screenForm.model,
+    //     isDirectTransfer: this.screenForm.isDirectTransfer
+    //   }
+    // }
   },
 
   watch: {
@@ -599,10 +193,129 @@ export default {
 
   created() {
     this.getSalesmanList()
-    this.getList()
+    // this.getList()
   },
 
   methods: {
+    // 列表请求函数
+    getList: v2EnginInfoOrderList,
+    // 列表导出函数
+    exportList: v2EnginInfoOrderListExport,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class="operation-btns">
+            {this.$checkBtnRole('apply', this.$route.meta.roles) && row.examineStatus === 'SAVE' ? (
+              <el-popconfirm
+                onOnConfirm={async () => {
+                  this.handleSubmit(row.enginInfoId)
+                }}
+                title="是否确定需要申请该项内容?"
+              >
+                <el-button slot="reference" size="mini" type="text">
+                  申请
+                </el-button>
+              </el-popconfirm>
+            ) : (
+              ''
+            )}
+
+            {this.$checkBtnRole('apply', this.$route.meta.roles) && row.examineStatus === 'WAIT' ? (
+              <el-popconfirm
+                onOnConfirm={async () => {
+                  this.handleWithdraw(row.enginInfoId)
+                }}
+                title="是否确定需要撤回该项内容?"
+              >
+                <el-button slot="reference" size="mini" type="text">
+                  撤回
+                </el-button>
+              </el-popconfirm>
+            ) : (
+              ''
+            )}
+
+            {this.$checkBtnRole('examine', this.$route.meta.roles) && row.examineStatus === 'OK' ? (
+              <el-popconfirm
+                onOnConfirm={async () => {
+                  this.handleAbandon(row.enginInfoId)
+                }}
+                title="是否确定需要弃审该项内容?"
+              >
+                <el-button slot="reference" size="mini" type="text">
+                  弃审
+                </el-button>
+              </el-popconfirm>
+            ) : (
+              ''
+            )}
+
+            {this.$checkBtnRole('edit', this.$route.meta.roles) &&
+            (!this.isDealer || (this.isDealer && row.examineStatus === 'SAVE')) ? (
+              <el-button
+                size="mini"
+                type="text"
+                onClick={async () => {
+                  this.toForm(row)
+                }}
+              >
+                编辑
+              </el-button>
+            ) : (
+              ''
+            )}
+
+            {this.$checkBtnRole('examine', this.$route.meta.roles) && row.examineStatus === 'WAIT' ? (
+              <el-button
+                size="mini"
+                type="text"
+                onClick={async () => {
+                  this.toExamine(row)
+                }}
+              >
+                审批
+              </el-button>
+            ) : (
+              ''
+            )}
+
+            <el-button
+              size="mini"
+              type="text"
+              onClick={async () => {
+                this.toDetail(row)
+              }}
+            >
+              详情
+            </el-button>
+
+            {this.$checkBtnRole('del', this.$route.meta.roles) && row.examineStatus !== 'OK' ? (
+              <el-popconfirm
+                onOnConfirm={async () => {
+                  this.handleDelete(row.enginInfoId)
+                }}
+                title="是否确定需要删除该项内容?"
+              >
+                <el-button slot="reference" size="mini" type="text">
+                  删除
+                </el-button>
+              </el-popconfirm>
+            ) : (
+              ''
+            )}
+          </div>
+        )
+      }
+    },
+
     // 获取业务员列表
     getSalesmanList() {
       getSalesmanList({
@@ -626,83 +339,86 @@ export default {
     },
 
     // 查询列表
-    getList() {
-      this.listLoading = true
-
-      const params = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
-        enginInfoNo: this.screenForm.orderNum,
-        projectNo: this.screenForm.enginNum,
-        enginSignType: this.screenForm.loginNum,
-        projectName: this.screenForm.enginName,
-        startOrderDate: this.screenForm.orderDate ? this.screenForm.orderDate[0] : '',
-        endOrderDate: this.screenForm.orderDate ? this.screenForm.orderDate[1] : '',
-        startContractExpireDate: this.screenForm.date ? this.screenForm.date[0] : '',
-        endContractExpireDate: this.screenForm.date ? this.screenForm.date[1] : '',
-        customerKeyword: this.screenForm.dealer,
-        useUnit: this.screenForm.company,
-        createName: this.screenForm.createMan,
-        confirmName: this.screenForm.examineMan,
-        examineStatus: this.screenForm.examineStatus,
-        isClose: this.screenForm.isClose,
-
-        serviceId: this.screenForm.salesMan,
-        specification: this.screenForm.model,
-        isDirectTransfer: this.screenForm.isDirectTransfer
-      }
-      getEnginList(params).then(res => {
-        res.data.records.forEach(item => {
-          item.sums1 = ['qty', 'hasOrderQty', 'compute_kdQty']
-          item.sums2 = ['totalAmount', 'price']
-        })
-        this.dataList = res.data.records
-        this.listTotal = res.data.total
-        this.listLoading = false
-      })
-    },
+    // getList() {
+    //   this.listLoading = true
+
+    //   const params = {
+    //     pageNum: this.currentPage,
+    //     pageSize: this.pageSize,
+    //     enginInfoNo: this.screenForm.orderNum,
+    //     projectNo: this.screenForm.enginNum,
+    //     enginSignType: this.screenForm.loginNum,
+    //     projectName: this.screenForm.enginName,
+    //     startOrderDate: this.screenForm.orderDate ? this.screenForm.orderDate[0] : '',
+    //     endOrderDate: this.screenForm.orderDate ? this.screenForm.orderDate[1] : '',
+    //     startContractExpireDate: this.screenForm.date ? this.screenForm.date[0] : '',
+    //     endContractExpireDate: this.screenForm.date ? this.screenForm.date[1] : '',
+    //     customerKeyword: this.screenForm.dealer,
+    //     useUnit: this.screenForm.company,
+    //     createName: this.screenForm.createMan,
+    //     confirmName: this.screenForm.examineMan,
+    //     examineStatus: this.screenForm.examineStatus,
+    //     isClose: this.screenForm.isClose,
+
+    //     serviceId: this.screenForm.salesMan,
+    //     specification: this.screenForm.model,
+    //     isDirectTransfer: this.screenForm.isDirectTransfer
+    //   }
+    //   getEnginList(params).then(res => {
+    //     res.data.records.forEach(item => {
+    //       item.sums1 = ['qty', 'hasOrderQty', 'compute_kdQty']
+    //       item.sums2 = ['totalAmount', 'price']
+    //     })
+    //     this.dataList = res.data.records
+    //     this.listTotal = res.data.total
+    //     this.listLoading = false
+    //   })
+    // },
 
     // 提交筛选表单
-    submitScreenForm() {
-      this.currentPage = 1
-      this.getList()
-    },
+    // submitScreenForm() {
+    //   this.currentPage = 1
+    //   this.getList()
+    // },
 
-    // 重置筛选表单
-    resetScreenForm() {
-        this.$refs.screenForm.resetFields()
-      this.currentPage = 1
-      this.getList()
-    },
+    // // 重置筛选表单
+    // resetScreenForm() {
+    //   this.$refs.screenForm.resetFields()
+    //   this.currentPage = 1
+    //   this.getList()
+    // },
 
-    // 更改每页数量
-    handleSizeChange(val) {
-      this.pageSize = val
-      this.currentPage = 1
-      this.getList()
-    },
+    // // 更改每页数量
+    // handleSizeChange(val) {
+    //   this.pageSize = val
+    //   this.currentPage = 1
+    //   this.getList()
+    // },
 
-    // 更改当前页
-    handleCurrentChange(val) {
-      this.currentPage = val
-      this.getList()
-    },
+    // // 更改当前页
+    // handleCurrentChange(val) {
+    //   this.currentPage = val
+    //   this.getList()
+    // },
 
     // 进入表单
     toForm(item) {
       this.queryItem = item
+      this.showPage = false
       this.isShowForm = true
     },
 
     // 进入审批
     toExamine(item) {
       this.queryItem = item
+      this.showPage = false
       this.isShowExamine = true
     },
 
     // 进入详情
     toDetail(item) {
       this.queryItem = item
+      this.showPage = false
       this.isShowDetail = true
     },
 
@@ -711,37 +427,38 @@ export default {
       this.isShowDetail = false
       this.isShowForm = false
       this.isShowExamine = false
+      this.showPage = true
     },
 
     // 申请
     handleSubmit(id) {
       applyEngin({ id }).then(res => {
-        this.$successMsg()
-        this.getList()
+        this.$refs.pageRef.refreshList()
+        this.$message.success('申请成功')
       })
     },
 
     // 撤回
     handleWithdraw(id) {
       withdrawEngin({ id }).then(res => {
-        this.$successMsg()
-        this.getList()
+        this.$refs.pageRef.refreshList()
+        this.$message.success('撤回成功')
       })
     },
 
     // 弃审
     handleAbandon(id) {
       abandonEngin({ id }).then(res => {
-        this.$successMsg()
-        this.getList()
+        this.$refs.pageRef.refreshList()
+        this.$message.success('弃审成功')
       })
     },
 
     // 删除
     handleDelete(id) {
       deleteEngin({ ids: id }).then(res => {
-        this.$successMsg()
-        this.getList()
+        this.$refs.pageRef.refreshList()
+        this.$message.success('删除成功')
       })
     },
 

+ 89 - 1
src/views/supply/engin/home_list.vue

@@ -609,9 +609,24 @@
     <HomeExamine v-if="isShowExamine" :list-item="queryItem" @backListFormDetail="backList" />
     <HomeReturn v-if="isShowReturn" :list-item="queryItem" @backListFormDetail="backList" />
   </div>
+  <!-- <template-page
+    ref="pageRef"
+    :getList="getList"
+    :operation="operation()"
+    :optionsEvensGroup="optionsEvensGroup"
+    :exportList="exportList"
+    :columnParsing="columnParsing"
+    :tableAttributes="tableAttributes"
+    :tableEvents="tableEvents"
+  >
+  </template-page> -->
 </template>
 
 <script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import Popu from '@/components/template/popu.vue'
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+
 import {
   getOrderList,
   applyHome,
@@ -631,12 +646,15 @@ import { getNoRebateWalletList } from '@/api/policy_list'
 
 let that
 export default {
+  mixins: [add_callback_mixin],
   components: {
     HomeDetail,
     HomeForm,
     HomeExamine,
     HomeReturn,
-    EditDateDialog
+    EditDateDialog,
+    TemplatePage,
+    Popu
   },
   filters: {
     statusFilter(val) {
@@ -653,6 +671,38 @@ export default {
   },
   data() {
     return {
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '新增',
+              click: this.addOn(() => {})
+            }
+          ]
+        ],
+        [
+          [
+            {
+              name: '批量删除',
+              click: async () => {
+                if (this.recordSelected.length === 0) {
+                  this.$message.error('请选择需要删除的数据')
+                  return
+                }
+                let messengerLevelId = this.recordSelected.map(v => {
+                  return v.messengerLevelId
+                })
+                let params = messengerLevelId
+                await levelDel(params)
+                this.$refs.pageRef.refreshList()
+                this.$message.success('批量删除成功')
+              }
+            }
+          ]
+        ]
+      ],
+
       currentPage: 1, // 当前页码
       pageSize: 10, // 每页数量
       listTotal: 0, // 列表总数
@@ -771,6 +821,44 @@ export default {
   },
 
   methods: {
+    // 列表请求函数
+    // getList: levelList,
+    // 列表导出函数
+    // exportList: exportLevelList,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class="operation-btns">
+            <el-popconfirm
+              onConfirm={async () => {
+                this.$refs.pageRef.refreshList()
+                this.$message.success('删除成功')
+              }}
+              title="是否确定需要删除该项内容?"
+            >
+              <el-button slot="reference" size="mini" type="text">
+                删除
+              </el-button>
+            </el-popconfirm>
+            <el-button size="mini" type="text" onClick={async () => {}}>
+              退订
+            </el-button>
+            <el-button size="mini" type="text" onClick={async () => {}}>
+              详情
+            </el-button>
+          </div>
+        )
+      }
+    },
+
     // 获取业务员列表
     getSalesmanList() {
       getSalesmanList({

+ 64 - 27
src/views/supply/implement/implement_list.vue

@@ -10,9 +10,9 @@
           </template>
           <template #left_btn>
             <el-radio-group v-model="screenForm.status" @change="getList()" size="mini">
-              <el-radio-button v-for="(item, index) in statusList" :key="index" :label="item.value">{{
-                item.label
-              }} </el-radio-button>
+              <el-radio-button v-for="(item, index) in statusList" :key="index" :label="item.value"
+                >{{ item.label }}
+              </el-radio-button>
             </el-radio-group>
           </template>
           <template #search>
@@ -72,7 +72,7 @@
                     <el-date-picker
                       v-model="screenForm.date"
                       type="datetimerange"
-                      :default-time="['00:00:00','23:59:59']"
+                      :default-time="['00:00:00', '23:59:59']"
                       range-separator="至"
                       style="width: 100%"
                       value-format="yyyy-MM-dd HH:mm:ss"
@@ -87,7 +87,7 @@
                     <el-date-picker
                       v-model="screenForm.orderDate"
                       type="datetimerange"
-:default-time="['00:00:00','23:59:59']"
+                      :default-time="['00:00:00', '23:59:59']"
                       range-separator="至"
                       style="width: 100%"
                       value-format="yyyy-MM-dd HH:mm:ss"
@@ -343,15 +343,9 @@
                 {{ scope.row.hasSendAmount | numToFixed }}
               </template>
             </el-table-column>
-            <el-table-column
-              align="right"
-              label="发货数量"
-              prop="hasSendQty"
-              min-width="100"
-              show-overflow-tooltip
-            >
-              <template v-slot="{row}">
-                {{row.qty - (row.refundableQty || 0)}}
+            <el-table-column align="right" label="发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip>
+              <template v-slot="{ row }">
+                {{ row.qty - (row.refundableQty || 0) }}
               </template>
             </el-table-column>
             <el-table-column
@@ -361,16 +355,9 @@
               min-width="100"
               show-overflow-tooltip
             ></el-table-column>
-            <el-table-column
-              align="right"
-              label="原供价"
-              prop="orgPrice"
-              min-width="100"
-              show-overflow-tooltip
-            >
+            <el-table-column align="right" label="原供价" prop="orgPrice" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
                 {{ scope.row.orgPrice | numToFixed }}
-
               </template>
             </el-table-column>
             <el-table-column
@@ -479,9 +466,22 @@
 
     <DisplaceDetail :listItem="queryItem" v-if="isShowDisplaceDetail" @backListFormDetail="backList" />
   </div>
+  <!-- <template-page
+    ref="pageRef"
+    :getList="getList"
+    :operation="operation()"
+    :optionsEvensGroup="optionsEvensGroup"
+    :exportList="exportList"
+    :columnParsing="columnParsing"
+    :tableAttributes="tableAttributes"
+    :tableEvents="tableEvents"
+  >
+  </template-page> -->
 </template>
 
 <script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+
 import { getList } from '@/api/supply/implement'
 import { getCategoryList } from '@/api/common'
 import DisplaceDetail from '@/views/supply/implement/components/displace_detail'
@@ -490,7 +490,8 @@ import { getNoRebateWalletList } from '@/api/policy_list'
 let that
 export default {
   components: {
-    DisplaceDetail
+    DisplaceDetail,
+    TemplatePage
   },
   filters: {
     statusFilter(val) {
@@ -503,6 +504,19 @@ export default {
   },
   data() {
     return {
+      // 事件组合
+      optionsEvensGroup: [],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+
       currentPage: 1, // 当前页码
       pageSize: 10, // 每页数量
       listTotal: 0, // 列表总数
@@ -566,8 +580,7 @@ export default {
         policyRemark: this.screenForm.policyRemark,
         isOver: this.screenForm.isOver,
         walletIds1: this.screenForm.walletIds1.join(','),
-        isDisplaceOrder:this.screenForm.isDisplaceOrder
-
+        isDisplaceOrder: this.screenForm.isDisplaceOrder
       }
     }
   },
@@ -582,6 +595,30 @@ export default {
   },
 
   methods: {
+    // 列表请求函数
+    // getList: levelList,
+    // 列表导出函数
+    // exportList: exportLevelList,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class="operation-btns">
+            <el-button size="mini" type="text" onClick={async () => {}}>
+              查看
+            </el-button>
+          </div>
+        )
+      }
+    },
+
     // 查询列表
     getList() {
       this.listLoading = true
@@ -609,7 +646,7 @@ export default {
         policyRemark: this.screenForm.policyRemark,
         isOver: this.screenForm.isOver,
         walletIds1: this.screenForm.walletIds1.join(','),
-        isDisplaceOrder:this.screenForm.isDisplaceOrder,
+        isDisplaceOrder: this.screenForm.isDisplaceOrder
       }
       getList(params).then(res => {
         res.data.records.forEach(item => {
@@ -647,7 +684,7 @@ export default {
 
     // 重置筛选表单
     resetScreenForm() {
-        this.$refs.screenForm.resetFields()
+      this.$refs.screenForm.resetFields()
       this.currentPage = 1
       this.getList()
     },

+ 65 - 28
src/views/supply/implement/implement_total_list.vue

@@ -78,7 +78,7 @@
                     <el-date-picker
                       v-model="screenForm.date"
                       type="datetimerange"
-:default-time="['00:00:00','23:59:59']"
+                      :default-time="['00:00:00', '23:59:59']"
                       range-separator="至"
                       style="width: 100%"
                       value-format="yyyy-MM-dd HH:mm:ss"
@@ -93,7 +93,7 @@
                     <el-date-picker
                       v-model="screenForm.orderDate"
                       type="datetimerange"
-:default-time="['00:00:00','23:59:59']"
+                      :default-time="['00:00:00', '23:59:59']"
                       range-separator="至"
                       style="width: 100%"
                       value-format="yyyy-MM-dd HH:mm:ss"
@@ -189,9 +189,8 @@
                   style="cursor: pointer"
                   @click="openDisplaceDetail(scope.row)"
                   v-if="scope.row.isDisplaceOrder"
-                >置换
-                </el-tag
-                >
+                  >置换
+                </el-tag>
                 <el-tag type="success" size="mini" v-if="scope.row.directTransferStatusName !== '非直调'">直调</el-tag>
               </template>
             </el-table-column>
@@ -362,15 +361,9 @@
                 {{ scope.row.hasSendAmount | numToFixed }}
               </template>
             </el-table-column>
-            <el-table-column
-              align="right"
-              label="发货数量"
-              prop="hasSendQty"
-              min-width="100"
-              show-overflow-tooltip
-            >
-              <template v-slot="{row}">
-                {{row.qty - (row.refundableQty || 0)}}
+            <el-table-column align="right" label="发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip>
+              <template v-slot="{ row }">
+                {{ row.qty - (row.refundableQty || 0) }}
               </template>
             </el-table-column>
             <el-table-column
@@ -410,20 +403,12 @@
               min-width="100"
               show-overflow-tooltip
             ></el-table-column>
-            <el-table-column
-              align="right"
-              label="原供价"
-              prop="orgPrice"
-              min-width="100"
-              show-overflow-tooltip
-            >
+            <el-table-column align="right" label="原供价" prop="orgPrice" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
                 {{ scope.row.orgPrice | numToFixed }}
-
               </template>
             </el-table-column>
 
-
             <el-table-column
               align="left"
               label="表头业务员"
@@ -500,9 +485,22 @@
 
     <DisplaceDetail :listItem="queryItem" v-if="isShowDisplaceDetail" @backListFormDetail="backList" />
   </div>
+  <!-- <template-page
+    ref="pageRef"
+    :getList="getList"
+    :operation="operation()"
+    :optionsEvensGroup="optionsEvensGroup"
+    :exportList="exportList"
+    :columnParsing="columnParsing"
+    :tableAttributes="tableAttributes"
+    :tableEvents="tableEvents"
+  >
+  </template-page> -->
 </template>
 
 <script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+
 import { getTotalList } from '@/api/supply/implement'
 import { getCategoryList } from '@/api/common'
 import DisplaceDetail from '@/views/supply/implement/components/displace_detail'
@@ -511,7 +509,8 @@ import { getNoRebateWalletList } from '@/api/policy_list'
 let that
 export default {
   components: {
-    DisplaceDetail
+    DisplaceDetail,
+    TemplatePage
   },
   filters: {
     statusFilter(val) {
@@ -524,6 +523,20 @@ export default {
   },
   data() {
     return {
+      // 事件组合
+      optionsEvensGroup: [],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+
+      //
       currentPage: 1, // 当前页码
       pageSize: 10, // 每页数量
       listTotal: 0, // 列表总数
@@ -549,7 +562,7 @@ export default {
         isOver: '',
         orderDate: [],
         walletIds1: [],
-        isDisplaceOrder:''
+        isDisplaceOrder: ''
       },
       categoryList: [],
       statusList: [
@@ -587,7 +600,7 @@ export default {
         policyCode: this.screenForm.policyCode,
         policyRemark: this.screenForm.policyRemark,
         isOver: this.screenForm.isOver,
-        isDisplaceOrder:this.screenForm.isDisplaceOrder
+        isDisplaceOrder: this.screenForm.isDisplaceOrder
       }
     }
   },
@@ -602,6 +615,30 @@ export default {
   },
 
   methods: {
+    // 列表请求函数
+    // getList: levelList,
+    // 列表导出函数
+    // exportList: exportLevelList,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class="operation-btns">
+            <el-button size="mini" type="text" onClick={async () => {}}>
+              查看
+            </el-button>
+          </div>
+        )
+      }
+    },
+
     // 查询列表
     getList() {
       this.listLoading = true
@@ -629,7 +666,7 @@ export default {
         policyCode: this.screenForm.policyCode,
         policyRemark: this.screenForm.policyRemark,
         isOver: this.screenForm.isOver,
-        isDisplaceOrder:this.screenForm.isDisplaceOrder
+        isDisplaceOrder: this.screenForm.isDisplaceOrder
       }
       getTotalList(params).then(res => {
         res.data.records.forEach(item => {
@@ -667,7 +704,7 @@ export default {
 
     // 重置筛选表单
     resetScreenForm() {
-        this.$refs.screenForm.resetFields()
+      this.$refs.screenForm.resetFields()
       this.currentPage = 1
       this.getList()
     },

+ 58 - 7
src/views/supply/implement/nsales_list.vue

@@ -64,7 +64,7 @@
                     <el-date-picker
                       v-model="screenForm.date"
                       type="datetimerange"
-:default-time="['00:00:00','23:59:59']"
+                      :default-time="['00:00:00', '23:59:59']"
                       range-separator="至"
                       style="width: 100%"
                       value-format="yyyy-MM-dd HH:mm:ss"
@@ -78,7 +78,7 @@
                     <el-date-picker
                       v-model="screenForm.approval"
                       type="datetimerange"
-:default-time="['00:00:00','23:59:59']"
+                      :default-time="['00:00:00', '23:59:59']"
                       range-separator="至"
                       style="width: 100%"
                       value-format="yyyy-MM-dd HH:mm:ss"
@@ -92,7 +92,7 @@
                     <el-date-picker
                       v-model="screenForm.printTime"
                       type="datetimerange"
-:default-time="['00:00:00','23:59:59']"
+                      :default-time="['00:00:00', '23:59:59']"
                       range-separator="至"
                       style="width: 100%"
                       value-format="yyyy-MM-dd HH:mm:ss"
@@ -141,7 +141,7 @@
                     <el-date-picker
                       v-model="screenForm.invoiceDate"
                       type="datetimerange"
-:default-time="['00:00:00','23:59:59']"
+                      :default-time="['00:00:00', '23:59:59']"
                       range-separator="至"
                       style="width: 100%"
                       value-format="yyyy-MM-dd HH:mm:ss"
@@ -497,9 +497,22 @@
     <SalesExamine v-if="isShowExamine" :list-item="queryItem" @backListFormExamine="backList" />
     <SalesReturnForm v-if="isShowReturnForm" :list-item="queryItem" @backListFormDetail="backList" />
   </div>
+  <!-- <template-page
+    ref="pageRef"
+    :getList="getList"
+    :operation="operation()"
+    :optionsEvensGroup="optionsEvensGroup"
+    :exportList="exportList"
+    :columnParsing="columnParsing"
+    :tableAttributes="tableAttributes"
+    :tableEvents="tableEvents"
+  >
+  </template-page> -->
 </template>
 
 <script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+
 import { abandonData, examineBatch, examineJudge, getList } from '@/api/supply/sales'
 import SalesDetail from '@/views/supply/sales/components/sales_detail'
 import SalesExamine from '@/views/supply/sales/components/sales_examine'
@@ -513,7 +526,8 @@ export default {
     SalesDetail,
     SalesExamine,
     SalesReturnForm,
-    ExamineDialog
+    ExamineDialog,
+    TemplatePage
   },
   filters: {
     statusFilter(val) {
@@ -540,6 +554,19 @@ export default {
   },
   data() {
     return {
+      // 事件组合
+      optionsEvensGroup: [],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+
       currentPage: 1, // 当前页码
       pageSize: 10, // 每页数量
       listTotal: 0, // 列表总数
@@ -556,7 +583,7 @@ export default {
         warehouse: '',
         date: [],
         status: '',
-        approval:[],
+        approval: [],
         printTime: [],
         mainOrderId: '',
         printDesc: null,
@@ -654,6 +681,30 @@ export default {
   },
 
   methods: {
+    // 列表请求函数
+    // getList: levelList,
+    // 列表导出函数
+    // exportList: exportLevelList,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class="operation-btns">
+            <el-button size="mini" type="text" onClick={async () => {}}>
+              查看
+            </el-button>
+          </div>
+        )
+      }
+    },
+
     // 查询列表
     getList() {
       this.listLoading = true
@@ -715,7 +766,7 @@ export default {
 
     // 重置筛选表单
     resetScreenForm() {
-        this.$refs.screenForm.resetFields()
+      this.$refs.screenForm.resetFields()
       this.currentPage = 1
       this.getList()
     },

+ 65 - 3
src/views/supply/policy/policy_list.vue

@@ -52,7 +52,7 @@
                     <el-date-picker
                       v-model="screenForm.date"
                       type="datetimerange"
-:default-time="['00:00:00','23:59:59']"
+                      :default-time="['00:00:00', '23:59:59']"
                       range-separator="至"
                       style="width: 100%"
                       value-format="yyyy-MM-dd HH:mm:ss"
@@ -508,9 +508,23 @@
     <EditDateDialog :is-show.sync="isShowEditDateDialog" :date-form.sync="dateForm" />
     <ExamineDialog :isShow.sync="isShowExamineDialog" :examineForm.sync="examineForm" />
   </div>
+  <!-- <template-page
+    ref="pageRef"
+    :getList="getList"
+    :operation="operation()"
+    :optionsEvensGroup="optionsEvensGroup"
+    :exportList="exportList"
+    :columnParsing="columnParsing"
+    :tableAttributes="tableAttributes"
+    :tableEvents="tableEvents"
+  >
+  </template-page> -->
 </template>
 
 <script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import Popu from '@/components/template/popu.vue'
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
 import {
   abandonData,
   closeData,
@@ -532,13 +546,16 @@ import { getNoRebateWalletList } from '@/api/policy_list'
 
 let that
 export default {
+  mixins: [add_callback_mixin],
   components: {
     RetailDetail,
     RetailForm,
     RetailExamine,
     RetailReturn,
     EditDateDialog,
-    ExamineDialog
+    ExamineDialog,
+    TemplatePage,
+    Popu
   },
   filters: {
     statusFilter(val) {
@@ -548,6 +565,27 @@ export default {
   },
   data() {
     return {
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '新增',
+              click: this.addOn(() => {})
+            }
+          ]
+        ],
+
+        [
+          [
+            {
+              name: '批量审批',
+              click: async () => {}
+            }
+          ]
+        ]
+      ],
+
       currentPage: 1, // 当前页码
       pageSize: 10, // 每页数量
       listTotal: 0, // 列表总数
@@ -651,6 +689,30 @@ export default {
   },
 
   methods: {
+    // 列表请求函数
+    // getList: levelList,
+    // 列表导出函数
+    // exportList: exportLevelList,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class="operation-btns">
+            <el-button size="mini" type="text" onClick={async () => {}}>
+              详情
+            </el-button>
+          </div>
+        )
+      }
+    },
+
     // 获取业务员列表
     getSalesmanList() {
       getSalesmanList({
@@ -771,7 +833,7 @@ export default {
 
     // 重置筛选表单
     resetScreenForm() {
-        this.$refs.screenForm.resetFields()
+      this.$refs.screenForm.resetFields()
       this.currentPage = 1
       this.getList()
     },