shish 2 лет назад
Родитель
Сommit
2a8bb7ef54
4 измененных файлов с 261 добавлено и 1 удалено
  1. 254 0
      ghsApp/src/admin/item/loan.vue
  2. 2 1
      ghsApp/src/admin/order/statBook.vue
  3. 4 0
      ghsApp/src/api/item/index.js
  4. 1 0
      ghsApp/src/pages.json

+ 254 - 0
ghsApp/src/admin/item/loan.vue

@@ -0,0 +1,254 @@
+<template>
+	<view class="app-content">
+		<view class="ex-page">
+			<view class="input-wrap">
+				<view class="search-bar">
+					<app-search-module v-model="py" placeholder="搜索花材" @input="searchFn"/>
+				</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-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;border-radius: 10upx;" @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:30upx;word-wrap: break-word;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:22upx;color:#a09999;margin-top:5upx;">可借 {{productItem.stock ? parseFloat(productItem.stock) : 0 }}</view>
+										</view>
+									</t-td>
+									<t-td>
+										<input type="number" v-model="productItem.bigCount" class="inp-input" placeholder="数量" style="border:1upx solid #CCCCCC;font-size:26upx;color:black;width:95upx;height:40px;" />
+									</t-td>
+									<t-td>
+										<button @click="loanItem(productItem)" class="admin-button-com blue middle">借用</button>
+									</t-td>
+								</t-tr>
+							</block>
+						</block>
+					</t-table>
+				</view>
+			</scroll-view>
+		</view>
+
+		<view class="app-footer">
+        	<button class="admin-button-com big blue" @click="goBack()" style="width:450upx;">返回</button>
+      	</view>
+
+	</view>
+</template>
+<script>
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import SelectList from "@/components/plugin/selectList";
+import { getLoanList } from "@/api/item";
+import { list } from "@/mixins";
+import { mapGetters} from "vuex";
+import AppSearchModule from "@/components/module/app-search";
+import ModalModule from "@/components/plugin/modal"
+import { addItem } from "@/api/order-item";
+import productMins from "@/mixins/product";
+export default {
+	components: { SelectList, AppWrapperEmpty,AppSearchModule,ModalModule},
+	computed: {		
+        ...mapGetters(["getDictionariesInfo","getLoginInfo","getMyShopInfo"])	
+    },
+	mixins: [productMins,list],
+	data() {
+		return {
+			selectJobType: "loan",
+			py:'',
+			currentInfo:{},
+			printLabelShow:false,
+			getAppIdList:{},
+			printItemId:0,
+			printType:0,
+			printNum:'',
+			printFocus:false,
+			warning:0,
+			posterUrl:'',
+			breakNum:'',
+			breakFocus:false,
+			breakShow:false,
+			checkStock:false,
+			T:null
+		};
+	},
+	onLoad() {
+		this.getLoanData()
+
+		this.selectJobId = this.option.id ? this.option.id : 0
+
+		//返回上一页时会刷新
+		let pages = getCurrentPages();
+		let prevPage = pages[ pages.length - 2 ];
+		prevPage.$vm.addSelectItem = 1
+
+	},
+	onPullDownRefresh() {
+		this.resetList();
+		this.getLoanData()
+		uni.stopPullDownRefresh()
+	},
+	onReachBottom() {
+		if (!this.list.finished) {
+			this.getLoanData().then((res) => {
+				uni.stopPullDownRefresh()
+			})
+		} else {
+			uni.stopPullDownRefresh()
+		}
+	},
+	methods: {
+		loanItem(item){
+			let that = this
+			let id = this.option.id ? this.option.id : 0
+			let data = [{id:item.id,bigCount:item.bigCount}]
+			uni.showLoading({mask:true})
+			addItem({data:JSON.stringify(data),id:id}).then(res=>{
+				uni.hideLoading()
+				if(res.code == 1){
+					that.$msg('借用成功')
+					that.goBack()
+				}
+			})
+			item.bigCount=''
+		},
+		goBack(){
+			let pages = getCurrentPages();
+			let prevPage = pages[ pages.length - 2 ];
+			prevPage.$vm.addSelectItem = 1
+			uni.navigateBack()
+		},
+		init(){
+
+		},
+		searchFn(){
+			let that = this
+			if(this.T != null){
+				clearTimeout(this.T)
+			}
+			this.T = setTimeout(function(){
+				that.resetList()
+				that.getLoanData()
+			},700)
+		},
+		getLoanData(){
+			return getLoanList({name:this.py,page: this.list.page}).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;
+		}
+	}
+}
+</style>

+ 2 - 1
ghsApp/src/admin/order/statBook.vue

@@ -235,7 +235,8 @@ export default {
 			this.$util.pageTo({ url: "/admin/book/globalBookCgChange?itemId="+this.currentItem.itemId+'&itemName='+this.currentItem.name+'&id='+this.currentItem.id})
 			this.$util.pageTo({ url: "/admin/book/globalBookCgChange?itemId="+this.currentItem.itemId+'&itemName='+this.currentItem.name+'&id='+this.currentItem.id})
 		},
 		},
 		getStock(){
 		getStock(){
-			this.$msg('开发中')
+			this.$refs.actRef.close()
+			this.$util.pageTo({ url: "/admin/item/loan?itemId="+this.currentItem.itemId})
 		},
 		},
 		selectDateFn(val) {
 		selectDateFn(val) {
 			this.params = {...this.params,...val}
 			this.params = {...this.params,...val}

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

@@ -18,6 +18,10 @@ export const applyAuth = data => {
 	return https.get('/item/apply-auth', data)
 	return https.get('/item/apply-auth', data)
 }
 }
 
 
+export const getLoanList = data => {
+	return https.get('/item/get-loan-list', data)
+}
+
 export const getSimleList = data => {
 export const getSimleList = data => {
 	return https.get('/item/simple-list', data)
 	return https.get('/item/simple-list', data)
 }
 }

+ 1 - 0
ghsApp/src/pages.json

@@ -424,6 +424,7 @@
 				{"path": "sendStock","style": {"navigationBarTitleText": "分配库存"}},
 				{"path": "sendStock","style": {"navigationBarTitleText": "分配库存"}},
 				{"path": "simple","style": {"navigationBarTitleText": "花材"}},
 				{"path": "simple","style": {"navigationBarTitleText": "花材"}},
 				{"path": "select","style": {"navigationBarTitleText": "添加花材"}},
 				{"path": "select","style": {"navigationBarTitleText": "添加花材"}},
+				{"path": "loan","style": {"navigationBarTitleText": "花材列表"}},
 				{"path": "change","style": {"navigationBarTitleText": "更换花材"}},
 				{"path": "change","style": {"navigationBarTitleText": "更换花材"}},
 				{"path": "lakala","style": {"navigationBarTitleText": "拉卡拉"}}
 				{"path": "lakala","style": {"navigationBarTitleText": "拉卡拉"}}
 			]
 			]