This commit is contained in:
GaoHao
2025-04-08 14:50:16 +08:00
3 changed files with 40 additions and 18 deletions

View File

@@ -92,7 +92,7 @@ pnpm run dev
pnpm run build pnpm run build
# 测试环境 # 测试环境
pnpm run build:test pnpm run build:local
# 正式环境 # 正式环境
pnpm run build:pro pnpm run build:pro

View File

@@ -6,23 +6,23 @@
<el-input v-model="state.form.shopName" placeholder="请输入门店名称"></el-input> <el-input v-model="state.form.shopName" placeholder="请输入门店名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="店铺类型"> <el-form-item label="店铺类型">
<el-radio-group v-model="state.form.shopType"> <el-radio-group v-model="state.form.shopType" :disabled="state.form.id || state.type == 'addBranch'">
<el-radio-button value="only">单店</el-radio-button> <el-radio-button value="only">单店</el-radio-button>
<el-radio-button value="chain">连锁店</el-radio-button> <el-radio-button value="chain">连锁店</el-radio-button>
<el-radio-button value="join">加盟店</el-radio-button> <el-radio-button value="join">加盟店</el-radio-button>
</el-radio-group> </el-radio-group>
<div class="tips">请谨慎修改</div> <div class="tips">请谨慎修改</div>
</el-form-item> </el-form-item>
<el-form-item label="是否为主店" prop="isHeadShop"> <el-form-item label="是否为主店" prop="isHeadShop" v-if="state.form.shopType != 'only'">
<el-radio-group v-model="state.form.isHeadShop" @change=" state.form.mainId = ''"> <el-radio-group v-model="state.form.isHeadShop" @change=" state.form.mainId = ''" :disabled="state.form.id || state.type == 'addBranch'">
<el-radio value="1"></el-radio> <el-radio :value="1"></el-radio>
<el-radio value="0"></el-radio> <el-radio :value="0"></el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="主店账号" prop="mainId" v-if="state.form.isHeadShop == '0'"> <el-form-item label="主店账号" prop="mainId" v-if="state.form.isHeadShop == '0'&&state.form.shopType != 'only'">
<!-- <el-form-item label="主店账号" prop="mainId" v-if="state.form.shopType != 'only'"> --> <!-- <el-form-item label="主店账号" prop="mainId" v-if="state.form.shopType != 'only'"> -->
<el-select v-model="state.form.mainId" placeholder="请选择主店铺" filterable reserve-keyword <el-select v-model="state.form.mainId" placeholder="请选择主店铺" filterable reserve-keyword
:remote-method="getTableData" :loading="state.shopListLoading"> :remote-method="getTableData" :loading="state.shopListLoading" :disabled="state.form.id || state.type == 'addBranch'">
<el-option v-for="item in state.shopList" :label="`${item.shopName}`" :value="item.id" <el-option v-for="item in state.shopList" :label="`${item.shopName}`" :value="item.id"
:key="item.id"></el-option> :key="item.id"></el-option>
</el-select> </el-select>
@@ -44,9 +44,9 @@
<div class="tips">请谨慎修改</div> <div class="tips">请谨慎修改</div>
</el-form-item> </el-form-item>
<el-form-item label="管理方式" v-if="state.form.shopType != 'only'"> <el-form-item label="管理方式" v-if="state.form.shopType != 'only'">
<el-radio-group v-model="state.form.tube_type"> <el-radio-group v-model="state.form.tubeType">
<el-radio-button value="0">不可直接管理</el-radio-button> <el-radio-button :value="0">不可直接管理</el-radio-button>
<el-radio-button value="1">直接管理</el-radio-button> <el-radio-button :value="1">直接管理</el-radio-button>
</el-radio-group> </el-radio-group>
<div class="tips">请谨慎修改</div> <div class="tips">请谨慎修改</div>
</el-form-item> </el-form-item>
@@ -185,11 +185,11 @@ const state = reactive({
endTime: "", endTime: "",
formLoading: false, formLoading: false,
form: { form: {
id: "", id: null,
shopName: "", shopName: "",
mainId: "", mainId: "",
shopType: "only", shopType: "only",
tube_type: "0", tubeType: 0,
registerType: "before", registerType: "before",
profiles: "release", profiles: "release",
activateCode: "", activateCode: "",
@@ -208,8 +208,9 @@ const state = reactive({
cities: "", cities: "",
districts: "", districts: "",
chainName: "", chainName: "",
isHeadShop: '0', isHeadShop: 0,
}, },
type: '',
resetForm: "", resetForm: "",
rules: { rules: {
activateCode: [ activateCode: [
@@ -370,13 +371,22 @@ function handleSuccess(response, file, fileList) {
state.files = response.data; state.files = response.data;
} }
function show(obj) { function show(obj,type) {
getTableData(); getTableData();
state.dialogVisible = true; state.dialogVisible = true;
if (obj && obj.id) { if (obj && obj.id) {
console.log(obj); console.log(obj);
state.form = { ...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) { for (let key in state.rules) {
if (key === "accountName") { if (key === "accountName") {
if (obj.id) { if (obj.id) {
@@ -390,9 +400,13 @@ function show(obj) {
} }
function close() { function close() {
state.dialogVisible = false; state.dialogVisible = false;
state.form = { ...state.resetForm };
state.type = "";
} }
function reset() { function reset() {
state.form = { ...state.resetForm }; state.form = { ...state.resetForm };
state.type = "";
} }
let ElMap = undefined; let ElMap = undefined;

View File

@@ -64,11 +64,13 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="address" label="商户号" /> <el-table-column prop="address" label="商户号" />
<el-table-column prop="status" label="店铺类型"> <el-table-column prop="status" label="店铺类型" align="center">
<template v-slot="scope"> <template v-slot="scope">
<div> <div>
<span>{{ scope.row.shopName }}</span> <span v-if="scope.row.shopType == 'only'">单店</span>
<div>(主店{{ scope.row.headShopName }})</div> <span v-if="scope.row.shopType == 'chain'">连锁店</span>
<span v-if="scope.row.shopType == 'join'">加盟店</span>
<div v-if="scope.row.shopType != 'only'&&scope.row.isHeadShop == 0">(主店{{ scope.row.headShopName }})</div>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@@ -109,6 +111,7 @@
<template #dropdown> <template #dropdown>
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item v-if="scope.row.isHeadShop == 1" :command="0">添加分店</el-dropdown-item>
<el-dropdown-item :command="{ row: scope.row, command: 1 }"> <el-dropdown-item :command="{ row: scope.row, command: 1 }">
三方配置 三方配置
</el-dropdown-item> </el-dropdown-item>
@@ -182,6 +185,11 @@ const refDetailModal = ref(null);
function dropdownClick(e, row) { function dropdownClick(e, row) {
console.log(e); console.log(e);
console.log(row); console.log(row);
if (e == 0) {
refAddShop.value.show({mainId:row.id,shopType:row.shopType,isHeadShop:0},'addBranch');
return;
}
if (e.command == 1) { if (e.command == 1) {
refDetailModal.value.show(e.row); refDetailModal.value.show(e.row);
return; return;