shish 1 an în urmă
părinte
comite
e16cd483db

+ 17 - 1
ghsApp/src/admin/item/detail.vue

@@ -261,6 +261,12 @@
             </label>
             </radio-group>
           </tui-list-cell>
+
+          <tui-list-cell class="line-cell" :hover="false">
+            <view class="tui-title">处理区花材</view>
+            <button v-if="productData.id > 0" class="admin-button-com default" @click="makeLose(productData)">设为处理花材</button>
+          </tui-list-cell>
+
       </view>
 
       <view class="app-footer">
@@ -348,7 +354,7 @@
 import TuiListCell from "@/components/plugin/list-cell";
 const form = require("@/utils/formValidation.js");
 import { getAllItemClass } from "@/api/item-class";
-import { applyAuth,modifyCgStaff } from '@/api/item';
+import { applyAuth,modifyCgStaff,setLosing } from '@/api/item';
 import { delCpItem,addCpItem } from '@/api/cp'
 import { getAllUnit } from "@/api/unit";
 import { addProduct,updateProduct,getProductDetail,py,print,modifyOnStockFn,delStatusUpdate,changeBelongCost } from "@/api/product";
@@ -567,6 +573,16 @@ export default {
 		closeMoreDoPop(){
 			this.$refs.rightShowMore.close()
 		},
+    makeLose(item){
+      let that = this
+      that.$util.confirmModal({content:'确认设为处理用花材?不了解此功能请勿操作?'},() => {
+        setLosing({id:item.id}).then(res=>{
+          if(res.code == 1){
+            this.$msg('设置成功')
+          }
+        })
+      })
+    },
     showChangeOnStock(item){
       let that = this
       that.$util.confirmModal({content:'了解修改后的影响,确认要修改?'},() => {

+ 56 - 24
ghsApp/src/admin/item/list2.vue

@@ -57,15 +57,27 @@
 		</view>
 
 		<modal-module :show="printLabelShow" @click="dialogInputConfirm" :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;" @blur="printBlur" :focus="printFocus" v-model="printNum" :adjust-position="false" class="inp-input" />
+			<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;" @blur="printBlur" :focus="printFocus" v-model="printNum" :adjust-position="false" class="inp-input" />
+					</div>
 				</div>
-			</div>
-			</div>
-		</template>
+				</div>
+			</template>
+		</modal-module>
+
+		<modal-module :show="moveLabelShow" @click="confirmToLosing" :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;" v-model="moveNum" :adjust-position="false" class="inp-input" />
+					</div>
+				</div>
+				</div>
+			</template>
 		</modal-module>
 
 		<modal-module :show="breakShow" @click="breakConfirm" :maskClosable="true" title="拆散数量" padding="30rpx 30rpx" >
@@ -108,17 +120,18 @@
 				<view style="width:100vw;"><button @click="costChange()">成本变动记录</button></view>
 				<view style="width:100vw;margin-top:8upx;"><button @click="priceChange()">价格变动记录</button></view>
 				<view style="width:100vw;margin-top:8upx;"><button @click="varietyManage()">多颜色</button></view>
-				<view style="width:100vw;margin-top:8upx;"><button @click="preSell()">预售</button></view>
-				<view style="width:100vw;margin-top:8upx;"><button @click="orderRecord()">下单记录</button></view>
 				<view style="width:100vw;margin-top:8upx;"><button @click="copyCreate()">复制新建</button></view>
-				<view style="width:100vw;margin-top:8upx;"><button @click="sendStock()">分配库存</button></view>
+				<view style="width:100vw;margin-top:8upx;"><button @click="toSubHalf()">减半扎</button></view>
+				<view style="width:100vw;margin-top:8upx;"><button @click="moveToLose()">挪到处理区</button></view>
 				<view style="width:100vw;margin-top:8upx;"><button @click="shareItem()">打开分享(批发)</button></view>
 				<view style="width:100vw;margin-top:8upx;"><button @click="getHdPosterFn()">分享海报(批发)</button></view>
 				<view style="width:100vw;margin-top:8upx;"><button @click="getSkPosterFn()">分享海报(零售)</button></view>
-				<view style="width:100vw;margin-top:8upx;"><button @click="toSubHalf()">减半扎</button></view>
+				<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="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>
@@ -145,7 +158,7 @@ import productMins from "@/mixins/product2";
 import { mapGetters } from "vuex";
 import { getWeixinId } from "@/api/invite";
 import { print,cancelDiscountPrice,cancelPreSell,delStatusUpdate,cancelFullOffFn } from '@/api/product';
-import { getHdPoster,getSkPoster,breakItem,changeFrontHide,applyAuth,changeHalf } from '@/api/item'
+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"
 export default {
@@ -169,7 +182,9 @@ export default {
 			printItemId:0,
 			printType:0,
 			printLabelShow:false,
+			moveLabelShow:false,
 			printNum:'',
+			moveNum:'',
 			printFocus:false,
 			warning:0,
 			currentInfo:{},
@@ -177,8 +192,7 @@ export default {
 			breakNum:'',
 			breakFocus:false,
 			breakShow:false,
-			halfRemark:'',
-			halfRemind:''
+			halfRemark:''
 		};
 	},
 	computed:{
@@ -197,23 +211,41 @@ export default {
 			let that = this
 			that.$util.confirmModal({content:'请选择操作项',okText:'拆散',cancelText:'报损',cacelTextColor:'#37863a',okTextColor:'#37863a'},() => {
 				that.halfRemark = '拆散减半扎'
-				that.halfRemind = '确认拆散减半?'
 				that.subHalf()
 			},()=>{
-				that.halfRemind = '确认报损减半?'
 				that.halfRemark = '报损减半扎'
 				that.subHalf()
 			})
 		},
 		subHalf(){
 			let that = this
-			that.$util.confirmModal({content:this.halfRemind},() => {
-				that.closeRightShow()
-				uni.showLoading()
-				changeHalf({productId:this.currentInfo.id,add:0,remark:this.halfRemark}).then((res) => {
-					uni.hideLoading()
-					let stock = res.data.stock ? res.data.stock : 0
-					uni.showToast({title: '成功,剩 '+stock,duration:1800,icon:'success'})
+			that.closeRightShow()
+			uni.showLoading()
+			changeHalf({productId:this.currentInfo.id,add:0,remark:this.halfRemark}).then((res) => {
+				uni.hideLoading()
+				let stock = res.data.stock ? res.data.stock : 0
+				uni.showToast({title: '成功,剩 '+stock,duration:1400,icon:'success'})
+			})			
+		},
+		moveToLose(){
+			this.moveLabelShow = true
+			this.moveNum = this.currentInfo.stock?parseFloat(this.currentInfo.stock):0
+		},
+		confirmToLosing(val){
+			let that=this;
+			if (val.index == 0) {
+				that.moveLabelShow = false
+				that.moveNum = ''
+				return
+			}
+			that.$util.confirmModal({content:'确定挪动?'},() => {
+				moveToLosing({id:this.currentInfo.id,num:that.moveNum}).then(res=>{
+					if(res.code == 1){
+						that.$msg(res.msg)
+						that.moveLabelShow = false
+						that.moveNum = ''
+						that.closeRightShow()
+					}
 				})
 			})
 		},

+ 8 - 0
ghsApp/src/api/item/index.js

@@ -1,5 +1,13 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 
+export const moveToLosing = data => {
+	return https.get('/item/move-to-losing', data)
+}
+
+export const setLosing = data => {
+	return https.get('/item/set-losing', data)
+}
+
 export const changeHalf = data => {
 	return https.post('/item/change-half', data)
 }