增加进件功能
This commit is contained in:
246
entryManager/add/components/bank-select.vue
Normal file
246
entryManager/add/components/bank-select.vue
Normal file
@@ -0,0 +1,246 @@
|
||||
<template>
|
||||
<view>
|
||||
|
||||
<view class="box" @click.stop="openPopup">
|
||||
<text class="u-font-28 color-999 u-p-r-16" v-if="!modelValue">请选择</text>
|
||||
<text class="u-font-28 color-333 u-p-r-16" v-else>{{returnLabel()}}</text>
|
||||
<view class="icon">
|
||||
<up-icon name="arrow-down" size="14" color="#999"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
<up-popup :show="show" placement="bottom" round="18rpx" closeOnClickOverlay @close="close">
|
||||
<view class="u-p-30">
|
||||
<view class="font-bold color-333 u-font-32">选择银行</view>
|
||||
<view class="u-m-t-24">
|
||||
<up-search v-model="query.bankName" @search="search" @change="bankNameChange" @custom="search"
|
||||
@clear="search"></up-search>
|
||||
</view>
|
||||
<scroll-view @scrolltolower="scrolltolower" scroll-with-animation :scroll-into-view="selid"
|
||||
class="scroll-view u-m-t-30" scroll-y="true" style="max-height :60vh;">
|
||||
<view class="u-m-b-10 u-flex item" v-for="item in list" :key="item.id" @click="itemClick(item)"
|
||||
:id="'shop_'+item.id" :class="{active:selItem&&selItem.id==item.id}">
|
||||
<view class="checkbox">
|
||||
<up-icon name="checkbox-mark" color="#fff"></up-icon>
|
||||
</view>
|
||||
<view class="u-flex-1">{{item.bankAlias}}</view>
|
||||
</view>
|
||||
|
||||
<up-loadmore :status="isEnd?'nomore':'loading'"></up-loadmore>
|
||||
</scroll-view>
|
||||
<view class="u-flex gap-20 u-m-t-30">
|
||||
<view class="u-flex-1">
|
||||
<my-button type="default" @click="close">取消</my-button>
|
||||
</view>
|
||||
<view class="u-flex-1">
|
||||
<my-button type="primary" @click="submit">确定</my-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</up-popup>
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import {
|
||||
computed,
|
||||
nextTick,
|
||||
onMounted,
|
||||
reactive,
|
||||
ref,
|
||||
watch
|
||||
} from 'vue';
|
||||
import {
|
||||
bankInfo
|
||||
} from '@/http/api/system/common.js';
|
||||
const customStyle = ref({
|
||||
marginRight: '20px'
|
||||
});
|
||||
|
||||
const show = ref(false);
|
||||
const modelValue = defineModel();
|
||||
|
||||
const bankInstId = defineModel('bankInstId');
|
||||
|
||||
|
||||
|
||||
|
||||
const selid = ref('')
|
||||
|
||||
function returnLabel() {
|
||||
const findShop = list.value.find(v => v.bankAlias == modelValue.value)
|
||||
return findShop ? findShop.bankAlias : ''
|
||||
}
|
||||
|
||||
const selItem = ref(null)
|
||||
|
||||
function itemClick(bank) {
|
||||
selItem.value = bank;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function close() {
|
||||
show.value = false;
|
||||
}
|
||||
|
||||
function submit() {
|
||||
modelValue.value = selItem.value.bankAlias
|
||||
bankInstId.value = selItem.value.bankCode
|
||||
console.log('modelValue', modelValue.value);
|
||||
console.log('bankInstId', bankInstId.value);
|
||||
show.value = false;
|
||||
|
||||
}
|
||||
|
||||
function search() {
|
||||
isEnd.value = false
|
||||
query.page = 1
|
||||
init()
|
||||
}
|
||||
|
||||
const list = ref([]);
|
||||
watch(() => modelValue.value, (newval) => {
|
||||
if (newval) {
|
||||
const findShop = list.value.find(v => v.bankAlias == modelValue.value)
|
||||
if (findShop) {
|
||||
selid.value = 'shop_' + findShop.id
|
||||
selItem.value = findShop
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
function openPopup() {
|
||||
const findShop = list.value.find(v => v.bankAlias == modelValue.value)
|
||||
if (findShop) {
|
||||
selid.value = 'shop_' + findShop.id
|
||||
selItem.value = findShop
|
||||
}
|
||||
show.value = true;
|
||||
|
||||
}
|
||||
|
||||
// --------------- 核心新增:节流函数实现 ---------------
|
||||
/**
|
||||
* 节流函数:限制函数在指定时间内只触发一次
|
||||
* @param {Function} fn - 要节流的函数
|
||||
* @param {number} delay - 节流延迟时间(毫秒)
|
||||
* @returns {Function} 节流后的函数
|
||||
*/
|
||||
function throttle(fn, delay = 300) {
|
||||
let timer = null; // 定时器标识
|
||||
return function(...args) {
|
||||
// 如果已有定时器,直接返回(未到触发时间)
|
||||
if (timer) return;
|
||||
// 执行函数并设置新定时器
|
||||
fn.apply(this, args);
|
||||
timer = setTimeout(() => {
|
||||
clearTimeout(timer);
|
||||
timer = null;
|
||||
}, delay);
|
||||
};
|
||||
}
|
||||
|
||||
// --------------- 核心修改:创建节流后的search方法 ---------------
|
||||
// 300ms内只触发一次search,可根据需求调整delay值(如500ms)
|
||||
const throttledSearch = throttle(search, 300);
|
||||
|
||||
// --------------- 改造bankNameChange:调用节流后的搜索 ---------------
|
||||
function bankNameChange() {
|
||||
// 输入变化时,调用节流后的搜索方法
|
||||
throttledSearch();
|
||||
}
|
||||
|
||||
const query = reactive({
|
||||
page: 1,
|
||||
size: 10,
|
||||
bankName: ''
|
||||
})
|
||||
const isEnd = ref(false)
|
||||
|
||||
function scrolltolower() {
|
||||
if (isEnd.value) {
|
||||
return
|
||||
}
|
||||
query.page++
|
||||
init()
|
||||
}
|
||||
|
||||
|
||||
async function init() {
|
||||
const res = await bankInfo(query);
|
||||
isEnd.value = query.page >= res.totalPage * 1 ? true : false
|
||||
if (res) {
|
||||
if (query.page == 1) {
|
||||
list.value = res.records
|
||||
} else {
|
||||
list.value = list.value.concat(res.records)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
onMounted(init);
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.box {
|
||||
border-radius: 8upx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: top;
|
||||
flex-wrap: wrap;
|
||||
padding: 20rpx 24rpx;
|
||||
border: 2rpx solid #e5e5e5;
|
||||
position: relative;
|
||||
|
||||
.icon {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 24rpx;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
}
|
||||
|
||||
.shop-item {
|
||||
padding: 4rpx 8rpx 4rpx 16rpx;
|
||||
border-radius: 4rpx;
|
||||
border: 2rpx solid #f0f0f0;
|
||||
background-color: #f5f5f5;
|
||||
margin-bottom: 16rpx;
|
||||
margin-left: 16rpx;
|
||||
}
|
||||
|
||||
.scroll-view {
|
||||
.item {
|
||||
border: 1px solid #eee;
|
||||
padding: 20rpx;
|
||||
border-radius: 12rpx;
|
||||
|
||||
&.active {
|
||||
border-color: $my-main-color;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.checkbox {
|
||||
margin-right: 10rpx;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 6rpx;
|
||||
border: 1px solid #999;
|
||||
|
||||
}
|
||||
|
||||
.item {
|
||||
&.active {
|
||||
.checkbox {
|
||||
background-color: $my-main-color;
|
||||
border-color: $my-main-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
292
entryManager/add/components/bankBranchList.vue
Normal file
292
entryManager/add/components/bankBranchList.vue
Normal file
@@ -0,0 +1,292 @@
|
||||
<template>
|
||||
<view>
|
||||
|
||||
<view class="box" @click.stop="openPopup">
|
||||
<text class="u-font-28 color-999 u-p-r-16" v-if="!modelValue">请选择</text>
|
||||
<text class="u-font-28 color-333 u-p-r-16" v-else>{{returnLabel()}}</text>
|
||||
<view class="icon">
|
||||
<up-icon name="arrow-down" size="14" color="#999"></up-icon>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<up-popup :show="show" placement="bottom" round="18rpx" closeOnClickOverlay @close="close">
|
||||
<view class="u-p-30">
|
||||
<view class="font-bold color-333 u-font-32">选择银行</view>
|
||||
<view class="u-m-t-24">
|
||||
<up-search v-model="keywords" @search="search" @change="search" @custom="search"
|
||||
@clear="search"></up-search>
|
||||
</view>
|
||||
<scroll-view scroll-with-animation :scroll-into-view="selid" class="scroll-view u-m-t-30"
|
||||
scroll-y="true" style="max-height :60vh;">
|
||||
<template v-if="list.length">
|
||||
<view class="u-m-b-10 u-flex item" v-for="item in list" :key="item.bankCode"
|
||||
@click="itemClick(item)" :id="'shop_'+item.bankCode"
|
||||
:class="{active:selItem&&selItem.bankCode==item.bankCode}">
|
||||
<view class="checkbox">
|
||||
<up-icon name="checkbox-mark" color="#fff"></up-icon>
|
||||
</view>
|
||||
<view class="u-flex-1">{{item.branchName}}</view>
|
||||
</view>
|
||||
<view class="u-p-20 u-flex u-row-center">
|
||||
<up-loadmore status="nomore"></up-loadmore>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<template v-if="keywords">
|
||||
<up-empty text="未搜索到相关支行"></up-empty>
|
||||
</template>
|
||||
<up-empty v-else text="暂无支行"></up-empty>
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
</scroll-view>
|
||||
<view class="u-flex gap-20 u-m-t-30">
|
||||
<view class="u-flex-1">
|
||||
<my-button type="default" @click="close">取消</my-button>
|
||||
</view>
|
||||
<view class="u-flex-1">
|
||||
<my-button type="primary" @click="submit">确定</my-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</up-popup>
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import {
|
||||
computed,
|
||||
onMounted,
|
||||
reactive,
|
||||
ref,
|
||||
watch
|
||||
} from 'vue';
|
||||
import {
|
||||
bankBranchList
|
||||
} from '@/http/api/order/entryManager.js';
|
||||
|
||||
const customStyle = ref({
|
||||
marginRight: '20px'
|
||||
});
|
||||
|
||||
const show = ref(false);
|
||||
const modelValue = defineModel();
|
||||
const bankBranchName = defineModel('bankBranchName', {
|
||||
default: '',
|
||||
});
|
||||
|
||||
const selid = ref('')
|
||||
|
||||
function returnLabel() {
|
||||
const findShop = list.value.find(v => v.bankCode == modelValue.value)
|
||||
return findShop ? findShop.branchName : ''
|
||||
}
|
||||
const selItem = ref(null)
|
||||
|
||||
function itemClick(data) {
|
||||
selItem.value = data
|
||||
}
|
||||
|
||||
function returnbranchName(bankCode) {
|
||||
const item = list.value.find((v) => v.bankCode == bankCode);
|
||||
return item?.branchName || '';
|
||||
}
|
||||
|
||||
function close() {
|
||||
show.value = false;
|
||||
}
|
||||
|
||||
function submit() {
|
||||
modelValue.value = selItem.value.bankCode
|
||||
bankBranchName.value = selItem.value.branchName
|
||||
show.value = false;
|
||||
}
|
||||
|
||||
const keywords = ref('')
|
||||
|
||||
function search() {
|
||||
list.value = matchStr(allList, keywords.value)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 模糊匹配对象数组中每个对象的全部属性,按匹配度由高到低排序返回,未匹配到的对象直接过滤(不返回)
|
||||
* @param {Array<Object>} arr - 待匹配的对象数组(必传,非数组返回空数组)
|
||||
* @param {string} str - 待匹配的目标字符串(空字符串返回原数组浅拷贝)
|
||||
* @returns {Array<Object>} 按匹配度降序排序后的对象数组(仅包含匹配项,不修改原数组)
|
||||
*/
|
||||
function matchStr(arr, str) {
|
||||
// ------------- 步骤1:严格边界处理,避免运行报错 -------------
|
||||
if (!Array.isArray(arr)) {
|
||||
console.warn('入参arr必须是对象数组');
|
||||
return [];
|
||||
}
|
||||
const targetStr = String(str || '').trim().toLowerCase();
|
||||
if (!targetStr) {
|
||||
return [...arr]; // 空字符串返回原数组浅拷贝(保持原有逻辑)
|
||||
}
|
||||
|
||||
// ------------- 步骤2:定义匹配度得分规则 -------------
|
||||
const getSinglePropScore = (propValue) => {
|
||||
const propStr = String(propValue).trim().toLowerCase();
|
||||
if (propStr === targetStr) return 3;
|
||||
if (propStr.startsWith(targetStr)) return 2;
|
||||
if (propStr.includes(targetStr)) return 1;
|
||||
return 0;
|
||||
};
|
||||
|
||||
// ------------- 步骤3:遍历数组,计算每个对象的总匹配度得分 -------------
|
||||
const arrWithScore = arr.map(item => {
|
||||
if (typeof item !== 'object' || item === null) {
|
||||
return {
|
||||
originItem: item,
|
||||
totalScore: 0
|
||||
};
|
||||
}
|
||||
|
||||
let totalScore = 0;
|
||||
Object.keys(item).forEach(propKey => {
|
||||
const propValue = item[propKey];
|
||||
totalScore += getSinglePropScore(propValue);
|
||||
});
|
||||
|
||||
return {
|
||||
originItem: item,
|
||||
totalScore: totalScore
|
||||
};
|
||||
});
|
||||
|
||||
// ------------- 步骤4:先过滤(仅保留得分>0的项),再排序,最后返回原对象格式 -------------
|
||||
return arrWithScore
|
||||
.filter(item => item.totalScore > 0) // 核心新增:过滤未匹配项(总得分=0的对象不保留)
|
||||
.sort((a, b) => b.totalScore - a.totalScore) // 仅对匹配项进行降序排序
|
||||
.map(item => item.originItem); // 剔除得分字段,返回原对象格式
|
||||
}
|
||||
|
||||
const list = ref([]);
|
||||
|
||||
function openPopup() {
|
||||
selid.value = 'shop_' + modelValue.value
|
||||
const findShop = list.value.find(v => v.bankCode == modelValue.value)
|
||||
selItem.value=findShop?findShop:null
|
||||
show.value = true;
|
||||
|
||||
}
|
||||
|
||||
// --------------- 核心新增:节流函数实现 ---------------
|
||||
/**
|
||||
* 节流函数:限制函数在指定时间内只触发一次
|
||||
* @param {Function} fn - 要节流的函数
|
||||
* @param {number} delay - 节流延迟时间(毫秒)
|
||||
* @returns {Function} 节流后的函数
|
||||
*/
|
||||
function throttle(fn, delay = 300) {
|
||||
let timer = null; // 定时器标识
|
||||
return function(...args) {
|
||||
// 如果已有定时器,直接返回(未到触发时间)
|
||||
if (timer) return;
|
||||
// 执行函数并设置新定时器
|
||||
fn.apply(this, args);
|
||||
timer = setTimeout(() => {
|
||||
clearTimeout(timer);
|
||||
timer = null;
|
||||
}, delay);
|
||||
};
|
||||
}
|
||||
|
||||
// --------------- 核心修改:创建节流后的search方法 ---------------
|
||||
// 300ms内只触发一次search,可根据需求调整delay值(如500ms)
|
||||
const throttledSearch = throttle(search, 300);
|
||||
|
||||
// --------------- 改造bankNameChange:调用节流后的搜索 ---------------
|
||||
function bankNameChange() {
|
||||
// 输入变化时,调用节流后的搜索方法
|
||||
throttledSearch();
|
||||
}
|
||||
|
||||
const props = defineProps({
|
||||
query: {
|
||||
type: Object,
|
||||
default: () => ({
|
||||
province: '',
|
||||
city: '',
|
||||
instId: '',
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
watch(() => show.value, (newval) => {
|
||||
init()
|
||||
})
|
||||
|
||||
let allList = []
|
||||
async function init() {
|
||||
const res = await bankBranchList(props.query);
|
||||
list.value = res
|
||||
allList = res
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.box {
|
||||
border-radius: 8upx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: top;
|
||||
flex-wrap: wrap;
|
||||
padding: 20rpx 40rpx 20rpx 24rpx;
|
||||
border: 2rpx solid #e5e5e5;
|
||||
position: relative;
|
||||
|
||||
.icon {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 24rpx;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
}
|
||||
|
||||
.shop-item {
|
||||
padding: 4rpx 8rpx 4rpx 16rpx;
|
||||
border-radius: 4rpx;
|
||||
border: 2rpx solid #f0f0f0;
|
||||
background-color: #f5f5f5;
|
||||
margin-bottom: 16rpx;
|
||||
margin-left: 16rpx;
|
||||
}
|
||||
|
||||
.scroll-view {
|
||||
.item {
|
||||
border: 1px solid #eee;
|
||||
padding: 20rpx;
|
||||
border-radius: 12rpx;
|
||||
|
||||
&.active {
|
||||
border-color: $my-main-color;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.checkbox {
|
||||
margin-right: 10rpx;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 6rpx;
|
||||
border: 1px solid #999;
|
||||
|
||||
}
|
||||
|
||||
.item {
|
||||
&.active {
|
||||
.checkbox {
|
||||
background-color: $my-main-color;
|
||||
border-color: $my-main-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
302
entryManager/add/components/basic-info.vue
Normal file
302
entryManager/add/components/basic-info.vue
Normal file
@@ -0,0 +1,302 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="u-font-32 font-bold u-m-32 text-center">商户基础信息</view>
|
||||
<view class="container">
|
||||
<!-- <view class="form-item">
|
||||
<view class="font-bold u-m-b-16">店铺</view>
|
||||
<shopSelect></shopSelect>
|
||||
</view> -->
|
||||
<view class="form-item required">
|
||||
<view class="title">商户类型</view>
|
||||
<up-radio-group v-model="form.userType">
|
||||
<up-radio v-for="(value,key) in userTypes" :label="value" :name="key">
|
||||
</up-radio>
|
||||
</up-radio-group>
|
||||
</view>
|
||||
|
||||
<view class="form-item required">
|
||||
<view class="title">企业类型</view>
|
||||
<up-radio-group v-model="form.companyChildType">
|
||||
<up-radio v-for="(value,key) in companyChildTypes" :label="value" :name="key">
|
||||
</up-radio>
|
||||
</up-radio-group>
|
||||
</view>
|
||||
|
||||
<view class="form-item required">
|
||||
<view class="title">商户简称</view>
|
||||
<up-input placeholder="商户简称" :placeholder-class="placeholderClass" v-model="form.shortName"></up-input>
|
||||
</view>
|
||||
<view class="form-item required">
|
||||
<view class="title"> 行业类目</view>
|
||||
<mccCategory v-model="form.mccCode"></mccCategory>
|
||||
</view>
|
||||
|
||||
<view class="form-item required">
|
||||
<view class="title"> 支付宝账号</view>
|
||||
<up-input placeholder="支付宝账号" :placeholder-class="placeholderClass"
|
||||
v-model="form.alipayAccount"></up-input>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="form-item required">
|
||||
<view class="title">联系人类型</view>
|
||||
<up-radio-group v-model="form.contactPersonType">
|
||||
<up-radio v-for="(value,key) in contactPersonTypes" :label="value" :name="key">
|
||||
</up-radio>
|
||||
</up-radio-group>
|
||||
</view>
|
||||
|
||||
<template v-if="form.contactPersonType=='SUPER'">
|
||||
<view class="form-item ">
|
||||
<view class="title"> 联系人身份证正面</view>
|
||||
<my-upload-img v-model="form.contactIdCardFrontPic.url" :size="200"
|
||||
@uploadSuccess="uploadSuccess($event,'IdCard','contactIdCardFrontPic')"></my-upload-img>
|
||||
</view>
|
||||
|
||||
<view class="form-item ">
|
||||
<view class="title"> 联系人身份证背面</view>
|
||||
<my-upload-img v-model="form.contactIdCardBackPic.url" :size="200"
|
||||
@uploadSuccess="uploadSuccess($event,'IdCard','contactIdCardBackPic')"></my-upload-img>
|
||||
</view>
|
||||
|
||||
<!-- <view class="form-item required">
|
||||
<view class="title">证件类型</view>
|
||||
<up-radio-group v-model="form.certType">
|
||||
<up-radio v-for="(value,key) in certTypes" :label="value" :name="key">
|
||||
</up-radio>
|
||||
</up-radio-group>
|
||||
</view> -->
|
||||
<view class="form-item ">
|
||||
<view class="title"> 联系人姓名</view>
|
||||
<up-input placeholder="联系人姓名" :placeholder-class="placeholderClass"
|
||||
v-model="form.contactName"></up-input>
|
||||
</view>
|
||||
<view class="form-item ">
|
||||
<view class="title"> 联系人身份证号</view>
|
||||
<up-input placeholder="联系人身份证号" :placeholder-class="placeholderClass"
|
||||
v-model="form.contactPersonId"></up-input>
|
||||
</view>
|
||||
<view class="form-item ">
|
||||
<view class="title"> 联系人身份证开始日期</view>
|
||||
<up-datetime-picker hasInput :minDate="minDate" :maxDate="maxDate" format="YYYY-MM-DD"
|
||||
placeholder="请选择" v-model="form.contactPersonIdStartDate" mode="date">
|
||||
</up-datetime-picker>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="form-item ">
|
||||
<view class="title"> 联系人身份证到期日期</view>
|
||||
<view class="u-m-b-16">
|
||||
<up-radio-group v-model="contactPersonIdEndDateType">
|
||||
<up-radio :name="1" label="有结束日期"></up-radio>
|
||||
<up-radio :name="2" label="长期有效"></up-radio>
|
||||
</up-radio-group>
|
||||
</view>
|
||||
<template v-if="contactPersonIdEndDateType==1">
|
||||
<up-datetime-picker hasInput :minDate="endDataMinDate" :maxDate="maxDate" format="YYYY-MM-DD"
|
||||
placeholder="请选择" v-model="form.contactPersonIdEndDate" mode="date">
|
||||
</up-datetime-picker>
|
||||
</template>
|
||||
|
||||
|
||||
</view>
|
||||
<view class="form-item ">
|
||||
<view class="title"> 联系人电话</view>
|
||||
<up-input placeholder="联系人电话" :placeholder-class="placeholderClass"
|
||||
v-model="form.contactPhone"></up-input>
|
||||
</view>
|
||||
|
||||
<view class="form-item ">
|
||||
<view class="title"> 联系人通讯地址</view>
|
||||
<up-input placeholder="联系人通讯地址" :placeholder-class="placeholderClass"
|
||||
v-model="form.contactAddr"></up-input>
|
||||
</view>
|
||||
|
||||
<view class="form-item ">
|
||||
<view class="title"> 联系人邮箱
|
||||
</view>
|
||||
<up-input placeholder="联系人邮箱" :placeholder-class="placeholderClass"
|
||||
v-model="form.contactEmail"></up-input>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
computed,
|
||||
onMounted,
|
||||
reactive,
|
||||
ref,
|
||||
watch
|
||||
} from 'vue';
|
||||
import shopSelect from './shop-select.vue'
|
||||
import mccCategory from '@/entryManager/components/mcc-category.vue'
|
||||
import {
|
||||
userTypes,
|
||||
contactPersonTypes,
|
||||
companyChildTypes,
|
||||
certTypes
|
||||
} from '@/entryManager/data.js'
|
||||
import {
|
||||
getInfoByImg
|
||||
} from '@/http/api/order/entryManager.js'
|
||||
|
||||
|
||||
import dayjs from 'dayjs';
|
||||
const minDate = dayjs('1970-01-01 00:00:00').valueOf()
|
||||
const maxDate = dayjs('2099-12-31 23:59:59').valueOf()
|
||||
const endDataMinDate = computed(() => {
|
||||
if (!form.contactPersonIdStartDate) {
|
||||
return minDate
|
||||
}
|
||||
if (form.contactPersonIdStartDate) {
|
||||
return dayjs(form.contactPersonIdStartDate).add(10, 'year').valueOf()
|
||||
}
|
||||
return minDate
|
||||
})
|
||||
|
||||
const contactPersonIdEndDateType = ref(1)
|
||||
watch(() => contactPersonIdEndDateType.value, (newval) => {
|
||||
if (newval == 2) {
|
||||
form.contactPersonIdEndDate = maxDate
|
||||
} else {
|
||||
form.contactPersonIdEndDate = dayjs().valueOf()
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
function uploadSuccess(url, type, key) {
|
||||
uni.showLoading({
|
||||
type: '识别中,请稍等……!'
|
||||
})
|
||||
getInfoByImg({
|
||||
url,
|
||||
type
|
||||
}).then(res => {
|
||||
uni.hideLoading()
|
||||
if (res) {
|
||||
const data = res.subImages[0].kvInfo.data
|
||||
if (key == 'contactIdCardBackPic') {
|
||||
if (data.validPeriod) {
|
||||
const [start, end] = data.validPeriod.split('-')
|
||||
if (start) {
|
||||
form.contactPersonIdStartDate = dayjs(start).valueOf()
|
||||
}
|
||||
if (end) {
|
||||
if (end.includes('长期')) {
|
||||
contactPersonIdEndDateType.value = 2
|
||||
} else {
|
||||
form.contactPersonIdEndDate = dayjs(end).valueOf()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if (key == 'contactIdCardFrontPic') {
|
||||
form.contactName = data.name
|
||||
form.contactPersonId = data.idNumber
|
||||
form.contactAddr = data.address
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
const form = reactive({
|
||||
userType: '0',
|
||||
shortName: '',
|
||||
mccCode: '',
|
||||
alipayAccount: '',
|
||||
contactPersonType: 'LEGAL',
|
||||
contactName: '',
|
||||
certType: '0',
|
||||
contactPersonId: '',
|
||||
contactPersonIdStartDate: '',
|
||||
contactPersonIdEndDate: '',
|
||||
contactIdCardBackPic: {
|
||||
url: ''
|
||||
},
|
||||
contactIdCardFrontPic: {
|
||||
url: ''
|
||||
},
|
||||
contactPhone: '',
|
||||
contactAddr: '',
|
||||
contactEmail: '',
|
||||
companyChildType: '1',
|
||||
})
|
||||
|
||||
const placeholderClass = ref('u-font-28')
|
||||
|
||||
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
const emits = defineEmits(['update'])
|
||||
watch(() => form, (newval) => {
|
||||
console.log('form', form);
|
||||
emits('update', newval)
|
||||
}, {
|
||||
deep: true,
|
||||
immediate: true
|
||||
})
|
||||
|
||||
watch(() => props.data, (newval) => {
|
||||
for (let key in form) {
|
||||
if (props.data.hasOwnProperty(key)) {
|
||||
form[key] = props.data[key]
|
||||
}
|
||||
}
|
||||
}, {
|
||||
deep: true,
|
||||
immediate: true
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.container {
|
||||
padding: 32rpx 28rpx;
|
||||
border-radius: 16rpx;
|
||||
margin-bottom: 32rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.form-item {
|
||||
margin-bottom: 32rpx;
|
||||
|
||||
.title {
|
||||
font-weight: 700;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
&.required {
|
||||
.title::before {
|
||||
content: '*';
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
81
entryManager/add/components/bottom-btn-group.vue
Normal file
81
entryManager/add/components/bottom-btn-group.vue
Normal file
@@ -0,0 +1,81 @@
|
||||
<template>
|
||||
<view v-if="isShow">
|
||||
<view class="zhanwei" :class="[direction == 'column' ? 'zhanwei1' : '']"></view>
|
||||
|
||||
<view class="fixed-bottom u-flex gap-20" :class="[direction == 'column' ? 'u-flex-column' : '']">
|
||||
<view class="u-flex-1">
|
||||
<my-button bgColor="#fff" type="default" @click="cancel" shape="circle">
|
||||
{{cancelText}}
|
||||
</my-button>
|
||||
</view>
|
||||
<view class="u-flex-1">
|
||||
<my-button type="primary" @click="save" shape="circle">
|
||||
{{confirmText}}
|
||||
</my-button>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
computed
|
||||
} from "vue";
|
||||
const emit = defineEmits(["save", "cancel"]);
|
||||
import {
|
||||
isMainShop
|
||||
} from "@/store/account.js";
|
||||
|
||||
const props = defineProps({
|
||||
isOpenPermission: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
cancelText:{
|
||||
type: String,
|
||||
default: "上一步",
|
||||
},
|
||||
confirmText:{
|
||||
type: String,
|
||||
default: "下一步",
|
||||
},
|
||||
//方向 row横向布局 column 纵向布局
|
||||
direction: {
|
||||
type: String,
|
||||
default: "row",
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
const isShow = computed(() => {
|
||||
if (props.isOpenPermission) {
|
||||
return isMainShop();
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
function save() {
|
||||
emit("save");
|
||||
}
|
||||
|
||||
function cancel() {
|
||||
emit("cancel");
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.zhanwei {
|
||||
height: 180rpx;
|
||||
}
|
||||
|
||||
.zhanwei1 {
|
||||
height: 240rpx;
|
||||
}
|
||||
|
||||
.fixed-bottom {
|
||||
&.u-flex-column {
|
||||
align-items: stretch;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
207
entryManager/add/components/business-licence-info.vue
Normal file
207
entryManager/add/components/business-licence-info.vue
Normal file
@@ -0,0 +1,207 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="u-font-32 font-bold u-m-32 text-center">营业执照信息</view>
|
||||
<view class="container">
|
||||
<view class="form-item " :class="isRequired">
|
||||
<view class="title"> 营业执照</view>
|
||||
<my-upload-img v-model="form.licensePic.url" :size="200"
|
||||
@uploadSuccess="uploadSuccess($event,'BusinessLicense')"></my-upload-img>
|
||||
</view>
|
||||
|
||||
<view class="form-item " :class="isRequired">
|
||||
<view class="title"> 营业执照全称</view>
|
||||
<up-input placeholder="营业执照全称" :placeholder-class="placeholderClass"
|
||||
v-model="form.licenceName"></up-input>
|
||||
</view>
|
||||
|
||||
<view class="form-item " :class="isRequired">
|
||||
<view class="title"> 营业执照号码</view>
|
||||
<up-input placeholder="营业执照号码" :placeholder-class="placeholderClass"
|
||||
v-model="form.licenceNo"></up-input>
|
||||
</view>
|
||||
|
||||
<view class="form-item " :class="isRequired">
|
||||
<view class="title"> 营业执照开始日期</view>
|
||||
<up-datetime-picker hasInput :minDate="minDate" :maxDate="dayjs().valueOf()" format="YYYY-MM-DD"
|
||||
placeholder="请选择" v-model="form.licenceStartDate" mode="date">
|
||||
</up-datetime-picker>
|
||||
<!-- <up-input placeholder="营业执照开始日期" :placeholder-class="placeholderClass"
|
||||
v-model="form.licenceStartDate"></up-input> -->
|
||||
</view>
|
||||
|
||||
<view class="form-item " :class="isRequired">
|
||||
<view class="title"> 营业执照结束日期</view>
|
||||
<view class="u-m-b-16">
|
||||
<up-radio-group v-model="licenceEndDateType">
|
||||
<up-radio :name="1" label="有结束日期"></up-radio>
|
||||
<up-radio :name="2" label="长期有效"></up-radio>
|
||||
</up-radio-group>
|
||||
</view>
|
||||
<template v-if="licenceEndDateType==1">
|
||||
<up-datetime-picker hasInput :minDate="form.licenceStartDate||minDate" :maxDate="maxDate"
|
||||
format="YYYY-MM-DD" placeholder="请选择" v-model="form.licenceEndDate" mode="date">
|
||||
</up-datetime-picker>
|
||||
</template>
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
<view class="form-item " :class="isRequired">
|
||||
<view class="title"> 营业执照注册地址</view>
|
||||
<up-input placeholder="营业执照注册地址" :placeholder-class="placeholderClass"
|
||||
v-model="form.registeredAddress"></up-input>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import dayjs from 'dayjs';
|
||||
const minDate = dayjs('1970-01-01 00:00:00').valueOf()
|
||||
const maxDate = dayjs('2099-12-31 23:59:59').valueOf()
|
||||
const licenceEndDateType = ref(1)
|
||||
import {
|
||||
reactive,
|
||||
watch,
|
||||
ref
|
||||
} from 'vue';
|
||||
import shopSelect from './shop-select.vue'
|
||||
import {
|
||||
userTypes,
|
||||
sexs,
|
||||
contactPersonTypes,
|
||||
companyChildTypes,
|
||||
certTypes
|
||||
} from '@/entryManager/data.js'
|
||||
const form = reactive({
|
||||
"licenceName": "",
|
||||
"licenceNo": "",
|
||||
"licenceStartDate": "",
|
||||
"licenceEndDate": "",
|
||||
"registeredAddress": "",
|
||||
"licensePic": {
|
||||
"url": "",
|
||||
"wechatId": "",
|
||||
"alipayId": ""
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
import {
|
||||
getInfoByImg
|
||||
} from '@/http/api/order/entryManager.js'
|
||||
import {
|
||||
includes
|
||||
} from 'lodash';
|
||||
|
||||
watch(() => licenceEndDateType.value, (newval) => {
|
||||
if (newval == 2) {
|
||||
form.licenceEndDate = maxDate
|
||||
} else {
|
||||
form.licenceEndDate = dayjs().add(10, 'year').valueOf()
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
function uploadSuccess(url, type, key) {
|
||||
uni.showLoading({
|
||||
type: '识别中,请稍等……!'
|
||||
})
|
||||
getInfoByImg({
|
||||
url,
|
||||
type
|
||||
}).then(res => {
|
||||
uni.hideLoading()
|
||||
if (res) {
|
||||
const data = res.subImages[0].kvInfo.data
|
||||
form.licenceName = data.companyName
|
||||
form.licenceNo = data.creditCode
|
||||
form.registeredAddress = data.businessAddress
|
||||
if (data.validFromDate) {
|
||||
form.licenceStartDate = dayjs(data.validFromDate).valueOf()
|
||||
}
|
||||
if (data.validToDate) {
|
||||
form.licenceEndDate = dayjs(data.validToDate).valueOf()
|
||||
}
|
||||
// console.log(dayjs(form.licenceEndDate).format('YYYY-MM-DD'));
|
||||
if (data.validPeriod.includes('长期')) {
|
||||
licenceEndDateType.value = 2;
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const placeholderClass = ref('u-font-28')
|
||||
|
||||
const isRequired = ref('required')
|
||||
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
watch(() => props.data, (newval) => {
|
||||
console.log('触发父数据更新')
|
||||
for (let key in form) {
|
||||
if (props.data.hasOwnProperty(key)) {
|
||||
form[key] = props.data[key]
|
||||
}
|
||||
}
|
||||
}, {
|
||||
deep: true,
|
||||
immediate: true
|
||||
})
|
||||
|
||||
const emits = defineEmits(['update'])
|
||||
watch(() => form, (newval) => {
|
||||
|
||||
emits('update', newval)
|
||||
}, {
|
||||
deep: true
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.container {
|
||||
padding: 32rpx 28rpx;
|
||||
border-radius: 16rpx;
|
||||
margin-bottom: 32rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.form-item {
|
||||
margin-bottom: 32rpx;
|
||||
|
||||
.title {
|
||||
font-weight: 700;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
&.required {
|
||||
.title::before {
|
||||
content: '*';
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.input-box {
|
||||
padding: 9px 10px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #dadbde;
|
||||
}
|
||||
</style>
|
||||
283
entryManager/add/components/legalPerpole-info.vue
Normal file
283
entryManager/add/components/legalPerpole-info.vue
Normal file
@@ -0,0 +1,283 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="u-font-32 font-bold u-m-32 text-center">法人信息</view>
|
||||
<view class="container">
|
||||
|
||||
|
||||
|
||||
|
||||
<view class="form-item required">
|
||||
<view class="title"> 身份证正面</view>
|
||||
<my-upload-img v-model="form.idCardFrontPic.url" :size="200" :maxSize="maxSize"
|
||||
@uploadSuccess="uploadSuccess($event,'IdCard','idCardFrontPic')"
|
||||
></my-upload-img>
|
||||
</view>
|
||||
<view class="form-item required">
|
||||
<view class="title"> 身份证反面</view>
|
||||
<my-upload-img v-model="form.idCardBackPic.url" :size="200" :maxSize="maxSize"
|
||||
@uploadSuccess="uploadSuccess($event,'IdCard','idCardBackPic')"
|
||||
></my-upload-img>
|
||||
</view>
|
||||
|
||||
<view class="form-item required">
|
||||
<view class="title"> 身份证手持 图片</view>
|
||||
<my-upload-img v-model="form.idCardHandPic.url" :size="200" :maxSize="maxSize"></my-upload-img>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="form-item required">
|
||||
<view class="title"> 法人姓名</view>
|
||||
<up-input placeholder="法人姓名" :placeholder-class="placeholderClass"
|
||||
v-model="form.legalPersonName"></up-input>
|
||||
</view>
|
||||
<view class="form-item required">
|
||||
<view class="title">法人性别</view>
|
||||
<up-radio-group v-model="form.legalGender">
|
||||
<up-radio v-for="(value,key) in sexs" :label="value" :name="key">
|
||||
</up-radio>
|
||||
</up-radio-group>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="form-item required">
|
||||
<view class="title"> 法人身份证号</view>
|
||||
<up-input placeholder="法人身份证号" :placeholder-class="placeholderClass"
|
||||
v-model="form.legalPersonId"></up-input>
|
||||
</view>
|
||||
<view class="form-item required">
|
||||
<view class="title"> 法人身份证开始日期</view>
|
||||
|
||||
<up-datetime-picker hasInput :minDate="minDate" :maxDate="dayjs().valueOf()" format="YYYY-MM-DD"
|
||||
placeholder="请选择" v-model="form.legalIdPersonStartDate" mode="date">
|
||||
</up-datetime-picker>
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
<view class="form-item required">
|
||||
<view class="title"> 法人身份证到期日期</view>
|
||||
|
||||
<view class="u-m-b-16">
|
||||
<up-radio-group v-model="endDateType">
|
||||
<up-radio :name="1" label="有结束日期"></up-radio>
|
||||
<up-radio :name="2" label="长期有效"></up-radio>
|
||||
</up-radio-group>
|
||||
</view>
|
||||
<template v-if="endDateType==1">
|
||||
<up-datetime-picker hasInput :minDate="endDataMinDate"
|
||||
:maxDate="maxDate" format="YYYY-MM-DD" placeholder="请选择"
|
||||
v-model="form.legalPersonIdEndDate" mode="date">
|
||||
</up-datetime-picker>
|
||||
</template>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="form-item required">
|
||||
<view class="title"> 法人电话</view>
|
||||
<up-input placeholder="法人电话" :placeholder-class="placeholderClass"
|
||||
v-model="form.legalPersonPhone"></up-input>
|
||||
</view>
|
||||
|
||||
<view class="form-item required">
|
||||
<view class="title">法人地址 </view>
|
||||
<up-input placeholder="法人地址" :placeholder-class="placeholderClass"
|
||||
v-model="form.legalAddress"></up-input>
|
||||
</view>
|
||||
|
||||
<view class="form-item required">
|
||||
<view class="title">法人邮箱 </view>
|
||||
<up-input placeholder="法人邮箱" :placeholder-class="placeholderClass"
|
||||
v-model="form.legalPersonEmail"></up-input>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
reactive,
|
||||
watch,computed ,
|
||||
ref
|
||||
} from 'vue';
|
||||
import shopSelect from './shop-select.vue'
|
||||
import {
|
||||
userTypes,
|
||||
sexs,
|
||||
contactPersonTypes,
|
||||
companyChildTypes,
|
||||
certTypes
|
||||
} from '@/entryManager/data.js'
|
||||
const form = reactive({
|
||||
"legalPersonName": "",
|
||||
"legalPersonId": "",
|
||||
"legalIdPersonStartDate":'',
|
||||
"legalPersonIdEndDate": '',
|
||||
"legalPersonPhone": "",
|
||||
"legalPersonEmail": "",
|
||||
"legalGender": "",
|
||||
"legalAddress": "",
|
||||
"idCardHandPic": {
|
||||
"url": "",
|
||||
"wechatId": "",
|
||||
"alipayId": ""
|
||||
},
|
||||
"idCardFrontPic": {
|
||||
"url": "",
|
||||
"wechatId": "",
|
||||
"alipayId": ""
|
||||
},
|
||||
"idCardBackPic": {
|
||||
"url": "",
|
||||
"wechatId": "",
|
||||
"alipayId": ""
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
import {
|
||||
getInfoByImg
|
||||
} from '@/http/api/order/entryManager.js'
|
||||
|
||||
|
||||
import dayjs from 'dayjs';
|
||||
import { includes } from 'lodash';
|
||||
const minDate = dayjs('1970-01-01 00:00:00').valueOf()
|
||||
const maxDate = dayjs('2099-12-31 23:59:59').valueOf()
|
||||
const endDataMinDate = computed(() => {
|
||||
if (!form.legalIdPersonStartDate) {
|
||||
return maxDate
|
||||
}
|
||||
if (form.legalIdPersonStartDate) {
|
||||
return dayjs(form.legalIdPersonStartDate).add(10, 'year').valueOf()
|
||||
}
|
||||
})
|
||||
|
||||
const endDateType = ref(1)
|
||||
watch(() => endDateType.value, (newval) => {
|
||||
if (newval == 2) {
|
||||
form.legalPersonIdEndDate = maxDate
|
||||
} else {
|
||||
form.legalPersonIdEndDate = dayjs().valueOf()
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function uploadSuccess(url, type, key) {
|
||||
uni.showLoading({
|
||||
type: '识别中,请稍等……!'
|
||||
})
|
||||
getInfoByImg({
|
||||
url,
|
||||
type
|
||||
}).then(res => {
|
||||
uni.hideLoading()
|
||||
if (res) {
|
||||
const data = res.subImages[0].kvInfo.data
|
||||
if (key == 'idCardBackPic') {
|
||||
if (data.validPeriod) {
|
||||
const [start, end] = data.validPeriod.split('-')
|
||||
if (start) {
|
||||
form.legalIdPersonStartDate = dayjs(start).valueOf()
|
||||
}
|
||||
if (end) {
|
||||
if (end.includes('长期')) {
|
||||
endDateType.value = 2
|
||||
} else {
|
||||
form.legalPersonIdEndDate = dayjs(end).valueOf()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if (key == 'idCardFrontPic') {
|
||||
form.legalPersonName = data.name
|
||||
form.legalPersonId = data.idNumber
|
||||
form.legalAddress = data.address
|
||||
if(data.sex.includes('男')){
|
||||
form.legalGender='0'
|
||||
}
|
||||
if(data.sex.includes('女')){
|
||||
form.legalGender='1'
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const placeholderClass = ref('u-font-28')
|
||||
|
||||
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
|
||||
}
|
||||
},
|
||||
maxSize:{
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
watch(() => props.data, (newval) => {
|
||||
for (let key in form) {
|
||||
if (props.data.hasOwnProperty(key)) {
|
||||
form[key] = props.data[key]
|
||||
}
|
||||
}
|
||||
}, {
|
||||
deep: true,
|
||||
immediate: true
|
||||
})
|
||||
|
||||
const emits = defineEmits(['update'])
|
||||
watch(() => form, (newval) => {
|
||||
emits('update', newval)
|
||||
}, {
|
||||
deep: true
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.container {
|
||||
padding: 32rpx 28rpx;
|
||||
border-radius: 16rpx;
|
||||
margin-bottom: 32rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.form-item {
|
||||
margin-bottom: 32rpx;
|
||||
|
||||
.title {
|
||||
font-weight: 700;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
&.required {
|
||||
.title::before {
|
||||
content: '*';
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
354
entryManager/add/components/settlement-info.vue
Normal file
354
entryManager/add/components/settlement-info.vue
Normal file
@@ -0,0 +1,354 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="u-font-32 font-bold u-m-32 text-center">结算信息</view>
|
||||
<view class="container">
|
||||
<view class="form-item ">
|
||||
<view class="title"> 结算类型</view>
|
||||
<up-radio-group v-model="form.settlementType">
|
||||
<up-radio v-for="(value,key) in settlementTypes" :label="value" :name="key">
|
||||
</up-radio>
|
||||
</up-radio-group>
|
||||
</view>
|
||||
|
||||
<template v-if="form.settlementType*1==0">
|
||||
<view class="form-item required">
|
||||
<view class="title"> 非法人手持结算授权书</view>
|
||||
<my-upload-img v-model="form.noLegalHandSettleAuthPic.url" :size="200"></my-upload-img>
|
||||
</view>
|
||||
|
||||
<view class="form-item required">
|
||||
<view class="title"> 非法人结算授权书</view>
|
||||
<my-upload-img v-model="form.noLegalSettleAuthPic.url" :size="200"></my-upload-img>
|
||||
</view>
|
||||
|
||||
<view class="form-item required">
|
||||
<view class="title"> 非法人身份证正面</view>
|
||||
<my-upload-img v-model="form.noLegalIdCardFrontPic.url" :size="200"></my-upload-img>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="form-item required">
|
||||
<view class="title"> 非法人身份证反面</view>
|
||||
<my-upload-img v-model="form.noLegalIdCardBackPic.url" :size="200"></my-upload-img>
|
||||
</view>
|
||||
|
||||
<view class="form-item required">
|
||||
<view class="title"> 非法人姓名
|
||||
</view>
|
||||
|
||||
<up-input placeholder="非法人姓名" :placeholder-class="placeholderClass"
|
||||
v-model="form.noLegalName"></up-input>
|
||||
</view>
|
||||
<view class="form-item required">
|
||||
<view class="title"> 非法人身份证号码
|
||||
</view>
|
||||
|
||||
<up-input placeholder="非法人身份证号码" :placeholder-class="placeholderClass"
|
||||
v-model="form.noLegalId"></up-input>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
<view class="form-item ">
|
||||
<view class="title"> 结算卡类型</view>
|
||||
<up-radio-group v-model="form.settlementCardType">
|
||||
<up-radio v-for="(value,key) in settlementCardTypes" :label="value" :name="key">
|
||||
</up-radio>
|
||||
</up-radio-group>
|
||||
</view>
|
||||
|
||||
<view class="form-item required">
|
||||
<view class="title"> 银行卡正面</view>
|
||||
<my-upload-img @uploadSuccess="uploadSuccess($event,'BankCard','bankCardFrontPic')"
|
||||
v-model="form.bankCardFrontPic.url" :size="200"></my-upload-img>
|
||||
</view>
|
||||
|
||||
<view class="form-item " :class="{required:form.settlementCardType==11}">
|
||||
<view class="title"> 银行卡反面</view>
|
||||
<my-upload-img v-model="form.bankCardBackPic.url" :size="200"></my-upload-img>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
<view class="form-item required">
|
||||
<view class="title"> 地区</view>
|
||||
<view class="input-box u-flex u-row-between u-col-center" @click="showCitySelect=true">
|
||||
<text class="color-999" v-if="!pro_city_area">请选择</text>
|
||||
<text class="color-333" v-else>{{pro_city_area}}</text>
|
||||
<up-icon name="arrow-down"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-item required">
|
||||
<view class="title"> 银行</view>
|
||||
<bankSelect v-model="form.bankName" v-model:bankInstId="form.bankInstId"></bankSelect>
|
||||
</view>
|
||||
<view class="form-item " v-if="pro_city_area&&form.bankName">
|
||||
<view class="title"> 支行</view>
|
||||
<bankBranchList :query="bankBranchListQuery" v-model:bankBranchName="form.bankBranchName"
|
||||
v-model:bankBranchCode="form.bankBranchCode"></bankBranchList>
|
||||
</view>
|
||||
<view class="form-item ">
|
||||
<view class="title"> 结算账户卡号</view>
|
||||
<up-input placeholder="结算账户卡号" :placeholder-class="placeholderClass"
|
||||
v-model="form.settlementCardNo"></up-input>
|
||||
</view>
|
||||
<view class="form-item ">
|
||||
<view class="title"> 结算账户户名</view>
|
||||
<up-input placeholder="结算账户户名" :placeholder-class="placeholderClass"
|
||||
v-model="form.settlementName"></up-input>
|
||||
</view>
|
||||
<view class="form-item ">
|
||||
<view class="title"> 结算银行预留手机号</view>
|
||||
<up-input placeholder="结算银行预留手机号" :placeholder-class="placeholderClass"
|
||||
v-model="form.bankMobile"></up-input>
|
||||
</view>
|
||||
<view class="form-item ">
|
||||
<view class="title"> 开户行行别名称</view>
|
||||
<up-input placeholder="开户行行别名称" :placeholder-class="placeholderClass"
|
||||
v-model="form.bankName"></up-input>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="form-item ">
|
||||
<view class="title"> 开户行缩写</view>
|
||||
<up-input placeholder="开户行缩写" :placeholder-class="placeholderClass"></up-input>
|
||||
</view>
|
||||
<view class="form-item ">
|
||||
<view class="title"> 开户行编号
|
||||
</view>
|
||||
<up-input placeholder="开户行编号" :placeholder-class="placeholderClass" v-model="form.bankType"></up-input>
|
||||
</view>
|
||||
<view class="form-item ">
|
||||
<view class="title"> 支行开户行行别名称
|
||||
|
||||
</view>
|
||||
<up-input placeholder="支行开户行行别名称" :placeholder-class="placeholderClass"
|
||||
v-model="form.bankBranchName"></up-input>
|
||||
</view>
|
||||
|
||||
<view class="form-item ">
|
||||
<view class="title"> 支行开户行编号
|
||||
|
||||
</view>
|
||||
<up-input placeholder="支行开户行编号" :placeholder-class="placeholderClass"
|
||||
v-model="form.bankBranchCode"></up-input>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
<view class="form-item ">
|
||||
<view class="title"> 开户许可证</view>
|
||||
<my-upload-img v-model="form.openAccountLicencePic.url" :size="200"></my-upload-img>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
<citySelect v-model="showCitySelect" @city-change="cityChange"></citySelect>
|
||||
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
computed,
|
||||
reactive,
|
||||
watch,
|
||||
ref
|
||||
} from 'vue';
|
||||
import shopSelect from './shop-select.vue'
|
||||
import citySelect from '../../components/u-city-select.vue'
|
||||
import bankSelect from './bank-select.vue'
|
||||
import bankBranchList from './bankBranchList.vue'
|
||||
import {
|
||||
userTypes,
|
||||
sexs,
|
||||
contactPersonTypes,
|
||||
companyChildTypes,
|
||||
settlementTypes,
|
||||
settlementCardTypes,
|
||||
certTypes
|
||||
} from '@/entryManager/data.js'
|
||||
import {
|
||||
getInfoByImg
|
||||
} from '@/http/api/order/entryManager.js'
|
||||
const showCitySelect = ref(false)
|
||||
const showBankSelect = ref(true)
|
||||
|
||||
function uploadSuccess(url, type, key) {
|
||||
uni.showLoading({
|
||||
type: '识别中,请稍等……!'
|
||||
})
|
||||
getInfoByImg({
|
||||
url,
|
||||
type
|
||||
}).then(res => {
|
||||
uni.hideLoading()
|
||||
if (res) {
|
||||
form.bankName = res.subImages[0].kvInfo.data.bankName
|
||||
form.settlementCardNo = res.subImages[0].kvInfo.data.cardNumber
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function basicSelectChange(e) {
|
||||
|
||||
}
|
||||
|
||||
function cityChange(e) {
|
||||
console.log('cityChange', e);
|
||||
form.openAccProvince = e.province.regionName;
|
||||
form.openAccCity = e.city.regionName;
|
||||
form.openAccArea = e.area.regionName;
|
||||
|
||||
form.openAccProvinceId = e.province.regionId;
|
||||
form.openAccCityId = e.city.regionId;
|
||||
form.openAccAreaId = e.area.regionId;
|
||||
console.log('form', form);
|
||||
}
|
||||
|
||||
const pro_city_area = computed(() => {
|
||||
if (form.openAccProvince && form.openAccCity && form.openAccArea) {
|
||||
const text = form.openAccProvince + '-' + form.openAccCity + '-' + form.openAccArea
|
||||
console.log('text', text);
|
||||
return text
|
||||
}
|
||||
return ''
|
||||
})
|
||||
const form = reactive({
|
||||
"settlementType": "0",
|
||||
"noLegalName": "",
|
||||
"noLegalId": "",
|
||||
"settlementCardType": "11",
|
||||
"settlementCardNo": "",
|
||||
"settlementName": "",
|
||||
"bankMobile": "",
|
||||
"openAccProvinceId": "",
|
||||
"openAccCityId": "",
|
||||
"openAccAreaId": "",
|
||||
"openAccProvince": "",
|
||||
"openAccCity": "",
|
||||
"openAccArea": "",
|
||||
"bankName": "",
|
||||
"bankInstId": "",
|
||||
"bankType": "",
|
||||
"bankBranchName": "",
|
||||
"bankBranchCode": "",
|
||||
"bankCardFrontPic": {
|
||||
"url": "",
|
||||
"wechatId": "",
|
||||
"alipayId": ""
|
||||
},
|
||||
"bankCardBackPic": {
|
||||
"url": "",
|
||||
"wechatId": "",
|
||||
"alipayId": ""
|
||||
},
|
||||
"openAccountLicencePic": {
|
||||
"url": "",
|
||||
"wechatId": "",
|
||||
"alipayId": ""
|
||||
},
|
||||
"noLegalHandSettleAuthPic": {
|
||||
"url": "",
|
||||
"wechatId": "",
|
||||
"alipayId": ""
|
||||
},
|
||||
"noLegalSettleAuthPic": {
|
||||
"url": "",
|
||||
"wechatId": "",
|
||||
"alipayId": ""
|
||||
},
|
||||
"noLegalIdCardFrontPic": {
|
||||
"url": "",
|
||||
"wechatId": "",
|
||||
"alipayId": ""
|
||||
},
|
||||
"noLegalIdCardBackPic": {
|
||||
"url": "",
|
||||
"wechatId": "",
|
||||
"alipayId": ""
|
||||
}
|
||||
})
|
||||
const placeholderClass = ref('u-font-28')
|
||||
|
||||
const isRequired = ref('required')
|
||||
const bankBranchListQuery = computed(() => {
|
||||
return {
|
||||
province: form.openAccProvince,
|
||||
city: form.openAccCity,
|
||||
instId: form.bankInstId,
|
||||
}
|
||||
})
|
||||
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
watch(() => props.data, (newval) => {
|
||||
console.log('watch 变', newval);
|
||||
|
||||
for (let key in form) {
|
||||
if (props.data.hasOwnProperty(key)) {
|
||||
form[key] = props.data[key]
|
||||
}
|
||||
}
|
||||
console.log(form);
|
||||
}, {
|
||||
deep: true,immediate:true
|
||||
})
|
||||
|
||||
const emits = defineEmits(['update'])
|
||||
watch(() => form, (newval) => {
|
||||
emits('update', newval)
|
||||
}, {
|
||||
deep: true
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.container {
|
||||
padding: 32rpx 28rpx;
|
||||
border-radius: 16rpx;
|
||||
margin-bottom: 32rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.form-item {
|
||||
margin-bottom: 32rpx;
|
||||
|
||||
.title {
|
||||
font-weight: 700;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
&.required {
|
||||
.title::before {
|
||||
content: '*';
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.input-box {
|
||||
padding: 10px 10px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #dadbde;
|
||||
}
|
||||
</style>
|
||||
165
entryManager/add/components/shop-select.vue
Normal file
165
entryManager/add/components/shop-select.vue
Normal file
@@ -0,0 +1,165 @@
|
||||
<template>
|
||||
<view>
|
||||
|
||||
<view class="box" @click.stop="openPopup">
|
||||
<text class="u-font-28 color-999 u-p-r-16" v-if="!modelValue">请选择</text>
|
||||
<text class="u-font-28 color-333 u-p-r-16" v-else>{{returnLabel()}}</text>
|
||||
<view class="icon">
|
||||
<up-icon name="arrow-down" size="14" color="#999"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
<up-popup :show="show" placement="bottom" round="18rpx" closeOnClickOverlay @close="close">
|
||||
<view class="u-p-30">
|
||||
<view class="font-bold color-333 u-font-32">选择门店</view>
|
||||
<scroll-view scroll-with-animation :scroll-into-view="selShopId" class="scroll-view u-m-t-30"
|
||||
scroll-y="true" style="max-height :60vh;">
|
||||
<view class="u-m-b-10 u-flex item" v-for="item in list" :key="item.shopId" @click="itemClick(item)"
|
||||
:id="'shop_'+item.shopId" :class="{active:modelValue==item.shopId}">
|
||||
<view class="checkbox">
|
||||
<up-icon name="checkbox-mark" color="#fff"></up-icon>
|
||||
</view>
|
||||
<view class="u-flex-1">{{item.shopName}}</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="u-flex gap-20 u-m-t-30">
|
||||
<view class="u-flex-1">
|
||||
<my-button type="default" @click="close">取消</my-button>
|
||||
</view>
|
||||
<view class="u-flex-1">
|
||||
<my-button type="primary" @click="submit">确定</my-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</up-popup>
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import {
|
||||
computed,
|
||||
onMounted,
|
||||
reactive,
|
||||
ref,
|
||||
watch
|
||||
} from 'vue';
|
||||
import {
|
||||
adminShopList
|
||||
} from '@/http/api/shop.js';
|
||||
|
||||
const customStyle = ref({
|
||||
marginRight: '20px'
|
||||
});
|
||||
|
||||
const show = ref(false);
|
||||
let modelValue = defineModel('modelValue', {
|
||||
default: '',
|
||||
});
|
||||
|
||||
const selShopId = ref('')
|
||||
|
||||
function returnLabel() {
|
||||
const findShop = list.value.find(v => v.shopId == modelValue.value)
|
||||
return findShop ? findShop.shopName : ''
|
||||
}
|
||||
|
||||
function itemClick(shop) {
|
||||
modelValue.value = shop.shopId
|
||||
}
|
||||
|
||||
function returnShopName(shopId) {
|
||||
const item = list.value.find((v) => v.shopId == shopId);
|
||||
return item?.shopName || '';
|
||||
}
|
||||
|
||||
function close() {
|
||||
show.value = false;
|
||||
}
|
||||
|
||||
function submit() {
|
||||
show.value = false;
|
||||
}
|
||||
|
||||
|
||||
const list = ref([]);
|
||||
|
||||
function openPopup() {
|
||||
selShopId.value = 'shop_' + modelValue.value
|
||||
show.value = true;
|
||||
|
||||
}
|
||||
async function init() {
|
||||
const res = await adminShopList({
|
||||
page: 1,
|
||||
size: 99999
|
||||
});
|
||||
if (res) {
|
||||
list.value = res.records.map((item) => ({
|
||||
shopId: item.id,
|
||||
shopName: item.shopName,
|
||||
}));
|
||||
}
|
||||
}
|
||||
onMounted(init);
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.box {
|
||||
border-radius: 8upx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: top;
|
||||
flex-wrap: wrap;
|
||||
padding: 10rpx 24rpx;
|
||||
border: 2rpx solid #e5e5e5;
|
||||
position: relative;
|
||||
|
||||
.icon {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 24rpx;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
}
|
||||
|
||||
.shop-item {
|
||||
padding: 4rpx 8rpx 4rpx 16rpx;
|
||||
border-radius: 4rpx;
|
||||
border: 2rpx solid #f0f0f0;
|
||||
background-color: #f5f5f5;
|
||||
margin-bottom: 16rpx;
|
||||
margin-left: 16rpx;
|
||||
}
|
||||
|
||||
.scroll-view {
|
||||
.item {
|
||||
border: 1px solid #eee;
|
||||
padding: 20rpx;
|
||||
border-radius: 12rpx;
|
||||
|
||||
&.active {
|
||||
border-color: $my-main-color;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.checkbox {
|
||||
margin-right: 10rpx;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 6rpx;
|
||||
border: 1px solid #999;
|
||||
|
||||
}
|
||||
|
||||
.item {
|
||||
&.active {
|
||||
.checkbox {
|
||||
background-color: $my-main-color;
|
||||
border-color: $my-main-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
180
entryManager/add/components/steps.vue
Normal file
180
entryManager/add/components/steps.vue
Normal file
@@ -0,0 +1,180 @@
|
||||
<template>
|
||||
<scroll-view scroll-x="true" scroll-with-animation :scroll-left="scrollLeft" class="steps-scroll-container"
|
||||
ref="scrollViewRef">
|
||||
<view class="steps-content" ref="contentRef">
|
||||
<view v-for="(item,index) in list" class="step-item" :key="index" :data-index="index" ref="stepItemRefs">
|
||||
<view class="step-inner">
|
||||
<view class="index" :class="{active:index<=cur}">
|
||||
<text>{{index+1}}</text>
|
||||
</view>
|
||||
<view class="step-text color-999" :class="{'color-main':index<=cur}" @click="handleClick(index)">
|
||||
{{item}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="step-arrow" v-if="index!=list.length-1">
|
||||
<up-icon name="arrow-rightward" size="16" :color="isActive(index)?'#318AFE':'#999'"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref,
|
||||
nextTick,
|
||||
getCurrentInstance
|
||||
} from 'vue';
|
||||
|
||||
const cur = defineModel({
|
||||
default:0
|
||||
})
|
||||
const scrollLeft = ref(0)
|
||||
const scrollViewRef = ref(null)
|
||||
const contentRef = ref(null) // 内容容器ref
|
||||
const stepItemRefs = ref([]) // 步骤项ref数组
|
||||
const instance = getCurrentInstance()
|
||||
|
||||
function isActive(index) {
|
||||
return cur.value === index
|
||||
}
|
||||
|
||||
// 核心:精准居中计算(基于元素相对于内容容器的偏移)
|
||||
const calcScrollCenter = (index) => {
|
||||
nextTick(async () => {
|
||||
try {
|
||||
const query = uni.createSelectorQuery().in(instance)
|
||||
|
||||
// 1. 获取滚动容器宽度
|
||||
const [scrollViewRect] = await new Promise(resolve => {
|
||||
query.select('.steps-scroll-container').boundingClientRect(rect => resolve([
|
||||
rect
|
||||
])).exec()
|
||||
})
|
||||
const scrollViewWidth = scrollViewRect?.width || 0
|
||||
|
||||
// 2. 获取当前步骤项的布局信息
|
||||
const [itemRect] = await new Promise(resolve => {
|
||||
query.select(`.step-item[data-index="${index}"]`).boundingClientRect(rect =>
|
||||
resolve([rect])).exec()
|
||||
})
|
||||
|
||||
// 3. 获取内容容器的布局信息
|
||||
const [contentRect] = await new Promise(resolve => {
|
||||
query.select('.steps-content').boundingClientRect(rect => resolve([rect]))
|
||||
.exec()
|
||||
})
|
||||
|
||||
if (!itemRect || !contentRect) return
|
||||
|
||||
// 关键修正:元素相对于内容容器的左偏移(而非视口)
|
||||
const itemOffsetLeft = itemRect.left - contentRect.left
|
||||
// 居中公式:滚动距离 = 元素偏移 - (容器宽度/2) + (元素宽度/2)
|
||||
let targetScrollLeft = itemOffsetLeft - (scrollViewWidth / 2) + (itemRect.width / 2)
|
||||
|
||||
// 4. 计算最大可滚动距离(边界限制)
|
||||
const maxScrollLeft = Math.max(0, contentRect.width - scrollViewWidth)
|
||||
// 限制滚动范围,避免超出边界
|
||||
targetScrollLeft = Math.max(0, Math.min(targetScrollLeft, maxScrollLeft))
|
||||
|
||||
// 5. 设置滚动距离(强制整数,避免小数导致的偏移)
|
||||
scrollLeft.value = Math.round(targetScrollLeft)
|
||||
} catch (e) {
|
||||
console.error('计算居中失败:', e)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 点击事件
|
||||
const handleClick = (index) => {
|
||||
if (cur.value === index) return
|
||||
cur.value = index
|
||||
calcScrollCenter(index)
|
||||
}
|
||||
|
||||
// 初始化居中
|
||||
nextTick(() => {
|
||||
calcScrollCenter(cur.value)
|
||||
})
|
||||
|
||||
// 步骤列表
|
||||
const list = ref(['基础信息', '法人信息', '营业执照信息', '门店信息', '结算信息'])
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
// 滚动容器:固定宽度,隐藏滚动条
|
||||
.steps-scroll-container {
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
box-sizing: border-box;
|
||||
overflow-x: auto;
|
||||
|
||||
// 隐藏滚动条(三端兼容)
|
||||
::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
-ms-overflow-style: none;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
|
||||
// 内容容器:inline-flex,宽度自适应
|
||||
.steps-content {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 10rpx 0;
|
||||
}
|
||||
|
||||
// 单个步骤项:统一间距和布局
|
||||
.step-item {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
margin: 0 10rpx; // 统一间距
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
// 步骤内部布局
|
||||
.step-inner {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
// 数字索引
|
||||
.index {
|
||||
border: 1px solid #999;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 50%;
|
||||
margin-right: 10rpx;
|
||||
color: #999;
|
||||
|
||||
&.active {
|
||||
border-color: $my-main-color;
|
||||
color: $my-main-color;
|
||||
}
|
||||
}
|
||||
|
||||
// 步骤文字
|
||||
.step-text {
|
||||
white-space: nowrap;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
// 箭头容器
|
||||
.step-arrow {
|
||||
padding: 0 10rpx;
|
||||
margin-top: 2rpx;
|
||||
}
|
||||
|
||||
// 样式补充
|
||||
.color-main {
|
||||
color: $my-main-color !important;
|
||||
}
|
||||
|
||||
.color-999 {
|
||||
color: #999;
|
||||
}
|
||||
</style>
|
||||
178
entryManager/add/components/store-info.vue
Normal file
178
entryManager/add/components/store-info.vue
Normal file
@@ -0,0 +1,178 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="u-font-32 font-bold u-m-32 text-center">门店信息</view>
|
||||
<view class="container">
|
||||
<view class="form-item required">
|
||||
<view class="title"> 归属地</view>
|
||||
<view class="input-box u-flex u-row-between u-col-center" @click="showCitySelect=true">
|
||||
<text class="color-999" v-if="!pro_city_area">请选择</text>
|
||||
<text class="color-333" v-else>{{pro_city_area}}</text>
|
||||
<up-icon name="arrow-down"></up-icon>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
<view class="form-item required">
|
||||
<view class="title"> 营业地址</view>
|
||||
|
||||
<up-input placeholder="营业地址" :placeholder-class="placeholderClass"
|
||||
v-model="form.businessAddress"></up-input>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<view class="form-item required">
|
||||
<view class="title"> 经营场所内设照片</view>
|
||||
<my-upload-img v-model="form.insidePic.url" :size="200"></my-upload-img>
|
||||
</view>
|
||||
<view class="form-item required">
|
||||
<view class="title"> 门头照</view>
|
||||
<my-upload-img v-model="form.doorPic.url" :size="200"></my-upload-img>
|
||||
</view>
|
||||
<view class="form-item required">
|
||||
<view class="title"> 收银台照片</view>
|
||||
<my-upload-img v-model="form.cashierDeskPic.url" :size="200"></my-upload-img>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
<citySelect v-model="showCitySelect" @city-change="cityChange"></citySelect>
|
||||
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
computed,
|
||||
reactive,
|
||||
ref,watch
|
||||
} from 'vue';
|
||||
import shopSelect from './shop-select.vue'
|
||||
import citySelect from '../../components/u-city-select.vue'
|
||||
import {
|
||||
userTypes,
|
||||
sexs,
|
||||
contactPersonTypes,
|
||||
companyChildTypes,
|
||||
certTypes
|
||||
} from '@/entryManager/data.js'
|
||||
const showCitySelect = ref(false)
|
||||
|
||||
function cityChange(e) {
|
||||
console.log('cityChange', e);
|
||||
form.mercProv = e.province.regionName;
|
||||
form.mercCity = e.city.regionName;
|
||||
form.mercArea = e.area.regionName;
|
||||
|
||||
form.mercProvCode = e.province.regionId;
|
||||
form.mercCityCode = e.city.regionId;
|
||||
form.mercAreaCode = e.area.regionId;
|
||||
console.log('form', form);
|
||||
}
|
||||
|
||||
const pro_city_area = computed(() => {
|
||||
if (form.mercProv && form.mercCity && form.mercArea) {
|
||||
const text = form.mercProv + '-' + form.mercCity + '-' + form.mercArea
|
||||
console.log('text', text);
|
||||
return text
|
||||
}
|
||||
return ''
|
||||
})
|
||||
const form = reactive({
|
||||
"mercProvCode": "",
|
||||
"mercCityCode": "",
|
||||
"mercAreaCode": "",
|
||||
"mercProv": "",
|
||||
"mercCity": "",
|
||||
"mercArea": "",
|
||||
"businessAddress": "",
|
||||
"insidePic": {
|
||||
"url": "",
|
||||
"wechatId": "",
|
||||
"alipayId": ""
|
||||
},
|
||||
"doorPic": {
|
||||
"url": "",
|
||||
"wechatId": "",
|
||||
"alipayId": ""
|
||||
},
|
||||
"cashierDeskPic": {
|
||||
"url": "",
|
||||
"wechatId": "",
|
||||
"alipayId": ""
|
||||
}
|
||||
})
|
||||
|
||||
const placeholderClass = ref('u-font-28')
|
||||
|
||||
const isRequired = ref('required')
|
||||
|
||||
|
||||
|
||||
const props=defineProps({
|
||||
data:{
|
||||
type:Object,
|
||||
default:()=>{
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
watch(()=>props.data,(newval)=>{
|
||||
for(let key in form){
|
||||
if(props.data.hasOwnProperty(key)){
|
||||
form[key]=props.data[key]
|
||||
}
|
||||
}
|
||||
},{
|
||||
deep:true,immediate:true
|
||||
})
|
||||
|
||||
const emits=defineEmits(['update'])
|
||||
watch(()=>form,(newval)=>{
|
||||
emits('update',newval)
|
||||
},{
|
||||
deep:true
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.container {
|
||||
padding: 32rpx 28rpx;
|
||||
border-radius: 16rpx;
|
||||
margin-bottom: 32rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.form-item {
|
||||
margin-bottom: 32rpx;
|
||||
|
||||
.title {
|
||||
font-weight: 700;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
&.required {
|
||||
.title::before {
|
||||
content: '*';
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.input-box {
|
||||
padding: 10px 10px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #dadbde;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user