| | |
| | | |
| | | <view class="floor"> |
| | | <view class="wran">删除</view> |
| | | <view class="default">修改</view> |
| | | <view class="primary" @click="submit()">申请报销</view> |
| | | <view class="default" v-show="settle == 1">修改</view> |
| | | <view class="primary" @click="submit()">{{subTitle}}</view> |
| | | </view> |
| | | </view> |
| | | </template> |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | settle: 1, |
| | | subTitle: '申请报销', |
| | | list: [{ |
| | | businessTripReasons: '沟通立库事宜', |
| | | businessTransportation$: '交通工具', |
| | |
| | | }, |
| | | { |
| | | label: "结束日期", |
| | | attribute: "businessStartTimeDay$", |
| | | attribute: "businessEndTimeDay$", |
| | | }, |
| | | |
| | | { |
| | | label: "出差时长", |
| | | attribute: "businessStartTimeDay$", |
| | | attribute: "businessDuration$", |
| | | }, |
| | | { |
| | | label: "出差天数", |
| | | attribute: "businessEndTimeDay$", |
| | | attribute: "businessTripDays$", |
| | | }, |
| | | { |
| | | label: "同行人", |
| | |
| | | const eventChannel = this.getOpenerEventChannel(); |
| | | eventChannel.on('busunessDetl', function(data) { |
| | | _this.list.push(data.data) |
| | | _this.settle = data.data.settle |
| | | if (data.data.settle == 1) { |
| | | _this.subTitle = '审批' |
| | | } |
| | | console.log(data) |
| | | }) |
| | | }, |
| | | methods: { |
| | | submit() { |
| | | if (this.settle == 1) { |
| | | this.approval() |
| | | } else { |
| | | |
| | | } |
| | | }, |
| | | // 审批 |
| | | approval() { |
| | | let _this = this |
| | | uni.request({ |
| | | url: `${_this.baseUrl}/businessTrip/approval/auth`, |
| | | header: { |
| | | 'token': uni.getStorageSync('token'), |
| | | 'content-type': 'application/x-www-form-urlencoded;charset=UTF-8' |
| | | }, |
| | | method: 'POST', |
| | | sslVerify: false, |
| | | data: {planId: _this.list[0].id}, |
| | | success(res) { |
| | | res = res.data |
| | | // console.log(res); |
| | | if (res.code === 200) { |
| | | uni.showToast({title: res.msg, icon: "none", position: 'top'}) |
| | | setTimeout(()=>{ |
| | | uni.navigateBack({}) |
| | | },1000) |
| | | } else if (res.code === 500) { |
| | | uni.showToast({title: res.msg, icon: "none", position: 'top'}) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | // 申请报销 |
| | | reimburse() { |
| | | |
| | | }, |
| | | back() { |
| | | uni.navigateBack({}) |
| | | }, |