diff --git a/README.md b/README.md index e84d90a..9dbf53d 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ pnpm run dev pnpm run build # 测试环境 -pnpm run build:test +pnpm run build:local # 正式环境 pnpm run build:pro diff --git a/src/api/account/shopBranch.ts b/src/api/account/shopBranch.ts index 9682253..7f47450 100644 --- a/src/api/account/shopBranch.ts +++ b/src/api/account/shopBranch.ts @@ -10,23 +10,26 @@ const ShopBranchApi = { params }); }, + getDataSync(params: any) { + return request({ + url: `${baseURL}/get/dataSyncMethod`, + method: "get", + params + }); + }, setDataSync(id: any) { - console.log(id) return request({ url: `${baseURL}/setting/dataSyncMethod?dataSyncMethod=${id}`, method: "post", }); }, dataSync(id: any) { - console.log(id) return request({ url: `${baseURL}/data/sync/enable?branchShopId=${id}`, method: "post", }); }, enable(id: any) { - console.log(id) - return request({ url: `${baseURL}/account/enable?branchShopId=${id}`, method: "post", diff --git a/src/views/shop/branchStore/index.vue b/src/views/shop/branchStore/index.vue index d23679e..6f3ecb9 100644 --- a/src/views/shop/branchStore/index.vue +++ b/src/views/shop/branchStore/index.vue @@ -7,16 +7,17 @@ - - - - - + - + 查询 重置 + + 同步设置: + + + @@ -24,10 +25,10 @@
- + @@ -102,7 +103,13 @@ const state = reactive({ }); onMounted(() => { getTableData(); + getDataSync() }); +async function getDataSync () { + let res = await ShopBranchApi.getDataSync() + state.par.dataSyncMethod = res +} + // 获取分店列表 async function getTableData() { state.tableData.loading = true; diff --git a/src/views/shop/list/components/addShop.vue b/src/views/shop/list/components/addShop.vue index 710566d..f39947b 100644 --- a/src/views/shop/list/components/addShop.vue +++ b/src/views/shop/list/components/addShop.vue @@ -6,23 +6,23 @@ - + 单店 连锁店 加盟店
请谨慎修改!!!
- - - - + + + + - + + :remote-method="getTableData" :loading="state.shopListLoading" :disabled="state.form.id || state.type == 'addBranch'"> @@ -44,9 +44,9 @@
请谨慎修改!!!
- - 不可直接管理 - 直接管理 + + 不可直接管理 + 直接管理
请谨慎修改!!!
@@ -185,11 +185,11 @@ const state = reactive({ endTime: "", formLoading: false, form: { - id: "", + id: null, shopName: "", mainId: "", shopType: "only", - tube_type: "0", + tubeType: 0, registerType: "before", profiles: "release", activateCode: "", @@ -208,8 +208,9 @@ const state = reactive({ cities: "", districts: "", chainName: "", - isHeadShop: '0', + isHeadShop: 0, }, + type: '', resetForm: "", rules: { activateCode: [ @@ -370,13 +371,22 @@ function handleSuccess(response, file, fileList) { state.files = response.data; } -function show(obj) { +function show(obj,type) { getTableData(); state.dialogVisible = true; if (obj && obj.id) { console.log(obj); state.form = { ...obj }; } + if (obj && obj.mainId) { + state.form = { ...obj }; + } + if( type ){ + state.type = type + } + console.log(state.form); + console.log(state.type); + for (let key in state.rules) { if (key === "accountName") { if (obj.id) { @@ -390,9 +400,13 @@ function show(obj) { } function close() { state.dialogVisible = false; + state.form = { ...state.resetForm }; + state.type = ""; + } function reset() { state.form = { ...state.resetForm }; + state.type = ""; } let ElMap = undefined; diff --git a/src/views/shop/list/index.vue b/src/views/shop/list/index.vue index 8df77aa..03c9ba7 100644 --- a/src/views/shop/list/index.vue +++ b/src/views/shop/list/index.vue @@ -64,11 +64,13 @@
- + @@ -109,6 +111,7 @@