factoryBuildingsList.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811
  1. <template >
  2. <view>
  3. <view :class="['custom-header', { 'is-back': isBack }, bgColor]">
  4. <view class="back-container" @click="handleBack">
  5. <view class="back-text">返回</view>
  6. </view>
  7. <view class="content-container">
  8. <view class="content-text">{{title}}</view>
  9. </view>
  10. </view>
  11. <view class="line-box">
  12. <view :style="[{top:CustomBar + 'px'}]">
  13. <view class="search-box1">
  14. <view class="choose-box">
  15. <jp-picker2 class="choose-boxp" v-model="searchForm.park" empty="选择所在板块" rangeKey="label" rangeValue="value"
  16. :range="parkList2" @change="picker2change" >
  17. </jp-picker2>
  18. </view>
  19. <view class="choose-box22">
  20. <jp-picker2 class="choose-boxp" v-model="searchForm.idleArea" empty="选择闲置面积" rangeKey="label" rangeValue="value"
  21. :range="parkList" @change="picker2change">
  22. </jp-picker2>
  23. </view>
  24. </view>
  25. <view class="search-box" >
  26. <view class="choose-box2" style="margin-top: 10rpx;">
  27. <view style="width: 520rpx;">
  28. <input type="text" placeholder="输入厂房名称或企业名称" v-model="searchForm.name" confirm-type="search"
  29. ></input>
  30. </view>
  31. <text style="padding-left: 40rpx;flex: 1;" class="cuIcon-search color-white" @click="doSearch"></text>
  32. </view>
  33. </view>
  34. <mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" :up="upOption" @up="upCallback">
  35. <view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''"
  36. v-for="(item, index) in dataList" :key="index" @touchstart="ListTouchStart"
  37. @touchmove="ListTouchMove" @touchend="ListTouchEnd" :data-target="'move-box-' + index">
  38. <view class="item-box" @click="gotoBuildInfo(item.id)">
  39. <view class="item-title">
  40. <view>
  41. {{item.name}}
  42. </view>
  43. </view>
  44. <view class="item-line">
  45. <view class="item-name">{{item.des1}}-{{item.address}}</view>
  46. </view>
  47. <view class="item-line">
  48. <view class="item-name31" v-if="item.ownership=='1'">国有</view>
  49. <view class="item-name31" v-if="item.ownership=='2'">集体</view>
  50. <view class="item-name31" v-if="item.ownership=='3'">民营</view>
  51. <view class="item-name31" v-if="item.singleLayer=='1'">单层</view>
  52. <view class="item-name31" v-if="item.singleLayer=='2'">多层</view>
  53. </view>
  54. <view class="item-line">
  55. <text class="item-name2">闲置面积:{{item.idleArea}}㎡</text>
  56. <view class="item-name3"></view>
  57. </view>
  58. </view>
  59. </view>
  60. </mescroll-body>
  61. <uni-fab v-if="canAdd" :pattern=" {
  62. color: '#7A7E83',
  63. backgroundColor: '#fff',
  64. selectedColor: '#007AFF',
  65. buttonColor: '#007AFF'
  66. }" horizontal="right" vertical="bottom" @fabClick="add" >
  67. </uni-fab>
  68. </view>
  69. </view>
  70. </view>
  71. </template>
  72. <script>
  73. import loginService from "@/api/auth/loginService";
  74. import uniFab from '@/components/uni-fab/uni-fab.vue';
  75. import DoublePicker from '@/components/DoublePicker/DoublePicker.vue'
  76. import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
  77. import MescrollMoreItemMixin from "@/components/mescroll-uni/mixins/mescroll-more-item.js";
  78. import {mapActions} from 'vuex'
  79. export default {
  80. mixins: [MescrollMixin, MescrollMoreItemMixin], // 使用mixin (在main.js注册全局组件)
  81. name: "apps",
  82. components: {
  83. uniFab,
  84. DoublePicker
  85. },
  86. data() {
  87. return {
  88. isLogin:"",
  89. pageInfo: {},
  90. canAdd:false,
  91. loginid:"",
  92. title:"闲置厂房",
  93. isBack: true, // 是否显示返回按钮
  94. bgColor: 'bg-blue', // 背景颜色
  95. stype: "", // 企业 => 3 楼宇 => 2 园区 => 1 zfadmin => 4 admin=> 5
  96. md:"1",
  97. searchForm: {
  98. idleArea:"",
  99. park:'',
  100. name:"",
  101. },
  102. dataList: [], // 数据列表
  103. modalName: null,
  104. loading: false,
  105. parkList: [{label: '全部',value: ''},{label: '0-500㎡',value: '1'},{label: '500-1000㎡',value: '2'},
  106. {label: '1000-3000㎡',value: '3'},{label: '3000-5000㎡',value: '4'},{label: '大于5000㎡',value: '5'}],
  107. parkList2: [{label: '全部',value: ''},{label: '台创园',value: '1'},{label: '大冈',value: '2'},
  108. {label: '大纵湖',value: '3'},{label: '学富',value: '4'},{label: '尚庄',value: '5'},{label: '张庄',value: '6'},
  109. {label: '楼王',value: '7'},{label: '潘黄',value: '8'},{label: '盐渎',value: '9'},{label: '秦南',value: '10'},
  110. {label: '郭猛',value: '11'},{label: '高新区',value: '12'},{label: '龙冈',value: '13'}],
  111. };
  112. },
  113. onLoad(query) {
  114. if (query.parkid) {
  115. // 1. 先清空,避免残留
  116. this.searchForm.park = '';
  117. // 2. 等组件渲染完再赋值,触发 v-model 回显
  118. this.$nextTick(() => {
  119. if (query.parkid === '台创园') {
  120. this.searchForm.park = '1';
  121. } else if (query.parkid === '大冈镇'|| query.parkid === '大冈') {
  122. this.searchForm.park = '2';
  123. } else if (query.parkid === '大纵湖镇' || query.parkid === '大纵湖旅游度假区'|| query.parkid === '大纵湖') {
  124. this.searchForm.park = '3';
  125. } else if (query.parkid === '学富镇'|| query.parkid === '学富') {
  126. this.searchForm.park = '4';
  127. } else if (query.parkid === '尚庄镇'|| query.parkid === '尚庄') {
  128. this.searchForm.park = '5';
  129. } else if (query.parkid === '张庄街道'|| query.parkid === '张庄') {
  130. this.searchForm.park = '6';
  131. } else if (query.parkid === '楼王镇'|| query.parkid === '楼王') {
  132. this.searchForm.park = '7';
  133. } else if (query.parkid === '潘黄街道'|| query.parkid === '潘黄') {
  134. this.searchForm.park = '8';
  135. } else if (query.parkid === '盐渎街道'|| query.parkid === '盐渎') {
  136. this.searchForm.park = '9';
  137. } else if (query.parkid === '秦南镇'|| query.parkid === '秦南') {
  138. this.searchForm.park = '10';
  139. } else if (query.parkid === '郭猛镇'|| query.parkid === '郭猛') {
  140. this.searchForm.park = '11';
  141. } else if (query.parkid === '盐龙街道'|| query.parkid === '高新区') {
  142. this.searchForm.park = '12';
  143. } else if (query.parkid === '龙冈镇'|| query.parkid === '龙冈') {
  144. this.searchForm.park = '13';
  145. }
  146. });
  147. }
  148. },
  149. onShow() {
  150. this.isLogin=this.$auth.checkisLogin();
  151. //判断是否能新增
  152. if(this.isLogin!=null){
  153. this.getRole();
  154. }else{
  155. this.canAdd = true;
  156. }
  157. },
  158. created() {
  159. },
  160. methods: {
  161. ...mapActions(['refreshUserInfo']),
  162. /*获取数据列表 */
  163. upCallback(page) {
  164. this.loading = true
  165. loginService.factoryBuildingsList({
  166. current: page.num,
  167. size: page.size,
  168. orders: [{ column: 'a.create_date', asc: false }],
  169. ...this.searchForm
  170. }).then(({
  171. data
  172. }) => {
  173. let curPageData = data.records
  174. this.mescroll.endBySize(curPageData.length, data.total);
  175. //如果是第一页需手动制空列表
  176. if (page.num == 1)
  177. this.dataList = [];
  178. //追加新数据
  179. this.dataList = this.dataList.concat(curPageData);
  180. }).catch(e => {
  181. //联网失败, 结束加载
  182. this.mescroll.endErr();
  183. })
  184. },
  185. gotoBuildInfo(id) {
  186. uni.navigateTo({
  187. url: `/pages/factoryBuildings/factoryBuildingsInfo?id=${id}&ischeck=1`
  188. })
  189. },
  190. updateCities(newCities) {
  191. this.cities = newCities;
  192. },
  193. // 搜索
  194. doSearch() {
  195. this.dataList = []; // 先清空列表,显示加载进度
  196. this.mescroll.resetUpScroll();
  197. },
  198. picker2change(e) {
  199. this.doSearch() ;
  200. },
  201. totongxunlu(){
  202. uni.navigateTo({
  203. url: '/pages/comList/comList'
  204. })
  205. },
  206. totongxunlu2(){
  207. uni.showModal({
  208. title: '功能暂未开放,请至后台导入!',
  209. showCancel: true,
  210. success: (res) => {
  211. }
  212. });
  213. },
  214. getPageInfo() {
  215. loginService.InfoStatistics({}).then(({ data }) => {
  216. this.pageInfo = data;
  217. });
  218. },
  219. autoLogin(){
  220. console.log("登录id"+this.loginid);
  221. loginService.loginid( this.loginid).then(({data}) => {
  222. this.$store.commit('SET_TOKEN',data.token);
  223. this.refreshUserInfo();
  224. }).catch(e => {
  225. console.error(e)
  226. })
  227. },
  228. getRole() {
  229. let userInfo = uni.getStorageSync('WMS-userinfo')
  230. var officeId = userInfo.officeDTO.id;
  231. var roleIds = userInfo.roleIds;
  232. //区“企业大走访”办公室、政府管理员、厂房板块维护人员
  233. if (roleIds.indexOf("1910175386924417025") != -1||roleIds.indexOf("ade960e8f02544998b07397304c059c1") != -1||roleIds.indexOf("1996038972899717121") != -1) {
  234. this.canAdd = true;
  235. }
  236. },
  237. outloginset(){
  238. loginService.logout().then(({
  239. data
  240. }) => {
  241. this.$store.commit('logout');
  242. uni.clearStorage();
  243. })
  244. this.$store.commit('logout');
  245. uni.clearStorage();
  246. this.isLogin=this.$auth.checkisLogin();
  247. uni.hideLoading()
  248. },
  249. outlogin() {
  250. uni.showModal({
  251. title: '您确认退出么?',
  252. showCancel: true,
  253. success: (res) => {
  254. if (res.confirm) {
  255. uni.showLoading()
  256. this.outloginset();
  257. }
  258. }
  259. });
  260. },
  261. tces() {
  262. uni.navigateTo({
  263. url: '/pages/index/AudioToWord'
  264. })
  265. },
  266. // ListTouch触摸开始
  267. ListTouchStart(e) {
  268. this.listTouchStart = e.touches[0].pageX
  269. },
  270. // ListTouch计算方向
  271. ListTouchMove(e) {
  272. this.listTouchDirection = e.touches[0].pageX - this.listTouchStart > -60 ? 'right' : 'left'
  273. },
  274. // ListTouch计算滚动
  275. ListTouchEnd(e) {
  276. if (this.listTouchDirection == 'left') {
  277. this.modalName = e.currentTarget.dataset.target
  278. } else {
  279. this.modalName = null
  280. }
  281. this.listTouchDirection = null
  282. },
  283. handleBack() {
  284. // 返回逻辑,比如跳转至上一页
  285. this.$router.go(-1);
  286. },
  287. add(){
  288. if(this.isLogin==null){
  289. uni.showModal({
  290. title: '您还未登录,现在去登录?',
  291. showCancel: true,
  292. success: (res) => {
  293. if (res.confirm) {
  294. uni.showLoading()
  295. uni.reLaunch({
  296. url: '/pages/login/factorylogin'
  297. })
  298. }
  299. }
  300. });
  301. }else{
  302. uni.navigateTo({
  303. url: '/pages/factoryBuildings/factoryBuildingsInfo'
  304. })
  305. }
  306. }
  307. }
  308. }
  309. </script>
  310. <style>
  311. .page {
  312. height: 100vh;
  313. }
  314. .line-box {
  315. padding-left: 20rpx;
  316. padding-right: 20rpx;
  317. margin-top: 20rpx;
  318. }
  319. .mart-t {
  320. margin-top: 30rpx;
  321. }
  322. .center-box{
  323. margin-top: 20rpx;
  324. width: 100%;
  325. border-radius: 25rpx;
  326. border-radius: 25rpx;
  327. background: #fff;
  328. box-shadow: 0px 8px 16px 2px rgba(101, 101, 101, 0.2);
  329. padding-bottom: 30rpx;
  330. display: flex;
  331. flex-wrap: wrap;
  332. }
  333. .center-left-box {
  334. width: 100%;
  335. padding-bottom: 30rpx;
  336. display: flex;
  337. flex-wrap: wrap;
  338. }
  339. .btn-box-text {
  340. flex:1;
  341. height: 20rpx;
  342. text-align: center;
  343. color: #000000;
  344. font-size: 14px;
  345. font-weight: 700;
  346. }
  347. .btn-box-1 {
  348. flex:1;
  349. height: 30rpx;
  350. text-align: center;
  351. color: #36A7F3;
  352. font-size: x-large;
  353. font-weight: 700;
  354. }
  355. .btn-box-2 {
  356. flex:1;
  357. height: 30rpx;
  358. text-align: center;
  359. color:#F3365A;
  360. font-size: x-large;
  361. font-weight: 700;
  362. }
  363. .btn-box-3 {
  364. flex:1;
  365. height: 30rpx;
  366. text-align: center;
  367. color:#15D578;
  368. font-size: x-large;
  369. font-weight: 700;
  370. }
  371. .btn-box-4 {
  372. flex:1;
  373. height: 30rpx;
  374. text-align: center;
  375. color:#F1A31B;
  376. font-size: x-large;
  377. font-weight: 700;
  378. }
  379. .btn-Imbox {
  380. flex:1;
  381. height: 150rpx;
  382. padding-top: 8rpx;
  383. text-align: center;
  384. display: flex;
  385. flex-direction: column;
  386. justify-content: center; /* 子元素内部内容竖向居中 */
  387. align-items: center; /* 子元素内部内容水平居中 */
  388. text-align: center; /* 文字居中 */
  389. }
  390. .btn-Imbox p {
  391. font-size: 14px; /* 文字大小,可根据需要调整 */
  392. margin: 0; /* 去掉默认的外边距 */
  393. font-weight: 700;
  394. }
  395. .center-img{
  396. width: 90rpx;
  397. height: 90rpx;
  398. margin-bottom: 10rpx;
  399. text-align: center;
  400. }
  401. .center-img2{
  402. width: 70rpx;
  403. height: 70rpx;
  404. margin-top: 10rpx;
  405. margin-bottom: 20rpx;
  406. text-align: center;
  407. }
  408. .kuai-text{
  409. color: #000000;
  410. font-weight: 900;
  411. font-size: 34rpx;
  412. padding-top: 20rpx;
  413. padding-left: 20rpx;
  414. }
  415. .btn-box-5 {
  416. width: 337rpx;
  417. height: 200rpx;
  418. background-image: url('../../static/img/btn3.png');
  419. background-size: 100% 100%;
  420. }
  421. .btn-box-6 {
  422. width: 337rpx;
  423. height: 200rpx;
  424. background-image: url('../../static/img/btn6.png');
  425. background-size: 100% 100%;
  426. }
  427. .h-200 {
  428. height: 200rpx;
  429. }
  430. .swiper {
  431. width: 750rpx;
  432. height: 310rpx;
  433. }
  434. .swiper-item {
  435. width: 750rpx;
  436. height: 310rpx;
  437. background-color: aliceblue;
  438. }
  439. .font-size-35 {
  440. font-size: 35px !important;
  441. }
  442. .img-size {
  443. width: 80rpx;
  444. height: 80rpx;
  445. }
  446. .content-box {
  447. width: 437rpx;
  448. height: 200rpx;
  449. }
  450. .my-app .padding-sm {
  451. padding: 6px;
  452. }
  453. .grid .padding-sm .bg-white {
  454. box-shadow: 0 1px 4px #f9f9f9, 1px 1px 40px rgba(0, 0, 0, .06);
  455. }
  456. .bg-blue {
  457. background: #fff;
  458. color: #0081ff !important;
  459. }
  460. .text-white,
  461. .line-white,
  462. .lines-white {
  463. color: #0081ff !important;
  464. }
  465. .cu-bar .search-form {
  466. background-color: white;
  467. }
  468. .item-box{
  469. width: 710rpx;
  470. background: #FFFFFF;
  471. box-shadow: 0px 1px 3px 0px rgba(9,2,4,0.1);
  472. border-radius: 10px;
  473. padding-top: 20rpx;
  474. padding-left: 38rpx;
  475. padding-right: 10rpx;
  476. margin-top: 20rpx;
  477. }
  478. .item-title{
  479. position: relative;
  480. display: flex;
  481. justify-content: space-between;
  482. font-size: 30rpx;
  483. color: #010101;
  484. font-weight: bold;
  485. align-items: center;
  486. }
  487. .item-line{
  488. display: flex;
  489. height: 48rpx;
  490. margin-top: 20rpx;
  491. }
  492. .item-line2{
  493. height: 48rpx;
  494. margin-top: 20rpx;
  495. }
  496. .subtitle{
  497. color: #E5880E;
  498. }
  499. .item-name{
  500. margin-top: 5rpx;
  501. font-size: 29rpx;
  502. color: #666666;
  503. }
  504. .item-name2{
  505. font-size: 29rpx;
  506. color: #676D99;
  507. height: 40rpx; /* 这里假设两行的高度是80rpx */
  508. overflow: hidden; /* 超出部分隐藏 */
  509. text-overflow: ellipsis; /* 超出部分显示省略号 */
  510. display: -webkit-box; /* 使用Webkit的行盒模型 */
  511. -webkit-line-clamp: 1; /* 限制最多显示2行 */
  512. -webkit-box-orient: vertical; /* 垂直排列 */
  513. }
  514. .item-name3{
  515. display: flex;
  516. width: 100%;
  517. padding-right: 30rpx;
  518. flex: 1;
  519. justify-content: flex-end;
  520. font-size: 29rpx;
  521. color: #FF4500;
  522. }
  523. .item-name31{
  524. padding-right: 30rpx;
  525. font-size: 29rpx;
  526. color: #2E8B57;
  527. }
  528. .item-content{
  529. color: #1497EF;
  530. font-size: 30rpx;
  531. }
  532. .btn-box{
  533. display: flex;
  534. }
  535. .line-zs{
  536. width: 2rpx;
  537. height: 30rpx;
  538. background: #36A7F3;
  539. }
  540. .edit-botton{
  541. width: 100rpx;
  542. height: 48rpx;
  543. line-height: 48rpx;
  544. color: #fff;
  545. font-size: 28rpx;
  546. margin-right: 20rpx;
  547. border-radius: 10rpx;
  548. background: #5A9EE9;
  549. text-align: center;
  550. }
  551. .del-botton{
  552. width: 100rpx;
  553. height: 48rpx;
  554. line-height: 48rpx;
  555. color: #fff;
  556. font-size: 28rpx;
  557. margin-right: 20rpx;
  558. border-radius: 10rpx;
  559. background: #F27C85;
  560. text-align: center;
  561. }
  562. .color-white{
  563. color: #808080;
  564. font-size: 40rpx;
  565. line-height: 60rpx;
  566. }
  567. .search-box{
  568. padding-left: 20rpx;
  569. padding-right: 20rpx;
  570. padding-top: 20rpx;
  571. margin-top: 20rpx;
  572. width: 100%;
  573. border-radius: 25rpx;
  574. border-radius: 25rpx;
  575. background: #fff;
  576. box-shadow: 0px 8px 16px 2px rgba(101, 101, 101, 0.2);
  577. padding-bottom: 30rpx;
  578. display: flex;
  579. flex-wrap: wrap;
  580. }
  581. .search-box1{
  582. display: flex;
  583. }
  584. .input-box{
  585. background: #fff;
  586. height: 65rpx;
  587. width: 640rpx;
  588. display: flex;
  589. align-items: center;
  590. border-radius: 30rpx;
  591. padding-left: 30rpx;
  592. margin-right: 20rpx;
  593. }
  594. .input-boxinput{
  595. height: 75rpx;
  596. font-size: 15rpx;
  597. }
  598. .choose-box{
  599. background: #fff;
  600. width: 100%;
  601. border-radius: 23rpx;
  602. height: 70rpx;
  603. display: flex;
  604. align-items: center;
  605. justify-content: center;
  606. margin-right: 10rpx;
  607. border: 1rpx solid #808080;
  608. }
  609. .choose-box22{
  610. background: #fff;
  611. width: 100%;
  612. border-radius: 23rpx;
  613. margin-left: 10rpx;
  614. height: 70rpx;
  615. display: flex;
  616. align-items: center;
  617. justify-content: center;
  618. border: 1rpx solid #808080;
  619. }
  620. .choose-box2{
  621. background: #fff;
  622. width: 100%;
  623. border-radius: 23rpx;
  624. height: 70rpx;
  625. display: flex;
  626. padding-left: 29rpx;
  627. align-items: center;
  628. border: 1rpx solid #808080;
  629. }
  630. .choose-box3{
  631. display: flex;
  632. }
  633. .choose-boxp{
  634. font-size: 32rpx;
  635. width: 80%;
  636. text-align: right;
  637. }
  638. .fixed-bottom-right {
  639. padding: 20rpx;
  640. position: fixed;
  641. bottom: 20px; /* 距离底部的距离 */
  642. right: 20px; /* 距离右侧的距离 */
  643. }
  644. .custom-header {
  645. display: flex;
  646. align-items: center;
  647. justify-content: center;
  648. padding: 10px;
  649. width: 100%;
  650. }
  651. .is-back {
  652. position: relative;
  653. }
  654. .back-container {
  655. position: absolute;
  656. left: 10px;
  657. cursor: pointer;
  658. }
  659. .back-text {
  660. color: white; /* 返回按钮文本颜色 */
  661. }
  662. /* 背景颜色 */
  663. .bg-blue {
  664. background-color: #4285f4; /* 假设这是一个蓝色背景 */
  665. }
  666. .content-container {
  667. flex: 1;
  668. text-align: center;
  669. }
  670. .content-text {
  671. color: white; /* 标题文本颜色 */
  672. font-weight: bold;
  673. }
  674. </style>