代码更新

This commit is contained in:
GaoHao
2025-03-04 18:30:16 +08:00
parent fd0c452a76
commit 4f65b08c06
32 changed files with 622 additions and 1616 deletions

View File

@@ -1,311 +0,0 @@
<template>
<view>
<view class=" u-font-28 min-page bg-gray default-box-padding">
<view class="bg-fff border-r-18 default-box-padding">
<view class="u-m-t-24">
<view class="font-bold">开班时间</view>
<view class="u-m-t-16 u-flex u-row-between u-p-b-24 border-bottom">
<view>
<uni-dateformat format="yyyy-MM-dd hh:mm:ss" :date="form.kaibanTime"></uni-dateformat>
<text></text>
</view>
<view class="u-flex">
<uni-icons type="right" color="#999" size="16"></uni-icons>
</view>
</view>
</view>
<view class="u-m-t-24">
<view class="font-bold">交班时间</view>
<view class="u-m-t-16 u-flex u-row-between u-p-b-24 border-bottom">
<view>
<uni-dateformat format="yyyy-MM-dd hh:mm:ss" :date="form.jiaobanTime"></uni-dateformat>
<text></text>
</view>
</view>
</view>
<view class="u-m-t-24">
<view class="font-bold">交班人</view>
<view class="u-m-t-16 u-flex u-row-between u-p-b-24 border-bottom">
<view>
<text class="color-999" v-if="form.banciItem===''">暂未选择</text>
<text v-else>
{{form.banciItem.name}}
</text>
</view>
<view class="u-flex">
<uni-icons type="right" color="#999" size="16"></uni-icons>
</view>
</view>
</view>
<view class="u-m-t-24">
<view class="font-bold">班次</view>
<view class="u-m-t-16 u-flex u-row-between u-p-b-24 ">
<view>
<text class="color-999" v-if="form.banciItem===''">暂未选择</text>
<text v-else>
{{form.banciItem.name}}
</text>
</view>
<view class="u-flex">
<uni-icons type="right" color="#999" size="16"></uni-icons>
</view>
</view>
</view>
</view>
<view class="bg-fff u-m-t-32 border-r-18 default-box-padding">
<view class="u-flex list u-text-center u-flex-wrap">
<view class="item u-m-b-32" v-for="(item,index) in form.infolists" :key="index">
<view class="color-666 u-font-24">{{item.name}}</view>
<view class="u-m-t-8 color-333">{{item.value}}</view>
</view>
</view>
</view>
<view style="height: 200rpx;"></view>
</view>
</view>
<view class="u-fixed bottom u-flex bg-fff ">
<view class="u-absolute u-flex" @tap="toggleIsDayin">
<label class="radio">
<radio @tap.stop="toggleIsDayin" :checked="form.isDayin" class="scale7" />
</label>
<text class="color-333 u-font-32">打印</text>
</view>
<view class="u-flex-1">
<my-button bgColor="#333" color="#fff" borderRadius="100rpx 0 0 100rpx" shape="circle" plain type="primary"
@tap="back">返回</my-button>
</view>
<view class="u-flex-1">
<my-button borderRadius="0 100rpx 100rpx 0" shape="circle" type="primary" @tap="jiaoban">确认交班</my-button>
</view>
</view>
</template>
<script setup>
import {
reactive
} from 'vue';
import myButton from '@/components/my-components/my-button';
const form = reactive({
isDayin:false,
kaibanTime: '2024-07-29 11:47:28',
jiaobanTime: '2024-07-29 11:47:28',
banciItem: {
name: '班次'
},
infolists: [{
name: '微信实际到账',
value: 0
},
{
name: '支付宝实际到账',
value: 0
},
{
name: '订单总数',
value: 0
},
{
name: '订单总额',
value: 0
},
{
name: '订单微信支付额',
value: 0
},
{
name: '订单支付宝支付额',
value: 0
},
{
name: '订单余额支付额',
value: 0
},
{
name: '订单线下支付额',
value: 0
},
{
name: '订单退款成功数',
value: 0
},
{
name: '订单退款成功额',
value: 0
},
{
name: '支付宝退款金额',
value: 0
},
{
name: '余额退款金额',
value: 0
},
{
name: '线下退款金额',
value: 0
},
{
name: '堂食订单数',
value: 0
},
{
name: '自取订单额',
value: 0
},
{
name: '外卖订单数',
value: 0
},
{
name: '外卖订单额',
value: 0
},
{
name: '满减金额',
value: 0
},
{
name: '积分抵扣金额',
value: 0
},
{
name: '优惠券抵扣金额',
value: 0
},
{
name: '会员抵扣金额',
value: 0
},
{
name: '堂食退款金额',
value: 0
},
{
name: '堂食实际收入',
value: 0
},
{
name: '外卖实际收入',
value: 0
},
{
name: '外卖退款金额',
value: 0
},
{
name: '自取退款金额',
value: 0
},
{
name: '自取实际收入',
value: 0
},
{
name: '配送费收入',
value: 0
},
{
name: '配送费退款金额',
value: 0
},
{
name: '配送费实际收入',
value: 0
},
{
name: '挂账金额',
value: 0
},
{
name: '商家减免金额',
value: 0
},
{
name: '开通会员数',
value: 0
},
{
name: '开通会员收入',
value: 0
},
{
name: '充值数',
value: 0
},
{
name: '充值赠送额',
value: 0
},
{
name: '收银笔数',
value: 0
},
{
name: '收银金额',
value: 0
},
{
name: '充值额',
value: 0
},
{
name: '微信收银金额',
value: 0
},
{
name: '余额收银金额',
value: 0
},
{
name: '支付宝收银金额',
value: 0
},
]
})
function toggleIsDayin(){
form.isDayin=!form.isDayin
}
function back(){
uni.navigateBack()
}
function jiaoban(){
}
</script>
<style lang="scss" scoped>
.list {
.item {
width: 33.333%;
}
}
.bottom {
background-color: transparent;
bottom: 84rpx;
left: 28rpx;
right: 28rpx;
.u-absolute{
bottom: 100%;
margin-bottom: 32rpx;
right: 0;
}
}
</style>

View File

@@ -1,27 +1,13 @@
<template>
<view class="top fixed-top bg-fff">
<!-- <my-tabs :list="tabs.list" @change="tabsChange"></my-tabs> -->
<view class="u-flex color-main u-m-t-32 " v-if="tabs.current===1">
<!-- <view class="u-flex u-p-l-20 " @tap="showJiaobanPickerView">
<view class=" u-flex u-row-between ">
<view>
<text class="" v-if="filters.jiaobanSelItem===''">暂未选择</text>
<text v-else>
{{filters.jiaobanSelItem.name}}
</text>
</view>
<view class="u-flex u-p-l-20 u-flex-1">
<image src="/pageWorkControl/static/images/icon-arrow-down-fill.svg"
class="icon-arrow-down-fill " mode=""></image>
</view>
</view>
</view> -->
<view class="u-flex color-main u-m-t-32 ">
<view class="u-flex u-p-l-20 u-flex-1 u-row-center">
<view @tap="timeToggle">
<view class=" u-font-24 color-main u-flex" v-if="filters.time.start&&filters.time.end">
<text>{{timeFormat(filters.time.start, 'yyyy年mm月dd日') || '开始'}}</text>
<view class=" u-font-24 color-main u-flex" v-if="pageData.time.start&&pageData.time.end">
<text>{{timeFormat(pageData.time.start, 'yyyy年mm月dd日') || '开始'}}</text>
<text class="u-p-l-10 u-p-r-10"></text>
<text>{{timeFormat(filters.time.end, 'yyyy年mm月dd日') || '结束'}}</text>
<text>{{timeFormat(pageData.time.end, 'yyyy年mm月dd日') || '结束'}}</text>
</view>
<view class="" v-else>所有时间</view>
@@ -33,385 +19,121 @@
</view>
</view>
</view>
<template v-if="tabs.current===0">
<view class="color-333 u-font-28 min-page bg-gray default-box-padding" style="padding-top: 43px;">
<view class="bg-fff border-r-12 default-box-padding">
<view>
<view class="font-bold">是否打印销售区间的商品数据</view>
<view class="u-m-t-16 u-flex u-row-between u-p-b-24 border-bottom">
<view>
<text>
{{banci.switchvalue?'打印':'不打印'}}
</text>
</view>
<view class="u-flex">
<up-switch v-model="banci.switchvalue"></up-switch>
</view>
</view>
<!--<view class="font-bold">班次</view>
<view class="u-m-t-16 u-flex u-row-between u-p-b-24 border-bottom" @tap="showJiaobanPickerView">
<view>
<text class="color-999" v-if="banci.selItem===''">暂未选择</text>
<text v-else>
{{banci.selItem.name}}
</text>
</view>
<view class="u-flex">
<uni-icons type="right" color="#999" size="16"></uni-icons>
</view>
</view> -->
<!-- <picker @change="banciChange" :value="banci.current" range-key="name" :range="banci.list">
<view class="u-m-t-16 u-flex u-row-between u-p-b-24 border-bottom">
<view>
<text class="color-999" v-if="banci.current===''">暂未选择</text>
<text v-else>
{{banci.list[banci.current].name}}
</text>
</view>
<view class="u-flex">
<uni-icons type="right" color="#999" size="16"></uni-icons>
</view>
</view>
</picker> -->
</view>
<!-- <view class="u-m-t-24">
<view class="font-bold">开班时间</view>
<view class="u-m-t-16 u-flex u-row-between u-p-b-24 border-bottom" @tap="jiaobanStartShow">
<view>
<uni-dateformat format="yyyy-MM-dd hh:mm:ss" :date="form.kaibanTime"></uni-dateformat>
<text></text>
</view>
<view class="u-flex">
<uni-icons type="right" color="#999" size="16"></uni-icons>
</view>
</view>
</view>
<view class="u-m-t-24">
<view class="font-bold">交班时间</view>
<view class="u-m-t-16 u-flex u-row-between u-p-b-24 border-bottom">
<view>
<uni-dateformat format="yyyy-MM-dd hh:mm:ss" :date="form.jiaobanTime"></uni-dateformat>
<text></text>
</view>
<view class="u-flex">
<uni-icons type="right" color="#999" size="16"></uni-icons>
</view>
</view>
</view> -->
</view>
</view>
</template>
<template v-if="tabs.current===1">
<template>
<view class="color-333 u-font-28 min-page bg-gray default-box-padding" style="padding-top:80px;">
<scroll-view :scroll-x="true" class="bg-fff table u-text-center">
<view class="bg-fff border-r-12 u-flex no-wrap u-col-top">
<view class="constantbox">
<view class="constantboxitem">
<view class="head">班次号</view>
<!-- <view class="head">班次</view> -->
<view class="head">交班人</view>
<view class="head">开班时间</view>
<view class="head">交班时间</view>
<view class="head">订单数</view>
<view class="head">订单金额()</view>
</view>
<view class="constantboxitem" v-for="(item,index) in tableData.data" :key="index"
<view class="constantboxitem" v-for="(item,index) in pageData.tableData.data" :key="index"
@click="toDetail(item)">
<view class="head">{{item.dutyId|| '无'}}</view>
<view class="head">{{item.staffName || '无'}}</view>
<view class="head">{{item.startTime|| '无'}}</view>
<view class="head">{{item.endTime|| '无'}}</view>
<view class="head">{{item.orderNum|| '无'}}</view>
<view class="head">{{item.totalAmount|| '无'}}</view>
<view class="head">{{item.loginTime|| '无'}}</view>
<view class="head">{{item.handoverTime|| '无'}}</view>
<view class="head">{{item.orderCount|| '无'}}</view>
<view class="head">{{item.handAmount|| '无'}}</view>
</view>
</view>
</view>
</scroll-view>
<up-loadmore :status="tableData.status" />
<up-loadmore :status="pageData.tableData.status" />
<view style="height: 100px;"></view>
</view>
</template>
<view class="u-fixed bottom u-flex bg-fff ">
<!-- <view class="u-flex-1">
<my-button bgColor="#333" color="#fff" borderRadius="100rpx 0 0 100rpx" shape="circle" plain type="primary"
@tap="toSetting">设置</my-button>
</view> -->
<!-- <view class="u-flex-1">
<my-button borderRadius="0 100rpx 100rpx 0" shape="circle" type="primary" @tap="jiaoban">开始交班</my-button>
<my-button borderRadius="100rpx" shape="circle" type="primary" @tap="jiaoban">开始交班</my-button>
</view> -->
</view>
<!-- 交班开班时间选择 -->
<my-date-pickerview @confirm="jiaobanPickerConfirm" :defaultTime="jiaobanDateIndex" :isArea="false"
ref="jiaobanDatePicker"></my-date-pickerview>
<!-- 交班记录时间筛选 -->
<my-date-pickerview @confirm="datePickerConfirm" mode="date" ref="datePicker"></my-date-pickerview>
<!-- 班次选择 -->
<my-pickerview autoClear @confirm="banciConfirm" :showTitle="false" range-key="name" ref="jiaobanPickerView"
:list="banci.list"></my-pickerview>
</template>
<script setup>
import {
onLoad,
onReady,
onHide,
onShow,
onPageScroll,
onPullDownRefresh,
onReachBottom,
} from '@dcloudio/uni-app';
import {
computed,
reactive,
ref,
watch
} from 'vue';
import { onHide, onShow, onReachBottom } from '@dcloudio/uni-app';
import { reactive, ref, watch } from 'vue';
import myButton from '@/components/my-components/my-button';
import myTabs from '@/components/my-components/my-tabs';
import color from '@/commons/color.js';
import myDatePickerview from '@/components/my-components/my-date-pickerview'
import myPickerview from '@/components/my-components/my-pickerview'
import {
timeFormat
} from '@/node_modules/uview-plus';
import { timeFormat } from '@/node_modules/uview-plus';
import go from '@/commons/utils/go.js'
import {
tbHandover,
handoverData
} from '@/http/yskApi/pageWorkControl.js'
function toDetail(item) {
// go.to('PAGES_WORK_HANDOVER_DETAIL', item)
}
import { getHandoverRecord } from '@/api/handover.js'
function toSetting() {
go.to('PAGES_WORK_SETTING')
}
const jiaoban = async () => {
// if (banci.selItem === '') {
// return uni.showToast({
// title: '请选择班次',
// icon: 'none'
// })
// }
// go.to('PAGES_WORK_HANDOVER_CONFIRM')
uni.showModal({
title: '提示',
content: '确认交班吗?',
success: async (res) => {
if (res.confirm) {
await handoverData({
isprintProduct: banci.switchvalue
})
uni.clearStorageSync()
uni.reLaunch({
url: '/pages/login/index'
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
})
}
const query = reactive({
createdAt: [],
proName: '',
cateId: '',
sort: 'id,desc'
})
const tableData = reactive({
data: [],
page: 0,
size: 15,
total: 0,
status: 'loadmore'
})
const jiaobanDatePicker = ref(null)
function jiaobanStartShow() {
jiaobanDatePicker.value.open()
}
const jiaobanPickerView = ref(null)
function showJiaobanPickerView() {
jiaobanPickerView.value.open()
}
function jiaobanPickerConfirm(e) {
form.kaibanTime = e
}
const form = reactive({
kaibanTime: new Date(),
jiaobanTime: new Date()
})
const jiaobanDateIndex = ref([
form.kaibanTime.getFullYear(),
form.kaibanTime.getMonth(),
form.kaibanTime.getDate(),
form.kaibanTime.getHours(),
form.kaibanTime.getMinutes(),
form.kaibanTime.getSeconds(),
])
let timer = null
function updateJiaoban() {
clearInterval(timer)
timer = setInterval(() => {
form.jiaobanTime = new Date()
}, 1000)
}
const banci = reactive({
list: [{
name: '早班',
value: 1
},
{
name: '中班',
value: 2
},
{
name: '晚班',
value: 3
},
],
selItem: '',
current: '',
switchvalue: false
})
function banciConfirm(e) {
if (tabs.current) {
filters.jiaobanSelItem = e[0]
} else {
banci.selItem = e[0]
}
}
function banciChange(e) {
banci.current = e.detail.value
}
const tabs = reactive({
list: ['交班', '交班记录'],
current: 1
})
// 切换tab
function tabsChange(i) {
console.log(i)
tabs.current = i
// 清除时间
clearTime()
if (tabs.current == 1) {
resetHandle()
} else {}
}
const filters = reactive({
jiaobanCurrent: '',
jiaobanSelItem: '',
const pageData = reactive({
time: {
start: '',
end: ''
},
query: {
page: 1,
size: 10,
beginDate: '',
endDate: ''
},
tableData: {
data: [],
page: 0,
size: 15,
total: 0,
status: 'loadmore'
}
})
// 清除时间
function clearTime() {
filters.time.start = ''
filters.time.end = ''
}
function timeToggle() {
datePicker.value.toggle()
}
const datePicker = ref(null)
function datePickerConfirm(e) {
filters.time.start = new Date(e.start.replaceAll('-', '/')).getTime()
filters.time.end = new Date(e.end.replaceAll('-', '/')).getTime()
onShow(() => {
getTableData()
}
// 重置列表
function resetHandle() {
query.sort = 'id,desc'
tableData.data = []
tableData.page = 0
tableData.size = 15
tableData.total = 0
getTableData()
}
// 列表
const getTableData = async () => {
tableData.status = 'loading';
let urlData = null
if (!filters.time.start) {
urlData =
`page=${tableData.page}&size=${tableData.size}&shopId=${uni.getStorageSync('shopId')}&sort=${query.sort}`
} else {
urlData =
`page=${tableData.page}&size=${tableData.size}&shopId=${uni.getStorageSync('shopId')}&tradeDay=${timeFormat(filters.time.start,'yyyymmdd')}&tradeDay=${timeFormat(filters.time.end,'yyyymmdd')}&sort=${query.sort}`
})
onReachBottom(() => {
if (pageData.tableData.status != 'nomore') {
pageData.tableData.page++
getTableData()
}
let res = await tbHandover(urlData)
tableData.total = res.totalElements
if (tableData.page == 0 && res.content.length < 10) {
tableData.data = res.content
tableData.status = 'nomore'
})
/**
* 获取交班记录
*/
const getTableData = async () => {
pageData.tableData.status = 'loading';
let res = await getHandoverRecord(pageData.query)
pageData.tableData.total = res.totalRow
if (pageData.tableData.page == 1 && res.records.length < 10) {
pageData.tableData.data = res.records
pageData.tableData.status = 'nomore'
return false;
} else {
setTimeout(() => {
tableData.data = [...tableData.data, ...res.content]
if (tableData.data.length >= tableData.total) tableData.status = 'nomore';
else tableData.status = 'loadmore';
pageData.tableData.data = [...pageData.tableData.data, ...res.records]
if (pageData.tableData.data.length >= pageData.tableData.total) pageData.tableData.status = 'nomore';
else pageData.tableData.status = 'loadmore';
}, 500)
}
}
onShow(() => {
form.jiaobanTime = new Date()
updateJiaoban()
resetHandle()
})
onHide(() => {
clearInterval(timer)
})
/**
* 选择时间
*/
function timeToggle() {
datePicker.value.toggle()
}
/**
* 筛选时间确认
* @param {Object} e
*/
function datePickerConfirm(e) {
pageData.tableData.query.beginDate = timeFormat(new Date(e.start.replaceAll('-', '/')).getTime())
pageData.tableData.query.endDate = timeFormat(new Date(e.end.replaceAll('-', '/')).getTime())
pageData.time.start = new Date(e.start.replaceAll('-', '/')).getTime()
pageData.time.end = new Date(e.end.replaceAll('-', '/')).getTime()
getTableData()
}
function toDetail(item) {
// go.to('PAGES_WORK_HANDOVER_DETAIL', item)
}
onReachBottom(() => {
if (tableData.status != 'nomore') {
tableData.page++
getTableData()
}
})
watch(() => tabs.current, (newval) => {
if (newval) {
clearInterval(timer)
filters.jiaobanSelItem = ''
} else {
banci.selItem = ''
updateJiaoban()
}
})
</script>
<style lang="scss" scoped>

View File

@@ -1,250 +0,0 @@
<template>
<my-model ref="model" :borderRadius="18" :title="title" iconColor="#000" @close="resetForm">
<template #desc>
<view class="u-text-left u-p-30 ">
<view class="u-m-t-40 ">
<view>班名次</view>
<view class="u-p-l-32 border u-m-t-24 u-flex-1">
<uni-easyinput paddingNone :inputBorder="false" v-model="form.name"
placeholder="请输入班次名称"></uni-easyinput>
</view>
</view>
<template v-if="active!=1">
<view class="u-m-t-40 " @tap="timePickerShow(form.start,'start')">
<view>开始时间</view>
<view class="u-p-l-32 border lh35 u-flex u-m-t-24 u-flex-1">
<view class="u-flex">
<image src="/pageWorkControl/static/images/icon-time.svg" class="icon-time" mode=""></image>
</view>
<view class="u-m-l-12">
<text v-if="!form.start" class="color-666">请选择开始时间</text>
<text v-else>{{form.start}}</text>
</view>
</view>
</view>
<view class="u-m-t-40 " @tap="timePickerShow(form.end,'end')">
<view>结束时间</view>
<view class="u-p-l-32 border lh35 u-flex u-m-t-24 u-flex-1">
<view class="u-flex">
<image src="/pageWorkControl/static/images/icon-time.svg" class="icon-time" mode=""></image>
</view>
<view class="u-m-l-12">
<text v-if="!form.end" class="color-666">请选择结束时间</text>
<text v-else>{{form.end}}</text>
</view>
</view>
</view>
</template>
</view>
</template>
<template #btn>
<view class="u-p-30">
<view class="u-m-t-10">
<my-button @tap="confirm" shape="circle" showShadow>{{props.title==='添加'?'添加':'提交'}}</my-button>
<my-button type="cancel" bgColor="#fff" @tap="close">取消</my-button>
</view>
</view>
</template>
</my-model>
<my-pickerview autoClear :isLink="false" mode="time" @confirm="timeConfirm" :showTitle="false" ref="timePicker"
:defaultIndex="times.defaultIndex"
></my-pickerview>
</template>
<script setup>
import {
reactive,
nextTick,
ref
} from 'vue';
import myPickerview from '@/components/my-components/my-pickerview'
import myModel from '@/components/my-components/my-model.vue'
import myButton from '@/components/my-components/my-button.vue'
const props = defineProps({
active:{
type:[String,Number],
default:1
},
mode:{
//time none
type:String,
default:'none'
},
title: {
type: String,
default: ''
},
data: {
type: Array,
default: []
}
})
function timeConfirm(e){
form[times.selType]=e.join(':')
}
const times=reactive({
defaultIndex:[0,0],
selType:'',
})
const timePicker = ref(null)
function timePickerShow(time,timeshowKey){
times.selType=timeshowKey
const date=new Date()
if(time===''){
times.defaultIndex=[date.getHours(),date.getMinutes()]
}else{
console.log(time.split(':').map(v=>parseInt(v)));
times.defaultIndex=time.split(':').map(v=>parseInt(v))
}
timePicker.value.open()
}
function currentPriceChange(newval){
nextTick(()=>{
form.discount=(newval*100/form.price).toFixed()
})
}
function discountChange(newval){
nextTick(()=>{
form.currentPrice=(form.price*newval/100).toFixed(2)
})
}
const $form = {
name:'',
start:'',
end:'',
}
const form = reactive({
...$form
})
function resetForm() {
Object.assign(form, {
...$form
})
}
const model = ref(null)
function open(item) {
if(item){
Object.assign(form,item)
}
model.value.open()
emits('open')
}
function close() {
model.value.close()
resetForm()
emits('close')
}
const emits = defineEmits(['confirm','close','open'])
function confirm() {
const {
name,start,end
} = form
if(!name){
return uni.showToast({
title:'请输入班次名',
icon:'none'
})
}
if(props.active==0){
if(!start){
return uni.showToast({
title:'请选择开始时间',
icon:'none'
})
}
if(!end){
return uni.showToast({
title:'请选择结束时间',
icon:'none'
})
}
}
emits('confirm',{...form})
close()
}
defineExpose({
open,
close
})
</script>
<style lang="scss">
.lh35{
line-height: 35px;
}
.icon-time{
width: 28rpx;
height: 28rpx;
}
.border{
border-radius: 8rpx;
}
.lh34 {
line-height: 34rpx;
}
.tag {
background-color: #fff;
border: 1px solid #E5E5E5;
line-height: inherit;
font-size: 24rpx;
color: #666666;
padding: 6rpx 20rpx;
border-radius: 8rpx;
&.active {
border-color: #E6F0FF;
color: $my-main-color;
}
}
.hover-class {
background-color: #E5E5E5;
}
.discount {
.u-absolute {
top: 0;
bottom: 0;
right: 0;
}
}
.bg1 {
background: #F7F7FA;
}
.tab {
padding: 0 80rpx;
}
.border {
border: 1px solid #E5E5E5;
border-radius: 4rpx;
}
.input-box {
padding: 22rpx 32rpx;
font-size: 28rpx;
color: #666;
}
.placeholder-class {
font-size: 28rpx;
}
</style>

View File

@@ -1,235 +0,0 @@
<template>
<view class="min-page bg-gray u-p-30 u-font-28 color-333">
<view class="bg-fff border-r-12 default-box-padding">
<view class="font-bold">交班模式</view>
<view class="u-m-t-24">
<radio-group @change="jiaobanModelChange">
<label class="radio u-m-r-60" v-for="(item,index) in jiaobanModel.list" :key="index">
<radio :value="''+index" :checked="index == jiaobanModel.active" class="scale7 " />
<text>{{item.label}}</text>
</label>
</radio-group>
</view>
</view>
<template v-if="jiaobanModel.active==0">
<view v-for="(item,index) in bancis.timeList" :key="index" >
<view class="bg-fff u-m-t-32 border-r-12 default-box-padding">
<view class="color-666">班次</view>
<view class="u-flex u-m-t-24 u-p-b-24 border-bottom u-row-between" @tap="addBanciOpen(item,index)">
<view class="">
<text>{{item.name}}</text>
<text></text>
<text>{{item.start}}</text>
<text>-</text>
<text>{{item.end}}</text>
</view>
<view class="u-flex">
<uni-icons type="right" color="#999"></uni-icons>
</view>
</view>
<view class="u-flex u-m-t-28" @tap="listDel(bancis.timeList,index)">
<view class="u-flex">
<uni-icons size="20" type="minus-filled" :color="$colorRed"></uni-icons>
</view>
<view class="u-m-l-12 red">删除</view>
</view>
</view>
</view>
</template>
<template v-if="jiaobanModel.active==1">
<view v-for="(item,index) in bancis.list" :key="index">
<view class="bg-fff u-m-t-32 border-r-12 default-box-padding">
<view class="color-666">班次</view>
<view class="u-flex u-m-t-24 u-p-b-24 border-bottom u-row-between" @tap="addBanciOpen(item,index)">
<view class="">
{{item.name}}
</view>
<view class="u-flex">
<uni-icons type="right" color="#999"></uni-icons>
</view>
</view>
<view class="u-flex u-m-t-28" @tap="listDel(bancis.list,index)">
<view class="u-flex">
<uni-icons size="20" type="minus-filled" :color="$colorRed"></uni-icons>
</view>
<view class="u-m-l-12 red">删除</view>
</view>
</view>
</view>
</template>
<view class="bg-fff u-flex u-m-t-32 border-r-12 default-box-padding" @tap="addBanciOpen">
<uni-icons type="plus-filled" :color="color.ColorMain" size="20"></uni-icons>
<view class="u-m-l-16">添加选项</view>
</view>
<view class="bg-fff u-m-t-32 border-r-18 default-box-padding">
<view class="" v-for="(radios,index) in radioGroups" :key="index">
<view class="font-bold">{{radios.title}}</view>
<view class="u-m-t-24 u-p-b-24 u-m-b-24" :class="{'border-bottom':index<radioGroups.length-1}">
<radio-group @change="radioGroupChange($event,radios)">
<label class="radio u-m-r-60" v-for="(item,itemindex) in radios.list" :key="itemindex">
<radio :value="''+itemindex" :checked="itemindex === radios.active" class="scale7 " />
<text>{{item.label}}</text>
</label>
</radio-group>
</view>
</view>
</view>
</view>
<view class="u-fixed bottom u-flex bg-fff ">
<view class="u-flex-1">
<my-button bgColor="#333" color="#fff" borderRadius="100rpx 0 0 100rpx" shape="circle" plain type="primary"
@tap="back">返回</my-button>
</view>
<view class="u-flex-1">
<my-button @tap="confirm" borderRadius="0 100rpx 100rpx 0" shape="circle" type="primary">确定</my-button>
</view>
</view>
<add-banci @confirm="addBanciConfirm" :active="jiaobanModel.active" :title="refAddBanciTitle" ref="refAddBanci"></add-banci>
</template>
<script setup>
import color from '@/commons/color.js'
import myButton from '@/components/my-components/my-button';
import addBanci from './components/add-banci';
import {
reactive, ref
} from 'vue';
const refAddBanci=ref(null)
const refAddBanciTitle=ref('添加')
function addBanciOpen(item,index){
bancis.selIndex=index
refAddBanciTitle.value=item.hasOwnProperty('name')?'编辑':'添加'
refAddBanci.value.open(item.hasOwnProperty('name')?item:null)
}
function addBanciConfirm(e){
console.log(e);
if(refAddBanciTitle.value==='添加'){
if(jiaobanModel.active==1){
bancis.list.push(e)
}else{
bancis.timeList.push(e)
}
}
}
function listDel(list,index){
uni.showModal({
title: '提示',
content: '确定删除【'+list[index].name+'】吗?',
success: function (res) {
if (res.confirm) {
list.splice(index,1)
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
const $colorRed = '#EB4F4F'
const bancis = reactive({
selIndex:'',
timeList: [{
name: '测试',
start: '6:00',
end: '12:00'
}],
list: [{
name: '早班'
},
{
name: '中班'
},
{
name: '晚班'
}
]
})
function back() {
uni.navigateBack()
}
function confirm() {
}
const jiaobanModel = reactive({
list: [{
label: '按时间段',
value: 0
},
{
label: '自定义',
value: 1
},
],
active: 1
})
const radioBasicArr = [{
label: '统计',
value: 0
},
{
label: '不统计',
value: 1
},
]
function returnRadioGroups(arr) {
return arr.map(v => {
return {
title: v,
active: 0,
list: [...radioBasicArr],
}
})
}
const textlists = [
'订单数', '订单额', '订单微信支付金额', '订单余额支付金额', '订单线下支付金额', '订单支付宝金额',
'堂食订单数', '堂食订单金额', '自取订单数', '自取订单金额', '外卖订单数', '外卖订单金额', '退款订单数',
'成功退款金额', '微信成功退款金额', '余额成功退款金额', '线下成功退款金额', '支付宝成功退款金额', '充值数',
'充值金额', '开通会员数', '开通会员金额', '配送费', '收银笔数', '收银金额', '订单满减优惠金额', '订单积分兑换金额',
'订单优惠券减免金额', '订单会员优惠金额', '充值赠送金额', '堂食退款金额', '外卖退款金额', '自取退款金额', '配送费退款',
'配送费总额', '微信到账金额', '支付宝到账金额', '收银支付宝金额', '收银余额支付金额', '收银微信支付金额'
]
const radioGroups = reactive(returnRadioGroups(textlists))
function radioGroupChange(e, item) {
console.log(e);
console.log(item);
item.active = e.detail.value
console.log(radioGroups);
}
function jiaobanModelChange(e) {
jiaobanModel.active = e.detail.value
}
</script>
<style scoped lang="scss">
$red: #EB4F4F;
.red {
color: $red;
}
.bottom {
background-color: transparent;
bottom: 84rpx;
left: 28rpx;
right: 28rpx;
}
</style>