Browse Source

单据查询模块--标题动态取 2024/7/11 14:16:52

hella_vue3
zhang_li 3 months ago
parent
commit
accc0e1eb0
  1. 9
      src/pages/index/index.vue
  2. 10
      src/pages/inspect/request/inspectRequest.vue
  3. 3
      src/pages/inspect/request/inspectRequestDetail.vue
  4. 10
      src/pages/issue/request/issueRequest.vue
  5. 3
      src/pages/issue/request/issueRequestDetail.vue
  6. 8
      src/pages/purchaseReceipt/job/purchaseReceipt.vue
  7. 8
      src/pages/purchaseReceipt/job/receiptJob.vue
  8. 223
      src/pages/query/container.vue
  9. 5
      src/pages/query/item.vue
  10. 5
      src/pages/query/location.vue
  11. 10
      src/pages/supplierDeliver/record/supplierDeliverRecord.vue
  12. 3
      src/pages/supplierDeliver/record/supplierDeliverRecordDetail.vue

9
src/pages/index/index.vue

@ -5,7 +5,7 @@
</view>
<view class="item-container" style="align-items: center; width: 100%">
<view class="thumb-box" v-for="(item1, index1) in filterList" :key="index1" @click="openCheck(item1.path)" style="text-align: center">
<view class="thumb-box" v-for="(item1, index1) in filterList" :key="index1" @click="openCheck(item1)" style="text-align: center">
<view class="" style="position: relative">
<image class="item-menu-image" :src="'/static/menus/' + item1.componentName" mode=""> </image>
<view class="">
@ -31,7 +31,7 @@
<text>{{ item.name }}</text>
</view>
<view class="item-container">
<view class="thumb-box" v-for="(item1, index1) in item.children" :key="index1" @click="openCheck(item1.path)">
<view class="thumb-box" v-for="(item1, index1) in item.children" :key="index1" @click="openCheck(item1)">
<view class="" style="position: relative">
<!-- <u-badge class="item-menu-badge" v-if="item1.count>0" type="error" :count="item1.count" :offset="position"
:showZero="false"></u-badge> -->
@ -366,9 +366,10 @@ const getDictory = () => {
.catch((error) => {})
}
const openCheck = (url) => {
const openCheck = (item) => {
const name = item.name.split('\\n').join('')
uni.navigateTo({
url: `/${url}`
url: `/${item.path}?title=${name}`
})
filterList.value = []
}

10
src/pages/inspect/request/inspectRequest.vue

@ -34,6 +34,7 @@ import { getInspectRequestList, inspectRequestClose, inspectRequestApprove, insp
import { getDetailOption, getDetailAndApproveOption, getDetailAndApprovePassAndApproveNoOption, getDetailAndHandleOption, getDetailAndAddAndCloseOption, getAddAgainOption } from '@/common/array.js'
const { proxy } = getCurrentInstance()
const title = ref('')
const requestList = ref([])
const pageNo = ref(1)
const pageSize = ref(10)
@ -52,7 +53,8 @@ const loadingType = ref('nomore')
const requestInfoPopupRef = ref()
const filter = ref()
const comMessageRef = ref()
onReady(() => {
onLoad((e) => {
title.value = e.title
detailOptions.value = getDetailOption()
detailAndApproveOptions.value = getDetailAndApproveOption()
detailAndApprovePassAndApproveNoOption.value = getDetailAndApprovePassAndApproveNoOption()
@ -84,7 +86,7 @@ onNavigationBarButtonTap((e) => {
})
const openRequestDetail = (item) => {
uni.navigateTo({
url: `./inspectRequestDetail?id=${item.id}`
url: `./inspectRequestDetail?id=${item.id}&title=${title.value}`
})
}
const openRequestInfoPopup = (item) => {
@ -146,13 +148,13 @@ const getList = (type) => {
requestList.value = type === 'refresh' ? list : requestList.value.concat(list)
pageNo.value++
updateTitle(`检验单申请(${totalCount.value})`)
updateTitle(`${title.value}(${totalCount.value})`)
})
.catch((error) => {
if (type === 'refresh') {
uni.stopPullDownRefresh()
}
updateTitle('检验单申请')
updateTitle(title.value)
loadingType.value = ''
showMessage(error.errMsg)
})

3
src/pages/inspect/request/inspectRequestDetail.vue

@ -42,6 +42,9 @@ const detailSource = ref([]) // 绑定在页面上的数据源
const jobDetailPopup = ref()
onLoad((option) => {
id.value = option.id
uni.setNavigationBarTitle({
title: `${option.title}详情`
})
getDetail()
})
//

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

@ -44,10 +44,14 @@ const addAgainOption = ref([])
const showOptions = ref([])
const fromType = ref('requestType')
const loadingType = ref('nomore')
const title = ref('')
const requestInfoPopupRef = ref()
const filter = ref()
const comMessageRef = ref()
onLoad((e) => {
title.value = e.title
})
onReady(() => {
detailOptions.value = getDetailOption()
detailAndApproveOptions.value = getDetailAndApproveOption()
@ -80,7 +84,7 @@ onNavigationBarButtonTap((e) => {
})
const openRequestDetail = (item) => {
uni.navigateTo({
url: `./issueRequestDetail?id=${item.masterId}`
url: `./issueRequestDetail?id=${item.masterId}&title=${title.value}`
})
}
const openRequestInfoPopup = (item) => {
@ -125,13 +129,13 @@ const getList = (type) => {
requestList.value = type === 'refresh' ? list : requestList.value.concat(list)
pageNo.value++
updateTitle(`发料申请(${totalCount.value})`)
updateTitle(`${title.value}(${totalCount.value})`)
})
.catch((error) => {
if (type === 'refresh') {
uni.stopPullDownRefresh()
}
updateTitle('发料申请')
updateTitle(title.value)
loadingType.value = ''
showMessage(error.errMsg)
})

3
src/pages/issue/request/issueRequestDetail.vue

@ -40,6 +40,9 @@ const type = ref('query') // 来源新增add, query查询
const titleInfo = ref({})
onLoad((option) => {
uni.setNavigationBarTitle({
title: `${option.title}详情`
})
id.value = option.id
getDetail()
})

8
src/pages/purchaseReceipt/job/purchaseReceipt.vue

@ -1,15 +1,16 @@
<template>
<view class="">
<receipt-job scanTitle="箱标签/ASN单号" :isShowAsn="false" :isShowJob="false" ref="receiptjob" operation="receipt"></receipt-job>
<receipt-job :title="title" scanTitle="箱标签/ASN单号" :isShowAsn="false" :isShowJob="false" ref="receiptjob" operation="receipt"></receipt-job>
</view>
</template>
<script setup lang="ts">
import { ref, getCurrentInstance, nextTick } from 'vue'
import { onShow, onNavigationBarButtonTap, onReady, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
import { onShow, onNavigationBarButtonTap, onLoad, onReady, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
import receiptJob from '@/pages/purchaseReceipt/job/receiptJob.vue'
const receiptjob = ref()
const title = ref('')
onShow(() => {
nextTick(() => {
if (receiptjob.value != undefined) {
@ -17,6 +18,9 @@ onShow(() => {
}
})
})
onLoad((option) => {
title.value = option.title
})
onPullDownRefresh(() => {
receiptjob.value.refresh()
})

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

@ -77,6 +77,10 @@ const props = defineProps({
scanTitle: {
type: String,
default: '箱标签'
},
title: {
type: String,
default: ''
}
})
onMounted(() => {
@ -137,7 +141,7 @@ const getList = (type) => {
const { list } = res.data
totalCount.value = res.data.total
updateTitle(`采购退货(${totalCount.value})`)
updateTitle(`${title.value}(${totalCount.value})`)
loadingType.value = 'loadmore'
if (list == null || list.length == 0) {
loadingType.value = 'nomore'
@ -151,7 +155,7 @@ const getList = (type) => {
uni.stopPullDownRefresh()
}
loadingType.value = ''
updateTitle('采购收货')
updateTitle(title.value)
uni.hideLoading()
showErrorMessage(error)
})

223
src/pages/query/container.vue

@ -1,64 +1,50 @@
<template>
<!-- <page-meta root-font-size="18px"></page-meta> -->
<view class="">
<com-blank-view @goScan='openScanPopup' v-if="containerNumber==''"></com-blank-view>
<com-blank-view @goScan="openScanPopup" v-if="containerNumber == ''"></com-blank-view>
<my-paging v-show="containerNumber!=''" ref="paging" v-model="dataList" @query="queryList">
<my-paging v-show="containerNumber != ''" ref="paging" v-model="dataList" @query="queryList">
<!-- 需要固定在顶部不滚动的view放在slot="top"的view中如果需要跟着滚动则不要设置slot="top" -->
<template #top>
<view v-if="containerNumber!=''">
<containerInfo :itemDetail="containerInfo" ></containerInfo>
<view class='split_line'></view>
<view v-if="containerNumber != ''">
<containerInfo :itemDetail="containerInfo"></containerInfo>
<view class="split_line"></view>
<z-tabs :list="tabList" @change="tabChange" />
</view>
</template>
<view class="" style="padding-bottom: 50rpx;">
<view class="" style="padding-bottom: 50rpx">
<view v-if="tabIndex == 0" v-for="(item, index) in dataList">
<comLocationDetailCard :isShowPack="false" :dataContent="item" style='margin: 10rpx;'>
</comLocationDetailCard>
<comLocationDetailCard :isShowPack="false" :dataContent="item" style="margin: 10rpx"> </comLocationDetailCard>
</view>
<view v-if="tabIndex == 1" v-for="(item, index) in dataList">
<comLocationDetailCard :dataContent="item" style='margin: 10rpx;'></comLocationDetailCard>
<comLocationDetailCard :dataContent="item" style="margin: 10rpx"></comLocationDetailCard>
</view>
</view>
</my-paging>
<win-scan-button @goScan='openScanPopup' v-if="containerNumber!=''"></win-scan-button>
<winScanContainer ref="scanPopup" title='器具代码' @getContainer='getScanCode'>
</winScanContainer>
<win-scan-button @goScan="openScanPopup" v-if="containerNumber != ''"></win-scan-button>
<winScanContainer ref="scanPopup" title="器具代码" @getContainer="getScanCode"> </winScanContainer>
<show-modal ref="modal"></show-modal>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
getBalanceByContainerNumber,
getBalanceByContainerNumberGroup,
getContainerByNumber
} from '@/api/request2.js';
import { getBalanceByContainerNumber, getBalanceByContainerNumberGroup, getContainerByNumber } from '@/api/request2.js'
import {
maxPageSize,
goHome
} from '@/common/basic.js';
import { maxPageSize, goHome } from '@/common/basic.js'
import {
calc
} from '@/common/calc.js';
import { calc } from '@/common/calc.js'
import locationInfo from '@/mycomponents/location/locationInfo.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comLocationDetailCard from '@/pages/query/coms/comLocationDetailCard.vue'
import winScanContainer from "@/mycomponents/scan/winScanContainer.vue"
import containerInfo from '@/mycomponents/container/containerInfo.vue'
import locationInfo from '@/mycomponents/location/locationInfo.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comLocationDetailCard from '@/pages/query/coms/comLocationDetailCard.vue'
import winScanContainer from '@/mycomponents/scan/winScanContainer.vue'
import containerInfo from '@/mycomponents/container/containerInfo.vue'
export default {
export default {
name: 'location',
components: {
locationInfo,
@ -67,7 +53,6 @@
comLocationDetailCard,
containerInfo,
winScanContainer
},
data() {
return {
@ -89,14 +74,17 @@
summarysList: [],
dataList: [],
tabList: ['汇总', '明细'],
tabIndex: 0,
};
tabIndex: 0
}
},
onLoad() {
onLoad(e) {
uni.setNavigationBarTitle({
title: e.title
})
},
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
goHome()
}
},
filters: {},
@ -105,109 +93,112 @@
},
methods: {
openScanPopup() {
var test =this.$refs;
this.$refs.scanPopup.openScanPopup();
const test = this.$refs
this.$refs.scanPopup.openScanPopup()
},
closeScanPopup() {
this.$refs.scanPopup.closeScanPopup();
this.$refs.scanPopup.closeScanPopup()
},
getScanCode(code) {
this.containerNumber = '';
this.summarys = [];
this.balances = [];
this.occupieds = [];
this.containerNumber = code.number;
this.containerInfo = code;
this.containerNumber = ''
this.summarys = []
this.balances = []
this.occupieds = []
this.containerNumber = code.number
this.containerInfo = code
this.tabChange(0)
// this.getItemInfo(code.number);
},
getItemInfo(code) {
uni.showLoading({
title: "正在查询器具信息...",
title: '正在查询器具信息...',
mask: true
});
getContainerByNumber(code).then(res => {
uni.hideLoading();
})
getContainerByNumber(code)
.then((res) => {
uni.hideLoading()
if (res.data.list.length > 0) {
this.closeScanPopup();
this.containerNumber = res.data.list[0].number;
this.containerInfo = res.data.list[0];
this.closeScanPopup()
this.containerNumber = res.data.list[0].number
this.containerInfo = res.data.list[0]
this.tabChange(0)
} else {
this.showMessage('未查找到器具【' + code + '】');
this.showMessage(`未查找到器具【${code}`)
}
}).catch(error => {
uni.hideLoading();
this.containerNumber = "";
this.showMessage(error);
})
.catch((error) => {
uni.hideLoading()
this.containerNumber = ''
this.showMessage(error)
})
},
getSummary(pageNo, pageSize) {
let that = this;
const that = this
uni.showLoading({
title: "加载中...",
title: '加载中...',
mask: true
});
var params = {
})
const params = {
containerNumber: this.containerNumber,
pageNo: pageNo,
pageSize: pageSize
pageNo,
pageSize
}
getBalanceByContainerNumberGroup(params).then(res => {
uni.hideLoading();
getBalanceByContainerNumberGroup(params)
.then((res) => {
uni.hideLoading()
if (res.data.list.length > 0) {
this.summarysList = this.setShowList(res.data.list)
this.$refs.paging.complete(this.summarysList);
this.$refs.paging.complete(this.summarysList)
} else {
this.$refs.paging.complete(false);
this.showMessage('未查找到器具【' + this.containerNumber + '】的库存信息');
this.$refs.paging.complete(false)
this.showMessage(`未查找到器具【${this.containerNumber}】的库存信息`)
}
}).catch(error => {
this.$refs.paging.complete(false);
uni.hideLoading();
this.showMessage(error);
})
.catch((error) => {
this.$refs.paging.complete(false)
uni.hideLoading()
this.showMessage(error)
})
},
getDetailList(pageNo, pageSize) {
let that = this;
const that = this
uni.showLoading({
title: "加载中...",
title: '加载中...',
mask: true
});
var params = {
})
const params = {
containerNumber: this.containerNumber,
pageNo: pageNo,
pageSize: pageSize
pageNo,
pageSize
}
getBalanceByContainerNumber(params).then(res => {
uni.hideLoading();
getBalanceByContainerNumber(params)
.then((res) => {
uni.hideLoading()
if (res.data.total > 0) {
this.detailList = this.setShowList(res.data.list)
this.$refs.paging.complete(this.detailList);
this.$refs.paging.complete(this.detailList)
} else {
this.$refs.paging.complete(false);
this.showMessage('未查找到器具【' + this.containerNumber + '】的库存信息');
this.$refs.paging.complete(false)
this.showMessage(`未查找到器具【${this.containerNumber}】的库存信息`)
}
}).catch(error => {
this.$refs.paging.complete(false);
uni.hideLoading();
this.showMessage(error);
})
.catch((error) => {
this.$refs.paging.complete(false)
uni.hideLoading()
this.showMessage(error)
})
},
setShowList(list) {
var resultlist = [];
list.forEach(res => {
var temp = resultlist.find(res1 =>
res1.itemCode == res.itemCode)
const resultlist = []
list.forEach((res) => {
const temp = resultlist.find((res1) => res1.itemCode == res.itemCode)
if (temp == undefined) {
var data = {
const data = {
itemCode: res.itemCode,
qty: Number(res.qty),
uom: res.uom,
@ -218,63 +209,61 @@
batch: res.batch,
uom: res.uom,
qty: Number(res.qty),
inventoryStatus: res.inventoryStatus,
inventoryStatus: res.inventoryStatus
}
data.list.push(item)
resultlist.push(data)
} else {
temp.qty = calc.add(temp.qty,res.qty)
temp.qty = calc.add(temp.qty, res.qty)
var item = {
packingNumber: res.packingNumber,
batch: res.batch,
uom: res.uom,
qty: Number(res.qty),
inventoryStatus: res.inventoryStatus,
inventoryStatus: res.inventoryStatus
}
temp.list.push(item)
}
})
return resultlist;
return resultlist
},
getContentByTab(index, pageNo, pageSize) {
if (index === 0) {
this.getSummary(pageNo, pageSize);
this.getSummary(pageNo, pageSize)
} else if (index === 1) this.getDetailList(pageNo, pageSize)
},
upper: function(e) {},
lower: function(e) {},
upper(e) {},
lower(e) {},
tabChange(index) {
this.tabIndex = index;
this.$refs.paging.reload(true);
this.tabIndex = index
this.$refs.paging.reload(true)
},
showMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
this.$refs.comMessage.showErrorMessage(message, (res) => {
if (res) {
this.afterCloseMessage()
}
});
})
},
afterCloseMessage() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.getfocus();
this.$refs.scanPopup.getfocus()
}
},
queryList(pageNo, pageSize) {
console.log("加载", pageNo)
if (this.containerNumber != "") {
console.log('加载', pageNo)
if (this.containerNumber != '') {
this.getContentByTab(this.tabIndex, pageNo, pageSize)
}
},
}
};
}
}
</script>
<style scoped lang="scss">
page {
page {
height: 100%;
}
}
</style>

5
src/pages/query/item.vue

@ -64,6 +64,11 @@
filter.value.openFilter()
}
})
onLoad((e)=>{
uni.setNavigationBarTitle({
title: e.title
})
})
onMounted(() => {
openScanPopup()
})

5
src/pages/query/location.vue

@ -73,6 +73,11 @@ onNavigationBarButtonTap((e) => {
onMounted(() => {
openScanPopup()
})
onLoad((e) => {
uni.setNavigationBarTitle({
title: e.title
})
})
onPullDownRefresh(() => {
getContentByTab(tabIndex.value, pageNo.value, pageSize.value, 'refresh')
})

10
src/pages/supplierDeliver/record/supplierDeliverRecord.vue

@ -51,6 +51,7 @@ const todayTime = ref('')
const detailOptions = ref([])
const detailGiveupOptions = ref([])
const currentItem = ref({})
const title = ref('')
const recordListPopupRef = ref()
const recordInfoPopupRef = ref()
const filter = ref()
@ -60,6 +61,9 @@ onShow(() => {
getList('refresh')
})
})
onLoad((e) => {
title.value = e.title
})
onReady(() => {
detailOptions.value = getDetailOption()
})
@ -123,7 +127,7 @@ const getList = (type) => {
const { list } = res.data
totalCount.value = res.data.total
updateTitle(`供应商发货记录(${totalCount.value})`)
updateTitle(`${title.value}(${totalCount.value})`)
loadingType.value = 'loadmore'
if (list == null || list.length == 0) {
loadingType.value = 'nomore'
@ -136,7 +140,7 @@ const getList = (type) => {
if (type === 'refresh') {
uni.stopPullDownRefresh()
}
updateTitle('供应商发货记录')
updateTitle(title.value)
loadingType.value = ''
uni.hideLoading()
showMessage(error)
@ -145,7 +149,7 @@ const getList = (type) => {
const openJobDetail = (item) => {
uni.navigateTo({
url: `./supplierDeliverRecordDetail?id=${item.masterId}`
url: `./supplierDeliverRecordDetail?id=${item.masterId}&title=${title.value}`
})
}

3
src/pages/supplierDeliver/record/supplierDeliverRecordDetail.vue

@ -59,6 +59,9 @@ const businessTypeInfo = ref({})
const managementList = ref([])
const recordDetailPopup = ref()
onLoad((option) => {
uni.setNavigationBarTitle({
title: `${option.title}详情`
})
id.value = option.id
getDetail()
})

Loading…
Cancel
Save