shish 2 лет назад
Родитель
Сommit
fcc5dd746e

+ 256 - 0
ghsApp/src/admin/item/change.vue

@@ -0,0 +1,256 @@
+<template>
+	<view class="app-content">
+		<view class="ex-page">
+			<view class="input-wrap">
+				<view class="search-bar">
+					<input type="text" v-model="py" class="inp-input" placeholder="这里搜索" @input="searchFn"
+					style="border:none;font-size:30upx;color:black;background-color:#ece5e5;border-radius:50upx;height:70upx;padding:0 25upx 0 25upx;" @focus="clear()" />
+				</view>
+			</view>
+			<scroll-view scroll-y scroll-with-animation class="main-view">
+				<view class="space-view ex-table">
+					<t-table :headerBackgroundColor="'#F0F2F6'">
+						<t-tr header>
+							<t-th>图片</t-th>
+							<t-th><view style="width:230upx;">名称</view></t-th>
+							<t-th>价格</t-th>
+							<t-th>数量</t-th>
+							<t-th>操作</t-th>
+						</t-tr>
+						<block v-if="!$util.isEmpty(list.data)">
+							<block v-for="(productItem, productIndex) in list.data" :key="productIndex">
+								<t-tr>
+									<t-td>
+										<image :src="productItem.smallCover" style="width:80upx;height:80upx;" @click="pageTo({url:'/admin/item/detail?id='+productItem.id})"></image>
+									</t-td>
+									<t-td>
+										<view style="width:230upx;text-align:left;color:black;font-size:26upx;overflow: hidden; white-space: nowrap;font-weight:bold;" 
+										@click="pageTo({url:'/admin/item/detail?id='+productItem.id})">
+											<text style="color:#3385ff;margin-right:3upx;" v-if="productItem.frontHide == 1">隐</text>
+											{{productItem.name}}
+											<view style="font-weight:normal;font-size:24upx;color:#a09999;margin-top:5upx;">剩 {{productItem.stock ? parseFloat(productItem.stock) : 0 }}</view>
+										</view>
+									</t-td>
+									<t-td>
+										<input type="digit" v-model="productItem.price" class="inp-input" placeholder="价格" style="border:1upx solid #CCCCCC;font-size:24upx;color:black;" />
+									</t-td>
+									<t-td>
+										<input type="number" v-model="productItem.bigCount" class="inp-input" placeholder="数量" style="border:1upx solid #CCCCCC;font-size:24upx;color:black;" />
+									</t-td>
+									<t-td>
+										<button @click="changeItem(productItem)" class="admin-button-com blue mini-btn">更换</button>
+									</t-td>
+								</t-tr>
+							</block>
+						</block>
+					</t-table>
+				</view>
+			</scroll-view>
+		</view>
+	</view>
+</template>
+<script>
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import SelectList from "@/components/plugin/selectList";
+import { getSimleList } from "@/api/item";
+import { list } from "@/mixins";
+import ShopSelect from "@/components/module/shopSelect";
+import DateSelect from "@/components/module/dateSelect";
+import {mapActions, mapGetters} from "vuex";
+import AppSearchModule from "@/components/module/app-search";
+import ModalModule from "@/components/plugin/modal"
+import { addItem,filterName,chageItem } from "@/api/order-item";
+import productMins from "@/mixins/product";
+export default {
+	components: { SelectList, AppWrapperEmpty,ShopSelect,DateSelect,AppSearchModule,ModalModule},
+	computed: {		
+        ...mapGetters(["getDictionariesInfo","getLoginInfo","getMyShopInfo"])	
+    },
+	mixins: [productMins,list],
+	data() {
+		return {
+			selectJobType: "selectchangeitem",
+			py:'',
+			num:0,
+			currentInfo:{},
+			printLabelShow:false,
+			printItemId:0,
+			printType:0,
+			printNum:'',
+			printFocus:false,
+			warning:0,
+			posterUrl:'',
+			breakNum:'',
+			breakFocus:false,
+			breakShow:false,
+			checkStock:false
+		};
+	},
+	onLoad() {
+		let id = this.option.id?this.option.id:0
+		filterName({id:id}).then(res=>{
+			if(res.code == 1){
+				this.py = res.data.name ? res.data.name : ''
+				this.num = res.data.num ? res.data.num : 0
+				this.getSimpleData()
+			}
+		})
+	},
+	onPullDownRefresh() {
+		this.resetList();
+		this.getSimpleData()
+		uni.stopPullDownRefresh()
+	},
+	onReachBottom() {
+		if (!this.list.finished) {
+			this.getSimpleData().then((res) => {
+				uni.stopPullDownRefresh()
+			})
+		} else {
+			uni.stopPullDownRefresh()
+		}
+	},
+	methods: {
+		changeItem(item){
+			let orderSn = this.option.orderSn?this.option.orderSn:''
+			let id = this.option.id ? this.option.id : 0
+			let num = item.bigCount ? item.bigCount : 0
+			if(Number(num)<=0){
+				this.$msg('请填写数量')
+				return false
+			}
+			let price = item.price?item.price:0
+			let productId = item.id?item.id:0
+			chageItem({orderSn:orderSn,delId:id,num:num,price:price,productId:productId}).then(res=>{
+				if(res.code == 1){
+					this.$msg(res.msg)
+					let pages = getCurrentPages();
+					let prevPage = pages[ pages.length - 2 ];
+					prevPage.$vm.addSelectItem = 1
+					uni.navigateBack()
+				}
+			})
+		},
+		init(){
+
+		},
+		clear(){
+			this.py=''
+			this.getSimpleData()
+		},
+		searchFn(){
+			this.resetList()
+			this.getSimpleData()
+		},
+		getSimpleData(){
+			let that = this
+			return getSimleList({name:this.py,page: this.list.page,num:this.num}).then(res=>{
+				this.completes(res)
+				if (this.$util.isEmpty(res.data)){
+					return false
+				}
+			})
+		}
+	}
+};
+</script>
+<style lang="scss" scoped>
+.ex-page {
+	background: white;
+	height: 100%;
+	display: flex;
+	flex-direction: column;
+	.input-wrap {
+		display: flex;
+		padding: 22upx 20upx 22upx 13upx;
+		.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;
+			}
+		}
+	}
+	.top-bar {
+		position: absolute;
+		left: 0;
+		display: flex;
+		width: 100%;
+		top:130upx;
+		z-index: 20;
+		.bar{
+			width: 50%;
+			height: 100%;
+			text-align: center;
+			&:nth-child(1){
+				border-right: 1upx solid #eeeeec;
+			}
+		}
+	}
+	.main-view {
+		margin-top:10upx;
+		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 {
+			::v-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 - 0
ghsApp/src/api/order-item/index.js

@@ -1,5 +1,9 @@
 import https from "@/plugins/luch-request_0.0.7/request";
 
+export const chageItem = data => {
+	return https.post("/order-item/change-item", data);
+};
+
 export const modifyBookItem = data => {
 	return https.post("/order-item/modify-book-item", data);
 };
@@ -25,4 +29,8 @@ export const getOrderProduct = data => {
 //根据花材获取订单
 export const getOrderInfoList = data => {
 	return https.get("/order-item/get-order-info-list", data);
+};
+
+export const filterName = data => {
+	return https.get("/order-item/filter-name", data);
 };

+ 2 - 1
ghsApp/src/pages.json

@@ -417,7 +417,8 @@
 				{"path": "rechargeHb","style": {"navigationBarTitleText": "充值活动"}},
 				{"path": "sendStock","style": {"navigationBarTitleText": "分配库存"}},
 				{"path": "simple","style": {"navigationBarTitleText": "花材"}},
-				{"path": "select","style": {"navigationBarTitleText": "选花材"}},
+				{"path": "select","style": {"navigationBarTitleText": "添加花材"}},
+				{"path": "change","style": {"navigationBarTitleText": "更换花材"}},
 				{"path": "lakala","style": {"navigationBarTitleText": "拉卡拉"}}
 			]
 		},

+ 9 - 1
ghsApp/src/pagesOrder/arrival.vue

@@ -13,7 +13,7 @@
 							<button v-if="detailInfo.book == 1 && detailInfo.status == 2 && parseFloat(detailInfo.actPrice) == 0" style="position:absolute;left:26upx;font-size:22upx;" class="admin-button-com default mini-btn" @click="changeOption(s)">更换</button>
 							<button v-if="detailInfo.book == 1 && detailInfo.status == 2 && parseFloat(detailInfo.actPrice) == 0" style="position:absolute;top:95upx;left:26upx;font-size:22upx;" class="admin-button-com default mini-btn" @click="delOption(s)">删除</button>
 
-							<text style="position:absolute;left:155upx;top:103upx;color:#3385FF;cursor: pointer" @click="giveItemFn(s)">挪库存</text>
+							<text style="position:absolute;left:155upx;top:103upx;color:#3385FF;cursor: pointer" @click="getStockFn(s)">挪库存</text>
 
 							<text style="position:absolute;left:608upx;top:120upx;color:#CCCCCC;font-size:21upx;">剩 {{ s.stock }}</text>
 							<text style="position:absolute;left:442upx;top:120upx;color:#CCCCCC;font-size:21upx;">成本{{ s.cost?parseFloat(s.cost):0 }}</text>
@@ -156,6 +156,14 @@ export default {
 		}
 	},
 	methods: {
+		changeOption(info){
+			let id = info.id ? info.id : 0
+			let orderSn = info.orderSn ? info.orderSn : ''
+			this.$util.pageTo({url: '/admin/item/change?id='+id+'&orderSn='+orderSn})
+		},
+		getStockFn(info){
+			this.$msg('开发中')
+		},
 		addItem(info){
 			let id = info.id ? info.id : 0
 			this.$util.pageTo({url: '/admin/item/select?id='+id})

+ 4 - 2
ghsApp/src/pagesOrder/detail.vue

@@ -646,8 +646,10 @@ export default {
 				})
 			})
 		},
-		changeOption(item){
-
+		changeOption(info){
+			let id = info.id ? info.id : 0
+			let orderSn = info.orderSn ? info.orderSn : ''
+			this.$util.pageTo({url: '/admin/item/change?id='+id+'&orderSn='+orderSn})
 		},
 		delOption(item){
 			let that = this