Bläddra i källkod

Merge branch 'feature/销售政策列表' into dev_v2

chenqilong 2 år sedan
förälder
incheckning
495e32e843

+ 46 - 0
src/api/policy_list.js

@@ -246,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',
@@ -295,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',
@@ -417,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({

+ 43 - 189
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">
@@ -222,26 +86,15 @@
         </template>
       </el-dialog>
     </div>
-  </div>
-  <!-- <template-page
-    ref="pageRef"
-    :getList="getList"
-    :operation="operation()"
-    :optionsEvensGroup="optionsEvensGroup"
-    :exportList="exportList"
-    :columnParsing="columnParsing"
-    :tableAttributes="tableAttributes"
-    :tableEvents="tableEvents"
-  >
-  </template-page> -->
+  </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 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,
@@ -249,11 +102,13 @@ import {
   getWalletRebateSaletypeAdd,
   getWalletRebateSaletypeDelete,
   getWalletRebateSaletypelist,
-  getWalletRebateSaletypeUpdate
+  getWalletRebateSaletypeUpdate,
+  walletRebateSaletypeListV2,
+  walletRebateSaletypeListV2Export
 } from '@/api/policy_list'
 
 export default {
-  mixins: [Mixin, add_callback_mixin],
+  mixins: [],
   data() {
     return {
       // 事件组合
@@ -262,7 +117,7 @@ export default {
           [
             {
               name: '新增',
-              click: this.addOn(() => {})
+              click: () => {}
             }
           ]
         ],
@@ -401,9 +256,9 @@ export default {
   },
   methods: {
     // 列表请求函数
-    // getList: levelList,
+    getList: walletRebateSaletypeListV2,
     // 列表导出函数
-    // exportList: exportLevelList,
+    exportList: walletRebateSaletypeListV2Export,
     // 表格列解析渲染数据更改
     columnParsing(item, defaultData) {
       return defaultData
@@ -453,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)
@@ -619,8 +474,7 @@ export default {
     this.getWalletList()
   },
   components: {
-    Pagination,
-    Pagination
+    TemplatePage
   }
 }
 </script>

+ 68 - 162
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,31 +55,19 @@
         </template>
       </el-dialog>
     </div>
-  </div>
-  <!-- <template-page
-    ref="pageRef"
-    :getList="getList"
-    :operation="operation()"
-    :optionsEvensGroup="optionsEvensGroup"
-    :exportList="exportList"
-    :columnParsing="columnParsing"
-    :tableAttributes="tableAttributes"
-    :tableEvents="tableEvents"
-  >
-    
-  </template-page> -->
+  </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 { addWallet, getDictList, getTypeList, getWalletList, updateWallet } from '@/api/policy_list'
+// 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, add_callback_mixin],
+  mixins: [add_callback_mixin],
   data() {
     return {
       // 事件组合
@@ -196,7 +76,12 @@ export default {
           [
             {
               name: '新增',
-              click: this.addOn(() => {})
+              click: () => {
+                this.dialogVisible = true
+                this.type = 1
+                this.getDictList()
+              },
+              isRole: this.$checkBtnRole('add', this.$route.meta.roles)
             }
           ]
         ]
@@ -204,7 +89,7 @@ export default {
       // 表格属性
       tableAttributes: {
         // 启用勾选列
-        selectColumn: true
+        selectColumn: false
       },
       // 表格事件
       tableEvents: {
@@ -221,6 +106,7 @@ export default {
         saleTypeName: '',
         status: ''
       },
+      dialogVisible: false,
       dialogForm: {
         name: ''
         // mainName: "",
@@ -298,7 +184,7 @@ export default {
   },
   methods: {
     // 列表请求函数
-    // getList: levelList,
+    getList: walletRebateListV2,
     // 列表导出函数
     // exportList: exportLevelList,
     // 表格列解析渲染数据更改
@@ -313,7 +199,27 @@ export default {
       return (h, { row, index, column }) => {
         return (
           <div class="operation-btns">
-            <el-button size="mini" type="text" onClick={async () => {}}>
+            {this.$checkBtnRole('edit', this.$route.meta.roles) ? (
+              <el-button
+                size="mini"
+                type="text"
+                onClick={async () => {
+                  this.hanleEdit(row)
+                }}
+              >
+                编辑
+              </el-button>
+            ) : (
+              ''
+            )}
+
+            <el-button
+              size="mini"
+              type="text"
+              onClick={async () => {
+                this.hanleDateil(row)
+              }}
+            >
               查看
             </el-button>
           </div>
@@ -321,29 +227,29 @@ export default {
       }
     },
 
-    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() {
+    //   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;
-      // });
-    },
+    //   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)
@@ -470,7 +376,7 @@ export default {
       }
       // this.$refs.dialogForm.resetFields()
       this.dialogVisible = false
-      this.getList()
+      this.$refs.pageRef.refreshList()
     },
     hanleCancel() {
       // this.type = "";
@@ -488,7 +394,7 @@ export default {
     }
   },
   components: {
-    Pagination
+    TemplatePage
   }
 }
 </script>

+ 99 - 187
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,30 +47,27 @@
         </span>
       </el-dialog>
     </div>
-  </div>
-  <!-- <template-page
-    ref="pageRef"
-    :getList="getList"
-    :operation="operation()"
-    :optionsEvensGroup="optionsEvensGroup"
-    :exportList="exportList"
-    :columnParsing="columnParsing"
-    :tableAttributes="tableAttributes"
-    :tableEvents="tableEvents"
-  >
-  </template-page> -->
+  </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 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 } from '@/api/policy_list'
+// 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, add_callback_mixin],
+  mixins: [],
   data() {
     return {
       // 事件组合
@@ -195,7 +76,11 @@ export default {
           [
             {
               name: '新增',
-              click: this.addOn(() => {})
+              click: () => {
+                this.dialogVisible = true
+                this.type = 1
+              },
+              isRole: this.$checkBtnRole('add', this.$route.meta.roles)
             }
           ]
         ]
@@ -203,7 +88,7 @@ export default {
       // 表格属性
       tableAttributes: {
         // 启用勾选列
-        selectColumn: true
+        selectColumn: false
       },
       // 表格事件
       tableEvents: {
@@ -218,6 +103,7 @@ export default {
         mainId: '',
         status: ''
       },
+      dialogVisible: false,
       dialogForm: {
         id: '',
         saleCode: '',
@@ -306,9 +192,9 @@ export default {
 
   methods: {
     // 列表请求函数
-    // getList: levelList,
+    getList: saleTypeRebateListV2,
     // 列表导出函数
-    // exportList: exportLevelList,
+    exportList: saleTypeRebateListV2Export,
     // 表格列解析渲染数据更改
     columnParsing(item, defaultData) {
       return defaultData
@@ -321,47 +207,61 @@ 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">
-                删除
+            {this.$checkBtnRole('edit', this.$route.meta.roles) ? (
+              <el-button
+                size="mini"
+                type="text"
+                onClick={async () => {
+                  this.hanleEdit(row)
+                }}
+              >
+                编辑
               </el-button>
-            </el-popconfirm>
+            ) : (
+              ''
+            )}
+
+            {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>
         )
       }
     },
 
-    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
-      })
-    },
+    // 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) {
@@ -378,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
@@ -454,11 +365,12 @@ export default {
       }
       // this.$refs.dialogForm.resetFields()
       this.dialogVisible = false
-      this.getList()
+      // this.getList()
+      this.$refs.pageRef.refreshList()
     }
   },
   components: {
-    Pagination
+    TemplatePage
   }
 }
 </script>