Browse Source

修改发料任务的扫描

hella_online_20240829
niexiting 2 months ago
parent
commit
b47b4dc384
  1. 7
      .env.development
  2. 1
      src/mycomponents/scan/winComScanBalance.vue
  3. 237
      src/pages/issue/coms/comScanIssuePack.vue
  4. 5
      src/pages/issue/job/issueDetail.vue
  5. 50
      src/pages/issue/job/issueJob.vue
  6. 3
      src/pages/repleinsh/job/repleinshJob.vue

7
.env.development

@ -1,12 +1,11 @@
VITE_BASE_URL=http://172.21.47.239:12080/admin-api VITE_BASE_URL=http://172.21.47.239:12080/admin-api
VITE_BASE_URL_IMAGE=http://172.22.32.8:81/admin-api VITE_BASE_URL_IMAGE=http://172.21.32.13:81/admin-api
# 租户配置 # 租户配置
VITE_TENANT='[{"text":"成都1397","value":2},{"text":"长春2379","value":3}]' VITE_TENANT='[{"text":"长春1379","value":1}]'
# 是否是测试环境 # 是否是测试环境
VITE_isDevelopment=false VITE_isDevelopment=false
# 积木报表请求路径 # 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://172.22.32.8:90' VITE_JMREPORT_BASE_URL='http://172.21.32.13:90'

1
src/mycomponents/scan/winComScanBalance.vue

@ -170,6 +170,7 @@
this.showErrorMessage(error) this.showErrorMessage(error)
}) })
}, },
getItemCodeType(itemCode, callBack) { getItemCodeType(itemCode, callBack) {
uni.showLoading({ uni.showLoading({
title: "加载中", title: "加载中",

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

@ -45,8 +45,9 @@
来源库位 来源库位
</view> </view>
<view class="" style="width: 75%; padding: 8rpx;"> <view class="" style="width: 75%; padding: 8rpx;">
<uni-combox class="my-combox" :candidates="fromLocationList" v-model="fromLocationCode" placeholder="请选择库位" <uni-combox class="my-combox" :candidates="fromLocationList" v-model="fromLocationCode"
@confirm="fromLocationUpdate" :inputStyle="inputStyleObject"></uni-combox> placeholder="请选择库位" @confirm="fromLocationUpdate"
:inputStyle="inputStyleObject"></uni-combox>
</view> </view>
</view> </view>
@ -114,7 +115,8 @@
} from '@/common/array.js'; } from '@/common/array.js';
import { import {
getWorkShopLineStation, getWorkShopLineStation,
getBalanceByFilter getBalanceByFilter,
getBalanceByParams,
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
uniqueArray uniqueArray
@ -131,7 +133,9 @@
import { import {
getBalanceByManagementPrecision getBalanceByManagementPrecision
} from '@/common/balance.js'; } from '@/common/balance.js';
import { getDirectoryItemArray } from '../../../common/directory.js'; import {
getDirectoryItemArray
} from '../../../common/directory.js';
export default { export default {
name: 'winScanPack', name: 'winScanPack',
@ -172,7 +176,8 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
label: {}, label: {},
inputStyleObject: { inputStyleObject: {
fontSize: "100rpx" fontSize: "100rpx"
} },
bussinessCode: 'Issue'
} }
}, },
created() { created() {
@ -282,111 +287,89 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
) )
return; return;
} else { } else {
// this.queryBalance(result);
uni.showLoading({
title: '加载中',
mask: true
})
this.getBalance(result.label, packageInfo, balances => {
this.packageInfo =packageInfo;
//
let s = '';
if (!result.package.parentNumber) {
if (balances.list.length == 0) {
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描')
} else {
let newBalances = balances.list.filter(b => b.locationCode == that
.fromLocationCode);
if (newBalances.length == 0) {
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描')
} else if (newBalances.length == 1) {
let balance = newBalances[0];
this.afterGetBalance(result.label, balance, packageInfo);
} else {
this.showBalanceSelect(newBalances);
}
}
} else {
//
if (balances.list.length == 0) {
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描')
} else {
//
let subPackitems = balances.list.filter(r => r.packingNumber == packageInfo
.number)
//
let subParentPackitems = balances.list.filter(r => r.packingNumber ==
packageInfo
.parentNumber&&r.locationCode==this.fromLocationCode)
//
if (subPackitems.length == 0) {
//
if (subParentPackitems.length > 0) {
if(subParentPackitems.length==1){
let balance = subParentPackitems[0];
balance.qty=packageInfo.qty;
this.afterGetBalance(result.label, balance, packageInfo);
}else {
this.showBalanceSelect(subParentPackitems);
}
} else { // this.getBalance(result.label, packageInfo, balances => {
this.showErrorMessage('按外包装【' + packageInfo.parentNumber + '】和子包装【' + // this.packageInfo = packageInfo;
packageInfo.number + '】都未查找到库存余额') // //
} // let s = '';
} else { // if (!result.package.parentNumber) {
var locationCode = this.fromLocationCode // if (balances.list.length == 0) {
if(balances.list==1){ // this.showErrorMessage(',')
locationCode=balances.list[0].locationCode
}else {
var manyBlances = balances.list.filter(r=>r.locationCode!=this.fromLocationCode)
if(manyBlances.length>0){
locationCode = manyBlances[0].locationCode;
}
}
this.showErrorMessage('该包装【' + packageInfo.number + '】在库位【' +
locationCode +
'】已经有库存余额,请重新扫描')
}
// //
// if (subitems.length == 0 && subParentPackitems.length > 0) {
// this.afterGetBalance(result.label, null, packageInfo);
// } else if (subitems.length > 0 && subParentPackitems.length == 0) {
// //
// this.showErrorMessage('' + balances.list[0].locationCode +
// ',')
// } else { // } else {
// let newBalances = balances.list.filter(b => b.locationCode == that
// .fromLocationCode);
// if (newBalances.length == 0) {
// this.showErrorMessage(',')
// } else if (newBalances.length == 1) {
// let balance = newBalances[0];
// this.afterGetBalance(result.label, balance, packageInfo);
// } else {
// this.showBalanceSelect(newBalances);
// } // }
// }
} // } else {
} // //
uni.hideLoading(); // if (balances.list.length == 0) {
}); // this.showErrorMessage(',')
// } else {
// //
// getBalanceByManagementPrecision(result.label, that.fromLocationCode, that.fromInventoryStatuses, // let subPackitems = balances.list.filter(r => r.packingNumber == packageInfo
// balanceRes => { // .number)
// if (balanceRes.success) { // //
// let s = ''; // let subParentPackitems = balances.list.filter(r => r.packingNumber ==
// if (balanceRes.data.list.length == 0) { // packageInfo
// this.afterGetBalance(result.label, null, packageInfo); // .parentNumber && r.locationCode == this.fromLocationCode)
// } else if (balanceRes.data.list.length == 1) {
// let balance = balanceRes.data.list[0];
// //
// if (subPackitems.length == 0) {
// //
// if (subParentPackitems.length > 0) {
// if (subParentPackitems.length == 1) {
// let balance = subParentPackitems[0];
// balance.qty = packageInfo.qty;
// this.afterGetBalance(result.label, balance, packageInfo); // this.afterGetBalance(result.label, balance, packageInfo);
// } else { // } else {
// this.showBalanceSelect(balanceRes.data.list); // this.showBalanceSelect(subParentPackitems);
// } // }
// } else {
// this.showErrorMessage('' + packageInfo.parentNumber + '' +
// packageInfo.number + '')
// }
// } else {
// var locationCode = this.fromLocationCode
// if (balances.list == 1) {
// locationCode = balances.list[0].locationCode
// } else { // } else {
// this.showErrorMessage(balanceRes.message.message); // var manyBlances = balances.list.filter(r => r.locationCode != this
// .fromLocationCode)
// if (manyBlances.length > 0) {
// locationCode = manyBlances[0].locationCode;
// }
// }
// this.showErrorMessage('' + packageInfo.number + '' +
// locationCode +
// ',')
// // var locationCode = this.fromLocationCode
// // if(balances.list==1){
// // locationCode=balances.list[0].locationCode
// // }else {
// // var manyBlances = balances.list.filter(r=>r.locationCode!=this.fromLocationCode)
// // if(manyBlances.length>0){
// // locationCode = manyBlances[0].locationCode;
// // }
// // }
// // this.showErrorMessage('' + packageInfo.number + '' +
// // locationCode +
// // ',')
// }
// }
// } // }
// uni.hideLoading(); // uni.hideLoading();
// }); // });
@ -397,6 +380,53 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
} }
}, },
queryBalance(result) {
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 + "] <br>" +
"包装号 [" + params.packingNumber + "] <br>" +
"批次 [" + params.batch + "] <br>" +
"状态 [" + status + "] <br>" +
"库区 [" + areaType + "] <br>" +
"未查找到库存余额"
this.showErrorMessage(hint)
} else if (res.data.length == 1) {
result.balance = res.data[0]
if (result.label.packingNumber != result.balance.packingNumber) {
result.balance.lableQty = result.label.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)
})
},
getBalance(label, packageInfo, callback) { getBalance(label, packageInfo, callback) {
var filters = [] var filters = []
@ -789,6 +819,7 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
max-height: 300rpx; max-height: 300rpx;
padding: 10rpx; padding: 10rpx;
} }
.my-combox { .my-combox {
font-size: 50px; font-size: 50px;
} }

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

@ -40,6 +40,7 @@
<com-scan-issue-pack ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData' <com-scan-issue-pack ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'
@afterScan='afterScan'> @afterScan='afterScan'>
</com-scan-issue-pack> </com-scan-issue-pack>
<balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
</template> </template>
@ -80,6 +81,7 @@
import comScanIssuePack from '@/pages/issue/coms/comScanIssuePack.vue' import comScanIssuePack from '@/pages/issue/coms/comScanIssuePack.vue'
import jobTop from '@/mycomponents/job/jobTop.vue' import jobTop from '@/mycomponents/job/jobTop.vue'
import workStation from '@/mycomponents/workStation/workStation.vue' import workStation from '@/mycomponents/workStation/workStation.vue'
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
export default { export default {
name: 'issueDetail', name: 'issueDetail',
@ -89,7 +91,8 @@
comIssueDetailCard, comIssueDetailCard,
comScanIssuePack, comScanIssuePack,
jobTop, jobTop,
workStation workStation,
balanceSelect
}, },
data() { data() {
return { return {

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

@ -25,7 +25,9 @@
<uni-load-more :status="loadingType" v-if="jobList.length>0" /> <uni-load-more :status="loadingType" v-if="jobList.length>0" />
</view> </view>
<win-scan-button @goScan='openScanPopup' v-if="jobList.length>0"></win-scan-button> <win-scan-button @goScan='openScanPopup' v-if="jobList.length>0"></win-scan-button>
<winScanPackJob ref="scanPopup" @getResult='getScanResult'></winScanPackJob> <winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode">
</winComScanBalance>
<!-- <winScanPackJob ref="scanPopup" @getResult='getScanResult'></winScanPackJob> -->
<jobList ref="jobList" @selectItem="selectItem"></jobList> <jobList ref="jobList" @selectItem="selectItem"></jobList>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
@ -43,6 +45,10 @@
updateTitle updateTitle
} from '@/common/basic.js'; } from '@/common/basic.js';
import {
getBusinessType
} from '@/common/record.js';
import { import {
getDetailOption, getDetailOption,
getDetailGiveupOption, getDetailGiveupOption,
@ -57,6 +63,7 @@
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue" import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue"
import jobList from '@/mycomponents/jobList/jobList.vue' import jobList from '@/mycomponents/jobList/jobList.vue'
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
export default { export default {
name: 'issue', name: 'issue',
@ -68,7 +75,8 @@
jobInfoPopup, jobInfoPopup,
winScanPackJob, winScanPackJob,
winScanButton, winScanButton,
jobList jobList,
winComScanBalance
}, },
data() { data() {
return { return {
@ -87,7 +95,9 @@
detailCloseOptions: [], detailCloseOptions: [],
title: '', title: '',
productionLine: "", productionLine: "",
fromLocation:"" fromLocation: "",
businessTypeCode: "Issue",
businessType: null,
}; };
}, },
onLoad(option) { onLoad(option) {
@ -136,6 +146,19 @@
}, },
methods: { methods: {
getBusinessTypeFunc() {
getBusinessType(this.businessTypeCode, res => {
if (res.success) {
this.businessType = res.businessType;
this.fromInventoryStatuses = res.fromInventoryStatuses.split(',');
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList
// this.openScanPopup();
} else {
this.showErrorMessage(res.message)
}
});
},
getIssueJobByProductionline() { getIssueJobByProductionline() {
getIssueJobByProductionline().then(res => { getIssueJobByProductionline().then(res => {
if (res.code == 0) { if (res.code == 0) {
@ -274,7 +297,8 @@
openJobDetail(item, scanMessage = '') { openJobDetail(item, scanMessage = '') {
uni.navigateTo({ uni.navigateTo({
url: './issueDetail?id=' + item.masterId + '&status=' + item.status + '&scanMessage=' + scanMessage +'&title='+this.title url: './issueDetail?id=' + item.masterId + '&status=' + item.status + '&scanMessage=' +
scanMessage + '&title=' + this.title
}); });
}, },
@ -418,9 +442,19 @@
}); });
}, },
openScanPopup() { openScanPopup() {
this.$refs.scanPopup.openScanPopup(); if (this.businessType == null) {
this.getBusinessTypeFunc()
} else {
this.$refs.scanPopup.openScanPopup(this.businessType);
}
}, },
// openScanPopup() {
// this.$refs.scanPopup.openScanPopup();
// },
getScanResult(result) { getScanResult(result) {
let balance = result.balance;
if (balance != null) {
this.scanMessage = ""
if (!result.label.batch) { if (!result.label.batch) {
this.showMessage("批次为空") this.showMessage("批次为空")
return; return;
@ -444,6 +478,11 @@
column: "itemCode", column: "itemCode",
action: "==", action: "==",
value: result.label.itemCode value: result.label.itemCode
},
{
column: "fromLocationCode",
action: "==",
value: balance.locationCode
} }
] ]
getIssueJobList({ getIssueJobList({
@ -480,6 +519,7 @@
} catch (e) { } catch (e) {
this.showMessage(e.message) this.showMessage(e.message)
} }
}
}, },
} }
} }

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

@ -146,7 +146,7 @@
getBusinessType(this.businessTypeCode, res => { getBusinessType(this.businessTypeCode, res => {
if (res.success) { if (res.success) {
this.businessType = res.businessType; this.businessType = res.businessType;
this.fromInventoryStatuses = getDirectoryItemArray(res.fromInventoryStatuses); this.fromInventoryStatuses =res.fromInventoryStatuses.split(',');
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList this.fromLocationAreaTypeList = res.fromLocationAreaTypeList
// this.openScanPopup(); // this.openScanPopup();
} else { } else {
@ -382,7 +382,6 @@
} else { } else {
this.$refs.scanPopup.openScanPopup(this.businessType); this.$refs.scanPopup.openScanPopup(this.businessType);
} }
}, },
selectItem(item) { selectItem(item) {
this.$refs.scanPopup.closeScanPopup(); this.$refs.scanPopup.closeScanPopup();

Loading…
Cancel
Save