维修工单记录详情查看维修报告
This commit is contained in:
parent
d343ed6486
commit
10bd09b8a6
@ -110,7 +110,7 @@
|
||||
label="维修报告:"
|
||||
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>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -199,6 +199,7 @@
|
||||
<el-button @click="closeDetails">关 闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<MaintenanceReportDetails ref="formRef"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -207,9 +208,13 @@ import * as RemoteMaintenanceOrderApi from '@/api/system/maintenance/maintenance
|
||||
import {getEquipCascader} from '@/api/system/equip/equipInfo'
|
||||
import {getComponentSelection} from '@/api/system/equip/componentInfo'
|
||||
import {getCustomerSelection} from '@/api/system/baseData/customerInfo'
|
||||
import MaintenanceReportDetails from '@/views/system/maintenance/maintenanceReport/MaintenanceReportDetails.vue';
|
||||
|
||||
export default {
|
||||
name: "RemoteMaintenanceOrder",
|
||||
components: {
|
||||
MaintenanceReportDetails,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
detailOpen: false,
|
||||
@ -253,6 +258,10 @@ export default {
|
||||
this.initSelection();
|
||||
},
|
||||
methods: {
|
||||
openReport(maintenanceOrderNo,id){
|
||||
console.log(id)
|
||||
this.$refs["formRef"].open(maintenanceOrderNo,id);
|
||||
},
|
||||
closeDetails(){
|
||||
this.detailOpen = false;
|
||||
this.detailForm = {};
|
||||
|
@ -2,34 +2,34 @@
|
||||
<div class="app-container">
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<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-form-item label="维修工单id" prop="maintenanceOrderId">
|
||||
{{formData.maintenanceOrderId}}
|
||||
<el-form-item label="维修工单:" prop="maintenanceOrderNo">
|
||||
{{formData.maintenanceOrderNo}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<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" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="维修内容" prop="maintenanceContent">
|
||||
<el-form-item label="维修内容:" prop="maintenanceContent">
|
||||
{{formData.maintenanceContent}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="故障原因" prop="maintenanceProblem">
|
||||
<el-form-item label="故障原因:" prop="maintenanceProblem">
|
||||
{{formData.maintenanceProblem}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="维修评价" prop="maintenanceEvaluation">
|
||||
<el-form-item label="维修评价:" prop="maintenanceEvaluation">
|
||||
{{formData.maintenanceEvaluation}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-form-item label="备注:" prop="remark">
|
||||
{{formData.remark}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -67,51 +67,25 @@ export default {
|
||||
},
|
||||
// 表单校验
|
||||
formRules: {
|
||||
maintenanceOrderId: [{required: true, message: '维修工单id不能为空', trigger: 'change'}],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
/** 打开弹窗 */
|
||||
async open(id) {
|
||||
this.dialogVisible = true;
|
||||
open(maintenanceOrderNo,id) {
|
||||
this.reset();
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
this.formLoading = true;
|
||||
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');
|
||||
MaintenanceReportApi.getMaintenanceReport(id).then(res=>{
|
||||
if (res.data == null){
|
||||
this.$message.error('未查询到数据')
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
await MaintenanceReportApi.createMaintenanceReport(data);
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.dialogVisible = false;
|
||||
this.$emit('success');
|
||||
} finally {
|
||||
this.dialogVisible = true;
|
||||
this.formLoading = true;
|
||||
this.formData = res.data;
|
||||
this.formData.maintenanceOrderNo = maintenanceOrderNo;
|
||||
this.formLoading = false;
|
||||
}
|
||||
this.dialogTitle = "维修报告详情";
|
||||
})
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
|
Loading…
Reference in New Issue
Block a user