Browse Source

Merge branch 'master_hella' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-uniapp into master_hella

hella_online_20240924
wangyufei 2 months ago
parent
commit
5d6e4be373
  1. 256
      src/pages/count/job/countJob.vue
  2. 124
      src/pages/fg/receiptByPlan.vue
  3. 46
      src/pages/fg/receiptNoPlan.vue
  4. 2
      src/pages/unPlanned/coms/comIssueJobCard.vue

256
src/pages/count/job/countJob.vue

@ -1,15 +1,12 @@
<template>
<view class="">
<com-empty-view v-if="jobList.length==0"></com-empty-view>
<job-filter ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday"
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask">
<job-filter ref="filter" :isShowFromLocationCode="true" @onQuery="getListByFilter" :isShowQurery="true">
</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"
<uni-swipe-action-item :right-options="item.status=='2'?detailGiveupOptions:detailOptions"
@click="swipeClick($event,item)">
<com-count-job-card :dataContent="item" @click='openJobDetail(item)'></com-count-job-card>
</uni-swipe-action-item>
@ -22,7 +19,7 @@
<uni-load-more :status="loadingType" />
</view>
<win-scan-button @goScan='openScanPopup' v-if="jobList.length>0"></win-scan-button>
<winScanPackJob title="库位" ref="scanPopup" @getResult='getScanResult' >
<winScanPackJob title="库位" ref="scanPopup" @getResult='getScanResult'>
</winScanPackJob>
<jobList ref="jobList" @selectItem="selectItem"></jobList>
<comMessage ref="comMessage"></comMessage>
@ -80,10 +77,15 @@
status: '1,2', //
detailOptions: [],
detailGiveupOptions: [],
title:''
title: '',
queryParams: {
creationTime: "",
status: "1,2",
fromLocationCode: ""
}
};
},
onLoad(option){
onLoad(option) {
this.title = option.title
},
@ -142,44 +144,14 @@
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
})
filters.push({
column: "countSplitType",
action: "==",
value: "locationCode"
})
filters.push({
column: "isOpenCount",
action: "==",
value: "TRUE"
})
filters.push({
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
})
var queryFiltersParams = this.setQueryParam()
var params = {
filters: filters,
filters: queryFiltersParams,
pageNo: this.pageNo,
pageSize: this.pageSize,
sort:"number",
by:"DESC"
sort: "number",
by: "DESC"
}
getCountJobList(params).then(res => {
@ -190,7 +162,7 @@
var list = res.data.list;
this.totalCount = res.data.total
updateTitle(this.title+"(" + this.totalCount + ")");
updateTitle(this.title + "(" + this.totalCount + ")");
this.loadingType = "loadmore";
if (list == null || list.length == 0) {
this.loadingType = "nomore";
@ -215,19 +187,82 @@
// url: './countDetail?id=' + item.id + '&status=' + item.status
// });
//
if(item.isOpenCount=="TRUE"){
if (item.isOpenCount == "TRUE") {
uni.navigateTo({
url: './countLightDetail?id=' + item.id + '&status=' + item.status+'&title='+this.title
url: './countLightDetail?id=' + item.id + '&status=' + item.status + '&title=' + this.title
});
}else {
} else {
//
uni.navigateTo({
url: './countBlindDetail?id=' + item.id + '&status=' + item.status+'&title='+this.title
url: './countBlindDetail?id=' + item.id + '&status=' + item.status + '&title=' + this.title
});
}
},
setQueryParam() {
var filterParams = []
//
if (this.queryParams.creationTime) {
filterParams.push({
column: "create_time",
action: "betweeen",
value: this.queryParams.creationTime
})
}
//
if (this.queryParams.status) {
filterParams.push({
column: "status",
action: "in",
value: this.queryParams.status
})
} else {
filterParams.push({
column: "status",
action: "in",
value: "1,2"
})
}
//
if (this.queryParams.fromLocationCode) {
filterParams.push({
column: "countSplitCode",
action: "==",
value: this.queryParams.fromLocationCode
})
}
filterParams.push({
column: "countSplitType",
action: "==",
value: "locationCode"
})
filterParams.push({
column: "isOpenCount",
action: "==",
value: "TRUE"
})
filterParams.push({
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
})
return filterParams;
},
getListByFilter(params) {
this.queryParams.creationTime = params.creationTime;
this.queryParams.status = params.status;
this.queryParams.fromLocationCode = params.fromLocationCode;
this.getList('refresh')
},
showItemList(itemList) {
this.$refs.jobListPopup.openPopup(itemList);
@ -236,15 +271,15 @@
selectedItem(item) {
this.openJobDetail(item);
},
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
},
selectItem(item) {
this.$refs.scanPopup.closeScanPopup();
this.openJobDetail(item)
},
swipeClick(e, dataContent) {
@ -266,12 +301,12 @@
cancleJob(id) {
cancleTakeCountJob(id).then(res => {
if(res.data){
if (res.data) {
this.getList("refresh")
uni.showToast({
title:"放弃任务成功"
title: "放弃任务成功"
})
}else {
} else {
this.showMessage("放弃任务失败")
}
}).catch(error => {
@ -279,77 +314,6 @@
})
},
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
})
filters.push({
column: "countSplitType",
action: "==",
value: "locationCode"
})
filters.push({
column: "isOpenCount",
action: "==",
value: "TRUE"
})
filters.push({
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
sort:"number",
by:"DESC"
}
getCountJobList(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) {
@ -357,8 +321,8 @@
}
});
},
getScanResult(result){
getScanResult(result) {
let that = this;
uni.showLoading({
title: "加载中....",
@ -370,57 +334,57 @@
action: "in",
value: '1,2'
})
filters.push({
column: "countSplitType",
action: "==",
value: "locationCode"
})
filters.push({
column: "isOpenCount",
action: "==",
value: "TRUE"
})
filters.push({
column: "countSplitCode",
action: "==",
value: result.label.code
})
filters.push({
column: "accept_user_id",
action: "==",
value: this.$store.state.user.id
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 1000,
sort:"number",
by:"DESC"
sort: "number",
by: "DESC"
}
getCountJobList(params).then(res => {
uni.hideLoading();
let resultList = res.data.list;
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)
}
})
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) {
that.showMessage('未查找到库位' + '【' + result.label.code + '】的盘点任务');
} else if (list.length == 1) {
that.selectItem(list[0]);
}else {
} else {
that.$refs.jobList.openList(list)
}
}).catch(error => {
@ -434,4 +398,4 @@
<style scoped lang="scss">
</style>
</style>

124
src/pages/fg/receiptByPlan.vue

@ -101,6 +101,7 @@
import {
isCheckMesCode,
planReceiptSubmit,
createByPlanSubmit,
createPutawayRequestByPlan,
createInspectRequestByPlan,
getPlanByNumber,
@ -156,7 +157,9 @@
allList: [],
index: 1,
loadingType: "",
pageSize: 500
pageSize: 500,
settingPutAwayRequestSwitch:true,
settingPutAwayInspectSwitch :true
};
},
@ -211,10 +214,13 @@
packUnit: result.packUnit,
workStationCode: result.workStationCode,
fgLocationCode: result.fgLocationCode,
putAwayRequestSwitch:result.putAwayRequestSwitch,
putAwayInspectSwitch:result.putAwayInspectSwitch,
putAwayRequestSwitch: result.putAwayRequestSwitch,
putAwayInspectSwitch: result.putAwayInspectSwitch,
subList: []
}
this.settingPutAwayRequestSwitch =result.putAwayRequestSwitch
this.settingPutAwayInspectSwitch =result.putAwayInspectSwitch
},
initList() {
@ -268,19 +274,19 @@
},
async commit() {
let list=[]
try {
let startTime = new Date()
uni.showLoading({
title: "提交中...",
mask: true
})
let params = this.setParams()
console.log(JSON.stringify(params))
let list = []
var planData = await planReceiptSubmit(params)
console.log('planData', planData)
if (planData.data && planData.data.length > 0) {
planData.data.forEach(item => {
var planData = await createByPlanSubmit(params)
if (planData.data.tb1&&planData.data.tb1.length>0) {
planData.data.tb1.forEach(item => {
list.push({
itemCode: item.itemCode, //
itemName: item.itemName, //
@ -300,65 +306,36 @@
})
})
} else {
throw new Error("提交失败")
}
//
if(this.dataContent.putAwayRequestSwitch){
if(list.length>0&&list[0].requestNumber){
await createPutawayRequestByPlan(list[0].requestNumber)
}
}
//
if(this.dataContent.putAwayInspectSwitch){
if(list.length>0&&list[0].requestNumber){
await createInspectRequestByPlan(list[0].requestNumber)
}
throw new Error("提交失败未获取到打印信息")
}
var queryParams = {
filters: [{
column: "number",
action: "==",
value: this.dataContent.planNumber
}],
pageNo: 1,
pageSize: 100,
}
let isAllSubmit = Number(Number(this.dataContent.goodQty) + Number(this.showList.length)) ==
Number(this.dataContent.planQty)
var planeInfo = await getPlanByNumber(queryParams);
if (planeInfo.data && planeInfo.data.list.length > 0) {
if (planeInfo.data.list[0].goodQty >= planeInfo.data.list[0].planQty) {
this.clear();
if (planData.data.tb2 && planData.data.tb2.list.length > 0) {
var planInfo = planData.data.tb2.list[0]
//
if (planInfo.goodQty >= planInfo.planQty) {
uni.showToast({
title:"计划已完成",
duration:2000
})
this.clearData()
} else {
this.dataContent.planNumber = planeInfo.data.list[0].number;
this.dataContent.handleQty = 0;
this.dataContent.planQty = planeInfo.data.list[0].planQty
this.dataContent.goodQty = planeInfo.data.list[0].goodQty
this.dataContent.noGoodQty = calc.sub(planeInfo.data.list[0].planQty, planeInfo.data.list[
0].goodQty),
this.dataContent.subList = []
//
this.dataContent.planQty = planInfo.planQty
this.dataContent.goodQty = planInfo.goodQty
this.dataContent.noGoodQty = calc.sub(planInfo.planQty, planInfo.goodQty),
this.dataContent.handleQty = 0;
this.dataContent.subList = []
this.showList = [];
this.allList = []
this.index = 1
}
}
uni.hideLoading()
if (isAllSubmit) {
this.clearData()
} else {
this.showList = [];
this.allList = [];
this.index = 1;
this.dataContent.handleQty = 0;
throw new Error("提交失败未获取到计划信息")
}
var hintMsg ="提交成功\n生成装配收货记录\n";
if(list.length>0&&list[0].requestNumber){
uni.hideLoading()
var hintMsg = "提交成功\n生成装配收货记录\n";
if (list.length > 0 && list[0].requestNumber) {
hintMsg += list[0].requestNumber
}
nextTick(() => {
@ -369,15 +346,33 @@
uni.hideLoading()
var hint = error.message ? error.message : error
if (hint.indexOf('请返回开工阶段') > -1) {
this.showErrorMessage('计划已完成')
this.showMessage('计划已完成')
this.clearData()
this.openFg();
} else {
this.showErrorMessage(hint)
}
}
this.startSetting(list)
},
async startSetting(list){
//
if (this.settingPutAwayRequestSwitch) {
if (list.length > 0 && list[0].requestNumber) {
await createPutawayRequestByPlan(list[0].requestNumber)
}
}
//
if (this.settingPutAwayInspectSwitch) {
if (list.length > 0 && list[0].requestNumber) {
await createInspectRequestByPlan(list[0].requestNumber)
}
}
},
setParams() {
this.allList.forEach(res => {
@ -558,6 +553,13 @@
this.scanPopupGetFocus()
}
});
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {
this.openFg();
}
});
}
}

46
src/pages/fg/receiptNoPlan.vue

@ -97,7 +97,7 @@
<script>
import {
isCheckMesCode,
planReceiptSubmit,
createByPlanSubmit,
createPutawayRequestByPlan,
createInspectRequestByPlan,
getPlanByNumber,
@ -150,6 +150,8 @@
loadingType: "",
pageSize: 20,
scanedQty: 0,
settingPutAwayRequestSwitch:true,
settingPutAwayInspectSwitch :true
};
},
@ -214,6 +216,8 @@
putAwayRequestSwitch:result.putAwayRequestSwitch,
putAwayInspectSwitch:result.putAwayInspectSwitch
}
this.settingPutAwayRequestSwitch =result.putAwayRequestSwitch
this.settingPutAwayInspectSwitch =result.putAwayInspectSwitch
},
initList() {
@ -264,6 +268,7 @@
},
async commit() {
let list = []
try {
uni.showLoading({
title: "提交中...",
@ -271,12 +276,10 @@
})
let params = this.setParams()
console.log(JSON.stringify(params))
let list = []
var planData = await planReceiptSubmit(params)
if (planData.data&&planData.data.length>0) {
planData.data.forEach(item => {
var planData = await createByPlanSubmit(params)
if (planData.data.tb1&&planData.data.tb1.length>0) {
planData.data.tb1.forEach(item => {
list.push({
itemCode: item.itemCode, //
itemName: item.itemName, //
@ -298,19 +301,6 @@
} else {
throw new Error("提交失败")
}
//
if(this.dataContent.putAwayRequestSwitch){
if(list.length>0&&list[0].requestNumber){
await createPutawayRequestByPlan(list[0].requestNumber)
}
}
//
if(this.dataContent.putAwayInspectSwitch){
if(list.length>0&&list[0].requestNumber){
await createInspectRequestByPlan(list[0].requestNumber)
}
}
var hintMsg ="提交成功\n生成装配收货记录\n";
if(list.length>0&&list[0].requestNumber){
hintMsg += list[0].requestNumber
@ -327,6 +317,24 @@
var hint = error.message ? error.message : error
this.showErrorMessage(hint)
}
this.startSetting(list)
},
async startSetting(list){
//
if (this.settingPutAwayRequestSwitch) {
if (list.length > 0 && list[0].requestNumber) {
await createPutawayRequestByPlan(list[0].requestNumber)
}
}
//
if (this.settingPutAwayInspectSwitch) {
if (list.length > 0 && list[0].requestNumber) {
await createInspectRequestByPlan(list[0].requestNumber)
}
}
console.log("提交所有完成"+getCurrDateTime())
},
setParams() {

2
src/pages/unPlanned/coms/comIssueJobCard.vue

@ -5,7 +5,7 @@
<view class="task_text">
<view class="card_view">
<text class="card_packing_code ">目的地</text>
<text class="card_content ">{{dataContent.destination}}</text>
<text class="card_content" style="word-wrap: break-word; word-break: break-all;" >{{dataContent.destination}}</text>
</view>
</view>
</view>

Loading…
Cancel
Save