Procházet zdrojové kódy

Merge branch 'feature/调整列表' into dev_v2

chenqilong před 2 roky
rodič
revize
2f7a60b585

+ 124 - 2
src/views/basic_data/material/modify_list.vue

@@ -397,9 +397,27 @@
     <ModifyListDetail v-else :detail="detail" />
     <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 import_mixin from '@/components/template/import_mixin.js'
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+
 import ModifyListApply from './components/modify_list-apply.vue'
 import ModifyListApproval from './components/modify_list-approval.vue'
 import ModifyListDetail from './components/modify_list-detail.vue'
@@ -417,9 +435,87 @@ import { downloadFiles, handleImport } from '@/utils/util'
 import { getCategoryList } from '@/api/common'
 
 export default {
-  mixins: [Mixin],
+  mixins: [Mixin, import_mixin, add_callback_mixin],
   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('批量删除成功')
+              }
+            }
+          ]
+        ],
+        [
+          [
+            {
+              name: '批量审批',
+              click: async () => {}
+            }
+          ]
+        ]
+        // [
+        //   [
+        //     {
+        //       name: '',
+        //       render: this.importButton(lbsAmapImport)
+        //     }
+        //   ]
+        // ],
+        // [
+        //   [
+        //     {
+        //       name: '导入模版',
+        //       click: () => {
+        //         // lbsAmapTemplateExcel({}, `${this.$route.meta.title}`)
+        //         //   .then(res => {
+        //         //     this.$message({
+        //         //       message: '下载成功',
+        //         //       type: 'success'
+        //         //     })
+        //         //   })
+        //         //   .catch(err => {
+        //         //     this.$message.error('下载失败')
+        //         //   })
+        //       }
+        //     }
+        //   ]
+        // ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+
+      //
       baseURL: '',
       importFileList: [],
       importLoading: false,
@@ -495,7 +591,9 @@ export default {
     ExamineDialog,
     ModifyListApply,
     ModifyListApproval,
-    ModifyListDetail
+    ModifyListDetail,
+    TemplatePage,
+    Popu
   },
   computed: {
     exParams() {
@@ -533,6 +631,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>
+        )
+      }
+    },
+
     formatterType(row) {
       for (let i = 0; i < this.typeList.length; i++) {
         if (this.typeList[i].id == row.saleTypeId) {

+ 115 - 0
src/views/basic_data/material/price_list.vue

@@ -231,17 +231,88 @@
       </div>
     </div>
   </div>
+
+  <!-- <template-page
+    ref="pageRef"
+    :getList="getList"
+    :operation="operation()"
+    :optionsEvensGroup="optionsEvensGroup"
+    :exportList="exportList"
+    :columnParsing="columnParsing"
+    :tableAttributes="tableAttributes"
+    :tableEvents="tableEvents"
+  >
+    
+  </template-page> -->
 </template>
 
 <script>
 import Mixin from '@/mixin/index'
+
+import TemplatePage from '@/components/template/template-page-1.vue'
 import { getProductDelete, getProductPriceList, getTypeList, handlePriceRevoke } from '@/api/basic_data/material'
 import { getCategoryList } from '@/api/common'
 
 export default {
+  components: { TemplatePage, Popu },
   mixins: [Mixin],
   data() {
     return {
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              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('批量删除成功')
+              }
+            }
+          ]
+        ],
+        [
+          [
+            {
+              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: [],
+
+      //待删除
       currentPage: 1, // 当前页码
       pageSize: 10, // 每页数量
       listTotal: 0, // 列表总数
@@ -269,6 +340,50 @@ 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-popconfirm
+              onConfirm={async () => {
+                this.$refs.pageRef.refreshList()
+                this.$message.success('删除成功')
+              }}
+              title="是否确定需要删除该项内容?"
+            >
+              <el-button slot="reference" size="mini" type="text">
+                删除
+              </el-button>
+            </el-popconfirm>
+          </div>
+        )
+      }
+    },
+
     addFn() {
       this.showDialogForm = true
     },

+ 100 - 1
src/views/sales_policy/policy_list.vue

@@ -289,9 +289,26 @@
   <EditPolicy v-else-if="isShow === 5" />
   <Details v-else-if="isShow === 4" />
   <Examine v-else />
+
+  <!-- <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 {
   cancelPolicy,
   cloneList,
@@ -316,9 +333,32 @@ import Examine from './components/Examine'
 import { mapState } from 'vuex'
 
 export default {
-  mixins: [Minxin],
+  mixins: [Minxin, add_callback_mixin],
   data() {
     return {
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '新增',
+              click: this.addOn(() => {})
+            }
+          ]
+        ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+
+      //
       id: '',
       code: '',
       codeId: '',
@@ -390,6 +430,63 @@ export default {
     comCode: state => state.sales.code
   }),
   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>
+            <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">
+                克隆
+              </el-button>
+            </el-popconfirm>
+            <el-popconfirm
+              onConfirm={async () => {
+                this.$refs.pageRef.refreshList()
+                this.$message.success('弃审成功')
+              }}
+              title="是否确定需要弃审该项内容?"
+            >
+              <el-button slot="reference" size="mini" type="text">
+                弃审
+              </el-button>
+            </el-popconfirm>
+          </div>
+        )
+      }
+    },
+
     tableRowClassName({ row, rowIndex }) {
       // || row.examineStatus=='FAIL'
       if (row.status == 0) {
@@ -524,6 +621,8 @@ export default {
     }
   },
   components: {
+    TemplatePage,
+    Popu,
     Examine,
     Details,
     AddModel,