| | |
| | | <template> |
| | | <view> |
| | | <view class="page-header"> |
| | | <view class="search-item"> |
| | | <view class="left">日期间隔</view> |
| | | <view class="right"> |
| | | <picker mode="selector" :value="curDateGap" :range="dateRangePicker" |
| | | @change="onDateRangePickerChangeHandler"> |
| | | <input disabled v-model="curDateGap" placeholder="请选择日期间隔" /> |
| | | <view class="picker-overlay"></view> |
| | | </picker> |
| | | |
| | | </view> |
| | | </view> |
| | | <view class="search-item"> |
| | | <view class="left">开始日期</view> |
| | | <view class="right"> |
| | | <uni-datetime-picker :clear-icon="false" type="date" v-model="startDate" |
| | | :disabled="!enableCustomDateRange"> |
| | | <view class="datetime-picker-inner" |
| | | :class="enableCustomDateRange?'font__enable':'font__disable'"> |
| | | <text>{{ startDate }}</text> |
| | | </view> |
| | | </uni-datetime-picker> |
| | | </view> |
| | | </view> |
| | | <view class="search-item"> |
| | | <view class="left">结束日期</view> |
| | | <view class="right"> |
| | | <uni-datetime-picker :clear-icon="false" type="date" v-model="endDate" |
| | | :disabled="!enableCustomDateRange"> |
| | | <view class="datetime-picker-inner" |
| | | :class="enableCustomDateRange?'font__enable':'font__disable'">{{ endDate }}</view> |
| | | </uni-datetime-picker> |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="button-groups"> |
| | | <button type="default" size="mini" class="btn-c" @tap.stop="onSearchClickHandler">查询</button> |
| | | <button type="default" size="mini" class="btn-a" @tap.stop="onResetClickHandler">重置</button> |
| | | </view> |
| | | </view> |
| | | <view class="tabs" id="tabs"> |
| | | <view :class="tabs == 0 ? 'on':''" @tap="switchTab(0)">未读消息</view> |
| | | <view :class="tabs == 1 ? 'on':''" @tap="switchTab(1)">我接收的</view> |
| | |
| | | name: 'OA_WorkLinkBillQuery', |
| | | data() { |
| | | return { |
| | | dateRangePicker: ["任意间隔", "今天", "近两天", "近三天", "近四天", "近五天", "近六天", "近七天", "近30天"], |
| | | curDateGap: "近七天", |
| | | enableCustomDateRange: false, |
| | | startDate: dayjs(new Date()).subtract(7, 'day').format('YYYY-MM-DD'), |
| | | endDate: dayjs(new Date()).format('YYYY-MM-DD'), |
| | | |
| | | dayjs, |
| | | CommonUtils, |
| | | tabs: 0, |
| | |
| | | }; |
| | | }, |
| | | methods: { |
| | | onDateRangePickerChangeHandler({ |
| | | detail |
| | | }) { |
| | | this.enableCustomDateRange = false |
| | | this.curDateGap = this.dateRangePicker[detail.value] |
| | | let date = new Date() |
| | | switch (this.curDateGap) { |
| | | case "今天": |
| | | this.startDate = dayjs(date).format("YYYY-MM-DD") |
| | | break; |
| | | case "近一天": |
| | | this.startDate = dayjs(date).subtract(1, 'day').format("YYYY-MM-DD") |
| | | break; |
| | | case "近两天": |
| | | this.startDate = dayjs(date).subtract(2, 'day').format("YYYY-MM-DD") |
| | | break; |
| | | case "近三天": |
| | | this.startDate = dayjs(date).subtract(3, 'day').format("YYYY-MM-DD") |
| | | break; |
| | | case "近四天": |
| | | this.startDate = dayjs(date).subtract(4, 'day').format("YYYY-MM-DD") |
| | | break; |
| | | case "近五天": |
| | | this.startDate = dayjs(date).subtract(5, 'day').format("YYYY-MM-DD") |
| | | break; |
| | | case "近六天": |
| | | this.startDate = dayjs(date).subtract(6, 'day').format("YYYY-MM-DD") |
| | | break; |
| | | case "近七天": |
| | | this.startDate = dayjs(date).subtract(7, 'day').format("YYYY-MM-DD") |
| | | break; |
| | | case "近30天": |
| | | this.startDate = dayjs(date).subtract(30, 'day').format("YYYY-MM-DD") |
| | | break; |
| | | } |
| | | if (this.curDateGap == '任意间隔') { |
| | | this.enableCustomDateRange = true |
| | | } |
| | | }, |
| | | onSearchClickHandler() { |
| | | this.switchTab(this.tabs) |
| | | }, |
| | | onResetClickHandler() { |
| | | this.dateRangePicker = ["任意间隔", "今天", "近两天", "近三天", "近四天", "近五天", "近六天", "近七天", "近30天"], |
| | | this.curDateGap = "近七天", |
| | | this.enableCustomDateRange = false, |
| | | this.startDate = dayjs(new Date()).subtract(7, 'day').format('YYYY-MM-DD'), |
| | | this.endDate = dayjs(new Date()).format('YYYY-MM-DD'), |
| | | this.getWorkLinkList() |
| | | }, |
| | | switchTab(tabIndex) { |
| | | this.tabs = tabIndex |
| | | this.sWhere = '' |
| | | switch (tabIndex) { |
| | | case 0: |
| | | this.sWhere = ` and (接收人 = '${getUserInfo()['HEmpName']}' or 抄送接收人 = '${getUserInfo()['HEmpName']}') and 阅读状态 = '未阅'` |
| | | this.sWhere = |
| | | ` and (接收人 = '${getUserInfo()['HEmpName']}' or 抄送接收人 = '${getUserInfo()['HEmpName']}') and 阅读状态 = '未阅'` |
| | | break; |
| | | case 1: |
| | | this.sWhere = ` and 接收人 = '${getUserInfo()['HEmpName']}'` |
| | |
| | | this.getWorkLinkList() |
| | | }, |
| | | async getWorkLinkList() { |
| | | this.sWhere += ` and 日期 >= CONVERT(VARCHAR(10), '${this.startDate}', 23) and 日期 <= CONVERT(VARCHAR(10), '${this.endDate}', 23)` |
| | | try { |
| | | |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: 'Sc_MESTransFerWorkBill/GetOA_WorkLinkBillList', |
| | | data: { |
| | |
| | | } |
| | | }, |
| | | displayDetail(item) { |
| | | console.log('item: ',item); |
| | | console.log('item: ', item); |
| | | uni.showModal({ |
| | | title: `${item["主题"]}`, |
| | | content: `${item["内容"]}`, |
| | |
| | | }, |
| | | reply(item) { |
| | | uni.navigateTo({ |
| | | url: `/pages/ZLGL/OA_WorkLink/OA_WorkLinkBill?HInterID=${item.hmainid}` |
| | | + `&HEntryID=${item.HEntryID}&operationType=5` |
| | | url: `/pages/ZLGL/OA_WorkLink/OA_WorkLinkBill?HInterID=${item.hmainid}` + |
| | | `&HEntryID=${item.HEntryID}&operationType=5` |
| | | }) |
| | | } |
| | | }, |
| | |
| | | color: #888; |
| | | } |
| | | } |
| | | |
| | | .page-header { |
| | | display: flex; |
| | | box-sizing: border-box; |
| | | padding: 20rpx; |
| | | flex-direction: column; |
| | | gap: 10rpx; |
| | | font-size: 32rpx; |
| | | |
| | | .search-item { |
| | | display: flex; |
| | | flex-direction: row; |
| | | gap: 10rpx; |
| | | justify-content: center; |
| | | align-items: center; |
| | | |
| | | .left { |
| | | width: 4em; |
| | | } |
| | | |
| | | .right { |
| | | flex: 1; |
| | | position: relative; |
| | | border-radius: 22rpx; |
| | | border: 1px solid #acacac; |
| | | display: flex; |
| | | padding: 4rpx 10rpx; |
| | | |
| | | picker { |
| | | width: 100%; |
| | | } |
| | | } |
| | | } |
| | | |
| | | input { |
| | | width: inherit; |
| | | padding: 8rpx 20rpx; |
| | | font-size: 30rpx; |
| | | } |
| | | |
| | | .datetime-picker-inner { |
| | | padding: 8rpx 20rpx; |
| | | font-size: 30rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .font__enable { |
| | | color: #000; |
| | | } |
| | | |
| | | .font__disable { |
| | | color: #cccccc; |
| | | } |
| | | } |
| | | |
| | | .button-groups { |
| | | box-sizing: border-box; |
| | | padding: 10rpx 0 0 0; |
| | | display: flex; |
| | | flex-direction: row; |
| | | gap: 10rpx; |
| | | justify-content: space-between; |
| | | |
| | | button { |
| | | border-radius: 50rpx; |
| | | width: 180rpx; |
| | | height: 66rpx; |
| | | line-height: 66rpx; |
| | | font-size: 28rpx; |
| | | } |
| | | |
| | | .btn-a { |
| | | background-color: #acacac; |
| | | color: #fff; |
| | | } |
| | | |
| | | .btn-b { |
| | | background-color: #41a863; |
| | | color: #fff; |
| | | } |
| | | |
| | | .btn-c { |
| | | background-color: #3a78ff; |
| | | color: #fff; |
| | | } |
| | | } |
| | | </style> |