list.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. <template>
  2. <view>
  3. <!-- 第一种样式 人员管理-->
  4. <block v-if="datainfo.length>0">
  5. <!-- 报修管理 -->
  6. <block v-if="type=='warranty'">
  7. <view class="walists" v-for="(ite,idx) in datainfo" :key="idx" @click="getPut(ite.repairId,ite.repairStatus)"
  8. :data-idx="idx"
  9. @touchstart="drawStart" @touchmove="drawMove" @touchend="drawEnd" :style="'right:'+ite.right+'px'"
  10. >
  11. <view class="delleft">
  12. <view class="watop ">
  13. <view class="watit">
  14. <view class="tit">{{ite.repairTitle}}</view>
  15. <view class="txt co01":class="{'co01':ite.repairStatus=='1','coa':ite.repairStatus=='3','co28':ite.repairStatus=='3'}">{{kaType(ite.repairStatus,bxztList)}}</view>
  16. <!-- <view class="txt co01" v-if="ite.type==1">待分派</view>
  17. <view class="txt coa" v-if="ite.type==3">已完成</view>
  18. <view class="txt co28" v-if="ite.type==2">处理中</view> -->
  19. </view>
  20. <!-- <view class="walist"><view class="tit">小区名称</view>:{{ite.communityName}}</view> -->
  21. <view class="walist"><view class="tit">项目</view>:{{kaType(ite.maintenanceCategory,bxlbList)}}</view>
  22. <view class="walist"><view class="tit">报修门户</view>:{{ite.houseAddress}}</view>
  23. <view class="walist"><view class="tit">报修时间</view>:{{ite.repairTime}}</view>
  24. <view class="walist" v-if="ite.type==3"><view class="tit" >完成时间</view>:{{ite.completionTime}}</view>
  25. </view>
  26. <view class="wabtn" @click.stop="getDetail(ite.repairId)">
  27. <view>查看详情</view>
  28. <image :src="rimg"></image>
  29. </view>
  30. </view>
  31. <view class="spdel" v-if="ite.right>0&&checkPermi(['wuYe:repair:remove'])&&ite.repairStatus<4" @click.stop="getDelFn(ite.repairId)">撤销</view>
  32. </view>
  33. </block>
  34. <!-- 访客 -->
  35. <block v-if="type=='visitor'">
  36. <view class="pr mb12" v-for="(ite,idx) in datainfo" :key="idx" @click="getDetail(ite.reservRecordId)" :data-idx="idx"
  37. @touchstart="drawStart" @touchmove="drawMove" @touchend="drawEnd" :style="'right:'+ite.right+'px'">
  38. <view class="vislist pr" style="z-index: 1;margin-bottom: 0;">
  39. <view class="vistop flexc mb12">
  40. <view class="tit flex0">{{ite.name}}</view>
  41. <view class="btns flex0" v-if="ite.isCar=='Y'">驾车</view>
  42. <view class="flex1"></view>
  43. <view class="txt flex0" :class="{'co01':ite.status==1,'coa':ite.status==2,'cof4':ite.status==3,}">{{kaType(ite.status,fkztList)}}</view>
  44. </view>
  45. <view class="vlist flexcw">
  46. <view>来访人数:{{ite.num}}人</view>
  47. <view>来访事由:{{ite.reason}}</view>
  48. <view>车牌号码:{{ite.plateNumber}}</view>
  49. <view>手机号码:{{ite.mobileNumber}}</view>
  50. <view>来访时间:{{ite.visitorTime}}</view>
  51. </view>
  52. </view>
  53. <view class="spdel" v-if="ite.right>0" @click.stop="getDelFn(ite.reservRecordId)">删除</view>
  54. </view>
  55. </block>
  56. <view class="shax" v-if="wtdt">{{wtdt}}</view>
  57. </block>
  58. <!-- 无数据 -->
  59. <view class="nodata" v-else>
  60. <image :src="noiconpimg"></image>
  61. <view>
  62. 暂无数据
  63. </view>
  64. </view>
  65. </view>
  66. </template>
  67. <script>
  68. import config from '@/config'
  69. import {selectDictValue} from "@/utils/common.js"
  70. import {checkPermi,checkRole} from "@/utils/permission"; // 权限判断函数
  71. export default{
  72. props:{
  73. datainfo: {
  74. type: Array,
  75. default () {
  76. return []
  77. }
  78. },
  79. wtdt:{
  80. type:String,
  81. default () {
  82. return ''
  83. }
  84. },
  85. type:{
  86. type:String,
  87. default () {
  88. return 0
  89. }
  90. },
  91. bxztList:{
  92. type:Array,
  93. default () {
  94. return []
  95. }
  96. },
  97. fkztList:{
  98. type:Array,
  99. default () {
  100. return []
  101. }
  102. },
  103. bxlbList:{
  104. type:Array,
  105. default () {
  106. return []
  107. }
  108. }
  109. },
  110. data(){
  111. return{
  112. noiconpimg:require("@/static/images/nodata.png"),
  113. rimg:require('@/static/images/rimg.png'),
  114. baseUrl:config.baseUrl,
  115. delBtnWidth:66,//左滑默认宽度
  116. }
  117. },
  118. mounted() {
  119. },
  120. methods:{
  121. checkPermi,checkRole,
  122. kaType(data, list) {
  123. return selectDictValue(list, data);
  124. },
  125. getDetail(e){
  126. this.$emit('getDetail',e)
  127. },
  128. getPut(e,type){
  129. if(type>1){
  130. this.$emit('getDetail',e)
  131. }else{
  132. this.$emit('getPut',e)
  133. }
  134. },
  135. getDelFn(id){
  136. var that=this;
  137. uni.showModal({
  138. title: '确认删除',
  139. content: "是否确认删除",
  140. cancelText: '取消',
  141. confirmText: '确认',
  142. success: function(res) {
  143. if (res.confirm) {
  144. that.$emit('getDelFn',id)
  145. } else if (res.cancel) {
  146. }
  147. }
  148. });
  149. },
  150. getPreview(idx,arr) {
  151. var newArr=[];
  152. arr.forEach(ite=>{
  153. var ds=this.baseUrl+ite
  154. newArr.push(ds)
  155. })
  156. uni.previewImage({
  157. urls: newArr,
  158. current:idx,
  159. success: function(data) {},
  160. fail: function(err) {}
  161. });
  162. },
  163. //开始触摸滑动
  164. drawStart(e) {
  165. // console.log("开始触发");
  166. var touch = e.touches[0];
  167. this.startX = touch.clientX;
  168. },
  169. //触摸滑动
  170. drawMove(e) {
  171. // console.log("滑动");
  172. for (var index in this.datainfo) {
  173. // this.csListArrl[index].right=0
  174. this.$set(this.datainfo[index],'right',0);
  175. }
  176. var idx=e.currentTarget.dataset.idx
  177. var touch = e.touches[0];
  178. var item = this.datainfo[idx];
  179. var disX = this.startX - touch.clientX;
  180. if (disX >= 20) {
  181. if (disX > this.delBtnWidth) {
  182. disX = this.delBtnWidth;
  183. }
  184. // this.csListArrl[idx].right=disX
  185. this.$set(this.datainfo[idx],'right',disX);
  186. } else {
  187. // this.csListArrl[idx].right=0
  188. this.$set(this.datainfo[idx],'right',0);
  189. }
  190. },
  191. //触摸滑动结束
  192. drawEnd(e) {
  193. // console.log("滑动结束");
  194. var idx=e.currentTarget.dataset.idx
  195. var item = this.datainfo[idx];
  196. if (item.right >= this.delBtnWidth / 2) {
  197. // this.datainfo[idx].right=this.delBtnWidth
  198. this.$set(this.datainfo[idx],'right',this.delBtnWidth);
  199. } else {
  200. this.datainfo[idx].right=0
  201. }
  202. },
  203. }
  204. }
  205. </script>
  206. <style lang="scss" scoped>
  207. .flex{display: flex;}
  208. .flexc{display: flex;align-items: center;}
  209. .mb10{margin-bottom: 20rpx;}
  210. // 报修
  211. .walists{background: #FFFFFF;border-radius: 20rpx;margin-bottom: 24rpx; position: relative;
  212. .watop{
  213. padding: 0 36rpx 8rpx 38rpx;
  214. .watit{padding: 24rpx 0;margin-bottom: 4rpx;display: flex;
  215. .tit{font-weight: bold;font-size: 28rpx;color: #272727;flex: 1;
  216. .cir{width: 14rpx;margin-left: 8rpx;margin-bottom: 10rpx;height: 14rpx;display: inline-block;background: #FF6969;border-radius: 8rpx;}
  217. }
  218. .txt{font-weight: bold;font-size: 26rpx;flex: 0 0 auto;
  219. }
  220. }
  221. }
  222. .walist{display: flex;font-weight: 500;font-size: 24rpx;color: #666666;margin-bottom: 16rpx;
  223. .tit{min-width: 100rpx;text-align-last: justify}
  224. }
  225. .wabtn{display: flex;align-items: center;justify-content: space-between;border-top: 2rpx solid #E5E5E5;height: 80rpx;padding: 0 38rpx;
  226. view{font-weight: 500;font-size: 24rpx;color: #666666;}
  227. image{width: 16rpx;height: 28rpx;}
  228. }
  229. }
  230. .vislist{background: #FFFFFF;border-radius: 20rpx;margin-bottom: 24rpx;padding: 26rpx 38rpx 12rpx;
  231. .vistop{
  232. .tit{font-size: 28rpx;color: #272727;font-weight: bold;}
  233. .btns{min-width: 70rpx;font-weight: 500;
  234. font-size: 20rpx;padding: 0 8rpx;box-sizing: border-box;text-align: center;margin-left: 18rpx;color: #00B861;border-radius: 16rpx;border: 2rpx solid #0AC86E;}
  235. .txt{font-weight: bold;font-size: 26rpx;margin-left: 18rpx;}
  236. }
  237. .vlist{
  238. view{font-weight: 500;font-size: 24rpx;color: #666666;margin-bottom: 16rpx;flex: 0 1 auto;min-width: 50%;}
  239. }
  240. }
  241. .carlist{background: #FFFFFF;border-radius: 20rpx;margin-bottom: 24rpx;
  242. .carltop{min-height: 154rpx;border-bottom: 2rpx solid #E5E5E5;
  243. .tit{font-weight: bold;font-size: 32rpx;}
  244. .txt{font-weight: 500;font-size: 26rpx;color: #272727;}
  245. .txtbtn{min-width: 82rpx;
  246. height: 32rpx;font-weight: 500;font-size: 20rpx;color: #45CB99;
  247. border-radius: 16rpx;border: 1px solid #45CB99;margin-left: 12rpx;}
  248. .cara{flex: 0 0 auto;width: 232rpx;height: 74rpx;margin-right: 40rpx;}
  249. .carb{flex: 0 0 auto;width: 278rpx;height: 130rpx;}
  250. }
  251. .carlf{padding:26rpx 0 10rpx;
  252. .clflist{font-weight: 500;font-size: 26rpx;color: #666666;margin-bottom: 16rpx;}
  253. }
  254. .ctop{border-bottom: 2rpx solid #E5E5E5;padding:26rpx 24rpx;
  255. .imgs{width: 40rpx;height: 42rpx;margin-right: 30rpx;}
  256. .tit{font-size: 32rpx;color: #272727;font-weight: bold;margin-right: 14rpx;}
  257. .txt{font-weight: 500;font-size: 26rpx;
  258. &.ca{color: #3565ED;}
  259. &.cb{color: #FE5A0E;}
  260. &.cc{color: #28C529;}
  261. }
  262. .txta{font-weight: 500;font-size: 24rpx;color: #AAAAAA;}
  263. .num{font-size: 24rpx;color: #AAAAAA;}
  264. }
  265. .btn{height: 34rpx;border-radius: 18rpx;display: flex;align-items: center;justify-content: center;padding: 0 10rpx;font-size: 22rpx;margin-right: 24rpx;
  266. &.btna{border: 2rpx solid #06C770;color: #06C770;}
  267. &.btnb{border: 2rpx solid #3565ED;color: #3565ED;}
  268. &.btnc{border: 2rpx solid #FE5A0E;color: #FE5A0E;}
  269. &.btnbga{border: 1px solid #0156FE;color: #3565ED;background: #DFEAFF;height: 36rpx;}
  270. &.btnbgb{border: 1px solid #C1C1C1;color: #666666;background: #F1F1F1;height: 36rpx;}
  271. &.btnbgc{border: 1px solid #FE5A0E;color:#FE5A0E;background:#FFEEE6;height: 36rpx;}
  272. }
  273. .clists{padding: 24rpx 24rpx 8rpx;
  274. .clist{font-weight: 500;margin-bottom: 16rpx;
  275. font-size: 26rpx;color: #272727;display: flex;line-height: 34rpx;
  276. .tit{font-size: 26rpx;color: #AAAAAA;flex: 0 0 auto;margin-right: 16rpx;min-width: 108rpx;text-align-last: justify;}
  277. .imgas{display: flex;align-items: center;flex-wrap: wrap;
  278. image{width: 142rpx;height: 142rpx;margin-right: 30rpx;margin-top: 8rpx;}
  279. }
  280. }
  281. .w50{
  282. .clist{width: 50%;}
  283. }
  284. }
  285. }
  286. // 物业费
  287. .mlistl{width: 40%;display: flex;flex-direction: column;align-items: center;flex: 0 0 auto;
  288. .mltit{font-weight: 500;font-size: 26rpx;color: #666666;margin-bottom: 18rpx;}
  289. .mltxt{font-weight: bold;font-size: 32rpx;color: #0156FE;}
  290. }
  291. // 无数据
  292. .nodata{display: flex;flex-direction: column;align-items: center;
  293. image{width: 440rpx;height: 440rpx;}
  294. view{font-size: 30rpx;color: #666666;font-weight: bold;}
  295. }
  296. </style>