list.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510
  1. <template>
  2. <view>
  3. <!-- 第一种样式 人员管理-->
  4. <block v-if="datainfo.length>0">
  5. <block v-if="type=='mycar'">
  6. <view class="carlist pr" v-for="(ite,idx) in datainfo" :key="idx" @click="getDetail(ite.carId)"
  7. :data-idx="idx"
  8. @touchstart="drawStart" @touchmove="drawMove" @touchend="drawEnd" :style="'right:'+ite.right+'px'"
  9. >
  10. <view class="delleft" style="padding: 0 24rpx;">
  11. <view class="carltop flexc">
  12. <view class="flex1">
  13. <view class="tit mb6 flexc" :class="ite.vehicleEnergy=='新能源'?'co16':'co01'">{{ite.plateNumber}}
  14. <text class="cir"></text>
  15. <text v-if="ite.vehicleColour">{{ite.vehicleColour}}</text>
  16. </view>
  17. <view class="txt flexc">
  18. {{ite.vehicleBrand}}
  19. <view class="txtbtn flexcc" v-if="ite.vehicleEnergy=='新能源'">{{ite.vehicleEnergy}}</view>
  20. <!-- <view class="txtbtn flexcc" v-if="ite.vehicleType==2">新能源</view> -->
  21. </view>
  22. </view>
  23. <image :src="carb" class="carb" v-if="ite.vehicleEnergy=='新能源'"></image>
  24. <image :src="cara" class="cara" v-else></image>
  25. </view>
  26. <view class="carlf">
  27. <view class="clflist">发动机号码 :{{ite.engineNumber}}</view>
  28. <view class="clflist">车辆识别代号:{{ite.identificationNumber}}</view>
  29. <view class="flexc">
  30. <view class="clflist w50">注册日期:{{ite.registrationDate}}</view>
  31. <view class="clflist w50">发证日期:{{ite.issueDate}}</view>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="spdel" v-if="ite.right>0&&checkPermi(['wuYe:car:remove'])" @click.stop="getDelFn(ite.carId)">删除</view>
  36. </view>
  37. </block>
  38. <!-- 地址 -->
  39. <block v-if="type=='address'">
  40. <view class="adrlist flexc" :class="ite.isdefault?'act':''" v-for="(ite,idx) in datainfo" :key="idx">
  41. <view class="adrl flex1">
  42. <view class="tit mb5">安徽省 合肥市 蜀山区 高新技术产业开发区</view>
  43. <view class="txt mb5">幸福大街88号幸福小区12#1304</view>
  44. <view class="txts flexc">袁玥 <text class="ml8">18305687768</text>
  45. <text class="ml8 btns" v-if="ite.isdefault">默认</text>
  46. <text class="ml8 btns" v-if="ite.isuser">最近使用</text>
  47. </view>
  48. </view>
  49. <view class="adrr flexcc">
  50. <image :src="edit"></image>
  51. </view>
  52. </view>
  53. </block>
  54. <!-- 人员管理 -->
  55. <block v-if="type=='people'">
  56. <view class="carlist peolist" v-for="(ite,idx) in datainfo" :key="idx">
  57. <view class="ctop flexc">
  58. <image :src="house" class="imgs" v-if="ite.houseStatus==1"></image>
  59. <image :src="housea" class="imgs" v-if="ite.houseStatus==4"></image>
  60. <image :src="houseb" class="imgs" v-if="ite.houseStatus==2"></image>
  61. <image :src="housec" class="imgs" v-if="ite.houseStatus==3"></image>
  62. <view class="tit">{{ite.detailedAddress}}</view>
  63. <view class="flex1"></view>
  64. <view class="txt ca" v-if="ite.houseStatus==1">自住</view>
  65. <view class="txt cb" v-if="ite.houseStatus==4">出租</view>
  66. <view class="txt cc" v-if="ite.houseStatus==2">空闲</view>
  67. <view class="txt co6" v-if="ite.houseStatus==3">代售</view>
  68. </view>
  69. <view class="plists">
  70. <block v-for="(aite,aidx) in ite.residentInfoList">
  71. <view class="flexc pr mb12" :key="`peo${aidx}`" v-if="aidx==0" @click="getDetail(aite.residentId)"
  72. :data-idx="idx" :data-aidx="aidx" data-type="peo"
  73. @touchstart="drawStart" @touchmove="drawMove" @touchend="drawEnd" :style="'right:'+aite.right+'px'"
  74. >
  75. <view class="plist flexc">
  76. <image :src="man" class="head" v-if="aite.residentGender==1"></image>
  77. <image :src="woman" class="head" v-else></image>
  78. <view class="flex1">
  79. <view class="ptit">{{aite.residentName}}
  80. <view class="btn btnc ml10" v-if="aite.isHouseholder=='Y'">户主</view>
  81. </view>
  82. <view class="ptxt">身份证号 | {{aite.residentIdCard}}</view>
  83. <view class="flexc">
  84. <view class="ptxt">性别 | {{aite.residentGender==1?'男':'女'}}</view>
  85. <view class="ptxt">年龄 | {{getAgeFromID(aite.residentIdCard)}}岁</view>
  86. </view>
  87. <view class="flexc" v-if="aite.residentAppearance">
  88. <view class="ptxt">人员面貌 | {{kaType(aite.residentAppearance,rymmList)}}</view>
  89. </view>
  90. </view>
  91. </view>
  92. <view class="spdel" v-if="aite.right>0&&checkPermi(['wuYe:residentInfo:remove'])" @click.stop="getDelFn(aite.residentId)">删除</view>
  93. </view>
  94. <view class="flexc pr mb12" :key="`peo${aidx}`" v-if="aidx>0&&ite.zhanflag" @click="getDetail(aite.residentId)"
  95. :data-idx="idx"
  96. :data-aidx="aidx" data-type="peo"
  97. @touchstart="drawStart" @touchmove="drawMove" @touchend="drawEnd" :style="'right:'+aite.right+'px'"
  98. >
  99. <view class="plist flexc">
  100. <image :src="man" class="head" v-if="aite.residentGender==1"></image>
  101. <image :src="woman" class="head" v-else></image>
  102. <view class="flex1">
  103. <view class="ptit">{{aite.residentName}}
  104. <view class="btn btnc ml10" v-if="aite.isHouseholder=='Y'">户主</view>
  105. </view>
  106. <view class="ptxt">身份证号 | {{aite.residentIdCard}}</view>
  107. <view class="flexc">
  108. <view class="ptxt">性别 | {{aite.residentGender==1?'男':'女'}}</view>
  109. <view class="ptxt">年龄 | {{getAgeFromID(aite.residentIdCard)}}岁</view>
  110. </view>
  111. <view class="flexc" v-if="aite.residentAppearance">
  112. <view class="ptxt">人员面貌 | {{kaType(aite.residentAppearance,rymmList)}}</view>
  113. </view>
  114. </view>
  115. </view>
  116. <view class="spdel" v-if="aite.right>0&&checkPermi(['wuYe:residentInfo:remove'])" @click.stop="getDelFn(aite.residentId)">删除</view>
  117. </view>
  118. </block>
  119. <image :src="upimg" v-if="ite.residentInfoList.length>1" :class="ite.zhanflag?'act':''" class="upimg" @click="getZhan(idx)"></image>
  120. </view>
  121. </view>
  122. </block>
  123. <!-- 车辆违规 -->
  124. <block v-if="type=='carpark'">
  125. <view class="carlist pr" v-for="(ite,idx) in datainfo" :key="ite.illegalParkingId" @click="getDetail(ite.illegalParkingId)"
  126. :data-idx="idx"
  127. @touchstart="drawStart" @touchmove="drawMove" @touchend="drawEnd" :style="checkPermi(['wuYe:illegalParking:remove'])?'right:'+ite.right+'px':''"
  128. >
  129. <view class="delleft">
  130. <view class="ctop flexc">
  131. <image :src="caraa" class="imgs" v-if="ite.carType==1"></image>
  132. <image :src="carbb" class="imgs" v-if="ite.carType==2"></image>
  133. <view class="tit">{{ite.plateNumber}}</view>
  134. <view class="num coff" v-if="ite.isBlack=='Y'">(已登黑名单)</view>
  135. <view class="flex1"></view>
  136. <block v-if="ite.carType">
  137. <view class="txt " :class="ite.carType==1?'ca':'cb'">{{kaType(ite.carType,carType)}}</view>
  138. </block>
  139. <!-- <view class="txt cb" v-if="ite.type==2">外来车辆</view> -->
  140. </view>
  141. <view class="clists">
  142. <block v-if="ite.carType==1">
  143. <view class="clist"><view class="tit">关联房号</view>{{ite.visitPortal}}</view>
  144. <view class="clist"><view class="tit">手机号码</view>{{ite.mobileNumber}}</view>
  145. </block>
  146. <view class="clist"><view class="tit">登记时间</view>{{ite.createTime}}</view>
  147. <view class="clist"><view class="tit">违停拍照</view>
  148. <view class="imgas" v-if="ite.illegalPhoto">
  149. <image :src="baseUrl+aite" v-for="(aite,aidx) in kaPhoto(ite.illegalPhoto)" :key="aidx" @click.stop="getPreview(aidx,ite.illegalPhoto)"></image>
  150. </view>
  151. </view>
  152. </view>
  153. </view>
  154. <view class="spdel" v-if="ite.right>0&&checkPermi(['wuYe:illegalParking:remove'])" @click.stop="getDelFn(ite.illegalParkingId)">删除</view>
  155. </view>
  156. </block>
  157. <view class="shax" v-if="wtdt">{{wtdt}}</view>
  158. </block>
  159. <!-- 无数据 -->
  160. <view class="nodata" v-else>
  161. <image :src="noiconpimg"></image>
  162. <view>
  163. 暂无数据
  164. </view>
  165. </view>
  166. </view>
  167. </template>
  168. <script>
  169. import {selectDictValue} from "@/utils/common.js"
  170. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  171. import config from '@/config'
  172. export default{
  173. props:{
  174. datainfo: {
  175. type: Array,
  176. default () {
  177. return []
  178. }
  179. },
  180. wtdt:{
  181. type:String,
  182. default () {
  183. return ''
  184. }
  185. },
  186. type:{
  187. type:String,
  188. default () {
  189. return 0
  190. }
  191. },
  192. clcxList:{
  193. type: Array,
  194. default () {
  195. return []
  196. }
  197. },
  198. rymmList:{
  199. type: Array,
  200. default () {
  201. return []
  202. }
  203. },
  204. carType:{
  205. type: Array,
  206. default () {
  207. return []
  208. }
  209. },
  210. tabval:{
  211. type:String,
  212. default () {
  213. return ''
  214. }
  215. }
  216. },
  217. data(){
  218. return{
  219. house:require("@/health/static/house.png"),
  220. housea:require("@/health/static/housea.png"),
  221. houseb:require("@/health/static/houseb.png"),
  222. housec:require("@/health/static/housec.png"),
  223. noiconpimg:require("@/static/images/nodata.png"),
  224. upimg:require("@/my/static/house/up.png"),
  225. cara:require("@/my/static/house/cara.png"),
  226. carb:require("@/my/static/house/carb.png"),
  227. caraa:require("@/my/static/house/caraa.png"),
  228. carbb:require("@/my/static/house/carbb.png"),
  229. edit:require("@/my/static/edit.png"),
  230. cira:require('@/news/static/complaint/cira.png'),
  231. cirb:require('@/news/static/complaint/cirb.png'),
  232. man:require("@/health/static/man.png"),
  233. woman:require("@/health/static/woman.png"),
  234. rimg:require("@/static/images/rimga.png"),
  235. baseUrl:config.baseUrl,
  236. delBtnWidth:66,//左滑默认宽度
  237. }
  238. },
  239. mounted() {
  240. },
  241. methods:{
  242. checkPermi, checkRole,
  243. kaType(data, list) {
  244. return selectDictValue(list, data);
  245. },
  246. kaPhoto(data){
  247. return data.split(',');
  248. },
  249. getDetail(e){
  250. this.$emit('getDetail',e)
  251. },
  252. getDelFn(e){
  253. var that=this;
  254. uni.showModal({
  255. title: '确认删除',
  256. content: "是否确认删除",
  257. cancelText: '取消',
  258. confirmText: '确认',
  259. success: function(res) {
  260. if (res.confirm) {
  261. that.$emit('getDelFn',e)
  262. } else if (res.cancel) {
  263. }
  264. }
  265. });
  266. },
  267. getSh(type,ite){
  268. var that=this;
  269. var str="";
  270. if(type=='2'){
  271. str="通过"
  272. }else if(type=='3'){
  273. str="不通过"
  274. }else if(type=='4'){
  275. str="下架"
  276. }
  277. uni.showModal({
  278. title: '确认'+str,
  279. content: "是否确认"+str,
  280. cancelText: '取消',
  281. confirmText: '确认',
  282. success: function(res) {
  283. if (res.confirm) {
  284. var obj={
  285. status:type,
  286. contentId:ite.contentId,
  287. commentId:ite.commentId,
  288. }
  289. that.$emit('getSh',obj)
  290. } else if (res.cancel) {
  291. }
  292. }
  293. });
  294. },
  295. getZhan(idx){
  296. // var obj=JSON.parse(JSON.stringify(this.datainfo))[idx]
  297. // obj.zhanflag=!obj.zhanflag;
  298. // this.datainfo.splice(idx,1,obj);
  299. this.datainfo[idx].zhanflag=!this.datainfo[idx].zhanflag
  300. },
  301. getDelFn(id){
  302. var that=this;
  303. uni.showModal({
  304. title: '确认删除',
  305. content: "是否确认删除",
  306. cancelText: '取消',
  307. confirmText: '确认',
  308. success: function(res) {
  309. if (res.confirm) {
  310. that.$emit('getDelFn',id)
  311. } else if (res.cancel) {
  312. }
  313. }
  314. });
  315. },
  316. getAgeFromID(idNumber) {
  317. if(idNumber){
  318. const birthDateStr = idNumber.substring(6, 14);
  319. const birthYear = parseInt(birthDateStr.substring(0, 4));
  320. const birthMonth = parseInt(birthDateStr.substring(4, 6));
  321. const birthDay = parseInt(birthDateStr.substring(6, 8));
  322. const today = new Date();
  323. const currentYear = today.getFullYear();
  324. const currentMonth = today.getMonth() + 1;
  325. const currentDay = today.getDate();
  326. let age = currentYear - birthYear;
  327. if (currentMonth < birthMonth || (currentMonth === birthMonth && currentDay < birthDay)) {
  328. age--;
  329. }
  330. return age;
  331. }
  332. },
  333. getPreview(idx,arr) {
  334. var newArr=[];
  335. var list=arr.split(',')
  336. list.forEach(ite=>{
  337. var ds=this.baseUrl+ite
  338. newArr.push(ds)
  339. })
  340. uni.previewImage({
  341. urls: newArr,
  342. current:idx,
  343. success: function(data) {},
  344. fail: function(err) {}
  345. });
  346. },
  347. //开始触摸滑动
  348. drawStart(e) {
  349. // console.log("开始触发");
  350. var touch = e.touches[0];
  351. this.startX = touch.clientX;
  352. },
  353. //触摸滑动
  354. drawMove(e) {
  355. var idx=e.currentTarget.dataset.idx
  356. var aidx=e.currentTarget.dataset.aidx
  357. var type=e.currentTarget.dataset.type;
  358. for (var index in this.datainfo) {
  359. if(type&&type=='peo'){
  360. for(var i in this.datainfo[idx].residentInfoList){
  361. this.$set(this.datainfo[idx].residentInfoList[i],'right',0);
  362. }
  363. }else{
  364. this.$set(this.datainfo[index],'right',0);
  365. }
  366. }
  367. var touch = e.touches[0];
  368. var item = this.datainfo[idx];
  369. var disX = this.startX - touch.clientX;
  370. if (disX >= 20) {
  371. if (disX > this.delBtnWidth) {
  372. disX = this.delBtnWidth;
  373. }
  374. if(type&&type=='peo'){
  375. this.$set(this.datainfo[idx].residentInfoList[aidx],'right',disX);
  376. }else{
  377. this.$set(this.datainfo[idx],'right',disX);
  378. }
  379. // this.csListArrl[idx].right=disX
  380. } else {
  381. // this.csListArrl[idx].right=0
  382. this.$set(this.datainfo[idx],'right',0);
  383. }
  384. },
  385. //触摸滑动结束
  386. drawEnd(e) {
  387. // console.log("滑动结束");
  388. var idx=e.currentTarget.dataset.idx
  389. var item = this.datainfo[idx];
  390. if (item.right >= this.delBtnWidth / 2) {
  391. // this.datainfo[idx].right=this.delBtnWidth
  392. // this.$set(this.datainfo[idx],'right',this.delBtnWidth);
  393. } else {
  394. this.datainfo[idx].right=0
  395. }
  396. },
  397. }
  398. }
  399. </script>
  400. <style lang="scss" scoped>
  401. .flex{display: flex;}
  402. .flexc{display: flex;align-items: center;}
  403. .mb10{margin-bottom: 20rpx;}
  404. .carlist{background: #FFFFFF;border-radius: 20rpx;margin-bottom: 24rpx;
  405. .carltop{min-height: 154rpx;border-bottom: 2rpx solid #E5E5E5;
  406. .cir{width: 8rpx;height: 8rpx;border-radius: 50%;margin: 0 8rpx;display: inline-block;}
  407. .co16{
  408. .cir{background: #16BE7F;}
  409. }
  410. .co01{
  411. .cir{background: #0156FE;}
  412. }
  413. .tit{font-weight: bold;font-size: 32rpx;}
  414. .txt{font-weight: 500;font-size: 26rpx;color: #272727;}
  415. .txtbtn{min-width: 82rpx;
  416. height: 32rpx;font-weight: 500;font-size: 20rpx;color: #45CB99;
  417. border-radius: 16rpx;border: 1px solid #45CB99;margin-left: 12rpx;}
  418. .cara{flex: 0 0 auto;width: 232rpx;height: 74rpx;margin-right: 40rpx;}
  419. .carb{flex: 0 0 auto;width: 278rpx;height: 130rpx;}
  420. }
  421. .carlf{padding:26rpx 0 10rpx;
  422. .clflist{font-weight: 500;font-size: 26rpx;color: #666666;margin-bottom: 16rpx;}
  423. }
  424. }
  425. .carlist{background: #FFFFFF;border-radius: 20rpx;margin-bottom: 24rpx;
  426. .ctop{border-bottom: 2rpx solid #E5E5E5;padding:26rpx 24rpx;
  427. .imgs{width: 40rpx;height: 42rpx;margin-right: 30rpx;}
  428. .tit{font-size: 32rpx;color: #272727;font-weight: bold;margin-right: 14rpx;}
  429. .txt{font-weight: 500;font-size: 26rpx;
  430. &.ca{color: #3565ED;}
  431. &.cb{color: #FE5A0E;}
  432. &.cc{color: #28C529;}
  433. }
  434. .txta{font-weight: 500;font-size: 24rpx;color: #AAAAAA;}
  435. .num{font-size: 24rpx;color: #AAAAAA;}
  436. }
  437. .btn{height: 34rpx;border-radius: 18rpx;display: flex;align-items: center;justify-content: center;padding: 0 10rpx;font-size: 22rpx;margin-right: 24rpx;
  438. &.btna{border: 2rpx solid #06C770;color: #06C770;}
  439. &.btnb{border: 2rpx solid #3565ED;color: #3565ED;}
  440. &.btnc{border: 2rpx solid #FE5A0E;color: #FE5A0E;}
  441. &.btnbga{border: 1px solid #0156FE;color: #3565ED;background: #DFEAFF;height: 36rpx;}
  442. &.btnbgb{border: 1px solid #C1C1C1;color: #666666;background: #F1F1F1;height: 36rpx;}
  443. &.btnbgc{border: 1px solid #FE5A0E;color:#FE5A0E;background:#FFEEE6;height: 36rpx;}
  444. }
  445. .clists{padding: 24rpx 24rpx 8rpx;
  446. .clist{font-weight: 500;margin-bottom: 16rpx;
  447. font-size: 26rpx;color: #272727;display: flex;line-height: 34rpx;
  448. .tit{font-size: 26rpx;color: #AAAAAA;flex: 0 0 auto;margin-right: 16rpx;min-width: 108rpx;text-align-last: justify;}
  449. .imgas{display: flex;align-items: center;flex-wrap: wrap;
  450. image{width: 142rpx;height: 142rpx;margin-right: 30rpx;margin-top: 8rpx;}
  451. }
  452. }
  453. .w50{
  454. .clist{width: 50%;}
  455. }
  456. }
  457. }
  458. // 收货地址
  459. .adrlist{border-bottom: 2rpx solid #E5E5E5;padding: 34rpx 0 34rpx 8rpx;
  460. .tit{font-weight: 500;font-size: 22rpx;color: #666666;}
  461. .txt{font-size: 28rpx;color: #272727;font-weight: bold;}
  462. .txts{font-weight: 500;font-size: 26rpx;color: #272727;}
  463. .btns{font-weight: 500;font-size: 22rpx;color: #0256FD;padding: 2rpx 14rpx;display:inline-block;background: #C9DBFF;
  464. border-radius: 10rpx;}
  465. .adrr{width: 40rpx;height: 40rpx;flex: 0 0 auto;margin-left: 12rpx;
  466. image{width: 22rpx;height: 22rpx;}
  467. }
  468. &.act{
  469. .tit{color: #0256FD;}
  470. .txt{color: #0256FD;}
  471. .txts{color: #0256FD;}
  472. }
  473. }
  474. // 人员
  475. .peolist{
  476. .ctop{padding: 24rpx 24rpx 22rpx;}
  477. .imgs{margin-right: 16rpx !important;}
  478. .tit{font-size: 28rpx !important;}
  479. .plists{padding: 30rpx 24rpx 6rpx;
  480. .plist{background: linear-gradient(-90deg, #F2F5FF 0%, #FBFDFF 100%);border-radius: 20rpx;border: 2rpx solid #E6E6E6;padding: 18rpx 26rpx 4rpx;width: 100%;z-index: 1;
  481. .head{width: 96rpx;height: 98rpx;margin-right: 32rpx;flex: 0 0 auto;}
  482. .ptit{font-weight: bold;font-size: 30rpx;color: #272727;display: flex;align-items: center;margin-bottom: 14rpx;}
  483. .ptxt{font-weight: 500;font-size: 26rpx;color: #666666;line-height: 36rpx;margin-bottom: 14rpx;min-width: 176rpx;}
  484. }
  485. }
  486. .upimg{width: 26rpx;height: 22rpx;display: block;transform: rotate(180deg);transition: all 0.3s;margin: 0 auto 18rpx;
  487. &.act{transform: rotate(0deg);}
  488. }
  489. }
  490. // 互动
  491. .pd12{padding: 24rpx;}
  492. // 无数据
  493. .nodata{display: flex;flex-direction: column;align-items: center;
  494. image{width: 440rpx;height: 440rpx;}
  495. view{font-size: 30rpx;color: #666666;font-weight: bold;}
  496. }
  497. </style>