Browse Source

完善物料变更功能及按计划完工2024/7/31 22:58:41

hella_vue3
zhang_li 3 months ago
parent
commit
38fe15dd4a
  1. 16
      src/common/utils/storage.js
  2. 4
      src/mycomponents/balance/balance.vue
  3. 21
      src/mycomponents/balance/light.vue
  4. 41
      src/mycomponents/print/print.vue
  5. 24
      src/mycomponents/scan/winComScanBalance.vue
  6. 291
      src/pages/fg/fgChange.vue
  7. 10
      src/pages/fg/receiptByPlan.vue
  8. 18
      src/pages/fg/receiptNoPlan.vue
  9. 53
      src/pages/package/job/overPackageJobDetail.vue
  10. 49
      src/pages/package/record/overPackageRecord.vue

16
src/common/utils/storage.js

@ -10,7 +10,21 @@ const setStorage = (key,value)=>{
// 清除全部本地存储 // 清除全部本地存储
const clearStorage = ()=>{ const clearStorage = ()=>{
uni.clearStorageSync(); const overPackageRecordPointParams = ''
if( uni.getStorageSync('overPackageRecordPointParams')){
overPackageRecordPointParams = uni.getStorageSync('overPackageRecordPointParams')
}
const overPackageJobDetailPointParams = ''
if( uni.getStorageSync('overPackageJobDetailPointParams')){
overPackageJobDetailPointParams = uni.getStorageSync('overPackageJobDetailPointParams')
}
uni.clearStorageSync();
if(overPackageRecordPointParams){
uni.setStorageSync('overPackageRecordPointParams',overPackageRecordPointParams)
}
if(overPackageJobDetailPointParams){
uni.setStorageSync('overPackageJobDetailPointParams',overPackageJobDetailPointParams)
}
} }
// 清除指定key本地存储 // 清除指定key本地存储

4
src/mycomponents/balance/balance.vue

@ -15,9 +15,9 @@
<qty v-if="dataContent.handleQty == 0 || dataContent.handleQty == undefined" :dataContent="dataContent" :isShowStdPack="isShowStdPack" :isShowStatus="isShowStatus"></qty> <qty v-if="dataContent.handleQty == 0 || dataContent.handleQty == undefined" :dataContent="dataContent" :isShowStdPack="isShowStdPack" :isShowStatus="isShowStatus"></qty>
<compare-qty v-else :dataContent="dataContent" :recommendQty="Number(dataContent.qty)" :handleQty="Number(dataContent.handleQty)" :isShowStdPack="isShowStdPack" :isShowStatus="isShowStatus"> </compare-qty> <compare-qty v-else :dataContent="dataContent" :recommendQty="Number(dataContent.qty)" :handleQty="Number(dataContent.handleQty)" :isShowStdPack="isShowStdPack" :isShowStatus="isShowStatus"> </compare-qty>
<view class="uni-flex uni-row" style="vertical-align: center" v-if="isDevlement()"> <!-- <view class="uni-flex uni-row" style="vertical-align: center" v-if="isDevlement()">
<image style="width: 26rpx; height: 26rpx; margin-top: 40rpx" src="/static/icons/icon_copy.svg" alt="" @click="copy" /> <image style="width: 26rpx; height: 26rpx; margin-top: 40rpx" src="/static/icons/icon_copy.svg" alt="" @click="copy" />
</view> </view> -->
</view> </view>
<!-- <view class="" v-if="dataContent.inventoryStatus"> <!-- <view class="" v-if="dataContent.inventoryStatus">
<move-status :fromInventoryStatus="dataContent.inventoryStatus"> </move-status> <move-status :fromInventoryStatus="dataContent.inventoryStatus"> </move-status>

21
src/mycomponents/balance/light.vue

@ -0,0 +1,21 @@
<template>
<view class="card_view">
<text class="card_light">{{ title }}</text>
<text class="card_content">{{ lightCode }}</text>
</view>
</template>
<script setup lang="ts">
const props = defineProps({
lightCode: {
type: String,
default: ''
},
title: {
type: String,
default: '灯码'
}
})
</script>
<style></style>

41
src/mycomponents/print/print.vue

@ -74,10 +74,10 @@ export default {
}, },
methods: { methods: {
setDefaultData(printDeafult, templateDeafult) { setDefaultData(printDeafult, templateDeafult) {
this.templateName = printDeafult.name this.printName = printDeafult?.label || '请选择打印机'
this.printCode = printDeafult.code this.printCode = printDeafult?.value || ''
this.templateName = templateDeafult.name this.templateName = templateDeafult?.label || '请选择打印模板'
this.templateCode = templateDeafult.code this.templateCode = templateDeafult?.value || ''
}, },
showErrorMessage(message, type) { showErrorMessage(message, type) {
@ -85,37 +85,42 @@ export default {
this.$refs.comMessage.showErrorMessage(message, (res) => {}) this.$refs.comMessage.showErrorMessage(message, (res) => {})
}) })
}, },
showSelectPrint() { async showSelectPrint() {
this.showPrintSelect = true
uni.showLoading({ uni.showLoading({
title: '加载中', title: '加载中',
mask: true mask: true
}) })
getPrintList() await getPrintList()
.then((res) => { .then((res) => {
this.printList = [] this.printList = res.data
uni.hideLoading()
}) })
.catch((error) => {}) .catch((error) => {})
this.showPrintSelect = true
}, },
confirmSelectPrint() { confirmSelectPrint(e) {
this.printCode = '' console.log(e)
this.$emit('printCode', this.printCode) this.printCode = e[0].value
this.printName = e[0].label
this.$emit('printCode', e[0])
}, },
showSelectTemplate() { async showSelectTemplate() {
this.showTemplateSelect = true
uni.showLoading({ uni.showLoading({
title: '加载中', title: '加载中',
mask: true mask: true
}) })
getPrintTemplateList() await getPrintTemplateList()
.then((res) => { .then((res) => {
this.templateList = [] this.templateList = res.data
uni.hideLoading()
}) })
.catch((error) => {}) .catch((error) => {})
this.showTemplateSelect = true
}, },
confirmSelectTemplate() { confirmSelectTemplate(e) {
this.templateCode = '' this.templateCode = e[0].value
this.$emit('templateCode', this.templateCode) this.templateName = e[0].label
this.$emit('templateCode', e[0])
} }
} }
} }

24
src/mycomponents/scan/winComScanBalance.vue

@ -17,7 +17,6 @@
</view> </view>
</uni-popup> </uni-popup>
<balance-select ref="balanceSelect" @onSelectItem="selectBalanceItem"></balance-select> <balance-select ref="balanceSelect" @onSelectItem="selectBalanceItem"></balance-select>
<!-- 模拟扫描功能 -->
</view> </view>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</template> </template>
@ -59,6 +58,10 @@ export default {
bussinessCode: { bussinessCode: {
type: String, type: String,
default: '' default: ''
},
verifyCategory: {
type: Boolean,
default: false
} }
}, },
data() { data() {
@ -152,11 +155,19 @@ export default {
.then((res) => { .then((res) => {
if (res.data != null && res.data.list.length > 0) { if (res.data != null && res.data.list.length > 0) {
const result = res.data.list[0] const result = res.data.list[0]
const { status } = result const status = result.available
const { type } = result const { type } = result
if (status == 'ENABLE') { if (status == 'TRUE') {
if (checkDirectoryItemExist(this.itemTypesList, type)) { if (checkDirectoryItemExist(this.itemTypesList, type)) {
callBack() if (this.verifyCategory) {
if (result.category == 'LCJ' || result.category == 'BJ') {
callBack()
} else {
this.showErrorMessage('扫描物料的种类不是【量产件】或者【备件】')
}
} else {
callBack()
}
} else { } else {
const hint = getListItemTypeDesc(this.itemTypesList) const hint = getListItemTypeDesc(this.itemTypesList)
uni.hideLoading() uni.hideLoading()
@ -197,6 +208,11 @@ export default {
if (this.$refs.comscan) { if (this.$refs.comscan) {
this.$refs.comscan.getfocus() this.$refs.comscan.getfocus()
} }
},
losefocus() {
if (this.$refs.comscan) {
this.$refs.comscan.losefocus()
}
} }
} }
} }

291
src/pages/fg/fgChange.vue

@ -6,60 +6,64 @@
<view class="page-wraper" v-if="currentPackage != null"> <view class="page-wraper" v-if="currentPackage != null">
<view class="page-main"> <view class="page-main">
<uni-collapse> <uni-collapse>
<uni-collapse-item> <uni-collapse-item :open="true">
<template v-slot:title> <template v-slot:title>
<view class="card_itemName" style="padding: 3px 5px; font-size: 28rpx"> 变更前包装信息 </view> <view class="card_itemName" style="padding: 3px 5px; font-size: 28rpx"> 变更信息 </view>
</template> </template>
<PackageAndItemCard :dataContent="currentPackage"></PackageAndItemCard> <view class="">
<view class="uni-flex uni-row u-col-center padding_10">
<text style="font-size: 28rpx">变更前物料</text>
<view class="card_itemCode" style="margin-left: 20rpx">
{{ currentPackage.itemCode }}
</view>
</view>
<view class="uni-flex uni-row u-col-center padding_10">
<text style="font-size: 28rpx">变更后物料</text>
<view class="uni-flex u-col-center uni-row" @click="showSelect">
<view class="card_itemCode" style="margin-left: 20rpx; color: blue">
{{ toItemCode }}
</view>
<view class="">
<image src="/static/icons/down.svg" mode="" style="width: 40rpx; height: 40rpx; margin-left: 20rpx"> </image>
</view>
<u-select v-model="show" mode="single-column" :list="toItemList" @confirm="confirmSelect"></u-select>
</view>
</view>
<view class="uni-flex uni-row u-col-center padding_10"
><text style="font-size: 28rpx">变更原因</text>
<view class="uni-flex uni-row">
<uni-easyinput style="margin-left: 20px" v-model="reason"></uni-easyinput>
</view>
</view>
</view>
</uni-collapse-item> </uni-collapse-item>
</uni-collapse> </uni-collapse>
<view> <balance style="margin-top: 5px" :dataContent="currentPackage" :isShowFromLocation="false"></balance>
<scroll-view scroll-y="true" class=""> <view style="margin-left: 30rpx; margin-top: 10rpx; margin-bottom: 10rpx" v-for="(item, index) in fgList" :key="index">
<view class="" v-for="(item, index) in fgList" :key="index"> <uni-swipe-action>
<uni-swipe-action> <uni-swipe-action-item :right-options="options">
<uni-swipe-action-item :right-options="options"> <view :class="item.scaned == true ? 'scan_view' : 'auto-wrap'">
<view class="uni-flex uni-row" style="margin-left: 50rpx; padding-top: 10rpx; padding-bottom: 10rpx"> <light :lightCode="item.remark"></light>
<!-- scan_view --> </view>
<view class="auto-wrap" style="font-size: 35rpx; font-weight: bold; width: 100%"> </uni-swipe-action-item>
<text style="font-size: 30rpx; color: #b66463">唯一码 </text> </uni-swipe-action>
{{ item.remark }}
</view>
</view>
</uni-swipe-action-item>
</uni-swipe-action>
<u-line color="#D8D8D8"></u-line>
</view>
</scroll-view>
</view> </view>
</view> </view>
<view class="page-footer"> <view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10" style="background-color: ghostwhite; width: 100%"> <view class="uni-flex u-col-center space-between padding_10" style="background-color: ghostwhite; width: 100%">
<view class=""> <view></view>
<view class="uni-flex uni-row u-col-center">
<text style="font-size: 28rpx">变更后物料</text>
<view class="uni-flex u-col-center uni-row" @click="showSelect">
<view class="card_itemCode" style="margin-left: 20rpx; color: blue">
{{ toItemCode }}
</view>
<view class="">
<image src="/static/icons/down.svg" mode="" style="width: 40rpx; height: 40rpx; margin-left: 20rpx" @click="showSelect"> </image>
</view>
<u-select v-model="show" mode="single-column" :list="toItemList" @confirm="confirmSelect"></u-select>
</view>
</view>
</view>
<view class="uni-flex uni-row"> <view class="uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> <button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
</view> </view>
</view> </view>
</view> </view>
<win-scan-button @goScan="openScanPopup"></win-scan-button> <win-scan-button @goScan="openScanFgPopup"></win-scan-button>
</view> </view>
<win-com-scan-balance ref="scanPopup" @getBalance="getPackScanResult" :bussinessCode="bussinessCode"> </win-com-scan-balance> <win-com-scan-balance ref="scanPopup" @getBalance="getPackScanResult" :bussinessCode="bussinessCode" :verifyCategory="true"> </win-com-scan-balance>
<win-scan-fg-label ref="scanPopup" @getResult="getFgScanResult" title="制品标签"></win-scan-fg-label> <win-scan-fg-label ref="scanFgPopup" @getResult="getFgScanResult" title="灯码"></win-scan-fg-label>
<!-- <win-scan-pack ref="scanPopup" @getResult='getScanResult' title="制品标签" headerType="HMQ"></win-scan-pack> --> <!-- <win-scan-pack ref="scanPopup" @getResult='getScanResult' title="制品标签" headerType="HMQ"></win-scan-pack> -->
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
@ -85,6 +89,8 @@ import comBlankView from '@/mycomponents/common/comBlankView.vue'
import PackageAndItemCard from '@/mycomponents/package/PackageAndItemCard.vue' import PackageAndItemCard from '@/mycomponents/package/PackageAndItemCard.vue'
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue' import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
import winScanFgLabel from '@/mycomponents/scan/winScanFgLabel.vue' import winScanFgLabel from '@/mycomponents/scan/winScanFgLabel.vue'
import balance from '@/mycomponents/balance/balance.vue'
import light from '@/mycomponents/balance/light.vue'
export default { export default {
components: { components: {
@ -94,24 +100,20 @@ export default {
comBlankView, comBlankView,
PackageAndItemCard, PackageAndItemCard,
winComScanBalance, winComScanBalance,
winScanFgLabel winScanFgLabel,
balance,
light
}, },
data() { data() {
return { return {
detailSource: [], // bussinessCode: 'Relegate',
toLocationCode: '',
fromLocationTypeList: [],
fromLocationCode: '',
businessType: {}, businessType: {},
dataContent: {},
managementList: [],
show: false, show: false,
toItemCode: '请选择变更后物料', toItemCode: '请选择变更后物料',
toItemList: [], toItemList: [],
fgList: [], fgList: [],
options: [],
currentPackage: null, currentPackage: null,
bussinessCode: 'Relegate' reason: ''
} }
}, },
mounted() {}, mounted() {},
@ -187,6 +189,7 @@ export default {
.then((res) => { .then((res) => {
if (res.data.length > 0) { if (res.data.length > 0) {
this.fgList = res.data this.fgList = res.data
const pack = result.package const pack = result.package
const { balance } = result const { balance } = result
this.currentPackage = result.package this.currentPackage = result.package
@ -209,29 +212,31 @@ export default {
}, },
getFgScanResult(result) { getFgScanResult(result) {
const that = this const item = this.fgList.find((r) => r.remark == result.content)
const itemIndex = this.allList.findIndex((r) => r.content == result.content)
// //
if (itemIndex == -1) { if (item != undefined) {
// if (this.allList.length > this.dataContent.packQty) { const index = this.fgList.findIndex((r) => r.remark == result.content)
// this.showErrorMessage("") if (item.scaned == true) {
// return; this.$refs.comMessage.showQuestionMessage(`灯码【${result.content}】已经扫描,是否移除`, (res) => {
// } if (res) {
result.countTime = new Date() item.scaned = false
this.allList.push(result) this.fgList.splice(index, 1)
this.allList.sort(compare('countTime')) // this.fgList.push(item) // ();
this.initList() }
this.scanPopupGetFocus() })
this.calcFgQty() } else {
item.scaned = true
this.fgList.unshift(this.fgList.splice(index, 1)[0]) // ();
}
this.calcHandleQty()
} else { } else {
this.$refs.comMessage.showQuestionMessage(`唯一码【${result.content}】已经扫描,是否移除`, (res) => { this.showErrorMessage('扫描的灯码不在灯码列表中')
if (res) { }
this.allList.splice(itemIndex, 1) },
this.allList.sort(compare('countTime')) //
this.initList() calcHandleQty() {
that.calcFgQty() if (this.fgList.length > 0) {
} this.currentPackage.handleQty = this.fgList.filter((r) => r.scaned == true).length
})
} }
}, },
@ -242,114 +247,43 @@ export default {
}) })
}, },
openScanFgPopup() {
setTimeout((r) => {
this.$refs.scanFgPopup.openScanPopup(this.currentPackage.itemCode)
this.scanFgPopupGetFocus()
})
},
commit() { commit() {
if (this.positionInfo == '请选择位置') { if (this.toItemCode == '请选择变更后物料') {
this.showMessage('请先选择位置') this.showMessage('请选择变更后物料')
return return
} }
if (this.currentPackage.handleQty == null) {
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { this.$refs.comMessage.showQuestionMessage('是否要将全部灯码进行变更?', (res) => {
// if (res) {
uni.showLoading({ this.commitRecord()
title: '提交中....',
mask: true
})
this.managementList = []
const precisionStrategParams = this.setPrecisionStrategParams()
getPrecisionStrategyList(precisionStrategParams, (res) => {
if (res.success) {
this.managementList = res.list
const params = this.setParams()
console.log(`提交${JSON.stringify(params)}`)
productionReceiptRecordSubmit(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)
} }
}) })
} else { } else {
this.showErrorMessage('没有要提交的数据,请先扫描') this.$refs.comMessage.showQuestionMessage(`是否要将已扫描的【${this.currentPackage.handleQty}】个灯码进行变更?`, (res) => {
} if (res) {
}, this.commitRecord()
setPrecisionStrategParams() {
const itemList = []
this.detailSource.forEach((item) => {
item.subList.forEach((detail) => {
if (detail.scaned) {
detail.toLocationCode = this.fgLocationCode
const filterResult = itemList.filter((res) => {
if (res.itemCode == item.itemCode && detail.toLocationCode == res.locationCode) {
return res
}
})
//
if (filterResult.length == 0) {
const result = {
itemCode: item.itemCode,
locationCode: detail.toLocationCode
}
itemList.push(result)
}
} }
}) })
}) }
return itemList },
commitRecord() {
// this.showCommitSuccessMessage('')
}, },
setParams() { setParams() {
const subList = [] let scanedList = this.fgList.filter((r) => r.scaned == true)
const creator = this.$store.state.user.id if (this.currentPackage.handleQty > 0) {
this.detailSource.forEach((item) => { scanedList = this.fgList.filter((r) => r.scaned == true)
item.subList.forEach((detail) => { }
if (detail.scaned) {
const submitItem = deepCopyData(detail)
const info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, detail.packingNumber, detail.toLocationCode, detail.batch)
submitItem.itemCode = detail.itemCode
submitItem.itemName = detail.package.itemName
submitItem.itemDesc1 = detail.package.itemDesc1
submitItem.itemDesc2 = detail.package.itemDesc2
submitItem.inventoryStatus = detail.inventoryStatus
submitItem.fromPackingNumber = info.packingNumber
submitItem.toPackingNumber = info.packingNumber
submitItem.fromContainerNumber = detail.containerNumber
submitItem.toContainerNumber = detail.containerNumber
submitItem.fromBatch = info.batch
submitItem.toBatch = info.batch
submitItem.fromLocationCode = detail.locationCode
submitItem.toLocationCode = detail.toLocationCode
submitItem.productionlineCode = this.productionLineCode
submitItem.workStationCode = this.workStationCode
submitItem.qty = detail.handleQty
submitItem.package = ''
subList.push(submitItem) const creator = this.$store.state.user.id
}
})
})
this.dataContent.subList = subList
this.dataContent.creator = creator
this.dataContent.workshopCode = this.workshopCode
return this.dataContent
}, },
showMessage(message) { showMessage(message) {
@ -384,6 +318,12 @@ export default {
} }
}, },
scanFgPopupGetFocus() {
if (this.$refs.scanFgPopup != undefined) {
this.$refs.scanFgPopup.getfocus()
}
},
scanPopupLoseFocus() { scanPopupLoseFocus() {
if (this.$refs.scanPopup != undefined) { if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.losefocus() this.$refs.scanPopup.losefocus()
@ -401,28 +341,15 @@ export default {
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, (res) => { this.$refs.comMessage.showSuccessMessage(hint, (res) => {
this.clearData() this.clearData()
this.openScanPopup()
}) })
}, },
clearData() { clearData() {
this.subList = [] this.toItemCode = '请选择变更后物料'
this.detailSource = [] this.toItemList = []
this.toLocationCode = '' this.fgList = []
this.dataContent = {} this.currentPackage = null
this.positionInfo = '请选择位置' this.reason = ''
this.fgLocationCode = ''
},
removePack() {
for (let i = 0; i < this.detailSource.length; i++) {
const item = this.detailSource[i]
if (item.subList.length == 0) {
this.detailSource.splice(i, 1)
}
}
this.updateData()
},
removeItem(index, item) {
this.detailSource.splice(index, 1)
}, },
showSelect() { showSelect() {

10
src/pages/fg/receiptByPlan.vue

@ -42,7 +42,7 @@
</view> </view>
<view style="word-break: break-all; font-size: 35rpx; font-weight: bold"> <view style="word-break: break-all; font-size: 35rpx; font-weight: bold">
<text v-if="dataContent.handleQty > 0" style="color: #ffa500">{{ dataContent.handleQty }}/</text> <text v-if="dataContent.handleQty > 0" style="color: #ffa500">{{ dataContent.handleQty }}/</text>
{{ dataContent.packQtyHint }} <text class="text_recommend">{{ dataContent.packQtyHint }}</text>
</view> </view>
</view> </view>
<view class="split_line" v-if="dataContent"></view> <view class="split_line" v-if="dataContent"></view>
@ -54,11 +54,12 @@
<view class="scan_view" v-for="(item, index) in showList" :key="index"> <view class="scan_view" v-for="(item, index) in showList" :key="index">
<uni-swipe-action> <uni-swipe-action>
<uni-swipe-action-item :right-options="options" @click="swipeClick($event, item, index)"> <uni-swipe-action-item :right-options="options" @click="swipeClick($event, item, index)">
<view class="uni-flex uni-row" style="margin-left: 50rpx; padding-top: 10rpx; padding-bottom: 10rpx"> <view class="uni-flex uni-row" style="margin-left: 30rpx; margin-top: 10rpx; margin-bottom: 10rpx">
<view class="auto-wrap" style="font-size: 35rpx; font-weight: bold; width: 100%"> <light :lightCode="item.content"></light>
<!-- <view class="auto-wrap" style="font-size: 35rpx; font-weight: bold; width: 100%">
<text style="font-size: 30rpx; color: #b66463">唯一码 </text> <text style="font-size: 30rpx; color: #b66463">唯一码 </text>
{{ item.content }} {{ item.content }}
</view> </view> -->
</view> </view>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
@ -100,6 +101,7 @@ import batch from '@/mycomponents/balance/batch.vue'
import pack from '@/mycomponents/balance/pack.vue' import pack from '@/mycomponents/balance/pack.vue'
import winScanFgLabel from '@/mycomponents/scan/winScanFgLabel.vue' import winScanFgLabel from '@/mycomponents/scan/winScanFgLabel.vue'
import comFgCard from '@/pages/productReceipt/coms/comFgCard.vue' import comFgCard from '@/pages/productReceipt/coms/comFgCard.vue'
import light from '@/mycomponents/balance/light.vue'
const dataContent = ref(null) const dataContent = ref(null)
const options = ref([]) const options = ref([])

18
src/pages/fg/receiptNoPlan.vue

@ -31,7 +31,8 @@
</view> </view>
<view style="word-break: break-all; font-size: 35rpx; font-weight: bold"> <view style="word-break: break-all; font-size: 35rpx; font-weight: bold">
<text v-if="dataContent.handleQty > 0" style="color: #ffa500">{{ dataContent.handleQty }}/</text> <text v-if="dataContent.handleQty > 0" style="color: #ffa500">{{ dataContent.handleQty }}/</text>
{{ dataContent.packQtyHint }} <!-- {{dataContent.packQtyHint}} -->
<text class="text_recommend">{{ dataContent.packQtyHint }}</text>
</view> </view>
</view> </view>
</view> </view>
@ -42,11 +43,12 @@
<view class="scan_view" v-for="(item, index) in showList" :key="index"> <view class="scan_view" v-for="(item, index) in showList" :key="index">
<uni-swipe-action> <uni-swipe-action>
<uni-swipe-action-item :right-options="options" @click="swipeClick($event, item, index)"> <uni-swipe-action-item :right-options="options" @click="swipeClick($event, item, index)">
<view class="uni-flex uni-row" style="margin-left: 50rpx; padding-top: 10rpx; padding-bottom: 10rpx"> <view class="uni-flex uni-row" style="margin-left: 30rpx; margin-top: 10rpx; margin-bottom: 10rpx">
<view class="auto-wrap" style="font-size: 35rpx; font-weight: bold; width: 100%"> <light :lightCode="item.content"></light>
<text style="font-size: 30rpx; color: #b66463">唯一码 </text> <!-- <view class="auto-wrap" style="font-size: 35rpx;font-weight: bold; width: 100%;">
{{ item.content }} <text style="font-size: 30rpx;color: #B66463;">唯一码 </text>
</view> {{item.content}}
</view> -->
</view> </view>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
@ -87,6 +89,7 @@ import batch from '@/mycomponents/balance/batch.vue'
import pack from '@/mycomponents/balance/pack.vue' import pack from '@/mycomponents/balance/pack.vue'
import winScanFgLabel from '@/mycomponents/scan/winScanFgLabel.vue' import winScanFgLabel from '@/mycomponents/scan/winScanFgLabel.vue'
import comFgCard from '@/pages/productReceipt/coms/comFgCard.vue' import comFgCard from '@/pages/productReceipt/coms/comFgCard.vue'
import light from '@/mycomponents/balance/light.vue'
export default { export default {
components: { components: {
@ -97,7 +100,8 @@ export default {
pack, pack,
winScanButton, winScanButton,
winScanFgLabel, winScanFgLabel,
comFgCard comFgCard,
light
}, },
data() { data() {
return { return {

53
src/pages/package/job/overPackageJobDetail.vue

@ -1,5 +1,8 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<div style="background: white">
<print ref="printService" @printCode="printCode" @templateCode="templateCode"></print>
</div>
<view class="page-header"> <view class="page-header">
<view class="page-header-box"> <view class="page-header-box">
<view class="header_job_top"> <view class="header_job_top">
@ -66,6 +69,7 @@ import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comScanPackagePack from '@/pages/package/coms/comScanPackagePack.vue' import comScanPackagePack from '@/pages/package/coms/comScanPackagePack.vue'
import jobTop from '@/mycomponents/job/jobTop.vue' import jobTop from '@/mycomponents/job/jobTop.vue'
import workStation from '@/mycomponents/workStation/workStation.vue' import workStation from '@/mycomponents/workStation/workStation.vue'
import print from '@/mycomponents/print/print.vue'
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
// store // store
const store = useCountStore() const store = useCountStore()
@ -77,11 +81,14 @@ const detailSource = ref([]) // 绑定在页面上的数据源
const detailOptions = ref([]) const detailOptions = ref([])
const scanOptions = ref([]) const scanOptions = ref([])
const jobStatus = ref('') const jobStatus = ref('')
const printDeafult = ref({}) //
const templateDeafult = ref({}) //
const scanPopup = ref() const scanPopup = ref()
const comScanPackagePackRef = ref() const comScanPackagePackRef = ref()
const comMessageRef = ref() const comMessageRef = ref()
const comOverPackJobDetailCardRef = ref() const comOverPackJobDetailCardRef = ref()
const managementList = ref([]) const managementList = ref([])
const printService = ref()
onLoad((option) => { onLoad((option) => {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: `${option.title}详情` title: `${option.title}详情`
@ -155,7 +162,14 @@ const getDetail = () => {
jobStatus.value = res.data.status jobStatus.value = res.data.status
subList.value = res.data.subList subList.value = res.data.subList
detailSource.value = getDataSource(detailSource.value, subList.value) detailSource.value = getDataSource(detailSource.value, subList.value)
nextTick(() => {
if (uni.getStorageSync('overPackageJobDetailPointParams')) {
const overPackageJobDetailPointParams = uni.getStorageSync('overPackageJobDetailPointParams')
jobContent.value.printerUuid = overPackageJobDetailPointParams.printDeafult.value
jobContent.value.modelCode = overPackageJobDetailPointParams.templateDeafult.value
printService.value.setDefaultData(overPackageJobDetailPointParams.printDeafult, overPackageJobDetailPointParams.templateDeafult)
}
})
setTimeout((r) => { setTimeout((r) => {
resizeCollapse() resizeCollapse()
}, 100) }, 100)
@ -231,29 +245,16 @@ const submitJob = () => {
overPageSubmit(params) overPageSubmit(params)
.then((res) => { .then((res) => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data == '打印任务已发送,等待打印机处理!') {
const list = [] const list = []
res.data.forEach((item) => { showCommitSuccessMessage(res.data)
list.push({ const overPackageJobDetailPointParams = {
itemCode: item.itemCode, // printDeafult: printDeafult.value,
itemName: item.itemName, // templateDeafult: templateDeafult.value
packName: item.packName, // }
packageCode: item.number, // uni.setStorageSync('overPackageJobDetailPointParams', overPackageJobDetailPointParams)
batch: item.batch, //
parentNumber: item.parentNumber, //
itemType: item.itemType, //
asnNumber: item.asnNumber, // ASN
supplierCode: item.supplierCode, //
qty: item.qty, //
printTimes: getCurrDateTime(), //
productionLineCode: item.productionLineCode, // 线
barcodeString: item.barcodeString, //
barcodeBase64: ''
})
})
showCommitSuccessMessage('提交成功<br>生成翻包记录<br>', list)
} else { } else {
showErrorMessage(`提交失败[${res.msg}]`) showErrorMessage(res.data)
} }
}) })
.catch((error) => { .catch((error) => {
@ -316,6 +317,14 @@ const setParams = () => {
jobContent.value.creator = creator jobContent.value.creator = creator
return jobContent.value return jobContent.value
} }
const printCode = (e) => {
jobContent.value.printerUuid = e.value
printDeafult.value = e
}
const templateCode = (e) => {
jobContent.value.modelCode = e.value
templateDeafult.value = e
}
const cancel = () => { const cancel = () => {
comMessageRef.value.showQuestionMessage('是否要清空已扫描的物料和目标库位信息?', (res) => { comMessageRef.value.showQuestionMessage('是否要清空已扫描的物料和目标库位信息?', (res) => {
if (res) { if (res) {

49
src/pages/package/record/overPackageRecord.vue

@ -105,6 +105,8 @@ const toPackUnitShow = ref('请选择')
const toPackQty = ref('') const toPackQty = ref('')
const itemCode = ref('') const itemCode = ref('')
const resultData = ref({}) const resultData = ref({})
const printDeafult = ref({}) //
const templateDeafult = ref({}) //
const scanPopup = ref() const scanPopup = ref()
const scanLocationCode = ref() const scanLocationCode = ref()
const toPackUnit = ref() const toPackUnit = ref()
@ -112,6 +114,10 @@ const comMessageRef = ref()
const printService = ref() const printService = ref()
onLoad(() => { onLoad(() => {
getBusinessType() getBusinessType()
nextTick(() => {
const overPackageRecordPointParams = uni.getStorageSync('overPackageRecordPointParams')
printService.value.setDefaultData(overPackageRecordPointParams.printDeafult, overPackageRecordPointParams.templateDeafult)
})
}) })
onLoad((option) => { onLoad((option) => {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
@ -183,10 +189,6 @@ const handleConfirm = (fromLocationCode) => {
} }
const getScanResult = (result) => { const getScanResult = (result) => {
setData(result) setData(result)
setTimeout((res) => {
printService.value.setDefaultData()
})
} }
const setData = (result) => { const setData = (result) => {
@ -328,25 +330,17 @@ const submitJob = () => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
const list = [] const list = []
const item = res.data if (res.data == '打印任务已发送,等待打印机处理!') {
// res.data.forEach((item) => { showCommitSuccessMessage(res.data)
list.push({ const overPackageRecordPointParams = {
itemCode: item.itemCode, // printDeafult: printDeafult.value,
itemName: item.itemName, // templateDeafult: templateDeafult.value
packName: item.packName, // }
packageCode: item.toPackingNumber, // uni.setStorageSync('overPackageRecordPointParams', overPackageRecordPointParams)
batch: item.toBatch, // detailSource.value = []
parentNumber: item.parentNumber, // } else {
itemType: item.itemType, // showErrorMessage(res.data)
asnNumber: item.asnNumber, // ASN }
supplierCode: item.supplierCode, //
qty: item.qty, //
printTimes: getCurrDateTime(), //
productionLineCode: item.productionLineCode, // 线
barcodeString: item.barcodeString, //
barcodeBase64: ''
})
// })
showCommitSuccessMessage(`提交成功<br>生成翻包记录<br>${list}`) showCommitSuccessMessage(`提交成功<br>生成翻包记录<br>${list}`)
} else { } else {
showErrorMessage(`提交失败[${res.msg}]`) showErrorMessage(`提交失败[${res.msg}]`)
@ -390,7 +384,14 @@ const setParams = () => {
dataContent.value.creator = creator dataContent.value.creator = creator
return dataContent.value return dataContent.value
} }
const printCode = (e) => {
dataContent.value.printerUuid = e.value
printDeafult.value = e
}
const templateCode = (e) => {
dataContent.value.modelCode = e.value
templateDeafult.value = e
}
const showMessage = (message) => { const showMessage = (message) => {
comMessageRef.value.showMessage(message, (res) => { comMessageRef.value.showMessage(message, (res) => {
if (res) { if (res) {

Loading…
Cancel
Save