更新商品管理模块
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
<template>
|
||||
<view class="u-p-30 safe-page">
|
||||
<up-sticky v-if="option.type==='edit'" offset-top="20" zIndex="99">
|
||||
<myTabs :list="tabsList" v-model="tabsCurrent"></myTabs>
|
||||
<myTabs :list="tabsList" v-model="tabsCurrent"></myTabs>
|
||||
</up-sticky>
|
||||
|
||||
<view class="box">
|
||||
<template v-if="tabsCurrent===0">
|
||||
<view class="basic">
|
||||
@@ -11,20 +10,13 @@
|
||||
err-show-type="toast" validateTrigger="submit" label-width="350" ref="Forms">
|
||||
<view class="block">
|
||||
<uni-forms-item label="商品类型" required showRequired>
|
||||
<up-radio-group
|
||||
:disabled="option.type=='edit'"
|
||||
v-model="FormData.typeEnum"
|
||||
placement="row"
|
||||
>
|
||||
<up-radio
|
||||
:customStyle="{marginRight: '30px'}"
|
||||
v-for="(item, index) in pageData.types"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:name="item.value"
|
||||
>
|
||||
</up-radio>
|
||||
</up-radio-group>
|
||||
<up-radio-group :disabled="option.type=='edit'" v-model="FormData.typeEnum"
|
||||
placement="row">
|
||||
<up-radio :customStyle="{marginRight: '30px'}"
|
||||
v-for="(item, index) in pageData.types" :key="index" :label="item.name"
|
||||
:name="item.value">
|
||||
</up-radio>
|
||||
</up-radio-group>
|
||||
<!-- <view class="u-flex u-flex-wrap types " :class="{disabled:option.productId!==''}">
|
||||
<view class="item" @tap="changeFormData('typeEnum',item.value)"
|
||||
:class="{active:FormData.typeEnum===item.value}"
|
||||
@@ -37,7 +29,7 @@
|
||||
</view> -->
|
||||
|
||||
</uni-forms-item>
|
||||
<uni-forms-item ref="fileItem" label="图片">
|
||||
<uni-forms-item ref="fileItem" label="图片" required showRequired>
|
||||
<my-upload-file ref="refFile" :images="FormData.images"></my-upload-file>
|
||||
<view class="u-m-t-16 color-999 u-font-24">
|
||||
注:第一张图为商品封面图,图片尺寸为750x750
|
||||
@@ -63,17 +55,6 @@
|
||||
</uni-forms-item>
|
||||
</view>
|
||||
|
||||
<!-- <uni-forms-item label="商品详情" required>
|
||||
<uni-easyinput :paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle"
|
||||
type="textarea" v-model="FormData.goodsDetail" placeholder="请填写商品详情" />
|
||||
</uni-forms-item> -->
|
||||
|
||||
<!-- <view class="">
|
||||
<uni-forms-item label="规格模式" required>
|
||||
<uni-data-checkbox v-model="FormData.specificationsPattern"
|
||||
:localdata="specificationMode" />
|
||||
</uni-forms-item>
|
||||
</view> -->
|
||||
<view class="border-top-0">
|
||||
<uni-forms-item label="单位" required showRequired name="categoryId">
|
||||
|
||||
@@ -84,7 +65,7 @@
|
||||
</uni-forms-item>
|
||||
</view>
|
||||
|
||||
<template v-if="FormData.typeEnum==='group'">
|
||||
<template v-if="FormData.typeEnum==='group'">
|
||||
<view class="border-top-0">
|
||||
<uni-forms-item label="团购券分类" required showRequired name="categoryId">
|
||||
<view class="u-p-30 bg-gray u-m-b-20" v-if="FormData.groupCategoryId.length">
|
||||
@@ -118,179 +99,29 @@
|
||||
<choose-group-category @confirm="refChooseCouponCategoryConfirm"
|
||||
ref="refChooseGroupCategory"></choose-group-category>
|
||||
</template>
|
||||
|
||||
|
||||
<!-- <view class="">
|
||||
<uni-forms-item label=" " required>
|
||||
<view class="u-flex u-row-between zuofa" @tap="toGuige ">
|
||||
<view class="color-333">{{returnSpecificationsGroup }}</view>
|
||||
<uni-icons type="right"></uni-icons>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
</view> -->
|
||||
|
||||
|
||||
<!-- <uni-forms-item label="底价(元)" name="floorPrice" required>
|
||||
<uni-easyinput :paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle"
|
||||
:inputBorder="inputBorder" v-model="FormData.floorPrice" placeholder="请输入底价(元)" />
|
||||
</uni-forms-item> -->
|
||||
<!-- <uni-forms-item label="售卖方式" required>
|
||||
<view style="display: none;"><uni-easyinput :paddingNone="inputPaddingNone"
|
||||
:inputBorder="inputBorder" v-model="FormData.salesMethod"
|
||||
placeholder="请选择售卖方式" />
|
||||
</view>
|
||||
<picker @change="salesMethodChange" :value="salesMethod.defaultIndex"
|
||||
:range="salesMethod.list">
|
||||
<view class="u-flex u-row-between lh40" v-if="FormData.salesMethod===0">
|
||||
<view class="color-333">{{salesMethod.list[FormData.salesMethod]||'售卖方式'}}
|
||||
</view>
|
||||
<uni-icons type="right"></uni-icons>
|
||||
</view>
|
||||
<view class="u-flex u-row-between lh40" v-if="FormData.salesMethod===1">
|
||||
<view class="u-flex">
|
||||
<text
|
||||
class="color-333">{{salesMethod.list[FormData.salesMethod]||'售卖方式'}}</text>
|
||||
<view class="u-flex color-999">
|
||||
<text>(</text>
|
||||
<text class="color-red">*</text>
|
||||
<text class="u-font-24">注意:预售商品不支持堂食</text>
|
||||
<text>)</text>
|
||||
</view>
|
||||
</view>
|
||||
<uni-icons type="right"></uni-icons>
|
||||
</view>
|
||||
<view class="u-flex u-row-between lh40" v-if="FormData.salesMethod===2">
|
||||
<view class="u-flex">
|
||||
<text
|
||||
class="color-333">{{salesMethod.list[FormData.salesMethod]||'售卖方式'}}</text>
|
||||
<view class="u-flex color-999">
|
||||
<text>(</text>
|
||||
<text class="color-red">*</text>
|
||||
<text class="u-font-24">注意:该商品仅作展示,无法进行下单</text>
|
||||
<text>)</text>
|
||||
</view>
|
||||
</view>
|
||||
<uni-icons type="right"></uni-icons>
|
||||
</view>
|
||||
</picker>
|
||||
</uni-forms-item> -->
|
||||
<!-- <template v-if="FormData.salesMethod==1">
|
||||
<view class="bg-gray border-top-0">
|
||||
<uni-forms-item label="交货时间" required>
|
||||
<radio-group @change="DeliveryTimeChange">
|
||||
<label class="u-flex " :class="{
|
||||
'u-m-b-40':index===0
|
||||
}" v-for="(item, index) in DeliveryTime" :key="item.value">
|
||||
<view>
|
||||
<radio :color="ColorMain" :value="item.value"
|
||||
:checked="index === DeliveryTimeCurrent" />
|
||||
</view>
|
||||
<view class="u-flex-1">
|
||||
<template v-if="index===0">
|
||||
<uni-datetime-picker v-model="FormData.startTime"
|
||||
:hide-second="true" :end="limitDayTime">
|
||||
<view class="u-flex u-row-between">
|
||||
<view>
|
||||
<text></text>
|
||||
<text
|
||||
class="color-999">{{FormData.startTime||'选择开始时间'}}</text>
|
||||
</view>
|
||||
<uni-icons type="right" color="#999"></uni-icons>
|
||||
</view>
|
||||
</uni-datetime-picker>
|
||||
|
||||
</template>
|
||||
<template v-if="index===1">
|
||||
<view class="u-flex ">
|
||||
<view>
|
||||
付款成功
|
||||
</view>
|
||||
<uni-easyinput :paddingNone="inputPaddingNone"
|
||||
:placeholderStyle="placeholderStyle"
|
||||
:inputBorder="false"
|
||||
v-model="FormData.paySuccessAfterDay" type="number"
|
||||
placeholder="请填写天数" />
|
||||
|
||||
|
||||
<view>
|
||||
天后交货
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
|
||||
</label>
|
||||
</radio-group>
|
||||
</uni-forms-item>
|
||||
</view>
|
||||
<view class="color-999 u-font-24 u-m-t-20 u-p-b-30">
|
||||
<text class="color-red">*</text> 注意: 只允许设置{{limitDay}}天内的发货时间,请务必按照约定时间发货以免引起客户投诉
|
||||
</view>
|
||||
<view class="">
|
||||
<uni-forms-item label="" required>
|
||||
<slot name="label">
|
||||
<view class="class">
|
||||
<text class="label-title u-m-r-6">预售可预约天数</text>
|
||||
<uni-icons @click="showModel('help')" color="#999"
|
||||
type="help"></uni-icons>
|
||||
</view>
|
||||
</slot>
|
||||
<view class="u-flex">
|
||||
<uni-easyinput :paddingNone="inputPaddingNone" :min="1" :max="15"
|
||||
:placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
||||
v-model="FormData.discountPrice" type="number" placeholder="填写天数" />
|
||||
<text>天</text>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
</view>
|
||||
</template> -->
|
||||
<!-- <uni-forms-item label="" required>
|
||||
<view class="u-flex u-row-between lh40">
|
||||
<view class="label-title">库存</view>
|
||||
<my-switch v-model="FormData.isStock"></my-switch>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
<view class="border-top-0 none-label" v-if="FormData.isStock">
|
||||
<uni-forms-item label="" required>
|
||||
<uni-easyinput :paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle"
|
||||
:inputBorder="inputBorder" v-model="FormData.stockNumber" type="number"
|
||||
placeholder="请填写库存" />
|
||||
</uni-forms-item>
|
||||
</view> -->
|
||||
|
||||
</view>
|
||||
|
||||
<template v-if="FormData.typeEnum==='sku' ">
|
||||
<!-- <view class="block 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="pageData.specList" v-model="FormData.specId">
|
||||
</uni-data-picker>
|
||||
</uni-forms-item>
|
||||
</view> -->
|
||||
<template v-if="FormData.typeEnum=='sku' ">
|
||||
<view class="block border-top-0">
|
||||
<uni-forms-item label=" ">
|
||||
<view class="u-flex u-row-between " @tap="toGuige">
|
||||
<view class="color-333 font-bold">
|
||||
<text v-if="!skuList.length">选择规格</text>
|
||||
<text v-if="!skuList.list.length">选择规格</text>
|
||||
<text v-else>编辑规格</text>
|
||||
</view>
|
||||
<uni-icons type="right"></uni-icons>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
<template v-if="skuList.length">
|
||||
<template v-if="skuList.list.length">
|
||||
<view class="u-text-center">
|
||||
<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"
|
||||
<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.salePrice}}</view>
|
||||
<view class="u-flex-1">{{item.stockNumber}}</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -374,9 +205,9 @@
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<template v-if="FormData.typeEnum!=='sku'">
|
||||
<template v-if="FormData.typeEnum!='sku'">
|
||||
<view class="u-m-t-32 u-font-32 u-m-l-10 u-m-b-32">规格属性</view>
|
||||
<view class="block" v-for="(sku,index) in skuList" :key="index">
|
||||
<view class="block" v-for="(sku,index) in skuList.list" :key="index">
|
||||
<view class="border-top-0">
|
||||
<uni-forms-item label="售价">
|
||||
<uni-easyinput :paddingNone="inputPaddingNone"
|
||||
@@ -392,7 +223,7 @@
|
||||
:inputBorder="inputBorder" v-model="sku.memberPrice" type="digit"
|
||||
placeholder="请输入会员价(元)" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="成本价(元)">
|
||||
<!-- <uni-forms-item label="成本价(元)">
|
||||
<uni-easyinput @blur="priceFormat(sku,'costPrice')" :paddingNone="inputPaddingNone"
|
||||
:placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
||||
v-model="sku.costPrice" type="digit" placeholder="请输入成本价(元)" />
|
||||
@@ -402,7 +233,7 @@
|
||||
:paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle"
|
||||
:inputBorder="inputBorder" v-model="sku.originPrice" type="digit"
|
||||
placeholder="请输入原价(元)" />
|
||||
</uni-forms-item>
|
||||
</uni-forms-item> -->
|
||||
<uni-forms-item label="起售数量">
|
||||
<uni-easyinput @blur="priceFormat(sku,'suit')" :paddingNone="inputPaddingNone"
|
||||
:placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
||||
@@ -598,138 +429,11 @@
|
||||
</template>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <view class="block">
|
||||
<view class="border-top-0">
|
||||
<uni-forms-item label="" required>
|
||||
<view class="u-flex u-row-between lh40">
|
||||
<view class="label-title">打折设置</view>
|
||||
<my-switch v-model="FormData.openDiscount"
|
||||
@change="openDiscountChange"></my-switch>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
</view>
|
||||
<view class="border-top-0 none-label" v-if="FormData.openDiscount">
|
||||
<uni-forms-item label="" required>
|
||||
<uni-easyinput :paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle"
|
||||
:inputBorder="inputBorder" v-model="FormData.discountPrice" type="digit"
|
||||
placeholder="请填写折后价" />
|
||||
</uni-forms-item>
|
||||
</view>
|
||||
<uni-forms-item label="" required>
|
||||
<view class="u-flex u-row-between lh40">
|
||||
<view class="label-title">不参与会员折扣</view>
|
||||
<my-switch v-model="FormData.isVipDiscount"></my-switch>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="会员价(元)" required>
|
||||
<uni-easyinput :paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle"
|
||||
:inputBorder="inputBorder" v-model="FormData.vipPrice" type="digit"
|
||||
placeholder="请输入会员价(元)" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="包装费(元)" required>
|
||||
<uni-easyinput :paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle"
|
||||
:inputBorder="inputBorder" v-model="FormData.packagingFee" type="digit"
|
||||
placeholder="请输入包装费(元)" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="重量(千克)" required>
|
||||
<uni-easyinput :paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle"
|
||||
:inputBorder="inputBorder" v-model="FormData.weight" type="digit"
|
||||
placeholder="请输入重量(千克)" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="赠送积分" required>
|
||||
<uni-easyinput :paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle"
|
||||
:inputBorder="inputBorder" v-model="FormData.integral" type="digit"
|
||||
placeholder="请输入赠送积分" />
|
||||
</uni-forms-item>
|
||||
|
||||
</view> -->
|
||||
|
||||
<!-- <view class="block">
|
||||
<view class="border-top-0 ">
|
||||
<uni-forms-item label="" required>
|
||||
<view class="u-flex u-row-between lh40">
|
||||
<view class="label-title">每日销量上限</view>
|
||||
<my-switch v-model="FormData.openDailySalesLimit"></my-switch>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
</view>
|
||||
<view class="border-top-0 none-label" v-if="FormData.openDailySalesLimit">
|
||||
<uni-forms-item label="" required>
|
||||
<uni-easyinput :paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle"
|
||||
:inputBorder="inputBorder" v-model="FormData.dailySalesLimit" type="digit"
|
||||
placeholder="请填写每日销量上限" />
|
||||
</uni-forms-item>
|
||||
</view>
|
||||
<uni-forms-item label="" required>
|
||||
<view class="u-flex u-row-between lh40">
|
||||
<view class="label-title">每单限购</view>
|
||||
<my-switch v-model="FormData.openOrderBuyLimit"></my-switch>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
<view class="border-top-0 none-label" v-if="FormData.openOrderBuyLimit">
|
||||
<uni-forms-item label="" required>
|
||||
<uni-easyinput :paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle"
|
||||
:inputBorder="inputBorder" v-model="FormData.orderBuyLimit" type="digit"
|
||||
placeholder="请填写每单限购" />
|
||||
</uni-forms-item>
|
||||
</view>
|
||||
<uni-forms-item label="" required>
|
||||
<view class="u-flex u-row-between lh40">
|
||||
<view class="label-title">每人限购</view>
|
||||
<my-switch v-model="FormData.openEveryoneBuyLimit"></my-switch>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
<view class="border-top-0 none-label" v-if="FormData.openEveryoneBuyLimit">
|
||||
<uni-forms-item label="" required>
|
||||
<uni-easyinput :paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle"
|
||||
:inputBorder="inputBorder" v-model="FormData.everyoneBuyLimit" type="digit"
|
||||
placeholder="请填写每人限购" />
|
||||
</uni-forms-item>
|
||||
</view>
|
||||
<uni-forms-item label="最低起售(件)" required>
|
||||
<uni-easyinput :paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle"
|
||||
:inputBorder="inputBorder" v-model="FormData.minBuyLimit" type="number"
|
||||
placeholder="请输入最低起售(件)" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="包装费(元)" required>
|
||||
<uni-easyinput :paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle"
|
||||
:inputBorder="inputBorder" v-model="FormData.packagingFee" type="digit"
|
||||
placeholder="请输入包装费(元)" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="">
|
||||
<view class="u-flex u-row-between" @tap="toTimerPage">
|
||||
<view>
|
||||
<view class="label-title">定时上下架</view>
|
||||
</view>
|
||||
<view class="u-flex">
|
||||
<view class="color-666">{{returnTimerText()}}</view>
|
||||
<uni-icons type="right"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
|
||||
<uni-forms-item label="虚拟销量" required>
|
||||
<uni-easyinput :paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle"
|
||||
:inputBorder="inputBorder" v-model="FormData.virtualSales" type="number"
|
||||
placeholder="虚拟销量" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="" required>
|
||||
<view class="u-flex u-row-between lh40">
|
||||
<view class="label-title">设为推荐</view>
|
||||
<my-switch v-model="FormData.isRecommend"></my-switch>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
|
||||
</view> -->
|
||||
|
||||
</uni-forms>
|
||||
<view style="height: 200rpx;"></view>
|
||||
<view style="padding-left: 110rpx;padding-right: 110rpx;" class="u-m-t-20" v-if="option.type==='edit'" @click="delModelShow">
|
||||
<my-button bgColor="#F9F9F9" shape="circle" type="cancel" >
|
||||
<view style="padding-left: 110rpx;padding-right: 110rpx;" class="u-m-t-20"
|
||||
v-if="option.type==='edit'" @click="delModelShow">
|
||||
<my-button bgColor="#F9F9F9" shape="circle" type="cancel">
|
||||
<view class="color-red">删除该商品</view>
|
||||
</my-button>
|
||||
</view>
|
||||
@@ -737,18 +441,13 @@
|
||||
<view class="save-btn-box">
|
||||
<my-button shape="circle" @tap="save">保存</my-button>
|
||||
</view>
|
||||
<!-- <view class="u-m-t-20" v-if="option.type==='edit'" @click="delModelShow">
|
||||
<my-button bgColor="#fff" shape="circle" type="cancel" >
|
||||
<view class="color-red">删除该商品</view>
|
||||
</my-button>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<template v-if="tabsCurrent===1">
|
||||
<edit-haocai :goods="FormData" @cancel="changeTabsCurrent(0)"></edit-haocai>
|
||||
<edit-haocai @updateGoods="updateGoodsDetail" :goods="FormData" @cancel="changeTabsCurrent(0)"></edit-haocai>
|
||||
</template>
|
||||
</view>
|
||||
|
||||
@@ -762,15 +461,16 @@
|
||||
</template>
|
||||
</my-model>
|
||||
|
||||
|
||||
|
||||
<!-- 删除弹窗 -->
|
||||
<my-model @confirm="delmodelConfirm" ref="delModel" desc="确认删除">
|
||||
</my-model>
|
||||
<!-- 选择商品 -->
|
||||
<choose-goods ref="refChooseGoods" @confirm="refChooseGoodsConfirm" :category="pageData.category"></choose-goods>
|
||||
<!-- 更多操作 -->
|
||||
<my-action-sheet @itemClick="actionSheetClick" ref="refMoreSheet" :list="actionSheet.list"></my-action-sheet>
|
||||
|
||||
|
||||
<!-- 删除弹窗 -->
|
||||
<my-model @confirm="delmodelConfirm" ref="delModel" desc="确认删除">
|
||||
</my-model>
|
||||
<!-- 选择商品 -->
|
||||
<choose-goods ref="refChooseGoods" @confirm="refChooseGoodsConfirm"
|
||||
:category="pageData.category"></choose-goods>
|
||||
<!-- 更多操作 -->
|
||||
<my-action-sheet @itemClick="actionSheetClick" ref="refMoreSheet" :list="actionSheet.list"></my-action-sheet>
|
||||
</view>
|
||||
|
||||
|
||||
@@ -798,7 +498,7 @@
|
||||
import myButton from '@/components/my-components/my-button'
|
||||
import mySwitch from '@/components/my-components/my-switch.vue'
|
||||
import infoBox from "@/commons/utils/infoBox.js"
|
||||
|
||||
|
||||
import {
|
||||
$types,
|
||||
$defaultSku
|
||||
@@ -1146,11 +846,12 @@
|
||||
|
||||
const tabsList = ['基础设置', '耗材绑定']
|
||||
let tabsCurrent = ref(0)
|
||||
function changeTabsCurrent(newval){
|
||||
tabsCurrent.value=newval
|
||||
|
||||
function changeTabsCurrent(newval) {
|
||||
tabsCurrent.value = newval
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
const Forms = ref(null)
|
||||
|
||||
|
||||
@@ -1253,10 +954,15 @@
|
||||
usageRules: ""
|
||||
}
|
||||
})
|
||||
const skuList = reactive([{
|
||||
...$defaultSku,
|
||||
barCode: `${uni.getStorageSync("shopId")}${dayjs().valueOf()}`
|
||||
}])
|
||||
const skuList = reactive({
|
||||
list: [{
|
||||
...$defaultSku,
|
||||
barCode: `${uni.getStorageSync("shopId")}${dayjs().valueOf()}`
|
||||
}]
|
||||
})
|
||||
watch(() => skuList.list, (newval) => {
|
||||
console.log(newval);
|
||||
})
|
||||
//库存表单数据
|
||||
const stockData = reactive({
|
||||
inventoryMode: 0,
|
||||
@@ -1294,13 +1000,21 @@
|
||||
url: v
|
||||
}
|
||||
})
|
||||
$goodsData = res
|
||||
Object.assign(FormData, res)
|
||||
if (res.skuList.length) {
|
||||
for (let i in res.skuList) {
|
||||
skuList[i] = res.skuList[i]
|
||||
for(let i in res.conInfos){
|
||||
const con=res.conInfos[i]
|
||||
const item=res.skuList.find(v=>v.id==con.productSkuId)
|
||||
if(item){
|
||||
if(item.hasOwnProperty('haoCaiList')){
|
||||
item.haoCaiList.push(con)
|
||||
}else{
|
||||
item.haoCaiList=[con]
|
||||
}
|
||||
}
|
||||
}
|
||||
$goodsData = res
|
||||
console.log(res);
|
||||
Object.assign(FormData, res)
|
||||
skuList.list = res.skuList || []
|
||||
//多规格
|
||||
if (res.typeEnum === 'sku') {
|
||||
const selectSpec = JSON.parse(res.selectSpec)
|
||||
@@ -1319,13 +1033,12 @@
|
||||
selectSpec: selectSpec.map(s => {
|
||||
return {
|
||||
...s,
|
||||
// value: s.value.map(v => {
|
||||
// return {
|
||||
// text: v,
|
||||
// value: v
|
||||
// }
|
||||
// })
|
||||
|
||||
value: s.value.map(v => {
|
||||
return typeof v === 'string' ? {
|
||||
text: v,
|
||||
value: v
|
||||
} : v
|
||||
})
|
||||
}
|
||||
}),
|
||||
result: res.skuList.map(v => {
|
||||
@@ -1339,7 +1052,8 @@
|
||||
...v
|
||||
},
|
||||
names,
|
||||
specSnap: v.specSnap
|
||||
specSnap: v.specSnap,
|
||||
coverImg:v.coverImg
|
||||
}
|
||||
}),
|
||||
specList: [],
|
||||
@@ -1422,9 +1136,14 @@
|
||||
const pageData = reactive({
|
||||
// 商品类型
|
||||
// types: $types,
|
||||
types: [
|
||||
{name:'单规格',value:'normal'},
|
||||
{name:'多规格',value:'sku'}
|
||||
types: [{
|
||||
name: '单规格',
|
||||
value: 'normal'
|
||||
},
|
||||
{
|
||||
name: '多规格',
|
||||
value: 'sku'
|
||||
}
|
||||
],
|
||||
// 单位
|
||||
units: [],
|
||||
@@ -1441,6 +1160,10 @@
|
||||
pageData.skuList = res
|
||||
})
|
||||
}
|
||||
function updateGoodsDetail(){
|
||||
getGoodsDetail()
|
||||
getProductSku()
|
||||
}
|
||||
onLoad((params) => {
|
||||
if (isEmpty(params)) {
|
||||
option.type = params.type ? params.type : 'add'
|
||||
@@ -1454,6 +1177,10 @@
|
||||
uni.setNavigationBarTitle({
|
||||
title: option.type === 'add' ? '添加商品' : '编辑商品'
|
||||
})
|
||||
if (option.type === 'edit') {
|
||||
getGoodsDetail()
|
||||
getProductSku()
|
||||
}
|
||||
defaultValueInit()
|
||||
getCategory()
|
||||
getTbShopUnit()
|
||||
@@ -1461,10 +1188,10 @@
|
||||
})
|
||||
|
||||
onShow(() => {
|
||||
if (option.type === 'edit') {
|
||||
getGoodsDetail()
|
||||
getProductSku()
|
||||
}
|
||||
// if (option.type === 'edit') {
|
||||
// getGoodsDetail()
|
||||
// getProductSku()
|
||||
// }
|
||||
})
|
||||
|
||||
|
||||
@@ -1498,15 +1225,23 @@
|
||||
if (typeEnum === 'group' && !groupCategoryId.length) {
|
||||
return infoBox.showToast('请选择团购券分类')
|
||||
}
|
||||
|
||||
// if(typeEnum==='sku'){
|
||||
// return infoBox.showErrorToast('请选择规格')
|
||||
// }
|
||||
const images = refFile.value.getFileList()
|
||||
if(images.length<=0){
|
||||
return infoBox.showToast('请上传商品图片')
|
||||
}
|
||||
const skuSnap = []
|
||||
const submitSkuList = FormData.specificationsGroup ? skuList : [{
|
||||
let submitSkuList = FormData.specificationsGroup ? skuList.list : [{
|
||||
...$defaultSku,
|
||||
barCode: `${uni.getStorageSync("shopId")}${dayjs().valueOf()}`
|
||||
}]
|
||||
}];
|
||||
if(typeEnum=='normal'){
|
||||
submitSkuList=skuList.list ;
|
||||
}
|
||||
console.log(submitSkuList);
|
||||
if (FormData.specificationsGroup) {
|
||||
for (let i of FormData.specificationsGroup.selectSpec) {
|
||||
if (i.selectSpecResult.length) {
|
||||
@@ -1517,7 +1252,6 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const submitData = {
|
||||
...FormData,
|
||||
images: images,
|
||||
@@ -1526,7 +1260,13 @@
|
||||
specInfo: JSON.stringify(submitSkuList),
|
||||
lowPrice: submitSkuList[0].salePrice,
|
||||
specificationsGroup: undefined,
|
||||
selectSpec: JSON.stringify(FormData.specificationsGroup.selectSpec),
|
||||
selectSpec: JSON.stringify(FormData.specificationsGroup.selectSpec.map(spe=>{
|
||||
return {
|
||||
...spe,value:spe.value.map(v=>{
|
||||
return typeof v==='string'?v:v.text||v.value
|
||||
})
|
||||
}
|
||||
})),
|
||||
skuSnap: JSON.stringify(skuSnap)
|
||||
}
|
||||
//编辑
|
||||
@@ -1562,29 +1302,33 @@
|
||||
|
||||
/**
|
||||
* 监听规格保存,拿到数据
|
||||
* @param {Boolean} open //控制开启或关闭监听
|
||||
*/
|
||||
function watchSpecificationsSave(open = true) {
|
||||
if (open) {
|
||||
uni.$on('emitspecificationsSave', function(data) {
|
||||
FormData.specificationsGroup = data
|
||||
skuList.length = data.result.length
|
||||
for (let i in data.result) {
|
||||
const v = data.result[i]
|
||||
skuList[i] = {
|
||||
...v.skus,
|
||||
...v.names,
|
||||
specSnap: v.specSnap,
|
||||
}
|
||||
}
|
||||
console.log(skuList);
|
||||
})
|
||||
} else {
|
||||
uni.$off('emitspecificationsSave', function(data) {
|
||||
console.log('emitspecificationsSave remove');
|
||||
})
|
||||
}
|
||||
const newSkuList = reactive({
|
||||
list: []
|
||||
})
|
||||
|
||||
function watchSpecificationsSave() {
|
||||
uni.$off('emitspecificationsSave')
|
||||
uni.$on('emitspecificationsSave', function(data) {
|
||||
FormData.specificationsGroup = data
|
||||
skuList.list = data.result.map(v => {
|
||||
return {
|
||||
...v.skus,
|
||||
...v.names,
|
||||
specSnap: v.specSnap,
|
||||
coverImg: v.coverImg || ''
|
||||
}
|
||||
})
|
||||
newSkuList.list = data.result.map(v => {
|
||||
return {
|
||||
...v.skus,
|
||||
...v.names,
|
||||
specSnap: v.specSnap,
|
||||
coverImg: v.coverImg || ''
|
||||
}
|
||||
})
|
||||
console.log(skuList.list);
|
||||
})
|
||||
}
|
||||
|
||||
function toGroup() {
|
||||
@@ -1666,23 +1410,20 @@
|
||||
watch(() => FormData.typeEnum, (newval) => {
|
||||
if (option.type === 'add') {
|
||||
if (newval === 'sku') {
|
||||
skuList.length = 0
|
||||
skuList.list = []
|
||||
} else {
|
||||
skuList[0] = {
|
||||
skuList.list[0] = {
|
||||
...$defaultSku,
|
||||
barCode: `${uni.getStorageSync("shopId")}${dayjs().valueOf()}`
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
watchSpecificationsSave()
|
||||
watchTimerSave()
|
||||
onBeforeUnmount(() => {
|
||||
watchSpecificationsSave(false)
|
||||
watchTimerSave(false)
|
||||
onShow(() => {
|
||||
watchSpecificationsSave()
|
||||
})
|
||||
onReady(() => {
|
||||
Forms.value&&Forms.value.setRules(rules)
|
||||
Forms.value && Forms.value.setRules(rules)
|
||||
})
|
||||
watch(() => pageData.types, (newval) => {
|
||||
Forms.value.setRules(rules)
|
||||
@@ -1764,6 +1505,7 @@
|
||||
.box {
|
||||
margin-top: 36rpx;
|
||||
font-size: 28rpx;
|
||||
|
||||
.block {
|
||||
background: #FFFFFF;
|
||||
border-radius: 18rpx 18rpx 18rpx 18rpx;
|
||||
|
||||
@@ -91,8 +91,8 @@
|
||||
|
||||
function haocaiClick(item, index) {
|
||||
console.log(item);
|
||||
if (item.consId != props.modelValue) {
|
||||
emits('update:modelValue', item.consId)
|
||||
if (item.id != props.modelValue) {
|
||||
emits('update:modelValue', item.id)
|
||||
emits('change', item)
|
||||
}
|
||||
popShow.value = false
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
<view class="">
|
||||
<template v-if="isBindGuige&&isSku">
|
||||
<view class="list">
|
||||
<view class="u-p-b-32 u-p-t-32 border-bottom" v-for="(item,index) in skuList" :key="index">
|
||||
<view class="u-p-b-32 u-p-t-32 border-bottom" v-for="(sku,index) in skuList" :key="index">
|
||||
<view>规格名称</view>
|
||||
<view class="u-m-t-16">{{item.specSnap}}</view>
|
||||
<view class="u-m-t-16">{{sku.specSnap}}</view>
|
||||
<view class="color-666 u-m-t-24 u-flex">
|
||||
<view class="xuhao">序号</view>
|
||||
<view class="u-flex u-flex-1 u-p-l-32 gap-20">
|
||||
@@ -26,29 +26,24 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-m-t-32 color-666">
|
||||
<view class="u-m-t-24" v-for="(haocai,haocaiIndex) in item.haoaiList"
|
||||
<view class="u-m-t-24" v-for="(item,haocaiIndex) in sku.haoCaiList"
|
||||
:key="haocaiIndex">
|
||||
<view class=" u-flex">
|
||||
<view class="xuhao">{{haocaiIndex+1}}</view>
|
||||
<view class="u-flex u-flex-1 u-p-l-32 gap-20">
|
||||
<view class="u-flex-1 ">
|
||||
<view class="u-flex input">
|
||||
<view>{{item.name}}</view>
|
||||
<up-icon :size="10" name="arrow-down-fill"></up-icon>
|
||||
</view>
|
||||
<choose-haocai @change="conInfosChange($event,item)"
|
||||
:listMap="$haocaiMap" :list="haoCaiList"
|
||||
v-model="item.conInfoId"></choose-haocai>
|
||||
</view>
|
||||
<view class="u-flex-1 ">
|
||||
<view class="u-flex input">
|
||||
<view>{{item.unit}}</view>
|
||||
<up-icon :size="10" name="arrow-down-fill"></up-icon>
|
||||
</view>
|
||||
<choose-danwei :listMap="$danweiMap" :list="danweiList"
|
||||
v-model="item.conUnit"></choose-danwei>
|
||||
</view>
|
||||
<view class="u-flex-1 ">
|
||||
<view class="u-flex input">
|
||||
<up-input border="none"></up-input>
|
||||
<up-icon color="#EB4F4F" @click="delGuigeHaocao(index,haocaiIndex)"
|
||||
:size="16" name="minus-circle-fill"></up-icon>
|
||||
</view>
|
||||
<view class="u-flex input">
|
||||
<up-input border="none" v-model="item.surplusStock"></up-input>
|
||||
<up-icon @click="delGuigeHaocao(index,haocaiIndex)" color="#EB4F4F" :size="16"
|
||||
name="minus-circle-fill"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -173,16 +168,20 @@
|
||||
deletetbProskuCon,
|
||||
} from "@/http/yskApi/consumable.js";
|
||||
import {
|
||||
tbShopCurrencyGet,$hasPermission
|
||||
tbShopCurrencyGet,
|
||||
$hasPermission
|
||||
} from '@/http/yskApi/shop.js'
|
||||
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
import chooseHaocai from './choose-haocai.vue';
|
||||
import chooseDanwei from './choose-danwei.vue';
|
||||
import {
|
||||
$tbProskuConV2
|
||||
} from '@/http/yskApi/goods.js'
|
||||
const emits=defineEmits(['cancel'])
|
||||
function cancel(){
|
||||
import { cloneWith } from 'lodash';
|
||||
const emits = defineEmits(['cancel', 'updateGoods'])
|
||||
|
||||
function cancel() {
|
||||
emits('cancel')
|
||||
}
|
||||
const props = defineProps({
|
||||
@@ -203,27 +202,29 @@
|
||||
console.log(newval);
|
||||
conInfos.value = newval
|
||||
})
|
||||
|
||||
function conInfosChange(newval, item) {
|
||||
console.log(newval);
|
||||
item.stockNumber = newval.balance
|
||||
item.conUnit = newval.conUnit
|
||||
}
|
||||
|
||||
|
||||
const skuList = ref(props.goods.skuList)
|
||||
watch(() => props.goods.skuList, (newval) => {
|
||||
console.log(newval);
|
||||
skuList.value = newval
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const $baseicHaocaiData = {
|
||||
conInfoId: '',
|
||||
conUnit: '',
|
||||
surplusStock: ''
|
||||
}
|
||||
|
||||
function addHaocai() {
|
||||
conInfos.value.push({
|
||||
conInfoId: '',
|
||||
conUnit: '',
|
||||
surplusStock: ''
|
||||
...$baseicHaocaiData
|
||||
})
|
||||
}
|
||||
const popup = reactive({
|
||||
@@ -233,11 +234,21 @@
|
||||
})
|
||||
|
||||
function addGuigeHaocai(index) {
|
||||
console.log(index);
|
||||
if (skuList.value[index].haoCaiList) {
|
||||
skuList.value[index].haoCaiList.push({
|
||||
...$baseicHaocaiData
|
||||
})
|
||||
} else {
|
||||
skuList.value[index].haoCaiList = [{
|
||||
...$baseicHaocaiData
|
||||
}]
|
||||
}
|
||||
console.log(skuList.value[index]);
|
||||
}
|
||||
|
||||
function delHaocai(index) {
|
||||
const item = conInfos.value[index]
|
||||
console.log(item);
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '是否删除该耗材',
|
||||
@@ -258,7 +269,24 @@
|
||||
}
|
||||
|
||||
function delGuigeHaocao(guigeIndex, haocaiIndex) {
|
||||
skuList.value[guigeIndex].haoaiList.splice(haocaiIndex, 1)
|
||||
const item = skuList.value[guigeIndex].haoCaiList[haocaiIndex]
|
||||
console.log(item);
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '是否删除该耗材',
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
if (item&&item.id) {
|
||||
deletetbProskuCon([item.id]).then(res1 => {
|
||||
skuList.value[guigeIndex].haoCaiList.splice(haocaiIndex, 1)
|
||||
})
|
||||
} else {
|
||||
skuList.value[guigeIndex].haoCaiList.splice(haocaiIndex, 1)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 是否是多规格商品
|
||||
@@ -270,30 +298,66 @@
|
||||
isBindGuige.value = isSku.value
|
||||
})
|
||||
|
||||
function save() {
|
||||
async function save() {
|
||||
console.log('save');
|
||||
const isPas= conInfos.value.every(v=>{
|
||||
return v.conInfoId&&v.conUnit&&v.surplusStock>0
|
||||
})
|
||||
console.log(isPas);
|
||||
return
|
||||
let ajaxData = ''
|
||||
let isPas=false
|
||||
if(!isBindGuige.value){
|
||||
//绑定至商品
|
||||
isPas = conInfos.value.every(v => {
|
||||
return v.conInfoId && v.conUnit && v.surplusStock > 0
|
||||
})
|
||||
}else{
|
||||
//绑定至规格
|
||||
isPas = skuList.value.filter(v=>v.haoCaiList&&v.haoCaiList.length).every(sku => {
|
||||
console.log(sku.haoCaiList);
|
||||
return sku.haoCaiList.every(v=>{
|
||||
return v.conInfoId && v.conUnit && v.surplusStock > 0
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
if (!isPas) {
|
||||
return infoBox.showToast('请填写全部耗材选项值')
|
||||
}
|
||||
let ajaxData = {
|
||||
productId: props.goods.id,
|
||||
cons: []
|
||||
}
|
||||
if (!isBindGuige.value) {
|
||||
//绑定至商品
|
||||
ajaxData = conInfos.value.map(v => {
|
||||
ajaxData.cons = conInfos.value.map(v => {
|
||||
return {
|
||||
id: v.id || '',
|
||||
conInfoId: v.conInfoId,
|
||||
productId: props.goods.id,
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
productSkuId: 0,
|
||||
surplusStock: v.surplusStock
|
||||
surplusStock: v.surplusStock * 1,
|
||||
status: 1
|
||||
}
|
||||
})
|
||||
} else {
|
||||
for(let i in skuList.value){
|
||||
const haocaiList=skuList.value[i].haoCaiList||[]
|
||||
for(let k in haocaiList){
|
||||
const v=haocaiList[k]
|
||||
ajaxData.cons.push({
|
||||
id: v.id || '',
|
||||
conInfoId: v.conInfoId,
|
||||
productId: props.goods.id,
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
productSkuId: skuList.value[i].id,
|
||||
surplusStock: v.surplusStock * 1,
|
||||
status: 1
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
console.log(ajaxData);
|
||||
$tbProskuConV2(ajaxData)
|
||||
await $tbProskuConV2(ajaxData)
|
||||
emits('updateGoods')
|
||||
infoBox.showToast('修改成功')
|
||||
}
|
||||
|
||||
let haoCaiList = ref([])
|
||||
@@ -303,12 +367,11 @@
|
||||
|
||||
function init() {
|
||||
gettbConsInfo({
|
||||
page: 0,
|
||||
size: 200
|
||||
"status": 1,
|
||||
}).then(res => {
|
||||
for (let i in res.content) {
|
||||
const item = res.content[i]
|
||||
$haocaiMap[item.consId] = item
|
||||
$haocaiMap[item.id] = item
|
||||
}
|
||||
haoCaiList.value = res.content
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
</view>
|
||||
|
||||
<view class="u-m-t-24">
|
||||
{{item.selectSpecResult}}
|
||||
<uni-data-checkbox @change="createResult" multiple :selectedColor="color.ColorMain"
|
||||
v-model="item.selectSpecResult" :localdata="item.value"></uni-data-checkbox>
|
||||
|
||||
@@ -30,6 +29,19 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view class="block u-m-b-32 u-p-30">
|
||||
<view class="font-bold">批量修改</view>
|
||||
<view class="u-flex fast-edit u-flex-wrap gap-20 u-m-t-12">
|
||||
<view class="color-main item u-flex u-row-center u-col-center" v-for="(item,index) in fastEdit.list" :key="index">
|
||||
<view class="u-flex u-col-center">
|
||||
<view class="u-m-r-12">{{item.text}}</view>
|
||||
<up-icon size="16" :color="color.ColorMain" name="edit-pen"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view> -->
|
||||
<view>
|
||||
<view class="block u-m-b-32" v-for="(item,index) in FormData.result" :key="index">
|
||||
|
||||
@@ -97,12 +109,12 @@
|
||||
<uni-easyinput @blur="priceFormat(item.skus,'firstShared')"
|
||||
:paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle"
|
||||
:inputBorder="inputBorder" v-model="item.skus.firstShared" type="digit"
|
||||
placeholder="请输入起售数量" />
|
||||
placeholder="请输入分销金额" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="商品条码" required>
|
||||
<uni-easyinput disabled :paddingNone="inputPaddingNone"
|
||||
:placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
||||
v-model="item.skus.barCode" placeholder="请输入起售数量" />
|
||||
v-model="item.skus.barCode" placeholder="请输入商品条码" />
|
||||
</uni-forms-item>
|
||||
</view>
|
||||
</view>
|
||||
@@ -112,18 +124,25 @@
|
||||
|
||||
<view class="save-btn-box">
|
||||
<button class="save-btn" hover-class="btn-hover-class" @click="save">保存</button>
|
||||
<button class="save-btn edit-btn" hover-class="btn-hover-class" @click="fastEditShow">
|
||||
<view class="u-flex u-row-center">
|
||||
<view class="u-m-r-6">批量修改</view>
|
||||
<up-icon name="edit-pen" :color="color.ColorMain"></up-icon>
|
||||
</view>
|
||||
</button>
|
||||
</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 myUploadFile from '@/components/my-components/my-upload-file'
|
||||
import {
|
||||
formatPrice
|
||||
} from "@/commons/utils/format.js";
|
||||
|
||||
import popFastEdit from "./components/fast-edit.vue"
|
||||
const refFiles = ref([]);
|
||||
//绑定文件上传元素
|
||||
function setRefFile(index) {
|
||||
@@ -135,10 +154,26 @@
|
||||
};
|
||||
}
|
||||
|
||||
const fastEdit=reactive({
|
||||
show:false,
|
||||
list:[
|
||||
{text:'会员价',key:'memberPrice',value:''},
|
||||
{text:'成本价',key:'costPrice',value:''},
|
||||
{text:'原价',key:'originPrice',value:''},
|
||||
{text:'起售数量',key:'suit',value:''},
|
||||
{text:'库存数量',key:'stockNumber',value:''},
|
||||
{text:'分销金额',key:'firstShared',value:''}
|
||||
],
|
||||
sel:''
|
||||
})
|
||||
function fastEditShow(){
|
||||
fastEdit.show=true
|
||||
}
|
||||
//上个页面传来的参数
|
||||
let option={}
|
||||
|
||||
|
||||
|
||||
//number类型数据限制
|
||||
function priceFormat(item, key) {
|
||||
nextTick(() => {
|
||||
@@ -180,7 +215,19 @@
|
||||
watch
|
||||
} from 'vue';
|
||||
|
||||
|
||||
function updateSkuKey(arr){
|
||||
for(let i in FormData.result){
|
||||
const sku=FormData.result[i].skus
|
||||
for(let k in arr){
|
||||
const item=arr[k]
|
||||
if(sku.hasOwnProperty(item.key)){
|
||||
sku[item.key]=item.value
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
const inputPaddingNone = ref(true)
|
||||
const form = ref(null)
|
||||
const originSpecMap={}
|
||||
@@ -353,15 +400,16 @@
|
||||
getTbProductSpec()
|
||||
const obj = uni.getStorageSync('guige')
|
||||
if (obj&&JSON.stringify(obj) !== '{}') {
|
||||
console.log(obj.selectSpec);
|
||||
option.productId=opt.productId
|
||||
Object.assign(FormData, obj)
|
||||
for(let i of obj.result){
|
||||
const key=returnSpecSnap(i.names)
|
||||
originSpecMap[key]=i
|
||||
}
|
||||
console.log(FormData);
|
||||
nextTick(() => {
|
||||
FormData.result = obj.result
|
||||
console.log(FormData.result);
|
||||
})
|
||||
}
|
||||
console.log(opt);
|
||||
@@ -516,7 +564,7 @@
|
||||
left: 30rpx;
|
||||
right: 30rpx;
|
||||
bottom: 60rpx;
|
||||
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
::v-deep.uni-forms-item {
|
||||
@@ -540,7 +588,12 @@
|
||||
border-radius: 12rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.edit-btn{
|
||||
background-color: #fff;
|
||||
color: #333;
|
||||
border-radius: 12rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.btn-hover-class {
|
||||
opacity: .6;
|
||||
}
|
||||
@@ -551,7 +604,18 @@
|
||||
padding-left: 42rpx;
|
||||
border-radius: 14rpx 14rpx 14rpx 14rpx;
|
||||
}
|
||||
|
||||
.fast-edit{
|
||||
.item{
|
||||
color: #333;
|
||||
border: 1px solid #bbb;
|
||||
padding: 4rpx 10rpx 8rpx 10rpx;
|
||||
border-radius: 10rpx;
|
||||
min-width: 186rpx;
|
||||
&.active{
|
||||
color: $my-main-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
::v-deep .uni-input-placeholder {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
157
pageProduct/add-specifications/components/fast-edit.vue
Normal file
157
pageProduct/add-specifications/components/fast-edit.vue
Normal file
@@ -0,0 +1,157 @@
|
||||
<template>
|
||||
<up-popup :show="popShow" @close="close" @open="open" mode="center" :round="9">
|
||||
<view class="u-p-32 box u-font-28">
|
||||
<view class="u-flex u-relative u-row-center">
|
||||
<view class="u-font-32">快速修改</view>
|
||||
<view class="u-absolute close">
|
||||
<up-icon @click="close" :size="16" color="#000" name="close-circle-fill"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-m-t-36">
|
||||
<view class="u-m-b-24" v-for="(item,index) in list" :key="index">
|
||||
<view>{{item.text}}:</view>
|
||||
<view class="u-m-t-24">
|
||||
<up-input v-model="item.value">
|
||||
<template #suffix>
|
||||
<up-button @click="itemClick(item)" type="primary" text="修改" size="mini"></up-button>
|
||||
</template>
|
||||
</up-input>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="u-m-t-60">
|
||||
<my-button type="primary" shape="circle" @tap="save">
|
||||
<view class="u-font-32">
|
||||
修改
|
||||
</view>
|
||||
</my-button>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</up-popup>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
reactive,
|
||||
ref,
|
||||
watch,
|
||||
onMounted,
|
||||
computed
|
||||
} from 'vue';
|
||||
import {
|
||||
returnSkuSnap,
|
||||
returnTypeEnum,
|
||||
returnCategory
|
||||
} from '@/pageProduct/util.js'
|
||||
import {
|
||||
$tbShopUnit
|
||||
} from '@/http/yskApi/goods.js'
|
||||
const props = defineProps({
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
})
|
||||
const arr = [
|
||||
{
|
||||
text: '售价',
|
||||
key: 'salePrice',
|
||||
value: ''
|
||||
},
|
||||
{
|
||||
text: '会员价',
|
||||
key: 'memberPrice',
|
||||
value: ''
|
||||
},
|
||||
{
|
||||
text: '成本价',
|
||||
key: 'costPrice',
|
||||
value: ''
|
||||
},
|
||||
{
|
||||
text: '原价',
|
||||
key: 'originPrice',
|
||||
value: ''
|
||||
},
|
||||
{
|
||||
text: '起售数量',
|
||||
key: 'suit',
|
||||
value: ''
|
||||
},
|
||||
{
|
||||
text: '库存数量',
|
||||
key: 'stockNumber',
|
||||
value: ''
|
||||
},
|
||||
{
|
||||
text: '分销金额',
|
||||
key: 'firstShared',
|
||||
value: ''
|
||||
}
|
||||
]
|
||||
const list = ref([...arr])
|
||||
|
||||
function changeShowRecoders(show) {
|
||||
recoders.show = show
|
||||
}
|
||||
|
||||
const data = ref(props.item)
|
||||
const emits = defineEmits(['update:show', 'update','itemClick'])
|
||||
const form = reactive({
|
||||
note: ''
|
||||
})
|
||||
let popShow = ref(props.show)
|
||||
|
||||
function itemClick(item){
|
||||
console.log(item);
|
||||
emits('update',[item])
|
||||
}
|
||||
|
||||
|
||||
watch(() => props.show, (newval) => {
|
||||
popShow.value = newval
|
||||
if (newval) {
|
||||
data.value = props.item
|
||||
}
|
||||
})
|
||||
const isSku = computed(() => {
|
||||
// return data.value.typeEnum == '多规格'
|
||||
return false
|
||||
})
|
||||
watch(() => popShow.value, (newval) => {
|
||||
emits('update:show', newval)
|
||||
})
|
||||
|
||||
function close() {
|
||||
popShow.value = false
|
||||
list.value=[...arr]
|
||||
}
|
||||
|
||||
function open() {
|
||||
|
||||
}
|
||||
|
||||
function save() {
|
||||
emits('update',list.value)
|
||||
popShow.value = false
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.box {
|
||||
width: 556rpx;
|
||||
border-radius: 18rpx 18rpx 18rpx 18rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.close {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.number {
|
||||
color: #EE4646;
|
||||
}
|
||||
</style>
|
||||
@@ -16,10 +16,10 @@
|
||||
报损数量
|
||||
</view>
|
||||
<view class="u-m-t-16">
|
||||
<up-input v-model="form.number">
|
||||
<template #suffix>
|
||||
<up-input v-model="form.stockNumber" type="number">
|
||||
<!-- <template #suffix>
|
||||
<view>{{data.unitName}}</view>
|
||||
</template>
|
||||
</template> -->
|
||||
</up-input>
|
||||
</view>
|
||||
</view>
|
||||
@@ -28,7 +28,7 @@
|
||||
<view>备注</view>
|
||||
</view>
|
||||
<view class="u-m-t-16">
|
||||
<up-textarea :height="42" v-model="form.note" placeholder="请输入备注"></up-textarea>
|
||||
<up-textarea :height="42" v-model="form.remark" placeholder="请输入备注"></up-textarea>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-m-b-32">
|
||||
@@ -36,9 +36,7 @@
|
||||
<view>上传图片</view>
|
||||
</view>
|
||||
<view class="u-m-t-16">
|
||||
<scroll-view scroll-y="true" style="max-height: 300rpx;">
|
||||
<my-up-upload v-model="form.images"></my-up-upload>
|
||||
</scroll-view>
|
||||
<my-up-upload :maxCount="1" :multiple="false" v-model="form.coverImg"></my-up-upload>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-m-t-60">
|
||||
@@ -67,8 +65,9 @@
|
||||
returnCategory
|
||||
} from '@/pageProduct/util.js'
|
||||
import {
|
||||
$tbShopUnit
|
||||
$frmLoss
|
||||
} from '@/http/yskApi/goods.js'
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
const props = defineProps({
|
||||
show: {
|
||||
type: Boolean,
|
||||
@@ -88,9 +87,9 @@
|
||||
const data = ref(props.goods)
|
||||
const emits = defineEmits(['update:show', 'save'])
|
||||
const form = reactive({
|
||||
note: '',
|
||||
number: 1,
|
||||
images: []
|
||||
remark: '',
|
||||
stockNumber: 1,
|
||||
coverImg: []
|
||||
})
|
||||
let popShow = ref(props.show)
|
||||
watch(() => props.show, (newval) => {
|
||||
@@ -111,8 +110,21 @@
|
||||
|
||||
}
|
||||
|
||||
function save() {
|
||||
console.log(form.images);
|
||||
async function save() {
|
||||
if (form.stockNumber <= 0) {
|
||||
return infoBox.showToast('请输入正确的报损数量')
|
||||
}
|
||||
if (!form.remark) {
|
||||
return infoBox.showToast('请输入备注')
|
||||
}
|
||||
console.log(form);
|
||||
const res= await $frmLoss({
|
||||
...form,
|
||||
productId:props.goods.id,
|
||||
coverImg:form.coverImg[0]?form.coverImg[0].serveUrl:''
|
||||
})
|
||||
infoBox.showToast('提交成功!')
|
||||
popShow.value=false
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view class="control" :style="getComputedStyle()">
|
||||
<view class="u-flex control1" v-if="showControl1">
|
||||
<view class="btn" @click="changeShowControl1">批量管理</view>
|
||||
<!-- <view class="btn" @click="changeShowControl1">批量管理</view> -->
|
||||
<view class="btn" @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>
|
||||
@@ -114,8 +114,8 @@
|
||||
|
||||
.control {
|
||||
position: fixed;
|
||||
left: 30rpx;
|
||||
right: 30rpx;
|
||||
left: 110rpx;
|
||||
right: 110rpx;
|
||||
z-index: 100;
|
||||
background: #3E3A3A;
|
||||
border-radius: 100rpx;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</view>
|
||||
<view class=" u-flex u-row-between u-m-t-30">
|
||||
<view>售罄</view>
|
||||
<up-switch :size="20" @change="isPauseSaleChange" v-model="isPauseSale"></up-switch>
|
||||
<up-switch :activeValue="1" :inactiveValue="0" :size="20" @change="isPauseSaleChange" v-model="isPauseSale"></up-switch>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -40,7 +40,9 @@
|
||||
returnCategory
|
||||
} from '@/pageProduct/util.js'
|
||||
import {
|
||||
$updateGrounding, $updateProductStatus
|
||||
$updateGrounding,
|
||||
$updateProductStatus,$updateProductData,
|
||||
$tbProskuConV2
|
||||
} from '@/http/yskApi/goods.js'
|
||||
import infoBox from '@/commons/utils/infoBox.js'
|
||||
const props = defineProps({
|
||||
@@ -73,7 +75,7 @@
|
||||
// 是否上架
|
||||
const isGrounding = ref(1)
|
||||
const data = ref(props.goods)
|
||||
const emits = defineEmits(['update:show', 'save', 'isGroundingChange','isPauseSaleChange'])
|
||||
const emits = defineEmits(['update:show', 'save', 'isGroundingChange', 'isPauseSaleChange'])
|
||||
const form = reactive({
|
||||
note: ''
|
||||
})
|
||||
@@ -102,21 +104,30 @@
|
||||
function save() {
|
||||
emits('save')
|
||||
}
|
||||
|
||||
function upDateGoods(par) {
|
||||
return $updateProductData([{
|
||||
id: data.value.id,
|
||||
isSku: 1,
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
...par
|
||||
}])
|
||||
}
|
||||
|
||||
async function isGroundingChange(e) {
|
||||
console.log(e);
|
||||
await $updateGrounding({
|
||||
isGrounding: e ? true : false,
|
||||
skuId: props.goods.id
|
||||
await upDateGoods({
|
||||
key:'grounding',
|
||||
value: e
|
||||
})
|
||||
emits('isGroundingChange', e)
|
||||
infoBox.showToast('更新成功')
|
||||
}
|
||||
|
||||
async function isPauseSaleChange(e) {
|
||||
console.log(e);
|
||||
await $updateProductStatus({
|
||||
targetId: props.goods.id,
|
||||
updateKey: "pauseSaleSku",
|
||||
updateValue: e?1:0
|
||||
await upDateGoods({
|
||||
key:'pauseSale',
|
||||
value: e
|
||||
})
|
||||
emits('isPauseSaleChange', e)
|
||||
infoBox.showToast('更新成功')
|
||||
|
||||
@@ -87,9 +87,10 @@
|
||||
<my-step :list="recoders.list"></my-step>
|
||||
</scroll-view>
|
||||
<view class="color-999 u-font-24 u-flex u-row-center u-col-center">
|
||||
<view class="u-flex" @click="changeShowRecoders(false)">
|
||||
<view class="u-m-r-6">收起记录</view>
|
||||
<up-icon name="arrow-up" :size="12"></up-icon>
|
||||
<!-- <view class="u-flex" @click="changeShowRecoders(false)"> -->
|
||||
<view class="u-flex" @click="toRecodes">
|
||||
<view class="u-m-r-6">全部记录</view>
|
||||
<up-icon name="arrow-right" :size="12"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -117,7 +118,7 @@
|
||||
returnCategory
|
||||
} from '@/pageProduct/util.js'
|
||||
import {
|
||||
$tbShopUnit
|
||||
$tbShopUnit,$getProductStockDetail
|
||||
} from '@/http/yskApi/goods.js'
|
||||
const props = defineProps({
|
||||
show: {
|
||||
@@ -135,29 +136,15 @@
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
function toRecodes(){
|
||||
}
|
||||
function changeShowRecoders(show) {
|
||||
recoders.show = show
|
||||
}
|
||||
const recoders = reactive({
|
||||
list: [{
|
||||
title: '2024-09-15 11:20:30',
|
||||
content: '开启了库存,库存由0件修改为5件'
|
||||
},
|
||||
{
|
||||
title: '2024-09-15 ',
|
||||
content: '开启了库存,库存由0件修改为4件'
|
||||
},
|
||||
{
|
||||
title: '2024-09-15 ',
|
||||
content: '开启了库存,库存由0件修改为3件'
|
||||
},
|
||||
{
|
||||
title: '2024-09-15 ',
|
||||
content: '开启了库存,库存由0件修改为2件'
|
||||
},
|
||||
],
|
||||
show: false,
|
||||
list: [],
|
||||
show: true,
|
||||
active: 0
|
||||
})
|
||||
|
||||
@@ -171,8 +158,27 @@
|
||||
popShow.value = newval
|
||||
if (newval) {
|
||||
data.value = props.goods
|
||||
getProductStockDetail()
|
||||
}
|
||||
})
|
||||
async function getProductStockDetail(){
|
||||
const {content}=await $getProductStockDetail({
|
||||
page:0,
|
||||
size:2,
|
||||
productId:props.goods.id,
|
||||
column:'/api/tbProductStockDetail/stock/count',
|
||||
shopId:uni.getStorageSync('shopId'),
|
||||
createdAt:[]
|
||||
})
|
||||
console.log(content);
|
||||
recoders.list=content.map(v=>{
|
||||
return {
|
||||
...v,
|
||||
title:v.createdAt,
|
||||
content:v.type+':'+Math.abs(v.stockNumber)
|
||||
}
|
||||
})
|
||||
}
|
||||
const isSku = computed(() => {
|
||||
// return data.value.typeEnum == '多规格'
|
||||
return false
|
||||
|
||||
@@ -33,17 +33,18 @@
|
||||
<view class="info-p-l color-333 u-flex u-row-between">
|
||||
<view class="u-flex">
|
||||
<text class="u-m-r-24">{{data.name}}</text>
|
||||
<!-- <uni-tag size="small" type="primary"
|
||||
<!-- <uni-tag size="small" type="primary"
|
||||
custom-style="background-color: #318AFE;" :text="data.typeEnum"></uni-tag> -->
|
||||
</view>
|
||||
<view class="u-font-32">
|
||||
<text v-if="data.typeEnum=='单规格'">¥</text>
|
||||
<text>{{data.lowPrice}}</text>
|
||||
<!-- <text>¥</text>
|
||||
<text>{{data.lowPrice}}</text>
|
||||
<text v-if="data.typeEnum == '多规格'">~¥{{data.maxPrice }}</text> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-m-t-44">
|
||||
<view class="u-m-t-24">
|
||||
<template v-if="data.skuList.length>=2">
|
||||
<view class="u-flex u-flex-wrap w-full gap-10 u-col-top">
|
||||
<view class="u-font-24 info-p-l u-m-t-14">规格:</view>
|
||||
@@ -64,7 +65,7 @@
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view style="height: 24rpx;">
|
||||
<view style="height: 44rpx;">
|
||||
|
||||
</view>
|
||||
</template>
|
||||
@@ -86,11 +87,11 @@
|
||||
<view class="u-flex">
|
||||
<view class="u-flex">
|
||||
<view class="u-m-r-18 color-999">售罄</view>
|
||||
<my-switch v-model="data.isSellNoneChange" @change="isHotChange"></my-switch>
|
||||
<my-switch v-model="isPauseSale" @change="isPauseSaleChange"></my-switch>
|
||||
</view>
|
||||
<view class="u-flex u-m-l-30">
|
||||
<view class="u-m-r-18 color-999">下架产品</view>
|
||||
<my-switch v-model="data.isSellNoneChange" @change="isHotChange"></my-switch>
|
||||
<view class="u-m-r-18 color-999">{{data.isGrounding?'下架产品':'上架产品' }}</view>
|
||||
<my-switch v-model="isGrounding" @change="isGroundingChange"></my-switch>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-flex">
|
||||
@@ -109,17 +110,21 @@
|
||||
<script setup>
|
||||
import {
|
||||
ref,
|
||||
watch,
|
||||
watchEffect
|
||||
} from 'vue';
|
||||
import {
|
||||
$goodsIsHot
|
||||
$goodsIsHot,
|
||||
$tbProskuConV2,$updateProductData
|
||||
} from '@/http/yskApi/goods.js'
|
||||
import mySwitch from '@/components/my-components/my-switch.vue'
|
||||
import go from '@/commons/utils/go.js';
|
||||
import {
|
||||
ColorMain
|
||||
} from '@/commons/color.js'
|
||||
const emits = defineEmits(['radioClick', 'changeClick', 'xiajia', 'del', 'changePrice', 'baosun', 'guigeClick','editStock'])
|
||||
const emits = defineEmits(['radioClick', 'changeClick', 'xiajia', 'del', 'changePrice', 'baosun', 'guigeClick','update',
|
||||
'editStock'
|
||||
])
|
||||
const props = defineProps({
|
||||
index: {
|
||||
type: Number
|
||||
@@ -127,7 +132,8 @@
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {}
|
||||
return {
|
||||
}
|
||||
}
|
||||
},
|
||||
showChecked: {
|
||||
@@ -139,27 +145,44 @@
|
||||
default: false
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
function isHotChange(e) {
|
||||
$goodsIsHot({
|
||||
|
||||
|
||||
async function upDateGoods(par) {
|
||||
const res = await $updateProductData([{
|
||||
id: props.data.id,
|
||||
isHot: props.data.isHot
|
||||
}).then(res => {
|
||||
uni.showToast({
|
||||
title: '修改成功',
|
||||
icon: 'none'
|
||||
})
|
||||
isSku: 0,
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
...par
|
||||
}])
|
||||
uni.showToast({
|
||||
title: '修改成功',
|
||||
icon: 'none'
|
||||
})
|
||||
emits('update')
|
||||
}
|
||||
|
||||
let isPauseSale=ref(props.data.isPauseSale)
|
||||
let isGrounding=ref(props.data.isGrounding)
|
||||
watch(() => props.data.isPauseSale, (newval) => {
|
||||
isPauseSale.value=newval
|
||||
})
|
||||
watch(() => props.data.isGrounding, (newval) => {
|
||||
isGrounding.value=newval
|
||||
})
|
||||
|
||||
function isPauseSaleChange(e) {
|
||||
upDateGoods({
|
||||
key: 'pauseSale',
|
||||
value: e
|
||||
})
|
||||
}
|
||||
|
||||
let isSellNone = ref(false)
|
||||
isSellNone.value = props.isSellNone
|
||||
|
||||
function isSellNoneChange() {
|
||||
console.log(isSellNone.value);
|
||||
console.log('isSellNoneChange');
|
||||
function isGroundingChange(e) {
|
||||
upDateGoods({
|
||||
key: 'grounding',
|
||||
value: e
|
||||
})
|
||||
}
|
||||
|
||||
let checked = ref(false)
|
||||
@@ -193,7 +216,8 @@
|
||||
function guigeClick(guigeIndex) {
|
||||
emits('guigeClick', props.index, guigeIndex)
|
||||
}
|
||||
function editStock(){
|
||||
|
||||
function editStock() {
|
||||
emits('editStock', props.index)
|
||||
}
|
||||
//携带参数type edit跳转到商品添加页面,编辑与添加同一页面,根据type值来判断
|
||||
@@ -298,7 +322,7 @@
|
||||
}
|
||||
|
||||
.skd {
|
||||
padding: 14rpx 40rpx 14rpx 20rpx;
|
||||
padding: 20rpx 20rpx 14rpx 20rpx;
|
||||
background: #F0F2F5;
|
||||
border-radius: 4rpx;
|
||||
position: relative;
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<view class="goods-list u-p-30">
|
||||
<template v-if="pageData.goodsList.length">
|
||||
<view class="u-m-b-32" v-for="(item,index) in pageData.goodsList" :key="index">
|
||||
<my-goods @changePrice="changePriceShow" @changeClick="goodsChangeClick"
|
||||
<my-goods :key="item.id" @update="getGoodsList" @changePrice="changePriceShow" @changeClick="goodsChangeClick"
|
||||
@editStock="changeStockShow" @guigeClick="editGuigeShow" @baosun="baosunShow"
|
||||
@radioClick="goodsRadioClick" :index="index" :data="item" @del="goodsDel"
|
||||
:showChecked="showChecked" :showDetail="pageData.showGoodsDetail"></my-goods>
|
||||
@@ -187,7 +187,9 @@
|
||||
page: 0,
|
||||
size: 10,
|
||||
categoryId: '',
|
||||
name: ''
|
||||
name: '',
|
||||
isPauseSale:'',
|
||||
isGrounding:''
|
||||
},
|
||||
category: '',
|
||||
categoryList: [], //分类列表
|
||||
@@ -198,7 +200,12 @@
|
||||
watch(() => pageData.query.categoryId, (newval) => {
|
||||
getGoodsList()
|
||||
})
|
||||
|
||||
watch(() => pageData.query.isPauseSale, (newval) => {
|
||||
getGoodsList()
|
||||
})
|
||||
watch(() => pageData.query.isGrounding, (newval) => {
|
||||
getGoodsList()
|
||||
})
|
||||
const popup = reactive({
|
||||
price: {
|
||||
show: false
|
||||
@@ -362,6 +369,7 @@
|
||||
}
|
||||
|
||||
function getGoodsList() {
|
||||
pageData.hasAjax = false
|
||||
$tbProductV2(pageData.query).then(res => {
|
||||
pageData.hasAjax = true
|
||||
console.log(res);
|
||||
@@ -377,9 +385,10 @@
|
||||
})
|
||||
}
|
||||
onShow(() => {
|
||||
getGoodsList()
|
||||
// getGoodsList()
|
||||
})
|
||||
onLoad(() => {
|
||||
getGoodsList()
|
||||
$tbShopCategory({
|
||||
page: 0,
|
||||
size: 200
|
||||
@@ -464,14 +473,36 @@
|
||||
|
||||
|
||||
function statesTableClick(index) {
|
||||
|
||||
pageData.stateCurrent = index
|
||||
console.log(index);
|
||||
if(index==0){
|
||||
pageData.query.isPauseSale=''
|
||||
pageData.query.isGrounding=''
|
||||
return
|
||||
}
|
||||
if(index==1){
|
||||
pageData.query.isPauseSale=1
|
||||
pageData.query.isGrounding=''
|
||||
return
|
||||
}
|
||||
if(index==2){
|
||||
pageData.query.isPauseSale=''
|
||||
pageData.query.isGrounding=1
|
||||
return
|
||||
}
|
||||
if(index==3){
|
||||
pageData.query.isPauseSale=''
|
||||
pageData.query.isGrounding=0
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
let test = ref(false)
|
||||
|
||||
function tabsChange(i) {
|
||||
console.log(i);
|
||||
pageData.showGoodsDetail = i ? true : false
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user