Bläddra i källkod

备件申购流程新增超级管理员

Shan9312 3 veckor sedan
förälder
incheckning
645d84363e

BIN
dist-测试-现代-1102.zip


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
dist/index.html


+ 1 - 0
src/store/getters.js

@@ -6,6 +6,7 @@ const getters = {
   name: state => state.user.name,
   roles: state => state.user.roles,
   buttons: state => state.user.buttons,
+  mainpasture: state => state.user.mainpasture,
   pastureid: state => state.user.pastureid,
   pasturename: state => state.user.pasturename,
   pasturenumber: state => state.user.pasturenumber,

+ 9 - 1
src/store/modules/user.js

@@ -10,6 +10,7 @@ const state = {
   name: '',
   avatar: '',
   pastureid: '',
+  mainpasture:'',
   pasturename: '',
   pasturenumber: '',
   employename: '',
@@ -42,6 +43,10 @@ const mutations = {
     Cookies.set('pastureid', pastureid)
     state.pastureid = pastureid
   },
+  SET_MAINPASTURE: (state, mainpasture) => {
+    Cookies.set('mainpasture', mainpasture)
+    state.mainpasture = mainpasture
+  },
   SET_PASTURENAME: (state, pasturename) => {
     Cookies.set('pasturename', pasturename)
     state.pasturename = pasturename
@@ -173,6 +178,7 @@ const actions = {
               Cookies.remove('employename')
               Cookies.remove('employeid')
               Cookies.remove('pastureid')
+              Cookies.remove('mainpasture')
               removeToken()
               resetRouter()
               resolve()
@@ -202,7 +208,9 @@ const actions = {
 
         GetDataByName({ 'name': 'findByUserPastureName', 'parammaps': { 'jwt_username': username }}).then(response => {
           if (response.data.list.length > 0) {
+            console.log(response.data.list[0],'99999999====')
             commit('SET_PASTUREID', response.data.list[0].pastureId)
+            commit('SET_MAINPASTURE', response.data.list[0].mainpasture)
             commit('SET_PASTURENAME', response.data.list[0].pastureName)
             commit('SET_PASTURENUMBER', response.data.list[0].pastureNumber)
             commit('SET_EMPLOYEID', response.data.list[0].employeId)
@@ -212,7 +220,7 @@ const actions = {
             commit('SET_DEPIDS', response.data.list[0].depIds)
             Cookies.set('gempid', response.data.list[0].employeId)
             Cookies.set('gdepartmentname', response.data.list[0].departmentName)
-
+            Cookies.set('mainpasture', response.data.list[0].mainpasture)
             Cookies.set('gshebquanx','0')
             // 接口判断是不是设备主管权限
             GetDataByName({ 'name': 'getIsDirectorOfEquipment', 'parammaps': { 'empId': response.data.list[0].employeId }}).then(response => {

+ 12 - 4
src/views/custom/outStock/index.vue

@@ -1121,6 +1121,7 @@ export default {
   data() {
     return {
       numList: [], // 青贮出库订单号
+      parueidIndex: '', // 当前赛场的id
       myHeight: document.documentElement.clientHeight - 85 - 250,
       isSap: 1,
       isSrm: 1,
@@ -1471,15 +1472,14 @@ export default {
     })
     this.get_select_list()
     this.getTypeList()
-    // 获取订单号
-    this.getNumberArr()
+
   },
 
   methods: {
     // 获取订单号数据
-    async getNumberArr() {
+    async getNumberArr(id) {
       const params = {
-        pastureId: Cookies.get('pastureid')
+        pastureId: id
       }
       const data = await getNumList(params)
       this.numList = data.data
@@ -1689,6 +1689,10 @@ export default {
         })
         this.get_table_data()
         this.getDepartDownList()
+
+        this.parueidIndex = response.data.findAllMainPasture.list[0].id || Cookies.get('pastureid')
+        // 获取订单号
+        this.getNumberArr(this.parueidIndex)
       })
     },
     getDepartDownList() {
@@ -1719,6 +1723,7 @@ export default {
     },
     changePasture(item) {
       this.getDepartParam.parammaps.pastureId = item
+      this.requestUseForm.parammaps.pastureId = item
       this.edit = 1
       this.getCreateDepartDownList()
       const arr = [
@@ -1730,6 +1735,9 @@ export default {
         this.findAllEmploye = response.data.findAllEmploye.list
         // this.findAllDepart = response.data.findAllDepart.list
       })
+      // 获取订单号
+      this.getNumberArr(item)
+      this.getNumber()
     },
     changeDepart(item) {
       this.createTemp.departmentName = this.createDepartList.find(obj => obj.id == item).name

+ 73 - 47
src/views/custom/subscribe/index.vue

@@ -282,7 +282,7 @@
 
           <!-- 设备 -->
           <el-button
-            v-if="isSubscribeExamineSBZG && row.statue == 3 && !row.isPasturd"
+            v-if="isSubscribeExamineSBZG && row.statue == 3 &&  (!row.isPasturd || row.isRolePasturd )"
             style="display: inline-block"
             type="success"
             size="mini"
@@ -304,7 +304,7 @@
               sdchangzhangshenhe &&
                 row.statue == 5 &&
                 row.departmentName == '挤奶处' &&
-                row.examine == 1  && !row.isPasturd
+                row.examine == 1  && (!row.isPasturd || row.isRolePasturd )
             "
             style="display: inline-block"
             type="success"
@@ -315,7 +315,7 @@
             v-else-if="
               sdchangzhangshenhe &&
                 row.statue == 5 &&
-                row.departmentName !== '挤奶处'  && !row.isPasturd
+                row.departmentName !== '挤奶处' && (!row.isPasturd || row.isRolePasturd )
             "
             style="display: inline-block"
             type="success"
@@ -325,7 +325,7 @@
 
           <!-- 采购 -->
           <el-button
-            v-if="isSubscribeExamineCG && (row.statue == 11 || row.statue == 15) && row.isPasturd"
+            v-if="isSubscribeExamineCG && (row.statue == 11 || (row.departmentName == '挤奶处' && row.statue == 15)) && row.isPasturd"
             style="display: inline-block"
             type="success"
             size="mini"
@@ -335,7 +335,7 @@
           <!-- 财务 -->
           <el-button
             v-if="
-              isSubscribeExamineCW && row.purchase_type == 1 && row.statue == 7  && !row.isPasturd
+              isSubscribeExamineCW && row.purchase_type == 1 && row.statue == 7  && (!row.isPasturd || row.isRolePasturd )
             "
             style="display: inline-block"
             type="success"
@@ -347,7 +347,7 @@
             v-if="
               isSubscribeExamineNT &&
                 row.departmentName == '挤奶处' &&
-                ((row.examine !== 1 && row.statue == 5) || row.statue == 11)  && !row.isPasturd
+                ((row.examine !== 1 && row.statue == 5) || row.statue == 11)  &&  (!row.isPasturd || row.isRolePasturd )
             "
             style="display: inline-block"
             type="success"
@@ -1232,6 +1232,7 @@
       :title="textMap[dialogStatus]"
       :visible.sync="dialogFormVisibleSee"
       :close-on-click-modal="false"
+      :before-close="handleCancel"
       width="90%"
     >
       <div class="app-containerSee">
@@ -1584,7 +1585,7 @@
                   v-if="
                     isSubscribeExamineKG &&
                     seeTemp.statue == 2 &&
-                    (seeTemp.departmentName == '挤奶处' && seeTemp.isPasturd)
+                    (seeTemp.departmentName == '挤奶处' && (seeTemp.isPasturd || seeTemp.isRolePasturd ))
                   "
                   type="success"
                   style="display: inline-block"
@@ -1592,7 +1593,7 @@
                 >审核</el-button>
                 <!-- 设备 -->
                 <el-button
-                  v-if="isSubscribeExamineSBZG && seeTemp.statue == 3 && !seeTemp.isPasturd"
+                  v-if="isSubscribeExamineSBZG && seeTemp.statue == 3 &&  (!seeTemp.isPasturd || seeTemp.isRolePasturd )"
                   type="success"
                   style="display: inline-block"
                   @click="handleExamine2(row)"
@@ -1611,7 +1612,7 @@
                     sdchangzhangshenhe &&
                       seeTemp.statue == 5 &&
                       seeTemp.departmentName == '挤奶处' &&
-                      seeTemp.examine == 1 && seeTemp.isPasturd
+                      seeTemp.examine == 1 && (!seeTemp.isPasturd || seeTemp.isRolePasturd )
                   "
                   type="success"
                   style="display: inline-block"
@@ -1621,7 +1622,7 @@
                   v-else-if="
                     sdchangzhangshenhe &&
                       seeTemp.statue == 5 &&
-                      seeTemp.departmentName !== '挤奶处' &&  !seeTemp.isPasturd
+                      seeTemp.departmentName !== '挤奶处' &&  (!seeTemp.isPasturd || seeTemp.isRolePasturd )
                   "
                   type="success"
                   style="display: inline-block"
@@ -1630,7 +1631,7 @@
 
                 <!-- 采购 -->
                 <el-button
-                  v-if="isSubscribeExamineCG && (seeTemp.statue == 11 || seeTemp.statue == 15) && seeTemp.isPasturd"
+                  v-if="isSubscribeExamineCG && (seeTemp.statue == 11 || (seeTemp.departmentName == '挤奶处' && seeTemp.statue == 15)) && seeTemp.isPasturd"
                   type="success"
                   style="display: inline-block"
                   @click="handleExamine5(row)"
@@ -1641,7 +1642,7 @@
                   v-if="
                     isSubscribeExamineCW &&
                       seeTemp.purchase_type == 1 &&
-                      seeTemp.statue == 7 &&  !seeTemp.isPasturd
+                      seeTemp.statue == 7 &&  (!seeTemp.isPasturd || seeTemp.isRolePasturd )
                   "
                   style="display: inline-block"
                   type="success"
@@ -1654,7 +1655,7 @@
                     isSubscribeExamineNT &&
                       seeTemp.departmentName == '挤奶处' &&
                       ((seeTemp.examine !== 1 && seeTemp.statue == 5) ||
-                      seeTemp.statue == 11)  && !seeTemp.isPasturd
+                      seeTemp.statue == 11)  && (!seeTemp.isPasturd || seeTemp.isRolePasturd )
                   "
                   style="display: inline-block"
                   type="success"
@@ -2432,7 +2433,7 @@
                 >审核</el-button>
                 <!-- 设备 -->
                 <el-button
-                  v-if="isSubscribeExamineSBZG && seeTemp.statue == 3 && !seeTemp.isPasturd"
+                  v-if="isSubscribeExamineSBZG && seeTemp.statue == 3 &&  (!seeTemp.isPasturd || seeTemp.isRolePasturd )"
                   type="success"
                   style="display: inline-block"
                   @click="handleExamine2(row)"
@@ -2451,7 +2452,7 @@
                     sdchangzhangshenhe &&
                       seeTemp.statue == 5 &&
                       seeTemp.departmentName == '挤奶处' &&
-                      seeTemp.examine == 1  && !seeTemp.isPasturd
+                      seeTemp.examine == 1  && (!seeTemp.isPasturd || seeTemp.isRolePasturd )
                   "
                   type="success"
                   style="display: inline-block"
@@ -2461,7 +2462,7 @@
                   v-else-if="
                     sdchangzhangshenhe &&
                       seeTemp.statue == 5 &&
-                      seeTemp.departmentName !== '挤奶处'  && !seeTemp.isPasturd
+                      seeTemp.departmentName !== '挤奶处' && (!seeTemp.isPasturd || seeTemp.isRolePasturd )
                   "
                   type="success"
                   style="display: inline-block"
@@ -2470,17 +2471,17 @@
 
                 <!-- 采购 -->
                 <el-button
-                  v-if="isSubscribeExamineCG && (seeTemp.statue == 11 || seeTemp.statue == 15) && seeTemp.isPasturd"
+                  v-if="isSubscribeExamineCG && (seeTemp.statue == 11 || (seeTemp.departmentName == '挤奶处' && seeTemp.statue == 15)) && seeTemp.isPasturd"
                   type="success"
                   style="display: inline-block"
                   @click="handleExamine5(row)"
-                >审核tt</el-button>
+                >审核</el-button>
                 <!-- 财务 -->
                 <el-button
                   v-if="
                     isSubscribeExamineCW &&
                       seeTemp.purchase_type == 1 &&
-                      seeTemp.statue == 7  && !seeTemp.isPasturd
+                      seeTemp.statue == 7  &&  (!seeTemp.isPasturd || seeTemp.isRolePasturd )
                   "
                   style="display: inline-block"
                   type="success"
@@ -2492,7 +2493,7 @@
                     isSubscribeExamineNT &&
                       seeTemp.departmentName == '挤奶处' &&
                       ((seeTemp.examine !== 1 && seeTemp.statue == 5) ||
-                      seeTemp.statue == 11)  && !seeTemp.isPasturd
+                      seeTemp.statue == 11)  &&  (!seeTemp.isPasturd || seeTemp.isRolePasturd )
                   "
                   style="display: inline-block"
                   type="success"
@@ -2779,7 +2780,8 @@ export default {
       },
       BrandList: [],
       isDepartmentId: false ,// 部门是挤奶处且点击新增按钮
-      isPasturd: false,
+      isPasturd: false, // 不是赛四权限
+      isRolePasturd: false, // 是赛四所有权限
     }
   },
 
@@ -2801,6 +2803,11 @@ export default {
   },
 
   methods: {
+    // 关闭查看弹窗
+    handleCancel() {
+      this.dialogFormVisibleSee = false;
+      this.get_table_data()
+    },
     tableSort(column) {
       sortChange(column, this.listSee)
     },
@@ -2986,13 +2993,22 @@ export default {
         if (response.data.list !== null) {
           console.log('table数据', response.data.list)
           this.list = response.data.list.map((item) => {
+              item.isPasturd = false
+              item.isRolePasturd = false
+              // this.$set(item,isPasturd,false );
+              // this.$set(item,isRolePasturd,false );
               // 如果当前登陆者是订单的负责人,则展示审核按钮,否则不展示
               // 如果不是赛四 不可库管审核
               // 如果是设备 可审核
-            if (item.pastureId != Cookies.get('pastureid')) {
+            if( item.pastureId != Cookies.get('pastureid') ) {
               item.isPasturd = true
-            } else {
+              item.isRolePasturd = false
+            } else if (item.pastureId == Cookies.get('mainpasture')) {
+              item.isPasturd = true
+              item.isRolePasturd = true
+            }else {
               item.isPasturd = false
+              item.isRolePasturd = false
             }
             return item;
           })
@@ -3024,7 +3040,8 @@ export default {
           loginId: Cookies.get('employeid'),
           menu: 'Subscribe',
           logindeptId: Cookies.get('departmentid'),
-          loginpastureId: Cookies.get('pastureid')
+          loginpastureId: Cookies.get('pastureid'),
+          pastureId:this.getdataListParm.parammaps.pastureId || Cookies.get('pastureid'),
         }
         this.get_table_data()
       } else if (this.radioAll === '待处理') {
@@ -3043,7 +3060,7 @@ export default {
           logindeptId: Cookies.get('departmentid'),
           loginpastureId: Cookies.get('pastureid'),
           empId: Cookies.get('employeid'),
-          pastureId: Cookies.get('pastureid'),
+          pastureId:this.getdataListParm.parammaps.pastureId || Cookies.get('pastureid'),
           deptId: Cookies.get('departmentid')
         }
         this.get_table_data()
@@ -3063,7 +3080,7 @@ export default {
           logindeptId: Cookies.get('departmentid'),
           loginpastureId: Cookies.get('pastureid'),
           empId: Cookies.get('employeid'),
-          pastureId: Cookies.get('pastureid'),
+          pastureId:this.getdataListParm.parammaps.pastureId || Cookies.get('pastureid'),
           deptId: Cookies.get('departmentid')
         }
         this.get_table_data()
@@ -3355,7 +3372,7 @@ export default {
       GetDataByName(this.seepart.getdataListParm).then((response) => {
         if (response.data.list !== null) {
           console.log('table数据', response.data.list)
-          this.seepartList = response.data.list
+          this.seepartList = response.data.list;
           this.seepart.pageNum = response.data.pageNum
           this.seepart.pageSize = response.data.pageSize
         } else {
@@ -4003,13 +4020,19 @@ export default {
       this.getdataListSee.parammaps.empId = ''
       this.isApplyEx4 = false
       this.getSeeList()
-      if (row.pastureId != Cookies.get('pastureid')) {
-        row.isPasturd = true
-      } else {
-        row.isPasturd = false
-      }
+      // // 赛四是同id 反之不同id
+      // if( row.pastureId != Cookies.get('pastureid') ) {
+      //       row.isPasturd = true
+      //       row.isRolePasturd = false
+      //     } else if ( Cookies.get('pastureid') == Cookies.get('mainpasture')) {
+      //       row.isPasturd = true
+      //       row.isRolePasturd = true
+      //     }else {
+      //       row.isPasturd = false
+      //       row.isRolePasturd = false
+      //     }
       this.seeTemp = Object.assign({}, row)
-      console.log('查看上方数据(从table读取)123', this.seeTemp)
+      console.log('查看=======hss',this.seeTemp,this.list)
 
     },
     getFlowPath() {
@@ -5874,9 +5897,9 @@ export default {
             console.log('审核确认发送参数', this.requestParam)
             this.isokDisable = false
             if (response.msg !== 'fail') {
-              this.get_table_data()
+              // this.get_table_data()
               this.dialogFormVisible_Examine = false
-              this.dialogFormVisible_See = false
+              this.handleCancel()
               this.statueReason = false
               this.$notify({
                 title: '成功',
@@ -5931,9 +5954,9 @@ export default {
             this.isokDisable = false
             console.log('审核确认发送参数', this.requestParam)
             if (response.msg !== 'fail') {
-              this.get_table_data()
+              // this.get_table_data()
               this.dialogFormVisible_Examine = false
-              this.dialogFormVisible_See = false
+             this.handleCancel()
               this.statueReason = false
               this.$notify({
                 title: '成功',
@@ -6013,9 +6036,9 @@ export default {
             console.log('审核确认发送参数', this.requestParam)
             this.isokDisable = false
             if (response.msg !== 'fail') {
-              this.get_table_data()
+              // this.get_table_data()
               this.dialogFormVisible_Examine = false
-              this.dialogFormVisible_See = false
+              this.handleCancel()
               this.statueReason = false
               this.$notify({
                 title: '成功',
@@ -6093,9 +6116,11 @@ export default {
           ExecDataByConfig(this.requestParam).then((response) => {
             this.isokDisable = false
             if (response.msg !== 'fail') {
-              this.get_table_data()
+              // this.get_table_data()
               this.dialogFormVisible_Examine = false
-              this.dialogFormVisible_See = false
+              this.handleCancel()
+              // this.dialogFormVisible_See = false
+              // this.dialogFormVisible2 = false
               this.statueReason = false
               this.$notify({
                 title: '成功',
@@ -6197,9 +6222,9 @@ export default {
           ExecDataByConfig(this.requestParam).then((response) => {
             this.isokDisable = false
             if (response.msg !== 'fail') {
-              this.get_table_data()
+              // this.get_table_data()
               this.dialogFormVisible_Examine = false
-              this.dialogFormVisible_See = false
+               this.handleCancel()
               this.statueReason = false
               this.$notify({
                 title: '成功',
@@ -6253,9 +6278,9 @@ export default {
             console.log('审核确认发送参数', this.requestParam)
             this.isokDisable = false
             if (response.msg !== 'fail') {
-              this.get_table_data()
+              // this.get_table_data()
               this.dialogFormVisible_Examine = false
-              this.dialogFormVisible_See = false
+              this.handleCancel()
               this.statueReason = false
               this.$notify({
                 title: '成功',
@@ -6309,9 +6334,9 @@ export default {
             console.log('审核确认发送参数', this.requestParam)
             this.isokDisable = false
             if (response.msg !== 'fail') {
-              this.get_table_data()
+              // this.get_table_data()
               this.dialogFormVisible_Examine = false
-              this.dialogFormVisible_See = false
+              this.handleCancel()
               this.statueReason = false
               this.$notify({
                 title: '成功',
@@ -6319,6 +6344,7 @@ export default {
                 type: 'success',
                 duration: 2000
               })
+
             } else {
               failproccess(response, this.$notify)
             }

Vissa filer visades inte eftersom för många filer har ändrats