confirm.vue 19 KB

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