factoryBuildingsList.vue 17 KB

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