Browse Source

添加组件 2024/7/29 15:13:04

hella_vue3
zhang_li 2 months ago
parent
commit
0eb9eee7d8
  1. 17
      src/api/request2.js
  2. 20
      src/common/array.js
  3. 2
      src/mycomponents/job/jobComMainDetailCard.vue
  4. 30
      src/mycomponents/package/packageList.vue
  5. 37
      src/pages/issue/job/issueJob.vue
  6. 296
      src/pages/issue/record/issueRecord.vue
  7. 4
      src/pages/package/coms/comScanPackagePack.vue
  8. 38
      src/pages/purchaseReceipt/coms/comReceiptDetailCard.vue
  9. 37
      src/pages/repleinsh/job/repleinshJob.vue
  10. 2
      src/pages/repleinsh/record/repleinshRecord.vue

17
src/api/request2.js

@ -884,6 +884,15 @@ export function takeIssueJob(id) {
export function cancleTakeIssueJob(id) {
return http.put("/wms/issue-job-main/abandon?id=" + id)
}
/**
* 发料 关闭任务
* @param {*} id
*
*/
export function closeTakeIssueJob(id) {
return http.put("/wms/issue-job-main/close?id=" + id)
}
/**
* 发料任务 提交
* @param {*} params
@ -2373,6 +2382,14 @@ export function takeRepleinshJob(id) {
export function cancleTakeRepleinshJob(id) {
return http.put("/wms/repleinsh-job-main/abandon?id=" + id)
}
/**
* 补料任务 关闭任务
* @param {*} id
*
*/
export function closeTakeRepleinshJob(id) {
return http.put("/wms/repleinsh-job-main/close?id=" + id)
}
/**
* 补料任务 提交
* @param {*} params

20
src/common/array.js

@ -223,7 +223,7 @@ export function getDetailEditRemoveOption() {
}
//详情编辑放弃
//详情编辑关闭
export function getDetailGiveupOption() {
let option_detail_giveup = [{
text: '详情',
@ -241,7 +241,23 @@ export function getDetailGiveupOption() {
return option_detail_giveup;
}
//详情放弃
export function getDetailCloseOption() {
let option_detail_giveup = [{
text: '详情',
style: {
backgroundColor: '#3C9CFF'
}
},
{
text: '关闭',
style: {
backgroundColor: '#F56C6C'
}
}
];
return option_detail_giveup;
}
//详情编辑移除
export function getEditRemoveOption() {

2
src/mycomponents/job/jobComMainDetailCard.vue

@ -7,7 +7,7 @@
<batch v-if="isShowBatch && dataContent.batch != null" :batch="dataContent.batch"></batch>
<div class="u-flex justify-between u-p-b-16">
<location v-if="isShowFromLocation && dataContent.fromLocationCode" title="来源库位" :locationCode="dataContent.fromLocationCode"> </location>
<level title="优先级" :priority="dataContent.priority"> </level>
<level title="优先级" :priority="dataContent.priority" v-if="dataContent.priority !== '' && dataContent.priority !== underfind && dataContent.priority !== null"> </level>
<to-location v-if="isShowToLocation" title="目标库位" :locationCode="dataContent.toLocationCode || dataContent.locationCode"> </to-location>
</div>
<view class="card_view" v-if="isShowDeliverType">

30
src/mycomponents/package/packageList.vue

@ -4,9 +4,11 @@
<u-collapse ref="collapse2">
<u-collapse-item :disabled="false" @change="collapseChange">
<template v-slot:title>
<package-card :dataContent="item" :isShowLocation="false" :isShowFromLocation="isShowFromLocation" :isShowStatus="isShowStatus" style="flex: 1"></package-card>
<u-swipe-action :options="item.scaned && isEdit ? editAndRemoveOptions : item.scaned ? removeOptions : options" bg-color="rgba(255,255,255,0)" @click="(...event) => swipeClick(event, cur, 'parent')">
<package-card :dataContent="item" :isShowLocation="false" :isShowFromLocation="isShowFromLocation" :isShowStatus="isShowStatus"></package-card>
</u-swipe-action>
</template>
<u-swipe-action :show="item.show" :index="index" v-for="(cur, key) in item.packList" :key="index" :options="cur.scaned && isEdit ? editAndRemoveOptions : cur.scaned ? removeOptions : options" bg-color="rgba(255,255,255,0)" @click="(...event) => swipeClick(event, cur)">
<u-swipe-action :show="item.show" :index="index" v-for="(cur, key) in item.packList" :key="index" :options="cur.scaned && isEdit ? editAndRemoveOptions : cur.scaned ? removeOptions : options" bg-color="rgba(255,255,255,0)" @click="(...event) => swipeClick(event, cur, 'child')">
<package-card :dataContent="cur" :isShowLocation="false" :isShowFromLocation="false" :isShowToLocation="false" :isShowBatch="false"></package-card>
</u-swipe-action>
</u-collapse-item>
@ -85,9 +87,7 @@ dataContent.value.forEach((item) => {
})
})
console.log(dataContent.value)
const swipeClick = (params, cur) => {
console.log(params)
console.log(cur)
const swipeClick = (params, cur, type) => {
let text = ''
if (cur.scaned && props.isEdit) {
text = editAndRemoveOptions.value[params[1]].text
@ -100,8 +100,26 @@ const swipeClick = (params, cur) => {
if (text == '编辑') {
edit(cur)
} else if (text == '移除') {
remove(cur)
if (type == 'parent') {
removeParent(item)
} else {
remove(item)
}
}
}
const removeParent = (item) => {
comMessageRef.value.showQuestionMessage('确定移除扫描信息?', (res) => {
if (res) {
item.scaned = false
item.handleQty = null
item.packList.forEach((subItem) => {
subItem.scaned = false
subItem.handleQty = null
})
emit('updateData')
}
})
}
const remove = (item) => {
comMessageRef.value.showQuestionMessage('确定移除扫描信息?', (res) => {

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

@ -3,7 +3,7 @@
<com-empty-view v-if="jobList.length == 0"></com-empty-view>
<job-filter :isShowFromLocationCode="true" :isShowProductionLineCode="true" :productionline="productionlineList" ref="filter" otherTitle="" @switchChangeToday="switchChangeToday" @switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday" :checkedWaitTask="checkedWaitTask" @productionLineCode="productionLineCode" @fromLocationCode="fromLocationCode"> </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 : detailOptions" bg-color="rgba(255,255,255,0)" class="u-m-b-20" @click="swipeClick">
<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">
<com-issue-job-card :dataContent="item" @click="openJobDetail(item)"></com-issue-job-card>
</u-swipe-action>
@ -22,10 +22,10 @@
<script setup lang="ts">
import { ref, getCurrentInstance, nextTick } from 'vue'
import { onLoad, onShow, onNavigationBarButtonTap, onReady, onBackPress, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
import { cancleTakeIssueJob, getIssueJobList, getIssueJobByProductionline } from '@/api/request2.js'
import { cancleTakeIssueJob, getIssueJobList, getIssueJobByProductionline, closeTakeIssueJob } from '@/api/request2.js'
import { goHome, updateTitle } from '@/common/basic.js'
import { getDetailOption, getDetailGiveupOption } from '@/common/array.js'
import { getDetailOption, getDetailGiveupOption, getDetailCloseOption } from '@/common/array.js'
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import jobFilter from '@/mycomponents/job/jobFilter.vue'
@ -54,6 +54,7 @@ const status = ref('1,2') // 待处理 、进行中
const detailOptions = ref([])
const detailGiveupOptions = ref([])
const productionlineList = ref([])
const detailCloseOptions = ref([])
const title = ref('')
const productionLine = ref('')
const fromLocation = ref('')
@ -76,6 +77,7 @@ onLoad((option) => {
onReady(() => {
detailOptions.value = getDetailOption()
detailGiveupOptions.value = getDetailGiveupOption()
detailCloseOptions.value = getDetailCloseOption()
})
onReachBottom(() => {
//
@ -227,6 +229,12 @@ const swipeClick = (index, index1) => {
cancleJob(dataContent.masterId)
}
})
} else if (e.content.text == '关闭') {
comMessageRef.value.showQuestionMessage('确定要关闭当前任务?', (res) => {
if (res) {
closeJob(dataContent.masterId)
}
})
}
}
const fromLocationCode = (fromLocationParams) => {
@ -277,6 +285,29 @@ const cancleJob = (id) => {
showMessage(error)
})
}
const closeJob = (id) => {
uni.showLoading({
title: '加载中....',
mask: true
})
closeTakeIssueJob(id)
.then((res) => {
uni.hideLoading()
if (res.data) {
getList('refresh')
uni.showToast({
title: '关闭任务成功'
})
} else {
showMessage('关闭任务失败')
}
})
.catch((error) => {
uni.hideLoading()
showMessage(error)
})
}
const switchChangeToday = (state, creationTime) => {
checkedToday.value = state
todayTime.value = creationTime

296
src/pages/issue/record/issueRecord.vue

@ -1,7 +1,7 @@
<template>
<view class="page-wraper">
<view class="">
<com-blank-view @goScan="showFromLocationPopup" v-if="recommendList.length == 0"></com-blank-view>
<com-blank-view @goScan="openScanPopup" v-if="recommendList.length == 0"></com-blank-view>
</view>
<view class="page-wraper" v-if="recommendList.length > 0">
<!-- <view class="page-header">
@ -34,7 +34,7 @@
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent" :isShowFromLocation="false" @removeItem="removeItem(index, item)" :isShowToLocation="false" @updateData="updateData" @removePack="removePack"> </record-com-detail-card>
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent" :isShowFromLocation="true" @removeItem="removeItem(index, item)" :isShowToLocation="false" @updateData="updateData" @removePack="removePack"> </record-com-detail-card>
</view>
</view>
</scroll-view>
@ -57,10 +57,8 @@
</view>
<win-scan-button @goScan="openScanPopup"></win-scan-button>
</view>
<win-scan-pack-and-location ref="scanPopup" @getResult="onScan" :allowModifyLocation="false" :queryBalance="false"> </win-scan-pack-and-location>
<winComScanBalance ref="scanPopup" @getBalance="getScanResult" :bussinessCode="businessTypeCode"> </winComScanBalance>
<comMessage ref="comMessage"></comMessage>
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation="getLocation" :locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location>
<balance-select ref="balanceSelect" @onSelectItem="selectBalanceItem"></balance-select>
</view>
</template>
@ -73,7 +71,7 @@ import { calc } from '@/common/calc.js'
import { getInventoryStatusDesc, getDirectoryItemArray } from '@/common/directory.js'
import { getBusinessType, createItemInfo, createDetailInfo, calcTreeHandleQty, calcHandleQty } from '@/common/record.js'
import { getBusinessType, createItemInfo, createDetailInfo, calcHandleQty } from '@/common/record.js'
import { getManagementPrecisions, getPrecisionStrategyList, getPrecisionStrategyParams } from '@/common/balance.js'
@ -81,11 +79,9 @@ import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanLocation from '@/mycomponents/scan/winScanLocation.vue'
import winScanPackAndLocation from '@/mycomponents/scan/winScanPackAndLocation.vue'
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
import recordDetailCard from '@/mycomponents/record/recordDetailCard.vue'
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
import balance from '@/mycomponents/balance/balance.vue'
export default {
@ -94,11 +90,9 @@ export default {
winScanPack,
requiredLocation,
comBlankView,
winScanLocation,
winScanPackAndLocation,
recordComDetailCard,
recordDetailCard,
balanceSelect,
winComScanBalance,
balance
},
data() {
@ -112,7 +106,7 @@ export default {
toLocationAreaTypeList: [],
inInventoryStatus: '', //
outInventoryStatus: '', //
businessType: {},
businessType: null,
showToLoaction: true,
recommendLocationList: [], //
fromWarehouseCode: '', //
@ -121,7 +115,8 @@ export default {
show: false,
positionInfo: '请选择生产线',
resultData: {},
recommendList: []
recommendList: [],
fromInventoryStatuses: []
}
},
onLoad(option) {
@ -132,9 +127,9 @@ export default {
getBusinessType(this.businessTypeCode, (res) => {
if (res.success) {
this.businessType = res.businessType
this.fromInventoryStatuses = getDirectoryItemArray(res.fromInventoryStatuses)
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList
this.toLocationAreaTypeList = res.toLocationAreaTypeList
this.showFromLocationPopup()
this.openScanPopup()
} else {
this.showErrorMessage(res.message)
}
@ -168,122 +163,7 @@ export default {
mounted() {},
methods: {
getBalance(label, packageInfo, callback) {
const filters = []
if (packageInfo.parentNumber) {
const packingNumber = `${packageInfo.parentNumber},${label.packingNumber}`
filters.push({
column: 'packingNumber',
action: 'in',
value: packingNumber
})
} else {
filters.push({
column: 'packingNumber',
action: '==',
value: label.packingNumber
})
}
filters.push({
column: 'itemCode',
action: '==',
value: label.itemCode
})
filters.push({
column: 'batch',
action: '==',
value: label.batch
})
if (this.fromInventoryStatuses != null && this.fromInventoryStatuses != '') {
filters.push({
column: 'inventoryStatus',
action: 'in',
value: this.fromInventoryStatuses
})
}
const params = {
filters,
pageNo: 1,
pageSize: 100
}
getBalanceByFilter(params)
.then((res) => {
callback(res.data)
})
.catch((err) => {
this.showErrorMessage(err.message)
})
},
getScanResult(result) {
this.resultData = result
const packageInfo = result.package
this.getBalance(result.label, packageInfo, (balances) => {
//
const s = ''
if (!result.package.parentNumber) {
if (balances.list.length == 0) {
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描')
} else {
const newBalances = balances.list.filter((b) => b.locationCode == this.fromLocationCode)
if (newBalances.length == 0) {
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描')
} else if (newBalances.length == 1) {
const balance = newBalances[0]
result.balance = balance
this.afterGetBalance(result)
} else {
this.showBalanceSelect(newBalances)
}
}
} else {
//
if (balances.list.length == 0) {
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描')
} else {
//
const subPackitems = balances.list.filter((r) => r.packingNumber == packageInfo.number)
//
const 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) {
const balance = subParentPackitems[0]
balance.qty = packageInfo.qty
result.balance = balance
this.afterGetBalance(result)
} else {
this.showBalanceSelect(subParentPackitems)
}
} else {
this.showErrorMessage(`按外包装【${packageInfo.parentNumber}】和子包装【${packageInfo.number}】都未查找到库存余额`)
}
} else {
let locationCode = this.fromLocationCode
if (balances.list == 1) {
locationCode = balances.list[0].locationCode
} else {
const manyBlances = balances.list.filter((r) => r.locationCode != this.fromLocationCode)
if (manyBlances.length > 0) {
locationCode = manyBlances[0].locationCode
}
}
this.showErrorMessage(`该包装【${packageInfo.number}】在库位【${locationCode}】已经有库存余额,请重新扫描`)
}
}
}
})
},
onScan(result) {
const that = this
const pack = result.package
if (that.recommendList.length > 0) {
@ -295,7 +175,7 @@ export default {
if (batch == undefined) {
that.showErrorMessage(`扫描的批次【${pack.batch}】,不是系统推荐的批次,不满足系统的先进先出规则,请重新扫描物料`)
} else {
this.getScanResult(result)
this.setData(result)
}
}
} else {
@ -325,7 +205,7 @@ export default {
if (recommendInfo.batch != result.package.batch) {
that.showErrorMessage(`扫描的批次【${result.package.batch}】,不是系统推荐的批次【${recommendInfo.batch}】,不满足系统的先进先出规则,请重新扫描`)
} else {
this.getScanResult(result)
this.setData(result)
}
} else {
that.showErrorMessage('未查找到物料的推荐信息')
@ -339,16 +219,7 @@ export default {
})
},
showBalanceSelect(items) {
this.$refs.balanceSelect.openPopup(items)
},
selectBalanceItem(balance) {
this.resultData.balance = balance
this.afterGetBalance(this.resultData)
},
afterGetBalance(result) {
setData(result) {
const { balance } = result
const { label } = result
const pack = result.package
@ -392,81 +263,6 @@ export default {
}
},
getScanResult1(result) {
const { balance } = result
const { label } = result
const pack = result.package
const { packUnit } = pack
const { packQty } = pack
const item = this.detailSource.find((res) => {
if (res.itemCode == balance.itemCode) {
return res
}
})
if (this.fromWarehouseCode == '') {
this.fromWarehouseCode = balance.warehouseCode
}
if (item == undefined) {
const itemp = createItemInfo(balance, pack)
const newDetail = createDetailInfo(balance, pack) //
newDetail.packUnit = packUnit
newDetail.packQty = packQty
itemp.subList.push(newDetail)
this.detailSource.push(itemp)
calcHandleQty(this.detailSource)
} else {
const detail = item.subList.find((r) => {
if (r.packingNumber == balance.packingNumber && r.batch == balance.batch && r.locationCode == balance.locationCode && r.inventoryStatus == balance.inventoryStatus) {
return r
}
})
if (detail == undefined) {
const newDetail = createDetailInfo(balance, pack)
newDetail.packUnit = packUnit
newDetail.packQty = packQty
item.subList.push(newDetail)
calcHandleQty(this.detailSource)
} else if (detail.scaned == true) {
this.showErrorMessage(`箱码[${balance.packingNumber}批次[${balance.batch}]已经在列表中`)
}
}
},
//
getRecommendLocation(balance, pack, callback) {
uni.showLoading({
title: '扫描中...',
mask: true
})
const recommend = this.recommendLocationList.find((r) => r.itemCode == balance.itemCode)
if (recommend == undefined) {
const param = {
itemCode: balance.itemCode,
batch: balance.batch,
inventoryStatus: balance.inventoryStatus,
supplierCode: pack.supplierCode,
businessCode: this.businessTypeCode
}
console.log(JSON.stringify(param))
getPutawayRecommendLocation(param)
.then((res) => {
this.recommendLocationList.push({
itemCode: balance.itemCode,
locationCode: res.data.code
})
callback(res.data)
uni.hideLoading()
})
.catch((error) => {
uni.hideLoading()
this.showErrorMessage(error)
uni.hideLoading()
})
} else {
callback(recommend)
}
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, (res) => {
if (res) {
@ -474,18 +270,6 @@ export default {
})
},
calcTreeHandleQty() {
for (const item of this.detailSource) {
item.qty = 0
for (const detail of item.subList) {
if (detail != undefined) {
item.qty = calc.add(item.qty, detail.qty)
}
}
}
this.$forceUpdate()
},
showSelect() {
// if (this.editPosition) {
this.show = true
@ -554,38 +338,35 @@ export default {
},
openScanPopup() {
if (this.fromLocationCode == '') {
this.showFromLocationPopup()
return
if (this.businessType) {
this.$refs.scanPopup.openScanPopup(this.businessType)
} else {
this.getBusinessType()
}
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType)
},
showFromLocationPopup() {
this.$nextTick(() => {
this.$refs.scanLocationCode.openScanPopup()
})
},
closeScanPopup() {
if (this.$refs.scanPopup != undefined) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.closeScanPopup()
}
},
scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) {
if (this.$refs.scanPopup) {
this.$refs.scanPopup.getfocus()
}
},
// scanLocationCode(location, code) {
// this.toLocationCode = code
// this.toLocationCode = location;
// },
commit() {
if (this.detailSource.length == 0) {
this.showErrorMessage('扫描数据为0,请先扫描数据')
return
}
if (this.positionInfo == '请选择生产线') {
this.showErrorMessage('请先选择生产线')
return
}
uni.showLoading({
title: '提交中....',
mask: true
@ -693,24 +474,6 @@ export default {
closeScanMessage() {
this.scanPopupGetFocus()
},
getLocation(location, code) {
this.getFromLocationCode(location, code)
},
getFromLocationCode(location, code) {
this.fromLocationInfo = location
this.fromLocationCode = code
this.openScanPopup()
},
getToLocationCode(location, code) {
if (this.fromLocationCode == code) {
uni.showToast({
title: `来源库位[${this.fromLocationCode}]不能与目标库位[${code}]一致`,
duration: 2000
})
return
}
this.toLocationCode = code
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, (res) => {
@ -736,6 +499,7 @@ export default {
this.toWarehouseCode = ''
this.detailSource = []
this.positionInfo = '请选择生产线'
this.recommendList = []
}
}
}

4
src/pages/package/coms/comScanPackagePack.vue

@ -248,11 +248,11 @@ const creatRecord = (label, balance, packageInfo) => {
balance.packUnit = packageInfo.packUnit
const record = {
scaned: true,
itemCode: label.itemCode
itemCode: label.itemCode,
packingNumber: packageInfo.number,
parentPackingNumber: packageInfo.parentNumber,
batch: label.batch,
qty: Number(balance.qty),
qty: balance.lableQty ? balance.lableQty : balance.qty,
// qty: Number(label.qty) > Number(balance.qty) ? Number(balance.qty) : Number(label.qty),
uom: balance.uom,
inventoryStatus: balance.inventoryStatus,

38
src/pages/purchaseReceipt/coms/comReceiptDetailCard.vue

@ -3,7 +3,9 @@
<u-collapse ref="collapse">
<u-collapse-item :open="true">
<template v-slot:title>
<u-swipe-action :options="dataContent.handleQty > 0 ? removeOptions : options" bg-color="rgba(255,255,255,0)" @click="(...event) => swipeClick(event, dataContent)">
<itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowPackUnit="false" style="width: 100%"></itemCompareQty>
</u-swipe-action>
</template>
<package-list :dataContent="dataContent.subList" :isEdit="settingParam.allowModifyQty == 'TRUE'" :settingParam="settingParam" @collapseChange="collapseChange" @updateData="updateData" :isShowFromLocation="false"></package-list>
</u-collapse-item>
@ -28,7 +30,7 @@ import winScanLocation from '@/mycomponents/scan/winScanLocation.vue'
import pack from '@/mycomponents/balance/pack.vue'
import detailList from '@/mycomponents/detail/detailList.vue'
import packageList from '@/mycomponents/package/packageList.vue'
import { getDetailOption, getPurchaseReceiptOption } from '@/common/array.js'
import { getDetailOption, getPurchaseReceiptOption, getRemoveOption } from '@/common/array.js'
const props = defineProps({
dataContent: {
@ -51,6 +53,8 @@ const editItem = ref({
const locatonItem = ref({})
const detailOptions = ref([])
const scanOptions = ref([])
const options = ref([])
const removeOptions = ref([])
const collapse = ref()
const comMessageRef = ref()
const receiptEdit = ref()
@ -61,6 +65,9 @@ onMounted(() => {
if (scanOptions.value.length == 0) {
scanOptions.value = getPurchaseReceiptOption(props.settingParam.allowModifyQty, props.settingParam.allowModifyLocation)
}
if (removeOptions.value.length == 0) {
removeOptions.value = getRemoveOption()
}
})
const collapseChange = () => {
setTimeout(() => {
@ -82,6 +89,23 @@ const refreshCollapse = () => {
})
})
}
const swipeClick = (params, item) => {
let text = ''
if (props.dataContent.handleQty > 0) {
text = removeOptions.value[params[1]].text
} else if (cur.scaned) {
text = options.value[params[1]].text
}
if (text == '详情') {
detail(item)
} else if (text == '编辑') {
edit(item)
} else if (text == '库位') {
showLocation(item)
} else if (text == '移除') {
removeScan(item)
}
}
const edit = (item) => {
editItem.value = item
receiptEdit.value.openTaskEditPopup(item.qty, item.handleQty, item.labelQty)
@ -99,12 +123,18 @@ const detail = (item) => {
showItem.value = item
jobDetailPopup.value.openPopup()
}
const remove = (item) => {
const removeScan = (item) => {
comMessageRef.value.showQuestionMessage('确定移除扫描信息?', (res) => {
if (res) {
item.scaned = false
item.handleQty = null
emit('remove', item)
item.subList.forEach((lst) => {
lst.scaned = false
lst.handleQty = null
lst.packList.forEach((pack) => {
pack.scaned = false
pack.handleQty = null
})
})
}
})
}

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

@ -3,7 +3,7 @@
<com-empty-view v-if="jobList.length == 0"></com-empty-view>
<job-filter :isShowFromLocationCode="true" ref="filter" otherTitle="ASN" @switchChangeToday="switchChangeToday" @switchChangeWait="switchChangeWait" @onScanNumber="getScanNumber" :checkedToday="checkedToday" :checkedWaitTask="checkedWaitTask" @fromLocationCode="fromLocationCode"> </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 : detailOptions" bg-color="rgba(255,255,255,0)" class="u-m-b-20" @click="swipeClick">
<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">
<com-repleinsh-job-card :dataContent="item" @click="openJobDetail(item)"></com-repleinsh-job-card>
</u-swipe-action>
<repleinsh-info-popup ref="jobInfoPopupRef"></repleinsh-info-popup>
@ -20,11 +20,11 @@
import { ref, getCurrentInstance, nextTick } from 'vue'
import { onLoad, onShow, onNavigationBarButtonTap, onReady, onBackPress, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
import { getRepleinshJobList, cancleTakeRepleinshJob } from '@/api/request2.js'
import { getRepleinshJobList, cancleTakeRepleinshJob, closeTakeRepleinshJob } from '@/api/request2.js'
import { goHome, updateTitle } from '@/common/basic.js'
import { getDetailOption, getDetailGiveupOption } from '@/common/array.js'
import { getDetailOption, getDetailGiveupOption, getDetailCloseOption } from '@/common/array.js'
import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import jobFilter from '@/mycomponents/job/jobFilter.vue'
@ -52,6 +52,7 @@ const status = ref('1,2') // 待处理 、进行中
const detailOptions = ref([])
const scanMessage = ref('')
const detailGiveupOptions = ref([])
const detailCloseOptions = ref([])
const title = ref('')
const scanMessage = ref('')
const filter = ref()
@ -70,6 +71,7 @@ onLoad((option) => {
onReady(() => {
detailOptions.value = getDetailOption()
detailGiveupOptions.value = getDetailGiveupOption()
detailCloseOptions.value = getDetailCloseOption()
})
onReachBottom(() => {
//
@ -199,6 +201,12 @@ const swipeClick = (index, index1) => {
cancleJob(dataContent.masterId)
}
})
} else if (e.content.text == '关闭') {
comMessageRef.value.showQuestionMessage('确定要关闭当前任务?', (res) => {
if (res) {
closeJob(dataContent.masterId)
}
})
}
}
const openjobInfoPopup = (item) => {
@ -220,6 +228,29 @@ const cancleJob = (id) => {
showMessage(error)
})
}
const closeJob = (id) => {
uni.showLoading({
title: '加载中....',
mask: true
})
closeTakeRepleinshJob(id)
.then((res) => {
uni.hideLoading()
if (res.data) {
getList('refresh')
uni.showToast({
title: '关闭任务成功'
})
} else {
showMessage('关闭任务失败')
}
})
.catch((error) => {
uni.hideLoading()
showMessage(error)
})
}
const switchChangeToday = (state, creationTime) => {
checkedToday.value = state
todayTime.value = creationTime

2
src/pages/repleinsh/record/repleinshRecord.vue

@ -49,7 +49,7 @@
</template>
<script>
import { repleinshRecordSubmit, validateItemAndLocation, getPutawayRecommendLocation, getBalanceByFilter, getBalanceByBatchOffShelf } from '@/api/request2.js'
import { repleinshRecordSubmit, validateItemAndLocation, getBalanceByFilter, getBalanceByBatchOffShelf } from '@/api/request2.js'
import { goHome, updateTitle, getCurrDateTime, getPackingNumberAndBatchByList, deepCopyData } from '@/common/basic.js'

Loading…
Cancel
Save