Merge branch 'ymf' of https://e.coding.net/g-cphe0354/cashier_front/cashier_admin_app into test
This commit is contained in:
commit
df3cf998c3
|
|
@ -0,0 +1,6 @@
|
|||
::v-deep .uni-easyinput__content-input{
|
||||
height: initial;
|
||||
}
|
||||
::v-deep .uni-forms-item{
|
||||
min-height: initial;
|
||||
}
|
||||
|
|
@ -55,12 +55,12 @@ const $PermissionObj = {
|
|||
],
|
||||
vip:[
|
||||
{
|
||||
key: '允许管理会员信息',
|
||||
text: 'yun_xu_guan_li_hui_yuan_xin_xi'
|
||||
text: '允许管理会员信息',
|
||||
key: 'yun_xu_guan_li_hui_yuan_xin_xi'
|
||||
},
|
||||
{
|
||||
key: 'yun_xu_xiu_gai_hui_yuan_yu_e',
|
||||
text: '允许修改会员余额'
|
||||
text: 'yun_xu_xiu_gai_hui_yuan_yu_e',
|
||||
key: '允许修改会员余额'
|
||||
}
|
||||
],
|
||||
stock:[
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import infoBox from "@/commons/utils/infoBox.js"
|
|||
import go from '@/commons/utils/go.js';
|
||||
// 测试服
|
||||
let baseUrl = 'https://admintestpapi.sxczgkj.cn'
|
||||
// let baseUrl = 'http://192.168.1.15:8000'
|
||||
// 王伟本地测
|
||||
// let baseUrl = '/ww'
|
||||
// let baseUrl = 'http://192.168.1.15:8000'
|
||||
|
|
@ -64,7 +65,6 @@ function commonsProcess(showLoading, httpReqCallback) {
|
|||
|
||||
return httpReqCallback().then((httpData) => {
|
||||
reqFinishFunc(); // 请求完毕的动作
|
||||
console.log(httpData,'调试1')
|
||||
// 从http响应数据中解构响应数据 [ 响应码、 bodyData ]
|
||||
let {
|
||||
statusCode,
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@
|
|||
<view class="page min-page">
|
||||
<view class="box">
|
||||
<view>
|
||||
<uni-forms :model="category" :rules="rules" err-show-type="toast" ref="form"
|
||||
:border="true" label-position="top" label-width="350">
|
||||
<uni-forms :model="category" :rules="rules" err-show-type="toast" ref="form" :border="true"
|
||||
label-position="top" label-width="350">
|
||||
<view class="block">
|
||||
<view class="border-top-0">
|
||||
<uni-forms-item label="图标">
|
||||
|
|
@ -13,14 +13,15 @@
|
|||
</view>
|
||||
<view class="">
|
||||
<uni-forms-item label="分类名称" required name="name">
|
||||
<uni-easyinput padding-none="true" :placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
||||
v-model="category.name" placeholder="输入分类名称" />
|
||||
<uni-easyinput padding-none :placeholderStyle="placeholderStyle"
|
||||
:inputBorder="inputBorder" v-model="category.name" placeholder="输入分类名称" />
|
||||
</uni-forms-item>
|
||||
</view>
|
||||
<template v-if="option.type==='edit'">
|
||||
<uni-forms-item label="排序" required name="sort">
|
||||
<uni-easyinput padding-none="true" :placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
||||
v-model="category.sort" type="number" placeholder="排序越小越靠前" />
|
||||
<uni-easyinput padding-none :placeholderStyle="placeholderStyle"
|
||||
:inputBorder="inputBorder" v-model="category.sort" type="number"
|
||||
placeholder="排序越小越靠前" />
|
||||
</uni-forms-item>
|
||||
</template>
|
||||
<uni-forms-item label="">
|
||||
|
|
@ -190,58 +191,59 @@
|
|||
</view>
|
||||
<view class="bottom" ref="bottom"></view>
|
||||
<!-- 更多操作 -->
|
||||
<my-action-sheet @itemClick="actionSheetClick" ref="refMoreSheet"
|
||||
:list="actionSheet.list"></my-action-sheet>
|
||||
<my-action-sheet @itemClick="actionSheetClick" ref="refMoreSheet" :list="actionSheet.list"></my-action-sheet>
|
||||
<!-- 添加/编辑子分类 -->
|
||||
<my-model ref="refAddChilCate" :title="refAddChilCateTitle">
|
||||
<template #desc>
|
||||
<view class="u-p-l-32 u-m-t-8 u-p-r-32 u-text-left">
|
||||
<uni-forms :model="categoryChild" :rules="rules" err-show-type="toast" :border="true"
|
||||
label-position="top" label-width="350">
|
||||
<view class="border-top-0">
|
||||
<uni-forms-item label="图标">
|
||||
<my-upload-file ref="refFile" :limit="1"
|
||||
@change="onfileChange($event,categoryChild,'pic')"
|
||||
:images="categoryChild.pic"></my-upload-file>
|
||||
</uni-forms-item>
|
||||
</view>
|
||||
<view class="">
|
||||
<uni-forms-item label="分类名称" required name="name">
|
||||
<uni-easyinput padding-none :placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
||||
v-model="categoryChild.name" placeholder="输入分类名称" />
|
||||
</uni-forms-item>
|
||||
</view>
|
||||
<template v-if="option.type==='edit'">
|
||||
<uni-forms-item label="排序" required name="sort">
|
||||
<uni-easyinput padding-none :placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
||||
v-model="categoryChild.sort" type="number" placeholder="排序越小越靠前" />
|
||||
</uni-forms-item>
|
||||
</template>
|
||||
<uni-forms-item label="">
|
||||
<view class="u-flex u-row-between u-col-center">
|
||||
<view class="label-title">开关</view>
|
||||
<view class="u-flex">
|
||||
<my-switch v-model="categoryChild.isShow"></my-switch>
|
||||
</view>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
|
||||
</view>
|
||||
|
||||
</template>
|
||||
<template #btn>
|
||||
<view class="u-flex u-p-30">
|
||||
<view class="u-flex-1 u-p-r-16">
|
||||
<my-button shape="circle" type="default" @tap="refAddChilCateClose">取消</my-button>
|
||||
</view>
|
||||
<view class="u-flex-1 u-p-l-16">
|
||||
<my-button shape="circle" @tap="refAddChilCateConfirm">确认</my-button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</my-model>
|
||||
</view>
|
||||
|
||||
<!-- 添加/编辑子分类 -->
|
||||
<my-model ref="refAddChilCate" :title="refAddChilCateTitle">
|
||||
<template #desc>
|
||||
<view class="u-p-40 u-text-left">
|
||||
<uni-forms :model="categoryChild" :rules="rules" err-show-type="toast"
|
||||
:border="true" label-position="top" label-width="350">
|
||||
<view class="border-top-0">
|
||||
<uni-forms-item label="图标">
|
||||
<my-upload-file ref="refFile" :limit="1" @change="onfileChange($event,categoryChild,'pic')"
|
||||
:images="categoryChild.pic"></my-upload-file>
|
||||
</uni-forms-item>
|
||||
</view>
|
||||
<view class="">
|
||||
<uni-forms-item label="分类名称" required name="name">
|
||||
<uni-easyinput :placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
||||
v-model="categoryChild.name" placeholder="输入分类名称" />
|
||||
</uni-forms-item>
|
||||
</view>
|
||||
<template v-if="option.type==='edit'">
|
||||
<uni-forms-item label="排序" required name="sort">
|
||||
<uni-easyinput :placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
||||
v-model="categoryChild.sort" type="number" placeholder="排序越小越靠前" />
|
||||
</uni-forms-item>
|
||||
</template>
|
||||
<uni-forms-item label="">
|
||||
<view class="u-flex u-row-between u-col-center">
|
||||
<view class="label-title">开关</view>
|
||||
<view class="u-flex">
|
||||
<my-switch v-model="categoryChild.isShow"></my-switch>
|
||||
</view>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
|
||||
</view>
|
||||
|
||||
</template>
|
||||
<template #btn>
|
||||
<view class="u-flex u-p-30">
|
||||
<view class="u-flex-1 u-p-r-16">
|
||||
<my-button shape="circle" type="default" @tap="refAddChilCateClose">取消</my-button>
|
||||
</view>
|
||||
<view class="u-flex-1 u-p-l-16">
|
||||
<my-button shape="circle" @tap="refAddChilCateConfirm">确认</my-button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</my-model>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
|
@ -270,11 +272,11 @@
|
|||
|
||||
|
||||
const refAddChilCate = ref(null)
|
||||
const refAddChilCateTitle = ref('添加子分类')
|
||||
const refAddChilCateTitle = ref('添加子分类')
|
||||
|
||||
function refAddChilCateClose() {
|
||||
refAddChilCate.value.close()
|
||||
categoryChild.value ={
|
||||
categoryChild.value = {
|
||||
...categoryBasicData
|
||||
}
|
||||
}
|
||||
|
|
@ -293,19 +295,25 @@
|
|||
if (result.length) {
|
||||
return infoBox.showToast(result[0].errMeessage)
|
||||
}
|
||||
let res=''
|
||||
if( refAddChilCateTitle.value ==='编辑子分类'){
|
||||
res= await $productCategory.update({...categoryChild.value,pid:category.id})
|
||||
categoryChild[selItem.index]=res
|
||||
}else{
|
||||
res= await $productCategory.add({...categoryChild.value,pid:category.id})
|
||||
let res = ''
|
||||
if (refAddChilCateTitle.value === '编辑子分类') {
|
||||
res = await $productCategory.update({
|
||||
...categoryChild.value,
|
||||
pid: category.id
|
||||
})
|
||||
categoryChild[selItem.index] = res
|
||||
} else {
|
||||
res = await $productCategory.add({
|
||||
...categoryChild.value,
|
||||
pid: category.id
|
||||
})
|
||||
category.childrenList.push(res)
|
||||
}
|
||||
uni.setStorageSync('cateItem',category)
|
||||
infoBox.showToast( refAddChilCateTitle.value==='编辑子分类'?'修改成功':'添加成功')
|
||||
uni.setStorageSync('cateItem', category)
|
||||
infoBox.showToast(refAddChilCateTitle.value === '编辑子分类' ? '修改成功' : '添加成功')
|
||||
refAddChilCateClose()
|
||||
}
|
||||
|
||||
|
||||
|
||||
let refMoreSheet = ref(null)
|
||||
let selItem = {
|
||||
|
|
@ -313,7 +321,7 @@
|
|||
index: ''
|
||||
}
|
||||
const actionSheet = reactive({
|
||||
list: ['编辑', '删除']
|
||||
list: ['编辑', '删除']
|
||||
})
|
||||
|
||||
function moreShow(item, index) {
|
||||
|
|
@ -324,9 +332,9 @@
|
|||
|
||||
function actionSheetClick(index) {
|
||||
console.log(index);
|
||||
if(index===0){
|
||||
refAddChilCateTitle.value='编辑子分类'
|
||||
categoryChild.value=selItem.data
|
||||
if (index === 0) {
|
||||
refAddChilCateTitle.value = '编辑子分类'
|
||||
categoryChild.value = selItem.data
|
||||
refAddChilCate.value.open()
|
||||
return
|
||||
}
|
||||
|
|
@ -339,7 +347,7 @@
|
|||
$productCategory.del([selItem.data.id]).then(res => {
|
||||
category.childrenList.splice(selItem.index, 1)
|
||||
infoBox.showToast('删除成功')
|
||||
uni.setStorageSync('cateItem',category)
|
||||
uni.setStorageSync('cateItem', category)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
@ -667,7 +675,14 @@
|
|||
$icon-size: 34rpx;
|
||||
$icon-line-width: 20rpx;
|
||||
$icon-line-height: 4rpx;
|
||||
|
||||
@import '@/commons/style/reset-uni-form.scss';
|
||||
::v-deep .uni-forms-item--border{
|
||||
padding-top: 24rpx ;
|
||||
padding-bottom: 24rpx ;
|
||||
}
|
||||
::v-deep .uni-forms-item.is-direction-top .uni-forms-item__label{
|
||||
padding-bottom: 16rpx;
|
||||
}
|
||||
.category-icon {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
|
|
@ -682,7 +697,9 @@
|
|||
.my-switch {
|
||||
transform: scale(0.7);
|
||||
}
|
||||
|
||||
::v-deep .uni-forms-item__content{
|
||||
min-height: inherit;
|
||||
}
|
||||
::v-deep .uni-forms-item__error {
|
||||
display: none !important;
|
||||
}
|
||||
|
|
@ -747,16 +764,15 @@
|
|||
.lh40 {
|
||||
line-height: 40rpx;
|
||||
}
|
||||
::v-deep .uni-forms-item.is-direction-top .uni-forms-item__label{
|
||||
padding-bottom: 24rpx;
|
||||
}
|
||||
|
||||
|
||||
.box {
|
||||
font-size: 28rpx;
|
||||
|
||||
.block {
|
||||
background: #FFFFFF;
|
||||
border-radius: 6px 18rpx 0 18rpx;
|
||||
padding: 12rpx 24rpx;
|
||||
border-radius: 18rpx;
|
||||
padding: 8rpx 24rpx;
|
||||
margin-bottom: 32rpx;
|
||||
}
|
||||
}
|
||||
|
|
@ -766,7 +782,6 @@
|
|||
left: 30rpx;
|
||||
right: 30rpx;
|
||||
bottom: 60rpx;
|
||||
|
||||
}
|
||||
|
||||
::v-deep.uni-forms-item {
|
||||
|
|
@ -789,6 +804,7 @@
|
|||
color: #fff;
|
||||
border-radius: 12rpx;
|
||||
font-size: 28rpx;
|
||||
border-radius: 100rpx;
|
||||
}
|
||||
|
||||
.btn-hover-class {
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
<template #btn>
|
||||
<view class="stock-btns u-p-b-40">
|
||||
<my-button shape="circle" @tap="goodsSortModelSave">确认修改</my-button>
|
||||
<my-button shape="circle" type="default" @tap="goodsSortModelCancel">取消</my-button>
|
||||
<my-button shape="circle" bgColor="#fff" type="default" @tap="goodsSortModelCancel">取消</my-button>
|
||||
</view>
|
||||
</template>
|
||||
</my-model>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
</view>
|
||||
|
||||
|
||||
<view class="u-m-t-32 u-flex u-col-top u-relative">
|
||||
<view class="u-m-t-24 u-flex u-col-top u-relative">
|
||||
<view v-if="props.showChecked">
|
||||
<label class="radio">
|
||||
<radio :color="ColorMain" style="transform: scale(0.7);" @click="radioClick"
|
||||
|
|
@ -31,8 +31,9 @@
|
|||
<view class="u-flex">
|
||||
<text class="u-m-r-24">{{data.name}}</text>
|
||||
</view>
|
||||
<view class="u-font-32">
|
||||
<text v-if="data.typeEnum=='单规格'||data.typeEnum=='normal'">¥</text>
|
||||
<view class="u-font-32 u-m-r-8">
|
||||
<!-- <text v-if="data.typeEnum=='单规格'||data.typeEnum=='normal'">¥</text> -->
|
||||
<text >¥</text>
|
||||
<text>{{data.lowPrice}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -233,7 +234,7 @@
|
|||
.goods {
|
||||
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
||||
background-color: #fff;
|
||||
padding: 24rpx 28rpx 16rpx 28rpx;
|
||||
padding: 32rpx 28rpx 32rpx 28rpx;
|
||||
font-size: 28rpx;
|
||||
|
||||
.skus {
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
<my-switch v-model="category.useTime"></my-switch>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="category.useTime" class="u-flex u-row-between u-col-center u-m-t-30 u-p-b-12">
|
||||
<view v-if="category.useTime" class="u-flex u-row-between u-col-center u-m-t-16 ">
|
||||
<view class="u-flex timesel" @click="changeTime('start')">
|
||||
<up-icon name="clock" size="14"></up-icon>
|
||||
<view class="u-m-l-20">
|
||||
|
|
@ -468,6 +468,7 @@
|
|||
}
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
@import '@/commons/style/reset-uni-form.scss';
|
||||
$icon-size: 34rpx;
|
||||
$icon-line-width: 20rpx;
|
||||
$icon-line-height: 4rpx;
|
||||
|
|
@ -563,7 +564,7 @@
|
|||
}
|
||||
::v-deep .uni-forms-item--border{
|
||||
padding-top: 12px;
|
||||
padding-bottom: 16px;
|
||||
padding-bottom: 12px;
|
||||
}
|
||||
.box {
|
||||
font-size: 28rpx;
|
||||
|
|
@ -571,7 +572,7 @@
|
|||
.block {
|
||||
background: #FFFFFF;
|
||||
border-radius: 12rpx 18rpx 0 18rpx;
|
||||
padding: 12rpx 24rpx;
|
||||
padding: 32rpx 24rpx 8rpx 24rpx;
|
||||
margin-bottom: 32rpx;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,32 +113,36 @@
|
|||
</template>
|
||||
</view>
|
||||
<template v-if="FormData.typeEnum=='sku' ">
|
||||
<view class="block border-top-0 u-p-t-0">
|
||||
<uni-forms-item label=" ">
|
||||
<view class="u-flex u-row-between " @tap="toGuige">
|
||||
<view class="color-333 font-bold">
|
||||
<text v-if="!skuList.list.length">选择规格</text>
|
||||
<text v-else>编辑规格</text>
|
||||
</view>
|
||||
<uni-icons type="right"></uni-icons>
|
||||
<view class="block border-top-0 u-p-t-32 u-p-b-32">
|
||||
<view class="u-flex u-row-between " >
|
||||
<view class="color-333 font-bold">
|
||||
<text v-if="!skuList.list.length">选择规格</text>
|
||||
<text v-else>编辑规格</text>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
<template v-if="skuList.list.length">
|
||||
<view class="u-flex u-col-center" @tap="toGuige">
|
||||
<view>
|
||||
<text v-if="FormData.specsInfoName">{{FormData.specsInfoName}}</text>
|
||||
<text class="color-999" v-else>请选择</text>
|
||||
</view>
|
||||
<view class="u-flex u-p-t-2">
|
||||
<uni-icons type="right" :size="14" color="#999"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <template >
|
||||
<view class="u-text-left">
|
||||
<view class="u-flex font-bold u-m-b-12">
|
||||
<view class="u-flex-1 ">组合名称</view>
|
||||
<view class="u-flex-1 ">售价</view>
|
||||
<!-- <view class="u-flex-1">库存数量</view> -->
|
||||
</view>
|
||||
<view class="u-flex u-p-b-12 u-p-t-12" v-for="(item,index) in skuList.list"
|
||||
:key="index">
|
||||
<view class="u-flex-1 ">{{item.specSnap}}</view>
|
||||
<view class="u-flex-1 ">¥{{item.salePrice}}</view>
|
||||
<!-- <view class="u-flex-1">{{item.stockNumber||0}}</view> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
</template> -->
|
||||
|
||||
</view>
|
||||
|
||||
|
|
@ -480,7 +484,7 @@
|
|||
</view>
|
||||
<view class="bootom">
|
||||
<view class="save-btn-box">
|
||||
<my-button shape="circle" @tap="save">保存</my-button>
|
||||
<my-button fontWeight="700" shape="circle" @tap="save">保存</my-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
|
@ -1009,6 +1013,7 @@
|
|||
// isShowMall: 1,
|
||||
// })
|
||||
const FormData = reactive({
|
||||
specsInfoName: '',
|
||||
id: "",
|
||||
typeEnum: "normal",
|
||||
specificationsGroup: '',
|
||||
|
|
@ -1110,6 +1115,11 @@
|
|||
}
|
||||
}
|
||||
res.skuList = (res.skuList.length ? res.skuList : [])
|
||||
let specsInfoName = ''
|
||||
for (let i in res.specsInfo) {
|
||||
specsInfoName = i
|
||||
}
|
||||
res.specsInfoName = specsInfoName
|
||||
$goodsData = res
|
||||
skuList.list = res.skuList
|
||||
Object.assign(FormData, res)
|
||||
|
|
@ -1767,9 +1777,11 @@
|
|||
padding: 0 !important;
|
||||
min-height: initial !important;
|
||||
}
|
||||
::v-deep .uni-easyinput__content-input{
|
||||
|
||||
::v-deep .uni-easyinput__content-input {
|
||||
height: inherit;
|
||||
}
|
||||
|
||||
::v-deep .none-label .uni-forms-item .uni-forms-item__label {
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@
|
|||
<up-icon :size="10" name="arrow-down-fill"></up-icon>
|
||||
</view> -->
|
||||
<view class="input u-flex" >
|
||||
<up-input @blur="blur" disabled="true" @change="filterHaocaiList" border="none" v-model="text" placeholder="请选择"></up-input>
|
||||
<view>{{text||''}}</view>
|
||||
<!-- <up-input @blur="blur" disabled="true" @change="filterHaocaiList" border="none" v-model="text" placeholder="请选择"></up-input> -->
|
||||
</view>
|
||||
<view class="u-absolute" v-if="popShow">
|
||||
<scroll-view scroll-y="true" class="scroll">
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@
|
|||
</view> -->
|
||||
</view>
|
||||
<view class="bottom">
|
||||
<my-button type="primary" shape="circle" font-weight="700" font-size="32" @click="save">保存</my-button>
|
||||
<my-button type="primary" shape="circle" font-weight="700" @click="save">保存</my-button>
|
||||
<my-button bgColor="#F9F9F9" shape="circle" color="#999" @click="cancel">取消</my-button>
|
||||
</view>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<template>
|
||||
<view class="page">
|
||||
<view class="page min-page">
|
||||
<view class="box">
|
||||
<view class="block border-top-0">
|
||||
<view class="block border-top-0 u-p-t-32 u-p-b-32">
|
||||
<uni-forms ref="nameFormRef" :model="specifications" :rules="rules" :label-width="350"
|
||||
label-position="top" validateTrigger="blur">
|
||||
<uni-forms-item label="模版名称" required name="name">
|
||||
<uni-easyinput :placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
||||
<uni-easyinput padding-none :placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
||||
v-model="specifications.name" placeholder="模版名称,如:衣服" />
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
|
|
@ -17,71 +17,81 @@
|
|||
<view class="block">
|
||||
<view class="border-top-0">
|
||||
<uni-forms-item label="规格组名" required name="name">
|
||||
<uni-easyinput :placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
||||
<uni-easyinput padding-none :placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
||||
v-model="item.name" placeholder="规格组名,如:尺码" />
|
||||
</uni-forms-item>
|
||||
</view>
|
||||
<uni-forms-item label="规格值">
|
||||
<view class="option">
|
||||
<view class="">
|
||||
<view class="u-flex option-item" v-for="(option,optionIndex) in item.options"
|
||||
:key="optionIndex">
|
||||
<view class="u-flex-1">
|
||||
<uni-forms-item :key="optionIndex" :name="['options',optionIndex,'name']"
|
||||
:ref="setFormInputRef(index,optionIndex)"
|
||||
:rules="[{'required': true,errorMessage: '必填'}]" label-width="0"
|
||||
label="" required :showRequired="false">
|
||||
<uni-easyinput
|
||||
v-model="specifications.list[index].options[optionIndex].name"
|
||||
@input="inpuChange(index,optionIndex)"
|
||||
:placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
||||
placeholder="请输入规格值,如:S、M" />
|
||||
</uni-forms-item>
|
||||
|
||||
</view>
|
||||
<view class=" u-flex" v-if="item.options.length>1">
|
||||
<uni-forms-item :key="optionIndex" label-width="0" label=""
|
||||
:showRequired="false">
|
||||
<view class="u-flex">
|
||||
<!-- <uni-easyinput v-model="specifications.list[index].options[optionIndex].optionPrice"
|
||||
@input="inpuChange(index,optionIndex)"
|
||||
|
||||
:placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
||||
type="digit" placeholder="填写价格" /> -->
|
||||
|
||||
<view class="icon icon-reduce u-m-l-38"
|
||||
@click="delOption(index,optionIndex)">
|
||||
|
||||
<view class="u-p-b-8">
|
||||
<uni-forms-item label="规格值">
|
||||
<view class="option ">
|
||||
<view class="">
|
||||
<view class="u-flex option-item u-m-t-8" v-for="(option,optionIndex) in item.options"
|
||||
:key="optionIndex">
|
||||
<view class="u-flex-1">
|
||||
<uni-forms-item :key="optionIndex" :name="['options',optionIndex,'name']"
|
||||
:ref="setFormInputRef(index,optionIndex)"
|
||||
:rules="[{'required': true,errorMessage: '必填'}]" label-width="0"
|
||||
label="" required :showRequired="false">
|
||||
<view class="bg-fff u-p-t-12 u-p-b-12" style="border-radius: 8rpx;">
|
||||
<uni-easyinput
|
||||
v-model="specifications.list[index].options[optionIndex].name"
|
||||
@input="inpuChange(index,optionIndex)"
|
||||
:placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
||||
placeholder="请输入规格值,如:S、M" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</uni-forms-item>
|
||||
|
||||
|
||||
</uni-forms-item>
|
||||
|
||||
</view>
|
||||
<view class=" u-flex" v-if="item.options.length>1">
|
||||
<uni-forms-item :key="optionIndex" label-width="0" label=""
|
||||
:showRequired="false">
|
||||
<view class="u-flex">
|
||||
<!-- <uni-easyinput v-model="specifications.list[index].options[optionIndex].optionPrice"
|
||||
@input="inpuChange(index,optionIndex)"
|
||||
|
||||
:placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
||||
type="digit" placeholder="填写价格" /> -->
|
||||
|
||||
<view class="icon icon-reduce u-m-l-38"
|
||||
@click="delOption(index,optionIndex)">
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</uni-forms-item>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-flex" @click="addOptions(index)">
|
||||
<view class="icon icon-add u-m-r-22 ">
|
||||
|
||||
<view class="u-flex u-m-t-24 " @click="addOptions(index)">
|
||||
<view class="icon icon-add u-m-r-22 ">
|
||||
|
||||
</view>
|
||||
<view class="color-main">添加规格</view>
|
||||
</view>
|
||||
<view class="color-main">添加规格</view>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
<template v-if="specifications.list.length>1">
|
||||
<view class="u-flex u-m-t-48 u-m-b-24" @click="delSpecificationsGroup(index)">
|
||||
<view class="icon icon-reduce u-m-r-22 ">
|
||||
|
||||
|
||||
</view>
|
||||
<view class="color-red">删除规格组</view>
|
||||
</uni-forms-item>
|
||||
</view>
|
||||
|
||||
<template v-if="specifications.list.length>1">
|
||||
<view class="u-p-b-32">
|
||||
<view class="u-flex " @click="delSpecificationsGroup(index)">
|
||||
<view class="icon icon-reduce u-m-r-22 ">
|
||||
|
||||
</view>
|
||||
<view class="color-red">删除规格组</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
</view>
|
||||
</uni-forms>
|
||||
</view>
|
||||
|
||||
<view class="u-flex block u-p-l-20 u-p-r-20 u-p-t-28 u-p-b-28" @click="addSpecificationsGroup">
|
||||
<view class="icon icon-add u-m-r-22 ">
|
||||
|
||||
|
|
@ -90,7 +100,7 @@
|
|||
</view>
|
||||
|
||||
<view class="save-btn-box">
|
||||
<button class="save-btn" hover-class="btn-hover-class" @click="save">保存</button>
|
||||
<button class="save-btn " hover-class="btn-hover-class" @click="save">保存</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom" ref="bottom"></view>
|
||||
|
|
@ -366,14 +376,25 @@
|
|||
|
||||
.page {
|
||||
background: #F9F9F9;
|
||||
padding: 30rpx;
|
||||
padding: 32rpx 30rpx 0 30rpx;
|
||||
padding-bottom: 200rpx;
|
||||
}
|
||||
|
||||
::v-deep .uni-forms-item--border {
|
||||
padding-top: 12px;
|
||||
padding-bottom: 12px;
|
||||
}
|
||||
.my-switch {
|
||||
transform: scale(0.7);
|
||||
}
|
||||
|
||||
::v-deep .uni-forms-item.is-direction-top .uni-forms-item__label{
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
::v-deep .uni-easyinput__content-input{
|
||||
height: inherit;
|
||||
}
|
||||
::v-deep.uni-forms-item {
|
||||
min-height: inherit;
|
||||
}
|
||||
::v-deep .uni-forms-item__error {
|
||||
display: none !important;
|
||||
}
|
||||
|
|
@ -440,13 +461,11 @@
|
|||
}
|
||||
|
||||
.box {
|
||||
margin-top: 70rpx;
|
||||
font-size: 28rpx;
|
||||
|
||||
.block {
|
||||
background: #FFFFFF;
|
||||
border-radius: 18rpx 18rpx 18rpx 18rpx;
|
||||
padding: 12rpx 24rpx;
|
||||
padding: 0 24rpx;
|
||||
margin-bottom: 32rpx;
|
||||
}
|
||||
}
|
||||
|
|
@ -479,6 +498,7 @@
|
|||
color: #fff;
|
||||
border-radius: 12rpx;
|
||||
font-size: 28rpx;
|
||||
border-radius: 100rpx;
|
||||
}
|
||||
|
||||
.btn-hover-class {
|
||||
|
|
@ -497,11 +517,10 @@
|
|||
}
|
||||
|
||||
.option {
|
||||
padding: 26rpx 30rpx 24rpx 24rpx;
|
||||
padding: 8rpx 24rpx 32rpx 24rpx;
|
||||
background: #F9F9F9;
|
||||
}
|
||||
|
||||
.option-item {
|
||||
margin-bottom: 34rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -4,25 +4,44 @@
|
|||
<view>
|
||||
<uni-forms :model="FormData" :rules="rules" err-show-type="undertext" validateTrigger="blur" ref="form"
|
||||
:border="true" :label-width="130">
|
||||
<view class="block">
|
||||
<view class="border-top-0">
|
||||
<view class="block u-p-b-16">
|
||||
|
||||
<view class="">
|
||||
<view class="u-m-t-20">选择规格</view>
|
||||
<view class="u-m-t-16">
|
||||
<uni-data-picker :clear-icon="false" @change="specIdChange"
|
||||
:map="{text:'name',value:'id'}" placeholder="请选择规格" popup-title="请选择规格"
|
||||
:localdata="FormData.specList" v-model="FormData.specId">
|
||||
</uni-data-picker>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="border-top-0">
|
||||
<uni-forms-item label="选择规格" required name="categoryId">
|
||||
<uni-data-picker :clear-icon="false" @change="specIdChange"
|
||||
:map="{text:'name',value:'id'}" placeholder="请选择规格" popup-title="请选择规格"
|
||||
:localdata="FormData.specList" v-model="FormData.specId">
|
||||
</uni-data-picker>
|
||||
</uni-forms-item>
|
||||
</view>
|
||||
<view class="u-p-b-20">
|
||||
<view class="u-m-t-12" v-for="(item,index) in FormData.selectSpec" :key="index">
|
||||
|
||||
</view> -->
|
||||
<view class=" u-m-t-32">
|
||||
<view class="u-m-t-16" v-for="(item,index) in FormData.selectSpec" :key="index">
|
||||
<view class="font-bold">
|
||||
{{item.name}}
|
||||
</view>
|
||||
|
||||
<view class="u-m-t-24">
|
||||
<uni-data-checkbox @change="createResult" multiple :selectedColor="color.ColorMain"
|
||||
v-model="item.selectSpecResult" :localdata="item.value"></uni-data-checkbox>
|
||||
<view class="u-m-t-16">
|
||||
<up-checkbox-group :labelSize="12" :size="14" :activeColor="color.ColorMain"
|
||||
shape="circle" v-model="item.selectSpecResult" placement="row"
|
||||
@change="createResult">
|
||||
<up-checkbox :customStyle="{marginRight: '60rpx',marginBottom:'16rpx'}"
|
||||
v-for="(item, index) in item.value" :key="index" :label="item.text"
|
||||
:name="item.value">
|
||||
</up-checkbox>
|
||||
</up-checkbox-group>
|
||||
|
||||
<!-- <uni-data-checkbox @change="createResult" multiple :selectedColor="color.ColorMain"
|
||||
v-model="item.selectSpecResult" :localdata="item.value">
|
||||
</uni-data-checkbox> -->
|
||||
|
||||
</view>
|
||||
|
||||
|
|
@ -34,16 +53,17 @@
|
|||
</uni-forms>
|
||||
|
||||
<view>
|
||||
<view class="block u-m-b-32" v-for="(item,index) in FormData.result" :key="index">
|
||||
<view class="block u-m-b-0 u-m-t-32" v-for="(item,index) in FormData.result" :key="index">
|
||||
<uni-forms :model="item.skus" :rules="rules" :ref="setFormRef(index)" err-show-type="undertext"
|
||||
validateTrigger="blur" :border="true" :label-width="130">
|
||||
|
||||
<view class="">
|
||||
<view class="u-m-t-20" v-for="(val,key) in item.names" :key="key">
|
||||
<text class="font-bold u-m-r-12">
|
||||
<view class="u-m-t-20 u-p-b-24 border-bottom" v-for="(val,key) in item.names"
|
||||
:key="key">
|
||||
<view class="font-bold u-m-r-12">
|
||||
{{key}}
|
||||
</text>
|
||||
<text class="color-999">{{val}}</text>
|
||||
</view>
|
||||
<view class="u-m-t-16 color-666 u-font-24">{{val}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-m-t-24">
|
||||
|
|
@ -51,13 +71,14 @@
|
|||
<view class="font-bold">
|
||||
图片
|
||||
</view>
|
||||
<view class="u-m-t-24">
|
||||
<view class="u-m-t-16">
|
||||
<my-upload-file @change="changeResultCover($event,index)" :limit="1"
|
||||
:ref="setRefFile(index)" :images="item.coverImg"></my-upload-file>
|
||||
:imageStyles="imageStyles" :ref="setRefFile(index)"
|
||||
:images="item.coverImg"></my-upload-file>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="skus u-m-t-32">
|
||||
<view class="skus u-m-t-24">
|
||||
<view class="">
|
||||
<uni-forms-item label="售价" required name="salePrice">
|
||||
<uni-easyinput @blur="priceFormat(item.skus,'salePrice')"
|
||||
|
|
@ -109,9 +130,12 @@
|
|||
placeholder="请输入分销金额" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="商品条码" required>
|
||||
<uni-easyinput disabled :paddingNone="inputPaddingNone"
|
||||
:placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
||||
v-model="item.skus.barCode" placeholder="请输入商品条码" />
|
||||
<view class="bg-gray u-flex u-col-center u-col-center u-p-l-24" style="height: 72rpx;background: #F6F6F6;border-radius: 8rpx ;">
|
||||
<uni-easyinput disabled :paddingNone="inputPaddingNone"
|
||||
:placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
||||
v-model="item.skus.barCode" placeholder="请输入商品条码" />
|
||||
</view>
|
||||
|
||||
</uni-forms-item>
|
||||
|
||||
</view>
|
||||
|
|
@ -120,8 +144,17 @@
|
|||
</view>
|
||||
</view>
|
||||
|
||||
<view class="save-btn-box">
|
||||
<button class="save-btn" hover-class="btn-hover-class" @click="save">保存</button>
|
||||
</view>
|
||||
|
||||
<view :style="{height:bottomHeight+'px'}"></view>
|
||||
<view class="safe-bottom fixed">
|
||||
<view class="btn">
|
||||
<up-button @click="save" shape="circle" type="primary" >
|
||||
<view class=" font-bold">
|
||||
保存
|
||||
</view>
|
||||
</up-button>
|
||||
<!-- <button class="save-btn" hover-class="btn-hover-class" @click="save">保存</button> -->
|
||||
<view class="u-m-t-20">
|
||||
<button class="save-btn edit-btn" hover-class="btn-hover-class" @click="fastEditShow">
|
||||
<view class="u-flex u-row-center">
|
||||
|
|
@ -130,15 +163,17 @@
|
|||
</view>
|
||||
</button>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="bottom" ref="bottom"></view>
|
||||
|
||||
<pop-fast-edit @update="updateSkuKey" v-model:show="fastEdit.show"></pop-fast-edit>
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import {
|
||||
getSafeBottomHeight
|
||||
} from '@/commons/utils/safe-bottom.js'
|
||||
import {
|
||||
formatPrice
|
||||
} from "@/commons/utils/format.js";
|
||||
|
|
@ -169,7 +204,22 @@
|
|||
import {
|
||||
hasPermission
|
||||
} from '@/commons/utils/hasPermission.js';
|
||||
|
||||
let bottomHeight = ref(100)
|
||||
onReady(() => {
|
||||
getSafeBottomHeight('safe-bottom').then(res => {
|
||||
console.log(res);
|
||||
bottomHeight.value = res
|
||||
})
|
||||
})
|
||||
const refFiles = ref([]);
|
||||
const imageStyles = reactive({
|
||||
width: 82,
|
||||
height: 82,
|
||||
border: {
|
||||
radius: '4px'
|
||||
}
|
||||
})
|
||||
//绑定文件上传元素
|
||||
function setRefFile(index) {
|
||||
refFiles.value[index] = null;
|
||||
|
|
@ -334,6 +384,7 @@
|
|||
let arr = []
|
||||
for (let k of FormData.selectSpec) {
|
||||
if (k.selectSpecResult.length) {
|
||||
console.log(k);
|
||||
arr.push({
|
||||
value: k.selectSpecResult,
|
||||
name: k.name
|
||||
|
|
@ -341,7 +392,7 @@
|
|||
}
|
||||
}
|
||||
const spes = combineSpecs(arr)
|
||||
FormData.result = spes.filter(v => {
|
||||
const result = spes.filter(v => {
|
||||
return !Array.isArray(v)
|
||||
}).map(v => {
|
||||
const specSnap = returnSpecSnap(v)
|
||||
|
|
@ -354,7 +405,7 @@
|
|||
}
|
||||
return data || newdata
|
||||
})
|
||||
console.log(FormData.result);
|
||||
FormData.result = result
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -526,8 +577,8 @@
|
|||
})
|
||||
}).catch(err => {
|
||||
console.log(err);
|
||||
if(err.length>=1){
|
||||
infoBox.showToast(err[0].errorMessage)
|
||||
if (err.length >= 1) {
|
||||
infoBox.showToast(err[0].errorMessage)
|
||||
}
|
||||
resolve({
|
||||
sucees: false
|
||||
|
|
@ -549,6 +600,8 @@
|
|||
}
|
||||
//判断验证是否通过
|
||||
console.log('pass');
|
||||
const item = FormData.specList.find(v => v.id === FormData.specId)
|
||||
FormData.specsInfoName = item ? item.name : ''
|
||||
console.log(FormData);
|
||||
emitspecificationsSave()
|
||||
|
||||
|
|
@ -568,14 +621,32 @@
|
|||
margin: auto;
|
||||
}
|
||||
|
||||
::v-deep .uni-forms-item--border {
|
||||
padding-top: 24rpx;
|
||||
padding-bottom: 24rpx;
|
||||
}
|
||||
|
||||
::v-deep.uni-forms-item {
|
||||
min-height: inherit;
|
||||
}
|
||||
|
||||
.page {
|
||||
background: #F9F9F9;
|
||||
padding: 30rpx;
|
||||
padding-bottom: 200rpx;
|
||||
padding: 30rpx 30rpx 0 30rpx;
|
||||
}
|
||||
|
||||
.safe-bottom {
|
||||
padding: 34rpx 28rpx;
|
||||
position: fixed;
|
||||
background-color: #fff;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 10;
|
||||
|
||||
.btn {
|
||||
padding: 0 88rpx 56rpx 88rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.my-switch {
|
||||
|
|
@ -626,6 +697,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
::v-deep .uni-easyinput__content-input {
|
||||
height: inherit;
|
||||
}
|
||||
|
||||
.icon-reduce {
|
||||
background-color: $my-red-color;
|
||||
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@
|
|||
</view>
|
||||
<view class="u-m-t-36">
|
||||
<scroll-view scroll-y="true" style="max-height: 70vh;">
|
||||
<view class="u-m-b-24" v-for="(item,index) in list" :key="index">
|
||||
<view class="u-m-b-32" v-for="(item,index) in list" :key="index">
|
||||
<view>{{item.text}}:</view>
|
||||
<view class="u-m-t-24">
|
||||
<view class="u-m-t-16">
|
||||
<up-input v-model="item.value">
|
||||
<template #suffix>
|
||||
<up-button @click="itemClick(item)" type="primary" text="修改" size="mini"></up-button>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<view class="control" :style="getComputedStyle()">
|
||||
<view class="u-flex control1" v-if="showControl1">
|
||||
<!-- <view class="btn" @click="changeShowControl1">批量管理</view> -->
|
||||
<view class="btn add" @tap="go.to('PAGES_PRODUCT_ADD')">商品添加</view>
|
||||
<view class="btn add font-bold u-font-28 color-fff" @tap="go.to('PAGES_PRODUCT_ADD')">商品添加</view>
|
||||
<!-- <view class="color-999 btn u-flex u-row-center" @click="emitToggleCategory">
|
||||
<text class="u-m-r-10">{{categoryName||'选择分类'}}</text>
|
||||
<view class="arrow-down" :class="{'up':categoryShow}">
|
||||
|
|
|
|||
|
|
@ -139,7 +139,10 @@
|
|||
goods: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
skuList: []
|
||||
return{
|
||||
id:'',
|
||||
skuList: []
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
@ -153,6 +156,7 @@
|
|||
]
|
||||
})
|
||||
function toRecodes(){
|
||||
console.log(props.goods.id);
|
||||
go.to('PAGES_PRODUCT_INVOICING_LIST',{
|
||||
productId:props.goods.id
|
||||
})
|
||||
|
|
|
|||
|
|
@ -83,7 +83,6 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import myButton from '@/components/my-components/my-button';
|
||||
import go from '@/commons/utils/go.js'
|
||||
import color from '@/commons/color.js'
|
||||
|
||||
|
|
@ -108,7 +107,7 @@
|
|||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
<style lang="scss" scoped>
|
||||
.text-ming-w{
|
||||
min-width: calc(28rpx * 5);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<view class="color-333 u-font-28">
|
||||
<up-sticky offset-top="0">
|
||||
<up-sticky :offset-top="0">
|
||||
<view class=" bg-fff u-flex u-p-l-30 u-row-between">
|
||||
<view class="u-flex ">
|
||||
<view class="u-flex u-p-t-30 u-p-b-30 u-flex-1 u-row-center" @tap="timeToggle">
|
||||
|
|
@ -18,16 +18,6 @@
|
|||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view style="width: 164rpx;"></view> -->
|
||||
<!-- <view class="search-box">
|
||||
<view class="search-btn u-flex" @tap="showSearch" :style="{width:search.show?'694rpx':'164rpx'}">
|
||||
<image src="@/static/iconImg/icon-search.svg" class="input-icon" />
|
||||
<view class="u-flex-1 u-p-l-10"><input v-model="search.keyword" @confirm="searchConfirm" type="text"
|
||||
placeholder-style="font-size:28rpx;" placeholder="搜索" /></view>
|
||||
<view @tap.stop="hideSearch" v-if="search.show">取消</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<view :style="{height:types.show?typesHeight:0}" class="tranistion types overflow-hide">
|
||||
<view @tap="changeTypesActive(index)" class="u-flex u-p-l-30 lh30 u-p-r-30 u-row-between"
|
||||
v-for="(item,index) in types.list" :key="index">
|
||||
|
|
@ -63,7 +53,7 @@
|
|||
</view> -->
|
||||
<template v-if="pageData.list.length">
|
||||
<view class="u-m-b-28 " v-for="(item,index) in pageData.list" :key="index">
|
||||
<list-item :data="item"></list-item>
|
||||
<my-list-item :data="item" ></my-list-item>
|
||||
</view>
|
||||
<my-pagination :size="pageData.size" :totalElements="pageData.totalElements"
|
||||
@change="pageChange"></my-pagination>
|
||||
|
|
@ -77,12 +67,10 @@
|
|||
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
<my-date-pickerview @confirm="datePickerConfirm" ref="datePicker"></my-date-pickerview>
|
||||
<my-mask ref="mask" @close="hideType"></my-mask>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
|
@ -94,9 +82,7 @@
|
|||
onPullDownRefresh
|
||||
} from '@dcloudio/uni-app';
|
||||
import color from '@/commons/color';
|
||||
import listItem from './components/list-item';
|
||||
import myMask from '@/components/my-components/my-mask'
|
||||
import myDatePickerview from '@/components/my-components/my-date-pickerview'
|
||||
import myListItem from './components/list-item.vue';
|
||||
import {
|
||||
ref,
|
||||
reactive,
|
||||
|
|
@ -218,7 +204,6 @@
|
|||
shopId:uni.getStorageSync('shopId'),
|
||||
createdAt:[]
|
||||
},
|
||||
productId:'',
|
||||
totalElements: 0,
|
||||
list: [],
|
||||
status: 'noMore',
|
||||
|
|
@ -229,7 +214,6 @@
|
|||
const createdAt=(filters.time.start&&filters.time.end)?[filters.time.start,filters.time.end ]:[]
|
||||
const res = await $getProductStockDetail({
|
||||
...pageData.query,
|
||||
productId: pageData.productId,
|
||||
type:types.active!==''?types.list[types.active].value:'',
|
||||
createdAt
|
||||
})
|
||||
|
|
@ -239,7 +223,7 @@
|
|||
}
|
||||
async function getSum(){
|
||||
const res = await $getProductStockDetailSum({
|
||||
productId: pageData.productId,
|
||||
productId: pageData.query.productId
|
||||
})
|
||||
pageData.changeSum = res.exchange
|
||||
}
|
||||
|
|
@ -249,7 +233,8 @@
|
|||
})
|
||||
|
||||
onLoad(opt => {
|
||||
pageData.query.productId = opt ? opt.productId : ''
|
||||
console.log(opt);
|
||||
Object.assign(pageData.query,opt)
|
||||
init()
|
||||
// getSum()
|
||||
})
|
||||
|
|
|
|||
|
|
@ -54,18 +54,20 @@
|
|||
onLoad
|
||||
} from '@dcloudio/uni-app'
|
||||
import {
|
||||
reactive,
|
||||
reactive,onBeforeMount,
|
||||
ref
|
||||
} from 'vue';
|
||||
let nouser = ref(false)
|
||||
|
||||
let timer=null
|
||||
function emitChooser(data) {
|
||||
uni.$emit('choose-user', data)
|
||||
setTimeout(() => {
|
||||
timer=setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 100)
|
||||
}
|
||||
|
||||
onBeforeMount(()=>{
|
||||
clearInterval(timer)
|
||||
})
|
||||
function chooseUser(index, item) {
|
||||
if (index === undefined || item === undefined) {
|
||||
nouser.value = true
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<template v-if="item.note">
|
||||
<view class="u-p-20 bg-gray u-m-t-10">
|
||||
<view class="u-p-20 bg-gray u-m-t-16">
|
||||
{{item.note}}
|
||||
</view>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -1,20 +1,24 @@
|
|||
<template>
|
||||
<view class="default-box-padding bg-fff border-r-24 u-m-t-32" v-if="data.length">
|
||||
<view class="u-font-32 color-999 border-bottom u-p-b-24">
|
||||
<view class=" font-bold u-p-b-32 border-bottom u-m-b-24" v-if="orderInfo.tableName">
|
||||
<text class="">桌号:</text>
|
||||
<text class="">{{orderInfo.tableName||""}}</text>
|
||||
</view>
|
||||
<view class=" color-999 border-bottom u-p-b-24">
|
||||
<text>共</text>
|
||||
<text class="color-333 "> {{goodsNumber}}</text>
|
||||
<text>份菜品</text>
|
||||
</view>
|
||||
<view class="u-m-b-20 u-m-t-20" v-for="(order,orderIndex) in data" :key="orderIndex">
|
||||
<view class="u-font-32"> 第{{ order.placeNum }}次下单
|
||||
<view class="u-m-b-20 " v-for="(order,orderIndex) in data" :key="orderIndex">
|
||||
<view class="u-p-t-24"> 第{{ order.placeNum }}次下单
|
||||
</view>
|
||||
<view class="u-m-t-24 list">
|
||||
<view class="item u-m-b-20" v-for="(item,index) in order.info" :key="index">
|
||||
<view class="item u-m-b-32" v-for="(item,index) in order.info" :key="index">
|
||||
<view class="u-flex u-col-top">
|
||||
<view>
|
||||
<view class="u-flex">
|
||||
<image class="img" :src="item.coverImg||item.productImg" mode=""></image>
|
||||
</view>
|
||||
<view class="u-p-l-30 u-flex-1">
|
||||
<view class="u-p-l-32 u-flex-1">
|
||||
<view class="u-flex u-row-between u-col-top">
|
||||
|
||||
<view class="">
|
||||
|
|
@ -25,9 +29,12 @@
|
|||
<view :class="{'line-th':item.status=='return'}">{{item.name||item.productName}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="color-999 u-font-24 u-m-t-10">{{item.productSkuName||''}}</view>
|
||||
<view class="color-999 u-font-24 u-m-t-8">{{item.productSkuName||''}}</view>
|
||||
<view class="u-m-t-12 color-666 u-font-24" v-if="item.note">
|
||||
备注:{{item.note}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-text-right">
|
||||
<view class="u-text-right u-m-t-28">
|
||||
<template v-if="item.status=='return'">
|
||||
<view>¥0.00</view>
|
||||
<view class="line-th color-666 ">¥{{item.salePrice||item.price}}</view>
|
||||
|
|
@ -35,30 +42,30 @@
|
|||
<template v-else>
|
||||
<view>¥{{item.salePrice||item.price}}</view>
|
||||
</template>
|
||||
<view class="u-m-t-10 color-999 u-font-24">X{{item.number||item.num}}</view>
|
||||
<view class="u-m-t-22 color-999 u-font-24">X{{item.number||item.num}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<template v-if="orderInfo.status=='unpaid'">
|
||||
<view class="u-flex u-row-right gap-20 u-m-t-20" v-if="item.status!='return'">
|
||||
<view class="u-flex u-row-right gap-20 u-m-t-24" v-if="item.status!='return'">
|
||||
<!-- <my-button :height="60" color="#333" plain type="cancel" shape="circle">更多操作</my-button> -->
|
||||
<my-button :width="168" :height="60" plain shape="circle"
|
||||
@tap="tuicai(item,index)">退菜</my-button>
|
||||
<my-button :width="128" :height="48" plain shape="circle"
|
||||
@tap="tuicai(item,index)"><text class="no-wrap">退菜</text></my-button>
|
||||
</view>
|
||||
</template>
|
||||
<template v-if="orderInfo.status=='closed'">
|
||||
<view class="u-flex u-row-right gap-20 u-m-t-20" v-if="item.status!='return'">
|
||||
<my-button :width="168" :height="60" plain shape="circle"
|
||||
@tap="tuikuan(item,index)">退款</my-button>
|
||||
<my-button :width="128" :height="48" plain shape="circle"
|
||||
@tap="tuikuan(item,index)"><text class="no-wrap">退款</text> </my-button>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-gray u-p-20 u-m-t-20" v-if="orderInfo.remark">
|
||||
<!-- <view class="bg-gray u-p-20 u-m-t-20" v-if="orderInfo.remark">
|
||||
<view>备注</view>
|
||||
<view class="u-m-t-10">{{orderInfo.remark}}</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<view class="u-m-t-32">
|
||||
|
|
@ -109,7 +116,7 @@
|
|||
<text class="font-bold u-font-32">{{to2(allPrice*1+seatFeePrice*1) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-m-t-30">
|
||||
<view class="u-m-t-24">
|
||||
<my-button @tap="printOrder" type="cancel" :color="color.ColorMain">重新打印</my-button>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -1,41 +1,44 @@
|
|||
<template>
|
||||
<view class="default-box-padding bg-fff border-r-12 u-m-t-20">
|
||||
<view class="default-box-padding bg-fff border-r-12 u-m-t-24">
|
||||
<view class="u-flex u-row-between">
|
||||
<view>订单状态</view>
|
||||
<view>{{returnStatus(data.status)}}</view>
|
||||
</view>
|
||||
<view class="u-flex u-row-between u-m-t-20">
|
||||
<view class="u-flex u-row-between u-m-t-24">
|
||||
<view>订单类型</view>
|
||||
<view>{{returnUseType(data.useType)}}</view>
|
||||
</view>
|
||||
<view class="u-flex u-row-between u-m-t-20">
|
||||
<view class="u-flex u-row-between u-m-t-24">
|
||||
<view>桌位号</view>
|
||||
<view>{{table.name||data.tableName}}</view>
|
||||
</view>
|
||||
<view class="u-flex u-row-between u-m-t-20" v-if="seatFee.number">
|
||||
<view class="u-flex u-row-between u-m-t-24" v-if="seatFee.number">
|
||||
<view>就餐人数</view>
|
||||
<view>{{seatFee.number||''}}</view>
|
||||
</view>
|
||||
<view class="u-flex u-row-between u-m-t-20">
|
||||
<view class="u-flex u-row-between u-m-t-24">
|
||||
<view>支付方式</view>
|
||||
<view>{{data.payType||''}}</view>
|
||||
</view>
|
||||
<!-- <view class="u-flex u-row-between u-m-t-20">
|
||||
<!-- <view class="u-flex u-row-between u-m-t-24">
|
||||
<view>预约时间</view>
|
||||
<view></view>
|
||||
</view> -->
|
||||
<view class="u-flex u-row-between u-m-t-20">
|
||||
<view class="u-flex u-row-between u-m-t-24">
|
||||
<view>下单时间</view>
|
||||
<view><up-text v-if="data.createdAt" mode="date" format="yyyy-mm-dd hh:MM:ss" :text="data.createdAt"></up-text></view>
|
||||
</view>
|
||||
<view class="u-flex u-row-between u-m-t-20">
|
||||
<view class="u-flex u-row-between u-m-t-24">
|
||||
<view>订单编号</view>
|
||||
<view>{{data.orderNo}}</view>
|
||||
</view>
|
||||
<!-- <view class="u-flex u-row-between u-m-t-20">
|
||||
<view>商家备注</view>
|
||||
<my-button plain shape="circle" :width="160" :height="60">编辑</my-button>
|
||||
</view> -->
|
||||
<view class="u-flex u-row-between u-m-t-24 u-col-top">
|
||||
<view class="no-wrap">商家备注</view>
|
||||
<view class="u-p-l-32 " style="max-width: 522rpx; word-wrap: break-word;">
|
||||
{{data.remark}}
|
||||
</view>
|
||||
<!-- <my-button plain shape="circle" :width="160" :height="60">编辑</my-button> -->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,23 @@
|
|||
{{data.productName}}
|
||||
</view>
|
||||
<view class="u-flex u-m-t-32">
|
||||
<up-number-box :buttonSize="44" :inputWidth="220" v-model="number"></up-number-box>
|
||||
<up-number-box :min="1" :max="data.num" :buttonSize="44" v-model="number" integer>
|
||||
<template #minus>
|
||||
<view class="minus number-box-btn">
|
||||
</view>
|
||||
</template>
|
||||
<template #input>
|
||||
<view class="u-flex-1 u-row-center u-text-center input">
|
||||
<up-input @change="parseIntNumber($event,false)" @blur="parseIntNumber($event,true)"
|
||||
v-model="number" border="none" type="number"></up-input>
|
||||
</view>
|
||||
</template>
|
||||
<template #plus>
|
||||
<view class="plus number-box-btn">
|
||||
<up-icon name="plus" color="#999" size="16" bold></up-icon>
|
||||
</view>
|
||||
</template>
|
||||
</up-number-box>
|
||||
</view>
|
||||
<view class="u-m-t-32">
|
||||
<view class="u-font-24">
|
||||
|
|
@ -14,13 +30,15 @@
|
|||
<text class="color-red">*</text>
|
||||
</view>
|
||||
<view class="u-flex u-flex-wrap u-m-t-24">
|
||||
<view class="u-flex u-m-r-16 u-m-b-16" v-for="(item,index) in tags" :key="index">
|
||||
<up-tag @click="changeTagSel(item)" :text="item.label" plain borderColor="#E6FOFF" color="#318AFE" v-if="item.checked"> </up-tag>
|
||||
<up-tag @click="changeTagSel(item)" borderColor="#E5E5E5" color="#666" :text="item.label" plain v-else> </up-tag>
|
||||
<view class="u-flex u-m-r-16 u-m-b-16" v-for="(item,index) in tags" :key="index">
|
||||
<up-tag @click="changeTagSel(item)" :text="item.label" plain borderColor="#E6FOFF"
|
||||
color="#318AFE" v-if="item.checked"> </up-tag>
|
||||
<up-tag @click="changeTagSel(item)" borderColor="#E5E5E5" color="#666" :text="item.label"
|
||||
plain v-else> </up-tag>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-m-t-24">
|
||||
<up-input placeholder="备注"></up-input>
|
||||
<up-textarea v-model="form.note" placeholder="备注"></up-textarea>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -29,19 +47,22 @@
|
|||
<view class="u-p-t-18 u-p-l-30 u-p-r-30 u-p-b-30">
|
||||
<my-button box-shadow shape="circle" @tap="confirm">确认退菜</my-button>
|
||||
<view class="u-m-t-10">
|
||||
<my-button @tap="toggleModelShow" shape="circle" bgColor="#fff" type="cancel" box-shadow>取消</my-button>
|
||||
<my-button @tap="toggleModelShow" shape="circle" bgColor="#fff" type="cancel"
|
||||
box-shadow>取消</my-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</template>
|
||||
</my-model>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
reactive,
|
||||
ref,
|
||||
watch
|
||||
} from 'vue';
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
|
|
@ -52,13 +73,48 @@
|
|||
default: false
|
||||
}
|
||||
})
|
||||
const emits = defineEmits(['update:show','confirm'])
|
||||
const form = reactive({
|
||||
note: ''
|
||||
})
|
||||
const emits = defineEmits(['update:show', 'confirm'])
|
||||
let model = ref(null)
|
||||
let modelShow = ref(props.show)
|
||||
let number = ref(1)
|
||||
const tags=ref([{label:"点错",checked:false},{label:"不想要了",checked:false} ,{label:"食材不足",checked:false} ,{label:"等待时间过长",checked:false}])
|
||||
function changeTagSel(item){
|
||||
item.checked=!item.checked
|
||||
const tags = ref([{
|
||||
label: "点错",
|
||||
checked: false
|
||||
}, {
|
||||
label: "不想要了",
|
||||
checked: false
|
||||
}, {
|
||||
label: "食材不足",
|
||||
checked: false
|
||||
}, {
|
||||
label: "等待时间过长",
|
||||
checked: false
|
||||
}])
|
||||
let timer = null
|
||||
|
||||
function parseIntNumber(val, isNow) {
|
||||
console.log(val);
|
||||
let newval = parseInt(val)
|
||||
if (newval > props.data.num) {
|
||||
newval = props.data.num
|
||||
}
|
||||
if (newval < 1) {
|
||||
newval = 1
|
||||
}
|
||||
if (isNow) {
|
||||
number.value = parseInt(newval)
|
||||
return
|
||||
}
|
||||
timer = setTimeout(() => {
|
||||
number.value = newval
|
||||
}, 100)
|
||||
}
|
||||
|
||||
function changeTagSel(item) {
|
||||
item.checked = !item.checked
|
||||
}
|
||||
watch(() => props.show, (newval) => {
|
||||
modelShow.value = newval
|
||||
|
|
@ -71,9 +127,9 @@
|
|||
close()
|
||||
}
|
||||
})
|
||||
|
||||
function toggleModelShow(show){
|
||||
modelShow.value=show?true:false
|
||||
|
||||
function toggleModelShow(show) {
|
||||
modelShow.value = show ? true : false
|
||||
}
|
||||
|
||||
function onModelClose() {
|
||||
|
|
@ -91,13 +147,65 @@
|
|||
function close() {
|
||||
model.value.close()
|
||||
}
|
||||
function confirm(){
|
||||
emits('confirm')
|
||||
|
||||
function confirm() {
|
||||
const selTag = tags.value.filter(item => item.checked).map(item => item.label).join(",")
|
||||
const note = selTag + (form.note.length > 0 ? "," + form.note : "");
|
||||
console.log({
|
||||
note,
|
||||
num: number.value
|
||||
});
|
||||
if (!note) {
|
||||
return infoBox.showToast("请输入退菜原因");
|
||||
}
|
||||
emits('confirm', {
|
||||
note,
|
||||
num: number.value
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .u-border{
|
||||
border-width: 1px!important;
|
||||
.number-box-btn {
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 122rpx;
|
||||
height: 84rpx;
|
||||
background: #F7F7FA;
|
||||
border-radius: 8rpx 0rpx 0rpx 8rpx;
|
||||
border: 2rpx solid #F9F9F9;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.input {
|
||||
border: 2rpx solid #F9F9F9;
|
||||
}
|
||||
|
||||
::v-deep .u-input__content__field-wrapper__field {
|
||||
height: 84rpx;
|
||||
}
|
||||
|
||||
::v-deep .uni-input-input {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.minus {
|
||||
&::after {
|
||||
content: '';
|
||||
display: block;
|
||||
width: 28rpx;
|
||||
height: 0rpx;
|
||||
border: 1px solid #999999;
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .u-border {
|
||||
border-width: 1px !important;
|
||||
}
|
||||
|
||||
::v-deep .u-number-box {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -15,28 +15,30 @@
|
|||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="u-flex u-row-between u-m-t-20 border-bottom u-p-b-20">
|
||||
<view class="u-flex u-row-between u-m-t-20 border-bottom u-p-b-24">
|
||||
<view class="u-flex">
|
||||
<up-avatar :size="30" :src="user.headImg"></up-avatar>
|
||||
<view class="color-666 u-m-l-30">{{'服务员下单'}}</view>
|
||||
</view>
|
||||
<view>
|
||||
<my-button @click="toOrder" :height="60" plain shape="circle">他的订单</my-button>
|
||||
<my-button width="128" height="48" @click="toOrder" :height="60" plain shape="circle">
|
||||
<text class="u-font-24 no-wrap">他的订单</text>
|
||||
</my-button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<view class="u-flex u-m-t-20 u-row-between u-font-28">
|
||||
<view class="u-flex u-m-t-24 u-row-between u-font-28">
|
||||
<view class="">
|
||||
<view class="font-bold ">{{user.amount}}</view>
|
||||
<view class="color-666 u-m-t-10 u-font-24">余额</view>
|
||||
<view class="color-666 u-m-t-8 u-font-24">余额</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="font-bold">{{user.totalScore}}</view>
|
||||
<view class="color-666 u-m-t-10 u-font-24">积分</view>
|
||||
<view class="color-666 u-m-t-8 u-font-24">积分</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="font-bold">0.00</view>
|
||||
<view class="color-666 u-m-t-10 u-font-24">已消费</view>
|
||||
<view class="color-666 u-m-t-8 u-font-24">已消费</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<template>
|
||||
<view class="min-page bg-gray u-font-28 u-p-30">
|
||||
<user-vue :orderInfo="orderDetail.info" :user="user"></user-vue>
|
||||
<view class="default-box-padding bg-fff border-r-12 u-m-t-32">
|
||||
<!-- <view class="default-box-padding bg-fff border-r-12 u-m-t-32">
|
||||
<text class="">桌位号:</text>
|
||||
<text class="">{{orderDetail.info.tableName}}</text>
|
||||
</view>
|
||||
</view> -->
|
||||
<goods-list @printOrder="onPrintOrder" @tuikuan="onTuikuan" :orderInfo="orderDetail.info"
|
||||
:data="orderDetail.goodsList" :seatFee="orderDetail.seatFee" @tuicai="onTuiCai"></goods-list>
|
||||
<template v-if="orderDetail.seatFee.totalNumber&&orderDetail.seatFee.totalAmount">
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
<view class="u-fixed bottom bg-fff ">
|
||||
<view class="u-flex u-abso">
|
||||
<template v-if="orderDetail.info.useType=='takeout'">
|
||||
<view class="u-flex-1">
|
||||
<view class="u-flex-1" v-if="orderDetail.info.status=='unpaid'">
|
||||
<my-button @tap="toPay" borderRadius="100rpx" shape="circle"
|
||||
type="primary">结账</my-button>
|
||||
</view>
|
||||
|
|
@ -25,11 +25,11 @@
|
|||
<template v-else>
|
||||
<template v-if="orderDetail.info.status=='unpaid'">
|
||||
<view class="u-flex-1">
|
||||
<my-button @tap="diancan" color="#fff" bgColor="rgb(57,53,52)" borderRadius="100rpx 0 0 100rpx" fontWeight="700" fontSize="32"
|
||||
<my-button @tap="diancan" color="#fff" bgColor="rgb(57,53,52)" borderRadius="100rpx 0 0 100rpx" fontWeight="700"
|
||||
shape="circle" plain type="primary">加菜</my-button>
|
||||
</view>
|
||||
<view class="u-flex-1">
|
||||
<my-button @tap="toPay" borderRadius="0 100rpx 100rpx 0" shape="circle" fontWeight="700" fontSize="32"
|
||||
<my-button @tap="toPay" borderRadius="0 100rpx 100rpx 0" shape="circle" fontWeight="700"
|
||||
type="primary">结账</my-button>
|
||||
</view>
|
||||
</template>
|
||||
|
|
@ -120,9 +120,10 @@
|
|||
tuicai.show = true
|
||||
tuicai.selGoods = goods
|
||||
}
|
||||
async function tuicaiConfirm() {
|
||||
async function tuicaiConfirm(e) {
|
||||
console.log(tuicai.selGoods);
|
||||
const res = await Api.$returnCart({
|
||||
...e,
|
||||
cartId: tuicai.selGoods.hasOwnProperty('cartId') ? tuicai.selGoods.cartId : tuicai.selGoods.id,
|
||||
tableId: orderDetail.info.tableId,
|
||||
})
|
||||
|
|
@ -199,6 +200,7 @@
|
|||
}, 1500)
|
||||
|
||||
function diancan() {
|
||||
clearEmit()
|
||||
go.to('PAGES_CREATE_ORDER', {
|
||||
tableId: options.tableId || orderDetail.info.tableId,
|
||||
name: options.name || orderDetail.info.tableName,
|
||||
|
|
@ -208,6 +210,7 @@
|
|||
|
||||
function toPay() {
|
||||
const userId=orderDetail.info.userId||''
|
||||
clearEmit()
|
||||
go.to('PAGES_ORDER_PAY', {
|
||||
tableId: options.tableId|| orderDetail.info.tableId,
|
||||
tableName: options.name,
|
||||
|
|
@ -310,7 +313,13 @@
|
|||
Object.assign(submitPar, par)
|
||||
return Api.$setUser(submitPar)
|
||||
}
|
||||
|
||||
|
||||
|
||||
function clearEmit(){
|
||||
uni.$off('choose-user')
|
||||
uni.$off('orderDetail:update')
|
||||
}
|
||||
|
||||
function watchChooseuser() {
|
||||
uni.$off('choose-user')
|
||||
uni.$on('choose-user', (data) => {
|
||||
|
|
|
|||
|
|
@ -30,15 +30,15 @@
|
|||
<view class="u-m-t-32">
|
||||
<view class="u-font-32">{{goosZhonglei}}种商品,共{{goodsNumber}}件</view>
|
||||
<view class="border-bottom u-p-b-32">
|
||||
<view class="u-flex u-row-between u-col-top u-m-t-24" v-for="(item,index) in data.detailList"
|
||||
<view class="u-flex u-row-between u-col-top u-m-t-32" v-for="(item,index) in data.detailList"
|
||||
:key="index">
|
||||
<view>
|
||||
<view class="color-666"> {{item.productName}}</view>
|
||||
<view class=""> {{item.productName}}</view>
|
||||
<view class="color-999 u-font-24 u-m-t-8">
|
||||
{{item.productSkuName}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-flex">
|
||||
<view class="u-flex u-flex-1 u-row-right">
|
||||
<view>×{{item.num}}</view>
|
||||
<view class="u-m-l-24 u-text-right" :style="computedPriceStyle()">¥{{item.price}}</view>
|
||||
</view>
|
||||
|
|
@ -46,8 +46,8 @@
|
|||
</view>
|
||||
|
||||
</view>
|
||||
<view class="u-flex u-row-between border-bottom u-m-t-32 u-p-b-32">
|
||||
<view>订单备注</view>
|
||||
<view class="u-flex u-row-between border-bottom u-m-t-32 u-p-b-32 u-col-top">
|
||||
<view class="no-wrap u-m-r-32">订单备注</view>
|
||||
<view>{{data.remark||'无'}}</view>
|
||||
</view>
|
||||
<view class="u-m-t-32">
|
||||
|
|
@ -99,7 +99,7 @@
|
|||
return ''
|
||||
}
|
||||
return {
|
||||
width: `${item.price}`.length * priceSize + 'px'
|
||||
'min-width': `${item.price}`.length * priceSize + 'px'
|
||||
}
|
||||
}
|
||||
// const computedPriceStyle = computed(() => {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
<template>
|
||||
<view class="min-page bg-gray u-font-28">
|
||||
<view class="top">
|
||||
<view class="search bg-fff u-p-t-32 u-p-l-28 u-p-r-28 u-p-b-32">
|
||||
<up-search v-bind="search" v-model="search.val"></up-search>
|
||||
<up-sticky offset-top="0">
|
||||
<view class="top">
|
||||
<view class="search bg-fff u-p-t-32 u-p-l-28 u-p-r-28 u-p-b-32">
|
||||
<up-search v-bind="search" v-model="search.val" @search="searchConfirm" @clear="searchConfirm" @custom="searchConfirm"></up-search>
|
||||
</view>
|
||||
<filter-vue @clearUser="clearQueryUser" @updateStatus="updateQuery('status',$event)" v-model:time="order.data.query.createdAt" :user="user" :type="option.type"></filter-vue>
|
||||
</view>
|
||||
<filter-vue @clearUser="clearQueryUser" @updateStatus="updateQuery('status',$event)" v-model:time="order.data.query.createdAt" :user="user" :type="option.type"></filter-vue>
|
||||
</view>
|
||||
</up-sticky>
|
||||
|
||||
<order-list @printOrder="onPrintOrder" :hasAjax="order.data.hasAjax" :list="order.data.list"></order-list>
|
||||
<template v-if="order.data.list.length>0">
|
||||
<my-pagination @change="pageChange" :totalElements="order.data.total"></my-pagination>
|
||||
|
|
@ -31,7 +34,7 @@
|
|||
import {getTodayTimestamps} from '@/commons/utils/dayjs-time.js';
|
||||
const search = reactive({
|
||||
val: '',
|
||||
placeholder: '搜索单号/昵称/姓名/手机号码/商品名称',
|
||||
placeholder: '搜索单号/商品名称',
|
||||
shape: 'square',
|
||||
inputStyle: {
|
||||
borderRadius: '12rpx'
|
||||
|
|
@ -49,7 +52,7 @@
|
|||
id: "",
|
||||
orderNo: "",
|
||||
orderType: "0",
|
||||
page: 1,
|
||||
page: 0,
|
||||
pageSize: 10,
|
||||
payType: "",
|
||||
productName: "",
|
||||
|
|
@ -62,10 +65,9 @@
|
|||
order.setQuery('userId','')
|
||||
}
|
||||
function pageChange(e){
|
||||
order.setVal('page',e)
|
||||
order.setQuery('page',e)
|
||||
console.log(e);
|
||||
console.log(order.data.page);
|
||||
const newPage=e-1
|
||||
order.setVal('page',newPage)
|
||||
order.setQuery('page',newPage)
|
||||
init()
|
||||
}
|
||||
function updateQuery(key,e){
|
||||
|
|
@ -80,9 +82,13 @@
|
|||
watch(()=>order.data.query.userId,(newval)=>{
|
||||
init()
|
||||
})
|
||||
function searchConfirm(){
|
||||
order.setQuery('page',0)
|
||||
init()
|
||||
}
|
||||
async function init() {
|
||||
console.log(order.data.query);
|
||||
const {content,totalElements}=await Api.tbOrderInfoData({...order.data.query,page:order.data.query.page-1})
|
||||
const {content,totalElements}=await Api.tbOrderInfoData({...order.data.query,page:order.data.query.page,searchText:search.val})
|
||||
uni.stopPullDownRefresh()
|
||||
order.setVal('list',content)
|
||||
console.log(order.data.list);
|
||||
|
|
|
|||
|
|
@ -113,8 +113,9 @@
|
|||
} from 'vue';
|
||||
import {
|
||||
onLoad,
|
||||
onBackPress
|
||||
onBackPress,onShow
|
||||
} from '@dcloudio/uni-app'
|
||||
import go from '@/commons/utils/go.js'
|
||||
import * as Api from '@/http/yskApi/Instead.js'
|
||||
import {
|
||||
queryAllShopUser
|
||||
|
|
@ -132,6 +133,7 @@
|
|||
let option = {isNowPay:false}
|
||||
let payFinish=ref(false)
|
||||
onBackPress(() => {
|
||||
uni.$emit('orderDetail:update')
|
||||
console.log('onBackPress');
|
||||
// uni.$emit('update:createOrderIndex')
|
||||
// if (option.isNowPay&&!payFinish.value) {
|
||||
|
|
@ -172,11 +174,11 @@
|
|||
go.to('PAGES_CHOOSE_USER')
|
||||
}
|
||||
//更新选择用户
|
||||
function setUser(par) {
|
||||
function setUser(par) {
|
||||
console.log(option);
|
||||
const submitPar = {
|
||||
masterId: option.masterId,
|
||||
tableId: table.value.tableId,
|
||||
tableId: option.tableId,
|
||||
vipUserId: user.value.id ? user.value.id : '',
|
||||
type: user.value.id ? 0 : 1 //0 设置 1 取消
|
||||
}
|
||||
|
|
@ -187,11 +189,17 @@
|
|||
uni.$off('choose-user')
|
||||
uni.$on('choose-user', (data) => {
|
||||
console.log(data);
|
||||
user.value = data
|
||||
setUser()
|
||||
setUser({
|
||||
vipUserId: data.id ? data.id : '',
|
||||
type: data.id ? 0 : 1 //0 设置 1 取消
|
||||
}).then(res=>{
|
||||
user.value = data
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
onShow(()=>{
|
||||
watchChooseuser()
|
||||
})
|
||||
|
||||
watch(() => pays.selIndex, (newval) => {
|
||||
clearInterval(timer)
|
||||
|
|
@ -238,10 +246,10 @@
|
|||
}
|
||||
|
||||
function changePayType(i, item) {
|
||||
if (item.payType == 'vipPay' && user.value.amount * 1 < order.amount * 1) {
|
||||
return infoBox.showToast('余额不足')
|
||||
}
|
||||
pays.payTypes.selIndex = i
|
||||
if (item.payType == 'vipPay' ) {
|
||||
chooseUser()
|
||||
}
|
||||
}
|
||||
//支付成功回调
|
||||
function paySuccess() {
|
||||
|
|
@ -250,6 +258,7 @@
|
|||
// uni.$emit('orderDetail:update')
|
||||
payFinish.value=true
|
||||
uni.$emit('get:table')
|
||||
uni.$emit('update:orderDetail')
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
|
|
@ -266,6 +275,10 @@
|
|||
}
|
||||
async function payOrder() {
|
||||
const payType = pays.payTypes.list[pays.payTypes.selIndex].payType
|
||||
if (payType == 'vipPay' && user.value.amount * 1 < order.amount * 1) {
|
||||
infoBox.showToast('余额不足')
|
||||
return
|
||||
}
|
||||
await Api.$payOrder({
|
||||
tableId: order.tableId,
|
||||
masterId: order.masterId,
|
||||
|
|
@ -328,7 +341,9 @@
|
|||
queryAllShopUser({
|
||||
id: order.userId
|
||||
}).then(res => {
|
||||
user.value = res.content[0] || opt
|
||||
if(res.content[0]){
|
||||
user.value =res.content[0]
|
||||
}
|
||||
})
|
||||
}
|
||||
getPayUrl()
|
||||
|
|
@ -348,7 +363,6 @@
|
|||
Object.assign(order, opt)
|
||||
const payTypeList = await Api.$getPayType()
|
||||
pays.payTypes.list = payTypeList
|
||||
|
||||
init()
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -387,7 +387,6 @@ class SchemaValidator extends RuleValidator {
|
|||
}
|
||||
|
||||
async validateUpdate(data, allData) {
|
||||
console.log(allData);
|
||||
let result = this._checkFieldInSchema(data)
|
||||
if (!result) {
|
||||
result = await this.invokeValidateUpdate(data, false, allData)
|
||||
|
|
|
|||
Loading…
Reference in New Issue