Commit 81755be0 by xiaohai

数据联调

parent 3b7b30f3
...@@ -122,11 +122,18 @@ ...@@ -122,11 +122,18 @@
}; };
}, },
methods: { methods: {
formatGroupData(data, employees = []) { formatGroupData(treeData, personData) {
let copyData = data.slice(0);
let _this = this; let _this = this;
let data = [].concat(JSON.parse(JSON.stringify(treeData)));
let employees = [].concat(JSON.parse(JSON.stringify(personData)));
let copyData = data.slice(0);
let onlyGroup = _this.onlyGroup; let onlyGroup = _this.onlyGroup;
this.menuData = [];
this.defaultOpen = [];
this.menusObj = {};
data.forEach(group => { data.forEach(group => {
group.allClerks = null;
group.childrens = null;
group.label = group.name || ""; group.label = group.name || "";
group.id = group.groupId || ""; group.id = group.groupId || "";
let allClerks = []; let allClerks = [];
...@@ -260,20 +267,47 @@ ...@@ -260,20 +267,47 @@
this.$refs.tree.filter(newK); this.$refs.tree.filter(newK);
}, },
treeData(newData) { treeData(newData) {
// let treeData = [].concat(JSON.parse(JSON.stringify(newData.treeData)));
// let personData = [].concat(JSON.parse(JSON.stringify(newData.personData)));
this.formatGroupData(newData.treeData, newData.personData); this.formatGroupData(newData.treeData, newData.personData);
}, },
defaultSelection(list) { treeSet(obj) {
this.$nextTick(() => { if (obj.dialogVisible) {
console.log(this.$refs, "this"); this.formatGroupData(this.treeData.treeData, this.treeData.personData);
this.selectedList = list; if (this.defaultSelection) {
this.$refs.tree.setCheckedNodes(list); let list = this.defaultSelection;
list.forEach(li => { this.$nextTick(() => {
this.defaultOpen.push(this.menusObj[li.id].parentId); console.log(this.$refs, "this");
}); this.selectedList = list;
}); this.$refs.tree.setCheckedNodes(list);
list.forEach(li => {
if (li.employeeClerkId) {
this.defaultOpen = [li.departmentId];
} else {
this.defaultOpen.push(this.menusObj[li.id].parentId);
}
});
});
}
}
}, },
// defaultSelection(list) {
// console.log(list);
// this.$nextTick(() => {
// console.log(this.$refs, "this");
// this.selectedList = list;
// this.$refs.tree.setCheckedNodes(list);
// list.forEach(li => {
// if (li.employeeClerkId) {
// this.defaultOpen = [li.departmentId];
// } else {
// this.defaultOpen.push(this.menusObj[li.id].parentId);
// }
// });
// });
// },
changed() { changed() {
this.formatGroupData(this.treeData.treeData, this.treeData.personData); // this.formatGroupData(this.treeData.treeData, this.treeData.personData);
} }
} }
}; };
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
inactive-color="#DCDFE6"> inactive-color="#DCDFE6">
</el-switch> </el-switch>
<div class="particular-setting" v-if="visibleThere"> <div class="particular-setting" v-if="visibleThere">
<select-area @callPerSelector="callPerSelector" :treeData="treeData"></select-area> <select-area @callPerSelector="callPerSelector" :treeData="treeData" :butList="butList" :specialList="specialList"></select-area>
</div> </div>
</div> </div>
<div class="only-visivble-self permission-div"> <div class="only-visivble-self permission-div">
...@@ -20,6 +20,9 @@ ...@@ -20,6 +20,9 @@
active-color="#409EFF" active-color="#409EFF"
inactive-color="#DCDFE6"> inactive-color="#DCDFE6">
</el-switch> </el-switch>
<div class="particular-setting" v-if="visibleSelf">
<select-area @callPerSelector="callPerSelector" :treeData="treeData" :butList="selfButList" :specialList="specialList"></select-area>
</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -31,7 +34,19 @@ ...@@ -31,7 +34,19 @@
selectArea selectArea
}, },
props: { props: {
visibleApartList: { butList: {
type: Array,
default() {
return [];
}
},
specialList: {
type: Array,
default() {
return [];
}
},
selfButList: {
type: Array, type: Array,
default() { default() {
return []; return [];
...@@ -54,6 +69,12 @@ ...@@ -54,6 +69,12 @@
default() { default() {
return {}; return {};
} }
},
departInfo: {
type: Object,
default() {
return {}
}
} }
}, },
data() { data() {
...@@ -68,21 +89,23 @@ ...@@ -68,21 +89,23 @@
*/ */
switchPermission(val, _this, _there) { switchPermission(val, _this, _there) {
val && (this[_there] = !val); val && (this[_there] = !val);
if (this.visibleSelf) {
this.departInfo.type = 2;
} else if (this.visibleThere) {
this.departInfo.type = 1;
} else {
this.departInfo.type = "";
}
}, },
callPerSelector(type, list) { callPerSelector(type, list) {
this.$emit("callPerSelector", type, list); this.$emit("callPerSelector", type, list);
} }
}, },
computed: { mounted() {
vaList() { console.log(this.departInfo);
return this.visibleApartList; let type = this.departInfo.type;
}, this.visibleThere = !!type == 1;
vsList() { this.visibleSelf = !!type == 2;
return this.visibleSpecialLsit;
},
osaList() {
return this.onlySelfApartList;
}
} }
}; };
</script> </script>
......
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
<div class="select-area"> <div class="select-area">
<div class="setting-name"> <div class="setting-name">
个别员工不设置该权限 个别员工不设置该权限
<!-- <a class="J_add a-href" @click="treeSet.dialogVisible = true;"><i class="el-icon-plus"></i>添加</a>
<a class="a-href J_check-detail">查看详情</a> -->
</div> </div>
<ul class="particular-list"> <ul class="particular-list">
<template v-for="(li, index) in butList"> <template v-for="(li, index) in butList">
...@@ -21,24 +19,23 @@ ...@@ -21,24 +19,23 @@
</ul> </ul>
<div class="setting-name"> <div class="setting-name">
允许指定部门/人员可见 允许指定部门/人员可见
<a class="J_add a-href"><i class="el-icon-plus"></i>添加</a> <!-- <a class="J_add a-href"><i class="el-icon-plus"></i>添加</a>
<a class="a-href J_check-detail">查看详情</a> <a class="a-href J_check-detail">查看详情</a> -->
</div> </div>
<ul class="particular-list"> <ul class="particular-list">
<template v-for="(li, index) in vipList"> <template v-for="(li, index) in specialList">
<li class="item person-item" v-if="li.employeeClerkId" :key="index+'_'+li.employeeClerkId"> <li class="item person-item" v-if="li.employeeClerkId" :key="index+'_'+li.employeeClerkId">
<img :src="li.headPic"> <img :src="li.headPic">
<p class="name">{{li.label}}</p> <p class="name">{{li.label}}</p>
<i class="el-icon-circle-close" @click="delCurrent(li, 'vipList')"></i> <i class="el-icon-circle-close" @click="delCurrent(li, 'specialList')"></i>
</li> </li>
<li class="item group-item" v-else :key="index+'_'+li.groupId"> <li class="item group-item" v-else :key="index+'_'+li.groupId">
{{li.label}} {{li.label}}
<i class="el-icon-circle-close" @click="delCurrent(li, 'vipList')"></i> <i class="el-icon-circle-close" @click="delCurrent(li, 'specialList')"></i>
</li> </li>
</template> </template>
<li class="item J_add-btn" @click="callSelector"><i class="el-icon-plus"></i></li> <li class="item J_add-btn" @click="callSelector('special', specialList)"><i class="el-icon-plus"></i></li>
</ul> </ul>
<!-- <vue-select-employee ref="butSelector" :treeSet="treeSet" @handleSelectedList="handleSelectedList" :treeData="groupData"></vue-select-employee> -->
</div> </div>
</template> </template>
<script> <script>
...@@ -55,18 +52,22 @@ export default { ...@@ -55,18 +52,22 @@ export default {
default() { default() {
return {}; return {};
} }
},
butList: {
type: Array,
default() {
return [];
}
},
specialList: {
type: Array,
default() {
return [];
}
} }
}, },
data() { data() {
return { return {
testList: [],
treeSet: {
isSelectPerson: true,
dialogVisible: false
},
butList: [],
vipList: [],
groupData: {}
}; };
}, },
...@@ -96,8 +97,6 @@ export default { ...@@ -96,8 +97,6 @@ export default {
}, },
watch: { watch: {
treeData(data) { treeData(data) {
console.log(data);
this.groupData = data;
} }
} }
}; };
...@@ -148,6 +147,7 @@ export default { ...@@ -148,6 +147,7 @@ export default {
border-radius:4px; border-radius:4px;
font-size:12px; font-size:12px;
color:rgba(64,158,255,1); color:rgba(64,158,255,1);
margin-top: 34px;
} }
&.J_add-btn { &.J_add-btn {
height:40px; height:40px;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
:visible.sync="dialogVisible"> :visible.sync="dialogVisible">
<p>请输入品牌名称</p> <p>请输入品牌名称</p>
<el-input v-model="brandName" class="m-t-20"></el-input> <el-input v-model="brandName" class="m-t-20"></el-input>
<p class="danger-tip"> <!-- <p class="danger-tip">
<i class="el-icon-info"></i> <i class="el-icon-info"></i>
下列两项选择后将无法修改,请谨慎选择 下列两项选择后将无法修改,请谨慎选择
</p> </p>
...@@ -27,15 +27,16 @@ ...@@ -27,15 +27,16 @@
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select> -->
<div class="btn-box t-rt m-t-20 m-b-10"> <div class="btn-box t-rt m-t-20 m-b-10">
<el-button @click="dialogVisible = false;">取消</el-button> <el-button @click="dialogVisible = false;">取消</el-button>
<el-button type="primary">确定</el-button> <el-button type="primary" @click="saveFn">确定</el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { getRequest } from '@/api/api';
export default { export default {
name: "add-brand-dialog", name: "add-brand-dialog",
data() { data() {
...@@ -66,6 +67,36 @@ ...@@ -66,6 +67,36 @@
], ],
brand: "" brand: ""
}; };
},
methods: {
saveFn() {
if (!this.brandName) {
this.$message.error({
message: "请输入品牌名称"
});
} else {
let ths = this;
let params = {
name: ths.brandName
};
getRequest("/haoban-manage-web/brand/insert", params)
.then(res => {
if (res.data.errorCode == 1) {
console.log(res);
ths.$emit("addSuccess");
} else {
ths.$message.error({
message: res.data.message
});
}
})
.catch(e => {
ths.$message.error({
message: e.message
});
});
}
}
} }
}; };
</script> </script>
......
...@@ -67,8 +67,8 @@ ...@@ -67,8 +67,8 @@
</el-form-item> </el-form-item>
<el-form-item label="门店地址"> <el-form-item label="门店地址">
<vue-office-area :areaOptions="areaOptions" @selected="selected" projectName="haoban-web" postUrl="/api-admin/dict-district-list"></vue-office-area> <vue-office-area :areaOptions="areaOptions" @selected="selected" projectName="haoban-web" postUrl="/api-admin/dict-district-list"></vue-office-area>
<el-input v-model="areaOptions.postAddress"> <el-input v-model="storeInfo.postAddress">
<template slot="suffix">{{(areaOptions.postAddress || "").length}}/50</template> <template slot="suffix">{{(storeInfo.postAddress || "").length}}/50</template>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="GPS坐标"> <el-form-item label="GPS坐标">
...@@ -97,12 +97,12 @@ ...@@ -97,12 +97,12 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="手机号码" prop="phone"> <el-form-item label="手机号码" prop="phone">
<el-input v-model="storeInfo.managerPhoneNumber"></el-input> <el-input v-model="storeInfo.managerPhoneNumber" disabled></el-input>
</el-form-item> </el-form-item>
<el-form-item label="店长性别"> <el-form-item label="店长性别">
<el-radio-group v-model="storeInfo.managerSex"> <el-radio-group v-model="storeInfo.managerSex">
<el-radio label="1"></el-radio> <el-radio :label="1"></el-radio>
<el-radio label="2"></el-radio> <el-radio :label="2"></el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="店长代码"> <el-form-item label="店长代码">
...@@ -154,16 +154,16 @@ export default { ...@@ -154,16 +154,16 @@ export default {
storeInfo: { storeInfo: {
type: Object, type: Object,
default() { default() {
return { return {};
groupChainName: ""
};
} }
} }
}, },
data() { data() {
return { return {
areaChainName: "", areaChainName: "",
location: "" location: "",
areaOptions: {},
imgs: []
}; };
}, },
methods: { methods: {
...@@ -171,7 +171,6 @@ export default { ...@@ -171,7 +171,6 @@ export default {
this.$refs.storeSelector.treeSet.dialogVisible = true; this.$refs.storeSelector.treeSet.dialogVisible = true;
}, },
handleSelectedList(list) { handleSelectedList(list) {
console.log(list);
this.storeInfo.groupChainName = list[0].label; this.storeInfo.groupChainName = list[0].label;
this.storeInfo.storeGroupId = list[0].id; this.storeInfo.storeGroupId = list[0].id;
}, },
...@@ -188,16 +187,17 @@ export default { ...@@ -188,16 +187,17 @@ export default {
let locationArr = that.location.split(","); let locationArr = that.location.split(",");
that.storeInfo.longitude = locationArr[0]; that.storeInfo.longitude = locationArr[0];
that.storeInfo.latitude = locationArr.length !== 2 ? "" : locationArr[1]; that.storeInfo.latitude = locationArr.length !== 2 ? "" : locationArr[1];
that.storeInfo.postAddress = that.areaOptions.postAddress;
that.storeInfo.managerPhone = that.storeInfo.managerPhoneNumber; that.storeInfo.managerPhone = that.storeInfo.managerPhoneNumber;
that.storeInfo.areaChainName = that.areaChainName; that.storeInfo.areaChainName = that.areaOptions.provinceName + "/" + that.areaOptions.cityName + "/" + that.areaOptions.countryName;
let params = that.storeInfo; let params = that.storeInfo;
console.log(params, "params"); console.log(params, "params");
getRequest("/haoban-manage-web/store/update", params) getRequest("/haoban-manage-web/store/update", params)
.then(res => { .then(res => {
console.log(res, "eidt result"); console.log(res, "eidt result");
if (res.data.errorCode == 1) { if (res.data.errorCode == 1) {
that.$message.success({
message: "操作成功!"
});
} else { } else {
that.$message.error({ that.$message.error({
message: res.data.message message: res.data.message
...@@ -209,26 +209,26 @@ export default { ...@@ -209,26 +209,26 @@ export default {
message: e.message message: e.message
}); });
}); });
} },
formatStoreInfo(obj) {
},
computed: {
areaOptions() {
let ths = this; let ths = this;
let arr = (ths.storeInfo.areaChainName || "").split("/"); let arr = (obj.areaChainName || "").split("/");
return { ths.areaOptions = {
provinceName: arr[0], provinceName: arr[0],
provinceId: ths.provinceId, provinceId: obj.provinceId,
cityName: arr[1], cityName: arr[1],
cityId: ths.cityId, cityId: obj.cityId,
countryName: arr[2], countryName: arr[2],
countyId: ths.countyId countyId: obj.countyId
}; };
}, ths.imgs = !obj.imageUrl ? [] : obj.imageUrl.split(",");
imgs() { ths.location = obj.longitude + "," + obj.latitude;
console.log(this.storeInfo.imageUrl, !!this.storeInfo.imageUrl); console.log( ths.areaOptions , ths.storeInfo, "ssss");
return !this.storeInfo.imageUrl ? [] : this.storeInfo.imageUrl.split(",");
} }
},
mounted() {
this.formatStoreInfo(this.storeInfo);
}, },
watch: { watch: {
$route(to) { $route(to) {
......
<template> <template>
<div class="add-department-container"> <div class="add-department-container">
<div class="setting-cell depart-info"> <div class="setting-cell depart-info" v-if="$route.query.type == 'group'">
<p class="title">部门信息</p> <p class="title">部门信息</p>
<el-form <el-form
class="department-info-form" class="department-info-form"
...@@ -13,13 +13,27 @@ ...@@ -13,13 +13,27 @@
<el-input v-model="departInfo.name"></el-input> <el-input v-model="departInfo.name"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="部门排序调整" prop="parentId"> <el-form-item label="部门排序调整" prop="parentId">
<el-input :disabled="disabled" v-model="departInfo.parentName" @focus="callGroupSelector" suffix-icon="el-icon-arrow-down"></el-input> <el-input :disabled="disabled" v-model="departInfo.chainName" @focus="callGroupSelector" suffix-icon="el-icon-arrow-down"></el-input>
</el-form-item>
</el-form>
</div>
<div class="setting-cell depart-info" v-else>
<p class="title">企业信息</p>
<el-form
class="department-info-form"
label-position="right"
:rules="rules"
:model="departInfo"
ref="departForm"
label-width="120px">
<el-form-item label="企业名称" prop="name">
<el-input v-model="departInfo.name" disabled></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<div class="setting-cell" v-if="!isAddNew"> <div class="setting-cell" v-if="!isAddNew">
<p class="title">权限设置</p> <p class="title">权限设置</p>
<permission-setting @callPerSelector="callPerSelector" :visibleApartList="testList" :visibleSpecialLsit="testList" :onlySelfApartList="testList" :treeData="treeData"></permission-setting> <permission-setting v-if="!disabled" @callPerSelector="callPerSelector" :departInfo="departInfo" :selfButList="selfButList" :butList="butList" :specialList="specialList" :visibleSpecialLsit="testList" :onlySelfApartList="testList" :treeData="treeData"></permission-setting>
</div> </div>
<div class="setting-cell"> <div class="setting-cell">
<div class="btn-area"> <div class="btn-area">
...@@ -43,11 +57,7 @@ ...@@ -43,11 +57,7 @@
}, },
data() { data() {
return { return {
departInfo: { departInfo: {},
name: "",
parentName: "",
parentId: ""
},
testList: [], testList: [],
treeSet: { treeSet: {
isSelectPerson: false, isSelectPerson: false,
...@@ -60,7 +70,7 @@ ...@@ -60,7 +70,7 @@
{ min: 1, max: 20, message: '长度在 1 到 20 个字符', trigger: 'blur' } { min: 1, max: 20, message: '长度在 1 到 20 个字符', trigger: 'blur' }
], ],
parentId: [ parentId: [
{ required: true, message: '请选择父级部门', trigger: 'change' } { required: true, message: '请选择父级部门', trigger: 'blur' }
] ]
}, },
treeData: {}, treeData: {},
...@@ -70,7 +80,10 @@ ...@@ -70,7 +80,10 @@
selectorType: "parent", selectorType: "parent",
changed: "parent", changed: "parent",
onlyPerson: false, onlyPerson: false,
onlyGroup: [] onlyGroup: [],
butList: [], // 仅可见本部门,个别员工除外
specialList: [], // 指定部门/人员可见
selfButList: []
}; };
}, },
methods: { methods: {
...@@ -85,20 +98,7 @@ ...@@ -85,20 +98,7 @@
getRequest("/haoban-manage-web/dept/findDeptById", params) getRequest("/haoban-manage-web/dept/findDeptById", params)
.then(res => { .then(res => {
if (res.data.errorCode == 1) { if (res.data.errorCode == 1) {
that.departInfo.name = res.data.result.name; this.formatGroupInfo(res.data.result);
that.departInfo.parentId = res.data.result.parentId;
let chain = res.data.result.chainName.split("/");
let len = chain.length;
if (len == 1) {
that.departInfo.parentName = ""
} else {
that.departInfo.parentName = chain[len - 2];
}
that.defaultParent = [{
label: that.departInfo.parentName,
id: res.data.result.parentId,
groupId: res.data.result.parentId
}];
} else { } else {
that.$message.error({ that.$message.error({
duration: 1000, duration: 1000,
...@@ -114,6 +114,43 @@ ...@@ -114,6 +114,43 @@
}) })
}, },
/** /**
*
* 处理部门信息
*/
formatGroupInfo(obj) {
let that = this;
that.departInfo.parentName = obj.chainName;
that.defaultParent = [{
label: that.departInfo.parentName,
id: obj.parentId,
groupId: obj.parentId
}];
obj.noPreClerkList = obj.noPreClerkList || [];
obj.allowClerkList = obj.allowClerkList || [];
obj.allowDeptList = obj.allowDeptList || [];
obj.noPreClerkList.forEach(clerk => {
clerk.label = clerk.name;
clerk.id = clerk.employeeClerkId;
});
obj.allowClerkList.forEach(clerk => {
clerk.label = clerk.name;
clerk.id = clerk.employeeClerkId;
});
obj.allowDeptList.forEach(group => {
group.label = group.name;
group.id = group.groupId;
});
that.specialList = obj.allowDeptList.concat(obj.allowClerkList);
if (obj.type == 1) {
that.butList = obj.noPreClerkList;
that.selfButList = [];
} else if(obj.type == 2) {
that.selfButList = obj.noPreClerkList;
that.butList = [];
}
that.departInfo = obj;
},
/**
* 唤起部门选择器 * 唤起部门选择器
*/ */
callGroupSelector() { callGroupSelector() {
...@@ -129,37 +166,79 @@ ...@@ -129,37 +166,79 @@
}; };
}, },
callPerSelector(type, list) { callPerSelector(type, list) {
this.selectorType = type; if (type == "but") {
this.defaultSelection = list; this.selectorType = type;
this.onlyPerson = true; this.defaultSelection = list;
this.onlyGroup = [this.$route.query.departmentId]; this.onlyPerson = true;
console.log(this.$route.query.departmentId); this.onlyGroup = [this.$route.query.departmentId];
this.changed = type; this.changed = type;
this.treeSet = { this.treeSet = {
dialogVisible: true, dialogVisible: true,
isSingle: false, isSingle: false,
isSelectPerson: true isSelectPerson: true
}; };
} else {
this.selectorType = type;
this.defaultSelection = list;
this.onlyPerson = false;
this.onlyGroup = [];
this.changed = type;
this.treeSet = {
dialogVisible: true,
isSingle: false,
isSelectPerson: true
};
}
}, },
/** /**
* 处理已选部门 * 处理已选部门
*/ */
handleSelectedList(group) { handleSelectedList(group) {
console.log(group); console.log(group);
this.departInfo.parentId = group ? group.id : ""; if (this.changed == "parent") {
this.departInfo.parentName = group ? group.label : ""; this.departInfo.parentId = group ? group.id : "";
this.departInfo.parentName = group ? group.label : "";
} else if (this.changed == "but") {
this.butList = group;
} else if (this.changed == "special") {
this.specialList = group;
}
}, },
saveEdit(goAhead = "") { saveEdit(goAhead = "") {
console.log(this.departInfo);
let _this = this;
this.$refs.departForm.validate(valid => { this.$refs.departForm.validate(valid => {
if (!valid) { if (!valid) {
return false; return false;
} }
let _this = this; let type = _this.departInfo.type;
let idArr = [];
if (type != "") {
_this[type == 1 ? "butList" : "selfButList"].forEach(per => {
idArr.push(per.id);
});
}
let allowCherkIds = [];
let allowDepartIds = [];
_this.specialList.forEach(per => {
if (per.employeeClerkId) {
allowCherkIds.push(per.id);
} else {
allowDepartIds.push(per.id);
}
});
let ids = idArr.join(",")
let params = { let params = {
type,
noPreCherkIds: ids,
allowCherkIds: allowCherkIds.join(","),
allowDepartIds: allowDepartIds.join(","),
parentId: _this.departInfo.parentId, parentId: _this.departInfo.parentId,
name: _this.departInfo.name name: _this.departInfo.name
} }
getRequest("/haoban-manage-web/dept/insert", params) if (!_this.isAddNew) params.groupId = _this.$route.query.departmentId;
let url = _this.isAddNew ? "/haoban-manage-web/dept/insert" : "/haoban-manage-web/dept/update";
getRequest(url, params)
.then(res => { .then(res => {
console.log(res); console.log(res);
if (res.data.errorCode == 1) { if (res.data.errorCode == 1) {
......
...@@ -78,7 +78,13 @@ export default { ...@@ -78,7 +78,13 @@ export default {
parentId: _this.departInfo.parentId, parentId: _this.departInfo.parentId,
name: _this.departInfo.name name: _this.departInfo.name
} }
let url = _this.isAddNew ? "/haoban-manage-web/dept/insert" : "/haoban-manage-web/department/update"; let url = "";
if (_this.isAddNew) {
url = "/haoban-manage-web/dept/insert";
} else {
url = "/haoban-manage-web/dept/update";
params.groupId = _this.$route.query.groupId;
}
getRequest(url, params) getRequest(url, params)
.then(res => { .then(res => {
console.log(res); console.log(res);
......
...@@ -15,16 +15,16 @@ ...@@ -15,16 +15,16 @@
<span class="title-span">{{groupInfo.groupName}}{{total}}人)</span> <span class="title-span">{{groupInfo.groupName}}{{total}}人)</span>
<span class="id-span">部门ID: {{groupInfo.departmentId}}</span> <span class="id-span">部门ID: {{groupInfo.departmentId}}</span>
<span class="handle-area"> <span class="handle-area">
<a :href="'#/addDepartment?addnew=1&departmentId='+groupInfo.departmentId" class="J_add-child a-href">添加子部门</a> <el-button @click="addSon" class="no-bdr-btn" :disabled="groupInfo.hasPression != 1">添加子分组</el-button>
<span class="hurdle"></span> <span class="hurdle"></span>
<a :href="'#/addDepartment?departmentId='+groupInfo.departmentId" class="J_edit a-href">编辑</a> <el-button @click="goToEdit(groupInfo.level)" :href="'#/addGroup?groupId='+groupInfo.departmentId" :disabled="groupInfo.hasPression != 1" class="no-bdr-btn">编辑</el-button>
</span> </span>
</div> </div>
<div class="af-right-button-box"> <div class="af-right-button-box">
<a :href="'#/employee?addnew=1&departmentId='+groupInfo.departmentId"> <a :href="'#/employee?addnew=1&departmentId='+groupInfo.departmentId">
<el-button type="primary">添加成员</el-button> <el-button type="primary">添加成员</el-button>
</a> </a>
<a><el-button>批量导入/导出</el-button></a> <a :href="'#/employeeIo?departmentId='+groupInfo.departmentId"><el-button>批量导入/导出</el-button></a>
<el-button type="danger" plain @click="delMembers" :disabled="disabledDel">批量删除</el-button> <el-button type="danger" plain @click="delMembers" :disabled="disabledDel">批量删除</el-button>
<el-button class="J_show-children"><el-checkbox class="m-r-10" v-model="showChildMember" @change="setChildMemberShow"></el-checkbox><a class="a-href">显示子成员</a></el-button> <el-button class="J_show-children"><el-checkbox class="m-r-10" v-model="showChildMember" @change="setChildMemberShow"></el-checkbox><a class="a-href">显示子成员</a></el-button>
</div> </div>
...@@ -90,7 +90,15 @@ ...@@ -90,7 +90,15 @@
this.currentPage = val; this.currentPage = val;
this.getEmployee(); this.getEmployee();
}, },
// 跳转添加子部门页面
addSon() {
location.href = '#/addDepartment?addnew=1&departmentId='+this.groupInfo.departmentId;
},
// 跳转编辑部门页面
goToEdit(level) {
let type = level == 0 ? "company" : "group";
location.href = '#/addDepartment?departmentId='+this.groupInfo.departmentId+'&type='+type;
},
/** /**
* 树形菜单搜索 * 树形菜单搜索
*/ */
...@@ -117,6 +125,8 @@ ...@@ -117,6 +125,8 @@
this.groupInfo.departmentId = obj.groupId; this.groupInfo.departmentId = obj.groupId;
this.groupInfo.groupName = obj.name; this.groupInfo.groupName = obj.name;
this.showEmployee = showEmployee; this.showEmployee = showEmployee;
this.groupInfo.hasPression = obj.hasPression;
this.groupInfo.level = obj.level;
this.loading = true; this.loading = true;
this.getEmployee(); this.getEmployee();
}, },
...@@ -262,6 +272,15 @@ ...@@ -262,6 +272,15 @@
margin: 0 10px; margin: 0 10px;
vertical-align: sub; vertical-align: sub;
} }
.no-bdr-btn {
background: none;
color: #409EFF;
border: none;
}
.el-button.is-disabled, .el-button.is-disabled:hover, .el-button.is-disabled:focus {
background: none;
color: #c0c4cc;
}
} }
} }
.af-right-button-box { .af-right-button-box {
......
...@@ -17,11 +17,11 @@ ...@@ -17,11 +17,11 @@
<el-radio-button label="note">错误记录</el-radio-button> <el-radio-button label="note">错误记录</el-radio-button>
</el-radio-group> </el-radio-group>
<div class="handle-area import"> <div class="handle-area import">
<el-steps direction="vertical" :active="2" style="height: 200px;"> <!-- <el-steps direction="vertical" :active="2" style="height: 200px;">
<el-step> <el-step>
<template slot="title"> <template slot="title">
<div> <div>
下载员工通讯录模板,统一收集员工信息<span class="download-btn">下载<i class="iconfont icon-icon_yunxiazai"></i></span> 下载员工通讯录模板,统一收集员工信息<a href="http://www.gicdev.com/haoban-manage-web/excel/通讯录-行政架构导入模板.xls"><span class="download-btn">下载<i class="iconfont icon-icon_yunxiazai"></i></span></a>
</div> </div>
</template> </template>
<el-button type="primary">下载<i class="iconfont icon-icon_yunxiazai"></i></el-button> <el-button type="primary">下载<i class="iconfont icon-icon_yunxiazai"></i></el-button>
...@@ -37,7 +37,20 @@ ...@@ -37,7 +37,20 @@
</div> </div>
</template> </template>
</el-step> </el-step>
</el-steps> </el-steps> -->
<div class="step-div" style="margin-bottom :90px;">
<span class="ft-large"></span>下载员工通讯录模板,统一收集员工信息
<a href="http://www.gicdev.com/haoban-manage-web/excel/通讯录-行政架构导入模板.xls" class="d-u-btn">
<el-button type="primary">下载<i class="iconfont icon-icon_yunxiazai m-l-5"></i></el-button>
</a>
</div>
<div class="step-div">
<span class="ft-large"></span>上传收集完毕的员工信息表
<div class="d-u-btn m-t-30">
<el-button type="primary">选择文件</el-button>
<p class="warming">文件格式必须为xls或xlsx格式</p>
</div>
</div>
<div class="up-btn-div"> <div class="up-btn-div">
<el-button type="primary">上传</el-button> <el-button type="primary">上传</el-button>
</div> </div>
...@@ -103,39 +116,57 @@ export default { ...@@ -103,39 +116,57 @@ export default {
border-radius:4px; border-radius:4px;
padding: 25px 20px; padding: 25px 20px;
margin-top: 24px; margin-top: 24px;
.el-step__title { color: #606266;
font-size:16px; .step-div {
font-family:PingFangSC-Regular; .d-u-btn {
font-weight:400; display:inline-block;
color:rgba(96,98,102,1);
.download-btn {
display: inline-block;
width:89px;
height:36px;
background:rgba(64,158,255,1);
border-radius:4px;
color: #fff;
text-align: center;
line-height: 36px;
margin-left: 10px; margin-left: 10px;
cursor: pointer; vertical-align: middle;
.iconfont { .warming {
margin-left: 5px; font-size:12px;
font-weight:400;
color:rgba(96,98,102,1);
line-height:30px;
margin-top: 5px;
} }
} }
.warming { .ft-large {
font-size:12px; font-size: 20px;
font-weight:400; margin-right: 10px;
color:rgba(96,98,102,1); color: #909399;
} }
} }
.el-step__head.is-finish { // .el-step__title {
color: rgba(96,98,102,1); // font-size:16px;
border-color: rgba(96,98,102,1); // font-family:PingFangSC-Regular;
} // font-weight:400;
// color:rgba(96,98,102,1);
// .download-btn {
// display: inline-block;
// width:89px;
// height:36px;
// background:rgba(64,158,255,1);
// border-radius:4px;
// color: #fff;
// text-align: center;
// line-height: 36px;
// margin-left: 10px;
// cursor: pointer;
// .iconfont {
// margin-left: 5px;
// }
// }
// .warming {
// font-size:12px;
// font-weight:400;
// color:rgba(96,98,102,1);
// }
// }
// .el-step__head.is-finish {
// color: rgba(96,98,102,1);
// border-color: rgba(96,98,102,1);
// }
.up-btn-div { .up-btn-div {
height: 100px;
line-height: 100px;
text-align: center; text-align: center;
margin-top: 20px; margin-top: 20px;
} }
......
<template> <template>
<div class="store-estrutura-container"> <div class="store-estrutura-container">
<search-menu <search-menu
ref="searchMenu"
:storeFrame="true" :storeFrame="true"
:treeData="menuData" :treeData="menuData"
:searchResult="searchResult" :searchResult="searchResult"
...@@ -22,7 +23,7 @@ ...@@ -22,7 +23,7 @@
</template> </template>
</search-menu> </search-menu>
<clerk-info v-if="showEmployee == 'employee'" :clerkInfo="selectedEmployee"></clerk-info> <clerk-info v-if="showEmployee == 'employee'" :clerkInfo="selectedEmployee"></clerk-info>
<store-info v-else-if="showEmployee == 'store'" :storeInfo="storeInfo"></store-info> <store-info ref="store_info" v-else-if="showEmployee == 'store'" :storeInfo="storeInfo"></store-info>
<div class="sf-right-container" <div class="sf-right-container"
v-else v-else
v-loading="loading"> v-loading="loading">
...@@ -30,9 +31,11 @@ ...@@ -30,9 +31,11 @@
<span class="title-span">{{groupInfo.groupName}}({{total}}家)</span> <span class="title-span">{{groupInfo.groupName}}({{total}}家)</span>
<span class="id-span">部门ID: {{groupInfo.departmentId}}</span> <span class="id-span">部门ID: {{groupInfo.departmentId}}</span>
<span class="handle-area"> <span class="handle-area">
<a :href="'#/addGroup?addnew=1&groupId='+groupInfo.departmentId" class="J_add-child a-href">添加子分组</a> <el-button @click="addSon" class="no-bdr-btn" :disabled="groupInfo.hasPression != 1">添加子分组</el-button>
<span class="hurdle"></span> <template v-if="groupInfo.level != 0">
<a class="J_edit a-href" :href="'#/addGroup?groupId='+groupInfo.departmentId">编辑</a> <span class="hurdle"></span>
<el-button @click="goToEdit(groupInfo.level)" :href="'#/addGroup?groupId='+groupInfo.departmentId" :disabled="groupInfo.hasPression != 1" class="no-bdr-btn">编辑</el-button>
</template>
</span> </span>
</div> </div>
<div class="tab-div"> <div class="tab-div">
...@@ -60,7 +63,7 @@ ...@@ -60,7 +63,7 @@
</el-pagination> </el-pagination>
</div> </div>
</div> </div>
<add-brand ref="add_brand"></add-brand> <add-brand ref="add_brand" @addSuccess="addSuccess"></add-brand>
</div> </div>
</template> </template>
<script> <script>
...@@ -137,6 +140,18 @@ export default { ...@@ -137,6 +140,18 @@ export default {
addBrand() { addBrand() {
this.$refs.add_brand.dialogVisible = true; this.$refs.add_brand.dialogVisible = true;
}, },
// 跳转添加子部门页面
addSon() {
location.href = '#/addGroup?addnew=1&groupId='+this.groupInfo.departmentId;
},
// 跳转编辑部门页面
goToEdit(level) {
let type = level == 0 ? "brand" : "group";
location.href = '#/addGroup?groupId='+this.groupInfo.departmentId+'&type='+type;
},
addSuccess() {
this.getGroupData();
},
/** /**
* 树形搜索结果选门店处理 * 树形搜索结果选门店处理
*/ */
...@@ -148,6 +163,7 @@ export default { ...@@ -148,6 +163,7 @@ export default {
console.log(res, "storeInfo"); console.log(res, "storeInfo");
if (res.data.errorCode == 1) { if (res.data.errorCode == 1) {
that.storeInfo = res.data.result; that.storeInfo = res.data.result;
// that.$refs.store_info.formatStoreInfo(res.data.result);
that.showEmployee = "store"; that.showEmployee = "store";
} else { } else {
that.$message.error({ that.$message.error({
...@@ -268,6 +284,8 @@ export default { ...@@ -268,6 +284,8 @@ export default {
this.groupInfo.departmentId = obj.groupId; this.groupInfo.departmentId = obj.groupId;
this.groupInfo.groupName = obj.name; this.groupInfo.groupName = obj.name;
this.showEmployee = showEmployee; this.showEmployee = showEmployee;
this.groupInfo.hasPression = obj.hasPression;
this.groupInfo.level = obj.level;
this.getStoreList(); this.getStoreList();
}, },
/** /**
...@@ -294,6 +312,16 @@ export default { ...@@ -294,6 +312,16 @@ export default {
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
.handle-area {
.no-bdr-btn {
background: none;
color: #409EFF;
border: none;
}
.el-button.is-disabled, .el-button.is-disabled:hover, .el-button.is-disabled:focus {
background: none;
color: #c0c4cc;
}
}
</style> </style>
...@@ -4,14 +4,17 @@ ...@@ -4,14 +4,17 @@
<div class="info-cell"> <div class="info-cell">
<p class="title">门店信息</p> <p class="title">门店信息</p>
<el-form <el-form
:rules="rules"
:model="storeInfo"
ref="storeInfo"
class="store-info-form info-form" class="store-info-form info-form"
label-width="90px"> label-width="100px">
<el-form-item label="门店名称" prop="name"> <el-form-item label="门店名称" prop="storeName">
<el-input v-model="storeInfo.storeName"> <el-input v-model="storeInfo.storeName">
<template slot="suffix">{{storeInfo.storeName ? storeInfo.storeName.length : 0}}/20</template> <template slot="suffix">{{storeInfo.storeName ? storeInfo.storeName.length : 0}}/20</template>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="所属分组" prop="group"> <el-form-item label="所属分组" prop="groupChainName">
<el-input v-model="storeInfo.groupChainName" @focus="callSelector"> <el-input v-model="storeInfo.groupChainName" @focus="callSelector">
<i slot="suffix" class="el-input__icon el-icon-arrow-down"></i> <i slot="suffix" class="el-input__icon el-icon-arrow-down"></i>
</el-input> </el-input>
...@@ -68,15 +71,15 @@ ...@@ -68,15 +71,15 @@
</el-form-item> </el-form-item>
<el-form-item label="门店地址"> <el-form-item label="门店地址">
<vue-office-area :areaOptions="areaOptions" @selected="selected" projectName="haoban-web" postUrl="/api-admin/dict-district-list"></vue-office-area> <vue-office-area :areaOptions="areaOptions" @selected="selected" projectName="haoban-web" postUrl="/api-admin/dict-district-list"></vue-office-area>
<el-input v-model="areaOptions.postAddress"> <el-input v-model="storeInfo.postAddress">
<template slot="suffix">{{(areaOptions.postAddress || "").length}}/50</template> <template slot="suffix">{{(storeInfo.postAddress || "").length}}/50</template>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="GPS坐标"> <el-form-item label="GPS坐标">
<el-input v-model="location" class="m-r-10"></el-input> <el-input v-model="location" class="m-r-10"></el-input>
<a href="http://m.gpsspg.com/maps.htm" class="a-href" target="_blank">经纬度测试工具</a> <a href="http://m.gpsspg.com/maps.htm" class="a-href" target="_blank">经纬度测试工具</a>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item prop="storeCode">
<template slot="label"> <template slot="label">
门店代码 门店代码
<i class="el-icon-question" style="color:#C0C4CC;"></i> <i class="el-icon-question" style="color:#C0C4CC;"></i>
...@@ -90,23 +93,26 @@ ...@@ -90,23 +93,26 @@
<div class="info-cell"> <div class="info-cell">
<p class="title">店长信息</p> <p class="title">店长信息</p>
<el-form <el-form
ref="storeManager"
:rules="rules"
:model="storeInfo"
class="store-manager-info-form info-form" class="store-manager-info-form info-form"
label-width="90px"> label-width="100px">
<el-form-item label="店长姓名" prop="name"> <el-form-item label="店长姓名" prop="managerName">
<el-input v-model="storeInfo.managerName"> <el-input v-model="storeInfo.managerName">
<template slot="suffix">{{(storeInfo.managerName || "").length}}/10</template> <template slot="suffix">{{(storeInfo.managerName || "").length}}/10</template>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="手机号码" prop="phone"> <el-form-item label="手机号码" prop="managerPhoneNumber">
<el-input v-model="storeInfo.managerPhoneNumber"></el-input> <el-input v-model="storeInfo.managerPhoneNumber" :disabled="!isNew"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="店长性别"> <el-form-item label="店长性别">
<el-radio-group v-model="storeInfo.managerSex"> <el-radio-group v-model="storeInfo.managerSex">
<el-radio label="1"></el-radio> <el-radio :label="1"></el-radio>
<el-radio label="2"></el-radio> <el-radio :label="2"></el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="店长代码"> <el-form-item label="店长代码" prop="managerCode">
<el-input v-model="storeInfo.managerCode"> <el-input v-model="storeInfo.managerCode">
<template slot="suffix">{{(storeInfo.managerCode || "").length}}/20</template> <template slot="suffix">{{(storeInfo.managerCode || "").length}}/20</template>
</el-input> </el-input>
...@@ -116,13 +122,16 @@ ...@@ -116,13 +122,16 @@
<div class="info-cell"> <div class="info-cell">
<p class="title">经营信息</p> <p class="title">经营信息</p>
<el-form <el-form
ref="storeOperate"
:rules="rules"
:model="storeInfo"
class="operate-info-form info-form" class="operate-info-form info-form"
label-width="90px"> label-width="90px">
<el-form-item label="特色服务"> <el-form-item label="特色服务" prop="specialService">
<el-input type="textarea" :rows="2" v-model="storeInfo.specialService"></el-input> <el-input type="textarea" :rows="2" v-model="storeInfo.specialService"></el-input>
<p class="counter t-rt c-909399">{{(storeInfo.specialService || "").length}}/20</p> <p class="counter t-rt c-909399">{{(storeInfo.specialService || "").length}}/20</p>
</el-form-item> </el-form-item>
<el-form-item label="人均消费"> <el-form-item label="人均消费" prop="personCost">
<el-input v-model="storeInfo.personCost"> <el-input v-model="storeInfo.personCost">
<template slot="suffix">{{(storeInfo.personCost+'').length}}/10</template> <template slot="suffix">{{(storeInfo.personCost+'').length}}/10</template>
</el-input> </el-input>
...@@ -138,7 +147,7 @@ ...@@ -138,7 +147,7 @@
</el-form> </el-form>
</div> </div>
<div class="handle-area"> <div class="handle-area">
<el-button type="primary" @click="save">保存</el-button> <el-button type="primary" @click="clickToSave">保存</el-button>
</div> </div>
</div> </div>
<vue-select-store ref="storeSelector" @handleSelectedList="handleSelectedList"></vue-select-store> <vue-select-store ref="storeSelector" @handleSelectedList="handleSelectedList"></vue-select-store>
...@@ -153,12 +162,75 @@ export default { ...@@ -153,12 +162,75 @@ export default {
vueSelectStore vueSelectStore
}, },
data() { data() {
let validatePhone = (rule, value, callback) => {
if (!value) {
return callback(new Error('请输入联系电话'));
} else {
let reg = /^1[34578]\d{9}$/;
let regPhone = /^(\(\d{3,4}\)|\d{3,4}-|\s)?\d{7,14}$/;
if (!reg.test(value) && !regPhone.test(value)) {
return callback(new Error("联系电话格式不正确"));
} else {
return callback();
}
}
}
let validateCellPhone = (rule, value, callback) => {
if (value) {
let reg = /^1[34578]\d{9}$/;
if (!reg.test(value)) {
return callback(new Error("手机号码格式不正确"));
} else {
return callback();
}
} else {
return callback();
}
}
let validateMoney = (rule, value, callback) => {
if (value) {
let reg = /^\d+(\.\d+)?$/;
if (!reg.test(value*1)) {
return callback(new Error("人均消费只能为非负整数或者小数"));
} else {
return callback();
}
} else {
return callback();
}
}
return { return {
storeInfo: { storeInfo: {
groupChainName: "" groupChainName: ""
}, },
areaChainName: "", areaChainName: "",
location: "" location: "",
areaOptions: {},
imgs: [],
rules: {
storeName: [
{ required: true, message: '请输入门店名称', trigger: 'blur' },
{ min: 1, max: 20, message: '长度在 1 到 20 个字符', trigger: 'blur' }
],
groupChainName: [
{ required: true, message: '请选择部门', trigger: 'change' }
],
phoneNumber: [{ required:true, validator: validatePhone, trigger: "blur"}],
storeCode: [
{ required: true, message: '请输入门店代码', trigger: 'blur' },
{ min: 1, max: 20, message: '长度在 1 到 20 个字符', trigger: 'blur' }
],
managerName: [
{ required: true, message: '请输入店长姓名', trigger: 'blur' },
{ min: 2, max: 10, message: '长度在 2 到 10 个字符', trigger: 'blur' }
],
managerPhoneNumber: [{ required:true, validator: validateCellPhone, trigger: "blur"}],
managerCode: [
{ max: 20, message: '长度在 20 个字符以内', trigger: 'blur' }
],
specialService: [{ max: 20, message: '长度在 20 个字符以内', trigger: 'blur' }],
personCost: [{ validator: validateMoney, trigger: "blur"}]
}
}; };
}, },
methods: { methods: {
...@@ -166,12 +238,10 @@ export default { ...@@ -166,12 +238,10 @@ export default {
this.$refs.storeSelector.treeSet.dialogVisible = true; this.$refs.storeSelector.treeSet.dialogVisible = true;
}, },
handleSelectedList(list) { handleSelectedList(list) {
console.log(list);
this.storeInfo.groupChainName = list[0].label; this.storeInfo.groupChainName = list[0].label;
this.storeInfo.storeGroupId = list[0].id; this.storeInfo.storeGroupId = list[0].id;
}, },
selected(val) { selected(val) {
console.log(val);
let that = this; let that = this;
that.areaChainName = val.provinceName + "/" + val.cityName + "/" + val.countryName; that.areaChainName = val.provinceName + "/" + val.cityName + "/" + val.countryName;
}, },
...@@ -181,8 +251,8 @@ export default { ...@@ -181,8 +251,8 @@ export default {
getRequest("/haoban-manage-web/store/findStoreById", params) getRequest("/haoban-manage-web/store/findStoreById", params)
.then(res => { .then(res => {
if (res.data.errorCode == 1) { if (res.data.errorCode == 1) {
that.storeInfo = res.data.result;
that.showEmployee = "store"; that.showEmployee = "store";
that.formatStoreInfo(res.data.result);
} else { } else {
that.$message.error({ that.$message.error({
message: res.data.message message: res.data.message
...@@ -190,6 +260,48 @@ export default { ...@@ -190,6 +260,48 @@ export default {
} }
}); });
}, },
clickToSave() {
let ths = this
let p1 = new Promise(function(resolve, reject) {
ths.$refs["storeInfo"].validate((valid) => {
if (valid) {
resolve();
}
})
});
let p2 = new Promise(function(resolve, reject) {
ths.$refs["storeManager"].validate((valid) => {
if (valid) {
resolve();
}
});
});
let p3 = new Promise(function(resolve, reject) {
ths.$refs["storeOperate"].validate((valid) => {
if (valid) {
resolve();
}
})
});
Promise.all([p1, p2, p3]).then(function(){
ths.save();
});
},
formatStoreInfo(obj) {
let ths = this;
let arr = (obj.areaChainName || "").split("/");
ths.areaOptions = {
provinceName: arr[0],
provinceId: obj.provinceId,
cityName: arr[1],
cityId: obj.cityId,
countryName: arr[2],
countyId: obj.countyId
};
ths.imgs = !obj.imageUrl ? [] : obj.imageUrl.split(",");
ths.location = obj.longitude + "," + obj.latitude;
ths.storeInfo = obj;
},
uploadOnSuccess() {}, uploadOnSuccess() {},
sortImg() {}, sortImg() {},
deleteImage() {}, deleteImage() {},
...@@ -198,12 +310,10 @@ export default { ...@@ -198,12 +310,10 @@ export default {
let locationArr = that.location.split(","); let locationArr = that.location.split(",");
that.storeInfo.longitude = locationArr[0]; that.storeInfo.longitude = locationArr[0];
that.storeInfo.latitude = locationArr.length !== 2 ? "" : locationArr[1]; that.storeInfo.latitude = locationArr.length !== 2 ? "" : locationArr[1];
that.storeInfo.postAddress = that.areaOptions.postAddress;
that.storeInfo.managerPhone = that.storeInfo.managerPhoneNumber; that.storeInfo.managerPhone = that.storeInfo.managerPhoneNumber;
that.storeInfo.areaChainName = that.areaChainName; that.storeInfo.areaChainName = that.areaChainName;
let params = that.storeInfo; let params = that.storeInfo;
console.log(params, "params"); let url = that.isNew ? "/haoban-manage-web/store/insert" : "/haoban-manage-web/store/update";
let url = that.isNew ? "/haoban-manage-web/store/add" : "/haoban-manage-web/store/update";
getRequest(url, params) getRequest(url, params)
.then(res => { .then(res => {
if (res.data.errorCode == 1) { if (res.data.errorCode == 1) {
...@@ -232,22 +342,6 @@ export default { ...@@ -232,22 +342,6 @@ export default {
} else { } else {
return true; return true;
} }
},
areaOptions() {
let ths = this;
let arr = (ths.storeInfo.areaChainName || "").split("/");
return {
provinceName: arr[0],
provinceId: ths.provinceId,
cityName: arr[1],
cityId: ths.cityId,
countryName: arr[2],
countyId: ths.countyId
};
},
imgs() {
console.log(this.storeInfo.imageUrl, !!this.storeInfo.imageUrl);
return !this.storeInfo.imageUrl ? [] : this.storeInfo.imageUrl.split(",");
} }
}, },
beforeMount() { beforeMount() {
......
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