guarantee-lsq 2 years ago
parent
commit
27ce5a8ea4

+ 16 - 0
src/api/repair/application-form.js

@@ -266,6 +266,22 @@ export function approve (parameter) {
   })
 }
 
+export function receiveRepair (parameter) {
+  return axios({
+    url: '/repair/application-forms/receive/repair',
+    method: 'PUT',
+    data: parameter
+  })
+}
+
+export function reportRepair (parameter) {
+  return axios({
+    url: '/repair/application-forms/report/repair',
+    method: 'PUT',
+    data: parameter
+  })
+}
+
 /**
  * returnRepair func
  * parameter: { }

+ 10 - 0
src/api/upms/role.js

@@ -35,6 +35,16 @@ export function queryRole (parameter) {
   })
 }
 
+export function getSelfRole () {
+  return axios({
+    url: '/upms/roles/self/role',
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
 export function addRole (parameter) {
   return axios({
     url: `/upms/roles`,

+ 10 - 0
src/api/upms/user-dept.js

@@ -29,6 +29,16 @@ export function queryUserDept (parameter) {
   })
 }
 
+export function queryRepairUser (parameter) {
+  return axios({
+    url: `/upms/user-depts/user-dept/dept-code/repair?${stringify(parameter)}`,
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
 export function queryUserDeptByUserDeptId (parameter) {
   return axios({
     url: `/upms/user-depts/users/dept/${parameter.deptId}`,

+ 1 - 0
src/router/generator-platform-routers.js

@@ -178,6 +178,7 @@ const constantRouterComponents = {
   'RepairManagerCheckForm': () => import('@/views/repair/application-form/RepairManagerCheckForm'),
   'WaitAllocatedRepairForm': () => import('@/views/repair/application-form/WaitAllocatedRepairForm'),
   'WaitDispatchRepairForm': () => import('@/views/repair/application-form/WaitDispatchRepairForm'),
+  'ReportRepairForm': () => import('@/views/repair/application-form/ReportRepairForm'),
   // 验收单
   'RepairCheck': () => import('@/views/repair/check/RepairCheck'),
   // 故障类别

+ 7 - 2
src/utils/dict.js

@@ -859,7 +859,8 @@ DictCache.VALUE = {
     REBACK: 5, // 已驳回
     FINISHED: 6, // 已完成
     REFUSED_REPAIR: 7, // 报修被拒
-    REPAIR_FAIL: 8 // 维修失败,再次派工
+    REPAIR_FAIL: 8, // 维修上报
+    RECEIVED: 9 // 维修失败,再次派工
   },
   /**
    * 维修状态
@@ -1430,7 +1431,11 @@ DictCache.COLOR = {
     5: 'error', // 已驳回
     6: 'success', // 已完成
     7: 'error', // 报修被拒
-    8: 'processing' // 维修转派
+    8: 'processing', // 维修转派
+    9: 'warning', // 维修转派
+    10: 'error', // 维修转派
+    11: 'processing', // 转派维修
+    12: 'processing' // 维修转派
   },
   /**
    * 维修状态

+ 26 - 6
src/views/part/info/modules/BaseForm.vue

@@ -72,8 +72,22 @@
             </a-select>
           </a-form-item>
         </a-col>
-      </a-row>
-      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="关联维修部门"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select v-decorator="['repairDeptId', {rules: [{required: true, message: '维修部门不能为空'}]}]" placeholder="请选择">
+              <a-select-option
+                v-for="(label,value) in repairDeptMap"
+                :key="value"
+                :label="label"
+                :value="value">{{ label }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </a-col>
         <a-col :lg="12" :md="24" :sm="24">
           <a-form-item
             label="备注"
@@ -96,7 +110,6 @@
 import pick from 'lodash.pick'
 import { addPartInfo, updatePartInfo } from '@/api/part/info'
 import { fetchPartTypeTree } from '@/api/part/type'
-import BaseTool from '../../../../utils/tool'
 
 export default {
   name: 'BasePartInfo',
@@ -109,6 +122,7 @@ export default {
       form: this.$form.createForm(this),
       visible: false,
       type: 1,
+      oldPartName: null,
       sbTypeTreeData: [],
       producers: [],
       statusMap: {},
@@ -116,6 +130,7 @@ export default {
       levelMap: {},
       sourceTypeMap: {},
       guiges: [],
+      repairDeptMap: {},
       sbId: null
     }
   },
@@ -124,12 +139,14 @@ export default {
   created () {
     this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PART_STATUS)
     this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PART_LEVEL)
+    this.repairDeptMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_DEPT_CATEGORY)
     this.setOptions()
     this.setTree()
   },
   methods: {
     base (record, type) {
       this.visible = true
+      this.oldPartName = ''
       // 1新增,2复制
       this.type = type == null ? 1 : 2
       const { form: { setFieldsValue } } = this
@@ -137,7 +154,8 @@ export default {
       // 如果是空标识添加
       this.$nextTick(() => {
         setFieldsValue(Object.assign(pick(record, [
-          'sbId'
+          'sbId',
+          'repairDeptId'
         ])))
       })
       if (this.BaseTool.Object.isBlank(record.id)) {
@@ -150,6 +168,7 @@ export default {
       }
       if (this.BaseTool.Object.isNotBlank(record.id)) {
         this.modalTitle = '修改'
+        this.oldPartName = record.name
       }
       this.$nextTick(() => {
         setFieldsValue(Object.assign(pick(record, [
@@ -161,7 +180,8 @@ export default {
           'sbId',
           'unit',
           'status',
-          'remark'
+          'remark',
+          'repairDeptId'
         ])))
       })
     },
@@ -173,7 +193,6 @@ export default {
           this.confirmLoading = false
           return
         }
-        console.log(values)
         if (this.BaseTool.String.isBlank(values.id)) {
           addPartInfo(values)
             .then(() => {
@@ -182,6 +201,7 @@ export default {
               this.confirmLoading = false
             })
         } else {
+          values.oldPartName = this.oldPartName
           updatePartInfo(values)
             .then(() => {
               this.handleCancel(values)

+ 6 - 2
src/views/part/info/modules/Detail.vue

@@ -13,9 +13,10 @@
       <detail-list-item term="部位类别">{{ model.typeName }}</detail-list-item>
       <detail-list-item term="部位等级">{{ BaseTool.Object.getField(levelMap,model.level) }}</detail-list-item>
       <detail-list-item term="所属设备">{{ model.sbName }}</detail-list-item>
-      <detail-list-item term="备注">{{ model.remark }}</detail-list-item>
+      <detail-list-item term="关联维修部门">{{ BaseTool.Object.getField(repairDeptMap,model.repairDeptId) }}</detail-list-item>
       <detail-list-item term="创建人">{{ model.createdUserName }}</detail-list-item>
       <detail-list-item term="更新日期">{{ model.updateTime }}</detail-list-item>
+      <detail-list-item term="备注">{{ model.remark }}</detail-list-item>
     </detail-list>
 
     <template slot="footer">
@@ -40,6 +41,7 @@ export default {
       mdl: {},
       modalTitle: null,
       visible: false,
+      repairDeptMap: {},
       model: {
         'no': null,
         'name': null,
@@ -68,7 +70,8 @@ export default {
         'producerName': null,
         'guigeName': null,
         'typeName': null,
-        'sourceSbName': null
+        'sourceSbName': null,
+        'repairDeptId': null
       },
       statusMap: {},
       unitMap: {},
@@ -81,6 +84,7 @@ export default {
     this.unitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_UNIT)
     this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PART_LEVEL)
     this.sourceTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBTYPE_SOURCETYPE)
+    this.repairDeptMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_DEPT_CATEGORY)
   },
   methods: {
     base (record) {

+ 1 - 1
src/views/repair/application-form/MyRepairForm.vue

@@ -1,5 +1,5 @@
 <template>
-  <RepairForm :filter="0" :search-type="2"/>
+  <RepairForm :filter="0" :search-type="1"/>
 </template>
 
 <script>

+ 4 - 4
src/views/repair/application-form/RepairForm.vue

@@ -97,8 +97,8 @@
       >
         <span slot="action" slot-scope="record">
           <template>
-            <a @click="handleView(record)">查看</a>
-            <operation-button
+            <a @click="handleView(record)">维修主页</a>
+<!--            <operation-button
               v-show="editFlag"
               v-if="DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REFUSED_REPAIR === record.status && $auth('repair-application-forms-edit')"
               @click="handleEdit(record)" >再次报修</operation-button>
@@ -120,7 +120,7 @@
               v-if="$auth('repair-application-forms-deal') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ALLOCATED === record.status)"
               :type="2"
               title="是否要驳回?"
-              @confirm="handleRefused(record)">报修驳回</operation-button>
+              @confirm="handleRefused(record)">报修驳回</operation-button>-->
           </template>
         </span>
         <span slot="status" slot-scope="text">
@@ -308,7 +308,7 @@ export default {
           checked: true,
           fixed: 'right',
           key: 'action',
-          width: '250px',
+          width: '120px',
           align: 'center',
           scopedSlots: { customRender: 'action' }
         }

+ 17 - 0
src/views/repair/application-form/ReportRepairForm.vue

@@ -0,0 +1,17 @@
+<template>
+  <RepairForm :search-type="8"/>
+</template>
+
+<script>
+import RepairForm from './RepairForm'
+export default {
+  name: 'ReportRepairForm',
+  components: {
+    RepairForm
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 1 - 1
src/views/repair/application-form/WaitAllocatedRepairForm.vue

@@ -1,5 +1,5 @@
 <template>
-  <RepairForm :search-type="3"/>
+  <RepairForm :search-type="4"/>
 </template>
 
 <script>

+ 1 - 1
src/views/repair/application-form/WaitDispatchRepairForm.vue

@@ -1,5 +1,5 @@
 <template>
-  <RepairForm :search-type="4"/>
+  <RepairForm :search-type="7"/>
 </template>
 
 <script>

+ 1 - 1
src/views/repair/application-form/WaitRepairForm.vue

@@ -1,5 +1,5 @@
 <template>
-  <RepairForm :search-type="1"/>
+  <RepairForm :search-type="3"/>
 </template>
 
 <script>

+ 3 - 3
src/views/repair/application-form/modules/AssignForm.vue

@@ -22,11 +22,11 @@
         </row-item>
         <row-item>
           <a-form-item
-            label="维修负责人"
+            label="维修班组长"
             :labelCol="BaseTool.Constant.labelCol"
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
-            <a-select v-decorator="['repairUserId', {rules: [{required: true, message: '维修人负责人不能为空'}]}]" placeholder="请选择">
+            <a-select v-decorator="['repairUserId', {rules: [{required: true, message: '维修班组长不能为空'}]}]" placeholder="请选择">
               <a-select-option
                 v-for="item in deptUserList"
                 :key="item.userId"
@@ -40,7 +40,7 @@
       <row-list :col="1">
         <row-item>
           <a-form-item
-            label="维修建议"
+            label="工程师建议"
             :labelCol="BaseTool.Constant.labelCol"
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >

+ 31 - 18
src/views/repair/application-form/modules/BaseForm.vue

@@ -12,6 +12,7 @@
       <a-form-item v-show="false" >
         <a-input v-decorator="['id']" type="hidden"/>
         <a-input v-decorator="['sbId']" type="hidden"/>
+        <a-input v-decorator="['partId']" type="hidden"/>
       </a-form-item>
 
       <row-list :col="2">
@@ -28,6 +29,27 @@
             <a-button style="width: 30%" type="primary" @click="handleSbSelect">选择</a-button>
           </a-form-item>
         </row-item>
+        <row-item>
+          <a-form-item
+            label="设备部位"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              style="width: 70%"
+              disabled
+              v-decorator="['partName']" />
+            <a-button style="width: 30%" type="primary" @click="handlePartSelect">选择</a-button>
+<!--            <a-select v-decorator="['repairDeptId', {rules: [{required: true, message: '维修部门不能为空'}]}]" placeholder="请选择">
+              <a-select-option
+                v-for="(label,value) in repairDeptMap"
+                :key="value"
+                :label="label"
+                :value="value">{{ label }}
+              </a-select-option>
+            </a-select>-->
+          </a-form-item>
+        </row-item>
         <row-item>
           <a-form-item
             label="使用位置"
@@ -105,22 +127,6 @@
               v-decorator="['actualUser', {initialValue: userInfo.realName, rules: [{required: true, message: '报修人不能为空'}]}]"/>
           </a-form-item>
         </row-item>
-        <row-item>
-          <a-form-item
-            label="维修部门"
-            :labelCol="BaseTool.Constant.labelCol"
-            :wrapperCol="BaseTool.Constant.wrapperCol"
-          >
-            <a-select v-decorator="['repairDeptId', {rules: [{required: true, message: '维修部门不能为空'}]}]" placeholder="请选择">
-              <a-select-option
-                v-for="(label,value) in repairDeptMap"
-                :key="value"
-                :label="label"
-                :value="value">{{ label }}
-              </a-select-option>
-            </a-select>
-          </a-form-item>
-        </row-item>
         <!--        <row-item>
           <a-form-item
             label="紧急等级"
@@ -262,6 +268,7 @@ export default {
       modalTitle: null,
       form: this.$form.createForm(this),
       visible: false,
+      sbId: null,
       // 下拉框map
       sourceMap: {},
       levelMap: {},
@@ -405,6 +412,9 @@ export default {
         values.repairFileList = this.repairFileList
         values.applicationFileList = this.applicationFileList
         values.checkFileList = this.checkFileList
+        if (values.partId === undefined) {
+          values.partId = ''
+        }
         if (this.BaseTool.String.isBlank(values.id)) {
           addRepairApplicationForm(values)
             .then(() => {
@@ -456,6 +466,7 @@ export default {
       const [ key ] = keys
       const [ row ] = rows
       const { form: { setFieldsValue } } = this
+      this.sbId = key
       // 日期处理
       this.$nextTick(() => {
         setFieldsValue(Object.assign({
@@ -466,8 +477,10 @@ export default {
       })
     },
     handlePartSelect () {
-      const sbId = this.form.getFieldValue('sbId')
-      this.$refs.partInfoSelectModal.base({ sbId })
+      if (this.sbId === null) {
+        return this.$message.error('选择设备部位之前,请选择设备')
+      }
+      this.$refs.partInfoSelectModal.base({ sbId: this.sbId })
     },
     handlePartSelected (keys, rows) {
       const [ key ] = keys

+ 80 - 17
src/views/repair/application-form/modules/DetailRepair.vue

@@ -76,14 +76,14 @@
               <a-descriptions-item label="报修单号">{{ model.no }}</a-descriptions-item>
               <a-descriptions-item label="设备编号">{{ model.sbNo }}</a-descriptions-item>
               <a-descriptions-item label="设备名称">{{ model.sbName }}</a-descriptions-item>
-              <a-descriptions-item label="送修部门">{{ model.name }}</a-descriptions-item>
               <a-descriptions-item label="使用位置">{{ model.sbCph }}</a-descriptions-item>
               <a-descriptions-item label="工单类别">{{ BaseTool.Object.getField(planFlagMap,model.category) }}</a-descriptions-item>
               <a-descriptions-item label="报修状态"><badge :text="BaseTool.Object.getField(statusMap,model.status)" :status="DictCache.COLOR.REPAIR_APPLICATION_FORM_STATUS[model.status]"/></a-descriptions-item>
               <a-descriptions-item label="报修时间">{{ model.applyTime }}</a-descriptions-item>
               <a-descriptions-item label="报修人">{{ model.actualUser }}</a-descriptions-item>
               <a-descriptions-item label="要求时间">{{ model.limitHours }}小时</a-descriptions-item>
-              <a-descriptions-item label="维修主管" >{{ model.checkUserName }}</a-descriptions-item>
+              <a-descriptions-item label="送修部门">{{ model.name }}</a-descriptions-item>
+              <a-descriptions-item label="维修工程师" >{{ model.checkUserName }}</a-descriptions-item>
               <a-descriptions-item label="故障描述" :span="3">{{ model.content }}</a-descriptions-item>
               <a-descriptions-item label="报修图片" :span="3">
                 <div v-if="model.applicationFileList != null && model.applicationFileList.length > 0">
@@ -104,7 +104,7 @@
         <div class="main gutter-color" v-show="current == 1">
           <div class="title">维修数据</div>
           <div>
-            <a-descriptions :column="3" bordered>
+            <a-descriptions :column="2" bordered>
               <a-descriptions-item label="维修开始时间">{{ model.repairStartTime }}</a-descriptions-item>
               <a-descriptions-item label="维修结束时间">{{ model.repairEndTime }}</a-descriptions-item>
               <a-descriptions-item label="维修耗时">{{ model.repairMinutes }}小时</a-descriptions-item>
@@ -233,7 +233,7 @@
         <div class="main gutter-color" v-show="current == 7">
           <div class="title">维修方案</div>
           <div style="margin:20px;margin-left:45%;" class="table-operator" >
-            <a-button type="primary" @click="handleAddRepairResolve">
+            <a-button v-if="$auth('repair-repairs-add')" type="primary" @click="handleAddRepairResolve">
               <a-icon type="plus"/>
               添加方案
             </a-button>
@@ -248,20 +248,22 @@
                 <a @click="handleViewRepairResolve(record)">方案详情</a>
                 <operation-button
                   @click="handleEditRepairResolve(record)" >修改</operation-button>
-                <!--                <operation-button
-                  title="确认该条维修记录?"
-                  @confirm="deleteRepairResolve(record.id)" >删除</operation-button>-->
               </template>
             </span>
           </a-table>
         </div>
       </div>
       <div class="btn">
-        <a-button v-if="$auth('repair-application-forms-dispatch') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ALLOCATED === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)" style="margin-left: 16px" type="default" @click="handleAssign">派工</a-button>
-        <a-button v-if="$auth('repair-application-forms-transfer-apply') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status)" style="margin-left: 8px" type="default" @click="handleTransfer()">转派申请</a-button>
+        <a-popconfirm v-if="DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ALLOCATED === model.status " title="是否要接单?" @confirm="receiveRepair">
+          <a-button style="margin-left: 8px" type="default">接单</a-button>
+        </a-popconfirm>
+        <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)" 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)" 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)" 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-popconfirm v-if="$auth('repair-application-forms-finish') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.WAIT_SUBMIT === model.status)" title="是否要提交审核该条数据?" @confirm="handleExamine">
-          <a-button style="margin-left: 8px" type="default">提交生产审核</a-button>
+        <a-popconfirm v-if="$auth('repair-application-forms-finish') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.WAIT_SUBMIT === model.status)" title="是否要结单?" @confirm="handleExamine">
+          <a-button style="margin-left: 8px" type="default">结单</a-button>
         </a-popconfirm>
         <a-popconfirm v-if="$auth('repair-application-forms-approve') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ACCEPTANCE === model.status" title="是否要接受?" @confirm="handleApprove">
           <a-button :loading="confirmLoading" style="margin-left: 8px" type="default">接受</a-button>
@@ -295,13 +297,14 @@
     <transfer-form ref="transferForm" @ok="handleOk"/>
     <detail-check-new ref='detailCheckNew' @ok='handleVerifyRecordOk'/>
     <repair-record-form ref='repairRecordForm' @ok='handleRepairRecordOk' />
+    <report-up-form ref='reportUpForm' @ok='handleOk' />
   </div>
 </template>
 
 <script>
 // import { stringify } from 'qs'
 import DetailList from '@/components/tools/DetailList'
-import { fetchRepairApplicationForm, approve, receive } from '@/api/repair/application-form'
+import { fetchRepairApplicationForm, approve, receive, receiveRepair } from '@/api/repair/application-form'
 import CheckForm from './CheckForm'
 import BaseOutForm from './BaseOutForm'
 import FinishForm from './FinishForm'
@@ -321,6 +324,7 @@ import BaseTool from '@/utils/tool'
 import FeeBaseForm from '@/views/repair/fee/modules/BaseForm'
 import FeeDetail from '@/views/repair/fee/modules/Detail'
 import { deleteRepairFees, fetchRepairFee, queryRepairFee } from '@/api/repair/fee'
+import {getSelfRole } from '@/api/upms/role'
 import ReasonBaseForm from '@/views/repair/repair-reason/modules/BaseForm'
 import ReasonDetail from '@/views/repair/repair-reason/modules/Detail'
 import { deleteRepairReasons, fetchRepairReason, queryRepairReason } from '@/api/repair/repair-reason'
@@ -337,6 +341,7 @@ import DetailRepairRecord from './DetailRepairRecord'
 import TransferForm from './TransferForm'
 import DetailCheckNew from './DetailCheckNew'
 import RepairRecordForm from './RepairRecordForm'
+import ReportUpForm from './ReportUpForm'
 const DetailListItem = DetailList.Item
 
 export default {
@@ -370,7 +375,8 @@ export default {
     DetailRepairRecord,
     TransferForm,
     DetailCheckNew,
-    RepairRecordForm
+    RepairRecordForm,
+    ReportUpForm
   },
   data () {
     return {
@@ -735,7 +741,12 @@ export default {
         'repairFormVO': null,
         'repairCheckVO': null,
         'checkUserName': null,
-        'remarkTwo': null
+        'remarkTwo': null,
+        'repairMinutes': null,
+        'repairDeptId': null,
+        'userId': null,
+        'sbCph': null,
+        'actualUser': null
       }
     }
   },
@@ -760,8 +771,6 @@ export default {
       this.showSbFlag = false
       this.modalTitle = '详情'
       this.model = record
-      console.log(111)
-      console.log(record)
       this.activeKey = 'a'
       const sbId = record.sbId
       if (sbId) {
@@ -770,7 +779,9 @@ export default {
           this.showSbFlag = true
         })
       }
-
+      if (record.repairMinutes === null) {
+        this.model.repairMinutes = '?'
+      }
       this.init()
     },
     init () {
@@ -950,6 +961,58 @@ export default {
         this.handleOk()
       })
     },
+    receiveRepair () {
+      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
+      receiveRepair(params).then(() => {
+        this.$message.info('接单成功')
+        this.handleOk()
+      })
+    },
+    reportRepair () {
+      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.remark
+      params.reportHandleType = 2 // 维修上报
+      getSelfRole().then(res => {
+        const modal = this.$refs.reportUpForm
+        params.roleType = res.data
+        modal.base(params)
+      })
+    },
+    handleReportRepair () {
+      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 // 处理维修上报
+      getSelfRole().then(res => {
+        const modal = this.$refs.reportUpForm
+        params.roleType = res.data
+        modal.base(params)
+      })
+    },
     handleEditRecord (record) {
       this.visible = false
       fetchCustomDataForRepairRecord({ id: record.id }).then(res => {

+ 12 - 1
src/views/repair/application-form/modules/DetailRepairRecord.vue

@@ -27,6 +27,16 @@
           </viewer></div>
         <div v-if="model.imageList == null || model.imageList.length === 0"> 暂无</div>
       </a-descriptions-item>
+      <a-descriptions-item label="维修文件" :span="3">
+        <div v-if="model.opinionFiles != null && model.opinionFiles.length > 0">
+          <a-upload
+            :multiple="true"
+            :fileList="BaseTool.UPLOAD.transImg(model.opinionFiles)"
+          >
+          </a-upload>
+        </div>
+        <div v-if="model.opinionFiles == null || model.opinionFiles.length === 0"> 暂无</div>
+      </a-descriptions-item>
     </a-descriptions>
   </a-card>
 </template>
@@ -56,7 +66,8 @@ export default {
         'createdTime': null,
         'updateTime': null,
         'opinion': null,
-        'repairHours': null
+        'repairHours': null,
+        'opinionFiles': null
       }
     }
   },

+ 73 - 18
src/views/repair/application-form/modules/FinishForm.vue

@@ -19,7 +19,11 @@
             :labelCol="BaseTool.Constant.labelCol"
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
-            <a-select @change="changePlanFlag" v-decorator="['category', {rules: [{required: true, message: '计划性维修不能为空'}]}]" placeholder="请选择">
+            <a-select
+              disabled='disabled'
+              @change="changePlanFlag"
+              v-decorator="['category', {rules: [{required: true, message: '计划性维修不能为空'}]}]"
+              placeholder="请选择">
               <a-select-option
                 v-for="(label,value) in planFlagMap"
                 :key="value"
@@ -29,6 +33,24 @@
             </a-select>
           </a-form-item>
         </row-item>
+        <row-item>
+          <a-form-item
+            label="所属工程师"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select
+              v-decorator="['dispatchUserId', {rules: [{required: true, message: '所属工程师不能为空'}]}]"
+              placeholder="请选择">
+              <a-select-option
+                v-for="item in dispatchList"
+                :key="item.userId"
+                :label="item.realName"
+                :value="item.userId">{{ item.realName }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </row-item>
         <row-item>
           <a-form-item
             label="完成时间"
@@ -36,6 +58,7 @@
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
             <a-date-picker
+              disabled='disabled'
               showTime
               v-decorator="['repairEndTime']"
               style="width: 100%"
@@ -47,32 +70,49 @@
       <row-list :col="1">
         <row-item>
           <a-form-item
-            label="维修描述"
+            label="维修图片"
             :labelCol="BaseTool.Constant.labelCol2"
             :wrapperCol="BaseTool.Constant.wrapperCol2"
           >
-            <a-textarea v-decorator="['remark']"/>
+            <a-upload
+              :action="uploadUrl"
+              :multiple="true"
+              list-type="picture"
+              :file-list="defaultRepairFileList"
+              @change="handleRepairFileChange"
+              accept="image/*"
+              :headers="headers"
+            >
+              <a-button> <a-icon type="upload" /> 上传图片 </a-button>
+            </a-upload>
           </a-form-item>
         </row-item>
         <row-item>
           <a-form-item
-            label="维修图片"
+            label="维修文件"
             :labelCol="BaseTool.Constant.labelCol2"
             :wrapperCol="BaseTool.Constant.wrapperCol2"
           >
             <a-upload
               :action="uploadUrl"
               :multiple="true"
-              list-type="picture"
-              :file-list="defaultRepairFileList"
-              @change="handleRepairFileChange"
-              accept="image/*"
+              :file-list="defaultFileList"
+              @change="handleFileChange"
               :headers="headers"
             >
-              <a-button> <a-icon type="upload" /> 上传图片 </a-button>
+              <a-button> <a-icon type="upload" /> 上传文件 </a-button>
             </a-upload>
           </a-form-item>
         </row-item>
+        <row-item>
+          <a-form-item
+            label="维修描述"
+            :labelCol="BaseTool.Constant.labelCol2"
+            :wrapperCol="BaseTool.Constant.wrapperCol2"
+          >
+            <a-textarea v-decorator="['remark']"/>
+          </a-form-item>
+        </row-item>
       </row-list>
     </a-form>
     <spare-part-used-select-modal ref="sparePartUsedSelectModal" />
@@ -91,6 +131,7 @@ import SparePartUsedSelectModal from '@/views/sqarepartmanage/sparepartused/modu
 import { uploadUrl } from '@/api/upms/file'
 import Vue from 'vue'
 import { ACCESS_TOKEN } from '@/store/mutation-types'
+import { queryRepairUser } from '@/api/upms/user-dept'
 
 export default {
   name: 'BaseRepairApplicationForm',
@@ -105,6 +146,7 @@ export default {
       planFlagMap: {},
       // 下拉框map
       treeData: [],
+      dispatchList: [],
       descripitionMap: {},
       headers: {
         Authorization: 'Bearer ' + Vue.ls.get(ACCESS_TOKEN)
@@ -116,6 +158,8 @@ export default {
       uploadUrl: uploadUrl,
       defaultRepairFileList: [],
       repairFileList: [], // 维修图片,
+      defaultFileList: [], // 维修文件
+      fileList: [],
       userList: []
     }
   },
@@ -138,6 +182,10 @@ export default {
       this.setTree()
       this.visible = true
       this.model = record
+      const params = { roleType: 2, deptId: record.repairDeptId, queryType: 1 }
+      this.getUsers(params)
+      this.defaultFileList = []
+      this.repairFileList = []
       // 如果是空标识添加
       if (this.BaseTool.Object.isBlank(record)) {
         this.modalTitle = '添加'
@@ -148,7 +196,11 @@ export default {
       this.defaultRepairFileList = this.BaseTool.UPLOAD.transImg(this.repairFileList)
       const { form: { setFieldsValue } } = this
       // 日期处理
-      record.repairEndTime = this.BaseTool.Date.formatter(record.repairEndTime, this.BaseTool.Date.PICKER_NORM_DATETIME_PATTERN)
+      if (record.repairEndTime !== null) {
+        record.repairEndTime = this.BaseTool.Date.formatter(record.repairEndTime, this.BaseTool.Date.PICKER_NORM_DATETIME_PATTERN)
+      } else {
+        record.repairEndTime = this.BaseTool.Date.formatter(new Date(), this.BaseTool.Date.PICKER_NORM_DATETIME_PATTERN)
+      }
       this.$nextTick(() => {
         setFieldsValue(Object.assign(pick(record, [
           'id',
@@ -156,13 +208,14 @@ export default {
           'level',
           'category',
           'repairErrorTypeId',
-          'repairEndTime'
+          'repairEndTime',
+          'dispatchUserId'
         ])))
       })
     },
-    getUsers () {
-      queryUser({ status: 1 }).then(res => {
-        this.userList = res.data
+    getUsers (params) {
+      queryRepairUser(params).then(res => {
+        this.dispatchList = res.data
       })
     },
     changePlanFlag (value) {
@@ -178,6 +231,10 @@ export default {
         })
       }
     },
+    handleFileChange (info) {
+      this.defaultFileList = info.fileList
+      this.fileList = this.setFileList(info, 19)
+    },
     handleRepairFileChange (info) {
       this.defaultRepairFileList = info.fileList
       this.repairFileList = this.setFileList(info, 12)
@@ -204,13 +261,11 @@ export default {
         }
         // 日期处理
         values.repairFileList = this.repairFileList
+        values.opinionFileList = this.fileList // 维修文件
         values.repairEndTime = this.BaseTool.Date.formatter(values.repairEndTime, this.BaseTool.Date.PICKER_NORM_DATETIME_PATTERN)
         finish(values).then(() => {
-          this.$message.info('维修已提交,等待主管审核')
+          this.$message.info('维修已提交,等待工程师审核')
           this.handleCancel(values)
-          /*setTimeout(() => {
-            self.$router.push({ path: '/repair/form/mine' })
-          }, 1000)*/
         }).catch(() => {
           this.confirmLoading = false
         })

+ 25 - 1
src/views/repair/application-form/modules/RepairRecordForm.vue

@@ -104,6 +104,23 @@
             </a-upload>
           </a-form-item>
         </row-item>
+        <row-item>
+          <a-form-item
+            label="维修文件"
+            :labelCol="BaseTool.Constant.labelCol2"
+            :wrapperCol="BaseTool.Constant.wrapperCol2"
+          >
+            <a-upload
+              :action="uploadUrl"
+              :multiple="true"
+              :file-list="defaultFileList"
+              @change="handleFileChange"
+              :headers="headers"
+            >
+              <a-button> <a-icon type="upload" /> 上传文件 </a-button>
+            </a-upload>
+          </a-form-item>
+        </row-item>
       </row-list>
     </a-form>
     <spare-part-used-select-modal ref="sparePartUsedSelectModal" />
@@ -134,7 +151,9 @@ export default {
       },
       uploadUrl: uploadUrl,
       defaultRepairFileList: [],
-      repairFileList: [] // 维修图片,
+      repairFileList: [], // 维修图片,
+      defaultFileList: [], // 维修文件
+      fileList: [],
     }
   },
   components: {
@@ -151,6 +170,7 @@ export default {
       // 如果是空标识添加
       this.modalTitle = '维修编辑'
       this.repairFileList = record.imageList
+      this.defaultFileList = this.defaultFileList = this.BaseTool.UPLOAD.transImg(record.opinionFiles)
       this.defaultRepairFileList = this.BaseTool.UPLOAD.transImg(this.repairFileList)
       const { form: { setFieldsValue } } = this
       // 日期处理
@@ -172,6 +192,10 @@ export default {
       this.defaultRepairFileList = info.fileList
       this.repairFileList = this.setFileList(info, 12)
     },
+    handleFileChange (info) {
+      this.defaultFileList = info.fileList
+      this.fileList = this.setFileList(info, 19)
+    },
     setFileList (info, type) {
       const file = info.file
       const fileList = info.fileList

+ 193 - 0
src/views/repair/application-form/modules/ReportUpForm.vue

@@ -0,0 +1,193 @@
+<template>
+  <a-modal
+    :title="modalTitle"
+    :width="800"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    class="ant-modal2"
+    @cancel="handleCancel"
+  >
+    <a-form :form="form">
+      <a-form-item v-show="false" >
+        <a-input v-decorator="['id']" type="hidden"/>
+      </a-form-item>
+
+      <row-list :col="2">
+        <row-item v-show='visibleReport'>
+          <a-form-item
+            label="上报对象"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select
+              @change="changePlanFlag"
+              v-decorator="['reportLeaderId']"
+              placeholder="请选择">
+              <a-select-option
+                v-for="item in roleUserMap"
+                :key="item.userId"
+                :label="item.realName"
+                :value="item.userId">{{ item.realName }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </row-item>
+
+        <row-item v-show='!visibleReport'>
+          <a-form-item
+            label="派工对象"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select
+              @change="changePlanFlag"
+              v-decorator="['reportLeaderId']"
+              placeholder="请选择">
+              <a-select-option
+                v-for="item in roleUserMap"
+                :key="item.userId"
+                :label="item.realName"
+                :value="item.userId">{{ item.realName }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </row-item>
+      </row-list>
+      <row-list :col="1">
+        <row-item v-show='visibleReport'>
+          <a-form-item
+            label="上报原因"
+            :labelCol="BaseTool.Constant.labelCol2"
+            :wrapperCol="BaseTool.Constant.wrapperCol2"
+          >
+            <a-textarea v-decorator="['remark']"/>
+          </a-form-item>
+        </row-item>
+        <row-item v-show='!visibleReport'>
+          <a-form-item
+            label="上报备注"
+            :labelCol="BaseTool.Constant.labelCol2"
+            :wrapperCol="BaseTool.Constant.wrapperCol2"
+          >
+            <a-textarea disabled='disabled' v-decorator="['remark']"/>
+          </a-form-item>
+        </row-item>
+      </row-list>
+    </a-form>
+    <template slot="footer">
+      <a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
+    </template>
+  </a-modal>
+</template>
+
+<script>
+import pick from 'lodash.pick'
+import { reportRepair } from '@/api/repair/application-form'
+import { queryRepairUser } from '@/api/upms/user-dept'
+import SparePartUsedSelectModal from '@/views/sqarepartmanage/sparepartused/modules/SparePartUsedSelectModal'
+
+export default {
+  name: 'ReportUpForm',
+  data () {
+    return {
+      model: null,
+      confirmLoading: false,
+      modalTitle: null,
+      form: this.$form.createForm(this),
+      visible: false,
+      chooseType: null,
+      roleType: null,
+      roleUserMap: [],
+      // 下拉框map
+      reportLeaderId: null,
+      visibleReport: false
+    }
+  },
+  components: {
+    SparePartUsedSelectModal
+  },
+  props: {
+  },
+  created () {
+    // 下拉框map
+  },
+  methods: {
+    base (record) {
+      this.visible = true
+      var queryType = 1
+      // 如果是空标识添加
+      if (record.reportHandleType === 2) {
+        this.modalTitle = '维修上报'
+        this.visibleReport = true
+        if (record.roleType === 1) {
+          // 维修人上报,type 3
+          record.reportHandleType = 3
+        }
+      } else {
+        this.modalTitle = '上报处理'
+        this.visibleReport = false
+        queryType = 2
+      }
+      this.model = record
+      const params = { roleType: record.roleType, deptId: record.repairDeptId, queryType: queryType }
+      this.getUsers(params)
+      const { form: { setFieldsValue } } = this
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign(pick(record, [
+          'id',
+          'remark'
+        ])))
+      })
+    },
+    getUsers (params) {
+      queryRepairUser(params).then(res => {
+        this.roleUserMap = res.data
+      })
+    },
+    changePlanFlag (value) {
+      this.reportLeaderId = value
+    },
+    save () {
+      const { form: { validateFieldsAndScroll } } = this
+      this.confirmLoading = true
+      validateFieldsAndScroll((errors, values) => {
+        if (errors) {
+          this.confirmLoading = false
+          return
+        }
+        // 日期处理
+        this.model.reportLeaderId = values.reportLeaderId
+        if (this.model.reportHandleType === 2) { // 维修上报
+          // 维修上报处理
+          if (this.model.roleType === 2 || this.model.roleType === 3) {
+            this.model.repairUserId = values.reportLeaderId
+          } else {
+            this.model.dispatchUserId = values.reportLeaderId
+          }
+        }
+        this.model.remark = values.remark
+        reportRepair(this.model).then(() => {
+          this.$message.info('操作成功')
+          if (this.model.reportHandleType !== 1) {
+            this.$router.push({ path: '/repair/form/mine' })
+          } else {
+            this.handleCancel(values)
+          }
+        }).catch(() => {
+          this.confirmLoading = false
+        })
+      })
+    },
+    handleCancel (values) {
+      this.visible = false
+      this.confirmLoading = false
+      this.form.resetFields()
+      if (this.BaseTool.Object.isNotBlank(values)) {
+        this.$emit('ok')
+      } else {
+        this.$emit('ok')
+      }
+    }
+  }
+}
+</script>

+ 20 - 3
src/views/sb/info/modules/BaseForm.vue

@@ -521,6 +521,22 @@
               v-decorator="['workYear', {rules: [{required: true, message: '不能为空'}]}]" />
           </a-form-item>
         </a-col>
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="关联维修部门"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select v-decorator="['repairDeptId']" placeholder="请选择">
+              <a-select-option
+                v-for="(label,value) in repairDeptMap"
+                :key="value"
+                :label="label"
+                :value="value">{{ label }}
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </a-col>
       </a-row>
       <title-divider title="自定义参数" width="120px"></title-divider>
       <div class="table-operator" style="margin-bottom: 8px;">
@@ -925,6 +941,7 @@ export default {
       // sbInfoTreeData: [],
       // sourceSbInfoTreeData: [],
       // sbPositionTreeData: [],
+      repairDeptMap: {},
       depreciationTypeMap: {},
       sourceTypeMap: {},
       levelMap: {},
@@ -984,6 +1001,7 @@ export default {
     this.isChildMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_IS_CHILD)
     this.isShowMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_IS_SHOW)
     this.isFinancingMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_IS_FINANCING)
+    this.repairDeptMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_DEPT_CATEGORY)
     queryFirmProducer({}).then(res => {
       this.producerList = res.data
     })
@@ -1096,7 +1114,6 @@ export default {
       }
       record.unitName = this.BaseTool.Object.getField(this.unitMap, record.unit)
       record.useTypeName = this.BaseTool.Object.getField(this.useTypeMap, record.useType)
-
       this.$nextTick(() => {
         setFieldsValue(Object.assign(pick(record, [
           'id',
@@ -1163,8 +1180,8 @@ export default {
           'batchNo',
           'workYear',
           'retirementDate',
-          'registerDate'
-
+          'registerDate',
+          'repairDeptId'
         ])))
       })
     },

+ 6 - 2
src/views/sb/info/modules/Detail.vue

@@ -161,6 +161,7 @@
               <a-descriptions-item v-else-if="model.isChild == 2" label="是否子设备">父设备</a-descriptions-item>
               <a-descriptions-item v-else-if="model.isChild == 3" label="是否子设备">独立设备</a-descriptions-item>
               <a-descriptions-item label="状态"><badge :status="DictCache.COLOR.SB_INFO_STATUS[model.status]" :text="statusMap[model.status]"></badge></a-descriptions-item>
+              <a-descriptions-item label="关联维修部门">{{ BaseTool.Object.getField(repairDeptMap,model.repairDeptId) }}</a-descriptions-item>
               <a-descriptions-item label="备注">{{ model.remark }}</a-descriptions-item>
             </a-descriptions>
           </a-card>
@@ -423,7 +424,8 @@ export default {
         'batchNo': null,
         'workYear': null,
         'retirementDate': null,
-        'registerDate': null
+        'registerDate': null,
+        'repairDeptId': null
       },
       numCheckStandard1: 0,
       numCheckjob1: 0,
@@ -444,7 +446,8 @@ export default {
       unitMap: {},
       colorMap: {},
       rlTypeMap: {},
-      sourceTypeMap: {}
+      sourceTypeMap: {},
+      repairDeptMap: {}
     }
   },
   created () {
@@ -459,6 +462,7 @@ export default {
     this.useTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_USE_TYPE)
     this.isChildMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_IS_CHILD)
     this.isShowMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_IS_SHOW)
+    this.repairDeptMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_DEPT_CATEGORY)
   },
   computed: {
   },