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_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_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)
})
},
getItemCodeType(itemCode, callBack) {
uni.showLoading({
title: "加载中",

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

@ -45,8 +45,9 @@
来源库位
</view>
<view class="" style="width: 75%; padding: 8rpx;">
<uni-combox class="my-combox" :candidates="fromLocationList" v-model="fromLocationCode" placeholder="请选择库位"
@confirm="fromLocationUpdate" :inputStyle="inputStyleObject"></uni-combox>
<uni-combox class="my-combox" :candidates="fromLocationList" v-model="fromLocationCode"
placeholder="请选择库位" @confirm="fromLocationUpdate"
:inputStyle="inputStyleObject"></uni-combox>
</view>
</view>
@ -114,7 +115,8 @@
} from '@/common/array.js';
import {
getWorkShopLineStation,
getBalanceByFilter
getBalanceByFilter,
getBalanceByParams,
} from '@/api/request2.js';
import {
uniqueArray
@ -131,7 +133,9 @@
import {
getBalanceByManagementPrecision
} from '@/common/balance.js';
import { getDirectoryItemArray } from '../../../common/directory.js';
import {
getDirectoryItemArray
} from '../../../common/directory.js';
export default {
name: 'winScanPack',
@ -172,7 +176,8 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
label: {},
inputStyleObject: {
fontSize: "100rpx"
}
},
bussinessCode: 'Issue'
}
},
created() {
@ -282,111 +287,89 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
)
return;
} else {
//
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);
}
this.queryBalance(result);
} 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 +
// ',')
// 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);
// }
}
}
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];
// }
// } 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(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 {
// 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();
// });
@ -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) {
var filters = []
@ -789,6 +819,7 @@ import { getDirectoryItemArray } from '../../../common/directory.js';
max-height: 300rpx;
padding: 10rpx;
}
.my-combox {
font-size: 50px;
}

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

@ -40,6 +40,7 @@
<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>
@ -80,6 +81,7 @@
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',
@ -89,7 +91,8 @@
comIssueDetailCard,
comScanIssuePack,
jobTop,
workStation
workStation,
balanceSelect
},
data() {
return {

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

@ -25,7 +25,9 @@
<uni-load-more :status="loadingType" v-if="jobList.length>0" />
</view>
<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>
<comMessage ref="comMessage"></comMessage>
</view>
@ -43,6 +45,10 @@
updateTitle
} from '@/common/basic.js';
import {
getBusinessType
} from '@/common/record.js';
import {
getDetailOption,
getDetailGiveupOption,
@ -57,6 +63,7 @@
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',
@ -68,7 +75,8 @@
jobInfoPopup,
winScanPackJob,
winScanButton,
jobList
jobList,
winComScanBalance
},
data() {
return {
@ -87,7 +95,9 @@
detailCloseOptions: [],
title: '',
productionLine: "",
fromLocation:""
fromLocation: "",
businessTypeCode: "Issue",
businessType: null,
};
},
onLoad(option) {
@ -136,6 +146,19 @@
},
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().then(res => {
if (res.code == 0) {
@ -274,7 +297,8 @@
openJobDetail(item, scanMessage = '') {
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() {
this.$refs.scanPopup.openScanPopup();
if (this.businessType == null) {
this.getBusinessTypeFunc()
} else {
this.$refs.scanPopup.openScanPopup(this.businessType);
}
},
// openScanPopup() {
// this.$refs.scanPopup.openScanPopup();
// },
getScanResult(result) {
let balance = result.balance;
if (balance != null) {
this.scanMessage = ""
if (!result.label.batch) {
this.showMessage("批次为空")
return;
@ -444,6 +478,11 @@
column: "itemCode",
action: "==",
value: result.label.itemCode
},
{
column: "fromLocationCode",
action: "==",
value: balance.locationCode
}
]
getIssueJobList({
@ -480,6 +519,7 @@
} catch (e) {
this.showMessage(e.message)
}
}
},
}
}

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

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

Loading…
Cancel
Save