Ver Fonte

前端: 一键审批按钮优化

baichengfei há 4 anos atrás
pai
commit
0c312bbd3b

+ 6 - 4
src/dashoo.cn/frontend_web/src/components/oilcontract/submitPopup.vue

@@ -174,6 +174,10 @@ export default {
         return {}
       }
     },
+    tableLoading: {
+      type: Boolean,
+      default: false
+    },
     examineType: {
       type: Number,
       default: 0
@@ -323,6 +327,7 @@ export default {
             type: 'success',
             message: res.data.message
           })
+          // _this.$emit('tableLoading', {})
           setTimeout(function () {
             _this.$nextTick(() => {
               _this.$emit('refreshPage', {})
@@ -382,6 +387,7 @@ export default {
             type: 'success',
             message: res.data.message
           })
+          // _this.$emit('tableLoading', {})
           setTimeout(function () {
             _this.$nextTick(() => {
               _this.$emit('refreshPage', {})
@@ -483,11 +489,9 @@ export default {
     },
     orgtreeChange (val) {
       this.userOptions = []
-      console.log(val, '22222222')
       let deptid = val[val.length - 1]
       let auditstepcode = 'PROF_RECE'
       api.getAuditerByDept(deptid, auditstepcode, this.$axios).then(res => {
-        console.log('专业处室人111', res)
         this.userOptions = res.data.item
       }).catch(err => {
         console.error(err)
@@ -495,7 +499,6 @@ export default {
     },
 
     getFirAuditerByDept () {
-      console.log('submitPopup')
       let deptId = this.authUser.Profile.DepartmentId
       this.userOptions = []
       let auditStepCode = 'FIRST_TRIAL' // 初审人
@@ -582,7 +585,6 @@ export default {
     changeOrgUnit (val) {
       let auditstepcode = 'PROF_RECE'
       api.getAuditerByDept(val, auditstepcode, this.$axios).then(res => {
-        console.log('专业处室人222', res)
         this.userOptions = res.data.item
       }).catch(err => {
         console.error(err)

+ 22 - 10
src/dashoo.cn/frontend_web/src/pages/oilcontract/contract-basis/index.vue

@@ -15,7 +15,15 @@
           </router-link> -->
           <!-- <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="exportExcel">导出</el-button> -->
           <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;"
-                     v-if="!selectAllButtonBoolean&&userSelectBoolean" @click="onSelectAllButton">一键审批</el-button>
+                     v-if="!selectAllButtonBoolean&&userSelectBoolean&&firstBatchPerm" @click="onSelectAllButton(1)">一键初审</el-button>
+          <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;"
+                     v-if="!selectAllButtonBoolean&&userSelectBoolean&&secondBatchPerm" @click="onSelectAllButton(2)">一键复审</el-button>
+          <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;"
+                     v-if="!selectAllButtonBoolean&&userSelectBoolean&&busSepBatchPerm" @click="onSelectAllButton(3)">一键分办</el-button>
+          <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;"
+                     v-if="!selectAllButtonBoolean&&userSelectBoolean&&busAuditBatchPerm" @click="onSelectAllButton(4)">一键审核(业务)</el-button>
+          <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;"
+                     v-if="!selectAllButtonBoolean&&userSelectBoolean&&profRegBatchPerm" @click="onSelectAllButton(7)">一键审批(企管)</el-button>
           <el-button type="info" size="mini" style="margin-left:10px; margin-top: -4px;" v-if="selectAllButtonBoolean"
                      @click="onSelectAllButtonDelete">取消</el-button>
           <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;"
@@ -216,7 +224,7 @@
     </el-dialog>
 
     <!-- :selectDeptBoolean="false"-->
-    <submit-popup ref="submitpopup" :eveId="eveIdList" :formData="formData" @refreshPage="initDatas"></submit-popup>
+    <submit-popup ref="submitpopup" :eveId="eveIdList" :formData="formData" @refreshPage="initDatas" @tableLoading="changeTableLoading"></submit-popup>
 
   </div>
 </template>
@@ -295,6 +303,7 @@ export default {
   },
   data () {
     return {
+      selectedAuditBtn: '',
       auditOptions: [
         {
           value: 0,
@@ -512,6 +521,9 @@ export default {
     // }
   },
   methods: {
+    changeTableLoading () {
+      this.tableLoading = true
+    },
     getYearList () {
       let now = new Date()
       let nowYear = now.getFullYear()
@@ -541,7 +553,6 @@ export default {
     },
     // 一键处理
     onSelectAll (e) {
-      console.log(e)
       var list = []
       e.map((item, index) => {
         list.push(item.Id)
@@ -550,28 +561,29 @@ export default {
     },
     // 筛选
     selectableFun (row, index) {
-      if (row.Status == 1 && this.firstBatchPerm) {
+      if (row.Status == 1 && this.firstBatchPerm && row.Status == this.selectedAuditBtn) {
         return true
-      } else if (row.Status == 2 && this.secondBatchPerm) {
+      } else if (row.Status == 2 && this.secondBatchPerm && row.Status == this.selectedAuditBtn) {
         return true
-      } else if (row.Status == 3 && this.busSepBatchPerm) {
+      } else if (row.Status == 3 && this.busSepBatchPerm && row.Status == this.selectedAuditBtn) {
         return true
-      } else if (row.Status == 4 && this.busAuditBatchPerm) {
+      } else if (row.Status == 4 && this.busAuditBatchPerm && row.Status == this.selectedAuditBtn) {
         return true
-      } else if (row.Status == 7 && this.profRegBatchPerm) {
+      } else if (row.Status == 7 && this.profRegBatchPerm && row.Status == this.selectedAuditBtn) {
         return true
       } else {
         return false
       }
     },
     // 一键处理按钮
-    onSelectAllButton () {
+    onSelectAllButton (val) {
+      this.selectedAuditBtn = val
       this.selectAllButtonBoolean = true
     },
     // 一键处理确定
     onSelectAllButtonTrue () {
       if (this.eveIdList != 0 && this.eveIdList != undefined) {
-        if (this.busSepBatchPerm && !this.firstBatchPerm && !this.secondBatchPerm && !this.busAuditBatchPerm && !this.profRegBatchPerm) {
+        if (this.selectedAuditBtn === 3) {
           this.formData.Status = '3'
           this.$refs.submitpopup.auditOrgChange()
           this.$refs.submitpopup.dialogBusinessOfficeSeparateBatchAuditVisible = true

+ 22 - 11
src/dashoo.cn/frontend_web/src/pages/oilcontract/contract-goods/index.vue

@@ -15,7 +15,15 @@
           </router-link> -->
           <!-- <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="exportExcel">导出</el-button> -->
           <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;"
-                     v-if="!selectAllButtonBoolean&&userSelectBoolean" @click="onSelectAllButton">一键审批</el-button>
+                     v-if="!selectAllButtonBoolean&&userSelectBoolean&&firstBatchPerm" @click="onSelectAllButton(1)">一键初审</el-button>
+          <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;"
+                     v-if="!selectAllButtonBoolean&&userSelectBoolean&&secondBatchPerm" @click="onSelectAllButton(2)">一键复审</el-button>
+          <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;"
+                     v-if="!selectAllButtonBoolean&&userSelectBoolean&&busSepBatchPerm" @click="onSelectAllButton(3)">一键分办</el-button>
+          <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;"
+                     v-if="!selectAllButtonBoolean&&userSelectBoolean&&busAuditBatchPerm" @click="onSelectAllButton(4)">一键审核(业务)</el-button>
+          <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;"
+                     v-if="!selectAllButtonBoolean&&userSelectBoolean&&profRegBatchPerm" @click="onSelectAllButton(7)">一键审批(企管)</el-button>
           <el-button type="info" size="mini" style="margin-left:10px; margin-top: -4px;" v-if="selectAllButtonBoolean"
                      @click="onSelectAllButtonDelete">取消</el-button>
           <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;"
@@ -110,7 +118,7 @@
     </el-card>
 
     <!-- :selectDeptBoolean="false"-->
-    <submit-popup ref="submitpopup" :eveId="eveIdList" :formData="formData" @refreshPage="initDatas"></submit-popup>
+    <submit-popup ref="submitpopup" :eveId="eveIdList" :formData="formData" @refreshPage="initDatas" @tableLoading="changeTableLoading"></submit-popup>
 
     <el-dialog title="高级查询" :visible.sync="dialogVisible" width="720px">
       <el-form ref="advancedsearchForm" label-width="110px">
@@ -290,6 +298,7 @@ export default {
   },
   data () {
     return {
+      selectedAuditBtn: '',
       auditOptions: [
         {
           value: 0,
@@ -501,6 +510,9 @@ export default {
     this.statusFun()
   },
   methods: {
+    changeTableLoading () {
+      this.tableLoading = true
+    },
     getYearList () {
       let now = new Date()
       let nowYear = now.getFullYear()
@@ -508,7 +520,6 @@ export default {
     },
     getBatchAuditPerm () {
       permissionApi.getBatchAuditPermission(this.$axios).then(res => {
-        console.log('所以权限', res.data)
         if (res.status === 200) {
           this.firstBatchPerm = res.data[0]
           this.secondBatchPerm = res.data[1]
@@ -531,7 +542,6 @@ export default {
     },
     // 一键处理
     onSelectAll (e) {
-      console.log(e)
       var list = []
       e.map((item, index) => {
         list.push(item.Id)
@@ -540,28 +550,29 @@ export default {
     },
     // 筛选
     selectableFun (row, index) {
-      if (row.Status == 1 && this.firstBatchPerm) {
+      if (row.Status == 1 && this.firstBatchPerm && row.Status == this.selectedAuditBtn) {
         return true
-      } else if (row.Status == 2 && this.secondBatchPerm) {
+      } else if (row.Status == 2 && this.secondBatchPerm && row.Status == this.selectedAuditBtn) {
         return true
-      } else if (row.Status == 3 && this.busSepBatchPerm) {
+      } else if (row.Status == 3 && this.busSepBatchPerm && row.Status == this.selectedAuditBtn) {
         return true
-      } else if (row.Status == 4 && this.busAuditBatchPerm) {
+      } else if (row.Status == 4 && this.busAuditBatchPerm && row.Status == this.selectedAuditBtn) {
         return true
-      } else if (row.Status == 7 && this.profRegBatchPerm) {
+      } else if (row.Status == 7 && this.profRegBatchPerm && row.Status == this.selectedAuditBtn) {
         return true
       } else {
         return false
       }
     },
     // 一键处理按钮
-    onSelectAllButton () {
+    onSelectAllButton (val) {
+      this.selectedAuditBtn = val
       this.selectAllButtonBoolean = true
     },
     // 一键处理确定
     onSelectAllButtonTrue () {
       if (this.eveIdList != 0 && this.eveIdList != undefined) {
-        if (this.busSepBatchPerm && !this.firstBatchPerm && !this.secondBatchPerm && !this.busAuditBatchPerm && !this.profRegBatchPerm) {
+        if (this.selectedAuditBtn === 3) {
           this.formData.Status = '3'
           this.$refs.submitpopup.auditOrgChange()
           this.$refs.submitpopup.dialogBusinessOfficeSeparateBatchAuditVisible = true

+ 24 - 10
src/dashoo.cn/frontend_web/src/pages/oilcontract/contract-service/index.vue

@@ -15,7 +15,15 @@
           </router-link> -->
           <!-- <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="exportExcel">导出</el-button> -->
           <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;"
-                     v-if="!selectAllButtonBoolean&&userSelectBoolean" @click="onSelectAllButton">一键审批</el-button>
+                     v-if="!selectAllButtonBoolean&&userSelectBoolean&&firstBatchPerm" @click="onSelectAllButton(1)">一键初审</el-button>
+          <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;"
+                     v-if="!selectAllButtonBoolean&&userSelectBoolean&&secondBatchPerm" @click="onSelectAllButton(2)">一键复审</el-button>
+          <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;"
+                     v-if="!selectAllButtonBoolean&&userSelectBoolean&&busSepBatchPerm" @click="onSelectAllButton(3)">一键分办</el-button>
+          <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;"
+                     v-if="!selectAllButtonBoolean&&userSelectBoolean&&busAuditBatchPerm" @click="onSelectAllButton(4)">一键审核(业务)</el-button>
+          <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;"
+                     v-if="!selectAllButtonBoolean&&userSelectBoolean&&profRegBatchPerm" @click="onSelectAllButton(7)">一键审批(企管)</el-button>
           <el-button type="info" size="mini" style="margin-left:10px; margin-top: -4px;" v-if="selectAllButtonBoolean"
                      @click="onSelectAllButtonDelete">取消</el-button>
           <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;"
@@ -109,7 +117,7 @@
       </el-pagination>
     </el-card>
     <!-- :selectDeptBoolean="false"-->
-    <submit-popup ref="submitpopup" :selectDeptBoolean="false" :eveId="eveIdList" :formData="formData"
+    <submit-popup ref="submitpopup" :selectDeptBoolean="false" :eveId="eveIdList" :formData="formData" @tableLoading="changeTableLoading"
                   @refreshPage="initDatas"></submit-popup>
 
     <el-dialog title="高级查询" :close-on-click-modal="false" :visible.sync="dialogVisible" width="720px">
@@ -292,6 +300,7 @@ export default {
   },
   data () {
     return {
+      selectedAuditBtn: '',
       auditOptions: [
         {
           value: 0,
@@ -503,6 +512,11 @@ export default {
     this.statusFun()
   },
   methods: {
+    changeTableLoading (val) {
+      if (val === true) {
+        this.tableLoading = true
+      }
+    },
     getYearList () {
       let now = new Date()
       let nowYear = now.getFullYear()
@@ -532,7 +546,6 @@ export default {
     },
     // 一键处理
     onSelectAll (e) {
-      console.log(e)
       var list = []
       e.map((item, index) => {
         list.push(item.Id)
@@ -541,28 +554,29 @@ export default {
     },
     // 筛选
     selectableFun (row, index) {
-      if (row.Status == 1 && this.firstBatchPerm) {
+      if (row.Status == 1 && this.firstBatchPerm && row.Status == this.selectedAuditBtn) {
         return true
-      } else if (row.Status == 2 && this.secondBatchPerm) {
+      } else if (row.Status == 2 && this.secondBatchPerm && row.Status == this.selectedAuditBtn) {
         return true
-      } else if (row.Status == 3 && this.busSepBatchPerm) {
+      } else if (row.Status == 3 && this.busSepBatchPerm && row.Status == this.selectedAuditBtn) {
         return true
-      } else if (row.Status == 4 && this.busAuditBatchPerm) {
+      } else if (row.Status == 4 && this.busAuditBatchPerm && row.Status == this.selectedAuditBtn) {
         return true
-      } else if (row.Status == 7 && this.profRegBatchPerm) {
+      } else if (row.Status == 7 && this.profRegBatchPerm && row.Status == this.selectedAuditBtn) {
         return true
       } else {
         return false
       }
     },
     // 一键处理按钮
-    onSelectAllButton () {
+    onSelectAllButton (val) {
+      this.selectedAuditBtn = val
       this.selectAllButtonBoolean = true
     },
     // 一键处理确定
     onSelectAllButtonTrue () {
       if (this.eveIdList != 0 && this.eveIdList != undefined) {
-        if (this.busSepBatchPerm && !this.firstBatchPerm && !this.secondBatchPerm && !this.busAuditBatchPerm && !this.profRegBatchPerm) {
+        if (this.selectedAuditBtn === 3) {
           this.formData.Status = '3'
           this.$refs.submitpopup.auditOrgChange()
           this.$refs.submitpopup.dialogBusinessOfficeSeparateBatchAuditVisible = true