index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
  1. <template>
  2. <div class="modifysend">
  3. <div class="top-add" @click="goNavigator()">
  4. <i class="iconfont icon-xinzeng"></i>
  5. <span class="txt">新增整改</span>
  6. </div>
  7. <van-tabs
  8. id="tabs"
  9. @change="getSelectedLoudong"
  10. @before-change="onBeforeChange"
  11. line-width="80rpx"
  12. title-active-color="#1D18BC"
  13. >
  14. <van-tab
  15. v-for="(item, index) in loudongList"
  16. :title="item.title"
  17. :name="item.name"
  18. :key="index"
  19. >
  20. </van-tab>
  21. </van-tabs>
  22. <div
  23. style="background: white; padding-top: 32rpx; padding: 0 32rpx"
  24. v-if="params.finishTypeMore == 2"
  25. >
  26. <uni-row>
  27. <uni-col :span="8">
  28. <div style="height: 70rpx; line-height: 70rpx">处理状态:</div>
  29. </uni-col>
  30. <uni-col :span="16">
  31. <picker
  32. @change="getFinishType"
  33. :value="params.finishTypeIndex"
  34. :range="finishStateList"
  35. range-key="text"
  36. >
  37. <view class="uni-select_2">
  38. {{
  39. params.finishTypeIndex === 0 || params.finishTypeIndex
  40. ? finishStateList[params.finishTypeIndex].text
  41. : "请选择"
  42. }}
  43. </view>
  44. </picker>
  45. </uni-col>
  46. </uni-row>
  47. <div style="margin-top: 16rpx">
  48. <uni-row>
  49. <uni-col :span="8">
  50. <div style="height: 70rpx; line-height: 70rpx">处理日期:</div>
  51. </uni-col>
  52. <uni-col :span="16">
  53. <uni-datetime-picker
  54. type="date"
  55. v-model="params.needFinishTime"
  56. @change="bindDateChange"
  57. :clear-icon="true"
  58. />
  59. <!-- <picker mode="date" @change="bindDateChange" style="float: left">
  60. <view class="uni-select_2">
  61. {{ !params.finishTime ? "请选择" : params.finishTime }}
  62. </view>
  63. finishTime
  64. </picker> -->
  65. </uni-col>
  66. </uni-row>
  67. </div>
  68. </div>
  69. <div class="info-findRectificationManagementInOutList">
  70. <checkbox-group @change="getIsCheckList">
  71. <div class="info-item" v-for="item in recordList" :key="item.id">
  72. <div class="info-top">
  73. <checkbox
  74. :value="item.id"
  75. :checked="item.isCheck"
  76. v-if="params.finishTypeMore == 1"
  77. />
  78. <div
  79. class="left"
  80. @click="jumpPageDetails(item.finishType, item.id)"
  81. >
  82. <img
  83. style="width: 90%; height: 90%; border-radius: 0.5rem"
  84. :src="
  85. item.infoMorePictureUrl != null &&
  86. item.infoMorePictureUrl.length > 0
  87. ? BASE_URI +
  88. '/FileController/download/' +
  89. item.infoMorePictureUrl[0]
  90. : ''
  91. "
  92. alt=""
  93. />
  94. </div>
  95. <div
  96. class="right"
  97. @click="jumpPageDetails(item.finishType, item.id)"
  98. >
  99. <p class="tit">
  100. {{ item.info }}
  101. </p>
  102. <p class="txt">创建时间:{{ item.createdAt }}</p>
  103. <!-- <p class="txt">{{ item.createdAt }}</p> -->
  104. <!-- <p class="txt">处理时间:{{ item.finishTime }}</p>
  105. <p class="txt">确认时间:{{ item.checkTime }}</p> -->
  106. </div>
  107. </div>
  108. <div class="info-bottom">
  109. <div class="left">
  110. <i class="iconfont icon-shijian"></i>
  111. <span>
  112. {{ item.updateAddress }}
  113. </span>
  114. </div>
  115. <div class="right">
  116. <span v-if="item.finishType == 1" class="normal-tip yd h-bg">
  117. 待派单
  118. </span>
  119. <span v-if="item.finishType == 2" class="normal-tip yd h-bg">
  120. 待处理
  121. </span>
  122. <span v-if="item.finishType == 3" class="normal-tip yd h-bg">
  123. 待确认
  124. </span>
  125. <span v-if="item.finishType == 4" class="normal-tip yd h-bg">
  126. 已完成
  127. </span>
  128. </div>
  129. </div>
  130. </div>
  131. </checkbox-group>
  132. <view class="‘btn-view‘" v-if="params.finishTypeMore == 1">
  133. <button class="btn" @click="modifysend()">任务派单</button>
  134. </view>
  135. </div>
  136. <select-dengjiyuan
  137. ref="selectDengjiyuan"
  138. :multiple="false"
  139. :range="range"
  140. :selectParent="false"
  141. :foldAll="true"
  142. rangeKey="name"
  143. idKey="id"
  144. @selectDengjiyuan="selectDengjiyuan"
  145. />
  146. </div>
  147. </template>
  148. <script>
  149. import {
  150. findRectificationManagementInOutList,
  151. getByCodes,
  152. getUserLocalStorageInfo,
  153. getSelectUserTwo,
  154. updateListRectificationManagement,
  155. } from "@/js_sdk/http.js";
  156. import tools from "../../subPackages/components/tkitree/tools.js";
  157. import selectDengjiyuan from "../../subPackages/components/select_dengjiyuan/tkitree.vue";
  158. // import Base from "@/pages/base/base";
  159. export default {
  160. data() {
  161. return {
  162. finishStateList: [
  163. { value: "", text: "全部" },
  164. { value: 2, text: "待处理" },
  165. { value: 3, text: "待确认" },
  166. { value: 4, text: "已完成" },
  167. ],
  168. range: [],
  169. isCheckList: [],
  170. loudongList: [
  171. { name: "1", title: "待派单" },
  172. { name: "2", title: "已派单" },
  173. ],
  174. BASE_URI: this.$constant.BASE_URI,
  175. dic_key: ["REPAIR_STATUS"],
  176. dic_SelectList: {},
  177. recordList: [],
  178. params: {
  179. openUser: getUserLocalStorageInfo().user.id,
  180. pageNum: 1,
  181. pageSize: 10,
  182. finishTypeMore: 1,
  183. },
  184. totalPage: 1,
  185. allData: [],
  186. findRectificationManagementInOutList: [
  187. {
  188. title: "关于组织2020年无锡市服务业提质增效资金项目申报的通知",
  189. name: "无锡 XXXX有限公司",
  190. date: "2020-09-18 19:34:06",
  191. type: "1",
  192. },
  193. {
  194. title:
  195. "关于组织2020年无锡市服务业提质增效资金项目申报的通知关于组织2020年无锡市服务业提质增效资金项目申报的通知",
  196. name: "无锡 XXXX有限公司",
  197. date: "2020-09-18 19:34:06",
  198. type: "2",
  199. },
  200. ],
  201. };
  202. },
  203. components: {
  204. selectDengjiyuan,
  205. },
  206. mounted() {
  207. // if (window.history && window.history.pushState) {
  208. // // 向历史记录中插入了当前页
  209. // history.pushState(null, null, document.URL);
  210. // window.addEventListener("popstate", this.goBack, false);
  211. // }
  212. },
  213. onLoad() {
  214. this.getByCodes();
  215. },
  216. onShow() {
  217. this.selectData();
  218. },
  219. methods: {
  220. getFinishType(e) {
  221. let that = this;
  222. that.params.finishType = that.finishStateList[e.detail.value].value;
  223. that.params.finishTypeIndex = e.detail.value;
  224. that.selectData();
  225. that.$forceUpdate();
  226. },
  227. bindDateChange(e) {
  228. let that = this;
  229. console.log(e);
  230. that.params.needFinishTime = e ? e : e;
  231. that.selectData();
  232. },
  233. getIsCheckList(e) {
  234. let that = this;
  235. that.isCheckList = e.detail.value;
  236. },
  237. selectDengjiyuan(e) {
  238. this.form.finishUserName = e[e.length - 1].name;
  239. this.form.finishUser = e[e.length - 1].id;
  240. this.$forceUpdate();
  241. },
  242. async modifysend() {
  243. let that = this;
  244. if (that.isCheckList.length == 0) {
  245. that.$showToast("请先选择要派发的整改");
  246. return;
  247. }
  248. let form = that.isCheckList.map((e) => {
  249. return {
  250. id: e,
  251. finishType: "2",
  252. updatedBy: getUserLocalStorageInfo().user.id,
  253. };
  254. });
  255. console.log(form);
  256. let data = await updateListRectificationManagement({
  257. entities: JSON.stringify(form),
  258. });
  259. if (data.code == 200) {
  260. that.$showToast("派单成功");
  261. that.selectData();
  262. }
  263. },
  264. async getSelectUserTwo(key) {
  265. let that = this;
  266. console.log(that.isCheckList);
  267. if (that.isCheckList.length == 0) {
  268. that.$showToast("请先选择要派发的整改");
  269. return;
  270. }
  271. let departmentList = await getSelectUserTwo("");
  272. that.range = tools.transData(
  273. departmentList.data,
  274. "id",
  275. "parentid",
  276. "children"
  277. );
  278. that.$refs[key]._show();
  279. that.$forceUpdate();
  280. },
  281. selectDengjiyuan(e) {
  282. var names = [];
  283. var ids = [];
  284. for (var p in e) {
  285. if (e[p].type == "u") {
  286. names.push(e[p].name);
  287. ids.push(e[p].id);
  288. }
  289. }
  290. this.form.xinxidengji = names.join(",");
  291. this.form.manageMessengerId = ids.join(",");
  292. },
  293. getSelectedLoudong(event) {
  294. let that = this;
  295. that.params = {
  296. openUser: getUserLocalStorageInfo().user.id,
  297. pageNum: 1,
  298. pageSize: 10,
  299. finishTypeMore: event.detail.name,
  300. };
  301. that.selectData();
  302. },
  303. goNavigator(id) {
  304. uni.navigateTo({
  305. url: "/pages/subPackages/modifyReport/add?isReport=" + 1,
  306. });
  307. },
  308. jumpPageDetails(type, id) {
  309. console.log(id);
  310. if (type == 4) {
  311. uni.navigateTo({
  312. url: "/pages/subPackages/modifyHandle/handle?id=" + id,
  313. });
  314. } else if (type == 3) {
  315. uni.navigateTo({
  316. url:
  317. "/pages/subPackages/modifySend/confirm?id=" +
  318. id +
  319. "&btnStatus=" +
  320. 1,
  321. });
  322. } else {
  323. uni.navigateTo({
  324. url:
  325. "/pages/subPackages/modifyReport/detail?id=" +
  326. id +
  327. "&pdStatus=" +
  328. 1,
  329. });
  330. }
  331. },
  332. async getByCodes() {
  333. let that = this;
  334. let data = await getByCodes(JSON.stringify(this.dic_key));
  335. that.dic_SelectList = that.$common.handleDicList(data);
  336. that.selectData();
  337. },
  338. // auth.currUser().id
  339. selectData() {
  340. const _this = this;
  341. findRectificationManagementInOutList(this.params).then((res) => {
  342. if (res) {
  343. res.rows.forEach((e) => {
  344. e.finishTime = this.$common.transServDay(e.finishTime);
  345. e.checkTime = !e.checkTime
  346. ? "暂无"
  347. : this.$common.transServDay(e.checkTime);
  348. e.updateAddress =
  349. e.updateAddress && e.updateAddress.length > 0
  350. ? e.updateAddress.replace("江苏省无锡市", "")
  351. : e.updateAddress;
  352. e.infoMorePictureUrl =
  353. e.infoMorePictureUrl && e.infoMorePictureUrl.length > 0
  354. ? e.infoMorePictureUrl.split(",")
  355. : [];
  356. e.createdAt = this.$common.transServDate(e.createdAt);
  357. console.log(e.infoMorePictureUrl);
  358. });
  359. this.recordList = res.rows;
  360. }
  361. });
  362. },
  363. getItemJson: function (item) {
  364. const fileUrls = item.fileUrl !== "" ? JSON.parse(item.fileUrl) : [];
  365. console.log(fileUrls);
  366. item.fileUrl = fileUrls;
  367. item.createdAt = this.$common.transServDate(item.createdAt);
  368. // console.log(item.status);
  369. // console.log(this.dic_SelectList.REPAIR_STATUS);
  370. // let index = this.dic_SelectList.REPAIR_STATUS.findIdex((e)=>e.value==item.status)
  371. // item.statusName = this.dic_SelectList.REPAIR_STATUS[index];
  372. return item;
  373. },
  374. /**
  375. *
  376. */
  377. quickSelect(item) {
  378. if (this.quickSleced.val && this.quickSleced.val === item.val) {
  379. this.quickSleced = {};
  380. } else {
  381. this.quickSleced = item;
  382. }
  383. },
  384. /**
  385. * 上传文件
  386. */
  387. afterRead(file) {
  388. console.log(file);
  389. },
  390. /**
  391. * 设置状态样式
  392. */
  393. setStatusStyle(status) {
  394. let statusClass = null;
  395. switch (status) {
  396. case "unAcceptance":
  397. statusClass = "pending-btn";
  398. break;
  399. case "acceptance":
  400. statusClass = "accepted-btn";
  401. break;
  402. case "processed":
  403. statusClass = "processed-btn";
  404. break;
  405. case "evaluated":
  406. statusClass = "evaluated-btn";
  407. break;
  408. }
  409. return statusClass;
  410. },
  411. },
  412. /**
  413. * 过滤器
  414. */
  415. filters: {
  416. /**
  417. * 状态:0、待受理 1、已受理 2、已处理 3、已评价
  418. */
  419. statusFilter(val) {
  420. let res = null;
  421. switch (val) {
  422. case "unAcceptance":
  423. res = "待处理";
  424. break;
  425. case "acceptance":
  426. res = "已受理";
  427. break;
  428. case "processed":
  429. res = "已处理";
  430. break;
  431. case "evaluated":
  432. res = "已评价";
  433. break;
  434. }
  435. return res;
  436. },
  437. },
  438. };
  439. </script>
  440. <style lang="scss" type="text/scss" scoped>
  441. .modifysend {
  442. .btn-view {
  443. width: 100%;
  444. height: 100rpx;
  445. padding: 20rpx 10%;
  446. background-color: #ffffff;
  447. position: fixed;
  448. bottom: 0;
  449. left: 0;
  450. }
  451. .uni-select_2 {
  452. font-size: 22rpx;
  453. border: 2px solid #e5e5e5;
  454. box-sizing: border-box;
  455. border-radius: 8rpx;
  456. padding: 0 10rpx;
  457. padding-left: 20rpx;
  458. position: relative;
  459. display: flex;
  460. -webkit-user-select: none;
  461. user-select: none;
  462. flex-direction: row;
  463. align-items: center;
  464. border-bottom: solid 2px #e5e5e5;
  465. width: 100%;
  466. flex: 1;
  467. height: 70rpx;
  468. color: #6a6a6a;
  469. }
  470. .btn {
  471. width: 80%;
  472. height: 90rpx;
  473. border-radius: 50rpx 50rpx 50rpx 50rpx;
  474. background: #1d18bc;
  475. line-height: 90rpx;
  476. color: white;
  477. }
  478. .top-add {
  479. background-color: #fff;
  480. padding: 30rpx;
  481. text-align: right;
  482. box-shadow: 0rpx 5rpx 10rpx 0rpx rgba(0, 0, 0, 0.05);
  483. i {
  484. font-size: 36rpx;
  485. color: $text6;
  486. margin-right: 15rpx;
  487. }
  488. .txt {
  489. font-size: 32rpx;
  490. color: $text6;
  491. }
  492. }
  493. .info-findRectificationManagementInOutList {
  494. height: calc(100vh - 124rpx);
  495. overflow-y: auto;
  496. .info-item {
  497. background-color: #fff;
  498. padding: 20rpx 30rpx;
  499. margin-bottom: 20rpx;
  500. .info-top {
  501. @include flex;
  502. .left {
  503. width: 286rpx;
  504. height: 168rpx;
  505. font-size: 0;
  506. border-radius: 10rpx;
  507. overflow: hidden;
  508. img {
  509. width: 100%;
  510. height: 100%;
  511. }
  512. }
  513. .right {
  514. align-self: flex-start;
  515. width: 380rpx;
  516. .tit {
  517. width: 380rpx;
  518. display: -webkit-box;
  519. -webkit-box-orient: vertical;
  520. -webkit-line-clamp: 2;
  521. overflow: hidden;
  522. text-overflow: ellipsis;
  523. font-size: 32rpx;
  524. line-height: 1.4;
  525. font-weight: bold;
  526. color: #333333;
  527. @include line-clamp;
  528. margin-bottom: 20rpx;
  529. }
  530. .txt {
  531. font-size: 28rpx;
  532. color: #666;
  533. }
  534. }
  535. }
  536. .info-bottom {
  537. margin-top: 20rpx;
  538. padding-top: 20rpx;
  539. border-top: 1rpx dashed #dbdbdb;
  540. @include flex;
  541. .left {
  542. i {
  543. font-size: 30rpx;
  544. color: #999999;
  545. margin-left: 10rpx;
  546. }
  547. span {
  548. font-size: 28rpx;
  549. color: #999999;
  550. }
  551. }
  552. .right {
  553. }
  554. }
  555. }
  556. }
  557. }
  558. </style>