You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
131 lines
3.9 KiB
Vue
131 lines
3.9 KiB
Vue
2 years ago
|
<template>
|
||
|
<div>
|
||
|
<el-card style="margin: 5px;margin-top: -20px">
|
||
|
<el-form label-width="100px" :model="inputQuery" style="width: 80%; margin: auto;" ref="formRef" :rules="formRules">
|
||
|
<el-row>
|
||
|
<el-col :span="20">
|
||
|
<el-form-item class="query-form-item" label="项目内容:" prop="content">
|
||
|
<el-input v-model="inputQuery.content" placeholder="请输入项目内容" style="width: 100%"
|
||
|
clearable></el-input>
|
||
|
</el-form-item>
|
||
|
</el-col>
|
||
|
</el-row>
|
||
|
<el-row>
|
||
|
<el-col :span="20">
|
||
|
<el-form-item class="query-form-item" label="备注:" prop="remark">
|
||
|
<el-input type="textarea" :rows="10" placeholder="请输入备注" v-model="inputQuery.remark"></el-input>
|
||
|
</el-form-item>
|
||
|
</el-col>
|
||
|
</el-row>
|
||
|
</el-form>
|
||
|
<div style="text-align: center;margin-top: 12px">
|
||
|
<el-button type="primary" size="small" icon="search" @click="onModifySubmit">提交</el-button>
|
||
|
<el-button type="primary" size="small" icon="search" @click="closeDialog">取消</el-button>
|
||
|
</div>
|
||
|
</el-card>
|
||
|
</div>
|
||
|
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
|
||
|
|
||
|
import {addDeviceInspectPlanDelect,uploadDeviceInspectPlanDelect} from "@/api/inventory/deviceInspectPlanDelect";
|
||
|
import {isBlank} from "@/utils/strUtil";
|
||
|
import {saveDeviceInspectPlan} from "@/api/inventory/deviceInspectPlan";
|
||
2 years ago
|
import {addDeviceRepairOrderDetail, updateDeviceRepairOrderDetail} from "@/api/inventory/deviceRepairOrderDetail";
|
||
2 years ago
|
|
||
|
export default {
|
||
|
props: {
|
||
|
inputQuery: {
|
||
|
type: Object,
|
||
|
required: true
|
||
|
},
|
||
2 years ago
|
type: {
|
||
|
type: Object,
|
||
|
required: true
|
||
|
},
|
||
2 years ago
|
closeDialog: {
|
||
|
type: Function,
|
||
|
required: true
|
||
|
}
|
||
|
},
|
||
|
name: "DeviceInspectPlanProjectSet",
|
||
|
data() {
|
||
|
return {
|
||
|
formRules: {
|
||
|
content: [
|
||
|
{required: true, message: "项目内容不能为空", trigger: "blur"}
|
||
|
],
|
||
|
},
|
||
|
};
|
||
|
},
|
||
|
methods: {
|
||
|
onModifySubmit() {
|
||
2 years ago
|
//报修接口
|
||
|
if(this.type == "repair"){
|
||
|
this.$refs["formRef"].validate((valid) => {
|
||
|
if (valid) {
|
||
|
if (isBlank(this.inputQuery.id)) {
|
||
|
addDeviceRepairOrderDetail(this.inputQuery).then((res) => {
|
||
|
if (res.code == 20000) {
|
||
|
this.closeDialog();
|
||
|
} else {
|
||
|
this.$message.error(res.message);
|
||
|
}
|
||
|
}).catch((error) => {
|
||
|
this.$message.error(error.message);
|
||
|
})
|
||
|
}else{
|
||
|
updateDeviceRepairOrderDetail(this.inputQuery).then((res) => {
|
||
|
if (res.code == 20000) {
|
||
|
this.closeDialog();
|
||
|
} else {
|
||
|
this.$message.error(res.message);
|
||
|
}
|
||
|
}).catch((error) => {
|
||
|
this.$message.error(error.message);
|
||
|
})
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
}else{
|
||
|
//巡检计划
|
||
|
this.$refs["formRef"].validate((valid) => {
|
||
|
if (valid) {
|
||
|
if (isBlank(this.inputQuery.id)) {
|
||
|
addDeviceInspectPlanDelect(this.inputQuery).then((res) => {
|
||
|
if (res.code == 20000) {
|
||
|
this.closeDialog();
|
||
|
} else {
|
||
|
this.$message.error(res.message);
|
||
|
}
|
||
|
}).catch((error) => {
|
||
|
this.$message.error(error.message);
|
||
|
})
|
||
|
}else{
|
||
|
uploadDeviceInspectPlanDelect(this.inputQuery).then((res) => {
|
||
|
if (res.code == 20000) {
|
||
|
this.closeDialog();
|
||
|
} else {
|
||
|
this.$message.error(res.message);
|
||
|
}
|
||
|
}).catch((error) => {
|
||
|
this.$message.error(error.message);
|
||
|
})
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
}
|
||
2 years ago
|
}
|
||
|
},
|
||
|
created() {
|
||
|
|
||
|
},
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<style scoped>
|
||
|
|
||
|
</style>
|