فهرست منبع

拆散和报损

shish 1 سال پیش
والد
کامیت
cab14b30a7
3فایلهای تغییر یافته به همراه175 افزوده شده و 71 حذف شده
  1. 1 1
      ghsApp/src/admin/cp/cpDetail.vue
  2. 63 4
      ghsApp/src/admin/item/detail.vue
  3. 111 66
      ghsApp/src/admin/item/list2.vue

+ 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
         })

+ 63 - 4
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>
@@ -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:'确认取消预售?'},() => {