Browse Source

变动记录

shish 3 years ago
parent
commit
3a396f708e

+ 10 - 5
ghsApp/src/admin/changePrice/changeList.vue

@@ -7,9 +7,9 @@
 					<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-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">
@@ -19,8 +19,13 @@
 								</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.price?parseFloat(item.price):0}}</view></t-td>
-							<t-td><view style="color:#333333;font-size:30upx;">{{item.skPrice?parseFloat(item.skPrice):0}}</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.price?parseFloat(item.price):0}}</view>
+									<view>¥{{item.skPrice?parseFloat(item.skPrice):0}}</view>
+								</view>
+							</t-td>
 						</t-tr>
 					</t-table>
 				</block>

+ 156 - 0
ghsApp/src/admin/changePrice/costChangeList.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;">{{item.cost?parseFloat(item.cost):0}}</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 { getCostChangeList } from "@/api/item";
+import { list } from "@/mixins";
+import { mapGetters} from "vuex";
+export default {
+	components: {  AppWrapperEmpty},
+	mixins: [list],
+	computed: {		
+		...mapGetters(["getDictionariesInfo","getLoginInfo"])	
+	},
+	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 getCostChangeList({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>

+ 9 - 15
ghsApp/src/admin/item/list.vue

@@ -199,39 +199,33 @@ export default {
 		},
 		moreToDo(item){
 			let that=this;
-			let doList = ['价格变动记录','复制花材','颜色管理', '下单记录','下架','上架']
+			let doList = ['成本变动记录','价格变动记录','复制花材','颜色管理', '下单记录','下架']
 			uni.showActionSheet({
 				itemList: doList,
 				success: function (respond) {
 					let index = respond.tapIndex
 					if(index == 0){
-						that.pageTo({url: '/admin/changePrice/changeList',query: {id: item.id}})
+						that.pageTo({url: '/admin/changePrice/costChangeList',query: {id: item.id}})
 					}else if (index == 1) {
+						that.pageTo({url: '/admin/changePrice/changeList',query: {id: item.id}})
+					}else if (index == 2) {
 						that.pageTo({url: '/admin/item/copy',query: {id: item.id}})
-					} else if (index == 2) {
+					} else if (index == 3) {
 						if(item.variety == 0){
-							that.$msg('没有开启颜色管理')
+							that.$msg('请选开启颜色管理')
 							return false
 						}
 						that.pageTo({url: "/admin/item/xjSelect?itemId="+item.id})
-					} else if (index == 3) {
-						that.pageTo({url: "/admin/order/itemOrder?id="+item.id})
 					} else if (index == 4) {
+						that.pageTo({url: "/admin/order/itemOrder?id="+item.id})
+					} else if (index == 5) {
 						that.$util.confirmModal({content:'确认下架?'},() => {
 							statusUpdate({id:item.id,status:2}).then(res=>{
 								if(res.code == 1){
 									that.$msg('操作成功')
 								}
 							})
-						})
-					} else if (index == 5) {
-						that.$util.confirmModal({content:'确认上架?'},() => {
-							statusUpdate({id:item.id,status:1}).then(res=>{
-								if(res.code == 1){
-									that.$msg('操作成功')
-								}
-							})
-						})				
+						})			
 					}else{
 
 					}

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

@@ -10,4 +10,8 @@ export const getColorList = data => {
 
 export const getPriceChangeList = data => {
 	return https.get('/price-change/list', data)
+}
+
+export const getCostChangeList = data => {
+	return https.get('/cost-change/list', data)
 }

+ 2 - 1
ghsApp/src/pages.json

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