shish hace 3 años
padre
commit
7594f59909

+ 19 - 31
hdApp/src/admin/billing/affirm.vue

@@ -6,24 +6,22 @@
 					<view class="commodity-view">
 						<view class="commodity-list">
 							<view class="commodity-item" v-for="(item, index) in selectList" :key="index" >
-								<image class="item-icon" :src="item.cover" alt="商品图" />
+								<image class="item-icon" :src="item.cover" />
 								<view class="item-info">
 									<view class="info-line">
 										<text class="item-name">{{ item.itemName }}</text>
 										<text class="item-price">
-											<text class="unit">¥</text>
-
 											<text class="price">
-												{{ getSelectItemPrice(item) }}
+												¥{{ getSelectItemPrice(item) }}
 											</text>
 										</text>
 									</view>
 									<view class="info-line">
-										<text class="item-type">{{ item.rank }}级</text>
+										<text class="item-type" v-if="item.ratioType == 0">{{item.ratio}}{{item.smallUnit}}/{{item.bigUnit}}</text>
+										<text class="item-type" v-else>若干{{item.smallUnit}}/{{item.bigUnit}}</text>
 										<text class="item-count">
-											<text v-if="item.bigCount > 0 || item.smallCount > 0">{{ `${item.bigCount}` }}</text>
-											<text v-if="item.smallCount > 0">/</text>
-											<text v-if="item.smallCount > 0">{{ item.smallCount }}</text>
+											x <text v-if="Number(item.bigCount) > 0">{{ item.bigCount }}{{item.bigUnit}}</text>
+											<text v-if="Number(item.smallCount) > 0">{{ item.smallCount }}{{item.smallUnit}}</text>
 										</text>
 									</view>
 								</view>
@@ -31,13 +29,12 @@
 						</view>
 						<view class="summary-bar">
 							<view class="operate-view" @click="gobackEvent">
-								<text class="iconfont icongouwuche"></text>
-								返回修改
+								<text class="iconfont icongouwuche"></text>返回修改
 							</view>
 							<view class="describe-view">
 								共<text v-if="Number(allCount.bigLength)>0">{{ allCount.bigLength }}扎</text>
-								<text v-if="Number(allCount.smallLength)>0">{{ allCount.smallLength }}支</text>,
-								合计<text class="price">¥{{ allPrice }}</text>
+								<text v-if="Number(allCount.smallLength)>0">{{ allCount.smallLength }}支</text>
+								合计 <text class="price">¥{{ allPrice }}</text>
 							</view>
 						</view>
 					</view>
@@ -62,14 +59,6 @@
 						<input type="number" placeholder="请填写人工和材料费" @input="countAllPrices()" v-model="packingMoney" placeholder-class="tui-placeholder">
 					</tui-list-cell>
 
-					<!--
-					<tui-list-cell class="line-cell" :hover="false" :arrow="false">
-						<view class="tui-title ">送货</view>
-						<button @tap="sendType=1" class="admin-button-com mini-btn" :class="sendType==1?'blue':'default'">自取</button>
-						<button @tap="sendType=0" class="admin-button-com mini-btn" :class="sendType==0?'blue':'default'">配送</button>
-					</tui-list-cell>
-					-->
-
 					<tui-list-cell class="line-cell" :hover="false" :arrow="false" >
 						<view class="tui-title ">运费</view>
 						<input type="number" placeholder="选填" v-model="freight" @input="countAllPrices()" placeholder-class="tui-placeholder">
@@ -214,12 +203,9 @@ export default {
 			let allPrices = this.allPrice.toFixed(2)
 			this.modifyPrice = (Number(allPrices) + Number(this.freight) + Number(this.packingMoney)).toFixed(2);
 		},
-		// 选取客户
 		changeCustomerFn(info) {
-			console.log("changeCustomerFn", info);
 			this.clientInfo = info;
 		},
-		//确定开单
 		affirmFormSubmit(){
 			const product = this.selectList.map(ele => {
 				return { productId: ele.id, bigNum: ele.bigCount, smallNum: ele.smallCount,classId:ele.classId,itemId:ele.itemId };
@@ -251,14 +237,15 @@ export default {
 			});
 		},
 		gobackEvent() {
-			uni.navigateBack({
-				delta: 1
-			});
+			if(this.option.customId){
+				this.$util.pageTo({url: '/admin/billing/index',type:2,query: {customId: this.option.customId}})
+			}else{
+				this.$util.pageTo({url: '/admin/billing/index',type:2})
+			}
 		}
 	}
 };
 </script>
-
 <style lang="scss" scoped>
 .admin-button-com {
 	margin-right: 20upx;
@@ -297,8 +284,9 @@ export default {
 							justify-content: space-between;
 							align-items: flex-end;
 							.item-name {
-								color: #666;
-								font-size: 28upx;
+								color: #333333;
+								font-size:30upx;
+								font-weight:bold;
 							}
 							.item-price {
 								color: #333;
@@ -340,13 +328,13 @@ export default {
 				}
 				.describe-view {
 					display: flex;
-
 					align-items: center;
 					color: #333;
 					font-size: 24upx;
 					.price {
 						font-weight: bold;
-						font-size: 36upx;
+						font-size: 34upx;
+						margin-left:8upx;
 					}
 				}
 			}

+ 156 - 0
hdApp/src/admin/changePrice/changeList.vue

@@ -0,0 +1,156 @@
+<template>
+<view class="app-content">
+	<view class="ex-page">
+		<scroll-view scroll-y scroll-with-animation class="main-view">
+			<view class="space-view ex-table">
+				<block v-if="!$util.isEmpty(list.data)">
+					<t-table :headerBackgroundColor="'#F0F2F6'">
+						<t-tr header>
+							<t-th><view style="width:200upx;color:#333333;font-size:30upx;font-weight:bold;">时间</view></t-th>
+							<t-th><view style="color:#333333;font-size:30upx;font-weight:bold;">操作</view></t-th>
+							<t-th><view style="color:#333333;font-size:30upx;font-weight:bold;">事项</view></t-th>
+							<t-th><view style="color:#333333;font-size:30upx;font-weight:bold;">价格</view></t-th>
+						</t-tr>
+						<t-tr v-for="(item, index) in list.data" :key="index">
+							<t-td align="center" color="info">
+								<view style="width:200upx;color:#333333;font-size:30upx;">
+									<view>{{ item.addTime.substr(5,11) }}</view>
+									<view>{{item.ptStyle==1?'零售':'批发'}}</view>
+								</view>
+							</t-td>
+							<t-td><view style="color:#333333;font-size:30upx;">{{item.staffName}}</view></t-td>
+							<t-td><view style="color:#333333;font-size:30upx;">{{item.event}}</view></t-td>
+							<t-td>
+								<view style="color:#333333;font-size:30upx;">
+									<view>¥{{item.skPrice?parseFloat(item.skPrice):0}}</view>
+								</view>
+							</t-td>
+						</t-tr>
+					</t-table>
+				</block>
+				<block v-else>
+					<AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
+				</block>
+			</view>
+		</scroll-view>
+	</view>
+</view>
+</template>
+<script>
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import { getPriceChangeList } from "@/api/item";
+import { list } from "@/mixins";
+export default {
+	components: {  AppWrapperEmpty},
+	mixins: [list],
+	data() {
+		return {
+		};
+	},
+	onPullDownRefresh() {
+		this.resetList();
+		this.getChangeList(this.option.id).then(res => {
+			uni.stopPullDownRefresh();
+		});
+	},
+	onReachBottom() {
+		if (!this.list.finished) {
+			this.getChangeList(this.option.id).then((res) => {
+				uni.stopPullDownRefresh();
+			});
+		} else {
+			uni.stopPullDownRefresh();
+		}
+	},
+	methods: {
+		async init() {
+			this.getChangeList(this.option.id);
+		},
+		getChangeList(id) {
+			return getPriceChangeList({id:id,page: this.list.page}).then(res => {
+				this.completes(res);
+			});
+		}
+	}
+};
+</script>
+<style lang="scss" scoped>
+.ex-page {
+	height: 100%;
+	display: flex;
+	flex-direction: column;
+	.top-bar {
+		position: absolute;
+		left: 0;
+		display: flex;
+		width: 100%;
+		// box-shadow: 0 5upx 5upx 5upx rgba($color: #000000, $alpha: 0.2);
+		z-index: 20;
+		.bar{
+			width: 50%;
+			height: 100%;
+			text-align: center;
+			&:nth-child(1){
+				border-right: 1upx solid #eeeeec;
+			}
+		}
+	}
+	.main-view {
+		/*margin-top: 80upx;*/
+		flex: 1;
+		background-color: #f9fbfc;
+		.space-view {
+			background-color: #fff;
+		}
+		.ex-info {
+			padding: 30upx;
+			.info-cell {
+				display: flex;
+				align-items: center;
+				font-size: 28upx;
+				&:not(:first-child) {
+					margin-top: 20upx;
+				}
+				.cell-label {
+					width: 110upx;
+					color: #666666;
+				}
+				.cell-value {
+					margin-left: 40upx;
+					color: #333;
+					&.warning {
+						color: #ffaf1d;
+					}
+					&.success {
+						color: #27c325;
+					}
+				}
+			}
+		}
+		.ex-table {
+			/deep/.icon-info {
+				color: #333333;
+			}
+		}
+	}
+	.bar-view {
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		padding: 0 30upx;
+		width: 100%;
+		height: 100upx;
+
+		box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
+		.info-view {
+			font-size: 26upx;
+		}
+		.btn-view {
+			display: flex;
+			.admin-button-com {
+				margin: 0 10upx;
+			}
+		}
+	}
+}
+</style>

+ 0 - 1
hdApp/src/admin/changePrice/components/Item.vue

@@ -17,7 +17,6 @@
 						<view class="price-area">
 						<input class="change-input" @click.stop @blur="savePrice"
 						@focus="modifyPrice = ''" placeholder-style="color:#CCCCCC" v-model="modifyPrice" type="digit" placeholder="填价格" />
-						<view v-if="Number(modifyPrice)>0" class="change-text">成本{{parseFloat((Number(modifyPrice)-Number(info.addPrice)).toFixed(2))}} 加价{{parseFloat(info.addPrice)}}</view>
 						</view>
 					</view>
 				</view>

+ 11 - 1
hdApp/src/admin/changePrice/list.vue

@@ -134,6 +134,16 @@ export default {
 			this.initData({ type, shopId: this.shopId,status:0});
 		},
 		commitPrice(){
+			let that = this
+			if(this.priceArr.length == 0){
+				this.$msg('没有修改')
+				return;
+			}
+			this.$util.confirmModal({content:'确认修改?'},() => {
+				that.commitChange()
+			})
+		},
+		commitChange(){
 			if(this.priceArr.length == 0){
 				uni.showToast({title:"没有修改",icon:"none"})
 				return;
@@ -145,7 +155,7 @@ export default {
 						this.initProduct()
 					}
 					this.$msg(res.msg)					
-				})
+			})
 		},
 		savePrice(price,id){
 			console.log('price',price,id)

+ 4 - 4
hdApp/src/admin/item/components/Item.vue

@@ -20,8 +20,8 @@
 			</view>
 		</view>
 	</view>
-	<text class="bottom-button" @click.stop="moreToDo(info)">更多</text>
-	<text class="bottom-button" @click.stop="goToOrderDetail(info.id)">销售记录</text>
+	<text class="bottom-button" @click.stop="moreAction(info)">更多</text>
+	<text class="bottom-button" @click.stop="goToOrderDetail(info.id)">下单记录</text>
 	<text class="bottom-button" @click.stop="goToStockDetail(info.id)">库存变动</text>
 </view>
 </template>
@@ -50,8 +50,8 @@ export default {
 		};
 	},
 	methods: {
-		moreToDo(item){
-			this.$emit('moreToDo', item)
+		moreAction(item){
+			this.$emit('moreAction', item)
 		},
 		goToOrderDetail(id){
 			this.$util.pageTo({url: "/admin/order/itemOrder?id="+id})

+ 29 - 24
hdApp/src/admin/item/list.vue

@@ -6,7 +6,6 @@
 				<app-search-module v-model="py" placeholder="小菊输xj搜索" @input="searchFn"/>
 			</view>
 			<view style="padding:0 0upx 0 20upx;" >
-				<!-- <button class="admin-button-com middle blue" style="margin-right:8upx;" @click="downPriceTable()">价格表</button> -->
 				<button class="admin-button-com middle blue" @click="pageTo({ url: '/admin/ptItem/itemList' })">添花材</button>
 			</view>
 		</view>
@@ -20,14 +19,13 @@
 																	@scroll="scroll_detail"
 																	lower-threshold="100"
 																	@scrolltolower="scroll_bottom">
-				<!--内容部分-->
 				<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>
 						<view v-if="classItem.child && !$util.isEmpty(classItem.child)">
 							<template v-for="(productItem, productIndex) in classItem.child">
 								<view style="height:255upx" :id="`class_${classIndex}`" :key="productIndex">
-									<ItemComponent v-if="classItem.isActive" :isPrice="false" :info="productItem" @goToProduct="goToProduct" @moreToDo="moreToDo" ></ItemComponent>
+									<ItemComponent v-if="classItem.isActive" :isPrice="false" :info="productItem" @goToProduct="goToProduct" @moreAction="moreAction" ></ItemComponent>
 								</view>
 							</template>
 						</view>
@@ -46,6 +44,15 @@
 			</scroll-view>
 		</view>
 	</view>
+	<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;"><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="copyCreate()">复制新建</button></view>
+			<view style="width:100vw;margin-top:8upx;"><button @click="shareItem()">分享</button></view>
+			<view style="width:100vw;margin-top:30upx;"><button @click="closeRightShow()">取消</button></view>
+		</view>
+	</uni-popup>
  </view>
 </template>
 <script>
@@ -94,27 +101,25 @@ export default {
 		})
 	},
 	methods: {
-		moreToDo(item){
-			//查询是否已经连接蓝牙
-			let that=this;
-			let doList = ['复制花材', '打1个标签', '打2个标签', '打10个标签','打20个标签']
-			let doNum = [0,1,2,10,20]
-			uni.showActionSheet({
-				itemList: doList,
-				success: function (respond) {
-					let index = respond.tapIndex
-					if (index == 0) {
-						that.$msg('开发中')
-					}else{
-						let currentNum = Number(doNum[index])
-						print({id:item.id,num:currentNum}).then(res=>{
-							if(res.code == 1){
-								that.$msg(res.msg)
-							}
-						})
-					}
-				}
-			})
+		priceChange(){
+			this.closeRightShow()
+			this.pageTo({url: '/admin/changePrice/changeList?id='+this.currentInfo.id})
+		},
+		costChange(){
+			this.$msg('开发中')
+		},
+		copyCreate(){
+			this.$msg('开发中')
+		},
+		shareItem(){
+			this.$msg('开发中')
+		},
+		moreAction(item){
+			this.currentInfo = item
+			this.$refs.rightShowMore.open('top')
+		},
+		closeRightShow(){
+			this.$refs.rightShowMore.close()
 		},
 		downPriceTable(){
 			// #ifdef MP-WEIXIN

+ 5 - 0
hdApp/src/api/item/index.js

@@ -0,0 +1,5 @@
+import https from '@/plugins/luch-request_0.0.7/request'
+
+export const getPriceChangeList = data => {
+	return https.get('/price-change/list', data)
+}

+ 2 - 1
hdApp/src/pages.json

@@ -65,7 +65,8 @@
 		{
 			"root": "admin/changePrice",
 			"pages": [
-				{"path": "list","style": {"navigationBarTitleText": "批量改价"}}
+				{"path": "list","style": {"navigationBarTitleText": "批量改价"}},
+				{"path": "changeList","style": {"navigationBarTitleText": "价格变动记录"}}
 			]
 		},
 		{