handle.vue 18 KB

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