guarantee-lsq vor 2 Jahren
Ursprung
Commit
bdb587bc18

+ 29 - 5
src/views/repair/application-form/modules/DetailRepair.vue

@@ -264,7 +264,7 @@
         <a-button v-if="$auth('repair-application-forms-dispatch') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.RECEIVED === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.MM_DISPATCH === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.DISPATCH_REPAIR === model.status)" style="margin-left: 16px" type="default" @click="handleAssign">派单</a-button>
         <a-button v-if="(DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REPAIR_FAIL === model.status)" style="margin-left: 16px" type="default" @click="reportRepair">维修上报</a-button>
         <a-button v-if="(DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REPAIR_FAIL === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.MM_REPAIR_FAIL === model.status)" style="margin-left: 16px" type="default" @click="handleReportRepair">处理维修上报</a-button>
-        <a-button v-if="$auth('repair-application-forms-finish') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.WAIT_SUBMIT === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REPAIR_FAIL === model.status)" style="margin-left: 8px" type="default" @click="handleTransfer()">转派</a-button>
+        <a-button v-if="$auth('repair-application-forms-finish') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.WAIT_SUBMIT === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REPAIR_FAIL === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.MM_REPAIR_FAIL === model.status)" style="margin-left: 8px" type="default" @click="handleTransfer()">转派</a-button>
         <a-button v-if="$auth('repair-application-forms-examine') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status" style="margin-left: 8px" type="default" @click="handleFinish()">完成维修</a-button>
         <a-button v-if="DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status" style="margin-left: 8px" type="default" @click="handleViewTicket()">维修票证</a-button>
         <a-popconfirm v-if="$auth('repair-application-forms-finish') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.WAIT_SUBMIT === model.status)" title="是否要结单?" @confirm="handleExamine">
@@ -886,8 +886,10 @@ export default {
       modal.base(null, this.model)
     },
     handleTransfer () {
-      const modal = this.$refs.transferForm
-      modal.base(this.model)
+      getSelfRole().then(res => {
+        const modal = this.$refs.transferForm
+        modal.base(this.model, res.data)
+      })
     },
     handleAddFee () {
       const modal = this.$refs.feeForm
@@ -1112,8 +1114,30 @@ export default {
       modal.base(this.model)
     },
     handleAssign () {
-      const modal = this.$refs.assignForm
-      modal.base(this.model)
+      getSelfRole().then(res => {
+        const roleType = res.data // 获取当前用户的角色
+        if (roleType === 4) {
+          const modal = this.$refs.reportUpForm
+          const params = {}
+          params.id = this.model.id
+          params.repairDeptId = this.model.repairDeptId
+          params.applyTime = this.model.applyTime
+          params.userId = this.model.userId
+          params.no = this.model.no
+          params.sbId = this.model.sbId
+          params.sbCph = this.model.sbCph
+          params.actualUser = this.model.actualUser
+          params.content = this.model.content
+          params.repairUserId = this.model.repairUserId
+          params.remark = this.model.remarkTwo
+          params.reportHandleType = 1 // 处理维修上报
+          params.roleType = 4
+          modal.base(params)
+        } else {
+          const modal = this.$refs.assignForm
+          modal.base(this.model)
+        }
+      })
     },
     handleSparePick () {
       const modal = this.$refs.baseModal

+ 5 - 2
src/views/repair/application-form/modules/TransferForm.vue

@@ -57,6 +57,7 @@ export default {
       modalTitle: null,
       form: this.$form.createForm(this),
       visible: false,
+      roleType: null,
       // 下拉框map
       record: {},
       roleUserMap: []
@@ -68,13 +69,14 @@ export default {
     // 下拉框map
   },
   methods: {
-    base (record) {
+    base (record, roleType) {
       this.visible = true
       // 如果是空标识添加
       this.modalTitle = '转派申请'
       this.record = record
+      this.roleType = roleType
       // 转派工程师集合查询
-      const params = { roleType: 2, deptId: record.repairDeptId, queryType: 1 }
+      const params = { roleType: this.roleType, deptId: record.repairDeptId, queryType: 1 }
       this.getUsers(params)
     },
     save () {
@@ -93,6 +95,7 @@ export default {
         values.status = this.record.status
         values.content = this.record.content
         values.actualUser = this.record.actualUser
+        values.roleType = this.roleType
         transferApplyByDTO(values)
           .then(() => {
             this.handleCancel(values)