Commit ff619e4a authored by wanglianghe's avatar wanglianghe

网点状态,服务内容

parent 5c8fd953
......@@ -31,13 +31,17 @@
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="" align="center" prop="id" />
<el-table-column label="排序" align="center" prop="aorder" />
<el-table-column label="网点编号" align="center" prop="number" />
<el-table-column label="网点名称" align="center" prop="titleZh" />
<el-table-column label="网点地址" align="center" prop="addressZh" />
<el-table-column label="负责人的用户id" align="center" prop="adminId" />
<el-table-column label="显示" align="center" prop="status" />
<el-table-column prop="status" label="状态" width="100">
<template slot-scope="scope">
<el-switch v-model="scope.row.status" :active-value="CommonStatusEnum.ENABLE" :inactive-value="CommonStatusEnum.DISABLE" @change="handleStatusChange(scope.row)" />
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
......@@ -125,11 +129,12 @@
</el-select>
</el-form-item>
<el-form-item label="服务内容" prop="freight">
<el-checkbox-group v-model="checkList">
<el-checkbox v-for="dict in transportDatas" :label="dict.label" :key="dict.value" name="freight">{{dict.label}}</el-checkbox>
<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-checkbox-group>
</el-form-item>
</el-form-item>
<el-form-item label="网点详情" prop="contentZh">
<el-input v-model="form.contentZh" placeholder="请输入网点详情" />
......@@ -194,9 +199,6 @@ export default {
//市信息列表
cityList: [],
//已选中服务方式
checkList:[],
// 服务网点列表
list: [],
// 弹出层标题
......@@ -210,7 +212,9 @@ export default {
pageSize: 10
},
// 表单参数
form: {},
form: {
type:[],
},
// 表单校验
rules: {
area: [{ validator:areaCheck, required: true, trigger: "blur" }],
......@@ -225,10 +229,8 @@ export default {
contentZh: [{ required: true, message: "网点详情不能为空", trigger: "blur" }],
contentEn: [{ required: true, message: "英文详情不能为空", trigger: "blur" }],
worktime: [{ required: true, message: "上班时间不能为空", trigger: "blur" }],
tradeType: [
{ required: true, message: '请选择网点属性', trigger: 'change' }
],
freight: [
tradeType: [{ required: true, message: '请选择网点属性', trigger: 'change' }],
type: [
{ type: 'array', required: true, message: '请至少选择一个服务内容', trigger: 'change' }
],
},
......@@ -329,6 +331,19 @@ export default {
}
},
handleStatusChange(row) {
let text = row.status === CommonStatusEnum.ENABLE ? "启用" : "停用";
this.$modal.confirm('确认要' + text + '编号为' + row.id + '的数据吗?').then(function() {
return updateNode(row);
}).then(() => {
this.$modal.msgSuccess(text + "成功");
}).catch(function() {
row.status = row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE
: CommonStatusEnum.ENABLE;
});
},
/** 取消按钮 */
cancel() {
......@@ -357,6 +372,7 @@ export default {
worktime: undefined,
adminId: undefined,
aorder: undefined,
type: []
};
this.resetForm("form");
......@@ -384,6 +400,14 @@ export default {
const id = row.id;
getNode(id).then(response => {
this.form = response.data;
this.changeContinents(response.data.zhou);
this.changeCountry(response.data.guojia);
this.changeProvince(response.data.sheng);
//TODO
this.form.type = response.data.freight.split(',');
this.open = true;
this.title = "修改服务网点";
});
......@@ -397,8 +421,8 @@ export default {
//逗号拼接运输方式
var freight = ''
for(let i = 0; i < this.checkList.length; i++) {
freight += this.checkList[i] + ','
for(let i = 0; i < this.form.type.length; i++) {
freight += this.form.type[i] + ','
}
freight = freight.substring(0, freight.length - 1);
this.form.freight = freight;
......
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