This commit is contained in:
魏啾
2024-12-05 10:48:31 +08:00
9 changed files with 460 additions and 149 deletions

View File

@@ -39,6 +39,10 @@
</up-radio-group>
</uni-forms-item>
</view>
<uni-forms-item required name="name" label="商品名称" showRequired>
<uni-easyinput :paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle"
:inputBorder="inputBorder" v-model="FormData.name" placeholder="请输入商品名称" />
</uni-forms-item>
<uni-forms-item ref="fileItem" label="图片" required showRequired>
<my-upload-file ref="refFile" :images="FormData.images"
:imageStyles="imageStyles"></my-upload-file>
@@ -55,33 +59,27 @@
</up-checkbox-group>
</uni-forms-item>
</view>
<template v-if="FormData.type!='package'">
<uni-forms-item required name="name" label="商品名称" showRequired>
<uni-easyinput :paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle"
:inputBorder="inputBorder" v-model="FormData.name" placeholder="请输入商品名称" />
<view class="u-relative">
<uni-forms-item label="商品分类" required showRequired name="categoryId">
<uni-data-picker :clear-icon="false" :map="{text:'name',value:'id'}"
placeholder="请选择商品分类" popup-title="请选择商品分类" :localdata="pageData.category"
v-model="FormData.categoryId">
</uni-data-picker>
</uni-forms-item>
<view class="u-relative">
<uni-forms-item label="商品分类" required showRequired name="categoryId">
<uni-data-picker :clear-icon="false" :map="{text:'name',value:'id'}"
placeholder="请选择商品分类" popup-title="请选择商品分类" :localdata="pageData.category"
v-model="FormData.categoryId">
</uni-data-picker>
</uni-forms-item>
<view class="zhezhao u-absolute position-all" @click="canEditGoodsCategory(true)"
v-if="option.type=='edit'&&disabledChangeCategory">
</view>
<view class="zhezhao u-absolute position-all" @click="canEditGoodsCategory(true)"
v-if="option.type=='edit'&&disabledChangeCategory">
</view>
<view class="border-top-0">
<uni-forms-item label="单位" required showRequired name="units">
<uni-data-picker :clear-icon="false" @change="unitIdChange"
:map="{text:'name',value:'id'}" placeholder="请选择单位" popup-title="请选择单位"
:localdata="pageData.units" v-model="FormData.unitId">
</uni-data-picker>
</uni-forms-item>
</view>
</template>
</view>
<view class="">
<uni-forms-item label="单位" required showRequired name="units">
<uni-data-picker :clear-icon="false" @change="unitIdChange"
:map="{text:'name',value:'id'}" placeholder="请选择单位" popup-title="请选择单位"
:localdata="pageData.units" v-model="FormData.unitId">
</uni-data-picker>
</uni-forms-item>
</view>
<template v-if="FormData.type==='package'">
<!-- <view class="block border-top-0">
<uni-forms-item label="选择规格" required name="categoryId">
@@ -92,7 +90,8 @@
</uni-data-picker>
</uni-forms-item>
</view> -->
<view class="border-top" >
<view class="border-top" v-if="FormData.proGroupVo">
<view class=""
v-if=" (FormData.groupType==1&&FormData.proGroupVo.length)||(FormData.groupType==0&&FormData.proGroupVo.length&&FormData.proGroupVo[0].goods.length) ">
<view class="border-bottom u-p-b-32"
@@ -512,7 +511,7 @@
</view>
</template>
<template v-if="FormData.type=='weight'">
<template v-if="FormData.type=='weigh'">
<view class="block u-p-t-32 u-p-b-32">
<view class="font-bold">
<text class="color-red">*</text>
@@ -544,7 +543,7 @@
<view class="border-top-0">
<view class="u-flex u-row-between u-p-b-24 u-p-t-20">
<view class="label-title">是否允许临时改价</view>
<my-switch disabled :openDisabledClass="false"
<my-switch
v-model="FormData.isTempPrice"></my-switch>
</view>
</view>
@@ -1239,7 +1238,7 @@
singleOrderLimit:0,
singlePeopleLimit:0,
type: 'normal',
showType: 'table',
showType: ['table'],
specsInfoName: '',
id: "",
typeEnum: "normal",
@@ -1686,8 +1685,9 @@
}
}
if (type == 'package') {
if (groupType == 0) {
if (groupType == 0&& FormData.proGroupVo[0].goods.length<=0) {
// 固定套餐
return infoBox.showToast('套餐组合至少需要包含一种商品,请添加商品')
}
if (groupType == 1) {
let ispase = FormData.proGroupVo.length > 0 ? true : false
@@ -1711,7 +1711,7 @@
// 可选套餐
}
}
if (type == 'weight') {
if (type == 'weigh') {
if (!FormData.weight) {
return infoBox.showToast('请输入重量')
}
@@ -1937,6 +1937,9 @@
initDefaultProGroupVo()
}
}
if(FormData.groupType==null){
FormData.groupType=0
}
} else {
if (newval == 'package') {
initDefaultProGroupVo()