Browse Source

asn收货

intex_online20241228
张立 2 months ago
parent
commit
263c9557fa
  1. 37
      src/api/request2.js
  2. 5
      src/common/style/new_style.css
  3. 4
      src/manifest.json
  4. 37
      src/mycomponents/balance/intoDeliNo.vue
  5. 6
      src/mycomponents/item/itemCompareQty.vue
  6. 2
      src/mycomponents/job/jobBottom.vue
  7. 2
      src/mycomponents/job/jobComMainCardAsn.vue
  8. 9
      src/mycomponents/job/jobComMainDetailCard.vue
  9. 2
      src/mycomponents/job/jobTopAsn.vue
  10. 30
      src/mycomponents/package/packageCard.vue
  11. 26
      src/mycomponents/package/packageList.vue
  12. 14
      src/mycomponents/qty/compareQty.vue
  13. 13
      src/mycomponents/qty/recommendHandleQty.vue
  14. 35
      src/pages.json
  15. 15
      src/pages/purchaseReceipt/coms/comReceiptDetailCardBacth.vue
  16. 10
      src/pages/purchaseReceipt/coms/comReceiptJobCard.vue
  17. 559
      src/pages/purchaseReceipt/job/purchaseReceiptAsn.vue
  18. 489
      src/pages/purchaseReceipt/job/purchaseReceiptAsnDetail.vue

37
src/api/request2.js

@ -827,14 +827,29 @@ export function getPurchaseReceiptJobList(params) {
data: params, data: params,
}); });
} }
/**
* 采购收货 任务
* status 任务状态
* 开始日期
* 结束日期
* 获取日期任务列表
* 接口返回添加包装号列表
* @param {*}
*/
export function getPurchaseReceiptASNJobList(params) {
return request({
url: baseApi + "/wms/purchasereceipt-job-detail/seniorASN",
method: "post",
data: params,
});
}
/** /**
* 采购收货 任务承接 * 采购收货 任务承接
* @param {*} id * @param {*} id
* *
*/ */
export function takePurchaseReceiptJob(id) { export async function takePurchaseReceiptJob(id) {
return request({ return await request({
url: baseApi + "/wms/purchasereceipt-job-main/accept?id=" + id, url: baseApi + "/wms/purchasereceipt-job-main/accept?id=" + id,
method: "put", method: "put",
data: {}, data: {},
@ -846,8 +861,8 @@ export function takePurchaseReceiptJob(id) {
* @param {*} id * @param {*} id
* *
*/ */
export function cancleTakePurchaseReceiptJob(id) { export async function cancleTakePurchaseReceiptJob(id) {
return request({ return await request({
url: baseApi + "/wms/purchasereceipt-job-main/abandon?id=" + id, url: baseApi + "/wms/purchasereceipt-job-main/abandon?id=" + id,
method: "put", method: "put",
data: {}, data: {},
@ -890,6 +905,18 @@ export function purchaseReceiptJobSubmit(params) {
data: params, data: params,
}); });
} }
/**
* asn采购收货 多任务提交
* @param {*} 任务id
*
*/
export function purchaseReceiptJobSubmitASN(params) {
return request({
url: baseApi + "/wms/purchasereceipt-job-main/executeASN",
method: "put",
data: params,
});
}
/** /**

5
src/common/style/new_style.css

@ -2179,6 +2179,11 @@ button::after {
padding: 5px; padding: 5px;
} }
.scan_view_gay {
/* #0CC2B6 20% */
background: linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0%, rgba(12, 194, 182, 0) 100%)
}
.scan_view { .scan_view {
/* #0CC2B6 20% */ /* #0CC2B6 20% */
background: linear-gradient(90deg, rgba(12, 194, 182, 0.2) 0%, rgba(12, 194, 182, 0) 100%) background: linear-gradient(90deg, rgba(12, 194, 182, 0.2) 0%, rgba(12, 194, 182, 0) 100%)

4
src/manifest.json

@ -3,8 +3,8 @@
"package" : "com.yingtai.pda", "package" : "com.yingtai.pda",
"appid" : "__UNI__F36DDCF", "appid" : "__UNI__F36DDCF",
"description" : "", "description" : "",
"versionName" : "1.0.1", "versionName" : "1.0.2",
"versionCode" : 1, "versionCode" : 2,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus" : {

37
src/mycomponents/balance/intoDeliNo.vue

@ -0,0 +1,37 @@
<template>
<view class="card_view ">
<text class="card_batch ">纳入便次</text>
<text class="card_content ">{{timestampToDateFormat(planArriveTime)}}<text v-if='deliNo && planArriveTime'>-</text>{{String(deliNo).length < 2 ? ('0' + deliNo) :deliNo }}</text>
</view>
</template>
<script>
export default {
data() {
return {}
},
props: {
planArriveTime: {
type: String,
default: ""
},
deliNo: {
type: String,
default: ""
}
},
methods:{
timestampToDateFormat(timestamp) {
const dateObj = new Date(timestamp); // Date
const year = dateObj.getFullYear(); //
const month = ("0" + (dateObj.getMonth() + 1)).slice(-2); //
const day = ("0" + dateObj.getDate()).slice(-2); //
return `${year}${month}${day}`; //
}
}
}
</script>
<style>
</style>

6
src/mycomponents/item/itemCompareQty.vue

@ -3,18 +3,19 @@
<view style="flex: 1;"> <view style="flex: 1;">
<item :dataContent="dataContent"></item> <item :dataContent="dataContent"></item>
</view> </view>
<!-- 显示采购标包数量和单位 -->
<view style="width: 40%;display: flex; flex-direction: column; align-items: flex-end; justify-content:flex-end;margin-right: 10rpx;word-break:break-word; " > <view style="width: 40%;display: flex; flex-direction: column; align-items: flex-end; justify-content:flex-end;margin-right: 10rpx;word-break:break-word; " >
<recommend-qty v-if="handleQty==0" :dataContent="dataContent" :isShowStatus="false" :isShowStdPack="true" :isShowSupplierQty='isShowSupplierQty' <recommend-qty v-if="handleQty==0" :dataContent="dataContent" :isShowStatus="false" :isShowStdPack="true" :isShowSupplierQty='isShowSupplierQty'
></recommend-qty> ></recommend-qty>
<!-- :objTextStyle='objTextStyle' -->
<compare-qty v-else :dataContent="dataContent" :recommendQty="Number(dataContent.qty)" <compare-qty v-else :dataContent="dataContent" :recommendQty="Number(dataContent.qty)"
:handleQty="Number(handleQty)" :isShowStatus="false" :isShowPackUnit="isShowPackUnit"> :handleQty="Number(handleQty)" :isShowStatus="false" :isShowPackUnit="isShowPackUnit" :isShowSupplierQty='isShowSupplierQty'>
</compare-qty> </compare-qty>
<view class="text_packQty" style="margin-top: 5rpx; margin-right: 20rpx;" v-if="isShowPackCount" > <view class="text_packQty" style="margin-top: 5rpx; margin-right: 20rpx;" v-if="isShowPackCount" >
{{dataContent.fromPackCount}}/{{dataContent.toPackCount}} {{dataContent.fromPackCount}}/{{dataContent.toPackCount}}
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
@ -66,6 +67,7 @@
type: Boolean, type: Boolean,
default: false default: false
}, },
}, },
watch: { watch: {

2
src/mycomponents/job/jobBottom.vue

@ -1,6 +1,6 @@
<template> <template>
<!-- style="margin-top: 10rpx;margin-bottom: 10rpx;" class="uni-flex uni-row space-between u-col-center" --> <!-- style="margin-top: 10rpx;margin-bottom: 10rpx;" class="uni-flex uni-row space-between u-col-center" -->
<view class="task_item"> <view class="task_item" style="background: none;">
<view class="uni-flex space-between u-col-center"> <view class="uni-flex space-between u-col-center">
<view class="uni-flex uni-row u-col-center"> <view class="uni-flex uni-row u-col-center">
<image class="card_icon_normal" src="/static/icons/icon_customer.svg" alt="" /> <image class="card_icon_normal" src="/static/icons/icon_customer.svg" alt="" />

2
src/mycomponents/job/jobComMainCardAsn.vue

@ -1,6 +1,6 @@
<template> <template>
<view> <view>
<view class="task_card"> <view class="task_card" :class="dataContent.scaned?'scan_view':''">
<jobTopAsn :dataContent="dataContent"></jobTopAsn> <jobTopAsn :dataContent="dataContent"></jobTopAsn>
<slot></slot> <slot></slot>
<view class='split_line'></view> <view class='split_line'></view>

9
src/mycomponents/job/jobComMainDetailCard.vue

@ -1,5 +1,5 @@
<template> <template>
<view class="task_item"> <view class="task_item" style="background: none;">
<view class="task_text" style="border-top: 1px solid #dedede;padding-top: 20rpx;margin-top: 20rpx;" > <view class="task_text" style="border-top: 1px solid #dedede;padding-top: 20rpx;margin-top: 20rpx;" >
<!-- 主子表拆分没有数量了 --> <!-- 主子表拆分没有数量了 -->
<itemCompareQty :dataContent="dataContent" <itemCompareQty :dataContent="dataContent"
@ -12,6 +12,7 @@
<pack v-if="isShowPack && dataContent.packingNumber" :packingCode="dataContent.packingNumber"> <pack v-if="isShowPack && dataContent.packingNumber" :packingCode="dataContent.packingNumber">
</pack> </pack>
<batch v-if="isShowBatch && dataContent.batch" :batch="dataContent.batch"></batch> <batch v-if="isShowBatch && dataContent.batch" :batch="dataContent.batch"></batch>
<intoDeliNo v-if="isShowBatchDeliNo" :planArriveTime="dataContent.planArriveTime" :deliNo="dataContent.deliNo"></intoDeliNo>
<view class="u-flex u-row-between"> <view class="u-flex u-row-between">
<location v-if="isShowFromLocation&&dataContent.fromLocationCode" title="来源库位" :locationCode="dataContent.fromLocationCode"> <location v-if="isShowFromLocation&&dataContent.fromLocationCode" title="来源库位" :locationCode="dataContent.fromLocationCode">
</location> </location>
@ -31,6 +32,7 @@
import location from '@/mycomponents/balance/location.vue' import location from '@/mycomponents/balance/location.vue'
import toLocation from '@/mycomponents/balance/toLocation.vue' import toLocation from '@/mycomponents/balance/toLocation.vue'
import batch from '@/mycomponents/balance/batch.vue' import batch from '@/mycomponents/balance/batch.vue'
import intoDeliNo from '@/mycomponents/balance/intoDeliNo.vue'
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue' import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import level from '@/mycomponents/balance/level.vue' import level from '@/mycomponents/balance/level.vue'
@ -40,6 +42,7 @@
location, location,
toLocation, toLocation,
batch, batch,
intoDeliNo,
itemCompareQty, itemCompareQty,
level level
}, },
@ -64,6 +67,10 @@
type: Boolean, type: Boolean,
default: true default: true
}, },
isShowBatchDeliNo: {
type: Boolean,
default: false
},
isShowFromLocation: { isShowFromLocation: {
type: Boolean, type: Boolean,
default: true default: true

2
src/mycomponents/job/jobTopAsn.vue

@ -1,5 +1,5 @@
<template> <template>
<view class="task_top"> <view class="task_top" style="background: none;">
<view class="uni-flex space-between u-col-center align-center" > <view class="uni-flex space-between u-col-center align-center" >
<job-number v-if="dataContent.asnNumber==null || dataContent.asnNumber==''" :number="dataContent.requestNumber"></job-number> <job-number v-if="dataContent.asnNumber==null || dataContent.asnNumber==''" :number="dataContent.requestNumber"></job-number>
<job-number v-else :number="dataContent.asnNumber"></job-number> <job-number v-else :number="dataContent.asnNumber"></job-number>

30
src/mycomponents/package/packageCard.vue

@ -1,14 +1,14 @@
<template> <template>
<view :class="dataContent.scaned?'scan_view':''" style="background-color: #fff; "> <view :class="dataContent.scaned?'scan_view':isShowPackingNumberProps && dataContent.requestNumber ? 'scan_view_gay' :''" style="background-color: #fff; ">
<!-- border-bottom: 1upx solid #EEEEEE; --> <!-- border-bottom: 1upx solid #EEEEEE; -->
<view class="uni-flex uni-row space-between" style="align-items: center"> <view class="uni-flex uni-row space-between" style="align-items: center">
<!-- uni-inline-item 暂时拿掉--> <!-- uni-inline-item 暂时拿掉-->
<view style="word-break: break-all;"> <view style="word-break: break-all;">
<!-- <container v-if="isShowContainer&&dataContent.containerNumber!=null" :container="dataContent.containerNumber"> <!-- <container v-if="isShowContainer&&dataContent.containerNumber!=null" :container="dataContent.containerNumber">
</container> --> </container> -->
<pack :packingCode="dataContent.packingNumber" :isShowPackingNumberProps='isShowPackingNumberProps' :title='packTitle'></pack>
<pack :packingCode="dataContent.packingNumber" :isShowPackingNumberProps='isShowPackingNumberProps'></pack>
<batch v-if="isShowBatch && dataContent.batch!=null" :batch="dataContent.batch"></batch> <batch v-if="isShowBatch && dataContent.batch!=null" :batch="dataContent.batch"></batch>
<intoDeliNo v-if="isShowBatchDeliNo " :planArriveTime="dataContent.planArriveTime" :deliNo="dataContent.deliNo"></intoDeliNo>
<location v-if="isShowFromLocation" title="来源库位" :locationCode="dataContent.fromLocationCode"> <location v-if="isShowFromLocation" title="来源库位" :locationCode="dataContent.fromLocationCode">
</location> </location>
<!-- <to-location></to-location> --> <!-- <to-location></to-location> -->
@ -20,7 +20,7 @@
<recommend-qty v-if="dataContent.handleQty==null || dataContent.handleQty==undefined" :dataContent="dataContent" <recommend-qty v-if="dataContent.handleQty==null || dataContent.handleQty==undefined" :dataContent="dataContent"
:isShowStdPack="false" :isShowStatus="isShowStatus"></recommend-qty> :isShowStdPack="false" :isShowStatus="isShowStatus"></recommend-qty>
<compare-qty v-else :dataContent="dataContent" :recommendQty="Number(dataContent.qty)" <compare-qty v-else :dataContent="dataContent" :recommendQty="Number(dataContent.qty)"
:handleQty="Number(dataContent.handleQty)" :isShowStdPack="false" :isShowStatus="isShowStatus" :isShowRecommendQty='isShowRecommendQty'> :handleQty="Number(dataContent.handleQty)" :isShowStdPack="false" :isShowStatus="isShowStatus" :isShowRecommendQty='isShowRecommendQty' :isShowSupplierQty='isShowSupplierQty' :isShowPackUnit='isShowPackUnit'>
</compare-qty> </compare-qty>
<!-- <view class="uni-flex uni-row center" style="vertical-align:center ;" v-if="isDevlement()"> <!-- <view class="uni-flex uni-row center" style="vertical-align:center ;" v-if="isDevlement()">
@ -40,6 +40,7 @@
import recommendQty from '@/mycomponents/qty/recommendQty.vue' import recommendQty from '@/mycomponents/qty/recommendQty.vue'
import compareQty from '@/mycomponents/qty/compareQty.vue' import compareQty from '@/mycomponents/qty/compareQty.vue'
import config from '@/static/config.js' import config from '@/static/config.js'
import intoDeliNo from '@/mycomponents/balance/intoDeliNo.vue'
export default { export default {
components: { components: {
@ -49,7 +50,8 @@
toLocation, toLocation,
batch, batch,
recommendQty, recommendQty,
compareQty compareQty,
intoDeliNo
}, },
data() { data() {
@ -74,6 +76,10 @@
type: Boolean, type: Boolean,
default: true default: true
}, },
isShowBatchDeliNo: {
type: Boolean,
default: false
},
isShowFromLocation: { isShowFromLocation: {
type: Boolean, type: Boolean,
default: true default: true
@ -99,7 +105,19 @@
isShowRecommendQty: { isShowRecommendQty: {
type: Boolean, type: Boolean,
default: true default: true
} },
isShowSupplierQty: {
type: Boolean,
default: false
},
packTitle:{
type:String,
default: '包装'
},
isShowPackUnit: {
type: Boolean,
default: true
},
}, },
watch: { watch: {
// //

26
src/mycomponents/package/packageList.vue

@ -10,7 +10,7 @@
@click="swipeClick($event,item,'parent',index)"> @click="swipeClick($event,item,'parent',index)">
<package-card :dataContent="item" :isShowLocation="false" <package-card :dataContent="item" :isShowLocation="false"
:isShowFromLocation="isShowFromLocation" :isShowFromLocation="isShowFromLocation"
:isShowStatus="isShowStatus"></package-card> :isShowStatus="isShowStatus" :isShowSupplierQty='isShowSupplierQty' :isShowBatch="isShowBatch" :isShowBatchDeliNo='isShowBatchDeliNo'></package-card>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
@ -19,13 +19,16 @@
style=" width: 100%; background-color: antiquewhite;"> style=" width: 100%; background-color: antiquewhite;">
<uni-swipe-action> <uni-swipe-action>
<uni-swipe-action-item <uni-swipe-action-item
:right-options="(pack.scaned)?editAndRemoveOptions : pack.scaned? removeOptions:options" :right-options="(pack.scaned&&isEdit)?editAndRemoveOptions : pack.scaned? removeOptions:options"
@click="swipeClick($event,pack,'child',index,item)"> @click="swipeClick($event,pack,'child',index,item)">
<package-card :dataContent="pack" :isShowLocation="false" :isShowFromLocation="false" :isShowPackingNumberProps='isShowPackingNumberProps'
<package-card :dataContent="pack" :isShowLocation="false" :isShowFromLocation="false" :isShowPackingNumberProps='isShowPackingNumberProps' :isShowSupplierQty='false'
:isShowToLocation="false" :isShowToLocation="false"
:isShowStatus="isShowPackListStatus" :isShowStatus="isShowPackListStatus"
:isShowRecommendQty='false' :isShowRecommendQty='false'
:isShowBatch="false"></package-card> :isShowBatch="false"
:isShowPackUnit='false'
:packTitle='packTitle'></package-card>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
@ -85,6 +88,10 @@
type: Boolean, type: Boolean,
default: true default: true
}, },
isShowBatchDeliNo: {
type: Boolean,
default: false
},
isShowFromLocation: { isShowFromLocation: {
type: Boolean, type: Boolean,
default: true default: true
@ -124,7 +131,14 @@
type: Boolean, type: Boolean,
default: false default: false
}, },
isShowSupplierQty: {
type: Boolean,
default: false
},
packTitle:{
type:String,
default: '包装'
},
}, },
watch: { watch: {
@ -251,7 +265,7 @@
confirm(qty) { confirm(qty) {
this.editItem.handleQty = qty; this.editItem.handleQty = qty;
this.$emit("updateData") this.$emit("updateData")
} },
} }
} }

14
src/mycomponents/qty/compareQty.vue

@ -34,7 +34,13 @@
<uom v-show="Number(handleQty)!=0||(isShowRecommendQty&&Number(recommendQty)>0)" :uom="dataContent.uom"> <uom v-show="Number(handleQty)!=0||(isShowRecommendQty&&Number(recommendQty)>0)" :uom="dataContent.uom">
</uom> </uom>
</view> </view>
<view> <view class="uni-flex uni-row " style="justify-content: flex-end;" v-if="dataContent.uom != dataContent.supplierUom && isShowSupplierQty">
<view class="text_recommend " style="font-size: 28rpx;margin-left: 12rpx;">
{{Number(dataContent.supplierQty) || null}}
</view>
<uom :uom="dataContent.supplierUom" style="font-size: 28rpx;margin-left: 12rpx;"></uom>
</view>
<view v-if="!isShowSupplierQty">
<pack-unit v-show="isShowPackUnit" :dataContent="dataContent"></pack-unit> <pack-unit v-show="isShowPackUnit" :dataContent="dataContent"></pack-unit>
<!-- <std-pack-qty v-show="isShowStdPack" :dataContent="dataContent"></std-pack-qty> --> <!-- <std-pack-qty v-show="isShowStdPack" :dataContent="dataContent"></std-pack-qty> -->
</view> </view>
@ -91,7 +97,11 @@
isShowRecommendQty: { isShowRecommendQty: {
type: Boolean, type: Boolean,
default: true default: true
} },
isShowSupplierQty: {
type: Boolean,
default: false
},
}, },
watch: { watch: {
handleQty: { handleQty: {

13
src/mycomponents/qty/recommendHandleQty.vue

@ -10,17 +10,14 @@
{{Number(dataContent.qty)}} {{Number(dataContent.qty)}}
</view> </view>
<uom :uom="dataContent.uom"></uom> <uom :uom="dataContent.uom"></uom>
<view class="uni-flex uni-row center" v-if="dataContent.uom != dataContent.supplierUom && isShowSupplierQty">
<span class="uom">|</span>
<view class="text_recommend " style="font-size: 30rpx;margin-left: 12rpx;">
{{Number(dataContent.supplierQty) || 0}}
</view> </view>
<uom :uom="dataContent.supplierUom" style="font-size: 30rpx;margin-left: 12rpx;"></uom> <view class="uni-flex uni-row " style="justify-content: flex-end;" v-if="dataContent.uom != dataContent.supplierUom && isShowSupplierQty">
<view class="text_recommend " style="font-size: 28rpx;margin-left: 12rpx;">
{{Number(dataContent.supplierQty) || 0}}
</view> </view>
<uom :uom="dataContent.supplierUom" style="font-size: 28rpx;margin-left: 12rpx;"></uom>
</view> </view>
<view v-if="!isShowSupplierQty">
<view>
<pack-unit :dataContent="dataContent"></pack-unit> <pack-unit :dataContent="dataContent"></pack-unit>
<!-- <std-pack-qty v-show="isShowStdPack" :dataContent="dataContent"></std-pack-qty> --> <!-- <std-pack-qty v-show="isShowStdPack" :dataContent="dataContent"></std-pack-qty> -->
</view> </view>

35
src/pages.json

@ -310,6 +310,34 @@
} }
} }
}, },
{
"path": "pages/purchaseReceipt/job/purchaseReceiptAsn",
"style": {
"navigationBarTitleText": "ASN收货",
"enablePullDownRefresh": true,
"titleNView": {
// "autoBackButton": "true",
"buttons": [
//
{
"float": "right",
"fontSize": "58rpx", //
"text": "\ue696",
"fontSrc": "/static/ali_icon/iconfont.ttf"
},
{
"float": "right",
"fontSize": "52rpx", //
"text": "\ue6e2",
"fontSrc": "/static/ali_icon/iconfont.ttf"
}
]
}
}
},
{ {
"path": "pages/purchaseReceipt/job/purchaseReject", "path": "pages/purchaseReceipt/job/purchaseReject",
"style": { "style": {
@ -345,6 +373,13 @@
"enablePullDownRefresh": true "enablePullDownRefresh": true
} }
}, },
{
"path": "pages/purchaseReceipt/job/purchaseReceiptAsnDetail",
"style": {
"navigationBarTitleText": "ASN收货任务详情",
"enablePullDownRefresh": true
}
},
{ {
"path": "pages/purchaseReturn/record/returnRecord", "path": "pages/purchaseReturn/record/returnRecord",
"style": { "style": {

15
src/pages/purchaseReceipt/coms/comReceiptDetailCardBacth.vue

@ -13,7 +13,7 @@
</template> </template>
<package-list ref='packageListRef' :dataContent="dataContent.subList" :isEdit="false" <package-list ref='packageListRef' :dataContent="dataContent.subList" :isEdit="false"
:settingParam="settingParam" @collapseChange="collapseChange" @updateData="updateData" :settingParam="settingParam" @collapseChange="collapseChange" @updateData="updateData"
:isShowFromLocation="false" :isShowPackingNumberProps='true' :isNumPackTips='isNumPackTips'></package-list> :isShowFromLocation="false" :isShowPackingNumberProps='true' :isNumPackTips='isNumPackTips' :isShowSupplierQty='isShowSupplierQty' :isShowBatch="isShowBatch" :isShowBatchDeliNo='isShowBatchDeliNo' :packTitle='packTitle'></package-list>
</uni-collapse-item> </uni-collapse-item>
</uni-collapse> </uni-collapse>
@ -76,7 +76,18 @@
type: Boolean, type: Boolean,
default: false default: false
}, },
isShowBatch: {
type: Boolean,
default: true
},
isShowBatchDeliNo: {
type: Boolean,
default: false
},
packTitle:{
type:String,
default: '包装'
},
}, },
watch: { watch: {

10
src/pages/purchaseReceipt/coms/comReceiptJobCard.vue

@ -1,6 +1,6 @@
<template> <template>
<jobComMainCardAsn :dataContent="dataContent"> <jobComMainCardAsn :dataContent="dataContent">
<jobComMainDetailCard :dataContent="dataContent" :isShowSupplierQty='isShowSupplierQty'></jobComMainDetailCard> <jobComMainDetailCard :dataContent="dataContent" :isShowSupplierQty='isShowSupplierQty' :isShowBatchDeliNo='isShowBatchDeliNo' :isShowBatch='isShowBatch'></jobComMainDetailCard>
</jobComMainCardAsn> </jobComMainCardAsn>
</template> </template>
@ -25,6 +25,14 @@
type: Boolean, type: Boolean,
default: false default: false
}, },
isShowBatch: {
type: Boolean,
default: true
},
isShowBatchDeliNo: {
type: Boolean,
default: false
},
}, },
methods: { methods: {

559
src/pages/purchaseReceipt/job/purchaseReceiptAsn.vue

@ -0,0 +1,559 @@
<template>
<view class="">
<com-empty-view v-if="jobList.length==0"></com-empty-view>
<view v-if="jobList.length>0" style="padding-bottom: 110rpx;">
<uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in jobList" :key="index">
<uni-swipe-action-item :right-options="detailOptions" @click="swipeClick($event,item)">
<com-receipt-job-card :dataContent="item" @click='openJobDetail(item)' :isShowSupplierQty='true'
:isShowBatch='false' :isShowBatchDeliNo='true'></com-receipt-job-card>
</uni-swipe-action-item>
</view>
</uni-swipe-action>
</view>
<view class="page-footer" v-if="jobList.length>0">
<button class="btn_single_clear" hover-class="btn_commit_after" @click="clearAll">清空</button>
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
</view>
<receipt-info-popup ref='jobInfoPopup'></receipt-info-popup>
<receipt-job-list-popup ref="jobListPopup" @selectedItem="selectedItem"></receipt-job-list-popup>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
<winScanPackJob :title="scanHintTitle" ref="scanPopup" @getResult='getScanResult'></winScanPackJob>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
getPurchaseReceiptASNJobList,
takePurchaseReceiptJob,
cancleTakePurchaseReceiptJob,
purchaseReceiptJobSubmitASN
} from '@/api/request2.js';
import {
Decimal
} from 'decimal.js'; //
import {
getDetailOption,
getDetailRemoveOption
} from '@/common/array.js';
import {
calc
} from '@/common/calc'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue"
import comReceiptJobCard from '@/pages/purchaseReceipt/coms/comReceiptJobCard.vue'
import receiptJobListPopup from '@/pages/purchaseReceipt/coms/receiptJobListPopup.vue'
import receiptInfoPopup from '@/pages/purchaseReceipt/coms/receiptInfoPopup.vue'
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
export default {
name: 'purchaseReceiptAsn',
components: {
winScanButton,
winScanPackJob,
comReceiptJobCard,
receiptJobListPopup,
receiptInfoPopup,
comEmptyView
},
data() {
return {
title: '',
scanHintTitle: "箱标签/ASN单号",
jobList: [],
detailOptions: [],
detailRemoveOption: [],
};
},
onShow() {},
onLoad(option) {
this.title = option.title
uni.setNavigationBarTitle({
title: this.title
})
this.detailOptions = getDetailOption();
this.detailRemoveOption = getDetailRemoveOption();
},
onNavigationBarButtonTap(e) {
if (e.index === 0) {
this.$refs.receiptjob.goHome();
// this.$refs.receiptjob.refresh();
} else if (e.index == 1) {
this.$refs.receiptjob.openFilter();
}
},
onShow() {
uni.$on('updateData', (data) => {
this.jobList.forEach(item => {
if (item.asnNumber == data.asnNumber && item.itemCode == data.itemCode && item.batch == data.batch) {
if (data.handleQty) {
item.scaned = true
} else {
item.scaned = false
}
item.packingNumber = data.packingNumber
item.packQty = data.packQty
item.packUnit = data.packUnit
item.toLocationCode = data.toLocationCode
item.labelQty = data.labelQty
item.handleQty = data.handleQty
item.convertRate = data.convertRate
item.supplierQty = data.supplierQty
item.supplierUom = data.supplierUom
item.packageDOS = data.packList
}
})
})
},
methods: {
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
},
getScanResult(result) {
uni.showLoading({
title: "加载中....",
mask: true
});
const asnNumber = result.label.asn || result.label.code
const isAsn = result.label.code ? true : false
try {
if (!asnNumber) {
this.showMessage("标签格式异常,请重新补打标签")
uni.hideLoading();
return;
}
this.scanMessage = ""
let filters = []
// ASN
filters = [{
column: "asn_number",
action: "==",
value: asnNumber
}, {
column: "status",
action: "in",
value: '1,2',
}, {
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
}]
getPurchaseReceiptASNJobList({
filters: filters,
pageNo: 1,
pageSize: 100,
}).then(async res => {
this.scanMessage = result.scanMessage
let resultList = res.data.list;
uni.hideLoading()
if (resultList.length > 0) {
// asn
const asnObj = this.jobList.find(item => item.asnNumber == asnNumber)
//
if (!isAsn) {
result.label.lookNumber = result.package.number.substring(result.package.number
.length - 5);
// asn
if (!asnObj) {
this.$refs.comMessage.showQuestionMessage(`ASN单号【${asnNumber}】不在列表中,是否要按此ASN收货?`, async res => {
if (res) {
// //
if (resultList[0].status == '1') {
await this.handleTakePurchaseReceiptJob(resultList[0].masterId, () => {
resultList.forEach(item => {
item.status = '2'
item.acceptUserId = 4
})
})
} else if (resultList[0].status == '2') {
//
if (resultList[0].acceptUserId != this.$store.state.user.id) {
this.showMessage(`ASN单号【${asnNumber}】已经被${resultList[0].acceptUserName}承接`)
return
}
}
this.jobList = [...this.jobList, ...resultList]
const itemObj = this.jobList.find(item => item.asnNumber == asnNumber && item
.itemCode == result.label.itemCode)
const packObj = itemObj.packageDOS.find(cur => cur.number == result.label
.packingNumber)
if (packObj.requestNumber) {
this.showMessage(`看板编号【${ result.label.lookNumber}】已经收货`)
return
}
if (packObj.scaned) {
this.showMessage(`看板编号【${ result.label.lookNumber}】已经扫描`)
return
}
itemObj.scaned = true
packObj.scaned = true
packObj.handleQty = result.label.qty
packObj.packingNumber = result.package.number
packObj.packQty = Number(result.package.packQty);
packObj.packUnit = result.package.packUnit
packObj.labelQty = Number(result.label.qty);
packObj.convertRate = result.label.convertRate
packObj.supplierQty = parseFloat(calc.div(parseFloat(packObj.handleQty), parseFloat(packObj.convertRate)).toFixed(5))
packObj.supplierUom = result.label.purchaseUom
this.calcHandleQty(this.jobList);
this.scanPopupGetFocus()
}else{
this.scanPopupGetFocus()
}
});
} else {
// asn
const itemObj = this.jobList.find(item => item.asnNumber == asnNumber && item.itemCode == result
.label.itemCode)
if (!itemObj) {
this.showMessage(`ASN单号【${asnNumber}】物料代码【${result.label.itemCode}】不在列表中 `)
return
}
const packObj = itemObj.packageDOS.find(cur => cur.number == result.label.packingNumber)
if (!packObj) {
this.showMessage(
`ASN单号【${asnNumber}】物料代码【${result.label.itemCode}】不存在看板编号【${ result.label.lookNumber}`)
return
}
if (packObj.requestNumber) {
this.showMessage(`看板编号【${ result.label.lookNumber}】已经收货`)
return
}
if (packObj.scaned) {
this.showMessage(`看板编号【${ result.label.lookNumber}】已扫描`)
return
}
itemObj.scaned = true
packObj.scaned = true
packObj.handleQty = result.label.qty
this.calcHandleQty(this.jobList);
this.scanPopupGetFocus()
}
} else {
// if (asnObj) {
// this.showMessage("ASN")
// return;
// }
// //
if (resultList[0].status == '1') {
await this.handleTakePurchaseReceiptJob(resultList[0].masterId, () => {
resultList.forEach(item => {
item.status = '2'
item.acceptUserId = this.$store.state.user.id
})
})
} else if (resultList[0].status == '2') {
//
if (resultList[0].acceptUserId != this.$store.state.user.id) {
this.showMessage(`ASN单号【${asnNumber}】已经被${resultList[0].acceptUserName}承接`)
return
}
}
this.jobList = [...this.jobList, ...resultList]
this.scanPopupGetFocus()
}
} else {
this.showMessage("未查询到此ASN关联的采购收货任务")
}
}).catch(error => {
this.showMessage(error + "\n扫描[" + result.scanMessage + "]")
this.scanPopupGetFocus()
})
} catch (e) {
this.showMessage(e.message)
this.scanPopupGetFocus()
}
},
calcHandleQty(detailSource) {
for (let item of detailSource) {
item.handleQty = new Decimal(0).toNumber();
// item.qty = new Decimal(0).toNumber();
for (let detail of item.packageDOS) {
if (detail != undefined) {
if (detail.scaned) {
item.handleQty = calc.add(item.handleQty, detail.handleQty);
}
// item.qty = calc.add(item.qty, detail.qty);
}
}
}
},
async handleTakePurchaseReceiptJob(id, callback) {
await takePurchaseReceiptJob(id).then(res => {
uni.hideLoading();
callback()
}).catch(error => {
uni.hideLoading();
this.showErrorMessage(error)
})
},
showMessage(message) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.packLoseFocus()
}
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.packGetFocus()
}
}
});
},
swipeClick(e, dataContent) {
if (e.content.text == "详情") {
this.openjobInfoPopup(dataContent);
} else if (e.content.text == "移除") {
this.$refs.comMessage.showQuestionMessage("是否要移除当前收货明细?",
res => {
if (res) {
this.jobList = this.jobList.filter(item => item.asnNumber != dataContent.asnNumber || item.itemCode !=
dataContent.itemCode)
const isHave = this.jobList.some(item => item.asnNumber == dataContent.asnNumber)
if (!isHave) {
//
cancleTakePurchaseReceiptJob(dataContent.masterId).then(res => {
}).catch(error => {})
}
}
});
}
},
openjobInfoPopup(item) {
this.$refs.jobInfoPopup.openPopup(item)
},
showErrorMessage(message) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.losefocus();
}
setTimeout(r => {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.scanPopupGetFocus()
}
});
})
},
openJobDetail(item) {
uni.navigateTo({
url: './purchaseReceiptAsnDetail?data=' + encodeURIComponent(JSON.stringify(item))
});
},
clearAll() {
this.$refs.comMessage.showQuestionMessage("是否确认要清空ASN收货列表?",
async res => {
if (res) {
let masterIds = Array.from(new Set(this.jobList.map(item => item.masterId)))
let index = 0
//
await this.handleCancleTakePurchaseReceiptJob(index, masterIds)
}
});
},
async handleCancleTakePurchaseReceiptJob(index, masterIds) {
if (index <= masterIds.length - 1) {
await cancleTakePurchaseReceiptJob(masterIds[index]).then(res => {
this.jobList = []
index++
this.handleCancleTakePurchaseReceiptJob(index, masterIds)
}).catch(error => {})
} else {
uni.navigateBack({
delta: 2
});
}
},
commit(){
let str =''
let str1 =''
this.params = []
let obj = {}
let obj1 = {}
this.jobList.forEach(item=>{
if(item.scaned){
obj = {...item}
obj.id = item.masterId
if(this.params.some(i => i.asnNumber == item.asnNumber)){
item.packageDOS.forEach(cur=>{
if(cur.scaned){
obj1 = {
...cur,
...item,
packingNumber:cur.number,
number:'',
deliNo:item.deliNo,
itemCode:item.itemCode,
itemDesc:item.itemDesc,
itemDesc1:item.itemDesc1,
itemDesc2:item.itemDesc2,
itemName:item.itemName,
backNumber:item.backNumber,
packQty:cur.packQty,
packUnit:cur.packUnit,
purchaseQty:cur.purchaseQty,
purchaseStdQty:cur.purchaseStdQty,
purchaseUom:cur.purchaseUom,
qty:item.qty,
remark:cur.remark,
supplierBatch:cur.supplierBatch,
supplierCode:cur.supplierCode,
toLocationCode:item.toLocationCode,
uom:item.uom,
handleQty:cur.handleQty,
qty:item.qty,
}
obj.subList.push(obj1)
}
})
}else{
obj.subList=[]
item.packageDOS.forEach(cur=>{
if(cur.scaned){
obj1 = {
...cur,
...item,
packingNumber:cur.number,
number:'',
deliNo:item.deliNo,
itemCode:item.itemCode,
itemDesc:item.itemDesc,
itemDesc1:item.itemDesc1,
itemDesc2:item.itemDesc2,
itemName:item.itemName,
backNumber:item.backNumber,
packQty:cur.packQty,
packUnit:cur.packUnit,
purchaseQty:cur.purchaseQty,
purchaseStdQty:cur.purchaseStdQty,
purchaseUom:cur.purchaseUom,
qty:item.qty,
remark:cur.remark,
supplierBatch:cur.supplierBatch,
supplierCode:cur.supplierCode,
toLocationCode:item.toLocationCode,
uom:item.uom,
handleQty:cur.handleQty,
qty:item.qty,
}
obj.subList.push(obj1)
}
})
this.params.push(obj)
}
}
if(item.handleQty>0 && item.handleQty < item.qty){
str += `ASN单号${item.asnNumber}】物料代码【${item.itemCode}】实际收货数量【${item.handleQty}】小于任务数量【${item.qty}】,\n`
}
if(!item.handleQty){
str1 += `ASN单号${item.asnNumber}】物料代码【${item.itemCode}】实际收货数量为0,\n`
}
})
this.params.forEach(item=>{
delete item.packageDOS
item.subList.forEach(cur=>{
delete cur.packageDOS,
delete item.masterId
})
})
//
if(str || str1){
this.$refs.comMessage.showQuestionMessage1(str + '对于未收货部分将创建一个新的收货任务\n'+ str1 +'是否确认提交', 'red', res => {
if (res) {
this.submitJob()
}
});
}else{
this.submitJob()
}
},
submitJob(){
purchaseReceiptJobSubmitASN(this.params).then(res => {
if (res.data) {
// this.showCommitSuccessMessage("\n\n" + res.data)
let str =''
let str1 =''
res.data.forEach(item=>{
if(item.isSuccess === 0 || item.isSuccess === '0'){
str+= `ASN单号【${item.asnNumber}】提交成功,生成采购收货记录,${item.recordNumber}\n`
}else{
str1+= `ASN单号【${item.asnNumber}】提交失败,失败原因:${item.message}\n`
}
})
if(str){
this.showCommitSuccessMessage(str+str1)
}else{
this.$refs.comMessage.showErrorMessage(str1);
}
} else {
// this.showErrorMessage("[" + res.msg + "]")
this.$refs.comMessage.showErrorMessage("提交失败[" + res.msg + "]");
}
}).catch(error => {
uni.hideLoading()
this.$refs.comMessage.showErrorMessage(error);
})
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
uni.navigateBack({
delta:1
})
})
},
scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.packGetFocus();
}
},
},
onBackPress(options) {
if (options.from === 'navigateBack') {
return false;
}
if (this.jobList.length > 0) {
this.$refs.comMessage.showQuestionMessage("是否要放弃当前的扫描信息?",
async res => {
if (res) {
let masterIds = Array.from(new Set(this.jobList.map(item => item.masterId)))
let index = 0
//
await this.handleCancleTakePurchaseReceiptJob(index, masterIds)
}
});
return true
}
},
}
</script>
<style scoped lang="scss">
.page-footer {
display: flex;
justify-content: flex-end;
background: white;
padding: 10rpx 20rpx;
position: fixed;
width: 100%;
bottom: 0px;
}
.btn_single_commit,
.btn_single_clear {
margin: 0px;
}
.btn_single_clear {
margin-right: 20rpx;
}
</style>

489
src/pages/purchaseReceipt/job/purchaseReceiptAsnDetail.vue

@ -0,0 +1,489 @@
<template>
<view class="page-wraper">
<view class="page-header">
<view class="header-view">
<view class="header_job_top">
<jobTopAsn :dataContent="jobContent"></jobTopAsn>
</view>
</view>
</view>
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view>
<!-- 管理精度是批次 -->
<comReceiptDetailCardBacth ref='comReceiptDetailCardBacthRef' :dataContent="item" :index="index"
:settingParam="jobContent" @remove="updateData" @updateData="updateData"
:locationAreaTypeList='toLocationAreaTypeList' :isNumPackTips='true' :isShowSupplierQty='true'
:isShowBatch="false" :isShowBatchDeliNo='true' packTitle='看板编号'>
</comReceiptDetailCardBacth>
</view>
</view>
</scroll-view>
</view>
<view class="page-footer">
<view style="background-color:ghostwhite; width: 100%; height: 100%;">
<view class="uni-flex u-col-center space-between padding_10" style="height: 100%;">
<view>
<locationCompare ref="locationCompare" title="收货库位" :recommendLocationCode="jobToLocationCode"
@getLocation='scanLocationCode' :locationAreaTypeList="toLocationAreaTypeList">
</locationCompare>
</view>
<view>
<!-- <button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> -->
</view>
</view>
</view>
</view>
<win-scan-pack ref="scanPopup" @getResult='getScanResult' :locationCode='jobToLocationCode'></win-scan-pack>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
purchaseReceiptJobSubmit,
getPurchaseReceiptJobDetail,
takePurchaseReceiptJob,
cancleTakePurchaseReceiptJob,
getPutawayJobList,
getPurchaseReceiptJobDetailListByNmber
} from '@/api/request2.js';
import {
goHome,
getCurrDateTime,
getPackingNumberAndBatch,
compareDesc,
navigateBack,
getSwitchInfoByCode
} from '@/common/basic.js';
import {
getDirectoryItemArray,
} from '@/common/directory.js';
import {
getManagementPrecisions
} from '@/common/balance.js';
import {
getTreeDataSource,
createRecordInfo,
calcHandleQty,
getScanCount,
calcTreeHandleQty
} from '@/common/detail.js';
import {
Decimal
} from 'decimal.js'; //
import {
calc
} from '@/common/calc'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import locationCompare from '@/mycomponents/location/locationCompare.vue'
import comReceiptDetailCardBacth from '@/pages/purchaseReceipt/coms/comReceiptDetailCardBacth.vue'
import jobTopAsn from '@/mycomponents/job/jobTopAsn.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import {
productDismantleJobClose
} from '@/api/request2.js';
import {
nextTick
} from 'vue';
export default {
name: 'purchase_receipt_asn_detail',
components: {
winScanButton,
locationCompare,
jobTopAsn,
comReceiptDetailCardBacth,
winScanPack
},
data() {
return {
jobContent: '',
detailSource: [],
jobToLocationCode: '',
toLocationCode: '',
scanPackList: [], //
packNumberList: [], //
};
},
onLoad(option) {
console.log(option)
this.jobContent = JSON.parse(decodeURIComponent(option.data));
this.jobContent.packList = this.jobContent.packageDOS
this.detailSource = [this.jobContent]
this.toLocationCode = this.jobContent.toLocationCode
this.jobToLocationCode = this.jobContent.toLocationCode
this.detailSource = getTreeDataSource(this.detailSource)
this.detailSource.forEach(item => {
item.subList.forEach(cur => {
cur.packList = cur.packageDOS
cur.packList.forEach(i => {
i.packingNumber = i.remark
if (i.scaned == true) {
this.scanPackList.push(i)
}
})
this.packNumberList = [...cur.packList]
})
})
this.$nextTick(() => {
this.$refs.comReceiptDetailCardBacthRef.forEach(item => {
item.resizeCollapse()
item.$refs.packageListRef.resizeCollapse()
})
})
},
methods: {
openScanPopup() {
//
this.$refs.scanPopup.openScanPopup(this.jobToLocationCode, true);
},
getScanResult(result) {
console.log(result)
this.balanceInfo = result.balance
this.managementType = result.managementType
if (this.managementType == 'BY_BATCH' || this.managementType == 'BY_QUANTITY') {
this.getScanResultAfterBatch(result)
} else {
this.getScanResultAfter(result)
}
},
//
getScanResultAfter(result) {
try {
var itemCode = result.label.itemCode;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {
this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
return;
}
detail.scaned = true;
if (result.label.labelType == "ContainerLabel") {
var containerNumber = result.label.container;
var itemDetail = detail.subList.filter(r => r.containerNumber == containerNumber);
if (itemDetail.length == 0) {
this.showErrorMessage("物料【" + itemCode + "】、托码【" + containerNumber + "】不在列表中")
} else {
if (itemDetail[0].scaned) {
this.showErrorMessage("物料【" + itemCode + "】、托码【" + containerNumber + "】已经扫描")
} else {
itemDetail.forEach(item => {
item.scaned = true;
itemDetail.scanDate = new Date();
item.handleQty = item.qty;
item.toLocationCode = this.toLocationCode;
})
calcHandleQty(this.detailSource);
this.detailSource[0].subList.sort(compareDesc('scanDate')); //
this.continueScan()
this.$forceUpdate()
}
}
} else if (result.label.labelType == "PurchaseLabel") {
var packingNumber = result.package.number;
var parentpackingNumber = result.package.parentNumber;
var batch = result.label.batch;
var qty = result.label.qty;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {
this.showMessage("物料号【" + itemCode + "】不在列表中")
} else {
//
var itemDetail = detail.subList.find(r => r.packingNumber == packingNumber && r.batch ==
batch);
if (itemDetail == undefined) {
itemDetail = detail.subList.find(r => r.packingNumber == parentpackingNumber && r.batch ==
batch);
if (itemDetail == undefined) {
this.showMessage("箱码【" + packingNumber + "】、批次【" + batch + "】不在列表中")
} else {
var pack = itemDetail.packList.find(p => p.packingNumber == packingNumber &&
p.batch == batch)
if (pack == undefined) {
this.showMessage("箱码【" + packingNumber + "】、批次【" + batch + "】不在列表中")
} else {
if (pack.scaned) {
pack.scanDate = new Date();
this.showMessage("箱码【" + packingNumber + "】已经扫描");
} else {
pack.scaned = true
pack.scanDate = new Date();
pack.handleQty = Number(result.label.qty);
pack.toLocationCode = this.toLocationCode;
pack.labelQty = Number(result.label.qty);
}
}
calcHandleQty(this.detailSource);
itemDetail.packList.sort(compareDesc('scanDate')); //
this.$forceUpdate()
}
} else {
//,
var scanedLength = 0;
itemDetail.packList.forEach(res => {
if (res.scaned) {
scanedLength++;
}
})
if (itemDetail.scaned && scanedLength == itemDetail
.packList.length) {
itemDetail.scanDate = new Date();
this.showMessage("箱码【" + packingNumber + "】已经扫描")
} else {
itemDetail.scaned = true;
itemDetail.scanDate = new Date();
itemDetail.handleQty = Number(result.label.qty);
itemDetail.toLocationCode = this.toLocationCode;
itemDetail.labelQty = Number(result.label.qty);
itemDetail.packList.forEach(pac => {
pac.scaned = true
pac.scanDate = new Date();
pac.handleQty = Number(pac.qty);
pac.toLocationCode = this.toLocationCode;
})
calcTreeHandleQty(this.detailSource);
this.detailSource[0].subList.sort(compareDesc('scanDate')); //
this.continueScan()
this.$forceUpdate()
}
}
}
}
} catch (e) {
this.showErrorMessage(e.message)
}
},
//
getScanResultAfterBatch(result) {
console.log(222, result)
try {
var itemCode = result.label.itemCode;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {
this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
return;
}
detail.scaned = true;
if (result.label.labelType == "ContainerLabel") {
var containerNumber = result.label.container;
var itemDetail = detail.subList.filter(r => r.containerNumber == containerNumber);
if (itemDetail.length == 0) {
this.showErrorMessage("物料【" + itemCode + "】、托码【" + containerNumber + "】不在列表中")
} else {
if (itemDetail[0].scaned) {
this.showErrorMessage("物料【" + itemCode + "】、托码【" + containerNumber + "】已经扫描")
} else {
itemDetail.forEach(item => {
item.scaned = true;
itemDetail.scanDate = new Date();
item.handleQty = calc.add(item.handleQty, result.label.qty)
item.toLocationCode = this.toLocationCode;
})
// calcHandleQty(this.detailSource);
this.detailSource[0].subList.sort(compareDesc('scanDate')); //
this.$forceUpdate()
}
}
this.continueScan()
} else if (result.label.labelType == "PurchaseLabel") {
// debugger
var packingNumber = result.package.number.substring(result.package.number.length - 5);
var parentpackingNumber = result.package.parentNumber;
var batch = result.label.batch;
var qty = result.label.qty;
console.log(this.detailSource)
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {
this.showMessage("物料号【" + itemCode + "】不在列表中")
} else {
//
const batchDetail = detail.subList.find(r => r.batch == batch);
if (!batchDetail) {
this.showMessage("批次【" + batch + "】不在列表中")
} else {
console.log(batchDetail)
const packingDetail = batchDetail.packList.find(r => r.packingNumber == packingNumber);
if (!packingDetail) {
this.showMessage("看板编号【" + packingNumber + "】不在列表中")
} else {
if (packingDetail.requestNumber) {
this.showMessage(`看板编号【${packingNumber}】已经收货`)
return
}
if (packingDetail.scaned) {
this.showMessage("看板编号【" + packingNumber + "】已经扫描");
} else {
packingDetail.scaned = true
packingDetail.packingNumber = packingNumber
packingDetail.packQty = Number(result.package.packQty);
packingDetail.packUnit = result.package.packUnit
packingDetail.toLocationCode = this.toLocationCode;
packingDetail.labelQty = Number(result.label.qty);
packingDetail.handleQty = Number(qty);
packingDetail.convertRate = result.label.convertRate
packingDetail.supplierQty = parseFloat(calc.div(parseFloat(packingDetail.handleQty), parseFloat(
packingDetail.convertRate)).toFixed(5))
packingDetail.supplierUom = result.label.purchaseUom
this.scanPackList.push(packingDetail)
calcTreeHandleQty(this.detailSource);
}
}
setTimeout(() => {
this.$refs.comReceiptDetailCardBacthRef.forEach(item => {
item.resizeCollapse()
item.$refs.packageListRef.$refs.collapse2.forEach(cur => {
cur.resize()
})
})
}, 500)
}
}
this.continueScan()
}
} catch (e) {
this.showErrorMessage(e.message)
}
},
//
continueScan() {
if (this.scanPackList.length == this.packNumberList.length) {
this.closeScanPopup();
} else {
this.scanPopupGetFocus();
}
},
showMessage(message) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.losefocus();
}
setTimeout(r => {
this.$refs.comMessage.showMessage(message, res => {
if (res) {
this.scanPopupGetFocus()
}
});
})
},
showErrorMessage(message) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.losefocus();
}
setTimeout(r => {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.scanPopupGetFocus()
}
});
})
},
scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.getfocus();
}
},
closeScanPopup() {
this.$refs.scanPopup.closeScanPopup();
},
updateData(type,item,index,ele) {
if(type == 'parent'){
}else if(type == 'child'){
setTimeout(()=>{
this.$refs.comReceiptDetailCardBacthRef.forEach(item=>{
item.resizeCollapse()
item.$refs.packageListRef.$refs.collapse2.forEach(cur=>{
cur.resize()
})
})
},500)
calcTreeHandleQty(this.detailSource);
}
},
scanLocationCode(location, code) {
if (this.jobContent.allowModifyLocation == 'TRUE') {
this.toLocationCode = code;
this.jobToLocationCode= code
this.toWarehouseCode= location.warehouseCode
} else {
if (code == this.jobToLocationCode) {
this.toLocationCode = code;
} else {
this.showErrorMessage("任务设置中不允许修改库位,扫描的库位【" + code + "】与推荐的库位【" + this.jobToLocationCode + "】不一致")
}
}
this.toLocationCode = code
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = code
})
})
},
},
onUnload(){
let data = {}
this.detailSource.forEach(item=>{
// data = {...item}
item.subList.forEach(cur=>{
data = {...item,...cur}
})
})
console.log(this.detailSource)
uni.$emit('updateData',data)
}
}
</script>
<style scoped lang="scss">
page {
width: 100%;
height: 100%;
background-color: #fff;
}
.page-wraper {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
}
.page-main {
flex: 1;
position: relative;
}
.page-main-scroll {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
.page-main-list {
/* height: 80rpx;
line-height: 80rpx; */
text-align: center;
background: #e0e0e0;
}
</style>
Loading…
Cancel
Save