|
@@ -18,6 +18,7 @@
|
|
|
export default {
|
|
|
props: ["formModelVisible", "title"],
|
|
|
data() {
|
|
|
+ let that = this;
|
|
|
return {
|
|
|
formData: {},
|
|
|
formFieldsData: {
|
|
@@ -30,6 +31,7 @@ export default {
|
|
|
boit_type_sign: "",
|
|
|
status:'',
|
|
|
info: "",
|
|
|
+ fan_model:""
|
|
|
},
|
|
|
url: "workplan",
|
|
|
formConfig: {
|
|
@@ -40,13 +42,18 @@ export default {
|
|
|
label: "计划名称"
|
|
|
},
|
|
|
wind_id: {
|
|
|
-
|
|
|
type: "cascader",
|
|
|
label: "风场名称",
|
|
|
isOptions: true,
|
|
|
options: [],
|
|
|
required: true,
|
|
|
vif: true,
|
|
|
+ on: {
|
|
|
+ change: (val) => {
|
|
|
+
|
|
|
+ that.queryWorkByFanModel(val);
|
|
|
+ }
|
|
|
+ },
|
|
|
attrs: {
|
|
|
//查询
|
|
|
filterable: true,
|
|
@@ -59,21 +66,35 @@ export default {
|
|
|
}
|
|
|
|
|
|
},
|
|
|
- //风场id
|
|
|
+ //风机id
|
|
|
fan_id:{
|
|
|
-
|
|
|
type: "cascader",
|
|
|
label: "风机编号",
|
|
|
isOptions: true,
|
|
|
+ // isReloadOptions: true,
|
|
|
options: [],
|
|
|
required: true,
|
|
|
- vif:true,
|
|
|
+ vif: true,
|
|
|
+ on: {
|
|
|
+ change: (val) => {
|
|
|
+ let arr = this.formConfig.formDesc.fan_id.options;
|
|
|
+ let model_id = '';
|
|
|
+ arr.forEach(item => {
|
|
|
+ if (item.id == val)
|
|
|
+ {
|
|
|
+ model_id = item.fan_model;
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
+ that.queryWorkByFanModel(model_id);
|
|
|
+ }
|
|
|
+ },
|
|
|
attrs: {
|
|
|
//查询
|
|
|
filterable:true,
|
|
|
props: {
|
|
|
- label: "name",
|
|
|
- value: "value",
|
|
|
+ label: "number",
|
|
|
+ value: "id",
|
|
|
emitPath: false,
|
|
|
multiple:false
|
|
|
}
|
|
@@ -141,22 +162,14 @@ export default {
|
|
|
|
|
|
},
|
|
|
status: {
|
|
|
- break: true,
|
|
|
-
|
|
|
- type: "select",
|
|
|
+ type: "switch",
|
|
|
label: "使用状态",
|
|
|
- required: true,
|
|
|
isOptions: true,
|
|
|
- options: [
|
|
|
- {
|
|
|
- text: "使用",
|
|
|
- value: 1
|
|
|
- },
|
|
|
- {
|
|
|
- text: "未使用",
|
|
|
- value: -1
|
|
|
- },
|
|
|
- ]
|
|
|
+ default:1,
|
|
|
+ attrs: {
|
|
|
+ activeValue: 1,
|
|
|
+ inactiveValue:-1
|
|
|
+ }
|
|
|
},
|
|
|
info: {
|
|
|
type: "textarea",
|
|
@@ -172,9 +185,9 @@ export default {
|
|
|
this.formConfig.formDesc.wind_id.options = response.data;
|
|
|
});
|
|
|
|
|
|
- this.$http.get("get_mainten_option?type=" + "2").then((response) => {
|
|
|
- this.formConfig.formDesc.work_sign.options = response.data;
|
|
|
- });
|
|
|
+ // this.$http.get("get_mainten_option?type=" + "2").then((response) => {
|
|
|
+ // this.formConfig.formDesc.work_sign.options = response.data;
|
|
|
+ // });
|
|
|
this.$http.get("get_mainten_option?type=" + "1").then((response) => {
|
|
|
this.formConfig.formDesc.parts_sign.options = response.data;
|
|
|
});
|
|
@@ -194,7 +207,20 @@ export default {
|
|
|
},
|
|
|
handleRequestSuccess() {
|
|
|
this.$message.success("发送成功");
|
|
|
+ },
|
|
|
+ queryFanByWindId(id)
|
|
|
+ {
|
|
|
+ this.$http.get("queryFanByWindId?id=" +id).then((response) => {
|
|
|
+ this.formConfig.formDesc.fan_id.options = response.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ queryWorkByFanModel(fan_model)
|
|
|
+ {
|
|
|
+ this.$http.get("get_mainten_option?type=2&fan_model=" +fan_model).then((response) => {
|
|
|
+ this.formConfig.formDesc.work_sign.options = response.data;
|
|
|
+ });
|
|
|
}
|
|
|
+
|
|
|
},
|
|
|
|
|
|
computed: {
|
|
@@ -203,7 +229,12 @@ export default {
|
|
|
this.$emit("sendVal", val); // 表示将子组件改变的值传递给父组件
|
|
|
},
|
|
|
get() {
|
|
|
-
|
|
|
+ if (this.formModelVisible)
|
|
|
+ {
|
|
|
+ this.queryFanByWindId(this.formFieldsData.wind_id)
|
|
|
+ this.queryWorkByFanModel(this.formFieldsData.fan_model);
|
|
|
+
|
|
|
+ }
|
|
|
return this.formModelVisible; // 表示获取父组件的值
|
|
|
}
|
|
|
}
|