hi 20 giờ trước cách đây
mục cha
commit
3e1c9dc0b4

+ 88 - 1
App.vue

@@ -1,4 +1,6 @@
 <script>
+	var main, receiver, filter;
+	var _codeQueryTag = false;
 export default {
 	onLaunch(options) {
 		
@@ -7,17 +9,102 @@ export default {
 		this.$store.dispatch('update/update', 0)
 	},
 	onShow() {
+		// #ifdef APP-PLUS
+		console.log('initScan')
+		this.initScan();
+		this.startScan();
+		this.setBROADCAST()
+		this.setBROADCASTACTION()
+		// #endif
 		// getApp().globalData.uploadUrl = this.$UPLOAD_URL
 		// getApp().globalData.img_url = this.$IMG_URL
 	},
 	onHide() {
-	
+		this.stopScan();
+	},
+	onLoad() {
+		
 	},
 	// globalData: {
 	// 	uploadUrl: '',
 	// 	img_url: ''
 	// },
 	methods: {
+		setBROADCAST() {
+			var main2 = plus.android.runtimeMainActivity(); //获取acitivity
+			var Intent = plus.android.importClass("android.content.Intent");
+			var intent2 = new Intent("com.android.scanner.service_settings");
+			intent2.putExtra("barcode_send_mode", "BROADCAST");
+			main2.sendBroadcast(intent2);
+		},
+		setBROADCASTACTION() {
+			var main2 = plus.android.runtimeMainActivity(); //获取acitivity
+			var Intent = plus.android.importClass("android.content.Intent");
+			var intent2 = new Intent("com.android.scanner.service_settings");
+			intent2.putExtra("action_barcode_broadcast", "com.pdapengyue.scan");
+			main2.sendBroadcast(intent2);
+		},
+		// 监听设备按键
+		key() {
+			plus.key.addEventListener('keydown', event => {
+				console.log("按键:" + event.keyCode);
+			});
+		},
+		// 点击触发激光扫码
+		ScanCode() {
+			var main2 = plus.android.runtimeMainActivity(); //获取acitivity
+			var Intent = plus.android.importClass("android.content.Intent");
+			var intent2 = new Intent("com.scan.onStartScan");
+			main2.sendBroadcast(intent2);
+		},
+		initScan() {
+			var vendor = plus.device.vendor; // 获取设备制造商
+			console.log("厂商:"+vendor);
+			let _this = this;
+			main = plus.android.runtimeMainActivity(); //获取activity  
+			var IntentFilter = plus.android.importClass('android.content.IntentFilter');
+			filter = new IntentFilter();
+			filter.addAction("com.pdapengyue.scan"); // 换你的广播动作  
+			receiver = plus.android.implements('io.dcloud.feature.internal.reflect.BroadcastReceiver', {
+				onReceive: function(context, intent) {
+					plus.android.importClass(intent);
+					let data = intent.getStringExtra("pdapengyuescannerdata"); // 换你的广播标签  
+					// console.log("条码信息:" + data)
+					uni.$emit('scanFinish',data)
+					// uni.showModal({
+					// 	title: '收到条码信息',
+					// 	content: '' + data,
+					// 	success: function(res) {
+					// 		if (res.confirm) {
+					// 			// 执行确认后的操作
+					// 		} else {
+					// 			// 执行取消后的操作
+					// 		}
+					// 	}
+					// })
+					_this.queryCode(code);
+				}
+			});
+		},
+		startScan() {
+			main.registerReceiver(receiver, filter);
+		
+		},
+		stopScan() {
+			main.unregisterReceiver(receiver);
+		},
+		queryCode(code) {
+			//防重复  
+			if (_codeQueryTag) return false;
+			_codeQueryTag = true;
+			setTimeout(function() {
+				_codeQueryTag = false;
+			}, 150);
+			var id = code
+			uni.$emit('scancodedate', {
+				code: id
+			})
+		}
 	}
 }
 </script>

+ 9 - 3
common/request/apis/purchase.js

@@ -1,8 +1,14 @@
 // 采购入库
 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 = (urlparams, config = {custom: { auth: true }}) => uni.$u.http.get(`/pda/orderDetail/${urlparams}`, config)
 // 订单明细上部
-export const orderInfo = (params, config = {custom: { auth: true }}) => uni.$u.http.get(`/pda/orderInfo/${params}`, config)
+export const orderInfo = (urlparams, config = {custom: { auth: true }}) => uni.$u.http.get(`/pda/orderInfo/${urlparams}`, config)
 // 订单操作、去入库/去拣货
-export const orderStartHandle = (params, config = {custom: { auth: true }}) => uni.$u.http.get(`/pda/orderStartHandle/${params}`, config)
+export const orderStartHandle = (urlparams, config = {custom: { auth: true }}) => uni.$u.http.get(`/pda/orderStartHandle/${urlparams}`, config)
+// 	商品详情
+export const materialDetail = (urlparams, config = {custom: { auth: true }}) => uni.$u.http.get(`/pda/materialDetail/${urlparams}`, config)
+// 商品库存详情
+export const materialDepotDetail = (urlparams,data, config = {custom: { auth: true }}) => uni.$u.http.get(`/pda/materialDepotDetail/${urlparams.type}/${urlparams.materialId}`, {data,config})
+// 商品入库
+export const orderSubmit = (params, config = {custom: { auth: true }}) => uni.$u.http.post(`/pda/orderSubmit`, params, config)

+ 1 - 0
common/request/index.js

@@ -15,6 +15,7 @@ module.exports = (vm) => {
 	})
 	// 请求拦截部分,如配置,每次请求前都会执行
 	uni.$u.http.interceptors.request.use(async (config) => {
+		console.log(config,'config')
 		// 引用token
 		let token = uni.getStorageSync('token');
 		if(config.custom&&config.custom.auth&&!token){

+ 1 - 1
components/error-pop/error-pop.vue

@@ -1,6 +1,6 @@
 <template>
 	<view>
-		<u-popup :show="errorShow" :closeOnClickOverlay="false" @close="closeClick" mode="center" :round="10">
+		<u-popup :show="errorShow" :closeOnClickOverlay="false" :safeAreaInsetBottom="false" @close="closeClick" mode="center" :round="10">
 			<view class="error-box">
 				<view class="flex_box flex_row_center">
 					<u-image src="@/static/image/error-img.png" width="112rpx" height="112rpx"></u-image>

+ 45 - 38
components/good-item/good-item.vue

@@ -1,43 +1,45 @@
 <template>
-	<view class="good-item" @click="toDetail">
-		<view class="good-msg">
-			<u-image
-				:src="item.src"
-				width="128rpx"
-				height="128rpx"
-			></u-image>
-			<view class="ss-m-l-16">
-				<view class="good-msg-name">{{item.materialName}}</view>
-				<view class="good-msg-txm">条形码:{{item.barCode}}</view>
+	<view>
+		<view class="good-item" @click="toDetail">
+			<view class="good-msg">
+				<u-image
+					:src="item.src"
+					width="128rpx"
+					height="128rpx"
+				></u-image>
+				<view class="ss-m-l-16">
+					<view class="good-msg-name">{{item.materialName}}</view>
+					<view class="good-msg-txm">条形码:{{item.barCode}}</view>
+				</view>
 			</view>
-		</view>
-		<view class="good-cont">
-			<view class="good-cont-item">
-				<view class="item-label">规格</view>
-				<view class="item-value">{{item.materialStandard || '-'}}</view>
-			</view>
-			<view class="good-cont-item">
-				<view class="item-label">批次号</view>
-				<view class="item-value">{{item.batchNumber || '-'}}</view>
-			</view>
-			<view class="good-cont-item">
-				<view class="item-label">生产日期</view>
-				<view class="item-value">{{item.productionDate || '-'}}</view>
-			</view>
-			<view class="good-cont-item">
-				<view class="item-label">库存</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">{{item.position || '-'}}</view>
-			</view>
-			<view class="good-cont-item">
-				<view class="item-label">订单数量</view>
-				<view class="item-value">{{item.operNumber || '0'}}{{item.materialUnit || ''}}</view>
+			<view class="good-cont">
+				<view class="good-cont-item">
+					<view class="item-label">规格</view>
+					<view class="item-value">{{item.materialStandard || '-'}}</view>
+				</view>
+				<view class="good-cont-item">
+					<view class="item-label">批次号</view>
+					<view class="item-value">{{item.batchNumber || '-'}}</view>
+				</view>
+				<view class="good-cont-item" @click.stop="calendarClick">
+					<view class="item-label">生产日期</view>
+					<view class="item-value">{{item.productionDate ? $u.timeFormat(item.productionDate, 'yyyy-mm-dd') : '-'}}</view>
+				</view>
+				<view class="good-cont-item">
+					<view class="item-label">库存</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">{{item.position || '-'}}</view>
+				</view>
+				<view class="good-cont-item">
+					<view class="item-label">订单数量</view>
+					<view class="item-value">{{item.operNumber || '0'}}{{item.materialUnit || ''}}</view>
+				</view>
 			</view>
+			<slot></slot>
 		</view>
-		<slot></slot>
 	</view>
 </template>
 
@@ -51,12 +53,17 @@
 		},
 		data() {
 			return {
-				
+				calendarShow:false,
+				value1: Number(new Date()),
+				maxDate:Number(new Date()),
 			}
 		},
 		methods:{
 			toDetail() {
-				this.$emit('toDetail')
+				this.$emit('toDetail',this.item)
+			},
+			calendarClick() {
+				this.$emit('calendarClick',this.item)
 			}
 		}
 	}

+ 1 - 1
components/success-pop/success-pop.vue

@@ -1,6 +1,6 @@
 <template>
 	<view>
-		<u-popup :show="successShow" closeable :closeOnClickOverlay="false" @close="closeClick" mode="center" :round="10">
+		<u-popup :show="successShow" :closeOnClickOverlay="false" :safeAreaInsetBottom="false"  @close="closeClick" mode="center" :round="10">
 			<view class="error-box">
 				<view class="flex_box flex_row_center">
 					<u-image src="@/static/image/success-img.png" width="240rpx" height="240rpx"></u-image>

+ 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.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 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-greed" v-if="item.status == 4">拣货中</view>
 			</view>
 		</view>
 		<view class="task-line" v-if="type == 'caigou'">
@@ -37,12 +37,12 @@
 		</view>
 		<view class="task-bottom">
 			<view v-if="type == 'caigou'">
-				<view class="btn btn-1" v-if="item.status == 1" @click="toStorage">去入库</view>
+				<view class="btn btn-1" v-if="item.status == 1 || item.status == 4" @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.status == 0" @click="toStorage">去出库</view>
-				<view class="btn btn-2" v-if="item.status == 1" @click="toDetail">详情</view>
+				<view class="btn btn-1" v-if="item.status == 1 || item.status == 4" @click="toStorage">去出库</view>
+				<view class="btn btn-2" v-else @click="toDetail">详情</view>
 			</view>
 		</view>
 	</view>

+ 8 - 6
components/upload-image/upload-image.vue

@@ -201,6 +201,7 @@ export default {
 		},
 		// 新增图片
 		async afterRead(event) {
+			console.log(event,'event')
 			// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
 			let lists = [].concat(event.file)
 			let fileListLen = this[`fileList${event.name}`].length
@@ -215,8 +216,9 @@ export default {
 			let failNum = 0
 			for (let i = 0; i < lists.length; i++) {
 				const result = await this.uploadFilePromise(lists[i].url)
+				console.log(result,'result')
 				let item = this[`fileList${event.name}`][fileListLen]
-				if (result.code === 1) {
+				if (result.code === 200) {
 					successNum++
 				} else {
 					failNum++
@@ -225,10 +227,10 @@ export default {
 					fileListLen,
 					1,
 					Object.assign(item, {
-						status: result.code === 1 ? 'success' : 'fail',
-						message: result.code === 1 ? '' : '上传失败',
-						url: result.code === 1 ? result.data.fullurl : '',
-						fullurl: result.code === 1 ? result.data.url : ''
+						status: result.code === 200 ? 'success' : 'fail',
+						message: result.code === 200 ? '' : '上传失败',
+						url: result.code === 200 ? result.url : '',
+						fullurl: result.code === 200 ? result.url : ''
 					})
 				)
 				fileListLen++
@@ -256,7 +258,7 @@ export default {
 					filePath: url,
 					name: 'file',
 					header: {
-						token: `${this.$store.getters.token}`
+						'x-access-token': `${this.$store.getters.token}`
 					},
 					success: (res) => {
 						let data = JSON.parse(res.data)

+ 3 - 3
env.js

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

+ 48 - 13
pages/goods/detail.vue

@@ -10,7 +10,7 @@
 						<text>货物名称</text>
 					</view>
 					<view class="info-line-value">
-						娃哈哈AD钙
+						{{goodsInfo.materialName}}
 					</view>
 				</view>
 				<view class="info-line">
@@ -18,7 +18,7 @@
 						<text>货物条码</text>
 					</view>
 					<view class="info-line-value">
-						9787540146481
+						{{goodsInfo.barCode}}
 					</view>
 				</view>
 				<view class="info-line">
@@ -34,7 +34,7 @@
 						<text>规格</text>
 					</view>
 					<view class="info-line-value">
-						250ml
+						{{goodsInfo.materialStandard || '-'}}
 					</view>
 				</view>
 				<view class="info-line">
@@ -42,7 +42,7 @@
 						<text>批次号</text>
 					</view>
 					<view class="info-line-value">
-						12345678966
+						{{goodsInfo.batchNumber || '-'}}
 					</view>
 				</view>
 				<view class="info-line">
@@ -50,7 +50,7 @@
 						<text>生产日期</text>
 					</view>
 					<view class="info-line-value">
-						2025-04-03
+						{{goodsInfo.productionDate || '-'}}
 					</view>
 				</view>
 				<view class="info-line">
@@ -58,7 +58,7 @@
 						<text>库存</text>
 					</view>
 					<view class="info-line-value">
-						20瓶
+						{{goodsInfo.inventory || '0'}}{{goodsInfo.commodityUnit || ''}}
 					</view>
 				</view>
 				<view class="info-line">
@@ -66,7 +66,7 @@
 						<text>库位</text>
 					</view>
 					<view class="info-line-value">
-						A区3-1-1
+						{{goodsInfo.position || '-'}}
 					</view>
 				</view>
 				<view class="info-line">
@@ -74,11 +74,11 @@
 						<text>创建时间</text>
 					</view>
 					<view class="info-line-value">
-						2025-04-03 16:44
+					{{goodsInfo.createTime}}
 					</view>
 				</view>
 			</view>
-			<view class="crk-box" @click="crkShow = true">
+			<view class="crk-box" @click="getMaterialDepotDetail(),crkShow = true">
 				<u-image src="@/static/image/cgrk-icon.png" width="48rpx" height="48rpx"></u-image>
 				<view class="crk-msg">
 					<view class="crk-msg-name">出入库明细</view>
@@ -118,27 +118,62 @@
 </template>
 
 <script>
+	import {materialDetail, materialDepotDetail} from '@/common/request/apis/purchase'
 	export default{
 		data() {
 			return {
 				navTitle:'哇哈哈AD盖',
+				goodsId:0,
 				crkShow: false,
-				currentCrkId:0,
+				currentCrkId:'in',
 				crkList:[
 					{
 						name:'出库',
-						id:0
+						id:'in'
 					},
 					{
 						name:'入库',
-						id:1
+						id:'out'
 					}
-				]
+				],
+				goodsInfo:{}
 			}
 		},
+		onLoad(e) {
+			this.navTitle = e.name ? decodeURIComponent(e.name) : ''
+			this.goodsId = e.id
+			this.getMaterialDetail()
+		},
 		methods:{
 			tabClick(item) {
 				this.currentCrkId = item.id
+				this.getMaterialDepotDetail()
+			},
+			getMaterialDetail() {
+				materialDetail(this.goodsId)
+				.then(res=>{
+					if(res.code == 200) {
+						this.goodsInfo = res.data
+					}
+				})
+			},
+			getMaterialDepotDetail() {
+				uni.showLoading()
+				let urlParams = {
+					type:this.currentCrkId,
+					materialId:this.goodsId,
+				}
+				let data = {pageNum:1,pageSize:10}
+				materialDepotDetail(urlParams,data)
+				.then(res=>{
+					if(res.code == 200) {
+						
+					}
+					uni.hideLoading()
+				})
+				.catch(err=>{
+					uni.hideLoading()
+				})
 			}
 		}
 	}

+ 20 - 4
pages/index/index.vue

@@ -44,13 +44,13 @@
 					{
 						src:require('@/static/image/home/icon-jhrw.png'),
 						text:'拣货任务',
-						num:5,
+						num:0,
 						url:'/pages/picking-task/index'
 					},
 					{
 						src:require('@/static/image/home/icon-cgrk.png'),
 						text:'采购入库',
-						num:5,
+						num:0,
 						url:'/pages/purchase/index'
 					},
 					{
@@ -74,14 +74,30 @@
 			// JSON.parse(Base64.decode(that.$Route.query.classData))
 		},
 		onShow() {
-
+			if(!this.isLogin) {
+				uni.$u.toast("请先登录!");
+				setTimeout(()=>{
+					uni.redirectTo({
+						url:'/pages/login/login'
+					})
+				},1500)
+			}
 		},
 		computed: {
 			...mapGetters(['isLogin','userInfo'])
 		},
 		methods: {
 			meunClick() {
-				this.meunShow = true
+				if(!this.isLogin) {
+					uni.$u.toast("请先登录!");
+					setTimeout(()=>{
+						uni.redirectTo({
+							url:'/pages/login/login'
+						})
+					},1500)
+				}else{
+					this.meunShow = true
+				}
 			},
 			operateClick(item) {
 				uni.navigateTo({

+ 131 - 23
pages/picking-task/delivery.vue

@@ -10,7 +10,7 @@
 						<text>发出仓库</text>
 					</view>
 					<view class="info-line-value">
-						我的仓库
+						我的仓库-暂无
 					</view>
 				</view>
 				<view class="info-line">
@@ -18,15 +18,15 @@
 						<text>客户</text>
 					</view>
 					<view class="info-line-value">
-						快马一店
+						{{orderInfo.supplierName}}
 					</view>
 				</view>
 				<view class="info-line">
 					<view class="info-line-label">
-						<text>销售出库</text>
+						<text>出库类型</text>
 					</view>
 					<view class="info-line-value">
-						我的仓库
+						{{orderInfo.subType}}
 					</view>
 				</view>
 				<view class="info-line">
@@ -34,7 +34,7 @@
 						<text>出库日期</text>
 					</view>
 					<view class="info-line-value">
-						2025-04-03
+						{{orderInfo.operTime}}
 					</view>
 				</view>
 				<view class="info-line">
@@ -42,7 +42,7 @@
 						<text>配送地址</text>
 					</view>
 					<view class="info-line-value">
-						长沙市岳麓区
+						长沙市岳麓区-暂无
 					</view>
 				</view>
 				<view class="info-line">
@@ -50,7 +50,7 @@
 						<text>上传凭证</text>
 					</view>
 					<view class="info-line-value ss-p-y-24">
-						<upload-image v-model="info.url" width="196rpx" height="196rpx"></upload-image>
+						<upload-image v-model="voucherPicture" width="196rpx" height="196rpx"></upload-image>
 					</view>
 				</view>
 				<view class="info-line">
@@ -58,7 +58,7 @@
 						<text>备注信息</text>
 					</view>
 					<view class="info-line-value">
-						<u-input v-model="info.mark" placeholder="请输入备注信息" border="none"></u-input>
+						<u-input v-model="orderInfo.mark" placeholder="请输入备注信息" border="none"></u-input>
 					</view>
 				</view>
 			</view>
@@ -118,7 +118,7 @@
 			</button>
 		</view>
 		<error-pop v-model="errorShow" @close="errorShow = false" @confirm="confirm" :content="popText.errorText"></error-pop>
-		<success-pop v-model="successShow" @close="successShow = false" @backClick="backClick" :content="popText.success"></success-pop>
+		<success-pop v-model="successShow" @close="successShow = false" @backClick="backClick" :content="popText.successText"></success-pop>
 		<!-- 扫码之后弹窗 -->
 		<scaned-pop v-model="scanedShow" @close="scanedShow = false" @confirm="scanConfirm"></scaned-pop>
 		
@@ -132,6 +132,7 @@
 	import successPop from '@/components/success-pop/success-pop.vue'
 	import scanedPop from '@/components/scaned-pop/scaned-pop.vue'
 	import goodsPop from '@/components/goods-pop/goods-pop.vue'
+	import {orderDetail, orderInfo, orderSubmit} from '@/common/request/apis/purchase'
 	export default {
 		components: {
 			goodItem,
@@ -156,27 +157,134 @@
 					mark: '',
 					url: ''
 				},
-				goodsList: [
-					{
-						src: '',
-						name: '大童专用氨基酸洗发水',
-					}, {
-						src: '',
-						name: '大童专用氨基酸洗发水',
-					},
-				]
+				goodsList: [],
+				orderInfo:{},
+				id:'',
+				calendarShow:false,
+				value1: '',
+				maxDate:Number(new Date()),
+				chooseGoodsInfo:{},
+				voucherPicture:''
+			}
+		},
+		onLoad(e) {
+			this.id = e.id
+			this.getOrderDetail(e.id)
+			this.getOrderInfo(e.id)
+		},
+		computed: {
+			speciesNum() {
+				let num = 0
+				if(this.goodsList.length == 0 || !this.goodsList) {
+					num = 0
+				}else {
+					num = this.goodsList.length
+				}
+				return num
+			},
+			// 手动输入的数量
+			goodsNum() {
+				let num = 0
+				if(this.goodsList.length == 0 || !this.goodsList) {
+					num = 0
+				}else {
+					this.goodsList.forEach(item=>{
+						num+=item.materialNumber
+					})
+				}
+				return num
+			},
+			// 订单返回的数量
+			orderGoodsNum() {
+				let num = 0
+				if(this.goodsList.length == 0 || !this.goodsList) {
+					num = 0
+				}else {
+					this.goodsList.forEach(item=>{
+						num+=item.operNumber
+					})
+				}
+				return num
 			}
 		},
 		methods:{
+			calendarConfirm(val) {
+				this.goodsList.forEach(item=>{
+					if(item.id == this.chooseGoodsInfo.id) {
+						item.productionDate = this.$u.timeFormat(val.value, 'yyyy-mm-dd')
+					}
+				})
+				this.calendarShow = false
+			},
+			calendarCole() {
+				this.calendarShow = false
+			},
+			calendarClick(item) {
+				console.log(item.productionDate,'item.productionDate')
+				this.chooseGoodsInfo = item
+				if(item.productionDate) {
+					this.value1 = Number(new Date(item.productionDate))
+				}else {
+					this.value1 = Number(new Date())
+				}
+				this.calendarShow = true
+			},
+			getOrderInfo(id) {
+				orderInfo(id)
+				.then(res=>{
+					if(res.code == 200) {
+						this.orderInfo = res.data
+					}
+				})
+			},
+			getOrderDetail(id) {
+				orderDetail(id)
+				.then(res=>{
+					if(res.code == 200) {
+						res.data.rows.forEach(item=>{
+							item.materialNumber = 0
+						})
+						this.goodsList = res.data.rows
+					}
+				})
+			},
 			submitClick() {
-				
+				if(this.orderGoodsNum != this.goodsNum) {
+					return this.errorShow = true
+				}
+				this.toOrderSubmit()
+			},
+			toOrderSubmit() {
+				let materials = this.goodsList.map(item=> {
+					return {
+						batchNumber:item.batchNumber,
+						materialNumber:item.materialNumber,
+						productionDate:item.productionDate ? this.$u.timeFormat(item.productionDate, 'yyyy-mm-dd') : ''
+					}
+				})
+				let params = {
+					id:this.id,
+					materials:materials,
+					voucherPicture:this.voucherPicture || '',
+					remark:this.orderInfo.mark || ''
+				}
+				orderSubmit(params)
+				.then(res=>{
+					if(res.code == 200) {
+						if(this.errorShow){
+							this.errorShow = false
+						}
+						this.successShow = true
+					}
+				})
 			},
 			confirm() {
-				console.log('确定')
+				this.toOrderSubmit()
 				this.errorShow = false
 			},
 			backClick() {
-				
+				uni.setStorageSync('orderRefresh',true)
+				uni.navigateBack()
 			},
 			// 扫码确认
 			scanConfirm() {
@@ -185,9 +293,9 @@
 			manualClick() {
 				this.goodsShow = true
 			},
-			toDetail() {
+			toDetail(val) {
 				uni.navigateTo({
-					url:'/pages/goods/detail'
+					url:`/pages/goods/detail?id=${val.id}&name=${val.materialName}`
 				})
 			}
 		}

+ 5 - 6
pages/picking-task/detail.vue

@@ -50,7 +50,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">
-						刘双美
+						刘双美-暂无
 					</view>
 				</view>
 				<view class="info-line">
@@ -105,11 +105,11 @@
 					<good-item :item="item" @toDetail="toDetail">
 						<view class="num-box">
 							<view class="num-box-text">已确认出库数量</view>
-							<u-number-box v-model="value" disabled>
+							<u-number-box v-model="item.actualQuantityInStorage" disabled>
 								<view slot="minus" class="minus">
 									<u-icon name="minus" color="#DADADA" size="12"></u-icon>
 								</view>
-								<text slot="input" class="input">{{value}}</text>
+								<text slot="input" class="input">{{item.actualQuantityInStorage || 0}}</text>
 								<view slot="plus" class="plus">
 									<u-icon name="plus" color="#FFFFFF" size="12"></u-icon>
 								</view>
@@ -134,7 +134,6 @@
 			return {
 				errorShow:false,
 				successShow:false,
-				value:0,
 				isUnfold: true, //是否展开
 				orderInfo: {},
 				goodsList: []
@@ -180,7 +179,7 @@
 			},
 			toDetail() {
 				uni.navigateTo({
-					url:'/pages/goods/detail'
+					url:`/pages/goods/detail?id=${val.id}&name=${val.materialName}`
 				})
 			}
 		}

+ 30 - 2
pages/picking-task/index.vue

@@ -10,7 +10,7 @@
 			<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" @clear="searchClick"></u-search>
-					<view class="flex_box">
+					<view class="flex_box" @click="ScanCode">
 						<view class="scan-text">扫描单据二维码</view>
 						<view class="scan-icon">
 							<image src="@/static/image/scan-icon.png" mode=""></image>
@@ -46,6 +46,8 @@
 </template>
 
 <script>
+	var main, receiver, filter;
+	var _codeQueryTag = false;
 	import taskItem from '@/components/task-item/task-item.vue'
 	import {saleOrder} from '@/common/request/apis/picking'
 	import {orderStartHandle} from '@/common/request/apis/purchase'
@@ -102,8 +104,34 @@
 			let statusBarHeight = systemInfo.statusBarHeight;
 			this.offsetTop = statusBarHeight + 40
 			this.init()
+			// uni.$on('scanFinish',(val)=>{
+			// 	console.log("条码信息:" + val)
+			// })
+			uni.$on('scanFinish',(data)=>{
+				this.params.number = data
+				this.init()
+				console.log('监听到事件来自 update ,携带参数 msg 为:' + data);
+			})
+		},
+		onHide() {
+			uni.$off('scanFinish')
+		},
+		onUnload() {
+			uni.$off('scanFinish')
+		},
+		onShow() {
+			if(uni.getStorageSync('orderRefresh')) {
+				this.init()
+				uni.removeStorageSync('orderRefresh')
+			}
 		},
 		methods:{
+			ScanCode() {
+				var main2 = plus.android.runtimeMainActivity(); //获取acitivity
+				var Intent = plus.android.importClass("android.content.Intent");
+				var intent2 = new Intent("com.scan.onStartScan");
+				main2.sendBroadcast(intent2);
+			},
 			init() {
 				uni.showLoading()
 				this.params.pageNum = 1
@@ -179,7 +207,7 @@
 				.then(res=>{
 					if(res.code == 200) {
 						uni.navigateTo({
-							url:'/pages/picking-task/delivery'
+							url:`/pages/picking-task/delivery?id=${id}`
 						})
 					}
 				})

+ 4 - 4
pages/purchase/detail.vue

@@ -113,11 +113,11 @@
 					<good-item :item="item" @toDetail="toDetail">
 						<view class="num-box">
 							<view class="num-box-text">已确认出库数量</view>
-							<u-number-box v-model="value" disabled>
+							<u-number-box v-model="item.actualQuantityInStorage" disabled>
 								<view slot="minus" class="minus">
 									<u-icon name="minus" color="#DADADA" size="12"></u-icon>
 								</view>
-								<text slot="input" class="input">{{value}}</text>
+								<text slot="input" class="input">{{item.actualQuantityInStorage || 0}}</text>
 								<view slot="plus" class="plus">
 									<u-icon name="plus" color="#FFFFFF" size="12"></u-icon>
 								</view>
@@ -186,9 +186,9 @@
 			manualClick() {
 				this.goodsShow = true
 			},
-			toDetail() {
+			toDetail(val) {
 				uni.navigateTo({
-					url:'/pages/goods/detail'
+					url:`/pages/goods/detail?id=${val.id}&name=${val.materialName}`
 				})
 			}
 		}

+ 7 - 2
pages/purchase/index.vue

@@ -104,6 +104,12 @@
 			this.offsetTop = statusBarHeight + 40
 			this.init()
 		},
+		onShow() {
+			if(uni.getStorageSync('orderRefresh')) {
+				this.init()
+				uni.removeStorageSync('orderRefresh')
+			}
+		},
 		methods:{
 			init() {
 				uni.showLoading()
@@ -119,7 +125,7 @@
 				.then(res=>{
 					if(res.code == 200) {
 						uni.navigateTo({
-							url:'/pages/purchase/put-storage'
+							url:`/pages/purchase/put-storage?id=${id}`
 						})
 					}
 				})
@@ -188,7 +194,6 @@
 			},
 			// 入库
 			toStorage(val) {
-				console.log(val)
 				this.toOrderStartHandle(val.id)
 			},
 			toDetail(val) {

+ 154 - 28
pages/purchase/put-storage.vue

@@ -10,7 +10,7 @@
 						<text>收入仓库</text>
 					</view>
 					<view class="info-line-value">
-						鹏越中心仓
+						鹏越中心仓-暂无
 					</view>
 				</view>
 				<view class="info-line">
@@ -18,7 +18,7 @@
 						<text>供应商</text>
 					</view>
 					<view class="info-line-value">
-						哇哈哈哈
+						{{orderInfo.supplierName}}
 					</view>
 				</view>
 				<view class="info-line">
@@ -26,7 +26,7 @@
 						<text>入库类型</text>
 					</view>
 					<view class="info-line-value">
-						采购入库
+						{{orderInfo.subType}}
 					</view>
 				</view>
 				<view class="info-line">
@@ -34,7 +34,7 @@
 						<text>入库日期</text>
 					</view>
 					<view class="info-line-value">
-						2025-04-03
+						{{orderInfo.operTime}}
 					</view>
 				</view>
 				<view class="info-line">
@@ -42,7 +42,7 @@
 						<text>上传凭证</text>
 					</view>
 					<view class="info-line-value ss-p-y-24">
-						<upload-image v-model="info.url" width="196rpx" height="196rpx"></upload-image>
+						<upload-image v-model="voucherPicture" width="196rpx" height="196rpx"></upload-image>
 					</view>
 				</view>
 				<view class="info-line">
@@ -50,7 +50,7 @@
 						<text>备注信息</text>
 					</view>
 					<view class="info-line-value">
-						<u-input v-model="info.mark" placeholder="请输入备注信息" border="none"></u-input>
+						<u-input v-model="orderInfo.mark" placeholder="请输入备注信息" border="none"></u-input>
 					</view>
 				</view>
 			</view>
@@ -78,18 +78,18 @@
 			<!-- 货物清单 -->
 			<view class="cargo-list">
 				<view class="cargo-list-title">
-					<view>库货物清单</view>
+					<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">
+					<good-item :item="item" @toDetail="toDetail" @calendarClick="calendarClick">
 						<view class="num-box">
 							<view class="num-box-text">已确认入库数量</view>
-							<u-number-box v-model="value">
+							<u-number-box v-model="item.materialNumber">
 								<view slot="minus" class="minus">
 									<u-icon name="minus" color="#0256FF" size="12"></u-icon>
 								</view>
-								<text slot="input" class="input">{{value}}</text>
+								<text slot="input" class="input">{{item.materialNumber}}</text>
 								<view slot="plus" class="plus">
 									<u-icon name="plus" color="#FFFFFF" size="12"></u-icon>
 								</view>
@@ -102,19 +102,29 @@
 		
 		<view class="footer-box">
 			<view class="footer-box-l">
-				<view>货物种类:5种</view>
-				<view>货物种数:25件</view>
+				<view>货物种类:{{speciesNum}}种</view>
+				<view>货物种数:{{goodsNum}}件</view>
 			</view>
 			<button class="submitBtn" @tap="submitClick">
 			  提交
 			</button>
 		</view>
 		<error-pop v-model="errorShow" @close="errorShow = false" @confirm="confirm" :content="popText.errorText"></error-pop>
-		<success-pop v-model="successShow" @close="successShow = false" @backClick="backClick" :content="popText.success"></success-pop>
+		<success-pop v-model="successShow" @close="successShow = false" @backClick="backClick" :content="popText.successText"></success-pop>
 		<!-- 扫码之后弹窗 -->
 		<scaned-pop v-model="scanedShow" @close="scanedShow = false" @confirm="scanConfirm"></scaned-pop>
 		
 		<goods-pop v-model="goodsShow" @close="goodsShow = false" type="caigou"></goods-pop>
+		
+		<u-datetime-picker
+			:show="calendarShow"
+			v-model="value1"
+			:maxDate="maxDate"
+			mode="date"
+			:closeOnClickOverlay="true"
+			@confirm="calendarConfirm"
+			@cancel="calendarShow = false"
+		></u-datetime-picker>
 	</view>
 </template>
 
@@ -124,6 +134,7 @@
 	import successPop from '@/components/success-pop/success-pop.vue'
 	import scanedPop from '@/components/scaned-pop/scaned-pop.vue'
 	import goodsPop from '@/components/goods-pop/goods-pop.vue'
+	import {orderDetail, orderInfo, orderSubmit} from '@/common/request/apis/purchase'
 	export default {
 		components: {
 			goodItem,
@@ -148,38 +159,153 @@
 					mark: '',
 					url: ''
 				},
-				goodsList: [
-					{
-						src: '',
-						name: '大童专用氨基酸洗发水',
-					}, {
-						src: '',
-						name: '大童专用氨基酸洗发水',
-					},
-				]
+				goodsList: [],
+				orderInfo:{},
+				id:'',
+				calendarShow:false,
+				value1: '',
+				maxDate:Number(new Date()),
+				chooseGoodsInfo:{}
+			}
+		},
+		onLoad(e) {
+			uni.$on('scanFinish',(data)=>{
+				console.log('监听到事件来自 update ,携带参数 msg 为:' + data);
+			})
+			this.id = e.id
+			this.getOrderDetail(e.id)
+			this.getOrderInfo(e.id)
+		},
+		onHide() {
+			uni.$off('scanFinish')
+		},
+		onUnload() {
+			uni.$off('scanFinish')
+		},
+		computed: {
+			speciesNum() {
+				let num = 0
+				if(this.goodsList.length == 0 || !this.goodsList) {
+					num = 0
+				}else {
+					num = this.goodsList.length
+				}
+				return num
+			},
+			// 手动输入的数量
+			goodsNum() {
+				let num = 0
+				if(this.goodsList.length == 0 || !this.goodsList) {
+					num = 0
+				}else {
+					this.goodsList.forEach(item=>{
+						num+=item.materialNumber
+					})
+				}
+				return num
+			},
+			// 订单返回的数量
+			orderGoodsNum() {
+				let num = 0
+				if(this.goodsList.length == 0 || !this.goodsList) {
+					num = 0
+				}else {
+					this.goodsList.forEach(item=>{
+						num+=item.operNumber
+					})
+				}
+				return num
 			}
 		},
 		methods:{
+			calendarConfirm(val) {
+				this.goodsList.forEach(item=>{
+					if(item.id == this.chooseGoodsInfo.id) {
+						item.productionDate = this.$u.timeFormat(val.value, 'yyyy-mm-dd')
+					}
+				})
+				this.calendarShow = false
+			},
+			calendarCole() {
+				this.calendarShow = false
+			},
+			calendarClick(item) {
+				console.log(item.productionDate,'item.productionDate')
+				this.chooseGoodsInfo = item
+				if(item.productionDate) {
+					this.value1 = Number(new Date(item.productionDate))
+				}else {
+					this.value1 = Number(new Date())
+				}
+				this.calendarShow = true
+			},
+			getOrderInfo(id) {
+				orderInfo(id)
+				.then(res=>{
+					if(res.code == 200) {
+						this.orderInfo = res.data
+					}
+				})
+			},
+			getOrderDetail(id) {
+				orderDetail(id)
+				.then(res=>{
+					if(res.code == 200) {
+						res.data.rows.forEach(item=>{
+							item.materialNumber = 0
+						})
+						this.goodsList = res.data.rows
+					}
+				})
+			},
 			submitClick() {
-				
+				if(this.orderGoodsNum != this.goodsNum) {
+					return this.errorShow = true
+				}
+				this.toOrderSubmit()
+			},
+			toOrderSubmit() {
+				let materials = this.goodsList.map(item=> {
+					return {
+						batchNumber:item.batchNumber,
+						materialNumber:item.materialNumber,
+						productionDate:item.productionDate ? this.$u.timeFormat(item.productionDate, 'yyyy-mm-dd') : ''
+					}
+				})
+				let params = {
+					id:this.id,
+					materials:materials,
+					voucherPicture:this.voucherPicture || '',
+					remark:this.orderInfo.mark || ''
+				}
+				orderSubmit(params)
+				.then(res=>{
+					if(res.code == 200) {
+						if(this.errorShow){
+							this.errorShow = false
+						}
+						this.successShow = true
+					}
+				})
 			},
 			confirm() {
-				console.log('确定')
+				this.toOrderSubmit()
 				this.errorShow = false
 			},
 			backClick() {
-				
+				uni.setStorageSync('orderRefresh',true)
+				uni.navigateBack()
 			},
 			// 扫码确认
 			scanConfirm() {
 				
 			},
 			manualClick() {
-				this.goodsShow = true
+				// this.goodsShow = true
 			},
-			toDetail() {
+			toDetail(val) {
 				uni.navigateTo({
-					url:'/pages/goods/detail'
+					url:`/pages/goods/detail?id=${val.id}&name=${val.materialName}`
 				})
 			}
 		}

BIN
unpackage/res/icons/1024x1024.png


BIN
unpackage/res/icons/120x120.png


BIN
unpackage/res/icons/144x144.png


BIN
unpackage/res/icons/152x152.png


BIN
unpackage/res/icons/167x167.png


BIN
unpackage/res/icons/180x180.png


BIN
unpackage/res/icons/192x192.png


BIN
unpackage/res/icons/20x20.png


BIN
unpackage/res/icons/29x29.png


BIN
unpackage/res/icons/40x40.png


BIN
unpackage/res/icons/58x58.png


BIN
unpackage/res/icons/60x60.png


BIN
unpackage/res/icons/72x72.png


BIN
unpackage/res/icons/76x76.png


BIN
unpackage/res/icons/80x80.png


BIN
unpackage/res/icons/87x87.png


BIN
unpackage/res/icons/96x96.png