采购单

This commit is contained in:
BinBin Song 2025-06-30 23:28:28 +08:00
parent d5f25b6f66
commit b7c9d76b8f
9 changed files with 1141 additions and 84 deletions

View File

@ -140,7 +140,19 @@
{
"navigationBarTitleText" : "消息通知"
}
}
} ,
{
"path": "pages/cgdsp/cgdsp-detail",
"style": {
"navigationBarTitleText": "详情"
}
},
{
"path": "pages/cgdsp/cgdsp",
"style": {
"navigationBarTitleText": "采购单审批"
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",

View File

@ -0,0 +1,442 @@
<script setup lang="ts">
import { toRaw, ref } from 'vue'
import { formatDate } from '@/utils/index'
import { onLoad } from '@dcloudio/uni-app'
import { useLoginStore } from '@/stores/modules/login'
import {
getReviewDetailAPI,
reject,
approval
} from '@/services/approveOrder'
import {Base64} from '@/uni_modules/base64/base64.js';
const popup = ref<UniHelper.UniPopupInstance>()
// porps
const props = defineProps<{
id: string
}>()
//
const queryParams: Required<any> = {
id: props.id,
}
const userStore = useLoginStore()
const dictInfo = userStore.dictInfo
const propertyDictData = dictInfo.filter(e => e.dictType == 'heli_project_property') || []
const lineDictData = dictInfo.filter(e => e.dictType == 'heli_business_line') || []
const fileDictData = dictInfo.filter(e => e.dictType == 'heli_business_file_type') || []
const LogDictData = dictInfo.filter(e => e.dictType == 'system_operate_type') || []
const unitDictData = dictInfo.filter(e => e.dictType == 'heli_material_unit') || []
//
const detailInfo = ref({})
let orderTimeStr = ''
let projectStartTimeStr = ''
let projectEndTimeStr = ''
let businessLineStr = ''
let propertyStr = ''
let isLoading = ref(true)
const getData = async () => {
//
// isLoading.value = true
const data = await getReviewDetailAPI( props.id)
orderTimeStr = formatDate(data.orderTime, 'YYYY-MM-DD')
projectStartTimeStr = formatDate(data.projectStartTime, 'YYYY-MM-DD')
projectEndTimeStr = formatDate(data.projectEndTime, 'YYYY-MM-DD')
const obj = propertyDictData.find((q) => q.value == data.property) || {}
propertyStr = obj?.label
const lineObj = lineDictData.find((q) => q.value == data.businessLine) || {}
businessLineStr = lineObj?.label
detailInfo.value = data || {}
isLoading.value = false
}
onLoad(async () => {
await getData()
})
const handleCancle = () => {
uni.navigateBack()
isShowPop.value = false
}
//
const handleAgree = async () => {
await approval(props.id)
uni.showToast({ icon: 'none', duration: 1500, title: '批准成功' })
setTimeout(() => {
uni.navigateBack()
}, 500);
}
const handleReject = async () => {
await reject(props.id)
uni.showToast({ icon: 'none', duration: 1500, title: '打回成功' })
setTimeout(() => {
uni.navigateBack()
}, 500);
}
const dialogInputConfirm = async (val: any) => {
console.log(val)
const params = {
...detailInfo.value,
active: 'REPULSE',
activeOpinion: val
}
const data = await postOperateAPI(params)
uni.showToast({ icon: 'none', duration: 1500, title: '打回成功' })
setTimeout(() => {
handleCancle();
}, 1500);
}
const isShowPop = ref(false)
//
const handleBack = () => {
popup.value?.open()
setTimeout(() => {
isShowPop.value = true
}, 0);
}
//
const openReport = (url: any) => {
uni.showLoading({
title: '加载中',
mask: true,
})
wx.downloadFile({
url: url,
success: function (res) {
console.log(res)
uni.hideLoading()
var filePath = res.tempFilePath
uni.showLoading({
title: '正在打开',
mask: true,
})
wx.openDocument({
filePath: filePath,
fileType: 'pdf',
success: function (res) {
console.log(res)
uni.hideLoading()
console.log('打开文档成功')
},
fail: function (err) {
uni.hideLoading()
console.log('fail:' + JSON.stringify(err))
},
})
},
fail: function (err) {
uni.hideLoading()
console.log('fail:' + JSON.stringify(err))
},
})
}
//
const showFile = ref(false)
const fileUrl = ref('')
const handleDownload = (pdfUrl: any) => {
//#ifndef MP-WEIXIN
fileUrl.value = 'https://star.hz-hl.com/FileServer/onlinePreview?url='+encodeURIComponent(Base64.encode(pdfUrl))
window.open(fileUrl.value);
// #endif
//#ifdef MP-WEIXIN
uni.navigateTo({
url: './components/showFileWx?fileUrl=' + encodeURIComponent(Base64.encode(pdfUrl))
});
//#endif
// showFile.value = true;
// if (pdfUrl) {
// switch (uni.getSystemInfoSync().platform) {
// case 'android':
// console.log('')
// //
// openReport(pdfUrl)
// break
// case 'ios':
// console.log('IOS')
// //web-view
// uni.navigateTo({
// url: '/pages/previewPdf/previewPdf?url=' + pdfUrl,
// })
// break
// default:
// openReport(pdfUrl)
// break
// }
// } else {
// uni.showToast({
// title: '',
// icon: 'none',
// duration: 2000,
// })
// }
}
</script>
<template>
<view class="data-detail">
<template v-if="!isLoading">
<view class="hd">
<view class="num">采购单号</view>
<view class="statusLabel"> 单号{{ detailInfo.purchaseNo }} </view>
</view>
<view class="md">
<view class="product-item">采购类型{{ detailInfo.purchaseOrderType }}</view>
<view class="product-item">项目名称{{ detailInfo.projectName }}</view>
<view class="product-item">客户简码{{ detailInfo. brief}}</view>
<view class="product-item">送审人{{ detailInfo.submitUserName }}</view>
<view class="product-item">送审时间{{ formatDate( detailInfo.submitTime, 'YYYY-MM-DD')}}</view>
</view>
<!-- <view class="md foot">
<view class="foot-item price" v-if="detailInfo.hasPrice">价格人民币{{ detailInfo.price }}</view>
<view class="foot-item">业务员{{ detailInfo.businessManName }}</view>
<view class="foot-item">是否已变更{{ detailInfo.hasAlter ? '是' : '否' }}</view>
</view> -->
<view class="table">
<view class="table-title"><span class="line"></span>子项目信息</view>
<uni-table ref="table" class="table-cont" :loading="loading" stripe emptyText="暂无更多数据"
@selection-change="selectionChange">
<uni-tr>
<uni-th width="150">序号</uni-th>
<uni-th width="150">项目名称</uni-th>
<uni-th width="150">物料名称</uni-th>
<uni-th width="150">工序</uni-th>
<uni-th width="150">采购数量</uni-th>
<uni-th width="150">供应商</uni-th>
<uni-th width="150">需要完成日期</uni-th>
<uni-th width="150">预计到货日期</uni-th>
<uni-th width="150">预估总价</uni-th>
<uni-th width="150">技术要求</uni-th>
<uni-th width="150">理论重量()</uni-th>
</uni-tr>
<uni-tr v-for="(item, index) in detailInfo.purchaseOrderMakeDetailDOList" :key="index">
<uni-td>{{ index + 1 }}</uni-td>
<uni-td>{{ item.name }}</uni-td>
<uni-td>{{ item.boomName }}</uni-td>
<uni-td>{{ item.procedureName }}</uni-td>
<uni-td>{{ item.purchaseAmount }}</uni-td>
<uni-td>{{ item.supplierName }}</uni-td>
<uni-td>{{ formatDate(item.requireTime, 'YYYY-MM-DD') }}</uni-td>
<uni-td>{{ formatDate(item.arriveTime, 'YYYY-MM-DD') }}</uni-td>
<uni-td>{{ item.estimatedPrice }}</uni-td>
<uni-td>{{ item.description }}</uni-td>
<uni-td>{{ item.theWeight }}</uni-td>
</uni-tr>
</uni-table>
</view>
<!-- <view class="table">
<view class="table-title"><span class="line"></span>附件信息</view>
<uni-table ref="table" class="table-cont" :loading="loading" stripe emptyText="暂无更多数据"
@selection-change="selectionChange">
<uni-tr>
<uni-th width="150">文件名称</uni-th>
<uni-th width="150">文件类型</uni-th>
<uni-th width="200">上传日期</uni-th>
<uni-th width="50">操作</uni-th>
</uni-tr>
<uni-tr v-for="(item, index) in fileTableData" :key="index">
<uni-td>{{ item.name }}</uni-td>
<uni-td>{{ item.businessFileType }}</uni-td>
<uni-td>{{ item.createTime }}</uni-td>
<uni-td>
<view class="button" @click="handleDownload(item.previewUrl)" size="mini" type="primary">查看</view>
</uni-td>
</uni-tr>
</uni-table>
</view> -->
<view class="table">
<view class="table-title"><span class="line"></span>操作日志</view>
<uni-table ref="table" class="table-cont" :loading="loading" stripe emptyText="暂无更多数据"
@selection-change="selectionChange">
<uni-tr>
<uni-th width="50">操作</uni-th>
<uni-th width="150">操作人</uni-th>
<uni-th width="200">操作时间</uni-th>
</uni-tr>
<uni-tr v-for="(item, index) in detailInfo.logList" :key="index">
<uni-td>{{ item.operation }}</uni-td>
<uni-td>{{ item.operationName }}</uni-td>
<uni-td>{{ formatDate(item.operationTime,'YYYY-MM-DD') }}</uni-td>
</uni-tr>
</uni-table>
</view>
<view class="action">
<view class="action-item cancle" @click="handleCancle">取消</view>
<template v-if="detailInfo.status == 1">
<view class="action-item agree" @click="handleAgree">批准</view>
<view class="action-item back" @click="handleReject">打回</view>
</template>
</view>
</template>
<view class="loading-text" v-else>加载中..</view>
<uni-popup ref="popup" type="dialog">
<uni-popup-dialog v-if="isShowPop" ref="inputClose" mode="input" title="打回订单" placeholder="请输入打回原因"
@confirm="dialogInputConfirm"></uni-popup-dialog>
</uni-popup>
<!-- <web-view v-if="showFile" :src="fileUrl"></web-view> -->
</view>
</template>
<style lang="scss">
//
.data-detail {
padding: 20rpx 0;
margin: 20rpx 20rpx;
border-radius: 10rpx;
background-color: #fff;
padding-bottom: 200rpx;
.hd {
padding: 10rpx;
font-size: 28rpx;
display: flex;
border-bottom: 2rpx solid #F2F2F2;
.statusLabel {
font-size: 24rpx;
color: #737D88;
}
}
.md {
padding: 10rpx;
min-height: 100rpx;
font-size: 28rpx;
border-bottom: 2rpx solid #F2F2F2;
.product-item {
margin: 20rpx 0;
display: flex;
align-items: center;
color: #737D88
}
&.foot {
display: flex;
flex-direction: column;
align-items: flex-end;
padding: 20rpx 30rpx;
.foot-item {
text-align: right;
margin: 10rpx 0;
display: flex;
align-items: center;
color: #737D88;
&.price {
font-weight: 600;
color: #1D2129;
}
}
}
}
.table {
padding: 20rpx 20rpx;
margin: 20rpx 0;
box-shadow: 0px 0px 8px 0px rgba(161, 161, 177, 0.12);
.table-title {
color: #0D0D26;
font-size: 36rpx;
margin: 20rpx 0;
font-weight: 500;
padding-bottom: 10rpx;
border-bottom: 2rpx solid #F2F2F2;
.line {
width: 10rpx;
height: 30rpx;
display: inline-block;
background-color: #356899;
margin-right: 10rpx;
}
}
.table-cont {
font-size: 24rpx;
}
.uni-table-th,
.uni-table-th-content {
background: #E4E8EF;
font-size: 28rpx;
color: #1D2129;
font-weight: normal;
}
.button {
color: #356899;
}
}
.action {
display: flex;
justify-content: center;
align-items: center;
position: fixed;
bottom: 60rpx;
border-radius: 18rpx;
padding: 30rpx 30rpx;
background: #FFFFFF;
margin: 0 auto;
width: 600rpx;
transform: translateX(10%);
box-shadow: 0px -4px 10px 0px rgba(121, 153, 183, 0.2);
.action-item {
width: 180rpx;
height: 60rpx;
display: flex;
justify-content: center;
align-items: center;
margin: 0 20rpx;
border-radius: 60rpx;
border: 1rpx solid #ccc;
font-size: 26rpx;
color: #444;
&.cancle {
color: #356899;
}
&.agree {
color: #fff;
background: linear-gradient(167deg, #2EACE6 -41%, #356899 111%);
}
&.stop {
color: #fff;
background: linear-gradient(168deg, #FFB59C -12%, #FF3636 101%);
}
&.back {
color: #fff;
background: linear-gradient(173deg, #FEA97B -25%, #F75E40 108%);
}
}
}
.loading-text {
text-align: center;
font-size: 28rpx;
color: #666;
padding: 20rpx 0;
}
}
</style>

View File

@ -0,0 +1,163 @@
<script setup lang="ts">
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import dataItem from './components/dataItem.vue'
import noticeItem from './components/noticeItem.vue'
// porps
const props = defineProps<{
state: string
}>()
// tabs
const orderTabs = ref([
{ orderState: 1, title: '待审批', isRender: false },
{ orderState: 2, title: '已审批', isRender: false },
])
const defaultState = props.state || 1
console.log(defaultState)
//
const activeIndex = ref(0)
const handleIndexChange = (index: any) => {
orderTabs.value.forEach((e) => {
e.isRender = false
})
activeIndex.value = index
orderTabs.value[index].isRender = true
}
onLoad(async (options) => {
if (options.state) {
//
orderTabs.value.forEach((e, index) => {
e.isRender = e.orderState == options.state
if (e.isRender) {
activeIndex.value = index
}
})
} else {
orderTabs.value.forEach((e, index) => {
e.isRender = e.orderState == 1
if (e.isRender) {
activeIndex.value = index
}
})
}
})
</script>
<template>
<view class="viewport">
<view class="tabs">
<text
class="item"
:class="{ active: activeIndex == index }"
v-for="(item, index) in orderTabs"
:key="item.title"
@tap="handleIndexChange(index)"
>
{{ item.title }}
</text>
<!-- 游标 -->
<view class="cursor" :style="{ left: activeIndex ? '65%' : '14%' }"></view>
</view>
<!-- 滑动容器 -->
<swiper
class="swiper"
:current="activeIndex"
@change="handleIndexChange($event.detail.current)"
>
<!-- 滑动项 -->
<swiper-item v-for="item in orderTabs" :key="item.title">
<dataItem v-if="item.isRender" :order-state="item.orderState" />
</swiper-item>
</swiper>
</view>
</template>
<style lang="scss">
page {
height: 100%;
}
.viewport {
height: 100%;
display: flex;
flex-direction: column;
// background-color: #3775F6;
.navbar {
width: 750rpx;
color: #000;
position: fixed;
top: 0;
left: 0;
z-index: 9;
/* background-color: #f8f8f8; */
background-color: #3775f6;
.wrap {
position: relative;
background-color: #3775f6;
.title {
height: 44px;
display: flex;
justify-content: center;
align-items: center;
font-size: 32rpx;
/* color: #000; */
color: #fff;
}
.back {
position: absolute;
left: 0;
height: 44px;
width: 44px;
font-size: 44rpx;
display: flex;
align-items: center;
justify-content: center;
/* color: #000; */
color: #fff;
}
}
}
.tabs {
display: flex;
justify-content: space-around;
line-height: 60rpx;
position: relative;
z-index: 9;
width: 100%;
.item {
flex: 1;
text-align: center;
padding: 20rpx;
font-size: 28rpx;
color: #1D2129;
&.active {
color: #356899;
}
}
.cursor {
position: absolute;
left: 13%;
bottom: 0;
width: 20%;
height: 6rpx;
padding: 0 50rpx;
background-color: #356899;
/* 过渡效果 */
transition: all 0.4s;
}
}
// swiper
.swiper {
background-color: #f7f7f8;
}
}
</style>

View File

@ -0,0 +1,361 @@
<script setup lang="ts">
import { onMounted, computed, ref } from 'vue'
import { onLoad, onShow } from '@dcloudio/uni-app'
import { getApproveOrderAPI, review } from '@/services/approveOrder'
import { useLoginStore } from '@/stores/modules/login'
import { formatDate } from '@/utils/index'
const userStore = useLoginStore()
const dictInfo = userStore.dictInfo
const propertyDictData = dictInfo.filter(e => e.dictType == 'heli_project_property') || []
//
const isFinish = ref(false)
//
const isTriggered = ref(false)
// porps
const props = defineProps<{
orderState: number
}>()
const statusText = computed(() => {
const text = props.orderState == 1 ? "审批" : '查看'
return text
})
//
const isLoading = ref(false)
//
const queryParams: Required<any> = {
pageNo: 1,
pageSize: 10,
status: props.orderState,
isSnapshot: 0,
}
const dataList = ref([])
const getListData = async () => {
// 退
if (isLoading.value) return
if (isFinish.value === true) {
return uni.showToast({ icon: 'none', title: '没有更多数据~' })
}
isLoading.value = true
//
const data = await review(queryParams)
isLoading.value = false
const heli_business_line = userStore.dictInfo.filter
data.list.forEach((e) => {
const obj = propertyDictData.find((q) => q.value == e.property) || {}
e.property = obj?.label
e.submitTime = formatDate(e.submitTime, 'YYYY-MM-DD')
e.projectStartTime = formatDate(e.projectStartTime, 'YYYY-MM-DD')
e.projectEndTime = formatDate(e.projectEndTime, 'YYYY-MM-DD')
})
//
dataList.value.push(...data.list)
//
if (queryParams.pageNo < data.total) {
//
queryParams.pageNo++
} else {
//
isFinish.value = true
}
}
onMounted(async () => {
await getListData()
})
onShow(async () => {
isLoading.value = false
queryParams.pageNo = 1
dataList.value = []
isFinish.value = false
await getListData()
})
const handleDetail = (id) => {
const url = `/pages/cgdsp/cgdsp-detail?id=${id}`
uni.navigateTo({ url })
}
//
const onRefresherrefresh = async () => {
//
isTriggered.value = true
//
queryParams.pageNo = 1
dataList.value = []
isFinish.value = false
//
await getListData()
//
isTriggered.value = false
}
// const searchVal = ref('')
// const handleSearch = async () => {
// let dataListDefault = []
// const code = searchVal.value
// if (code) {
// dataListDefault = dataList.value
// dataList.value = dataList.value.filter((e) => {
// return e.code == code
// })
// } else {
// dataList.value = dataListDefault
// }
// }
</script>
<template>
<view class="cont">
<!-- <view class="search" v-if="dataList.length > 5">
<view class="title"></view>
<input class="uni-input" v-model="searchVal" @change="handleSearch" placeholder="根据编号搜索" />
</view> -->
<scroll-view enable-back-to-top scroll-y class="data-list" refresher-enabled :refresher-triggered="isTriggered"
@refresherrefresh="onRefresherrefresh" @scrolltolower="getListData">
<view class="item" v-for="item in dataList" :key="item.id" @click="handleDetail(item.id)">
<view class="hd">
<view class="num">采购单号</view>
<view class="statusLabel"> 单号{{ item.purchaseNo }} </view>
</view>
<view class="md">
<view class="product-item">采购类型{{ item.purchaseOrderType }}</view>
<view class="product-item">项目名称{{ item.projectName }}</view>
<view class="product-item">客户简码{{ item.brief }}</view>
<view class="product-item">送审人{{ item.submitUserName }}</view>
<view class="product-item">送审时间{{ item.submitTime }}</view>
</view>
<view class="statusText">{{ statusText }}</view>
</view>
<!-- 底部提示文字 -->
<view class="loading-text" :style="{ paddingBottom: safeAreaInsets?.bottom + 'px' }">
{{ isFinish ? '没有更多数据~' : '正在加载...' }}
</view>
</scroll-view>
</view>
</template>
<style lang="scss">
//
.search {
padding: 4rpx;
width: 80%;
margin: 30rpx auto;
.uni-input {
border: 1px solid #D1D6DB;
height: 60rpx;
line-height: 60rpx;
padding: 4rpx 10rpx;
font-size: 32rpx;
border-radius: 6rpx;
}
}
.data-list {
height: 90vh;
.item {
position: relative;
padding: 20rpx 0;
margin: 20rpx 20rpx;
border-radius: 10rpx;
background-color: #fff;
.hd {
padding: 10rpx;
font-size: 28rpx;
display: flex;
.statusLabel {
font-size: 24rpx;
color: #737D88;
}
}
.md {
position: relative;
padding: 10rpx;
min-height: 100rpx;
font-size: 28rpx;
border-top: 2rpx solid #F2F2F2;
.product-item {
margin: 20rpx 0;
display: flex;
align-items: center;
color: #737D88
}
}
.statusText {
position: absolute;
right: 30rpx;
top: 100rpx;
border-radius: 10rpx;
font-size: 24rpx;
padding: 10rpx 30rpx;
border-radius: 10rpx;
font-size: 24rpx;
background: linear-gradient(149deg, #2DACE6 4%, #356899 98%);
color: #fff;
}
&:last-child {
padding-bottom: 40rpx;
}
}
.status {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 28rpx;
color: #999;
margin-bottom: 15rpx;
.date {
color: #666;
flex: 1;
}
.primary {
color: #ff9240;
}
.icon-delete {
line-height: 1;
margin-left: 10rpx;
padding-left: 10rpx;
border-left: 1rpx solid #e3e3e3;
}
}
.goods {
display: flex;
margin-bottom: 20rpx;
.cover {
width: 170rpx;
height: 170rpx;
margin-right: 20rpx;
border-radius: 10rpx;
overflow: hidden;
position: relative;
.image {
width: 170rpx;
height: 170rpx;
}
}
.quantity {
position: absolute;
bottom: 0;
right: 0;
line-height: 1;
padding: 6rpx 4rpx 6rpx 8rpx;
font-size: 24rpx;
color: #fff;
border-radius: 10rpx 0 0 0;
background-color: rgba(0, 0, 0, 0.6);
}
.meta {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
}
.name {
height: 80rpx;
font-size: 26rpx;
color: #444;
}
.type {
line-height: 1.8;
padding: 0 15rpx;
margin-top: 10rpx;
font-size: 24rpx;
align-self: flex-start;
border-radius: 4rpx;
color: #888;
background-color: #f7f7f8;
}
.more {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
font-size: 22rpx;
color: #333;
}
}
.payment {
display: flex;
justify-content: flex-end;
align-items: center;
line-height: 1;
padding: 20rpx 0;
text-align: right;
color: #999;
font-size: 28rpx;
border-bottom: 1rpx solid #eee;
.quantity {
font-size: 24rpx;
margin-right: 16rpx;
}
.amount {
color: #444;
margin-left: 6rpx;
}
.symbol {
font-size: 20rpx;
}
}
.action {
display: flex;
justify-content: flex-end;
align-items: center;
padding-top: 20rpx;
.button {
width: 180rpx;
height: 60rpx;
display: flex;
justify-content: center;
align-items: center;
margin-left: 20rpx;
border-radius: 60rpx;
border: 1rpx solid #ccc;
font-size: 26rpx;
color: #444;
}
.secondary {
color: #3775F6;
border-color: #3775F6;
}
.primary {
color: #fff;
background-color: #3775F6;
border-color: #3775F6;
}
}
.loading-text {
text-align: center;
font-size: 28rpx;
color: #666;
padding: 20rpx 0;
}
}
</style>import type { stringify } from 'querystring';

View File

@ -0,0 +1,38 @@
<template>
<view>
<web-view :src="showUrl" />
</view>
</template>
<script>
import { ref, onMounted, onUnmounted } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
export default {
setup() {
const showUrl = ref('');
// 使 onLoad
onLoad((options) => {
console.log('页面加载中...');
console.log(options.fileUrl);
if (options.fileUrl) {
showUrl.value = `https://star.hz-hl.com/FileServer/onlinePreview?url=${options.fileUrl}`;
console.log(showUrl.value);
}
});
// 使 onMounted onLoad
onMounted(() => {
console.log('Vue 组件挂载完成');
});
return {
showUrl,
};
},
};
</script>
<style scoped>
/* 你的样式 */
</style>

View File

@ -1,83 +1,86 @@
<!--
* @Author: 王文杰
* @Date: 2024-03-04 14:13:16
* @LastEditors: jevononlie 728254585@qq.com
* @LastEditTime: 2024-04-18 14:48:48
* @FilePath: /app-nx-personal/src/pages/index/components/CategoryPanel.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<script setup lang="ts">
import type { CategoryItem } from '@/types/home'
// props
defineProps<{
list: Object[]
}>()
const handleToBooking = (item: Object) => {
console.log('点击了分类', JSON.stringify(item))
if (item.auth) {
const path = item.path
const url = `/pages/${path}/${path}`
uni.navigateTo({
url,
})
}
}
</script>
<template>
<view class="category">
<template v-if="list.length">
<view class="category-item" hover-class="none" v-for="item in list" :key="item.path"
@click="handleToBooking(item)">
<view v-if="item.unReadCount>=0" class="center-msg">
<!-- <span class="msg-text">消息通知</span> -->
<text class="unread-badge" v-if="item.unReadCount>0">{{ item.unReadCount }}</text>
<image class="icon" :src="item.imgUrl" mode="scaleToFill"></image>
</view>
<view v-else >
<image v-if="item.auth" class="icon" :src="item.imgUrl" mode="scaleToFill"></image>
<image v-else class="icon" :src="item.defaultImgUrl" mode="scaleToFill"></image>
</view>
</view>
</template>
<view v-else class="empty-data">
<image class="icon" src="/static/images/home-empty.png" mode="aspectFit"></image>
</view>
</view>
</template>
<style lang="scss">
@import '../styles/category.scss';
.center-msg {
position: relative;
width: 100%;
height: 240rpx;
display: flex;
justify-content: center;
align-items: center;
}
.msg-text {
font-size: 32rpx;
color: #333;
width: 100%;
text-align: center;
}
.unread-badge {
position: absolute;
top: 20rpx;
right: 28rpx;
background: #ff4d4f;
color: #fff;
border-radius: 20rpx;
padding: 0 12rpx;
font-size: 24rpx;
min-width: 32rpx;
text-align: center;
z-index: 1;
}
</style>
<!--
* @Author: 王文杰
* @Date: 2024-03-04 14:13:16
* @LastEditors: jevononlie 728254585@qq.com
* @LastEditTime: 2024-04-18 14:48:48
* @FilePath: /app-nx-personal/src/pages/index/components/CategoryPanel.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<script setup lang="ts">
import type { CategoryItem } from '@/types/home'
// props
defineProps<{
list : Object[]
}>()
const handleToBooking = (item : Object) => {
console.log('点击了分类', JSON.stringify(item))
if (item.auth) {
const path = item.path
const url = `/pages/${path}/${path}`
uni.navigateTo({
url,
})
}
}
</script>
<template>
<view class="category">
<template v-if="list.length">
<view class="category-item" hover-class="none" v-for="item in list" :key="item.path"
@click="handleToBooking(item)">
<view v-if="item.unReadCount>=0" class="center-msg">
<!-- <span class="msg-text">消息通知</span> -->
<text class="unread-badge" v-if="item.unReadCount>0">{{ item.unReadCount }}</text>
<image class="icon" :src="item.imgUrl" mode="scaleToFill"></image>
</view>
<view v-else>
<image v-if="item.auth" class="icon" :src="item.imgUrl" mode="scaleToFill"></image>
<image v-else class="icon" :src="item.defaultImgUrl" mode="scaleToFill"></image>
</view>
</view>
</template>
<view v-else class="empty-data">
<image class="icon" src="/static/images/home-empty.png" mode="aspectFit"></image>
</view>
</view>
</template>
<style lang="scss">
@import '../styles/category.scss';
.center-msg {
position: relative;
width: 100%;
height: 240rpx;
display: flex;
justify-content: center;
align-items: center;
}
.msg-text {
font-size: 32rpx;
color: #333;
width: 100%;
text-align: center;
}
.unread-badge {
position: absolute;
top: 20rpx;
right: 28rpx;
background: #ff4d4f;
color: #fff;
border-radius: 20rpx;
padding: 0 12rpx;
font-size: 24rpx;
min-width: 32rpx;
text-align: center;
z-index: 1;
}
</style>

View File

@ -58,6 +58,13 @@ const categoryList = ref([
imgUrl: "/static/images/mojusheji.png",
defaultImgUrl: "/static/images/assembleReport-default.png",
},
{
path: "cgdsp",
name: "采购单审批",
auth: true,
imgUrl: "/static/images/pic_cgdsp.png",
defaultImgUrl: "/static/images/pic_cgdsp.png",
},
{
path: "messageNotification",
name: "消息通知",
@ -94,6 +101,7 @@ const getHomeCategory = async () => {
if (menus.length) {
const arr = [];
categoryList.value.forEach((e) => {
if (e.path === 'cgdsp') return;
const target = menus.find((q) => q.path == e.path);
e.auth = !!target;
});

View File

@ -95,3 +95,33 @@ export const getDictAPI = (data: Object) => {
data,
})
}
export const review = async(data:any) =>{
return http<any[]>({
method: 'GET',
url: '/heli/purchase-order-make/review',
data,
})
}
export const getReviewDetailAPI = (id:any) => {
return http<any[]>({
method: 'GET',
url: '/heli/purchase-order-make/obtainReviewDetails?id='+id,
})
}
export const reject = (id:any) => {
return http<any[]>({
method: 'GET',
url: '/heli/purchase-order-make/reject?id='+id,
})
}
export const approval = (id:any) => {
return http<any[]>({
method: 'GET',
url: '/heli/purchase-order-make/approval?id='+id,
})
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB