list.vue 17 KB

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