shish 2 лет назад
Родитель
Сommit
878cab12e2

+ 1 - 1
ghsApp/src/admin/billing/index2.vue

@@ -26,9 +26,9 @@
 				<!--花材列表-->
 				<block v-if="!$util.isEmpty(globalItemData)">
 					<view class="item_list_bx selectAll">
-						<view class="item_list_title"></view>
 						<view v-if="!$util.isEmpty(globalItemData)">
 							<template v-for="(productItem, productIndex) in globalItemData">
+								<view class="item_list_title" v-if="productItem.className && productItem.className!=''">{{ productItem.className }}</view>
 								<view style="height: 175upx" :key="productIndex">
 									<Commondity
 										:globalCheckStock="true"

+ 1 - 1
ghsApp/src/admin/breakage/index.vue

@@ -26,8 +26,8 @@
 			:scroll-top="globalScrollTopPlace" @scroll="globalGetScroll" lower-threshold="100" @scrolltolower="globalScrollBottom">
 				<block v-if="!$util.isEmpty(globalItemData)">
 					<view class="item_list_bx selectAll">
-						<view class="item_list_title"></view>
 						<template v-for="(productItem, productIndex) in globalItemData">
+							<view class="item_list_title" v-if="productItem.className && productItem.className!=''">{{ productItem.className }}</view>
 							<view style="height: 175upx" :key="productIndex">
 								<Commondity
 									:checkStock="true"

+ 1 - 1
ghsApp/src/admin/changePrice/changeStock2.vue

@@ -25,9 +25,9 @@
 
 				<block v-if="!$util.isEmpty(globalItemData)">
 					<view class="item_list_bx selectAll">
-						<view class="item_list_title"></view>
 						<view v-if="!$util.isEmpty(globalItemData)">
 							<template v-for="(productItem, productIndex) in globalItemData">
+								<view class="item_list_title" v-if="productItem.className && productItem.className!=''">{{ productItem.className }}</view>
 								<view style="height:190upx" :key="productIndex">
 									<ItemComponent :isPrice="false" :info="productItem" @saveStock="saveStock" :ref="`productRef${productItem.id}`" 
 									@hideChangeFn="hideChangeFn" @cancelPreSellFn="cancelPreSellFn">

+ 1 - 2
ghsApp/src/admin/changePrice/list2.vue

@@ -29,11 +29,10 @@
 
 				<block v-if="!$util.isEmpty(globalItemData)">
 					<view class="item_list_bx selectAll">
-						<view class="item_list_title"></view>
-
 						<view v-if="!$util.isEmpty(globalItemData)">
 
 							<template v-for="(productItem, productIndex) in globalItemData">
+								<view class="item_list_title" v-if="productItem.className && productItem.className!=''">{{ productItem.className }}</view>
 								<view style="height:230upx" :key="productIndex">
 									<ItemComponent :isPrice="false" :info="productItem" @hideChangeFn="hideChangeFn" :ref="`productRef${productItem.id}`"
 									@savePrice="savePrice" @cancelDiscountFn="cancelDiscountFn" @cancelFullOff="cancelFullOff" @cancelPreSellFn="cancelPreSellFn"></ItemComponent>

+ 22 - 0
ghsApp/src/mixins/product2.js

@@ -31,6 +31,7 @@ export default {
 			globalCustomId:0,
 			globalClassData:[],
 			globalClassId:0,
+			globalClassDataIndex:[],
 			globalFinishGetItem:0,
 			globalPage:1,
 			globalPy:'',
@@ -142,6 +143,7 @@ export default {
 			getMenu().then(res=>{
 				if(res.code == 1){
 					that.globalClassData = res.data.class ? res.data.class : []
+					that.globalClassDataIndex = res.data.classIndex ? res.data.classIndex : []
 					if(that.globalClassData[0]){
 						that.globalClassId = that.globalClassData[0].id
 						//保存到仓库
@@ -178,6 +180,13 @@ export default {
 				}
 			})
         },
+		sorts_fun(arr) {
+			return function(a, b) {
+				var v1 = a[arr];
+				var v2 = b[arr];
+				return v1 - v2;
+			}
+		},
 		globalRememberRefresh(){
 			let that = this
 			if(that.$util.isEmpty(that.globalItemData)){
@@ -191,9 +200,13 @@ export default {
 			}
 			//修改数据需要复制一份,否则不会生效
 			that.globalItemData = copyObject(that.globalItemData);
+
+			that.globalItemData = that.globalItemData.sort(this.sorts_fun('classId'))
+			let hasExists = []
 			for (let i=0;i<that.globalItemData.length;i++){
 				let currentProduct = that.globalItemData[i]
 				let currentPId = currentProduct.id
+				let currentClassId = currentProduct.classId||0
 				let selectProduct = selectListData[currentPId] || []
 				if(!that.$util.isEmpty(selectProduct)){
 					that.globalItemData[i].bigCount = selectProduct.bigCount || 0
@@ -204,6 +217,15 @@ export default {
 					that.globalItemData[i].userPrice = 0
 					that.globalItemData[i].smallCount = 0
 				}
+				let cName = ''
+				if(hasExists[currentClassId]){
+					//无操作
+				}else{
+					let currentClass = this.globalClassDataIndex[currentClassId] ? this.globalClassDataIndex[currentClassId] : null
+					cName = currentClass.name ? currentClass.name : ''
+					hasExists[currentClassId] = 1
+				}
+				that.globalItemData[i].className = cName
 			}
 		},
 		globalSwitchClass(cur,item) {

+ 1 - 1
ghsApp/src/pagesPurchase/add.vue

@@ -26,8 +26,8 @@
 			 lower-threshold="100" @scrolltolower="globalScrollBottom">
 				<block v-if="!$util.isEmpty(globalItemData)">
 					<view class="item_list_bx selectAll">
-						<view class="item_list_title"></view>
 						<template v-for="(productItem, productIndex) in globalItemData">
+							<view class="item_list_title" v-if="productItem.className && productItem.className!=''">{{ productItem.className }}</view>
 							<view style="height:240upx" :key="productIndex">
 							<CommodityPurchase
 								:type="selectJobType"

+ 1 - 1
ghsApp/src/pagesStorehouse/allot/exSelect.vue

@@ -23,9 +23,9 @@
 				:scroll-top="globalScrollTopPlace" @scroll="globalGetScroll" lower-threshold="100" @scrolltolower="globalScrollBottom">
 				<block v-if="!$util.isEmpty(globalItemData)">
 					<view class="item_list_bx selectAll">
-						<view class="item_list_title"></view>
 						<view v-if="!$util.isEmpty(globalItemData)">
 							<template v-for="(productItem, productIndex) in globalItemData">
+								<view class="item_list_title" v-if="productItem.className && productItem.className!=''">{{ productItem.className }}</view>
 								<view style="height: 175upx" :key="productIndex">
 								<Commondity
 									:key="productIndex"

+ 1 - 1
ghsApp/src/pagesStorehouse/inventory/select2.vue

@@ -27,9 +27,9 @@
 				<!--内容部分 start -->
 				<block v-if="!$util.isEmpty(globalItemData)">
 					<view class="item_list_bx selectAll">
-						<view class="item_list_title"></view>
 						<view v-if="!$util.isEmpty(globalItemData)">
 							<template v-for="(productItem, productIndex) in globalItemData">
+								<view class="item_list_title" v-if="productItem.className && productItem.className!=''">{{ productItem.className }}</view>
 								<view style="height:175upx" :key="productIndex">
 								<Commondity
 									:key="productIndex"