Commit ed7cc8a0 authored by wanglianghe's avatar wanglianghe

仓库

parent 585f5ac4
......@@ -168,9 +168,9 @@
</el-select>
</el-form-item>
<el-form-item label="服务内容" prop="type">
<el-checkbox-group v-model="form.type">
<el-checkbox v-for="dict in transportDatas" :label="dict.value" :key="dict.value" name="freight"> {{dict.label}}</el-checkbox>
<el-form-item label="服务内容" prop="checkList">
<el-checkbox-group v-model="form.checkList">
<el-checkbox v-for="dict in transportDatas" :label="dict.value" :key="dict.value" :value="dict.value" name="freight"> {{dict.label}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
......@@ -264,7 +264,7 @@ export default {
},
// 表单参数
form: {
type:[],
checkList:[],
},
// 表单校验
rules: {
......@@ -281,7 +281,7 @@ export default {
contentEn: [{ required: true, message: "英文详情不能为空", trigger: "blur" }],
worktime: [{ required: true, message: "上班时间不能为空", trigger: "blur" }],
tradeType: [{ required: true, message: '请选择网点属性', trigger: 'change' }],
type: [
checkList: [
{ type: 'array', required: true, message: '请至少选择一个服务内容', trigger: 'change' }
],
},
......@@ -461,7 +461,7 @@ export default {
worktime: undefined,
adminId: undefined,
aorder: undefined,
type: []
checkList: []
};
this.resetForm("form");
......@@ -494,8 +494,8 @@ export default {
this.changeCountry(response.data.guojia);
this.changeProvince(response.data.sheng);
//TODO
this.form.type = response.data.freight.split(',');
let ckList = response.data.freight.split(',');
this.$set(this.form, 'checkList', ckList);
this.open = true;
this.title = "修改服务网点";
......@@ -510,8 +510,8 @@ export default {
//逗号拼接运输方式
var freight = ''
for(let i = 0; i < this.form.type.length; i++) {
freight += this.form.type[i] + ','
for(let i = 0; i < this.form.checkList.length; i++) {
freight += this.form.checkList[i] + ','
}
freight = freight.substring(0, freight.length - 1);
this.form.freight = freight;
......
......@@ -152,7 +152,7 @@
</el-select>
</el-form-item>
<el-form-item label="运输方式" prop="freight">
<el-form-item label="运输方式" prop="checkList">
<el-checkbox-group v-model="form.checkList">
<el-checkbox v-for="dict in transportDatas" :label="dict.value" :key="dict.value" name="freight"> {{dict.label}}</el-checkbox>
</el-checkbox-group>
......@@ -200,16 +200,6 @@ export default {
}
};
var freightCheck = (rule, value, callback) => {
console.log('@@@@@');
console.log(this.form.checkList);
if(!this.form.checkList) {
callback(new Error('请至少选择一个服务内容'));
} else {
callback();
}
};
return {
// 遮罩层
loading: true,
......@@ -279,7 +269,9 @@ export default {
addressZh: [{ required: true, message: "仓库地址不能为空", trigger: "blur" }],
addressEn: [{ required: true, message: "英文地址不能为空", trigger: "blur" }],
tradeType: [{ required: true, message: '请选择网点属性', trigger: 'change' }],
freight: [{ validator:freightCheck, required: true, trigger: 'blur' }],
checkList: [
{ type: 'array', required: true, message: '请至少选择一个服务内容', trigger: 'change' }
],
},
nodeId: this.$route.query.nodeId,
......@@ -485,12 +477,15 @@ export default {
getWarehouse(id).then(response => {
this.form = response.data;
let ckList = response.data.freight.split(',');
this.$set(this.form, 'checkList', ckList);
this.changeContinents(response.data.zhou);
this.changeCountry(response.data.guojia);
this.changeProvince(response.data.sheng);
this.form.checkList = response.data.freight.split(',');
this.isUpdate = true;
this.open = true;
......
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