Compare commits

..

4 Commits

8 changed files with 334 additions and 59 deletions

View File

@ -159,6 +159,7 @@ export async function categoryImportData(data) {
'Content-Type': 'multipart/form-data', 'Content-Type': 'multipart/form-data',
}, },
data, data,
timeout: 120000
}) })
} }
export async function brandImportData(data) { export async function brandImportData(data) {

View File

@ -112,3 +112,14 @@ export function exportFile(params) {
params, params,
}) })
} }
//开分店
export function createSubStore(data) {
return request({
url: URL.shop.store.base.subStore,
method: 'post',
data:data,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
}

View File

@ -936,6 +936,7 @@ let url = {
//商家端-获取门店信息 //商家端-获取门店信息
get: api_url + '/admin/shop/shop-store-base/get', get: api_url + '/admin/shop/shop-store-base/get',
exportFile: api_url + '/admin/shop/shop-store-base/exportFile', exportFile: api_url + '/admin/shop/shop-store-base/exportFile',
subStore:api_url+'/admin/shop/merch/branch/apply/store',
}, },
activity: { activity: {
base: { base: {

View File

@ -159,7 +159,6 @@ export default {
this.uploadMessageType = 'success' this.uploadMessageType = 'success'
const res = await GoodsToolApi.categoryImportData(formData) const res = await GoodsToolApi.categoryImportData(formData)
console.log("?????",res)
if (res.status === 200) { if (res.status === 200) {
this.uploadMessage = '文件上传成功!' this.uploadMessage = '文件上传成功!'
this.uploadMessageType = 'success' this.uploadMessageType = 'success'

View File

@ -139,8 +139,8 @@
> >
<el-switch <el-switch
v-model="form.is_delivery_self" v-model="form.is_delivery_self"
:active-value="1" :active-value=1
:inactive-value="2" :inactive-value=2
@change="handleDeliveryStatus" @change="handleDeliveryStatus"
active-text="是" active-text="是"
inactive-text="否" inactive-text="否"

View File

@ -0,0 +1,214 @@
<template>
<el-dialog title="创建分店" :visible.sync="visible" width="50%" custom-class="center-dialog">
<div>
<el-form v-model="subStoreForm" label-width="150px">
<el-form-item label="总店" >
<el-select
v-model="subStoreForm.parent_store_id"
clearable
filterable
placeholder="选择店铺"
style="width: 200px;"
>
<el-option
v-for="item in shopList"
:key="item.store_id"
:label="item.store_name"
:value="item.store_id"
/>
</el-select>
</el-form-item>
<el-form-item label="登录手机号">
<el-input v-model="subStoreForm.login_mobile" placeholder="请输入分店登录手机号" style="width: 200px;" clearable />
</el-form-item>
<el-form-item label="登陆密码">
<el-input v-model="subStoreForm.password" type="password" placeholder="请输入登陆密码" style="width: 200px;" clearable/>
</el-form-item>
<el-form-item label="店铺名字">
<el-input v-model="subStoreForm.store_name" placeholder="请输入店铺名字" style="width: 150px;" clearable />
</el-form-item>
<el-form-item label="联系人姓名">
<el-input v-model="subStoreForm.contact_name" placeholder="请输入联系人姓名" style="width: 200px;" clearable />
</el-form-item>
<el-form-item label="邮箱">
<el-input v-model="subStoreForm.email" placeholder="请输入联系人电子邮箱" style="width: 200px;" clearable />
</el-form-item>
<div style="display: flex;margin: 20px 0;">
<div style="display: flex;align-items: center;justify-content: center;">
<div class="item-lable">门脸图</div>
<div>
<el-image
style="margin-right: 20px; width: 300px; height: 200px"
:src="subStoreForm.front_facade_image || require('@/assets/index_images/image.jpg')"
:preview-src-list="srcList1"
lazy />
<div class="upload-btn">
<el-upload
class="upload-demo"
:action="uploadUrl"
:data="uploadParams"
:show-file-list="false"
:limit="1"
:on-success="(res,file,fileList)=>handleAvatarSuccess(res,file,fileList,'front_facade_image')">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件</div>
</el-upload>
</div>
</div>
</div>
<div style="display: flex;align-items: center;justify-content: center;">
<div class="item-lable">环境图</div>
<div>
<el-image
style="margin-right: 20px; width: 300px; height: 200px"
:src="subStoreForm.environment_image || require('@/assets/index_images/image.jpg')"
:preview-src-list="srcList2"
lazy />
<div class="upload-btn">
<el-upload
class="upload-demo"
:action="uploadUrl"
:data="uploadParams"
:show-file-list="false"
:limit="1"
:on-success="(res,file,fileList)=>handleAvatarSuccess(res,file,fileList,'environment_image')">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件</div>
</el-upload>
</div>
</div>
</div>
</div>
<!-- <el-form-item label="店铺地址">
<el-input v-model="subStoreForm.store_address" style="width: 100%;" clearable/>
</el-form-item> -->
<el-form-item label="实体店铺详细地址"label-width="130px">
<keyword
:keyword="subStoreForm.store_address"
:location="queryArea.city.name"
:style="{ width: '100%' }"
@getAddress="getAddress"
/>
</el-form-item>
<el-form-item label="经度" size="normal">
<el-input v-model="subStoreForm.store_longitude" style="width: 150px;" disabled clearable />
</el-form-item>
<el-form-item label="纬度" size="normal">
<el-input v-model="subStoreForm.store_latitude" style="width: 150px;" disabled clearable />
</el-form-item>
</el-form>
</div>
<template #footer>
<span>
<el-button @click="close">取消</el-button>
<el-button type="primary" @click="submitSubStore">确认</el-button>
</span>
</template>
</el-dialog>
</template>
<script>
import {createSubStore} from '@/api/store/base.js'
import GoodsToolApi from '@/api/goodsTool'
import keyword from '@/components/baiduMap/keyword'
import { URL } from '@/config'
import { getToken } from '@/utils/token'
export default {
data() {
return {
visible: false,
subStoreForm:{
parent_store_id:'',
login_mobile:'',
password:'',
store_name:'',
contact_name:'',
email:'',
front_facade_image:'',
environment_image:'',
store_address:'',
store_longitude:'',
store_latitude:'',
},
queryArea: {
province: { code: '', name: '' },
city: { code: '', name: '' },
district: { code: '', name: '' },
},
shopList: [],
srcList1:[],
srcList2:[],
uploadParams: {
authorization: "",
gallery_id: 0,
},
uploadUrl: URL.action,
}
},
components: { keyword },
created() {
this.uploadParams.authorization = getToken();
},
mounted() {
this.getShopList()
},
methods:{
open(){
this.visible=true
},
close(){
this.visible=false
},
async getShopList() {
try {
let res = await GoodsToolApi.getShopList()
this.shopList = res.data.items || []
} catch (error) {
console.error('获取店铺列表失败:', error)
}
},
async submitSubStore(){
let res=await createSubStore(this.subStoreForm);
if(res.status==200){
console.log("dadad")
}
},
getAddress(address) {
this.subStoreForm.store_address = address.value
this.echoAddress(address.lng, address.lat)
},
//
echoAddress(lng, lat) {
this.subStoreForm.store_longitude = lng
this.subStoreForm.store_latitude = lat
},
async handleAvatarSuccess(response, file, fileList, type){
if (response && response.status === 200 && response.code === 0) {
if (response.data && response.data.media_url) {
if(type != 'license_image'){
this.subStoreForm[type] = response.data.media_url
}else{
this.subStoreForm[type].push(response.data.media_url)
}
switch (type) {
case 'front_facade_image':
this.srcList1 = [response.data.media_url];
break;
case 'environment_image':
this.srcList2 = [response.data.media_url];
break;
}
}
}
},
}
}
</script>
<style scoped>
</style>

View File

@ -17,8 +17,11 @@
> >
{{ __('导出打印') }} {{ __('导出打印') }}
</el-button> </el-button>
<el-button icon="el-icon-plus" type="primary" @click="handleEdit()"> <!-- <el-button icon="el-icon-plus" type="primary" @click="handleEdit()">
{{ __('添加') }} {{ __('添加') }}
</el-button> -->
<el-button icon="el-icon-plus" type="primary" @click="handleSubStore()">
{{ __('添加分店') }}
</el-button> </el-button>
</vab-query-form-left-panel> </vab-query-form-left-panel>
<vab-query-form-right-panel :span="21"> <vab-query-form-right-panel :span="21">
@ -385,6 +388,7 @@
<detail ref="detail" @fetch-data="fetchData" /> <detail ref="detail" @fetch-data="fetchData" />
<setState ref="setState" @fetch-data="fetchData" /> <setState ref="setState" @fetch-data="fetchData" />
<SetCategory ref="SetCategory" /> <SetCategory ref="SetCategory" />
<CreateSubStore ref="subStoreRef"/>
</div> </div>
</template> </template>
@ -400,6 +404,7 @@
import Detail from './components/StoreBaseDetailEdit' import Detail from './components/StoreBaseDetailEdit'
import setState from './components/setState' import setState from './components/setState'
import LocationEdit from './components/LocationEdit' import LocationEdit from './components/LocationEdit'
import CreateSubStore from './components/createSubStore.vue'
import {getList as getSubsite} from "@/api/plantform/subsite"; import {getList as getSubsite} from "@/api/plantform/subsite";
export default { export default {
@ -412,6 +417,7 @@
Detail, Detail,
SetCategory, SetCategory,
setState, setState,
CreateSubStore
}, },
data() { data() {
return { return {
@ -453,6 +459,7 @@
}, },
], ],
store_type: 2, store_type: 2,
subStoreRef:null,
storeList: [ storeList: [
{ {
store_is_selfsupport: 1, store_is_selfsupport: 1,
@ -571,6 +578,9 @@
this.$refs['edit'].showEdit() this.$refs['edit'].showEdit()
} }
}, },
handleSubStore(){
this.$refs.subStoreRef?.open()
},
handleLocationEdit(row) { handleLocationEdit(row) {
if (row) { if (row) {
this.$refs['locationEdit'].showEdit(row) this.$refs['locationEdit'].showEdit(row)

View File

@ -196,19 +196,16 @@
/> --> /> -->
</div> </div>
</div> </div>
<div class="item-info" style="margin: 40px 0">
<div class="item-info" style="margin: 40px 0;">
<div class="item-block"> <div class="item-block">
<div class="item-lable">店铺门面正面图片</div> <div class="item-lable">店铺门面正面图片</div>
<div> <div>
<el-image <el-image
style="margin-right: 20px; width: 500px; height: 300px" style="margin-right: 20px; width: 500px; height: 300px"
:src=" :src="form.front_facade_image || require('@/assets/index_images/image.jpg')"
form.front_facade_image ||
require('@/assets/index_images/image.jpg')
"
:preview-src-list="srcList1" :preview-src-list="srcList1"
lazy lazy />
></el-image>
<div class="upload-btn"> <div class="upload-btn">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
@ -216,24 +213,19 @@
:data="uploadParams" :data="uploadParams"
:show-file-list="false" :show-file-list="false"
:limit="1" :limit="1"
:on-success="(response, file, fileList) => handleAvatarSuccess(response, file, fileList, 'front_facade_image')" :on-success="(res,file,fileList)=>handleAvatarSuccess(res,file,fileList,'front_facade_image')">
>
<el-button size="small" type="primary">点击上传</el-button> <el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件</div> <div slot="tip" class="el-upload__tip">只能上传jpg/png文件</div>
</el-upload> </el-upload>
</div> </div>
</div> </div>
<div class="item-lable">店铺门面环境图片</div> <div class="item-lable">店铺门面环境图片</div>
<div> <div>
<el-image <el-image
style="margin-right: 20px; width: 500px; height: 300px" style="margin-right: 20px; width: 500px; height: 300px"
:src=" :src="form.environment_image || require('@/assets/index_images/image.jpg')"
form.environment_image || :preview-src-list="srcList2" lazy />
require('@/assets/index_images/image.jpg')
"
:preview-src-list="srcList2"
lazy
></el-image>
<div class="upload-btn"> <div class="upload-btn">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
@ -241,8 +233,51 @@
:data="uploadParams" :data="uploadParams"
:show-file-list="false" :show-file-list="false"
:limit="1" :limit="1"
:on-success="(response, file, fileList) => handleAvatarSuccess(response, file, fileList, 'environment_image')" :on-success="(res,file,fileList)=>handleAvatarSuccess(res,file,fileList,'environment_image')">
> <el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件</div>
</el-upload>
</div>
</div>
</div>
</div>
<div class="item-info" style="margin: 40px 0;">
<div class="item-block">
<div class="item-lable">门店收银台图片</div>
<div>
<el-image
style="margin-right: 20px; width: 500px; height: 300px"
:src="form.checkstand_image || require('@/assets/index_images/image.jpg')"
:preview-src-list="srcListNew1" lazy />
<div class="upload-btn">
<el-upload
class="upload-demo"
:action="uploadUrl"
:data="uploadParams"
:show-file-list="false"
:limit="1"
:on-success="(res,file,fileList)=>handleAvatarSuccess(res,file,fileList,'checkstand_image')">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件</div>
</el-upload>
</div>
</div>
<div class="item-lable">许可证照片</div>
<div>
<el-image
style="margin-right: 20px; width: 500px; height: 300px"
:src="form.opening_permit_image || require('@/assets/index_images/image.jpg')"
:preview-src-list="srcListNew2" lazy />
<div class="upload-btn">
<el-upload
class="upload-demo"
:action="uploadUrl"
:data="uploadParams"
:show-file-list="false"
:limit="1"
:on-success="(res,file,fileList)=>handleAvatarSuccess(res,file,fileList,'opening_permit_image')">
<el-button size="small" type="primary">点击上传</el-button> <el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件</div> <div slot="tip" class="el-upload__tip">只能上传jpg/png文件</div>
</el-upload> </el-upload>
@ -980,7 +1015,7 @@
<el-button <el-button
v-if="![1,5].includes(form.approval_status)" v-if="![1,5].includes(form.approval_status)"
class="btn" class="btn"
type="normal" type="success"
@click="saveUserInfo()" @click="saveUserInfo()"
> >
保存信息 保存信息
@ -1090,6 +1125,8 @@ export default {
entity_type: '', entity_type: '',
front_facade_image: '', front_facade_image: '',
environment_image: '', environment_image: '',
checkstand_image:'',
opening_permit_image:'',
biz_license_number: '', biz_license_number: '',
biz_license_image: '', biz_license_image: '',
biz_license_content:'', biz_license_content:'',
@ -1214,6 +1251,8 @@ export default {
isIndeterminate: true, isIndeterminate: true,
srcList1: [], srcList1: [],
srcList2: [], srcList2: [],
srcListNew1:[],
srcListNew2:[],
srcList3: [], srcList3: [],
srcList4: [], srcList4: [],
srcList5: [], srcList5: [],