维修工单记录详情查看维修报告

This commit is contained in:
xusd 2024-09-05 17:54:14 +08:00
parent d343ed6486
commit 10bd09b8a6
2 changed files with 28 additions and 45 deletions

View File

@ -110,7 +110,7 @@
label="维修报告:" label="维修报告:"
prop="diagnoiseReportId" prop="diagnoiseReportId"
> >
<el-button v-if="detailForm.diagnoiseReportId !== null" size="mini" type="text" @click="">维修报告</el-button> <el-button v-if="detailForm.diagnoiseReportId !== null" size="mini" type="text" @click="openReport(detailForm.maintenanceOrderNo,detailForm.diagnoiseReportId)">维修报告</el-button>
<span v-else></span> <span v-else></span>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -199,6 +199,7 @@
<el-button @click="closeDetails"> </el-button> <el-button @click="closeDetails"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<MaintenanceReportDetails ref="formRef"/>
</div> </div>
</template> </template>
@ -207,9 +208,13 @@ import * as RemoteMaintenanceOrderApi from '@/api/system/maintenance/maintenance
import {getEquipCascader} from '@/api/system/equip/equipInfo' import {getEquipCascader} from '@/api/system/equip/equipInfo'
import {getComponentSelection} from '@/api/system/equip/componentInfo' import {getComponentSelection} from '@/api/system/equip/componentInfo'
import {getCustomerSelection} from '@/api/system/baseData/customerInfo' import {getCustomerSelection} from '@/api/system/baseData/customerInfo'
import MaintenanceReportDetails from '@/views/system/maintenance/maintenanceReport/MaintenanceReportDetails.vue';
export default { export default {
name: "RemoteMaintenanceOrder", name: "RemoteMaintenanceOrder",
components: {
MaintenanceReportDetails,
},
data() { data() {
return { return {
detailOpen: false, detailOpen: false,
@ -253,6 +258,10 @@ export default {
this.initSelection(); this.initSelection();
}, },
methods: { methods: {
openReport(maintenanceOrderNo,id){
console.log(id)
this.$refs["formRef"].open(maintenanceOrderNo,id);
},
closeDetails(){ closeDetails(){
this.detailOpen = false; this.detailOpen = false;
this.detailForm = {}; this.detailForm = {};

View File

@ -2,34 +2,34 @@
<div class="app-container"> <div class="app-container">
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="45%" v-dialogDrag append-to-body> <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="45%" v-dialogDrag append-to-body>
<el-form ref="formRef" :model="formData" :rules="formRules" v-loading="formLoading" label-width="100px"> <el-form ref="formRef" :model="formData" :rules="formRules" v-loading="formLoading" label-width="120px">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="维修工单id" prop="maintenanceOrderId"> <el-form-item label="维修工单" prop="maintenanceOrderNo">
{{formData.maintenanceOrderId}} {{formData.maintenanceOrderNo}}
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="维修结果类型" prop="maintenanceResultType"> <el-form-item label="维修结果类型" prop="maintenanceResultType">
<dict-tag :type="DICT_TYPE.MAINTENANCE_RESULT_TYPE" :value="formData.maintenanceResultType" /> <dict-tag :type="DICT_TYPE.MAINTENANCE_RESULT_TYPE" :value="formData.maintenanceResultType" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="维修内容" prop="maintenanceContent"> <el-form-item label="维修内容" prop="maintenanceContent">
{{formData.maintenanceContent}} {{formData.maintenanceContent}}
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="故障原因" prop="maintenanceProblem"> <el-form-item label="故障原因" prop="maintenanceProblem">
{{formData.maintenanceProblem}} {{formData.maintenanceProblem}}
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="维修评价" prop="maintenanceEvaluation"> <el-form-item label="维修评价" prop="maintenanceEvaluation">
{{formData.maintenanceEvaluation}} {{formData.maintenanceEvaluation}}
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
{{formData.remark}} {{formData.remark}}
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -67,51 +67,25 @@ export default {
}, },
// //
formRules: { formRules: {
maintenanceOrderId: [{required: true, message: '维修工单id不能为空', trigger: 'change'}],
}, },
}; };
}, },
methods: { methods: {
/** 打开弹窗 */ /** 打开弹窗 */
async open(id) { open(maintenanceOrderNo,id) {
this.dialogVisible = true;
this.reset(); this.reset();
// MaintenanceReportApi.getMaintenanceReport(id).then(res=>{
if (id) { if (res.data == null){
this.formLoading = true; this.$message.error('未查询到数据')
try {
const res = await MaintenanceReportApi.getMaintenanceReport(id);
this.formData = res.data;
this.title = "修改维修报告";
} finally {
this.formLoading = false;
}
}
this.title = "新增维修报告";
},
/** 提交按钮 */
async submitForm() {
//
await this.$refs["formRef"].validate();
this.formLoading = true;
try {
const data = this.formData;
//
if (data.maintenanceReportId) {
await MaintenanceReportApi.updateMaintenanceReport(data);
this.$modal.msgSuccess("修改成功");
this.dialogVisible = false;
this.$emit('success');
return; return;
} }
// this.dialogVisible = true;
await MaintenanceReportApi.createMaintenanceReport(data); this.formLoading = true;
this.$modal.msgSuccess("新增成功"); this.formData = res.data;
this.dialogVisible = false; this.formData.maintenanceOrderNo = maintenanceOrderNo;
this.$emit('success');
} finally {
this.formLoading = false; this.formLoading = false;
} this.dialogTitle = "维修报告详情";
})
}, },
/** 表单重置 */ /** 表单重置 */
reset() { reset() {