list.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  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)"
  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>:幸福小区</view>
  21. <view class="walist"><view class="tit">报修门户</view>:{{ite.houseAddress}}</view>
  22. <view class="walist"><view class="tit">报修时间</view>:{{ite.repairTime}}</view>
  23. <view class="walist" v-if="ite.type==3"><view class="tit" >完成时间</view>:{{ite.completionTime}}</view>
  24. </view>
  25. <view class="wabtn" @click.stop="getDetail(ite.repairId)">
  26. <view>查看详情</view>
  27. <image :src="rimg"></image>
  28. </view>
  29. </view>
  30. <view class="spdel" v-if="ite.right>0&&checkPermi(['wuYe:repair:remove'])" @click.stop="getDelFn(ite.repairId)">删除</view>
  31. </view>
  32. </block>
  33. <!-- 访客 -->
  34. <block v-if="type=='visitor'">
  35. <view class="pr mb12" v-for="(ite,idx) in datainfo" :key="idx" @click="getDetail(ite.reservRecordId)" :data-idx="idx"
  36. @touchstart="drawStart" @touchmove="drawMove" @touchend="drawEnd" :style="'right:'+ite.right+'px'">
  37. <view class="vislist pr" style="z-index: 1;margin-bottom: 0;">
  38. <view class="vistop flexc mb12">
  39. <view class="tit flex0">{{ite.name}}</view>
  40. <view class="btns flex0" v-if="ite.isCar=='Y'">驾车</view>
  41. <view class="flex1"></view>
  42. <view class="txt flex0" :class="{'co01':ite.status==1,'coa':ite.status==2,'cof4':ite.status==3,}">{{kaType(ite.status,fkztList)}}</view>
  43. </view>
  44. <view class="vlist flexcw">
  45. <view>来访人数:{{ite.num}}人</view>
  46. <view>来访事由:{{ite.reason}}</view>
  47. <view>车牌号码:{{ite.plateNumber}}</view>
  48. <view>手机号码:{{ite.mobileNumber}}</view>
  49. <view>来访时间:{{ite.visitorTime}}</view>
  50. </view>
  51. </view>
  52. <view class="spdel" v-if="ite.right>0" @click.stop="getDelFn(ite.reservRecordId)">删除</view>
  53. </view>
  54. </block>
  55. <view class="shax" v-if="wtdt">{{wtdt}}</view>
  56. </block>
  57. <!-- 无数据 -->
  58. <view class="nodata" v-else>
  59. <image :src="noiconpimg"></image>
  60. <view>
  61. 暂无数据
  62. </view>
  63. </view>
  64. </view>
  65. </template>
  66. <script>
  67. import config from '@/config'
  68. import {selectDictValue} from "@/utils/common.js"
  69. import {checkPermi,checkRole} from "@/utils/permission"; // 权限判断函数
  70. export default{
  71. props:{
  72. datainfo: {
  73. type: Array,
  74. default () {
  75. return []
  76. }
  77. },
  78. wtdt:{
  79. type:String,
  80. default () {
  81. return ''
  82. }
  83. },
  84. type:{
  85. type:String,
  86. default () {
  87. return 0
  88. }
  89. },
  90. bxztList:{
  91. type:Array,
  92. default () {
  93. return []
  94. }
  95. },
  96. fkztList:{
  97. type:Array,
  98. default () {
  99. return []
  100. }
  101. },
  102. },
  103. data(){
  104. return{
  105. noiconpimg:require("@/static/images/nodata.png"),
  106. rimg:require('@/static/images/rimg.png'),
  107. baseUrl:config.baseUrl,
  108. delBtnWidth:66,//左滑默认宽度
  109. }
  110. },
  111. mounted() {
  112. },
  113. methods:{
  114. checkPermi,checkRole,
  115. kaType(data, list) {
  116. return selectDictValue(list, data);
  117. },
  118. getDetail(e){
  119. this.$emit('getDetail',e)
  120. },
  121. getPut(e){
  122. this.$emit('getPut',e)
  123. },
  124. getDelFn(id){
  125. var that=this;
  126. uni.showModal({
  127. title: '确认删除',
  128. content: "是否确认删除",
  129. cancelText: '取消',
  130. confirmText: '确认',
  131. success: function(res) {
  132. if (res.confirm) {
  133. that.$emit('getDelFn',id)
  134. } else if (res.cancel) {
  135. }
  136. }
  137. });
  138. },
  139. getPreview(idx,arr) {
  140. var newArr=[];
  141. arr.forEach(ite=>{
  142. var ds=this.baseUrl+ite
  143. newArr.push(ds)
  144. })
  145. uni.previewImage({
  146. urls: newArr,
  147. current:idx,
  148. success: function(data) {},
  149. fail: function(err) {}
  150. });
  151. },
  152. //开始触摸滑动
  153. drawStart(e) {
  154. // console.log("开始触发");
  155. var touch = e.touches[0];
  156. this.startX = touch.clientX;
  157. },
  158. //触摸滑动
  159. drawMove(e) {
  160. // console.log("滑动");
  161. for (var index in this.datainfo) {
  162. // this.csListArrl[index].right=0
  163. this.$set(this.datainfo[index],'right',0);
  164. }
  165. var idx=e.currentTarget.dataset.idx
  166. var touch = e.touches[0];
  167. var item = this.datainfo[idx];
  168. var disX = this.startX - touch.clientX;
  169. if (disX >= 20) {
  170. if (disX > this.delBtnWidth) {
  171. disX = this.delBtnWidth;
  172. }
  173. // this.csListArrl[idx].right=disX
  174. this.$set(this.datainfo[idx],'right',disX);
  175. } else {
  176. // this.csListArrl[idx].right=0
  177. this.$set(this.datainfo[idx],'right',0);
  178. }
  179. },
  180. //触摸滑动结束
  181. drawEnd(e) {
  182. // console.log("滑动结束");
  183. var idx=e.currentTarget.dataset.idx
  184. var item = this.datainfo[idx];
  185. if (item.right >= this.delBtnWidth / 2) {
  186. // this.datainfo[idx].right=this.delBtnWidth
  187. this.$set(this.datainfo[idx],'right',this.delBtnWidth);
  188. } else {
  189. this.datainfo[idx].right=0
  190. }
  191. },
  192. }
  193. }
  194. </script>
  195. <style lang="scss" scoped>
  196. .flex{display: flex;}
  197. .flexc{display: flex;align-items: center;}
  198. .mb10{margin-bottom: 20rpx;}
  199. // 报修
  200. .walists{background: #FFFFFF;border-radius: 20rpx;margin-bottom: 24rpx; position: relative;
  201. .watop{
  202. padding: 0 36rpx 8rpx 38rpx;
  203. .watit{padding: 24rpx 0;margin-bottom: 4rpx;display: flex;
  204. .tit{font-weight: bold;font-size: 28rpx;color: #272727;flex: 1;
  205. .cir{width: 14rpx;margin-left: 8rpx;margin-bottom: 10rpx;height: 14rpx;display: inline-block;background: #FF6969;border-radius: 8rpx;}
  206. }
  207. .txt{font-weight: bold;font-size: 26rpx;flex: 0 0 auto;
  208. }
  209. }
  210. }
  211. .walist{display: flex;font-weight: 500;font-size: 24rpx;color: #666666;margin-bottom: 16rpx;
  212. .tit{min-width: 100rpx;text-align-last: justify}
  213. }
  214. .wabtn{display: flex;align-items: center;justify-content: space-between;border-top: 2rpx solid #E5E5E5;height: 80rpx;padding: 0 38rpx;
  215. view{font-weight: 500;font-size: 24rpx;color: #666666;}
  216. image{width: 16rpx;height: 28rpx;}
  217. }
  218. }
  219. .vislist{background: #FFFFFF;border-radius: 20rpx;margin-bottom: 24rpx;padding: 26rpx 38rpx 12rpx;
  220. .vistop{
  221. .tit{font-size: 28rpx;color: #272727;font-weight: bold;}
  222. .btns{min-width: 70rpx;font-weight: 500;
  223. 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;}
  224. .txt{font-weight: bold;font-size: 26rpx;margin-left: 18rpx;}
  225. }
  226. .vlist{
  227. view{font-weight: 500;font-size: 24rpx;color: #666666;margin-bottom: 16rpx;flex: 0 1 auto;min-width: 50%;}
  228. }
  229. }
  230. // 无数据
  231. .nodata{display: flex;flex-direction: column;align-items: center;
  232. image{width: 440rpx;height: 440rpx;}
  233. view{font-size: 30rpx;color: #666666;font-weight: bold;}
  234. }
  235. </style>