瀏覽代碼

优化收入等级代码

master
liuminjian 3 年之前
父節點
當前提交
756ce393e0
共有 3 個檔案被更改,包括 68 行新增74 行删除
  1. +18
    -10
      pages/inCome/inCome.js
  2. +4
    -12
      pages/inCome/inCome.json
  3. +46
    -52
      pages/inCome/inCome.wxml

+ 18
- 10
pages/inCome/inCome.js 查看文件

@@ -32,11 +32,16 @@ Page({
qtPics:[], //其他图片列表数据 qtPics:[], //其他图片列表数据
//收入时间弹窗显隐 //收入时间弹窗显隐
srShow:false, srShow:false,
minDate: new Date(2018, 0, 1).getTime(),
maxDate: new Date(2025, 0, 31).getTime(),
minDate: new Date(2021, 6, 1).getTime(),
maxDate: new Date(2023, 0, 31).getTime(),
crzhShow:false, crzhShow:false,
accountListOptions:[] //存入账户类型选项
accountListOptions:[], //存入账户类型选项
crlxShow:false, //收入类型弹窗显隐
}, },
onCancelcrlx(){
this.setData({crlxShow:false,})
},
oncrlxShow(){ this.setData({crlxShow:true})},
onCancelcrzh(){ onCancelcrzh(){
this.setData({crzhShow:false}) this.setData({crzhShow:false})
}, },
@@ -84,8 +89,10 @@ Page({
this.setData({showHt:true}) this.setData({showHt:true})
}, },
bindPickerChange (e) { bindPickerChange (e) {
let obj = this.data.incomeTypeOptions[e.detail.value];
let obj = e.detail.value;

this.setData({ this.setData({
crlxShow:false,
'formData.incomeType':obj.dictValue, 'formData.incomeType':obj.dictValue,
incomeTypeText:obj.dictLabel incomeTypeText:obj.dictLabel
}) })
@@ -111,13 +118,9 @@ Page({
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onReady: function () {
onReady: function () {
let that = this; let that = this;
//初始化收入时间
this.setData({
'formData.accountDate':UTIL.formatDate(new Date())
})

//获取收入单位 //获取收入单位
UTIL.httpRequest(API.URL_GET_GETINFO, {method:'GET'}, { UTIL.httpRequest(API.URL_GET_GETINFO, {method:'GET'}, {
success: (res) => { success: (res) => {
@@ -326,6 +329,11 @@ Page({
} }
}) })
},
onChange(event){
this.setData({
[event.currentTarget.dataset.value]: event.detail,
})
}, },
imgPreviewImage(e){ imgPreviewImage(e){


+ 4
- 12
pages/inCome/inCome.json 查看文件

@@ -1,22 +1,14 @@
{ {
"navigationStyle": "custom",
"usingComponents": { "usingComponents": {
"van-row": "@vant/weapp/row/index",
"van-col": "@vant/weapp/col/index",

"van-cell": "@vant/weapp/cell/index", "van-cell": "@vant/weapp/cell/index",
"van-cell-group": "@vant/weapp/cell-group/index", "van-cell-group": "@vant/weapp/cell-group/index",
"van-tag": "@vant/weapp/tag/index",
"van-icon": "@vant/weapp/icon/index", "van-icon": "@vant/weapp/icon/index",
"van-steps": "@vant/weapp/steps/index",
"van-button": "@vant/weapp/button/index",
"van-radio": "@vant/weapp/radio/index",
"van-radio-group": "@vant/weapp/radio-group/index",
"van-field": "@vant/weapp/field/index", "van-field": "@vant/weapp/field/index",
"van-popup": "@vant/weapp/popup/index", "van-popup": "@vant/weapp/popup/index",
"van-picker": "@vant/weapp/picker/index", "van-picker": "@vant/weapp/picker/index",
"van-calendar": "@vant/weapp/calendar/index",
"van-dialog": "@vant/weapp/dialog/index",
"van-collapse": "@vant/weapp/collapse/index",
"van-collapse-item": "@vant/weapp/collapse-item/index"
"van-calendar": "@vant/weapp/calendar/index"


} }
} }

+ 46
- 52
pages/inCome/inCome.wxml 查看文件

@@ -1,11 +1,12 @@
<!--pages/apply/index.wxml--> <!--pages/apply/index.wxml-->
<view class="ns" style="height:{{isIPX?'88px':'64px'}};"> <view class="ns" style="height:{{isIPX?'88px':'64px'}};">
<image src="../../image/apply/back.png" style="top:{{isIPX?'54px':'30px'}};" mode="widthFix" bindtap="back"></image>
<image src="/image/apply/back.png" style="top:{{isIPX?'54px':'30px'}};" mode="widthFix" bindtap="back"></image>
<text style="top:{{isIPX?'54px':'30px'}};">收入登记</text> <text style="top:{{isIPX?'54px':'30px'}};">收入登记</text>
</view> </view>
<!-- 付款单位开始 --> <!-- 付款单位开始 -->
<view class="top" style="margin-top:{{isIPX?'100px':'75px'}};"> <view class="top" style="margin-top:{{isIPX?'100px':'75px'}};">
<image src="../../image/apply/dress_icon.png" mode="widthFix"></image>
<image src="/image/apply/dress_icon.png" mode="widthFix"></image>
<view class="top-tit">收入单位</view> <view class="top-tit">收入单位</view>
<view class="top-title">{{bookName}}</view> <view class="top-title">{{bookName}}</view>
</view> </view>
@@ -13,31 +14,28 @@
<text>基础信息</text> <text>基础信息</text>
</view> </view>
<view class="main-box table-box"> <view class="main-box table-box">
<view class="flex-block">
<text class="rules">收入时间</text>
<view class="wrap" bindtap="onsrDate" >
{{formData.accountDate}}
</view>
<van-calendar
<van-field readonly label="收入时间" value="{{formData.accountDate }}"
placeholder="请选择收入时间" border="{{ false }}" input-align="right" is-link arrow-direction ="down"
bindtap="onsrDate" required="{{true}}"
/>
<van-calendar
show="{{ srShow }}" show="{{ srShow }}"
min-date="{{ minDate }}" min-date="{{ minDate }}"
max-date="{{ maxDate }}" max-date="{{ maxDate }}"
bind:close="onClose" bind:close="onClose"
bind:confirm="onConfirm" bind:confirm="onConfirm"
/> />
</view>
<view class="flex-block">
<text class="rules">收入金额</text>
<input class="wrap" data-prop="formData.jieAmount" type="number" value="{{formData.jieAmount}}" bindinput="inputChange" placeholder="请输入收入金额"/>
</view>
<view class="flex-block"><text class="rules">存入账户</text>
<!-- <input class="wrap" type="number" bindinput="inputChange" data-prop="formData.accountName" value="{{formData.accountName}}" placeholder="请输入存入账户"/> -->
<view bindtap="oncrzhShow" class="wrap">
<text wx:if="{{formData.accountName==''}}" class="color-gray">请选择存入账户</text>
<text wx:else>{{formData.accountName}}</text>
</view>
<!-- custom-style="height: 20%;"-->

<van-field type="number" data-value="formData.jieAmount" required="{{true}}" label="收入金额" value="{{ formData.jieAmount }}" placeholder="请输入收入金额" border="{{ false }}" bind:change="onChange" input-align="right"/>


<van-field readonly label="存入账户" value="{{formData.accountName }}"
placeholder="请选择存入账户" border="{{ false }}" input-align="right" is-link arrow-direction ="down"
bindtap="oncrzhShow" required="{{true}}"
/>
<van-popup <van-popup
show="{{ crzhShow }}" show="{{ crzhShow }}"
position="bottom" position="bottom"
@@ -46,38 +44,42 @@
<van-picker columns="{{ accountListOptions }}" value-key="accountName" bind:cancel="onCancelcrzh" <van-picker columns="{{ accountListOptions }}" value-key="accountName" bind:cancel="onCancelcrzh"
show-toolbar="{{true}}" show-toolbar="{{true}}"
bind:confirm="onConfirmcrzh"/> bind:confirm="onConfirmcrzh"/>

</van-popup> </van-popup>


</view>
<view class="flex-block"><text class="rules">收入类型</text>
<picker bindchange="bindPickerChange" class="wrap picker_wrap"
value="{{incomeTypeText}}"
range="{{incomeTypeOptions}}"
range-key="dictLabel">
<view class="picker">
{{incomeTypeText}}
</view>
</picker>
</view>
<view class="flex-block"><text class="rules">单据编码</text> <input class="wrap" type="number" bindinput="inputChange" data-prop="formData.billNum" value="{{formData.billNum}}" placeholder="请输入单据编码"/></view>
<view class="flex-block"><text class="rules">备注说明</text> <input class="wrap" type="number" bindinput="inputChange" data-prop="formData.accountSummary" placeholder="请输入备注说明" value="{{formData.accountSummary}}"/></view>
<van-field readonly label="收入类型" value="{{incomeTypeText}}"
placeholder="请选择收入类型" border="{{ false }}" input-align="right" is-link arrow-direction ="down"
bindtap="oncrlxShow" required="{{true}}"
/>
<van-popup
show="{{ crlxShow }}"
position="bottom"
bind:close="onCancelcrlx"
>
<van-picker columns="{{ incomeTypeOptions }}" value-key="dictLabel" bind:cancel="onCancelcrlx"
show-toolbar="{{true}}"
bind:confirm="bindPickerChange" />
</van-popup>
<van-field required="{{true}}" data-value="formData.billNum" label="单据编码" value="{{ formData.billNum }}" placeholder="请输入单据编码" border="{{ false }}" bind:change="onChange" input-align="right"/>

<van-field required="{{true}}" data-value="formData.accountSummary" label="备注说明" value="{{ formData.accountSummary }}" placeholder="请输入备注说明" border="{{ false }}" bind:change="onChange" input-align="right"/>
</view> </view>
<view class="title"> <view class="title">
<text>关联合同</text> <text>关联合同</text>
</view> </view>
<view class="main-box table-box"> <view class="main-box table-box">
<view class="flex-block">
<text class="rules {{formData.incomeType == '2' ?'':'no'}}">付款人{{}}</text>
<view class="wrap" bindtap="selectContraction">
<text wx:if="{{payerText==''}}" class="color-gray">请选择付款人</text>
<text wx:else>{{payerText}}</text>
</view>
<van-field readonly label="付款人" value="{{payerText}}"
placeholder="请选择付款人" border="{{ false }}" input-align="right" is-link arrow-direction ="down"
bindtap="selectContraction" required="{{formData.incomeType == '2'}}"
/>


<van-popup show="{{showHt}}" round position="bottom" bind:close="closeBox" >
<van-field readonly label="合同编码" value="{{formData.contractionId}}"
placeholder="请选择合同编码" border="{{ false }}" input-align="right" is-link arrow-direction ="down"
bindtap="selectContraction" required="{{formData.incomeType == '2'}}"
/>
<van-popup show="{{showHt}}" round position="bottom" bind:close="closeBox" >
<van-picker <van-picker
columns="{{contractionOptions}}" columns="{{contractionOptions}}"
show-toolbar show-toolbar
@@ -86,14 +88,6 @@
bind:confirm="onConfirmContraction" bind:confirm="onConfirmContraction"
/> />
</van-popup> </van-popup>
</view>
<view class="flex-block"><text class="rules {{formData.incomeType == '2' ?'':'no'}}">合同编码</text>
<view class="wrap" bindtap="selectContraction">
<text wx:if="{{formData.contractionId==''}}" class="color-gray">请选择合同编码</text>
<text wx:else>{{formData.contractionId}}</text>
</view>
</view>
</view> </view>
<view class="title"> <view class="title">
<text>附件</text> <text>附件</text>


Loading…
取消
儲存