补正页面优化,可补正项目列表添加搜索,首页生成按钮Bug修复

This commit is contained in:
itgaojian163 2025-05-08 16:01:06 +08:00
parent b64d169428
commit 1d05f8ae3d
16 changed files with 281 additions and 85 deletions

View File

@ -120,8 +120,8 @@
background-color: var(--btn-green-color);
color: white;
font-size: 16px;
height: 70rpx;
line-height: 70rpx;
height: 80rpx;
line-height: 80rpx;
border-radius: 5px;
text-align: center;
}
@ -229,6 +229,13 @@
text-overflow: ellipsis;
}
.single-line-front {
white-space: nowrap;
overflow: hidden;
direction: rtl;
text-overflow: ellipsis;
}
.multiple-3-ellipsis {
display: -webkit-box;
-webkit-box-orient: vertical;

View File

@ -102,7 +102,7 @@ class ProjectService {
}
//获取可以补正的项目列表
static doGetCanProRepairList(data) {
return request(apiPath.canProRepairList, 'GET', data)
return request(apiPath.canProRepairList, "GET", data)
}
}

View File

@ -24,7 +24,16 @@ Page({
showSelPro: false,
showSelType: false,
tempSelType: null,
remark: ''
remark: '',
proKeywords: '',
proPageData: {
page: 1,
rows: 10,
keywords: ''
},
listRefreshTrig: false,
loadingState: 'loading',
hasMore: true,
},
/**
@ -49,39 +58,74 @@ Page({
//获取可以申请补正的列表
this.getCanRepairList(false)
},
//获取可以补正的项目列表
getCanRepairList(isShow) {
const _self = this
wx.showLoading({
title: '加载中...',
inputKeywords(e) {
this.setData({
proKeywords: e.detail.value
})
const data = {
page: 1,
rows: 30
},
clearSearch() {
this.setData({
proKeywords: ''
})
this.doRefreshList()
},
//搜索项目
doSearchKeyWord() {
this.doRefreshList()
},
doRefreshList() {
const _self = this
_self.setData({
listRefreshTrig: true,
loadingState: 'loading',
hasMore: true,
isLoadMore: false,
'proPageData.page': 1,
'proPageData.keywords': _self.data.proKeywords
})
_self.getCanRepairList(true)
},
doLoadMore() {
//判断是否正在加载中 与是否存在更多数据
const _self = this
if (_self.data.isLoadMore || !_self.data.hasMore) {
return
}
ProApi.doGetCanProRepairList(data)
_self.setData({
isLoadMore: true,
'proPageData.page': ++_self.data.proPageData.page,
'proPageData.keywords': _self.data.proKeywords
})
_self.getCanRepairList(false)
},
//获取可以补正的项目列表
getCanRepairList(isRefresh) {
const _self = this
_self.setData({
proList: isRefresh ? [] : _self.data.proList,
loadingState: isRefresh ? 'loading' : ''
})
ProApi.doGetCanProRepairList(_self.data.proPageData)
.then(res => {
wx.hideLoading()
if (res.rows && res.rows.length > 0) {
_self.setData({
proList: res.rows,
showSelPro: isShow,
tempSelPro: _self.data.selPro
})
} else {
_self.setData({
msgHint: '您暂无可以补正的软著',
msgType: 'error',
msgShow: true
})
}
console.log(res)
var status = 'success'
status = res.rows && res.rows.length > 0 ? 'success' : 'empty'
_self.setData({
loadingState: isRefresh ? status : '',
proList: _self.data.proList.concat(res.rows),
listRefreshTrig: false,
isLoadMore: false
})
_self.setData({
hasMore: _self.data.proList.length < res.total
})
})
.catch(err => {
wx.hideLoading()
_self.setData({
msgHint: err.msg ? err.msg : '网络错误,请稍后重试',
msgType: 'error',
msgShow: true
loadingState: 'error',
listRefreshTrig: false,
isLoadMore: false,
hasMore: true
})
})
},

View File

@ -2,6 +2,8 @@
"usingComponents": {
"mp-toptips": "weui-miniprogram/toptips/toptips",
"mp-half-screen-dialog": "weui-miniprogram/half-screen-dialog/half-screen-dialog",
"mp-uploader": "weui-miniprogram/uploader/uploader"
"mp-uploader": "weui-miniprogram/uploader/uploader",
"container-loading": "/components/container-loading/container-loading",
"mp-loading": "weui-miniprogram/loading/loading"
}
}

View File

@ -11,14 +11,14 @@
<view class="apply-box">
<text class="label">补正信息</text>
<view class="apply-item-row mt-20 ml-10">
<view class="apply-title star">补正软著</view>
<view class="apply-title star" style="align-self: center;">补正软著</view>
<view class="apply-content" bind:tap="showSelProDialog">
<view class="{{selPro == null? 'text-hint':'text-sel'}}">{{selPro==null? '选择需要补正的软著' :selPro.projName}}</view>
<view class="icon-arrow-down-line" style="width: 24rpx;height: 24rpx;margin:0rpx 20rpx;"></view>
</view>
</view>
<view class="apply-item-row mt-20 ml-10">
<view class="apply-title star">补正种类</view>
<view class="apply-title star" style="align-self: center;">补正种类</view>
<view class="apply-content" bind:tap="showSelTypeDialog">
<view class="{{selType==null?'text-hint':'text-sel'}}">{{selType==null?'选择种类':selType.title}}</view>
<view class="icon-arrow-down-line" style="width: 24rpx;height: 24rpx;margin:0rpx 20rpx;"></view>
@ -45,30 +45,40 @@
<!-- 补正软著列表 -->
<mp-half-screen-dialog show="{{showSelPro}}" bindclose="closeDialog">
<view slot="title">补正软著</view>
<view slot="title">
<view class="search-container">
<input class="search-input" value="{{proKeywords}}" bindinput="inputKeywords" bindconfirm="doSearchKeyWord" type="text" confirm-type="search" placeholder="请输入项目名称" />
<view wx:if="{{proKeywords !=''}}" bind:tap="clearSearch" class="icon-clear" style="width: 20px;height: 20px;"></view>
</view>
</view>
<view slot="desc">
<scroll-view scroll-y style="height: 500rpx;">
<view class="pro-list-box">
<radio-group>
<block wx:for="{{proList}}" wx:key="index">
<view class="pro-list-item" bind:tap="" data-value="{{item}}">
<radio class="custom-radio" style="margin-left: 5px;" checked="{{tempSelPro.projId==item.projId}}"></radio>
<view class="pro-list-item-left" bind:tap="choosePro" data-value="{{item}}">
<view class="pro-list-item-left-title">
<view class="pro-list-name">{{item.projName}}</view>
<rich-text class="pro-list-item-left-tag" nodes="已通过补正<span style='color:red;font-size:28rpx;font-weight:bold;'>{{item.approvedCount}}</span>次"></rich-text>
<view style="height: 600rpx;">
<container-loading loadingState="{{loadingState}}" style="height: 600rpx;" bindrefresh="doRefreshList">
<scroll-view scroll-y="{{true}}" style="height: 600rpx;" bindrefresherrefresh="doRefreshList" refresher-enabled refresher-triggered="{{listRefreshTrig}}" bindscrolltolower="doLoadMore" lower-threshold='50'>
<view class="pro-list-box">
<radio-group>
<block wx:for="{{proList}}" wx:key="index">
<view class="pro-list-item" bind:tap="" data-value="{{item}}">
<radio class="custom-radio" style="margin-left: 5px;" checked="{{tempSelPro.projId==item.projId}}"></radio>
<view class="pro-list-item-left" bind:tap="choosePro" data-value="{{item}}">
<view class="pro-list-item-left-title">
<view class="pro-list-name">{{item.projName}}</view>
<rich-text class="pro-list-item-left-count" nodes="已通过补正<span style='color:red;font-size:28rpx;font-weight:bold;'>{{item.approvedCount}}</span>次"></rich-text>
</view>
<view class="pro-list-item-left-footer">
<view class="pro-list-item-left-tag">{{item.applyContactName}}</view>
<view class="pro-list-item-left-tag">{{item.projContext}}</view>
<view class="pro-list-item-left-tag">{{item.gmtCreate}}</view>
</view>
</view>
</view>
<view class="pro-list-item-left-footer">
<view class="pro-list-item-left-tag">{{item.applyContactName}}</view>
<view class="pro-list-item-left-tag">{{item.projContext}}</view>
<view class="pro-list-item-left-tag">{{item.gmtCreate}}</view>
</view>
</view>
</view>
</block>
</radio-group>
</view>
</scroll-view>
</block>
</radio-group>
<mp-loading show="{{isLoadMore}}" type="circle"></mp-loading>
</view>
</scroll-view>
</container-loading>
</view>
</view>
<view slot="footer">
<view class="bottom-btn-green" bind:tap="confirmSelPro">确定</view>

View File

@ -27,6 +27,7 @@
.apply-title {
font-size: 28rpx;
color: var(--text-color);
flex: 0.3;
}
.apply-content {
@ -34,6 +35,8 @@
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-end;
flex: 0.7;
}
.reason-content {
@ -97,17 +100,59 @@
margin-top: 20rpx;
}
.pro-list-item-left-count {
font-size: 24rpx;
color: var(--text-color);
flex-wrap: nowrap;
margin-top: 4rpx;
}
.pro-list-item-left-tag {
font-size: 24rpx;
color: var(--text-color);
}
.pro-list-name {
font-size: 28rpx;
font-size: 26rpx;
font-weight: bold;
flex: 1;
}
.search-container {
position: relative;
align-self: center;
border-radius: 5px;
background-color: var(--bg-gray-color);
padding: 5px;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
width: 100%;
}
.search-input {
box-sizing: border-box;
color: var(--text-color);
font-size: 28rpx;
text-align: center;
flex: 1;
}
.search-input::after {
content: '';
position: absolute;
left: 10px;
top: 50%;
transform: translateY(-50%);
width: 20px;
height: 20px;
margin-top: -1px;
background-size: cover;
background-image: url('data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSI2NCA2NCA4OTYgODk2IiB3aWR0aD0iMTQiIGhlaWdodD0iMTkiIHN0eWxlPSIiIGZpbHRlcj0ibm9uZSI+CiAgICAKICAgIDxnPgogICAgPHBhdGggZD0iTTkwOS42IDg1NC41TDY0OS45IDU5NC44QzY5MC4yIDU0Mi43IDcxMiA0NzkgNzEyIDQxMmMwLTgwLjItMzEuMy0xNTUuNC04Ny45LTIxMi4xLTU2LjYtNTYuNy0xMzItODcuOS0yMTIuMS04Ny45cy0xNTUuNSAzMS4zLTIxMi4xIDg3LjlDMTQzLjIgMjU2LjUgMTEyIDMzMS44IDExMiA0MTJjMCA4MC4xIDMxLjMgMTU1LjUgODcuOSAyMTIuMUMyNTYuNSA2ODAuOCAzMzEuOCA3MTIgNDEyIDcxMmM2NyAwIDEzMC42LTIxLjggMTgyLjctNjJsMjU5LjcgMjU5LjZhOC4yIDguMiAwIDAgMCAxMS42IDBsNDMuNi00My41YTguMiA4LjIgMCAwIDAgMC0xMS42ek01NzAuNCA1NzAuNEM1MjggNjEyLjcgNDcxLjggNjM2IDQxMiA2MzZzLTExNi0yMy4zLTE1OC40LTY1LjZDMjExLjMgNTI4IDE4OCA0NzEuOCAxODggNDEyczIzLjMtMTE2LjEgNjUuNi0xNTguNEMyOTYgMjExLjMgMzUyLjIgMTg4IDQxMiAxODhzMTE2LjEgMjMuMiAxNTguNCA2NS42UzYzNiAzNTIuMiA2MzYgNDEycy0yMy4zIDExNi4xLTY1LjYgMTU4LjR6IiBmaWxsPSJyZ2JhKDIwNCwyMDQsMjA0LDEpIj48L3BhdGg+CiAgICA8L2c+CiAgPC9zdmc+');
}
/* 上传图片 */
@ -184,4 +229,8 @@
.weui-half-screen-dialog__ft {
padding: 0rpx 0rpx 20rpx;
}
.weui-half-screen-dialog__hd__side+.weui-half-screen-dialog__hd__main {
padding: 0 46rpx;
}

View File

@ -51,6 +51,7 @@ Page({
downloadProgress: 0, //下载文件进度
downloading: false, //下载文件中
tempDownloadPro: null, //下载的item
approveReason: '', //补正原因
},
/**
@ -233,6 +234,7 @@ Page({
approveImgs: item.correctionVoucherFileKVs,
approveTime: item.gmtReview,
approveDesc: item.reviewReason,
approveReason: item.correctionReason,
approveStatus: item.applyStatus == 'APPROVED' ? false : true,
showHint: true
})
@ -241,12 +243,76 @@ Page({
previewImg(e) {
const _self = this
const current = e.currentTarget.dataset.value
const url = []
_self.data.approveImgs.forEach(item => url.push(item.url))
console.log(url)
wx.previewImage({
urls: url,
current: current
//判断是pdf还是图片
if (current.value.toLowerCase().endsWith('.pdf')) {
//文件,下载文件
_self.doDownloadApprovePdf(current)
} else {
//图片
const urls = [current.url]
wx.previewImage({
urls: urls,
})
}
},
//下载凭证文件
doDownloadApprovePdf(item) {
const _self = this
_self.setData({
showHint: false
})
wx.showLoading({
title: '加载中...',
})
const token = Cache.get('token')
const header = {}
if (token) {
header.Auth = `Bearer ${token}`;
}
wx.downloadFile({
url: item.url,
header: header,
success: res => {
wx.hideLoading()
if (res.statusCode === 200) {
// 从响应头中获取文件名
let fileName = item.value;
if (fileName) {
// 保存文件时使用获取到的文件名
wx.getFileSystemManager().saveFile({
tempFilePath: res.tempFilePath,
filePath: wx.env.USER_DATA_PATH + '/' + fileName,
success: function (res) {
const savedFilePath = res.savedFilePath;
console.log('文件下载并保存成功', savedFilePath);
if (savedFilePath.endsWith(".txt")) {
wx.navigateTo({
url: '/pages/readTxt/readTxt?filePath=' + savedFilePath,
})
} else {
wx.openDocument({
filePath: savedFilePath,
showMenu: true
})
}
},
fail: function (err) {
console.error('文件保存失败', err);
_self.showErr('很抱歉,文件下载出现问题。建议您稍作等待,之后再尝试下载。')
}
})
} else {
console.error('未从响应头中获取到文件名');
_self.showErr('很抱歉,文件下载出现问题。建议您稍作等待,之后再尝试下载。')
}
} else {
_self.showErr('很抱歉,文件下载出现问题。建议您稍作等待,之后再尝试下载。')
}
},
fail: err => {
_self.showErr('很抱歉,文件下载出现问题。建议您稍作等待,之后再尝试下载。')
console.log(`下载失败${err}`)
}
})
},
closeDialog(e) {

View File

@ -60,10 +60,15 @@
</view>
<mp-dialog show="{{showHint}}" buttons="{{buttons}}" bindbuttontap="closeHint">
<view class="approve-box">
<view class="approve-title">补正凭证</view>
<view class="approve-title">补正原因</view>
<view class="approve-content mt-10">{{approveReason}}</view>
<view class="approve-title mt-10">补正凭证</view>
<view class="approve-img-box mt-10">
<block wx:for="{{approveImgs}}" wx:key="index">
<image data-value="{{item.url}}" bind:tap="previewImg" class="approve-img-item" src="{{item.url}}" mode="scaleToFill"></image>
<view class="approve-img-item single-line-front" bind:tap="previewImg" data-value="{{item}}">
{{item.value}}
</view>
</block>
</view>
<view wx:if="{{approveTime !=''}}" class="approve-content-box">

View File

@ -301,16 +301,25 @@
.approve-img-box {
display: flex;
flex-direction: row;
flex-wrap: wrap;
flex-direction: column;
margin-top: 15rpx;
box-sizing: border-box;
width: 100%;
}
.approve-img-item {
width: 120rpx;
height: 120rpx;
font-size: 24rpx;
border-radius: 5rpx;
margin: 5rpx;
padding: 10rpx;
text-align: left;
background-color: var(--gray-bg-color);
width: 100%;
margin: 10rpx;
box-sizing: border-box;
}
.approve-img-item:nth-of-type(n+2) {
margin-top: 10rpx;
}
.approve-content {

View File

@ -88,9 +88,12 @@
</view>
<view class="project-btns">
<view class="project-create-time">{{item.gmtCreate}}</view>
<view wx:if="{{item.generate.generateStatus=='SUCCESS'}}" class="project-btn" bind:tap="doShowDownload" data-value="{{item}}">下载</view>
<view wx:if="{{item.generate.generateStatus=='FAILED'}}" class="project-re-btn" bind:tap="doReCreate" data-value="{{item}}">重新生成</view>
<view wx:if="{{item.isShowCreate}}" class="project-btn" bind:tap="doCreatePro" data-value="{{item}}">生成</view>
<block wx:else>
<view wx:if="{{item.generate.generateStatus=='SUCCESS'}}" class="project-btn" bind:tap="doShowDownload" data-value="{{item}}">下载</view>
<view wx:elif="{{item.generate.generateStatus=='FAILED'}}" class="project-re-btn" bind:tap="doReCreate" data-value="{{item}}">重新生成</view>
<view wx:elif="{{item.generate.generateStatus=='NONE'}}" class="project-btn" bind:tap="doCreatePro" data-value="{{item}}">生成</view>
</block>
</view>
</view>
</view>

View File

@ -140,11 +140,9 @@ Page({
this.setData({
checkList: newCheckList,
orderList: newOrderList,
money: newCheckList.length > 0 ? newCheckList.map(item => {
let count = 0
count += item.rechargeMoney
return count
}) : 0
money: newCheckList.length > 0 ? newCheckList.reduce((accumulator, item) => {
return accumulator + Number(item.rechargeMoney);
}, 0) : 0
});
},
//去开票

View File

@ -15,9 +15,9 @@
</view>
</view>
</view> -->
<view style="margin-top: 20px;">
<view style="margin-top: 10rpx;">
<container-loading loadingState="{{loadingState}}">
<scroll-view scroll-y style="height: 85vh;" bindrefresherrefresh="doRefreshList" refresher-enabled refresher-triggered="{{listRefreshTrig}}" bindscrolltolower="doLoadMore" lower-threshold='30'>
<scroll-view scroll-y style="height: 83vh;" bindrefresherrefresh="doRefreshList" refresher-enabled refresher-triggered="{{listRefreshTrig}}" bindscrolltolower="doLoadMore" lower-threshold='40'>
<view class="order-list-box">
<block wx:for="{{orderList}}" wx:key="index">
<view class="order-list-item" bind:tap="checkItem" data-value="{{item}}">

View File

@ -67,6 +67,9 @@
align-items: center;
padding: 10rpx 20rpx;
}
.order-list-item:nth-of-type(n+2){
margin-top: 20rpx;
}
.order-list-item-content {
display: flex;
@ -88,7 +91,7 @@
}
.pay-money {
font-size: 45rpx;
font-size: 32rpx;
font-weight: bold;
}

View File

@ -89,8 +89,8 @@
width: 94vw;
}
.order-item:nth-of-type(n+2) {
margin-top: 15px;
#mp-slide:nth-of-type(n+2) {
margin-top: 20rpx;
}
.contact-desc {

View File

@ -23,7 +23,7 @@
<scroll-view scroll-y style="height: 85vh;" bindrefresherrefresh="doRefreshList" refresher-enabled refresher-triggered="{{listRefreshTrig}}" bindscrolltolower="doLoadMore" lower-threshold='30'>
<view class="coupons-list-box">
<block wx:for="{{msgList}}" wx:key="index">
<mp-slideview id="mp-slide" buttons="{{onlyDelBtns}}" icon="{{true}}" bindshow="show" data-value="{{item}}" bindhide="hide" bindbuttontap="slideButtonTap">
<mp-slideview id="mp-slide" buttons="{{onlyDelBtns}}" icon="{{true}}" data-value="{{item}}" bindbuttontap="slideButtonTap">
<view class="msg-item-box" bind:tap="readItem" data-value="{{item}}">
<view class="msg-title-box">
<view wx:if="{{item.isRead==0}}" class="msg-content-notice-point"></view>

View File

@ -20,8 +20,8 @@
<view class="order-types">
<view class="or-type">{{tools.proType(detail.productType)}}</view>
<view class="or-count">数量{{detail.quantity}}</view>
<view class="or-price">单价{{detail.unitPrice/100}}</view>
<view class="or-total">总金额{{item.totalAmount/100}}</view>
<!-- <view class="or-price">单价{{detail.unitPrice/100}}</view> -->
<view class="or-total">总金额{{detail.unitPrice/100}}</view>
</view>
<view class="order-remark-box">
<view class="order-remark-title">订单备注</view>