Browse Source

Merge branch 'hella_online_20240803' into master_hella

hella_online_20240829
陈薪名 3 months ago
parent
commit
77f4d90376
  1. 42
      src/api/request2.js
  2. 15
      src/common/record.js
  3. 7
      src/mycomponents/balance/balance.vue
  4. 2
      src/mycomponents/job/jobFilter.vue
  5. 130
      src/mycomponents/query/balanceQuery.vue
  6. 18
      src/mycomponents/record/recordComDetailCard.vue
  7. 5
      src/mycomponents/scan/winComScanFg.vue
  8. 48
      src/mycomponents/scan/winScanPackage.vue
  9. 274
      src/mycomponents/scan/winScanParentPackage.vue
  10. 55
      src/pages.json
  11. 13
      src/pages/fg/receiptByPlan.vue
  12. 51
      src/pages/inventoryMove/coms/comMoveJob.vue
  13. 2
      src/pages/inventoryMove/job/okToHoldMoveJob.vue
  14. 25
      src/pages/issue/coms/comScanIssuePack.vue
  15. 732
      src/pages/issue/coms/comScanIssuePack0816.vue
  16. 19
      src/pages/issue/job/issueDetail.vue
  17. 608
      src/pages/issue/job/issueDetail0816.vue
  18. 95
      src/pages/issue/job/issueJob.vue
  19. 746
      src/pages/issue/job/issueJob0816.vue
  20. 70
      src/pages/issue/record/directIssue.vue
  21. 248
      src/pages/issue/record/directIssue0816.vue
  22. 3
      src/pages/login/index.vue
  23. 21
      src/pages/productPutaway/record/productPutawayRecord.vue
  24. 7
      src/pages/productReceipt/job/fgProductReceiptDetail.vue
  25. 11
      src/pages/productReceipt/job/productReceiptDetail.vue
  26. 2
      src/pages/productionReceipt/job/productionReceiptDetail.vue
  27. 11
      src/pages/productionReceipt/job/productionReceiptJob.vue
  28. 87
      src/pages/putaway/record/putawayRecord.vue
  29. 21
      src/pages/repleinsh/coms/comScanReplishPack.vue
  30. 59
      src/pages/repleinsh/job/repleinshDetail.vue
  31. 64
      src/pages/repleinsh/job/repleinshJob.vue
  32. 63
      src/pages/repleinsh/record/directRepleinshRecord.vue

42
src/api/request2.js

@ -4114,6 +4114,21 @@ export function getBalanceByFilter(param) {
}); });
} }
/**
* 查询库存事务
* @param {*}
*
*/
export function getTransactionByFilter(param) {
return request({
url: baseApi + "/wms/transaction/senior",
method: "post",
data: param,
});
}
/** /**
* 查询管理精度多个物料多个库位 * 查询管理精度多个物料多个库位
* @param {*} * @param {*}
@ -4493,3 +4508,30 @@ export function fgChangeCommit(params) {
data: params, data: params,
}); });
} }
/**
* 查询物料与库位关系
*/
export function checkItemCodeAndLocation(params) {
return request({
url: baseApi + "/wms/location/checkRecommendLocation",
method: "post",
data: params,
});
}
/**
* 库存余额根据业务类型汇总接口
*/
export function getBalanceByBusinessType(params) {
return request({
url: baseApi + "/wms/balance/summaryByBusinessType",
method: "get",
data: params,
});
}

15
src/common/record.js

@ -49,6 +49,21 @@ export function createDetailInfo(balance, pack) {
return detail; return detail;
} }
export function createDetailByPackInfo(pack) {
// data.toInventoryStatus = this.toInventoryStatus == "" ? data.inventoryStatus : this.toInventoryStatus;
// data.inventoryStatus = data.inventoryStatus;
let detail = deepCopyData(pack); detail.scaned = true;
detail.balanceQty = new Decimal(detail.qty).toNumber()
detail.qty = new Decimal(detail.qty).toNumber();
detail.packQty = pack.packQty ? new Decimal(pack.packQty).toNumber() : 0
detail.packUnit = pack.packUnit
detail.handleQty = new Decimal(detail.qty).toNumber();
detail.package = pack;
return detail;
}
//计算实际数量 //计算实际数量
export function calcHandleQty(detailSource) { export function calcHandleQty(detailSource) {
for (let item of detailSource) { for (let item of detailSource) {

7
src/mycomponents/balance/balance.vue

@ -2,7 +2,8 @@
<view :class="dataContent.scaned?'scan_view':''" style="background-color: #ffffff;margin-bottom: 1px; "> <view :class="dataContent.scaned?'scan_view':''" style="background-color: #ffffff;margin-bottom: 1px; ">
<view class="uni-flex uni-row space-between" style="align-items: center"> <view class="uni-flex uni-row space-between" style="align-items: center">
<view> <view>
<pack v-if="dataContent.parentNumber" title="父包装" :packingCode="dataContent.parentNumber"></pack> <pack v-if="isShowParentPack &&dataContent.parentNumber" title="父包装"
:packingCode="dataContent.parentNumber"></pack>
<pack v-if="isShowPack && dataContent.packingNumber" :packingCode="dataContent.packingNumber"></pack> <pack v-if="isShowPack && dataContent.packingNumber" :packingCode="dataContent.packingNumber"></pack>
<batch v-if="isShowBatch && dataContent.batch" :batch="dataContent.batch"></batch> <batch v-if="isShowBatch && dataContent.batch" :batch="dataContent.batch"></batch>
<location title="来源库位" v-if="isShowFromLocation" :locationCode="dataContent.locationCode"></location> <location title="来源库位" v-if="isShowFromLocation" :locationCode="dataContent.locationCode"></location>
@ -91,6 +92,10 @@
type: Boolean, type: Boolean,
default: false default: false
}, },
isShowParentPack: {
type: Boolean,
default: true
},
}, },
watch: { watch: {

2
src/mycomponents/job/jobFilter.vue

@ -198,6 +198,8 @@
return params; return params;
}, },
reset(){ reset(){
this.checkedTodayModel = false
this.checkedWaitModel = false
this.productionLineCode = '' this.productionLineCode = ''
this.fromLocationCode = '' this.fromLocationCode = ''
this.fromAreaCode = ''// this.fromAreaCode = ''//

130
src/mycomponents/query/balanceQuery.vue

@ -39,28 +39,28 @@
</view> </view>
<view class="split_line"></view> <view class="split_line"></view>
</view> </view>
<scroll-view scroll-x="true" v-if="tableData.length>0" style="width: 330px; display: flex; align-items: center; justify-content: center; "> <scroll-view scroll-x="true" v-if="tableData.length>0"
<view style="width: 330px; display: flex;justify-content: center; background-color: #fff; padding-bottom: 150rpx;"> style="width: 330px; display: flex; align-items: center; justify-content: center; ">
<view
style="width: 330px; display: flex;justify-content: center; background-color: #fff; padding-bottom: 150rpx;">
<uni-table border stripe emptyText="暂无更多数据"> <uni-table border stripe emptyText="暂无更多数据">
<!-- 表头行 --> <!-- 表头行 -->
<uni-tr> <uni-tr>
<uni-th width="60" style="font-weight: 800;" align="left">序号</uni-th>
<uni-th width="60" align="left">批次</uni-th> <uni-th width="60" align="left">批次</uni-th>
<uni-th width="50" align="left">库位</uni-th> <uni-th width="100" align="left">库位</uni-th>
<uni-th width="60" align="left">状态</uni-th> <uni-th width="60" align="left">状态</uni-th>
<uni-th width="120" align="left">数量</uni-th> <uni-th width="120" align="left">数量</uni-th>
</uni-tr> </uni-tr>
<!-- 表格数据行 --> <!-- 表格数据行 -->
<uni-tr v-for="(item, index) in tableData" :key="index"> <uni-tr v-for="(item, index) in tableData" :key="index">
<uni-td>{{index+1}}</uni-td>
<uni-td>{{item.batch}}</uni-td> <uni-td>{{item.batch}}</uni-td>
<uni-td>{{item.locationCode}}</uni-td> <uni-td>{{item.locationCode}}</uni-td>
<uni-td>{{statusDesc(item.inventoryStatus)}}</uni-td> <uni-td>{{statusDesc(item.inventoryStatus)}}</uni-td>
<uni-td>{{item.qty}}</uni-td> <uni-td>{{item.totalQty}}</uni-td>
</uni-tr> </uni-tr>
</uni-table> </uni-table>
<view class="uni-flex" style=" flex-direction: column; position: fixed; bottom: 0; margin-bottom: 100rpx; background-color: #fff; width: 100%; align-items: center;" > <!-- <view class="uni-flex" style=" flex-direction: column; position: fixed; bottom: 0; margin-bottom: 100rpx; background-color: #fff; width: 100%; align-items: center;" >
<view class="" style="width: 100%; display: flex; justify-content: center; font-size: 32rpx;margin-top: 10rpx;margin-bottom: 10rpx;"> <view class="" style="width: 100%; display: flex; justify-content: center; font-size: 32rpx;margin-top: 10rpx;margin-bottom: 10rpx;">
<view class="" >当前页{{ current }}总数{{ total }}每页{{ pageSize }} <view class="" >当前页{{ current }}总数{{ total }}每页{{ pageSize }}
</view> </view>
@ -68,7 +68,7 @@
</view> </view>
<uni-pagination :current="current" :total="total" :show-icon="true" <uni-pagination :current="current" :total="total" :show-icon="true"
@change="change" /> @change="change" />
</view> </view> -->
</view> </view>
@ -76,16 +76,18 @@
</scroll-view> </scroll-view>
<button @click="closeDrawer" type="primary" style="padding-left: 20rpx;">关闭</button> <button @click="closeDrawer" type="primary" style="padding-left: 20rpx; width: 100%;">关闭</button>
</view> </view>
</uni-drawer> </uni-drawer>
<comMessage ref="comMessage"></comMessage>
</view> </view>
</template> </template>
<script> <script>
import { import {
getBasicItemByCodeSenior, getBasicItemByCodeSenior,
getBalanceByBusinessType
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
@ -102,80 +104,7 @@
itemCodeResult: [], itemCodeResult: [],
current: 1, current: 1,
total: 18, total: 18,
tableData: [{ tableData: []
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 1
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 2
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 3
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 4
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 3
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 4
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 3
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 4
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 3
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 4
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 3
},
{
batch: "20240814",
locationCode: "901",
inventoryStatus: "OK",
qty: 4
}
]
} }
}, },
props: { props: {
@ -183,10 +112,10 @@
// type: Object, // type: Object,
// default: {} // default: {}
// }, // },
// isShowPack: { businessTypeCode: {
// type: Boolean, type: String,
// default: true default: ""
// } }
}, },
watch: { watch: {
@ -211,30 +140,35 @@
selectItemCode(item) { selectItemCode(item) {
this.itemCode = item.code this.itemCode = item.code
this.itemCodeResult = [] this.itemCodeResult = []
this.getBalanceByBusiness(this.itemCode, this.businessTypeCode)
}, },
clearItemCode() { clearItemCode() {
this.itemCode = "" this.itemCode = ""
this.itemCodeResult = [] this.itemCodeResult = []
this.tableData =[]
}, },
onConfirmItemCode() { onConfirmItemCode() {
if (!this.itemCode) { if (!this.itemCode) {
this.showErrorMessage("物料号为空,请先输入物料号") this.showErrorMessage("物料号为空,请先输入物料号")
return; return;
} }
this.tableData=[]
uni.showLoading({ uni.showLoading({
title: "加载中", title: "加载中",
mask: true mask: true
}) })
getBasicItemByCodeSenior(this.itemCode).then(res => { getBasicItemByCodeSenior(this.itemCode).then(res => {
uni.hideLoading()
if (res.data && res.data.list.length > 0) { if (res.data && res.data.list.length > 0) {
if (res.data.list.length == 1) { if (res.data.list.length == 1) {
this.itemCode = res.data.list[0].code this.itemCode = res.data.list[0].code
this.getBalanceByBusiness(this.itemCode, this.businessTypeCode)
} else { } else {
uni.hideLoading()
this.itemCodeResult = res.data.list this.itemCodeResult = res.data.list
} }
} else { } else {
uni.hideLoading()
this.showErrorMessage("未查找到物料[" + this.itemCode + "]") this.showErrorMessage("未查找到物料[" + this.itemCode + "]")
} }
@ -243,6 +177,26 @@
this.showErrorMessage(error) this.showErrorMessage(error)
}) })
}, },
getBalanceByBusiness(itemCode, businessType) {
var params = {
itemCode: itemCode,
businessType: businessType,
inOrOut:"out"
}
getBalanceByBusinessType(params).then(res => {
uni.hideLoading()
if (res.data && res.data.length > 0) {
this.tableData = res.data
} else {
this.showErrorMessage("系统异常:按"+res.msg+"未查找到库存")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
showDrawer() { showDrawer() {
this.$refs.showRight.open(); this.$refs.showRight.open();
}, },

18
src/mycomponents/record/recordComDetailCard.vue

@ -9,7 +9,8 @@
:isShowBalanceQty="isShowBalanceQty"></item-qty> :isShowBalanceQty="isShowBalanceQty"></item-qty>
<view style="margin-left: 10px; margin-top: 5px;"> <view style="margin-left: 10px; margin-top: 5px;">
<pack title='父包装' :packingCode='dataContent.containerNumber'></pack> <pack title='父包装' :packingCode='dataContent.containerNumber'></pack>
<location v-if="isShowParentToLocation" title='目标库位' :locationCode='dataContent.toLocationCode'></location> <location v-if="isShowParentToLocation" title='目标库位'
:locationCode='dataContent.toLocationCode'></location>
</view> </view>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
@ -21,7 +22,7 @@
:right-options="detail.scaned?scanOptions:detailOptions"> :right-options="detail.scaned?scanOptions:detailOptions">
<balance :dataContent="detail" :isShowStdPack="false" :isShowStatus="isShowStatus" <balance :dataContent="detail" :isShowStdPack="false" :isShowStatus="isShowStatus"
:isShowPack="true" :isShowFromLocation="isShowFromLocation" :isShowPack="true" :isShowFromLocation="isShowFromLocation"
:isShowToLocation="isShowToLocation"> :isShowToLocation="isShowToLocation" :isShowParentPack="isShowParentPack">
</balance> </balance>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
@ -100,6 +101,17 @@
type: Boolean, type: Boolean,
default: false default: false
}, },
isShowParentPack: {
type: Boolean,
default: true
},
isShowModifedLocation: {
type: Boolean,
default: false
},
}, },
watch: { watch: {
@ -137,7 +149,7 @@
mounted() { mounted() {
this.detailOptions = getDetailOption(); this.detailOptions = getDetailOption();
this.scanOptions = getDetailEditRemoveOption(); this.scanOptions = getDetailEditRemoveOption();
this.removeOptions = getEditLocationRemoveOption(); this.removeOptions = this.isShowModifedLocation ?getEditLocationRemoveOption():getClearOption();
}, },
methods: { methods: {

5
src/mycomponents/scan/winComScanFg.vue

@ -188,6 +188,11 @@
// let productDate = content.substr(lengthMat, 8); // let productDate = content.substr(lengthMat, 8);
// let batch = content.substr(lengthMat + 8, 3); // let batch = content.substr(lengthMat + 8, 3);
let order = content.substr(-8); let order = content.substr(-8);
if(content.length!=lengthBc){
that.clear();
throw new Error("解析错误:扫描标签长度与配置条码的长度不一致")
}
if (scanPartNumber != partNumber) { if (scanPartNumber != partNumber) {
that.clear(); that.clear();
throw new Error("解析错误:扫描的客户物料号【" + scanPartNumber + throw new Error("解析错误:扫描的客户物料号【" + scanPartNumber +

48
src/mycomponents/scan/winScanPackage.vue

@ -33,6 +33,12 @@
getBalanceByFilter getBalanceByFilter
} from '@/api/request2.js'; } from '@/api/request2.js';
import {
getInventoryStatusDesc,
getDirectoryItemArray,
getLocationAreaTypeName
} from '@/common/directory.js';
export default { export default {
name: 'winScanPack', name: 'winScanPack',
components: { components: {
@ -55,7 +61,8 @@
data() { data() {
return { return {
show: false, show: false,
businessType: null businessType: null,
scanResult:{}
} }
}, },
created() { created() {
@ -104,6 +111,7 @@
getScanResult(result) { getScanResult(result) {
if (result.success) { if (result.success) {
this.scanResult=result
this.getBalance(result, res => { this.getBalance(result, res => {
result.balance = res; result.balance = res;
this.$emit("getResult", result); this.$emit("getResult", result);
@ -130,14 +138,14 @@
value: this.businessType.outInventoryStatuses value: this.businessType.outInventoryStatuses
}) })
} }
if (this.businessType.outAreaTypes != null) { if (this.businessType.outAreaTypes ) {
filters.push({ filters.push({
column: "areaType", column: "areaType",
action: "in", action: "in",
value: this.businessType.outAreaTypes value: this.businessType.outAreaTypes
}) })
} }
if (this.businessType.outAreaCodes != null) { if (this.businessType.outAreaCodes ) {
filters.push({ filters.push({
column: "areaCode", column: "areaCode",
action: "in", action: "in",
@ -147,6 +155,30 @@
return filters; return filters;
}, },
getQueryCondition() {
let condition = '按照以下条件:\n';
let label = this.scanResult.label;
let status = getInventoryStatusDesc(getDirectoryItemArray(this.businessType.outInventoryStatuses));
let areaType =getLocationAreaTypeName(this.businessType.outAreaTypes)
condition = condition + '物料号=[' + label.itemCode
+ ']\n箱码=[' + label.packingNumber +
']\n批次=[' +
label.batch +
']'
if (status) {
condition = condition + '\n库存状态=[' + status + ']'
}
if (areaType) {
condition = condition + '\n库区类型=[' + areaType + ']'
}
if (this.businessType.outAreaCodes) {
condition = condition + '\n库区代码=[' + this.businessType.outAreaCodes + ']'
}
return condition;
},
getBalance(result, callback) { getBalance(result, callback) {
let filters = []; let filters = [];
let label = result.label; let label = result.label;
@ -176,7 +208,7 @@
getBalanceByFilter(params).then(res => { getBalanceByFilter(params).then(res => {
if (res.data.list.length > 0) { if (res.data.list.length > 0) {
res.data.list.forEach(r => { res.data.list.forEach(r => {
if (packageInfo.parentNumber !== null) { if (packageInfo.parentNumber) {
r.parentPackingNumber = packageInfo.parentNumber r.parentPackingNumber = packageInfo.parentNumber
} else { } else {
r.parentPackingNumber = packageInfo.number r.parentPackingNumber = packageInfo.number
@ -201,9 +233,7 @@
params.filters = filters; params.filters = filters;
getBalanceByFilter(params).then(res1 => { getBalanceByFilter(params).then(res1 => {
if (res1.data.list.length == 0) { if (res1.data.list.length == 0) {
this.showErrorMessage('未查找到该包装的库存余额', res => { this.showErrorMessage(this.getQueryCondition()+'\n未查找到该包装的库存余额')
this.packGetFocus();
})
} else { } else {
res1.data.list.forEach(r => r.parentPackingNumber = packageInfo.number) res1.data.list.forEach(r => r.parentPackingNumber = packageInfo.number)
callback(res1.data.list) callback(res1.data.list)
@ -212,9 +242,7 @@
this.showErrorMessage(err.message); this.showErrorMessage(err.message);
}) })
} else { } else {
this.showErrorMessage('未查找到该包装的库存余额', res => { this.showErrorMessage(this.getQueryCondition()+'\n未查找到该包装的库存余额')
this.packGetFocus();
})
} }
} }
}).catch(err => { }).catch(err => {

274
src/mycomponents/scan/winScanParentPackage.vue

@ -0,0 +1,274 @@
<template>
<view>
<uni-popup ref="popup" @change="change" :mask-click="false">
<view class="popup_box">
<view class="pop_title uni-flex space-between">
<view class="" style="font-size: 35rpx;">
扫描{{title}}
</view>
<view class="">
<image class="fr icons_scan_close" src="/static/icons/icons_scan_close.svg"
@click="closeScanPopup()"></image>
</view>
</view>
<view class="">
<view class="">
<win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult"
:headerType="headerType" :isShowHistory="isShowHistory" :clearResult="true"></win-com-scan>
</view>
</view>
</view>
</uni-popup>
<!-- 模拟扫描功能 -->
<win-com-scan v-show="false" ref="comscansimulate" @getResult="getScanResult" :headerType="headerType"
:isShowHistory="false" :clearResult="true"></win-com-scan>
<comMessage ref="comMessage" @afterClose="getfocus"></comMessage>
</view>
</template>
<script>
import winComScan from '@/mycomponents/scan/winComScan.vue'
import {
getBalanceByFilter
} from '@/api/request2.js';
export default {
name: 'winScanParentPackage',
components: {
winComScan,
},
props: {
title: {
type: String,
default: '箱标签'
},
isShowHistory: {
type: Boolean,
default: true
},
headerType: {
type: String,
default: 'HPQ,HMQ'
}
},
data() {
return {
show: false,
businessType: null
}
},
created() {
},
methods: {
simulateScan(item) {
this.$refs.comscansimulate.setItemCodeSimulate(item.copyContent)
this.$refs.comscansimulate.clickScanMsg();
},
openScanPopup() {
this.$refs.popup.open('bottom')
setTimeout(res => {
this.getfocus()
}, 500)
},
openScanPopupByBusinessType(businessType) {
this.$refs.popup.open('bottom')
setTimeout(res => {
this.getfocus()
this.businessType = businessType;
}, 500)
},
closeScanPopup() {
this.losefocus()
this.$refs.popup.close();
this.$emit("close", '');
},
scanClick() {
if (this.$refs.comscan) {
this.$refs.comscan.clickScanMsg();
}
},
cancelClick() {
if (this.$refs.comscan) {
this.$refs.comscan.clearScanValue();
}
},
getScanResult(result) {
if (result.success) {
this.getBalance(result, res => {
result.balance = res;
this.$emit("getResult", result);
})
} else {
this.showMessage(result.message)
}
},
getParams(label) {
let filters = [{
column: "itemCode",
action: "==",
value: label.itemCode
}, {
column: "batch",
action: "==",
value: label.batch
}];
if (this.businessType.outInventoryStatuses != null) {
filters.push({
column: "inventoryStatus",
action: "in",
value: this.businessType.outInventoryStatuses
})
}
if (this.businessType.outAreaTypes != null) {
filters.push({
column: "areaType",
action: "in",
value: this.businessType.outAreaTypes
})
}
if (this.businessType.outAreaCodes != null) {
filters.push({
column: "areaCode",
action: "in",
value: this.businessType.outAreaCodes
})
}
return filters;
},
getBalance(result, callback) {
let filters = [];
let packageInfo = result.package;
let comfilters = this.getParams(packageInfo);
let balance = {
parentBalance: {},
childBalance: []
};
let parentPackingNumber = packageInfo.parentNumber;
let childPackingNumber = packageInfo.number;
//packageInfo.subList0
//1.
if (parentPackingNumber) {
let packingNumber = parentPackingNumber + "," + childPackingNumber;
filters.push({
column: "packingNumber",
action: "in",
value: packingNumber
})
} else {
filters.push({
column: "packingNumber",
action: "==",
value: childPackingNumber
})
}
filters = filters.concat(comfilters);
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getBalanceByFilter(params).then(res => {
res.data.list.forEach(r => {
if (packageInfo.parentNumber) {
r.parentPackingNumber = parentPackingNumber
} else {
r.parentPackingNumber = childPackingNumber
}
})
//
if (packageInfo.subList.length > 0) {
let packparams = '';
packageInfo.subList.forEach(pack => {
packparams = packparams + pack.number + ','
})
packparams = packparams.trimEnd(',');
filters = [];
filters.push({
column: "packingNumber",
action: "in",
value: packparams
})
filters = filters.concat(comfilters);
params.filters = filters;
getBalanceByFilter(params).then(res1 => {
if (res1.data.list.length == 0) {
this.showErrorMessage('未查找到该包装的库存余额', res => {
this.packGetFocus();
})
} else {
res1.data.list.forEach(r => r.parentPackingNumber = childPackingNumber)
balance.parentBalance = res.data.list.filter(r => r.packingNumber ==
childPackingNumber)
balance.childBalance = res1.data.list;
callback(balance);
}
}).catch(err => {
this.showErrorMessage(err.message);
})
} else {
//
//()
balance.childBalance = res.data.list.filter(r => r.packingNumber == childPackingNumber)
balance.parentBalance = res.data.list.filter(r => r.packingNumber == parentPackingNumber)
callback(balance);
}
}).catch(err => {
this.showErrorMessage(err.message);
})
},
getfocus() {
if (this.$refs.comscan) {
this.$refs.comscan.getfocus();
}
},
losefocus() {
if (this.$refs.comscan) {
this.$refs.comscan.losefocus();
}
},
showMessage(message) {
this.$refs.comMessage.showMessage(message);
},
change(e) {
this.show = e.show
},
showErrorMessage(message) {
this.losefocus()
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.getfocus();
}
});
},
}
}
</script>
<style lang="scss">
.scroll-view {
overflow-y: scroll;
height: auto;
max-height: 300rpx;
}
</style>

55
src/pages.json

@ -629,6 +629,41 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
{
"path": "pages/issue/job/issueJob0816",
"style": {
"navigationBarTitleText": "发料任务0816",
"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/issue/job/issueDetail0816",
"style": {
"navigationBarTitleText": "发料任务详情0816",
"enablePullDownRefresh": false
}
},
{ {
"path": "pages/issue/record/issueRecord", "path": "pages/issue/record/issueRecord",
"style": { "style": {
@ -784,7 +819,25 @@
"navigationBarTitleText": "直接补料", "navigationBarTitleText": "直接补料",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"titleNView": { "titleNView": {
"autoBackButton": "true" "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"
}
]
} }
} }
}, },

13
src/pages/fg/receiptByPlan.vue

@ -273,7 +273,9 @@ import { nextTick } from 'vue';
console.log(JSON.stringify(params)) console.log(JSON.stringify(params))
let list = [] let list = []
try{
var planData = await planReceiptSubmit(params) var planData = await planReceiptSubmit(params)
console.log('planData',planData)
if (planData.data) { if (planData.data) {
planData.data.forEach(item => { planData.data.forEach(item => {
@ -298,6 +300,17 @@ import { nextTick } from 'vue';
} else { } else {
throw new Error("提交失败") throw new Error("提交失败")
} }
}catch(error){
console.log('异常',error)
if(error.indexOf('请返回开工阶段')>-1){
uni.hideLoading()
this.showErrorMessage('计划已完成')
this.clearData()
this.openFg();
return
}
}
// //
let createProductputawaySwitch = getSwitchInfoByCode( let createProductputawaySwitch = getSwitchInfoByCode(

51
src/pages/inventoryMove/coms/comMoveJob.vue

@ -1,9 +1,9 @@
<template> <template>
<view class=""> <view class="">
<com-empty-view v-if="jobList.length==0"></com-empty-view> <com-empty-view v-if="jobList.length==0"></com-empty-view>
<job-filter ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday" <job-filter ref="filter" :isShowItemCode="isShowItemCode" :isShowQurery="isShowQurery" otherTitle="ASN" @switchChangeToday="switchChangeToday"
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday" @switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask"> :checkedWaitTask="checkedWaitTask" @onQuery="getListByFilter">
</job-filter> </job-filter>
<view v-if="jobList.length>0"> <view v-if="jobList.length>0">
@ -67,7 +67,15 @@
title: { title: {
type: String, type: String,
default: "" default: ""
} },
isShowItemCode: {
type: Boolean,
default: false
},
isShowQurery: {
type: Boolean,
default: false
},
}, },
data() { data() {
return { return {
@ -82,7 +90,8 @@
status: '1,2', // status: '1,2', //
detailOptions: [], detailOptions: [],
detailGiveupOptions: [], detailGiveupOptions: [],
titleName:"" titleName:"",
filterItemCode:''
}; };
}, },
@ -172,6 +181,15 @@
value: this.status value: this.status
}) })
if(this.filterItemCode){
//
filters.push({
column: "itemCode",
action: "like",
value: this.filterItemCode
})
}
filters.push({ filters.push({
column: "accept_user_id", column: "accept_user_id",
action: "==", action: "==",
@ -194,14 +212,14 @@
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
} }
var list = res.data.list; let list = res.data.list;
this.totalCount = res.data.total this.totalCount = res.data.total
this.loadingType = "loadmore"; this.loadingType = "loadmore";
this.jobList = type === "refresh" ? list : this.jobList.concat(list);
if (list == null || list.length == 0) { if (list == null || list.length == 0) {
this.loadingType = "nomore"; this.loadingType = "nomore";
return; return;
} }
this.jobList = type === "refresh" ? list : this.jobList.concat(list);
this.pageNo++; this.pageNo++;
this.updateTitle(); this.updateTitle();
}).catch(error => { }).catch(error => {
@ -260,6 +278,27 @@
this.showMessage(error) this.showMessage(error)
}) })
}, },
getListByFilter(params) {
console.log('getListByFilter',params)
if (params.itemCode) {
//
this.filterItemCode = params.itemCode
}else{
this.filterItemCode = ''
}
if (params.status) {
this.status = params.status
}else{
this.status = "1,2"
}
if(params.creationTime==""){
this.checkedToday = false;
}
this.todayTime = params.creationTime
this.getList('refresh')
},
switchChangeToday(state, creationTime) { switchChangeToday(state, creationTime) {
this.checkedToday = state; this.checkedToday = state;

2
src/pages/inventoryMove/job/okToHoldMoveJob.vue

@ -1,6 +1,6 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<comMoveJob :title="title" ref="comMoveJob" businessTypeCode='OkToHold' > </comMoveJob> <comMoveJob :isShowItemCode="true" :isShowQurery="true" :title="title" ref="comMoveJob" businessTypeCode='OkToHold' > </comMoveJob>
</view> </view>
</template> </template>

25
src/pages/issue/coms/comScanIssuePack.vue

@ -10,6 +10,7 @@
</view> </view>
<view class=""> <view class="">
<image class="fr icons_scan_close" src="/static/icons/icons_scan_close.svg" <image class="fr icons_scan_close" src="/static/icons/icons_scan_close.svg"
@click="closeScanPopup()"></image> @click="closeScanPopup()"></image>
</view> </view>
@ -500,7 +501,7 @@
let item = that.toLocation.Items.find(r => r.itemCode == itemCode); let item = that.toLocation.Items.find(r => r.itemCode == itemCode);
that.fromLocationCode = balance.locationCode; that.fromLocationCode = balance.locationCode;
let fromLocation = item.Locations.find(l => l.fromLocationCode == that.fromLocationCode); let fromLocation = item.Locations.find(l => l.fromLocationCode == that.fromLocationCode);
if (fromLocation != undefined) { if (fromLocation &&!fromLocation.isNewAdd) {
let batch = fromLocation.Batchs.find(r => r.batch == lot); let batch = fromLocation.Batchs.find(r => r.batch == lot);
if (batch != undefined) { if (batch != undefined) {
if (batch.Records == undefined) { if (batch.Records == undefined) {
@ -530,7 +531,7 @@
} else { } else {
that.addRecord(batch, label, balance, packageInfo) that.addRecord(batch, label, balance, packageInfo)
} }
that.$emit("afterScan");
} else { } else {
that.showErrorMessage('箱码【' + packingCode + '】已经扫描,请继续扫描下一箱', that.showErrorMessage('箱码【' + packingCode + '】已经扫描,请继续扫描下一箱',
res => { res => {
@ -550,6 +551,7 @@
batch.detail = fromLocation.Batchs[0].detail; batch.detail = fromLocation.Batchs[0].detail;
} }
fromLocation.Batchs.unshift(batch); fromLocation.Batchs.unshift(batch);
this.getfocus();
that.$emit("afterScan"); that.$emit("afterScan");
} }
}) })
@ -561,8 +563,22 @@
} }
} }
} else { } else {
if (this.jobContent.allowModifyLocation == "TRUE") {
this.showQuestionMessage("扫描物料[" + itemCode + "]的库位【" + that.fromLocationCode +
"】与推荐的库位不一致,是否要继续发料?", res => {
if (res) {
let locaion = that.createLocationInfo(label, balance, packageInfo); let locaion = that.createLocationInfo(label, balance, packageInfo);
item.Locations.push(locaion); item.Locations.push(locaion);
this.getfocus();
that.$emit("afterScan");
}
})
} else {
this.showErrorMessage("扫描物料[" + itemCode + "]的库位【" + that.fromLocationCode +
"】与推荐的库位不一致,不允许继续发料?")
}
} }
} catch (e) { } catch (e) {
that.showErrorMessage(e.stack, that.showErrorMessage(e.stack,
@ -573,13 +589,14 @@
} }
}, },
// //
createLocationInfo(label, balance, packageInfo) { createLocationInfo(label, balance, packageInfo) {
let location = { let location = {
fromLocationCode: balance.locationCode, fromLocationCode: balance.locationCode,
qty: balance.qty, qty: balance.qty,
uom: balance.uom, uom: balance.uom,
handleQty: 0, handleQty: 0,
isNewAdd:true,
Batchs: [] Batchs: []
} }
let batch = this.createBatchInfo(label, balance, packageInfo); let batch = this.createBatchInfo(label, balance, packageInfo);
@ -644,6 +661,7 @@
this.issueRecord.unshift(record) this.issueRecord.unshift(record)
this.calcBatchHandleQty(batch); this.calcBatchHandleQty(batch);
this.getfocus(); this.getfocus();
this.$emit("afterScan");
}, },
getfocus() { getfocus() {
@ -691,7 +709,6 @@
this.issueRecord.splice(index, 1) this.issueRecord.splice(index, 1)
let item = this.toLocation.Items.find(r => r.itemCode == record.itemCode); let item = this.toLocation.Items.find(r => r.itemCode == record.itemCode);
if (item != undefined) { if (item != undefined) {
item.Locations.forEach(l => { item.Locations.forEach(l => {

732
src/pages/issue/coms/comScanIssuePack0816.vue

@ -0,0 +1,732 @@
<template>
<view>
<uni-popup ref="popup" :maskClick='false'>
<view class="">
<view class="popup_box">
<view class="pop_title uni-flex space-between">
<view class="" style="font-size: 35rpx;">
扫描箱码
</view>
<view class="">
<image class="fr icons_scan_close" src="/static/icons/icons_scan_close.svg"
@click="closeScanPopup()"></image>
</view>
</view>
<view class="">
<view class="">
<win-com-scan ref="comscan" placeholder="箱标签" @getResult="onScan" :clearResult="true"
headerType="HPQ,HMQ" :isShowHistory="false">
</win-com-scan>
<view style="width: 100%;">
<view style="width: 100%;" v-if="issueRecord.length>0">
<view class="uni-flex uni-row space-between u-col-center">
<view class="" style="padding: 10rpx;">
历史记录
</view>
<view class="" style="padding-right: 10rpx;">
<u-icon :name="expendIcon" size="35rpx" @click="expands()"></u-icon>
</view>
</view>
<u-line class='line_color' style='padding-top: 10rpx;padding-bottom: 20rpx;'>
</u-line>
<scroll-view scroll-y="true" class="scroll-view"
v-if="expand&&issueRecord.length>0">
<view class="uni-flex u-col" v-for="(record,index) in issueRecord">
<view style="width: 100%;">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,record,index)"
:right-options="scanOptions">
<view style="padding: 0px 10px">
<balance :dataContent="record" :isShowFromLocation="false"
:isShowStdPack="false"></balance>
</view>
</uni-swipe-action-item>
</uni-swipe-action>
<u-line class='line_color'></u-line>
</view>
</view>
</scroll-view>
</view>
</view>
</view>
</view>
</view>
</view>
</uni-popup>
<balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select>
<comMessage ref="comMessage"></comMessage>
<balance-qty-edit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="true"></balance-qty-edit>
<!-- 模拟扫描功能 -->
<!-- <win-com-scan v-show="false" ref="comscansimulate" placeholder="箱标签" @getResult="onScan" :clearResult="true"
headerType="HPQ,HMQ" :isShowHistory="false">
</win-com-scan> -->
</view>
</template>
<script>
import winComScan from '@/mycomponents/scan/winComScan.vue'
import balance from '@/mycomponents/balance/balance.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
import {
getDetailOption,
getDetailEditRemoveOption
} from '@/common/array.js';
import {
getWorkShopLineStation,
getBalanceByFilter,
getBalanceByParams,
} from '@/api/request2.js';
import {
uniqueArray
} from '@/common/basic.js';
import {
getLabelInfo
} from '@/common/label.js';
import {
calc
} from '@/common/calc.js';
import {
getBalanceByManagementPrecision
} from '@/common/balance.js';
import {
getDirectoryItemArray
} from '../../../common/directory.js';
export default {
name: 'winScanPack',
emits: ["afterScan", "closeScan"],
components: {
winComScan,
balance,
balanceQtyEdit,
balanceSelect
},
props: {
title: {
type: String,
default: ''
},
},
data() {
return {
dataContent: {},
jobContent: {},
expendIcon: 'arrow-down',
show: false,
scanList: [],
toLocation: null,
toLocationCode: '',
fromLocationList: [],
fromLocationCode: '',
fromLocation: null,
issueRecord: [], //
expand: true,
scanOptions: {},
editItem: {},
positionInfo: "请选择位置",
positionList: [],
defaultValueList: [],
fromInventoryStatuses: "",
packageInfo: {},
label: {},
inputStyleObject: {
fontSize: "100rpx"
},
bussinessCode: 'Issue',
toLocationAreaTypeList: []
}
},
created() {
},
watch: {},
mounted() {
this.detailOptions = getDetailOption();
this.scanOptions = getDetailEditRemoveOption();
},
methods: {
openScanPopupForJobSimulate(content, jobcontent, scanMessage) {
this.issueRecord = [];
this.dataContent = content;
this.jobContent = jobcontent;
this.initData();
getLabelInfo(scanMessage, "HPQ,HMQ", callback => {
if (callback.success) {
this.onScan(callback);
} else {
this.showErrorMessage(callback.message, res => {})
}
})
},
openScanPopup(content, jobcontent) {
this.issueRecord = [];
this.dataContent = content;
this.jobContent = jobcontent;
this.initData();
// this.positionInfo = this.jobContent.workShopCode + "-" + this.jobContent.subList[0].productionLineCode +
// "-" + this.jobContent.subList[0].workStationCode
this.$refs.popup.open('bottom')
setTimeout(res => {
this.getfocus();
}, 500)
},
closeScanPopup() {
this.losefocus()
this.$refs.popup.close();
this.$emit("closeScan")
//
// Object.assign(this.$data, this.$options.data());
},
initData() {
let that = this;
that.fromLocationList = [];
if (that.dataContent != null) {
that.fromInventoryStatuses = this.jobContent.outInventoryStatuses
that.toLocation = that.dataContent[0];
that.toLocationCode = that.dataContent[0].toLocationCode;
that.toLocationAreaTypeList = getDirectoryItemArray(this.jobContent.toAreaTypes)
// that.fromLocationList = that.getFromLocationList();
}
},
showBalanceSelect(items) {
this.$refs.balanceSelect.openPopup(items);
},
// getFromLocationList() {
// let list = [];
// this.dataContent.forEach(location => {
// location.Items.forEach(item => {
// item.Locations.forEach(f => {
// let item = list.find(l => l == f.fromLocationCode);
// if (item == undefined) {
// list.push(f.fromLocationCode)
// }
// })
// })
// });
// //
// list = uniqueArray(list);
// this.fromLocationCode = list[0];
// return list;
// },
fromLocationUpdate(fromlocation) {
let location = this.fromLocationList.find(r => r == fromlocation)
if (location == undefined) {
this.fromLocationCode = ''
this.showErrorMessage('发料库位【' + fromlocation + '】不存在')
}
},
queryBalance(result) {
try {
let that = this;
let packageInfo = result.package;
let itemCode = result.label.itemCode;
let packingCode = result.label.packingNumber;
let lot = result.label.batch;
let item = that.toLocation.Items.find(r => r.itemCode == itemCode);
if (item == undefined) {
that.showErrorMessage('未查找到物料【' + itemCode + '】的发料明细',
res => {
that.getfocus();
}
)
return;
} else {
var params = {
itemCode: result.package.itemCode,
batch: result.label.batch,
packingNumber: result.label.packingNumber,
parentPackingNumber: result.package.parentNumber,
inventoryStatus: this.jobContent.outInventoryStatuses.split(','),
areaType: this.jobContent.fromAreaTypes.split(','),
bussinessCode: this.jobContent.businessType
}
uni.showLoading({
title: '查询中',
mask: true
})
getBalanceByParams(params).then(res => {
if (res.data.length == 0) {
var status = getInventoryStatusDesc(params.inventoryStatus)
var areaType = getListLocationAreaTypeDesc(params.areaType)
var hint =
"按物料号 [" + params.itemCode + "] \n" +
"包装号 [" + params.packingNumber + "] \n" +
"批次 [" + params.batch + "] \n" +
"状态 [" + status + "] \n" +
"库区 [" + areaType + "] \n" +
"未查找到库存余额"
this.showErrorMessage(hint,
res => {
that.getfocus();
})
} else if (res.data.length == 1) {
result.balance = res.data[0]
if (result.label.packingNumber != result.balance.packingNumber) {
result.balance.qty = Number(result.label.qty)
} else {
result.balance.qty = Number(result.balance.qty)
}
this.afterGetBalance(result.label, result.balance, result.package);
} else {
//
this.$refs.balanceSelect.openPopup(res.data);
}
uni.hideLoading()
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error,
res => {
that.getfocus();
})
})
}
} catch (e) {
this.showErrorMessage(e.stack, res => {
that.getfocus();
})
uni.hideLoading();
}
},
getBalance(label, packageInfo, callback) {
var filters = []
if (packageInfo.parentNumber) {
var packingNumber = packageInfo.parentNumber + "," + label.packingNumber;
filters.push({
column: "packingNumber",
action: "in",
value: packingNumber
})
} else {
filters.push({
column: "packingNumber",
action: "==",
value: label.packingNumber
})
}
filters.push({
column: "itemCode",
action: "==",
value: label.itemCode
})
filters.push({
column: "batch",
action: "==",
value: label.batch
})
if (this.fromInventoryStatuses != null && this.fromInventoryStatuses != "") {
filters.push({
column: "inventoryStatus",
action: "in",
value: this.fromInventoryStatuses
})
}
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getBalanceByFilter(params).then(res => {
callback(res.data)
}).catch(err => {
this.showErrorMessage(err.message);
})
},
onScan(result) {
if (!result.package) {
this.showErrorMessage('扫描数据错误[' + result.label.code + "]",
res => {
this.getfocus();
}
)
return;
}
if (this.toLocation && result.package.packUnit) {
let item = this.toLocation.Items.find(r => r.itemCode == result.package.itemCode);
if (!item) {
this.showErrorMessage('扫描物料【' + result.package.itemCode + '】不属于该任务');
return
}
if (result.package.packUnit !== item.packUnit) {
this.$refs.comMessage.showQuestionMessage(
`扫描物料包装【${result.package.packUnit}】与任务推荐包装规格【${item.packUnit}】不一致.是否要继续发料?`, res => {
if (res) {
this.getToLocationBalance(result)
}
});
} else {
this.getToLocationBalance(result)
}
}
},
//
getToLocationBalance(result) {
uni.showLoading({
title: '查询中',
mask: true
})
var filters = []
if (result.package.parentNumber) {
var packingNumber = result.package.parentNumber + "," + result.package.number;
filters.push({
column: "packingNumber",
action: "in",
value: packingNumber
})
} else {
filters.push({
column: "packingNumber",
action: "==",
value: result.package.number
})
}
filters.push({
column: "itemCode",
action: "==",
value: result.package.itemCode
})
filters.push({
column: "batch",
action: "==",
value: result.package.batch
})
filters.push({
column: "areaType",
action: "in",
value: this.toLocationAreaTypeList.join(',')
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getBalanceByFilter(params).then(res => {
uni.hideLoading()
if (res.data.list.length > 0) {
this.showErrorMessage("包装在库位【" + res.data.list[0].locationCode + "】已有库存余额");
} else {
this.queryBalance(result);
}
// callback(res.data)
}).catch(err => {
uni.hideLoading()
this.showErrorMessage(err.message);
})
},
selectBalanceItem(balance) {
this.afterGetBalance(this.label, balance, this.packageInfo);
},
afterGetBalance(label, balance, packageInfo) {
let that = this;
try {
let itemCode = label.itemCode;
let packingCode = label.packingNumber;
let lot = label.batch;
let item = that.toLocation.Items.find(r => r.itemCode == itemCode);
that.fromLocationCode = balance.locationCode;
let fromLocation = item.Locations.find(l => l.fromLocationCode == that.fromLocationCode);
if (fromLocation != undefined) {
let batch = fromLocation.Batchs.find(r => r.batch == lot);
if (batch != undefined) {
if (batch.Records == undefined) {
batch.Records = [];
}
let record = batch.Records.find(r => r.packingNumber == packingCode);
if (record == undefined) {
//
if (batch.Recommends != undefined && batch.Recommends.length > 0) {
let recommend = batch.Recommends.find(r => r.packingNumber == packingCode);
if (recommend != undefined) {
that.addRecord(batch, label, balance, packageInfo)
} else {
//
if (this.jobContent.allowModifyPackingNumber == 'TRUE') {
that.addRecord(batch, label, balance, packageInfo);
} else {
that.showErrorMessage('未查找到该箱码【' + packingCode + '】的明细',
res => {
that.getfocus();
return;
}
)
}
}
} else {
that.addRecord(batch, label, balance, packageInfo)
}
that.$emit("afterScan");
} else {
that.showErrorMessage('箱码【' + packingCode + '】已经扫描,请继续扫描下一箱',
res => {
that.getfocus();
}
)
}
} else {
if (this.jobContent.allowModifyBatch == "TRUE") {
this.showQuestionMessage('在【' + that.fromLocationCode + '】库位下,未查找到批次【' + lot +
'】的发料明细,是否要继续发料?', res => {
if (res) {
let batch = that.createBatchInfo(label, balance, packageInfo);
//details
if (fromLocation.Batchs.length > 0) {
batch.detail = fromLocation.Batchs[0].detail;
}
fromLocation.Batchs.unshift(batch);
that.$emit("afterScan");
}
})
} else {
that.showErrorMessage('未查找到批次【' + lot + '】的发料明细',
res => {
that.getfocus();
});
}
}
} else {
let locaion = that.createLocationInfo(label, balance, packageInfo);
item.Locations.push(locaion);
}
} catch (e) {
that.showErrorMessage(e.stack,
res => {
that.getfocus();
}
)
}
},
//
createLocationInfo(label, balance, packageInfo) {
let location = {
fromLocationCode: balance.locationCode,
qty: balance.qty,
uom: balance.uom,
handleQty: 0,
Batchs: []
}
let batch = this.createBatchInfo(label, balance, packageInfo);
batch.detail = balance;
batch.detail.fromLocationCode = balance.locationCode;
location.Batchs.push(batch);
return location;
},
createBatchInfo(data, balance, packageInfo) {
let batch = {
batch: data.batch,
qty: 0,
uom: data.uom,
handleQty: Number(balance.qty),
Records: []
}
let record = this.creatRecord(data, balance, packageInfo);
batch.Records.push(record);
this.issueRecord.unshift(record)
return batch;
},
creatRecord(label, balance, packageInfo) {
balance.packQty = packageInfo.packQty
balance.packUnit = packageInfo.packUnit
let record = {
scaned: true,
itemCode: label.itemCode,
packingNumber: label.packingNumber,
parentPackingNumber: packageInfo.parentNumber,
batch: label.batch,
// qty: Number(balance.qty),
// qty: Number(label.qty) > Number(balance.qty) ? Number(balance.qty) : Number(label.qty),
qty: Number(balance.qty),
handleQty: Number(balance.qty),
uom: balance.uom,
inventoryStatus: balance.inventoryStatus,
balance: balance,
toLocationCode: this.toLocationCode,
supplierCode: label.supplierCode,
packUnit: packageInfo.packUnit,
packQty: packageInfo.packQty
}
return record;
},
calcBatchHandleQty(batch) {
let handleQty = 0;
batch.Records.forEach(res => {
handleQty = calc.add(handleQty, res.qty)
})
batch.handleQty = handleQty;
},
addRecord(batch, label, balance, packageInfo) {
let record = this.creatRecord(label, balance, packageInfo);
batch.Records.push(record);
this.issueRecord.unshift(record)
this.calcBatchHandleQty(batch);
this.getfocus();
},
getfocus() {
if (this.$refs.comscan != undefined) {
this.$refs.comscan.getfocus();
}
},
losefocus() {
if (this.$refs.comscan != undefined) {
this.$refs.comscan.losefocus();
}
},
expands() {
this.expand = !this.expand;
this.expendIcon = this.expand == true ? "arrow-down" : "arrow-up"
},
swipeClick(e, item, index) {
if (e.content.text == "详情") {
this.detail(item)
} else if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "移除") {
this.remove(item, index)
}
},
edit(item) {
this.editItem = item;
// item.balance.balanceQty = item.balance.qty;
item.balance.balanceQty = item.balance.qty;
this.$refs.balanceQtyEdit.openEditPopup(item.balance, item.qty);
},
detail(item) {
this.showItem = item;
this.$refs.receiptHint.openScanPopup()
},
remove(record, index) {
this.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
record.qty = 0;
this.issueRecord.splice(index, 1)
let item = this.toLocation.Items.find(r => r.itemCode == record.itemCode);
if (item != undefined) {
item.Locations.forEach(l => {
let batch = l.Batchs.find(b => b.packingNumber == record.packingNumber && b
.batch == record.batch);
if (batch && batch.Records && batch.Records.length > 0) {
let rIndex = batch.Records.findIndex(r => r.packingNumber == record
.packingNumber && r.batch == record.batch);
batch.Records.splice(rIndex, 1);
}
})
}
this.$emit('updateData', item);
}
});
},
packGetFocus() {
if (this.$refs.comscan) {
this.$refs.comscan.getfocus();
}
},
packLoseFocus() {
if (this.$refs.comscan) {
this.$refs.comscan.losefocus();
}
},
showMessage(message, callback) {
setTimeout(r => {
this.packLoseFocus();
this.$refs.comMessage.showMessage(message, callback);
})
},
showErrorMessage(message, callback) {
setTimeout(r => {
this.packLoseFocus();
this.$refs.comMessage.showErrorMessage(message, callback);
})
},
showQuestionMessage(message, callback) {
setTimeout(r => {
this.packLoseFocus();
this.$refs.comMessage.showQuestionMessage(message, callback);
})
},
confirm(val) {
this.editItem.qty = Number(val);
this.$emit('updateData', this.editItem)
},
cancle() {
this.closeScanPopup()
}
}
}
</script>
<style lang="scss">
button {
border: none;
}
button::after {
border: none
}
.scroll-view {
overflow-y: scroll;
height: auto;
max-height: 300rpx;
padding: 10rpx;
}
.my-combox {
font-size: 50px;
}
</style>

19
src/pages/issue/job/issueDetail.vue

@ -32,7 +32,7 @@
<view class=""> <view class="">
</view> </view>
<view class=" uni-flex uni-row"> <view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="submit()">提交</button> <button class="btn_single_commit" hover-class="btn_commit_after" @click="autoCommit()">提交</button>
</view> </view>
</view> </view>
</view> </view>
@ -449,9 +449,16 @@
afterScan() { afterScan() {
this.resizeCollapse(); this.resizeCollapse();
this.autoCommit()
},
autoCommit(){
let str="" let str=""
var totalQty =0;
var taskQty =0;
this.detailSource.forEach(detail => { this.detailSource.forEach(detail => {
detail.Items.forEach(item => { detail.Items.forEach(item => {
taskQty =calc.add(taskQty,item.qty)
item.Locations.forEach(lco => { item.Locations.forEach(lco => {
lco.Batchs.forEach(batch => { lco.Batchs.forEach(batch => {
batch.Records.forEach(record => { batch.Records.forEach(record => {
@ -466,8 +473,12 @@
str += str +=
`包装号【${record.packingNumber}】提交数量【${tempHandleQty}】与任务物料数量【${batch.qty}】不一致\n` `包装号【${record.packingNumber}】提交数量【${tempHandleQty}】与任务物料数量【${batch.qty}】不一致\n`
} }
} }
if(record){
var hanleQty =record.qty?record.qty:0
totalQty = calc.add(totalQty,hanleQty)
}
}) })
}) })
}) })
@ -476,6 +487,9 @@
if(str){ if(str){
str = '任务明细未全部完成,是否提交?\n' + str str = '任务明细未全部完成,是否提交?\n' + str
}
if(totalQty!=taskQty){
str ="扫描数量["+totalQty+"]与任务数量不一致["+taskQty+"],是否提交"
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => { this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
if (res) { if (res) {
// //
@ -487,7 +501,6 @@
}else { }else {
// //
this.$throttle(this.submit, 2000, this)() this.$throttle(this.submit, 2000, this)()
} }
}, },

608
src/pages/issue/job/issueDetail0816.vue

@ -0,0 +1,608 @@
<template>
<view class="page-wraper">
<view class="page-header">
<view class="header-view">
<view class="header_job_top">
<job-top :dataContent="jobContent"></job-top>
</view>
<work-station :workshopCode="jobContent.workShopCode"
:productionLineCode="jobContent.detailProductionLineCode"
:workStationCode="jobContent.detailWorkStationCode"
:rawLocationCode="jobContent.detailToLocationCode">
</work-station>
</view>
</view>
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view v-for="(toLocation, index) in detailSource">
<!-- <work-station :workshopCode="jobContent.workShopCode"
:productionLineCode="toLocation.productionLineCode"
:workStationCode="toLocation.workStationCode" :rawLocationCode="toLocation.toLocationCode">
</work-station> -->
<com-issue-detail-card ref='comIssueDetailCard' :dataContent="toLocation" @updateData='updateData'>
</com-issue-detail-card>
<view class="split_line"></view>
</view>
</scroll-view>
</view>
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="">
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="autoCommit()">提交</button>
</view>
</view>
</view>
<win-scan-button @goScan='openScanDetailPopup'></win-scan-button>
<com-scan-issue-pack ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'
@afterScan='afterScan'>
</com-scan-issue-pack>
<balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
takeIssueJob,
cancleTakeIssueJob,
getIssueJobDetail,
issueJobSubmit
} from '@/api/request2.js';
import {
goHome,
navigateBack,
getRemoveOption,
getCurrDateTime,
getDirectoryItemArray,
getPackingNumberAndBatch,
deepCopyData
} from '@/common/basic.js';
import {
getDataSource
} from '@/pages/issue/js/issue.js';
import {
getManagementPrecisions
} from '@/common/balance.js';
import {
calc
} from '@/common/calc.js';
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import comIssueDetailCard from '@/pages/issue/coms/comIssueDetailCard.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comScanIssuePack from '@/pages/issue/coms/comScanIssuePack.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
import workStation from '@/mycomponents/workStation/workStation.vue'
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
export default {
name: 'issueDetail',
components: {
jobDetailPopup,
winScanButton,
comIssueDetailCard,
comScanIssuePack,
jobTop,
workStation,
balanceSelect
},
data() {
return {
id: '',
jobContent: {}, //
subList: [], //subList
detailSource: [], //
detailOptions: [],
scanOptions: [],
jobStatus: "",
scanMessage: ''
};
},
props: {
},
onLoad(option) {
uni.setNavigationBarTitle({
title: option.title + '详情'
});
this.id = option.id;
this.scanMessage = option.scanMessage || '';
if (this.id != undefined) {
//
if (option.status == "1") {
this.receive((callback => {
this.getDetail();
}));
} else {
this.getDetail();
}
}
},
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}
},
//
onBackPress(e) {
//
if (e.from === 'backbutton') {
if (this.jobStatus == "2") {
//
cancleTakeIssueJob(this.id).then(res => {
uni.navigateBack();
}).catch(error => {
uni.navigateBack();
})
} else {
uni.navigateBack();
}
return true;
}
},
watch: {
locationTypes(newVal) {
let value = newVal;
},
},
mounted: function() {
// this.resizeCollapse();
},
methods: {
resizeCollapse() {
this.$nextTick(r => {
this.$refs.comIssueDetailCard.forEach(r => {
r.resizeCollapse();
})
});
},
//
receive(callback) {
if (this.id != null) {
takeIssueJob(this.id).then(res => {
callback();
}).catch(error => {
this.showErrorMessage(error)
})
}
},
getDetail() {
var that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getIssueJobDetail(that.id).then(res => {
uni.hideLoading();
if (res.data == null) {
that.showMessage('未获取到详情');
} else {
if (res.data.subList.length > 0) {
that.jobContent = res.data;
that.jobStatus = res.data.status
that.subList = res.data.subList;
that.detailSource = getDataSource(that.detailSource, that.subList)
that.jobContent.detailToLocationCode = res.data.subList[0].toLocationCode
//
if (this.scanMessage) {
this.openScanPopupSimulate(this.scanMessage);
}
setTimeout(r => {
that.resizeCollapse();
}, 100)
// that.detailSource.forEach(r => {
// r.subList.forEach(s => {
// if (this.scanedPackingNumber && this.scanedPackingNumber == s
// .packingNumber) {
// s.scaned = true
// s.cancleScanedHiht = true
// //
// this.openScanPopupSimulate(s);
// this.scanedPackingNumber = ''
// }
// })
// })
} else {
that.showMessage('列表数据为0');
}
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
closeScan() {
this.resizeCollapse();
},
// submit() {
//3.
//:XXX
// var isOutIn = getApp().globalData.feed_configList.filter(
// res => {
// if (res.name == 'feed_isOutIn') {
// return res;
// }
// });
// this.dataContent.itemCodeList.forEach(res => {
// if (res.handleQty > res.recommendQty) {
// this.$refs.modal.showConfirmMessageModal(',?', confirm => {
// if (confirm) {
// //
// uni.showToast({
// title: ""
// })
// }
// })
// } else {
// uni.showToast({
// title: "" + res.handleQty + "][" + res.recommendQty + "]"
// })
// }
// })
// },
submit() {
uni.showLoading({
title: "提交中....",
mask: true
});
//
var itemCodes = []
let locationCode = this.detailSource[0].toLocationCode
this.detailSource.forEach(toLocation => {
toLocation.Items.forEach(item => {
itemCodes.push(item.itemCode)
})
})
//
getManagementPrecisions(itemCodes, locationCode, res => {
if (res.success) {
this.managementList = res.list;
this.submitJob();
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
});
},
submitJob() {
var params = this.setParams()
if (!params.subList || params.subList.length == 0) {
uni.hideLoading()
this.showErrorMessage("请扫描您需要提交的发料任务")
return
}
console.log("提交参数", JSON.stringify(params));
issueJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功\n生成发料记录\n" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
setParams() {
var subList = []
var createTime = getCurrDateTime();
var creator = this.$store.state.user.id
this.detailSource.forEach(toLocationCode => {
toLocationCode.Items.forEach(item => {
item.Locations.forEach(fromLocation => {
fromLocation.Batchs.forEach(batch => {
let subItem = batch.detail;
if (subItem != undefined) {
subItem.recordList = [];
if (batch.Records.length > 0) {
batch.Records.forEach(r => {
let record = {};
record.handleQty = r.qty;
record.fromPackingNumber = r
.packingNumber;
record.fromBatch = r.batch;
record.fromContainerNumber = r
.ContainerNumber;
record.toContainerNumber = r
.ContainerNumber;
record.toInventoryStatus = r
.inventoryStatus;
// record.toLocationCode = subItem
// .toLocationCode;
record.toLocationCode = this.jobContent
.detailToLocationCode;
record.supplierCode = r.supplierCode;
let single_price = r.balance
.singlePrice == null ? 0 : r
.balance
.singlePrice;
record.singlePrice = single_price;
record.amount = single_price * r.qty;
//使
if (item.onTheWayLocationCode) {
record.toPackingNumber = r
.packingNumber;
record.toBatch = r.batch;
} else {
var info =
getPackingNumberAndBatch(
this.managementList, r
.itemCode,
r.packingNumber, r
.batch);
record.toPackingNumber = info
.packingNumber;
record.toBatch = info.batch;
}
record.fromParentPackingNumber = r
.parentPackingNumber;
subItem.recordList.push(record);
})
subList.push(deepCopyData(subItem));
}
}
})
})
})
})
this.jobContent.subList = subList
this.jobContent.createTime = createTime;
this.jobContent.creator = creator;
return this.jobContent;
},
cancel() {
let that = this;
this.$refs.comMessage.showQuestionMessage('是否要清空已扫描的物料和目标库位信息?', res => {
if (res) {
that.clearInfo();
}
});
},
clearInfo() {
this.dataContent.itemCodeList.forEach(res => {
if (res.recommendList != null) {
res.recommendList.forEach(res1 => {
if (res1.locationCodeList != null) {
res1.locationCodeList.forEach(res2 => {
if (res2.packingCodeList != null) {
res2.packingCodeList.forEach(res3 => {
res3.itemCode = "";
res3.qty = 0;
})
}
})
}
})
}
})
},
updateData(record) {
console.log('updateData', record)
console.log('this.detailSource', this.detailSource)
let requestLocation = this.detailSource.find(r => r.toLocationCode == record.toLocationCode);
let item = requestLocation.Items.find(r => r.itemCode == record.itemCode);
let itemHandleQty = 0;
if (item != undefined) {
item.Locations.forEach(l => {
let batch = l.Batchs.find(b => (b.packingNumber == record.packingNumber || b
.packingNumber == null || b.packingNumber == '') && b.batch == record.batch);
let handleQty = 0;
if (batch != undefined) {
batch.Records.forEach(res => {
handleQty = calc.add(handleQty, res.qty)
})
batch.handleQty = handleQty;
itemHandleQty = calc.add(itemHandleQty, handleQty)
}
})
}
this.resizeCollapse();
item.handleQty = itemHandleQty;
},
afterScan() {
this.resizeCollapse();
this.autoCommit()
},
autoCommit(){
let str=""
var totalQty =0;
var taskQty =0;
this.detailSource.forEach(detail => {
detail.Items.forEach(item => {
taskQty =calc.add(taskQty,item.qty)
item.Locations.forEach(lco => {
lco.Batchs.forEach(batch => {
batch.Records.forEach(record => {
if (batch.qty != record.qty) {
var tempHandleQty = 0
if (record.qty) {
tempHandleQty = record.qty
} else {
tempHandleQty = 0
}
if (batch.qty != 0) {
str +=
`包装号【${record.packingNumber}】提交数量【${tempHandleQty}】与任务物料数量【${batch.qty}】不一致\n`
}
}
if(record){
var hanleQty =record.qty?record.qty:0
totalQty = calc.add(totalQty,hanleQty)
}
})
})
})
})
})
if(str){
str = '任务明细未全部完成,是否提交?\n' + str
}
if(totalQty!=taskQty){
str ="扫描数量["+totalQty+"]与任务数量不一致["+taskQty+"],是否提交"
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
if (res) {
//
this.$throttle(this.submit, 2000, this)()
} else {
this.scanPopupGetFocus()
}
});
}else {
//
this.$throttle(this.submit, 2000, this)()
}
},
scanPopupGetFocus() {
if (this.$refs.comScanIssuePack) {
this.$refs.comScanIssuePack.getfocus();
}
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
showCommitSuccess() {
this.$refs.comMessage.showCommitSuccess();
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
navigateBack(1)
})
},
showRescanMessage(message) {
this.$refs.comMessage.showRescanMessage(message);
},
afterCloseMessage() {
this.scanPopupGetFocus();
},
closeScanMessage() {
this.scanPopupGetFocus();
},
confirm(data) {
this.dataContent = data;
},
confirmResult(result) {
this.dataContent = result;
this.$forceUpdate();
},
openScanDetailPopup() {
var datacontent = {}
//
// Object.assign(datacontent, this.detailSource);
this.$refs.comScanIssuePack.openScanPopup(this.detailSource, this.jobContent);
},
openScanPopupSimulate(scanMessage) {
this.$refs.comScanIssuePack.openScanPopupForJobSimulate(this.detailSource, this.jobContent, scanMessage);
},
closeScanPopup() {
this.updateCommitBtn();
},
}
};
</script>
<style scoped lang="scss">
.uni-numbox__value {
width: 40px;
}
button[disabled] {
background-color: #3C9CFF;
color: #fff;
opacity: 0.7;
}
// /deep/ .input-value {
// font-size: 16px;
// }
// /deep/ .uni-collapse-item__title-text {
// font-size: 16px;
// }
// /deep/ .uni-collapse-item--border {
// border-bottom-width: 0px;
// border-bottom-color: #ebeef5;
// }
// /deep/ .uni-collapse-item--border {
// border-bottom-width: 1px;
// border-bottom-color: #ebeef5;
// }
</style>

95
src/pages/issue/job/issueJob.vue

@ -329,82 +329,91 @@
title: "加载中­....", title: "加载中­....",
mask: true mask: true
}); });
var filters = [] // var filters = []
if (this.checkedToday) { // if (this.checkedToday) {
filters.push({ // filters.push({
column: "create_time", // column: "create_time",
action: "betweeen", // action: "betweeen",
value: this.todayTime // value: this.todayTime
}) // })
} // }
filters.push({ // filters.push({
column: "status", // column: "status",
action: "in", // action: "in",
value: this.status // value: this.status
}) // })
if (params.status) {
this.status = params.status
}else{
this.status = "1,2"
}
if(params.creationTime==""){
this.checkedToday = false;
}
if (params.fromLocationCode) { if (params.fromLocationCode) {
// //
this.fromLocation = params.fromLocationCode this.fromLocation = params.fromLocationCode
filters.push({ // filters.push({
column: "fromLocationCode", // column: "fromLocationCode",
action: "==", // action: "==",
value: params.fromLocationCode // value: params.fromLocationCode
}) // })
}else{ }else{
this.fromLocation = '' this.fromLocation = ''
} }
if (params.productionLineCode) { if (params.productionLineCode) {
// 线 // 线
this.productionLine = params.productionLineCode this.productionLine = params.productionLineCode
filters.push({ // filters.push({
column: "productionLineCode", // column: "productionLineCode",
action: "==", // action: "==",
value: params.productionLineCode // value: params.productionLineCode
}) // })
}else{ }else{
this.productionLine = '' this.productionLine = ''
} }
if (params.itemCode) { if (params.itemCode) {
// //
this.filterItemCode = params.itemCode this.filterItemCode = params.itemCode
filters.push({ // filters.push({
column: "itemCode", // column: "itemCode",
action: "like", // action: "like",
value: params.itemCode // value: params.itemCode
}) // })
}else{ }else{
this.filterItemCode = '' this.filterItemCode = ''
} }
if (params.fromAreaCode) { if (params.fromAreaCode) {
// //
this.fromAreaCode = params.fromAreaCode this.fromAreaCode = params.fromAreaCode
filters.push({ // filters.push({
column: "fromAreaCode", // column: "fromAreaCode",
action: "==", // action: "==",
value: params.fromAreaCode // value: params.fromAreaCode
}) // })
}else{ }else{
this.fromAreaCode = '' this.fromAreaCode = ''
} }
if (params.toAreaCode) { if (params.toAreaCode) {
// //
this.toAreaCode = params.toAreaCode this.toAreaCode = params.toAreaCode
filters.push({ // filters.push({
column: "toAreaCode", // column: "toAreaCode",
action: "==", // action: "==",
value: params.toAreaCode // value: params.toAreaCode
}) // })
}else{ }else{
this.toAreaCode = '' this.toAreaCode = ''
} }
var params = { // var params = {
filters: filters, // filters: filters,
pageNo: 1, // pageNo: 1,
pageSize: 100, // pageSize: 100,
} // }
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode) this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode)
// getIssueJobList(params).then(res => { // getIssueJobList(params).then(res => {

746
src/pages/issue/job/issueJob0816.vue

@ -0,0 +1,746 @@
<template>
<view class="">
<com-empty-view v-if="jobList.length==0"></com-empty-view>
<job-filter :isShowFromLocationCode="true" :isShowFromAreaCode="true" :isShowToAreaCode="true" :isShowProductionLineCode="true" :productionline="productionlineList"
ref="filter" otherTitle=""
:checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask"
@switchChangeWait="switchChangeWait"
@switchChangeToday="switchChangeToday"
:isShowItemCode="true" @onQuery="getListByFilter" :isShowQurery='true'>
<!-- <job-filter :isShowFromLocationCode="true" :isShowProductionLineCode="true"
:productionline="productionlineList" ref="filter" otherTitle="" @switchChangeToday="switchChangeToday"
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask" @productionLineCode="productionLineCode"
@fromLocationCode="fromLocationCode"> -->
</job-filter>
<view v-if="jobList.length>0">
<uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in jobList" :key="index">
<uni-swipe-action-item
:right-options="item.status=='2'?detailGiveupOptions:item.status=='1'?detailCloseOptions:detailOptions"
@click="swipeClick($event,item)">
<com-issue-job-card :dataContent="item" @click='openJobDetail(item)'></com-issue-job-card>
</uni-swipe-action-item>
</view>
</uni-swipe-action>
<job-list-popup ref="jobListPopup" @selectedItem="selectedItem"></job-list-popup>
<job-info-popup ref='jobInfoPopup'></job-info-popup>
<uni-load-more :status="loadingType" v-if="jobList.length>0" />
</view>
<win-scan-button @goScan='openScanPopup' v-if="jobList.length>0"></win-scan-button>
<winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode">
</winComScanBalance>
<!-- <winScanPackJob ref="scanPopup" @getResult='getScanResult'></winScanPackJob> -->
<jobList ref="jobList" @selectItem="selectItem"></jobList>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
cancleTakeIssueJob,
getIssueJobList,
getIssueJobByProductionline,
closeTakeIssueJob
} from '@/api/request2.js';
import {
goHome,
updateTitle
} from '@/common/basic.js';
import {
getBusinessType
} from '@/common/record.js';
import {
planRefreshTime
} from '@/common/config.js';
import {
getDetailOption,
getDetailGiveupOption,
getDetailCloseOption
} from '@/common/array.js';
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import jobFilter from '@/mycomponents/job/jobFilter.vue'
import comIssueJobCard from '@/pages/issue/coms/comIssueJobCard.vue'
import jobListPopup from '@/pages/issue/coms/jobListPopup.vue'
import jobInfoPopup from '@/pages/issue/coms/jobInfoPopup.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue"
import jobList from '@/mycomponents/jobList/jobList.vue'
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
export default {
name: 'issue',
components: {
comEmptyView,
jobFilter,
comIssueJobCard,
jobListPopup,
jobInfoPopup,
winScanPackJob,
winScanButton,
jobList,
winComScanBalance
},
data() {
return {
jobList: [],
pageNo: 1,
pageSize: 10,
totalCount: 0,
loadingType: "nomore",
checkedToday: false,
checkedWaitTask: false,
todayTime: "",
status: '1,2', //
detailOptions: [],
detailGiveupOptions: [],
productionlineList: [],
detailCloseOptions: [],
title: '',
productionLine: "",
fromLocation: "",
fromAreaCode: '', //
toAreaCode: '', //
filterItemCode: "",
businessTypeCode: "Issue",
businessType: null,
timer:null
};
},
onLoad(option) {
this.title = option.title
this.getIssueJobByProductionline()
},
onShow() {
this.timerRefresh();
},
onHide() {
this.stopRefresh();
},
onUnload(){
this.stopRefresh();
},
onReady() {
this.detailOptions = getDetailOption();
this.detailGiveupOptions = getDetailGiveupOption();
this.detailCloseOptions = getDetailCloseOption();
},
onReachBottom() {
//
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getList('more', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode)
},
onPullDownRefresh() {
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode)
},
//退
onBackPress(options) {
if (options.from === 'navigateBack') {
uni.navigateBack({
delta: 1
})
return false;
}
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
} else if (e.index == 1) {
this.$refs.filter.openFilter();
}
},
methods: {
timerRefresh() {
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode)
this.stopRefresh();
var that = this;
this.timer = setInterval(function() {
that.getList('refresh', that.fromLocation, that.productionLine, that.filterItemCode,this.fromAreaCode,this.toAreaCode)
console.log('发料刷新');
}, planRefreshTime)
},
stopRefresh() {
if (this.timer) {
clearInterval(this.timer);
this.timer = null;
}
},
getBusinessTypeFunc() {
getBusinessType(this.businessTypeCode, res => {
if (res.success) {
this.businessType = res.businessType;
this.fromInventoryStatuses = res.fromInventoryStatuses.split(',');
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList
// this.openScanPopup();
this.$refs.scanPopup.openScanPopup(this.businessType);
} else {
this.showErrorMessage(res.message)
}
});
},
getIssueJobByProductionline() {
getIssueJobByProductionline().then(res => {
if (res.code == 0) {
this.productionlineList = res.data.map(item => ({
value: item.value,
text: item.name
}))
this.productionlineList.unshift({
value: "",
text: "全部"
})
} else {
this.productionlineList = []
}
})
},
getList(type, fromLocation = '', productionLine = '',filterItemCode='',fromAreaCode='',toAreaCode='') {
let that = this;
uni.showLoading({
title: "加载中­....",
mask: true
});
this.loadingType = "loading";
if (type === "refresh") {
this.pageNo = 1;
this.jobList = [];
}
var filters = []
if (this.checkedToday) {
filters.push({
column: "create_time",
action: "betweeen",
value: this.todayTime
})
}
filters.push({
column: "status",
action: "in",
value: this.status
})
if (fromLocation) {
//
filters.push({
column: "fromLocationCode",
action: "==",
value: fromLocation
})
}
if(fromAreaCode){
//
filters.push({
column: "fromAreaCode",
action: "==",
value: fromAreaCode
})
}
if(toAreaCode){
//
filters.push({
column: "toAreaCode",
action: "==",
value: toAreaCode
})
}
if (productionLine) {
// 线
filters.push({
column: "productionLineCode",
action: "==",
value: productionLine
})
}
if(filterItemCode){
//
filters.push({
column: "itemCode",
action: "like",
value: filterItemCode
})
}
var params = {
filters: filters,
pageNo: this.pageNo,
pageSize: 100,
}
getIssueJobList(params).then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
this.openScanPopup()
}
var list = res.data.list;
this.totalCount = res.data.total
updateTitle(this.title + "(" + this.totalCount + ")");
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
this.loadingType = "nomore";
return;
}
this.jobList = type === "refresh" ? list : this.jobList.concat(list);
this.pageNo++;
if (type === "refresh") {
uni.stopPullDownRefresh();
}
}).catch(error => {
if (type === "refresh") {
uni.stopPullDownRefresh();
}
updateTitle(this.title);
this.loadingType = "";
uni.hideLoading();
that.showMessage(error)
})
},
getListByFilter(params) {
console.log('getListByFilter',params)
let that = this;
uni.showLoading({
title: "加载中­....",
mask: true
});
// var filters = []
// if (this.checkedToday) {
// filters.push({
// column: "create_time",
// action: "betweeen",
// value: this.todayTime
// })
// }
// filters.push({
// column: "status",
// action: "in",
// value: this.status
// })
if (params.status) {
this.status = params.status
}else{
this.status = "1,2"
}
if(params.creationTime==""){
this.checkedToday = false;
}
if (params.fromLocationCode) {
//
this.fromLocation = params.fromLocationCode
// filters.push({
// column: "fromLocationCode",
// action: "==",
// value: params.fromLocationCode
// })
}else{
this.fromLocation = ''
}
if (params.productionLineCode) {
// 线
this.productionLine = params.productionLineCode
// filters.push({
// column: "productionLineCode",
// action: "==",
// value: params.productionLineCode
// })
}else{
this.productionLine = ''
}
if (params.itemCode) {
//
this.filterItemCode = params.itemCode
// filters.push({
// column: "itemCode",
// action: "like",
// value: params.itemCode
// })
}else{
this.filterItemCode = ''
}
if (params.fromAreaCode) {
//
this.fromAreaCode = params.fromAreaCode
// filters.push({
// column: "fromAreaCode",
// action: "==",
// value: params.fromAreaCode
// })
}else{
this.fromAreaCode = ''
}
if (params.toAreaCode) {
//
this.toAreaCode = params.toAreaCode
// filters.push({
// column: "toAreaCode",
// action: "==",
// value: params.toAreaCode
// })
}else{
this.toAreaCode = ''
}
// var params = {
// filters: filters,
// pageNo: 1,
// pageSize: 100,
// }
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode)
// getIssueJobList(params).then(res => {
// uni.hideLoading();
// if (res.data.total == 0) {
// that.showMessage('');
// } else if (res.data.total == 1) {
// that.openJobDetail(res.data.list[0]);
// } else {
// that.showItemList(res.data.list);
// }
// }).catch(error => {
// that.showMessage(error)
// })
},
fromLocationCode(fromLocation) {
this.fromLocation = fromLocation;
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode)
},
productionLineCode(productionLineCode) {
this.productionLine = productionLineCode
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode)
},
getByAsnNumber(code) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getPurchasereceiptByAsnNumber(code).then(res => {
uni.hideLoading();
if (res.data.total == 0) {
that.showMessage('未查找到' + '【' + code + '】的收货任务');
} else if (res.data.total == 1) {
this.$refs.scanAsnNumber.closeScanPopup();
that.openJobDetail(res.data.list[0]);
} else {
this.$refs.scanAsnNumber.closeScanPopup();
that.showItemList(res.data.list);
}
}).catch(error => {
uni.hideLoading();
that.showErrorMessage(error);
})
},
openJobDetail(item, scanMessage = '') {
this.getJobInfoByNumber(item.number,scanMessage)
},
showItemList(itemList) {
this.$refs.jobListPopup.openPopup(itemList);
},
selectedItem(item) {
this.openJobDetail(item);
},
selectItem(item) {
this.$refs.scanPopup.closeScanPopup();
this.openJobDetail(item, this.scanMessage);
},
swipeClick(e, dataContent) {
if (e.content.text == "详情") {
this.openjobInfoPopup(dataContent);
} else if (e.content.text == "放弃") {
this.$refs.comMessage.showQuestionMessage("确定要放弃当前任务?",
res => {
if (res) {
this.cancleJob(dataContent.masterId);
}
});
} else if (e.content.text == "关闭") {
this.$refs.comMessage.showQuestionMessage("确定要关闭当前任务?",
res => {
if (res) {
this.closeJob(dataContent.masterId);
}
});
}
},
openjobInfoPopup(item) {
this.$refs.jobInfoPopup.openPopup(item)
},
cancleJob(id) {
cancleTakeIssueJob(id).then(res => {
if (res.data) {
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode)
uni.showToast({
title: "放弃任务成功"
})
} else {
this.showMessage("放弃任务失败")
}
}).catch(error => {
this.showMessage(error)
})
},
closeJob(id) {
uni.showLoading({
title: "加载中....",
mask: true
});
closeTakeIssueJob(id).then(res => {
uni.hideLoading()
if (res.data) {
this.getList("refresh")
uni.showToast({
title: "关闭任务成功"
})
} else {
this.showMessage("关闭任务失败")
}
}).catch(error => {
uni.hideLoading()
this.showMessage(error)
})
},
switchChangeToday(state, creationTime) {
this.checkedToday = state;
this.todayTime = creationTime;
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode)
},
switchChangeWait(state, jobStatus) {
this.checkedWaitTask = state;
this.status = jobStatus;
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode)
},
getJobInfoByNumber(number,scanMessage){
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
var filters = []
filters.push({
column: "status",
action: "in",
value: '1,2'
})
filters.push({
column: "number",
action: "==",
value: number
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getIssueJobList(params).then(res => {
uni.hideLoading();
if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + number + '】的发料任务');
} else {
var result =res.data.list[0];
if(result.acceptUserId&&result.acceptUserId!=this.$store.state.user.id){
this.$refs.comMessage.showErrorMessage("任务号["+result.number+"]已经被["+result.acceptUserName+"]承接,无法执行", res => {
if (res) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.getfocus()
}
this.getList('refresh', this.fromLocation, this.productionLine, this.filterItemCode,this.fromAreaCode,this.toAreaCode)
}
});
return;
}
uni.navigateTo({
url: './issueDetail?id=' + result.masterId + '&status=' + result.status + '&scanMessage=' +
scanMessage + '&title=' + this.title
});
this.scanMessage=""
}
}).catch(error => {
uni.hideLoading();
that.showMessage(error);
})
},
getScanNumber(code) {
this.getDataListByType(code)
},
getDataListByType(code) {
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
var filters = []
filters.push({
column: "status",
action: "in",
value: '1,2'
})
filters.push({
column: "number",
action: "==",
value: code
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getIssueJobList(params).then(res => {
uni.hideLoading();
if (res.data.list.length == 0) {
that.showMessage('未查找到' + '【' + code + '】的发料任务');
} else if (res.data.list.length == 1) {
that.openJobDetail(res.data.list[0]);
}
}).catch(error => {
uni.hideLoading();
that.showMessage(error);
})
},
showMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.getfocus()
}
}
});
},
openScanPopup() {
if (this.businessType == null) {
this.getBusinessTypeFunc()
} else {
this.$refs.scanPopup.openScanPopup(this.businessType);
}
},
getScanResult(result) {
let balance = result.balance;
if (balance != null) {
this.scanMessage = ""
if (!result.label.batch) {
this.showMessage("批次为空")
return;
}
if (!result.label.itemCode) {
this.showMessage("物料号为空")
return;
}
try {
var filters = [{
column: "status",
action: "in",
value: '1,2'
},
{
column: "batch",
action: "==",
value: result.label.batch
},
{
column: "itemCode",
action: "==",
value: result.label.itemCode
},
{
column: "fromLocationCode",
action: "==",
value: balance.locationCode
}
]
getIssueJobList({
filters: filters,
pageNo: 1,
pageSize: 1000,
sort: 'createTime',
by: 'asc'
}).then(res => {
this.scanMessage = result.scanMessage
let resultList = res.data.list;
if (resultList.length > 0) {
resultList.forEach(item => {
item.title = item.number;
item.selected = false
})
let list = []
resultList.forEach(item => {
if (!list.find(subItem => subItem.title == item.title)) {
list.push(item)
}
})
if (list.length > 0) {
this.selectItem(list[0])
}
} else {
this.showMessage("按来源库位[" + balance.locationCode + "]批次[" + result.label.batch +
"]物料号[" + result.label.itemCode + "]未查找到任务\n" + "扫描[" + result
.scanMessage + "]")
}
}).catch(error => {
this.showMessage(error + "\n扫描[" + result.scanMessage + "]")
})
} catch (e) {
this.showMessage(e.message)
}
}
},
}
}
</script>
<style scoped lang="scss">
</style>

70
src/pages/issue/record/directIssue.vue

@ -48,7 +48,7 @@
<winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode"> <winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode">
</winComScanBalance> </winComScanBalance>
<!-- <balanceQuery ref="refBalanceQuery"></balanceQuery> --> <balanceQuery ref="refBalanceQuery" :businessTypeCode="businessTypeCode"></balanceQuery>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
</template> </template>
@ -99,7 +99,7 @@
import recordDetailCard from '@/mycomponents/record/recordDetailCard.vue' import recordDetailCard from '@/mycomponents/record/recordDetailCard.vue'
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue' import balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue' import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
// import balanceQuery from '@/mycomponents/query/balanceQuery.vue' import balanceQuery from '@/mycomponents/query/balanceQuery.vue'
export default { export default {
@ -114,7 +114,7 @@
recordDetailCard, recordDetailCard,
balanceSelect, balanceSelect,
winComScanBalance, winComScanBalance,
// balanceQuery balanceQuery
}, },
data() { data() {
return { return {
@ -166,8 +166,8 @@
if (e.index === 0) { if (e.index === 0) {
goHome(); goHome();
} else if (e.index == 1) { } else if (e.index == 1) {
// this.$refs.refBalanceQuery.showDrawer(); this.$refs.refBalanceQuery.showDrawer();
// this.closeScanPopup(); this.closeScanPopup();
} }
}, },
// //
@ -178,10 +178,6 @@
mounted() {}, mounted() {},
methods: { methods: {
// showDrawer() {
// this.$refs.showRight.open();
// },
getBusinessType() { getBusinessType() {
getBusinessType(this.businessTypeCode, res => { getBusinessType(this.businessTypeCode, res => {
if (res.success) { if (res.success) {
@ -247,6 +243,59 @@
} }
}) })
if (detail == undefined) { if (detail == undefined) {
//
//
//,
if (pack.parentNumber) {
var checkData = item.subList.find(r => {
if (r.packingNumber == pack.parentNumber &&
r.batch == balance.batch) {
return r;
}
})
if (checkData) {
//
this.showErrorMessage("扫描箱码[" + pack.number + "]批次[" + balance.batch +
"]的父包装已经扫描")
console.log("父包装已经扫描")
} else {
let newDetail = createDetailInfo(balance, pack);
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
item.subList.push(newDetail);
}
} else {
//
var checkData = item.subList.find(r => {
if (r.parentNumber == pack.number &&
r.batch == balance.batch) {
return r;
}
})
if (checkData) {
//
this.$refs.comMessage.showQuestionMessage("箱码[" + checkData.parentNumber+"]" + "批次[" + balance
.batch + "]是父包装,是否移除子包装", res => {
if (res) {
item.subList = [];
let newDetail = createDetailInfo(balance, pack);
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
item.subList.push(newDetail);
}
})
console.log("扫描的是父包装,是否移除子包装")
} else {
let newDetail = createDetailInfo(balance, pack); let newDetail = createDetailInfo(balance, pack);
newDetail.parentNumber = pack.parentNumber; newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number newDetail.packingNumber = pack.number
@ -256,6 +305,9 @@
newDetail.handleQty = balance.lableQty newDetail.handleQty = balance.lableQty
} }
item.subList.push(newDetail); item.subList.push(newDetail);
}
}
this.scanPopupGetFocus() this.scanPopupGetFocus()
} else { } else {
if (detail.scaned == true) { if (detail.scaned == true) {

248
src/pages/issue/record/directIssue0816.vue

@ -18,9 +18,8 @@
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent" <record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowFromLocation="false" @removeItem="removeItem(index,item)" :isShowFromLocation="false" @removeItem="removeItem(index,item)"
:isShowToLocation="false" :isShowParentToLocation="false" @updateData="updateData" :isShowToLocation="false" :isShowParentToLocation="false" @updateData="updateData"
@removePack="removePack"> @removePack="removePack" :isShowParentPack="false">
</record-com-detail-card> </record-com-detail-card>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
@ -45,9 +44,10 @@
</view> </view>
<win-scan-button @goScan='openScanPopup'></win-scan-button> <win-scan-button @goScan='openScanPopup'></win-scan-button>
</view> </view>
<win-scan-parent-package ref="scanPopup" @getResult='getScanResult'></win-scan-parent-package>
<winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode"> <!-- <win-scan-package ref="scanPopup" @getResult='getScanResult'></win-scan-package> -->
</winComScanBalance> <!-- <winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode">
</winComScanBalance> -->
<!-- <balanceQuery ref="refBalanceQuery"></balanceQuery> --> <!-- <balanceQuery ref="refBalanceQuery"></balanceQuery> -->
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
@ -57,7 +57,7 @@
import { import {
issueRecordSubmit, issueRecordSubmit,
getWorkShopLineStation, getWorkShopLineStation,
getBalanceByFilter getTransactionByFilter
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
@ -79,6 +79,7 @@
getBusinessType, getBusinessType,
createItemInfo, createItemInfo,
createDetailInfo, createDetailInfo,
createDetailByPackInfo,
calcTreeHandleQty, calcTreeHandleQty,
calcHandleQty calcHandleQty
} from '@/common/record.js'; } from '@/common/record.js';
@ -100,7 +101,7 @@
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue' import balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue' import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
// import balanceQuery from '@/mycomponents/query/balanceQuery.vue' // import balanceQuery from '@/mycomponents/query/balanceQuery.vue'
import winScanParentPackage from '@/mycomponents/scan/winScanParentPackage.vue'
export default { export default {
components: { components: {
@ -114,6 +115,7 @@
recordDetailCard, recordDetailCard,
balanceSelect, balanceSelect,
winComScanBalance, winComScanBalance,
winScanParentPackage
// balanceQuery // balanceQuery
}, },
data() { data() {
@ -181,7 +183,6 @@
// showDrawer() { // showDrawer() {
// this.$refs.showRight.open(); // this.$refs.showRight.open();
// }, // },
getBusinessType() { getBusinessType() {
getBusinessType(this.businessTypeCode, res => { getBusinessType(this.businessTypeCode, res => {
if (res.success) { if (res.success) {
@ -197,72 +198,117 @@
getScanResult(result) { getScanResult(result) {
let pack = result.package; let pack = result.package;
let balance = result.balance; let childBalance = result.balance.childBalance;
let parentBalance = result.balance.parentBalance[0];
//1.
if (this.itemCode) {
var item = this.detailSource.find(res => res.itemCode == pack.itemCode)
if (item == undefined) {
this.showErrorMessage("请扫描物料为【" + this.itemCode + "】不在此次发料记录中")
return;
}
if (item.subList.length > 0) {
var detail = item.subList.find(r => {
if (r.packingNumber == pack.number &&
r.batch == pack.batch) {
return r;
}
})
if (this.fromLocationCode && this.fromLocationCode != balance.locationCode) { if (detail && detail.scaned) {
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]在库位[" + this this.showErrorMessage("箱码[" + pack.number + "批次[" + pack.batch + "]重复扫描")
.fromLocationCode + "]没有库存余额")
return; return;
} }
}
}
//2.
// //
if (pack.parentNumber) { if (pack.parentNumber) {
this.setPackageData(result); //
if (childBalance.length == 0) {
this.getTransactionList(pack.number, transactionRes => {
if (transactionRes.length == 0) {
this.setPackageData(parentBalance, pack);
} else { } else {
this.setContainerData(result); this.showErrorMessage("箱码[" + pack.number + "批次[" + pack.batch +
"]已经发过料")
}
});
} else { //
this.setPackageData(childBalance[0], pack);
}
} else {
//
if(pack.subList.length==0){
this.getTransactionList(pack.number, transactionRes => {
if (transactionRes.length == 0) {
this.setPackageData(childBalance[0], pack);
} else {
this.showErrorMessage("箱码[" + pack.number + "批次[" + pack.batch +
"]已经发过料")
}
});
}else {
let packparams = '';
pack.subList.forEach(pack => {
packparams = packparams + pack.number + ','
})
packparams = packparams.trimEnd(',');
this.getTransactionList(packparams, transactionRes => {
//
pack.subList.forEach(sub => {
let subBalance = childBalance.find(r => r.packingNumber == sub.number);
if (subBalance) {
//
if (subBalance.locationCode == parentBalance.locationCode) {
this.setPackageData(subBalance, sub);
} else {
//
} }
},
setPackageData(result) { } else {
let balance = result.balance; //
let label = result.label; //
let pack = result.package; let transaction = transactionRes.find(p => p.packingNumber == sub
.number)
if (!transaction) {
this.setPackageData(parentBalance, sub);
}
}
})
})
}
}
},
setPackageData(balance, pack) {
var item = this.detailSource.find(res => { var item = this.detailSource.find(res => {
if (res.itemCode == balance.itemCode) { if (res.itemCode == balance.itemCode) {
return res return res
} }
}) })
if (item == undefined) { if (item == undefined) {
if (this.itemCode != "" && this.itemCode != balance.itemCode) {
this.showErrorMessage("请扫描物料为【" + this.itemCode + "】的箱码")
return;
}
if (this.fromWarehouseCode == '') {
this.fromWarehouseCode = balance.warehouseCode;
}
var itemp = createItemInfo(balance, pack); var itemp = createItemInfo(balance, pack);
let newDetail = createDetailInfo(balance, pack); // let newDetail = this.createPackageDetail(balance, pack);
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
itemp.subList.push(newDetail); itemp.subList.push(newDetail);
this.detailSource.push(itemp) this.detailSource.push(itemp);
this.itemCode = balance.itemCode; this.itemCode = balance.itemCode;
this.fromLocationCode = balance.locationCode this.fromLocationCode = balance.locationCode;
this.fromWarehouseCode = balance.warehouseCode;
this.scanPopupGetFocus() this.scanPopupGetFocus()
} else { } else {
var detail = item.subList.find(r => { var detail = item.subList.find(r => {
if (r.packingNumber == pack.number && if (r.packingNumber == pack.number &&
r.batch == balance.batch && r.batch == pack.batch &&
r.locationCode == balance.locationCode && r.locationCode == pack.locationCode &&
r.inventoryStatus == balance.inventoryStatus) { r.inventoryStatus == balance.inventoryStatus) {
return r; return r;
} }
}) })
if (detail == undefined) { if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack); let newDetail = this.createPackageDetail(balance, pack);
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
item.subList.push(newDetail); item.subList.push(newDetail);
this.scanPopupGetFocus() this.scanPopupGetFocus()
} else { } else {
@ -274,73 +320,55 @@
calcHandleQty(this.detailSource); calcHandleQty(this.detailSource);
}, },
setContainerData(result) { //
//1. getTransactionList(packingNumbers, callback) {
this.getBalance(result, resList => { let params = {
filters: [{
}); column: "businessType",
},
getBalance(result, callback) {
let packageInfo = result.package;
let filters = [{
column: "itemCode",
action: "==", action: "==",
value: packageInfo.itemCode value: "发料"
}, { }, {
column: "batch",
action: "==",
value: packageInfo.batch
}];
if (this.businessType.outInventoryStatuses != null) {
filters.push({
column: "inventoryStatus",
action: "in",
value: this.businessType.outInventoryStatuses
})
}
if (this.businessType.outAreaTypes != null) {
filters.push({
column: "areaType",
action: "in",
value: this.businessType.outAreaTypes
})
}
let packingNumber = packageInfo.number;
packageInfo.subList.forEach(sub => {
packingNumber = packingNumber + ',' + sub.number
})
packingNumber = packingNumber.trimEnd(',');
filters.push({
column: "packingNumber", column: "packingNumber",
action: "in", action: "in",
value: packingNumber value: packingNumbers
}) }, {
var params = { column: "inventoryAction",
filters: filters, action: "==",
value: "OUT"
}],
pageSize: 20,
pageNo: 1, pageNo: 1,
pageSize: 100, sort: "",
by: "ASC"
} }
getBalanceByFilter(params).then(res => {
if (res.data.list.length > 0) {
res.data.list.forEach(r => {
// if (packageInfo.parentNumber !== null) {
// r.parentPackingNumber = packageInfo.parentNumber
// } else {
// r.parentPackingNumber = packageInfo.number
// }
})
callback(res.data.list)
} else {
} getTransactionByFilter(params).then(res => {
callback(res.data.list);
}).catch(err => { }).catch(err => {
this.showErrorMessage(err.message); callback([]);
}) })
}, },
createPackageDetail(balance, pack) {
let newDetail = {};
if (balance.packingNumber != pack.number) {
newDetail = createDetailByPackInfo(pack);
newDetail.inventoryStatus = balance.inventoryStatus;
} else {
newDetail = createDetailInfo(balance, pack);
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
}
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
return newDetail;
},
showErrorMessage(message) { showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => { this.$refs.comMessage.showErrorMessage(message, res => {
if (res) { if (res) {
@ -432,12 +460,18 @@
this.updateData(); this.updateData();
}, },
// openScanPopup() {
// if (this.businessType) {
// this.$refs.scanPopup.openScanPopup(this.businessType);
// } else {
// this.getBusinessType()
// }
// },
openScanPopup() { openScanPopup() {
if (this.businessType) { setTimeout(r => {
this.$refs.scanPopup.openScanPopup(this.businessType); this.$refs.scanPopup.openScanPopupByBusinessType(this.businessType);
} else { })
this.getBusinessType()
}
}, },
showFromLocationPopup() { showFromLocationPopup() {

3
src/pages/login/index.vue

@ -158,6 +158,7 @@
}, },
onLoad() { onLoad() {
if(this.needCode){
getCaptchaImage().then(res => { getCaptchaImage().then(res => {
if (res) { if (res) {
var code = res.data.img; var code = res.data.img;
@ -169,6 +170,8 @@
}).catch(error => { }).catch(error => {
this.showErrorMessage(error); this.showErrorMessage(error);
}) })
}
this.getAppVersion() this.getAppVersion()
}, },
methods: { methods: {

21
src/pages/productPutaway/record/productPutawayRecord.vue

@ -10,6 +10,7 @@
<view class=""> <view class="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent" <record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowStatus="true" :isShowToLocation='false' @removeItem="removeItem(index,item)" :isShowStatus="true" :isShowToLocation='false' @removeItem="removeItem(index,item)"
:isShowModifedLocation="true"
@updateData="updateData" @removePack="removePack" @editLocation="showScanToLocation"> @updateData="updateData" @removePack="removePack" @editLocation="showScanToLocation">
</record-com-detail-card> </record-com-detail-card>
</view> </view>
@ -147,6 +148,7 @@
getScanResult(result) { getScanResult(result) {
let label = result.label; let label = result.label;
let pack = result.package; let pack = result.package;
let errorHint=""
result.balance.forEach( result.balance.forEach(
balance => { balance => {
let item = this.detailSource.find(res => { let item = this.detailSource.find(res => {
@ -180,14 +182,19 @@
item.subList.push(newDetail); item.subList.push(newDetail);
} else { } else {
if (detail.scaned == true) { if (detail.scaned == true) {
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + errorHint+="箱码[" + balance.packingNumber + "批次[" + balance.batch +
"]重复扫描") "]重复扫描\n"
} }
} }
} }
this.calcHandleQty(); this.calcHandleQty();
} }
) )
if(errorHint){
this.showErrorMessage(errorHint)
}else {
this.scanPopupGetFocus()
}
}, },
getRecommendLocation(balance) { getRecommendLocation(balance) {
@ -251,9 +258,6 @@
this.$forceUpdate(); this.$forceUpdate();
}, },
updateData() {
this.calcHandleQty();
},
removeItem(index, item) { removeItem(index, item) {
this.removeRecommendLocation([item.expectinNumber]); this.removeRecommendLocation([item.expectinNumber]);
this.detailSource.splice(index, 1) this.detailSource.splice(index, 1)
@ -423,13 +427,6 @@
if (res) {} if (res) {}
}); });
}, },
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
}
});
},
showScanMessage(message) { showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message); this.$refs.comMessage.showScanMessage(message);

7
src/pages/productReceipt/job/fgProductReceiptDetail.vue

@ -232,6 +232,13 @@
that.jobStatus = res.data.status that.jobStatus = res.data.status
that.jobToLocationCode = that.subList[0].toLocationCode that.jobToLocationCode = that.subList[0].toLocationCode
that.productionLineCode = that.subList[0].productionLineCode; that.productionLineCode = that.subList[0].productionLineCode;
var valiDate = getSwitchInfoByCode("fgProductReceipCommitValidate")
if(valiDate){
that.jobContent.allowModifyLocation = 'TRUE'
}else{
that.jobContent.allowModifyLocation = 'FALSE'
}
// if (that.jobContent.allowModifyLocation == 'FALSE') { // if (that.jobContent.allowModifyLocation == 'FALSE') {
// that.toLocationCode = that.subList[0].toLocationCode // that.toLocationCode = that.subList[0].toLocationCode
// } // }

11
src/pages/productReceipt/job/productReceiptDetail.vue

@ -227,10 +227,15 @@
that.jobStatus = res.data.status; that.jobStatus = res.data.status;
that.jobToLocationCode = that.subList[0].toLocationCode; that.jobToLocationCode = that.subList[0].toLocationCode;
that.productionLineCode = that.jobContent.subList[0].productionLineCode; that.productionLineCode = that.jobContent.subList[0].productionLineCode;
var valiDate = getSwitchInfoByCode("semiProductReceipCommitValidate")
if (that.jobContent.allowModifyLocation == 'FALSE') { if(valiDate){
that.toLocationCode = that.subList[0].toLocationCode that.jobContent.allowModifyLocation = 'TRUE'
}else{
that.jobContent.allowModifyLocation = 'FALSE'
} }
// if (that.jobContent.allowModifyLocation == 'FALSE') {
// that.toLocationCode = that.subList[0].toLocationCode
// }
that.toLocationAreaTypeList = getDirectoryItemArray(that.jobContent.toAreaTypes) that.toLocationAreaTypeList = getDirectoryItemArray(that.jobContent.toAreaTypes)
that.detailSource = getDataSource(that.subList) that.detailSource = getDataSource(that.subList)
if (that.scanMessage) { if (that.scanMessage) {

2
src/pages/productionReceipt/job/productionReceiptDetail.vue

@ -34,7 +34,7 @@
:locationAreaTypeList="toLocationAreaTypeList"></locationCompare> :locationAreaTypeList="toLocationAreaTypeList"></locationCompare>
</view> </view>
<view class=" uni-flex uni-row"> <view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> <button class="btn_single_commit" hover-class="btn_commit_after" @click="autoCommit">提交</button>
</view> </view>
</view> </view>
</view> </view>

11
src/pages/productionReceipt/job/productionReceiptJob.vue

@ -460,6 +460,17 @@
}else{ }else{
this.filterItemCode = '' this.filterItemCode = ''
} }
if (params.status) {
this.status = params.status
}else{
this.status = "1,2"
}
if(params.creationTime==""){
this.checkedToday = false;
}
this.todayTime = params.creationTime
this.getList('refresh', this.productionLine, this.filterItemCode) this.getList('refresh', this.productionLine, this.filterItemCode)
}, },

87
src/pages/putaway/record/putawayRecord.vue

@ -5,10 +5,11 @@
</view> </view>
<view class="page-wraper" v-if="detailSource.length>0"> <view class="page-wraper" v-if="detailSource.length>0">
<view class="page-header"> <view class="page-header">
<view class="header-view">
<view class="header_item"> <view class="header_item">
来源库位 : {{fromLocationCode}} 来源库位 : {{fromLocationCode}}
</view> </view>
<u-line /> </view>
</view> </view>
<view class="page-main"> <view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
@ -16,7 +17,10 @@
<view class=""> <view class="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent" <record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowFromLocation="false" @removeItem="removeItem(index,item)" :isShowFromLocation="false" @removeItem="removeItem(index,item)"
@updateData="updateData" @removePack="removePack"> :isShowModifedLocation="true"
@updateData="updateData"
@editLocation="showScanToLocation"
@removePack="removePack">
</record-com-detail-card> </record-com-detail-card>
</view> </view>
@ -43,14 +47,17 @@
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation' <win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation'
:locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location> :locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location>
<win-scan-location ref="scanToLocationCode" title="目标库位" @getLocation='getToLocationCode'
:locationAreaTypeList="toLocationAreaTypeList"></win-scan-location>
</view> </view>
</template> </template>
<script> <script>
import { import {
putawayRecordSubmit, putawayRecordSubmit,
validateItemAndLocation, getPutawayRecommendLocation,
getPutawayRecommendLocation checkItemCodeAndLocation,
recommendLocationRemoveExpectin
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
@ -116,7 +123,8 @@
showToLoaction: true, showToLoaction: true,
recommendLocationList: [], // recommendLocationList: [], //
fromWarehouseCode: '', // fromWarehouseCode: '', //
businessTypeCode: "PurchasePutaway" businessTypeCode: "PurchasePutaway",
editItem:{}
}; };
}, },
onLoad(option) { onLoad(option) {
@ -168,6 +176,7 @@
// //
this.getRecommendLocation(balance, pack, toLocation => { this.getRecommendLocation(balance, pack, toLocation => {
var itemp = createItemInfo(balance, pack); var itemp = createItemInfo(balance, pack);
itemp.toLocationCode = toLocation.locationCode;
let newDetail = createDetailInfo(balance, pack); // let newDetail = createDetailInfo(balance, pack); //
newDetail.toLocationCode = toLocation.locationCode; newDetail.toLocationCode = toLocation.locationCode;
newDetail.toWarehouseCode = toLocation.toWarehouseCode; newDetail.toWarehouseCode = toLocation.toWarehouseCode;
@ -445,6 +454,7 @@
this.openScanPopup(); this.openScanPopup();
}, },
getToLocationCode(location, code) { getToLocationCode(location, code) {
console.log( JSON.stringify(this.editItem) )
if (this.fromLocationCode == code) { if (this.fromLocationCode == code) {
uni.showToast({ uni.showToast({
title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致", title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致",
@ -452,7 +462,60 @@
}) })
return return
} }
this.toLocationCode = code; var item = this.editItem.subList[0]
if(item){
var param ={
batch:item.batch,
inventoryStatus:item.inventoryStatus,
itemCode:item.itemCode,
toLocationCode:code,
expectinNumber: item.packingNumber + "-" + Date.now(),
}
checkItemCodeAndLocation(param).then(res=>{
if(res.data.recommendFlag){
this.editItem.toLocationCode = code;
}else {
if(res.data.errorMsg){
this.showErrorMessage("系统异常:"+res.data.errorMsg)
}else {
if(res.data.balanceMsg){
this.$refs.comMessage.showQuestionMessage("系统异常:"+res.data.balanceMsg, confirmRes => {
if (confirmRes) {
this.editItem.toLocationCode = code;
}else {
this.removeRecommendLocation(res.data.expectinNumberList)
}
});
}else {
this.editItem.toLocationCode = code;
}
}
}
}).catch(error=>{
this.showErrorMessage(error)
})
}
},
//
removeRecommendLocation(lst) {
let param = {
expectinNumberList: lst,
};
recommendLocationRemoveExpectin(param).then(res => {
}).catch(err => {
this.showErrorMessage('【' + lst.join(',') + '】移除预占用失败,请在PC端的预占用中移除')
})
},
showScanToLocation(item) {
this.editItem = item;
setTimeout(r => {
this.$refs.scanToLocationCode.openScanPopup();
})
}, },
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
@ -461,12 +524,24 @@
}) })
}, },
showQuestionMessage(hint) {
this.$refs.comMessage.showQuestionMessage('已经有库存余额,是否继续上架?', res => {
if (res) {
}else {
}
});
},
clear() { clear() {
this.fromLocationInfo = {}; this.fromLocationInfo = {};
this.fromLocationCode = ''; this.fromLocationCode = '';
this.fromWarehouseCode = ''; this.fromWarehouseCode = '';
this.toWarehouseCode = ''; this.toWarehouseCode = '';
this.detailSource = []; this.detailSource = [];
this.editItem ={}
} }
} }
} }

21
src/pages/repleinsh/coms/comScanReplishPack.vue

@ -417,7 +417,9 @@
}, },
selectBalanceItem(balance) { selectBalanceItem(balance) {
if(balance){
this.afterGetBalance(this.label, balance, this.packageInfo); this.afterGetBalance(this.label, balance, this.packageInfo);
}
}, },
afterGetBalance(label, balance, packageInfo) { afterGetBalance(label, balance, packageInfo) {
@ -431,7 +433,7 @@
that.fromLocationCode = balance.locationCode; that.fromLocationCode = balance.locationCode;
let fromLocation = item.Locations.find(l => l.fromLocationCode == that.fromLocationCode); let fromLocation = item.Locations.find(l => l.fromLocationCode == that.fromLocationCode);
// //
if (fromLocation != undefined) { if (fromLocation && !fromLocation.isNewAdd) {
let batch = fromLocation.Batchs.find(r => r.batch == lot); let batch = fromLocation.Batchs.find(r => r.batch == lot);
if (batch != undefined) { if (batch != undefined) {
if (batch.Records == undefined) { if (batch.Records == undefined) {
@ -487,8 +489,24 @@
} }
} }
} else { } else {
if (this.jobContent.allowModifyLocation == "TRUE") {
this.showQuestionMessage("扫描物料[" + itemCode + "]的库位【" + that.fromLocationCode +
"】与推荐的库位不一致,是否要继续发料?", res => {
if (res) {
let locaion = that.createLocationInfo(label, balance, packageInfo); let locaion = that.createLocationInfo(label, balance, packageInfo);
item.Locations.push(locaion); item.Locations.push(locaion);
this.getfocus();
that.$emit("afterScan");
}
})
} else {
this.showErrorMessage("扫描物料[" + itemCode + "]的库位【" + that.fromLocationCode +
"】与推荐的库位不一致,不允许继续发料?")
}
} }
} catch (e) { } catch (e) {
this.showErrorMessage(e.stack, this.showErrorMessage(e.stack,
@ -506,6 +524,7 @@
qty: balance.qty, qty: balance.qty,
uom: balance.uom, uom: balance.uom,
handleQty: 0, handleQty: 0,
isNewAdd: true,
Batchs: [] Batchs: []
} }
let batch = this.createBatchInfo(label, balance, packageInfo); let batch = this.createBatchInfo(label, balance, packageInfo);

59
src/pages/repleinsh/job/repleinshDetail.vue

@ -30,7 +30,7 @@
:locationAreaTypeList="toLocationAreaTypeList"></requiredLocation> :locationAreaTypeList="toLocationAreaTypeList"></requiredLocation>
</view> </view>
<view class=" uni-flex uni-row"> <view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="submit">提交</button> <button class="btn_single_commit" hover-class="btn_commit_after" @click="clickSubmit">提交</button>
</view> </view>
</view> </view>
</view> </view>
@ -225,6 +225,58 @@
}); });
}, },
clickSubmit(){
let str=""
var totalQty =0;
var taskQty =0;
this.detailSource.forEach(detail => {
detail.Items.forEach(item => {
taskQty =calc.add(taskQty,item.qty)
item.Locations.forEach(lco => {
lco.Batchs.forEach(batch => {
batch.Records.forEach(record => {
if (batch.qty != record.qty) {
var tempHandleQty = 0
if (record.qty) {
tempHandleQty = record.qty
} else {
tempHandleQty = 0
}
if (batch.qty != 0) {
str +=
`包装号【${record.packingNumber}】提交数量【${tempHandleQty}】与任务物料数量【${batch.qty}】不一致\n`
}
}
if(record){
var hanleQty =record.qty?record.qty:0
totalQty = calc.add(totalQty,hanleQty)
}
})
})
})
})
})
if(str){
str = '任务明细未全部完成,是否提交?\n' + str
}
if(totalQty!=taskQty){
str ="扫描数量["+totalQty+"]与任务数量不一致["+taskQty+"],是否提交"
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
if (res) {
//
this.$throttle(this.submitJob, 2000, this)()
} else {
this.scanPopupGetFocus()
}
});
}else {
//
this.$throttle(this.submitJob, 2000, this)()
}
},
submit() { submit() {
var scanCount = this.getScanCount(this.subList); var scanCount = this.getScanCount(this.subList);
@ -277,6 +329,11 @@
mask: true mask: true
}); });
var params = this.setParams() var params = this.setParams()
if (!params.subList || params.subList.length == 0) {
uni.hideLoading()
this.showErrorMessage("请扫描您需要提交的补料任务")
return
}
console.log("提交参数", JSON.stringify(params)); console.log("提交参数", JSON.stringify(params));
repleinshJobSubmit(params).then(res => { repleinshJobSubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()

64
src/pages/repleinsh/job/repleinshJob.vue

@ -281,29 +281,37 @@
title: "加载中­....", title: "加载中­....",
mask: true mask: true
}); });
var filters = [] // var filters = []
if (this.checkedToday) { // if (this.checkedToday) {
filters.push({ // filters.push({
column: "create_time", // column: "create_time",
action: "betweeen", // action: "betweeen",
value: this.todayTime // value: this.todayTime
}) // })
} // }
filters.push({ // filters.push({
column: "status", // column: "status",
action: "in", // action: "in",
value: this.status // value: this.status
}) // })
if (params.status) {
this.status = params.status
}else{
this.status = "1,2"
}
if(params.creationTime==""){
this.checkedToday = false;
}
if (params.fromLocationCode) { if (params.fromLocationCode) {
// //
this.fromLocationCode = params.fromLocationCode this.fromLocationCode = params.fromLocationCode
filters.push({ // filters.push({
column: "fromLocationCode", // column: "fromLocationCode",
action: "==", // action: "==",
value: params.fromLocationCode // value: params.fromLocationCode
}) // })
}else{ }else{
this.fromLocationCode = '' this.fromLocationCode = ''
} }
@ -311,19 +319,19 @@
if (params.itemCode) { if (params.itemCode) {
// //
this.filterItemCode = params.itemCode this.filterItemCode = params.itemCode
filters.push({ // filters.push({
column: "itemCode", // column: "itemCode",
action: "like", // action: "like",
value: params.itemCode // value: params.itemCode
}) // })
}else{ }else{
this.filterItemCode = '' this.filterItemCode = ''
} }
var params = { // var params = {
filters: filters, // filters: filters,
pageNo: 1, // pageNo: 1,
pageSize: 100, // pageSize: 100,
} // }
this.getList('refresh', this.fromLocationCode, this.filterItemCode) this.getList('refresh', this.fromLocationCode, this.filterItemCode)
// getRepleinshJobList(params).then(res => { // getRepleinshJobList(params).then(res => {

63
src/pages/repleinsh/record/directRepleinshRecord.vue

@ -44,6 +44,7 @@
</view> </view>
<winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode"> <winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode">
</winComScanBalance> </winComScanBalance>
<balanceQuery ref="refBalanceQuery" :businessTypeCode="businessTypeCode"></balanceQuery>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
</template> </template>
@ -94,6 +95,7 @@
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue' import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
import balanceQuery from '@/mycomponents/query/balanceQuery.vue'
export default { export default {
components: { components: {
@ -104,7 +106,8 @@
winScanLocation, winScanLocation,
winScanPackAndLocation, winScanPackAndLocation,
recordComDetailCard, recordComDetailCard,
winComScanBalance winComScanBalance,
balanceQuery
}, },
data() { data() {
return { return {
@ -137,6 +140,9 @@
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
if (e.index === 0) { if (e.index === 0) {
goHome(); goHome();
} else if (e.index == 1) {
this.$refs.refBalanceQuery.showDrawer();
this.closeScanPopup();
} }
}, },
// //
@ -261,6 +267,22 @@
} }
}) })
if (detail == undefined) { if (detail == undefined) {
//
//
//,
if (pack.parentNumber) {
var checkData = item.subList.find(r => {
if (r.packingNumber == pack.parentNumber &&
r.batch == balance.batch) {
return r;
}
})
if (checkData) {
//
this.showErrorMessage("箱码[" + pack.number + "]批次[" + balance.batch +
"]的父包装已经扫描")
console.log("父包装已经扫描")
} else {
let newDetail = createDetailInfo(balance, pack); let newDetail = createDetailInfo(balance, pack);
newDetail.parentNumber = pack.parentNumber; newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number newDetail.packingNumber = pack.number
@ -270,6 +292,45 @@
newDetail.handleQty = balance.lableQty newDetail.handleQty = balance.lableQty
} }
item.subList.push(newDetail); item.subList.push(newDetail);
}
} else {
//
var checkData = item.subList.find(r => {
if (r.parentNumber == pack.number &&
r.batch == balance.batch) {
return r;
}
})
if (checkData) {
//
this.$refs.comMessage.showQuestionMessage("扫描箱码[" + checkData.parentNumber+"]" + "批次[" + balance
.batch + "]是父包装,是否移除子包装", res => {
if (res) {
item.subList = [];
let newDetail = createDetailInfo(balance, pack);
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
item.subList.push(newDetail);
}
})
console.log("扫描的是父包装,是否移除子包装")
} else {
let newDetail = createDetailInfo(balance, pack);
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
item.subList.push(newDetail);
}
}
this.scanPopupGetFocus() this.scanPopupGetFocus()
} else { } else {
if (detail.scaned == true) { if (detail.scaned == true) {

Loading…
Cancel
Save