Explorar o código

价格变动明细

shish %!s(int64=3) %!d(string=hai) anos
pai
achega
71445039a1

+ 158 - 0
ghsApp/src/admin/changePrice/changeList.vue

@@ -0,0 +1,158 @@
+<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:160upx;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="width:180upx;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:160upx;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.relateName}}</view></t-td>
+							<t-td><view style="width:180upx;color:#333333;font-size:30upx;">{{item.typeName}}</view></t-td>
+							<t-td><view style="color:#333333;font-size:30upx;">{{parseFloat(item.itemNum)}}</view></t-td>
+							<t-td><view style="color:#333333;font-size:30upx;">{{parseFloat(item.newStock)}}</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 { getStockDetailApi } from "@/api/storehouse/stock";
+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 getStockDetailApi({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>

+ 8 - 6
ghsApp/src/admin/item/list.vue

@@ -195,22 +195,24 @@ 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) {
+					if(index == 0){
+						that.pageTo({url: '/admin/changePrice/changeList',query: {id: item.id}})
+					}else if (index == 1) {
 						that.pageTo({url: '/admin/item/copy',query: {id: item.id}})
-					} else if (index == 1) {
+					} else if (index == 2) {
 						if(item.variety == 0){
 							that.$msg('没有开启颜色管理')
 							return false
 						}
 						that.pageTo({url: "/admin/item/xjSelect?itemId="+item.id})
-					} else if (index == 2) {
-						that.pageTo({url: "/admin/order/itemOrder?id="+item.id})
 					} else if (index == 3) {
+						that.pageTo({url: "/admin/order/itemOrder?id="+item.id})
+					} else if (index == 4) {
 						that.$util.confirmModal({content:'确认下架?'},() => {
 							statusUpdate({id:item.id,status:2}).then(res=>{
 								if(res.code == 1){
@@ -218,7 +220,7 @@ export default {
 								}
 							})
 						})
-					} else if (index == 4) {
+					} else if (index == 5) {
 						that.$util.confirmModal({content:'确认上架?'},() => {
 							statusUpdate({id:item.id,status:1}).then(res=>{
 								if(res.code == 1){

+ 12 - 2
ghsApp/src/admin/shop/add.vue

@@ -106,6 +106,13 @@
 					<input type="number" v-model="form.allowDebtAmount" @focus="form.allowDebtAmount=''" placeholder-class="phcolor" class="tui-input" name="allowDebtAmount" placeholder="请填写金额" />
 				</tui-list-cell>
 
+				<tui-list-cell class="line-cell" :hover="false">
+					<view class="tui-title">设为首店</view>
+					<view>
+						<switch style="transform:scale(0.7,0.7)" :checked="form.default == 0 ? false : true" @change="defaultChange" /> {{form.default==0 ? '关闭' : '开启'}}
+					</view>
+				</tui-list-cell>
+
 				<tui-list-cell class="line-cell remark-wrap" :hover="false">
 					<view class="tui-title">简介</view>
 					<view class="tui-input">
@@ -167,7 +174,8 @@ export default {
 				img: [],
 				allowDebt:0,
 				allowDebtAmount:5000,
-				presell:0
+				presell:0,
+				default:0
 			},
 			showRegion: false,
 			region: {
@@ -234,6 +242,9 @@ export default {
 		presellChange(e){
 			this.form.presell = e.target.value ? 1 : 0
 		},
+		defaultChange(e){
+			this.form.default = e.target.value ? 1 : 0
+		},
 		allowDebtChange(e){
 			this.form.allowDebt = e.target.value ? 1 : 0
 		},
@@ -295,7 +306,6 @@ export default {
 				uni.hideLoading()
 				let promptText = this.option.id ? '修改成功' : '添加成功'
 				this.$msg(promptText)
-				uni.removeStorageSync('modifyShopB')
 				setTimeout(() => {
 					this.$util.pageTo(1)
 				}, 1000)

+ 20 - 77
ghsApp/src/admin/shop/list.vue

@@ -8,16 +8,13 @@
 							<div>
 								<span class="staff-name">{{ item.shopName }}</span>
 								<span>{{ item.telephone }}</span>
+								<span v-if="item.default && item.default == 1" class="first-shop">默认</span>
 							</div>
 						</div>
 						<div class="list-det-right">
 							<div @click.stop="toModiyFn(item)">
 								<i class="iconfont iconbianji"></i>
 							</div>
-							<!-- 删除 -->
-							<!-- <div @click="delModalFn(item)">
-								<i class="iconfont iconshanchu1"></i>
-							</div> -->
 						</div>
 					</div>
 				</div>
@@ -26,25 +23,20 @@
 				<app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
 			</block>
 		</div>
-		<!-- 按钮 -->
 		<div class="app-footer">
-			<!-- <div class="admin-button-com middle blue" @click="pageTo('/admin/shop/add')">添加门店</div> -->
 			<div @click="addModel" class="admin-button-com middle blue">添加门店</div>
 		</div>
-		<!-- 删除弹窗 -->
-		<modal-module :show="delModal" @cancel="modalCancel" @click="delModalClick" content="是否要删除该门店" color="#333" :size="32" padding="30upx 30upx"></modal-module>
 	</div>
 </template>
-
 <script>
 import AppAvatarModule from '@/components/module/app-avatar'
 import AppWrapperEmpty from '@/components/app-wrapper-empty'
 import ModalModule from '@/components/plugin/modal'
 import { list } from '@/mixins'
-import { getList, downQrCode, downMemberCode, delShop } from '@/api/shop'
+import { getList } from '@/api/shop'
 import {mapActions} from "vuex";
 export default {
-	name: 'shop-list',
+	name: 'list',
 	components: {
 		AppAvatarModule,
 		AppWrapperEmpty,
@@ -53,37 +45,30 @@ export default {
 	mixins: [list],
 	data() {
 		return {
-			// 删除弹窗操作
-			delModal: false,
-			delModalText: '确定删除该员工吗?',
-			operateData: {}
+
 		}
 	},
 	onPullDownRefresh() {
 		this.resetList()
-		this._list().then(res => {
+		this.getShopList().then(res => {
 			uni.stopPullDownRefresh()
 		})
 	},
 	onReachBottom() {
 		if (!this.list.finished) {
-			this._list().then(res => {
+			this.getShopList().then(res => {
 				uni.stopPullDownRefresh()
 			})
 		} else {
 			uni.stopPullDownRefresh()
 		}
 	},
-	onShow: function() {
-		// this.setUserShopAll()
-		// this.init()
-	},
 	methods: {
 		...mapActions(['setUserShopAll']),
 		async init() {
-			this._list()
+			this.getShopList()
 		},
-		_list() {
+		getShopList() {
 			return getList().then(res => {
 				this.completes(res)
 			})
@@ -91,60 +76,8 @@ export default {
 		toModiyFn(item) {
 			this.pageTo({ url: '/admin/shop/add?id='+item.id})
 		},
-		// 收款码
-		downQrCodeFn(item, index) {
-			downQrCode({ id: item.id })
-			uni.previewImage({
-				urls: [this.$constant.formal + item.gatheringCode]
-			})
-		},
-		viewQrCodeFn(item) {
-			uni.previewImage({
-				urls: item.gatheringCode
-			})
-		},
-	// 添加门店
-	addModel() {
-	uni.removeStorageSync('modifyShopB')
-	this.pageTo({url:'/admin/shop/add'})
-	},
-		// 会员码
-		downMemberCodeFn(item, index) {
-			downMemberCode({ id: item.id })
-			uni.previewImage({
-				urls: [this.$constant.formal + item.applyMemberCode]
-			})
-		},
-		viewMemberCodeFn(item) {
-			uni.previewImage({
-				urls: item.applyMemberCode
-			})
-		},
-		// 关闭弹窗
-		modalCancel() {
-			this.delModal = false
-			this.roleModal = false
-		},
-		// 删除弹窗
-		delModalFn(item) {
-			this.delModalText = this.tabIndex == 0 ? '确定删除该吗?' : '确定删除该角色吗?'
-			this.operateData = item
-			this.delModal = true
-		},
-		delModalClick(e) {
-			let index = e.index
-			if (index === 0) {
-				this.modalCancel()
-			} else {
-				delShop({ id: this.operateData.id }).then(res => {
-					this.modalCancel()
-					this.$msg('删除成功!')
-					setTimeout(() => {
-						this.resetList()
-						this._list()
-					}, 1000)
-				})
-			}
+		addModel() {
+			this.pageTo({url:'/admin/shop/add'})
 		}
 	}
 }
@@ -173,6 +106,16 @@ export default {
 			margin-left: 20upx;
 			@include disFlex(center, space-between);
 			.list-det-left {
+				.first-shop{
+					border:1upx solid #3385FF;
+					background-color:#3385FF;
+					color:white;
+					border-radius:20upx;
+					padding:5upx 10upx 5upx 10upx;
+					margin-left:20upx;
+					font-size:20upx;
+					width:100upx;
+				}
 				.staff-name {
 					color: #333;
 					font-size: 30upx;

+ 2 - 1
ghsApp/src/pages.json

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