Browse Source

修改发料任务的扫描

hella_online_20240829
niexiting 2 months ago
parent
commit
b47b4dc384
  1. 7
      .env.development
  2. 1
      src/mycomponents/scan/winComScanBalance.vue
  3. 297
      src/pages/issue/coms/comScanIssuePack.vue
  4. 5
      src/pages/issue/job/issueDetail.vue
  5. 236
      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: "加载中",

297
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>
@ -95,8 +96,8 @@
<balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select> <balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
<balance-qty-edit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="true"></balance-qty-edit> <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" <!-- <win-com-scan v-show="false" ref="comscansimulate" placeholder="箱标签" @getResult="onScan" :clearResult="true"
headerType="HPQ,HMQ" :isShowHistory="false"> headerType="HPQ,HMQ" :isShowHistory="false">
</win-com-scan> --> </win-com-scan> -->
</view> </view>
@ -114,12 +115,13 @@
} 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
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
getLabelInfo getLabelInfo
} from '@/common/label.js'; } from '@/common/label.js';
@ -131,11 +133,13 @@
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',
emits: ["afterScan","closeScan"], emits: ["afterScan", "closeScan"],
components: { components: {
winComScan, winComScan,
balance, balance,
@ -170,9 +174,10 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
fromInventoryStatuses: "", fromInventoryStatuses: "",
packageInfo: {}, packageInfo: {},
label: {}, label: {},
inputStyleObject:{ inputStyleObject: {
fontSize: "100rpx" fontSize: "100rpx"
} },
bussinessCode: 'Issue'
} }
}, },
created() { created() {
@ -184,7 +189,7 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
this.scanOptions = getDetailEditRemoveOption(); this.scanOptions = getDetailEditRemoveOption();
}, },
methods: { methods: {
openScanPopupForJobSimulate(content, jobcontent,scanMessage) { openScanPopupForJobSimulate(content, jobcontent, scanMessage) {
this.issueRecord = []; this.issueRecord = [];
this.dataContent = content; this.dataContent = content;
this.jobContent = jobcontent; this.jobContent = jobcontent;
@ -195,11 +200,11 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
} else { } else {
this.showErrorMessage(callback.message, res => {}) this.showErrorMessage(callback.message, res => {})
} }
}) })
}, },
openScanPopup(content, jobcontent) { openScanPopup(content, jobcontent) {
this.issueRecord = []; this.issueRecord = [];
this.dataContent = content; this.dataContent = content;
@ -223,7 +228,7 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
let that = this; let that = this;
that.fromLocationList = []; that.fromLocationList = [];
if (that.dataContent != null) { if (that.dataContent != null) {
that.fromInventoryStatuses = this.jobContent.outInventoryStatuses that.fromInventoryStatuses = this.jobContent.outInventoryStatuses
that.toLocation = that.dataContent[0]; that.toLocation = that.dataContent[0];
that.toLocationCode = that.dataContent[0].toLocationCode; that.toLocationCode = that.dataContent[0].toLocationCode;
that.fromLocationList = that.getFromLocationList(); that.fromLocationList = that.getFromLocationList();
@ -259,8 +264,8 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
this.showErrorMessage('发料库位【' + fromlocation + '】不存在') this.showErrorMessage('发料库位【' + fromlocation + '】不存在')
} }
}, },
onScanResult(result){ onScanResult(result) {
try { try {
let that = this; let that = this;
if (that.fromLocationCode == '') { if (that.fromLocationCode == '') {
@ -282,124 +287,149 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
) )
return; return;
} else { } else {
// this.queryBalance(result);
uni.showLoading({
title: '加载中', // this.getBalance(result.label, packageInfo, balances => {
mask: true // this.packageInfo = packageInfo;
}) // //
// let s = '';
this.getBalance(result.label, packageInfo, balances => { // if (!result.package.parentNumber) {
this.packageInfo =packageInfo; // if (balances.list.length == 0) {
// // this.showErrorMessage(',')
let s = ''; // } else {
if (!result.package.parentNumber) { // let newBalances = balances.list.filter(b => b.locationCode == that
if (balances.list.length == 0) { // .fromLocationCode);
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描') // if (newBalances.length == 0) {
} else { // this.showErrorMessage(',')
let newBalances = balances.list.filter(b => b.locationCode == that // } else if (newBalances.length == 1) {
.fromLocationCode); // let balance = newBalances[0];
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.showErrorMessage('按外包装【' + packageInfo.parentNumber + '】和子包装【' +
packageInfo.number + '】都未查找到库存余额')
}
} else {
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 +
'】已经有库存余额,请重新扫描')
}
// //
// 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 {
// }
}
}
uni.hideLoading();
});
// getBalanceByManagementPrecision(result.label, that.fromLocationCode, that.fromInventoryStatuses,
// balanceRes => {
// if (balanceRes.success) {
// let s = '';
// if (balanceRes.data.list.length == 0) {
// this.afterGetBalance(result.label, null, packageInfo);
// } else if (balanceRes.data.list.length == 1) {
// let balance = balanceRes.data.list[0];
// this.afterGetBalance(result.label, balance, packageInfo); // this.afterGetBalance(result.label, balance, packageInfo);
// } else { // } else {
// this.showBalanceSelect(balanceRes.data.list); // this.showBalanceSelect(newBalances);
// } // }
// }
// } else {
// //
// if (balances.list.length == 0) {
// this.showErrorMessage(',')
// } else { // } else {
// this.showErrorMessage(balanceRes.message.message); // //
// 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.showErrorMessage('' + packageInfo.parentNumber + '' +
// packageInfo.number + '')
// }
// } else {
// 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 +
// ',')
// // 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();
// });
} }
} catch (e) { } catch (e) {
this.showErrorMessage(e.stack) this.showErrorMessage(e.stack)
uni.hideLoading(); uni.hideLoading();
} }
}, },
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 = []
if (packageInfo.parentNumber) { if (packageInfo.parentNumber) {
var packingNumber = packageInfo.parentNumber + "," + label.packingNumber; var packingNumber = packageInfo.parentNumber + "," + label.packingNumber;
filters.push({ filters.push({
@ -414,7 +444,7 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
value: label.packingNumber value: label.packingNumber
}) })
} }
filters.push({ filters.push({
column: "itemCode", column: "itemCode",
action: "==", action: "==",
@ -425,7 +455,7 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
action: "==", action: "==",
value: label.batch value: label.batch
}) })
if (this.fromInventoryStatuses != null && this.fromInventoryStatuses != "") { if (this.fromInventoryStatuses != null && this.fromInventoryStatuses != "") {
filters.push({ filters.push({
column: "inventoryStatus", column: "inventoryStatus",
@ -433,7 +463,7 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
value: this.fromInventoryStatuses value: this.fromInventoryStatuses
}) })
} }
var params = { var params = {
filters: filters, filters: filters,
pageNo: 1, pageNo: 1,
@ -448,8 +478,8 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
onScan(result) { onScan(result) {
if(!result.package){ if (!result.package) {
this.showErrorMessage('扫描数据错误['+result.label.code+"]", this.showErrorMessage('扫描数据错误[' + result.label.code + "]",
res => { res => {
this.getfocus(); this.getfocus();
} }
@ -527,7 +557,7 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
}, },
selectBalanceItem(balance) { selectBalanceItem(balance) {
this.afterGetBalance(this.label, balance,this.packageInfo); this.afterGetBalance(this.label, balance, this.packageInfo);
}, },
afterGetBalance(label, balance, packageInfo) { afterGetBalance(label, balance, packageInfo) {
@ -733,16 +763,16 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
}, },
packGetFocus() { packGetFocus() {
if(this.$refs.comscan){ if (this.$refs.comscan) {
this.$refs.comscan.getfocus(); this.$refs.comscan.getfocus();
} }
}, },
packLoseFocus() { packLoseFocus() {
if(this.$refs.comscan){ if (this.$refs.comscan) {
this.$refs.comscan.losefocus(); this.$refs.comscan.losefocus();
} }
}, },
showMessage(message, callback) { showMessage(message, callback) {
setTimeout(r => { setTimeout(r => {
@ -789,7 +819,8 @@ 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;
} }
</style> </style>

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 {

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

@ -9,12 +9,12 @@
<view v-if="jobList.length>0"> <view v-if="jobList.length>0">
<uni-swipe-action ref="swipeAction"> <uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in jobList" :key="index"> <view v-for="(item, index) in jobList" :key="index">
<uni-swipe-action-item <uni-swipe-action-item
:right-options="item.status=='2'?detailGiveupOptions:item.status=='1'?detailCloseOptions:detailOptions" :right-options="item.status=='2'?detailGiveupOptions:item.status=='1'?detailCloseOptions:detailOptions"
@click="swipeClick($event,item)"> @click="swipeClick($event,item)">
<com-issue-job-card :dataContent="item" @click='openJobDetail(item)'></com-issue-job-card> <com-issue-job-card :dataContent="item" @click='openJobDetail(item)'></com-issue-job-card>
</uni-swipe-action-item> </uni-swipe-action-item>
</view> </view>
</uni-swipe-action> </uni-swipe-action>
@ -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 {
@ -84,18 +92,20 @@
detailOptions: [], detailOptions: [],
detailGiveupOptions: [], detailGiveupOptions: [],
productionlineList: [], productionlineList: [],
detailCloseOptions: [], detailCloseOptions: [],
title:'', title: '',
productionLine:"", productionLine: "",
fromLocation:"" fromLocation: "",
businessTypeCode: "Issue",
businessType: null,
}; };
}, },
onLoad(option) { onLoad(option) {
this.title = option.title this.title = option.title
this.getIssueJobByProductionline() this.getIssueJobByProductionline()
}, },
onShow() { onShow() {
this.getList('refresh',this.fromLocation,this.productionLine); this.getList('refresh', this.fromLocation, this.productionLine);
}, },
onReady() { onReady() {
@ -108,12 +118,12 @@
if (this.loadingType == 'loading' || this.loadingType == 'nomore') { if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return; return;
} }
this.getList('more', this.fromLocation, this.productionLine) this.getList('more', this.fromLocation, this.productionLine)
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.getList('refresh',this.fromLocation, this.productionLine) this.getList('refresh', this.fromLocation, this.productionLine)
}, },
//退 //退
@ -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) {
@ -215,18 +238,18 @@
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
} }
var list = res.data.list; var list = res.data.list;
this.totalCount = res.data.total this.totalCount = res.data.total
updateTitle(this.title+"(" + this.totalCount + ")"); updateTitle(this.title + "(" + this.totalCount + ")");
this.loadingType = "loadmore"; this.loadingType = "loadmore";
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.jobList = type === "refresh" ? list : this.jobList.concat(list);
this.pageNo++; this.pageNo++;
if (type === "refresh") { if (type === "refresh") {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
} }
}).catch(error => { }).catch(error => {
if (type === "refresh") { if (type === "refresh") {
@ -239,12 +262,12 @@
}) })
}, },
fromLocationCode(fromLocation) { fromLocationCode(fromLocation) {
this.fromLocation =fromLocation; this.fromLocation = fromLocation;
this.getList('refresh', this.fromLocation, this.productionLine) this.getList('refresh', this.fromLocation, this.productionLine)
}, },
productionLineCode(productionLineCode) { productionLineCode(productionLineCode) {
this.productionLine =productionLineCode this.productionLine = productionLineCode
this.getList('refresh', this.fromLocation,this.productionLine) this.getList('refresh', this.fromLocation, this.productionLine)
}, },
getByAsnNumber(code) { getByAsnNumber(code) {
let that = this; let that = this;
@ -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
}); });
}, },
@ -296,18 +320,18 @@
this.openjobInfoPopup(dataContent); this.openjobInfoPopup(dataContent);
} else if (e.content.text == "放弃") { } else if (e.content.text == "放弃") {
this.$refs.comMessage.showQuestionMessage("确定要放弃当前任务?", this.$refs.comMessage.showQuestionMessage("确定要放弃当前任务?",
res => { res => {
if (res) { if (res) {
this.cancleJob(dataContent.masterId); this.cancleJob(dataContent.masterId);
} }
}); });
}else if (e.content.text == "关闭") { } else if (e.content.text == "关闭") {
this.$refs.comMessage.showQuestionMessage("确定要关闭当前任务?", this.$refs.comMessage.showQuestionMessage("确定要关闭当前任务?",
res => { res => {
if (res) { if (res) {
this.closeJob(dataContent.masterId); this.closeJob(dataContent.masterId);
} }
}); });
} }
}, },
@ -318,7 +342,7 @@
cancleJob(id) { cancleJob(id) {
cancleTakeIssueJob(id).then(res => { cancleTakeIssueJob(id).then(res => {
if (res.data) { if (res.data) {
this.getList("refresh",this.fromLocation,this.productionLine) this.getList("refresh", this.fromLocation, this.productionLine)
uni.showToast({ uni.showToast({
title: "放弃任务成功" title: "放弃任务成功"
}) })
@ -334,15 +358,15 @@
title: "加载中....", title: "加载中....",
mask: true mask: true
}); });
closeTakeIssueJob(id).then(res => { closeTakeIssueJob(id).then(res => {
uni.hideLoading() uni.hideLoading()
if(res.data){ if (res.data) {
this.getList("refresh") this.getList("refresh")
uni.showToast({ uni.showToast({
title:"关闭任务成功" title: "关闭任务成功"
}) })
}else { } else {
this.showMessage("关闭任务失败") this.showMessage("关闭任务失败")
} }
}).catch(error => { }).catch(error => {
@ -354,13 +378,13 @@
switchChangeToday(state, creationTime) { switchChangeToday(state, creationTime) {
this.checkedToday = state; this.checkedToday = state;
this.todayTime = creationTime; this.todayTime = creationTime;
this.getList("refresh",this.fromLocation,this.productionLine); this.getList("refresh", this.fromLocation, this.productionLine);
}, },
switchChangeWait(state, jobStatus) { switchChangeWait(state, jobStatus) {
this.checkedWaitTask = state; this.checkedWaitTask = state;
this.status = jobStatus; this.status = jobStatus;
this.getList("refresh",this.fromLocation,this.productionLine); this.getList("refresh", this.fromLocation, this.productionLine);
}, },
getScanNumber(code) { getScanNumber(code) {
@ -383,7 +407,7 @@
action: "==", action: "==",
value: code value: code
}) })
filters.push({ filters.push({
column: "accept_user_id", column: "accept_user_id",
action: "==", action: "==",
@ -418,67 +442,83 @@
}); });
}, },
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) {
if (!result.label.batch) { let balance = result.balance;
this.showMessage("批次为空") if (balance != null) {
return; this.scanMessage = ""
} if (!result.label.batch) {
if (!result.label.itemCode) { this.showMessage("批次为空")
this.showMessage("物料号为空") return;
return; }
} if (!result.label.itemCode) {
try { this.showMessage("物料号为空")
var filters = [{ return;
column: "status", }
action: "in", try {
value: '1,2' var filters = [{
}, column: "status",
{ action: "in",
column: "batch", value: '1,2'
action: "==", },
value: result.label.batch {
}, column: "batch",
{ action: "==",
column: "itemCode", value: result.label.batch
action: "==", },
value: result.label.itemCode {
} column: "itemCode",
] action: "==",
getIssueJobList({ value: result.label.itemCode
filters: filters, },
pageNo: 1, {
pageSize: 1000, column: "fromLocationCode",
sort: 'createTime', action: "==",
by: 'asc' value: balance.locationCode
}).then(res => { }
this.scanMessage = result.scanMessage ]
let resultList = res.data.list; getIssueJobList({
if (resultList.length > 0) { filters: filters,
resultList.forEach(item => { pageNo: 1,
item.title = item.number; pageSize: 1000,
item.selected = false sort: 'createTime',
}) by: 'asc'
let list = [] }).then(res => {
resultList.forEach(item => { this.scanMessage = result.scanMessage
if (!list.find(subItem => subItem.title == item.title)) { let resultList = res.data.list;
list.push(item) 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 {
if (list.length > 0) { this.showMessage("物料号[" + result.label.itemCode + "]批次[" + result.label.batch +
this.selectItem(list[0]) ']' + "未查找到任务<br>" + "扫描[" + result.scanMessage + "]")
} }
} else { }).catch(error => {
this.showMessage("物料号[" + result.label.itemCode + "]批次[" + result.label.batch + this.showMessage(error + "<br>扫描[" + result.scanMessage + "]")
']'+"未查找到任务<br>"+"扫描["+result.scanMessage+"]") })
}
}).catch(error => {
this.showMessage(error+"<br>扫描["+result.scanMessage+"]")
})
} 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