|
|
@@ -1,21 +1,18 @@
|
|
|
<template>
|
|
|
<view class="billing_box_bg">
|
|
|
- <app-tabs :tabs="tabs" :currentTab="tabIndex" @change="change" itemWidth="50%"/>
|
|
|
<view class="input-wrap">
|
|
|
<view class="search-bar">
|
|
|
- <app-search-module v-if="tabs[tabIndex].key==STOCK_TYPE.WARN" v-model="py" placeholder="输入拼音首字母查询" @input="searchFnContrapose"/>
|
|
|
- <app-search-module v-else v-model="py" placeholder="输入拼音首字母查询" @input="searchFn"/>
|
|
|
+ <app-search-module v-model="py" placeholder="输入拼音首字母查询" @input="searchFnContrapose"/>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
- <view v-if="tabs[tabIndex].name=='库存预警'" class="scroll-middle_bx">
|
|
|
+ <view class="scroll-middle_bx">
|
|
|
<block v-if="!$util.isEmpty(filterProductInfoContrapose)">
|
|
|
<scroll-view scroll-y class="item_list_bx" @scrolltolower="loadMore" lower-threshold="100" style="width: 100%">
|
|
|
<template v-for="(productItem, productIndex) in filterProductInfoContrapose">
|
|
|
<view style="padding: 20rpx 0">
|
|
|
<CommodityStock
|
|
|
:isPrice="false"
|
|
|
- :type="tabs[tabIndex].key"
|
|
|
+ :type="STOCK_TYPE.WARN"
|
|
|
:key="productIndex"
|
|
|
:info="productItem"
|
|
|
:isEdit="true"
|
|
|
@@ -25,51 +22,15 @@
|
|
|
</template>
|
|
|
</scroll-view>
|
|
|
</block>
|
|
|
-
|
|
|
<block v-else>
|
|
|
<view style="width: 100%">
|
|
|
<app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(filterProductInfoContrapose)"/></view>
|
|
|
</block>
|
|
|
</view>
|
|
|
-
|
|
|
- <view v-else class="scroll-middle_bx">
|
|
|
- <scroll-view scroll-y scroll-with-animation class="tab-view" :scroll-top="scrollTop">
|
|
|
- <div v-for="(item, index) in filterProductInfo" :key="index" class="tab-bar-item" :class="[classIndex == index ? 'active' : '']" :data-current="index" @tap.stop="swichClass(index)">
|
|
|
- <text>{{ item.className || "" }}</text>
|
|
|
- </div>
|
|
|
- </scroll-view>
|
|
|
- <scroll-view scroll-y class="right-box" :scroll-into-view="scroll_into_view"
|
|
|
- scroll-with-animation="true" @scroll="scroll_detail" lower-threshold="100" @scrolltolower="scroll_bottom">
|
|
|
- <block v-if="!$util.isEmpty(filterProductInfo)">
|
|
|
- <view class="item_list_bx selectAll" v-for="(classItem, classIndex) in filterProductInfo" :key="classIndex" :id="`class_${classIndex}`">
|
|
|
- <view class="item_list_title" v-if="!$util.isEmpty(classItem.child)"> {{ classItem.className }}</view>
|
|
|
- <text v-if="tabs[tabIndex].name=='库存预警'&&$util.isEmpty(classItem.child)">当前库存充足</text>
|
|
|
- <template v-for="(productItem,productIndex) in classItem.child" >
|
|
|
- <view style="height: 200rpx" :id="`class_${classIndex}`" :key="productIndex">
|
|
|
- <CommodityStock v-if="classItem.isActive"
|
|
|
- :isPrice="false"
|
|
|
- :type="tabs[tabIndex].key"
|
|
|
- :info="productItem"
|
|
|
- :isEdit="true"
|
|
|
- ></CommodityStock>
|
|
|
- </view>
|
|
|
- </template>
|
|
|
- </view>
|
|
|
- </block>
|
|
|
- <block v-else>
|
|
|
- <view style="width: 100%">
|
|
|
- <app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(filterProductInfo)"/>
|
|
|
- </view>
|
|
|
- </block>
|
|
|
- <!--内容部分 end -->
|
|
|
- </scroll-view>
|
|
|
- </view>
|
|
|
</view>
|
|
|
</template>
|
|
|
-
|
|
|
<script>
|
|
|
import AppSearchModule from "@/components/module/app-search";
|
|
|
-import AppTabs from "@/components/plugin/tabs";
|
|
|
import AppWrapperEmpty from "@/components/app-wrapper-empty";
|
|
|
import CommodityStock from "../components/CommodityStock";
|
|
|
import { STOCK_TYPE } from "@/utils/declare";
|
|
|
@@ -79,9 +40,8 @@ import { selectShop } from "@/mixins";
|
|
|
import { mapGetters } from "vuex";
|
|
|
import DorpdownSelect from "@/components/module/dorpdownSelect";
|
|
|
export default {
|
|
|
- name: "stock_manage", // 开单
|
|
|
+ name: "stock_manage",
|
|
|
components: {
|
|
|
- AppTabs,
|
|
|
AppSearchModule,
|
|
|
AppWrapperEmpty,
|
|
|
CommodityStock,
|
|
|
@@ -94,41 +54,29 @@ export default {
|
|
|
autoLoad: false, //不自动请求数据 自定义请求
|
|
|
pageType: "stock",
|
|
|
tabIndex: 0,
|
|
|
+ modifyStock:{},
|
|
|
tabs: [
|
|
|
{
|
|
|
name: "库存预警",
|
|
|
key: STOCK_TYPE.WARN
|
|
|
- },
|
|
|
- {
|
|
|
- name: "库存明细",
|
|
|
- key: STOCK_TYPE.MANAGE
|
|
|
}
|
|
|
],
|
|
|
- modifyStock:{}
|
|
|
};
|
|
|
},
|
|
|
computed:{
|
|
|
...mapGetters(["getMyShopInfo","getLoginInfo"]),
|
|
|
},
|
|
|
onLoad() {
|
|
|
- let type = this.tabs[this.tabIndex].key == STOCK_TYPE.WARN ? "waring" : "";
|
|
|
+ let type = "waring";
|
|
|
this.shopId = this.getMyShopInfo.id;
|
|
|
- if(type=="waring"){
|
|
|
- this.initDataContrapose({ type, shopId: this.shopId,status:0,delStatus:0});
|
|
|
- }else{
|
|
|
- this.initData({ type, shopId: this.shopId,status:0});
|
|
|
- }
|
|
|
+ this.initDataContrapose({ type, shopId: this.shopId,status:0,delStatus:0});
|
|
|
},
|
|
|
onPullDownRefresh() {
|
|
|
this.page = 1
|
|
|
this.filterProductInfoContrapose = []
|
|
|
- let type = this.tabs[this.tabIndex].key == STOCK_TYPE.WARN ? "waring" : "";
|
|
|
+ let type = "waring";
|
|
|
this.shopId = this.getMyShopInfo.id;
|
|
|
- if(type=="waring"){
|
|
|
- this.initDataContrapose({ type, shopId: this.shopId,status:0,delStatus:0});
|
|
|
- }else{
|
|
|
- this.initData({ type, shopId: this.shopId,status:0});
|
|
|
- }
|
|
|
+ this.initDataContrapose({ type, shopId: this.shopId,status:0,delStatus:0});
|
|
|
},
|
|
|
onShow(){
|
|
|
},
|
|
|
@@ -136,7 +84,6 @@ export default {
|
|
|
affirm(val) {
|
|
|
if (val.index === 0) {
|
|
|
this.modalCancel();
|
|
|
- } else {
|
|
|
}
|
|
|
},
|
|
|
change(e) {
|
|
|
@@ -147,14 +94,8 @@ export default {
|
|
|
title: "加载中"
|
|
|
});
|
|
|
this.tabIndex = e.index;
|
|
|
- this.tabs[this.tabIndex].key;
|
|
|
- let type = this.tabs[this.tabIndex].key == STOCK_TYPE.WARN ? "waring" : "";
|
|
|
- if(type=="waring"){
|
|
|
- this.filterProductInfoContrapose = this.allFilterProductInfoContrapose;
|
|
|
- uni.hideLoading();
|
|
|
- }else{
|
|
|
- this.initData({ type, shopId: this.shopId,status:0});
|
|
|
- }
|
|
|
+ this.filterProductInfoContrapose = this.allFilterProductInfoContrapose;
|
|
|
+ uni.hideLoading();
|
|
|
}
|
|
|
},
|
|
|
scrollTop() {},
|
|
|
@@ -168,13 +109,9 @@ export default {
|
|
|
title: "加载中"
|
|
|
});
|
|
|
this.initProductInfo();
|
|
|
- let type = this.tabs[this.tabIndex].key == STOCK_TYPE.WARN ? "waring" : "";
|
|
|
+ let type = "waring";
|
|
|
this.shopId = val.selectItem.id;
|
|
|
- if(type=="waring"){
|
|
|
- this.initDataContrapose({ type, shopId: this.shopId,status:0,delStatus:0});
|
|
|
- }else{
|
|
|
- this.initData({ type, shopId: this.shopId,status:0});
|
|
|
- }
|
|
|
+ this.initDataContrapose({ type, shopId: this.shopId,status:0,delStatus:0});
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
@@ -264,7 +201,7 @@ export default {
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
.item_list_bx {
|
|
|
- padding: 40px 16px;
|
|
|
+ padding: 10px 40px;
|
|
|
}
|
|
|
.item_list_title {
|
|
|
margin-bottom: 20px;
|