questionList.vue 16 KB

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