Browse Source

page/repleinsh/job 文件迁移 8/8-10/25

hella_vue3
王志国 3 weeks ago
parent
commit
1ad14f5a3e
  1. 70
      src/pages/repleinsh/job/repleinshDetail.vue
  2. 514
      src/pages/repleinsh/job/repleinshDetailBatch.vue
  3. 351
      src/pages/repleinsh/job/repleinshJob.vue

70
src/pages/repleinsh/job/repleinshDetail.vue

@ -23,7 +23,7 @@
<requiredLocation ref="comScanLocation" title="目标库位" :locationCode="toLocationCode" @getLocation="scanLocationCode" :isShowEdit="jobContent.allowModifyLocation == 'TRUE'" :locationAreaTypeList="toLocationAreaTypeList"></requiredLocation>
</view>
<view class="uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="submit">提交</button>
<button class="btn_single_commit" hover-class="btn_commit_after" @click="clickSubmit">提交</button>
</view>
</view>
</view>
@ -151,7 +151,7 @@ const receive = (callback) => {
const getDetail = () => {
proxy.$modal.loading('加载中....')
getRepleinshJobDetail(id.value)
.then((res) => {
.then(async (res) => {
uni.hideLoading()
if (res.data == null) {
showMessage('未获取到详情')
@ -162,7 +162,7 @@ const getDetail = () => {
toLocationCode.value = subList.value[0].toLocationCode
console.log(`库位${toLocationCode.value}`)
toLocationAreaTypeList.value = getDirectoryItemArray(jobContent.value.toAreaTypes)
detailSource.value = getDataSource(detailSource.value, subList.value)
detailSource.value = await getDataSource(detailSource.value, subList.value)
if (scanMessage.value) {
comScanIssuePackRef.value.openScanPopupForJobSimulate(detailSource.value, jobContent.value, scanMessage.value)
}
@ -193,7 +193,56 @@ const resizeCollapse = () => {
})
})
}
const clickSubmit = () => {
let str = ""
var totalQty = 0;
var taskQty = 0;
detailSource.value.forEach(detail => {
detail.Items.forEach(item => {
taskQty = calc.add(taskQty, item.qty)
item.Locations.forEach(lco => {
lco.Batchs.forEach(batch => {
batch.Records.forEach(record => {
if (batch.qty != record.qty) {
let tempHandleQty = 0
if (record.qty) {
tempHandleQty = record.qty
} else {
tempHandleQty = 0
}
if (batch.qty != 0) {
str +=
`包装号【${record.packingNumber}】提交数量【${tempHandleQty}】与任务物料数量【${batch.qty}】不一致\n`
}
}
if (record) {
let hanleQty = record.qty ? record.qty : 0
totalQty = calc.add(totalQty, hanleQty)
}
})
})
})
})
})
if (str) {
str = '任务明细未全部完成,是否提交?\n' + str
}
if (totalQty != taskQty) {
str = "扫描数量[" + totalQty + "]与任务数量不一致[" + taskQty + "],是否提交"
comMessageRef.value.showQuestionMessage1(str, 'red', res => {
if (res) {
//
proxy.$throttle(submitJob, 2000, proxy)()
} else {
this.scanPopupGetFocus()
}
});
} else {
//
proxy.$throttle(submitJob, 2000, proxy)()
}
}
const submit = () => {
const scanCount = getScanCount(subList.value)
@ -240,12 +289,23 @@ const setSubmitParamsAndSubmit = () => {
const submitJob = () => {
proxy.$modal.loading('提交中....')
let itemCodes = []
detailSource.value.forEach(item => {
item.Items.forEach(cur=>{
itemCodes.push(cur.itemCode)
})
})
const params = setParams()
if (!params.subList || params.subList.length == 0) {
uni.hideLoading()
showErrorMessage("请扫描您需要提交的补料任务")
return
}
repleinshJobSubmit(params)
.then((res) => {
uni.hideLoading()
if (res.data) {
showCommitSuccessMessage(`提交成功<br>生成补料记录<br>${res.data}`)
showCommitSuccessMessage(`提交成功\n生成补料记录\n${res.data}`)
} else {
showErrorMessage(`提交失败[${res.msg}]`)
}
@ -273,8 +333,6 @@ const setParams = () => {
const record = {}
record.handleQty = r.qty
// record.fromPackingNumber = r
// .packingNumber;
record.fromBatch = r.batch
record.fromContainerNumber = r.containerNumber

514
src/pages/repleinsh/job/repleinshDetailBatch.vue

@ -0,0 +1,514 @@
<template>
<view class="page-wraper">
<view class="page-header">
<view class="header-view">
<view class="header_job_top">
<job-top :dataContent="jobContent"></job-top>
</view>
<view class="header_item">
申请单号 : {{jobContent.requestNumber}}
</view>
</view>
</view>
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<!-- <view v-for="(toLocation, index) in detailSource">
<comRepleishDetailCardBatch ref='comIssueDetailCard' :dataContent="toLocation" @updateData='updateData'></comRepleishDetailCardBatch>
</view> -->
<comRepleishDetailCardBatch ref='comIssueDetailCard' :dataContent="detailSource" @updateData='updateData'>
</comRepleishDetailCardBatch>
</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="">
<requiredLocation ref='comScanLocation' title="目标库位" :locationCode="toLocationCode"
@getLocation='scanLocationCode' :isShowEdit="jobContent.allowModifyLocation == 'TRUE'"
:locationAreaTypeList="toLocationAreaTypeList"></requiredLocation>
</view>
<view class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="clickSubmit">提交</button>
</view>
</view>
</view>
<win-scan-button @goScan='openScanDetailPopup'></win-scan-button>
<comScanReplishPackBatch ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'>
</comScanReplishPackBatch>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
takeRepleinshJob,
cancleTakeRepleinshJob,
getRepleinshJobDetail,
repleinshJobSubmit
} from '@/api/request2.js';
import {
goHome,
navigateBack,
getRemoveOption,
getCurrDateTime,
getDirectoryItemArray,
getPackingNumberAndBatch,
deepCopyData
} from '@/common/basic.js';
import {
getDataSource
} from '@/pages/issue/js/issue.js';
import {
calc
} from '@/common/calc.js';
import {
getManagementPrecisions
} from '@/common/balance.js';
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comRepleishDetailCard from '@/pages/repleinsh/coms/comRepleishDetailCard.vue'
import comRepleishDetailCardBatch from '@/pages/repleinsh/coms/comRepleishDetailCardBatch.vue'
import comScanReplishPack from '@/pages/repleinsh/coms/comScanReplishPack.vue'
import comScanReplishPackBatch from '@/pages/repleinsh/coms/comScanReplishPackBatch.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
export default {
name: 'issueDetail',
components: {
jobDetailPopup,
winScanButton,
comRepleishDetailCard,
comRepleishDetailCardBatch,
comScanReplishPack,
requiredLocation,
jobTop,
comScanReplishPackBatch
},
data() {
return {
id: '',
jobContent: {}, //
subList: [], //subList
detailSource: [], //
detailOptions: [],
scanOptions: [],
toLocationCode: '',
toLocationAreaTypeList: [],
jobStatus: "",
scanMessage: "",
managementType: ''
};
},
props: {
},
onLoad(option) {
uni.setNavigationBarTitle({
title: option.title + '详情'
})
this.id = option.id;
this.scanMessage = option.scanMessage
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") {
//
cancleTakeRepleinshJob(this.id).then(res => {
uni.navigateBack();
}).catch(error => {
uni.navigateBack();
})
} else {
uni.navigateBack();
}
return true;
}
},
watch: {
locationTypes(newVal) {
let value = newVal;
},
},
mounted: function() {
},
methods: {
//
receive(callback) {
if (this.id != null) {
takeRepleinshJob(this.id).then(res => {
callback();
}).catch(error => {
this.showErrorMessage(error)
})
}
},
getDetail() {
var that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
getRepleinshJobDetail(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.toLocationCode = that.subList[0].toLocationCode
that.toLocationAreaTypeList = getDirectoryItemArray(that.jobContent.toAreaTypes)
that.detailSource = res.data;
if (that.scanMessage) {
this.$refs.comScanIssuePack.openScanPopupForJobSimulate(this.detailSource, this
.jobContent, that.scanMessage);
}
let timer = setTimeout(r => {
that.resizeCollapse();
if (timer) {
timer = null
clearTimeout(timer)
}
}, 1000)
} else {
that.showMessage('列表数据为0');
}
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
closeScan() {
this.resizeCollapse();
},
resizeCollapse() {
},
clickSubmit() {
let str = ""
var scanCount = this.getScanCount(this.subList);
if(!scanCount){
this.$refs.comMessage.showErrorMessage('扫描数量为0,请先扫描', res => {
});
return;
}
this.detailSource.subList.forEach(item => {
if (item.handleQty != item.qty) {
str +=
"扫描数量[" + item.handleQty + "]与任务数量不一致[" + item.qty + "],是否提交"
}
})
if (str) {
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
if (res) {
//
this.$throttle(this.submitJob, 2000, this)()
} else {
this.scanPopupGetFocus()
}
});
} else {
//
this.$throttle(this.submitJob, 2000, this)()
}
},
submit() {
var scanCount = this.getScanCount(this.subList);
// //
// if (this.jobContent.allowPartialComplete == "TRUE") {
// // 00
// if (scanCount == 0) {
// this.$refs.comMessage.showQuestionMessage("0,?", res => {
// if (res) {
// this.setSubmitParamsAndSubmit();
// }
// })
// } else {
// this.setSubmitParamsAndSubmit();
// }
// } else {
//
if (scanCount == 0) {
this.showErrorMessage("扫描数为0,请先扫描")
} else {
this.setSubmitParamsAndSubmit();
}
// }
},
setSubmitParamsAndSubmit() {
//
this.submitJob();
//使
// 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);
// }
// });
// }
},
async submitJob() {
uni.showLoading({
title: "提交中....",
mask: true
});
var itemCodes = []
this.detailSource.subList.forEach(item => {
itemCodes.push(item.itemCode)
})
await getManagementPrecisions(itemCodes, this.toLocationCode, res => {
if (res.success) {
this.managementList = res.list;
var params = this.setParams()
console.log("提交参数", params);
if (!params.subList || params.subList.length == 0) {
uni.hideLoading()
this.showErrorMessage("请扫描您需要提交的补料任务")
return
}
repleinshJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功\n生成补料记录\n" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
}
})
},
setParams() {
var commitSubList = []
var createTime = getCurrDateTime();
var creator = this.$store.state.user.id
this.detailSource.subList.forEach(r => {
if(r.scaned){
let subItem = {
...r
}
subItem.recordList = []
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 = this
.toLocationCode;
record.supplierCode = r.supplierCode;
record.fromParentPackingNumber = r
.parentPackingNumber;
record.fromPackingNumber = r
.packingNumber;
record.toPackingNumber = r
.packingNumber;
record.toPackUnit = r.packUnit;
record.toBatch = r.batch;
var info = getPackingNumberAndBatch(this.managementList, r.itemCode,r.packingNumber, r.batch);
record.toPackingNumber = info.packingNumber;
record.packingNumber = info.packingNumber;
record.fromPackingNumber = info.packingNumber;
subItem.toPackingNumber = info.packingNumber;
subItem.packingNumber = info.packingNumber;
subItem.fromPackingNumber = info.packingNumber;
subItem.recordList.push(record);
commitSubList.push(deepCopyData(subItem));
}
})
this.jobContent.subList = commitSubList
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.subList.find(r => r.toLocationCode == record.toLocationCode);
// this.detailSource.subList.forEach(r =>{
// if(r.itemCode == record.itemCode){
// r.handleQty = record.qty
// }
// });
console.log(this.detailSource.subList)
},
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();
},
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();
},
scanLocationCode(location, code) {
this.toLocationCode = code
},
getScanCount(subList) {
var scanCount = 0;
this.detailSource.subList.forEach(toLocationCode => {
scanCount+=calc.add(scanCount,parseFloat(toLocationCode.handleQty))
})
console.log(scanCount)
return scanCount;
}
}
};
</script>
<style scoped lang="scss">
</style>

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

@ -1,11 +1,10 @@
<template>
<view class="">
<com-empty-view v-if="jobList.length == 0"></com-empty-view>
<job-filter :isShowFromLocationCode="true" :isShowProductionLineCode="false"
:productionline="productionlineList" ref="filter" otherTitle="" @switchChangeToday="switchChangeToday"
@switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday"
:checkedWaitTask="checkedWaitTask" :isShowItemCode="true" @productionLineCode="productionLineCode"
@fromLocationCode="fromLocationCodeQuery" :isShowQurery='true' @onQuery="getListByFilter">
<job-filter :isShowFromLocationCode="true" :isShowFromAreaCode="true" :isShowToAreaCode="true"
:isShowProductionLineCode="false"
ref="filter" otherTitle="" :isShowItemCode="true"
@onQuery="getListByFilter" :isShowQurery='true'>
</job-filter>
<view v-if="jobList.length > 0" class="u-m-20">
<u-swipe-action :show="item.show" :index="index" v-for="(item, index) in jobList" :key="index" :options="item.status == '2' ? detailGiveupOptions : item.status == '1' ? detailCloseOptions : detailOptions" bg-color="rgba(255,255,255,0)" class="u-m-b-20" @click="swipeClick">
@ -30,9 +29,9 @@ import {getRepleinshJobList, cancleTakeRepleinshJob, closeTakeRepleinshJob, getI
import { goHome, updateTitle } from '@/common/basic.js'
import { getDetailOption, getDetailGiveupOption, getDetailCloseOption } from '@/common/array.js'
import {
getBusinessType
} from '@/common/record.js';
import {planRefreshTime, repleinshJobFilter} from '@/common/config.js';
import {getManagementPrecisions} from '@/common/balance.js';
import {getBusinessType} from '@/common/record.js';
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import jobFilter from '@/mycomponents/job/jobFilter.vue'
@ -77,9 +76,15 @@ const productionLineCode = ref('')
const productionlineList = ref([])
const fromLocationCode = ref('')
const filterItemCode = ref('')
const timer = ref(null)
const managementList = ref([])
const managementType = ref('')
const fromInventoryStatuses = ref('')
const fromLocationAreaTypeList = ref([])
onShow(() => {
nextTick(() => {
getList('refresh',fromLocationCode.value, filterItemCode.value)
getList('refresh')
})
})
onLoad((option) => {
@ -96,10 +101,10 @@ onReachBottom(() => {
if (loadingType.value == 'loading' || loadingType.value == 'nomore') {
return
}
getList('more',fromLocationCode.value,filterItemCode.value)
getList('more')
})
onPullDownRefresh(() => {
getList('refresh',fromLocationCode.value,filterItemCode.value)
getList('refresh')
})
// 退
onBackPress((options) => {
@ -115,54 +120,92 @@ onNavigationBarButtonTap((e) => {
if (e.index === 0) {
goHome()
} else if (e.index == 1) {
filter.value.openFilter()
filter.value.openFilterParams(uni.getStorageSync(repleinshJobFilter))
}
})
const getList = (type, fromLocationCode = '', filterItemCode = '') => {
proxy.$modal.loading('加载中­....')
loadingType.value = 'loading'
if (type === 'refresh') {
pageNo.value = 1
jobList.value = []
const timerRefresh = ()=> {
getList('refresh')
stopRefresh();
timer.value = setInterval(function() {
getList('refresh')
}, planRefreshTime)
}
const stopRefresh = ()=> {
if (timer.value) {
clearInterval(timer.value);
timer.value = null;
}
}
const setQueryParam = ()=> {
let filterParams = []
const queryParams = uni.getStorageSync(repleinshJobFilter)
const filters = []
if (checkedToday.value) {
filters.push({
column: 'create_time',
action: 'betweeen',
value: todayTime.value
//
if (queryParams.creationTime ) {
filterParams.push({
column: "create_time",
action: "betweeen",
value: queryParams.creationTime
})
}
filters.push({
column: 'status',
action: 'in',
value: status.value
})
filters.push({
column: 'accept_user_id',
action: '==',
value: store.id
})
if (fromLocationCode != '') {
//
filters.push({
column: 'fromLocationCode',
action: '==',
value: fromLocationCode
//
if (queryParams.status) {
filterParams.push({
column: "status",
action: "in",
value: queryParams.status
})
}else {
filterParams.push({
column: "status",
action: "in",
value: "1,2"
})
}
//
if (queryParams.fromLocationCode) {
filterParams.push({
column: "fromLocationCode",
action: "==",
value: queryParams.fromLocationCode
})
}
if (filterItemCode != '') {
//
filters.push({
//
if (queryParams.itemCode) {
filterParams.push({
column: "itemCode",
action: "like",
value: filterItemCode
value: queryParams.itemCode
})
}
//
if (queryParams.fromAreaCode) {
filterParams.push({
column: "fromAreaCode",
action: "==",
value: queryParams.fromAreaCode
})
}
//
if (queryParams.toAreaCode) {
filterParams.push({
column: "toAreaCode",
action: "==",
value: queryParams.toAreaCode
})
}
return filterParams;
}
const getList = (type, fromLocationCode = '', filterItemCode = '') => {
proxy.$modal.loading('加载中­....')
loadingType.value = 'loading'
if (type === 'refresh') {
pageNo.value = 1
jobList.value = []
}
const queryFiltersParams = setQueryParam()
const params = {
filters,
filters:queryFiltersParams,
pageNo: pageNo.value,
pageSize: pageSize.value,
// sort: 'number',
@ -193,7 +236,7 @@ const getList = (type, fromLocationCode = '', filterItemCode = '') => {
loadingType.value = ''
updateTitle(title.value)
uni.hideLoading()
showErrorMessage(error)
showMessage(error)
})
}
const fromLocationCodeQuery = (fromLocationCode) => {
@ -202,8 +245,68 @@ const fromLocationCodeQuery = (fromLocationCode) => {
getList('refresh', fromLocationCode.value, filterItemCode.value)
}
const openJobDetail = (item, scanMessageParams = '') => {
proxy.$tab.navigateTo(`./repleinshDetail?id=${item.masterId}&status=${item.status}&scanMessage=${scanMessage.value}&title=${title.value}`)
scanMessage.value = ''
getJobInfoByNumber(item.number,scanMessageParams, item)
}
const getJobInfoByNumber = (number,scanMessage, item)=> {
proxy.$modal.loading('加载中­....')
let filters = []
filters.push({
column: "status",
action: "in",
value: '1,2'
})
filters.push({
column: "number",
action: "==",
value: number
})
const params = {
filters: filters,
pageNo: 1,
pageSize: pageSize.value,
}
getRepleinshJobList(params).then(res => {
uni.hideLoading();
if (res.data.list.length == 0) {
showMessage('未查找到' + '【' + number + '】的发料任务');
} else {
let result = res.data.list[0];
if(result.acceptUserId&&result.acceptUserId!=store.id){
comMessageRef.value.showErrorMessage("任务号["+result.number+"]已经被["+result.acceptUserName+"]承接,无法执行", res => {
if (res) {
scanPopup.value?.getfocus()
getList('refresh')
}
});
return;
}
getManagementPrecisions([item.itemCode], item.fromLocationCode, ret => {
if (ret.success) {
managementList.value = ret.list;
managementType.value = managementList.value.some(cur => cur.ManagementPrecision == 'BY_BATCH') ?
'BY_BATCH' : ''
if (managementType.value == 'BY_BATCH') {
uni.navigateTo({
url: './repleinshDetailBatch?id=' + result.masterId + '&status=' + result.status +
'&scanMessage=' +
scanMessage + '&title=' + title.value
});
} else {
uni.navigateTo({
url: './repleinshDetail?id=' + result.masterId + '&status=' + result.status +
'&scanMessage=' +
scanMessage + '&title=' + title.value
});
}
}
})
scanMessage.value = ""
}
}).catch(error => {
uni.hideLoading();
showMessage(error);
})
}
const selectedItem = (item) => {
openJobDetail(item)
@ -278,59 +381,7 @@ const closeJob = (id) => {
showMessage(error)
})
}
const switchChangeToday = (state, creationTime) => {
checkedToday.value = state
todayTime.value = creationTime
getList('refresh')
}
const switchChangeWait = (state, jobStatus) => {
checkedWaitTask.value = state;
waitTask.value = state
status.value = jobStatus
getList('refresh')
}
const getScanNumber = (code) => {
getDataListByType(code)
}
const getDataListByType = (code) => {
proxy.$modal.loading('加载中­....')
const filters = []
filters.push({
column: 'status',
action: 'in',
value: '1,2'
})
filters.push({
column: 'number',
action: '==',
value: code
})
filters.push({
column: 'accept_user_id',
action: '==',
value: store.id
})
const params = {
filters,
pageNo: 1,
pageSize: 100,
sort: 'number',
by: 'desc'
}
getRepleinshJobList(params)
.then((res) => {
uni.hideLoading()
if (res.data.list.length == 0) {
showMessage('未查找到' + `${code}】的补料任务`)
} else {
openJobDetail(res.data.list[0])
}
})
.catch((error) => {
uni.hideLoading()
showMessage(error)
})
}
const showMessage = (message) => {
comMessageRef.value.showErrorMessage(message, (res) => {
if (res) {
@ -345,79 +396,8 @@ const openScanPopup = () => {
}
}
const getListByFilter = ( param )=>{
uni.showLoading({
title: "加载中­....",
mask: true
});
let filters = []
if (checkedToday.value) {
filters.push({
column: "create_time",
action: "betweeen",
value: todayTime.value
})
}
filters.push({
column: "status",
action: "in",
value: status.value
})
filters.push({
column: "accept_user_id",
action: "==",
value:store.id
})
if (param.fromLocationCode) {
//
fromLocationCode.value = param.fromLocationCode
filters.push({
column: "fromLocationCode",
action: "==",
value: param.fromLocationCode
})
}else{
fromLocationCode.value = ''
}
// if (param.productionLine) {
// // 线
// filters.push({
// column: "productionLineCode",
// action: "==",
// value: param.productionLine
// })
// }
if (param.itemCode) {
//
filterItemCode.value = param.itemCode
filters.push({
column: "itemCode",
action: "like",
value: param.itemCode
})
}else{
filterItemCode.value = ''
}
let params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getList('refresh', fromLocationCode.value, filterItemCode.value)
// getIssueJobList(params).then(res => {
// uni.hideLoading();
// if (res.data.total == 0) {
// showMessage('');
// } else if (res.data.total == 1) {
// openJobDetail(res.data.list[0]);
// } else {
// showItemList(res.data.list);
// }
// }).catch(error => {
// showMessage(error)
// })
uni.setStorageSync(repleinshJobFilter,params)
getList('refresh')
}
const selectItem = (item) => {
scanPopup.value.closeScanPopup()
@ -460,11 +440,6 @@ const getScanResult = (result) => {
action: '==',
value: result.label.itemCode
},
{
column: 'accept_user_id',
action: '==',
value: store.id
},
{
column: "fromLocationCode",
action: "==",
@ -496,11 +471,11 @@ const getScanResult = (result) => {
selectItem(list[0])
}
} else {
showMessage(`按来源库位[${balance.locationCode}]批次[${result.label.batch}]物料号[${result.label.itemCode}]未查找到任务<br>` + `扫描[${result.scanMessage}]`)
showMessage(`按来源库位[${balance.locationCode}]批次[${result.label.batch}]物料号[${result.label.itemCode}]未查找到任务\n` + `扫描[${result.scanMessage}]`)
}
})
.catch((error) => {
showMessage(`${error}<br>扫描[${result.scanMessage}]`)
showMessage(`${error}\n扫描[${result.scanMessage}]`)
})
} catch (e) {
showMessage(e.message)
@ -508,17 +483,17 @@ const getScanResult = (result) => {
}
}
const getBusinessTypeFunc = ()=> {
getBusinessType(this.businessTypeCode, res => {
getBusinessType(businessTypeCode.value, res => {
if (res.success) {
this.businessType = res.businessType;
this.fromInventoryStatuses = getDirectoryItemArray(res.fromInventoryStatuses).split(',');
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList
// this.openScanPopup();
businessType.value = res.businessType;
fromInventoryStatuses.value = res.fromInventoryStatuses.split(',');
fromLocationAreaTypeList.value = res.fromLocationAreaTypeList
} else {
this.showErrorMessage(res.message)
showMessage(res.message)
}
});
}
</script>
<style scoped lang="scss"></style>

Loading…
Cancel
Save