Compare commits

..

No commits in common. "7777ef643971e2afcf602bf40db83f0e7f0d0a30" and "09c139790c8745dce64d0a9bb0429710a40f1c3f" have entirely different histories.

4 changed files with 57 additions and 140 deletions

View File

@ -154,14 +154,4 @@ export function updateUserInfo(data){
}, },
data: data, data: data,
}) })
}
//查询分类列表
export function getStoreCategories(){
return request({
url: URL.shop.merch.category,
method: 'get',
params:{
category_is_enable:1
}
})
} }

View File

@ -449,7 +449,6 @@ let url = {
merchApproval: api_url + '/admin/shop/merch/approval', merchApproval: api_url + '/admin/shop/merch/approval',
//更新商家信息 //更新商家信息
update:api_url + '/admin/shop/merch/update', update:api_url + '/admin/shop/merch/update',
category:api_url + '/admin/shop/shop-base-store-category/categoryTree',
// 发起合同签署 // 发起合同签署
createByFile: api_url + '/admin/shop/esign/sign-flow/create-by-file', createByFile: api_url + '/admin/shop/esign/sign-flow/create-by-file',
//查看商家签署合同 //查看商家签署合同

View File

@ -46,16 +46,20 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="__('经营品类')"> <el-form-item :label="__('经营分类')" prop="store_category_id">
<el-cascader <el-select
v-model="cascaderValue" v-model.trim="form.store_category_id"
:options="cascaderOptions" clearable
placeholder="请选择经营品类" :placeholder="__('经营分类')"
:show-all-levels="false" :style="{ width: '48%' }"
@change="handleChangeBizCategory" >
clearable <el-option
:disabled="isReadonly" v-for="item in classifyData"
:key="item.store_category_id"
:label="item.store_category_name"
:value="item.store_category_id"
/> />
</el-select>
</el-form-item> </el-form-item>
<el-form-item :label="__('分账比例')" prop="split_ratio"> <el-form-item :label="__('分账比例')" prop="split_ratio">
<el-input v-model.trim="form.split_ratio" :placeholder="__('比例在70%-99%之间')" clearable /> <el-input v-model.trim="form.split_ratio" :placeholder="__('比例在70%-99%之间')" clearable />
@ -139,9 +143,7 @@ import { translateTitle as __ } from '@/utils/i18n'
import { doEdit, FindStoreLevel, storeSetUp } from '@/api/store/base' import { doEdit, FindStoreLevel, storeSetUp } from '@/api/store/base'
import { GetStoreClassify } from '@/api/base/store/category' import { GetStoreClassify } from '@/api/base/store/category'
import { getList as getSubsite } from '@/api/plantform/subsite' import { getList as getSubsite } from '@/api/plantform/subsite'
import {
getStoreCategories
} from '@/api/shopAudit/shopAudit'
export default { export default {
name: 'StoreBaseEdit', name: 'StoreBaseEdit',
@ -150,8 +152,6 @@ export default {
options: [], options: [],
classifyData: [], classifyData: [],
siteOptions: [], siteOptions: [],
cascaderValue: [], //
cascaderOptions: [],
form: { form: {
store_is_open: 0, store_is_open: 0,
store_is_selfsupport: 1, store_is_selfsupport: 1,
@ -278,20 +278,9 @@ export default {
}) })
}, },
async fetchdataGetStoreClassify() { async fetchdataGetStoreClassify() {
try { await GetStoreClassify().then((res) => {
const res = await getStoreCategories(); this.classifyData = res.data
if (res.status === 200 && res.data) { })
this.classifyData = res.data;
//
this.cascaderOptions = this.transformStoreCategories(res.data);
console.log("级联分类数据源:", this.cascaderOptions);
} else {
this.$baseMessage("获取经营品类失败", "error");
}
} catch (err) {
this.$baseMessage("获取经营品类异常", "error");
console.error(err);
}
}, },
async getSubsiteList() { async getSubsiteList() {
let param = { let param = {
@ -306,31 +295,13 @@ export default {
} }
}, },
showEdit(row) { showEdit(row) {
this.cascaderValue = [];
if (!row) { if (!row) {
// this.title = this.__('新增')
this.title = this.__('新增');
this.form = {
store_is_open: 0,
store_is_selfsupport: 1,
store_type: 1,
store_o2o_flag: 0,
subsite_id: 0,
split_ratio: 0,
store_category_id: 0,
store_2nd_category_id:0,
};
} else { } else {
this.title = this.__('编辑'); this.title = this.__('编辑')
this.form = Object.assign({}, row); this.form = Object.assign({}, row)
if (row.store_category_id && row.store_2nd_category_id) {
this.cascaderValue = [
row.store_category_id, // ID
row.store_2nd_category_id // ID
];
}
} }
this.dialogFormVisible = true; this.dialogFormVisible = true
}, },
close() { close() {
this.form = { this.form = {
@ -342,30 +313,6 @@ export default {
this.$refs['form'].resetFields() this.$refs['form'].resetFields()
this.dialogFormVisible = false this.dialogFormVisible = false
}, },
transformStoreCategories(data) {
return data.map(item => ({
value: item.store_category_id,
label: item.store_category_name,
children: item.children ? [
//
{
value: item.store_category_id,
label: item.store_category_name
},
...item.children.map(child => ({
value: child.store_category_id,
label: child.store_category_name
}))
] : []
}));
},
handleChangeBizCategory(value) {
if (value && value.length === 2) {
const [bizCategoryId, bizSecondCategoryId] = value;
this.form.store_category_id = bizCategoryId;
this.form.store_2nd_category_id = bizSecondCategoryId;
}
},
save() { save() {
this.$refs['form'].validate(async (valid) => { this.$refs['form'].validate(async (valid) => {
if (valid) { if (valid) {

View File

@ -43,15 +43,26 @@
<div class="item-block" style="margin-left: 30px;"> <div class="item-block" style="margin-left: 30px;">
<div class="item-lable">经营品类</div> <div class="item-lable">经营品类</div>
<el-cascader <!-- <el-input
v-model="cascaderValue" class="item-input"
:options="cascaderOptions" v-model="form.biz_category"
placeholder="请选择经营品类" clearable
:show-all-levels="false" :disabled="isReadonly"
@change="handleChangeBizCategory" /> -->
clearable <el-select
:disabled="isReadonly" v-model.trim="form.biz_category"
/> clearable
:placeholder="__('经营分类')"
:style="{ width: '48%' }"
:disabled="isReadonly"
>
<el-option
v-for="item in classifyData"
:key="item.store_category_id"
:label="item.store_category_name"
:value="item.store_category_id"
/>
</el-select>
</div> </div>
</div> </div>
<div class="item-info"> <div class="item-info">
@ -1023,7 +1034,6 @@ import {
createSubAccount, createSubAccount,
checkShopName, checkShopName,
updateUserInfo, updateUserInfo,
getStoreCategories
} from '@/api/shopAudit/shopAudit' } from '@/api/shopAudit/shopAudit'
import { GetStoreClassify } from '@/api/base/store/category' import { GetStoreClassify } from '@/api/base/store/category'
import { batchNoApi, imgOcrResultApi } from "@/api/upload"; import { batchNoApi, imgOcrResultApi } from "@/api/upload";
@ -1071,8 +1081,6 @@ export default {
formConfig: JSON.parse(JSON.stringify(config)), formConfig: JSON.parse(JSON.stringify(config)),
cityData: JSON.parse(JSON.stringify(city.cityData)), cityData: JSON.parse(JSON.stringify(city.cityData)),
classifyData: [], classifyData: [],
cascaderValue: [], //
cascaderOptions: [],
form: { form: {
id:'', id:'',
login_mobile: '66', login_mobile: '66',
@ -1330,7 +1338,9 @@ export default {
}, },
}, },
created() { created() {
this.uploadParams.authorization = getToken(); this.uploadParams.authorization = getToken()
this.fetchdataGetStoreClassify()
console.log(this.uploadParams)
}, },
methods: { methods: {
async getMerchDetail() { async getMerchDetail() {
@ -1374,13 +1384,6 @@ export default {
this.showLoading = false this.showLoading = false
await this.getCategoryList(); await this.getCategoryList();
if (this.form.biz_category && this.form.biz_second_category) {
this.cascaderValue = [
this.form.biz_category, // ID
this.form.biz_second_category // ID
];
console.log("级联回显值:", this.cascaderValue);
}
const areaData = await getAreaJSON() const areaData = await getAreaJSON()
if(this.form.store_district){ if(this.form.store_district){
@ -1487,30 +1490,6 @@ export default {
} }
}, },
transformStoreCategories(data) {
return data.map(item => ({
value: item.store_category_id,
label: item.store_category_name,
children: item.children ? [
//
{
value: item.store_category_id,
label: `${item.store_category_name} 到账比例(${item.split_ratio}%)`
},
...item.children.map(child => ({
value: child.store_category_id,
label: `${child.store_category_name} 到账比例(${child.split_ratio}%)`
}))
] : []
}));
},
handleChangeBizCategory(value) {
if (value && value.length === 2) {
const [bizCategoryId, bizSecondCategoryId] = value;
this.form.biz_category = bizCategoryId;
this.form.biz_second_category = bizSecondCategoryId;
}
},
formatAreaData(data){ formatAreaData(data){
let provinces = [] let provinces = []
data.forEach((item) => { data.forEach((item) => {
@ -1556,18 +1535,15 @@ export default {
const parts = url.split('/') const parts = url.split('/')
return parts[parts.length - 1] || 'contract.pdf' return parts[parts.length - 1] || 'contract.pdf'
}, },
async getCategoryList() { async getCategoryList(){
try { let res = await GetCategoryList();
const res = await getStoreCategories();
if (res.code === 0 && res.status === 200) { if(res && res.status == 200){
this.cascaderOptions = this.transformStoreCategories(res.data);
console.log("分类列表加载完成:", this.cascaderOptions); let name = this.findCategoryName(res.data,this.form.biz_category);
} else { if(name){
this.$message.warning("获取分类列表异常"); this.form.biz_category = name
} }
} catch (err) {
this.$message.error("获取店铺分类失败");
console.error(err);
} }
}, },
findCategoryName(categories, targetId) { findCategoryName(categories, targetId) {
@ -1881,6 +1857,11 @@ export default {
console.log(this.form.province_nmae) console.log(this.form.province_nmae)
} }
}, },
async fetchdataGetStoreClassify() {
await GetStoreClassify().then((res) => {
this.classifyData = res.data
})
},
handerChangeCity(e){ handerChangeCity(e){
this.provinceData = []; this.provinceData = [];
this.provinceCode = "" this.provinceCode = ""