hi 3 days ago
parent
commit
59d813c25d

+ 3 - 0
common/request/apis/picking.js

@@ -0,0 +1,3 @@
+// 拣货任务
+export const saleOrder = (params, config = {custom: { auth: true }}) => uni.$u.http.post(`/pda/saleOrder`, params, config)
+// export const bannerList = (params, config = {}) => uni.$u.http.get(`/1`, {params, config, custom: { auth: false }})

+ 4 - 0
common/request/apis/purchase.js

@@ -0,0 +1,4 @@
+// 采购入库
+export const purchaseInventory = (params, config = {custom: { auth: true }}) => uni.$u.http.post(`/pda/purchaseInventory`, params, config)
+// 订单明细
+export const orderDetail = (params, config = {custom: { auth: true }}) => uni.$u.http.get(`/pda/orderDetail/${params}`, config)

+ 4 - 2
common/request/index.js

@@ -20,7 +20,7 @@ module.exports = (vm) => {
 		if(config.custom&&config.custom.auth&&!token){
 			uni.$u.toast('请登录后再操作')
 			setTimeout(()=>{
-				// vm.$Router.push('/pages/account/login/login')
+				vm.$Router.push('/pages/login/login')
 			},1000)
 			return new Promise(() => { })
 		}
@@ -43,7 +43,9 @@ module.exports = (vm) => {
 			}
 		}
 		let data = config.method==="GET" ? config.params : config.data;
-		if(token) data.token = token;
+		if(token) {
+			config.header['x-access-token'] = token
+		}
 		return config;
 	}, config => { // 可使用async await 做异步操作
 		return Promise.reject(config)

+ 30 - 18
common/store/modules/user.js

@@ -59,36 +59,48 @@ const actions = {
 		commit('setisOneLogin', 1);
 
 		commit('setUserInfo', userInfo);
+		uni.$u.toast("登录成功!");
+		setTimeout(()=>{
+			uni.redirectTo({
+				url:'/pages/index/index'
+			})
+		},1500)
 		// dispatch('chat/start', '', {
 		// 	root: true
 		// })
-		const user_id = uni.getStorageSync('user_id')
+		// const user_id = uni.getStorageSync('user_id')
 	},
 	// 退出登录
 	userLogout({
 		commit,
 		dispatch
-	},isPort) {
-		if(isPort) {
-			logout({}).then(res => {
-				if (res.code == 1) {
-					commit('setToken', "");
-					commit('setLogin', false);
-					commit('setisOneLogin', 0);
-					commit('setUserInfo', {});
-					uni.$u.toast(res.msg);
-				} else {
-					uni.$u.toast(res.msg);
-				}
-			}).catch(err => {
-				uni.$u.toast(err.msg);
-			})
-		}else{
+	}) {
+		// if(isPort) {
+		// 	logout({}).then(res => {
+		// 		if (res.code == 1) {
+		// 			commit('setToken', "");
+		// 			commit('setLogin', false);
+		// 			commit('setisOneLogin', 0);
+		// 			commit('setUserInfo', {});
+		// 			uni.$u.toast(res.msg);
+		// 		} else {
+		// 			uni.$u.toast(res.msg);
+		// 		}
+		// 	}).catch(err => {
+		// 		uni.$u.toast(err.msg);
+		// 	})
+		// }else{
 			commit('setToken', "");
 			commit('setLogin', false);
 			commit('setisOneLogin', 0);
 			commit('setUserInfo', {});
-		}
+			uni.$u.toast("退出成功!");
+			setTimeout(()=>{
+				uni.redirectTo({
+					url:'/pages/login/login'
+				})
+			},1500)
+		// }
 		
 	},
 	// 获取权益信息

+ 15 - 9
components/task-item/task-item.vue

@@ -1,19 +1,21 @@
 <template>
 	<view class="task-item">
 		<view class="task-head">
-			<view class="sn-box">单据编号:CGDD00000000692</view>
+			<view class="sn-box">单据编号:{{item.number}}</view>
 			<view v-if="type == 'caigou'">
-				<view class="tips tips-red" v-if="item.type == 0">待入库</view>
-				<view class="tips tips-greed" v-if="item.type == 1">已入库</view>
+				<view class="tips tips-red" v-if="item.status == 1">待入库</view>
+				<view class="tips tips-greed" v-if="item.status == 2">已入库</view>
+				<view class="tips tips-yellow" v-if="item.status == 4">入库中</view>
 			</view>
 			<view v-else>
 				<view class="tips tips-red" v-if="item.type == 0">待拣货</view>
 				<view class="tips tips-greed" v-if="item.type == 1">已拣货</view>
+				<view class="tips tips-greed" v-if="item.type == 1">拣货中</view>
 			</view>
 		</view>
 		<view class="task-line" v-if="type == 'caigou'">
 			<view>供应商:</view>
-			<view>张三贸易有限公司</view>
+			<view>{{item.supplierName}}</view>
 		</view>
 		<view class="task-line" v-else>
 		<view>客户名称:</view>
@@ -21,22 +23,22 @@
 		</view>
 		<view class="task-line">
 			<view>单据日期:</view>
-			<view>2021-11-21 00:00:03</view>
+			<view>{{item.createTime}}</view>
 		</view>
 		<view class="task-line">
 			<view class="task-line2">
 				<view>货物总数:</view>
-				<view class="task-num">55件</view>
+				<view class="task-num">{{item.goodsQuantity}}件</view>
 			</view>
 			<view class="task-line2">
 				<view>货物种类:</view>
-				<view class="task-num">55件</view>
+				<view class="task-num">{{item.goodsTypeCount}}件</view>
 			</view>
 		</view>
 		<view class="task-bottom">
 			<view v-if="type == 'caigou'">
-				<view class="btn btn-1" v-if="item.type == 0" @click="toStorage">去入库</view>
-				<view class="btn btn-2" v-if="item.type == 1" @click="toDetail">详情</view>
+				<view class="btn btn-1" v-if="item.status == 1" @click="toStorage">去入库</view>
+				<view class="btn btn-2" v-else @click="toDetail">详情</view>
 			</view>
 			<view v-else>
 				<view class="btn btn-1" v-if="item.type == 0" @click="toStorage">去出库</view>
@@ -110,6 +112,10 @@
 				color: #00B97B;
 				background: rgba(0, 185, 123, 0.20);
 			}
+			.tips-yellow {
+				color: #F57701;
+				background: rgba(245, 151, 1, 0.20);
+			}
 		}
 	
 		.task-line {

+ 2 - 2
env.js

@@ -1,14 +1,14 @@
 /**
  *  全局配置文件
  */
-export const BASE_URL = process.env.NODE_ENV === "development" ? 'http://192.168.168.26:8080' : 'https://xxxx.com'
+export const BASE_URL = process.env.NODE_ENV === "development" ? 'https://erp.xianglitech.com.cn/prod-api' : 'https://erp.xianglitech.com.cn/prod-api'
 
 
 // 上传路径
 export const UPLOAD_URL = `${BASE_URL}/api/common/upload`
 
 // 全局网络图片地址变量,css背景图片地址变量在uni.scss中定义
-export const UPLOAD_BASE = `https://xxx.com`
+export const UPLOAD_BASE = `https://erp.xianglitech.com.cn/`
 export const IMG_URL = `${UPLOAD_BASE}`
 export const imgurl = ''
 

+ 2 - 2
main.js

@@ -72,8 +72,8 @@ import { downloadFile, goChat, openFile, setCache, exportWord, filterSize, count
 
 // #ifdef APP
 // app文件分享
-import {anyShareFile} from '@/common/js/appFileShare.js'
-Vue.prototype.$anyShareFile = anyShareFile
+// import {anyShareFile} from '@/common/js/appFileShare.js'
+// Vue.prototype.$anyShareFile = anyShareFile
 // #endif
 
 Vue.prototype.$downloadFile = downloadFile

+ 12 - 6
pages.json

@@ -1,12 +1,6 @@
 {
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
 		{
-			"path": "pages/login/login",
-			"style": {
-				"navigationBarTitleText": ""
-			}
-		},
-		{
 			"path": "pages/index/index",
 			"style": {
 				"navigationBarTitleText": "首页"
@@ -19,6 +13,12 @@
 			}
 		},
 		{
+			"path": "pages/login/login",
+			"style": {
+				"navigationBarTitleText": ""
+			}
+		},
+		{
 			"path": "pages/index/app-update",
 			"style": {
 				"navigationBarTitleText": ""
@@ -74,6 +74,12 @@
 			}
 		},
 		{
+			"path": "pages/purchase/detail",
+			"style": {
+				"navigationBarTitleText": ""
+			}
+		},
+		{
 			"path": "pages/check/index",
 			"style": {
 				"navigationBarTitleText": ""

+ 8 - 5
pages/index/components/use-pop.vue

@@ -4,15 +4,15 @@
 			<view class="meun-pop">
 			 <view class="use-cont">
 				 <u-avatar :src="userInfo.avatar" size="44"></u-avatar>
-				 <view class="use-cont-name">{{userInfo.nickName}}</view>
-				 <image class="edit-img" src="@/static/image/home/edit-icon.png" mode=""></image>
+				 <view class="use-cont-name">{{userInfo.username}}</view>
+				 <!-- <image class="edit-img" src="@/static/image/home/edit-icon.png" mode=""></image> -->
 			 </view>
 			 <view class="use-msg">
 				<view class="use-msg-line">
 					<image class="label-icon" src="@/static/image/home/phone-icon.png" mode=""></image>
 					<view class="use-msg-line-cont">
 						<view>手机号</view>
-						<view class="line-value">199188123456</view>
+						<view class="line-value">{{userInfo.phonenum}}</view>
 					</view>
 				</view>
 				<view class="use-msg-line">
@@ -20,13 +20,13 @@
 					<view class="use-msg-line-cont">
 						<view>角色</view>
 						<view class="line-value">
-							<view>仓库管理员</view>
+							<view>{{userInfo.position}}</view>
 							<u-icon name="arrow-right" color="#7E838D"></u-icon>
 						</view>
 					</view>
 				</view>
 			 </view>
-			 <button class="toLoginBtn">
+			 <button class="toLoginBtn" @click="logout">
 			  退出登录
 			 </button>
 			</view>
@@ -60,6 +60,9 @@
 			closeClick() {
 				this.meunShow = false
 				this.$emit('close')
+			},
+			logout() {
+				this.$store.dispatch('userLogout')
 			}
 		}
 	}

+ 2 - 9
pages/index/index.vue

@@ -30,10 +30,7 @@
 
 <script>
 	import usePop from './components/use-pop.vue'
-	const Base64 = require('js-base64').Base64
-	import {
-		bannerList
-	} from '@/common/request/apis/index'
+	// const Base64 = require('js-base64').Base64
 	import {
 		mapGetters
 	} from 'vuex'
@@ -70,10 +67,6 @@
 					}
 				],
 				meunShow:false,
-				userInfo: {
-					avatar:'https://uviewui.com/album/1.jpg',
-					nickName:'快马阳光冰姜'
-				},
 				noticeShow:true
 			}
 		},
@@ -84,7 +77,7 @@
 
 		},
 		computed: {
-			// ...mapGetters(['isLogin'])
+			...mapGetters(['isLogin','userInfo'])
 		},
 		methods: {
 			meunClick() {

+ 18 - 15
pages/login/components/account-login.vue

@@ -8,14 +8,12 @@
       labelAlign="left"
       labelPosition="top"
     >
-      <u-form-item prop="loginName" label="手机号">
+      <u-form-item prop="loginName" label="号">
         <view class="input-line">
 					<u-input
-							placeholder="请输入手机号"
+							placeholder="请输入号"
 							v-model="model.loginName"
 							border="none"
-							type="number"
-							maxlength="11"
 					></u-input>
         </view>
       </u-form-item>
@@ -36,6 +34,7 @@
 
 <script>
 	import {login} from '@/common/request/apis/login'
+	import md5 from '@/common/request/md5.js'
 	export default{
 		data() {
 			return {
@@ -47,22 +46,26 @@
 		},
 		methods:{
 			accountLoginSubmit() {
-			  // if(!uni.$u.test.mobile(this.model.mobile)){
-			  // 	return uni.$u.toast("请输入正确手机号");
-			  // }
+			  if(!this.model.loginName){
+			  	return uni.$u.toast("请输入账号");
+			  }
 			  if(!this.model.password) {
 			  	return uni.$u.toast("请输入密码");
 			  }
-			  uni.$u.toast("登录成功!");
-				login(this.model)
+				let params = {
+					...this.model,
+					password: md5(this.model.password)
+				}
+				login(params)
 				.then(res=>{
-					
+					if(res.code == 200) {
+						let userInfo = {
+							token:res.data.token,
+							...res.data.user
+						}
+						this.$store.dispatch('userLogin',userInfo)
+					}
 				})
-			  // setTimeout(()=>{
-					// uni.redirectTo({
-					// 	url:'/pages/index/index'
-					// })
-			  // },1000)
 			}
 		}
 	}

+ 10 - 0
pages/picking-task/detail.vue

@@ -125,6 +125,7 @@
 
 <script>
 	import goodItem from '@/components/good-item/good-item.vue'
+	import {orderDetail} from '@/common/request/apis/purchase'
 	export default {
 		components: {
 			goodItem,
@@ -150,7 +151,16 @@
 				]
 			}
 		},
+		onLoad(e) {
+			console.log(e)
+		},
 		methods:{
+			getOrderDetail() {
+				orderDetail()
+				.then(res=>{
+					
+				})
+			},
 			submitClick() {
 				
 			},

+ 70 - 24
pages/picking-task/index.vue

@@ -9,7 +9,7 @@
 		<view class="container_main">
 			<u-sticky :offsetTop="offsetTop" bgColor="#F0F6FB">
 				<view class="search-box">
-					<u-search placeholder="请输入单据编号" bgColor="#fff" shape="square" v-model="searchKey" :showAction="false"></u-search>
+					<u-search placeholder="请输入单据编号" bgColor="#fff" shape="square" v-model="params.number" :showAction="false" @search="searchClick"></u-search>
 					<view class="flex_box">
 						<view class="scan-text">扫描单据二维码</view>
 						<view class="scan-icon">
@@ -18,11 +18,11 @@
 					</view>
 				</view>
 				<view class="type-box flex_box">
-					<view class="type-item">
+					<view class="type-item" @click="tabClick(1)">
 						<view class="type-val">{{type1}}</view>
 						<u-icon name="arrow-down-fill" color="#999999" size="12"></u-icon>
 					</view>
-					<view class="type-item">
+					<view class="type-item" @click="tabClick(2)">
 						<view class="type-val">{{type2}}</view>
 						<u-icon name="arrow-down-fill" color="#999999" size="12"></u-icon>
 					</view>
@@ -35,13 +35,18 @@
 			</view>
 		</view>
 		<!-- 中心仓弹窗 -->
-		<u-picker :show="stashShow" :defaultIndex="defaultIndex" :columns="columnsList" @confirm="pickerConfirm" @cancel="stashShow= false"></u-picker>
-
+		<u-picker :show="stashShow" :defaultIndex="defaultIndex" :columns="stashColumns" @confirm="pickerConfirm" @cancel="stashShow= false"></u-picker>
+		<!-- 状态 -->
+		<u-picker :show="statusShow" :defaultIndex="defaultIndex2" :columns="statusColumns" @confirm="statusConfirm" @cancel="statusShow= false"></u-picker>
+		<!-- 月份 -->
+		<u-picker :show="dateShow" :defaultIndex="defaultIndex3" :columns="dateColumns" @confirm="dateConfirm" @cancel="dateShow= false"></u-picker>
+		
 	</view>
 </template>
 
 <script>
 	import taskItem from '@/components/task-item/task-item.vue'
+	import {saleOrder} from '@/common/request/apis/picking'
 	export default{
 		components:{
 			taskItem
@@ -50,48 +55,89 @@
 			return {
 				offsetTop:0,
 				cangName:'鹏越中心仓',
-				searchKey:'',
 				type1:'全部',
 				type2:'月份',
 				stashShow:false,
-				columnsList:[],
+				statusShow:false,
+				dateShow:false,
 				stashColumns:[
 					['鹏越中心仓','美团中心仓']
 				],
+				statusColumns:[
+					['全部','待拣货','已拣货','拣货中']
+				],
+				dateColumns:[
+					['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月']
+				],
 				defaultIndex:[],
-				pickType:0,//1.中心仓
-				taskList:[
-					{
-						type:0
-					},
-					{
-						type:1
-					}
-				]
+				defaultIndex2:[],
+				defaultIndex3:[],
+				taskList:[],
+				params:{
+					beginTime:'',
+					endTime:'',
+					number:'',
+					status:0
+				}
 			}
 		},
 		onLoad() {
 			let systemInfo = uni.getSystemInfoSync();
 			let statusBarHeight = systemInfo.statusBarHeight;
 			this.offsetTop = statusBarHeight + 40
+			this.getSaleOrder()
 		},
 		methods:{
+			searchClick() {
+				this.getPurchaseInventory()
+			},
+			tabClick(type) {
+				if(type == 1) {
+					this.defaultIndex = this.getDefaultIndex(this.type1,this.statusColumns)
+					this.statusShow = true
+				}else {
+					this.defaultIndex = this.getDefaultIndex(this.type2,this.dateColumns)
+					this.dateShow = true
+				}
+			},
+			getSaleOrder() {
+				saleOrder(this.params)
+				.then(res=>{
+					if(res.code == 200) {
+						this.taskList = res.data.rows;
+					}
+				})
+			},
 			stashClick() {
-				this.pickType = 1
-				this.columnsList = this.stashColumns
-				this.defaultIndex = this.getDefaultIndex(this.cangName)
+				this.defaultIndex = this.getDefaultIndex(this.cangName,this.stashColumns)
 				this.stashShow = true
 			},
 			pickerConfirm(val) {
-				if(this.pickType == 1) {
-					this.cangName = val.value[0]
-				}
+				this.cangName = val.value[0]
 				this.stashShow = false
 			},
+			statusConfirm(val) {
+				this.type1 = val.value[0]
+				this.statusShow = false
+			},
+			dateConfirm(val) {
+				this.type2 = val.value[0]
+				this.dateShow = false
+				let month = val.indexs[0]
+				this.getLastDayOfMonth(month)
+				this.getSaleOrder()
+			},
+			// 获取开始时间、结束时间
+			getLastDayOfMonth(month) {
+				let year = new Date().getFullYear()
+			  let monthStart = new Date(year, month + 1, 0).getDate();
+				this.params.beginTime = `${year}-${month + 1}-01`
+				this.params.endTime = `${year}-${month + 1}-${monthStart}`
+			},
 			// 获取picker默认index
-			getDefaultIndex(val) {
+			getDefaultIndex(val,list) {
 				let arr = []
-				let index = this.columnsList[0].findIndex(item=>item == val)
+				let index = list[0].findIndex(item=>item == val)
 				arr = [index]
 				return arr
 			},

+ 359 - 0
pages/purchase/detail.vue

@@ -0,0 +1,359 @@
+<template>
+	<view class="deliver-page">
+		<u-navbar height="40px" title="采购订单详情" bgColor="#0256FF" :titleStyle="{color:'#fff'}" leftIconColor="#fff" autoBack
+			placeholder>
+		</u-navbar>
+		<view class="container_main">
+			<view class="info-box" :class="isUnfold ? '':'min-height'">
+				<view class="info-line">
+					<view class="info-line-label">
+						<text>入库单号</text>
+					</view>
+					<view class="info-line-value">
+						RK-20250403164422
+					</view>
+				</view>
+				<view class="info-line">
+					<view class="info-line-label">
+						<text>收入仓库</text>
+					</view>
+					<view class="info-line-value">
+						我的仓库
+					</view>
+				</view>
+				<view class="info-line">
+					<view class="info-line-label">
+						<text>供应商</text>
+					</view>
+					<view class="info-line-value">
+						哇嘎嘎
+					</view>
+				</view>
+				<view class="info-line">
+					<view class="info-line-label">
+						<text>入库数量</text>
+					</view>
+					<view class="info-line-value">
+						1
+					</view>
+				</view>
+				<view class="info-line">
+					<view class="info-line-label">
+						<text>入库种类</text>
+					</view>
+					<view class="info-line-value">
+						1
+					</view>
+				</view>
+				<view class="info-line">
+					<view class="info-line-label">
+						<text>制单日期</text>
+					</view>
+					<view class="info-line-value">
+						2025-04-03
+					</view>
+				</view>
+				<view class="info-line">
+					<view class="info-line-label">
+						<text>制单人</text>
+					</view>
+					<view class="info-line-value">
+						刘双强
+					</view>
+				</view>
+				<view class="info-line">
+					<view class="info-line-label">
+						<text>入库类型</text>
+					</view>
+					<view class="info-line-value">
+						销售入库
+					</view>
+				</view>
+				<view class="info-line">
+					<view class="info-line-label">
+						<text>入库人</text>
+					</view>
+					<view class="info-line-value">
+						刘双美
+					</view>
+				</view>
+				<view class="info-line">
+					<view class="info-line-label">
+						<text>备注信息</text>
+					</view>
+					<view class="info-line-value">
+						备注备注备注备注备注
+					</view>
+				</view>
+				<view class="info-line">
+					<view class="info-line-label">
+						<text>入库时间</text>
+					</view>
+					<view class="info-line-value">
+						2025-04-03 16:44
+					</view>
+				</view>
+				
+				
+			</view>
+			<view class="btn-box">
+				<view class="btn-cont" @click="isUnfold = !isUnfold">
+					<text>{{isUnfold ? '收起' : '展开'}}</text>
+					<u-icon :name="isUnfold?'arrow-up':'arrow-down'"></u-icon>
+				</view>
+			</view>
+
+			<!-- 货物清单 -->
+			<view class="cargo-list">
+				<view class="cargo-list-title">
+					<view>出库货物清单</view>
+					<view class="cargo-list-title-tips">(轻触货物查看详情)</view>
+				</view>
+				<block v-for="(item,i) in goodsList" :key="i">
+					<good-item :item="item" @toDetail="toDetail">
+						<view class="num-box">
+							<view class="num-box-text">已确认出库数量</view>
+							<u-number-box v-model="value" disabled>
+								<view slot="minus" class="minus">
+									<u-icon name="minus" color="#DADADA" size="12"></u-icon>
+								</view>
+								<text slot="input" class="input">{{value}}</text>
+								<view slot="plus" class="plus">
+									<u-icon name="plus" color="#FFFFFF" size="12"></u-icon>
+								</view>
+							</u-number-box>
+						</view>
+					</good-item>
+				</block>
+			</view>
+		</view>
+		
+	</view>
+</template>
+
+<script>
+	import goodItem from '@/components/good-item/good-item.vue'
+	import {orderDetail} from '@/common/request/apis/purchase'
+	export default {
+		components: {
+			goodItem,
+		},
+		data() {
+			return {
+				errorShow:false,
+				successShow:false,
+				value:0,
+				isUnfold: true, //是否展开
+				info: {
+					mark: '',
+					url: ''
+				},
+				goodsList: []
+			}
+		},
+		onLoad(e) {
+			console.log(e)
+			this.getOrderDetail(e.id)
+		},
+		methods:{
+			getOrderDetail(id) {
+				orderDetail(id)
+				.then(res=>{
+					if(res.code == 200) {
+						this.goodsList = res.data.rows
+					}
+				})
+			},
+			submitClick() {
+				
+			},
+			confirm() {
+				console.log('确定')
+				this.errorShow = false
+			},
+			backClick() {
+				
+			},
+			// 扫码确认
+			scanConfirm() {
+				
+			},
+			manualClick() {
+				this.goodsShow = true
+			},
+			toDetail() {
+				uni.navigateTo({
+					url:'/pages/goods/detail'
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.deliver-page {
+		min-height: 100vh;
+		background-color: #F0F6FB;
+		padding-bottom: 130rpx;
+
+		.container_main {
+			padding: 24rpx;
+
+			.info-box {
+				background-color: #fff;
+				border-radius: 16rpx 16rpx 0 0;
+				padding: 24rpx 24rpx 0 24rpx;
+
+				.info-line {
+					border-bottom: 1px solid #F4F4F4;
+					min-height: 92rpx;
+					color: #333;
+					font-family: "PingFang SC";
+					font-size: 28rpx;
+					font-weight: 400;
+					display: flex;
+					align-items: center;
+
+					&-label {
+						width: 162rpx;
+					}
+
+					.must-box {
+						color: #FF3B1D;
+					}
+				}
+			}
+
+			.min-height {
+				height: 300rpx;
+				overflow: hidden;
+			}
+
+			.btn-box {
+				height: 112rpx;
+				display: flex;
+				align-items: center;
+				justify-content: center;
+				background-color: #fff;
+				border-radius: 0 0 16rpx 16rpx;
+
+				.btn-cont {
+					display: flex;
+					align-items: center;
+					justify-content: center;
+					width: 154rpx;
+					height: 56rpx;
+					border-radius: 120rpx;
+					border: 1px solid #D9D9D9;
+					color: #666;
+					font-family: "PingFang SC";
+					font-size: 28rpx;
+					font-weight: 400;
+				}
+			}
+
+			.cargo-list {
+				padding: 24rpx 0;
+				background-color: #fff;
+				margin-top: 24rpx;
+				border-radius: 16rpx;
+
+				.cargo-list-title {
+					font-family: "PingFang SC";
+					font-size: 32rpx;
+					font-style: normal;
+					font-weight: bold;
+					display: flex;
+					align-items: center;
+					position: relative;
+					padding-left: 50rpx;
+
+					&::after {
+						content: '';
+						display: block;
+						width: 6rpx;
+						height: 30rpx;
+						border-radius: 100px;
+						background: #0256FF;
+						position: absolute;
+						top: 50%;
+						left: 24rpx;
+						transform: translateY(-50%);
+					}
+
+					.cargo-list-title-tips {
+						color: #0256FF;
+						font-size: 24rpx;
+						font-weight: 400;
+					}
+				}
+
+				.num-box {
+					display: flex;
+					align-items: center;
+					justify-content: space-between;
+					padding: 0 48rpx 0 26rpx;
+					.num-box-text {
+						color: #666;
+						font-family: "PingFang SC";
+						font-size: 28rpx;
+						font-weight: 400;
+					}
+					.input {
+						width: 112rpx;
+						text-align: center;
+						border-bottom: 1px solid #DADADA;
+						margin: 0 8rpx;
+					}
+					.minus {
+						width: 40rpx;
+						height: 40rpx;
+						border-radius: 8rpx;
+						border: 1px solid #DADADA;
+						display: flex;
+						align-items: center;
+						justify-content: center;
+					}
+					.plus {
+						width: 40rpx;
+						height: 40rpx;
+						border-radius: 8rpx;
+						background-color: #DADADA;
+						display: flex;
+						align-items: center;
+						justify-content: center;
+					}
+				}
+			}
+		}
+		
+		.footer-box {
+			background-color: #fff;
+			height: 126rpx;
+			position: fixed;
+			bottom: 0;
+			left: 0;
+			right: 0;
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+			padding: 0 40rpx 0 60rpx;
+			.footer-box-l {
+				color: #666;
+				font-family: "PingFang SC";
+				font-size: 28rpx;
+				font-weight: 400;
+			}
+			.submitBtn {
+				width: 362rpx;
+				height: 76rpx;
+				border-radius: 16rpx;
+				background: #0256FF;
+				color: #FFF;
+				font-size: 28rpx;
+				font-weight: 500;
+				margin: 0;
+			}
+		}
+	}
+</style>

+ 106 - 24
pages/purchase/index.vue

@@ -9,7 +9,7 @@
 		<view class="container_main">
 			<u-sticky :offsetTop="offsetTop" bgColor="#F0F6FB">
 				<view class="search-box">
-					<u-search placeholder="请输入单据编号" bgColor="#fff" shape="square" v-model="searchKey" :showAction="false"></u-search>
+					<u-search placeholder="请输入单据编号" bgColor="#fff" shape="square" v-model="params.number" :showAction="false" @search="searchClick"></u-search>
 					<view class="flex_box">
 						<view class="scan-text">扫描单据二维码</view>
 						<view class="scan-icon">
@@ -18,11 +18,11 @@
 					</view>
 				</view>
 				<view class="type-box flex_box">
-					<view class="type-item">
+					<view class="type-item" @click="tabClick(1)">
 						<view class="type-val">{{type1}}</view>
 						<u-icon name="arrow-down-fill" color="#999999" size="12"></u-icon>
 					</view>
-					<view class="type-item">
+					<view class="type-item" @click="tabClick(2)">
 						<view class="type-val">{{type2}}</view>
 						<u-icon name="arrow-down-fill" color="#999999" size="12"></u-icon>
 					</view>
@@ -32,16 +32,22 @@
 				<block v-for="(item,i) in taskList" :key="i">
 					<task-item :item="item" @toStorage="toStorage" @toDetail="toDetail" type="caigou"></task-item>
 				</block>
+				<u-empty mode="data" v-if="taskList.length == 0"></u-empty>
 			</view>
 		</view>
 		<!-- 中心仓弹窗 -->
-		<u-picker :show="stashShow" :defaultIndex="defaultIndex" :columns="columnsList" @confirm="pickerConfirm" @cancel="stashShow= false"></u-picker>
-
+		<u-picker :show="stashShow" :defaultIndex="defaultIndex" :columns="stashColumns" @confirm="pickerConfirm" @cancel="stashShow= false"></u-picker>
+		<!-- 状态 -->
+		<u-picker :show="statusShow" keyName="name" :defaultIndex="defaultIndex2" :columns="statusColumns" @confirm="statusConfirm" @cancel="statusShow= false"></u-picker>
+		<!-- 月份 -->
+		<u-picker :show="dateShow" :defaultIndex="defaultIndex3" :columns="dateColumns" @confirm="dateConfirm" @cancel="dateShow= false"></u-picker>
+		
 	</view>
 </template>
 
 <script>
 	import taskItem from '@/components/task-item/task-item.vue'
+	import {purchaseInventory} from '@/common/request/apis/purchase'
 	export default{
 		components:{
 			taskItem
@@ -54,44 +60,120 @@
 				type1:'全部',
 				type2:'月份',
 				stashShow:false,
-				columnsList:[],
+				stashShow:false,
+				statusShow:false,
+				dateShow:false,
 				stashColumns:[
 					['鹏越中心仓','美团中心仓']
 				],
+				statusColumns:[
+					[{
+						name:'全部',
+						id:''
+					},{
+						name:'待入库',
+						id:'1'
+					},{
+						name:'入库中',
+						id:'4'
+					},{
+						name:'已入库',
+						id:'2'
+					}]
+				],
+				dateColumns:[
+					['全年','一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月']
+				],
 				defaultIndex:[],
-				pickType:0,//1.中心仓
-				taskList:[
-					{
-						type:0
-					},
-					{
-						type:1
-					}
-				]
+				defaultIndex2:[],
+				defaultIndex3:[],
+				taskList:[],
+				params:{
+					beginTime:'',
+					endTime:'',
+					number:'',
+					status:'',
+					pageNum:1,
+					pageSize:10
+				}
 			}
 		},
 		onLoad() {
 			let systemInfo = uni.getSystemInfoSync();
 			let statusBarHeight = systemInfo.statusBarHeight;
 			this.offsetTop = statusBarHeight + 40
+			this.init()
 		},
 		methods:{
+			init() {
+				uni.showLoading()
+				this.params.pageNum = 1
+				this.getPurchaseInventory()
+			},
+			searchClick() {
+				this.init()
+			},
+			tabClick(type) {
+				if(type == 1) {
+					this.defaultIndex = this.getDefaultIndex(this.type1,this.statusColumns)
+					this.statusShow = true
+				}else {
+					this.defaultIndex = this.getDefaultIndex(this.type2,this.dateColumns)
+					this.dateShow = true
+				}
+			},
+			getPurchaseInventory() {
+				purchaseInventory(this.params)
+				.then(res=>{
+					if(res.code == 200) {
+						this.taskList = res.data.rows;
+					}
+					uni.hideLoading()
+				})
+				.catch(err=>{
+					uni.hideLoading()
+				})
+			},
 			stashClick() {
-				this.pickType = 1
-				this.columnsList = this.stashColumns
-				this.defaultIndex = this.getDefaultIndex(this.cangName)
+				this.defaultIndex = this.getDefaultIndex(this.cangName,this.stashColumns)
 				this.stashShow = true
 			},
 			pickerConfirm(val) {
-				if(this.pickType == 1) {
-					this.cangName = val.value[0]
-				}
+				this.cangName = val.value[0]
 				this.stashShow = false
 			},
+			statusConfirm(val) {
+				this.type1 = val.value[0].name
+				this.params.status = val.value[0].id
+				this.statusShow = false
+				this.params.pageNum = 1
+				this.getPurchaseInventory()
+			},
+			dateConfirm(val) {
+				this.type2 = val.value[0]
+				this.dateShow = false
+				let month = val.indexs[0]
+				this.getLastDayOfMonth(month)
+				uni.showLoading()
+				this.init()
+			},
+			// 获取开始时间、结束时间
+			getLastDayOfMonth(month) {
+				let year = new Date().getFullYear()
+				if(month !=0) {
+					let monthStart = new Date(year, month, 0).getDate();
+					this.params.beginTime = `${year}-${month}-01`
+					this.params.endTime = `${year}-${month}-${monthStart}`
+				}else {
+					this.params.beginTime = ''
+					this.params.endTime = ''
+				}
+				
+			},
 			// 获取picker默认index
-			getDefaultIndex(val) {
+			getDefaultIndex(val,list) {
 				let arr = []
-				let index = this.columnsList[0].findIndex(item=>item == val)
+				let index = list[0].findIndex(item=>item == val)
 				arr = [index]
 				return arr
 			},
@@ -103,7 +185,7 @@
 			},
 			toDetail(val) {
 				uni.navigateTo({
-					url:'/pages/picking-task/detail'
+					url:`/pages/purchase/detail?id=${val.id}`
 				})
 			}
 		}

+ 1 - 1
uni_modules/uview-ui/components/u-icon/u-icon.vue

@@ -161,7 +161,7 @@
 	// 非nvue下加载字体
 	@font-face {
 		font-family: 'uicon-iconfont';
-		src: url('/static/font_2225171_8kdcwk4po24.ttf') format('truetype');
+		src: url('https://at.alicdn.com/t/font_2225171_8kdcwk4po24.ttf') format('truetype');
 	}
 
 	/* #endif */