更新商品管理模块
This commit is contained in:
@@ -1,9 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="u-p-30 safe-page">
|
<view class="u-p-30 safe-page">
|
||||||
<up-sticky v-if="option.type==='edit'" offset-top="20" zIndex="99">
|
<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>
|
</up-sticky>
|
||||||
|
|
||||||
<view class="box">
|
<view class="box">
|
||||||
<template v-if="tabsCurrent===0">
|
<template v-if="tabsCurrent===0">
|
||||||
<view class="basic">
|
<view class="basic">
|
||||||
@@ -11,20 +10,13 @@
|
|||||||
err-show-type="toast" validateTrigger="submit" label-width="350" ref="Forms">
|
err-show-type="toast" validateTrigger="submit" label-width="350" ref="Forms">
|
||||||
<view class="block">
|
<view class="block">
|
||||||
<uni-forms-item label="商品类型" required showRequired>
|
<uni-forms-item label="商品类型" required showRequired>
|
||||||
<up-radio-group
|
<up-radio-group :disabled="option.type=='edit'" v-model="FormData.typeEnum"
|
||||||
:disabled="option.type=='edit'"
|
placement="row">
|
||||||
v-model="FormData.typeEnum"
|
<up-radio :customStyle="{marginRight: '30px'}"
|
||||||
placement="row"
|
v-for="(item, index) in pageData.types" :key="index" :label="item.name"
|
||||||
>
|
:name="item.value">
|
||||||
<up-radio
|
</up-radio>
|
||||||
:customStyle="{marginRight: '30px'}"
|
</up-radio-group>
|
||||||
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="u-flex u-flex-wrap types " :class="{disabled:option.productId!==''}">
|
||||||
<view class="item" @tap="changeFormData('typeEnum',item.value)"
|
<view class="item" @tap="changeFormData('typeEnum',item.value)"
|
||||||
:class="{active:FormData.typeEnum===item.value}"
|
:class="{active:FormData.typeEnum===item.value}"
|
||||||
@@ -37,7 +29,7 @@
|
|||||||
</view> -->
|
</view> -->
|
||||||
|
|
||||||
</uni-forms-item>
|
</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>
|
<my-upload-file ref="refFile" :images="FormData.images"></my-upload-file>
|
||||||
<view class="u-m-t-16 color-999 u-font-24">
|
<view class="u-m-t-16 color-999 u-font-24">
|
||||||
注:第一张图为商品封面图,图片尺寸为750x750
|
注:第一张图为商品封面图,图片尺寸为750x750
|
||||||
@@ -63,17 +55,6 @@
|
|||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
</view>
|
</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">
|
<view class="border-top-0">
|
||||||
<uni-forms-item label="单位" required showRequired name="categoryId">
|
<uni-forms-item label="单位" required showRequired name="categoryId">
|
||||||
|
|
||||||
@@ -84,7 +65,7 @@
|
|||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<template v-if="FormData.typeEnum==='group'">
|
<template v-if="FormData.typeEnum==='group'">
|
||||||
<view class="border-top-0">
|
<view class="border-top-0">
|
||||||
<uni-forms-item label="团购券分类" required showRequired name="categoryId">
|
<uni-forms-item label="团购券分类" required showRequired name="categoryId">
|
||||||
<view class="u-p-30 bg-gray u-m-b-20" v-if="FormData.groupCategoryId.length">
|
<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"
|
<choose-group-category @confirm="refChooseCouponCategoryConfirm"
|
||||||
ref="refChooseGroupCategory"></choose-group-category>
|
ref="refChooseGroupCategory"></choose-group-category>
|
||||||
</template>
|
</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>
|
</view>
|
||||||
|
<template v-if="FormData.typeEnum=='sku' ">
|
||||||
<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> -->
|
|
||||||
<view class="block border-top-0">
|
<view class="block border-top-0">
|
||||||
<uni-forms-item label=" ">
|
<uni-forms-item label=" ">
|
||||||
<view class="u-flex u-row-between " @tap="toGuige">
|
<view class="u-flex u-row-between " @tap="toGuige">
|
||||||
<view class="color-333 font-bold">
|
<view class="color-333 font-bold">
|
||||||
<text v-if="!skuList.length">选择规格</text>
|
<text v-if="!skuList.list.length">选择规格</text>
|
||||||
<text v-else>编辑规格</text>
|
<text v-else>编辑规格</text>
|
||||||
</view>
|
</view>
|
||||||
<uni-icons type="right"></uni-icons>
|
<uni-icons type="right"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<template v-if="skuList.length">
|
<template v-if="skuList.list.length">
|
||||||
<view class="u-text-center">
|
<view class="u-text-center">
|
||||||
<view class="u-flex font-bold u-m-b-12">
|
<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 class="u-flex-1">售价</view>
|
||||||
<view class="u-flex-1">库存数量</view>
|
<view class="u-flex-1">库存数量</view>
|
||||||
</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">
|
:key="index">
|
||||||
<view class="u-flex-1">{{item.specSnap}}</view>
|
<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 class="u-flex-1">{{item.stockNumber}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -374,9 +205,9 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</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="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">
|
<view class="border-top-0">
|
||||||
<uni-forms-item label="售价">
|
<uni-forms-item label="售价">
|
||||||
<uni-easyinput :paddingNone="inputPaddingNone"
|
<uni-easyinput :paddingNone="inputPaddingNone"
|
||||||
@@ -392,7 +223,7 @@
|
|||||||
:inputBorder="inputBorder" v-model="sku.memberPrice" type="digit"
|
:inputBorder="inputBorder" v-model="sku.memberPrice" type="digit"
|
||||||
placeholder="请输入会员价(元)" />
|
placeholder="请输入会员价(元)" />
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item label="成本价(元)">
|
<!-- <uni-forms-item label="成本价(元)">
|
||||||
<uni-easyinput @blur="priceFormat(sku,'costPrice')" :paddingNone="inputPaddingNone"
|
<uni-easyinput @blur="priceFormat(sku,'costPrice')" :paddingNone="inputPaddingNone"
|
||||||
:placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
:placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
||||||
v-model="sku.costPrice" type="digit" placeholder="请输入成本价(元)" />
|
v-model="sku.costPrice" type="digit" placeholder="请输入成本价(元)" />
|
||||||
@@ -402,7 +233,7 @@
|
|||||||
:paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle"
|
:paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle"
|
||||||
:inputBorder="inputBorder" v-model="sku.originPrice" type="digit"
|
:inputBorder="inputBorder" v-model="sku.originPrice" type="digit"
|
||||||
placeholder="请输入原价(元)" />
|
placeholder="请输入原价(元)" />
|
||||||
</uni-forms-item>
|
</uni-forms-item> -->
|
||||||
<uni-forms-item label="起售数量">
|
<uni-forms-item label="起售数量">
|
||||||
<uni-easyinput @blur="priceFormat(sku,'suit')" :paddingNone="inputPaddingNone"
|
<uni-easyinput @blur="priceFormat(sku,'suit')" :paddingNone="inputPaddingNone"
|
||||||
:placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
:placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
||||||
@@ -598,138 +429,11 @@
|
|||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</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>
|
</uni-forms>
|
||||||
<view style="height: 200rpx;"></view>
|
<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">
|
<view style="padding-left: 110rpx;padding-right: 110rpx;" class="u-m-t-20"
|
||||||
<my-button bgColor="#F9F9F9" shape="circle" type="cancel" >
|
v-if="option.type==='edit'" @click="delModelShow">
|
||||||
|
<my-button bgColor="#F9F9F9" shape="circle" type="cancel">
|
||||||
<view class="color-red">删除该商品</view>
|
<view class="color-red">删除该商品</view>
|
||||||
</my-button>
|
</my-button>
|
||||||
</view>
|
</view>
|
||||||
@@ -737,18 +441,13 @@
|
|||||||
<view class="save-btn-box">
|
<view class="save-btn-box">
|
||||||
<my-button shape="circle" @tap="save">保存</my-button>
|
<my-button shape="circle" @tap="save">保存</my-button>
|
||||||
</view>
|
</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>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="tabsCurrent===1">
|
<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>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -762,15 +461,16 @@
|
|||||||
</template>
|
</template>
|
||||||
</my-model>
|
</my-model>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 删除弹窗 -->
|
<!-- 删除弹窗 -->
|
||||||
<my-model @confirm="delmodelConfirm" ref="delModel" desc="确认删除">
|
<my-model @confirm="delmodelConfirm" ref="delModel" desc="确认删除">
|
||||||
</my-model>
|
</my-model>
|
||||||
<!-- 选择商品 -->
|
<!-- 选择商品 -->
|
||||||
<choose-goods ref="refChooseGoods" @confirm="refChooseGoodsConfirm" :category="pageData.category"></choose-goods>
|
<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-action-sheet @itemClick="actionSheetClick" ref="refMoreSheet" :list="actionSheet.list"></my-action-sheet>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
@@ -798,7 +498,7 @@
|
|||||||
import myButton from '@/components/my-components/my-button'
|
import myButton from '@/components/my-components/my-button'
|
||||||
import mySwitch from '@/components/my-components/my-switch.vue'
|
import mySwitch from '@/components/my-components/my-switch.vue'
|
||||||
import infoBox from "@/commons/utils/infoBox.js"
|
import infoBox from "@/commons/utils/infoBox.js"
|
||||||
|
|
||||||
import {
|
import {
|
||||||
$types,
|
$types,
|
||||||
$defaultSku
|
$defaultSku
|
||||||
@@ -1146,11 +846,12 @@
|
|||||||
|
|
||||||
const tabsList = ['基础设置', '耗材绑定']
|
const tabsList = ['基础设置', '耗材绑定']
|
||||||
let tabsCurrent = ref(0)
|
let tabsCurrent = ref(0)
|
||||||
function changeTabsCurrent(newval){
|
|
||||||
tabsCurrent.value=newval
|
function changeTabsCurrent(newval) {
|
||||||
|
tabsCurrent.value = newval
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const Forms = ref(null)
|
const Forms = ref(null)
|
||||||
|
|
||||||
|
|
||||||
@@ -1253,10 +954,15 @@
|
|||||||
usageRules: ""
|
usageRules: ""
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const skuList = reactive([{
|
const skuList = reactive({
|
||||||
...$defaultSku,
|
list: [{
|
||||||
barCode: `${uni.getStorageSync("shopId")}${dayjs().valueOf()}`
|
...$defaultSku,
|
||||||
}])
|
barCode: `${uni.getStorageSync("shopId")}${dayjs().valueOf()}`
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
watch(() => skuList.list, (newval) => {
|
||||||
|
console.log(newval);
|
||||||
|
})
|
||||||
//库存表单数据
|
//库存表单数据
|
||||||
const stockData = reactive({
|
const stockData = reactive({
|
||||||
inventoryMode: 0,
|
inventoryMode: 0,
|
||||||
@@ -1294,13 +1000,21 @@
|
|||||||
url: v
|
url: v
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
$goodsData = res
|
for(let i in res.conInfos){
|
||||||
Object.assign(FormData, res)
|
const con=res.conInfos[i]
|
||||||
if (res.skuList.length) {
|
const item=res.skuList.find(v=>v.id==con.productSkuId)
|
||||||
for (let i in res.skuList) {
|
if(item){
|
||||||
skuList[i] = res.skuList[i]
|
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') {
|
if (res.typeEnum === 'sku') {
|
||||||
const selectSpec = JSON.parse(res.selectSpec)
|
const selectSpec = JSON.parse(res.selectSpec)
|
||||||
@@ -1319,13 +1033,12 @@
|
|||||||
selectSpec: selectSpec.map(s => {
|
selectSpec: selectSpec.map(s => {
|
||||||
return {
|
return {
|
||||||
...s,
|
...s,
|
||||||
// value: s.value.map(v => {
|
value: s.value.map(v => {
|
||||||
// return {
|
return typeof v === 'string' ? {
|
||||||
// text: v,
|
text: v,
|
||||||
// value: v
|
value: v
|
||||||
// }
|
} : v
|
||||||
// })
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
result: res.skuList.map(v => {
|
result: res.skuList.map(v => {
|
||||||
@@ -1339,7 +1052,8 @@
|
|||||||
...v
|
...v
|
||||||
},
|
},
|
||||||
names,
|
names,
|
||||||
specSnap: v.specSnap
|
specSnap: v.specSnap,
|
||||||
|
coverImg:v.coverImg
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
specList: [],
|
specList: [],
|
||||||
@@ -1422,9 +1136,14 @@
|
|||||||
const pageData = reactive({
|
const pageData = reactive({
|
||||||
// 商品类型
|
// 商品类型
|
||||||
// types: $types,
|
// types: $types,
|
||||||
types: [
|
types: [{
|
||||||
{name:'单规格',value:'normal'},
|
name: '单规格',
|
||||||
{name:'多规格',value:'sku'}
|
value: 'normal'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '多规格',
|
||||||
|
value: 'sku'
|
||||||
|
}
|
||||||
],
|
],
|
||||||
// 单位
|
// 单位
|
||||||
units: [],
|
units: [],
|
||||||
@@ -1441,6 +1160,10 @@
|
|||||||
pageData.skuList = res
|
pageData.skuList = res
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
function updateGoodsDetail(){
|
||||||
|
getGoodsDetail()
|
||||||
|
getProductSku()
|
||||||
|
}
|
||||||
onLoad((params) => {
|
onLoad((params) => {
|
||||||
if (isEmpty(params)) {
|
if (isEmpty(params)) {
|
||||||
option.type = params.type ? params.type : 'add'
|
option.type = params.type ? params.type : 'add'
|
||||||
@@ -1454,6 +1177,10 @@
|
|||||||
uni.setNavigationBarTitle({
|
uni.setNavigationBarTitle({
|
||||||
title: option.type === 'add' ? '添加商品' : '编辑商品'
|
title: option.type === 'add' ? '添加商品' : '编辑商品'
|
||||||
})
|
})
|
||||||
|
if (option.type === 'edit') {
|
||||||
|
getGoodsDetail()
|
||||||
|
getProductSku()
|
||||||
|
}
|
||||||
defaultValueInit()
|
defaultValueInit()
|
||||||
getCategory()
|
getCategory()
|
||||||
getTbShopUnit()
|
getTbShopUnit()
|
||||||
@@ -1461,10 +1188,10 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
if (option.type === 'edit') {
|
// if (option.type === 'edit') {
|
||||||
getGoodsDetail()
|
// getGoodsDetail()
|
||||||
getProductSku()
|
// getProductSku()
|
||||||
}
|
// }
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@@ -1498,15 +1225,23 @@
|
|||||||
if (typeEnum === 'group' && !groupCategoryId.length) {
|
if (typeEnum === 'group' && !groupCategoryId.length) {
|
||||||
return infoBox.showToast('请选择团购券分类')
|
return infoBox.showToast('请选择团购券分类')
|
||||||
}
|
}
|
||||||
|
|
||||||
// if(typeEnum==='sku'){
|
// if(typeEnum==='sku'){
|
||||||
// return infoBox.showErrorToast('请选择规格')
|
// return infoBox.showErrorToast('请选择规格')
|
||||||
// }
|
// }
|
||||||
const images = refFile.value.getFileList()
|
const images = refFile.value.getFileList()
|
||||||
|
if(images.length<=0){
|
||||||
|
return infoBox.showToast('请上传商品图片')
|
||||||
|
}
|
||||||
const skuSnap = []
|
const skuSnap = []
|
||||||
const submitSkuList = FormData.specificationsGroup ? skuList : [{
|
let submitSkuList = FormData.specificationsGroup ? skuList.list : [{
|
||||||
...$defaultSku,
|
...$defaultSku,
|
||||||
barCode: `${uni.getStorageSync("shopId")}${dayjs().valueOf()}`
|
barCode: `${uni.getStorageSync("shopId")}${dayjs().valueOf()}`
|
||||||
}]
|
}];
|
||||||
|
if(typeEnum=='normal'){
|
||||||
|
submitSkuList=skuList.list ;
|
||||||
|
}
|
||||||
|
console.log(submitSkuList);
|
||||||
if (FormData.specificationsGroup) {
|
if (FormData.specificationsGroup) {
|
||||||
for (let i of FormData.specificationsGroup.selectSpec) {
|
for (let i of FormData.specificationsGroup.selectSpec) {
|
||||||
if (i.selectSpecResult.length) {
|
if (i.selectSpecResult.length) {
|
||||||
@@ -1517,7 +1252,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const submitData = {
|
const submitData = {
|
||||||
...FormData,
|
...FormData,
|
||||||
images: images,
|
images: images,
|
||||||
@@ -1526,7 +1260,13 @@
|
|||||||
specInfo: JSON.stringify(submitSkuList),
|
specInfo: JSON.stringify(submitSkuList),
|
||||||
lowPrice: submitSkuList[0].salePrice,
|
lowPrice: submitSkuList[0].salePrice,
|
||||||
specificationsGroup: undefined,
|
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)
|
skuSnap: JSON.stringify(skuSnap)
|
||||||
}
|
}
|
||||||
//编辑
|
//编辑
|
||||||
@@ -1562,29 +1302,33 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 监听规格保存,拿到数据
|
* 监听规格保存,拿到数据
|
||||||
* @param {Boolean} open //控制开启或关闭监听
|
|
||||||
*/
|
*/
|
||||||
function watchSpecificationsSave(open = true) {
|
const newSkuList = reactive({
|
||||||
if (open) {
|
list: []
|
||||||
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');
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
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() {
|
function toGroup() {
|
||||||
@@ -1666,23 +1410,20 @@
|
|||||||
watch(() => FormData.typeEnum, (newval) => {
|
watch(() => FormData.typeEnum, (newval) => {
|
||||||
if (option.type === 'add') {
|
if (option.type === 'add') {
|
||||||
if (newval === 'sku') {
|
if (newval === 'sku') {
|
||||||
skuList.length = 0
|
skuList.list = []
|
||||||
} else {
|
} else {
|
||||||
skuList[0] = {
|
skuList.list[0] = {
|
||||||
...$defaultSku,
|
...$defaultSku,
|
||||||
barCode: `${uni.getStorageSync("shopId")}${dayjs().valueOf()}`
|
barCode: `${uni.getStorageSync("shopId")}${dayjs().valueOf()}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
watchSpecificationsSave()
|
onShow(() => {
|
||||||
watchTimerSave()
|
watchSpecificationsSave()
|
||||||
onBeforeUnmount(() => {
|
|
||||||
watchSpecificationsSave(false)
|
|
||||||
watchTimerSave(false)
|
|
||||||
})
|
})
|
||||||
onReady(() => {
|
onReady(() => {
|
||||||
Forms.value&&Forms.value.setRules(rules)
|
Forms.value && Forms.value.setRules(rules)
|
||||||
})
|
})
|
||||||
watch(() => pageData.types, (newval) => {
|
watch(() => pageData.types, (newval) => {
|
||||||
Forms.value.setRules(rules)
|
Forms.value.setRules(rules)
|
||||||
@@ -1764,6 +1505,7 @@
|
|||||||
.box {
|
.box {
|
||||||
margin-top: 36rpx;
|
margin-top: 36rpx;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
|
|
||||||
.block {
|
.block {
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
border-radius: 18rpx 18rpx 18rpx 18rpx;
|
border-radius: 18rpx 18rpx 18rpx 18rpx;
|
||||||
|
|||||||
@@ -91,8 +91,8 @@
|
|||||||
|
|
||||||
function haocaiClick(item, index) {
|
function haocaiClick(item, index) {
|
||||||
console.log(item);
|
console.log(item);
|
||||||
if (item.consId != props.modelValue) {
|
if (item.id != props.modelValue) {
|
||||||
emits('update:modelValue', item.consId)
|
emits('update:modelValue', item.id)
|
||||||
emits('change', item)
|
emits('change', item)
|
||||||
}
|
}
|
||||||
popShow.value = false
|
popShow.value = false
|
||||||
|
|||||||
@@ -14,9 +14,9 @@
|
|||||||
<view class="">
|
<view class="">
|
||||||
<template v-if="isBindGuige&&isSku">
|
<template v-if="isBindGuige&&isSku">
|
||||||
<view class="list">
|
<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>规格名称</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="color-666 u-m-t-24 u-flex">
|
||||||
<view class="xuhao">序号</view>
|
<view class="xuhao">序号</view>
|
||||||
<view class="u-flex u-flex-1 u-p-l-32 gap-20">
|
<view class="u-flex u-flex-1 u-p-l-32 gap-20">
|
||||||
@@ -26,29 +26,24 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-m-t-32 color-666">
|
<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">
|
:key="haocaiIndex">
|
||||||
<view class=" u-flex">
|
<view class=" u-flex">
|
||||||
<view class="xuhao">{{haocaiIndex+1}}</view>
|
<view class="xuhao">{{haocaiIndex+1}}</view>
|
||||||
<view class="u-flex u-flex-1 u-p-l-32 gap-20">
|
<view class="u-flex u-flex-1 u-p-l-32 gap-20">
|
||||||
<view class="u-flex-1 ">
|
<view class="u-flex-1 ">
|
||||||
<view class="u-flex input">
|
<choose-haocai @change="conInfosChange($event,item)"
|
||||||
<view>{{item.name}}</view>
|
:listMap="$haocaiMap" :list="haoCaiList"
|
||||||
<up-icon :size="10" name="arrow-down-fill"></up-icon>
|
v-model="item.conInfoId"></choose-haocai>
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex-1 ">
|
<view class="u-flex-1 ">
|
||||||
<view class="u-flex input">
|
<choose-danwei :listMap="$danweiMap" :list="danweiList"
|
||||||
<view>{{item.unit}}</view>
|
v-model="item.conUnit"></choose-danwei>
|
||||||
<up-icon :size="10" name="arrow-down-fill"></up-icon>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex-1 ">
|
<view class="u-flex input">
|
||||||
<view class="u-flex input">
|
<up-input border="none" v-model="item.surplusStock"></up-input>
|
||||||
<up-input border="none"></up-input>
|
<up-icon @click="delGuigeHaocao(index,haocaiIndex)" color="#EB4F4F" :size="16"
|
||||||
<up-icon color="#EB4F4F" @click="delGuigeHaocao(index,haocaiIndex)"
|
name="minus-circle-fill"></up-icon>
|
||||||
:size="16" name="minus-circle-fill"></up-icon>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -173,16 +168,20 @@
|
|||||||
deletetbProskuCon,
|
deletetbProskuCon,
|
||||||
} from "@/http/yskApi/consumable.js";
|
} from "@/http/yskApi/consumable.js";
|
||||||
import {
|
import {
|
||||||
tbShopCurrencyGet,$hasPermission
|
tbShopCurrencyGet,
|
||||||
|
$hasPermission
|
||||||
} from '@/http/yskApi/shop.js'
|
} from '@/http/yskApi/shop.js'
|
||||||
|
|
||||||
|
import infoBox from '@/commons/utils/infoBox.js'
|
||||||
import chooseHaocai from './choose-haocai.vue';
|
import chooseHaocai from './choose-haocai.vue';
|
||||||
import chooseDanwei from './choose-danwei.vue';
|
import chooseDanwei from './choose-danwei.vue';
|
||||||
import {
|
import {
|
||||||
$tbProskuConV2
|
$tbProskuConV2
|
||||||
} from '@/http/yskApi/goods.js'
|
} from '@/http/yskApi/goods.js'
|
||||||
const emits=defineEmits(['cancel'])
|
import { cloneWith } from 'lodash';
|
||||||
function cancel(){
|
const emits = defineEmits(['cancel', 'updateGoods'])
|
||||||
|
|
||||||
|
function cancel() {
|
||||||
emits('cancel')
|
emits('cancel')
|
||||||
}
|
}
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -203,27 +202,29 @@
|
|||||||
console.log(newval);
|
console.log(newval);
|
||||||
conInfos.value = newval
|
conInfos.value = newval
|
||||||
})
|
})
|
||||||
|
|
||||||
function conInfosChange(newval, item) {
|
function conInfosChange(newval, item) {
|
||||||
console.log(newval);
|
console.log(newval);
|
||||||
item.stockNumber = newval.balance
|
item.stockNumber = newval.balance
|
||||||
item.conUnit = newval.conUnit
|
item.conUnit = newval.conUnit
|
||||||
}
|
}
|
||||||
|
|
||||||
const skuList = ref(props.goods.skuList)
|
const skuList = ref(props.goods.skuList)
|
||||||
watch(() => props.goods.skuList, (newval) => {
|
watch(() => props.goods.skuList, (newval) => {
|
||||||
console.log(newval);
|
console.log(newval);
|
||||||
skuList.value = newval
|
skuList.value = newval
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const $baseicHaocaiData = {
|
||||||
|
conInfoId: '',
|
||||||
|
conUnit: '',
|
||||||
|
surplusStock: ''
|
||||||
|
}
|
||||||
|
|
||||||
function addHaocai() {
|
function addHaocai() {
|
||||||
conInfos.value.push({
|
conInfos.value.push({
|
||||||
conInfoId: '',
|
...$baseicHaocaiData
|
||||||
conUnit: '',
|
|
||||||
surplusStock: ''
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const popup = reactive({
|
const popup = reactive({
|
||||||
@@ -233,11 +234,21 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
function addGuigeHaocai(index) {
|
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) {
|
function delHaocai(index) {
|
||||||
const item = conInfos.value[index]
|
const item = conInfos.value[index]
|
||||||
|
console.log(item);
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: '是否删除该耗材',
|
content: '是否删除该耗材',
|
||||||
@@ -258,7 +269,24 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function delGuigeHaocao(guigeIndex, haocaiIndex) {
|
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
|
isBindGuige.value = isSku.value
|
||||||
})
|
})
|
||||||
|
|
||||||
function save() {
|
async function save() {
|
||||||
console.log('save');
|
console.log('save');
|
||||||
const isPas= conInfos.value.every(v=>{
|
let isPas=false
|
||||||
return v.conInfoId&&v.conUnit&&v.surplusStock>0
|
if(!isBindGuige.value){
|
||||||
})
|
//绑定至商品
|
||||||
console.log(isPas);
|
isPas = conInfos.value.every(v => {
|
||||||
return
|
return v.conInfoId && v.conUnit && v.surplusStock > 0
|
||||||
let ajaxData = ''
|
})
|
||||||
|
}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) {
|
if (!isBindGuige.value) {
|
||||||
//绑定至商品
|
//绑定至商品
|
||||||
ajaxData = conInfos.value.map(v => {
|
ajaxData.cons = conInfos.value.map(v => {
|
||||||
return {
|
return {
|
||||||
|
id: v.id || '',
|
||||||
conInfoId: v.conInfoId,
|
conInfoId: v.conInfoId,
|
||||||
productId: props.goods.id,
|
productId: props.goods.id,
|
||||||
shopId: uni.getStorageSync('shopId'),
|
shopId: uni.getStorageSync('shopId'),
|
||||||
productSkuId: 0,
|
productSkuId: 0,
|
||||||
surplusStock: v.surplusStock
|
surplusStock: v.surplusStock * 1,
|
||||||
|
status: 1
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} 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);
|
console.log(ajaxData);
|
||||||
$tbProskuConV2(ajaxData)
|
await $tbProskuConV2(ajaxData)
|
||||||
|
emits('updateGoods')
|
||||||
|
infoBox.showToast('修改成功')
|
||||||
}
|
}
|
||||||
|
|
||||||
let haoCaiList = ref([])
|
let haoCaiList = ref([])
|
||||||
@@ -303,12 +367,11 @@
|
|||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
gettbConsInfo({
|
gettbConsInfo({
|
||||||
page: 0,
|
"status": 1,
|
||||||
size: 200
|
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
for (let i in res.content) {
|
for (let i in res.content) {
|
||||||
const item = res.content[i]
|
const item = res.content[i]
|
||||||
$haocaiMap[item.consId] = item
|
$haocaiMap[item.id] = item
|
||||||
}
|
}
|
||||||
haoCaiList.value = res.content
|
haoCaiList.value = res.content
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,6 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="u-m-t-24">
|
<view class="u-m-t-24">
|
||||||
{{item.selectSpecResult}}
|
|
||||||
<uni-data-checkbox @change="createResult" multiple :selectedColor="color.ColorMain"
|
<uni-data-checkbox @change="createResult" multiple :selectedColor="color.ColorMain"
|
||||||
v-model="item.selectSpecResult" :localdata="item.value"></uni-data-checkbox>
|
v-model="item.selectSpecResult" :localdata="item.value"></uni-data-checkbox>
|
||||||
|
|
||||||
@@ -30,6 +29,19 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</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>
|
||||||
<view class="block u-m-b-32" v-for="(item,index) in FormData.result" :key="index">
|
<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')"
|
<uni-easyinput @blur="priceFormat(item.skus,'firstShared')"
|
||||||
:paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle"
|
:paddingNone="inputPaddingNone" :placeholderStyle="placeholderStyle"
|
||||||
:inputBorder="inputBorder" v-model="item.skus.firstShared" type="digit"
|
:inputBorder="inputBorder" v-model="item.skus.firstShared" type="digit"
|
||||||
placeholder="请输入起售数量" />
|
placeholder="请输入分销金额" />
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item label="商品条码" required>
|
<uni-forms-item label="商品条码" required>
|
||||||
<uni-easyinput disabled :paddingNone="inputPaddingNone"
|
<uni-easyinput disabled :paddingNone="inputPaddingNone"
|
||||||
:placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
:placeholderStyle="placeholderStyle" :inputBorder="inputBorder"
|
||||||
v-model="item.skus.barCode" placeholder="请输入起售数量" />
|
v-model="item.skus.barCode" placeholder="请输入商品条码" />
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -112,18 +124,25 @@
|
|||||||
|
|
||||||
<view class="save-btn-box">
|
<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>
|
||||||
|
<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>
|
</view>
|
||||||
<view class="bottom" ref="bottom"></view>
|
<view class="bottom" ref="bottom"></view>
|
||||||
|
|
||||||
|
<pop-fast-edit @update="updateSkuKey" v-model:show="fastEdit.show"></pop-fast-edit>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import myUploadFile from '@/components/my-components/my-upload-file'
|
import myUploadFile from '@/components/my-components/my-upload-file'
|
||||||
import {
|
import {
|
||||||
formatPrice
|
formatPrice
|
||||||
} from "@/commons/utils/format.js";
|
} from "@/commons/utils/format.js";
|
||||||
|
import popFastEdit from "./components/fast-edit.vue"
|
||||||
const refFiles = ref([]);
|
const refFiles = ref([]);
|
||||||
//绑定文件上传元素
|
//绑定文件上传元素
|
||||||
function setRefFile(index) {
|
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={}
|
let option={}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//number类型数据限制
|
//number类型数据限制
|
||||||
function priceFormat(item, key) {
|
function priceFormat(item, key) {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
@@ -180,7 +215,19 @@
|
|||||||
watch
|
watch
|
||||||
} from 'vue';
|
} 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 inputPaddingNone = ref(true)
|
||||||
const form = ref(null)
|
const form = ref(null)
|
||||||
const originSpecMap={}
|
const originSpecMap={}
|
||||||
@@ -353,15 +400,16 @@
|
|||||||
getTbProductSpec()
|
getTbProductSpec()
|
||||||
const obj = uni.getStorageSync('guige')
|
const obj = uni.getStorageSync('guige')
|
||||||
if (obj&&JSON.stringify(obj) !== '{}') {
|
if (obj&&JSON.stringify(obj) !== '{}') {
|
||||||
|
console.log(obj.selectSpec);
|
||||||
option.productId=opt.productId
|
option.productId=opt.productId
|
||||||
Object.assign(FormData, obj)
|
Object.assign(FormData, obj)
|
||||||
for(let i of obj.result){
|
for(let i of obj.result){
|
||||||
const key=returnSpecSnap(i.names)
|
const key=returnSpecSnap(i.names)
|
||||||
originSpecMap[key]=i
|
originSpecMap[key]=i
|
||||||
}
|
}
|
||||||
console.log(FormData);
|
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
FormData.result = obj.result
|
FormData.result = obj.result
|
||||||
|
console.log(FormData.result);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
console.log(opt);
|
console.log(opt);
|
||||||
@@ -516,7 +564,7 @@
|
|||||||
left: 30rpx;
|
left: 30rpx;
|
||||||
right: 30rpx;
|
right: 30rpx;
|
||||||
bottom: 60rpx;
|
bottom: 60rpx;
|
||||||
|
z-index: 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep.uni-forms-item {
|
::v-deep.uni-forms-item {
|
||||||
@@ -540,7 +588,12 @@
|
|||||||
border-radius: 12rpx;
|
border-radius: 12rpx;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
}
|
}
|
||||||
|
.edit-btn{
|
||||||
|
background-color: #fff;
|
||||||
|
color: #333;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
.btn-hover-class {
|
.btn-hover-class {
|
||||||
opacity: .6;
|
opacity: .6;
|
||||||
}
|
}
|
||||||
@@ -551,7 +604,18 @@
|
|||||||
padding-left: 42rpx;
|
padding-left: 42rpx;
|
||||||
border-radius: 14rpx 14rpx 14rpx 14rpx;
|
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 {
|
::v-deep .uni-input-placeholder {
|
||||||
font-size: 28rpx;
|
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>
|
||||||
<view class="u-m-t-16">
|
<view class="u-m-t-16">
|
||||||
<up-input v-model="form.number">
|
<up-input v-model="form.stockNumber" type="number">
|
||||||
<template #suffix>
|
<!-- <template #suffix>
|
||||||
<view>{{data.unitName}}</view>
|
<view>{{data.unitName}}</view>
|
||||||
</template>
|
</template> -->
|
||||||
</up-input>
|
</up-input>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
<view>备注</view>
|
<view>备注</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-m-t-16">
|
<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>
|
</view>
|
||||||
<view class="u-m-b-32">
|
<view class="u-m-b-32">
|
||||||
@@ -36,9 +36,7 @@
|
|||||||
<view>上传图片</view>
|
<view>上传图片</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-m-t-16">
|
<view class="u-m-t-16">
|
||||||
<scroll-view scroll-y="true" style="max-height: 300rpx;">
|
<my-up-upload :maxCount="1" :multiple="false" v-model="form.coverImg"></my-up-upload>
|
||||||
<my-up-upload v-model="form.images"></my-up-upload>
|
|
||||||
</scroll-view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-m-t-60">
|
<view class="u-m-t-60">
|
||||||
@@ -67,8 +65,9 @@
|
|||||||
returnCategory
|
returnCategory
|
||||||
} from '@/pageProduct/util.js'
|
} from '@/pageProduct/util.js'
|
||||||
import {
|
import {
|
||||||
$tbShopUnit
|
$frmLoss
|
||||||
} from '@/http/yskApi/goods.js'
|
} from '@/http/yskApi/goods.js'
|
||||||
|
import infoBox from '@/commons/utils/infoBox.js'
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
show: {
|
show: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@@ -88,9 +87,9 @@
|
|||||||
const data = ref(props.goods)
|
const data = ref(props.goods)
|
||||||
const emits = defineEmits(['update:show', 'save'])
|
const emits = defineEmits(['update:show', 'save'])
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
note: '',
|
remark: '',
|
||||||
number: 1,
|
stockNumber: 1,
|
||||||
images: []
|
coverImg: []
|
||||||
})
|
})
|
||||||
let popShow = ref(props.show)
|
let popShow = ref(props.show)
|
||||||
watch(() => props.show, (newval) => {
|
watch(() => props.show, (newval) => {
|
||||||
@@ -111,8 +110,21 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function save() {
|
async function save() {
|
||||||
console.log(form.images);
|
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>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="control" :style="getComputedStyle()">
|
<view class="control" :style="getComputedStyle()">
|
||||||
<view class="u-flex control1" v-if="showControl1">
|
<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="btn" @tap="go.to('PAGES_PRODUCT_ADD')">商品添加</view>
|
||||||
<!-- <view class="color-999 btn u-flex u-row-center" @click="emitToggleCategory">
|
<!-- <view class="color-999 btn u-flex u-row-center" @click="emitToggleCategory">
|
||||||
<text class="u-m-r-10">{{categoryName||'选择分类'}}</text>
|
<text class="u-m-r-10">{{categoryName||'选择分类'}}</text>
|
||||||
@@ -114,8 +114,8 @@
|
|||||||
|
|
||||||
.control {
|
.control {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
left: 30rpx;
|
left: 110rpx;
|
||||||
right: 30rpx;
|
right: 110rpx;
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
background: #3E3A3A;
|
background: #3E3A3A;
|
||||||
border-radius: 100rpx;
|
border-radius: 100rpx;
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class=" u-flex u-row-between u-m-t-30">
|
<view class=" u-flex u-row-between u-m-t-30">
|
||||||
<view>售罄</view>
|
<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>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -40,7 +40,9 @@
|
|||||||
returnCategory
|
returnCategory
|
||||||
} from '@/pageProduct/util.js'
|
} from '@/pageProduct/util.js'
|
||||||
import {
|
import {
|
||||||
$updateGrounding, $updateProductStatus
|
$updateGrounding,
|
||||||
|
$updateProductStatus,$updateProductData,
|
||||||
|
$tbProskuConV2
|
||||||
} from '@/http/yskApi/goods.js'
|
} from '@/http/yskApi/goods.js'
|
||||||
import infoBox from '@/commons/utils/infoBox.js'
|
import infoBox from '@/commons/utils/infoBox.js'
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -73,7 +75,7 @@
|
|||||||
// 是否上架
|
// 是否上架
|
||||||
const isGrounding = ref(1)
|
const isGrounding = ref(1)
|
||||||
const data = ref(props.goods)
|
const data = ref(props.goods)
|
||||||
const emits = defineEmits(['update:show', 'save', 'isGroundingChange','isPauseSaleChange'])
|
const emits = defineEmits(['update:show', 'save', 'isGroundingChange', 'isPauseSaleChange'])
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
note: ''
|
note: ''
|
||||||
})
|
})
|
||||||
@@ -102,21 +104,30 @@
|
|||||||
function save() {
|
function save() {
|
||||||
emits('save')
|
emits('save')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function upDateGoods(par) {
|
||||||
|
return $updateProductData([{
|
||||||
|
id: data.value.id,
|
||||||
|
isSku: 1,
|
||||||
|
shopId: uni.getStorageSync('shopId'),
|
||||||
|
...par
|
||||||
|
}])
|
||||||
|
}
|
||||||
|
|
||||||
async function isGroundingChange(e) {
|
async function isGroundingChange(e) {
|
||||||
console.log(e);
|
await upDateGoods({
|
||||||
await $updateGrounding({
|
key:'grounding',
|
||||||
isGrounding: e ? true : false,
|
value: e
|
||||||
skuId: props.goods.id
|
|
||||||
})
|
})
|
||||||
emits('isGroundingChange', e)
|
emits('isGroundingChange', e)
|
||||||
infoBox.showToast('更新成功')
|
infoBox.showToast('更新成功')
|
||||||
}
|
}
|
||||||
|
|
||||||
async function isPauseSaleChange(e) {
|
async function isPauseSaleChange(e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
await $updateProductStatus({
|
await upDateGoods({
|
||||||
targetId: props.goods.id,
|
key:'pauseSale',
|
||||||
updateKey: "pauseSaleSku",
|
value: e
|
||||||
updateValue: e?1:0
|
|
||||||
})
|
})
|
||||||
emits('isPauseSaleChange', e)
|
emits('isPauseSaleChange', e)
|
||||||
infoBox.showToast('更新成功')
|
infoBox.showToast('更新成功')
|
||||||
|
|||||||
@@ -87,9 +87,10 @@
|
|||||||
<my-step :list="recoders.list"></my-step>
|
<my-step :list="recoders.list"></my-step>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
<view class="color-999 u-font-24 u-flex u-row-center u-col-center">
|
<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-flex" @click="changeShowRecoders(false)"> -->
|
||||||
<view class="u-m-r-6">收起记录</view>
|
<view class="u-flex" @click="toRecodes">
|
||||||
<up-icon name="arrow-up" :size="12"></up-icon>
|
<view class="u-m-r-6">全部记录</view>
|
||||||
|
<up-icon name="arrow-right" :size="12"></up-icon>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -117,7 +118,7 @@
|
|||||||
returnCategory
|
returnCategory
|
||||||
} from '@/pageProduct/util.js'
|
} from '@/pageProduct/util.js'
|
||||||
import {
|
import {
|
||||||
$tbShopUnit
|
$tbShopUnit,$getProductStockDetail
|
||||||
} from '@/http/yskApi/goods.js'
|
} from '@/http/yskApi/goods.js'
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
show: {
|
show: {
|
||||||
@@ -135,29 +136,15 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
function toRecodes(){
|
||||||
|
}
|
||||||
function changeShowRecoders(show) {
|
function changeShowRecoders(show) {
|
||||||
recoders.show = show
|
recoders.show = show
|
||||||
}
|
}
|
||||||
const recoders = reactive({
|
const recoders = reactive({
|
||||||
list: [{
|
list: [],
|
||||||
title: '2024-09-15 11:20:30',
|
show: true,
|
||||||
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,
|
|
||||||
active: 0
|
active: 0
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -171,8 +158,27 @@
|
|||||||
popShow.value = newval
|
popShow.value = newval
|
||||||
if (newval) {
|
if (newval) {
|
||||||
data.value = props.goods
|
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(() => {
|
const isSku = computed(() => {
|
||||||
// return data.value.typeEnum == '多规格'
|
// return data.value.typeEnum == '多规格'
|
||||||
return false
|
return false
|
||||||
|
|||||||
@@ -33,17 +33,18 @@
|
|||||||
<view class="info-p-l color-333 u-flex u-row-between">
|
<view class="info-p-l color-333 u-flex u-row-between">
|
||||||
<view class="u-flex">
|
<view class="u-flex">
|
||||||
<text class="u-m-r-24">{{data.name}}</text>
|
<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> -->
|
custom-style="background-color: #318AFE;" :text="data.typeEnum"></uni-tag> -->
|
||||||
</view>
|
</view>
|
||||||
<view class="u-font-32">
|
<view class="u-font-32">
|
||||||
|
<text v-if="data.typeEnum=='单规格'">¥</text>
|
||||||
<text>{{data.lowPrice}}</text>
|
<text>{{data.lowPrice}}</text>
|
||||||
<!-- <text>¥</text>
|
<!-- <text>¥</text>
|
||||||
<text>{{data.lowPrice}}</text>
|
<text>{{data.lowPrice}}</text>
|
||||||
<text v-if="data.typeEnum == '多规格'">~¥{{data.maxPrice }}</text> -->
|
<text v-if="data.typeEnum == '多规格'">~¥{{data.maxPrice }}</text> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-m-t-44">
|
<view class="u-m-t-24">
|
||||||
<template v-if="data.skuList.length>=2">
|
<template v-if="data.skuList.length>=2">
|
||||||
<view class="u-flex u-flex-wrap w-full gap-10 u-col-top">
|
<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>
|
<view class="u-font-24 info-p-l u-m-t-14">规格:</view>
|
||||||
@@ -64,7 +65,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<view style="height: 24rpx;">
|
<view style="height: 44rpx;">
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -86,11 +87,11 @@
|
|||||||
<view class="u-flex">
|
<view class="u-flex">
|
||||||
<view class="u-flex">
|
<view class="u-flex">
|
||||||
<view class="u-m-r-18 color-999">售罄</view>
|
<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>
|
||||||
<view class="u-flex u-m-l-30">
|
<view class="u-flex u-m-l-30">
|
||||||
<view class="u-m-r-18 color-999">下架产品</view>
|
<view class="u-m-r-18 color-999">{{data.isGrounding?'下架产品':'上架产品' }}</view>
|
||||||
<my-switch v-model="data.isSellNoneChange" @change="isHotChange"></my-switch>
|
<my-switch v-model="isGrounding" @change="isGroundingChange"></my-switch>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex">
|
<view class="u-flex">
|
||||||
@@ -109,17 +110,21 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import {
|
||||||
ref,
|
ref,
|
||||||
|
watch,
|
||||||
watchEffect
|
watchEffect
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
import {
|
import {
|
||||||
$goodsIsHot
|
$goodsIsHot,
|
||||||
|
$tbProskuConV2,$updateProductData
|
||||||
} from '@/http/yskApi/goods.js'
|
} from '@/http/yskApi/goods.js'
|
||||||
import mySwitch from '@/components/my-components/my-switch.vue'
|
import mySwitch from '@/components/my-components/my-switch.vue'
|
||||||
import go from '@/commons/utils/go.js';
|
import go from '@/commons/utils/go.js';
|
||||||
import {
|
import {
|
||||||
ColorMain
|
ColorMain
|
||||||
} from '@/commons/color.js'
|
} 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({
|
const props = defineProps({
|
||||||
index: {
|
index: {
|
||||||
type: Number
|
type: Number
|
||||||
@@ -127,7 +132,8 @@
|
|||||||
data: {
|
data: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {
|
default: () => {
|
||||||
return {}
|
return {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
showChecked: {
|
showChecked: {
|
||||||
@@ -139,27 +145,44 @@
|
|||||||
default: false
|
default: false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function isHotChange(e) {
|
|
||||||
$goodsIsHot({
|
|
||||||
|
async function upDateGoods(par) {
|
||||||
|
const res = await $updateProductData([{
|
||||||
id: props.data.id,
|
id: props.data.id,
|
||||||
isHot: props.data.isHot
|
isSku: 0,
|
||||||
}).then(res => {
|
shopId: uni.getStorageSync('shopId'),
|
||||||
uni.showToast({
|
...par
|
||||||
title: '修改成功',
|
}])
|
||||||
icon: 'none'
|
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)
|
function isGroundingChange(e) {
|
||||||
isSellNone.value = props.isSellNone
|
upDateGoods({
|
||||||
|
key: 'grounding',
|
||||||
function isSellNoneChange() {
|
value: e
|
||||||
console.log(isSellNone.value);
|
})
|
||||||
console.log('isSellNoneChange');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let checked = ref(false)
|
let checked = ref(false)
|
||||||
@@ -193,7 +216,8 @@
|
|||||||
function guigeClick(guigeIndex) {
|
function guigeClick(guigeIndex) {
|
||||||
emits('guigeClick', props.index, guigeIndex)
|
emits('guigeClick', props.index, guigeIndex)
|
||||||
}
|
}
|
||||||
function editStock(){
|
|
||||||
|
function editStock() {
|
||||||
emits('editStock', props.index)
|
emits('editStock', props.index)
|
||||||
}
|
}
|
||||||
//携带参数type edit跳转到商品添加页面,编辑与添加同一页面,根据type值来判断
|
//携带参数type edit跳转到商品添加页面,编辑与添加同一页面,根据type值来判断
|
||||||
@@ -298,7 +322,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.skd {
|
.skd {
|
||||||
padding: 14rpx 40rpx 14rpx 20rpx;
|
padding: 20rpx 20rpx 14rpx 20rpx;
|
||||||
background: #F0F2F5;
|
background: #F0F2F5;
|
||||||
border-radius: 4rpx;
|
border-radius: 4rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
<view class="goods-list u-p-30">
|
<view class="goods-list u-p-30">
|
||||||
<template v-if="pageData.goodsList.length">
|
<template v-if="pageData.goodsList.length">
|
||||||
<view class="u-m-b-32" v-for="(item,index) in pageData.goodsList" :key="index">
|
<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"
|
@editStock="changeStockShow" @guigeClick="editGuigeShow" @baosun="baosunShow"
|
||||||
@radioClick="goodsRadioClick" :index="index" :data="item" @del="goodsDel"
|
@radioClick="goodsRadioClick" :index="index" :data="item" @del="goodsDel"
|
||||||
:showChecked="showChecked" :showDetail="pageData.showGoodsDetail"></my-goods>
|
:showChecked="showChecked" :showDetail="pageData.showGoodsDetail"></my-goods>
|
||||||
@@ -187,7 +187,9 @@
|
|||||||
page: 0,
|
page: 0,
|
||||||
size: 10,
|
size: 10,
|
||||||
categoryId: '',
|
categoryId: '',
|
||||||
name: ''
|
name: '',
|
||||||
|
isPauseSale:'',
|
||||||
|
isGrounding:''
|
||||||
},
|
},
|
||||||
category: '',
|
category: '',
|
||||||
categoryList: [], //分类列表
|
categoryList: [], //分类列表
|
||||||
@@ -198,7 +200,12 @@
|
|||||||
watch(() => pageData.query.categoryId, (newval) => {
|
watch(() => pageData.query.categoryId, (newval) => {
|
||||||
getGoodsList()
|
getGoodsList()
|
||||||
})
|
})
|
||||||
|
watch(() => pageData.query.isPauseSale, (newval) => {
|
||||||
|
getGoodsList()
|
||||||
|
})
|
||||||
|
watch(() => pageData.query.isGrounding, (newval) => {
|
||||||
|
getGoodsList()
|
||||||
|
})
|
||||||
const popup = reactive({
|
const popup = reactive({
|
||||||
price: {
|
price: {
|
||||||
show: false
|
show: false
|
||||||
@@ -362,6 +369,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getGoodsList() {
|
function getGoodsList() {
|
||||||
|
pageData.hasAjax = false
|
||||||
$tbProductV2(pageData.query).then(res => {
|
$tbProductV2(pageData.query).then(res => {
|
||||||
pageData.hasAjax = true
|
pageData.hasAjax = true
|
||||||
console.log(res);
|
console.log(res);
|
||||||
@@ -377,9 +385,10 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
getGoodsList()
|
// getGoodsList()
|
||||||
})
|
})
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
|
getGoodsList()
|
||||||
$tbShopCategory({
|
$tbShopCategory({
|
||||||
page: 0,
|
page: 0,
|
||||||
size: 200
|
size: 200
|
||||||
@@ -464,14 +473,36 @@
|
|||||||
|
|
||||||
|
|
||||||
function statesTableClick(index) {
|
function statesTableClick(index) {
|
||||||
|
|
||||||
pageData.stateCurrent = 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)
|
let test = ref(false)
|
||||||
|
|
||||||
function tabsChange(i) {
|
function tabsChange(i) {
|
||||||
console.log(i);
|
console.log(i);
|
||||||
pageData.showGoodsDetail = i ? true : false
|
pageData.showGoodsDetail = i ? true : false
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user