From f26f29d84e0a68831a6af14dab3eec5500496d2e Mon Sep 17 00:00:00 2001 From: spring <2396852758@qq.com> Date: 星期三, 28 五月 2025 16:48:52 +0800 Subject: [PATCH] 初始化项目 --- pages/wareHouse/packing/detail.vue | 398 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 398 insertions(+), 0 deletions(-) diff --git a/pages/wareHouse/packing/detail.vue b/pages/wareHouse/packing/detail.vue new file mode 100644 index 0000000..3c93dba --- /dev/null +++ b/pages/wareHouse/packing/detail.vue @@ -0,0 +1,398 @@ +<template> + <view class="wrap"> + <u-form class="form" label-position="left"> + <u-form-item label="鑷冲簱浣嶅彿" label-width="180"> + <picker @change="bindPackLocationChange($event,locationNo)" :value="locationIndex" :range="locationNo" + range-key="value"> + <view> + <text>{{locationIndex==null ? "璇烽�夋嫨":locationNo[locationIndex].value}}</text> + </view> + </picker> + </u-form-item> + </u-form> + <scroll-view class="scroll-list" scroll-y="true"> + <view class="list" :border="false" style="margin-top: 20rpx;"> + <view class="title"> + <view> + <u-icon class="grid-icon" name="column-line" :size="40" :style="{ color: '#0081ff' }"></u-icon> + </view> + <view class="text-black text-bold basis-xl">鍖呰淇℃伅</view> + </view> + <view class="content" style="background: #fff;"> + <view class="row-list"> + <view class="_label"> + 缂栧彿: + </view> + <view class="_content"> + {{ packingInfo.no }} + </view> + </view> + <view class="row-list"> + <view class="_label"> + 鐗╂枡缂栫爜: + </view> + <view class="_content"> + {{ packingInfo.cusMaterialCode }} + </view> + </view> + <view class="row-list"> + <view class="_label"> + 鍖呰灏哄: + </view> + <view class="_content"> + {{ packingInfo.packSize }} + </view> + </view> + <view class="row-list"> + <view class="_label"> + 鍖呰: + </view> + <view class="_content"> + {{ packingInfo.packMaterial }} + </view> + </view> + <view class="row-list"> + <view class="_label"> + 鍖呰閲嶉噺: + </view> + <view class="_content"> + {{ packingInfo.packWeight }} + </view> + </view> + </view> + </view> + <u-cell-group class="list" :border="false"> + <view class="title"> + <view> + <u-icon class="grid-icon" name="column-line" :size="40" :style="{ color: '#0081ff' }"></u-icon> + </view> + <view class="text-black text-bold basis-xl">鍖呰绉诲簱淇℃伅</view> + </view> + <view class="content" v-for="(item, index) in list" :key="item.id" :index="index"> + <view class="row-img" @click="deleteHandle(item)"> + <u-image width="18px" height="18px" src="@/static/custom/delete.png"></u-image> + </view> + <view class="row-list" style="padding-top: 8px;"> + <view class="_label"> + 闆朵欢鍙�: + </view> + <view class="_content"> + {{ item.partNo }} + </view> + </view> + <view class="row-list"> + <view class="_label"> + 闆朵欢鍚嶇О: + </view> + <view class="_content"> + {{ item.partName }} + </view> + </view> + <view class="row-list"> + <view class="_label"> + 绯荤粺缂栧彿: + </view> + <view class="_content"> + {{ item.systemNo }} + </view> + </view> + <view class="row-list"> + <view class="_label"> + SN: + </view> + <view class="_content"> + {{ item.partBatchNo }} + </view> + </view> + <view class="row-list"> + <view class="_label"> + IFS鎵规鍙�: + </view> + <view class="_content"> + {{ item.ifsBatchNo }} + </view> + </view> + <view class="row-list"> + <view class="_label"> + 鍗曚綅: + </view> + <view class="_content"> + {{ item.unit }} + </view> + </view> + <view class="row-list"> + <view class="_label"> + 浠庡簱浣嶅彿: + </view> + <view class="_content"> + {{ item.locationNo }} + </view> + </view> + <view class="row-list"> + <view class="_label"> + 鑷冲簱浣嶅彿: + </view> + <view class="_content"> + {{ item.inLocationNo }} + </view> + </view> + <view class="row-list"> + <view class="_label"> + 鍙敤搴撳瓨鏁伴噺: + </view> + <view class="_content"> + {{ item.availableStockQuantity }} + </view> + </view> + </view> + </u-cell-group> + </scroll-view> + <scan></scan> + </view> +</template> +<script> + import scan from "@/components/scan/scan.vue"; + export default { + components: { + scan + }, + data() { + return { + list: [], + packingInfo: {}, + locationNo: [], + tolocationNo: "", //鑷冲簱浣嶅彿 + tolocationId: undefined, //鑷冲簱浣嶅彿id + locationIndex: null, + }; + }, + onReady() { + let that = this + //鑾峰彇鑷冲簱浣嶅彿 + that.$u.api.pigxPacking.packHeadBasicInfoList().then(res => { + let locationNoList = res.data.locationNoList + locationNoList.map((item, index) => { + + let location = { + lable: item, + value: item + } + that.locationNo.push(location) + }); + + }); + + }, + onLoad(option) { + if (option.item) { + let obj = JSON.parse(decodeURIComponent(option.item)); + this.packingInfo = obj + } + this.loadList() + }, + onShow() { + + let that = this + + uni.$off('scan') // 姣忔杩涙潵鍏� 绉婚櫎鍏ㄥ眬鑷畾涔変簨浠剁洃鍚櫒 + uni.$on('scan', function(data) { + console.log('onscan'); + //鎵爜鎴愬姛鍚庣殑鍥炶皟锛屼綘鍙互鍐欒嚜宸辩殑閫昏緫浠g爜鍦ㄨ繖閲� + console.log('鎵爜缁撴灉锛�', data.code); + + if (data.code != "" && (that.tolocationNo == "")) { + uni.showToast({ + title: '璇烽�夋嫨鑷冲簱浣嶅彿', + icon: 'none' + }) + return + } + + that.scanHandler(data.code); + }) + }, + onNavigationBarButtonTap(e) { + uni.scanCode({ + success: res => { + try { + const result = JSON.parse(res.result) + + } catch (e) {} + } + }); + }, + methods: { + //鎵爜鎿嶄綔 + scanHandler(scanCode) { + let that = this + let data = { + partBatchNo: scanCode + } + that.$u.api.pigxPacking.getStockInfoByBatchNo(data).then(res => { + + let resList = [] + resList = res.data.records + + if (resList.length > 0) { + let paramObj = { + stockList: resList, + inLocationId: that.tolocationId, //鑷冲簱浣峣d + id: that.packingInfo.id + } + + that.$u.api.pigxPacking.addPackagingItem(paramObj).then(res1 => { + + setTimeout(() => { + uni.showModal({ + title: '鎻愮ず', + content: '鍖呰绉诲簱鎴愬姛', + showCancel: false, + success: function() { + that.loadList(); + } + }) + }, 200) + + }) + + } + + }); + }, + async loadList() { + + let that = this + that.list = [] + + let paramObj = { + packagingId: that.packingInfo.id + } + + let res = await that.$u.api.pigxPacking.getPackagingItemList(paramObj); + let reList = res.data.records + + for (let i = 0; i < reList.length; i++) { + + //搴撳瓨淇℃伅 + let data = { + systemNo: reList[i].systemNo + } + let resStock = await that.$u.api.pigxPacking.getStockInfo(data) + let stockList = resStock.data.records + //鍒ゆ柇鏁扮粍涓槸鍚﹀瓨鍦� + let stockInfoList = stockList.filter(item => item.id == reList[i].stockId) + + //鍖呰淇℃伅 + let item = { + id: reList[i].id, + partNo: reList[i].partNo, + partName: reList[i].partName, + partBatchNo: "", + ifsBatchNo: "", + unit: "", + locationNo: "", + availableStockQuantity: "", + inLocationNo: reList[i].inLocationNo, + systemNo: reList[i].systemNo + } + + //搴撳瓨淇℃伅 + if (stockInfoList.length > 0) { + item.partBatchNo = stockInfoList[0].partBatchNo + item.ifsBatchNo = stockInfoList[0].ifsBatchNo + item.unit = stockInfoList[0].unit + item.locationNo = stockInfoList[0].locationNo + item.availableStockQuantity = stockInfoList[0].availableStockQuantity + } + + that.list.push(item) + + } + }, + //鑷冲簱浣嶅彿 + bindPackLocationChange(e, storage) { + + if (storage.length <= 0) { + this.locationIndex = null + return + } + this.locationIndex = e.target.value + this.tolocationNo = storage[this.locationIndex].value + + //鑾峰彇鑷冲簱浣嶅彿瀵瑰簲鐨刬d鍩虹鏁版嵁 + let data = { + locNo: this.tolocationNo + } + this.$u.api.pigxPacking.getBasicLocation(data).then(res => { + + let reList = res.data.records + if (reList.length > 0) { + this.tolocationId = reList[0].id + //娴嬭瘯鐢� + // this.scanHandler("KC000006"); + } + }); + + }, + deleteHandle(obj) { + let that = this + + uni.showModal({ + title: '鎻愮ず', + content: '姝ゆ搷浣滃皢姘镐箙鍒犻櫎绯荤粺鍙�:' + obj.systemNo + ', 鏄惁缁х画?', + success: function(res) { + if (res.confirm) { + + that.$u.api.pigxPacking.delPackagingItem(obj).then(res => { + that.loadList(); + }) + } + } + }); + } + } + }; +</script> +<style lang="scss" scoped> + .wrap .form { + padding: 0px 13px; + ; + } + + .list .content { + font-size: 12px; + background-color: #efefef; + box-sizing: border-box; + border-radius: 14rpx; + margin: 8px; + padding: 5px 10px; + box-shadow: none; + position: relative; + } + + .list .title { + display: flex; + flex-direction: row; + } + + .row-list { + display: flex; + flex-direction: row; + } + + .row-list ._label { + flex: 0.8; + color: #909399; + } + + .row-list ._content { + flex: 1.5; + text-align: right; + } + + .row-img { + position: absolute; + right: 2px; + top: 0px; + } +</style> -- Gitblit v1.9.3