yuhan hace 1 año
padre
commit
2e6abfbf03

+ 2 - 1
src/views/module_cmms/repairManage/RepairManageList.vue

@@ -120,6 +120,7 @@
           <a @click="handleEdit(record)">编辑</a>
           <a-divider type="vertical" />
           <a @click="handleDisptch(record)">派单</a>
+          <!--  :disabled="record.repairuser" -->
 
           <a-divider type="vertical" />
           <a-dropdown>
@@ -229,7 +230,7 @@
           {
             title:'待办人',
             align:"center",
-            dataIndex: 'repairuser'
+            dataIndex: 'repairuser_dictText'
           },
           {
             title:'维修时间',

+ 10 - 18
src/views/module_cmms/repairManage/modules/RepairManageDispatch.vue

@@ -5,22 +5,22 @@
         <a-row>
           <a-col :span="24">
             <a-form-model-item label="工单编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repairname">
-              <a-input v-model="model.repairname" placeholder="请输入维修工单编号"  ></a-input>
+              <a-input v-model="model.repairname" placeholder="请输入维修工单编号" disabled ></a-input>
             </a-form-model-item>
           </a-col>
           <a-col :span="24">
             <a-form-model-item label="工单名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repairname">
-              <a-input v-model="model.repairname" placeholder="请输入工单名称"  ></a-input>
+              <a-input v-model="model.repairname" placeholder="请输入工单名称" disabled ></a-input>
             </a-form-model-item>
           </a-col>
           <a-col :span="24">
             <a-form-model-item label="设备编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentcode">
-              <a-input v-model="model.equipmentcode" placeholder="请输入设备编号"  ></a-input>
+              <a-input v-model="model.equipmentcode" placeholder="请输入设备编号" disabled ></a-input>
             </a-form-model-item>
           </a-col>
           <a-col :span="24">
             <a-form-model-item label="设备名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentname">
-              <a-input v-model="model.equipmentname" placeholder="请输入设备名称"  ></a-input>
+              <a-input v-model="model.equipmentname" placeholder="请输入设备名称" disabled ></a-input>
             </a-form-model-item>
           </a-col>
           <!-- <a-col :span="24">
@@ -35,12 +35,12 @@
           </a-col> -->
           <a-col :span="24">
             <a-form-model-item label="故障描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="faultdesc">
-              <a-input v-model="model.faultdesc" placeholder="请输入故障描述"></a-input>
+              <a-textarea v-model="model.faultdesc" placeholder="请输入故障描述" disabled></a-textarea>
             </a-form-model-item>
           </a-col>
           <a-col :span="24">
             <a-form-model-item label="待办人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repairuser">
-              <a-input v-model="model.repairuser" placeholder="请输入待办人"  ></a-input>
+              <j-dict-select-tag v-model="model.repairuser" placeholder="请选择待办人" dictCode="sys_user,realname,id"/>
             </a-form-model-item>
           </a-col>
         </a-row>
@@ -51,7 +51,7 @@
 
 <script>
 
-  import { httpAction, getAction } from '@/api/manage'
+  import { httpAction, getAction, putAction } from '@/api/manage'
   import { validateDuplicateValue } from '@/utils/util'
 
   export default {
@@ -87,7 +87,8 @@
         url: {
           add: "/cmmsRepairManage/cmmsRepairManage/add",
           edit: "/cmmsRepairManage/cmmsRepairManage/edit",
-          queryById: "/cmmsRepairManage/cmmsRepairManage/queryById"
+          queryById: "/cmmsRepairManage/cmmsRepairManage/queryById",
+          repair: "/cmmsRepair/cmmsRepair/repair",
         }
       }
     },
@@ -118,16 +119,7 @@
         this.$refs.form.validate(valid => {
           if (valid) {
             that.confirmLoading = true;
-            let httpurl = '';
-            let method = '';
-            if(!this.model.id){
-              httpurl+=this.url.add;
-              method = 'post';
-            }else{
-              httpurl+=this.url.edit;
-               method = 'put';
-            }
-            httpAction(httpurl,this.model,method).then((res)=>{
+            putAction(this.url.repair,this.model).then((res)=>{
               if(res.success){
                 that.$message.success(res.message);
                 that.$emit('ok');

+ 9 - 4
src/views/module_cmms/repairManage/modules/RepairManageModal.vue

@@ -8,8 +8,8 @@
     :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
     @cancel="handleCancel"
     cancelText="关闭">
-    <repair-manage-form v-if="modalType==='form'" ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></repair-manage-form>
-    <repair-manage-dispatch v-if="modalType==='dispatch'" ref="dispatchForm"></repair-manage-dispatch>
+    <repair-manage-form v-if="modalType==='form'" ref="realForm" @ok="submitCallback('form')" :disabled="disableSubmit"></repair-manage-form>
+    <repair-manage-dispatch v-if="modalType==='dispatch'" ref="dispatchForm" @ok="submitCallback('dispatch')"></repair-manage-dispatch>
   </j-modal>
 </template>
 
@@ -58,9 +58,14 @@
         this.modalType = 'form';
       },
       handleOk () {
-        this.$refs.realForm.submitForm();
+        if(this.modalType === 'form'){
+          this.$refs.realForm.submitForm();
+        } 
+        if (this.modalType === 'dispatch') {
+          this.$refs.dispatchForm.submitForm();
+        }
       },
-      submitCallback(){
+      submitCallback(type){
         this.$emit('ok');
         this.visible = false;
         this.modalType = 'form';