Commit 8425e838 authored by chenqikuai's avatar chenqikuai

1:

parent 62a2bff0
......@@ -76,6 +76,7 @@ import {
import HeaderSelect from "@/components/HeaderSelect2/index.vue";
import { fooList } from "@/components/HeaderSelect2/const";
import StaffService from "@/service/StaffService";
import AddressService from "@/service/AddressService";
Vue.use(Switch);
......@@ -287,16 +288,22 @@ export default Vue.extend({
(this.$refs.addForm as FormModel).validate((valid) => {
if (valid) {
if (this.modalMode === eAddManagerModalMode.create) {
StaffService.getInstance().addNextLevel({
attr: {
add_same_level: false,
},
level: this.searchLevel,
name: this.form.name,
password: this.form.password,
phone: this.form.tel,
second_sub_branch: this.form.fooProp3 as number,
});
StaffService.getInstance()
.addNextLevel({
attr: {
add_same_level: false,
},
level: this.searchLevel,
name: this.form.name,
password: this.form.password,
phone: this.form.tel,
second_sub_branch: this.form.fooProp3 as number,
})
.then(() => {
this.save({
refreshMark: new Date().getTime(),
});
});
}
this.setModal(false);
} else {
......@@ -318,11 +325,18 @@ export default Vue.extend({
newV.forEach((item, index) => {
(this.form as any)[`fooProp${index}`] = item.value;
});
if (newV[3].options.length !== 0)
this.outletName = newV[3].options[0].Name;
if (newV[3].value !== undefined) {
this.outletName =
newV[3].options.find((i) => i.ID === newV[3].value)?.Name || "";
}
},
outletName(newV, oldV) {
console.log(newV);
async outletName(newV, oldV) {
const ret = await AddressService.getInstance().getOutlet({
outlet_name: newV,
});
if (ret.code === 200) {
this.form.location = ret.data.location;
}
},
},
});
......
......@@ -9,6 +9,7 @@ import {
export default <Module<iUserManagementState, {}>>{
namespaced: true,
state: {
refreshMark: NaN,
modalShow: true,
modalMode: eAddManagerModalMode.create,
typeOfOperatedObject: eTypeOfOperatedObject.manager,
......
......@@ -40,4 +40,5 @@ export interface iUserManagementState {
branchDetailMsg: Partial<iBranchDetailMsg>
personalMsg: iPersonalMsg
address: string
refreshMark: number
}
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