123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291 |
- <template>
- <view class="container" v-if="isShow">
- <view class="headerBox">
- <view class="searchBox">
- <icon class="icon-small searchIcon" type="search" size="20"></icon>
- <input type="text" data-code="code" v-model="CodeTitle" class="fway-form-input searchInput" placeholder="请输入编号或者标题搜索" />
- <text class="searchBtn" @tap="onTapSearch">搜索</text>
- </view>
- <view class="tabBox">
- <view class="tabItem" :class="tabIndex == '1' ? 'active' : ''" @tap="onChangeState('1')">全部</view>
- <view class="tabItem" :class="tabIndex == '2' ? 'active' : ''" @tap="onChangeState('2')">未回复</view>
- <view class="tabItem" :class="tabIndex == '3' ? 'active' : ''" @tap="onChangeState('3')">已回复</view>
- <view class="tabItem" :class="tabIndex == '4' ? 'active' : ''" @tap="onChangeState('4')">已评价</view>
- </view>
- </view>
- <view class="contentBox">
- <z-paging ref="paging" v-model="listData" @query="onGetOrderList" refresher-update-time-key="list">
- <view class="listInfoBox">
- <view class="listInfo" v-for="(item, index) in listData" :key="index" @tap="onOrderViewTo(item.id)">
- <view class='listCode'>
- <view class="codeTextBox">
- <!-- <text>编号:</text> -->
- <text class="codeText">{{item.orderNo}}</text>
- <text class="codeType" v-if="item.industryName">{{item.industryName}}</text>
- </view>
- <rich-text :nodes="item.statusText" class="codeStatus" :class="item.statusClass"></rich-text>
- </view>
- <rich-text :nodes="item.title" class="listTitle"></rich-text>
- <view class="listDetailBox">
- <text class="listArea">{{item.area}}</text>
- <text class="listDate">{{item.creationTime}}</text>
- </view>
- </view>
- </view>
- </z-paging>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- isShow: false,
- tabIndex: '1',
- State: '',
- CodeTitle: '',
- listData: [],
- isReLoad: false,
- }
- },
- onLoad(options) {
- let that = this;
- if (options.tabIndex){
- that.tabIndex = options.tabIndex;
- }
- that.isShow = true;
- },
- methods: {
- onGetOrderList(pageNo, pageSize) {
- let that = this;
- switch(that.tabIndex) {
- case '1':
- that.State = 0;
- break;
- case '2':
- that.State = 1;
- break;
- case '3':
- that.State = 2;
- break;
- case '4':
- that.State = 3;
- break;
- default: break;
- }
- that.$admin.req({
- method: 'GET',
- url: '/api/v1/Snapshot/order?KeyWords=' + that.CodeTitle + '&Status=' + that.State + '&QueryIndex=' + (pageNo - 1) + '&QueryCount=' + pageSize,
- }).then(res => {
- if (res && res.length > 0) {
- res.forEach((item, index) => {
- item.creationTime = that.$util.formatTime(new Date(item.creationTime));
- switch (item.statusText) {
- case '办理完成':
- item.statusClass = 'greenText';
- break;
- case '办理中':
- item.statusClass = 'redText';
- break;
- case '待受理':
- item.statusClass = 'yellowText';
- break;
- case '':
- item.statusClass = 'grayText';
- break;
- default:
- item.statusClass = 'blueText';
- break;
- }
- })
- that.$refs.paging.complete(res);
- } else if (res && res.length == 0) {
- that.$refs.paging.complete([]);
- } else {
- that.$util.msg('网络出错!');
- that.$refs.paging.complete(false);
- }
- typeof fun === 'function' && fun();
- }, err => {
- if (!that.isReLoad) {
- that.isReLoad = true;
- that.onGetOrderList(pageNo, pageSize);
- } else {
- that.$util.msg(err);
- that.$refs.paging.complete(false);
- }
- })
- },
- // 点击查询按钮
- onTapSearch() {
- let that = this;
- that.$refs.paging.reload();
- },
- // 切换工单状态
- onChangeState(tabIndex) {
- let that = this;
- if (that.tabIndex != tabIndex){
- that.tabIndex = tabIndex;
- that.$refs.paging.reload();
- }
- },
- onOrderViewTo(id) {
- uni.navigateTo({
- url: '/pagesCare/Order/View?type=mine&id=' + encodeURIComponent(id)
- })
- },
- }
- }
- </script>
- <style lang="less">
- .container {
- background-color: #F6F7F8;
- }
- .headerBox {
- line-height: 0;
- background-color: #fff;
- }
- .searchBox {
- padding: 20rpx;
- position: relative;
- }
- .searchIcon {
- position: absolute;
- top: 40rpx;
- left: 50rpx;
- }
- .searchInput {
- background-color: #F6F7F8;
- border-radius: 30rpx;
- padding: 10rpx 110rpx 10rpx 80rpx;
- width: calc(100% - 190rpx);
- height: 60rpx;
- line-height: 60rpx;
- font-size: 36rpx;
- }
- .searchBtn {
- position: absolute;
- line-height: 60rpx;
- top: 26rpx;
- right: 26rpx;
- background-color: #E5F7FF;
- color: #3e6ffd;
- font-size: 36rpx;
- padding: 4rpx 20rpx;
- border-radius: 30rpx;
- }
- .tabBox {
- padding: 0;
- line-height: 48rpx;
- }
- .tabItem {
- padding: 20rpx 0 30rpx;
- display: inline-block;
- width: calc(25%);
- text-align: center;
- color: #333333;
- font-size: 36rpx;
- position: relative;
- }
- .active {
- color: #3e6ffd;
- }
- .active::after {
- content: " ";
- width: 72rpx;
- height: 6rpx;
- background-color: #3e6ffd;
- position: absolute;
- bottom: 0;
- left: calc(50% - 36rpx);
- }
- .contentBox {
- position: relative;
- height: calc(100% - 200rpx);
- }
- .listInfo {
- margin: 20rpx;
- padding: 30rpx 20rpx;
- border-radius: 20rpx;
- background-color: #fff;
- }
- .listCode {
- padding-bottom: 30rpx;
- border-bottom: 2rpx #EEEEEE solid;
- }
- .codeTextBox {
- width: calc(100% - 160rpx);
- display: inline-block;
- font-size: 36rpx;
- color: #666666;
- vertical-align: middle;
- }
- .codeText {
- color: #000006;
- }
-
- .codeType{
- padding: 2rpx 6rpx 4rpx;
- margin-left: 20rpx;
- border: 2rpx #3e6ffd solid;
- border-radius: 10rpx;
- color: #3e6ffd;
- font-size: 32rpx;
- }
- .codeStatus {
- width: calc(160rpx);
- display: inline-block;
- color: #3e6ffd;
- font-size: 36rpx;
- text-align: right;
- vertical-align: middle;
- }
- .listTitle {
- color: #000405;
- font-size: 40rpx;
- line-height: 50rpx;
- white-space: pre-line;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- /*行向垂直排列*/
- -webkit-line-clamp: 2;
- width: 100%;
- padding-top: 20rpx;
- }
- .listDetailBox {
- color: #666666;
- font-size: 32rpx;
- padding-top: 30rpx;
- display: block;
- }
- .listArea {
- font-size: 32rpx;
- margin-right: 20rpx;
- }
- .listDate {
- font-size: 32rpx;
- }
- </style>
|