shish 1 год назад
Родитель
Сommit
c5a6b7f205

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

@@ -8,7 +8,7 @@
 			<view class="search-bar">
 				<app-search-module ref="globalSearchRef" v-model="globalPy" placeholder="这里搜索" @input="globalSearch" />
 			</view>
-			<view style="float:right">
+			<view style="float:right;margin-left:10upx;">
 				<button class="admin-button-com middle blue" @click="removeFromSave(0)">清除花材</button>
 			</view>
 		</view>
@@ -102,7 +102,7 @@ import ModalModule from "@/components/plugin/modal";
 import { COMMODITY_TYPE } from "@/utils/declare";
 import productMins from "@/mixins/product2";
 export default {
-	name: "breakageIndex",
+	name: "index",
 	components: {
 		AppTabs,
 		AppSearchModule,

+ 1 - 1
ghsApp/src/admin/cp/cpDetail.vue

@@ -358,7 +358,7 @@
     methods: {
       showChangeOnStock(item){
         let that = this
-        that.$util.confirmModal({content:'了解修改后的影响,确认要修改?'},() => {
+        that.$util.confirmModal({content:'确认了解修改后的影响,确认要修改?'},() => {
           this.onStockShow = true
           this.newOnStock = item.onStock
         })

+ 64 - 5
ghsApp/src/admin/item/detail.vue

@@ -16,7 +16,9 @@
       </block>
         <tui-list-cell class="line-cell" :hover="false" v-if="productData.id && productData.id>0">
           <view class="tui-title">编号</view>
-          <view style="color:#CCCCCC;width:300upx;" @click="getProductId(productData)">{{productData.itemId?productData.itemId:0}}</view>
+          <view style="color:#CCCCCC;width:300upx;" @click="getProductId(productData)">
+            {{productData.id?productData.id:0}}-{{productData.itemId?productData.itemId:0}}
+          </view>
           <button v-if="productData.id > 0" class="admin-button-com blue middle" @click="moreDo()">更多操作</button>
         </tui-list-cell>
         <tui-list-cell class="line-cell" :hover="false">
@@ -327,6 +329,7 @@
 		<uni-popup ref="rightShowMore" background-color="#fff" type="center" :animation="true" class="class-popup-style">
 			<view style="display:flex;width:100vw;padding:20upx 20upx 40upx 20upx;height:auto;justify-content: space-between;align-items:center;flex-wrap:wrap;max-height:100vh;overflow:auto;">
         <view style="width:100vw;margin-top:8upx;"><button @click="goWaste(productData)">报损</button></view>
+        <view style="width:100vw;margin-top:8upx;"><button @click="goPart(productData)">拆散</button></view>
 				<view style="width:100vw;margin-top:8upx;"><button @click="orderRecord(productData)">下单记录</button></view>
 				<view style="width:100vw;margin-top:8upx;"><button @click="copyCreate(productData)">复制新建</button></view>
 				<view style="width:100vw;margin-top:8upx;"><button @click="onStockChange(productData)">路上库存变动</button></view>
@@ -336,7 +339,7 @@
 			</view>
 		</uni-popup>
 
-    <modal-module :show="wasteShow" @click="wasteConfirm" :maskClosable="true" title="损数量" padding="30rpx 30rpx" >
+    <modal-module :show="wasteShow" @click="wasteConfirm" :maskClosable="true" title="损数量" padding="30rpx 30rpx" >
       <template v-slot:content>
         <view class="app-modal-input-wrap">
         <view class="inp-list-line">
@@ -345,6 +348,18 @@
           </view>
         </view>
       </view>
+      </template>
+		</modal-module>
+
+    <modal-module :show="partShow" @click="partConfirm" :maskClosable="true" title="拆散数量" padding="30rpx 30rpx" >
+      <template v-slot:content>
+        <view class="app-modal-input-wrap">
+        <view class="inp-list-line">
+          <view class="line-input">
+          <input type="number" ref="input" style="width:61.8%;text-align:center;" @blur="partBlur" :focus="partFocus" v-model="partNum" :adjust-position="false" class="inp-input" />
+          </view>
+        </view>
+      </view>
       </template>
 		</modal-module>
 
@@ -414,6 +429,7 @@ import { mapGetters } from "vuex"
 import htzImageUpload from '@/components/htz-image-upload/htz-image-upload.vue'
 import ModalModule from "@/components/plugin/modal"
 import { getAllStaff } from "@/api/shop-admin";
+import { partItem } from "@/api/part";
 export default {
   name: "item-detail",
   components: {
@@ -479,9 +495,13 @@ export default {
       printItemId:0,
       printNum:'',
       printLabelShow:false,
-      backCpInfo:{cpId:0,cpName:'',needUpdate:0},      wasteNum:'',
+      backCpInfo:{cpId:0,cpName:'',needUpdate:0},
+      wasteNum:'',
       wasteShow:false,
       wasteFocus:false,
+      partNum:'',
+      partShow:false,
+      partFocus:false,
       belongCost:0,
       staffData:[],
       modifyUnitType:'big'
@@ -607,7 +627,46 @@ export default {
 			this.closeMoreDoPop()
 			this.pageTo({url: '/pagesStorehouse/stockWarn/onStockChange?id='+info.id+'&name='+info.name})
 		},
-    goWaste(info){
+    goPart(){
+      this.closeMoreDoPop()
+      this.partShow = true
+      let that = this
+			setTimeout(x => {
+				this.$nextTick(() => {
+          that.partFocus = true
+        })
+			}, 300)
+    },
+    partBlur(){
+      this.partFocus = false
+    },
+    closePartPop(){
+      this.partShow = false
+      this.partFocus = false
+      this.partNum = ''    
+    },
+    partConfirm(val){
+			let that = this
+			if (val.index == 0) {
+        this.closePartPop()
+				return
+			}
+      if(Number(that.partNum)<0){
+        that.$msg('请填写数量')
+        return false
+      }
+      let product = [{ productId:that.productData.id,bigNum:that.partNum,smallNum:null,classId:0,itemId:that.productData.itemId,ratio:that.productData.ratio }]
+      that.$util.confirmModal({content:'确认拆散?'},() => {
+          partItem({product:JSON.stringify(product),remark:''}).then((res) => {
+            if(res.code == 1){
+              that.closePartPop()
+              that.hasRequest = 0
+              that.init()
+            }
+          })
+      })
+    },
+    goWaste(){
       this.closeMoreDoPop()
       this.wasteShow = true
       let that = this
@@ -728,7 +787,7 @@ export default {
     },
     showChangeOnStock(item){
       let that = this
-      that.$util.confirmModal({content:'了解修改后的影响,确认要修改?'},() => {
+      that.$util.confirmModal({content:'确认了解修改后的影响,确认要修改?'},() => {
         this.onStockShow = true
         this.newOnStock = item.onStock
       })

+ 111 - 66
ghsApp/src/admin/item/list2.vue

@@ -80,18 +80,6 @@
 			</template>
 		</modal-module>
 
-		<modal-module :show="breakShow" @click="breakConfirm" :maskClosable="true" title="拆散数量" padding="30rpx 30rpx" >
-		<template v-slot:content>
-			<div class="app-modal-input-wrap">
-			<div class="inp-list-line">
-				<div class="line-input">
-				<input type="number" ref="input" style="width:61.8%;text-align:center;" :focus="breakFocus" v-model="breakNum" :adjust-position="false" class="inp-input" />
-				</div>
-			</div>
-			</div>
-		</template>
-		</modal-module>
-
 		<uni-popup ref="globalClassImgRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
 			<view style="display:flex;padding:20upx;height:auto;justify-content: space-between;align-items:center;flex-wrap:wrap;max-height:100vh;overflow:auto;">
 				<view v-for="(item, index) in globalClassData" :key="index" @tap.stop="globalChangeClass(index,item)" style="margin-bottom:20upx;margin-left:3upx;">
@@ -128,9 +116,11 @@
 				<view style="width:100vw;margin-top:8upx;"><button @click="orderRecord()">下单记录</button></view>
 				<view style="width:100vw;margin-top:8upx;"><button @click="onStockChange()">路上库存变动</button></view>
 				<!-- <view style="width:100vw;margin-top:8upx;"><button @click="ptAuth()">申请平台认证</button></view> -->
+				<view style="width:100vw;margin-top:8upx;"><button @click="preSell()">预售</button></view>
+				<view style="width:100vw;margin-top:8upx;"><button @click="doWaste()">报损</button></view>
+				<view style="width:100vw;margin-top:8upx;"><button @click="doPart()">拆散</button></view>
 				<view style="width:100vw;margin-top:8upx;"><button @click="delItem()">删除</button></view>
 				<view style="width:100vw;margin-top:8upx;"><button @click="sendStock()">分配库存</button></view>
-				<view style="width:100vw;margin-top:8upx;"><button @click="preSell()">预售</button></view>
 				<view style="width:100vw;margin-top:30upx;"><button @click="closeRightShow()">取消</button></view>
 			</view>
 		</uni-popup>
@@ -147,6 +137,30 @@
 			</view>
 		</uni-popup>
 
+		<modal-module :show="wasteShow" @click="wasteConfirm" :maskClosable="true" title="报损数量" padding="30rpx 30rpx" >
+		<template v-slot:content>
+			<view class="app-modal-input-wrap">
+			<view class="inp-list-line">
+			<view class="line-input">
+			<input type="number" ref="input" style="width:61.8%;text-align:center;" @blur="wasteBlur" :focus="wasteFocus" v-model="wasteNum" :adjust-position="false" class="inp-input" />
+			</view>
+			</view>
+		</view>
+		</template>
+			</modal-module>
+
+		<modal-module :show="partShow" @click="partConfirm" :maskClosable="true" title="拆散数量" padding="30rpx 30rpx" >
+		<template v-slot:content>
+			<view class="app-modal-input-wrap">
+			<view class="inp-list-line">
+			<view class="line-input">
+			<input type="number" ref="input" style="width:61.8%;text-align:center;" @blur="partBlur" :focus="partFocus" v-model="partNum" :adjust-position="false" class="inp-input" />
+			</view>
+			</view>
+		</view>
+		</template>
+		</modal-module>
+
 	</view>
 </template>
 <script>
@@ -160,6 +174,8 @@ import { print,cancelDiscountPrice,cancelPreSell,delStatusUpdate,cancelFullOffFn
 import { getHdPoster,getSkPoster,breakItem,changeFrontHide,applyAuth,changeHalf,moveToLosing } from '@/api/item'
 import uniPopup from '@/uni_modules/uni-popup/components/uni-popup/uni-popup.vue';
 import ModalModule from "@/components/plugin/modal"
+import { partItem } from "@/api/part"
+import { wastage } from "@/api/order"
 export default {
 	name: "list",
 	components: {
@@ -188,10 +204,12 @@ export default {
 			warning:0,
 			currentInfo:{},
 			posterUrl:'',
-			breakNum:'',
-			breakFocus:false,
-			breakShow:false,
-			halfRemark:''
+			wasteNum:'',
+			wasteShow:false,
+			wasteFocus:false,
+			partNum:'',
+			partShow:false,
+			partFocus:false,
 		};
 	},
 	computed:{
@@ -206,6 +224,82 @@ export default {
 		})
 	},
 	methods: {
+		doPart(){
+			this.closeRightShow()
+			this.partShow = true
+			let that = this
+			setTimeout(x => {
+				this.$nextTick(() => {
+					that.partFocus = true
+				})
+			}, 300)
+		},
+		partBlur(){
+			this.partFocus = false
+		},
+		closePartPop(){
+			this.partShow = false
+			this.partFocus = false
+			this.partNum = ''    
+		},
+		partConfirm(val){
+			let that = this
+			if (val.index == 0) {
+				this.closePartPop()
+				return
+			}
+			if(Number(that.partNum)<0){
+				that.$msg('请填写数量')
+				return false
+			}
+			let product = [{ productId:this.currentInfo.id,bigNum:that.partNum,smallNum:null,classId:0,itemId:this.currentInfo.itemId,ratio:this.currentInfo.ratio }]
+			that.$util.confirmModal({content:'确认拆散?'},() => {
+				partItem({product:JSON.stringify(product),remark:''}).then((res) => {
+					if(res.code == 1){
+						that.closePartPop()
+						that.$msg('拆散成功')
+					}
+				})
+			})
+		},
+		doWaste(){
+			this.closeRightShow()
+			this.wasteShow = true
+			let that = this
+			setTimeout(x => {
+				this.$nextTick(() => {
+					that.wasteFocus = true
+				})
+			}, 300)
+		},
+		wasteBlur(){
+			this.wasteFocus = false
+		},
+		closeWastePop(){
+			this.wasteShow = false
+			this.wasteFocus = false
+			this.wasteNum = ''    
+		},
+		wasteConfirm(val){
+			let that = this
+			if (val.index == 0) {
+				this.closeWastePop()
+				return
+			}
+			if(Number(that.wasteNum)<0){
+				that.$msg('请填写数量')
+				return false
+			}
+			let product = [{ productId:this.currentInfo.id,bigNum:that.wasteNum,smallNum:null,classId:0,itemId:this.currentInfo.itemId,ratio:this.currentInfo.ratio }]
+			that.$util.confirmModal({content:'确认报损?'},() => {
+				wastage({product:JSON.stringify(product),remark:''}).then((res) => {
+					if(res.code == 1){
+						that.closeWastePop()
+						that.$msg('报损成功')
+					}
+				});
+			})
+		},
 		moveToLose(){
 			this.moveLabelShow = true
 			this.moveNum = this.currentInfo.stock?parseFloat(this.currentInfo.stock):0
@@ -255,55 +349,6 @@ export default {
 				}
 			})
 		},
-		breakSingleItem(item){
-			let that = this
-			this.breakNum = 1
-			that.$util.confirmModal({content:'确定拆1扎?'},() => {
-				that.breakAction()
-			})
-		},
-		breakMore(){
-			this.closeRightShow()
-			this.breakShow = true
-			this.breakNum = null
-			setTimeout(x => {
-				this.$nextTick(() => this.setBreakFocus())
-			}, 200)
-		},
-		breakAction(){
-			let that = this
-			breakItem({breakNum:that.breakNum,id:that.currentInfo.id}).then(res=>{
-				if(res.code == 1){
-					that.breakShow = false
-					that.breakFocus = false
-					that.$msg(res.msg)
-				}
-			})
-		},
-		breakConfirm(val){
-			let that=this;
-			if (val.index == 0) {
-				that.breakShow = false
-				that.breakFocus = false
-				return false
-			}
-			if (this.breakNum == null) {
-				that.$msg('请填写数量')
-				that.breakFocus = true
-				return false
-			}
-			if (Number(this.breakNum) <= 0) {
-				that.$msg('数量不能小于1')
-				that.breakFocus = true
-				return false
-			}
-			that.$util.confirmModal({content:'确认拆'+that.breakNum+'份?'},() => {
-				that.breakAction()
-			})
-		},
-		setBreakFocus(){
-			this.breakFocus = true
-		},
 		cancelPreSellFn(item){
 			let that = this
 			this.$util.confirmModal({content:'确认取消预售?'},() => {

+ 23 - 37
ghsApp/src/admin/part/index.vue

@@ -6,9 +6,9 @@
 				<button class="admin-button-com middle blue" @click="selectFlowerNumFn()">图片分类</button>
 			</view>
 			<view class="search-bar">
-				<app-search-module v-model="py" placeholder="输拼音首字母也可以搜" @input="searchFn" />
+				<app-search-module ref="globalSearchRef" v-model="globalPy" placeholder="这里搜索" @input="globalSearch" />
 			</view>
-			<view style="float:right">
+			<view style="float:right;margin-left:10upx;">
 				<button class="admin-button-com middle blue" @click="removeFromSave(0)">清除花材</button>
 			</view>
 		</view>
@@ -16,22 +16,20 @@
 		<view class="scroll-middle_bx">
 
 			<scroll-view scroll-y scroll-with-animation class="tab-view">
-				<!--分类 start -->
-				<div v-for="(item, index) in globalClassItemList" :key="index" class="tab-bar-item" :class="classIndex == index ? 'active' : ''" :data-current="index" @tap.stop="swichClass(index)">
-					<text>{{ item.className || "" }}</text>
+				<div v-for="(item, index) in globalClassData" :key="index" class="tab-bar-item" :class="globalClassIndex == index ? 'active' : ''" :data-current="index" @tap.stop="globalSwitchClass(index,item)">
+					<text>{{ item.name || "" }}</text>
 				</div>
-				<!--分类 end -->
 				<view style="height: 120upx"></view>
 			</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">
-				<!--花材列表 start -->
-				<block v-if="!$util.isEmpty(globalClassItemList)">
-					<view class="item_list_bx selectAll" v-for="(classItem, classIndex) in globalClassItemList" :key="classIndex" :id="`class_${classIndex}`">
-						<view class="item_list_title">{{ classItem.className }}</view>
-						<template v-for="(productItem, productIndex) in classItem.child">
-							<view style="height: 175upx" :id="`class_${classItem.classId}_${productItem.id}`" :key="productIndex">
-								<Commondity v-if="classItem.isActive"
+			<scroll-view scroll-y class="right-box" :scroll-into-view="scroll_into_view" scroll-with-animation="true" 
+			:scroll-top="globalScrollTopPlace" @scroll="globalGetScroll" lower-threshold="100" @scrolltolower="globalScrollBottom">
+				<block v-if="!$util.isEmpty(globalItemData)">
+					<view class="item_list_bx selectAll">
+						<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"
 									:info="productItem"
 									@showAddModelFn="showAddModelFn"
@@ -42,9 +40,8 @@
 					</view>
 				</block>
 				<block v-else>
-					<app-wrapper-empty title="加载中" :is-empty="$util.isEmpty(globalClassItemList)" />
+					<app-wrapper-empty title="加载中" :is-empty="$util.isEmpty(globalItemData)" />
 				</block>
-				<!--花材列表 end -->
 			</scroll-view>
 
 		</view>
@@ -52,10 +49,7 @@
 		<modal-module :show="isAddModel" @cancel="addItemModelHidden" @click="confirmAddItemModel" :title="customData.name" color="#333" :size="32" padding="30rpx 30rpx" >
 			<template slot="customContent">
 				<view class="select-cmd_bx" v-if="customData">
-					<view class="kc">
-						<text class="unit_price">库存 {{ customData.stock?parseFloat(customData.stock):0 }}</text>
-						<text style="margin-left:14upx;">{{customData.ratio}}{{customData.smallUnit}}/{{customData.bigUnit}}</text>
-					</view>
+					<view class="kc"><text class="unit_price">库存 {{ customData.stock||0 }}</text></view>
 					<view class="num_bx">
 
 						<!-- #ifdef APP-PLUS -->
@@ -81,21 +75,19 @@
 		<modal-module :show="showSubmitModel" title="确认下一步?" color="#333" :size="32" padding="30upx 30upx" >
 		</modal-module>
 
-		<FooterCart :price="allPrice" :count="allCount" @confirm="confirmToSave" :selectJobType="selectJobType" ></FooterCart>
+		<FooterCart :price="allPrice" :count="allCount" @confirm="confirmToSave" :displayTotalPrice="false"></FooterCart>
 
-		<uni-popup ref="selectFlowerNumRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
+		<uni-popup ref="globalClassImgRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
 			<view style="display:flex;padding:20upx;height:auto;justify-content: space-between;align-items:center;flex-wrap:wrap;max-height:100vh;overflow:auto;">
 
-				<view v-for="(item, index) in globalClassItemList" :key="index" @tap.stop="changeClass(index)" style="margin-bottom:20upx;margin-left:3upx;">
-				<image :src="item.classCover" style="width:120upx;height:120upx;border-radius:10upx;"></image>
-				<view style="margin-top:5upx;overflow: hidden;white-space: nowrap;width:120upx;text-align:center;">{{item.className}}</view>
+				<view v-for="(item, index) in globalClassData" :key="index" @tap.stop="globalChangeClass(index,item)" style="margin-bottom:20upx;margin-left:3upx;">
+				<image :src="item.cover" style="width:120upx;height:120upx;border-radius:10upx;"></image>
+				<view style="margin-top:5upx;overflow: hidden;white-space: nowrap;width:120upx;text-align:center;">{{item.name}}</view>
 				</view>
 
 			</view>
 		</uni-popup>
 
-		<image v-if="showClassRemind" @click="hideClassRemind" style="position:absolute;width:610upx;height:699upx;top:225upx;left:80upx;z-index:9999;" :src="`${constant.imgUrl}/class_remind.png`"></image>
-
 	</view>
 </view>
 </template>
@@ -108,7 +100,7 @@ import Commondity from "@/components/module/app-commodity";
 import FooterCart from "@/components/module/app-footer-cart";
 import ModalModule from "@/components/plugin/modal";
 import { COMMODITY_TYPE } from "@/utils/declare";
-import productMins from "@/mixins/product";
+import productMins from "@/mixins/product2";
 export default {
 	name: "index",
 	components: {
@@ -139,18 +131,12 @@ export default {
 		};
 	},
 	onLoad(){
-		this.initData({requestType:'part'})
+		this.globalRequestType = 'part'
+		this.initData()
 	},
 	methods: {
-		changeClass(index){
-			this.$refs.selectFlowerNumRef.close()
-			this.swichClass(index)
-		},
 		selectFlowerNumFn(){
-			this.$refs.selectFlowerNumRef.open('top')
-		},
-		hideClassRemind(){
-
+			this.$refs.globalClassImgRef.open('top')
 		},
 		switchGlobalUnitType(){
 			if(this.globalUnitType == 0){