修复BUG

This commit is contained in:
qijq 2025-08-06 10:11:54 +08:00
parent 73d79e54a9
commit 018f84a808
9 changed files with 494 additions and 295 deletions

View File

@ -16,6 +16,7 @@
}}前送达
</view>
<u-icon
v-if="currOrderItem.sf_order_info.feed && !isErrorOrder"
class="icon"
name="arrow-right"
color="#000"
@ -434,20 +435,25 @@
closeable
@close="showSfFlowPopup = false"
>
<!-- <view class="SfFlow-popup-content">
<view class="SfFlow-popup-title">顺丰轨迹</view>
<view class="SfFlow-popup-content">
<view class="SfFlow-popup-title">同城轨迹</view>
<view class="SfFlow-content">
<u-steps current="0" direction="column">
<u-steps
:current="
currOrderItem.sf_order_info.feed
? currOrderItem.sf_order_info.feed.length
: 0
"
direction="column"
>
<u-steps-item
title="已下单"
desc="10:30"
v-for="(item, index) of sf_order_info.feed"
v-for="(item, index) of currOrderItem.sf_order_info.feed"
:title="item.content"
:desc="item.create_time"
></u-steps-item>
<u-steps-item title="" desc="10:35"></u-steps-item>
<u-steps-item title="运输中" desc="11:40"></u-steps-item>
</u-steps>
</view>
</view> -->
</view>
</u-popup>
<u-toast ref="uToast"></u-toast>
</view>
@ -549,6 +555,9 @@ export default {
showOrderPickingPopup: false,
currOrderItem: {
order_items: [],
sf_order_info: {
feed: null,
},
},
isRefreshing: false,
refreshInterval: null, //
@ -574,6 +583,13 @@ export default {
},
created() {
this.currOrderItem = JSON.parse(JSON.stringify(this.orderItem));
if (this.currOrderItem.sf_order_info.feed) {
this.currOrderItem.sf_order_info.feed = JSON.parse(
this.currOrderItem.sf_order_info.feed
);
console.log("有值feed", this.currOrderItem.sf_order_info);
}
},
mounted() {
// 1

View File

@ -19,7 +19,9 @@
@click="pageBack()"
></u-icon>
</block>
<block slot="right" v-if="!isAdd">删除</block>
<block slot="right" v-if="!isAdd">
<text @click="delectCommodity">删除</text>
</block>
</navBar>
<view class="addAndEditProduct-content">
<u--form
@ -316,9 +318,9 @@
</view>
<u-popup
class="right-popup"
zIndex="998"
zIndex="1200"
:overlay="false"
:show="showRightPopup"
:show="showRightPecificationOfGoodPopup"
mode="right"
>
<specificationOfGood
@ -327,7 +329,7 @@
:productInfoByPid="productInfoByPid"
:typeId="typeId"
@handerSpecificationInfoList="handerSpecificationInfoList"
@pageBack="showRightPopup = false"
@pageBack="showRightPecificationOfGoodPopup = false"
:isAdd="isAdd"
></specificationOfGood>
</u-popup>
@ -364,6 +366,39 @@
</view>
</view>
</u-popup>
<u-popup
class="affirm-popup"
zIndex="10077"
:show="showDelectPopup"
mode="center"
>
<view class="affirm-popup-content">
<view class="affirm-popup-title">确认删除</view>
<view class="affirm-popup-tips">
确定删除{{ productItem.product_name }}这个商品
</view>
<view class="popup-btn-list">
<u-button
class="btn-item"
:hairline="true"
:plain="true"
shape="circle"
@click="showDelectPopup = false"
>
取消
</u-button>
<u-button
class="btn-item btn-item-2"
:hairline="true"
:plain="true"
shape="circle"
@click="handerDelectCommodity"
>
删除
</u-button>
</view>
</view>
</u-popup>
<tki-tree
ref="tkitree"
:range="baTreePickerList"
@ -403,6 +438,7 @@ import {
GetClassifyInfo,
GetCommoditSpecificationBaseInfo,
} from "@/api/warehouse/commodity";
import { DelectCommodity } from "@/api/warehouse/productList";
import tkiTree from "./components/tree/tree";
import specificationOfGood from "./specificationOfGood.vue";
import store from "../../../store";
@ -534,7 +570,7 @@ export default {
showSaleTime: false,
productSaleTime: Number(new Date()),
baTreePickerList: [],
showRightPopup: false,
showRightPecificationOfGoodPopup: false,
commoditSpecificationBaseInfo: {},
selectCommodisItems: [],
typeId: 0,
@ -549,6 +585,8 @@ export default {
shop_product_index: {},
shop_product_info: {},
},
showDelectPopup: false,
cheboxList: [],
};
},
computed: {
@ -662,6 +700,20 @@ export default {
}
this.loadingClassIfy = false;
},
delectCommodity() {
this.showDelectPopup = true;
},
async handerDelectCommodity() {
let params = {
product_ids: this.productItem.product_id.toString(),
};
let res = await DelectCommodity(params);
if (res && res.status == 200) {
uni.$u.toast("删除成功");
this.handerPageBack();
}
},
async getCommoditSpecification() {
let params = {
product_id: this.productItem.product_id,
@ -672,16 +724,16 @@ export default {
this.selectCommodisItems = res.data;
// 1.
let productSpec = this.productInfoByPid.shop_product_info.product_spec;
this.productSpec = this.productInfoByPid.shop_product_info.product_spec;
try {
productSpec = JSON.parse(productSpec);
if (!Array.isArray(productSpec)) {
productSpec = [productSpec]; //
this.productSpec = JSON.parse(this.productSpec);
if (!Array.isArray(this.productSpec)) {
this.productSpec = [this.productSpec]; //
}
// 2. {itemId: }
const specItemMap = [];
productSpec.forEach((specGroup) => {
this.productSpec.forEach((specGroup) => {
if (specGroup.item && Array.isArray(specGroup.item)) {
specGroup.item.forEach((item) => {
specItemMap.push(item.id);
@ -797,7 +849,7 @@ export default {
return;
}
this.showRightPopup = true;
this.showRightPecificationOfGoodPopup = true;
},
treeConfirm(list) {
if (list.length > 1) {
@ -819,9 +871,9 @@ export default {
treeCancel() {
this.$refs.tkitree._hide();
},
handerSpecificationInfoList(specificationInfoList) {
handerSpecificationInfoList(specificationInfoList, cheboxList) {
this.specificationInfoList = specificationInfoList;
this.cheboxList = cheboxList;
console.log(this.specificationInfoList);
},
handerAddAndEditPopup() {
@ -838,7 +890,7 @@ export default {
if (this.specificationInfoList.length <= 0) {
this.$refs.uToast.show({
message: "请选择选择规格",
message: "请选择填写售卖规格信息",
type: "error",
duration: 1000,
});
@ -851,7 +903,7 @@ export default {
const key2 = String(item.spec_id) + "_" + String(item.spec_item_id);
const color_img = this.viceImg.map((item) => item.url);
const mainMColorimg = this.primaryImg.map((item) => item.url);
let obj = {
var obj = {
color_img: color_img,
item_is_default: item.item_is_default,
item_market_price:
@ -861,21 +913,22 @@ export default {
item_unit_points: "0", //
item_unit_price: item.item_unit_price_2 || item.item_unit_price,
main_color_img: mainMColorimg.toString(),
product_spec:
item.spec_item_id > 0
? JSON.stringify([
};
if (this.cheboxList.length > 0 || this.productSpec.length > 0) {
obj.product_spec = JSON.stringify([
{
id: item.spec_id,
name: this.commoditSpecificationBaseInfo.specs[0]
.spec_name,
name: this.commoditSpecificationBaseInfo.specs[0].spec_name,
item: {
id: item.spec_item_id,
name: item.spec_item_name,
},
},
])
: "[]",
};
]);
} else {
obj.product_spec = "[]";
}
if (this.isAdd) {
obj.category_id = this.form.category_id;
@ -911,7 +964,10 @@ export default {
return obj;
});
const productSpec = this.specificationInfoList.reduce((acc, item) => {
var productSpec = this.productSpec;
if (this.cheboxList.length > 0 || productSpec.length > 0) {
productSpec = this.specificationInfoList.reduce((acc, item) => {
const existingSpec = acc.find((spec) => spec.id === item.spec_id);
if (existingSpec) {
@ -922,6 +978,7 @@ export default {
} else {
acc.push({
id: item.spec_id,
name: this.commoditSpecificationBaseInfo.specs[0].spec_name,
item: [
{
id: item.spec_item_id,
@ -933,6 +990,7 @@ export default {
return acc;
}, []);
}
console.log(this.form.product_param);

View File

@ -158,7 +158,7 @@
<scroll-view
v-if="commodityList.length > 0 && !loadingCommodityData"
scroll-y
:style="{ height: height - 230 + 'px' }"
:style="{ height: height - 180 + 'px' }"
:show-scrollbar="false"
@scrolltolower="handerScrolltolower"
refresher-enabled
@ -186,7 +186,6 @@
:name="item.product_id"
iconSize="14"
size="14"
></u-checkbox>
<view class="commodity-info">
<view
@ -239,7 +238,6 @@
:name="item.product_id"
iconSize="14"
size="14"
></u-checkbox>
<view class="commodity-info">
<view
@ -292,7 +290,10 @@
</view>
<view
class="productList-bottom"
:class="['productList-bottom-2', { 'productList-bottom-2': selectCommodityList.length > 0 }]"
:class="[
'productList-bottom-2',
{ 'productList-bottom-2': selectCommodityList.length > 0 },
]"
>
<view class="commodity-btn-content">
<view
@ -302,7 +303,8 @@
shape="circle"
@click="updateProductPutaway(1001)"
>
<u-icon name="arrow-upward" color="#666" size="14"></u-icon>
<u-icon name="arrow-upward" color="#666" size="14"></u-icon>
上架
</view>
<view
class="commodity-btn-item"
@ -311,7 +313,8 @@
shape="circle"
@click="updateProductPutaway(1002)"
>
<u-icon name="arrow-downward" color="#666" size="14"></u-icon>
<u-icon name="arrow-downward" color="#666" size="14"></u-icon>
下架
</view>
<view
class="commodity-btn-item commodity-btn-item-2"
@ -320,11 +323,14 @@
shape="circle"
@click="delectCommodity"
>
<u-icon name="trash" color="#666" size="14"></u-icon>
<u-icon name="trash" color="#666" size="14"></u-icon>
删除
</view>
</view>
<view class="product-tips">
共选择 <text>{{ selectCommodityList.length }}</text>/100
共选择
<text>{{ selectCommodityList.length }}</text>
/100
<text class="product-tips-check" @click="showPopup = true">
查看
<u-icon class="icon-up" size="8" name="arrow-up"></u-icon>
@ -376,7 +382,6 @@
}"
>
<view class="commodity-list">
<view
class="commodity-item"
v-for="(item, index) of selectCommodityList"
@ -896,7 +901,7 @@ export default {
return item;
});
await this.updateCommodityStatistics();
await this.getProductList();
this.clearCheckboxLists(this.tabbar);
this.selectCommodityList = [];
@ -1367,7 +1372,7 @@ export default {
<style lang="scss" scoped>
@import "@/styles/variables.scss";
page{
page {
background: #f5f6fa;
}
@ -1457,7 +1462,7 @@ page{
word-break: break-all;
}
::v-deep .tui-icon-arrow{
::v-deep .tui-icon-arrow {
left: 8rpx;
}
.active {
@ -1479,7 +1484,7 @@ page{
.active::before {
content: "";
position: absolute;
border-left: 4rpx solid #FE411B;
border-left: 4rpx solid #fe411b;
height: 30rpx;
left: 0;
top: 50%;
@ -1655,7 +1660,7 @@ page{
padding-left: 24rpx;
}
.checkbox-all-name{
.checkbox-all-name {
font-size: 28rpx;
}
@ -1665,6 +1670,7 @@ page{
.commodity-item {
display: flex;
align-items: center;
margin-bottom: 24rpx;
width: 100%;
.commodity-checkbox {
@ -1725,7 +1731,7 @@ page{
.commodity-price {
font-size: 28rpx;
color: #FE411B;
color: #fe411b;
.currency {
margin-right: 4px;
@ -1766,7 +1772,7 @@ page{
display: flex;
align-items: center;
justify-content: space-between;
.commodity-btn-item {
.commodity-btn-item {
display: flex;
align-items: center;
justify-content: center;
@ -1780,11 +1786,10 @@ page{
line-height: 1;
}
.commodity-btn-item-2 {
color: $base-color;
border-color: $base-color;
::v-deep .u-icon__icon{
::v-deep .u-icon__icon {
color: $base-color !important;
}
}
@ -1792,7 +1797,7 @@ page{
.product-tips {
font-size: 24rpx;
color: #666;
text{
text {
color: $base-color;
}
@ -1814,7 +1819,7 @@ page{
}
}
.commodity-btn-content{
.commodity-btn-content {
display: flex;
align-items: center;
justify-content: center;
@ -1825,7 +1830,7 @@ page{
align-items: center;
justify-content: center;
.bottom-item-name{
.bottom-item-name {
font-size: 28rpx;
color: #222;
}
@ -1953,7 +1958,7 @@ page{
.commodity-price {
font-size: 28rpx;
color: #FE411B;
color: #fe411b;
.currency {
margin-right: 4px;

View File

@ -44,10 +44,10 @@
</view>
<view
class="classify-btn-content"
@click.stop="handerSetting($event, item)"
@click.stop="handerSetting($event, item, false)"
>
<view class="classify-btn-item">
<u-icon name="edit-pen" size="16"> </u-icon>
<u-icon name="edit-pen" size="16"></u-icon>
设置
</view>
</view>
@ -57,7 +57,6 @@
<view
class="second-level-item"
v-for="(group, index2) of item.sub"
@click="handerCollApseChildren(group)"
>
<view
class="second-level-item-info"
@ -75,8 +74,11 @@
</view>
</view>
<view class="classify-btn-content">
<view class="classify-btn-item">
<u-icon name="edit-pen" size="16"> </u-icon>
<view
class="classify-btn-item"
@click.stop="handerSetting($event, item, true)"
>
<u-icon name="edit-pen" size="16"></u-icon>
设置
</view>
</view>
@ -137,7 +139,11 @@
已有商品类型无法修改
</view>
</view>
<view class="stair-bottom-item" @click="handerShowRightAddSecondLevel">
<view
class="stair-bottom-item"
@click="handerShowRightAddSecondLevel"
v-if="!isSubclassification"
>
新增二级分类
</view>
<view
@ -292,11 +298,11 @@
<text class="u-loadmore-tips">正在加载...</text>
</view>
</block>
<!-- <block v-else>
<block v-else>
<view class="u-loadmore u-loadmore-line">
<text class="u-loadmore-tips">没有更多商品类型了 ~</text>
</view>
</block> -->
</block>
</view>
</scroll-view>
<view class="popup-btn-list">
@ -335,7 +341,8 @@
:closable="true"
fontSize="12"
title="注意,确认商品类型后不可修改名称,商品类型,虚拟商品!"
type="warning" :show-icon="true"
type="warning"
:show-icon="true"
></u-alert>
<u--form
labelPosition="left"
@ -356,7 +363,7 @@
count
autoHeight
maxlength="8"
placeholder="请输入二级分类名称"
placeholder="请输入分类名称"
></u--textarea>
</u-form-item>
<u-form-item
@ -404,7 +411,7 @@
:hairline="true"
:plain="true"
shape="circle"
@click="showAddStairClassifyPopup = false"
@click="handerCancelEditPopup"
>
取消
</u-button>
@ -454,11 +461,13 @@ import {
import { GetTypeManageList } from "@/api/warehouse/typeManage";
import tuiCollapse from "../manage/components/tui-collapse/classify-collapse.vue";
import editClassify from "../manage/editClassify.vue";
import favoriteLoading from "@/components/favorite-loading/favorite-loading.vue";
export default {
name: "classifyList",
components: {
tuiCollapse,
editClassify,
favoriteLoading,
},
data() {
return {
@ -517,6 +526,7 @@ export default {
},
],
},
isSubclassification: false,
};
},
computed: {},
@ -569,6 +579,7 @@ export default {
if (this.typeManageList.length <= 0) {
this.isNotypeManageData = true;
return;
}
}
this.loadingDownTypeManageData = false;
@ -610,10 +621,11 @@ export default {
handerCollApse(e, item, isStair) {
this.current = this.current == e.index ? -1 : e.index;
},
handerSetting(event, item) {
handerSetting(event, item, isSubclassification) {
event.stopPropagation();
this.currStairItem = item;
this.showBottomStairPopup = true;
this.isSubclassification = isSubclassification;
},
handerCloseTypePopup() {
this.showCommodityTypePopup = false;
@ -634,6 +646,11 @@ export default {
this.showBottomStairPopup = false;
this.showRightPopup = true;
},
handerCancelEditPopup() {
this.loadingDownTypeManageData = false;
this.isNoDownTypeManageData = false;
this.showAddStairClassifyPopup = false;
},
hadnerShowCommodityTypePopup() {
this.showCommodityTypePopup = true;
},

View File

@ -24,6 +24,7 @@
placeholder="搜索你想要的商品"
:showAction="false"
bgColor="#fff"
@focus.native.stop="handleNoFocus"
:disabled="true"
@click="skipuSearch"
></u-search>
@ -306,7 +307,7 @@
mode="right"
>
<addAndEditProduct
@pageBack="showRightPopup = false"
@pageBack="handerAddAndEditProductPageBanck"
:productItem="productItem"
:isAdd="isAdd"
></addAndEditProduct>
@ -453,6 +454,11 @@ export default {
this.scrollViewId = `id_0`;
}
},
handleNoFocus() {
e.target.blur(); //
//
e.preventDefault();
},
handerClosePopup() {
this.showBottomPopup = false;
},
@ -465,10 +471,15 @@ export default {
if (res && res.status == 200) {
this.selectCommodisItems = res.data;
console.log(item.product_spec);
// 1.
let productSpec = JSON.parse(JSON.stringify(item.product_spec));
if (productSpec.length > 0) {
if (!Array.isArray(productSpec)) {
productSpec = JSON.parse(productSpec);
}
if (productSpec.length > 0) {
if (!Array.isArray(productSpec)) {
productSpec = [productSpec]; //
}
@ -633,23 +644,7 @@ export default {
openCount: true,
};
let result = await GetProductList(params);
if (result && result.status == 200) {
var {
allRecords,
normalRecords,
offRecords,
illegalRecords,
unCheckedRecords,
} = result.data;
this.commodityStatusList[0].badge.value = allRecords;
this.commodityStatusList[1].badge.value = normalRecords;
this.commodityStatusList[2].badge.value = offRecords;
this.commodityStatusList[3].badge.value = illegalRecords;
this.commodityStatusList[4].badge.value = unCheckedRecords;
}
this.getProductList();
}
}, 500);
},
@ -718,6 +713,10 @@ export default {
this.getProductList();
}
},
handerAddAndEditProductPageBanck() {
this.showRightPopup = false;
this.getProductList();
},
detail(e) {
uni.navigateTo({
url: "../productDetail/productDetail",
@ -850,6 +849,19 @@ page {
padding-left: 16rpx;
}
.search {
::v-deep.u-search__content__input {
outline: none !important;
box-shadow: none !important;
border-color: transparent !important;
background-color: transparent !important;
}
::v-deep.uni-input-form {
display: none;
}
}
.tab-view {
/* height: 100%; */
width: 210rpx;

View File

@ -394,6 +394,11 @@ export default {
this.showBottomPopup = false;
},
handerSearch(e) {
if (!this.inputSearch) {
this.commodityList = [];
return;
}
clearTimeout(this.time3);
this.time3 = setTimeout(() => {
this.getProductList();
@ -410,8 +415,11 @@ export default {
// 1.
let productSpec = JSON.parse(JSON.stringify(item.product_spec));
if (productSpec.length > 0) {
if (!Array.isArray(productSpec)) {
productSpec = JSON.parse(productSpec);
}
if (productSpec.length > 0) {
if (!Array.isArray(productSpec)) {
productSpec = [productSpec]; //
}
@ -561,32 +569,7 @@ export default {
this.commodityList[index].product_state_id = type;
let params = {
kind_id: "1201,1202,1203",
pageNum: this.pageNum,
pageSize: this.pageSize,
product_state_id: this.currProductStateId,
category_id: this.currCategoryId,
openCount: true,
};
let result = await GetProductList(params);
if (result && result.status == 200) {
var {
allRecords,
normalRecords,
offRecords,
illegalRecords,
unCheckedRecords,
} = result.data;
this.commodityStatusList[0].badge.value = allRecords;
this.commodityStatusList[1].badge.value = normalRecords;
this.commodityStatusList[2].badge.value = offRecords;
this.commodityStatusList[3].badge.value = illegalRecords;
this.commodityStatusList[4].badge.value = unCheckedRecords;
}
this.getProductList();
}
}, 500);
},
@ -605,7 +588,6 @@ export default {
this.isNoDownCommodityData = false;
this.isNoCommodityData = false;
this.currProductStateId = e.value;
this.commodityList = [];
this.getProductList();
},
handerCollApse(e) {

View File

@ -1,5 +1,16 @@
<template>
<view class="specification-container">
<u-search
class="u-search"
:showAction="true"
actionText="搜索"
:animation="true"
placeholder="请输入订单号搜索"
bgColor="#fff"
v-model="inputKeyword"
@custom="handerSearch"
@input="handerInputSearch"
></u-search>
<view class="specification-content">
<favorite-loading
class="specification-loading"
@ -274,6 +285,7 @@ export default {
loadingDownSpecificationData: false,
isNoDownSpecificationData: false,
time: null,
inputKeyword: "",
};
},
computed: {},
@ -322,6 +334,10 @@ export default {
pageSize: this.pageSize,
};
if (this.inputKeyword) {
params.spec_name = this.inputKeyword;
}
let res = await GetSpecificationList(params);
if (res && res.status == 200) {
if (this.loadingDownSpecificationData) {
@ -346,6 +362,17 @@ export default {
this.isRefreshing = false;
this.loadingDownSpecificationData = false;
},
handerInputSearch() {
if (this.inputKeyword.length == 0) {
this.getSpecificationList();
}
},
handerSearch() {
if (this.inputKeyword) {
this.pageNum = 1;
this.getSpecificationList();
}
},
handerScrolltolower() {
clearTimeout(this.time);
if (this.isNoDownTypeManageData) return;
@ -509,10 +536,16 @@ export default {
<style lang="scss" scoped>
@import "@/styles/variables.scss";
.specification-container {
overflow: hidden;
.u-search {
margin: 40rpx 40rpx 20rpx !important;
}
.specification-scroll {
-ms-overflow-style: none; /* IE和Edge */
scrollbar-width: none; /* Firefox */
height: calc(100vh - 300rpx);
height: calc(100vh - 384rpx);
}
.specification-loading {

View File

@ -710,7 +710,7 @@ export default {
type: "error",
duration: 1000,
});
this.isVerify = false;
isVerify = false;
break;
}
@ -720,7 +720,7 @@ export default {
type: "error",
duration: 1000,
});
this.isVerify = false;
isVerify = false;
break;
}
@ -730,7 +730,7 @@ export default {
type: "error",
duration: 1000,
});
this.isVerify = false;
isVerify = false;
break;
}
}
@ -744,7 +744,7 @@ export default {
type: "error",
duration: 1000,
});
this.isVerify = false;
isVerify = false;
break;
}
@ -754,7 +754,7 @@ export default {
type: "error",
duration: 1000,
});
this.isVerify = false;
isVerify = false;
break;
}
@ -764,7 +764,7 @@ export default {
type: "error",
duration: 1000,
});
this.isVerify = false;
isVerify = false;
break;
}
@ -774,7 +774,7 @@ export default {
type: "error",
duration: 1000,
});
this.isVerify = false;
isVerify = false;
break;
}
}
@ -782,7 +782,11 @@ export default {
if (!isVerify) return;
this.$emit("handerSpecificationInfoList", this.specificationInfoList);
this.$emit(
"handerSpecificationInfoList",
this.specificationInfoList,
this.checkboxValue
);
this.pageBack(true);
},
},

View File

@ -1,12 +1,33 @@
<template>
<view class="typeManagement-container">
<u-search
class="u-search"
:showAction="true"
actionText="搜索"
:animation="true"
placeholder="请输入订单号搜索"
bgColor="#fff"
v-model="inputKeyword"
@custom="handerSearch"
@input="handerInputSearch"
></u-search>
<view class="typeManagement-content">
<view class="no-commodity-type" v-if="typeManageList.length <= 0">
<favorite-loading
class="favorite-loading"
v-show="loading"
:color="'#fe4119'"
text=""
animation="spinner15"
></favorite-loading>
<view
class="no-commodity-type"
v-if="typeManageList.length <= 0 && !loading"
>
<view class="no-commodity-type-bg"></view>
<view class="no-commodity-type-tips">暂无商品类型</view>
</view>
<scroll-view
v-if="typeManageList.length > 0"
v-if="typeManageList.length > 0 && !loading"
scroll-y
class="typeManagement-scroll"
:show-scrollbar="false"
@ -54,7 +75,6 @@
</view>
</view>
</view>
<view
class="m-loading-box"
v-if="typeManageList.length > 0 && !isNotypeManageData"
@ -315,10 +335,12 @@ import {
} from "@/api/warehouse/typeManage";
import { GetProductCategoryTree } from "@/api/warehouse/productList";
import tkiTree from "./components/tree/tree";
import favoriteLoading from "@/components/favorite-loading/favorite-loading.vue";
export default {
name: "typeManagement",
components: {
tkiTree,
favoriteLoading,
},
data() {
return {
@ -341,6 +363,7 @@ export default {
checkboxList: [],
specsCheckboxList: [],
currDelectItem: {},
time: null,
form: {
type_name: "",
type_category_id: "",
@ -371,6 +394,7 @@ export default {
},
],
},
inputKeyword: "",
};
},
computed: {},
@ -410,6 +434,26 @@ export default {
console.log(this.allSpecificationList);
}
},
handerScrolltolower() {
clearTimeout(this.time);
if (this.isNoDownTypeManageData) return;
this.loadingDownTypeManageData = true;
this.pageNum = this.pageNum + 1;
this.time = setTimeout(() => {
this.getTypeManageList();
}, 500);
},
handerInputSearch() {
if (this.inputKeyword.length == 0) {
this.getTypeManageList();
}
},
handerSearch() {
if (this.inputKeyword) {
this.pageNum = 1;
this.getTypeManageList();
}
},
findLabelInClassifyList(classifyList, targetId) {
for (const category of classifyList) {
if (category.id === targetId) {
@ -493,9 +537,14 @@ export default {
return item;
});
},
handleRefresh() {
this.isRefreshing = true;
this.pageNum = 1;
this.getTypeManageList();
},
async getTypeManageList() {
if (!this.loadingDownTypeManageData) {
this.loding = true;
this.loading = true;
}
if (this.isRefreshing) {
@ -509,6 +558,10 @@ export default {
pageSize: this.pageSize,
};
if (this.inputKeyword) {
params.type_name = this.inputKeyword;
}
let res = await GetTypeManageList(params);
if (res && res.status == 200) {
if (this.loadingDownTypeManageData) {
@ -525,6 +578,9 @@ export default {
if (this.typeManageList.length <= 0) {
this.isNotypeManageData = true;
this.isRefreshing = false;
this.loading = false;
return;
}
if (this.typeManageList.length > 0) {
@ -537,6 +593,7 @@ export default {
});
}
}
this.loading = false;
this.loadingDownTypeManageData = false;
this.isRefreshing = false;
},
@ -680,6 +737,12 @@ export default {
@import "@/styles/variables.scss";
.typeManagement-container {
overflow: hidden;
.u-search {
margin: 40rpx 40rpx 20rpx !important;
}
.tab-hander {
display: flex;
justify-content: space-around;
@ -694,6 +757,15 @@ export default {
font-size: 28rpx;
}
.typeManagement-scroll {
height: calc(100vh - 170px);
}
.favorite-loading {
margin: 70% auto;
display: flex;
}
.typeManagement_list {
margin: 24rpx;
padding: 24rpx;