index.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. <template>
  2. <view class="">
  3. <view class="bg-white">
  4. <image style="width: 100%;height: 340rpx;" src="/static/banner.jpg" ></image>
  5. </view>
  6. <!-- 社区管理 -->
  7. <view style="padding:40rpx 40rpx 10px" class=" flex bg-white">
  8. <u-icon name="xiaoqu" custom-prefix="custom-icon" size="36" color="#7dc7ae"></u-icon>
  9. <view style="font-size: 30rpx;" class="flex justify-center align-center text-bold padding-left-10">
  10. <text>社区管理</text>
  11. </view>
  12. </view>
  13. <view style="padding: 30rpx 10rpx 0rpx;" class="cu-list grid col-4 no-border" >
  14. <view class="cu-item " @click="jump(item.title)" v-for="(item,index) in gridList" :key="index">
  15. <view class="grid-icon" >
  16. <u-icon :name="item.name" custom-prefix="custom-icon" size="80" :color="item.color"></u-icon>
  17. </view>
  18. <text style="color: #333333;font-size: 26rpx;padding-top: 6rpx;padding-bottom: 20rpx;" >{{item.title}}</text>
  19. <view class="cu-tag bg-red badge" v-if="item.badge>0">{{item.badge}}</view>
  20. </view>
  21. </view>
  22. <!-- 物业服务 -->
  23. <view style="padding: 20rpx 0 20rpx 40rpx;" class=" flex bg-white">
  24. <u-icon size="40" name="daibanshixiang1" custom-prefix="custom-icon" color="#7dc7ae"></u-icon>
  25. <view style="font-size: 30rpx;" class="flex justify-center align-center text-bold padding-left-10">
  26. <text>物业服务</text>
  27. </view>
  28. </view>
  29. <view class="bg-white " style="padding: 0rpx 0 20rpx 0">
  30. <u-tabs bar-height="8" bar-width="80" active-color="#7dc7ae" :list="list" :is-scroll="false" :current="subsectionCurrent" @change="subsectionChange"></u-tabs>
  31. </view>
  32. <!-- 物业报修 -->
  33. <card v-if="subsectionCurrent==1" @handleRepair="handleRepair" :list="repairList"></card>
  34. <!-- 用户反馈 -->
  35. <feedback v-else :list="feedbackList"></feedback>
  36. <view class="flex justify-center " style="padding:30rpx 0 ">
  37. <view @click="more" class="cu-btn radius sm" style="border: 1rpx solid #7fc6ac;color: #7fc6ac;padding: 10rpx 40rpx;">
  38. 查看更多
  39. </view>
  40. </view>
  41. <!-- 详情 -->
  42. <u-popup v-model="popupShow" mode="center" width="650" :closeable="true" border-radius="10">
  43. <view style="padding: 60rpx 40rpx 10rpx;">
  44. <u-form label-width="150" :model="form" label-position="top">
  45. <u-form-item label="照片上传" >
  46. <view class="cu-form-group">
  47. <view class="grid col-4 grid-square flex-sub">
  48. <view class="bg-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage" :data-url="imgList[index]">
  49. <image :src="imgList[index]" mode="aspectFill"></image>
  50. <view class="cu-tag bg-red" @tap.stop="DelImg" :data-index="index">
  51. <text class='cuIcon-close'></text>
  52. </view>
  53. </view>
  54. <view class="solids" @tap="ChooseImage" v-if="imgList.length<4">
  55. <text class='cuIcon-cameraadd'></text>
  56. </view>
  57. </view>
  58. </view>
  59. </u-form-item>
  60. <u-form-item label="处理情况" required=true><u-input v-model="detail"/></u-form-item>
  61. </u-form>
  62. <view @click="submit()" class="flex cu-btn bg-blue" style="margin: 60rpx 0 10rpx;padding: 40rpx;">
  63. 确定
  64. </view>
  65. </view>
  66. </u-popup>
  67. </view>
  68. </template>
  69. <script>
  70. import card from "@/components/repair/repair"
  71. import feedback from "@/components/feedback/feedback"
  72. var _this = this;
  73. export default {
  74. components:{
  75. card,feedback
  76. },
  77. data() {
  78. return {
  79. //照片上传及处理情况
  80. imgList: [],
  81. imgMaxNum: 4,
  82. detail:'',
  83. detailTemp:{},
  84. //弹出
  85. popupShow:false,
  86. feedbackList:[],
  87. repairList:[],
  88. list:[
  89. {
  90. name:'用户反馈'
  91. },
  92. {
  93. name:'物业报修'
  94. }
  95. ],
  96. subsectionCurrent:0,
  97. gridList:[
  98. {
  99. color:'#9cc7c7',
  100. title:"小区管理",
  101. badge:0,
  102. name:'shequ'
  103. },
  104. {
  105. color:'#3dc159',
  106. title:"楼栋管理",
  107. badge:0,
  108. name:'loudong1'
  109. },
  110. {
  111. color:'#3dc159',
  112. title:"单元管理",
  113. badge:0,
  114. name:'tesecanyin'
  115. },
  116. {
  117. color:'#77b0cb',
  118. title:"房间管理",
  119. badge:0,
  120. name:'fangjianxinxi-'
  121. },
  122. {
  123. color:'#de9964',
  124. title:"住户管理",
  125. badge:0,
  126. name:'zhuhu'
  127. },
  128. {
  129. color:'#d2837d',
  130. title:"住户审核",
  131. badge:0,
  132. name:'zheng'
  133. },
  134. {
  135. color:'#7156bf',
  136. title:"车辆管理",
  137. badge:0,
  138. name:'cheliang1'
  139. },
  140. ]
  141. }
  142. },
  143. onLoad() {
  144. },
  145. onShow() {
  146. this.fetchUserFeedback()
  147. this.fetchRepairList()
  148. this.getApplyUserReadyCheckCount()
  149. },
  150. methods: {
  151. getApplyUserReadyCheckCount(){
  152. this.$api.dataStatistics.getApplyUserAccountWithCheckState().then(res=>{
  153. this.gridList[5].badge=res.data.applyUserReadyCheckCount
  154. })
  155. },
  156. /**
  157. * 处理工单
  158. */
  159. // handleRepair(item){
  160. // //已完成,待评价
  161. // console.log("item",item)
  162. // item.handleStatus=1
  163. // item.estimateStatus=0
  164. // this.$dialog.showModal('确定把该工单置为已处理状态?').then(res=>{
  165. // this.$api.estateRepair.submit(item).then(res=>{
  166. // this.$u.toast('操作成功')
  167. // this.fetchRepairList()
  168. // })
  169. // })
  170. // },
  171. /**
  172. * @param {Object} item
  173. * 点击处理工单
  174. */
  175. handleRepair(item){
  176. console.log("进入时item:", item)
  177. this.detailTemp = item,
  178. this.popupShow=true,
  179. this.imgList = [],
  180. this.detail = ''
  181. },
  182. /**
  183. * 确认提交工单情况s
  184. */
  185. submit(){
  186. this.detailTemp.picArr = this.imgList.join(",")
  187. console.log("临时item",this.detailTemp)
  188. // this.detailTemp.
  189. this.$showModel('确定把该工单置为已处理状态?').then(res=>{
  190. if(this.detail == ''){
  191. this.$u.toast('请填写处理情况')
  192. return
  193. }else{
  194. this.detailTemp.handleStatus=1,
  195. this.detailTemp.estimateStatus=0
  196. this.$api.estateRepair.submit(this.detailTemp).then(res=>{
  197. this.$u.toast('操作成功')
  198. this.mescroll.resetUpScroll()
  199. this.popupShow=false
  200. })
  201. }
  202. })
  203. },
  204. /**
  205. * @param {Object} index
  206. * 拍照或者从图库选择照片上传照片
  207. */
  208. ChooseImage() {
  209. _this = this;
  210. uni.chooseImage({
  211. count: 4, //默认9
  212. sizeType: ['original'], //可以指定是原图还是压缩图,默认二者都有
  213. sourceType: ['camera','album'], //从相机、相册选择
  214. success: (res) => {
  215. var tempFilePaths = res.tempFilePaths;
  216. if (_this.imgList.length+tempFilePaths.length > _this.imgMaxNum) {
  217. uni.showToast({
  218. title: '超过上传图片的最大数量',
  219. icon: 'none'
  220. })
  221. } else {
  222. if (_this.imgList.length != 0) {
  223. _this.imgList = _this.imgList.concat(res.tempFilePaths);
  224. } else {
  225. _this.imgList = res.tempFilePaths;
  226. }
  227. for (var i = 0; i < tempFilePaths.length; i++) {
  228. uni.uploadFile({
  229. url: "https://www.example.com/upload",
  230. filePath: tempFilePaths[i],
  231. name: "file", // 一定要与后台@RequestParam("file") MultipartFile变量名一致
  232. success(res) {
  233. console.log(res);
  234. }
  235. });
  236. }
  237. }
  238. }
  239. });
  240. },
  241. ViewImage(e) {
  242. uni.previewImage({
  243. urls: this.imgList,
  244. current: e.currentTarget.dataset.url
  245. });
  246. },
  247. DelImg(e) {
  248. this.imgList.splice(e.currentTarget.dataset.index, 1)
  249. },
  250. more(){
  251. if (this.subsectionCurrent==1) {
  252. uni.navigateTo({
  253. url:'../repair/list'
  254. })
  255. }else if (this.subsectionCurrent==0) {
  256. uni.navigateTo({
  257. url:'../feedback/list'
  258. })
  259. }
  260. },
  261. fetchUserFeedback(){
  262. let params={
  263. current:1,
  264. size:5
  265. }
  266. this.$api.userFeedBack.page(params).then(res=>{
  267. this.feedbackList=res.data.records
  268. })
  269. },
  270. fetchRepairList(){
  271. let params={
  272. current:1,
  273. size:20
  274. }
  275. this.$api.estateRepair.page(params).then(res=>{
  276. this.repairList=res.data.records
  277. })
  278. },
  279. subsectionChange(index){
  280. this.subsectionCurrent=index
  281. },
  282. jump(title){
  283. let url=''
  284. if (title=='小区管理') {
  285. url='/pages/residential/residential'
  286. }else if(title=='楼栋管理'){
  287. url='/pages/building/building'
  288. }else if (title=='单元管理') {
  289. url='/pages/unit/unit'
  290. }else if (title=='房间管理') {
  291. url='/pages/room/room'
  292. }else if (title=='住户管理') {
  293. url='/pages/user/user'
  294. }else if (title=='住户审核') {
  295. url='/pages/user-auth/user-auth'
  296. }else if (title=='车辆管理') {
  297. url='/pages/car/car'
  298. }
  299. if (!this.$isEmpty(url)) {
  300. uni.navigateTo({
  301. url:url,
  302. })
  303. }
  304. }
  305. }
  306. }
  307. </script>
  308. <style lang="scss">
  309. .nav-checked{
  310. background-color: #7fc6ac;
  311. color: #FFFFFF;
  312. font-weight: 800;
  313. }
  314. .nav-unchecked{
  315. background-color: #FFFFFF;
  316. color: #7fc6ac;
  317. }
  318. </style>