提交 b2e37b47 authored 作者: 黄旭新's avatar 黄旭新

xin

上级 78b4df58
......@@ -5,8 +5,8 @@
<image src="../../static/images/my_bg.jpg" mode="widthFix"></image>
<!-- 客服平台公告 -->
<view class="kfgg">
<button open-type="contact"><image src="../../static/images/icons/kf.svg" mode=""></image></button>
<image @click="notice" src="../../static/images/icons/ld.svg" mode=""></image>
<button open-type="contact"><image src="https://fire.huoshitou.net/profile/icon/kf.png" mode=""></image></button>
<image @click="notice" src="https://fire.huoshitou.net/profile/icon/ld.png" mode=""></image>
</view>
<!-- 头部区域 -->
<view class="myInfo_user">
......@@ -50,17 +50,19 @@
<view class="myInfo">
<!-- 海报区域 -->
<view class="myInfo_poster" v-if="type == 2 || iscreate" @click="linkposter">
<image src="../../static/images/index/banner.jpg" mode="widthFix"></image>
<image src="https://fire.huoshitou.net/profile/icon/mybanner.png" mode="widthFix"></image>
</view>
<!-- 收益区域 -->
<view class="myInfo_earnings myInfo_commons">
<view class="myInfo_items" v-for="(item,index) in earningsList" :key="index"
@click="linkToEarnings(index)">
{{item.name}}
<view class="text"><text v-if="item.others!='null'">{{item.others}}</text></view>
<view class="myInfo_block">
<view class="myInfo_block_title">我的收益</view>
<view class="myInfo_earnings myInfo_commons">
<view class="myInfo_items" v-for="(item,index) in earningsList" :key="index"
@click="linkToEarnings(index)">
{{item.name}}
<view class="text"><text v-if="item.others!='null'">{{item.others}}</text></view>
</view>
</view>
</view>
<view class="jianju"></view>
<!-- 个人区域 -->
<view class="myInfo_personage myInfo_commons" v-if="personageList.length != 0">
<view class="myInfo_items" v-for="(i,index) in personageList" :key="index"
......@@ -69,9 +71,6 @@
<view class="text"><text v-if="i.others!=''">{{i.others}}</text></view>
</view>
</view>
<view class="jianju"></view>
<!-- ++++++++++++++++ -->
<tab-bar :activeIndex="tabbarIndex"></tab-bar>
......@@ -744,6 +743,9 @@
</script>
<style lang="scss">
.mypage,page{
background: #F5F5F5;
}
.myInfo_navigation {
width: 100%;
position: relative;
......@@ -751,8 +753,8 @@
image {
width: 100%;
display: block;
border-radius:0 0 20% 20%;
}
.kfgg{
display: flex;
flex-direction: row;
......@@ -762,7 +764,7 @@
width: 90%;
left: 5%;
position: absolute;
bottom: 198rpx;
bottom: 184rpx;
z-index: 100;
button{
background-color: transparent;
......@@ -778,8 +780,16 @@
height: 38rpx;
}
image:nth-last-child(1){
margin-left: 20rpx;
margin-left: 26rpx;
margin-right: 4rpx;
width: 48rpx;
height: 48rpx;
}
button image:nth-last-child(1){
margin-left: 0;
margin-right: 0;
width: 40rpx;
height: 40rpx;
}
}
......@@ -803,11 +813,12 @@
align-items: center;
justify-content: space-between;
padding: 32rpx;
bottom: 0rpx;
bottom: -18rpx;
position: absolute;
height: 180rpx;
background: linear-gradient(180deg, #FFFFFF 76.73%, #E6EDF2 95.39%);
border-radius: 16px 16px 0px 0px;
background-color: #fff;
border-radius: 10rpx;
box-shadow: 0px 3px 3px rgba(0, 0, 0, 0.16);
.user_img {
width: 100rpx;
......@@ -863,8 +874,23 @@
.myInfo {
padding: 32rpx;
.myInfo_block{
background-color: #fff;
margin: 20rpx 0;
border-radius: 10rpx;
padding: 12rpx 22rpx;
}
.myInfo_block_title{
color: #2FA1F7;
font-size: 32rpx;
text-indent: 16rpx;
margin-bottom: 18rpx;
}
.myInfo_poster {
padding-top: 10rpx;
image {
width: 100%;
display: block;
......@@ -880,12 +906,11 @@
}
.myInfo_commons {
padding: 32rpx;
background-color: #fff;
display: flex;
flex-direction: row;
flex-wrap: wrap;
background-color: #ccc;
border-radius: 10rpx;
}
......@@ -910,7 +935,7 @@
.myInfo_items {
width: 33%;
color: #333;
font-size: 30rpx;
font-size: 28rpx;
font-weight: 500;
display: flex;
height: 111rpx;
......@@ -940,8 +965,9 @@
}
.text {
padding-top: 24rpx;
text {
font-size: 28rpx;
font-size: 32rpx;
color: #1989FA;
}
}
......
......@@ -31,14 +31,16 @@
</view>
<view class="LssueContracts_item">
合同开始时间
<picker class="picker" mode="date" fields="month" :start="startDate" :end="endDate" @change="bindStartDateChange">
<picker class="picker" mode="date" fields="month" :start="startDate" :end="endDate"
@change="bindStartDateChange">
<view class="uni-input">{{contractStartTime ? contractStartTime : '请选择开始时间'}}</view>
<image src="../../../static/images/right.png" mode=""></image>
</picker>
</view>
<view class="LssueContracts_item">
合同结束时间
<picker class="picker" mode="date" fields="year" :start="startDate" :end="endDate" @change="bindEndDateChange">
<picker class="picker" mode="date" fields="year" :start="startDate" :end="endDate"
@change="bindEndDateChange">
<view class="uni-input">{{contractEndTime ? contractEndTime : '请选择结束时间'}}</view>
<image src="../../../static/images/right.png" mode=""></image>
</picker>
......@@ -62,38 +64,20 @@
} from '@/static/util/fun.js'
export default {
onLoad(options) {
this.contractId = options.id
if (this.contractId) {
// 编辑合同的数据回显
get(api.issueContract, {
id: this.contractId
}).then(res => {
console.log(res.data)
if (res.code == 200) {
this.contractA = res.data.contractA
this.companyValue = res.data.ename
// console.log(this.companys)
let arr = this.companys.filter(item => {
if (item.eName == this.companyValue) {
return item.userId
}
})
console.log(arr)
this.userId = arr[0].userId
this.electricity = res.data.electricity
this.contractStartTime = res.data.contractStartTime.replace(new RegExp('-', 'g'), '/')
this.contractEndTime = res.data.contractEndTime.replace(new RegExp('-', 'g'), '/')
this.contractType = res.data.contractType
if (this.contractType == 1) {
this.typeValue = '固定价差'
this.fixedSpread = res.data.fixedSpread
} else {
this.typeValue = '月竞分成'
this.shareRatio = res.data.shareRatio
}
let that = this
that.contractId = options.id
// 售电公司列表
get(api.electricitySalesCompaniesList).then(res => {
if (res.code == 200) {
console.log('获取售电公司列表')
that.companys = res.data
that.companyOptions = res.data.map(item => item.eName)
console.log(that.companys)
if (that.contractId) {
that.datashow()
}
})
}
}
})
},
created() {
this.electricId = uni.getStorageSync('user').electricId
......@@ -141,9 +125,43 @@
let year = new Date().getFullYear() + 10
return year + '-12-31'
}
},
methods: {
//数据回显
datashow() {
let that = this
// 编辑合同的数据回显
get(api.issueContract, {
id: that.contractId
}).then(res => {
console.log('获取合同信息')
console.log(res.data)
if (res.code == 200) {
that.contractA = res.data.contractA
that.companyValue = res.data.ename
// console.log(that.companys)
for (let i = 0; i < that.companys.length; i++) {
if (that.companys[i].eName == that.companyValue) {
console.log(that.companys[i].userId)
that.userId = that.companys[i].userId
}
}
console.log(that.userId)
that.electricity = res.data.electricity
that.contractStartTime = res.data.contractStartTime.replace(new RegExp('-', 'g'), '/')
that.contractEndTime = res.data.contractEndTime.replace(new RegExp('-', 'g'), '/')
that.contractType = res.data.contractType
if (that.contractType == 1) {
that.typeValue = '固定价差'
that.fixedSpread = res.data.fixedSpread
} else {
that.typeValue = '月竞分成'
that.shareRatio = res.data.shareRatio
}
}
})
},
//选择合同类型
bindTypeChange(event) {
// console.log(event)
......@@ -178,12 +196,12 @@
},
//选择合同结束时间
bindEndDateChange(e) {
if(this.contractStartTime.split('/')[0]>e.detail.value){
if (this.contractStartTime.split('/')[0] > e.detail.value) {
uni.showToast({
title:'合同开始时间不能大于合同结束时间',
icon:'none'
title: '合同开始时间不能大于合同结束时间',
icon: 'none'
})
}else{
} else {
this.contractEndTime = e.detail.value + '/12/31'
}
},
......@@ -269,8 +287,8 @@
}, 500)
} else {
uni.showToast({
title:res.msg,
icon:'none'
title: res.msg,
icon: 'none'
})
this.flag = true
}
......@@ -293,7 +311,7 @@
return '请输入合同的甲方'
} else if (arr[2] == '') {
return '请选择合同的乙方'
} else if (arr[3] == ''|| isNaN(arr[3])) {
} else if (arr[3] == '' || isNaN(arr[3])) {
return '请输入合同的电量'
} else if (arr[4] == '') {
return '请选择合同的开始时间'
......@@ -378,6 +396,7 @@
background-color: #1989fa;
border-radius: 16rpx;
}
.addContracts_btn {
position: absolute;
left: 50%;
......
......@@ -191,7 +191,6 @@ __webpack_require__.r(__webpack_exports__);
......@@ -298,9 +297,9 @@ var _api = _interopRequireDefault(__webpack_require__(/*! ../../static/util/api.
//
//
//
//
var app = getApp();var _default = { data: function data() {return { // 收益区域
earningsList: [], earningsList_dianke: [{ id: 1, name: '现货收益', others: '', url: '/pages/Earnings/CashEarnings/CashEarnings' }, { id: 2, name: '居间收益', others: '', url: '/pages/Earnings/IntermediateEarings/IntermediateEarings' }, { id: 3, name: '佣金收益', others: '', url: '/pages/Earnings/commissionEarnings/commissionEarnings' }, { id: 4, name: '存量居间收益', others: '', url: '/pages/Earnings/betweenEarnings/betweenEarnings' }, { id: 5, name: '待确认收益', others: '', url: '/pages/Earnings/affirmEarnings/affirmEarnings' }, { id: 6, name: '发票管理', others: 'null', url: '/pages/Invoice/invoice' }], earningsList_gaoji: [{ id: 1, name: '企业优惠金额', others: '', limit: 'corporateDiscount', url: '/pages/Earnings/DiscountsMoney/DiscountsMoney' }, { id: 2, name: '现货收益', others: '', limit: 'spotIncome', url: '/pages/Earnings/CashEarnings/CashEarnings' }, { id: 3, name: '待确认收益', others: '', limit: 'pendingIncome', url: '/pages/Earnings/affirmEarnings/affirmEarnings' }, { id: 4, name: '发票管理', others: 'null', limit: 'invoiceManagement', url: '/pages/Invoice/invoice' }, { id: 5, name: '零售结算联系单', others: 'null', limit: 'retailSettlementForm', url: '/pages/myInfo/retailTrade' }], earningsList_zhongji: [{ id: 1, name: '企业优惠金额',
earningsList: [], earningsList_dianke: [{ id: 1, name: '现货收益', others: '', url: '/pages/Earnings/CashEarnings/CashEarnings' }, { id: 2, name: '居间收益', others: '', url: '/pages/Earnings/IntermediateEarings/IntermediateEarings' }, { id: 3, name: '佣金收益', others: '', url: '/pages/Earnings/commissionEarnings/commissionEarnings' }, { id: 4, name: '存量居间收益', others: '', url: '/pages/Earnings/betweenEarnings/betweenEarnings' }, { id: 5, name: '待确认收益', others: '', url: '/pages/Earnings/affirmEarnings/affirmEarnings' }, { id: 6, name: '发票管理', others: 'null', url: '/pages/Invoice/invoice' }], earningsList_gaoji: [{ id: 1, name: '企业优惠金额', others: '', limit: 'corporateDiscount', url: '/pages/Earnings/DiscountsMoney/DiscountsMoney' }, { id: 2, name: '现货收益', others: '', limit: 'spotIncome', url: '/pages/Earnings/CashEarnings/CashEarnings' }, { id: 3, name: '待确认收益', others: '', limit: 'pendingIncome', url: '/pages/Earnings/affirmEarnings/affirmEarnings' }, { id: 4, name: '发票管理', others: 'null', limit: 'invoiceManagement', url: '/pages/Invoice/invoice' }, { id: 5, name: '零售结算联系单', others: 'null', limit: 'retailSettlementForm', url: '/pages/myInfo/retailTrade' }], earningsList_zhongji: [{ id: 1,
name: '企业优惠金额',
others: '',
limit: 'corporateDiscount',
url: '/pages/Earnings/DiscountsMoney/DiscountsMoney' },
......
<view class="mypage"><view class="myInfo_navigation"><text class="myInfo_navigation_title" style="{{'top:'+(statusBarHeight+'rpx')+';'}}">我的</text><image src="../../static/images/my_bg.jpg" mode="widthFix"></image><view class="kfgg"><button open-type="contact"><image src="../../static/images/icons/kf.svg" mode></image></button><image src="../../static/images/icons/ld.svg" mode data-event-opts="{{[['tap',[['notice',['$event']]]]]}}" bindtap="__e"></image></view><view class="myInfo_user"><image class="user_img" src="../../static/images/index/group.png" mode="scaleToFill"></image><view class="user_info"><block wx:if="{{isAuthenticate==2}}"><view class="user_info_name">{{''+certificationName+''}}</view></block><block wx:else><view class="user_info_name">{{''+wxName+''}}</view></block><block wx:if="{{type==2}}"><view class="user_info_code">{{'邀请码: '+(inviteCode?inviteCode:'需实名认证')+''}}<text data-event-opts="{{[['tap',[['getInviteCode']]]]}}" class="item-btn" bindtap="__e">复制</text></view></block><block wx:if="{{type==1&&iscreate}}"><view class="credit">{{'信用分: '+credit+''}}</view></block></view><block wx:if="{{isuser}}"><view data-event-opts="{{[['tap',[['linkto',['$event']]]]]}}" class="authentication" bindtap="__e"><block wx:if="{{isAuthenticate==0}}"><text>未认证</text></block><block wx:if="{{isAuthenticate==1}}"><text>认证失败</text></block><block wx:if="{{isAuthenticate==2}}"><text>已认证</text></block><block wx:if="{{isAuthenticate==3}}"><text>待审核</text></block><image src="../../static/images/right.png" mode></image></view></block><block wx:if="{{!isuser}}"><view data-event-opts="{{[['tap',[['tologin',['$event']]]]]}}" class="authentication" bindtap="__e"><text>未登录</text><image src="../../static/images/right.png" mode></image></view></block></view></view><view class="myInfo"><block wx:if="{{type==2||iscreate}}"><view data-event-opts="{{[['tap',[['linkposter',['$event']]]]]}}" class="myInfo_poster" bindtap="__e"><image src="../../static/images/index/banner.jpg" mode="widthFix"></image></view></block><view class="myInfo_earnings myInfo_commons"><block wx:for="{{earningsList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['linkToEarnings',[index]]]]]}}" class="myInfo_items" bindtap="__e">{{''+item.name+''}}<view class="text"><block wx:if="{{item.others!='null'}}"><text>{{item.others}}</text></block></view></view></block></view><view class="jianju"></view><block wx:if="{{personageList.length!=0}}"><view class="myInfo_personage myInfo_commons"><block wx:for="{{personageList}}" wx:for-item="i" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['linkToPersonage',[index]]]]]}}" class="myInfo_items" bindtap="__e">{{''+i.name+''}}<view class="text"><block wx:if="{{i.others!=''}}"><text>{{i.others}}</text></block></view></view></block></view></block><view class="jianju"></view><tab-bar vue-id="5dcf2140-1" activeIndex="{{tabbarIndex}}" bind:__l="__l"></tab-bar></view></view>
\ No newline at end of file
<view class="mypage"><view class="myInfo_navigation"><text class="myInfo_navigation_title" style="{{'top:'+(statusBarHeight+'rpx')+';'}}">我的</text><image src="../../static/images/my_bg.jpg" mode="widthFix"></image><view class="kfgg"><button open-type="contact"><image src="https://fire.huoshitou.net/profile/icon/kf.png" mode></image></button><image src="https://fire.huoshitou.net/profile/icon/ld.png" mode data-event-opts="{{[['tap',[['notice',['$event']]]]]}}" bindtap="__e"></image></view><view class="myInfo_user"><image class="user_img" src="../../static/images/index/group.png" mode="scaleToFill"></image><view class="user_info"><block wx:if="{{isAuthenticate==2}}"><view class="user_info_name">{{''+certificationName+''}}</view></block><block wx:else><view class="user_info_name">{{''+wxName+''}}</view></block><block wx:if="{{type==2}}"><view class="user_info_code">{{'邀请码: '+(inviteCode?inviteCode:'需实名认证')+''}}<text data-event-opts="{{[['tap',[['getInviteCode']]]]}}" class="item-btn" bindtap="__e">复制</text></view></block><block wx:if="{{type==1&&iscreate}}"><view class="credit">{{'信用分: '+credit+''}}</view></block></view><block wx:if="{{isuser}}"><view data-event-opts="{{[['tap',[['linkto',['$event']]]]]}}" class="authentication" bindtap="__e"><block wx:if="{{isAuthenticate==0}}"><text>未认证</text></block><block wx:if="{{isAuthenticate==1}}"><text>认证失败</text></block><block wx:if="{{isAuthenticate==2}}"><text>已认证</text></block><block wx:if="{{isAuthenticate==3}}"><text>待审核</text></block><image src="../../static/images/right.png" mode></image></view></block><block wx:if="{{!isuser}}"><view data-event-opts="{{[['tap',[['tologin',['$event']]]]]}}" class="authentication" bindtap="__e"><text>未登录</text><image src="../../static/images/right.png" mode></image></view></block></view></view><view class="myInfo"><block wx:if="{{type==2||iscreate}}"><view data-event-opts="{{[['tap',[['linkposter',['$event']]]]]}}" class="myInfo_poster" bindtap="__e"><image src="https://fire.huoshitou.net/profile/icon/mybanner.png" mode="widthFix"></image></view></block><view class="myInfo_block"><view class="myInfo_block_title">我的收益</view><view class="myInfo_earnings myInfo_commons"><block wx:for="{{earningsList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['linkToEarnings',[index]]]]]}}" class="myInfo_items" bindtap="__e">{{''+item.name+''}}<view class="text"><block wx:if="{{item.others!='null'}}"><text>{{item.others}}</text></block></view></view></block></view></view><block wx:if="{{personageList.length!=0}}"><view class="myInfo_personage myInfo_commons"><block wx:for="{{personageList}}" wx:for-item="i" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['linkToPersonage',[index]]]]]}}" class="myInfo_items" bindtap="__e">{{''+i.name+''}}<view class="text"><block wx:if="{{i.others!=''}}"><text>{{i.others}}</text></block></view></view></block></view></block><tab-bar vue-id="5dcf2140-1" activeIndex="{{tabbarIndex}}" bind:__l="__l"></tab-bar></view></view>
\ No newline at end of file
......@@ -24,6 +24,9 @@
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.mypage, page {
background: #F5F5F5;
}
.myInfo_navigation {
width: 100%;
position: relative;
......@@ -31,6 +34,8 @@
.myInfo_navigation image {
width: 100%;
display: block;
-webkit-border-radius: 0 0 20% 20%;
border-radius: 0 0 20% 20%;
}
.myInfo_navigation .kfgg {
display: -webkit-box;
......@@ -50,7 +55,7 @@
width: 90%;
left: 5%;
position: absolute;
bottom: 198rpx;
bottom: 184rpx;
z-index: 100;
}
.myInfo_navigation .kfgg button {
......@@ -67,8 +72,16 @@
height: 38rpx;
}
.myInfo_navigation .kfgg image:nth-last-child(1) {
margin-left: 20rpx;
margin-left: 26rpx;
margin-right: 4rpx;
width: 48rpx;
height: 48rpx;
}
.myInfo_navigation .kfgg button image:nth-last-child(1) {
margin-left: 0;
margin-right: 0;
width: 40rpx;
height: 40rpx;
}
.myInfo_navigation .myInfo_navigation_title {
width: 100%;
......@@ -95,14 +108,14 @@
-webkit-justify-content: space-between;
justify-content: space-between;
padding: 32rpx;
bottom: 0rpx;
bottom: -18rpx;
position: absolute;
height: 180rpx;
background: -webkit-gradient(linear, left top, left bottom, color-stop(76.73%, #FFFFFF), color-stop(95.39%, #E6EDF2));
background: -webkit-linear-gradient(top, #FFFFFF 76.73%, #E6EDF2 95.39%);
background: linear-gradient(180deg, #FFFFFF 76.73%, #E6EDF2 95.39%);
-webkit-border-radius: 16px 16px 0px 0px;
border-radius: 16px 16px 0px 0px;
background-color: #fff;
-webkit-border-radius: 10rpx;
border-radius: 10rpx;
-webkit-box-shadow: 0px 3px 3px rgba(0, 0, 0, 0.16);
box-shadow: 0px 3px 3px rgba(0, 0, 0, 0.16);
}
.myInfo_navigation .myInfo_user .user_img {
width: 100rpx;
......@@ -154,6 +167,22 @@
.myInfo {
padding: 32rpx;
}
.myInfo .myInfo_block {
background-color: #fff;
margin: 20rpx 0;
-webkit-border-radius: 10rpx;
border-radius: 10rpx;
padding: 12rpx 22rpx;
}
.myInfo .myInfo_block_title {
color: #2FA1F7;
font-size: 32rpx;
text-indent: 16rpx;
margin-bottom: 18rpx;
}
.myInfo .myInfo_poster {
padding-top: 10rpx;
}
.myInfo .myInfo_poster image {
width: 100%;
display: block;
......@@ -167,7 +196,6 @@
margin-left: -32rpx;
}
.myInfo .myInfo_commons {
padding: 32rpx;
background-color: #fff;
display: -webkit-box;
display: -webkit-flex;
......@@ -178,7 +206,8 @@
flex-direction: row;
-webkit-flex-wrap: wrap;
flex-wrap: wrap;
background-color: #ccc;
-webkit-border-radius: 10rpx;
border-radius: 10rpx;
}
.myInfo .myInfo_items:nth-last-child(1) .hexian {
display: none;
......@@ -197,7 +226,7 @@
.myInfo .myInfo_items {
width: 33%;
color: #333;
font-size: 30rpx;
font-size: 28rpx;
font-weight: 500;
display: -webkit-box;
display: -webkit-flex;
......@@ -233,8 +262,11 @@
position: absolute;
bottom: 0;
}
.myInfo .myInfo_items .text {
padding-top: 24rpx;
}
.myInfo .myInfo_items .text text {
font-size: 28rpx;
font-size: 32rpx;
color: #1989FA;
}
.myInfo .official {
......
......@@ -166,6 +166,8 @@ __webpack_require__.r(__webpack_exports__);
......@@ -244,9 +246,10 @@ var _fun = __webpack_require__(/*! @/static/util/fun.js */ 50);function _interop
//
//
//
var _default = { onLoad: function onLoad(options) {var _this = this;this.contractId = options.id;if (this.contractId) {// 编辑合同的数据回显
(0, _fun.get)(_api.default.issueContract, { id: this.contractId }).then(function (res) {console.log(res.data);if (res.code == 200) {_this.contractA = res.data.contractA;_this.companyValue = res.data.ename; // console.log(this.companys)
var arr = _this.companys.filter(function (item) {if (item.eName == _this.companyValue) {return item.userId;}});console.log(arr);_this.userId = arr[0].userId;_this.electricity = res.data.electricity;_this.contractStartTime = res.data.contractStartTime.replace(new RegExp('-', 'g'), '/');_this.contractEndTime = res.data.contractEndTime.replace(new RegExp('-', 'g'), '/');_this.contractType = res.data.contractType;if (_this.contractType == 1) {_this.typeValue = '固定价差';_this.fixedSpread = res.data.fixedSpread;} else {_this.typeValue = '月竞分成';_this.shareRatio = res.data.shareRatio;}}});}}, created: function created() {var _this2 = this;this.electricId = uni.getStorageSync('user').electricId;(0, _fun.get)(_api.default.electricitySalesCompaniesList).then(function (res) {if (res.code == 200) {_this2.companys = res.data;_this2.companyOptions = res.data.map(function (item) {return item.eName;});}});}, data: function data() {return { contractId: '', //合同id
//
//
var _default = { onLoad: function onLoad(options) {var that = this;that.contractId = options.id; // 售电公司列表
(0, _fun.get)(_api.default.electricitySalesCompaniesList).then(function (res) {if (res.code == 200) {console.log('获取售电公司列表');that.companys = res.data;that.companyOptions = res.data.map(function (item) {return item.eName;});console.log(that.companys);if (that.contractId) {that.datashow();}}});}, created: function created() {var _this = this;this.electricId = uni.getStorageSync('user').electricId;(0, _fun.get)(_api.default.electricitySalesCompaniesList).then(function (res) {if (res.code == 200) {_this.companys = res.data;_this.companyOptions = res.data.map(function (item) {return item.eName;});}});}, data: function data() {return { contractId: '', //合同id
contractType: '', //合同类型 1-固定价差, 3-月竞分成
contractA: '', //合同甲方
userId: null, //售电公司id
......@@ -261,21 +264,36 @@ var _default = { onLoad: function onLoad(options) {var _this = this;this.contrac
companyValue: '', //乙方公司(售电公司)
companys: '', //后台返回的售电公司列表
companyOptions: [] //处理后的售电公司列表
};}, computed: { startDate: function startDate() {var year = new Date().getFullYear();var month = new Date().getMonth() + 1;var day = new Date().getDay();if (month == 13) {
year = year + 1;
month = 1;
}
month = month > 9 ? month : '0' + month;
day = day > 9 ? day : '0' + day;
return year + '-' + month + '-' + day;
};}, computed: { startDate: function startDate() {var year = new Date().getFullYear();var month = new Date().getMonth() + 1;var day = new Date().getDay();if (month == 13) {year = year + 1;month = 1;}month = month > 9 ? month : '0' + month;day = day > 9 ? day : '0' + day;return year + '-' + month + '-' + day;}, endDate: function endDate() {var year = new Date().getFullYear() + 10;return year + '-12-31';} }, methods: { //数据回显
datashow: function datashow() {var that = this; // 编辑合同的数据回显
(0, _fun.get)(_api.default.issueContract, { id: that.contractId }).then(function (res) {
console.log('获取合同信息');
console.log(res.data);
if (res.code == 200) {
that.contractA = res.data.contractA;
that.companyValue = res.data.ename;
// console.log(that.companys)
for (var i = 0; i < that.companys.length; i++) {
if (that.companys[i].eName == that.companyValue) {
console.log(that.companys[i].userId);
that.userId = that.companys[i].userId;
}
}
console.log(that.userId);
that.electricity = res.data.electricity;
that.contractStartTime = res.data.contractStartTime.replace(new RegExp('-', 'g'), '/');
that.contractEndTime = res.data.contractEndTime.replace(new RegExp('-', 'g'), '/');
that.contractType = res.data.contractType;
if (that.contractType == 1) {
that.typeValue = '固定价差';
that.fixedSpread = res.data.fixedSpread;
} else {
that.typeValue = '月竞分成';
that.shareRatio = res.data.shareRatio;
}
}
});
},
endDate: function endDate() {
var year = new Date().getFullYear() + 10;
return year + '-12-31';
} },
methods: {
//选择合同类型
bindTypeChange: function bindTypeChange(event) {
// console.log(event)
......@@ -291,11 +309,11 @@ var _default = { onLoad: function onLoad(options) {var _this = this;this.contrac
},
//选择乙方公司
bindCompanyChange: function bindCompanyChange(event) {var _this3 = this;
bindCompanyChange: function bindCompanyChange(event) {var _this2 = this;
var i = event.detail.value;
this.companyValue = this.companyOptions[i];
var arr = this.companys.filter(function (item) {
if (item.eName == _this3.companyValue) {
if (item.eName == _this2.companyValue) {
return item.userId;
}
});
......@@ -320,7 +338,7 @@ var _default = { onLoad: function onLoad(options) {var _this = this;this.contrac
}
},
// 保存合同
submit: function submit() {var _this4 = this;var _this$$data =
submit: function submit() {var _this3 = this;var _this$$data =
......@@ -404,7 +422,7 @@ var _default = { onLoad: function onLoad(options) {var _this = this;this.contrac
title: res.msg,
icon: 'none' });
_this4.flag = true;
_this3.flag = true;
}
});
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论