shish 3 лет назад
Родитель
Сommit
3b71ceeb12

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

@@ -56,7 +56,7 @@
 		</view>
 
       <div class="app-footer">
-		<button class="admin-button-com big blue" @click="modifyClass()">所选花材移动到</button>
+		<button class="admin-button-com big blue" @click="modifyClass()">提交所选花材</button>
       </div>
 
 		<uni-popup ref="selectFlowerNumRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">

+ 1 - 1
ghsApp/src/admin/item/list.vue

@@ -280,7 +280,7 @@ export default {
 			})
 		},
 		sendStock(){
-			this.pageTo({url: '/admin/item/sendStock?id='+this.currentInfo.id,type:2})
+			this.pageTo({url: '/admin/item/sendStock?id='+this.currentInfo.id+'&price='+this.currentInfo.price+'&stock='+this.currentInfo.stock,type:2})
 		},
 		downloadImg(){
 			let that = this

+ 311 - 337
ghsApp/src/admin/item/sendStock.vue

@@ -1,383 +1,357 @@
 <template>
-<view class="app-content">
-	<view class="billing_box_bg">
-    	<view class="input-wrap">
-			<text style="margin-right:30upx;font-size:42upx;">库存:{{stock}}扎</text>
-			<text style="margin-right:30upx;font-size:42upx;">单价:¥{{ option.price ? option.price : 0 }}</text>
-			<button style="margin-right:30upx;" class="admin-button-com middle blue" @click="setSon()">设置子花材</button>
-		</view>
-		<view class="scroll-middle_bx">
-			<block>
-				<view class="item_list_bx"  style="width: 100%">
-					<view v-for="(sonItem,xjIndex) in sonItemList" :key="xjIndex">
-						<view>
-							<view class="item-cmd_bx">
-								<view class="img_bx" style="background:#eeeeee">
-									<image :src="sonItem.cover"></image>
-								</view>
-								<view class="cmd-info_bx">
-									<view class="tit">{{ sonItem.name || "" }}</view>
-									<view class="kc">剩 {{sonItem.stock ? parseFloat(sonItem.stock) : 0}}</view>
-									<view class="num-open_bx">
-										<view class="open-bx warn">
-											数量:<input class="change-input" placeholder-style="color:#CCCCCC" 
-											v-model="numList[sonItem.id]" type="digit" placeholder="请填写" />
+	<view class="app-content">
+		<view class="billing_box_bg">
+			<view class="input-wrap">
+				<text style="margin-right:15upx;font-size:42upx;">库存:{{stock}}扎</text>
+				<text style="margin-right:20upx;font-size:42upx;">批发价:¥{{ price }}</text>
+				<button class="admin-button-com middle blue" @click="setSon()">新增子花材</button>
+			</view>
+			<view class="scroll-middle_bx">
+				<block>
+					<view class="item_list_bx"  style="width: 100%">
+						<view v-for="(sonItem,xjIndex) in sonItemList" :key="xjIndex">
+							<view>
+								<view class="item-cmd_bx">
+									<view class="img_bx" style="background:#eeeeee">
+										<image :src="sonItem.cover"></image>
+									</view>
+									<view class="cmd-info_bx">
+										<view class="tit">{{ sonItem.name || "" }}</view>
+										<view class="kc">剩 {{sonItem.stock ? parseFloat(sonItem.stock) : 0}}</view>
+										<view class="num-open_bx">
+											<view class="open-bx">
+	<button class="admin-button-com mini-btn blue del-button" @click="delItem(sonItem)">删除</button>
+	<input class="hy-ok-price" placeholder-style="color:#CCCCCC" v-model="sonItem.sendHyPrice" type="number" placeholder="会员价" />
+	<input class="add-ok-stock" placeholder-style="color:#CCCCCC" v-model="sonItem.sendSonStock" type="digit" placeholder="库存数量" />
+	<input class="ls-ok-price" placeholder-style="color:#CCCCCC" v-model="sonItem.sendLsPrice" type="digit" placeholder="零售价" />
+	<input class="pf-ok-price" placeholder-style="color:#CCCCCC" @input="linkChange(sonItem)" v-model="sonItem.sendPfPrice" type="digit" placeholder="批发价" />
+											</view>
 										</view>
 									</view>
 								</view>
 							</view>
 						</view>
 					</view>
-				</view>
-			</block>
+				</block>
+			</view>
+	
+			<div class="app-footer footer-button">
+				<button class="admin-button-com big default" @click="goBack()" 
+				style="margin-left:58upx;padding:30upx 55upx 30upx 55upx;">返回</button>
+				<button class="admin-button-com big blue" @click="confirmSend()" 
+				style="margin-left:58upx;padding:30upx 65upx; 30upx 65upx;" >确认</button>
+			</div>
+	
 		</view>
-
-		<div class="app-footer footer-button">
-			<button class="admin-button-com big blue" @click="clearXj()">清除全部</button>
-			<button class="admin-button-com big blue" @click="goBack()" style="margin-left:58upx;padding:30upx 55upx 30upx 55upx;">返回</button>
-			<button class="admin-button-com big blue" @click="confirmXj()" style="margin-left:58upx;padding:30upx 65upx; 30upx 65upx;" >确认</button>
-		</div>
-
 	</view>
-</view>
-</template>
-<script>
-import AppWrapperEmpty from "@/components/app-wrapper-empty";
-import { mapGetters } from "vuex";
-import { getSonList } from "@/api/item"
-export default {
-	name: "sendStock",
-	components: {
-		AppWrapperEmpty,
-	},
-	mixins: [],
-	data() {
-		return {
-			sonItemList:[],
-			xjData:[],
-			numList:[],
-			stock:0
-		};
-	},
-	computed:{
-		...mapGetters(["getMyShopInfo","getLoginInfo"]),
-	},
-	onLoad() {
-		this.stock = this.option.stock ? parseFloat(this.option.stock) : 0
-		let that = this
-		let saveInfo = uni.getStorageSync("xj"+this.option.customId)
-		let ptItemId = this.option.ptItemId ? this.option.ptItemId : 0
-		if(!this.$util.isEmpty(saveInfo)){
-			saveInfo.forEach((item,index)=>{
-				if(item.ptItemId == ptItemId){
-					let hasList = item.list ? item.list : []
-					if(!that.$util.isEmpty(hasList)){
-						hasList.forEach((hasItem,hasIndex)=>{
-							that.numList[hasItem.id] = hasItem.num
-						})
-					}
-				}
-			})
-		}
-	},
-	onPullDownRefresh() {
-	},
-	onShow(){
-		this.init()
-	},
-	methods: {
-		setSon(){
-			let productId = this.option.id ? this.option.id : 0
-			this.$util.pageTo({url:'/admin/changePrice/setSon?id='+productId})
+	</template>
+	<script>
+	import AppWrapperEmpty from "@/components/app-wrapper-empty";
+	import { mapGetters } from "vuex";
+	import { getSonList,delMsItem } from "@/api/item"
+	export default {
+		name: "sendStock",
+		components: {
+			AppWrapperEmpty,
 		},
-		clearXj(){
-			let that = this
-			this.$util.confirmModal({content:'确认全部清除?'},() => {
-				that.confirmClearXj()
-			})
+		mixins: [],
+		data() {
+			return {
+				sonItemList:[],
+				stock:0,
+				price:0
+			};
 		},
-		confirmClearXj(){
-			uni.removeStorageSync("xj"+this.option.customId)
-			if(!this.$util.isEmpty(this.numList)){
-				console.log('this.numList',this.numList)
-				this.numList.forEach((item,index,arr)=>{
-					arr[index]=''
-				})
-				this.$forceUpdate();
-				console.log('this.numList',this.numList)
-			}
+		onShow(){
 
-			//返回上一页带参数
-			let pages = getCurrentPages();
-			let prevPage = pages[ pages.length - 2 ];
-			//修改上一页data里面的xjData
-			prevPage.$vm.xjData = {price:null,stock:0,hasUpdate:1,cancel:1}
-			uni.navigateBack({});
 		},
-		goBack(){
-			//返回上一页带参数
-			let pages = getCurrentPages();
-			let prevPage = pages[ pages.length - 2 ];
-			//修改上一页data里面的xjData
-			prevPage.$vm.xjData = {price:this.option.price,stock:0,hasUpdate:0,cancel:0}
-			uni.navigateBack({});
+		onLoad(){
+			this.price = this.option.price ? parseFloat(this.option.price) : 0
+			this.stock = this.option.stock ? parseFloat(this.option.stock) : 0
 		},
-		confirmXj(){
-			let ptItemId = this.option.ptItemId ? this.option.ptItemId : 0
-			let arr = []
-			this.numList.forEach((num,id)=>{
-				if(!this.$util.isEmpty(num) && Number(num)>0){
-					arr.push({id:id,num:num})
-				}
-			})
-
-			if(this.$util.isMoney(this.option.price) == false){
-				this.$msg("请填写单价")
-				return false
-			}
-
-			let totalNum = 0
-			arr.forEach((item)=>{
-				totalNum = (Number(item.num) + Number(totalNum)).toFixed(0)
-			})
-			if(totalNum <= 0){
-				this.$msg("请填写数量")
-				return false
-			}
+		methods: {
+			linkChange(item){
+				let skMore = item.skMore
+				let hj
+			},
+			delItem(item){
+				let that = this
+				let motherId = this.option.id ? this.option.id : 0
+				this.$util.confirmModal({content:'确认删除?'},() => {
+					delMsItem({motherId:motherId,id:item.id}).then(res=>{
+						if(res.code == 1){
+							that.$msg(res.msg)
+							that.init()
+						}
+					})
+				})
+			},
+			setSon(){
+				let productId = this.option.id ? this.option.id : 0
+				this.$util.pageTo({url:'/admin/changePrice/setSon?id='+productId})
+			},
+			goBack(){
+				uni.navigateBack({});
+			},
+			confirmSend(){
+				if (!this.$util.isEmpty(this.sonItemList)){
+					this.sonItemList.forEach((item,idx,arr) => {
+						if(Number(item.sendSonStock)>0){
+							
+						}else{
 
-			if(totalNum > Number(this.option.stock)){
-				this.$msg("数量超过总库存")
-				return false
-			}
+						}
+					})
+				}
 
-			let saveInfo = uni.getStorageSync("xj"+this.option.customId)
-			if(!this.$util.isEmpty(saveInfo)){
-				let getIndex = -1
-				saveInfo.forEach((colorItem,colorIndex)=>{
-					if(colorItem.ptItemId == ptItemId){
-						getIndex = colorIndex
-					}
+			},
+			init(){
+				let productId = this.option.id ? this.option.id : 0
+				getSonList({motherId:productId}).then(res => {
+					this.sonItemList = res.data.list
 				})
-				if(getIndex > -1){
-					saveInfo[getIndex].list = arr
-				}else{
-					saveInfo.push({ptItemId:ptItemId,list:arr})
-				}
-			}else{
-				saveInfo = [{ptItemId:ptItemId,list:arr}]
 			}
-			uni.setStorageSync("xj"+this.option.customId, saveInfo)
-
-			//返回上一页带参数
-			let pages = getCurrentPages();
-			let prevPage = pages[ pages.length - 2 ];
-			//修改上一页data里面的xjData
-			prevPage.$vm.xjData = {price:this.option.price,stock:totalNum,hasUpdate:1,cancel:0}
-			uni.navigateBack({});
-		},
-		init(){
-			let productId = this.option.id ? this.option.id : 0
-			getSonList({motherId:productId}).then(res => {
-				this.sonItemList = res.data.list
-			})
 		}
-	}
-};
-</script>
-
-<style lang="scss" scoped>
-.billing_box_bg {
-	height: 100%;
-	display: flex;
-	background: white;
-	flex-direction: column;
-	.input-wrap {
-		font-size:30upx;
+	};
+	</script>
+	
+	<style lang="scss" scoped>
+	.billing_box_bg {
+		height: 100%;
 		display: flex;
-		padding: 22upx 20upx 22upx 30upx;
-		.search-bar {
-			flex: 1;
-		}
-		.city-select {
+		background: white;
+		flex-direction: column;
+		.input-wrap {
+			font-size:30upx;
 			display: flex;
-			flex-shrink: 0;
-			align-items: center;
-			margin-right: 15upx;
-			margin-left: 45upx;
-			background-color: #ffff;
-			.iconfont {
-				margin-left: 20upx;
-				font-size: 30upx;
+			padding: 22upx 20upx 22upx 30upx;
+			.search-bar {
+				flex: 1;
+			}
+			.city-select {
+				display: flex;
+				flex-shrink: 0;
+				align-items: center;
+				margin-right: 15upx;
+				margin-left: 45upx;
+				background-color: #ffff;
+				.iconfont {
+					margin-left: 20upx;
+					font-size: 30upx;
+				}
 			}
 		}
-	}
-	.scroll-middle_bx {
-		margin-bottom:110upx;
-	}
-	.tab-view {
-		height: 100%;
-		width: 170upx;
-		flex-shrink: 0;
-		background-color: #f0f2f6;
-		.tab-bar-item {
-			position: relative;
+		.scroll-middle_bx {
+			margin-bottom:110upx;
+		}
+		.tab-view {
+			height: 100%;
 			width: 170upx;
-			height: 90upx;
-			box-sizing: border-box;
-			display: flex;
-			align-items: center;
-			justify-content: center;
-			font-size: 26upx;
-			color: #444;
-			font-weight: 400;
-			.tag {
+			flex-shrink: 0;
+			background-color: #f0f2f6;
+			.tab-bar-item {
+				position: relative;
+				width: 170upx;
+				height: 90upx;
+				box-sizing: border-box;
 				display: flex;
-				padding: 0 20upx;
 				align-items: center;
-				position: absolute;
-				right: 0;
-				top: 0;
-				height: 32upx;
-				background: #ff2842;
-				border-radius: 16upx;
-				color: #fff;
-				font-size: 20upx;
+				justify-content: center;
+				font-size: 26upx;
+				color: #444;
+				font-weight: 400;
+				.tag {
+					display: flex;
+					padding: 0 20upx;
+					align-items: center;
+					position: absolute;
+					right: 0;
+					top: 0;
+					height: 32upx;
+					background: #ff2842;
+					border-radius: 16upx;
+					color: #fff;
+					font-size: 20upx;
+				}
+				&:last-child{
+					margin-bottom: 110upx;
+				}
 			}
-			&:last-child{
-				margin-bottom: 110upx;
+			.active {
+				position: relative;
+				color: $mainColor;
+				font-size: 26upx;
+				background: #fff;
+			}
+			.active::before {
+				content: "";
+				position: absolute;
+				border-left: 8upx solid $mainColor;
+				height: 100%;
+				left: 0;
 			}
 		}
-		.active {
-			position: relative;
-			color: $mainColor;
-			font-size: 26upx;
-			background: #fff;
-		}
-		.active::before {
-			content: "";
-			position: absolute;
-			border-left: 8upx solid $mainColor;
+		.right-box {
 			height: 100%;
-			left: 0;
+			flex: 1;
+			box-sizing: border-box;
 		}
-	}
-	.right-box {
-		height: 100%;
-		flex: 1;
-		box-sizing: border-box;
-	}
-	.item_list_bx {
-		padding: 10upx 40upx;
-	}
-	.item_list_title {
-		margin-bottom: 20upx;
-		font-size: 24upx;
-		font-weight: 600;
-		color: #666666;
-	}
-	.select-cmd_bx {
-		& .kc {
-			color: #999999;
-			font-size: 28upx;
-			font-weight: 400;
-			margin-bottom: 60upx;
-			text-align: center;
-			margin-top: 10upx;
+		.item_list_bx {
+			padding: 10upx 40upx;
 		}
-		& .num_bx {
-			display: flex;
-			align-items: center;
-			margin-bottom: 80upx;
-			& > input {
-				width: 212upx;
-				height: 80upx;
-				border: 1upx solid #dddddd;
-				border-radius: 4upx;
+		.item_list_title {
+			margin-bottom: 20upx;
+			font-size: 24upx;
+			font-weight: 600;
+			color: #666666;
+		}
+		.select-cmd_bx {
+			& .kc {
+				color: #999999;
+				font-size: 28upx;
+				font-weight: 400;
+				margin-bottom: 60upx;
 				text-align: center;
-				margin-right: 24upx;
+				margin-top: 10upx;
+			}
+			& .num_bx {
+				display: flex;
+				align-items: center;
+				margin-bottom: 80upx;
+				& > input {
+					width: 212upx;
+					height: 80upx;
+					border: 1upx solid #dddddd;
+					border-radius: 4upx;
+					text-align: center;
+					margin-right: 24upx;
+				}
 			}
 		}
 	}
-}
-.item-cmd_bx {
-	position: relative;
-	margin-bottom: 20upx;
-	.img_bx {
-		height: 160upx;
-		width: 160upx;
-		position: absolute;
-		left: 0upx;
-		top: 0upx;
-		image{
-			width: 100%;
-			height: 100%;
-		}
-	}
-	.cmd-info_bx {
+	.item-cmd_bx {
 		position: relative;
-		padding-left: 177upx;
-		&.active{
-			&:before{
-				content: ' ';
-				height: 22upx;
-				width: 22upx;
-				border-width: 2upx 2upx 0 0;
-				border-color: #b2b2b2;
-				border-style: solid;
-				-webkit-transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0);
-				transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0);
-				position: absolute;
-				top: 50%;
-				margin-top: -12upx;
-				right: 30upx;
+		margin-bottom: 20upx;
+		height:190upx;
+		.img_bx {
+			height: 160upx;
+			width: 160upx;
+			position: absolute;
+			left: 0upx;
+			top: 0upx;
+			image{
+				width: 100%;
+				height: 100%;
 			}
 		}
-
-		& .tit {
-			font-size: 30upx;
-			font-weight: 700;
-			color: #333333;
-		}
-		& .kc {
-			color: #999999;
-			font-size: 26upx;
-			padding: 13upx 0 13upx;
-		}
-		& .num-open_bx {
-			display: flex;
-			align-items: center;
-			& .price {
-				font-size: 28upx;
-				color: #999999;
-				flex: 1;
+		.cmd-info_bx {
+			position: relative;
+			padding-left: 177upx;
+			&.active{
+				&:before{
+					content: ' ';
+					height: 22upx;
+					width: 22upx;
+					border-width: 2upx 2upx 0 0;
+					border-color: #b2b2b2;
+					border-style: solid;
+					-webkit-transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0);
+					transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0);
+					position: absolute;
+					top: 50%;
+					margin-top: -12upx;
+					right: 30upx;
+				}
 			}
-			& .open-bx {
+	
+			& .tit {
+				font-size: 30upx;
+				font-weight: 700;
 				color: #333333;
-				text{
-					font-size: 24upx;
+			}
+			& .kc {
+				color: #999999;
+				font-size: 26upx;
+				padding: 13upx 0 13upx;
+			}
+			& .num-open_bx {
+				display: flex;
+				align-items: center;
+				& .price {
+					font-size: 28upx;
+					color: #999999;
+					flex: 1;
 				}
-				*.warn {
-					color: $redColor;
+				& .open-bx {
+					color: #333333;
+					position: relative;
+					.del-button{
+						position: absolute;
+						left:20upx;
+						top:15upx;
+						width:100upx;
+					}
+					.hy-ok-price{
+						width: 160upx;
+						height: 60upx;
+						line-height: 60upx;
+						text-align: center;
+						background: #ffffff;
+						border: 1upx solid #b4b4b4;
+						border-radius: 4upx;
+						font-size: 25upx;
+						color:#5e5d5d;
+						position: absolute;
+						left:180upx;
+						top:15upx;
+					}
+					.add-ok-stock{
+						width: 160upx;
+						height: 60upx;
+						line-height: 60upx;
+						text-align: center;
+						background: #ffffff;
+						border: 1upx solid #3385FF;
+						border-radius: 4upx;
+						font-size: 25upx;
+						color:#3385FF;
+						position: absolute;
+						left:180upx;
+						top:-58upx;
+					}
+					.ls-ok-price{
+						width: 160upx;
+						height: 60upx;
+						line-height: 60upx;
+						text-align: center;
+						background: #ffffff;
+						border: 1upx solid #b4b4b4;
+						border-radius: 4upx;
+						font-size: 25upx;
+						color:#5e5d5d;
+						position: absolute;
+						left:350upx;
+						top:15upx;
+					}
+					.pf-ok-price{
+						width: 160upx;
+						height: 60upx;
+						line-height: 60upx;
+						text-align: center;
+						background: #ffffff;
+						border: 1upx solid #3385FF;
+						border-radius: 4upx;
+						font-size: 25upx;
+						color:#3385FF;
+						position: absolute;
+						left:350upx;
+						top:-58upx;
+					}
 				}
 			}
 		}
 	}
-}
-.change-input {
-	width: 180upx;
-	height: 60upx;
-	line-height: 60upx;
-	text-align: center;
-	background: #ffffff;
-	border: 1upx solid #b4b4b4;
-	border-radius: 4upx;
-	font-size: 25upx;
-	color:#5e5d5d;
-	position: relative;
-	left:120upx;
-	top:-36upx;
-}
-.footer-button{
-	height:120upx;
-}
-</style>
+	.footer-button{
+		height:120upx;
+	}
+	</style>

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

@@ -1,5 +1,9 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 
+export const delMsItem = data => {
+	return https.get('/item-ms/del-item', data)
+}
+
 export const getSonList = data => {
 	return https.get('/item-ms/get-son-list', data)
 }