From ea44321752674bc97efb7bfa987c19121c3d6881 Mon Sep 17 00:00:00 2001 From: zhangwei <1504152376@qq.com> Date: 星期四, 16 一月 2025 17:16:50 +0800 Subject: [PATCH] 财务报销(未完成) --- src/pages/reimbursement/examine.vue | 275 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 275 insertions(+), 0 deletions(-) diff --git a/src/pages/reimbursement/examine.vue b/src/pages/reimbursement/examine.vue new file mode 100644 index 0000000..64664ed --- /dev/null +++ b/src/pages/reimbursement/examine.vue @@ -0,0 +1,275 @@ +<template> + <view class="full-page" scroll-y using-sticky> + <view class=""> + <up-sticky bgColor="#fff"> + <view class="coreshop-ff content c-p-10"> + <up-search placeholder="璇风偣鍑婚�夋嫨鏃ユ湡" @clear='clear' @click='clickTime' disabled @custom='init' + v-model="workTime" search-icon="calendar" @search='init' :show-action="false"></up-search> + </view> + <view class="coreshop-ff content c-p-10"> + <up-search placeholder="璇疯緭鍏ュ伐浜哄悕瀛�" v-model="workerUserName" @custom='init' @clear='init' + @search='init'></up-search> + <!-- <up-search placeholder="璇风偣鍑婚�夋嫨鎵撳崱鏃ユ湡" @click='clickIcon' @clear='PostMyComDakaListPage' disabled + v-model="wordDate" search-icon="calendar" @search='PostMyComDakaListPage' + @custom='PostMyComDakaListPage'></up-search> --> + </view> + <!-- <up-subsection :list="list" :current="current4" activeColor="#f9ae3d" + @change="sectionChange"></up-subsection> --> + <up-subsection :list="list" current='1' activeColor="#f9ae3d" @change="sectionChange"></up-subsection> + </up-sticky> + <view class="full-page-content c-p-b-100"> + <view class="c-p-l-20 c-p-r-20" v-if="listO.orderList&&listO.orderList.length>0"> + <view class="listrecord c-p-t-20" v-for="(item,index) in listO.orderList" :key="item.id" + @click="pageToDetail(item)"> + <view class="coreshop-ff chuany-bradius20"> + <view class="c-p-20 chuany-font28"> + <view class="chuany-flex chuany-justify-between"> + <view class="chuany-font32 chuany-width24"> + {{item.planPeople}} + </view> + <view class="chuany-width50"> + {{item.depart.name}} + </view> + <view class="chuany-width24"> + <u-text align="right" size='14' + :type="item.approvalStatus=='unApproval'?'primary':item.approvalStatus=='Yes'?'success':'warning'" + :text="item.approvalStatus=='unApproval'?'鏈壒澶�':item.approvalStatus=='Yes'?'鎵瑰噯':'涓嶆壒鍑�'"> + </u-text> + </view> + </view> + <view class="text-69 chuany-flex chuany-justify-between"> + <view class="c-p-t-8 chuany-width24"> + 璐圭敤鎶ラ攢 + </view> + <view class="c-p-t-8 chuany-width50"> + {{$util.formatDate(item.planStartTime)}} + </view> + <view class="c-p-t-8 chuany-width24 chuany-text-right"> + {{item.planMoney}} 鍏� + </view> + </view> + <view class="c-p-t-8"> + 鎽樿锛歿{item.planContent}} + </view> + </view> + </view> + </view> + <up-loadmore :status="loadStatus" /> + </view> + <view v-else> + <up-empty text='鏆傛棤' icon="/static/order.png"> + </up-empty> + </view> + </view> + <fui-date-picker range :show="datePickerShow" :value="getFirstDayOfMonth()" type="3" @change="changePicker" + @cancel="cancel"></fui-date-picker> + <view class="tabbtns"> + 鍚堣锛歿{heji}} 鍏� + </view> + </view> + </view> + +</template> + +<script setup> + import { + onLoad, + onShow, + onReachBottom, + onPullDownRefresh, + onHide + } from "@dcloudio/uni-app"; + import { + reactive, + ref, + getCurrentInstance + } from 'vue'; + const { + $upload, + $api, + $util, + $db + } = getCurrentInstance().appContext.config.globalProperties + let state = reactive({ + pageIndex: 1, + pageSize: 20, + }) + const list = ['鍏ㄩ儴', '鏈壒澶�', '涓嶆壒鍑�', '鎵瑰噯'] + let workTime = ref('') + let datePickerShow = ref(false) + let loadStatus = ref('loadmore') + let workerUserName = ref('') + let totalPages = ref(0) + let listO = reactive({ + orderList: [] + }) + let role = ref() + let approvalStatus = ref('unApproval') + let heji = ref(0) + onReachBottom(() => { + if (loadStatus.value != 'nomore') { + getRolePlaneList(); + } + }) + + onPullDownRefresh(() => { + init() + uni.stopPullDownRefresh(); + }) + onLoad((options) => { + role.value = options.role + // workTime.value = getFirstDayOfMonth() + '鑷�' + $util.formatDate(new Date()) + // state.planStartTimeStart = getFirstDayOfMonth() //宸ヤ綔寮�濮嬫椂闂� + // state.planStartTimeEnd = $util.formatDate(new Date()) + + }) + onShow(() => { + init() + }) + const getFirstDayOfMonth = () => { + var currentDate = new Date(); + currentDate.setDate(1); // 灏嗘棩鏈熻涓�1 + return $util.formatDate(currentDate); + } + const sectionChange = (val) => { + switch (val) { + case 0: + approvalStatus.value = null + break; + case 1: + approvalStatus.value = 'unApproval' + break; + case 2: + approvalStatus.value = 'No' + break; + case 3: + approvalStatus.value = 'Yes' + break; + } + init() + } + const current4 = ref(0); + // const list = ref(['鍏ㄩ儴', '瀹℃牳涓�', '宸插綍鐢�', '鏈綍鐢�']); + const changePicker = (val) => { + console.log(val); + workTime.value = val.startDate.result + '鑷�' + val.endDate.result + state.planStartTimeStart = new Date(val.startDate.result) //宸ヤ綔寮�濮嬫椂闂� + state.planStartTimeEnd = new Date(val.endDate.result) + datePickerShow.value = !datePickerShow.value + init() + } + + // const search = (index) => { + // console.log(index, '------鈥�'); + // if (index == 0) { + // getRolePlaneList() + // } else { + // getRolePlaneList(index - 1) + // } + + // } + const clear = () => { + state.planStartTimeStart = "" + state.planStartTimeEnd = "" + getRolePlaneList() + } + const clickTime = () => { + datePickerShow.value = !datePickerShow.value + } + + const cancel = () => { + datePickerShow.value = !datePickerShow.value + } + const init = () => { + state.pageIndex = 1 + state.pageSize = 20 + loadStatus.value = 'loadmore' + listO.orderList = [] + getRolePlaneList() + } + const getRolePlaneList = () => { + let data = { + page: { + pageIndex: state.pageIndex, + pageSize: state.pageSize, + }, + approvalStatus: approvalStatus.value + } + if (state.planStartTimeStart) { + data.planStartTimeStart = state.planStartTimeStart + } + if (state.planStartTimeEnd) { + data.planStartTimeEnd = state.planStartTimeEnd + } + if(workerUserName.value){ + data.staffName = workerUserName.value + } + loadStatus.value = 'loading'; + let getList = null + if (role.value == 'zhuGuan') { + getList = $api.getzhuguanplanelist + } else { + getList = $api.getjingliplanelist + } + getList(data).then(res => { + console.log(res, res.code, '-----------123鈥�'); + if (res.code == 1) { + heji.value = res.data.totalMoney + if (state.pageIndex == 1) { + listO.orderList = res.data.list + } else { + listO.orderList = listO.orderList.concat(...res.data.list) + } + console.log(listO.orderList, 'listO.orderList鈥�'); + // totalPages.value = res.data.totalCount + // 鏍规嵁count鏁伴噺鍒ゆ柇鏄惁杩樻湁鏁版嵁 + if (res.data.page.totalCount > listO.orderList.length) { + loadStatus.value = 'loadmore' + state.pageIndex++ + } else { + // 鏁版嵁宸插姞杞藉畬姣� + loadStatus.value = 'nomore' + } + } else { + // _that.$refs.uToast.show({ message: res.msg, type: 'error' }); + } + }) + } + const pageToDetail = (item) => { + if (item.approvalStatus == 'unApproval') { + uni.navigateTo({ + url: `/pages/reimbursement/approve?role=${role.value}&detailId=${item.keyid}` + }); + }else{ + $util.showToast({ + title: '姝ゆ姤閿�鍗曞凡鎵瑰锛�' + }) + } + // if (state.planStartTimeStart) { + // data.planStartTimeStart = state.planStartTimeStart + // } + // if (state.planStartTimeEnd) { + // data.planStartTimeEnd = state.planStartTimeEnd + // } + + // $db.set('detailItem',JSON.stringify(item)) + } +</script> + +<style> + .content { + /* width: 100%; */ + box-sizing: border-box; + } + + .bgblue { + background-color: #4e96f5; + border-radius: 20rpx 20rpx 0 0; + color: #fff; + } + + .listrecord { + width: 100%; + box-sizing: border-box; + } +</style> \ No newline at end of file -- Gitblit v1.9.1