zhangback
2025-12-30 939ee5a461a64b40b23d2b5f51c69dead13ee7e3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
<template>
 <view>
   <Nav title="车辆预约审核" customBack="pages/myInfo/index" ></Nav>
 
   <view class="u-page">
     <u-subsection :list="list" @change="changeSub"  mode="subsection" :current="queryForm.auditStatus"></u-subsection>
 
     <view v-if="indexList.length > 0" style="padding-top: 10px">
       <view v-for="(item, index) in indexList" :key="index" class="list-item" @click="itemClick(item)">
         <view  class="item-cell"><view class="w-100px">车牌号</view><view>{{ item.carNo }}</view></view>
         <view  class="item-cell"><view class="w-100px">被访人电话</view><view>{{ item.phone }}</view></view>
         <view  class="item-cell"><view class="w-100px">预约地点</view><view>{{ getPositionStr(item.position) }}</view></view>
         <view class="item-cell">
           <view class="w-100px">进出场类型</view>
           <view>{{ item.entryExitFlagName }}</view></view>
          <view style="display: flex;align-items: center;" >
            <view class="w-100px"  >预约时间</view>
            <view>{{ item.startTime  }}</view>
            <!-- <view class="item-cells">
              <view>{{ item.startTime + '至'  }}</view>
              <view class="pre" >{{item.endTime }}</view>
            </view> -->
          </view>
         <!-- <view class="item-cell"><view class="w-100px">预约时间</view><view>{{ item.startTime + '至' + item.endTime }}</view></view> -->
         <view class="item-cell"><view class="w-100px">审核状态</view><view :style="{color:auditStatus(item.auditStatus)}">{{ item.auditStatusName }}</view></view>
         <view class="item-cell" v-if="item.auditStatus == 2"><view class="w-100px">不通过原因</view><view>{{ item.auditRemark }}</view></view>
       </view>
       <view class="u-p-b-20 u-m-t-20">
         <u-loadmore :status="load.status" color="#999999" :icon-type="load.icon" :load-text="load.text"></u-loadmore>
       </view>
     </view>
     <view v-else style="padding-top: 25%;">
       <u-empty mode="list" text="暂无审核信息"></u-empty>
     </view>
     <u-modal :show="show2" :showCancelButton="true" @confirm="confirm" @cancel="cancel">
       <u-form ref="form1" :model="form"  labelWidth="60" style="width: 100%;">
         <u-form-item required label="审核不通过原因">
           <u--textarea v-model="form.auditRemark" placeholder="请输入不通过原因" ></u--textarea>
         </u-form-item>
       </u-form>
 
     </u-modal>
     <u-popup :show="show" :overlayZIndex="10060" :zIndex="10065" :round="10" @close="show = false" :closeable="true" :customStyle="{height: '80%'}">
       <view>
         <u-cell  title="预约信息"></u-cell>
         <scroll-view scroll-y="true" style="height: 450px;">
<!--          <u-cell  title="被访人" :value="activeItem.interviewee" />-->
          <u-cell  title="被访人单位" :value="activeItem.companyName" />
          <u-cell  title="被访部门" v-if="activeItem.interviewee" :value="activeItem.interviewee" />
          <u-cell  title="预约地点" v-if="activeItem.position" :value="getPositionStr(activeItem.position)" />
 
          <u-cell  title="进出场类型" :value="activeItem.entryExitFlagName"></u-cell>
          <u-cell  title="预约时间" :value="activeItem.startTime"></u-cell>
          <u-cell  title="来访人" :value="activeItem.visitor" />
           <u-cell  title="联系电话" :value="activeItem.phone"></u-cell>
<!--           <u-cell  title="来访人单位" :value="activeItem.visitorUnit" />-->
          
<!--           <u-cell  title="来访事由" :value="activeItem.remark"></u-cell>-->
           <view v-for="(item,index) in activeItem.carList">
             <view style="display: flex;justify-content: space-between;align-items: center;background: #3c9cff;
 
    font-size: 14px;
    line-height: 32px;
    padding: 0 12px;">
               <view class="title" style="color: #ffffff" >来访车辆{{index+1}}</view>
             </view>
             <view class="container">
               <u-cell  title="车辆类型" :value="item.carTypeName"></u-cell>
               <u-cell  title="车牌号" :value="item.carNum" ></u-cell>
<!--               <u-cell  title="车辆状态"  >-->
<!--                 <text slot="right-icon" :style="{color: carStatusColor(item.status)}" >{{carStatus(item.status)}}</text>-->
<!--               </u-cell>-->
 
 
             </view>
           </view>
         </scroll-view>
         <view style="height: 68px;width: 100%">
 
         </view>
 
         <view class="bottom-box" v-if="activeItem.auditStatus == 0">
           <view class="custom-no">
           <u-button  type="error"  @click="noClick" text="不通过"></u-button>
           </view>
           <view class="custom-ok">
             <u-button  type="primary" @click="okClick" text="通过"></u-button>
           </view>
         </view>
       </view>
     </u-popup>
   </view>
 </view>
</template>
 
<script>
import {auditCar, getAuditCarList} from "../../common/api";
export default {
  name: "index",
  data(){
    return{
      list: [
          '待审核','审核通过','审核不通过'
      ],
      indexList: [],
      queryForm:{
        pageNum:1,
        pageSize:10,
        auditStatus: 0
      },
      load:{
        status: 'loadMore',
        icon: 'flower',
        text:{
          loadmore: '上拉加载',
          loading:'努力加载中',
          nomore : '没有更多数据了'
        }
      },
      auditStatusList:[
          '待审核','审核通过','审核不通过','系统作废'
      ],
      statusList:[
          '待入园','已入园','已出园'
      ],
      show:false,
      show2:false,
      activeItem:{
        carList:[]
      },
      form:{},
      rules:{}
    }
  },
  onReady() {
    //onReady 为uni-app支持的生命周期之一
    this.$refs.form1.setRules(this.rules)
  },
  onLoad(){
    uni.setNavigationBarTitle({ title: '车辆预约审核',})
    this.getApiPage();
  },
  //底部触发
  onReachBottom(){
    if (this.load.status !== 'nomore'){
      this.load.status = 'loading';
      this.queryForm.pageNum = this.queryForm.pageNum +1;
      this.getApiPage();
    }
  },
  methods: {
 
    getPositionStr(position){
      if(position == 1){
        return  '物流园'
      }else if(position == 2){
        return '办公楼'
      }else {
        return  '物流园/办公楼'
      }
    },
 
    carStatusColor(status){
      if(status == 0){
        return  '#82848a'
      }else if(status == 1){
        return '#2979ff'
      }else if(status == 2){
        return  '#19be6b'
      }
    },
 
    auditStatus(status){
      if(status == 0){
        return  '#3c9cff'
      }else if(status == 1){
        return '#5ac725'
      }else if(status == 2){
        return  '#f56c5c'
      }
    },
    goToDetail(e){
      this.$u.route({url:'pages/announcement/detail',params:{id:e.name}});
    },
    goUrl(url){
      this.$u.route({url:url});
    },
    getApiPage() {
      const _this = this;
      getAuditCarList(_this.queryForm).then(res=>{
        this.$nextTick(()=>{
          res.rows.forEach(item=>{
            item.auditStatusName = this.auditStatusList[item.auditStatus];
            item.statusName = this.statusList[item.status];
            item.entryExitFlagName = item.entryExitFlag === 'I'?'进园':  item.entryExitFlag === 'E'? '出园':'进园+出园';
          })
          if (_this.queryForm.pageNum === 1){
            _this.indexList = res.rows;
          }else{
            _this.indexList.push(...res.rows);
          }
          this.$forceUpdate();
        })
        if (res.haveNextPage && this.queryForm.pageSize === res.rows.length){
          this.load.status = 'loadmore';
        }else{
          this.load.status = 'nomore';
        }
      })
    },
    itemClick(item){
      this.show = true;
      item.carList.forEach(item=>{
        if (item.carNum){
          item.vehicleNumList = item.carNum.split(',');
        }
 
      })
      this.activeItem = item;
    },
    noClick(){
      this.show2 = true;
    },
    cancel(){
      this.show2 = false;
    },
    okClick(){
      auditCar({
        auditStatus: 1,
        id: this.activeItem.id,
      }).then(res=>{
        uni.showToast({
          title: '审核成功',
          icon: 'success',
          duration: 2000
        });
        this.show = false;
        this.getApiPage();
      })
    },
    confirm(){
      if (!this.form.auditRemark){
        uni.$u.toast('请填写审核不通过原因');
        return;
      }
      auditCar({
        auditStatus: 2,
        auditRemark: this.form.auditRemark,
        id: this.activeItem.id,
      }).then(res=>{
        uni.showToast({
          title: '审核成功',
          icon: 'success',
          duration: 2000
        });
        this.show2 = false;
        this.show = false;
        this.getApiPage();
      })
    },
    changeSub(e){
      this.queryForm.auditStatus = e;
      this.queryForm.pageNum = 1;
      this.getApiPage();
    }
  },
}
</script>
 
<style scoped>
.bottom-box{
  position: absolute;
  bottom: 0;width: 100%;padding: 0 2%;    box-sizing: border-box;
  background: #ffffff;height: 68px;display: flex;justify-content: space-between;align-items: center;
}
.custom-no{
 
  width: 48%;
}
.custom-ok{
  width: 48%;
}
.list-item{
width: 94%;
  padding: 10px;box-sizing: border-box;
border-radius: 4px;background: #ffffff;border: 1px solid #e4e7ed;
  box-shadow: 0px 0px 12px rgba(0, 0, 0, .12);
  margin: 0 auto 10px;
}
.item-cell{
  display: flex;justify-content: left;align-items: center;font-size: 16px;line-height: 28px
}
.item-cells{
  font-size: 16px;line-height: 28px
}
.w-100px{
  width: 120px;
}
.pre {
  white-space: pre;
}
</style>