Commit d7c9a320 by Chao Sun

冲突

parents e28f73cf 20eb17e4
...@@ -10,6 +10,10 @@ Vue.config.productionTip = false; ...@@ -10,6 +10,10 @@ Vue.config.productionTip = false;
Vue.prototype.axios = axios; Vue.prototype.axios = axios;
Vue.prototype.$api = api; Vue.prototype.$api = api;
import { numberToCurrencyNo } from '@/utils/numberToCurrency'
// 配置全局过滤器,实现数字千分位格式
Vue.filter('numberToCurrency', numberToCurrencyNo)
App.mpType = 'app' App.mpType = 'app'
const app = new Vue({ const app = new Vue({
api, api,
......
/* 保单年度弹窗 */
.policySelectContainer{
position: fixed;
z-index: 2;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.35);
}
.policySelectContainer .policyYearContainer{
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 57%;
background-color: #fff;
border-top-left-radius: 40rpx;
border-top-right-radius: 40rpx;
padding: 20rpx 30rpx 0;
box-sizing: border-box;
}
.policyYearContainer .modalTitle{
display: flex;
justify-content: space-between;
align-items: center;
font-weight: bold;
}
.policyYearContainer .modalTitle text:last-child{
color: #FF0000;
}
.policyYearItemContainer{
display: flex;
flex-wrap: wrap;
justify-content: space-around;
}
.policyYearItemContainer view{
width: 9%;
height: 0;
padding-bottom: 9%;
margin: 20rpx 0;
color: #fff;
border-radius: 50%;
position: relative;
margin-right: 6rpx;
color: #333;
font-weight: bold;
}
.policyYearItemContainer view.actived{
background: linear-gradient(135deg, #CEB07D 0%, #FFDDA9 56%, #FED495 100%, #FED495 100%);
color:#6B4000;
}
.policyYearItemContainer view text{
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-55%);
}
.policyStepContainer{
display: flex;
justify-content: space-around;
margin-top: 40rpx;
}
.policyStepContainer button{
flex: 0 0 30%;
font-size: 32rpx;
color:#000;
font-weight:bold;
border:1px solid #CEB07D;
}
.policyStepContainer uni-button::after{
border:1px solid #CEB07D;
}
.policyStepContainer button.actived{
background: linear-gradient(135deg, #CEB07D 0%, #FFDDA9 56%, #FED495 100%, #FED495 100%);
color: #6B4000;
}
.policyStepContainer button.actived,.policyStepContainer button.actived::after{
border:none;
}
.confirm button{
background: linear-gradient(135deg, #CEB07D 0%, #FFDDA9 56%, #FED495 100%, #FED495 100%);
color: #6B4000;
font-weight: bold;
font-size: 36rpx;
margin-top: 56rpx;
width: 300rpx;
}
.confirm button,.confirm button::after{
border: none ;
}
.uni-textarea{
position: relative;
}
.pasteDiscernment{
position: absolute;
right: 0;
bottom: 0;
height: 50rpx;
background: #9B8055;
border-radius: 100px;
color: #fff;
font-size: 24rpx;
}
.batchDataImportContainer{
background-color: #fbfbfb;
height: 90vh;
}
.batchDataLists{
margin-top: 20rpx;
background: #fff;
}
.batchDataLists view{
display: flex;
text-align: center;
border-bottom: 1px solid #e4e4e4;
}
.batchDataLists view text:first-child{
width: 0;
flex: 0 0 35%;
border-right: 1px solid #e4e4e4;
}
.batchDataLists view text:last-child{
width: 0;
flex: 0 0 65%;
}
.batchDataLists view.batchDataTh{
height: 60rpx;
background:linear-gradient(135deg, #CEB07D 0%, #FFDDA9 56%, #FED495 100%, #FED495 100%);
line-height: 60rpx;
border-top-left-radius: 12rpx;
border-top-right-radius: 12rpx;
}
.batchDataLists view.batchDataTd{
height: 80rpx;
line-height: 80rpx;
}
.dataOptionContainer{
margin: 20rpx 20rpx 0;
margin-bottom: 34rpx;
}
.dataOptionContainer .uni-textarea{
background-color: #fff;
margin-bottom: 20rpx;
}
.tips{
font-size: 24rpx;
color: #666;
padding: 0 20rpx 20rpx;
background-color: #fff;
}
.tips text text{
font-size: 28rpx;
color: #9B8055;
font-weight: bold;
}
.selectStepContent,.selectStepContainer{
display: flex;
align-items: center;
}
.selectStepContainer{
justify-content: space-between;
padding: 20rpx 20rpx 0;
background-color: #fff;
}
.stepContent{
display: flex;
align-items: center;
border-bottom: 1px solid #e4e4e4;
padding: 0 5px;
}
.selectStepContainer button{
background-color: transparent;
}
.selectStepContainer button::after{
border: 1px solid #CEB07D;
}
.optionContent{
position: fixed;
bottom: 0;
left: 0;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
background-color: #fff;
}
.optionContent button{
flex: 0 0 46%;
border:2rpx solid #e7c793;
color: #6B4000;
font-size: 36rpx;
}
.optionContent button:last-child{
background: linear-gradient(135deg, #CEB07D 0%, #FFDDA9 56%, #FED495 100%, #FED495 100%);
border: none;
}
.batchDataTd input{
height: 100%;
}
\ No newline at end of file
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</view> </view>
<!-- 自定义 --> <!-- 自定义 -->
<view> <view>
<button class="mini-btn" type="default" size="mini" @click="policyYearModalFlag=true">自定义</button> <button class="mini-btn" type="default" size="mini" @click="selectCustomPolicyYear">自定义</button>
</view> </view>
</view> </view>
<!-- 提示信息--> <!-- 提示信息-->
...@@ -24,23 +24,25 @@ ...@@ -24,23 +24,25 @@
<!-- 粘贴数据区域 --> <!-- 粘贴数据区域 -->
<view class="uni-textarea"> <view class="uni-textarea">
<textarea v-model="pasteData" placeholder-style="color:#999999;font-size:14px;padding-left:9px;padding-top:3px" placeholder="请根据左侧保单年度进行现金价值数据粘贴"/> <textarea v-model="pasteData" placeholder-style="color:#999999;font-size:14px;padding-left:9px;padding-top:3px" placeholder="请根据左侧保单年度进行现金价值数据粘贴"/>
<button class="mini-btn pasteDiscernment" type="default" size="mini">粘贴并识别</button> <button class="mini-btn pasteDiscernment" type="default" size="mini" @click="pasteDataDistinguish">粘贴并识别</button>
</view> </view>
<!-- 批量数据输入区域 --> <!-- 批量数据输入区域 -->
<scroll-view class="batchDataLists" upper-threshold="200" scroll-y="true"> <view class="batchDataLists">
<view class="batchDataTh"> <view class="batchDataTh">
<text>保单年度</text> <text>保单年度</text>
<text>现金价值</text> <text>现金价值</text>
</view> </view>
<view class="batchDataTd" v-for="item in irrAndSimpleInfos"> <scroll-view scroll-y="true" style="height: 560rpx;">
<text>{{item.nyear}}</text> <view class="batchDataTd" v-for="item in irrAndSimpleInfos">
<text>{{item.cashValue}}</text> <text>{{item.nyear}}</text>
</view> <input class="uni-input" style="height: 100%;" type="digit" v-model="item.cashValue" placeholder="请输入纯数字" />
</scroll-view> </view>
</scroll-view>
</view>
</view> </view>
<!-- 操作 --> <!-- 操作 -->
<view class="optionContent"> <view class="optionContent">
<button type="default" plain="true" form-type="reset">全部清空</button> <button type="default" plain="true" form-type="reset" @click="clearData">全部清空</button>
<button type="default" plain="true" @click="calcute()">{{calcuteMethod=='2' ? '输入批量数据' : '开始计算'}}</button> <button type="default" plain="true" @click="calcute()">{{calcuteMethod=='2' ? '输入批量数据' : '开始计算'}}</button>
</view> </view>
<!-- 保单年度选择弹窗 --> <!-- 保单年度选择弹窗 -->
...@@ -58,7 +60,7 @@ ...@@ -58,7 +60,7 @@
</view> </view>
<view class="policyYearItemContainer"> <view class="policyYearItemContainer">
<view v-for="item of customPolicyYearRangeCount" @click="selectCustomPolicyYears(item + customPolicyYearRange * customPolicyYearRangeCount)" :class="{'actived':getActiveStatus(item + customPolicyYearRange * customPolicyYearRangeCount)}"> <view v-for="item of customPolicyYearRangeCount" @click="selectCustomPolicyYears(item + customPolicyYearRange * customPolicyYearRangeCount)" :class="{'actived':getActiveStatus(item + customPolicyYearRange * customPolicyYearRangeCount)}">
<text>{{item + customPolicyYearRange * customPolicyYearRangeCount > 105 ? '' : item + customPolicyYearRange * customPolicyYearRangeCount}}</text> <text>{{item + customPolicyYearRange * customPolicyYearRangeCount > this.maxPolicyYear ? '' : item + customPolicyYearRange * customPolicyYearRangeCount}}</text>
</view> </view>
</view> </view>
<view class="confirm"> <view class="confirm">
...@@ -80,18 +82,35 @@ ...@@ -80,18 +82,35 @@
irrAndSimpleInfos:[{nyear:1,cashValue:''}], irrAndSimpleInfos:[{nyear:1,cashValue:''}],
customPolicyYearRange:0, customPolicyYearRange:0,
customPolicyYearRangeCount:40, customPolicyYearRangeCount:40,
policyYearLists:[], maxPolicyYear:105,
policyYearLists:[{nyear:1,isActived:true,cashValue:''}],
policyYearModalFlag:false, policyYearModalFlag:false,
} }
}, },
onLoad() {
this.bindPickerChange({detail:{value:this.index}})
},
methods:{ methods:{
// 选择间隔 // 选择间隔
bindPickerChange(e){ bindPickerChange(e){
this.index = e.detail.value this.index = e.detail.value;
const m = this.stepLists[this.index]===1 ? 2 : 1;
this.policyYearLists = [{nyear:1,isActived:true,cashValue:''}];
for(let n=m;n<=this.maxPolicyYear;n++){
let calcNumber = this.stepLists[this.index] * n;
if(calcNumber <= this.maxPolicyYear){
this.policyYearLists = this.policyYearLists.concat([{nyear:calcNumber,cashValue:''}]) ;
}else{
break;
}
}
this.irrAndSimpleInfos = this.policyYearLists.concat([]);
}, },
// 选择自定义 // 选择自定义
selectCustomPolicyYear(){ selectCustomPolicyYear(){
this.policyYearModalFlag=true;
this.irrAndSimpleInfos = this.policyYearLists = [];
console.log(this.irrAndSimpleInfos)
}, },
// 选择保单年度区间 // 选择保单年度区间
selectPolicyYearRange(e){ selectPolicyYearRange(e){
...@@ -99,7 +118,6 @@ ...@@ -99,7 +118,6 @@
}, },
// 选择保单年度(自定义) // 选择保单年度(自定义)
selectCustomPolicyYears(e){ selectCustomPolicyYears(e){
console.log(e)
if(this.policyYearLists.filter(item=>item.nyear==e).pop()){ if(this.policyYearLists.filter(item=>item.nyear==e).pop()){
this.policyYearLists.filter(item=>item.nyear==e).pop()['isActived'] = !this.policyYearLists.filter(item=>item.nyear==e).pop()['isActived'] this.policyYearLists.filter(item=>item.nyear==e).pop()['isActived'] = !this.policyYearLists.filter(item=>item.nyear==e).pop()['isActived']
}else{ }else{
...@@ -121,209 +139,55 @@ ...@@ -121,209 +139,55 @@
if(this.policyYearLists.length>0){ if(this.policyYearLists.length>0){
this.policyYearLists.sort((a,b)=>a.nyear - b.nyear) this.policyYearLists.sort((a,b)=>a.nyear - b.nyear)
} }
this.irrAndSimpleInfos = JSON.parse(JSON.stringify(this.policyYearLists)); this.irrAndSimpleInfos = JSON.parse(JSON.stringify(this.policyYearLists));
},
// 粘贴并识别
pasteDataDistinguish(){
const pasteDataLists = this.pasteData.trim().split('\n');
console.log(pasteDataLists)
if(pasteDataLists.length<=0 || pasteDataLists.every((item)=>item=='')){
uni.showModal({
title: '数据识别结果',
content: '检测到您并没有导入数据,请重新操作',
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}else if(pasteDataLists.length !== this.irrAndSimpleInfos.length){
uni.showModal({
title: '数据识别结果',
content: '检测到您导入的数据条数和选择的保单年度数量不一致,系统将从上到下依次填入,请确认是否继续',
success: (res)=> {
if (res.confirm) {
console.log('用户点击确定');
if(this.irrAndSimpleInfos.length>0){
const minLength = Math.min(pasteDataLists.length,this.irrAndSimpleInfos.length) ;
console.log(minLength)
for(let i=0;i<minLength;i++){
this.irrAndSimpleInfos[i]['cashValue'] = pasteDataLists[i];
}
}
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
},
// 全部清空
clearData(){
this.pasteData = '';
this.irrAndSimpleInfos.forEach(item=>item.cashValue='');
} }
} }
} }
</script> </script>
<style> <style>
/* 保单年度弹窗 */ @import 'data-import.css'
.policySelectContainer{
position: fixed;
z-index: 2;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.35);
}
.policySelectContainer .policyYearContainer{
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 57%;
background-color: #fff;
border-top-left-radius: 40rpx;
border-top-right-radius: 40rpx;
padding: 20rpx 30rpx 0;
box-sizing: border-box;
}
.policyYearContainer .modalTitle{
display: flex;
justify-content: space-between;
align-items: center;
font-weight: bold;
}
.policyYearContainer .modalTitle text:last-child{
color: #FF0000;
}
.policyYearItemContainer{
display: flex;
flex-wrap: wrap;
justify-content: space-around;
}
.policyYearItemContainer view{
width: 9%;
height: 0;
padding-bottom: 9%;
margin: 20rpx 0;
color: #fff;
border-radius: 50%;
position: relative;
margin-right: 6rpx;
color: #333;
font-weight: bold;
}
.policyYearItemContainer view.actived{
background: linear-gradient(135deg, #CEB07D 0%, #FFDDA9 56%, #FED495 100%, #FED495 100%);
color:#6B4000;
}
.policyYearItemContainer view text{
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-55%);
}
.policyStepContainer{
display: flex;
justify-content: space-around;
margin-top: 40rpx;
}
.policyStepContainer button{
flex: 0 0 30%;
font-size: 32rpx;
color:#000;
font-weight:bold;
border:1px solid #CEB07D;
}
.policyStepContainer uni-button::after{
border:1px solid #CEB07D;
}
.policyStepContainer button.actived{
background: linear-gradient(135deg, #CEB07D 0%, #FFDDA9 56%, #FED495 100%, #FED495 100%);
color: #6B4000;
}
.policyStepContainer button.actived,.policyStepContainer button.actived::after{
border:none;
}
.confirm button{
background: linear-gradient(135deg, #CEB07D 0%, #FFDDA9 56%, #FED495 100%, #FED495 100%);
color: #6B4000;
font-weight: bold;
font-size: 36rpx;
margin-top: 56rpx;
width: 300rpx;
}
.confirm button,.confirm button::after{
border: none ;
}
.uni-textarea{
position: relative;
}
.pasteDiscernment{
position: absolute;
right: 0;
bottom: 0;
height: 50rpx;
background: #9B8055;
border-radius: 100px;
color: #fff;
font-size: 24rpx;
}
.batchDataImportContainer{
background-color: #fbfbfb;
height: 90vh;
}
.batchDataLists{
margin-top: 20rpx;
background: #fff;
padding-bottom: 120rpx;
}
.batchDataLists view{
display: flex;
text-align: center;
border-bottom: 1px solid #e4e4e4;
}
.batchDataLists view text:first-child{
width: 0;
flex: 0 0 35%;
border-right: 1px solid #e4e4e4;
}
.batchDataLists view text:last-child{
width: 0;
flex: 0 0 65%;
}
.batchDataLists view.batchDataTh{
height: 60rpx;
background:linear-gradient(135deg, #CEB07D 0%, #FFDDA9 56%, #FED495 100%, #FED495 100%);
line-height: 60rpx;
border-top-left-radius: 12rpx;
border-top-right-radius: 12rpx;
}
.batchDataLists view.batchDataTd{
height: 80rpx;
line-height: 80rpx;
}
.dataOptionContainer{
margin: 20rpx 20rpx 0;
margin-bottom: 34rpx;
}
.dataOptionContainer .uni-textarea{
background-color: #fff;
margin-bottom: 20rpx;
}
.tips{
font-size: 24rpx;
color: #666;
padding: 0 20rpx 20rpx;
background-color: #fff;
}
.tips text text{
font-size: 28rpx;
color: #9B8055;
font-weight: bold;
}
.selectStepContent,.selectStepContainer{
display: flex;
align-items: center;
}
.selectStepContainer{
justify-content: space-between;
padding: 20rpx 20rpx 0;
background-color: #fff;
}
.stepContent{
display: flex;
align-items: center;
border-bottom: 1px solid #e4e4e4;
padding: 0 5px;
}
.selectStepContainer button{
background-color: transparent;
}
.selectStepContainer button::after{
border: 1px solid #CEB07D;
}
.optionContent{
position: fixed;
bottom: 0;
left: 0;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
background-color: #fff;
}
.optionContent button{
flex: 0 0 46%;
border:2rpx solid #e7c793;
color: #6B4000;
font-size: 36rpx;
}
.optionContent button:last-child{
background: linear-gradient(135deg, #CEB07D 0%, #FFDDA9 56%, #FED495 100%, #FED495 100%);
border: none;
}
</style> </style>
\ No newline at end of file
import api from "../api/api"; import api from "../api/api";
import {baseURL,apiURL,sfpURL} from "../environments/environment"; import {baseURL,apiURL,sfpURL} from "../environments/environment";
// 白名单,不需要携带token就允许被访问的接口 // 白名单,不需要携带token就允许被访问的接口
<<<<<<< HEAD
const whiteApiList = ['/api/authorize/obtainToken'] const whiteApiList = ['/api/authorize/obtainToken']
=======
const whiteApiList = [`/api/authorize/obtainToken`]
>>>>>>> 20eb17e444fb451ad26e91c66292178c8cb3acd4
export const interceptor = () => { export const interceptor = () => {
......
export function numberToCurrencyNo(value) {
if (!value) return 0
// 获取整数部分
const intPart = Math.trunc(value)
// 整数部分处理,增加,
const intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
// 预定义小数部分
let floatPart = ''
// 将数值截取为小数部分和整数部分
const valueArray = value.toString().split('.')
if (valueArray.length === 2) { // 有小数部分
floatPart = valueArray[1].toString() // 取得小数部分
return intPartFormat + '.' + floatPart
}
return intPartFormat + floatPart
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment