factoryBuildingsList.vue 15 KB

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