Commit ed7cc8a0 authored by wanglianghe's avatar wanglianghe

仓库

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