| @@ -17,16 +17,18 @@ Page({ | |||
| orderAmount: "",//汇票金额 必填 | |||
| billPayUnit: "", //付票单位 必填 | |||
| billReceiveUnit: "", // 收票单位 必填 | |||
| startTime: "", //开票日期 必填 | |||
| endTime: "", //到期日期 必填 | |||
| startTime: "2020-01-01", //开票日期 必填 | |||
| endTime: "2020-01-01", //到期日期 必填 | |||
| orderStatus: "", //汇票状态 必填 1在库 2转付中 3转付 4承兑 | |||
| remark: "", | |||
| }, | |||
| minDate: new Date(2008, 5, 1).getTime(), | |||
| maxDate: new Date(2040, 0, 31).getTime(), | |||
| minDate: new Date(2020, 5, 1).getTime(), | |||
| maxDate: new Date(2030, 0, 31).getTime(), | |||
| orderStatusOptions:[], | |||
| orderTypeOptions:[], | |||
| showBtn:true | |||
| showBtn:true, | |||
| showStartTime:false, | |||
| showEndTime:false, | |||
| }, | |||
| /** | |||
| @@ -76,7 +78,29 @@ Page({ | |||
| this.onShow() | |||
| } | |||
| }, | |||
| onConfirmStartTime(e){ | |||
| let data = this.getNewDate(new Date(e.detail.value)); | |||
| this.setData({'form.startTime':data}); | |||
| }, | |||
| onConfirmEndTime(e){ | |||
| let data = this.getNewDate(new Date(e.detail.value)); | |||
| this.setData({'form.endTime':data}); | |||
| }, | |||
| getNewDate(date){ | |||
| //date是传过来的时间戳,注意需为13位,10位需*1000 | |||
| //也可以不传,获取的就是当前时间 | |||
| var time | |||
| if(date){ | |||
| time = new Date(date); | |||
| }else{ | |||
| time = new Date(); | |||
| } | |||
| var year= time.getFullYear() //年 | |||
| var month = ("0" + (time.getMonth() + 1)).slice(-2); //月 | |||
| var day = ("0" + time.getDate()).slice(-2); //日 | |||
| var mydate = year + "-" + month + "-" + day; | |||
| return mydate | |||
| }, | |||
| /** | |||
| * 生命周期函数--监听页面初次渲染完成 | |||
| */ | |||
| @@ -14,6 +14,7 @@ | |||
| "van-field": "@vant/weapp/field/index", | |||
| "van-popup": "@vant/weapp/popup/index", | |||
| "van-picker": "@vant/weapp/picker/index", | |||
| "van-calendar": "@vant/weapp/calendar/index" | |||
| "van-calendar": "@vant/weapp/calendar/index", | |||
| "van-datetime-picker": "@vant/weapp/datetime-picker/index" | |||
| } | |||
| } | |||
| @@ -3,7 +3,7 @@ | |||
| <image src="/image/apply/back.png" style="top:{{isIPX?'54px':'30px'}};" mode="widthFix" bindtap="back"></image> | |||
| <text style="top:{{isIPX?'54px':'30px'}};">{{form.id?"":"新增"}}银行汇票</text> | |||
| </view> | |||
| <view class="main-box table-box" style="margin-top:{{isIPX?'100px':'75px'}};"> | |||
| <view class="main-box table-box table-boxs" style="margin-top:{{isIPX?'100px':'75px'}};"> | |||
| <van-field label="汇票号码" value="{{ form.orderNum }}" placeholder="汇票号码" border="{{ false }}" bind:change="onChange" input-align="right" required data-value="form.orderNum"/> | |||
| @@ -24,14 +24,22 @@ | |||
| <van-field label="付票单位" value="{{ form.billPayUnit }}" placeholder="付票单位" border="{{ false }}" bind:change="onChange" input-align="right" required data-value="form.billPayUnit" /> | |||
| <van-field label="收票单位" value="{{ form.billReceiveUnit }}" placeholder="收票单位" border="{{ false }}" bind:change="onChange" input-align="right" required data-value="form.billReceiveUnit"/> | |||
| <van-field readonly label="开票日期" value="{{ form.startTime }}" placeholder="开票日期" border="{{ false }}" bind:change="onChange" input-align="right" required data-value="form.startTime" bindtap="openBox" data-name="showStartTime"/> | |||
| <van-calendar show="{{ showStartTime }}" min-date="{{minDate}}" max-date="{{maxDate}}" bind:close="closeBox" data-name="showStartTime" bind:confirm="onConfirmTime" data-value="form.startTime" show-confirm="{{ false }}" /> | |||
| <van-field readonly label="到期日期" value="{{ form.endTime }}" placeholder="到期日期" border="{{ false }}" bind:change="onChange" input-align="right" required data-value="form.endTime" bindtap="openBox" data-name="showEndTime"/> | |||
| <van-calendar show="{{ showEndTime }}" min-date="{{minDate}}" max-date="{{maxDate}}" bind:close="closeBox" data-name="showEndTime" bind:confirm="onConfirmTime" data-value="form.endTime" show-confirm="{{ false }}" /> | |||
| <view class="section" style="margin-top: -28rpx;"> | |||
| <view class="section__title"><text style="color:red;margin-right: 8rpx;">*</text>开票日期</view> | |||
| <picker mode="date" value="{{form.startTime}}" bindchange="onConfirmStartTime"> | |||
| <view class="picker"> | |||
| {{form.startTime?form.startTime:'开票日期'}} | |||
| </view> | |||
| </picker> | |||
| </view> | |||
| <view class="section" style="margin-top: -28rpx;"> | |||
| <view class="section__title"><text style="color:red;margin-right: 8rpx;">*</text>到期日期</view> | |||
| <picker mode="date" value="{{form.endTime}}" bindchange="onConfirmEndTime"> | |||
| <view class="picker"> | |||
| {{form.endTime?form.endTime:'到期日期'}} | |||
| </view> | |||
| </picker> | |||
| </view> | |||
| <van-popup show="{{showOrderStatus}}" round position="bottom" bind:close="closeBox" data-name="showOrderStatus"> | |||
| <van-picker | |||
| columns="{{orderStatusOptions}}" | |||
| @@ -56,4 +56,9 @@ | |||
| padding: 8px 0px; | |||
| background-image: linear-gradient(to right, #2C8E68, #5CAE77); | |||
| color: #fff; | |||
| } | |||
| .table-boxs>view{ | |||
| display: flex; | |||
| justify-content: space-between; | |||
| line-height: 100rpx; | |||
| } | |||
| @@ -292,7 +292,7 @@ | |||
| <view class="section__title"><text style="color:red;margin-right: 22rpx;"></text>审核时间</view> | |||
| <picker mode="date" value="{{form.reviewTime}}" start="{{ minDate }}" end="{{ maxDate }}" bindchange="onConfirmReviewTime"> | |||
| <view class="picker"> | |||
| {{form.reviewTime?form.reviewTime.substring(0,9):'审核时间'}} | |||
| {{form.reviewTime?form.reviewTime:'审核时间'}} | |||
| </view> | |||
| </picker> | |||
| </view> | |||
| @@ -147,7 +147,7 @@ Page({ | |||
| success: (res) => { | |||
| if(res.code==200){ | |||
| let new_list = this.data.list | |||
| new_list.splice(this.data.index,1) | |||
| new_list.splice(this.data.itemIndex,1) | |||
| this.setData({'list':new_list}) | |||
| UTIL.showToastNoneIcon('删除成功!'); | |||
| }else{ | |||
| @@ -52,7 +52,29 @@ Page({ | |||
| } | |||
| }, | |||
| onConfirmStartTime(e){ | |||
| let data = this.getNewDate(new Date(e.detail.value)); | |||
| this.setData({'form.startTime':data}); | |||
| }, | |||
| onConfirmEndTime(e){ | |||
| let data = this.getNewDate(new Date(e.detail.value)); | |||
| this.setData({'form.endTime':data}); | |||
| }, | |||
| getNewDate(date){ | |||
| //date是传过来的时间戳,注意需为13位,10位需*1000 | |||
| //也可以不传,获取的就是当前时间 | |||
| var time | |||
| if(date){ | |||
| time = new Date(date); | |||
| }else{ | |||
| time = new Date(); | |||
| } | |||
| var year= time.getFullYear() //年 | |||
| var month = ("0" + (time.getMonth() + 1)).slice(-2); //月 | |||
| var day = ("0" + time.getDate()).slice(-2); //日 | |||
| var mydate = year + "-" + month + "-" + day; | |||
| return mydate | |||
| }, | |||
| back:function(){ | |||
| wx.navigateBack({ | |||
| delta: 1 | |||
| @@ -3,17 +3,26 @@ | |||
| <image src="/image/apply/back.png" style="top:{{isIPX?'54px':'30px'}};" mode="widthFix" bindtap="back"></image> | |||
| <text style="top:{{isIPX?'54px':'30px'}};">{{form.id?"":"新增"}}工程项目</text> | |||
| </view> | |||
| <view class="main-box table-box" style="margin-top:{{isIPX?'100px':'75px'}};"> | |||
| <view class="main-box table-box table-boxs" style="margin-top:{{isIPX?'100px':'75px'}};"> | |||
| <van-field label="项目名称" value="{{ form.projectName }}" placeholder="项目名称" border="{{ false }}" bind:change="onChange" input-align="right" required data-value="form.projectName"/> | |||
| <van-field label="合同承建方" value="{{ form.projectContractor }}" placeholder="合同承建方" border="{{ false }}" bind:change="onChange" input-align="right" required data-value="form.projectContractor"/> | |||
| <van-field readonly label="开工日期" value="{{ form.startTime }}" placeholder="开工日期" border="{{ false }}" bind:change="onChange" input-align="right" required is-link arrow-direction ="down" bindtap="openBox" data-name="showStartTime"/> | |||
| <van-calendar show="{{ showStartTime }}" bind:close="closeBox" data-name="showStartTime" bind:confirm="onConfirmTime" data-value="form.startTime" show-confirm="{{ false }}" /> | |||
| <van-field label="竣工日期" value="{{ form.endTime }}" placeholder="竣工日期" border="{{ false }}" bind:change="onChange" input-align="right" required is-link arrow-direction ="down" bindtap="openBox" data-name="showEndTime" /> | |||
| <van-calendar show="{{ showEndTime }}" bind:close="closeBox" data-name="showEndTime" bind:confirm="onConfirmTime" data-value="form.endTime" show-confirm="{{ false }}" /> | |||
| <view class="section" style="margin-top: -28rpx;"> | |||
| <view class="section__title"><text style="color:red;margin-right: 8rpx;">*</text>开工日期</view> | |||
| <picker mode="date" value="{{form.startTime}}" bindchange="onConfirmStartTime"> | |||
| <view class="picker"> | |||
| {{form.startTime?form.startTime:'开工日期'}} | |||
| </view> | |||
| </picker> | |||
| </view> | |||
| <view class="section" style="margin-top: -28rpx;"> | |||
| <view class="section__title"><text style="color:red;margin-right: 8rpx;">*</text>竣工日期</view> | |||
| <picker mode="date" value="{{form.endTime}}" bindchange="onConfirmEndTime"> | |||
| <view class="picker"> | |||
| {{form.endTime?form.endTime:'竣工日期'}} | |||
| </view> | |||
| </picker> | |||
| </view> | |||
| <van-field label="合共价款(元)" value="{{ form.projectAmount }}" type="digit" placeholder="合共价款(元)" border="{{ false }}" bind:change="onChange" input-align="right" required data-value="form.projectAmount"/> | |||
| @@ -59,4 +59,9 @@ | |||
| } | |||
| .van-field__label { | |||
| width: max-content; | |||
| } | |||
| .table-boxs>view{ | |||
| display: flex; | |||
| justify-content: space-between; | |||
| line-height: 100rpx; | |||
| } | |||