reportDetails.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564
  1. <template>
  2. <div class="goreport">
  3. <div class="form gaisideshurukuang">
  4. <uni-forms
  5. ref="baseForm"
  6. style="font-size: 26rpx"
  7. :modelValue="form"
  8. label-width="150rpx"
  9. >
  10. <uni-forms-item
  11. label="走访公司"
  12. class="mt42rpx pd42rpx border_bottom_ccc"
  13. >
  14. <div
  15. @click="chosseAboutCompany()"
  16. style="height: 73rpx; line-height: 73rpx"
  17. >
  18. <span>
  19. {{ !form.companyName ? "请选择走访公司" : form.companyName }}
  20. </span>
  21. </div>
  22. </uni-forms-item>
  23. <uni-forms-item
  24. label="走访时间:"
  25. class="mt42rpx pd42rpx border_bottom_ccc"
  26. >
  27. <div style="height: 73rpx; line-height: 73rpx">
  28. <picker
  29. style="float: left; width: 100%; height: 40rpx; color: #777"
  30. mode="date"
  31. :value="form.interviewTime"
  32. @change="getInterviewTime"
  33. >
  34. {{ !form.interviewTime ? "请选择走访时间" : form.interviewTime }}
  35. </picker>
  36. </div>
  37. </uni-forms-item>
  38. <uni-forms-item
  39. label="同行人"
  40. class="mt42rpx pd42rpx border_bottom_ccc"
  41. >
  42. <div style="display: flex; justify-content: space-between">
  43. <div style="margin-top: 15rpx">
  44. <div v-for="(item, index) in isSelectPeers" class="isSelectPeers">
  45. {{ item.name }}
  46. <icon type="clear" size="18" @click="deletePeer(index)" />
  47. </div>
  48. </div>
  49. <picker
  50. style="margin-top: 20rpx"
  51. @change="selectPeers"
  52. :value="index"
  53. range-key="truename"
  54. :range="peersList"
  55. >
  56. <span style="color: #1d18bc">添加</span>
  57. </picker>
  58. </div>
  59. </uni-forms-item>
  60. <uni-forms-item
  61. v-if="form.interviewType == '上市进展'"
  62. label="估值:"
  63. class="mt42rpx pd42rpx border_bottom_ccc"
  64. >
  65. <div style="height: 73rpx; display: flex; align-items: center">
  66. <input
  67. type="number"
  68. v-model="form.valuation"
  69. placeholder="请输入估值"
  70. />
  71. </div>
  72. </uni-forms-item>
  73. <uni-forms-item
  74. v-if="form.interviewType == '上市进展'"
  75. label="融资情况"
  76. class="mt42rpx pd42rpx border_bottom_ccc"
  77. >
  78. <div style="height: 73rpx; display: flex; align-items: center">
  79. <input
  80. type="text"
  81. v-model="form.financingSituation"
  82. placeholder="请输入融资情况"
  83. />
  84. </div>
  85. </uni-forms-item>
  86. </uni-forms>
  87. </div>
  88. <div class="form zoufangjilu" style="margin-bottom: 146rpx">
  89. <van-row>
  90. <van-col :span="24"> 走访记录 </van-col>
  91. </van-row>
  92. <div class="margint16rpx">
  93. <textarea
  94. type="textarea"
  95. inputBorder
  96. maxlength="5000"
  97. autoHeight
  98. class="textarea_info 666"
  99. style="
  100. margin-top: 16rpx;
  101. border: 1px solid #cccccc;
  102. border-radius: 4px;
  103. padding: 10rpx;
  104. min-height: 500rpx;
  105. height: auto;
  106. width: 97%;
  107. "
  108. v-model="form.interviewRecord"
  109. placeholder="请输入"
  110. >
  111. </textarea>
  112. </div>
  113. <uni-forms
  114. v-if="form.isStatus != 1"
  115. ref="baseForm"
  116. style="font-size: 26rpx"
  117. :modelValue="form"
  118. label-width="170rpx"
  119. >
  120. </uni-forms>
  121. </div>
  122. <!-- <multiple-select
  123. v-model="show"
  124. model="false"
  125. :all-show="false"
  126. :data="companyAllList"
  127. :default-selected="defaultSelected"
  128. @confirm="confirm"
  129. ></multiple-select> -->
  130. <view class="btn-view">
  131. <div class="btn" @click="dialogInputConfirm()" style="margin-left: 10rpx">
  132. 编辑完成
  133. </div>
  134. </view>
  135. <van-popup :show="show" bind:close="onClose" round position="bottom">
  136. <div style="display: flex; justify-content: space-between">
  137. <div style="margin: 32rpx" @click="closePopup()">取消</div>
  138. <div style="margin: 32rpx" @click="getSelectValue()">确认</div>
  139. </div>
  140. <uni-easyinput
  141. v-model="companyName"
  142. @input="filtedCompanyAllList"
  143. placeholder="请输入内容"
  144. ></uni-easyinput>
  145. <picker-view
  146. indicator-style="height: 50px;"
  147. style="width: 100%; height: 300px"
  148. @change="getRowValue"
  149. :value="value"
  150. >
  151. <picker-view-column>
  152. <view
  153. v-for="(item, index) in companyAllList"
  154. :key="index"
  155. style="line-height: 50px; text-align: center"
  156. >{{ item.label }}</view
  157. >
  158. </picker-view-column>
  159. </picker-view>
  160. </van-popup>
  161. </div>
  162. </template>
  163. <script>
  164. import multipleSelect from "../../../subPackages/components/momo-multipleSelect/momo-multipleSelect";
  165. import {
  166. getByCodes,
  167. addInterview,
  168. getBySaveStatus,
  169. editInterview,
  170. getCompanyAll,
  171. getInterviewDetails,
  172. getQyList,
  173. } from "@/js_sdk/http.js";
  174. import vanRow from "../../../../wxcomponents/weapp/dist/row";
  175. import vanCol from "../../../../wxcomponents/weapp/dist/col";
  176. // import { findYuanQuList } from "@/js_sdk/http.js";
  177. const form = {
  178. id: null,
  179. isStatus: null,
  180. interviewTime: null,
  181. interviewType: null,
  182. interviewTypeIndex: null,
  183. companyId: null,
  184. companyIndex: null,
  185. projectType: "",
  186. interviewRecord: "",
  187. associationCompanyString: [],
  188. };
  189. export default {
  190. components: {
  191. vanRow,
  192. vanCol,
  193. multipleSelect,
  194. },
  195. data() {
  196. return {
  197. id: "",
  198. isSelectPeers: [],
  199. isStatus: 2,
  200. range: [
  201. { value: 2, text: "是" },
  202. { value: 1, text: "否" },
  203. ],
  204. defaultSelected: [],
  205. dic_key: ["interviewType"],
  206. dic_SelectList: {},
  207. companyIndex: null,
  208. companyAllList: [],
  209. defaultSelected: [],
  210. show: false,
  211. active: 0,
  212. form: { ...form },
  213. index: 0,
  214. companyName: "",
  215. value: 0,
  216. peersList: [],
  217. companyAllList: [],
  218. };
  219. },
  220. onLoad: function (option) {
  221. this.getCompanyAll();
  222. this.id = option.id; //打印出上个页面传递的参数。\
  223. this.getByCodes();
  224. this.getQyList();
  225. },
  226. methods: {
  227. getRowValue(e) {
  228. console.log(e);
  229. this.isSelectedIndex = e.detail.value[0];
  230. },
  231. closePopup() {
  232. this.show = false;
  233. this.form.companyIndex = null;
  234. this.form.companyId = null;
  235. },
  236. getSelectValue() {
  237. console.log(this.value, "this.value");
  238. console.log("this.isSelectedIndex", this.isSelectedIndex);
  239. if (this.isSelectedIndex == null) {
  240. this.form.companyIndex = 0;
  241. this.form.companyId = this.companyAllList[this.value].value;
  242. this.form.companyName = this.companyAllList[this.value].label;
  243. console.log("11111111", this.form.companyName);
  244. } else {
  245. let index = this.companyAllList.findIndex(
  246. (e) => e.value == this.companyAllList[this.isSelectedIndex].value
  247. );
  248. this.form.companyIndex = index;
  249. this.form.companyId = this.companyAllList[index].value;
  250. this.form.companyName = this.companyAllList[index].label;
  251. console.log("企业名称", this.form.companyName);
  252. console.log("企业id", this.form.companyId);
  253. console.log();
  254. }
  255. this.show = false;
  256. },
  257. async filtedCompanyAllList() {
  258. // this.value = 0;
  259. // this.isSelectedIndex = 0;
  260. let companyAllList = await getCompanyAll(this.companyName);
  261. this.companyAllList = companyAllList.map((e) => {
  262. return {
  263. label: e.qymc,
  264. value: e.id,
  265. };
  266. });
  267. console.log("当前的value", this.value);
  268. console.log("companyAllList", this.companyAllList);
  269. // if (this.companyName && this.companyName.length > 0) {
  270. // // companyAllList = this.companyAllList.filter((e) =>
  271. // // e.label.includes(this.companyName)
  272. // // );
  273. // if (companyAllList.length > 0 && companyAllList[0].value) {
  274. // let index = this.companyAllList.findIndex(
  275. // (e) => e.value == companyAllList[0].value
  276. // );
  277. // this.form.companyIndex = index;
  278. // } else {
  279. // this.form.companyIndex = null;
  280. // this.form.companyId = null;
  281. // }
  282. // } else {
  283. // companyAllList = this.companyAllList;
  284. // }
  285. return companyAllList;
  286. },
  287. async getQyList() {
  288. let data = await getQyList();
  289. this.peersList = data;
  290. console.log("dataadataasfdsagd", data);
  291. },
  292. deletePeer(i) {
  293. this.isSelectPeers.splice(i, 1);
  294. },
  295. selectPeers(e) {
  296. console.log(this.peersList[e.detail.value]);
  297. let data = this.peersList[e.detail.value];
  298. console.log(e.detail.value);
  299. for (let i = 0; i < this.isSelectPeers.length; i++) {
  300. if (data.truename == this.isSelectPeers[i].name) {
  301. this.$showToast("请勿重复添加");
  302. return;
  303. }
  304. }
  305. this.isSelectPeers.push({ name: data.truename, id: data.id });
  306. },
  307. async dialogInputConfirm() {
  308. for (const key in this.form) {
  309. console.log(this.form[key]);
  310. if (!this.form[key]) {
  311. delete this.form[key];
  312. }
  313. }
  314. console.log("this.isSelectPeers", this.isSelectPeers);
  315. let companionsUserName = this.isSelectPeers
  316. .map((e) => {
  317. return e.name;
  318. })
  319. .join();
  320. let companionsUserId = this.isSelectPeers
  321. .map((e) => {
  322. return e.id;
  323. })
  324. .join();
  325. console.log(companionsUserId);
  326. let data = await editInterview({
  327. ...this.form,
  328. companionsUserName: companionsUserName,
  329. companionsUserId: companionsUserId,
  330. });
  331. if (data.code == 200) {
  332. this.$showToast("修改成功");
  333. uni.navigateBack({});
  334. }
  335. },
  336. async getInterviewDetails() {
  337. let detail = await getInterviewDetails(this.id);
  338. this.form = detail;
  339. this.getCompanyIdByApiList({ companyId: detail.companyId });
  340. this.getInterviewLableByApiList({
  341. interviewType: this.form.interviewType,
  342. });
  343. this.form.isStatus = detail.isStatus;
  344. console.log(
  345. "detail.companionsUserName.split()",
  346. detail.companionsUserName.split()
  347. );
  348. if (detail.companionsUserName.length > 0) {
  349. let isSelectPeers = detail.companionsUserName.split(",").map((e) => {
  350. return { name: e };
  351. });
  352. console.log("isSelectPeers", isSelectPeers);
  353. for (let i = 0; i < detail.companionsUserId.split(",").length; i++) {
  354. isSelectPeers[i].id = detail.companionsUserId.split(",")[i];
  355. }
  356. console.log(this.isSelectPeers);
  357. this.isSelectPeers = isSelectPeers;
  358. } else {
  359. this.isSelectPeers = [];
  360. }
  361. },
  362. getCompanyIdByApiList(params) {
  363. this.form.companyId = params.companyId;
  364. let companyIndex = this.companyAllList.findIndex(
  365. (e) => e.value == params.companyId
  366. );
  367. this.form.companyIndex = companyIndex;
  368. },
  369. getInterviewLableByApiList(params) {
  370. let interviewTypeIndex = this.dic_SelectList.interviewType.findIndex(
  371. (e) => e.value == params.interviewType
  372. );
  373. this.form.interviewType =
  374. this.dic_SelectList.interviewType[interviewTypeIndex].value;
  375. this.form.interviewTypeIndex = interviewTypeIndex;
  376. },
  377. getInterviewTime(e) {
  378. this.form.interviewTime = e.detail.value;
  379. },
  380. async takeParamsGoBack(e) {
  381. const token = uni.getStorageSync("laocui_user_info");
  382. let data;
  383. if (this.form.id) {
  384. data = await editInterview({
  385. ...this.form,
  386. status: e,
  387. createdBy: JSON.parse(token).user.id,
  388. });
  389. } else {
  390. if (this.form.companyId == null) {
  391. return this.$showToast("请选择走访公司");
  392. }
  393. if (this.form.interviewTime == null || this.form.interviewTime == "") {
  394. return this.$showToast("请选择走访时间");
  395. }
  396. data = await addInterview({
  397. ...this.form,
  398. status: e,
  399. createdBy: JSON.parse(token).user.id,
  400. });
  401. }
  402. if (data.code == 200) {
  403. if (e == 1) {
  404. this.$emit("changeActive");
  405. this.$showToast("提交成功");
  406. this.form = { ...form };
  407. }
  408. if (e == 0) {
  409. this.$showToast("保存成功");
  410. }
  411. }
  412. },
  413. getCompany(e) {
  414. this.form.companyIndex = e.detail.value;
  415. this.form.companyId = this.companyAllList[e.detail.value].value;
  416. },
  417. chosseAboutCompany() {
  418. this.show = true;
  419. },
  420. async getCompanyAll() {
  421. let companyAllList = await getCompanyAll();
  422. this.getInterviewDetails();
  423. this.companyAllList = companyAllList.map((e) => {
  424. return {
  425. label: e.qymc,
  426. value: e.id,
  427. };
  428. });
  429. },
  430. async getByCodes() {
  431. let data = await getByCodes(JSON.stringify(this.dic_key));
  432. this.dic_SelectList = this.$common.handleDicList(data);
  433. },
  434. confirm(e) {
  435. let associationCompanyString = [];
  436. let associationCompany = [];
  437. for (var p in e) {
  438. associationCompanyString.push(e[p].label);
  439. associationCompany.push(e[p].value);
  440. }
  441. this.form.associationCompanyString = associationCompanyString.join(",");
  442. this.form.associationCompany = associationCompany.join(",");
  443. },
  444. bindPickerChange(e) {
  445. this.form.interviewTypeIndex = e.detail.value;
  446. this.form.interviewType =
  447. this.dic_SelectList.interviewType[e.detail.value].value;
  448. },
  449. },
  450. // onLoad: function (){
  451. // this.$refs.findYuanQuList()
  452. // },
  453. };
  454. </script>
  455. <style lang="scss">
  456. .gaisideshurukuang {
  457. .textheighet {
  458. height: auto;
  459. }
  460. .isSelectPeers {
  461. display: flex;
  462. align-items: center;
  463. justify-content: space-between;
  464. margin-bottom: 10rpx;
  465. width: 372rpx;
  466. }
  467. .btn-view {
  468. width: 100%;
  469. height: 100rpx;
  470. padding: 20rpx 10%;
  471. background-color: #ffffff;
  472. position: fixed;
  473. bottom: 0;
  474. left: 0;
  475. }
  476. .btn {
  477. border-radius: 8rpx 8rpx 8rpx 8rpx;
  478. width: 80%;
  479. height: 90rpx;
  480. text-align: center;
  481. // border-radius: 50rpx 50rpx 50rpx 50rpx;
  482. background: #1d18bc;
  483. line-height: 90rpx;
  484. color: white;
  485. }
  486. font-size: 26rpx !important;
  487. .is-input-border {
  488. border-top: none !important;
  489. border-left: none !important;
  490. border-right: none !important;
  491. border: none;
  492. border-radius: 0 !important;
  493. }
  494. .uni-forms-item {
  495. margin-bottom: 0px;
  496. border-bottom: 2rpx solid #cccccc !important;
  497. }
  498. }
  499. .btn-view {
  500. width: 100%;
  501. height: 100rpx;
  502. padding: 20rpx 10%;
  503. background-color: #ffffff;
  504. position: fixed;
  505. bottom: 0;
  506. left: 0;
  507. }
  508. .btn {
  509. border-radius: 8rpx 8rpx 8rpx 8rpx;
  510. width: 80%;
  511. height: 90rpx;
  512. text-align: center;
  513. // border-radius: 50rpx 50rpx 50rpx 50rpx;
  514. background: #1d18bc;
  515. line-height: 90rpx;
  516. color: white;
  517. }
  518. .goreport {
  519. .uni-forms-item {
  520. margin-bottom: 0px;
  521. border-bottom: 2rpx solid #cccccc !important;
  522. }
  523. .textarea_info {
  524. textarea {
  525. background: #f9f9f9;
  526. }
  527. }
  528. .is-disabled {
  529. background: white !important;
  530. color: #777;
  531. }
  532. .form {
  533. width: calc(100% - 128rpx);
  534. margin: 32rpx;
  535. background: #ffffff;
  536. padding: 32rpx;
  537. .label {
  538. height: 53rpx;
  539. line-height: 53rpx;
  540. }
  541. .is-input-border {
  542. }
  543. .uni-forms-item {
  544. border-bottom: 2rpx solid #cccccc !important;
  545. }
  546. }
  547. }
  548. </style>