Commit a3d0687b authored by 王晓倩's avatar 王晓倩

巡检设备非空校验问题

parent c0ee0f4c
...@@ -151,7 +151,7 @@ ...@@ -151,7 +151,7 @@
</el-form-item> </el-form-item>
<el-form-item label="巡检设备" prop="devices"> <el-form-item label="巡检设备" prop="devices">
<el-cascader <el-cascader
v-model="devices" v-model="form.devices"
:options="options" :options="options"
:props="props" :props="props"
:show-all-levels="false" :show-all-levels="false"
...@@ -287,14 +287,14 @@ ...@@ -287,14 +287,14 @@
orderName: [ orderName: [
{ required: true, message: "工单名称不能为空", trigger: "blur" } { required: true, message: "工单名称不能为空", trigger: "blur" }
], ],
// devices: [ devices: [
// { required: true, message: '请选择巡检设备', trigger: 'change', type: 'array' } { required: true, message: "请选择巡检设备", trigger: "blur" }
// ], ],
startTime: [ startTime: [
{ required: true, message: '请选择开始时间', trigger: 'blur' } { required: true, message: "请选择开始时间", trigger: "blur" }
], ],
endTime: [ endTime: [
{ required: true, message: '请选择结束事件', trigger: 'blur' } { required: true, message: "请选择结束事件", trigger: "blur" }
], ],
} }
}; };
...@@ -308,7 +308,7 @@ ...@@ -308,7 +308,7 @@
methods: { methods: {
handleChange(value) { handleChange(value) {
// this.devices = value; // this.devices = value;
console.log(this.devices); console.log(this.form.devices);
}, },
/** 查询巡检计划列表 */ /** 查询巡检计划列表 */
getList() { getList() {
...@@ -405,7 +405,7 @@ ...@@ -405,7 +405,7 @@
const planId = row.planId || this.ids const planId = row.planId || this.ids
getInspectionPlan(planId).then(response => { getInspectionPlan(planId).then(response => {
this.form = response.data; this.form = response.data;
this.devices = eval(this.form.deviceIds); this.form.devices = eval(this.form.deviceIds);
this.open = true; this.open = true;
this.title = "修改巡检计划"; this.title = "修改巡检计划";
}); });
...@@ -416,7 +416,7 @@ ...@@ -416,7 +416,7 @@
if (valid) { if (valid) {
if(this.title != "下发工单") { if(this.title != "下发工单") {
// 二维数组转字符串(处理设备级联选项的值) // 二维数组转字符串(处理设备级联选项的值)
var arr = this.devices; var arr = this.form.devices;
var arrLen = arr.length; var arrLen = arr.length;
var str = "["; var str = "[";
for (var i = 0; i < arrLen; i++) { for (var i = 0; i < arrLen; i++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment