Browse Source

翻包任务

hella_vue3
lijuncheng 8 months ago
parent
commit
eb44fa07b8
  1. 2
      .hbuilderx/launch.json
  2. 67
      src/api/request2.js
  3. 23
      src/common/label.js
  4. 5
      src/mycomponents/scan/winComScan.vue
  5. 8
      src/mycomponents/scan/winScanJobNumber.vue
  6. 38
      src/pages.json
  7. 11
      src/pages/count/record/countRecord.vue
  8. 5
      src/pages/issue/coms/jobInfoPopup.vue
  9. 2
      src/pages/issue/job/issueDetail.vue
  10. 7
      src/pages/issue/job/issueJob.vue
  11. 50
      src/pages/issue/request/issueScanRequest.vue
  12. 39
      src/pages/package/coms/comOverPackJobCard.vue
  13. 188
      src/pages/package/coms/comOverPackJobDetailCard.vue
  14. 305
      src/pages/package/job/overPackageJob.vue
  15. 518
      src/pages/package/job/overPackageJobDetail.vue

2
.hbuilderx/launch.json

@ -17,7 +17,7 @@
"type" : "uni-app:h5"
},
{
"playground" : "custom",
"playground" : "standard",
"type" : "uni-app:app-android"
}
]

67
src/api/request2.js

@ -3681,3 +3681,70 @@ export function getPackageUnitList(params) {
data: params,
});
}
/**
* 翻包 任务承接
* @param {*} id
*
*/
export function takeOverPageJob(id) {
return request({
url: baseApi + "/wms/issue-job-main/accept?id=" + id,
method: "put",
data: {},
});
}
/**
* 翻包 放弃承接
* @param {*} id
*
*/
export function cancleTakeOverPageJob(id) {
return request({
url: baseApi + "/wms/issue-job-main/abandon?id=" + id,
method: "put",
data: {},
});
}
/**
* 翻包任务 列表
* status 任务状态
* 开始日期
* 结束日期
* 获取日期任务列表
* @param {*}
*/
export function getOverPageJobList(params) {
return request({
url: baseApi + "/wms/issue-job-main/senior",
method: "post",
data: params,
});
}
/**
* 翻包任务明细
* @param {*} 任务id
*
*/
export function getOverPageJobDetail(id) {
return request({
url: baseApi + "/wms/issue-job-main/getIssueJobById?id=" + id,
method: "get",
data: {},
});
}
/**
* 翻包任务 提交
* @param {*} params
*/
export function overPageSubmit(params) {
return request({
url: baseApi + "/wms/issue-job-main/execute",
method: "put",
data: params,
});
}

23
src/common/label.js

@ -49,17 +49,18 @@ export function getLabelInfo(scanMsg,headerType, callBack) {
getBarCodeInfo('text', 'V1.0', scanMsg, callBack);
}
}else {
let labelResult = {
label: {
labelType: "",
barType: '',
code:""
},
package: null,
success: false,
message: '标签格式不正确',
}
callBack(labelResult);
getBarCodeInfo('text', 'V1.0', scanMsg, callBack);
// let labelResult = {
// label: {
// labelType: "",
// barType: '',
// code:""
// },
// package: null,
// success: false,
// message: '标签格式不正确',
// }
// callBack(labelResult);
}
}

5
src/mycomponents/scan/winComScan.vue

@ -108,8 +108,8 @@
document.querySelector('textarea').setAttribute('inputmode', 'none')
}
// #endif
// #ifdef APP-PLUS
this.hide()
// #ifdef APP-PLUS
//
// this.hide()
// uni.onKeyboardHeightChange(res => {
@ -146,6 +146,7 @@
},
methods: {
hide() {
// #ifdef APP-PLUS
//
var interval = setInterval(function() {
uni.hideKeyboard(); //
@ -155,6 +156,7 @@
clearInterval(interval);
console.log('停止刷新')
}, 1000);
// #endif
},
getValue() {
return this.scanMsg
@ -221,6 +223,7 @@
this.$nextTick(r => {
that.boxfocus = true;
});
this.hide()
},
losefocus() {
let that = this;

8
src/mycomponents/scan/winScanJobNumber.vue

@ -13,7 +13,13 @@
</view>
<view class="">
<view class="">
<win-com-scan ref="scan" @getResult="getScanResult" :placeholder='title' :clearResult="false" :isShowHistory="false">
<win-com-scan ref="scan"
@getResult="getScanResult"
:placeholder='title'
:clearResult="false"
:isShowHistory="false"
headerType=""
>
</win-com-scan>
</view>
</view>

38
src/pages.json

@ -1691,9 +1691,47 @@
"navigationBarTitleText": "翻包",
"enablePullDownRefresh": false
}
},
{
"path": "pages/package/job/overPackageJob",
"style": {
"navigationBarTitleText": "翻包任务",
"enablePullDownRefresh": false,
"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/package/job/overPackageJobDetail",
"style": {
"navigationBarTitleText": "翻包任务详情",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {
"navigationBarTextStyle": "white",

11
src/pages/count/record/countRecord.vue

@ -38,7 +38,7 @@
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location>
<win-scan-location ref="scanFromLocationCode" title="盘点库位" @getLocation='getLocation'
:locationTypeList="fromLocationTypeArray"></win-scan-location>
<count-qty-edit ref="CountQtyEdit" @confirm="editConfirm" :isShowStatus="true" :allowEditStatus="true">
<count-qty-edit ref="countQtyEdit" @confirm="editConfirm" :isShowStatus="true" :allowEditStatus="true">
</count-qty-edit>
<comMessage ref="comMessage"></comMessage>
</view>
@ -74,6 +74,7 @@
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import countQtyEdit from "@/mycomponents/qty/countQtyEdit.vue"
export default {
name: 'receipt_detail',
@ -85,7 +86,7 @@
comBlankView,
winScanPackAndLocation,
winScanLocation,
CountQtyEdit
countQtyEdit
},
data() {
return {
@ -265,7 +266,7 @@
this.$refs.comMessage.showSelectMessageModal("箱码【" + packingNumber + "】已经完成盘点,是否要编辑数量",
res => {
if (res) {
this.$refs.CountQtyEdit.openEditPopup(this.itemEditInfo,
this.$refs.countQtyEdit.openEditPopup(this.itemEditInfo,
detail.subList);
} else {
this.scanPopupGetFocus();
@ -276,7 +277,7 @@
this.itemEditInfo.packQty = result.package.packQty;
this.itemEditInfo.packUnit = result.package.packUnit;
this.itemEditInfo.record = this.createRecordInfo(this.itemEditInfo, result.balance);
this.$refs.CountQtyEdit.openEditPopupShowSeconds(this.itemEditInfo);
this.$refs.countQtyEdit.openEditPopupShowSeconds(this.itemEditInfo);
this.calcHandleQty();
}
}
@ -358,7 +359,7 @@
editItem(val) {
var detail = this.detailSource.find(r => r.itemCode == val.itemCode);
this.$refs.CountQtyEdit.openEditPopup(val,
this.$refs.countQtyEdit.openEditPopup(val,
detail.subList);
},

5
src/pages/issue/coms/jobInfoPopup.vue

@ -40,7 +40,10 @@
methods: {
openPopup(val) {
this.dataContent = val;
this.$refs.popup.open('bottom')
setTimeout(res=>{
this.$refs.popup.open('bottom')
},100)
},
closePopup() {
this.$refs.popup.close()

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

@ -73,7 +73,6 @@
import comIssueDetailCard from '@/pages/issue/coms/comIssueDetailCard.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comScanIssuePack from '@/pages/issue/coms/comScanIssuePack.vue'
import comIssueRequestInfo from '@/pages/issue/coms/comIssueRequestInfo.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
import workStation from '@/mycomponents/workStation/workStation.vue'
@ -83,7 +82,6 @@
jobDetailPopup,
winScanButton,
comIssueDetailCard,
comIssueRequestInfo,
comScanIssuePack,
jobTop,
workStation

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

@ -1,16 +1,11 @@
<template>
<view class="">
<com-empty-view v-if="jobList.length==0"></com-empty-view>
<job-filter ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday"
<job-filter ref="filter" otherTitle="" @switchChangeToday="switchChangeToday"
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask">
</job-filter>
<view v-if="jobList.length>0">
<job-filter ref="filter" otherTitle="" @switchChangeToday="switchChangeToday"
@switchChangeWait="switchChangeWait" @onScanNumber="getByAsnNumber" :checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask">
</job-filter>
<uni-swipe-action ref="swipeAction">
<view v-for="(item, index) in jobList" :key="index">
<uni-swipe-action-item :right-options="item.status=='2'?detailGiveupOptions:detailOptions"

50
src/pages/issue/request/issueScanRequest.vue

@ -4,7 +4,8 @@
<com-blank-view @goScan='goScan()'></com-blank-view>
</view>
</view>
<win-scan-pack ref="scanPopup" @getResult='getScanResult' headerType="HCMQ" title="叫料标签"></win-scan-pack>
<win-scan-pack ref="scanPopup" @getResult='getScanResult' headerType="HCMQ" title="叫料标签" :isShowHistory="false"></win-scan-pack>
<comMessage ref="comMessage"></comMessage>
</template>
<script>
@ -85,22 +86,25 @@
this.$refs.scanPopup.openScanPopup();
},
getScanResult(data){
this.detailSource.subList = [];
this.detailSource = {
subList:[]
}
var labelInfo = data.label;
var warehouseCode = labelInfo.warehouseCode;
var workshopCode =labelInfo.workshopCode;
var productionLineCode =labelInfo.productionLineCode;
var workStationCode = labelInfo.workStationCode;
var itemCode = labelInfo.itemCode;
var location = labelInfo.location;
var qty = labelInfo.qty;
var uom = labelInfo.uom;
var packUnit = labelInfo.packUnit;
var data = {};
this.detailSource.subList.push()
var data = {
productionLineCode:labelInfo.productionLineCode,
workStationCode:labelInfo.workStationCode,
itemCode:labelInfo.itemCode,
location:labelInfo.location,
qty:labelInfo.qty,
uom:labelInfo.uom,
packUnit:labelInfo.packUnit
};
this.detailSource.subList.push(data)
this.detailSource.warehouseCode = labelInfo.warehouseCode;
this.detailSource.workshopCode = labelInfo.workshopCode;
this.submit();
},
setParams() {
@ -117,7 +121,7 @@
issueRequestSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成发料申请" + res.data)
this.showCommitSuccessMessage("提交成功<br>生成发料申请[" + res.data+"]")
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
@ -128,14 +132,26 @@
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
navigateBack(1)
this.closeScanPopup();
this.goScan();
})
},
closeScanPopup() {
this.$refs.scanPopup.closeScanPopup();
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {}
if (res) {
this.scanPopupGetFocus()
}
});
},
scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.getfocus();
}
},
}
}
</script>

39
src/pages/package/coms/comOverPackJobCard.vue

@ -0,0 +1,39 @@
<template>
<job-com-main-card :dataContent="dataContent">
<view class="task_item">
<view class="task_text">
申请单号 {{dataContent.requestNumber}}
</view>
<view class="task_text">
车间 {{dataContent.workShopCode}}
</view>
</view>
</job-com-main-card>
</template>
<script>
import jobComMainCard from '@/mycomponents/job/jobComMainCard.vue'
export default {
components: {
jobComMainCard,
},
data() {
return {};
},
props: {
dataContent: {
type: Object,
default: {}
},
},
methods: {
}
}
</script>
<style lang="scss">
</style>

188
src/pages/package/coms/comOverPackJobDetailCard.vue

@ -0,0 +1,188 @@
<template>
<view>
<!-- <requiredLocation title="需求库位" :locationCode="dataContent.toLocationCode"
:isShowEdit="dataContent.allowModifyLocation==1"></requiredLocation> -->
<view v-for="(item,index) in dataContent.Items" :key="index">
<uni-collapse ref="collapse">
<uni-collapse-item :open="true">
<template v-slot:title>
<!-- 物品 -->
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="itemCoceClick($event,item,index)"
:right-options="removeOptions">
<item-qty :dataContent="item" :handleQty="item.handleQty"></item-qty>
</uni-swipe-action-item>
</uni-swipe-action>
<!-- <com-issue-request-info :workShopCode="dataContent.workShopCode" :dataContent="dataContent">
</com-issue-request-info> -->
</template>
<u-line />
<view v-for="(loacation,index) in item.Locations" :key="index">
<view>
<view class="uni-flex uni-row space-between">
<!-- 推荐库位 -->
<location :locationCode="loacation.fromLocationCode">
</location>
</view>
<view v-for="(batch,index) in loacation.Batchs" :key="index">
<recommend-balance style='margin-left: 0rpx;' :detail="batch" :isShowLocation="false"
:isShowPack="batch.packingNumber!=null && batch.packingNumber!=''">
</recommend-balance>
<view class="uni-flex uni-row " v-if='batch.Records.length>0'>
<view class="center " style=" width: 20px;background-color: #0CC2B6; color: #fff; margin-left: 40px;padding: 0px 2px;">
扫描
</view>
<view class="uni-flex uni-column scan_view" style="width: 100%;">
<view v-for="(record,index) in batch.Records" :key="index">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,batch,record,index)"
:right-options="scanOptions">
<handle-balance :detail="record" :isShowLocation="false"
:isShowBatch="batch.packingNumber!=null">
</handle-balance>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
</view>
</view>
</view>
</view>
</view>
</uni-collapse-item>
</uni-collapse>
</view>
</view>
<balance-qty-edit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="true"></balance-qty-edit>
<detail-info-popup ref="detailInfoPopup"></detail-info-popup>
<comMessage ref="message"></comMessage>
</template>
<script>
import itemQty from '@/mycomponents/item/itemQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import recommendBalance from '@/mycomponents/balance/recommendBalance.vue'
import handleBalance from '@/mycomponents/balance/handleBalance.vue'
import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue'
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import location from '@/mycomponents/balance/location.vue'
import detailInfoPopup from '@/pages/productionReceipt/coms/detailInfoPopup.vue'
import comIssueRequestInfo from '@/pages/issue/coms/comIssueRequestInfo.vue'
import {
getDetailOption,
getEditRemoveOption,
getRemoveOption
} from '@/common/array.js';
export default {
emits: ['updateData',"removeItemCode"],
components: {
itemQty,
recommend,
recommendBalance,
handleBalance,
recommendQtyEdit,
requiredLocation,
balanceQtyEdit,
location,
detailInfoPopup,
comIssueRequestInfo
},
props: {
dataContent: {
type: Object,
default: {}
},
settingParam: {
type: Object,
default: {}
},
},
watch: {
},
data() {
return {
option: [],
showItem: {},
editItem: {},
batchItem: {},
detailOptions: [],
scanOptions: [],
removeOptions:[]
}
},
mounted() {
this.detailOptions = getDetailOption();
this.scanOptions = getEditRemoveOption();
this.removeOptions = getRemoveOption()
},
methods: {
resizeCollapse() {
this.$nextTick(r => {
this.$refs.collapse.forEach(r => {
r.childrens.forEach(i => {
i.init();
})
r.resize();
})
});
},
swipeClick(e, batch, record, index) {
if (e.content.text == "编辑") {
this.edit(batch, record)
} else if (e.content.text == "移除") {
this.remove(batch, record, index)
}
},
itemCoceClick(e,item,index){
if (e.content.text == "移除") {
this.dataContent.Items.splice(index, 1);
this.$emit('removeItemCode')
}
},
edit(batch, item) {
let that = this;
that.editItem = item;
that.batchItem = batch;
item.balance.balanceQty = item.balance.qty;
that.$refs.balanceQtyEdit.openEditPopup(item.balance, item.qty);
},
detail(item) {
this.showItem = item;
this.$refs.receiptHint.openScanPopup()
},
remove(batch, record, index) {
this.$refs.message.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
batch.Records.splice(index, 1);
this.resizeCollapse();
this.$emit('updateData', record)
}
});
},
confirm(val) {
this.editItem.qty = val;
this.$emit('updateData', this.editItem)
// let qty = 0;
// this.batchItem.Records.forEach(r => {
// qty += Number(r.qty);
// })
// this.batchItem.handleQty = qty;
}
}
}
</script>
<style>
</style>

305
src/pages/package/job/overPackageJob.vue

@ -0,0 +1,305 @@
<template>
<view class="">
<com-empty-view v-if="jobList.length==0"></com-empty-view>
<job-filter ref="filter" otherTitle="" @switchChangeToday="switchChangeToday"
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask">
</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:detailOptions"
@click="swipeClick($event,item)">
<comOverPackJobCard :dataContent="item" @click='openJobDetail(item)'></comOverPackJobCard>
</uni-swipe-action-item>
</view>
</uni-swipe-action>
<job-info-popup ref='jobInfoPopup'></job-info-popup>
<uni-load-more :status="loadingType" v-if="jobList.length>0" />
</view>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
cancleTakeOverPageJob,
getOverPageJobList,
} from '@/api/request2.js';
import {
goHome,
updateTitle
} from '@/common/basic.js';
import {
getDetailOption,
getDetailGiveupOption
} from '@/common/array.js';
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import jobFilter from '@/mycomponents/job/jobFilter.vue'
import comOverPackJobCard from '@/pages/package/coms/comOverPackJobCard.vue'
import jobInfoPopup from '@/pages/issue/coms/jobInfoPopup.vue'
export default {
name: 'issue',
components: {
comEmptyView,
jobFilter,
comOverPackJobCard,
jobInfoPopup
},
data() {
return {
jobList: [],
pageNo: 1,
pageSize: 10,
totalCount: 0,
loadingType: "nomore",
checkedToday: false,
checkedWaitTask: false,
todayTime: "",
status: '1,2', //
detailOptions: [],
detailGiveupOptions: [],
};
},
onShow() {
this.getList('refresh');
},
onReady() {
this.detailOptions = getDetailOption();
this.detailGiveupOptions = getDetailGiveupOption();
},
onReachBottom() {
//
if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
return;
}
this.getList("more");
},
onPullDownRefresh() {
this.getList('refresh');
},
//退
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: {
getList(type) {
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: "request_time",
action: "betweeen",
value: this.todayTime
})
}
filters.push({
column: "status",
action: "in",
value: this.status
})
var params = {
filters: filters,
pageNo: this.pageNo,
pageSize: this.pageSize,
}
getOverPageJobList(params).then(res => {
uni.hideLoading();
if (type === "refresh") {
uni.stopPullDownRefresh();
}
var list = res.data.list;
this.totalCount = res.data.total
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
this.loadingType = "nomore";
return;
}
this.jobList = type === "refresh" ? list : this.jobList.concat(list);
this.pageNo++;
updateTitle("翻包任务(" + this.totalCount + ")");
}).catch(error => {
if (type === "refresh") {
uni.stopPullDownRefresh();
}
updateTitle("翻包任务");
this.loadingType = "";
uni.hideLoading();
that.showMessage(error)
})
},
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) {
uni.navigateTo({
url: './overPackageJobDetail?id=' + item.id + '&status=' + item.status
});
},
showItemList(itemList) {
this.$refs.scanList.openPopup(itemList);
},
selectedItem(item) {
this.openJobDetail(item);
},
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.id);
}
});
}
},
openjobInfoPopup(item) {
this.$refs.jobInfoPopup.openPopup(item)
},
cancleJob(id) {
cancleTakeOverPageJob(id).then(res => {
if(res.data){
this.getList("refresh")
uni.showToast({
title:"放弃任务成功"
})
}else {
this.showMessage("放弃任务失败")
}
}).catch(error => {
this.showMessage(error)
})
},
switchChangeToday(state, creationTime) {
this.checkedToday = state;
this.todayTime = creationTime;
this.getList("refresh");
},
switchChangeWait(state, jobStatus) {
this.checkedWaitTask = state;
this.status = jobStatus;
this.getList("refresh");
},
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,
}
getOverPageJobList(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) {
}
});
},
}
}
</script>
<style scoped lang="scss">
</style>

518
src/pages/package/job/overPackageJobDetail.vue

@ -0,0 +1,518 @@
<template>
<view class="page-wraper">
<view class="page-header">
<view class="header_job_top">
<job-top :dataContent="jobContent"></job-top>
</view>
<view class="header_item">
申请单号 : {{jobContent.requestNumber}}
</view>
</view>
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view v-for="(toLocation, index) in detailSource" :key="index">
<work-station :workshopCode="jobContent.workShopCode"
:productionLineCode="toLocation.productionLineCode"
:workStationCode="toLocation.workStationCode" :rawLocationCode="toLocation.toLocationCode">
</work-station>
<comOverPackJobDetailCard ref='comOverPackJobDetailCard' :dataContent="toLocation" @updateData='updateData'>
</comOverPackJobDetailCard>
</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="submit()">提交</button>
</view>
</view>
</view>
<win-scan-button @goScan='openScanDetailPopup'></win-scan-button>
<com-scan-issue-pack ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'>
</com-scan-issue-pack>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
takeOverPageJob,
cancleTakeOverPageJob,
getOverPageJobDetail,
overPageSubmit
} from '@/api/request2.js';
import {
goHome,
updateTitle,
navigateBack,
getRemoveOption,
getCurrDateTime,
getDirectoryItemArray,
getPackingNumberAndBatch,
} 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 comOverPackJobDetailCard from '@/pages/package/coms/comOverPackJobDetailCard.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'
export default {
name: 'issueDetail',
components: {
jobDetailPopup,
winScanButton,
comOverPackJobDetailCard,
comScanIssuePack,
jobTop,
workStation
},
data() {
return {
id: '',
jobContent: {}, //
subList: [], //subList
detailSource: [], //
detailOptions: [],
scanOptions: [],
jobStatus:""
};
},
props: {
},
onLoad(option) {
this.id = option.id;
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") {
//
cancleTakeOverPageJob(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.comOverPackJobDetailCard.forEach(r => {
r.resizeCollapse();
})
// this.$refs.mainCollapse.forEach(r => {
// r.childrens.forEach(i => {
// i.init();
// })
// r.resize();
// })
});
},
//
receive(callback) {
if (this.id != null) {
takeOverPageJob(this.id).then(res => {
callback();
}).catch(error => {
this.showErrorMessage(error)
})
}
},
getDetail() {
var that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getOverPageJobDetail(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)
setTimeout(r => {
that.resizeCollapse();
}, 100)
uni.hideLoading();
} 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)
})
})
//使
if (this.jobContent.useOnTheWayLocation == 'TRUE') {
this.submitJob();
} else {
//
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()
console.log("提交参数", JSON.stringify(params));
overPageSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成发料记录<br>" + 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.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 (this.jobContent
.useOnTheWayLocation ==
'TRUE') {
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;
}
subItem.recordList.push(record);
})
subList.push(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) {
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;
},
scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.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();
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
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);
},
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>
Loading…
Cancel
Save