hfxc226 3 years ago
parent
commit
96d3197b17

+ 12 - 11
src/views/repair/application-form/modules/DetailRepair.vue

@@ -6,18 +6,18 @@
           <span class="table-page-search-submitButtons" style="float: right">
             <a-button v-if="$auth('repair-application-forms-finish')" style="margin-left: 16px" type="default" @ok="handleOk" @click="handleViewBom()">备件BOM</a-button>
             <a-button v-if="$auth('repair-application-forms-finish')" style="margin-left: 16px" type="default" @ok="handleOk" @click="handleViewCheck()">维护项目</a-button>
-            <a-button v-if="$auth('repair-application-forms-assign') && (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="primary" @click="handleAssign">派工</a-button>
+            <a-button v-if="$auth('repair-application-forms-assign') && (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-popconfirm v-if="$auth('repair-application-forms-deal') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ALLOCATED === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)" title="是否要接收?" @confirm="receive">
               <a-button style="margin-left: 8px">接收</a-button>
             </a-popconfirm>
-            <a-button v-if="$auth('repair-application-forms-out') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING >= model.status) && model.type != 2" style="margin-left: 8px" type="primary" @click="handleOut">委外</a-button>
-            <a-button v-if="$auth('repair-application-forms-dispatch') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status" style="margin-left: 8px" type="primary" @click="handleDispatch">转派</a-button>
-            <a-button v-if="$auth('repair-application-forms-finish') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status" style="margin-left: 8px" type="primary" @click="handleFinish()">完成</a-button>
-            <a-button v-if="$auth('repair-application-forms-edit')" style="margin-left: 8px" type="default" @click="handleFinish()">修改</a-button>
+            <a-button v-if="$auth('repair-application-forms-out') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING >= model.status) && model.type != 2" style="margin-left: 8px" type="default" @click="handleOut">委外</a-button>
+            <a-button v-if="$auth('repair-application-forms-dispatch') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status" style="margin-left: 8px" type="default" @click="handleDispatch">转派</a-button>
+            <a-button v-if="$auth('repair-application-forms-finish') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status" style="margin-left: 8px" type="default" @click="handleFinish()">完成</a-button>
+            <a-button v-if="$auth('repair-application-forms-edit')" style="margin-left: 8px" type="default" @click="handleEdit()">修改</a-button>
             <a-popconfirm v-if="DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.WAIT_SUBMIT === model.status" title="是否要提交审核该条数据?" @confirm="handleExamine">
-              <a-button style="margin-left: 8px" type="primary">提交审核</a-button>
+              <a-button style="margin-left: 8px" type="default">提交审核</a-button>
             </a-popconfirm>
-            <a-button style="margin-left: 8px" @click="handleCancel">返回</a-button>
+            <a-button style="margin-left: 8px" type="primary" @click="handleCancel">返回</a-button>
           </span>
         </a-col>
       </a-row>
@@ -220,6 +220,7 @@
     <detail-sb-check ref="detailSbCheckModal" @ok="handleOk"/>
     <base-form ref="baseRepairProjectModal" @ok="handleOk"/>
     <detail ref="detailRepairProjectModal"/>
+    <edit-form ref="editForm" @ok="handleOk" />
   </div>
 </template>
 
@@ -229,6 +230,7 @@ import { fetchRepairApplicationForm, examine, approve, receive } from '@/api/rep
 import CheckForm from './CheckForm'
 import BaseOutForm from './BaseOutForm'
 import FinishForm from './FinishForm'
+import EditForm from './EditForm'
 import DispatchForm from './DispatchForm'
 import AssignForm from './AssignForm'
 import SparePickBaseForm from '../../../store/sparepickform/modules/BaseForm'
@@ -258,6 +260,7 @@ export default {
   name: 'RepairApplicationFormDetail',
   components: {
     CheckForm,
+    EditForm,
     DetailList,
     DetailSbCheck,
     DetailSbBom,
@@ -701,10 +704,8 @@ export default {
       })
     },
     handleEdit (record) {
-      fetchRepairProject({ id: record.id }).then(res => {
-        const modal = this.$refs.baseRepairProjectModal
-        modal.base(res.data)
-      })
+      const modal = this.$refs.editForm
+      modal.base(this.model)
     },
     handleRepairProjectAdd () {
       this.$refs.baseRepairProjectModal.base({ repairId: this.model.id })

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

@@ -122,7 +122,7 @@ export default {
         this.modalTitle = '添加'
         return
       }
-      this.modalTitle = '维修完成'
+      this.modalTitle = '修改工单'
       const { form: { setFieldsValue } } = this
       // 日期处理
       record.repairStartTime = this.BaseTool.Date.formatter(record.repairStartTime, this.BaseTool.Date.PICKER_NORM_DATETIME_PATTERN)

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

@@ -1201,7 +1201,9 @@ export default {
         values.nextCheckDate = BaseTool.Date.formatter(values.nextCheckDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
         values.guaranteeDate = BaseTool.Date.formatter(values.guaranteeDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
         values.retirementDate = BaseTool.Date.formatter(values.retirementDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
-
+        if (values.registerDate != null) {
+          values.registerDate = BaseTool.Date.formatter(values.registerDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        }
         values.lastRepaireTime = this.BaseTool.Date.formatter(values.lastRepaireTime, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
         values.lastBaoyangTime = this.BaseTool.Date.formatter(values.lastBaoyangTime, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
         values.spDate = this.BaseTool.Date.formatter(values.spDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)