handle.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620
  1. <template>
  2. <div class="addcompany">
  3. <div class="list" style="padding-bottom: 500rpx">
  4. <div class="list-row" style="padding-top: 0">
  5. <div style="height: auto" class="width100">
  6. <div class="width100 mt24rpx padb24rpx border_bottom_ccc list_date">
  7. <textarea
  8. :disabled="id != null"
  9. v-model="form.info"
  10. :maxlength="2000"
  11. placeholder="请输入"
  12. type="textarea"
  13. style="
  14. height: 200rpx;
  15. background: rgba(249, 249, 249, 1);
  16. padding: 20rpx;
  17. width: calc(100% - 40rpx);
  18. "
  19. />
  20. <div
  21. style="
  22. background: rgba(249, 249, 249, 1);
  23. text-align: right;
  24. padding-right: 10px;
  25. padding-bottom: 10rpx;
  26. "
  27. >
  28. {{ form.info.length }}/2000
  29. </div>
  30. </div>
  31. <div
  32. class="width100 mt24rpx padb24rpx border_bottom_ccc list_date display_flex"
  33. style="display: flex"
  34. >
  35. <div class="input_title float_left">
  36. <span style="color: red">*&nbsp;</span>
  37. 整改位置
  38. </div>
  39. <div
  40. @click="getCurrentLocal()"
  41. class="float_left width60 first_title font28rpx"
  42. style="color: #777; height: auto"
  43. >
  44. <div
  45. style="color: #777; height: auto; width: 80%"
  46. class="float_left input_value"
  47. >
  48. {{ form.updateAddress }}
  49. </div>
  50. </div>
  51. </div>
  52. <div
  53. class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height40rpx"
  54. >
  55. <div class="input_title float_left">
  56. <span style="color: red">*</span>
  57. 处理人
  58. </div>
  59. <view style="color: #777" class="input_value float_left">
  60. {{ !form.finishUserName ? "请选择" : form.finishUserName }}
  61. </view>
  62. </div>
  63. <div
  64. class="width100 mt24rpx padb24rpx border_bottom_ccc list_date"
  65. style="display: flex"
  66. >
  67. <div class="input_title float_left">
  68. <span style="color: red">*</span>
  69. 发布人
  70. </div>
  71. <view
  72. style="color: #777; display: flex; height: auto"
  73. class="input_value float_left"
  74. >
  75. {{ form.openUserDeptName }}
  76. -
  77. {{ form.openUserName }}
  78. -
  79. <!-- {{ form.openUserPhone }} -->
  80. 0510-13921516068
  81. <TelNum :num="form.openUserPhone" :showTel="false" />
  82. </view>
  83. </div>
  84. <div
  85. class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height40rpx"
  86. >
  87. <div class="input_title float_left">要求处理日期</div>
  88. <div
  89. class="float_left width60 whitespacenowrap first_title height50rpx font28rpx"
  90. style="color: #777"
  91. >
  92. {{ form.needFinishTime == "null" ? "不限" : form.needFinishTime }}
  93. </div>
  94. </div>
  95. <div class="width100 mt24rpx border_bottom_ccc list_date">
  96. <div class="input_title">整改处理前照片</div>
  97. <div style="margin-top: 24rpx">(支持图片上传10M内,最多6张)</div>
  98. <div
  99. class="custom-image-box"
  100. style="margin-top: 20rpx; margin-bottom: 36rpx"
  101. >
  102. <van-uploader
  103. :multiple="true"
  104. :file-list="form.infoMorePictureUrlList"
  105. :deletable="false"
  106. :show-upload="true"
  107. disabled
  108. />
  109. </div>
  110. </div>
  111. <view class="width100 mt24rpx padb24rpx list_date height300rpx">
  112. <view class="input_title mb16rpx">处理结果:</view>
  113. <textarea
  114. v-model="form.finishInfo"
  115. :maxlength="2000"
  116. placeholder="请输入"
  117. type="textarea"
  118. style="
  119. height: 200rpx;
  120. background: rgba(249, 249, 249, 1);
  121. padding: 20rpx;
  122. width: calc(100% - 40rpx);
  123. "
  124. />
  125. <div
  126. style="
  127. background: rgba(249, 249, 249, 1);
  128. text-align: right;
  129. padding-right: 10px;
  130. padding-bottom: 10rpx;
  131. "
  132. >
  133. {{ form.finishInfo.length }}/2000
  134. </div>
  135. </view>
  136. <div class="width100 mt24rpx border_bottom_ccc list_date">
  137. <div class="input_title">整改处理后照片</div>
  138. <div style="margin-top: 24rpx">(支持图片上传10M内,最多6张)</div>
  139. <div
  140. class="custom-image-box"
  141. style="margin-top: 20rpx; margin-bottom: 36rpx"
  142. >
  143. <van-uploader
  144. :max-count="6"
  145. :show-upload="true"
  146. @delete="deleteRYXXZP"
  147. :deletable="form.finishType != 4"
  148. :file-list="form.finishPictureUrlList"
  149. @after-read="uploadfinishPictureUrl"
  150. />
  151. </div>
  152. </div>
  153. </div>
  154. </div>
  155. <div class="save_button" @click="save()" v-if="form.finishType == 2">
  156. 提交
  157. </div>
  158. </div>
  159. <select-dengjiyuan
  160. ref="selectDengjiyuan"
  161. :multiple="false"
  162. :range="range"
  163. :selectParent="false"
  164. :foldAll="true"
  165. rangeKey="name"
  166. idKey="id"
  167. @selectDengjiyuan="selectDengjiyuan"
  168. />
  169. <multiple-select
  170. v-model="show"
  171. :data="companyAllList"
  172. :default-selected="defaultSelected"
  173. @confirm="confirm"
  174. ></multiple-select>
  175. </div>
  176. </template>
  177. <script>
  178. const form = {
  179. finishType: "3",
  180. finishInfo: "",
  181. info: "",
  182. infoMorePictureUrlList: [],
  183. finishPictureUrlList: [],
  184. testTypeIndex: 0,
  185. year: "2023",
  186. carDate: "2023-06-30",
  187. remark: "",
  188. checkInfo: "",
  189. updateAddressY: "",
  190. updateAddressX: "",
  191. updateAddress: "",
  192. };
  193. import TelNum from "../../subPackages/components/tel-number";
  194. import multipleSelect from "../../subPackages/components/momo-multipleSelect/momo-multipleSelect";
  195. import tools from "../../subPackages/components/tkitree/tools.js";
  196. import {
  197. getSelectUserTwo,
  198. getSelectDeptTwo,
  199. getByCodes,
  200. getUserLocalStorageInfo,
  201. addRectificationManagement,
  202. findRectificationManagementInOutById,
  203. updateListRectificationManagement,
  204. } from "@/js_sdk/http";
  205. export default {
  206. components: {
  207. multipleSelect,
  208. TelNum,
  209. },
  210. data() {
  211. return {
  212. id: null,
  213. BASE_URI: this.$constant.BASE_URI,
  214. companyAllList: [],
  215. defaultSelected: [],
  216. show: false,
  217. bizhongIndex: 0,
  218. testList: [
  219. { label: "类型1", value: 1 },
  220. { label: "类型2", value: 2 },
  221. { label: "类型3", value: 3 },
  222. { label: "类型4", value: 4 },
  223. { label: "类型5", value: 5 },
  224. { label: "类型6", value: 6 },
  225. { label: "类型7", value: 7 },
  226. { label: "类型8", value: 8 },
  227. ],
  228. settleInTypeIndex: 0,
  229. range: [],
  230. zaitiList: [],
  231. imageStyles: {},
  232. listStyles: {},
  233. fileLists: [],
  234. activeNames: [],
  235. StatusBar: 0,
  236. dic_key: ["rectification_management_update_type"],
  237. dic_SelectList: {},
  238. search: {
  239. pageSize: 10,
  240. pageNum: 1,
  241. },
  242. form: { ...form },
  243. companyAllList: [],
  244. value: ["0"],
  245. modeIndex: -1,
  246. styleIndex: -1,
  247. current: 0,
  248. mode: "default",
  249. dotsStyles: {},
  250. swiperDotIndex: 0,
  251. };
  252. },
  253. onLoad(option) {
  254. this.getByCodes();
  255. this.id = option.id !== "null" ? option.id : null;
  256. this.form.createdBy = getUserLocalStorageInfo().user.id;
  257. // qqmapsdk = new QQMapWX({
  258. // key: "OJ7BZ-ULH6V-XBLPV-ULIMK-APS3H-QHFIP",
  259. // });
  260. // this.getCurrentLocal();
  261. },
  262. onShow() {},
  263. methods: {
  264. transDate(e) {
  265. console.log(this.$common.transDate(e));
  266. return this.$common.transDate(e);
  267. },
  268. selectDengjiyuan(e) {
  269. this.form.finishUserName = e[e.length - 1].name;
  270. this.form.finishUser = e[e.length - 1].id;
  271. this.$forceUpdate();
  272. },
  273. async getSelectUserTwo(key) {
  274. let that = this;
  275. let departmentList = await getSelectUserTwo("");
  276. that.range = tools.transData(
  277. departmentList.data,
  278. "id",
  279. "parentid",
  280. "children"
  281. );
  282. console.log(key);
  283. that.$refs[key]._show();
  284. },
  285. async findRectificationManagementInOutById() {
  286. let that = this;
  287. try {
  288. if (that.id != null) {
  289. let detail = await findRectificationManagementInOutById(that.id);
  290. that.form = { ...form };
  291. that.form = detail;
  292. that.form.info = detail.info;
  293. that.form.finishInfo = detail.finishInfo;
  294. if (detail.finishTime) {
  295. that.form.finishTime = this.$common.transDate(detail.finishTime);
  296. } else {
  297. detail.finishTime = null;
  298. }
  299. if (detail.infoMorePictureUrl.length != 0) {
  300. let infoMorePictureUrlList = detail.infoMorePictureUrl.split(",");
  301. that.form.infoMorePictureUrlList = infoMorePictureUrlList.map(
  302. (e) => {
  303. return {
  304. name: e,
  305. imgUrl: "/FileController/download/" + e,
  306. url:
  307. that.$constant.BASE_URI + "/FileController/download/" + e,
  308. isImage: true,
  309. };
  310. }
  311. );
  312. }
  313. if (detail.finishPictureUrl && detail.finishPictureUrl.length != 0) {
  314. let finishPictureUrlList = detail.finishPictureUrl.split(",");
  315. that.form.finishPictureUrlList = finishPictureUrlList.map((e) => {
  316. return {
  317. name: e,
  318. imgUrl: "/FileController/download/" + e,
  319. url: that.$constant.BASE_URI + "/FileController/download/" + e,
  320. isImage: true,
  321. };
  322. });
  323. }
  324. let index =
  325. that.dic_SelectList.rectification_management_update_type.findIndex(
  326. (e) => e.value == detail.updateType
  327. );
  328. console.log(index);
  329. if (index != -1) {
  330. that.form.testTypeIndex = index;
  331. that.form.updateType =
  332. that.rectification_management_update_type[index].value;
  333. }
  334. console.log(that.form.finishInfo);
  335. that.$forceUpdate();
  336. }
  337. } catch (error) {}
  338. },
  339. selectYear(event) {
  340. this.form.attributiveYear = event.detail.value;
  341. this.$forceUpdate();
  342. },
  343. selectCarDate(event) {
  344. this.form.finishTime = event.detail.value;
  345. this.$forceUpdate();
  346. },
  347. bindPickerChange: function (e) {
  348. this.form.testTypeIndex = e.detail.value;
  349. this.form.updateType =
  350. this.dic_SelectList.rectification_management_update_type[
  351. e.detail.value
  352. ].value;
  353. },
  354. uploadfinishPictureUrl(event) {
  355. let that = this;
  356. const { file } = event.detail;
  357. uni.uploadFile({
  358. url: that.$constant.BASE_URI + "/wx/fileController/upload",
  359. filePath: file.url,
  360. name: "file",
  361. formData: { user: "test" },
  362. success(res) {
  363. // 上传完成需要更新 fileList
  364. if (!that.form.finishPictureUrlList) {
  365. that.form.finishPictureUrlList = [];
  366. }
  367. console.log(that.form.finishPictureUrlList);
  368. let data = JSON.parse(res.data);
  369. that.form.finishPictureUrlList.push({
  370. imgUrl: "/FileController/download/" + data.data[0],
  371. id: data.data[0],
  372. url:
  373. that.$constant.BASE_URI +
  374. "/FileController/download/" +
  375. data.data[0],
  376. isImage: true,
  377. });
  378. that.$forceUpdate();
  379. },
  380. fail(res) {},
  381. });
  382. },
  383. confirm(e) {
  384. var associationCompanyString = [];
  385. var associationCompany = [];
  386. for (var p in e) {
  387. associationCompanyString.push(e[p].label);
  388. associationCompany.push(e[p].value);
  389. }
  390. this.form.associationCompanyString = associationCompanyString.join(",");
  391. this.form.associationCompany = associationCompany.join(",");
  392. },
  393. deleteRYXXZP(event) {
  394. this.form.finishPictureUrlList.splice(event.detail.index, 1);
  395. },
  396. async getByCodes() {
  397. let data = await getByCodes(JSON.stringify(this.dic_key));
  398. this.dic_SelectList = this.$common.handleDicList(data);
  399. this.form.updateType =
  400. this.dic_SelectList.rectification_management_update_type[0].value;
  401. this.findRectificationManagementInOutById();
  402. console.log(this.form.updateType);
  403. },
  404. // /wx/SaleController/findRoomInfoListByIds
  405. async findRoomInfoListByIds() {
  406. let data = await findRoomInfoListByIds(ids);
  407. return data;
  408. },
  409. async getSelectDeptTwo(key) {
  410. let that = this;
  411. let departmentList = await getSelectDeptTwo("");
  412. that.range = tools.transData(
  413. departmentList.data,
  414. "id",
  415. "parentid",
  416. "children"
  417. );
  418. that.$refs[key]._show();
  419. },
  420. async save() {
  421. let that = this;
  422. let finishPictureUrl = [];
  423. if (
  424. that.form.finishPictureUrlList &&
  425. that.form.finishPictureUrlList.length > 0
  426. ) {
  427. finishPictureUrl = that.form.finishPictureUrlList.map((e) => {
  428. return e.id;
  429. });
  430. }
  431. console.log(that.form.finishPictureUrl);
  432. let form = [
  433. {
  434. finishType: 3,
  435. finishTime: this.$common.transServDate(new Date()),
  436. // checkTime: this.$common.transServDate(new Date()),
  437. finishUser: getUserLocalStorageInfo().user.id,
  438. updatedBy: getUserLocalStorageInfo().user.id,
  439. id: that.form.id,
  440. finishInfo: that.form.finishInfo,
  441. finishPictureUrl: finishPictureUrl.toString(),
  442. },
  443. ];
  444. let data = await updateListRectificationManagement({
  445. entities: JSON.stringify(form),
  446. });
  447. if (data.code == 200) {
  448. that.$showToast("新增成功");
  449. uni.switchTab({
  450. url: "/pages/index/index",
  451. });
  452. }
  453. },
  454. chossseFile() {
  455. this.$refs.files.upload();
  456. },
  457. onChange(event) {
  458. this.activeNames = event.detail;
  459. },
  460. },
  461. };
  462. </script>
  463. <style scoped lang="scss" scpoed>
  464. .btn-view {
  465. width: 100%;
  466. height: 100rpx;
  467. padding: 20rpx 10%;
  468. background-color: #ffffff;
  469. position: fixed;
  470. bottom: 0;
  471. left: 0;
  472. }
  473. .btn {
  474. width: 80%;
  475. height: 90rpx;
  476. border-radius: 50rpx 50rpx 50rpx 50rpx;
  477. background: #1d18bc;
  478. line-height: 90rpx;
  479. color: white;
  480. }
  481. .save_button {
  482. width: calc(100% - 64rpx);
  483. margin: 64rpx 32rpx 0 32rpx;
  484. background: #1d18bc;
  485. border-radius: 50rpx;
  486. height: 88rpx;
  487. color: white;
  488. text-align: center;
  489. line-height: 88rpx;
  490. }
  491. .form {
  492. width: calc(100% - 64rpx);
  493. background: #ffffff;
  494. padding: 32rpx;
  495. margin-top: 64rpx;
  496. .label {
  497. height: 53rpx;
  498. line-height: 53rpx;
  499. }
  500. }
  501. .form_row {
  502. height: 40rpx;
  503. font-weight: 400;
  504. font-size: 24rpx;
  505. }
  506. .zaiti_list {
  507. width: 100%;
  508. height: 50rpx;
  509. line-height: 50rpx;
  510. }
  511. .idclass {
  512. width: 147rpx;
  513. height: 100rpx;
  514. }
  515. .dengjibutton {
  516. margin-top: 24rpx;
  517. margin-left: 60rpx;
  518. margin-right: 60rpx;
  519. width: calc(100% - 120rpx);
  520. height: 60rpx;
  521. text-align: center;
  522. background: #1d18bc;
  523. color: white;
  524. line-height: 60rpx;
  525. }
  526. .addcompany {
  527. margin-bottom: 200rpx;
  528. }
  529. .addcompany {
  530. .detailstitle {
  531. height: 42rpx;
  532. font-size: 30rpx;
  533. font-weight: 500;
  534. color: #333333;
  535. padding-bottom: 16rpx;
  536. }
  537. .typestitle {
  538. height: 42rpx;
  539. font-size: 24rpx;
  540. font-weight: 500;
  541. padding-bottom: 16rpx;
  542. margin-bottom: 16rpx;
  543. }
  544. }
  545. </style>
  546. <style lang="scss">
  547. ::v-deep .is-open + .uni-collapse-item__wrap {
  548. height: auto !important;
  549. }
  550. ::v-deep .uni-collapse-item__wrap-content {
  551. height: auto !important;
  552. }
  553. .pageconfig {
  554. background: #ffffff;
  555. padding: 32rpx;
  556. }
  557. .input_title {
  558. width: 40%;
  559. font-size: 28rpx;
  560. height: 40rpx;
  561. line-height: 40rpx;
  562. color: #333333;
  563. }
  564. .input_value {
  565. width: 60%;
  566. font-size: 28rpx;
  567. height: 40rpx;
  568. line-height: 40rpx;
  569. color: #777777;
  570. }
  571. .uni-collapse-item__title-box {
  572. padding: 0 !important;
  573. }
  574. .uni-collapse-item__title-text {
  575. color: #1d18bc !important;
  576. font-size: 32rpx !important;
  577. }
  578. </style>
  579. <style lang="scss">
  580. .example-body {
  581. padding: 10px;
  582. padding-top: 0;
  583. }
  584. .custom-image-box {
  585. /* #ifndef APP-NVUE */
  586. display: flex;
  587. /* #endif */
  588. flex-direction: row;
  589. justify-content: space-between;
  590. align-items: center;
  591. }
  592. .text {
  593. font-size: 14px;
  594. color: #333;
  595. }
  596. .uni-file-picker__item {
  597. display: none;
  598. }
  599. .uploadbutton {
  600. width: 162rpx;
  601. height: 44rpx;
  602. }
  603. </style>