diff --git a/src/pages/issue/job/issueDetail.vue b/src/pages/issue/job/issueDetail.vue
index 5ec0d283..3ce7b87b 100644
--- a/src/pages/issue/job/issueDetail.vue
+++ b/src/pages/issue/job/issueDetail.vue
@@ -23,8 +23,16 @@
-
-
+
+
+
+
@@ -32,7 +40,7 @@
@@ -55,13 +63,12 @@ import { getManagementPrecisions } from '@/common/balance.js'
import { calc } from '@/common/calc.js'
-import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import comIssueDetailCard from '@/pages/issue/coms/comIssueDetailCard.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'
-import balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
+import comIssueDetailCardBatch from '@/pages/issue/coms/comIssueDetailCardBatch.vue'
import { useCountStore } from '@/store'
// 获取自定义的store
const store = useCountStore()
@@ -74,12 +81,12 @@ const detailOptions = ref([])
const scanOptions = ref([])
const jobStatus = ref('')
const scanMessage = ref('')
-const scanPopup = ref()
const comScanIssuePackRef = ref()
const comMessageRef = ref()
const managementList = ref([])
-
+const managementType = ref('')
const comIssueDetailCardRef = ref()
+const fromLocationCode = ref()
onLoad((option) => {
uni.setNavigationBarTitle({
title: `${option.title}详情`
@@ -154,10 +161,26 @@ const getDetail = () => {
subList.value = res.data.subList
detailSource.value = getDataSource(detailSource.value, subList.value)
jobContent.value.detailToLocationCode = res.data.subList[0].toLocationCode
+ fromLocationCode.value = subList.value[0].fromLocationCode
// 任务中已经扫描,模拟扫描赋值
if (scanMessage.value) {
openScanPopupSimulate(scanMessage.value)
}
+ //获取管理模式,封装参数
+ let itemCodes = []
+ detailSource.value.forEach(item => {
+ item.Items.forEach((cur) => {
+ itemCodes.push(cur.itemCode)
+ })
+ item.scaned = false
+ })
+ getManagementPrecisions(itemCodes, fromLocationCode.value, res => {
+ if (res.success) {
+ managementList.value = res.list;
+ managementType.value = managementList.value.some(item => item.ManagementPrecision ==
+ 'BY_BATCH') ? 'BY_BATCH' : ''
+ }
+ })
setTimeout((r) => {
resizeCollapse()
}, 100)
@@ -210,7 +233,7 @@ const submitJob = () => {
.then((res) => {
uni.hideLoading()
if (res.data) {
- showCommitSuccessMessage(`提交成功
生成发料记录
${res.data}`)
+ showCommitSuccessMessage(`提交成功\n生成发料记录\n${res.data}`)
} else {
showErrorMessage(`提交失败[${res.msg}]`)
}
@@ -259,6 +282,8 @@ const setParams = () => {
} else {
const info = getPackingNumberAndBatch(managementList.value, r.itemCode, r.packingNumber, r.batch)
record.toPackingNumber = info.packingNumber
+ record.packingNumber = info.packingNumber;
+ record.fromPackingNumber = info.packingNumber;
record.toBatch = info.batch
}
record.fromParentPackingNumber = r.parentPackingNumber
@@ -324,38 +349,77 @@ const updateData = (record) => {
}
const afterScan = () => {
resizeCollapse()
+ autoCommit()
+}
+const autoCommit = ()=>{
+ let str = ""
+ let totalQty = 0;
+ let taskQty = 0;
detailSource.value.forEach((detail) => {
- const s = ''
detail.Items.forEach((item) => {
- let totalHandleQty = 0
- let isHandleEmpty = false // 多个库位时 handleQty =0;
+ taskQty = calc.add(taskQty,item.qty)
item.Locations.forEach((lco) => {
lco.Batchs.forEach((batch) => {
- if (batch.handleQty != 0) {
- totalHandleQty = calc.add(totalHandleQty, batch.handleQty)
- } else {
- isHandleEmpty = true
- }
+ batch.Records.forEach(record => {
+ if (batch.qty != record.qty) {
+ let tempHandleQty
+ 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 (item.qty == totalHandleQty) {
- if (isHandleEmpty) {
- return
- }
- submit()
+ })
+ })
+ if(str){
+ str = '任务明细未全部完成,是否提交?\n' + str
+ }
+ if(totalQty != taskQty){
+ str =`扫描数量[${totalQty}]与任务数量不一致[${taskQty}],是否提交"`
+ comMessageRef.value.showQuestionMessage1(str, 'red', res => {
+ if (res) {
+ //防止重复点击
+ proxy.$throttle(submit, 2000, proxy)()
} else {
- comMessageRef.value.showQuestionMessage(`实际扫描数量【${totalHandleQty}】与物料需求数量【${item.qty}】不一致,是否继续提交`, (res) => {
- if (res) {
- submit()
- }
+ // let record = this.creatRecord(label, balance, packageInfo);
+ // batch.Records.push(record);
+ // this.issueRecord.unshift(record)
+ // this.calcBatchHandleQty(batch);
+ // this.getfocus();
+ // this.$emit("afterScan");
+ detailSource.value.forEach(detail => {
+ detail.Items.forEach(item => {
+ taskQty = calc.add(taskQty,item.qty)
+ item.Locations.forEach(lco => {
+ lco.Batchs.forEach(batch => {
+ batch.Records = []
+ })
+ })
+ })
})
+ comScanIssuePackRef.value.clearList()
+ scanPopupGetFocus()
}
})
- })
+ }else {
+ //防止重复点击
+ proxy.$throttle(submit, 2000, proxy)()
+ }
}
const scanPopupGetFocus = () => {
- if (!scanPopup.value) {
- scanPopup.value.getfocus()
+ if (comScanIssuePackRef.value) {
+ comScanIssuePackRef.value.getfocus()
}
}
const showMessage = (message) => {
diff --git a/src/pages/issue/job/issueDetail0816.vue b/src/pages/issue/job/issueDetail0816.vue
new file mode 100644
index 00000000..baabd9a2
--- /dev/null
+++ b/src/pages/issue/job/issueDetail0816.vue
@@ -0,0 +1,608 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/issue/job/issueJob.vue b/src/pages/issue/job/issueJob.vue
index 8edede1a..f3cce451 100644
--- a/src/pages/issue/job/issueJob.vue
+++ b/src/pages/issue/job/issueJob.vue
@@ -1,14 +1,11 @@
-
-
+
@@ -38,6 +35,7 @@ import { getDetailOption, getDetailGiveupOption, getDetailCloseOption } from '@/
import {
getBusinessType
} from '@/common/record.js';
+import {planRefreshTime, issueJobFilter} from '@/common/config.js';
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import jobFilter from '@/mycomponents/job/jobFilter.vue'
import comIssueJobCard from '@/pages/issue/coms/comIssueJobCard.vue'
@@ -81,9 +79,13 @@ const businessType = ref(null)
const filterItemCode = ref('')
const fromInventoryStatuses = ref()
const fromLocationAreaTypeList = ref([])
+const fromAreaCode = ref('')
+const toAreaCode = ref('')
+const timer = ref(null)
+const productionLineCode = ref('')
onShow(() => {
nextTick(() => {
- getList('refresh', fromLocation.value, productionLine.value,filterItemCode.value)
+ getList('refresh')
})
})
onLoad((option) => {
@@ -100,10 +102,10 @@ onReachBottom(() => {
if (loadingType.value == 'loading' || loadingType.value == 'nomore') {
return
}
- getList('more', fromLocation.value, productionLine.value,filterItemCode.value)
+ getList('more')
})
onPullDownRefresh(() => {
- getList('refresh', fromLocation.value, productionLine.value,filterItemCode.value)
+ getList('refresh')
})
// 后退按钮
onBackPress((options) => {
@@ -119,9 +121,23 @@ onNavigationBarButtonTap((e) => {
if (e.index === 0) {
goHome()
} else if (e.index == 1) {
- filter.value.openFilter()
+ filter.value.openFilterParams(uni.getStorageSync(issueJobFilter))
}
})
+const timerRefresh = ()=> {
+ getList('refresh')
+ stopRefresh();
+ timer.value = setInterval(function() {
+ getList('refresh')
+ console.log('发料刷新');
+ }, planRefreshTime)
+}
+const stopRefresh = ()=> {
+ if (timer.value) {
+ clearInterval(timer.value);
+ timer.value = null;
+ }
+}
const getBusinessTypeFunc = ()=> {
getBusinessType(businessTypeCode.value, res => {
if (res.success) {
@@ -129,6 +145,7 @@ const getBusinessTypeFunc = ()=> {
fromInventoryStatuses.value = res.fromInventoryStatuses.split(',');
fromLocationAreaTypeList.value = res.fromLocationAreaTypeList
// this.openScanPopup();
+ scanPopup.value.openScanPopup(businessType.value)
} else {
comMessageRef.value.showErrorMessage(res.message)
}
@@ -151,7 +168,7 @@ const getIssueJobByProductionline1 = () => {
}
})
}
-const getList = (type, fromLocation = '', productionLine = '',filterItemCode = '') => {
+const getList = (type) => {
proxy.$modal.loading('加载中....')
loadingType.value = 'loading'
if (type === 'refresh') {
@@ -159,51 +176,9 @@ const getList = (type, fromLocation = '', productionLine = '',filterItemCode = '
jobList.value = []
}
- const 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 (fromLocation) {
- // 来源库位
- filters.push({
- column: 'fromLocationCode',
- action: '==',
- value: fromLocation
- })
- }
- if (productionLine) {
- // 生产线
- filters.push({
- column: 'productionLineCode',
- action: '==',
- value: productionLine
- })
- }
- if(filterItemCode){
- // 物料代码
- filters.push({
- column: "itemCode",
- action: "like",
- value: filterItemCode
- })
- }
+ let queryFiltersParams = setQueryParam()
const params = {
- filters,
+ filters: queryFiltersParams,
pageNo: pageNo.value,
pageSize: 100,
}
@@ -227,6 +202,9 @@ const getList = (type, fromLocation = '', productionLine = '',filterItemCode = '
if (type === "refresh") {
uni.stopPullDownRefresh();
}
+ if(jobList.value.length>0){
+ openScanPopup()
+ }
})
.catch((error) => {
if (type === 'refresh') {
@@ -238,9 +216,84 @@ const getList = (type, fromLocation = '', productionLine = '',filterItemCode = '
comMessageRef.value.showErrorMessage(error)
})
}
+const setQueryParam = ()=>{
+ let filterParams = []
+ let queryParams = uni.getStorageSync(issueJobFilter)
+ // if(!queryParams){
+ // queryParams={
+ // }
+ // queryParams.status="1,2"
+ // }
+
+ //只看当天
+ if (queryParams.creationTime ) {
+ filterParams.push({
+ column: "create_time",
+ action: "betweeen",
+ value: queryParams.creationTime
+ })
+ }
+ //只看待处理
+ if (queryParams.status) {
+ filterParams.push({
+ column: "status",
+ action: "in",
+ value: queryParams.status
+ })
+ }else {
+ filterParams.push({
+ column: "status",
+ action: "in",
+ value: "1,2"
+ })
+ }
+
+ //生产线
+ if (queryParams.productionLineCode) {
+ filterParams.push({
+ column: "productionLineCode",
+ action: "==",
+ value: queryParams.productionLineCode
+ })
+ }
+ //物料代码
+ if (queryParams.itemCode) {
+ filterParams.push({
+ column: "itemCode",
+ action: "like",
+ value: queryParams.itemCode
+ })
+ }
+
+ //来源库位
+ if (queryParams.fromLocationCode) {
+ filterParams.push({
+ column: "fromLocationCode",
+ action: "==",
+ value: queryParams.fromLocationCode
+ })
+ }
+ //来源库区
+ 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 openJobDetail = (item, scanMessage = '') => {
- proxy.$tab.navigateTo(`./issueDetail?id=${item.masterId}&status=${item.status}&scanMessage=${scanMessage}`)
+ getJobInfoByNumber(item.number, scanMessage)
}
const showItemList = (itemList)=> {
jobListPopupRef.value.openPopup(itemList);
@@ -277,114 +330,16 @@ const swipeClick = (index, index1) => {
})
}
}
-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) {
- fromLocation.value = param.fromLocationCode
- // 来源库位
- filters.push({
- column: "fromLocationCode",
- action: "==",
- value: param.fromLocationCode
- })
- }else{
- fromLocation.value = ''
- }
-
- if (param.productionLineCode) {
- productionLine.value = param.productionLineCode
- // 生产线
- filters.push({
- column: "productionLineCode",
- action: "==",
- value: param.productionLineCode
- })
- }else{
- productionLine.value = ''
- }
- 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', fromLocation.value, productionLine.value, filterItemCode.value)
- // getIssueJobList(params).then(res => {
- // uni.hideLoading();
- // if (res.data.total == 0) {
- // showMessage('未查找到' + '【' + code + '】的收货任务');
- // } else if (res.data.total == 1) {
- // openJobDetail(res.data.list[0]);
- // } else {
- // showItemList(res.data.list);
- // }
- // }).catch(error => {
- // showMessage(error)
- // })
+const getListByFilter = ( params )=>{
+ productionLineCode.value = params.productionLineCode
+ uni.setStorageSync(issueJobFilter,params)
+ getList('refresh')
}
const fromLocationCode = (fromLocationParams) => {
fromLocation.value = fromLocationParams
getList('refresh', fromLocation.value, productionLine.value,filterItemCode.value)
}
-const productionLineCode = (productionLineCode) => {
- productionLine.value = productionLineCode
- getList('refresh', fromLocation.value, productionLine.value,filterItemCode.value)
-}
-const getByAsnNumber = (code) => {
- proxy.$modal.loading('加载中....')
- getPurchasereceiptByAsnNumber(code)
- .then((res) => {
- uni.hideLoading()
- if (res.data.total == 0) {
- that.showMessage('未查找到' + `【${code}】的收货任务`)
- } else if (res.data.total == 1) {
- scanAsnNumber.value.closeScanPopup()
- openJobDetail(res.data.list[0])
- } else {
- scanAsnNumber.value.closeScanPopup()
- showItemList(res.data.list)
- }
- })
- .catch((error) => {
- uni.hideLoading()
- comMessageRef.value.showErrorMessage(error)
- })
-}
const openjobInfoPopup = (item) => {
jobInfoPopupRef.value.openPopup(item)
}
@@ -392,7 +347,7 @@ const cancleJob = (id) => {
cancleTakeIssueJob(id)
.then((res) => {
if (res.data) {
- getList('refresh', fromLocation.value, productionLine.value,filterItemCode.value)
+ getList('refresh')
uni.showToast({
title: '放弃任务成功'
})
@@ -427,61 +382,63 @@ const closeJob = (id) => {
showMessage(error)
})
}
-const switchChangeToday = (state, creationTime) => {
- checkedToday.value = state
- todayTime.value = creationTime
- getList('refresh', fromLocation.value, productionLine.value,filterItemCode.value)
-}
-const switchChangeWait = (state, jobStatus) => {
- checkedWaitTask.value = state
- status.value = jobStatus
- getList('refresh', fromLocation.value, productionLine.value,filterItemCode.value)
-}
-const getScanNumber = (code) => {
- getDataListByType(code)
-}
-const getDataListByType = (code) => {
- proxy.$modal.loading('加载中....')
- const filters = []
+const getJobInfoByNumber = (number, scanMessage)=>{
+ uni.showLoading({
+ title: "加载中....",
+ mask: true
+ });
+ let filters = []
filters.push({
- column: 'status',
- action: 'in',
+ column: "status",
+ action: "in",
value: '1,2'
})
filters.push({
- column: 'number',
- action: '==',
- value: code
- })
- filters.push({
- column: 'accept_user_id',
- action: '==',
- value: store.id
+ column: "number",
+ action: "==",
+ value: number
})
- const params = {
- filters,
+
+ var params = {
+ filters: filters,
pageNo: 1,
- pageSize: 100
+ pageSize: pageSize.value,
}
- getIssueJobList(params)
- .then((res) => {
- uni.hideLoading()
- if (res.data.list.length == 0) {
- showMessage('未查找到发料任务');
- } else if (res.data.list.length == 1) {
- openJobDetail(res.data.list[0])
+ getIssueJobList(params).then(res => {
+ uni.hideLoading();
+ if (res.data.list.length == 0) {
+ showMessage(`未查找到【${number}】的发料任务`);
+ } else {
+ var result = res.data.list[0];
+ if (result.acceptUserId && result.acceptUserId != store.id) {
+ comMessageRef.value.showErrorMessage(`任务号[${result.number}]已经被[${result.acceptUserName}]承接,无法执行`, res => {
+ if (res) {
+ if (scanPopup.value) {
+ scanPopup.value.getfocus()
+ }
+ getList('refresh')
+ }
+ });
+ return;
}
- })
- .catch((error) => {
- uni.hideLoading()
- showMessage(error)
- })
+ uni.navigateTo({
+ url: './issueDetail?id=' + result.masterId + '&status=' + result.status +
+ '&scanMessage=' +
+ scanMessage + '&title=' + title.value
+ });
+ scanMessage.value = ""
+ }
+ }).catch(error => {
+ uni.hideLoading();
+ showMessage(error);
+ })
}
+
const showMessage = (message) => {
comMessageRef.value.showErrorMessage(message, (res) => {
if (res) {
if (scanPopup.value) {
- scanPopup.value.packGetFocus()
+ scanPopup.value.getfocus()
}
}
})
@@ -495,6 +452,90 @@ const openScanPopup = () => {
}
}
const getScanResult = (result) => {
+ uni.showLoading({
+ title:"查询中",
+ mask:true
+ })
+ let balance = result.balance;
+ if (balance != null) {
+ scanMessage.value = ""
+ if (!result.label.batch) {
+ showMessage('批次为空')
+ return
+ }
+ if (!result.label.itemCode) {
+ showMessage('物料号为空')
+ return
+ }
+ try {
+ const filters = [
+ {
+ column: 'status',
+ action: 'in',
+ value: '1,2'
+ },
+ {
+ column: 'batch',
+ action: '==',
+ value: result.label.batch
+ },
+ {
+ column: 'itemCode',
+ action: '==',
+ value: result.label.itemCode
+ },
+ {
+ column: "fromLocationCode",
+ action: "==",
+ value: balance.locationCode
+ }
+ ]
+ if(productionLineCode.value){
+ filters.push({
+ column: "productionLineCode",
+ action: "==",
+ value: productionLineCode.value
+ })
+ }
+ getIssueJobList({
+ filters,
+ pageNo: 1,
+ pageSize: 1000,
+ sort: 'createTime',
+ by: 'asc'
+ })
+ .then((res) => {
+ scanMessage.value = result.scanMessage
+ const resultList = res.data.list
+ if (resultList.length > 0) {
+ resultList.forEach((item) => {
+ item.title = item.number
+ item.selected = false
+ })
+ const list = []
+ resultList.forEach((item) => {
+ if (!list.find((subItem) => subItem.title == item.title)) {
+ list.push(item)
+ }
+ })
+ if (list.length > 0) {
+ selectItem(list[0])
+ }
+ } else {
+ queryByItemCode(result)
+ }
+ })
+ .catch((error) => {
+ uni.hideLoading()
+ showMessage(`${error}\n扫描[${result.scanMessage}]`)
+ })
+ } catch (e) {
+ showMessage(e.message)
+ }
+ }
+}
+//按物料和查询条件查询
+const queryByItemCode = (result) => {
let balance = result.balance;
if (balance != null) {
scanMessage.value = ""
@@ -529,6 +570,13 @@ const getScanResult = (result) => {
value: balance.locationCode
}
]
+ if(productionLineCode.value){
+ filters.push({
+ column: "productionLineCode",
+ action: "==",
+ value: productionLineCode.value
+ })
+ }
getIssueJobList({
filters,
pageNo: 1,
@@ -555,11 +603,13 @@ const getScanResult = (result) => {
}
} else {
showMessage("按来源库位[" + balance.locationCode + "]批次[" + result.label.batch +
- "]物料号[" + result.label.itemCode + "]未查找到任务
" + "扫描[" + result.scanMessage + "]")
+ "]物料号[" + result.label.itemCode + "]未查找到任务\n" + "扫描[" + result
+ .scanMessage + "]")
}
})
.catch((error) => {
- showMessage(`${error}
扫描[${result.scanMessage}]`)
+ uni.hideLoading()
+ showMessage(`${error}\n扫描[${result.scanMessage}]`)
})
} catch (e) {
showMessage(e.message)
diff --git a/src/pages/issue/job/issueJob0816.vue b/src/pages/issue/job/issueJob0816.vue
new file mode 100644
index 00000000..a3017f95
--- /dev/null
+++ b/src/pages/issue/job/issueJob0816.vue
@@ -0,0 +1,746 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file