|
@@ -0,0 +1,409 @@
|
|
|
+<template>
|
|
|
+ <view class="bg-set" :class="mask ? 'tl-show': ''">
|
|
|
+ <u-navbar :autoBack="true" :placeholder="true" leftIconColor="#fff" bgColor="#FD4B09">
|
|
|
+ <view slot="center" style="width: 88%;margin-left: 80rpx;">
|
|
|
+ <u-search v-model="form.goods" :animation="true" :actionStyle="{color:'#fff'}" @custom="custom"
|
|
|
+ @search="custom"></u-search>
|
|
|
+ </view>
|
|
|
+ </u-navbar>
|
|
|
+ <view class="topBackground" :style="{top: revenueTop+44+'px'}" style="overflow:hidden">
|
|
|
+ <u-tabs :list="list" @click="click" :activeStyle="{ color: '#fff' }" :inactiveStyle="{ color: '#ffffff80' }"
|
|
|
+ lineColor="#fff">
|
|
|
+ <view slot="right" style="font-size: 15px;color: #fff;">
|
|
|
+ <text style="margin-left: 10rpx;">|<text style="margin:0rpx 15rpx"
|
|
|
+ @click="show = true,mask = true">筛选</text></text>
|
|
|
+ </view>
|
|
|
+ </u-tabs>
|
|
|
+ </view>
|
|
|
+ <view style="margin: 0rpx auto;" class="content">
|
|
|
+ <view class="contentBox" v-for="(item,index) in dataList" :key="index">
|
|
|
+ <view style="width: 100%;margin: 0 auto;">
|
|
|
+ <view class="textBox">
|
|
|
+ <view style="font-size: 30rpx;font-weight: bold;">{{item.goods}}</view>
|
|
|
+ <view>
|
|
|
+ 库存:{{item.balance?item.balance.slice(0,item.balance.length-3):item.balance}}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="textBox">
|
|
|
+ <view style="font-size: 30rpx;">库存单价:{{item.stockPrice}}</view>
|
|
|
+ <view v-if="item.label.includes('特价')">
|
|
|
+ <u--input
|
|
|
+ style="padding:0"
|
|
|
+ type="number"
|
|
|
+ inputAlign="right"
|
|
|
+ placeholder="请输入商城价格"
|
|
|
+ border="none"
|
|
|
+ v-model="item.salesPrice"
|
|
|
+ @blur="(val)=>{blur(val,item)}"
|
|
|
+ ></u--input>
|
|
|
+ </view>
|
|
|
+ <view v-else>商城价格:{{item.salesPrice}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="textBox" style="padding-top: 10rpx;">
|
|
|
+ <view>
|
|
|
+ <u-checkbox-group v-model="item.label" iconPlacement="left" placement="row" @change="(n)=>{checkboxChange(n,item)}">
|
|
|
+ <u-checkbox activeColor="#fd4b09" :customStyle="{marginBottom: '8px'}"
|
|
|
+ v-for="(li, ind) in checkboxListTwo" :key="ind" :label="li.dictValue"
|
|
|
+ :name="li.dictValue">
|
|
|
+ </u-checkbox>
|
|
|
+ </u-checkbox-group>
|
|
|
+ <!-- <u-radio-group v-model="item.label" placement="row" shape="square">
|
|
|
+ <u-radio :customStyle="{marginBottom: '8px'}" v-for="(li, ind) in checkboxListTwo"
|
|
|
+ :key="ind" :label="li.dictValue" :name="li.dictValue">
|
|
|
+ </u-radio>
|
|
|
+ </u-radio-group> -->
|
|
|
+ </view>
|
|
|
+ <view>
|
|
|
+ <u-button v-if="item.upperFrame == 0" type="primary" size="small" text="上架" color="#fd4b09" shape="circle"
|
|
|
+ @click="change(item,index,'up')"></u-button>
|
|
|
+ <u-button v-else-if="item.upperFrame == 1" type="warning" size="small" text="下架"
|
|
|
+ shape="circle" @click="change(item,index,'down')"></u-button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <u-empty v-if="total == 0" style="position: absolute;top: 45%;left: 50%;transform:translate(-50%,-50%)"
|
|
|
+ mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png" />
|
|
|
+ <u-loadmore v-if="total !== 0 && dataList.length != 0" :status="status" />
|
|
|
+ </view>
|
|
|
+ <u-popup :show="show" @close="show = false,mask = false" closeable :closeOnClickOverlay="false" zIndex="10070">
|
|
|
+ <view style="mawidth: 100%;margin: auto 30rpx;margin-top: 20rpx;padding-bottom: 20rpx;">
|
|
|
+ <text>筛选条件</text>
|
|
|
+ <u--form labelPosition="left" :model="formTwo" labelWidth="150rpx">
|
|
|
+ <u-form-item label="产品分类" borderBottom @click="filterAll(['goodsTypeName','goodsTypeId'])">
|
|
|
+ <u-input v-model="formTwo.goodsTypeName" border="none" placeholder="请选择"
|
|
|
+ suffixIcon="arrow-right" disabled disabledColor="#ffffff" />
|
|
|
+ </u-form-item>
|
|
|
+ </u--form>
|
|
|
+ <text style="font-size: 30rpx;">库存筛选</text>
|
|
|
+ <view style="display: flex;justify-content: space-between;">
|
|
|
+ <u-button :type="formTwo.inventoryBalance == 0?'primary':''" text="库存数量>0" @click="stock(0)">
|
|
|
+ </u-button>
|
|
|
+ <u-button :type="formTwo.inventoryBalance == 1?'primary':''" text="库存数量≤0" @click="stock(1)">
|
|
|
+ </u-button>
|
|
|
+ </view>
|
|
|
+ <text style="font-size: 30rpx;">标签筛选</text>
|
|
|
+ <view>
|
|
|
+ <u-checkbox-group v-model="formTwo.labels" placement="column">
|
|
|
+ <u-checkbox :customStyle="{marginBottom: '8px'}" v-for="(item, index) in checkboxList"
|
|
|
+ :key="index" :label="item.dictValue" :name="item.dictKey">
|
|
|
+ </u-checkbox>
|
|
|
+ </u-checkbox-group>
|
|
|
+ </view>
|
|
|
+ <view style="display: flex;justify-content: space-between;padding-top: 20rpx;">
|
|
|
+ <view style="width: 45%;">
|
|
|
+ <u-button text="全部清空" type="warning" @click="confirmEmptying"></u-button>
|
|
|
+ </view>
|
|
|
+ <view style="width: 45%;">
|
|
|
+ <u-button text="确认搜索" type="primary" @click="confirmSearch"></u-button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </u-popup>
|
|
|
+ <u-picker :show="dropDown" :columns="columns" :keyName="keyName" @cancel="dropDown = false" @confirm="confirm">
|
|
|
+ </u-picker>
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import {
|
|
|
+ queryBrand,
|
|
|
+ queryStock,
|
|
|
+ listAll
|
|
|
+ } from '@/api/views/stock/index.js'
|
|
|
+ import {
|
|
|
+ submit
|
|
|
+ } from '@/api/views/productLaunch/index.js'
|
|
|
+ export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ list: [{
|
|
|
+ name: '全部',
|
|
|
+ value: ''
|
|
|
+ }],
|
|
|
+ show: false,
|
|
|
+ mask: false,
|
|
|
+ dropDown: false,
|
|
|
+ columns: [],
|
|
|
+ checkboxList: [],
|
|
|
+ checkboxListTwo: [],
|
|
|
+ status: 'loadmore',
|
|
|
+ revenueTop: 0,
|
|
|
+ keyName: '',
|
|
|
+ total: 0,
|
|
|
+ dataList: [],
|
|
|
+ screen: [],
|
|
|
+ form: {
|
|
|
+ size: 20,
|
|
|
+ current: 1
|
|
|
+ },
|
|
|
+ formTwo: {
|
|
|
+ size: 20,
|
|
|
+ current: 1
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onLoad() {
|
|
|
+ this.$u.api.getWorkDicts('goods_lable').then(res => {
|
|
|
+ this.checkboxList = res.data
|
|
|
+ this.keyName = "dictValue"
|
|
|
+ })
|
|
|
+ this.$u.api.getWorkDicts('lable').then(res => {
|
|
|
+ this.checkboxListTwo = res.data
|
|
|
+ })
|
|
|
+ listAll().then(res => {
|
|
|
+ res.data.forEach(item => this.list.push({
|
|
|
+ name: item.cname,
|
|
|
+ value: item.id
|
|
|
+ }))
|
|
|
+ this.query()
|
|
|
+ })
|
|
|
+ uni.getSystemInfo({
|
|
|
+ success: (e) => {
|
|
|
+ this.revenueTop = e.statusBarHeight
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onReachBottom() {
|
|
|
+ this.status = 'loading'
|
|
|
+ if (this.dataList.length < this.total) {
|
|
|
+ this.form.current++
|
|
|
+ this.query()
|
|
|
+ } else {
|
|
|
+ this.status = 'nomore'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ checkboxChange(n,item){
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中',
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
+ submit({
|
|
|
+ ...item,
|
|
|
+ label:n.join(","),
|
|
|
+ ids:item.goodsId
|
|
|
+ }).then(res => {
|
|
|
+ uni.hideLoading();
|
|
|
+ this.dataList = []
|
|
|
+ this.query()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ blur(val,item){
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中',
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
+ submit({
|
|
|
+ ...item,
|
|
|
+ label:item.label.join(","),
|
|
|
+ ids:item.goodsId,
|
|
|
+ specialOffer:val
|
|
|
+ }).then(res => {
|
|
|
+ uni.hideLoading();
|
|
|
+ this.dataList = []
|
|
|
+ this.query()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ change(item,index,type) {
|
|
|
+ if (type == "up") {
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中',
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
+ submit({
|
|
|
+ ...item,
|
|
|
+ upperFrame: 1,
|
|
|
+ label:item.label.join(","),
|
|
|
+ ids:item.goodsId
|
|
|
+ }).then(res => {
|
|
|
+ uni.hideLoading();
|
|
|
+ this.dataList = []
|
|
|
+ this.query()
|
|
|
+ })
|
|
|
+ } else if (type == "down") {
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中',
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
+ submit({
|
|
|
+ ...item,
|
|
|
+ upperFrame: 0,
|
|
|
+ label:item.label.join(","),
|
|
|
+ ids:item.goodsId
|
|
|
+ }).then(res => {
|
|
|
+ uni.hideLoading();
|
|
|
+ this.dataList = []
|
|
|
+ this.query()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ confirmEmptying() {
|
|
|
+ this.formTwo = {
|
|
|
+ size: 20,
|
|
|
+ current: 1
|
|
|
+ }
|
|
|
+ this.form = {
|
|
|
+ size: 20,
|
|
|
+ current: 1
|
|
|
+ }
|
|
|
+ this.dataList = []
|
|
|
+ this.show = false
|
|
|
+ this.mask = false
|
|
|
+ this.query()
|
|
|
+ },
|
|
|
+ confirmSearch() {
|
|
|
+ let form = {
|
|
|
+ ...JSON.parse(JSON.stringify(this.formTwo)),
|
|
|
+ labels: this.formTwo.labels ? this.formTwo.labels.join(',') : '',
|
|
|
+ size: 20,
|
|
|
+ current: 1
|
|
|
+ }
|
|
|
+ this.form = form
|
|
|
+ this.dataList = []
|
|
|
+ this.show = false
|
|
|
+ this.mask = false
|
|
|
+ this.query()
|
|
|
+ },
|
|
|
+ stock(val) {
|
|
|
+ this.$set(this.formTwo, "inventoryBalance", val)
|
|
|
+ },
|
|
|
+ //集合筛选条件
|
|
|
+ filterAll(screen) {
|
|
|
+ this.screen = screen
|
|
|
+ switch (screen[1]) {
|
|
|
+ case "goodsTypeId":
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中',
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
+ listAll().then(res => {
|
|
|
+ this.columns = [res.data]
|
|
|
+ this.keyName = "cname"
|
|
|
+ this.dropDown = true
|
|
|
+ uni.hideLoading()
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //选择确认
|
|
|
+ confirm(e) {
|
|
|
+ this.formTwo[this.screen[0]] = e.value[0].cname
|
|
|
+ this.formTwo[this.screen[1]] = e.value[0].id
|
|
|
+ this.dropDown = false
|
|
|
+ },
|
|
|
+ query() {
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中',
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
+ queryStock(this.form).then(res => {
|
|
|
+ this.total = res.data.total || 0
|
|
|
+ if (res.data.records) {
|
|
|
+ this.dataList = this.dataList.concat(res.data.records)
|
|
|
+ }
|
|
|
+ uni.hideLoading();
|
|
|
+ if (this.total < 10) {
|
|
|
+ this.status = 'nomore'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ custom(e) {
|
|
|
+ this.dataList = []
|
|
|
+ this.form = {
|
|
|
+ goods: e,
|
|
|
+ size: 20,
|
|
|
+ current: 1,
|
|
|
+ }
|
|
|
+ this.query()
|
|
|
+ },
|
|
|
+ click(item) {
|
|
|
+ this.dataList = []
|
|
|
+ this.form = {
|
|
|
+ goodsTypeId: item.value,
|
|
|
+ size: 20,
|
|
|
+ current: 1,
|
|
|
+ }
|
|
|
+ this.query()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+ .tl-show {
|
|
|
+ overflow: hidden;
|
|
|
+ position: fixed;
|
|
|
+ height: 100%;
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .contentBox {
|
|
|
+ width: 96%;
|
|
|
+ margin: 20rpx auto;
|
|
|
+ background-color: #FFFFFF;
|
|
|
+ border-radius: 20rpx;
|
|
|
+ /* box-shadow: 0 5rpx 14rpx 0 rgba(101, 176, 249, 0.42); */
|
|
|
+ padding-top: 15rpx;
|
|
|
+ padding-bottom: 10rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .textBox {
|
|
|
+ padding: 0 15px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ font-size: 24rpx;
|
|
|
+ margin-bottom: 10rpx;
|
|
|
+ align-items: flex-end;
|
|
|
+ }
|
|
|
+
|
|
|
+ .topBackground {
|
|
|
+ position: fixed;
|
|
|
+ top: 0;
|
|
|
+ z-index: 1;
|
|
|
+ width: 100%;
|
|
|
+ background-color: #FF6F3B;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* .statistics_h {
|
|
|
+ position: fixed;
|
|
|
+ top: calc(88px + var(--status-bar-height));
|
|
|
+ z-index: 1;
|
|
|
+ width: 100%;
|
|
|
+ background-color: #fff;
|
|
|
+ padding-top: 10rpx;
|
|
|
+ } */
|
|
|
+
|
|
|
+ .content {
|
|
|
+ margin-top: 100rpx !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* .statistics {
|
|
|
+ width: calc(96% - 20rpx);
|
|
|
+ margin: 0 auto;
|
|
|
+ background: url("../../../static/images/bg.png") no-repeat;
|
|
|
+ background-size: 100% 100%;
|
|
|
+ border-radius: 20rpx;
|
|
|
+ color: #fff;
|
|
|
+ padding: 10rpx 0rpx 10rpx 10rpx;
|
|
|
+ font-size: 38rpx;
|
|
|
+ } */
|
|
|
+
|
|
|
+ /* ::v-deep .u-line {
|
|
|
+ border-bottom: 4rpx dashed #B6B6B6 !important;
|
|
|
+ } */
|
|
|
+
|
|
|
+ ::v-deep .u-divider {
|
|
|
+ margin: 10rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ ::v-deep .u-album__row__wrapper>uni-image {
|
|
|
+ border-radius: 10rpx;
|
|
|
+ border-top-right-radius: 0;
|
|
|
+ border-bottom-right-radius: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ ::v-deep .u-navbar__content {
|
|
|
+ background-image: linear-gradient(to bottom, #FD4B09, #FF6F3B);
|
|
|
+ }
|
|
|
+</style>
|