diff --git a/src/api/sylive/groups-user/index.js b/src/api/sylive/groups-user/index.js
index 6a36887..6643193 100644
--- a/src/api/sylive/groups-user/index.js
+++ b/src/api/sylive/groups-user/index.js
@@ -152,3 +152,15 @@ export async function checkExistence(field, value, id) {
}
return Promise.reject(new Error(res.data.message));
}
+
+/**
+ * 同步原始门店用户
+ * @param groupsId 分组id
+ */
+export async function synchronousGroupsUser(groupsId) {
+ const res = await request.get('/sylive/groupsUser/synchronous/' + groupsId);
+ if (res.data.code === 0) {
+ return res.data.message;
+ }
+ return Promise.reject(new Error(res.data.message));
+}
diff --git a/src/api/sylive/organization/index.js b/src/api/sylive/organization/index.js
index 77231da..bb969e4 100644
--- a/src/api/sylive/organization/index.js
+++ b/src/api/sylive/organization/index.js
@@ -77,3 +77,15 @@ export async function removeOrganization(id) {
}
return Promise.reject(new Error(res.data.message));
}
+
+/**
+ * 机构详情
+ * @param id 机构id
+ */
+export async function infoOrganization(id) {
+ const res = await request.get('/sylive/organization/info/' + id);
+ if (res.data.code === 0) {
+ return res.data.data;
+ }
+ return Promise.reject(new Error(res.data.message));
+}
diff --git a/src/views/sylive/groups/components/gro-edit.vue b/src/views/sylive/groups/components/gro-edit.vue
index abb3f34..00f267f 100644
--- a/src/views/sylive/groups/components/gro-edit.vue
+++ b/src/views/sylive/groups/components/gro-edit.vue
@@ -50,6 +50,26 @@
是
+
+
+
import GroSelect from './gro-select.vue';
import { addGroups, updateGroups } from '@/api/sylive/groups';
+ import { infoOrganization } from '@/api/sylive/organization';
export default {
components: { GroSelect },
@@ -99,7 +120,9 @@
// 分组数据
groupsList: Array,
// 统计类型数据
- statisticsTypeList: Array
+ statisticsTypeList: Array,
+ // 门店数据
+ organizationList: Array
},
data() {
const defaultForm = {
@@ -109,7 +132,8 @@
userFrom: 0,
ifBiz: 0,
statisticsType: null,
- sortNumber: null
+ sortNumber: null,
+ originalBizId: null
};
return {
defaultForm,
@@ -145,6 +169,16 @@
}
},
methods: {
+ onChange(value) {
+ let organizationId = Number(value);
+ if (organizationId) {
+ infoOrganization(organizationId)
+ .then((re) => {
+ this.form.groupsName = re.organizationName;
+ })
+ .catch(() => {});
+ }
+ },
/* 保存编辑 */
save() {
this.$refs.form.validate((valid) => {
diff --git a/src/views/sylive/groups/components/gro-user-list.vue b/src/views/sylive/groups/components/gro-user-list.vue
index 179bbd2..bd02453 100644
--- a/src/views/sylive/groups/components/gro-user-list.vue
+++ b/src/views/sylive/groups/components/gro-user-list.vue
@@ -14,6 +14,17 @@
+ 同步原始门店
+
+
{
+ loading.close();
+ this.$message.success(msg);
+ this.reload();
+ })
+ .catch((e) => {
+ loading.close();
+ this.$message.error(e.message);
+ });
+ },
/* 刷新表格 */
reload(where) {
this.$refs.table.reload({ page: 1, where: where });
diff --git a/src/views/sylive/groups/components/gro-user-search.vue b/src/views/sylive/groups/components/gro-user-search.vue
index 65b6082..d2c050f 100644
--- a/src/views/sylive/groups/components/gro-user-search.vue
+++ b/src/views/sylive/groups/components/gro-user-search.vue
@@ -7,7 +7,7 @@
@submit.native.prevent
>
-
+
-
+
@@ -74,6 +73,7 @@
:parent-id="parentId"
:groups-list="data"
:statistics-type-list="statisticsTypeList"
+ :organization-list="organizationList"
@done="query"
/>