Explorar o código

fix: 商用列表删除权限限制

zh %!s(int64=2) %!d(string=hai) anos
pai
achega
e987f812d2
Modificáronse 1 ficheiros con 66 adicións e 61 borrados
  1. 66 61
      src/views/supply/engin/commerce_list.vue

+ 66 - 61
src/views/supply/engin/commerce_list.vue

@@ -1,22 +1,22 @@
 <template>
   <template-page
     ref="pageRef"
-    :getList="getList"
+    :get-list="getList"
     :operation="operation()"
-    :optionsEvensGroup="optionsEvensGroup"
-    :exportList="exportList"
-    :columnParsing="columnParsing"
-    :tableAttributes="tableAttributes"
-    :tableEvents="tableEvents"
-    :fieldBeansHook="fieldBeansHook"
-    :operationColumnWidth="200"
+    :options-evens-group="optionsEvensGroup"
+    :export-list="exportList"
+    :column-parsing="columnParsing"
+    :table-attributes="tableAttributes"
+    :table-events="tableEvents"
+    :field-beans-hook="fieldBeansHook"
+    :operation-column-width="200"
   >
     <EditDateDialog :is-show.sync="isShowEditDateDialog" :date-form.sync="dateForm" @submit="submitDateForm" />
     <Popu v-if="isShowDetail || isShowForm || isShowExamine || isShowReturn">
-      <CommerceDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
-      <CommerceForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
-      <CommerceExamine :listItem="queryItem" v-if="isShowExamine" @backListFormDetail="backList" />
-      <CommerceReturn :listItem="queryItem" v-if="isShowReturn" @backListFormDetail="backList" />
+      <CommerceDetail v-if="isShowDetail" :list-item="queryItem" @backListFormDetail="backList" />
+      <CommerceForm v-if="isShowForm" :list-item="queryItem" @backListFormDetail="backList" />
+      <CommerceExamine v-if="isShowExamine" :list-item="queryItem" @backListFormDetail="backList" />
+      <CommerceReturn v-if="isShowReturn" :list-item="queryItem" @backListFormDetail="backList" />
     </Popu>
   </template-page>
 </template>
@@ -46,7 +46,6 @@ import { getNoRebateWalletList } from '@/api/policy_list'
 
 let that
 export default {
-  mixins: [add_callback_mixin],
   components: {
     CommerceDetail,
     CommerceForm,
@@ -58,7 +57,7 @@ export default {
   },
   filters: {
     statusFilter(val) {
-      let obj = that.statusList.find(o => o.value == val)
+      const obj = that.statusList.find(o => o.value == val)
       return obj ? obj.label : ''
     },
     typeFilter(val) {
@@ -69,6 +68,7 @@ export default {
       return MAP[val]
     }
   },
+  mixins: [add_callback_mixin],
   data() {
     return {
       // 事件组合
@@ -88,7 +88,7 @@ export default {
           [
             {
               name: '批量删除',
-              click: async () => {
+              click: async() => {
                 if (this.recordSelected.length === 0) {
                   this.$message.error('请选择需要删除的数据')
                   return
@@ -103,7 +103,9 @@ export default {
       // 表格属性
       tableAttributes: {
         // 启用勾选列
-        selectColumn: true
+        selectColumn: true,
+        selectable: this.selectable
+
       },
       // 表格事件
       tableEvents: {
@@ -166,7 +168,7 @@ export default {
 
   computed: {
     exParams() {
-      let ids = this.multipleSelection.map(item => {
+      const ids = this.multipleSelection.map(item => {
         return item.enginOrderNo
       })
       return {
@@ -213,20 +215,20 @@ export default {
       if (item.colName === 'order_date') {
         defaultData.render = (h, { row, index, column }) => {
           return (
-            <div class="dateClass">
+            <div class='dateClass'>
               <span>{row.orderDate}</span>
               {this.$checkBtnRole('date', this.$route.meta.roles) &&
               !this.isCustomer &&
               row.examineStatus !== '保存' ? (
-                <el-button
-                  type="text"
-                  icon="el-icon-edit"
-                  style="padding: 0; margin-left: 6px"
-                  onClick={() => this.editDate(row)}
-                />
-              ) : (
-                ''
-              )}
+                  <el-button
+                    type='text'
+                    icon='el-icon-edit'
+                    style='padding: 0; margin-left: 6px'
+                    onClick={() => this.editDate(row)}
+                  />
+                ) : (
+                  ''
+                )}
             </div>
           )
         }
@@ -238,10 +240,17 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-
+    selectable(row, index) {
+      console.log(row.examineStatus)
+      if ((row.examineStatus == '保存' || row.examineStatus == '关闭')) {
+        return true
+      } else {
+        return false
+      }
+    },
     fieldBeansHook(val) {
       if (this.isCustomer !== '') {
-        let res = val.filter(
+        const res = val.filter(
           v => v.jname !== 'refPowerCategory' && v.jname !== 'geLiInerNote' && v.jname !== 'geLiNote'
         )
         return res
@@ -252,17 +261,16 @@ export default {
     operation() {
       return (h, { row, index, column }) => {
         return (
-          <div class="operation-btns">
-            <div class="operation-btns">
+          <div class='operation-btns'>
+            <div class='operation-btns'>
               {this.$checkBtnRole('apply', this.$route.meta.roles) && row.examineStatus == '保存' ? (
                 <el-popconfirm
-                  onOnConfirm={async () => {
+                  onOnConfirm={async() => {
                     this.handleSubmit(row.parentId, row)
-
                   }}
-                  title="是否确定需要申请该项内容?"
+                  title='是否确定需要申请该项内容?'
                 >
-                  <el-button slot="reference" size="mini" type="text">
+                  <el-button slot='reference' size='mini' type='text'>
                     申请
                   </el-button>
                 </el-popconfirm>
@@ -272,13 +280,12 @@ export default {
 
               {this.$checkBtnRole('apply', this.$route.meta.roles) && row.examineStatus == '待审核' ? (
                 <el-popconfirm
-                  onOnConfirm={async () => {
+                  onOnConfirm={async() => {
                     this.handleWithdraw(row.parentId, row)
-
                   }}
-                  title="是否确定需要撤回该项内容?"
+                  title='是否确定需要撤回该项内容?'
                 >
-                  <el-button slot="reference" size="mini" type="text">
+                  <el-button slot='reference' size='mini' type='text'>
                     撤回
                   </el-button>
                 </el-popconfirm>
@@ -288,13 +295,12 @@ export default {
 
               {this.$checkBtnRole('examine', this.$route.meta.roles) && row.examineStatus === '审核通过' ? (
                 <el-popconfirm
-                  onOnConfirm={async () => {
+                  onOnConfirm={async() => {
                     this.handleAbandon(row.parentId, row)
-
                   }}
-                  title="是否确定需要弃审该项内容?"
+                  title='是否确定需要弃审该项内容?'
                 >
-                  <el-button slot="reference" size="mini" type="text">
+                  <el-button slot='reference' size='mini' type='text'>
                     弃审
                   </el-button>
                 </el-popconfirm>
@@ -304,9 +310,9 @@ export default {
 
               {this.$checkBtnRole('edit', this.$route.meta.roles) && row.examineStatus === '保存' ? (
                 <el-button
-                  size="mini"
-                  type="text"
-                  onClick={async () => {
+                  size='mini'
+                  type='text'
+                  onClick={async() => {
                     this.toForm(row)
                   }}
                 >
@@ -318,9 +324,9 @@ export default {
 
               {this.$checkBtnRole('examine', this.$route.meta.roles) && row.examineStatus === '待审核' ? (
                 <el-button
-                  size="mini"
-                  type="text"
-                  onClick={async () => {
+                  size='mini'
+                  type='text'
+                  onClick={async() => {
                     this.toExamine(row)
                   }}
                 >
@@ -332,9 +338,9 @@ export default {
 
               {this.$checkBtnRole('examine', this.$route.meta.roles) ? (
                 <el-button
-                  size="mini"
-                  type="text"
-                  onClick={async () => {
+                  size='mini'
+                  type='text'
+                  onClick={async() => {
                     this.toReturn(row)
                   }}
                 >
@@ -345,24 +351,23 @@ export default {
               )}
 
               <el-button
-                size="mini"
-                type="text"
-                onClick={async () => {
+                size='mini'
+                type='text'
+                onClick={async() => {
                   this.toDetail(row)
                 }}
               >
                 详情
               </el-button>
 
-              {this.$checkBtnRole('del', this.$route.meta.roles) && row.examineStatus !== '审核通过' ? (
+              {this.$checkBtnRole('del', this.$route.meta.roles) && (row.examineStatus == '保存' || row.examineStatus == '关闭') ? (
                 <el-popconfirm
-                  onOnConfirm={async () => {
+                  onOnConfirm={async() => {
                     this.handleDelete(row.parentId, row)
-
                   }}
-                  title="是否确定需要删除该项内容?"
+                  title='是否确定需要删除该项内容?'
                 >
-                  <el-button slot="reference" size="mini" type="text">
+                  <el-button slot='reference' size='mini' type='text'>
                     删除
                   </el-button>
                 </el-popconfirm>
@@ -551,7 +556,7 @@ export default {
         type: 'warning'
       })
         .then(() => {
-          let ids = this.recordSelected.map(item => {
+          const ids = this.recordSelected.map(item => {
             return item.parentId
           })
           deleteCom({ ids: ids.join(',') }).then(res => {