confirm.vue 17 KB

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