Browse Source

增加组件2024/7/3 16:35:31

hella_vue3
zhang_li 3 months ago
parent
commit
7ec6a5ffb2
  1. 8
      .env.development
  2. 8
      src/mycomponents/qty/balanceQtyEdit.vue
  3. 6
      src/mycomponents/record/recordComDetailCard.vue
  4. 2
      src/mycomponents/scan/winComScan.vue
  5. 73
      src/mycomponents/scan/winScanPackage.vue
  6. 20
      src/pages.json
  7. 5
      src/pages/fg/receiptByPlan.vue
  8. 398
      src/pages/fg/receiptNoPlan.vue
  9. 4
      src/pages/issue/request/issueScanRequest.vue
  10. 288
      src/pages/material/materialDowngrade.vue
  11. 5
      src/pages/purchaseReceipt/job/receiptDetail.vue
  12. 3
      src/pages/repleinsh/record/directRepleinshRecord.vue

8
.env.development

@ -1,11 +1,11 @@
VITE_BASE_URL=http://172.21.32.14:81/api/admin-api VITE_BASE_URL=http://172.22.32.9:81/api/admin-api
VITE_BASE_URL_IMAGE=http://172.21.32.14:81/admin-api VITE_BASE_URL_IMAGE=http://172.22.32.9:81/admin-api
# 租户配置 # 租户配置
VITE_TENANT='[{"text":"长春","value":1}]' VITE_TENANT='[{"text":"成都","value":2}]'
# 是否是测试环境 # 是否是测试环境
VITE_isDevelopment=false VITE_isDevelopment=false
# 积木报表请求路径 # 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://172.21.32.14:90' VITE_JMREPORT_BASE_URL='http://172.22.32.9:90'

8
src/mycomponents/qty/balanceQtyEdit.vue

@ -148,17 +148,15 @@ const calcQty = (e) => {
} }
const setValue = () => { const setValue = () => {
const balanceQty = Number(dataContent.value.balanceQty) const balanceQty = Number(dataContent.value.balanceQty)
if (allQty.value == 0) { if (allQty.value < 0) {
comMessageRef.value.showErrorMessage('数量必须于0', (res) => { comMessageRef.value.showErrorMessage('数量必须于0', (res) => {
if (res) { if (res) {
allQty.value = balanceQty allQty.value = balanceQty
} }
}) })
} else if (allQty.value > balanceQty) { } else if (allQty.value > balanceQty) {
comMessageRef.value.showErrorMessage(`数量[${allQty.value}]不允许大于库存数量[${balanceQty}]`, (res) => { comMessageRef.value.showConfirmWarningModal(`数量[${allQty.value}]不允许大于库存数量[${balanceQty}]`, (res) => {
if (res) {
allQty.value = balanceQty allQty.value = balanceQty
}
}) })
} else { } else {
callback() callback()

6
src/mycomponents/record/recordComDetailCard.vue

@ -66,7 +66,11 @@ watch(
if (val.subList.length > 0) { if (val.subList.length > 0) {
if (collapse1.value != undefined && collapse1.value != null) { if (collapse1.value != undefined && collapse1.value != null) {
nextTick((res) => { nextTick((res) => {
collapse1.value.init() setTimeout(() => {
if (collapse1.value) {
collapse1.value.resize()
}
}, 500)
}) })
} }
} }

2
src/mycomponents/scan/winComScan.vue

@ -24,7 +24,7 @@
</view> </view>
</view> </view>
<u-line class="line_color" style="padding-top: 10rpx; padding-bottom: 20rpx"></u-line> <u-line class="line_color" style="padding-top: 10rpx; padding-bottom: 20rpx"></u-line>
<scroll-view scroll-y="true" class="scroll-view" v-if="expand && scanList.length > 0" style="height: 70px"> <scroll-view scroll-y="true" class="scroll-view" v-if="expand" style="height: 70px">
<view class="uni-flex u-col" v-for="(item, index) in scanList" :key="index"> <view class="uni-flex u-col" v-for="(item, index) in scanList" :key="index">
<view style="width: 100%; max-height: 100px"> <view style="width: 100%; max-height: 100px">
<view class="uni-flex u-row space-between u-col-center" @click="showItem(item)"> <view class="uni-flex u-row space-between u-col-center" @click="showItem(item)">

73
src/mycomponents/scan/winScanPackage.vue

@ -25,6 +25,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, getCurrentInstance, onMounted, nextTick, watch } from 'vue' import { ref, getCurrentInstance, onMounted, nextTick, watch } from 'vue'
import winComScan from '@/mycomponents/scan/winComScan.vue' import winComScan from '@/mycomponents/scan/winComScan.vue'
import { getBalanceByFilter } from '@/api/request2.js'
const props = defineProps({ const props = defineProps({
title: { title: {
@ -37,13 +38,14 @@ const props = defineProps({
}, },
headerType: { headerType: {
type: String, type: String,
default: 'HPQ' default: 'HPQ,HMQ'
} }
}) })
const show = ref(false) const show = ref(false)
const comscansimulate = ref() const comscansimulate = ref()
const comscan = ref() const comscan = ref()
const comMessageRef = ref() const comMessageRef = ref()
const businessType = ref(null)
const simulateScan = (item) => { const simulateScan = (item) => {
comscansimulate.value.setItemCodeSimulate(item.copyContent) comscansimulate.value.setItemCodeSimulate(item.copyContent)
comscansimulate.value.clickScanMsg() comscansimulate.value.clickScanMsg()
@ -58,7 +60,12 @@ const closeScanPopup = () => {
show.value = false show.value = false
emit('close', '') emit('close', '')
} }
const openScanPopupByBusinessType = (businessTypeParams) => {
setTimeout((res) => {
show.value = false
businessType.value = businessTypeParams
}, 200)
}
const scanClick = () => { const scanClick = () => {
if (comscan.value) { if (comscan.value) {
comscan.value.clickScanMsg() comscan.value.clickScanMsg()
@ -73,12 +80,72 @@ const cancelClick = () => {
const getScanResult = (result) => { const getScanResult = (result) => {
if (result.success) { if (result.success) {
getBalance(result, (res) => {
result.balance = res
emit('getResult', result) emit('getResult', result)
})
} else { } else {
showMessage(result.message) showMessage(result.message)
} }
} }
const getBalance = (result, callback) => {
const filters = []
const { label } = result
const packageInfo = result.package
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 (businessType.value != null) {
filters.push({
column: 'inventoryStatus',
action: 'in',
value: businessType.value.inInventoryStatuses
})
}
const params = {
filters,
pageNo: 1,
pageSize: 100
}
getBalanceByFilter(params)
.then((res) => {
if (res.length == 0) {
showErrorMessage('未查找到该包装的库存余额', (res) => {
packGetFocus()
})
} else {
callback(res.data)
}
})
.catch((err) => {
showErrorMessage(err.message)
})
}
const getfocus = () => { const getfocus = () => {
if (comscan.value != undefined) { if (comscan.value != undefined) {
comscan.value.getfocus() comscan.value.getfocus()
@ -94,6 +161,8 @@ const losefocus = () => {
const showMessage = (message) => { const showMessage = (message) => {
comMessageRef.value.showMessage(message) comMessageRef.value.showMessage(message)
} }
//
const emit = defineEmits(['getResult'])
</script> </script>
<style lang="scss"> <style lang="scss">

20
src/pages.json

@ -2094,6 +2094,26 @@
"navigationBarTitleText": "标签成品标签", "navigationBarTitleText": "标签成品标签",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},{
"path": "pages/material/materialDowngrade",
"style": {
"navigationBarTitleText": "物料降级",
"enablePullDownRefresh": false
}
},
{
"path": "pages/fg/receiptByPlan",
"style": {
"navigationBarTitleText": "按计划报工",
"enablePullDownRefresh": false
}
},
{
"path": "pages/fg/receiptNoPlan",
"style": {
"navigationBarTitleText": "无计划报工",
"enablePullDownRefresh": false
}
} }
], ],
"globalStyle": { "globalStyle": {

5
src/pages/fg/receiptByPlan.vue

@ -0,0 +1,5 @@
<template></template>
<script></script>
<style></style>

398
src/pages/fg/receiptNoPlan.vue

@ -0,0 +1,398 @@
<template>
<view class="page-wraper">
<view class="page-header">
<view class="page-header-box">
<view class="header_job_top">
<job-top :dataContent="jobContent"></job-top>
</view>
<!-- <view class="header_item">
申请单号{{jobContent.requestNumber}}
</view>
-->
<view class="cen_card u-p-t-20" style="padding: 5rpx">
<view class="cell_box uni-flex uni-row">
<view class="cell_info">
<view class="text_lightblue">发货类型</view>
<view>{{ jobContent.deliverType }}</view>
</view>
<view class="cell_info">
<view class="text_lightblue">客户代码</view>
<view>{{ jobContent.customerCode }}</view>
</view>
<view class="cell_info">
<view class="text_lightblue">目标库位</view>
<view>{{ toLocationCode }}</view>
</view>
</view>
</view>
</view>
</view>
<view class="page-main">
<scroll-view scroll-y="true" class="">
<view v-for="(toLocation, index) in detailSource">
<comDeliverDetailCard ref="comIssueDetailCardRef" :dataContent="toLocation" @updateData="updateData"> </comDeliverDetailCard>
</view>
</scroll-view>
</view>
<div class="btn_bottom" style="width: 100%">
<view class="" style="display: flex; flex-direction: row">
<button class="btn_commit" hover-class="btn_commit_after" style="flex: 1" @click="submit()">提交</button>
</view>
</div>
<win-scan-button @goScan="openScanDetailPopup"></win-scan-button>
<comScanDeliverPack ref="comScanIssuePackRef" @closeScan="closeScan" @updateData="updateData"> </comScanDeliverPack>
<com-message ref="comMessageRef" />
</view>
</template>
<script setup lang="ts">
import { ref, getCurrentInstance, nextTick } from 'vue'
import { onLoad, onShow, onNavigationBarButtonTap, onReady, onBackPress, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
import { getDeliverDetail, takeDeliverJob, cancleTakeDeliverJob, deliverJobSubmit } from '@/api/request2.js'
import { calc } from '@/common/calc.js'
import { goHome, navigateBack, getRemoveOption, getCurrDateTime, getPackingNumberAndBatch } from '@/common/basic.js'
import { getDataSource } from '@/pages/issue/js/issue.js'
import { getManagementPrecisions } from '@/common/balance.js'
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comDeliverDetailCard from '@/pages/deliver/coms/comDeliverDetailCard.vue'
import comScanDeliverPack from '@/pages/deliver/coms/comScanDeliverPack.vue'
import jobTop from '@/mycomponents/job/jobTop.vue'
import { useCountStore } from '@/store'
// store
const store = useCountStore()
const { proxy } = getCurrentInstance()
const id = ref('')
const jobContent = ref({}) //
const subList = ref([]) // subList
const detailSource = ref([]) //
const detailOptions = ref([])
const scanOptions = ref([])
const status = ref('')
const toLocationCode = ref('')
const jobStatus = ref('')
const scanPopup = ref()
const comScanIssuePackRef = ref()
const comMessageRef = ref()
const managementList = ref([])
const comIssueDetailCardRef = ref()
onLoad((option) => {
id.value = option.id
if (id.value != undefined) {
//
if (option.status == '1') {
receive((callback) => {
getDetail()
})
} else {
getDetail()
}
}
})
//
onNavigationBarButtonTap((e) => {
if (e.index === 0) {
goHome()
}
})
//
onBackPress((e) => {
//
if (e.from == 'backbutton') {
if (jobStatus.value == '2') {
//
cancleTakeDeliverJob(id.value)
.then((res) => {
uni.navigateBack()
})
.catch((error) => {
uni.navigateBack()
})
} else {
uni.navigateBack()
}
return true
}
})
const receive = (callback) => {
if (id.value != null) {
takeDeliverJob(id.value)
.then((res) => {
callback()
})
.catch((error) => {
showErrorMessage(error)
})
}
}
const getDetail = () => {
proxy.$modal.loading('加载中....')
getDeliverDetail(id.value)
.then((res) => {
uni.hideLoading()
if (res.data == null) {
showMessage('未获取到详情')
} else if (res.data.subList.length > 0) {
jobContent.value = res.data
jobStatus.value = res.data.status
subList.value = res.data.subList
detailSource.value = getDataSource(detailSource.value, subList.value)
toLocationCode.value = subList.value[0].toLocationCode
setTimeout((r) => {
resizeCollapse()
}, 100)
uni.hideLoading()
} else {
showMessage('列表数据为0')
}
})
.catch((error) => {
uni.hideLoading()
showErrorMessage(error)
})
}
const closeScan = () => {
resizeCollapse()
}
const resizeCollapse = () => {
nextTick((r) => {
comIssueDetailCardRef.value.forEach((r) => {
r.resizeCollapse()
})
})
}
const submit = () => {
proxy.$modal.loading('提交中....')
//
const itemCodes = []
const locationCode = detailSource.value[0].toLocationCode
detailSource.value.forEach((toLocation) => {
toLocation.Items.forEach((item) => {
itemCodes.push(item.itemCode)
})
})
// 使
if (locationCode == null) {
submitJob()
} else {
//
getManagementPrecisions(itemCodes, locationCode, (res) => {
if (res.success) {
managementList.value = res.list
submitJob()
} else {
uni.hideLoading()
showErrorMessage(res.message)
}
})
}
}
const submitJob = () => {
const params = setParams()
if (params.subList.length == 0) {
uni.hideLoading()
comMessageRef.value.showConfirmMessageModal('请扫描箱码')
return
}
deliverJobSubmit(params)
.then((res) => {
uni.hideLoading()
if (res.data) {
showCommitSuccessMessage(`提交成功<br>生成发货记录<br>${res.data}`)
} else {
showErrorMessage(`提交失败[${res.msg}]`)
}
})
.catch((error) => {
uni.hideLoading()
showErrorMessage(error)
})
}
const setParams = () => {
const subList = []
const createTime = getCurrDateTime()
const creator = store.id
detailSource.value.forEach((toLocationCode) => {
toLocationCode.Items.forEach((item) => {
item.Locations.forEach((fromLocation) => {
fromLocation.Batchs.forEach((batch) => {
const subItem = batch.detail
subItem.recordList = []
if (batch.Records.length > 0) {
batch.Records.forEach((r) => {
const record = {}
record.handleQty = r.qty
record.toContainerNumber = r.ContainerNumber
record.toInventoryStatus = r.inventoryStatus
record.toLocationCode = subItem.toLocationCode
record.supplierCode = r.supplierCode
// 使
if (toLocationCode.value == null) {
record.toPackingNumber = r.packingNumber
record.toBatch = r.batch
} else {
const info = getPackingNumberAndBatch(managementList.value, r.itemCode, r.packingNumber, r.batch)
record.toPackingNumber = info.packingNumber
record.toBatch = info.batch
}
record.fromPackingNumber = r.packingNumber
subItem.recordList.push(record)
})
subList.push(subItem)
}
})
})
})
})
jobContent.value.subList = subList
jobContent.value.createTime = createTime
jobContent.value.creator = creator
return jobContent.value
}
const cancel = () => {
comMessageRef.value.showQuestionMessage('是否要清空已扫描的物料和目标库位信息?', (res) => {
if (res) {
clearInfo()
}
})
}
const clearInfo = () => {
dataContent.value.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
})
}
})
}
})
}
})
}
const updateData = (record) => {
const requestLocation = detailSource.value.find((r) => r.toLocationCode == record.toLocationCode)
const item = requestLocation.Items.find((r) => r.itemCode == record.itemCode)
let itemHandleQty = 0
if (item != undefined) {
item.Locations.forEach((l) => {
const 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)
}
})
}
// item.handleQty=itemHandleQty;
}
const scanPopupGetFocus = () => {
if (!scanPopup.value) {
scanPopup.value.getfocus()
}
}
const showMessage = (message) => {
comMessageRef.value.showMessage(message, (res) => {
afterCloseMessage()
})
}
const showErrorMessage = (message) => {
comMessageRef.value.showErrorMessage(message, (res) => {
afterCloseMessage()
})
}
const showScanMessage = (message) => {
comMessageRef.value.showScanMessage(message)
}
const showCommitSuccess = () => {
comMessageRef.value.showCommitSuccess()
}
const showCommitSuccessMessage = (hint) => {
comMessageRef.value.showSuccessMessage(hint, (res) => {
navigateBack(1)
})
}
const showRescanMessage = (message) => {
comMessageRef.value.showRescanMessage(message)
}
const afterCloseMessage = () => {
scanPopupGetFocus()
}
const closeScanMessage = () => {
scanPopupGetFocus()
}
const confirm = (data) => {
dataContent.value = data
}
const confirmResult = (result) => {
dataContent.value = result
}
const openScanDetailPopup = () => {
const datacontent = {}
//
// Object.assign(datacontent, this.detailSource);
comScanIssuePackRef.value.openScanPopup(detailSource.value, jobContent.value)
}
const closeScanPopup = () => {
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>
<template></template>
<script></script>
<style></style>

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

@ -74,8 +74,6 @@ const getScanResult = (data) => {
const labelInfo = data.label const labelInfo = data.label
var data = { var data = {
productionLineCode: labelInfo.productionLineCode,
workStationCode: labelInfo.workStationCode,
itemCode: labelInfo.itemCode, itemCode: labelInfo.itemCode,
location: labelInfo.location, location: labelInfo.location,
qty: labelInfo.qty, qty: labelInfo.qty,
@ -83,6 +81,8 @@ const getScanResult = (data) => {
packUnit: labelInfo.packUnit packUnit: labelInfo.packUnit
} }
detailSource.value.subList.push(data) detailSource.value.subList.push(data)
detailSource.value.productionLineCode = labelInfo.productionLineCode
detailSource.value.workStationCode = labelInfo.workStationCode
detailSource.value.warehouseCode = labelInfo.warehouseCode detailSource.value.warehouseCode = labelInfo.warehouseCode
detailSource.value.workshopCode = labelInfo.workshopCode detailSource.value.workshopCode = labelInfo.workshopCode
submit() submit()

288
src/pages/material/materialDowngrade.vue

@ -0,0 +1,288 @@
<template>
<view class="page-wraper">
<view class="">
<com-blank-view @goScan="openScanPopup" v-if="detailSource.length == 0"></com-blank-view>
</view>
<view class="page-wraper" v-if="detailSource.length > 0">
<!-- <view class="page-header">
<view class="header_item">
来源库位 : {{fromLocationCode}}
</view>
<u-line />
</view> -->
<view class="page-main">
<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)" @updateData="updateData" @removePack="removePack"> </record-com-detail-card>
</view>
</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="">
<!-- <requiredLocation v-if="showToLoaction" title="目标库位" :locationCode="toLocationCode"
@getLocation='getToLocationCode' :locationTypeList="tolocationTypeList"></requiredLocation> -->
</view>
<view class="uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
</view>
</view>
</view>
<win-scan-button @goScan="openScanPopup"></win-scan-button>
</view>
<win-scan-package ref="scanPopup" @getResult="getScanResult" :allowModifyLocation="false"> </win-scan-package>
<comMessage ref="comMessage"></comMessage>
<!-- <win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation'
:locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location> -->
</view>
</template>
<script>
import { putawayRecordSubmit, validateItemAndLocation, getPutawayRecommendLocation } from '@/api/request2.js'
import { goHome, updateTitle, getCurrDateTime, getPackingNumberAndBatchByList, deepCopyData } from '@/common/basic.js'
import { calc } from '@/common/calc.js'
import { getInventoryStatusDesc, getDirectoryItemArray } from '@/common/directory.js'
import { getBusinessType, createItemInfo, createDetailInfo, calcHandleQty } from '@/common/record.js'
import { getManagementPrecisions, getPrecisionStrategyList, getPrecisionStrategyParams } from '@/common/balance.js'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackage from '@/mycomponents/scan/winScanPackage.vue'
// import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanLocation from '@/mycomponents/scan/winScanLocation.vue'
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
export default {
components: {
winScanButton,
winScanPackage,
// requiredLocation,
comBlankView,
winScanLocation,
recordComDetailCard
},
data() {
return {
id: '',
dataContent: {}, //
detailSource: [], //
fromLocationInfo: {},
fromLocationCode: '',
fromLocationAreaTypeList: [],
toLocationAreaTypeList: [],
inInventoryStatus: '', //
outInventoryStatus: '', //
businessType: {},
showToLoaction: true,
recommendLocationList: [], //
fromWarehouseCode: '', //
businessTypeCode: 'Relegate'
}
},
onLoad(option) {
this.clear()
getBusinessType(this.businessTypeCode, (res) => {
if (res.success) {
this.businessType = res.businessType
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList
this.toLocationAreaTypeList = res.toLocationAreaTypeList
this.openScanPopup()
} else {
this.showErrorMessage(res.message)
}
})
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome()
}
},
//
onBackPress(e) {},
onPullDownRefresh() {},
mounted() {},
methods: {
getScanResult(result) {
const { balance } = result
const { label } = result
const pack = result.package
const { poLine } = label
const { poNumber } = label
const { supplierCode } = label
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, (res) => {
if (res) {
}
})
},
updateData() {
calcHandleQty(this.detailSource)
for (let i = 0; i < this.detailSource.length; i++) {
const item = this.detailSource[i]
if (item.qty == 0) {
this.detailSource.splice(i, 1)
}
}
this.$forceUpdate()
},
removeItem(index, item) {
this.detailSource.splice(index, 1)
this.updateData()
},
openScanPopup() {
this.$refs.scanPopup.openScanPopupByBusinessType(this.businessType)
},
showFromLocationPopup() {
this.$nextTick(() => {
this.$refs.scanLocationCode.openScanPopup()
})
},
closeScanPopup() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.closeScanPopup()
}
},
scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.getfocus()
}
},
// scanLocationCode(location, code) {
// this.toLocationCode = code
// this.toLocationCode = location;
// },
commit() {
uni.showLoading({
title: '提交中....',
mask: true
})
//
const precisionStrategyParams = getPrecisionStrategyParams(this.detailSource)
// 2:
getPrecisionStrategyList(precisionStrategyParams, (res) => {
if (res.success) {
this.managementList = res.list
const params = this.setRecordParams()
console.log('提交参数', JSON.stringify(params))
putawayRecordSubmit(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)
})
} else {
uni.hideLoading()
this.showErrorMessage(res.message)
}
})
},
setRecordParams() {
const subList = []
const creator = this.$store.state.user.id
this.detailSource.forEach((item) => {
item.subList.forEach((detail) => {
if (detail.scaned) {
const info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, detail.packingNumber, detail.toLocationCode, detail.batch)
const submitItem = deepCopyData(detail)
submitItem.toPackingNumber = info.packingNumber
submitItem.toBatch = info.batch
submitItem.toContainerNumber = detail.containerNumber
submitItem.fromPackingNumber = info.packingNumber
submitItem.fromBatch = info.batch
submitItem.fromContainerNumber = detail.containerNumber
submitItem.fromLocationCode = detail.locationCode
submitItem.toLocationCode = detail.toLocationCode
// detail.toInventoryStatus = detail.inventoryStatus
// detail.toLocationCode = detail.toLocationCode
submitItem.qty = detail.handleQty
submitItem.package = ''
subList.push(submitItem)
}
})
})
if (subList.length > 0) {
this.dataContent.toWarehouseCode = subList[0].toWarehouseCode
}
this.dataContent.subList = subList
this.dataContent.creator = creator
this.dataContent.fromWarehouseCode = this.fromWarehouseCode
return this.dataContent
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, (res) => {
if (res) {
}
})
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message)
},
afterCloseMessage() {
this.scanPopupGetFocus()
},
closeScanMessage() {
this.scanPopupGetFocus()
},
getLocation(location, code) {
this.getFromLocationCode(location, code)
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, (res) => {
this.clear()
})
},
clear() {
this.fromLocationInfo = {}
this.fromLocationCode = ''
this.fromWarehouseCode = ''
this.toWarehouseCode = ''
this.detailSource = []
}
}
}
</script>
<style scoped lang="scss"></style>

5
src/pages/purchaseReceipt/job/receiptDetail.vue

@ -423,10 +423,7 @@ const submitJob = () => {
const timer1 = setInterval(async () => { const timer1 = setInterval(async () => {
if (timerCount == 15) { if (timerCount == 15) {
clearInterval(timer1) clearInterval(timer1)
uni.showToast({ showErrorMessage('上架任务生成异常,请到收货记录里重新生成上架申请')
title: '跳转打印页面失败',
icon: 'none'
})
return return
} }
await getPutawayJobList({ await getPutawayJobList({

3
src/pages/repleinsh/record/directRepleinshRecord.vue

@ -230,7 +230,8 @@ const showBalanceSelect = (items) => {
} }
const selectBalanceItem = (balance) => { const selectBalanceItem = (balance) => {
afterGetBalance(resultData.value, balance) resultData.value.balance = balance
afterGetBalance(resultData.value)
} }
const afterGetBalance = (result) => { const afterGetBalance = (result) => {

Loading…
Cancel
Save