index.vue 16 KB

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