完成退款项目,补正项目列表

This commit is contained in:
itgaojian163 2025-05-16 18:00:23 +08:00
parent d98e999535
commit 99579749ff
11 changed files with 1551 additions and 111 deletions

73
App.vue
View File

@ -63,7 +63,6 @@
color: $white-color !important;
}
.mt-10 {
margin-top: 10rpx;
}
@ -371,4 +370,76 @@
.has-icon {
margin-left: -48rpx;
}
.condition-box {
position: fixed;
/* #ifdef H5 */
top: 80rpx;
/* #endif */
/* #ifdef MP-BAIDU */
top: 0;
/* #endif */
left: 0;
display: flex;
flex-direction: column;
box-sizing: border-box;
width: 100%;
z-index: 99;
}
.condition-input-box {
display: flex;
flex-direction: row;
align-items: center;
padding: 20rpx 30rpx 0rpx 30rpx;
}
.condition-input-container {
display: flex;
flex-direction: row;
align-items: center;
background-color: white;
padding: 10rpx;
border-radius: 10rpx;
flex: 1;
}
.condition-option-btn {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
border-radius: 15rpx;
padding: 4rpx 15rpx;
font-size: 20rpx;
background-color: $divider-color;
}
.condition-option-btn:active {
background-color: $gray-bg-color;
}
.condition-input-text {
font-size: 28rpx;
flex: 1;
text-align: center;
margin-right: 10rpx;
}
.condition-content {
margin-top: 5rpx;
max-height: 0vh;
background-color: $bg-gray-shade-color;
overflow: hidden;
transition: max-height 0.5s ease;
}
.condition-content.visible {
max-height: 100vh;
}
.condition-mask {
background-color: $bg-gray-shade-color;
height: 100vh;
}
</style>

View File

@ -30,7 +30,8 @@ export function createApp() {
appTitle: 'AI喵著',
appUrl: appUrl,
onlyDelBtns: [],
cancelEditBtns: []
cancelEditBtns: [],
primaryColor: '#FFA900'
})
return {
app

View File

@ -102,10 +102,22 @@
}
},
{
"path" : "pages/copyright/refund/refund",
"style" :
"path": "pages/copyright/refund/refund",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": true
}
},
{
"navigationBarTitleText" : "",
"path": "pages/copyright/applyRefund/applyRefund",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "pages/copyright/repair/repair",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": true
}
}

View File

@ -0,0 +1,536 @@
<template>
<view class="page-container">
<swiper indicator-dots style="height: 120rpx;" autoplay indicator-active-color="#fff">
<swiper-item>
<image :src="globalData.locImg+'/banner_1.png'" style="width: 100vw;height: 120rpx;"></image>
</swiper-item>
<swiper-item>
<image :src="globalData.locImg+'/banner_2.png'" style="width: 100vw;height: 120rpx;"></image>
</swiper-item>
</swiper>
<view class="apply-box">
<text class="label">申请退款</text>
<view class="apply-item-row mt-20 ml-10">
<view class="apply-title star" style="align-self: center;">退款软著</view>
<view class="apply-content" @click="showSelProDialog">
<view :class="selPro == null? 'text-hint':'text-sel'">
{{selPro==null? '选择需要退款的软著' :selPro.projName}}
</view>
<view class="icon-arrow-solid"></view>
</view>
</view>
<view class="apply-item-column mt-20 ml-10">
<view class="apply-title star">退款原因</view>
<textarea @input="inputRemark" :value="remark" placeholder="请输入退款原因"
placeholder-style="font-size:28rpx;color:$text-gray-hint-color"
class="reason-content mt-10"></textarea>
</view>
<view class="apply-item-column mt-20 ml-10">
<view class="apply-title star">退款凭证</view>
<view class="mt-10">
<!-- 图片上传 files 4 max-->
<uni-file-picker ref="imgPicker" :del-icon="true" limit="4" fileMediatype="image" @delete="delImgs"
:auto-upload="false" :image-styles="imageStyles" @select="uploadImgToNet"></uni-file-picker>
</view>
<view class="hint">
*上传完整的补正通知书或者完整的补正通知书的截图,要求右上方的流水号和右下方的补正通知书的日期都得完整显示
</view>
</view>
</view>
<view class="bottom-fixed-footer">
<view class="bottom-btn-green" @click="doApply">提交</view>
</view>
<!-- 可以退款的项目dialog -->
<uni-popup ref="proDialog" type="bottom" background-color="#fff" border-radius="15rpx 15rpx 0rpx 0rpx">
<view class="bottom-dialog-container">
<view class="dialog-title-box">
<view class="search-container">
<input placeholder="请输入项目名称" class="search-input" />
</view>
<view class="icon-close size-48" @click="closeDialog"></view>
</view>
<view style="height: 600rpx;" class="mt-10">
<containerLoadingVue :loadingVisible="loadingState">
<scroll-view scroll-y style="height: 580rpx;" :lower-threshold="10" @doRefresh="doRefreshList"
refresher-background="#FFFFFF00" @scrolltolower="doLoadMore">
<view class="pro-list-box">
<radio-group>
<view v-for="(item,index) in proList" :key="index" class="pro-list-item"
:data-value="item">
<radio style="transform: scale(0.7);" :color="primaryColor"
:borderColor="primaryColor"
:checked="tempSelPro != null && tempSelPro.projId==item.projId"></radio>
<view class="pro-list-item-left" @click="choosePro" :data-value="item">
<view class="pro-list-item-left-title">
<view class="pro-list-name">{{item.projName}}</view>
</view>
<view class="pro-list-item-left-footer">
<view class="pro-list-item-left-tag mr-10 single-line">
{{item.authorName}}
</view>
<view class="pro-list-item-left-tag">{{item.gmtCreate}}</view>
</view>
</view>
</view>
</radio-group>
<uni-load-more :status="hasMore"></uni-load-more>
</view>
</scroll-view>
</containerLoadingVue>
</view>
<view class="bottom-btn-green" @click="confirmSelPro">确定</view>
</view>
</uni-popup>
<uni-popup type="message" ref="msg">
<uni-popup-message :type="msgType" :message="msgHint" :duration="2000"></uni-popup-message>
</uni-popup>
</view>
</template>
<script>
import ProApi from '../../../common/js/net/projectApi'
import containerLoadingVue from '../../../components/container-loading.vue'
import {
inject
} from 'vue'
import {
kindList
} from '../../../common/js/data'
import {
get
} from '../../../common/js/cache/storage'
import {
uploadImgUrl
} from '../../../common/js/net/mainUrl'
export default {
components: {
containerLoadingVue
},
setup() {
const globalData = inject('globalData')
return {
globalData
}
},
data() {
return {
primaryColor: this.globalData.primaryColor,
msgHint: '',
msgType: '',
selPro: null,
selType: null,
files: [],
proList: [],
tempSelPro: null,
typeList: kindList,
showSelPro: false,
showSelType: false,
tempSelType: null,
remark: '',
proKeywords: '',
proPageData: {
page: 1,
rows: 10,
keywords: ''
},
listRefreshTrig: false,
loadingState: 'loading',
hasMore: true,
imageStyles: {
width: 72,
height: 72,
border: {
color: "#F5F5F5",
width: 1,
style: 'solid',
radius: '2px'
}
},
}
},
onLoad(options) {
uni.setNavigationBarTitle({
title: '申请退款',
})
uni.setNavigationBarColor({
frontColor: '#000000', // #ffffff#000000
backgroundColor: '#F0F0F0', //
animation: { //
duration: 500,
timingFunc: 'easeIn'
}
})
console.log(this.globalData.primaryColor)
},
methods: {
inputRemark(e) {
this.remark = e.detail.value
},
//
showSelProDialog() {
const _self = this
_self.doRefreshList()
_self.tempSelPro = _self.selPro
_self.$refs.proDialog.open()
},
closeDialog() {
this.$refs.proDialog.close()
},
confirmSelPro() {
if (this.tempSelPro == null) {
this.msgHint = '请选择退款项目'
this.msgType = 'error'
this.$refs.msg.open()
} else {
this.$refs.proDialog.close()
this.selPro = this.tempSelPro
this.tempSelPro = null
}
},
//
doRefreshList() {
const _self = this
_self.loadingState = 'loading'
_self.hasMore = 'more'
_self.isLoadMore = false
_self.proPageData.page = 1
_self.proPageData.keywords = _self.proKeywords
_self.getCanRefundList(true)
},
//
doLoadMore() {
//
const _self = this
if (_self.isLoadMore) {
return
}
_self.isLoadMore = true
_self.proPageData.page = ++_self.proPageData.page
_self.proPageData.keywords = _self.proKeywords
_self.getCanRefundList(false)
},
getCanRefundList(isRefresh) {
const _self = this
_self.proList = isRefresh ? [] : _self.proList
_self.loadingState = isRefresh ? 'loading' : ''
ProApi.doGetCanRefundProList(_self.proPageData)
.then(res => {
console.log(res)
var status = 'success'
status = res.rows && res.rows.length > 0 ? 'success' : 'empty'
_self.loadingState = isRefresh ? status : ''
_self.proList = _self.proList.concat(res.rows)
_self.isLoadMore = false
_self.hasMore = _self.proList.length < res.total ? 'more' : 'noMore'
})
.catch(err => {
_self.loadingState = 'error'
_self.isLoadMore = false
_self.hasMore = 'more'
})
},
choosePro(e) {
this.tempSelPro = e.currentTarget.dataset.value
},
//
delImgs(e) {
console.log('删除凭证', e)
this.files.splice(e.index, 1)
},
//
async uploadImgToNet(e) {
uni.showLoading({
title: '上传中...'
})
const tempFilePaths = e.tempFilePaths;
const token = get('token');
const header = token ? {
Auth: `Bearer ${token}`
} : {};
const that = this;
try {
//
const results = [];
//
for (let i = 0; i < tempFilePaths.length; i++) {
const filePath = tempFilePaths[i];
// 使 Promise uni.uploadFile
const result = await new Promise((resolve, reject) => {
uni.uploadFile({
url: uploadImgUrl,
header: header,
filePath: filePath,
name: 'image',
success(res) {
if (res.statusCode === 200) {
let data = res.data;
if (typeof data === 'string') {
data = JSON.parse(data);
}
resolve(data.data);
} else {
reject(new Error('上传失败状态码非200'));
}
},
fail(err) {
reject(err);
}
});
});
//
results.push(result);
}
//
that.files = that.files.concat(results);
uni.hideLoading();
} catch (error) {
uni.hideLoading();
that.msgHint = '凭证上传失败,请稍后重试';
that.msgType = 'error';
that.$refs.msg.open();
//
that.$refs.imgPicker.clearFiles();
console.error('上传错误:', error);
}
},
//
doApply() {
const legal = this.checkParams()
if (legal) {
const _self = this
uni.showLoading({
title: '提交中...',
})
const ids = _self.files.map(item => item.fileId).join(',');
const data = {
projId: _self.selPro.projId,
refundReason: _self.remark,
refundVoucher: ids
}
ProApi.doApplyRefundPro(data)
.then(res => {
uni.hideLoading()
_self.msgHint = '提交操作已顺利完成,我们会尽快审核,还请耐心等待'
_self.msgType = 'success'
_self.$refs.msg.open()
//TODO
// setTimeout(() => {
// _self.backPageRefresh()
// }, 2000);
setTimeout(() => {
uni.navigateBack({
success: function() {
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2];
if (prevPage && typeof prevPage.doRefreshList ===
'function') {
prevPage.doRefreshList()
}
}
});
}, 1500)
})
.catch(err => {
wx.hideLoading()
_self.msgHint = err.msg ? err.msg : '提交失败,请稍后重试'
_self.msgType = 'error'
_self.$refs.msg.open()
})
}
},
//
checkParams() {
const _self = this
if (_self.selPro == null) {
_self.msgHint = '请选择退款软著'
_self.msgType = 'error'
_self.$refs.msg.open()
return false
}
if (_self.remark == '') {
_self.msgHint = '请输入退款原因'
_self.msgType = 'error'
_self.$refs.msg.open()
return false
}
if (_self.files.length <= 0) {
_self.msgHint = '请上传退款凭证'
_self.msgType = 'error'
_self.$refs.msg.open()
return false
}
return true
}
}
}
</script>
<style lang="scss" scoped>
.apply-box {
margin-top: 20rpx;
display: flex;
flex-direction: column;
padding: 30rpx;
background-color: $white-color;
border-radius: 10rpx;
}
.label {
font-size: 32rpx;
font-weight: bold;
}
.apply-item-row {
display: flex;
flex-direction: row;
justify-content: space-between;
}
.apply-item-column {
display: flex;
flex-direction: column;
}
.apply-title {
font-size: 28rpx;
color: $text-color;
flex: 0.3;
}
.apply-content {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-end;
flex: 0.7;
background-color: $bg-gray-input-color;
padding: 10rpx 15rpx;
font-size: 28rpx;
border-radius: 15rpx;
}
.reason-content {
border-radius: 15rpx;
height: 120rpx;
background-color: $bg-gray-input-color;
font-size: 28rpx;
padding: 20rpx;
}
.text-hint {
color: $text-gray-hint-color;
}
.text-sel {
color: $text-color;
}
.hint {
margin-top: 10rpx;
font-size: 26rpx;
color: $red-color;
}
.pro-list-box {
display: flex;
flex-direction: column;
}
.pro-list-item {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
border-radius: 10rpx;
padding: 30rpx;
margin: 10rpx;
box-shadow: 1rpx 1rpx 2rpx 2rpx $bg-gray-input-color;
}
.pro-list-item:nth-of-type(n+2) {
margin-top: 20rpx;
}
.pro-list-item-left {
display: flex;
flex-direction: column;
flex: 1;
margin-left: 30rpx;
}
.pro-list-item-left-title {
display: flex;
flex-direction: row;
justify-content: space-between;
}
.pro-list-item-left-footer {
display: flex;
flex-direction: row;
justify-content: space-between;
margin-top: 20rpx;
}
.pro-list-item-left-count {
font-size: 24rpx;
color: $text-color;
flex-wrap: nowrap;
margin-top: 4rpx;
}
.pro-list-item-left-tag {
font-size: 24rpx;
color: $text-color;
flex: .5;
}
.pro-list-name {
font-size: 26rpx;
font-weight: bold;
flex: 1;
}
.search-container {
position: relative;
align-self: center;
border-radius: 5px;
background-color: $bg-gray-color;
padding: 5px;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
width: 100%;
margin-right: 20rpx;
}
.search-input {
box-sizing: border-box;
color: $text-color;
font-size: 28rpx;
text-align: center;
flex: 1;
padding: 10rpx;
background-color: $bg-gray-input-color;
border-radius: 10rpx;
}
.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+');
}
:deep(.file-picker__progress) {
display: none !important;
}
</style>

View File

@ -58,8 +58,10 @@
<view class="repair-title-apply-time">{{item.gmtCreate}}</view>
</view>
<view class="divider-v mt-20"></view>
<view class="repair-name-box mt-10" :data-value="item" @click="showReason">
<view class="repair-title-content">{{item.projName}}</view>
<view class="repair-name-box mt-10">
<view :data-value="item" @click="showReason" class="repair-title-content">
{{item.projName}}
</view>
<view v-if="item.applyStatus=='PENDING'" class="icon-cancel-yellow size-48"
@click="cancelApply" :data-value="item"></view>
</view>
@ -258,7 +260,7 @@
doLoadMore() {
//
const _self = this
if (_self.isLoadMore || !_self.hasMore) {
if (_self.isLoadMore || _self.hasMore == 'noMore') {
return
}
_self.isLoadMore = true
@ -289,23 +291,18 @@
const fileName = item.value
const path = item.url
//pdf
const tempPath =
'https://www.aimzhu.com/copyright/route/file/v2/download/true/04e5694a-1438-41ed-bda5-7cb0bf67ea8d'
const tempFileName = '18b20温度模块.PDF'
_self.download(tempPath, tempFileName)
// if (current.value.toLowerCase().endsWith('.pdf')) {
// //,
// _self.download(current)
// } else {
// //
// const urls = [current.url]
// console.log((urls))
// uni.previewImage({
// urls: urls,
// })
// }
if (fileName.toLowerCase().endsWith('.pdf')) {
//,
_self.download(path, fileName)
} else {
//
const urls = [path]
uni.previewImage({
urls: urls,
})
}
},
//pdf
//
cancelApply(e) {
const item = e.currentTarget.dataset.value
const _self = this
@ -411,77 +408,7 @@
</script>
<style lang="scss" scoped>
.condition-box {
position: fixed;
/* #ifdef H5 */
top: 80rpx;
/* #endif */
/* #ifdef MP-BAIDU */
top: 0;
/* #endif */
left: 0;
display: flex;
flex-direction: column;
box-sizing: border-box;
width: 100%;
z-index: 99;
}
.condition-input-box {
display: flex;
flex-direction: row;
align-items: center;
padding: 20rpx 30rpx 0rpx 30rpx;
}
.condition-input-container {
display: flex;
flex-direction: row;
align-items: center;
background-color: white;
padding: 10rpx;
border-radius: 10rpx;
flex: 1;
}
.condition-option-btn {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
border-radius: 15rpx;
padding: 4rpx 15rpx;
font-size: 20rpx;
background-color: $divider-color;
}
.condition-option-btn:active {
background-color: $gray-bg-color;
}
.condition-input-text {
font-size: 28rpx;
flex: 1;
text-align: center;
margin-right: 10rpx;
}
.condition-content {
margin-top: 5rpx;
max-height: 0vh;
background-color: $bg-gray-shade-color;
overflow: hidden;
transition: max-height 0.5s ease;
}
.condition-content.visible {
max-height: 100vh;
}
.condition-mask {
background-color: $bg-gray-shade-color;
height: 100vh;
}
.condition-content-container {
background-color: $divider-color;

View File

@ -0,0 +1,888 @@
<template>
<view class="page-container">
<view class="condition-box">
<view class="condition-input-box">
<view class="condition-input-container">
<icon class="ml-20" type="search" size="20"></icon>
<input class="condition-input-text" :value="keywords" @input="inputKeywords"
@confirm="doSearchKeyWord" placeholder-style="font-size:28rpx;" type="text"
confirm-type="search" placeholder="项目名称" />
<view class="icon-clear size-32 mr-10" v-if="keywords != ''" @click="clearSearch"></view>
<view @click="chooseOptions" class="condition-option-btn icon-arrow-solid">筛选</view>
</view>
<view class="add-btn" @click="applyRepair">申请补正</view>
</view>
<view :class="['condition-content', { 'visible': isShowOptions }]">
<view class="condition-content-container">
<view class="condition-content-box">
<view class="condition-content-box-left">
<view class="left-item" @click="chooseLeft" data-value="state">
<view
:class="['left-item-line',curOptions=='state'? 'left-sel-line':'left-normal-line']">
</view>
<view class="left-sel-text">状态</view>
</view>
<view class="left-item" @click="chooseLeft" data-value="kind">
<view
:class="['left-item-line',curOptions=='kind'? 'left-sel-line':'left-normal-line']">
</view>
<view class="left-sel-text">种类</view>
</view>
<view class="left-item" @click="chooseLeft" data-value="type">
<view
:class="['left-item-line',curOptions=='type'? 'left-sel-line':'left-normal-line']">
</view>
<view class="left-sel-text">类型</view>
</view>
</view>
<scroll-view class="condition-content-box-scroll-right" scroll-y>
<view class="condition-content-box-right">
<block v-if="curOptions=='state'">
<block v-for="(item,index) in stateList" :key="index">
<view
:class="[tempSelState==item.value ? 'right-item-sel':'right-item-normal','condition-content-right-item']"
:data-value="item.value" @click="chooseState">{{item.title}}</view>
</block>
</block>
<block v-else-if="curOptions=='kind'">
<block v-for="(item,index) in kindList" :key="index">
<view
:class="[tempSelKind==item.value ? 'right-item-sel':'right-item-normal','condition-content-right-item']"
:data-value="item.value" @click="chooseKind">{{item.title}}</view>
</block>
</block>
<block v-else>
<block v-for="(item,index) in typeList" :key="index">
<view
:class="[tempSelType==item.value ? 'right-item-sel':'right-item-normal' ,'condition-content-right-item']"
:data-value="item.value" @click="chooseType">{{item.title}}</view>
</block>
</block>
</view>
</scroll-view>
</view>
<view class="condition-content-btns">
<view class="condition-content-btn clear" @click="clearChooseOption">清除</view>
<view class="condition-content-btn cancel" @click="cancelChooseOption">取消</view>
<view class="condition-content-btn confirm" @click="confirmChooseOption">确定</view>
</view>
</view>
<view class="condition-mask" @click="cancelChooseOption"></view>
</view>
</view>
<view style="margin-top: 80rpx;">
<ContainerLoading :loadingVisible="loadingState">
<scroll-view scroll-y style="height: 80vh;" :lower-threshold="100" refresher-background="#FFFFFF00"
@scrolltolower="doLoadMore">
<view class="repair-list-box">
<block v-for="(item,index) in repairList" :key="index">
<view class="repair-list-item">
<view class="repair-item-title-box" :data-value="item" @click="showReason">
<view class="repair-title-box">
<view :class="[repairStatusColor(item.applyStatus),'repair-status-content']">
{{repairStatus(item.applyStatus)}}
</view>
</view>
<view class="repair-title-apply-time">{{item.gmtCreate}}</view>
</view>
<view class="divider-v mt-20"></view>
<view class="repair-name-box mt-10">
<view class="repair-title-content" :data-value="item" @click="showReason">
{{item.projName}}
</view>
<view v-if="item.applyStatus=='PENDING'" class="icon-cancel-yellow size-48"
@click="cancelApply" :data-value="item">
</view>
</view>
<view :data-value="item" @click="showReason"
class="repair-reason-desc multiple-2-ellipsis">{{item.correctionReason}}</view>
<view class="repair-footer-box">
<view class="repair-attr-box" :data-value="item" @click="showReason">
<view class="repair-attr-item">{{repairType(item.type)}}</view>
<view class="repair-attr-item">{{repairKind(item.correctionType)}}
</view>
</view>
<view v-if="item.applyStatus=='APPROVED'" class="options-btn" @click="downloadFile"
:data-value="item">下载</view>
</view>
</view>
</block>
<uni-load-more :status="hasMore"></uni-load-more>
</view>
</scroll-view>
</ContainerLoading>
</view>
<DownloadProgress :isShow="downloading" :progress="downloadProgress"></DownloadProgress>
<uni-popup ref="reasonDialog" type="center" background-color="#fff" border-radius="15rpx 15rpx 15rpx 15rpx">
<view class="bottom-dialog-container" style="width: 80vw;">
<view class="approve-title">补正原因</view>
<view v-if="reasonItem != null" class="approve-content mt-10">{{reasonItem.correctionReason}}</view>
<view class="approve-title mt-10">补正凭证</view>
<view v-if="reasonItem != null" class="approve-img-box mt-10">
<block v-for="(item,index) in reasonItem.correctionVoucherFileKVs" :key="index">
<view class="approve-img-item single-line" @click="previewImg" :data-item="item">
{{item.value}}
</view>
</block>
</view>
<view v-if="reasonItem != null && reasonItem.gmtReview !=''" class="approve-content-box">
<view class="approve-title mt-10">审核时间</view>
<view class="approve-content mt-10">{{reasonItem.gmtReview}}</view>
<view class="approve-title mt-10">审核意见</view>
<view class="approve-content mt-10">{{reasonItem.reviewReason}}</view>
</view>
<view class="close-btn" @click="closeDialog">关闭</view>
</view>
</uni-popup>
<uni-popup type="message" ref="msg">
<uni-popup-message :type="msgType" :message="msgHint" :duration="2000"></uni-popup-message>
</uni-popup>
</view>
</template>
<script>
import ProApi from '@/common/js/net/projectApi';
import ContainerLoading from '@/components/container-loading.vue'
import DownloadProgress from '@/components/download-progress.vue';
import {
inject,
isReactive
} from 'vue';
import {
typeList,
stateList,
kindList
} from '@/common/js/data';
import {
repairStatusColor,
repairStatus,
repairType,
repairKind
} from '@/common/js/conver.js'
import {
previewUrl
} from '@/common/js/net/mainUrl';
import {
get
} from '@/common/js/cache/storage';
export default {
components: {
ContainerLoading,
DownloadProgress
},
setup() {
const globalData = inject('globalData')
return {
globalData
}
},
data() {
return {
keywords: '',
pageData: {
page: 1,
rows: 10,
projName: '',
type: '',
correctionType: '',
applyStatus: ''
},
msgShow: false,
msgHint: '',
msgType: 'error',
loadingState: 'loading',
listRefreshTrig: false,
isLoadMore: false,
hasMore: true,
repairList: [], //
typeList: typeList,
selectType: '',
tempSelType: '',
kindList: kindList,
selectKind: '',
tempSelKind: '',
stateList: stateList,
selectState: '',
tempSelState: '',
buttons: [{
text: '关闭'
}],
showHint: false,
approveImgs: [],
approveTime: '',
approveDesc: '',
preUrl: previewUrl,
approveStatus: false, //
showDownloadDialog: false,
downloadProgress: 0, //
downloading: false, //
tempDownloadPro: null, //item
approveReason: '', //
isShowOptions: false,
curOptions: 'state',
needRefresh: false, //
reasonItem: null, //
};
},
onLoad(options) {
uni.setNavigationBarTitle({
title: "补正项目",
});
uni.setNavigationBarColor({
frontColor: "#000000",
backgroundColor: "#F0F0F0",
animation: {
duration: 500,
timingFunc: "easeIn",
},
});
this.doRefreshList()
},
methods: {
repairStatusColor,
repairStatus,
repairType,
repairKind,
inputKeywords(e) {
this.keywords = e.detail.value
},
//
clearSearch() {
const _self = this
this.keywords = ''
this.doRefreshList()
},
//
doSearchKeyWord() {
this.doRefreshList()
},
//
chooseOptions() {
this.tempSelKind = this.selectKind
this.tempSelState = this.selectState
this.tempSelType = this.selectType
this.isShowOptions = !this.isShowOptions
},
//
chooseLeft(e) {
this.curOptions = e.currentTarget.dataset.value
},
//
chooseType(e) {
this.tempSelType = e.currentTarget.dataset.value
},
chooseKind(e) {
this.tempSelKind = e.currentTarget.dataset.value
},
chooseState(e) {
this.tempSelState = e.currentTarget.dataset.value
},
confirmChooseOption() {
this.selectState = this.tempSelState
this.selectKind = this.tempSelKind
this.selectType = this.tempSelType
this.tempSelKind = ''
this.tempSelState = ''
this.tempSelType = ''
this.isShowOptions = false
this.doRefreshList()
},
cancelChooseOption() {
this.isShowOptions = false
this.tempSelKind = ''
this.tempSelState = ''
this.tempSelType = ''
},
clearChooseOption() {
this.selectKind = ''
this.selectState = ''
this.selectType = ''
this.tempSelKind = ''
this.tempSelState = ''
this.tempSelType = ''
this.isShowOptions = false
this.doRefreshList()
},
closeDialog() {
this.$refs.reasonDialog.close()
},
//
showReason(e) {
const item = e.currentTarget.dataset.value
const _self = this
item.correctionVoucherFileKVs.map(value => {
value.url = previewUrl + value.key
return value
})
this.reasonItem = item
console.log(item)
this.$refs.reasonDialog.open()
},
//
previewImg(e) {
const _self = this
_self.$refs.reasonDialog.close()
const item = e.currentTarget.dataset.value
console.log(item)
const fileName = item.value
const path = item.url
//pdf
if (fileName.toLowerCase().endsWith('.pdf')) {
//,
_self.download(path, fileName)
} else {
//
const urls = [path]
uni.previewImage({
urls: urls,
})
}
},
//
doDownload(url, header) {
const _self = this
return new Promise((resolve, reject) => {
const downloadTask = uni.downloadFile({
url: url,
header: header,
success: resolve,
fail: reject
})
downloadTask.onProgressUpdate(res => {
_self.downloadProgress = res.progress
})
})
},
//
//path :
async download(path, fileName) {
const _self = this
_self.downloadProgress = 0 //
_self.downloading = true //
const url = path
const token = get('token')
const header = {}
if (token) {
header.Auth = `Bearer ${token}`;
}
const downloadRes = await _self.doDownload(url, header)
console.log('下载返回', downloadRes)
if (downloadRes && downloadRes.statusCode == 200) {
uni.saveFile({
tempFilePath: downloadRes.tempFilePath,
success: res => {
_self.downloadProgress = 0
_self.downloading = false
uni.openDocument({
filePath: res.savedFilePath,
showMenu: true,
success: openRes => {
console.log('打开文件成功')
},
fail: openErr => {
_self.showErr('很抱歉,文件下载出现问题。建议您稍作等待,之后再尝试下载。')
}
})
},
fail: err => {
console.log(err)
_self.showErr('很抱歉,文件下载出现问题。建议您稍作等待,之后再尝试下载。')
}
})
}
},
showErr(msg) {
const _self = this
_self.msgHint = msg
_self.msgType = 'error'
_self.showDownload = false
_self.downloading = false
_self.downloadProgress = 0
_self.$refs.msg.open()
},
//
doRefreshList() {
console.log('正在刷新...')
const _self = this
_self.loadingState = 'loading'
_self.hasMore = 'more'
_self.pageData.page = 1
_self.pageData.projName = _self.keywords
_self.pageData.type = _self.selectType
_self.pageData.correctionType = _self.selectKind
_self.pageData.applyStatus = _self.selectState
_self.isLoadMore = false
_self.doGetRepairList(true)
},
doLoadMore() {
//
const _self = this
if (_self.isLoadMore || _self.hasMore == 'noMore') {
return
}
_self.isLoadMore = true
_self.pageData.page = ++_self.pageData.page
_self.pageData.projName = _self.keywords
_self.pageData.type = _self.selectType
_self.pageData.correctionType = _self.selectKind
_self.pageData.applyStatus = _self.selectState
_self.doGetRepairList(false)
},
//
doGetRepairList(isRefresh) {
const _self = this
_self.repairList = isRefresh ? [] : _self.repairList
_self.loadingState = isRefresh ? 'loading' : ''
ProApi.doGetMineRepairList(_self.pageData)
.then(res => {
console.log(res)
var status = 'success'
status = res.rows && res.rows.length > 0 ? 'success' : 'empty'
_self.loadingState = isRefresh ? status : ''
_self.repairList = _self.repairList.concat(res.rows)
_self.isLoadMore = false
_self.hasMore = _self.repairList.length < res.total ? 'more' : 'noMore'
})
.catch(err => {
_self.loadingState = 'error'
_self.isLoadMore = false
_self.hasMore = 'more'
})
},
//
downloadFile(e) {
const item = e.currentTarget.dataset.value
},
//
applyRepair() {
uni.navigateTo({
url: '/pages/copyright/applyRepair/appRepair'
})
},
//
cancelApply(e) {
const item = e.currentTarget.dataset.value
const _self = this
uni.showModal({
title: '警告',
content: '您确定要撤销这次补正吗?',
success: res => {
if (res.confirm) {
_self.doCancelApply(item)
}
}
})
},
//
doCancelApply(item) {
const _self = this
uni.showLoading({
title: '取消中...',
})
ProApi.doCancelProrepair(item.projCorrectionApplyId)
.then(res => {
uni.hideLoading()
_self.msgType = 'success'
_self.msgHint = '撤销成功'
_self.$refs.msg.open()
_self.doRefreshList()
})
.catch(err => {
uni.hideLoading()
_self.msgType = 'error'
_self.msgHint = err.msg ? err.msg : '撤销失败,请稍后重试'
_self.$refs.msg.open()
})
}
},
onPullDownRefresh() {
this.doRefreshList()
uni.stopPullDownRefresh()
}
};
</script>
<style lang="scss" scoped>
.condition-content-container {
background-color: $divider-color;
padding: 0rpx 30rpx;
height: 350rpx;
display: flex;
flex-direction: column;
}
.condition-content-box {
display: flex;
flex-direction: row;
flex: 1;
padding: 20rpx;
}
.condition-content-box-left {
display: flex;
flex-direction: column;
flex: .2;
border-right: 1rpx solid $white-color;
height: 100%;
}
.condition-content-box-scroll-right {
flex: .8;
height: 230rpx;
padding: 0rpx 20rpx;
}
.condition-content-box-right {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.left-item {
display: flex;
flex-direction: row;
align-items: center;
padding: 10rpx 0rpx;
}
.left-item-line {
width: 8rpx;
height: 30rpx;
border-radius: 5rpx;
}
.left-sel-line {
background-color: $primary-color;
color: $text-brown-color;
}
.left-normal-line {
background-color: $divider-color;
color: $text-gray-desc-color;
}
.left-sel-text {
font-size: 28rpx;
margin-left: 10rpx;
color: $text-color;
}
.left-sel {
border-left: 5rpx solid $primary-color;
padding-left: 10rpx;
}
.condition-content-right-item {
white-space: nowrap;
line-height: 28rpx;
height: 28rpx;
border-radius: 10rpx;
font-size: 24rpx;
text-align: center;
padding: 5rpx 10rpx;
margin: 10rpx;
color: $text-brown-color;
}
.right-item-sel {
background-color: $primary-color-light;
}
.right-item-normal {
background-color: transparent;
}
.condition-content-btns {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-evenly;
margin-bottom: 20rpx;
margin-top: 10rpx;
}
.condition-content-btn {
font-size: 28rpx;
padding: 5rpx 60rpx;
text-align: center;
border-radius: 8rpx;
}
.cancel {
background-color: $white-color;
color: $text-color;
}
.clear {
background-color: $white-color;
color: $text-color;
}
.confirm {
background-color: $btn-green-color;
color: $white-color;
}
.add-btn {
border-radius: 8rpx;
background-color: $btn-green-color;
color: rgba(255, 255, 255, 1);
font-size: 28rpx;
text-align: center;
height: 50rpx;
margin-left: 20rpx;
line-height: 50rpx;
font-family: PingFangSC-regular;
padding: 5rpx 10rpx;
}
.add-btn:active {
background-color: $btn-green-color-active;
}
.content-container {
height: 82vh;
margin-top: 70rpx;
}
.bottom-btn {
position: fixed;
bottom: 40rpx;
left: 0;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
width: 100%;
}
.repair-list-box {
display: flex;
flex-direction: column;
}
.repair-list-item {
display: flex;
flex-direction: column;
background-color: $white-color;
padding: 20rpx;
border-radius: 8rpx;
}
.repair-list-item:nth-of-type(n+2) {
margin-top: 20rpx;
}
.repair-item-title-box {
display: flex;
flex-direction: row;
justify-content: space-between;
}
.repair-title-box {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
font-size: 28rpx;
}
.repair-name-box {
display: flex;
flex-direction: row;
justify-content: space-between;
}
.repair-title-content {
font-size: 28rpx;
font-weight: bold;
flex: 1;
padding-right: 15rpx;
}
.repair-reason-desc {
margin-top: 10rpx;
font-size: 24rpx;
color: $text-gray-desc-color;
}
.repair-footer-box {
margin-top: 20rpx;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: flex-end;
}
.repair-attr-box {
display: flex;
flex-direction: row;
}
.repair-attr-item {
font-size: 20rpx;
color: $text-brown-color;
background-color: $divider-color;
padding: 2rpx 10rpx;
border-radius: 5rpx;
text-align: center;
}
.repair-attr-item:nth-of-type(n+2) {
margin-left: 10rpx;
}
.repair-title-apply-time {
font-size: 22rpx;
color: $text-gray-hint-color;
}
.repair-status-green {
background-color: $bg-green-color;
}
.repair-status-red {
background-color: $bg-red-color;
}
.repair-status-yellow {
background-color: $primary-color;
}
.repair-status-content {
padding: 2rpx 10rpx;
font-size: 22rpx;
border-radius: 5rpx;
height: 30rpx;
line-height: 30rpx;
text-align: center;
color: $text-color;
}
.repair-status-gray {
background-color: $bg-gray-deep-color;
}
.order-item {
display: flex;
flex-direction: column;
background-color: white;
border-radius: 10rpx;
padding: 10rpx 20rpx;
}
.record-title-box {
display: flex;
flex-direction: row;
}
.record-options {
display: flex;
flex-direction: row;
}
.options-btn {
font-size: 24rpx;
line-height: 24rpx;
height: 24rpx;
padding: 10rpx 20rpx;
border-radius: 5rpx;
background-color: $btn-green-color;
color: $white-color;
}
.options-btn:active {
background-color: $btn-green-color-active;
}
.close-btn {
font-size: 28rpx;
text-align: center;
width: 120rpx;
align-self: center;
border-radius: 15rpx;
padding: 10rpx 15rpx;
color: $btn-blue-color;
}
.close-btn:active {
color: $btn-blue-color-active;
}
.approve-title {
font-size: 28rpx;
color: $text-color;
font-weight: bold;
}
.approve-content-box {
margin-top: 10rpx;
display: flex;
flex-direction: column;
align-items: flex-start;
}
.approve-img-box {
display: flex;
flex-direction: column;
margin-top: 15rpx;
box-sizing: border-box;
width: 100%;
}
.approve-img-item {
font-size: 24rpx;
border-radius: 5rpx;
padding: 10rpx;
text-align: left;
background-color: $gray-bg-color;
width: 100%;
margin: 10rpx;
box-sizing: border-box;
}
.approve-img-item:nth-of-type(n+2) {
margin-top: 10rpx;
}
.approve-content {
font-size: 24rpx;
margin-left: 20rpx;
text-align: left;
color: $text-gray-desc-color;
}
.approve-hint {
margin-top: 20rpx;
font-size: 24rpx;
color: $text-gray-hint-color;
}
.col-yellow {
background-color: $primary-color;
color: $text-color;
}
.col-gray {
background-color: $bg-gray-deep-color;
color: $text-gray-desc-color;
}
.col-green {
background-color: $bg-green-color;
color: $text-brown-color;
}
.col-red {
background-color: $bg-red-color;
color: $text-brown-color;
}
</style>

View File

@ -44,10 +44,15 @@
})
// #endif
// #ifdef H5 || MP-BAIDU
// set('token',
// 'WWZRMmsySWJib2hKQUZVVzdYdjFBS3RGRko5UzVVb1dWdm1SZUVxVnUycVhTeDFtN0Q2aHcyTXlwVFRXUTJZM2I5eWRjc2VXK0lLd2d2Z1pCSndydFZQYjZ6ejIyakd6czV4UVF2V3hSRUxsNWZlOStITjhTU1JWdXNWWExIeTloNHNsVkdPMWQ3Q0JGamNhSnpSNXhVVXN5Wnk1NmpnOGNsckxueHNiZFBVdlU3NGpkZDRHMTQrc1pYTGlyZ1c3MnprdFRvTUhWODhJR2M1THhObkN4NGpKZk9sUmVJcTJqYTBZalp0YkNxRU5aNjA3WklLQnRTMVdEdXg0NW1tMEV5V3RSSEEvV0M2ZmFoRWtzRGRoZkd0ZUcyZ2pKRFYwa3YxYThDZm53ZGE5bTBYKzgrVm8yV1h1aTdVU2FQbVAwbFZ6TnhobkxvNGswMWlsMGtiSVNBPT0='
// )
// set('userId', 'c2438eb8-2685-49a9-bf02-5111a5192d96')
set('token',
'WWZRMmsySWJib2hKQUZVVzdYdjFBS3RGRko5UzVVb1dWdm1SZUVxVnUycVhTeDFtN0Q2aHcyTXlwVFRXUTJZM2I5eWRjc2VXK0lLd2d2Z1pCSndydFZQYjZ6ejIyakd6czV4UVF2V3hSRUxsNWZlOStITjhTU1JWdXNWWExIeTloNHNsVkdPMWQ3Q0JGamNhSnpSNXhVVXN5Wnk1NmpnOGNsckxueHNiZFBVdlU3NGpkZDRHMTQrc1pYTGlyZ1c3MnprdFRvTUhWODhJR2M1THhObkN4NGpKZk9sUmVJcTJqYTBZalp0YkNxRU5aNjA3WklLQnRTMVdEdXg0NW1tMEV5V3RSSEEvV0M2ZmFoRWtzRGRoZkd0ZUcyZ2pKRFYwa3YxYThDZm53ZGE5bTBYKzgrVm8yV1h1aTdVU2FQbVAwbFZ6TnhobkxvNGswMWlsMGtiSVNBPT0='
'NjBIOFRORDcraDc4U1RsUTI4a3B5em50VVVzclp2QjdFWDV2dVJJc0VLL3Fhazd0bjZPaU9Tc3E1cHc2cmYyZTc0Y2FITTdRR0pMTk1xaVRHM0I1d0NiTnJ4b1BVSVNtUFl4SlFtR1g2M0tCQTc2TXM4L3d4ZVhwM09VREN0bDMrTXNoa0trWDR1eG5PdG84OXZ4UVE0dDhRUDdQRk1Qd2N0ZWVLSzJaZzBkZ0RhQS84M3B5WDN1aGlEdWQwR3BIZ24vWDBUWmhrNUZiQkJPUDJKQngyL002Rm5aOG5JZ01HTldoNmJnRGxqOFhjNDhjMmxvVnJDV3JSWlo4dHIydHBRU3FEN3htVjVHZlhueUFjRHlpSVZEd0JJZVJWa3NVMFNlVkNWR2dSZHg4RXFsSkttc05WTDhBN014R3dVRUdIclNZN0UwSm9zdUZ3T052MTRmWmhwRmZhWTJsbURCZ0RlTDFLeHZWWDQ0PQ=='
)
set('userId', 'c2438eb8-2685-49a9-bf02-5111a5192d96')
set('userId', '776864b2-f9d5-49eb-9ea9-db6c862ea10b')
setTimeout(() => {
uni.switchTab({
url: '/pages/index/home'

View File

@ -389,7 +389,7 @@
doLoadMore() {
//
const _self = this
if (_self.isLoadMore || !_self.hasMore) {
if (_self.isLoadMore || _self.loadMore == 'noMore') {
return
}
_self.isLoadMore = true

View File

@ -168,7 +168,7 @@
doLoadMore() {
//
const _self = this
if (_self.isLoadMore || !_self.hasMore) {
if (_self.isLoadMore || _self.hasMore=='noMore') {
return
}
var isEffective = ''

View File

@ -139,7 +139,7 @@
doLoadMore() {
//
const _self = this
if (_self.isLoadMore || !_self.hasMore) {
if (_self.isLoadMore || _self.hasMore=='noMore') {
return
}
_self.isLoadMore = true

View File

@ -39,7 +39,7 @@
</block>
</view>
</block>
<uni-load-more :status="loadMore"></uni-load-more>
<uni-load-more :status="hasMore"></uni-load-more>
</view>
</scroll-view>
</ContainerLoading>
@ -123,14 +123,14 @@
_self.orderList = _self.orderList.concat(res.rows)
_self.listRefreshTrig = false
_self.isLoadMore = false
_self.hasMore = _self.orderList.length < res.total
_self.hasMore = _self.orderList.length < res.total ? 'more' : 'noMore'
_self.loadMore = _self.hasMore ? 'more' : 'noMore'
})
.catch(err => {
_self.loadingState = 'error'
_self.listRefreshTrig = false
_self.isLoadMore = false
_self.hasMore = true
_self.hasMore = 'more'
_self.loadMore = 'more'
})
},
@ -151,7 +151,7 @@
doLoadMore() {
//
const _self = this
if (_self.isLoadMore || !_self.hasMore) {
if (_self.isLoadMore || _self.hasMore == 'noMore') {
return
}
_self.isLoadMore = true