Merge branch 'test' of https://e.coding.net/g-cphe0354/cashier_front/cashier_admin_app into dwb
This commit is contained in:
@@ -12,14 +12,15 @@
|
|||||||
<view class="block">
|
<view class="block">
|
||||||
<view class="border-top-0 typeEnum">
|
<view class="border-top-0 typeEnum">
|
||||||
<uni-forms-item label="商品类型" required showRequired>
|
<uni-forms-item label="商品类型" required showRequired>
|
||||||
<up-radio-group v-model="FormData.type" placement="row">
|
<up-radio-group v-model="FormData.type" placement="row"
|
||||||
|
@change="changeFormDatatype">
|
||||||
<up-radio v-for="(item, index) in pageData.types" :key="index"
|
<up-radio v-for="(item, index) in pageData.types" :key="index"
|
||||||
:label="item.name" :name="item.value">
|
:label="item.name" :name="item.value">
|
||||||
</up-radio>
|
</up-radio>
|
||||||
</up-radio-group>
|
</up-radio-group>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
</view>
|
</view>
|
||||||
<view class="" v-if="FormData.type!='package'">
|
<view class="" v-if="FormData.type!='package' && FormData.type!='weigh'">
|
||||||
<uni-forms-item label="商品规格" required showRequired>
|
<uni-forms-item label="商品规格" required showRequired>
|
||||||
<up-radio-group v-model="FormData.typeEnum" placement="row">
|
<up-radio-group v-model="FormData.typeEnum" placement="row">
|
||||||
<up-radio :custom-style="{marginRight:'30px'}"
|
<up-radio :custom-style="{marginRight:'30px'}"
|
||||||
@@ -515,12 +516,12 @@
|
|||||||
<view class="block u-p-t-32 u-p-b-32">
|
<view class="block u-p-t-32 u-p-b-32">
|
||||||
<view class="font-bold">
|
<view class="font-bold">
|
||||||
<text class="color-red">*</text>
|
<text class="color-red">*</text>
|
||||||
<text>重量</text>
|
<text>单位</text>
|
||||||
</view>
|
</view>
|
||||||
<view class=" u-m-t-16">
|
<view class=" u-m-t-16">
|
||||||
<up-input v-model="FormData.weight">
|
<up-input v-model="FormData.weight">
|
||||||
<template #suffix>
|
<template #suffix>
|
||||||
<view class="bg-gray">千克</view>
|
<view class="bg-gray">{{activeinHouseList}}</view>
|
||||||
</template>
|
</template>
|
||||||
</up-input>
|
</up-input>
|
||||||
<view class="u-m-t-16 color-999 u-font-24">用于快递或配送运费计重</view>
|
<view class="u-m-t-16 color-999 u-font-24">用于快递或配送运费计重</view>
|
||||||
@@ -543,8 +544,7 @@
|
|||||||
<!-- <view class="border-top-0">
|
<!-- <view class="border-top-0">
|
||||||
<view class="u-flex u-row-between u-p-b-24 u-p-t-20">
|
<view class="u-flex u-row-between u-p-b-24 u-p-t-20">
|
||||||
<view class="label-title">是否允许临时改价</view>
|
<view class="label-title">是否允许临时改价</view>
|
||||||
<my-switch
|
<my-switch v-model="FormData.isTempPrice"></my-switch>
|
||||||
v-model="FormData.isTempPrice"></my-switch>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-p-t-24 u-p-b-24 border-top u-flex u-row-between">
|
<view class="u-p-t-24 u-p-b-24 border-top u-flex u-row-between">
|
||||||
@@ -577,7 +577,8 @@
|
|||||||
<view>
|
<view>
|
||||||
<uni-forms-item label="">
|
<uni-forms-item label="">
|
||||||
<view class="u-flex u-row-between" @tap="toTimerPage">
|
<view class="u-flex u-row-between" @tap="toTimerPage">
|
||||||
<view>
|
<view style="display: flex;">
|
||||||
|
<text class="color-red">*</text>
|
||||||
<view class="label-title">定时上下架</view>
|
<view class="label-title">定时上下架</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex u-font-24">
|
<view class="u-flex u-font-24">
|
||||||
@@ -1228,9 +1229,9 @@
|
|||||||
//表单边框
|
//表单边框
|
||||||
const inputBorder = ref(false)
|
const inputBorder = ref(false)
|
||||||
const FormData = reactive({
|
const FormData = reactive({
|
||||||
days: '',
|
days: "Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday",
|
||||||
startTime: '',
|
endTime: "23:59",
|
||||||
endTime: '',
|
startTime: "00:00",
|
||||||
//每日销量上限,
|
//每日销量上限,
|
||||||
dayLimit: 0,
|
dayLimit: 0,
|
||||||
singleOrderLimit: 0,
|
singleOrderLimit: 0,
|
||||||
@@ -1570,6 +1571,12 @@
|
|||||||
getTbShopUnit()
|
getTbShopUnit()
|
||||||
getTbProductSpec()
|
getTbProductSpec()
|
||||||
})
|
})
|
||||||
|
const changeFormDatatype = (e) => {
|
||||||
|
console.log(e)
|
||||||
|
console.log(FormData)
|
||||||
|
// 当是称重商品时 默认是单规格
|
||||||
|
FormData.typeEnum = 'normal'
|
||||||
|
}
|
||||||
|
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
// if (option.type === 'edit') {
|
// if (option.type === 'edit') {
|
||||||
@@ -1775,7 +1782,6 @@
|
|||||||
return result.replace(/.$/, "")
|
return result.replace(/.$/, "")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 监听规格保存,拿到数据
|
* 监听规格保存,拿到数据
|
||||||
*/
|
*/
|
||||||
@@ -2013,11 +2019,22 @@
|
|||||||
disabledChangeCategory.value = !res
|
disabledChangeCategory.value = !res
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const activeinHouseList = computed(() => {
|
||||||
|
try {
|
||||||
|
return pageData.units.filter((item) => {
|
||||||
|
if (item.id == FormData.unitId) {
|
||||||
|
return item.name
|
||||||
|
}
|
||||||
|
})[0].name
|
||||||
|
} catch (error) {
|
||||||
|
//TODO handle the exception
|
||||||
|
}
|
||||||
|
});
|
||||||
/**
|
/**
|
||||||
* 权限end
|
* 权限end
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
watch(() => pageData.types, (newval) => {
|
watch(() => pageData.types, (newval) => {
|
||||||
Forms.value.setRules(rules)
|
Forms.value.setRules(rules)
|
||||||
})
|
})
|
||||||
@@ -2028,6 +2045,7 @@
|
|||||||
onReady(() => {
|
onReady(() => {
|
||||||
Forms.value && Forms.value.setRules(rules)
|
Forms.value && Forms.value.setRules(rules)
|
||||||
})
|
})
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
clearTimeout(timer)
|
clearTimeout(timer)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
</image>
|
</image>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-m-l-30 u-m-r-30 color-333">
|
<view class="u-m-l-30 u-m-r-30 color-333">
|
||||||
{{item.number}}
|
{{(item.number).toFixed(2)}}
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex" @tap="updateNumber(true,index,item)">
|
<view class="u-flex" @tap="updateNumber(true,index,item)">
|
||||||
<image src="/pagesCreateOrder/static/images/icon-add-black.svg" class="icon" mode="">
|
<image src="/pagesCreateOrder/static/images/icon-add-black.svg" class="icon" mode="">
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<template v-if="data.chooseNumber">
|
<template v-if="data.chooseNumber">
|
||||||
<view class="u-font-32">
|
<view class="u-font-32">
|
||||||
{{data.chooseNumber}}
|
{{(data.chooseNumber).toFixed(2)}}
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex" @tap.stop="emitEvent('reduce')">
|
<view class="u-flex" @tap.stop="emitEvent('reduce')">
|
||||||
<image src="/pagesCreateOrder/static/images/icon-reduce.svg" class="icon" mode="">
|
<image src="/pagesCreateOrder/static/images/icon-reduce.svg" class="icon" mode="">
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
<button @click="deleteLast">←</button>
|
<button @click="deleteLast">←</button>
|
||||||
</view>
|
</view>
|
||||||
<view class="classmoney">
|
<view class="classmoney">
|
||||||
¥ {{ form.goods.lowPrice * currentInput }}
|
¥ {{ (form.goods.lowPrice * currentInput).toFixed(2) }}
|
||||||
</view>
|
</view>
|
||||||
<view class="classconfirm" @click="clickconfirm">
|
<view class="classconfirm" @click="clickconfirm">
|
||||||
确认
|
确认
|
||||||
@@ -90,10 +90,12 @@
|
|||||||
// 首位不能输入0
|
// 首位不能输入0
|
||||||
if (currentInput.value === '') {
|
if (currentInput.value === '') {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请输入'
|
title: '请输入',
|
||||||
|
icon: 'none'
|
||||||
})
|
})
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
emit('weighgoodsUpdate', form.foodsindex, form.index, true, '', currentInput.value)
|
emit('weighgoodsUpdate', form.foodsindex, form.index, true, undefined, currentInput.value)
|
||||||
overlayshow.value = false
|
overlayshow.value = false
|
||||||
}
|
}
|
||||||
//显示
|
//显示
|
||||||
@@ -106,7 +108,6 @@
|
|||||||
index,
|
index,
|
||||||
goods
|
goods
|
||||||
})
|
})
|
||||||
console.log(form)
|
|
||||||
overlayshow.value = true
|
overlayshow.value = true
|
||||||
}
|
}
|
||||||
defineExpose({
|
defineExpose({
|
||||||
|
|||||||
@@ -862,7 +862,6 @@
|
|||||||
// 称重
|
// 称重
|
||||||
const refweighitem = ref(null)
|
const refweighitem = ref(null)
|
||||||
const tapweigh = (foodsindex, index) => {
|
const tapweigh = (foodsindex, index) => {
|
||||||
console.log(foodsindex, index)
|
|
||||||
const goods = data.tabbar[index].foods[foodsindex]
|
const goods = data.tabbar[index].foods[foodsindex]
|
||||||
refweighitem.value.open(foodsindex, index, goods)
|
refweighitem.value.open(foodsindex, index, goods)
|
||||||
}
|
}
|
||||||
@@ -990,7 +989,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function searchGoodsUpdate(goodsItem, goodsIndex, isAdd) {
|
function searchGoodsUpdate(goodsItem, goodsIndex, isAdd) {
|
||||||
console.log(goodsItem.goodsIndex, goodsItem.index, isAdd, goodsIndex, 111111)
|
|
||||||
goodsUpdate(goodsItem.goodsIndex, goodsItem.index, isAdd, goodsIndex)
|
goodsUpdate(goodsItem.goodsIndex, goodsItem.index, isAdd, goodsIndex)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1015,10 +1013,6 @@
|
|||||||
const productId = $goods.id
|
const productId = $goods.id
|
||||||
const skuId = $goods.specList[0].id
|
const skuId = $goods.specList[0].id
|
||||||
let suit = $goods.specList[0].suit || 1
|
let suit = $goods.specList[0].suit || 1
|
||||||
// 不影响之前的代码 称重suit单独处理
|
|
||||||
if ($goods.type == 'weigh' && showCurrentInput) {
|
|
||||||
suit = showCurrentInput
|
|
||||||
}
|
|
||||||
if (goodsInCarIndex !== -1) {
|
if (goodsInCarIndex !== -1) {
|
||||||
//更新
|
//更新
|
||||||
const carGoods = cars[goodsInCarIndex]
|
const carGoods = cars[goodsInCarIndex]
|
||||||
@@ -1050,6 +1044,10 @@
|
|||||||
$goods.chooseNumber = number
|
$goods.chooseNumber = number
|
||||||
setSearchGoods(searchGoodsIndex, number)
|
setSearchGoods(searchGoodsIndex, number)
|
||||||
} else {
|
} else {
|
||||||
|
// 不影响之前的代码 称重suit单独处理
|
||||||
|
if ($goods.type == 'weigh' && showCurrentInput) {
|
||||||
|
suit = showCurrentInput
|
||||||
|
}
|
||||||
// 套餐和单规格
|
// 套餐和单规格
|
||||||
if ($goods.groupType != 1) {
|
if ($goods.groupType != 1) {
|
||||||
//增加
|
//增加
|
||||||
@@ -1060,7 +1058,7 @@
|
|||||||
skuId
|
skuId
|
||||||
})
|
})
|
||||||
infoBox.showToast('添加成功')
|
infoBox.showToast('添加成功')
|
||||||
$goods.chooseNumber = num
|
$goods.chooseNumber = Number(num)
|
||||||
cars.push(cartGoods)
|
cars.push(cartGoods)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="constant">
|
<view class="constant">
|
||||||
<view class="constantitem" @click="overlayshow = true">
|
<view class="constantitem" @click="object_id =null,overlayshow = true">
|
||||||
<view>扫码核销</view>
|
<view>扫码核销</view>
|
||||||
<view>
|
<view>
|
||||||
<up-icon name="arrow-right" color="#909399" size="20"></up-icon>
|
<up-icon name="arrow-right" color="#909399" size="20"></up-icon>
|
||||||
|
|||||||
Reference in New Issue
Block a user