初始上传
This commit is contained in:
208
addon/cashier/source/os/pages/store/acccount_record.vue
Executable file
208
addon/cashier/source/os/pages/store/acccount_record.vue
Executable file
@@ -0,0 +1,208 @@
|
||||
<template>
|
||||
<base-page>
|
||||
<view class="manage">
|
||||
<view class="title-back flex items-center cursor-pointer" @click="backFn">
|
||||
<text class="iconfont iconqianhou1"></text>
|
||||
<text class="left">返回</text>
|
||||
<text class="content">|</text>
|
||||
<text>账户记录</text>
|
||||
</view>
|
||||
<view class="screen-warp common-form">
|
||||
<view class="common-form-item">
|
||||
<view class="form-inline goods-category">
|
||||
<label class="form-label">来源方式</label>
|
||||
<view class="form-input-inline">
|
||||
<select-lay :zindex="10" :value="screen.from_type" name="names" placeholder="请选择来源方式" :options="fromType" @selectitem="selectFromType"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-inline">
|
||||
<label class="form-label">发生时间</label>
|
||||
<view class="form-input-inline">
|
||||
<uni-datetime-picker v-model="screen.start_date" type="datetime" placeholder="请选择开始时间" :clearIcon="false" />
|
||||
</view>
|
||||
<view class="form-input-inline">
|
||||
<uni-datetime-picker v-model="screen.end_date" type="datetime" placeholder="请选择结束时间" :clearIcon="false" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-inline">
|
||||
<label class="form-label">备注</label>
|
||||
<view class="form-input-inline">
|
||||
<input type="text" v-model="screen.remark" placeholder="请输入备注" class="form-input" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="common-form-item">
|
||||
<view class="form-inline common-btn-wrap">
|
||||
<button type="default" class="screen-btn" @click="search()">筛选</button>
|
||||
<button type="default" @click="reset()">重置</button>
|
||||
<button type="default" class="screen-btn" @click="exportRecord()">导出</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<uni-data-table url="/store/storeapi/account/pages" :cols="cols" ref="table">
|
||||
<template v-slot:action="data">
|
||||
<view class="common-table-action" v-if="data.value.from_type == 'order' || data.value.from_type == 'refund'"><text @click="detail(data)">查看详情</text></view>
|
||||
</template>
|
||||
</uni-data-table>
|
||||
</view>
|
||||
</base-page>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getAccountScreen,
|
||||
accountExport,
|
||||
} from '@/api/settlement.js';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
screen: {
|
||||
page: 1,
|
||||
start_date: '',
|
||||
end_date: '',
|
||||
from_type: '',
|
||||
remark: '',
|
||||
},
|
||||
userList: [],
|
||||
cols: [{
|
||||
width: 12,
|
||||
title: '来源方式',
|
||||
field: 'type_name',
|
||||
align: 'left'
|
||||
}, {
|
||||
width: 12,
|
||||
title: '记录金额',
|
||||
field: 'account_data',
|
||||
align: 'right'
|
||||
}, {
|
||||
width: 18,
|
||||
title: '发生时间',
|
||||
align: 'center',
|
||||
return: data => {
|
||||
return data.create_time ? this.$util.timeFormat(data.create_time) : '';
|
||||
}
|
||||
}, {
|
||||
width: 48,
|
||||
title: '备注',
|
||||
field: 'remark',
|
||||
align: 'left'
|
||||
},{
|
||||
width: 10,
|
||||
title: '操作',
|
||||
action: true, // 表格操作列
|
||||
align: 'right'
|
||||
}],
|
||||
fromType: [],
|
||||
withdrawDetail: null
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.getScreenContent();
|
||||
},
|
||||
methods: {
|
||||
detail(data){
|
||||
if(window.location.origin.indexOf('localhost') != -1){
|
||||
window.open(window.location.origin+'/cashregister/pages/order/orderlist?order_no='+data.value.related_info.order_no+'&order_from='+data.value.related_info.order_from,'_blank');
|
||||
}else{
|
||||
window.open(this.$config.baseUrl+'/cashregister/pages/order/orderlist?order_no='+data.value.related_info.order_no+'&order_from='+data.value.related_info.order_from,'_blank');
|
||||
}
|
||||
},
|
||||
switchStoreAfter() {
|
||||
this.screen = {
|
||||
page: 1,
|
||||
start_date: '',
|
||||
end_date: ''
|
||||
};
|
||||
this.$refs.table.load();
|
||||
},
|
||||
search() {
|
||||
this.$refs.table.load(this.screen);
|
||||
},
|
||||
reset() {
|
||||
this.screen = {
|
||||
page: 1,
|
||||
start_date: '',
|
||||
end_date: '',
|
||||
from_type: '',
|
||||
remark: '',
|
||||
};
|
||||
},
|
||||
getScreenContent() {
|
||||
getAccountScreen().then(res => {
|
||||
if (res.code == 0) {
|
||||
this.fromType = Object.keys(res.data.from_type_list).map(index => {
|
||||
return {
|
||||
value: index,
|
||||
label: res.data.from_type_list[index].type_name
|
||||
};
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
selectFromType(index) {
|
||||
this.screen.from_type = index == -1 ? '' : this.fromType[index].value;
|
||||
this.$forceUpdate();
|
||||
},
|
||||
backFn() {
|
||||
this.$util.redirectTo('/pages/store/settlement');
|
||||
},
|
||||
exportRecord() {
|
||||
accountExport(this.screen).then(res => {
|
||||
if (res.code == 0) {
|
||||
window.open(this.$util.img(res.data.path));
|
||||
}else{
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.manage {
|
||||
position: relative;
|
||||
background-color: #fff;
|
||||
padding: 0.15rem;
|
||||
height: 100vh;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
// 筛选面板
|
||||
.screen-warp {
|
||||
padding: 0.15rem;
|
||||
background-color: #f2f3f5;
|
||||
margin-bottom: 0.15rem;
|
||||
display: flex;
|
||||
justify-content: start;
|
||||
flex-direction: column;
|
||||
|
||||
/deep/ .uni-date-x {
|
||||
height: 0.35rem;
|
||||
}
|
||||
|
||||
/deep/ .uni-select-lay {
|
||||
background: #fff;
|
||||
|
||||
.uni-select-lay-select {
|
||||
height: 0.37rem;
|
||||
}
|
||||
}
|
||||
|
||||
.primary-btn {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
&>* {
|
||||
margin-right: 0.15rem;
|
||||
}
|
||||
|
||||
.common-btn-wrap button{
|
||||
margin-right: .1rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
57
addon/cashier/source/os/pages/store/close.vue
Executable file
57
addon/cashier/source/os/pages/store/close.vue
Executable file
@@ -0,0 +1,57 @@
|
||||
<template>
|
||||
<base-page>
|
||||
<view class="empty-box">
|
||||
<image src="@/static/cashier/store-close.png" mode="widthFix" />
|
||||
<view>门店已停业</view>
|
||||
<button class="btn" @click="$util.redirectTo('/pages/login/login')">返回</button>
|
||||
</view>
|
||||
</base-page>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
onLoad() {},
|
||||
onShow() {},
|
||||
methods: {}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.empty-box {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
background-color: #ffffff;
|
||||
z-index: 10000;
|
||||
|
||||
image {
|
||||
width: 3rem;
|
||||
height: 3rem;
|
||||
max-height: 3rem;
|
||||
}
|
||||
|
||||
view {
|
||||
text-align: center;
|
||||
font-size: 0.16rem;
|
||||
color: $primary-color;
|
||||
margin: 0 0 0.3rem;
|
||||
}
|
||||
|
||||
button {
|
||||
background-color: #fff;
|
||||
color: $primary-color;
|
||||
border: 0.01rem solid $primary-color;
|
||||
font-size: 0.165rem;
|
||||
width: 1rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
409
addon/cashier/source/os/pages/store/config.vue
Executable file
409
addon/cashier/source/os/pages/store/config.vue
Executable file
@@ -0,0 +1,409 @@
|
||||
<template>
|
||||
<base-page>
|
||||
<view class="store-config">
|
||||
<view class="common-wrap common-form fixd common-scrollbar">
|
||||
<view class="common-title">门店设置</view>
|
||||
<view class="common-form-item">
|
||||
<label class="form-label">门店名称</label>
|
||||
<view class="form-input-inline">
|
||||
<input type="text" v-model="storeData.store_name" class="form-input" />
|
||||
</view>
|
||||
<text class="form-word-aux-line">门店的名称(招牌)</text>
|
||||
</view>
|
||||
<view class="common-form-item store-img">
|
||||
<label class="form-label">门店图片</label>
|
||||
<view class="form-input-inline upload-box" @click="addImg">
|
||||
<view class="upload" v-if="storeData.store_image">
|
||||
<image :src="$util.img(storeData.store_image)" @error="$util.img(defaultImg.store)" mode="heightFix" />
|
||||
</view>
|
||||
<view class="upload" v-else>
|
||||
<text class="iconfont iconyunshangchuan"></text>
|
||||
<view>点击上传</view>
|
||||
</view>
|
||||
</view>
|
||||
<text class="form-word-aux-line">门店图片在PC及移动端对应页面及列表作为门店标志出现。建议图片尺寸:100 * 100像素,图片格式:jpg、png、jpeg。</text>
|
||||
</view>
|
||||
|
||||
<view class="common-form-item">
|
||||
<label class="form-label">门店类型</label>
|
||||
<view class="form-inline">
|
||||
<radio-group @change="storeTypeChange" class="form-radio-group">
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="directsale" :checked="storeData.store_type == 'directsale'" />
|
||||
直营店
|
||||
</label>
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="franchise" :checked="storeData.store_type == 'franchise'" />
|
||||
加盟店
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="common-form-item" v-if="category.status">
|
||||
<label class="form-label">门店分类</label>
|
||||
<view class="form-input-inline">
|
||||
<uni-data-select v-model="storeData.category_id" :localdata="category.list"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="common-form-item" v-if="label.length">
|
||||
<label class="form-label">门店标签</label>
|
||||
<view class="form-block">
|
||||
<checkbox-group class="form-checkbox-group" @change="labelChange">
|
||||
<label class="form-checkbox-item" v-for="(item, index) in label">
|
||||
<checkbox :value="item.label_id.toString()" :checked="labelChecked(item)" />
|
||||
{{ item.label_name }}
|
||||
</label>
|
||||
</checkbox-group>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="common-form-item">
|
||||
<label class="form-label">门店电话</label>
|
||||
<view class="form-input-inline">
|
||||
<input type="number" v-model="storeData.telphone" class="form-input" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="common-form-item">
|
||||
<label class="form-label">门店地址</label>
|
||||
<view class="form-inline">
|
||||
<pick-regions ref="selectArea" :default-regions="defaultRegions" @getRegions="handleGetRegions">
|
||||
<view class="form-input-inline long">
|
||||
<view class="form-input">{{ storeData.full_address }}</view>
|
||||
</view>
|
||||
</pick-regions>
|
||||
</view>
|
||||
</view>
|
||||
<view class="common-form-item">
|
||||
<label class="form-label"></label>
|
||||
<view class="form-inline">
|
||||
<view class="form-input-inline long">
|
||||
<input type="text" v-model="storeData.address" class="form-input" />
|
||||
</view>
|
||||
<view class="form-input-inline short btn" @click="getLatLng()">查找</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="common-form-item store-img">
|
||||
<label class="form-label">地图定位</label>
|
||||
<view class="form-inline">
|
||||
<view class="map-box">
|
||||
<image src="@/static/location.png" class="map-icon" />
|
||||
<map style="width: 100%; height: 100%;" :latitude="storeData.latitude" :longitude="storeData.longitude" :markers="covers" @markertap="markertap" @regionchange="tap"></map>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="common-btn-wrap">
|
||||
<button type="default" class="screen-btn" @click="saveFn">保存</button>
|
||||
<button type="default" @click="$util.redirectTo('/pages/store/index')">返回</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</base-page>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
editStore,
|
||||
getAllStoreCategory,
|
||||
getAllStoreLabel
|
||||
} from '@/api/store.js'
|
||||
import { getAddressByName, getTranAddressInfo } from '@/api/address.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
storeData: {},
|
||||
covers: [{
|
||||
latitude: 39.909,
|
||||
longitude: 116.39742,
|
||||
iconPath: '/static/location.png'
|
||||
}],
|
||||
defaultRegions: [],
|
||||
category: {
|
||||
status: 0,
|
||||
list: []
|
||||
},
|
||||
label: [],
|
||||
labelData: {}
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.getLabel();
|
||||
this.getCategory();
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
this.storeData = this.$util.deepClone(this.globalStoreInfo);
|
||||
this.storeData.start_time = this.timeFormat(this.storeData.start_time);
|
||||
this.storeData.end_time = this.timeFormat(this.storeData.end_time);
|
||||
this.defaultRegions = [this.storeData.province_id, this.storeData.city_id, this.storeData.district_id];
|
||||
this.$nextTick(() => {
|
||||
this.$refs.selectArea.handleDefaultRegions();
|
||||
});
|
||||
},
|
||||
getLabel() {
|
||||
getAllStoreLabel().then(res => {
|
||||
if (res.code == 0) {
|
||||
this.label = res.data;
|
||||
let labelData = {};
|
||||
res.data.forEach(item => {
|
||||
labelData[item.label_id] = item.label_name;
|
||||
});
|
||||
this.labelData = labelData;
|
||||
}
|
||||
});
|
||||
},
|
||||
getCategory() {
|
||||
getAllStoreCategory().then(res => {
|
||||
if (res.code == 0) {
|
||||
this.category.status = res.data.status;
|
||||
this.category.list = res.data.list.map(item => {
|
||||
return {
|
||||
value: item.category_id,
|
||||
text: item.category_name
|
||||
};
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
addImg() {
|
||||
this.$util.upload(1, {
|
||||
path: 'image'
|
||||
}, res => {
|
||||
if (res.length > 0) {
|
||||
this.storeData.store_image = res[0];
|
||||
this.$forceUpdate();
|
||||
}
|
||||
});
|
||||
},
|
||||
tap(e) {
|
||||
if (e.detail && e.detail.centerLocation) {
|
||||
this.storeData.latitude = e.detail.centerLocation.latitude;
|
||||
this.storeData.longitude = e.detail.centerLocation.longitude;
|
||||
this.covers = [{
|
||||
latitude: this.storeData.latitude,
|
||||
longitude: this.storeData.longitude,
|
||||
iconPath: '/static/location.png'
|
||||
}];
|
||||
this.getAddress();
|
||||
this.$forceUpdate();
|
||||
}
|
||||
},
|
||||
handleGetRegions(regions) {
|
||||
this.storeData.full_address = '';
|
||||
this.storeData.full_address += regions[0] != undefined ? regions[0].label : '';
|
||||
this.storeData.full_address += regions[1] != undefined ? '-' + regions[1].label : '';
|
||||
this.storeData.full_address += regions[2] != undefined ? '-' + regions[2].label : '';
|
||||
|
||||
this.storeData.province_id = regions[0] != undefined ? regions[0].value : '';
|
||||
this.storeData.city_id = regions[1] != undefined ? regions[1].value : '';
|
||||
this.storeData.district_id = regions[2] != undefined ? regions[2].value : '';
|
||||
this.defaultRegions = [this.storeData.province_id, this.storeData.city_id, this.storeData.district_id];
|
||||
this.$forceUpdate();
|
||||
this.getLatLng();
|
||||
},
|
||||
//获取详细地址
|
||||
getAddress() {
|
||||
let value = this.storeData.latitude + ',' + this.storeData.longitude;
|
||||
getTranAddressInfo(value).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.storeData.full_address = '';
|
||||
this.storeData.full_address += res.data.province != undefined ? res.data.province : '';
|
||||
this.storeData.full_address += res.data.city != undefined ? '-' + res.data.city : '';
|
||||
this.storeData.full_address += res.data.district != undefined ? '-' + res.data.district : '';
|
||||
this.storeData.address = res.data.address != undefined ? res.data.address : '';
|
||||
|
||||
this.storeData.province_id = res.data.province_id != undefined ? res.data.province_id : '';
|
||||
this.storeData.city_id = res.data.city_id != undefined ? res.data.city_id : '';
|
||||
this.storeData.district_id = res.data.district_id != undefined ? res.data.district_id : '';
|
||||
this.defaultRegions = [this.storeData.province_id, this.storeData.city_id, this.storeData.district_id];
|
||||
this.$forceUpdate();
|
||||
}
|
||||
});
|
||||
},
|
||||
//获取详细地址
|
||||
getLatLng() {
|
||||
let value = this.storeData.full_address + this.storeData.address;
|
||||
getAddressByName(value).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.storeData.latitude = res.data.latitude;
|
||||
this.storeData.longitude = res.data.longitude;
|
||||
}
|
||||
});
|
||||
},
|
||||
storeTypeChange(e) {
|
||||
this.storeData.store_type = e.detail.value;
|
||||
},
|
||||
getSaveData() {
|
||||
let data = Object.assign({}, this.storeData);
|
||||
data.start_time = this.timeTurnTimeStamp(data.start_time);
|
||||
data.end_time = this.timeTurnTimeStamp(data.end_time);
|
||||
data.time_week = this.storeData.time_week.toString();
|
||||
return data;
|
||||
},
|
||||
checkData(data) {
|
||||
if (data.store_name == '') {
|
||||
this.$util.showToast({
|
||||
title: '请输入门店名称'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!data.district_id || data.address == '') {
|
||||
this.$util.showToast({
|
||||
title: '请选择门店地址'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
saveFn() {
|
||||
let data = this.getSaveData();
|
||||
if (this.checkData(data)) {
|
||||
if (this.flag) return false;
|
||||
this.flag = true;
|
||||
editStore(data).then(res => {
|
||||
this.flag = false;
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
if (res.code >= 0) {
|
||||
this.$store.dispatch('app/getStoreInfoFn', {
|
||||
callback: () => {
|
||||
this.getData();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
timeTurnTimeStamp(_time) {
|
||||
let data = _time.split(':');
|
||||
return data[0] * 3600 + data[1] * 60;
|
||||
},
|
||||
timeFormat(time) {
|
||||
let h = time / 3600;
|
||||
let i = (time % 3600) / 60;
|
||||
h = h < 10 ? '0' + h : h;
|
||||
i = i < 10 ? '0' + i : i;
|
||||
return h + ':' + i;
|
||||
},
|
||||
labelChange(e) {
|
||||
if (e.detail.value.length) {
|
||||
this.storeData.label_id = ',' + e.detail.value.toString() + ',';
|
||||
let labelName = [];
|
||||
e.detail.value.forEach(item => {
|
||||
labelName.push(this.labelData[item]);
|
||||
});
|
||||
this.storeData.label_name = ',' + labelName.toString() + ',';
|
||||
} else {
|
||||
this.storeData.label_id = '';
|
||||
this.storeData.label_name = '';
|
||||
}
|
||||
},
|
||||
labelChecked(item) {
|
||||
let labelIdArr = [];
|
||||
if (!this.storeData.label_id) return false;
|
||||
if (typeof this.storeData.label_id == 'string') labelIdArr = this.storeData.label_id.split(',');
|
||||
return labelIdArr.includes(item.label_id.toString());
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.store-config {
|
||||
position: relative;
|
||||
.common-wrap.fixd {
|
||||
padding: 30rpx;
|
||||
height: calc(100vh - 0.4rem);
|
||||
overflow-y: auto;
|
||||
// padding-bottom: 1rem !important;
|
||||
box-sizing: border-box;
|
||||
|
||||
.form-label {
|
||||
width: 1.5rem !important;
|
||||
}
|
||||
|
||||
.form-input-inline /deep/ .uni-select {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.common-btn-wrap {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
padding: 0.24rem 0.2rem;
|
||||
}
|
||||
|
||||
.form-word-aux-line {
|
||||
margin-left: 1.5rem !important;
|
||||
}
|
||||
}
|
||||
|
||||
.upload-box {
|
||||
border: 0.01rem dashed #e6e6e6 !important;
|
||||
width: 2.5rem !important;
|
||||
height: 1.2rem !important;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.upload {
|
||||
text-align: center;
|
||||
color: #5a5a5a;
|
||||
|
||||
.iconfont {
|
||||
font-size: 0.3rem;
|
||||
}
|
||||
|
||||
image {
|
||||
max-width: 100%;
|
||||
height: 1.2rem !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.store-img {
|
||||
align-items: flex-start !important;
|
||||
}
|
||||
|
||||
.map-box {
|
||||
width: 6.5rem;
|
||||
height: 5rem;
|
||||
position: relative;
|
||||
|
||||
.map-icon {
|
||||
position: absolute;
|
||||
top: calc(50% - 0.36rem);
|
||||
left: calc(50% - 0.18rem);
|
||||
width: 0.36rem;
|
||||
height: 0.36rem;
|
||||
z-index: 100;
|
||||
}
|
||||
}
|
||||
|
||||
.form-input {
|
||||
font-size: 0.16rem;
|
||||
}
|
||||
|
||||
.form-input-inline.btn {
|
||||
height: 0.37rem;
|
||||
line-height: 0.35rem;
|
||||
box-sizing: border-box;
|
||||
border: 0.01rem solid #e6e6e6;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.common-title {
|
||||
font-size: 0.18rem;
|
||||
margin-bottom: 0.2rem;
|
||||
}
|
||||
}</style>
|
||||
268
addon/cashier/source/os/pages/store/deliver.vue
Executable file
268
addon/cashier/source/os/pages/store/deliver.vue
Executable file
@@ -0,0 +1,268 @@
|
||||
<template>
|
||||
<base-page>
|
||||
<view class="deliverlist">
|
||||
<view class="deliverlist-box">
|
||||
<view class="deliverlist-left">
|
||||
<view class="deliver-title">
|
||||
配送员
|
||||
<text class="iconfont icongengduo1"></text>
|
||||
</view>
|
||||
<view class="deliver-list-wrap">
|
||||
<block v-if="list.length > 0">
|
||||
<scroll-view scroll-y="true" class="deliver-list-scroll all-scroll" @scrolltolower="getDeliverList">
|
||||
<view class="item" @click="deliverSelect(item, index)" v-for="(item, index) in list" :key="index" :class="index == selectDeliverKeys ? 'itemhover' : ''">
|
||||
<view class="item-right">
|
||||
<view class="deliver-name">{{ item.deliver_name }}</view>
|
||||
<view class="deliver-money">{{ item.deliver_mobile }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</block>
|
||||
<view class="notYet" v-else-if="!one_judge && list.length == 0">暂无配送员</view>
|
||||
</view>
|
||||
<view class="add-deliver">
|
||||
<button type="default" class="primary-btn" @click="addDeliver">添加配送员</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="deliverlist-right" v-show="!one_judge">
|
||||
<view class="deliver-title">配送员详情</view>
|
||||
<view class="deliver-information">
|
||||
<block v-if="detail && Object.keys(detail).length">
|
||||
<view class="title">基本信息</view>
|
||||
<view class="information-box">
|
||||
<view class="box-left">
|
||||
<view class="information">
|
||||
<view>姓名:</view>
|
||||
<view>{{ detail.deliver_name }}</view>
|
||||
</view>
|
||||
<view class="information">
|
||||
<view>电话:</view>
|
||||
<view>{{ detail.deliver_mobile }}</view>
|
||||
</view>
|
||||
<view class="information">
|
||||
<view>添加时间:</view>
|
||||
<view>{{ detail.create_time ? $util.timeFormat(detail.create_time) : '--' }}</view>
|
||||
</view>
|
||||
<view class="information">
|
||||
<view>最后修改时间:</view>
|
||||
<view>{{ detail.modify_time ? $util.timeFormat(detail.modify_time) : '--' }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</block>
|
||||
<block v-else>
|
||||
<image class="cart-empty" src="@/static/goods/goods_empty.png" mode="widthFix" />
|
||||
</block>
|
||||
<view class="button-box" v-if="detail && Object.keys(detail).length">
|
||||
<button class="default-btn" @click="$refs.deletePop.open()">删除</button>
|
||||
<button class="default-btn" @click="openEditDeliverPop(detail.deliver_id)">修改</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<uni-popup ref="deliverpop" type="center">
|
||||
<view class="common-wrap common-form">
|
||||
<view class="common-title">{{ deliverData.deliver_id > 0 ? '修改' : '添加' }}配送员</view>
|
||||
<view class="common-form-item">
|
||||
<label class="form-label">
|
||||
<text class="required">*</text>
|
||||
姓名
|
||||
</label>
|
||||
<view class="form-input-inline">
|
||||
<input type="text" v-model="deliverData.deliver_name" class="form-input" />
|
||||
</view>
|
||||
<text class="form-word-aux"></text>
|
||||
</view>
|
||||
<view class="common-form-item">
|
||||
<label class="form-label">
|
||||
<text class="required">*</text>
|
||||
手机号
|
||||
</label>
|
||||
<view class="form-input-inline">
|
||||
<input type="number" v-model="deliverData.deliver_mobile" class="form-input" />
|
||||
</view>
|
||||
<text class="form-word-aux"></text>
|
||||
</view>
|
||||
<view class="common-btn-wrap">
|
||||
<button type="default" class="screen-btn" @click="addDeliverSave">{{ deliverData.deliver_id > 0 ? '修改' : '添加' }}</button>
|
||||
<button type="primary" class="default-btn btn save" @click="addDeliverClose()">取消</button>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
<!-- 删除 -->
|
||||
<uni-popup ref="deletePop" type="center">
|
||||
<view class="confirm-pop">
|
||||
<view class="title">确定要删除吗?</view>
|
||||
<view class="btn">
|
||||
<button type="primary" class="default-btn btn save" @click="$refs.deletePop.close()">取消</button>
|
||||
<button type="primary" class="primary-btn btn" @click="deleteDeliverFn(detail.deliver_id)">确定</button>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
<ns-loading :layer-background="{ background: 'rgba(255,255,255,.8)' }" ref="loading"></ns-loading>
|
||||
</view>
|
||||
</view>
|
||||
</base-page>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
addDeliver,
|
||||
deleteDeliver,
|
||||
editDeliver,
|
||||
getDeliverInfo,
|
||||
getDeliverList
|
||||
} from '@/api/deliver.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
search_text: '',
|
||||
page: 1,
|
||||
// 每次返回数据数
|
||||
page_size: 8,
|
||||
// 第一次请求列表做详情渲染判断
|
||||
one_judge: true,
|
||||
//详情数据
|
||||
detail: {},
|
||||
list: [],
|
||||
selectDeliverKeys: 0,
|
||||
flag: false,
|
||||
deliverData: {
|
||||
deliver_id: 0,
|
||||
deliver_name: '',
|
||||
deliver_mobile: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.getDeliverListFn();
|
||||
},
|
||||
methods: {
|
||||
deliverSelect(item, keys) {
|
||||
this.selectDeliverKeys = keys;
|
||||
this.getDeliverDetail(item.deliver_id);
|
||||
},
|
||||
// 搜索员工
|
||||
search() {
|
||||
this.page = 1;
|
||||
this.list = [];
|
||||
this.one_judge = true;
|
||||
this.getDeliverListFn();
|
||||
},
|
||||
addDeliver() {
|
||||
this.$refs.deliverpop.open();
|
||||
},
|
||||
addDeliverClose() {
|
||||
this.$refs.deliverpop.close();
|
||||
},
|
||||
addDeliverSave() {
|
||||
if (this.deliverData.deliver_name == '') {
|
||||
this.$util.showToast({
|
||||
title: '请输入配送员名称'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.deliverData.deliver_mobile == '') {
|
||||
this.$util.showToast({
|
||||
title: '请输入配送员电话'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.flag) return false;
|
||||
this.flag = true;
|
||||
let action = '';
|
||||
if (this.deliverData.deliver_id > 0) {
|
||||
action = editDeliver(this.deliverData);
|
||||
} else {
|
||||
action = addDeliver(this.deliverData);
|
||||
}
|
||||
action.then(res => {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
if (res.code == 0) {
|
||||
this.page = 1;
|
||||
this.list = [];
|
||||
this.one_judge = true;
|
||||
this.getDeliverListFn();
|
||||
this.addDeliverClose();
|
||||
this.deliverData = {
|
||||
deliver_id: 0,
|
||||
deliver_name: '',
|
||||
deliver_mobile: ''
|
||||
};
|
||||
}
|
||||
this.flag = false;
|
||||
});
|
||||
},
|
||||
openEditDeliverPop(deliver_id) {
|
||||
getDeliverInfo(deliver_id).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.deliverData = res.data;
|
||||
this.$refs.deliverpop.open();
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 请求的列表数据
|
||||
*/
|
||||
getDeliverListFn() {
|
||||
getDeliverList({
|
||||
page: this.page,
|
||||
page_size: this.page_size,
|
||||
}).then(res => {
|
||||
if (res.data.list.length == 0 && this.one_judge) {
|
||||
this.detail = {};
|
||||
this.one_judge = false;
|
||||
}
|
||||
this.$refs.loading.hide();
|
||||
if (res.code >= 0 && res.data.list.length != 0) {
|
||||
this.page += 1;
|
||||
if (this.list.length == 0) {
|
||||
this.list = res.data.list;
|
||||
} else {
|
||||
this.list = this.list.concat(res.data.list);
|
||||
}
|
||||
|
||||
//初始时加载一遍详情数据
|
||||
if (this.one_judge) {
|
||||
this.getDeliverDetail(this.list[0].deliver_id);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
getDeliverDetail(deliver_id) {
|
||||
getDeliverInfo(deliver_id).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.detail = res.data;
|
||||
this.one_judge = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
deleteDeliverFn(deliver_id) {
|
||||
if (this.flag) return;
|
||||
this.flag = true;
|
||||
deleteDeliver(deliver_id).then(res => {
|
||||
this.flag = false;
|
||||
if (res.code >= 0) {
|
||||
this.page = 1;
|
||||
this.list = [];
|
||||
this.one_judge = true;
|
||||
this.$refs.deletePop.close()
|
||||
this.getDeliverListFn();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import './public/css/deliver.scss';
|
||||
</style>
|
||||
228
addon/cashier/source/os/pages/store/index.vue
Executable file
228
addon/cashier/source/os/pages/store/index.vue
Executable file
@@ -0,0 +1,228 @@
|
||||
<template>
|
||||
<base-page>
|
||||
<view class="">
|
||||
<view class="store-information" v-if="addon.includes('store')">
|
||||
<view class="store-status">门店信息</view>
|
||||
<view class="store-types">
|
||||
<view class="info-left">
|
||||
<view class="type type1">
|
||||
<view>门店名称:</view>
|
||||
<view>{{ storeData.store_name }}</view>
|
||||
</view>
|
||||
<view class="type type1">
|
||||
<view>门店电话:</view>
|
||||
<view class="message">{{ storeData.telphone }}</view>
|
||||
</view>
|
||||
<view class="type type1">
|
||||
<view>门店类型:</view>
|
||||
<view class="message">{{ storeData.store_type == 'directsale' ? '直营店' : '加盟店' }}</view>
|
||||
</view>
|
||||
<view class="type type1">
|
||||
<view>门店地址:</view>
|
||||
<view class="message">{{ storeData.full_address }}{{ storeData.address }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-img">
|
||||
<image :src="$util.img(storeData.store_image)" @error="$util.img(defaultImg.store)" mode="aspectFit"/>
|
||||
</view>
|
||||
<view class="btn" @click="$util.redirectTo('/pages/store/config')">设置</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="store-information">
|
||||
<view class="store-status">运营信息</view>
|
||||
<view class="store-types">
|
||||
<view class="info-left">
|
||||
<template v-if="addon.includes('store')">
|
||||
<view class="type type1">
|
||||
<view>营业状态:</view>
|
||||
<view class="message" v-if="storeData.is_frozen == 1">已停业</view>
|
||||
<view class="message" v-else>{{ storeData.status == 1 ? '营业中' : '休息' }}</view>
|
||||
</view>
|
||||
<view class="type type1">
|
||||
<view>营业时间:</view>
|
||||
<view class="message">{{ storeData.open_date }}</view>
|
||||
</view>
|
||||
<view class="type type1">
|
||||
<view>物流配送:</view>
|
||||
<view class="message">{{ storeData.is_express ? '开启' : '关闭' }}</view>
|
||||
</view>
|
||||
<view class="type type1">
|
||||
<view>同城配送:</view>
|
||||
<view>{{ storeData.is_o2o ? '开启' : '关闭' }}</view>
|
||||
</view>
|
||||
<view class="type type1">
|
||||
<view>门店自提:</view>
|
||||
<view class="message">{{ storeData.is_pickup ? '开启' : '关闭' }}</view>
|
||||
</view>
|
||||
<view class="type type1">
|
||||
<view>自提日期:</view>
|
||||
<view class="message" v-if="storeData.time_type == 1">
|
||||
<text class="week" v-if="storeData.time_week.includes('1') || storeData.time_week.includes(1)">周一</text>
|
||||
<text class="week" v-if="storeData.time_week.includes('2') || storeData.time_week.includes(2)">周二</text>
|
||||
<text class="week" v-if="storeData.time_week.includes('3') || storeData.time_week.includes(3)">周三</text>
|
||||
<text class="week" v-if="storeData.time_week.includes('4') || storeData.time_week.includes(4)">周四</text>
|
||||
<text class="week" v-if="storeData.time_week.includes('5') || storeData.time_week.includes(5)">周五</text>
|
||||
<text class="week" v-if="storeData.time_week.includes('6') || storeData.time_week.includes(6)">周六</text>
|
||||
<text class="week" v-if="storeData.time_week.includes('0') || storeData.time_week.includes(0)">周日</text>
|
||||
</view>
|
||||
<view class="message" v-if="storeData.time_type == 0">每天</view>
|
||||
</view>
|
||||
<view class="type type1">
|
||||
<view>自提时间:</view>
|
||||
<view class="message">{{ storeData.start_time }}-{{ storeData.end_time }}</view>
|
||||
</view>
|
||||
|
||||
<view class="type type1">
|
||||
<view>库存设置:</view>
|
||||
<view class="message">{{ storeData.stock_type == 'all' ? '总部统一库存' : '门店独立库存' }}</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<view class="type type1">
|
||||
<view>会员搜索方式:</view>
|
||||
<view class="message">{{ memberSearchWayConfig.way == 'exact' ? '精确搜索' : '列表搜索' }}</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="btn" @click="$util.redirectTo('/pages/store/operate')">设置</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</base-page>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapGetters} from 'vuex';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
storeData: {
|
||||
store_name: '',
|
||||
store_image: '',
|
||||
status: 0,
|
||||
telphone: '',
|
||||
open_date: '',
|
||||
is_o2o: 0,
|
||||
is_pickup: 0,
|
||||
time_type: 0,
|
||||
start_time: '00:00',
|
||||
end_time: '23:59',
|
||||
stock_type: 'all',
|
||||
time_week: '',
|
||||
latitude: 39.909,
|
||||
longitude: 116.39742,
|
||||
province_id: 110000,
|
||||
city_id: 110100,
|
||||
district_id: 110101,
|
||||
address: '',
|
||||
full_address: '',
|
||||
store_type: 'directsale'
|
||||
}
|
||||
};
|
||||
},
|
||||
onLoad() {},
|
||||
onShow() {
|
||||
this.getData();
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['memberSearchWayConfig'])
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
this.storeData = this.$util.deepClone(this.globalStoreInfo);
|
||||
this.storeData.start_time = this.timeFormat(this.storeData.start_time);
|
||||
this.storeData.end_time = this.timeFormat(this.storeData.end_time);
|
||||
},
|
||||
timeFormat(time) {
|
||||
let h = parseInt(time / 3600);
|
||||
let i = parseInt((time % 3600) / 60);
|
||||
h = h < 10 ? '0' + h : h;
|
||||
i = i < 10 ? '0' + i : i;
|
||||
return h + ':' + i;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.store-information {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding-bottom: 0.1rem;
|
||||
margin-bottom: 0.2rem;
|
||||
.store-status {
|
||||
font-size: 0.24rem;
|
||||
font-weight: bold;
|
||||
height: 0.6rem;
|
||||
line-height: 0.6rem;
|
||||
padding-left: 0.2rem;
|
||||
}
|
||||
|
||||
.store-types {
|
||||
width: 100%;
|
||||
background: #ffffff;
|
||||
padding: 0.2rem 0.3rem;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 0.2rem;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
|
||||
.info-left {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.btn {
|
||||
position: absolute;
|
||||
top: 0.2rem;
|
||||
right: 0.2rem;
|
||||
color: $primary-color;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.info-img {
|
||||
margin-top: 0.4rem;
|
||||
|
||||
image {
|
||||
max-width: 1.5rem;
|
||||
height: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.type {
|
||||
padding-left: 0.1rem;
|
||||
|
||||
view {
|
||||
font-size: 0.14rem;
|
||||
|
||||
.look {
|
||||
color: $primary-color;
|
||||
margin-left: 0.24rem;
|
||||
}
|
||||
}
|
||||
|
||||
view:nth-child(1) {
|
||||
width: 1rem;
|
||||
text-align: right;
|
||||
margin-right: 0.1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.type1 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 0.34rem;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.week {
|
||||
margin-right: 0.1rem;
|
||||
}
|
||||
</style>
|
||||
569
addon/cashier/source/os/pages/store/operate.vue
Executable file
569
addon/cashier/source/os/pages/store/operate.vue
Executable file
@@ -0,0 +1,569 @@
|
||||
<template>
|
||||
<base-page>
|
||||
<view class="store-operate">
|
||||
<view class="common-wrap common-form fixd common-scrollbar">
|
||||
<view class="common-title">运营设置</view>
|
||||
|
||||
<template v-if="addon.includes('store')">
|
||||
<view class="common-form-item">
|
||||
<label class="form-label">门店名称</label>
|
||||
<view class="form-input-inline">
|
||||
<input type="text" v-model="storeData.store_name" disabled class="form-input" />
|
||||
</view>
|
||||
<text class="form-word-aux-line">门店的名称(招牌)</text>
|
||||
</view>
|
||||
|
||||
<view class="common-form-item">
|
||||
<label class="form-label">是否营业</label>
|
||||
<view class="form-inline">
|
||||
<radio-group @change="statusChange" class="form-radio-group">
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="1" :checked="storeData.status == 1" />
|
||||
是
|
||||
</label>
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="0" :checked="storeData.status == 0" />
|
||||
否
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="common-form-item">
|
||||
<label class="form-label">营业时间</label>
|
||||
<view class="form-inline">
|
||||
<view class="form-input-inline long">
|
||||
<input type="text" v-model="storeData.open_date" class="form-input" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="common-form-item">
|
||||
<label class="form-label">物流配送</label>
|
||||
<view class="form-inline">
|
||||
<radio-group @change="expressChange" class="form-radio-group">
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="1" :checked="storeData.is_express == 1" />
|
||||
开启
|
||||
</label>
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="0" :checked="storeData.is_express == 0" />
|
||||
关闭
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
<text class="form-word-aux-line">物流配送只有在连锁门店模式有效,在平台运营模式,按照总店查询</text>
|
||||
</view>
|
||||
|
||||
<view class="common-form-item">
|
||||
<label class="form-label">同城配送</label>
|
||||
<view class="form-inline">
|
||||
<radio-group @change="o2oChange" class="form-radio-group">
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="1" :checked="storeData.is_o2o == 1" />
|
||||
开启
|
||||
</label>
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="0" :checked="storeData.is_o2o == 0" />
|
||||
关闭
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
<text class="form-word-aux-line">开启同城配送需要门店设置配送费用以及配送员</text>
|
||||
</view>
|
||||
|
||||
<view class="common-form-item">
|
||||
<label class="form-label">门店自提</label>
|
||||
<view class="form-inline">
|
||||
<radio-group @change="pickupChange" class="form-radio-group">
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="1" :checked="storeData.is_pickup == 1" />
|
||||
开启
|
||||
</label>
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="0" :checked="storeData.is_pickup == 0" />
|
||||
关闭
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<block v-if="storeData.is_pickup == 1">
|
||||
<view class="common-form-item">
|
||||
<label class="form-label">自提日期</label>
|
||||
<view class="form-inline">
|
||||
<radio-group @change="timeTypeChange" class="form-radio-group">
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="0" :checked="storeData.time_type == 0" />
|
||||
每天
|
||||
</label>
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="1" :checked="storeData.time_type == 1" />
|
||||
自定义
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="common-form-item" v-if="storeData.time_type == 1">
|
||||
<label class="form-label">自提时间</label>
|
||||
<view class="form-block">
|
||||
<checkbox-group class="form-checkbox-group" @change="checkboxChange">
|
||||
<label class="form-checkbox-item">
|
||||
<checkbox value="1" :checked="storeData.time_week.includes('1') || storeData.time_week.includes(1)" />
|
||||
周一
|
||||
</label>
|
||||
<label class="form-checkbox-item">
|
||||
<checkbox value="2" :checked="storeData.time_week.includes('2') || storeData.time_week.includes(2)" />
|
||||
周二
|
||||
</label>
|
||||
<label class="form-checkbox-item">
|
||||
<checkbox value="3" :checked="storeData.time_week.includes('3') || storeData.time_week.includes(3)" />
|
||||
周三
|
||||
</label>
|
||||
<label class="form-checkbox-item">
|
||||
<checkbox value="4" :checked="storeData.time_week.includes('4') || storeData.time_week.includes(4)" />
|
||||
周四
|
||||
</label>
|
||||
<label class="form-checkbox-item">
|
||||
<checkbox value="5" :checked="storeData.time_week.includes('5') || storeData.time_week.includes(5)" />
|
||||
周五
|
||||
</label>
|
||||
<label class="form-checkbox-item">
|
||||
<checkbox value="6" :checked="storeData.time_week.includes('6') || storeData.time_week.includes(6)" />
|
||||
周六
|
||||
</label>
|
||||
<label class="form-checkbox-item">
|
||||
<checkbox value="0" :checked="storeData.time_week.includes('0') || storeData.time_week.includes(0)" />
|
||||
周日
|
||||
</label>
|
||||
</checkbox-group>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="common-form-item" v-for="(item, index) in storeData.delivery_time" :key="index">
|
||||
<label class="form-label">{{ index == 0 ? '时段设置' : '' }}</label>
|
||||
<view class="form-inline">
|
||||
<view class="form-input-inline">
|
||||
<picker mode="time" class="form-input" :value="timeFormat(item.start_time)" @change="bindStartTimeChange($event, index)">
|
||||
<view class="uni-input">{{ item.start_time ? timeFormat(item.start_time) : '00:00' }}</view>
|
||||
</picker>
|
||||
</view>
|
||||
<text class="form-mid">-</text>
|
||||
<view class="form-input-inline">
|
||||
<picker mode="time" class="form-input" :value="timeFormat(item.end_time)" @change="bindEndTimeChange($event, index)">
|
||||
<view class="uni-input">{{ item.end_time ? timeFormat(item.end_time) : '' }}</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="time-action" v-if="index == 0" @click="addDeliveryTime">添加</view>
|
||||
<view class="time-action" v-else @click="deleteDeliveryTime(index)">删除</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="common-form-item">
|
||||
<label class="form-label">细分时段</label>
|
||||
<view class="form-block">
|
||||
<radio-group @change="timeIntervalChange" class="form-radio-group">
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="30" :checked="storeData.time_interval == 30" />
|
||||
30分钟
|
||||
</label>
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="60" :checked="storeData.time_interval == 60" />
|
||||
一小时
|
||||
</label>
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="90" :checked="storeData.time_interval == 90" />
|
||||
90分钟
|
||||
</label>
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="120" :checked="storeData.time_interval == 120" />
|
||||
两小时
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="common-form-item">
|
||||
<label class="form-label">提现预约</label>
|
||||
<view class="form-block">
|
||||
<radio-group @change="advanceDayChange" class="form-radio-group">
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="0" :checked="storeData.advance_day === 0" />
|
||||
无需提前
|
||||
</label>
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="1" :checked="storeData.advance_day !== 0" />
|
||||
需提前
|
||||
<input type="number" v-model="storeData.advance_day" class="radio-input" :class="{ disabled: storeData.advance_day === 0 }" :disabled="storeData.advance_day === 0" />
|
||||
天
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
<text class="form-word-aux-line">预约提货是否需提前进行预约</text>
|
||||
</view>
|
||||
<view class="common-form-item">
|
||||
<label class="form-label">最长预约</label>
|
||||
<view class="form-block">
|
||||
<radio-group @change="mostDayChange" class="form-radio-group">
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="0" :checked="storeData.most_day === 0" />
|
||||
无需提前
|
||||
</label>
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="1" :checked="storeData.most_day !== 0" />
|
||||
可预约
|
||||
<input type="number" v-model="storeData.most_day" class="radio-input" :class="{ disabled: storeData.most_day === 0 }" :disabled="storeData.most_day === 0" />
|
||||
天内
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
<text class="form-word-aux-line">预约提货最长可预约多少天内进行提货</text>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<view class="common-form-item">
|
||||
<label class="form-label">库存设置</label>
|
||||
<view class="form-inline">
|
||||
<radio-group @change="stockTypeChange" class="form-radio-group">
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="all" :disabled="Boolean(storeData.is_default)" :checked="storeData.stock_type == 'all'" />
|
||||
总部统一库存
|
||||
</label>
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="store" :disabled="Boolean(storeData.is_default)" :checked="storeData.stock_type == 'store'" />
|
||||
门店独立库存
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<view class="common-form-item">
|
||||
<label class="form-label">会员搜索方式</label>
|
||||
<view class="form-inline">
|
||||
<radio-group @change="memberSearchWayChange" class="form-radio-group">
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="exact" :checked="memberSearchWay == 'exact'" />
|
||||
精确搜索
|
||||
</label>
|
||||
<label class="radio form-radio-item">
|
||||
<radio value="list" :checked="memberSearchWay == 'list'" />
|
||||
列表搜索
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="common-btn-wrap">
|
||||
<button type="default" class="screen-btn" @click="saveFn">保存</button>
|
||||
<button type="default" @click="$util.redirectTo('/pages/store/index')">返回</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</base-page>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
editStore
|
||||
} from '@/api/store.js'
|
||||
import {setMemberSearchWayConfig} from '@/api/config.js'
|
||||
import {mapGetters} from 'vuex';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
storeData: {},
|
||||
covers: [{
|
||||
latitude: 39.909,
|
||||
longitude: 116.39742,
|
||||
iconPath: '/static/location.png'
|
||||
}],
|
||||
defaultRegions: [],
|
||||
memberSearchWay: 'exact'
|
||||
};
|
||||
},
|
||||
onLoad() {},
|
||||
onShow() {
|
||||
this.getData();
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['memberSearchWayConfig'])
|
||||
},
|
||||
watch: {
|
||||
memberSearchWayConfig: {
|
||||
immediate: true,
|
||||
handler(newVal, oldVal) {
|
||||
if(newVal) {
|
||||
this.memberSearchWay = newVal.way;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
this.storeData = this.$util.deepClone(this.globalStoreInfo);
|
||||
this.storeData.start_time = this.timeFormat(this.storeData.start_time);
|
||||
this.storeData.end_time = this.timeFormat(this.storeData.end_time);
|
||||
if(this.memberSearchWayConfig) {
|
||||
this.memberSearchWay = this.memberSearchWayConfig.way;
|
||||
}
|
||||
},
|
||||
statusChange(e) {
|
||||
this.storeData.status = e.detail.value;
|
||||
},
|
||||
o2oChange(e) {
|
||||
this.storeData.is_o2o = e.detail.value;
|
||||
},
|
||||
expressChange(e) {
|
||||
this.storeData.is_express = e.detail.value;
|
||||
},
|
||||
pickupChange(e) {
|
||||
this.storeData.is_pickup = e.detail.value;
|
||||
},
|
||||
timeTypeChange(e) {
|
||||
this.storeData.time_type = e.detail.value;
|
||||
},
|
||||
bindStartTimeChange(e, index) {
|
||||
this.storeData.delivery_time[index].start_time = this.timeTurnTimeStamp(e.detail.value);
|
||||
},
|
||||
bindEndTimeChange(e, index) {
|
||||
this.storeData.delivery_time[index].end_time = this.timeTurnTimeStamp(e.detail.value);
|
||||
},
|
||||
stockTypeChange(e) {
|
||||
this.storeData.stock_type = e.detail.value;
|
||||
},
|
||||
memberSearchWayChange(e) {
|
||||
this.memberSearchWay = e.detail.value;
|
||||
},
|
||||
timeIntervalChange(e) {
|
||||
this.storeData.time_interval = e.detail.value;
|
||||
},
|
||||
checkboxChange(e) {
|
||||
this.storeData.time_week = e.detail.value;
|
||||
},
|
||||
advanceDayChange(e) {
|
||||
if (e.detail.value == 1) this.storeData.advance_day = '';
|
||||
else this.storeData.advance_day = 0;
|
||||
},
|
||||
mostDayChange(e) {
|
||||
if (e.detail.value == 1) this.storeData.most_day = '';
|
||||
else this.storeData.most_day = 0;
|
||||
},
|
||||
getSaveData() {
|
||||
let data = Object.assign({}, this.storeData);
|
||||
data.start_time = this.timeTurnTimeStamp(data.start_time);
|
||||
data.end_time = this.timeTurnTimeStamp(data.end_time);
|
||||
data.time_week = this.storeData.time_week.toString();
|
||||
data.advance_day = parseInt(this.storeData.advance_day);
|
||||
data.most_day = parseInt(this.storeData.most_day);
|
||||
data.delivery_time = JSON.stringify(this.storeData.delivery_time);
|
||||
return data;
|
||||
},
|
||||
checkData(data) {
|
||||
if (data.is_pickup) {
|
||||
let deliveryTimeVerify = true;
|
||||
for (let i = 0; i < this.storeData.delivery_time.length; i++) {
|
||||
let time = this.storeData.delivery_time[i];
|
||||
if (time.end_time == 0) {
|
||||
this.$util.showToast({
|
||||
title: '请选择时段结束时间'
|
||||
});
|
||||
deliveryTimeVerify = false;
|
||||
break;
|
||||
}
|
||||
if (parseInt(time.start_time) > parseInt(time.end_time)) {
|
||||
this.$util.showToast({
|
||||
title: '时段结束时间不能小于开始时间'
|
||||
});
|
||||
deliveryTimeVerify = false;
|
||||
break;
|
||||
}
|
||||
if ((parseInt(time.end_time) - parseInt(time.start_time)) / 60 < parseInt(data.time_interval)) {
|
||||
this.$util.showToast({
|
||||
title: '时段时间间隔不能小于' + data.time_interval + '分钟'
|
||||
});
|
||||
deliveryTimeVerify = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!deliveryTimeVerify) return deliveryTimeVerify;
|
||||
if (isNaN(data.advance_day)) {
|
||||
this.$util.showToast({
|
||||
title: '提前预约时间格式错误'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (data.advance_day < 0) {
|
||||
this.$util.showToast({
|
||||
title: '提前预约时间不能为负数'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (isNaN(data.most_day)) {
|
||||
this.$util.showToast({
|
||||
title: '最长可预约时间格式错误'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (data.most_day < 0) {
|
||||
this.$util.showToast({
|
||||
title: '最长可预约时间不能为负数'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (data.most_day > 15) {
|
||||
this.$util.showToast({
|
||||
title: '最长可预约时间不能超过15天'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
},
|
||||
saveFn() {
|
||||
let data = this.getSaveData();
|
||||
|
||||
setMemberSearchWayConfig({
|
||||
way : this.memberSearchWay
|
||||
}).then((res)=>{
|
||||
if(res.code >= 0){
|
||||
this.$store.dispatch('app/getMemberSearchWayConfigFn');
|
||||
|
||||
if (!this.addon.includes('store')) {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
if (this.addon.includes('store')) {
|
||||
|
||||
if (this.checkData(data)) {
|
||||
if (this.flag) return false;
|
||||
this.flag = true;
|
||||
editStore(data).then(res => {
|
||||
this.flag = false;
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
if (res.code >= 0) {
|
||||
this.$store.dispatch('app/getStoreInfoFn', {
|
||||
callback: () => {
|
||||
this.getData();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
timeTurnTimeStamp(_time) {
|
||||
let data = _time.split(':');
|
||||
return data[0] * 3600 + data[1] * 60;
|
||||
},
|
||||
timeFormat(time) {
|
||||
let h = parseInt(time / 3600);
|
||||
let i = parseInt((time % 3600) / 60);
|
||||
h = h < 10 ? '0' + h : h;
|
||||
i = i < 10 ? '0' + i : i;
|
||||
return h + ':' + i;
|
||||
},
|
||||
addDeliveryTime() {
|
||||
if (this.storeData.delivery_time.length >= 3) {
|
||||
this.$util.showToast({
|
||||
title: '最多添加三个时段'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
this.storeData.delivery_time.push({
|
||||
start_time: 0,
|
||||
end_time: 0
|
||||
});
|
||||
},
|
||||
deleteDeliveryTime(index) {
|
||||
this.storeData.delivery_time.splice(index, 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.store-operate {
|
||||
position: relative;
|
||||
.common-btn-wrap {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
padding: 0.24rem 0.2rem;
|
||||
}
|
||||
.common-wrap {
|
||||
padding: 30rpx;
|
||||
height: calc(100vh - 0.4rem);
|
||||
overflow-y: auto;
|
||||
// padding-bottom: 1rem !important;
|
||||
box-sizing: border-box;
|
||||
|
||||
.form-label {
|
||||
padding: .09rem .15rem;
|
||||
text-align: right;
|
||||
width: 1.2rem;
|
||||
}
|
||||
}
|
||||
|
||||
.store-img {
|
||||
align-items: flex-start !important;
|
||||
}
|
||||
|
||||
.map-box {
|
||||
width: 6.5rem;
|
||||
height: 5rem;
|
||||
position: relative;
|
||||
|
||||
.map-icon {
|
||||
position: absolute;
|
||||
top: calc(50% - 0.36rem);
|
||||
left: calc(50% - 0.18rem);
|
||||
width: 0.36rem;
|
||||
height: 0.36rem;
|
||||
z-index: 100;
|
||||
}
|
||||
}
|
||||
|
||||
.form-input {
|
||||
font-size: 0.16rem;
|
||||
}
|
||||
|
||||
.form-input-inline.btn {
|
||||
height: 0.37rem;
|
||||
line-height: 0.35rem;
|
||||
box-sizing: border-box;
|
||||
border: 0.01rem solid #e6e6e6;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.common-title {
|
||||
font-size: 0.18rem;
|
||||
margin-bottom: 0.2rem;
|
||||
}
|
||||
|
||||
.radio-input {
|
||||
width: 0.6rem;
|
||||
height: 0.35rem;
|
||||
line-height: 0.35rem;
|
||||
padding: 0 0.1rem;
|
||||
margin: 0 0.1rem;
|
||||
border: 0.01rem solid #eee;
|
||||
|
||||
&.disabled {
|
||||
background: #f5f5f5;
|
||||
}
|
||||
}
|
||||
|
||||
.time-action {
|
||||
color: $primary-color;
|
||||
cursor: pointer;
|
||||
}
|
||||
}</style>
|
||||
317
addon/cashier/source/os/pages/store/public/css/deliver.scss
Executable file
317
addon/cashier/source/os/pages/store/public/css/deliver.scss
Executable file
@@ -0,0 +1,317 @@
|
||||
.deliverlist {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
|
||||
.deliverlist-box {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #ffffff;
|
||||
display: flex;
|
||||
|
||||
.deliverlist-left {
|
||||
width: 5rem;
|
||||
height: 100%;
|
||||
border-right: 0.01rem solid #e6e6e6;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.notYet {
|
||||
color: #e6e6e6;
|
||||
font-size: 0.4rem;
|
||||
margin-top: 3rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.add-deliver {
|
||||
padding: 0.24rem 0.2rem;
|
||||
background: #fff;
|
||||
|
||||
button {
|
||||
height: .4rem;
|
||||
line-height: .4rem;
|
||||
}
|
||||
}
|
||||
|
||||
.deliver-title {
|
||||
text-align: center;
|
||||
line-height: 0.6rem;
|
||||
font-size: 0.18rem;
|
||||
font-weight: 500;
|
||||
height: 0.6rem;
|
||||
border-bottom: 0.01rem solid #e6e6e6;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
|
||||
.icongengduo1 {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 0.2rem;
|
||||
transform: translateY(-50%);
|
||||
font-size: 0.3rem;
|
||||
color: $primary-color;
|
||||
}
|
||||
}
|
||||
|
||||
.deliver-list-wrap {
|
||||
flex: 1;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.deliver-list-scroll {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
.itemhover {
|
||||
background: var(--primary-color-light-9);
|
||||
}
|
||||
|
||||
.item {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0.2rem;
|
||||
box-sizing: border-box;
|
||||
border-bottom: 0.01rem solid #e6e6e6;
|
||||
|
||||
image {
|
||||
width: 0.7rem;
|
||||
height: 0.7rem;
|
||||
margin-right: 0.1rem;
|
||||
}
|
||||
|
||||
.item-right {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
height: 0.6rem;
|
||||
|
||||
.deliver-name {
|
||||
font-size: 0.16rem;
|
||||
}
|
||||
|
||||
.deliver-money {
|
||||
font-size: 0.14rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.deliverlist-right {
|
||||
width: 0;
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
|
||||
.deliver-title {
|
||||
text-align: center;
|
||||
line-height: 0.6rem;
|
||||
font-size: 0.18rem;
|
||||
font-weight: 500;
|
||||
height: 0.6rem;
|
||||
border-bottom: 0.01rem solid #e6e6e6;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
|
||||
.icongengduo1, .iconguanbi1 {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 0.2rem;
|
||||
transform: translateY(-50%);
|
||||
font-size: 0.3rem;
|
||||
color: $primary-color;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.deliver-information {
|
||||
width: 100%;
|
||||
padding: 0.2rem 0.2rem 0.88rem 0.2rem;
|
||||
box-sizing: border-box;
|
||||
height: calc(100% - 0.6rem);
|
||||
overflow: auto;
|
||||
position: relative;
|
||||
|
||||
.title {
|
||||
font-size: 0.18rem;
|
||||
margin-bottom: 0.32rem;
|
||||
}
|
||||
|
||||
.title2 {
|
||||
margin-bottom: 0.35rem;
|
||||
}
|
||||
|
||||
.information-box {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.box-left {
|
||||
width: 5rem;
|
||||
|
||||
.information {
|
||||
width: 100%;
|
||||
padding-left: 0.1rem;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 0.15rem;
|
||||
|
||||
view {
|
||||
color: #303133;
|
||||
font-size: 0.14rem;
|
||||
}
|
||||
|
||||
view:nth-child(1) {
|
||||
width: 1.3rem;
|
||||
margin-right: 0.16rem;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
view:nth-child(2) {
|
||||
width: 74%;
|
||||
margin-right: 0.23rem;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.information:last-child {
|
||||
margin-bottom: 0.35rem;
|
||||
}
|
||||
}
|
||||
|
||||
.deliver-img {
|
||||
width: 1.5rem;
|
||||
height: 1.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
.table {
|
||||
width: 100%;
|
||||
height: 2.6rem;
|
||||
box-sizing: border-box;
|
||||
|
||||
.table-all {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 0.38rem;
|
||||
box-sizing: border-box;
|
||||
|
||||
.table-td {
|
||||
font-size: 0.14rem;
|
||||
text-align: left;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.table-th {
|
||||
height: 0.56rem;
|
||||
background: #f7f8fa;
|
||||
}
|
||||
|
||||
.table-tb {
|
||||
width: 100%;
|
||||
height: calc(100% - 0.56rem);
|
||||
|
||||
.table-tr {
|
||||
height: 0.7rem;
|
||||
border-bottom: 0.01rem solid #e6e6e6;
|
||||
box-sizing: border-box;
|
||||
|
||||
.table-td {
|
||||
text-overflow: -o-ellipsis-lastline;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
|
||||
image {
|
||||
width: 0.5rem;
|
||||
height: 0.5rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
view {
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
/deep/ .uni-scroll-view::-webkit-scrollbar {
|
||||
width: 0.05rem;
|
||||
height: 0.3rem;
|
||||
}
|
||||
|
||||
/deep/ .uni-scroll-view::-webkit-scrollbar-thumb {
|
||||
border-radius: 0.1rem;
|
||||
box-shadow: inset 0 0 0.05rem rgba(0, 0, 0, 0.2);
|
||||
background: rgba(193, 193, 193, 1);
|
||||
}
|
||||
|
||||
.deliver-information::-webkit-scrollbar {
|
||||
width: 0.05rem;
|
||||
height: 0.3rem;
|
||||
}
|
||||
|
||||
.deliver-information::-webkit-scrollbar-thumb {
|
||||
border-radius: 0.1rem;
|
||||
box-shadow: inset 0 0 0.05rem rgba(0, 0, 0, 0.2);
|
||||
background: rgba(193, 193, 193, 1);
|
||||
}
|
||||
|
||||
.button-box {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
padding: 0.24rem 0.2rem;
|
||||
box-sizing: border-box;
|
||||
|
||||
button {
|
||||
min-width: 0.9rem;
|
||||
height: 0.4rem;
|
||||
line-height: 0.4rem;
|
||||
margin: 0;
|
||||
margin-left: 0.1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.cart-empty {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 2.1rem;
|
||||
}
|
||||
|
||||
.common-wrap {
|
||||
padding: 30rpx;
|
||||
margin: 30rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.common-title {
|
||||
font-size: 0.18rem;
|
||||
margin-bottom: 0.2rem;
|
||||
}
|
||||
543
addon/cashier/source/os/pages/store/settlement.vue
Executable file
543
addon/cashier/source/os/pages/store/settlement.vue
Executable file
@@ -0,0 +1,543 @@
|
||||
<template>
|
||||
<base-page>
|
||||
<view class="page-height uni-flex uni-column">
|
||||
<view class="uni-flex uni-row">
|
||||
<view class="account-wrap">
|
||||
<view class="head-title">账户概览</view>
|
||||
<view class="account-item">
|
||||
<view @click="$util.redirectTo('/pages/store/acccount_record')">
|
||||
<view class="account-title">待结算金额(元)</view>
|
||||
<view class="money">
|
||||
{{ globalStoreInfo.account | moneyFormat }}
|
||||
<text class="iconfont iconqianhou2"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="action">
|
||||
<button type="default" class="primary-btn" v-if="
|
||||
globalStoreInfo.is_settlement == 1 &&
|
||||
withdrawConfig.is_settlement == 1 &&
|
||||
withdrawConfig.period_type == 4 &&
|
||||
globalStoreInfo.account > 0 &&
|
||||
parseFloat(globalStoreInfo.account) >= parseFloat(withdrawConfig.withdraw_least)
|
||||
" @click="applyWithdraw">
|
||||
申请结算
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="uni-flex uni-row sub-bottom">
|
||||
<view class="account-item" @click="$util.redirectTo('/pages/store/settlement_record')">
|
||||
<view class="account-title">打款中金额(元)</view>
|
||||
<view class="money">
|
||||
{{ globalStoreInfo.account_apply | moneyFormat }}
|
||||
<text class="iconfont iconqianhou2"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="account-item" @click="$util.redirectTo('/pages/store/settlement_record')">
|
||||
<view class="account-title">已打款金额(元)</view>
|
||||
<view class="money">
|
||||
{{ globalStoreInfo.account_withdraw | moneyFormat }}
|
||||
<text class="iconfont iconqianhou2"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-wrap">
|
||||
<view class="head-title">结算账户</view>
|
||||
<view class="info-content">
|
||||
<block v-if="globalStoreInfo.is_settlement == 1 && withdrawConfig.is_settlement == 1">
|
||||
<view class="info-text">
|
||||
结算方式:
|
||||
<text>总部收款,</text>
|
||||
<text v-if="withdrawConfig.period_type == 1">每日自动结算</text>
|
||||
<text v-if="withdrawConfig.period_type == 2">每周自动结算</text>
|
||||
<text v-if="withdrawConfig.period_type == 3">每月自动结算</text>
|
||||
<text v-if="withdrawConfig.period_type == 4">门店申请结算</text>
|
||||
</view>
|
||||
<view class="info-text">账户类型:{{ bankType[globalStoreInfo.bank_type] }}</view>
|
||||
<block v-if="globalStoreInfo.bank_type == 1">
|
||||
<view class="info-text">微信名:{{ globalStoreInfo.bank_user_name }}</view>
|
||||
</block>
|
||||
<block v-if="globalStoreInfo.bank_type == 2">
|
||||
<view class="info-text">真实姓名:{{ globalStoreInfo.bank_user_name }}</view>
|
||||
<view class="info-text">支付宝账号:{{ globalStoreInfo.bank_type_account }}</view>
|
||||
</block>
|
||||
<block v-if="globalStoreInfo.bank_type == 3">
|
||||
<view class="info-text">开户行:{{ globalStoreInfo.bank_type_name }}</view>
|
||||
<view class="info-text">户头:{{ globalStoreInfo.bank_user_name }}</view>
|
||||
<view class="info-text">账户:{{ globalStoreInfo.bank_type_account }}</view>
|
||||
</block>
|
||||
</block>
|
||||
<view class="empty" v-else>无需结算</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="settlement-record uni-flex uni-column">
|
||||
<view class="head-title">结算记录</view>
|
||||
<view class="record-wrap common-scrollbar">
|
||||
<uni-data-table url="/store/storeapi/withdraw/page" :cols="cols" ref="table" :pagesize="8">
|
||||
<template v-slot:action="data">
|
||||
<view class="common-table-action" v-if="data.value.transfer_type == 'wechatpay' && data.value.status == 1 && newWithdrawDetail && newWithdrawDetail.transfer_type" @click="showQRcode(data)"><text >收款</text></view>
|
||||
<view class="common-table-action"><text @click="detail(data)">查看详情</text></view>
|
||||
</template>
|
||||
</uni-data-table>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<uni-popup ref="applyWithdraw" type="center">
|
||||
<view class="apply-withdraw">
|
||||
<view class="title">
|
||||
本次可结算金额为
|
||||
<text class="money" v-if="globalStoreInfo">{{ globalStoreInfo.account | moneyFormat }}</text>
|
||||
元,是否申请结算?
|
||||
</view>
|
||||
<view class="btn">
|
||||
<button type="primary" class="primary-btn btn" @click="apply">确定</button>
|
||||
<button type="primary" class="default-btn btn save" @click="$refs.applyWithdraw.close()">取消</button>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
|
||||
<uni-popup ref="detailPopup">
|
||||
<view class="pop-box">
|
||||
<view class="pop-header">
|
||||
<view class="">结算详情</view>
|
||||
<view class="pop-header-close" @click="$refs.detailPopup.close()">
|
||||
<text class="iconguanbi1 iconfont"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pop-content common-scrollbar" v-if="withdrawDetail">
|
||||
<view class="pop-content-item">
|
||||
<view class="pop-content-text">结算信息</view>
|
||||
<view class="pop-contents-text">结算编号:{{ withdrawDetail.withdraw_no }}</view>
|
||||
<view class="pop-contents-text">结算状态:{{ withdrawDetail.status_name }}</view>
|
||||
<view class="pop-contents-text" v-if="withdrawDetail.status == -1 || withdrawDetail.status == -2">拒绝理由:{{ withdrawDetail.refuse_reason }}</view>
|
||||
<view class="pop-contents-text">结算金额:{{ withdrawDetail.money | moneyFormat }}</view>
|
||||
<view class="pop-contents-text">结算方式:{{ withdrawDetail.transfer_type_name }}</view>
|
||||
<view class="pop-contents-text">结算类型:{{ withdrawDetail.settlement_type_name }}</view>
|
||||
<view class="pop-contents-text">结算申请时间:{{ withdrawDetail.apply_time | timeFormat }}</view>
|
||||
<view class="pop-contents-text" v-if="withdrawDetail.transfer_type == 'bank'">银行名称:{{ withdrawDetail.bank_name }}</view>
|
||||
<view class="pop-contents-text">结算收款账号:{{ withdrawDetail.account_number }}</view>
|
||||
<view class="pop-contents-text">结算方式:{{ withdrawDetail.transfer_type_name }}</view>
|
||||
<view class="pop-contents-text">真实姓名:{{ withdrawDetail.realname }}</view>
|
||||
<view class="pop-contents-text flex" v-if="withdrawDetail.voucher_img">转账凭证:<image class="voucher-img" :src="$util.img(withdrawDetail.voucher_img)" /></view>
|
||||
<view class="pop-contents-text" v-if="withdrawDetail.voucher_desc">凭证说明:{{ withdrawDetail.voucher_desc }}</view>
|
||||
</view>
|
||||
<view class="pop-content-item" v-if="withdrawDetail.settlement_type != 'apply'">
|
||||
<view class="pop-content-text">周期结算</view>
|
||||
<view class="pop-contents-text">周期结算编号:{{ withdrawDetail.settlement_info.settlement_no }}</view>
|
||||
<view class="pop-contents-text">周期开始时间:{{ withdrawDetail.settlement_info.start_time }}</view>
|
||||
<view class="pop-contents-text">周期结束时间:{{ withdrawDetail.settlement_info.end_time }}</view>
|
||||
<view class="pop-contents-text">结算订单总额:{{ withdrawDetail.settlement_info.order_money }}</view>
|
||||
<view class="pop-contents-text">结算总分销佣金:{{ withdrawDetail.settlement_info.commission }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
|
||||
<uni-popup ref="qrcodePopup">
|
||||
<view class="pop-box qrcode">
|
||||
<view class="pop-header">
|
||||
<view class="">扫码收款</view>
|
||||
<view class="pop-header-close" @click="closeQrcodePopup()">
|
||||
<text class="iconguanbi1 iconfont"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pop-content common-scrollbar qrcode-area" >
|
||||
<image class="qr-img" :src="qrcode" mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</base-page>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
applyWithdraw,
|
||||
getWithdrawConfig,
|
||||
withdrawDetail,
|
||||
withdrawConfig,
|
||||
transferCode
|
||||
} from '@/api/settlement.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
bankType: {
|
||||
1: '微信',
|
||||
2: '支付宝',
|
||||
3: '银行卡'
|
||||
},
|
||||
withdrawConfig: {
|
||||
is_settlement: 0
|
||||
},
|
||||
cols: [{
|
||||
width: 12,
|
||||
title: '结算方式',
|
||||
field: 'transfer_type_name',
|
||||
align: 'left'
|
||||
}, {
|
||||
width: 12,
|
||||
title: '结算类型',
|
||||
field: 'settlement_type_name',
|
||||
align: 'left'
|
||||
}, {
|
||||
width: 12,
|
||||
title: '结算金额',
|
||||
align: 'left',
|
||||
return: data => {
|
||||
return this.$util.moneyFormat(data.money);
|
||||
}
|
||||
}, {
|
||||
width: 12,
|
||||
title: '结算状态',
|
||||
field: 'status_name'
|
||||
}, {
|
||||
width: 15,
|
||||
title: '申请时间',
|
||||
align: 'center',
|
||||
return: data => {
|
||||
return data.apply_time ? this.$util.timeFormat(data.apply_time) : '';
|
||||
}
|
||||
}, {
|
||||
width: 15,
|
||||
title: '转账时间',
|
||||
align: 'center',
|
||||
return: data => {
|
||||
return data.transfer_time ? this.$util.timeFormat(data.transfer_time) : '';
|
||||
}
|
||||
}, {
|
||||
width: 20,
|
||||
title: '操作',
|
||||
action: true, // 表格操作列
|
||||
align: 'right'
|
||||
}],
|
||||
isRepeat: false,
|
||||
withdrawDetail: null,
|
||||
newWithdrawDetail: null,
|
||||
qrcode: '',
|
||||
timer: null,
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
},
|
||||
onShow() {
|
||||
this.getWithdrawConfigFn();
|
||||
this.getNewWithdrawConfigFn();
|
||||
this.$store.dispatch('app/getStoreInfoFn');
|
||||
},
|
||||
methods: {
|
||||
closeQrcodePopup() {
|
||||
this.$refs.qrcodePopup.close()
|
||||
clearInterval(this.timer);
|
||||
this.$refs.table.load();
|
||||
},
|
||||
checkWithdrawStatus(withdraw_id) {
|
||||
this.timer = setInterval(() => {
|
||||
withdrawDetail(withdraw_id).then(res => {
|
||||
if (res.code == 0) {
|
||||
if(res.data.status == 2){
|
||||
clearInterval(this.timer);
|
||||
this.$refs.qrcodePopup.close();
|
||||
this.$refs.table.load();
|
||||
}
|
||||
}else{
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
});
|
||||
}, 1000);
|
||||
},
|
||||
showQRcode(data) {
|
||||
this.qrcode = '';
|
||||
transferCode({
|
||||
id: data.value.withdraw_id,
|
||||
}).then(res => {
|
||||
this.qrcode = res.data;
|
||||
this.$refs.qrcodePopup.open();
|
||||
this.checkWithdrawStatus(data.value.withdraw_id);
|
||||
})
|
||||
},
|
||||
getNewWithdrawConfigFn() {
|
||||
withdrawConfig().then(res => {
|
||||
if (res.code == 0) {
|
||||
this.newWithdrawDetail = res.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
switchStoreAfter() {
|
||||
this.$refs.table.load();
|
||||
},
|
||||
getWithdrawConfigFn() {
|
||||
getWithdrawConfig().then(res => {
|
||||
if (res.code == 0) {
|
||||
this.withdrawConfig = res.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
applyWithdraw() {
|
||||
this.$refs.applyWithdraw.open();
|
||||
},
|
||||
apply() {
|
||||
if (this.isRepeat) return;
|
||||
this.isRepeat = true;
|
||||
applyWithdraw(this.globalStoreInfo.account).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$store.dispatch('app/getStoreInfoFn');
|
||||
this.$refs.applyWithdraw.close();
|
||||
this.$refs.table.load();
|
||||
setTimeout(() => {
|
||||
this.isRepeat = false;
|
||||
}, 500);
|
||||
} else {
|
||||
this.isRepeat = false;
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
detail(data) {
|
||||
withdrawDetail(data.value.withdraw_id).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.withdrawDetail = res.data;
|
||||
this.$refs.detailPopup.open('center');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page-height {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.account-wrap {
|
||||
flex: 1;
|
||||
width: 0;
|
||||
padding: 0.15rem;
|
||||
margin-right: 0.15rem;
|
||||
background: #fff;
|
||||
|
||||
.head-title {
|
||||
font-size: 0.16rem;
|
||||
}
|
||||
|
||||
.account-item {
|
||||
padding: 0.2rem 0;
|
||||
cursor: pointer;
|
||||
|
||||
.account-title {
|
||||
font-size: 0.14rem;
|
||||
color: #aaa;
|
||||
}
|
||||
|
||||
.money {
|
||||
font-size: 0.2rem;
|
||||
font-weight: bold;
|
||||
margin-top: 0.15rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.iconqianhou2 {
|
||||
line-height: 1;
|
||||
color: #bbb;
|
||||
margin-left: 0.05rem;
|
||||
}
|
||||
}
|
||||
|
||||
.action {
|
||||
margin-top: 0.3rem;
|
||||
height: 0.4rem;
|
||||
button {
|
||||
display: inline-block;
|
||||
margin-right: 0.1rem;
|
||||
width: auto;
|
||||
min-width: 0.8rem;
|
||||
line-height: 0.4rem;
|
||||
height: 0.4rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.sub-bottom {
|
||||
border-top: 0.01rem solid #f5f5f5;
|
||||
|
||||
.account-item {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.info-wrap {
|
||||
width: 30vw;
|
||||
padding: 0.15rem;
|
||||
background: #fff;
|
||||
|
||||
.head-title {
|
||||
font-size: 0.16rem;
|
||||
}
|
||||
|
||||
.info-content {
|
||||
margin-top: 0.2rem;
|
||||
|
||||
.info-text {
|
||||
margin-bottom: 0.1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.empty {
|
||||
padding: 1rem;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.settlement-record {
|
||||
padding: 0.15rem;
|
||||
flex: 1;
|
||||
height: 0;
|
||||
margin: 0.15rem 0;
|
||||
background: #fff;
|
||||
|
||||
.head-title {
|
||||
font-size: 0.16rem;
|
||||
}
|
||||
|
||||
.record-wrap {
|
||||
padding-top: 0.15rem;
|
||||
flex: 1;
|
||||
height: 0;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
}
|
||||
|
||||
.pop-box {
|
||||
background: #ffffff;
|
||||
width: 5rem;
|
||||
height: 60vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
&.qrcode{
|
||||
width: 2.8rem;
|
||||
height: auto;
|
||||
}
|
||||
.pop-header {
|
||||
width: 100%;
|
||||
padding: 0 0.15rem 0 0.2rem;
|
||||
height: 0.5rem;
|
||||
// width: 3.5rem;
|
||||
margin: 0 auto;
|
||||
line-height: 0.5rem;
|
||||
border-bottom: 0.01rem solid #f0f0f0;
|
||||
font-size: 0.14rem;
|
||||
color: #333;
|
||||
overflow: hidden;
|
||||
border-radius: 0.02rem 0.2rem 0 0;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.pop-header-close {
|
||||
cursor: pointer;
|
||||
|
||||
text {
|
||||
font-size: 0.18rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.pop-content {
|
||||
flex: 1;
|
||||
height: 0;
|
||||
padding: 0.1rem 0.2rem;
|
||||
box-sizing: border-box;
|
||||
font-weight: 900;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.qrcode-area{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0.2rem 0.2rem;
|
||||
.qr-img{
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.pop-contents {
|
||||
margin-top: 0.3rem;
|
||||
width: 3rem;
|
||||
height: 0.8rem;
|
||||
padding: 0.1rem 0.2rem;
|
||||
box-sizing: border-box;
|
||||
font-weight: 900;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.pop-content-item {
|
||||
margin-left: 0.3rem;
|
||||
}
|
||||
|
||||
.pop-content-items {
|
||||
margin-left: 0.3rem;
|
||||
}
|
||||
|
||||
.pop-content-text {
|
||||
padding: 0.1rem;
|
||||
}
|
||||
|
||||
.pop-contents-text {
|
||||
margin-left: 0.4rem;
|
||||
font-weight: normal;
|
||||
padding: 0.1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.apply-withdraw {
|
||||
width: 3.8rem;
|
||||
border-radius: 0.06rem;
|
||||
background: #ffffff;
|
||||
padding: 0.6rem 0.15rem 0.2rem 0.15rem;
|
||||
box-sizing: border-box;
|
||||
|
||||
.title {
|
||||
font-size: 0.16rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.money {
|
||||
font-weight: bold;
|
||||
font-size: 0.16rem;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 0.3rem;
|
||||
|
||||
.btn {
|
||||
width: auto;
|
||||
padding: 0 0.3rem;
|
||||
margin: 0;
|
||||
height: 0.35rem;
|
||||
}
|
||||
|
||||
.btn:last-child {
|
||||
margin-left: 0.2rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.voucher-img {
|
||||
width: 1.5rem;
|
||||
}
|
||||
</style>
|
||||
349
addon/cashier/source/os/pages/store/settlement_record.vue
Executable file
349
addon/cashier/source/os/pages/store/settlement_record.vue
Executable file
@@ -0,0 +1,349 @@
|
||||
<template>
|
||||
<base-page>
|
||||
<view class="manage">
|
||||
<view class="title-back flex items-center cursor-pointer" @click="backFn">
|
||||
<text class="iconfont iconqianhou1"></text>
|
||||
<text class="left">返回</text>
|
||||
<text class="content">|</text>
|
||||
<text>结算记录</text>
|
||||
</view>
|
||||
<view class="screen-warp common-form">
|
||||
<view class="common-form-item">
|
||||
<view class="form-inline goods-category">
|
||||
<label class="form-label">结算方式</label>
|
||||
<view class="form-input-inline">
|
||||
<select-lay :zindex="10" :value="screen.transfer_type" name="names" placeholder="请选择结算方式" :options="transferType" @selectitem="selectTransferType"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-inline goods-category">
|
||||
<label class="form-label">结算类型</label>
|
||||
<view class="form-input-inline">
|
||||
<select-lay :zindex="9" :value="screen.settlement_type" name="names" placeholder="请选择结算类型" :options="settlementType" @selectitem="selectSettlementType"/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="common-form-item">
|
||||
<view class="form-inline goods-category">
|
||||
<label class="form-label">结算状态</label>
|
||||
<view class="form-input-inline">
|
||||
<select-lay :zindex="9" :value="screen.status" name="names" placeholder="请选择结算状态" :options="status" @selectitem="selectStatus"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-inline">
|
||||
<label class="form-label">申请时间</label>
|
||||
<view class="form-input-inline">
|
||||
<uni-datetime-picker v-model="screen.start_time" type="datetime" placeholder="请选择开始时间" :clearIcon="false" />
|
||||
</view>
|
||||
<view class="form-input-inline">
|
||||
<uni-datetime-picker v-model="screen.end_time" type="datetime" placeholder="请选择结束时间" :clearIcon="false" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="common-form-item">
|
||||
<view class="form-inline common-btn-wrap">
|
||||
<button type="default" class="screen-btn" @click="search()">筛选</button>
|
||||
<button type="default" @click="reset()">重置</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<uni-data-table url="/store/storeapi/withdraw/page" :cols="cols" ref="table">
|
||||
<template v-slot:action="data">
|
||||
<view class="common-table-action"><text @click="detail(data)">查看详情</text></view>
|
||||
</template>
|
||||
</uni-data-table>
|
||||
|
||||
<uni-popup ref="detailPopup">
|
||||
<view class="pop-box">
|
||||
<view class="pop-header">
|
||||
<view class="pop-header-text">结算详情</view>
|
||||
<view class="pop-header-close" @click="$refs.detailPopup.close()">
|
||||
<text class="iconguanbi1 iconfont"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pop-content common-scrollbar" v-if="withdrawDetail">
|
||||
<view class="pop-content-item">
|
||||
<view class="pop-content-text">结算信息</view>
|
||||
<view class="pop-contents-text">结算编号:{{ withdrawDetail.withdraw_no }}</view>
|
||||
<view class="pop-contents-text">结算状态:{{ withdrawDetail.status_name }}</view>
|
||||
<view class="pop-contents-text">结算金额:{{ withdrawDetail.money | moneyFormat }}</view>
|
||||
<view class="pop-contents-text">结算方式:{{ withdrawDetail.transfer_type_name }}</view>
|
||||
<view class="pop-contents-text">结算类型:{{ withdrawDetail.settlement_type_name }}</view>
|
||||
<view class="pop-contents-text">结算申请时间:{{ withdrawDetail.apply_time | timeFormat }}</view>
|
||||
<view class="pop-contents-text" v-if="withdrawDetail.transfer_type == 'bank'">银行名称:{{ withdrawDetail.bank_name }}</view>
|
||||
<view class="pop-contents-text">结算收款账号:{{ withdrawDetail.account_number }}</view>
|
||||
<view class="pop-contents-text">结算方式:{{ withdrawDetail.transfer_type_name }}</view>
|
||||
<view class="pop-contents-text">真实姓名:{{ withdrawDetail.realname }}</view>
|
||||
</view>
|
||||
<view class="pop-content-item" v-if="withdrawDetail.settlement_type != 'apply'">
|
||||
<view class="pop-content-text">周期结算</view>
|
||||
<view class="pop-contents-text">周期结算编号:{{ withdrawDetail.settlement_info.settlement_no }}</view>
|
||||
<view class="pop-contents-text">周期开始时间:{{ withdrawDetail.settlement_info.start_time }}</view>
|
||||
<view class="pop-contents-text">周期结束时间:{{ withdrawDetail.settlement_info.end_time }}</view>
|
||||
<view class="pop-contents-text">结算订单总额:{{ withdrawDetail.settlement_info.order_money }}</view>
|
||||
<view class="pop-contents-text">结算总分销佣金:{{ withdrawDetail.settlement_info.commission }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</base-page>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getWithdrawScreen,
|
||||
withdrawDetail
|
||||
} from '@/api/settlement.js';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
screen: {
|
||||
page: 1,
|
||||
start_time: '',
|
||||
end_time: '',
|
||||
withdraw_no: '',
|
||||
transfer_type: '',
|
||||
settlement_type: '',
|
||||
status: 'all'
|
||||
},
|
||||
userList: [],
|
||||
cols: [{
|
||||
width: 12,
|
||||
title: '结算方式',
|
||||
field: 'transfer_type_name',
|
||||
align: 'left'
|
||||
}, {
|
||||
width: 12,
|
||||
title: '结算类型',
|
||||
field: 'settlement_type_name',
|
||||
align: 'left'
|
||||
}, {
|
||||
width: 12,
|
||||
title: '结算金额',
|
||||
align: 'left',
|
||||
return: data => {
|
||||
return this.$util.moneyFormat(data.money);
|
||||
}
|
||||
}, {
|
||||
width: 12,
|
||||
title: '结算状态',
|
||||
field: 'status_name'
|
||||
}, {
|
||||
width: 15,
|
||||
title: '申请时间',
|
||||
align: 'center',
|
||||
return: data => {
|
||||
return data.apply_time ? this.$util.timeFormat(data.apply_time) : '';
|
||||
}
|
||||
}, {
|
||||
width: 15,
|
||||
title: '转账时间',
|
||||
align: 'center',
|
||||
return: data => {
|
||||
return data.transfer_time ? this.$util.timeFormat(data.transfer_time) : '';
|
||||
}
|
||||
}, {
|
||||
width: 20,
|
||||
title: '操作',
|
||||
action: true, // 表格操作列
|
||||
align: 'right'
|
||||
}],
|
||||
status: [],
|
||||
settlementType: [],
|
||||
transferType: [],
|
||||
withdrawDetail: null
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.getScreenContent();
|
||||
},
|
||||
methods: {
|
||||
switchStoreAfter() {
|
||||
this.screen = {
|
||||
page: 1,
|
||||
start_time: '',
|
||||
end_time: ''
|
||||
};
|
||||
this.$refs.table.load();
|
||||
},
|
||||
search() {
|
||||
this.$refs.table.load(this.screen);
|
||||
},
|
||||
reset() {
|
||||
this.screen = {
|
||||
page: 1,
|
||||
start_time: '',
|
||||
end_time: '',
|
||||
withdraw_no: '',
|
||||
transfer_type: '',
|
||||
settlement_type: '',
|
||||
status: 'all'
|
||||
};
|
||||
},
|
||||
getScreenContent() {
|
||||
getWithdrawScreen().then(res => {
|
||||
if (res.code == 0) {
|
||||
this.status = Object.keys(res.data.status).map(index => {
|
||||
return {
|
||||
value: index,
|
||||
label: res.data.status[index]
|
||||
};
|
||||
});
|
||||
this.settlementType = Object.keys(res.data.settlement_type).map(index => {
|
||||
return {
|
||||
value: index,
|
||||
label: res.data.settlement_type[index]
|
||||
};
|
||||
});
|
||||
this.transferType = Object.keys(res.data.transfer_type_list).map(index => {
|
||||
return {
|
||||
value: index,
|
||||
label: res.data.transfer_type_list[index]
|
||||
};
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
selectTransferType(index) {
|
||||
this.screen.transfer_type = index == -1 ? '' : this.transferType[index].value;
|
||||
},
|
||||
selectSettlementType(index) {
|
||||
this.screen.settlement_type = index == -1 ? '' : this.settlementType[index].value;
|
||||
},
|
||||
selectStatus(index) {
|
||||
this.screen.status = index == -1 ? 'all' : this.status[index].value;
|
||||
},
|
||||
detail(data) {
|
||||
withdrawDetail(data.value.withdraw_id).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.withdrawDetail = res.data;
|
||||
this.$refs.detailPopup.open('center');
|
||||
}
|
||||
});
|
||||
},
|
||||
backFn() {
|
||||
this.$util.redirectTo('/pages/store/settlement');
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.manage {
|
||||
position: relative;
|
||||
background-color: #fff;
|
||||
padding: 0.15rem;
|
||||
height: 100vh;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
// 筛选面板
|
||||
.screen-warp {
|
||||
padding: 0.15rem;
|
||||
background-color: #f2f3f5;
|
||||
margin-bottom: 0.15rem;
|
||||
display: flex;
|
||||
justify-content: start;
|
||||
flex-direction: column;
|
||||
|
||||
/deep/ .uni-date-x {
|
||||
height: 0.35rem;
|
||||
}
|
||||
|
||||
/deep/ .uni-select-lay {
|
||||
background: #fff;
|
||||
|
||||
.uni-select-lay-select {
|
||||
height: 0.37rem;
|
||||
}
|
||||
}
|
||||
|
||||
.primary-btn {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
&>* {
|
||||
margin-right: 0.15rem;
|
||||
}
|
||||
}
|
||||
|
||||
// pop弹框
|
||||
.pop-box {
|
||||
background: #ffffff;
|
||||
width: 5rem;
|
||||
height: 60vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.pop-header {
|
||||
width: 100%;
|
||||
padding: 0 0.15rem 0 0.2rem;
|
||||
height: 0.5rem;
|
||||
// width: 3.5rem;
|
||||
margin: 0 auto;
|
||||
line-height: 0.5rem;
|
||||
border-bottom: 0.01rem solid #f0f0f0;
|
||||
font-size: 0.14rem;
|
||||
color: #333;
|
||||
overflow: hidden;
|
||||
border-radius: 0.02rem 0.2rem 0 0;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.pop-header-text {
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.pop-header-close {
|
||||
cursor: pointer;
|
||||
|
||||
text {
|
||||
font-size: 0.18rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.pop-content {
|
||||
flex: 1;
|
||||
height: 0;
|
||||
padding: 0.1rem 0.2rem;
|
||||
box-sizing: border-box;
|
||||
font-weight: 900;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.pop-contents {
|
||||
margin-top: 0.3rem;
|
||||
width: 3rem;
|
||||
height: 0.8rem;
|
||||
padding: 0.1rem 0.2rem;
|
||||
box-sizing: border-box;
|
||||
font-weight: 900;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.pop-content-item {
|
||||
margin-left: 0.3rem;
|
||||
}
|
||||
|
||||
.pop-content-items {
|
||||
margin-left: 0.3rem;
|
||||
}
|
||||
|
||||
.pop-content-text {
|
||||
padding: 0.1rem;
|
||||
}
|
||||
|
||||
.pop-contents-text {
|
||||
margin-left: 0.4rem;
|
||||
font-weight: normal;
|
||||
padding: 0.1rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user