Browse Source

页面报错修改 文件迁移Vue2升级Vue3 8/2-10/25

hella_vue3
王志国 3 weeks ago
parent
commit
a574a49984
  1. 1
      src/mycomponents/balance/pack.vue
  2. 11
      src/mycomponents/qty/qtyEdit.vue
  3. 6
      src/mycomponents/scan/winComScanBalance.vue
  4. 2
      src/mycomponents/scan/winScanItem.vue
  5. 259
      src/mycomponents/scan/winScanPackLevel.vue
  6. 7
      src/pages/inventoryMove/coms/comMoveJob.vue
  7. 2
      src/pages/inventoryMove/coms/comMoveRecord.vue
  8. 1
      src/pages/inventoryMove/record/holdToOkRecord.vue
  9. 1
      src/pages/inventoryMove/record/holdToScrapRecord.vue
  10. 2
      src/pages/inventoryMove/record/moveFreeRecord.vue
  11. 2
      src/pages/inventoryMove/record/okToHoldRecord.vue
  12. 2
      src/pages/issue/request/issueRequest.vue
  13. 2
      src/pages/package/record/splitPackageRecord.vue
  14. 6
      src/pages/productReceipt/job/productReceiptJob.vue
  15. 4
      src/pages/purchaseReceipt/job/receiptJob.vue
  16. 2
      src/pages/query/pack.vue

1
src/mycomponents/balance/pack.vue

@ -8,6 +8,7 @@
<script setup lang="ts"> <script setup lang="ts">
import {getSwitchInfoByCode} from '@/common/basic.js'; import {getSwitchInfoByCode} from '@/common/basic.js';
import {onMounted} from "vue"; import {onMounted} from "vue";
import {ref} from "vue";
const props = defineProps({ const props = defineProps({
packingCode: { packingCode: {
type: String, type: String,

11
src/mycomponents/qty/qtyEdit.vue

@ -32,7 +32,7 @@
</view> </view>
</view> </view>
</u-popup> </u-popup>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessageRef"></comMessage>
</view> </view>
</template> </template>
@ -64,10 +64,7 @@ const props = defineProps({
}); });
const emit = defineEmits(['confirm']); const emit = defineEmits(['confirm']);
const comMessageRef = ref(null);
const popup = ref(null);
const comMessage = ref(null);
const allQty = ref(0); const allQty = ref(0);
const balanceQty = ref(0); const balanceQty = ref(0);
@ -107,11 +104,11 @@ const calcQty = (val) => {
const setValue = () => { const setValue = () => {
const balanceQtyValue = Number(dataContent.value.qty); const balanceQtyValue = Number(dataContent.value.qty);
if (allQty.value === 0) { if (allQty.value === 0) {
comMessage.value.showConfirmWarningModal('数量必须大于0', () => { comMessageRef.value.showConfirmWarningModal('数量必须大于0', () => {
allQty.value = balanceQtyValue; allQty.value = balanceQtyValue;
}); });
} else if (allQty.value > balanceQtyValue) { } else if (allQty.value > balanceQtyValue) {
comMessage.value.showConfirmWarningModal(`数量[${allQty.value}]不允许大于库存数量[${balanceQtyValue}]`, () => { comMessageRef.value.showConfirmWarningModal(`数量[${allQty.value}]不允许大于库存数量[${balanceQtyValue}]`, () => {
allQty.value = balanceQtyValue; allQty.value = balanceQtyValue;
}); });
} else { } else {

6
src/mycomponents/scan/winComScanBalance.vue

@ -20,7 +20,7 @@
</view> </view>
</view> </view>
</u-popup> </u-popup>
<balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select> <balance-select ref="balanceSelectRef" @onSelectItem='selectBalanceItem'></balance-select>
</view> </view>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</template> </template>
@ -100,7 +100,7 @@ const resultData = ref({})
const popup = ref(null) const popup = ref(null)
const comMessage = ref(null) const comMessage = ref(null)
const comscan = ref(null) const comscan = ref(null)
const balanceSelect = ref(null) const balanceSelectRef = ref(null)
// //
const openScanPopup = (businessTypeValue) => { const openScanPopup = (businessTypeValue) => {
@ -218,7 +218,7 @@ const queryBalance = (result) => {
} }
emit('getBalance', result) emit('getBalance', result)
} else { } else {
balanceSelect.value.openPopup(res.data) balanceSelectRef.value.openPopup(res.data)
} }
}).catch(error => { }).catch(error => {
uni.hideLoading() uni.hideLoading()

2
src/mycomponents/scan/winScanItem.vue

@ -11,7 +11,7 @@
<view class=""> <view class="">
<view class=""> <view class="">
<win-com-scan ref="scan" @getResult="getScanResult" :placeholder='title' :clearResult="false" <win-com-scan ref="scan" @getResult="getScanResult" :placeholder='title' :clearResult="false"
headerType="HMQ,HPQ"> headerType="HMQ,HPQ"></win-com-scan>
</view> </view>
</view> </view>
</view> </view>

259
src/mycomponents/scan/winScanPackLevel.vue

@ -1,143 +1,156 @@
<template> <template>
<view> <view>
<u-popup v-model="show" mode="bottom" :mask-close-able="false"> <u-popup v-model="show" mode="bottom">
<view class="popup_box"> <view class="popup_box">
<view class="pop_title uni-flex space-between"> <view class="pop_title uni-flex space-between">
<view class="" style="font-size: 35rpx"> 扫描{{ title }} </view> <view class="" style="font-size: 35rpx"> 扫描{{ title }}</view>
<view class=""> <view class="">
<image class="fr icons_scan_close" src="/static/icons/icons_scan_close.svg" @click="closeScanPopup()"> <image class="fr icons_scan_close" src="/static/icons/icons_scan_close.svg" @click="closeScanPopup()">
</image> </image>
</view> </view>
</view> </view>
<view class="uni-flex uni-row" <view class="uni-flex uni-row"
style="align-items: center; background-color: #fff; margin-left: 20rpx; margin-right: 20rpx; border-radius: 8rpx"> style="align-items: center; background-color: #fff; margin-left: 20rpx; margin-right: 20rpx; border-radius: 8rpx">
<view class="uni-center" style="width: 25%; font-size: 32rpx; font-weight: bold"> 优先级 </view> <view class="uni-center" style="width: 25%; font-size: 32rpx; font-weight: bold"> 优先级</view>
<view style="width: 100%"> <view style="width: 100%">
<uni-data-select style="padding: 20rpx;" v-model="priorityCode" :localdata="priorityList" @change="change" <uni-data-select style="padding: 20rpx;" v-model="priorityCode" :localdata="priorityList" @change="change"
:clear="false"></uni-data-select> :clear="false"></uni-data-select>
</view> </view>
</view> </view>
<view class=""> <view class="">
<view class=""> <view class="">
<win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult" :headerType="headerType" <win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult" :headerType="headerType"
:isShowHistory="isShowHistory" :clearResult="true"></win-com-scan> :isShowHistory="isShowHistory" :clearResult="true"></win-com-scan>
</view> </view>
</view> </view>
</view> </view>
</u-popup> </u-popup>
<com-message ref="comMessageRef" /> <com-message ref="comMessageRef"/>
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, getCurrentInstance, nextTick } from 'vue' import {ref, getCurrentInstance, nextTick} from 'vue'
import { onLoad, onNavigationBarButtonTap, onPullDownRefresh } from '@dcloudio/uni-app' import {onLoad, onNavigationBarButtonTap, onPullDownRefresh} from '@dcloudio/uni-app'
import { getLabelInfo } from '@/common/label.js' import {getLabelInfo} from '@/common/label.js'
import winComScan from '@/mycomponents/scan/winComScan.vue' import winComScan from '@/mycomponents/scan/winComScan.vue'
const props = defineProps({ const props = defineProps({
title: { title: {
type: String, type: String,
default: '箱标签' default: '箱标签'
}, },
isShowHistory: { isShowHistory: {
type: Boolean, type: Boolean,
default: true default: true
}, },
headerType: { headerType: {
type: String, type: String,
default: 'HPQ' default: 'HPQ'
} }
}) })
const emit = defineEmits(['close']) const emit = defineEmits(['close'])
const show = ref(false) const show = ref(false)
const priorityList = ref([ const comMessageRef = ref(null)
{ const priorityList = ref([
value: 0, {
text: '低' value: 0,
}, text: '低'
{ },
value: 1, {
text: '中' value: 1,
}, text: '中'
{ },
value: 2, {
text: '高' value: 2,
} text: '高'
]) }
const priorityCode = ref(1) ])
const comscan = ref() const priorityCode = ref(1)
const simulateScan = (scanMessage) => { const comscan = ref()
getLabelInfo(scanMessage, headerType.value, (callback) => { const simulateScan = (scanMessage) => {
if (callback.success) { getLabelInfo(scanMessage, headerType.value, (callback) => {
getScanResult(callback) if (callback.success) {
} else { getScanResult(callback)
showMessage(callback.message) } else {
} showMessage(callback.message)
}) }
} })
const openScanPopup = () => { }
show.value = true const openScanPopup = () => {
setTimeout((res) => { show.value = true
getfocus() setTimeout((res) => {
}, 200) getfocus()
} }, 200)
const closeScanPopup = () => { }
losefocus() const closeScanPopup = () => {
show.value = false losefocus()
emit('close', '') show.value = false
} emit('close', '')
}
const scanClick = () => { const scanClick = () => {
if (comscan.value) { if (comscan.value) {
comscan.value.clickScanMsg() comscan.value.clickScanMsg()
} }
} }
const cancelClick = () => { const cancelClick = () => {
if (comscan.value) { if (comscan.value) {
comscan.value.clearScanValue() comscan.value.clearScanValue()
} }
} }
const getScanResult = (result) => { const getScanResult = (result) => {
if (result.success) { if (result.success) {
result.priorityCode = priorityCode.value result.priorityCode = priorityCode.value
emit('getResult', result) emit('getResult', result)
} else { } else {
showMessage(result.message) showMessage(result.message)
} }
} }
const getfocus = () => { const getfocus = () => {
if (comscan.value) { if (comscan.value) {
comscan.value.getfocus() comscan.value.getfocus()
} }
} }
const losefocus = () => { const losefocus = () => {
if (comscan.value) { if (comscan.value) {
comscan.value.losefocus() comscan.value.losefocus()
} }
} }
const showMessage = (message) => { const showMessage = (message) => {
comMessageRef.value.showMessage(message) comMessageRef.value.showMessage(message)
} }
const change = (e) => { const change = (e) => {
console.log(e) console.log(e)
} }
defineExpose({
simulateScan,
openScanPopup,
closeScanPopup,
scanClick,
cancelClick,
getScanResult,
getfocus,
losefocus,
showMessage,
change
})
</script> </script>
<style lang="scss"> <style lang="scss">
.scroll-view { .scroll-view {
overflow-y: scroll; overflow-y: scroll;
height: auto; height: auto;
max-height: 300rpx; max-height: 300rpx;
} }
</style> </style>

7
src/pages/inventoryMove/coms/comMoveJob.vue

@ -79,13 +79,6 @@ onMounted(() => {
// refresh() // refresh()
}) })
}) })
const onReach = ()=> {
//
if (loadingType.value == 'loading' || loadingType.value == 'nomore') {
return;
}
getList("more");
}
const updateTitle = () => { const updateTitle = () => {
let title = '' let title = ''
const name = props.title const name = props.title

2
src/pages/inventoryMove/coms/comMoveRecord.vue

@ -141,7 +141,7 @@ const initData = () => {
// this.toLocationCode = "HOLD" // this.toLocationCode = "HOLD"
toLocationCode.value = '' toLocationCode.value = ''
} }
title.value = myTitle.value title.value = props.myTitle
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: title.value title: title.value
}) })

1
src/pages/inventoryMove/record/holdToOkRecord.vue

@ -7,6 +7,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, getCurrentInstance, nextTick } from 'vue' import { ref, getCurrentInstance, nextTick } from 'vue'
import comMoveRecord from '@/pages/inventoryMove/coms/comMoveRecord.vue' import comMoveRecord from '@/pages/inventoryMove/coms/comMoveRecord.vue'
import {onLoad} from "@dcloudio/uni-app";
const title = ref('') const title = ref('')
onLoad((option) => { onLoad((option) => {

1
src/pages/inventoryMove/record/holdToScrapRecord.vue

@ -7,6 +7,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, getCurrentInstance, nextTick } from 'vue' import { ref, getCurrentInstance, nextTick } from 'vue'
import comMoveRecord from '@/pages/inventoryMove/coms/comMoveRecord.vue' import comMoveRecord from '@/pages/inventoryMove/coms/comMoveRecord.vue'
import {onLoad} from "@dcloudio/uni-app";
const title = ref('') const title = ref('')
onLoad((option) => { onLoad((option) => {

2
src/pages/inventoryMove/record/moveFreeRecord.vue

@ -7,7 +7,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, getCurrentInstance, nextTick } from 'vue' import { ref, getCurrentInstance, nextTick } from 'vue'
import comMoveRecord from '@/pages/inventoryMove/coms/comMoveRecord.vue' import comMoveRecord from '@/pages/inventoryMove/coms/comMoveRecord.vue'
import {onLoad} from '@dcloudio/uni-app'
const title = ref('') const title = ref('')
onLoad((option) => { onLoad((option) => {
title.value = option.title title.value = option.title

2
src/pages/inventoryMove/record/okToHoldRecord.vue

@ -7,7 +7,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, getCurrentInstance, nextTick } from 'vue' import { ref, getCurrentInstance, nextTick } from 'vue'
import comMoveRecord from '@/pages/inventoryMove/coms/comMoveRecord.vue' import comMoveRecord from '@/pages/inventoryMove/coms/comMoveRecord.vue'
import { onLoad } from '@dcloudio/uni-app'
const title = ref('') const title = ref('')
onLoad((option) => { onLoad((option) => {
title.value = option.title title.value = option.title

2
src/pages/issue/request/issueRequest.vue

@ -16,7 +16,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, getCurrentInstance, nextTick } from 'vue' import { ref, getCurrentInstance, nextTick } from 'vue'
import { onShow, onNavigationBarButtonTap, onReady, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app' import {onLoad, onShow, onNavigationBarButtonTap, onReady, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
import requestFilter from '@/mycomponents/request/requestFilter.vue' import requestFilter from '@/mycomponents/request/requestFilter.vue'
import comEmptyView from '@/mycomponents/common/comEmptyView.vue' import comEmptyView from '@/mycomponents/common/comEmptyView.vue'
import comIssueRequestCard from '@/pages/issue/coms/comIssueRequestCard.vue' import comIssueRequestCard from '@/pages/issue/coms/comIssueRequestCard.vue'

2
src/pages/package/record/splitPackageRecord.vue

@ -35,7 +35,7 @@
<winComScanBalance ref="scanPopup" @getBalance="getScanResult" <winComScanBalance ref="scanPopup" @getBalance="getScanResult"
:bussinessCode="typeCode" :isCheckLocationBalance="false"> :bussinessCode="typeCode" :isCheckLocationBalance="false">
</winComScanBalance> </winComScanBalance>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessageRef"></comMessage>
</view> </view>
</template> </template>

6
src/pages/productReceipt/job/productReceiptJob.vue

@ -64,7 +64,6 @@ const status = ref('1,2') // 待处理 、进行中
const detailOptions = ref([]) const detailOptions = ref([])
const detailGiveupOptions = ref([]) const detailGiveupOptions = ref([])
const scanMessage = ref('') const scanMessage = ref('')
const scanMessage = ref('')
const filter = ref() const filter = ref()
const comMessageRef = ref() const comMessageRef = ref()
const jobInfoPopupRef = ref() const jobInfoPopupRef = ref()
@ -133,7 +132,7 @@ const getList = (type) => {
const { list } = res.data const { list } = res.data
totalCount.value = res.data.total totalCount.value = res.data.total
updateTitle(`${title.value}(${totalCount.value})`) updateTitle(`${props.title}(${totalCount.value})`)
loadingType.value = 'loadmore' loadingType.value = 'loadmore'
if (list == null || list.length == 0) { if (list == null || list.length == 0) {
@ -413,7 +412,8 @@ const getJobInfoByNumber = (number,scanMessage)=>{
}) })
} }
defineExpose({ defineExpose({
refresh, timerRefresh,
stopRefresh,
toHome, toHome,
onReach, onReach,
openFilter openFilter

4
src/pages/purchaseReceipt/job/receiptJob.vue

@ -156,9 +156,9 @@ const getList = (type) => {
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
} }
loadingType.value = '' loadingType.value = ''
updateTitle(title.value) updateTitle(props.title)
uni.hideLoading() uni.hideLoading()
showErrorMessage(error) showMessage(error)
}) })
} }
const getScanAsnNumber = (code) => { const getScanAsnNumber = (code) => {

2
src/pages/query/pack.vue

@ -76,7 +76,7 @@ onLoad((option) => {
title: option.title title: option.title
}) })
}) })
mounted(() => { onMounted(() => {
openScanPopup() openScanPopup()
}) })
onPullDownRefresh(() => { onPullDownRefresh(() => {

Loading…
Cancel
Save