fix:添加店铺主店列表修改

This commit is contained in:
GaoHao
2025-04-09 15:15:41 +08:00
parent f8c3c41247
commit 2546bdbd2d

View File

@@ -23,8 +23,8 @@
<!-- <el-form-item label="主店账号" prop="mainId" v-if="state.form.shopType != 'only'"> -->
<el-select v-model="state.form.mainId" placeholder="请选择主店铺" filterable reserve-keyword
: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.shopId"
:key="item.shopId"></el-option>
<el-option v-for="item in state.shopList" :label="`${item.shopName}`" :value="item.id"
:key="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="连锁店扩展店名">
@@ -305,17 +305,20 @@ onMounted(() => {
state.resetForm = { ...state.form };
});
// 获取商家列表
async function getTableData(query = "") {
console.log(123)
state.shopListLoading = true;
try {
const res = await ShopApi.getBranchList({
const res = await ShopApi.getList({
page: 1,
size: 100,
shopName: query,
type: "only",
isHeadShop: 1,
});
state.shopListLoading = false;
state.shopList = res;
state.shopList = res.records;
} catch (error) {
state.shopListLoading = false;
console.log(error);