hi 2 days ago
parent
commit
4ede3caff3

+ 5 - 1
common/request/apis/purchase.js

@@ -1,4 +1,8 @@
 // 采购入库
 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)
+export const orderDetail = (params, config = {custom: { auth: true }}) => uni.$u.http.get(`/pda/orderDetail/${params}`, config)
+// 订单明细上部
+export const orderInfo = (params, config = {custom: { auth: true }}) => uni.$u.http.get(`/pda/orderInfo/${params}`, config)
+// 订单操作、去入库/去拣货
+export const orderStartHandle = (params, config = {custom: { auth: true }}) => uni.$u.http.get(`/pda/orderStartHandle/${params}`, config)

+ 8 - 8
components/good-item/good-item.vue

@@ -7,34 +7,34 @@
 				height="128rpx"
 			></u-image>
 			<view class="ss-m-l-16">
-				<view class="good-msg-name">{{item.name}}</view>
-				<view class="good-msg-txm">条形码:6904045405</view>
+				<view class="good-msg-name">{{item.materialName}}</view>
+				<view class="good-msg-txm">条形码:{{item.barCode}}</view>
 			</view>
 		</view>
 		<view class="good-cont">
 			<view class="good-cont-item">
 				<view class="item-label">规格</view>
-				<view class="item-value">205ml</view>
+				<view class="item-value">{{item.materialStandard || '-'}}</view>
 			</view>
 			<view class="good-cont-item">
 				<view class="item-label">批次号</view>
-				<view class="item-value">12345678966</view>
+				<view class="item-value">{{item.batchNumber || '-'}}</view>
 			</view>
 			<view class="good-cont-item">
 				<view class="item-label">生产日期</view>
-				<view class="item-value">2025-04-03</view>
+				<view class="item-value">{{item.productionDate || '-'}}</view>
 			</view>
 			<view class="good-cont-item">
 				<view class="item-label">库存</view>
-				<view class="item-value">20瓶</view>
+				<view class="item-value">{{item.inventory || '0'}}{{item.commodityUnit || ''}}</view>
 			</view>
 			<view class="good-cont-item">
 				<view class="item-label">库位</view>
-				<view class="item-value">A区3-1-1</view>
+				<view class="item-value">{{item.position || '-'}}</view>
 			</view>
 			<view class="good-cont-item">
 				<view class="item-label">订单数量</view>
-				<view class="item-value">20瓶</view>
+				<view class="item-value">{{item.operNumber || '0'}}{{item.materialUnit || ''}}</view>
 			</view>
 		</view>
 		<slot></slot>

+ 6 - 6
components/task-item/task-item.vue

@@ -8,9 +8,9 @@
 				<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 class="tips tips-red" v-if="item.status == 0">待拣货</view>
+				<view class="tips tips-greed" v-if="item.status == 1">已拣货</view>
+				<view class="tips tips-greed" v-if="item.status == 1">拣货中</view>
 			</view>
 		</view>
 		<view class="task-line" v-if="type == 'caigou'">
@@ -41,8 +41,8 @@
 				<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>
-				<view class="btn btn-2" v-if="item.type == 1" @click="toDetail">详情</view>
+				<view class="btn btn-1" v-if="item.status == 0" @click="toStorage">去出库</view>
+				<view class="btn btn-2" v-if="item.status == 1" @click="toDetail">详情</view>
 			</view>
 		</view>
 	</view>
@@ -67,7 +67,7 @@
 		},
 		methods:{
 			toStorage() {
-				this.$emit('toStorage')
+				this.$emit('toStorage',this.item)
 			},
 			toDetail() {
 				this.$emit('toDetail',this.item)

+ 1 - 1
env.js

@@ -1,7 +1,7 @@
 /**
  *  全局配置文件
  */
-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 BASE_URL = process.env.NODE_ENV === "development" ? 'http://192.168.168.25:8080' : 'https://erp.xianglitech.com.cn/prod-api'
 
 
 // 上传路径

+ 24 - 4
pages/login/components/account-login.vue

@@ -59,11 +59,31 @@
 				login(params)
 				.then(res=>{
 					if(res.code == 200) {
-						let userInfo = {
-							token:res.data.token,
-							...res.data.user
+						let err = {}
+						if (res.data.msgTip === 'user can login') {
+							let userInfo = {
+								token:res.data.token,
+								...res.data.user
+							}
+							this.$store.dispatch('userLogin',userInfo)
+						} else if (res.data.msgTip === 'user is not exist') {
+							uni.$u.toast("用户不存在")
+						} else if (res.data.msgTip === 'user password error') {
+							uni.$u.toast("用户密码不正确")
+						} else if (res.data.msgTip === 'user is black') {
+							uni.$u.toast("用户被禁用")
+						} else if (res.data.msgTip === 'tenant is black') {
+							if (loginName === 'jsh') {
+								uni.$u.toast("jsh用户已停用,请注册租户进行体验!")
+							} else {
+								uni.$u.toast("用户所属的租户被禁用")
+							}
+						} else if (res.data.msgTip === 'tenant is expire') {
+							uni.$u.toast("试用期已结束,请联系客服续费")
+						} else if (res.data.msgTip === 'access service error') {
+							uni.$u.toast("查询服务异常")
 						}
-						this.$store.dispatch('userLogin',userInfo)
+						
 					}
 				})
 			}

+ 29 - 29
pages/picking-task/detail.vue

@@ -10,7 +10,7 @@
 						<text>出库单号</text>
 					</view>
 					<view class="info-line-value">
-						RK-20250403164422
+						{{orderInfo.number}}
 					</view>
 				</view>
 				<view class="info-line">
@@ -18,7 +18,7 @@
 						<text>发出仓库</text>
 					</view>
 					<view class="info-line-value">
-						我的仓库
+						我的仓库-暂无
 					</view>
 				</view>
 				<view class="info-line">
@@ -26,7 +26,7 @@
 						<text>出库数量</text>
 					</view>
 					<view class="info-line-value">
-						1
+						{{orderInfo.goodsQuantity}}
 					</view>
 				</view>
 				<view class="info-line">
@@ -34,7 +34,7 @@
 						<text>出库种类</text>
 					</view>
 					<view class="info-line-value">
-						1
+						{{orderInfo.goodsTypeCount}}
 					</view>
 				</view>
 				<view class="info-line">
@@ -42,7 +42,7 @@
 						<text>制单日期</text>
 					</view>
 					<view class="info-line-value">
-						2025-04-03
+						{{orderInfo.createTime}}
 					</view>
 				</view>
 				<view class="info-line">
@@ -58,7 +58,7 @@
 						<text>出库类型</text>
 					</view>
 					<view class="info-line-value">
-						销售出库
+						{{orderInfo.subType}}
 					</view>
 				</view>
 				<view class="info-line">
@@ -74,7 +74,7 @@
 						<text>备注信息</text>
 					</view>
 					<view class="info-line-value">
-						备注备注备注备注备注
+							{{orderInfo.remark || '-'}}
 					</view>
 				</view>
 				<view class="info-line">
@@ -82,7 +82,7 @@
 						<text>出库时间</text>
 					</view>
 					<view class="info-line-value">
-						2025-04-03 16:44
+						{{orderInfo.operTime}}
 					</view>
 				</view>
 				
@@ -125,7 +125,7 @@
 
 <script>
 	import goodItem from '@/components/good-item/good-item.vue'
-	import {orderDetail} from '@/common/request/apis/purchase'
+	import {orderDetail, orderInfo} from '@/common/request/apis/purchase'
 	export default {
 		components: {
 			goodItem,
@@ -136,31 +136,31 @@
 				successShow:false,
 				value:0,
 				isUnfold: true, //是否展开
-				info: {
-					mark: '',
-					url: ''
-				},
-				goodsList: [
-					{
-						src: '',
-						name: '大童专用氨基酸洗发水',
-					}, {
-						src: '',
-						name: '大童专用氨基酸洗发水',
-					},
-				]
+				orderInfo: {},
+				goodsList: []
 			}
 		},
 		onLoad(e) {
-			console.log(e)
+			this.getOrderInfo(e.id)
+			this.getOrderDetail(e.id)
 		},
 		methods:{
-			getOrderDetail() {
-				orderDetail()
-				.then(res=>{
-					
-				})
-			},
+		getOrderInfo(id) {
+			orderInfo(id)
+			.then(res=>{
+				if(res.code == 200) {
+					this.orderInfo = res.data
+				}
+			})
+		},
+		getOrderDetail(id) {
+			orderDetail(id)
+			.then(res=>{
+				if(res.code == 200) {
+					this.goodsList = res.data.rows
+				}
+			})
+		},
 			submitClick() {
 				
 			},

+ 58 - 17
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="params.number" :showAction="false" @search="searchClick"></u-search>
+					<u-search placeholder="请输入单据编号" bgColor="#fff" shape="square" v-model="params.number" :showAction="false" @search="searchClick" @clear="searchClick"></u-search>
 					<view class="flex_box">
 						<view class="scan-text">扫描单据二维码</view>
 						<view class="scan-icon">
@@ -32,12 +32,13 @@
 				<block v-for="(item,i) in taskList" :key="i">
 					<task-item :item="item" @toStorage="toStorage" @toDetail="toDetail"></task-item>
 				</block>
+					<u-empty mode="data" v-if="taskList.length == 0"></u-empty>
 			</view>
 		</view>
 		<!-- 中心仓弹窗 -->
 		<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="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>
 		
@@ -47,6 +48,7 @@
 <script>
 	import taskItem from '@/components/task-item/task-item.vue'
 	import {saleOrder} from '@/common/request/apis/picking'
+	import {orderStartHandle} from '@/common/request/apis/purchase'
 	export default{
 		components:{
 			taskItem
@@ -64,10 +66,22 @@
 					['鹏越中心仓','美团中心仓']
 				],
 				statusColumns:[
-					['全部','待拣货','已拣货','拣货中']
+					[{
+						name:'全部',
+						id:''
+					},{
+						name:'待拣货',
+						id:'1'
+					},{
+						name:'拣货中',
+						id:'4'
+					},{
+						name:'已拣货',
+						id:'2'
+					}]
 				],
 				dateColumns:[
-					['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月']
+					['全年','一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月']
 				],
 				defaultIndex:[],
 				defaultIndex2:[],
@@ -77,7 +91,9 @@
 					beginTime:'',
 					endTime:'',
 					number:'',
-					status:0
+					status:'',
+					pageNum:1,
+					pageSize:10
 				}
 			}
 		},
@@ -85,11 +101,16 @@
 			let systemInfo = uni.getSystemInfoSync();
 			let statusBarHeight = systemInfo.statusBarHeight;
 			this.offsetTop = statusBarHeight + 40
-			this.getSaleOrder()
+			this.init()
 		},
 		methods:{
+			init() {
+				uni.showLoading()
+				this.params.pageNum = 1
+				this.getSaleOrder()
+			},
 			searchClick() {
-				this.getPurchaseInventory()
+				this.init()
 			},
 			tabClick(type) {
 				if(type == 1) {
@@ -106,6 +127,10 @@
 					if(res.code == 200) {
 						this.taskList = res.data.rows;
 					}
+					uni.hideLoading()
+				})
+				.catch(err=>{
+					uni.hideLoading()
 				})
 			},
 			stashClick() {
@@ -117,39 +142,55 @@
 				this.stashShow = false
 			},
 			statusConfirm(val) {
-				this.type1 = val.value[0]
+				this.type1 = val.value[0].name
+				this.params.status = val.value[0].id
 				this.statusShow = false
+				this.init()
 			},
 			dateConfirm(val) {
 				this.type2 = val.value[0]
 				this.dateShow = false
 				let month = val.indexs[0]
 				this.getLastDayOfMonth(month)
-				this.getSaleOrder()
+				this.init()
 			},
 			// 获取开始时间、结束时间
 			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}`
+				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,list) {
 				let arr = []
-				let index = list[0].findIndex(item=>item == val)
+				let index = list[0].findIndex(item=>item.name == val)
 				arr = [index]
 				return arr
 			},
+			// 点击操作
+			toOrderStartHandle(id) {
+				orderStartHandle(id)
+				.then(res=>{
+					if(res.code == 200) {
+						uni.navigateTo({
+							url:'/pages/picking-task/delivery'
+						})
+					}
+				})
+			},
 			// 出库
 			toStorage(val) {
-				uni.navigateTo({
-					url:'/pages/picking-task/delivery'
-				})
+				this.toOrderStartHandle(val.id)
 			},
 			toDetail(val) {
 				uni.navigateTo({
-					url:'/pages/picking-task/detail'
+					url:`/pages/picking-task/detail?id=${val.id}`
 				})
 			}
 		}

+ 22 - 17
pages/purchase/detail.vue

@@ -10,7 +10,7 @@
 						<text>入库单号</text>
 					</view>
 					<view class="info-line-value">
-						RK-20250403164422
+						{{orderInfo.number}}
 					</view>
 				</view>
 				<view class="info-line">
@@ -18,7 +18,7 @@
 						<text>收入仓库</text>
 					</view>
 					<view class="info-line-value">
-						我的仓库
+						我的仓库-暂无
 					</view>
 				</view>
 				<view class="info-line">
@@ -26,7 +26,7 @@
 						<text>供应商</text>
 					</view>
 					<view class="info-line-value">
-						哇嘎嘎
+						{{orderInfo.supplierName}}
 					</view>
 				</view>
 				<view class="info-line">
@@ -34,7 +34,7 @@
 						<text>入库数量</text>
 					</view>
 					<view class="info-line-value">
-						1
+						{{orderInfo.goodsQuantity}}
 					</view>
 				</view>
 				<view class="info-line">
@@ -42,7 +42,7 @@
 						<text>入库种类</text>
 					</view>
 					<view class="info-line-value">
-						1
+						{{orderInfo.goodsTypeCount}}
 					</view>
 				</view>
 				<view class="info-line">
@@ -50,7 +50,7 @@
 						<text>制单日期</text>
 					</view>
 					<view class="info-line-value">
-						2025-04-03
+						{{orderInfo.createTime}}
 					</view>
 				</view>
 				<view class="info-line">
@@ -58,7 +58,7 @@
 						<text>制单人</text>
 					</view>
 					<view class="info-line-value">
-						刘双强
+						刘双强-暂无
 					</view>
 				</view>
 				<view class="info-line">
@@ -66,7 +66,7 @@
 						<text>入库类型</text>
 					</view>
 					<view class="info-line-value">
-						销售入库
+						{{orderInfo.subType}}
 					</view>
 				</view>
 				<view class="info-line">
@@ -74,7 +74,7 @@
 						<text>入库人</text>
 					</view>
 					<view class="info-line-value">
-						刘双美
+						刘双美-暂无
 					</view>
 				</view>
 				<view class="info-line">
@@ -82,7 +82,7 @@
 						<text>备注信息</text>
 					</view>
 					<view class="info-line-value">
-						备注备注备注备注备注
+						{{orderInfo.remark || '-'}}
 					</view>
 				</view>
 				<view class="info-line">
@@ -90,7 +90,7 @@
 						<text>入库时间</text>
 					</view>
 					<view class="info-line-value">
-						2025-04-03 16:44
+						{{orderInfo.operTime}}
 					</view>
 				</view>
 				
@@ -133,7 +133,7 @@
 
 <script>
 	import goodItem from '@/components/good-item/good-item.vue'
-	import {orderDetail} from '@/common/request/apis/purchase'
+	import {orderDetail, orderInfo} from '@/common/request/apis/purchase'
 	export default {
 		components: {
 			goodItem,
@@ -144,18 +144,23 @@
 				successShow:false,
 				value:0,
 				isUnfold: true, //是否展开
-				info: {
-					mark: '',
-					url: ''
-				},
+				orderInfo: {},
 				goodsList: []
 			}
 		},
 		onLoad(e) {
-			console.log(e)
+			this.getOrderInfo(e.id)
 			this.getOrderDetail(e.id)
 		},
 		methods:{
+			getOrderInfo(id) {
+				orderInfo(id)
+				.then(res=>{
+					if(res.code == 200) {
+						this.orderInfo = res.data
+					}
+				})
+			},
 			getOrderDetail(id) {
 				orderDetail(id)
 				.then(res=>{

+ 16 - 8
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="params.number" :showAction="false" @search="searchClick"></u-search>
+					<u-search placeholder="请输入单据编号" bgColor="#fff" shape="square" v-model="params.number" :showAction="false" @search="searchClick" @clear="searchClick"></u-search>
 					<view class="flex_box">
 						<view class="scan-text">扫描单据二维码</view>
 						<view class="scan-icon">
@@ -47,7 +47,7 @@
 
 <script>
 	import taskItem from '@/components/task-item/task-item.vue'
-	import {purchaseInventory} from '@/common/request/apis/purchase'
+	import {purchaseInventory, orderStartHandle} from '@/common/request/apis/purchase'
 	export default{
 		components:{
 			taskItem
@@ -113,6 +113,17 @@
 			searchClick() {
 				this.init()
 			},
+			// 点击操作
+			toOrderStartHandle(id) {
+				orderStartHandle(id)
+				.then(res=>{
+					if(res.code == 200) {
+						uni.navigateTo({
+							url:'/pages/purchase/put-storage'
+						})
+					}
+				})
+			},
 			tabClick(type) {
 				if(type == 1) {
 					this.defaultIndex = this.getDefaultIndex(this.type1,this.statusColumns)
@@ -146,15 +157,13 @@
 				this.type1 = val.value[0].name
 				this.params.status = val.value[0].id
 				this.statusShow = false
-				this.params.pageNum = 1
-				this.getPurchaseInventory()
+				this.init()
 			},
 			dateConfirm(val) {
 				this.type2 = val.value[0]
 				this.dateShow = false
 				let month = val.indexs[0]
 				this.getLastDayOfMonth(month)
-				uni.showLoading()
 				this.init()
 			},
 			// 获取开始时间、结束时间
@@ -179,9 +188,8 @@
 			},
 			// 入库
 			toStorage(val) {
-				uni.navigateTo({
-					url:'/pages/purchase/put-storage'
-				})
+				console.log(val)
+				this.toOrderStartHandle(val.id)
 			},
 			toDetail(val) {
 				uni.navigateTo({