reportDetails.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427
  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="170rpx"
  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. <picker
  19. style="float: left; width: 440rpx; height: 40rpx; color: #777"
  20. @change="getCompany"
  21. range-key="label"
  22. :range="companyAllList"
  23. >
  24. {{
  25. !form.companyId
  26. ? "请选择走访公司"
  27. : companyAllList[form.companyIndex].label
  28. }}
  29. </picker>
  30. </div>
  31. </uni-forms-item>
  32. <uni-forms-item
  33. label="走访时间:"
  34. class="mt42rpx pd42rpx border_bottom_ccc"
  35. >
  36. <div style="height: 73rpx; line-height: 73rpx">
  37. <picker
  38. style="float: left; width: 100%; height: 40rpx; color: #777"
  39. mode="date"
  40. :value="form.interviewTime"
  41. @change="getInterviewTime"
  42. >
  43. {{ !form.interviewTime ? "请选择走访时间" : form.interviewTime }}
  44. </picker>
  45. </div>
  46. </uni-forms-item>
  47. <uni-forms-item
  48. label="走访类型:"
  49. class="mt42rpx pd42rpx border_bottom_ccc"
  50. >
  51. <div style="height: 73rpx; line-height: 73rpx">
  52. <picker
  53. style="float: left; width: 100%; height: 40rpx; color: #777"
  54. :range="dic_SelectList.interviewType"
  55. :value="0"
  56. @change="bindPickerChange"
  57. range-key="label"
  58. >
  59. {{
  60. !form.interviewType
  61. ? "请选择"
  62. : dic_SelectList.interviewType[form.interviewTypeIndex].label
  63. }}
  64. </picker>
  65. </div>
  66. </uni-forms-item>
  67. <uni-forms-item
  68. label="是否需要处理"
  69. class="mt42rpx pd42rpx border_bottom_ccc"
  70. >
  71. <div style="height: 73rpx; line-height: 73rpx; width: 100%">
  72. <span style="color: #777" v-if="form.isStatus == 2">是</span>
  73. <span style="color: #777" v-if="form.isStatus == 1">否</span>
  74. </div>
  75. </uni-forms-item>
  76. </uni-forms>
  77. </div>
  78. <div class="form zoufangjilu" style="margin-bottom: 146rpx">
  79. <van-row>
  80. <van-col :span="24"> 走访记录 </van-col>
  81. <van-col :span="24">
  82. <div class="margint16rpx">
  83. <uni-easyinput
  84. type="textarea"
  85. inputBorder
  86. class="textarea_info"
  87. style="margin-top: 16rpx"
  88. v-model="form.interviewRecord"
  89. placeholder="请输入"
  90. />
  91. </div>
  92. </van-col>
  93. </van-row>
  94. <uni-forms
  95. v-if="form.isStatus != 1"
  96. ref="baseForm"
  97. style="font-size: 26rpx"
  98. :modelValue="form"
  99. label-width="170rpx"
  100. >
  101. <uni-forms-item
  102. label="处理人"
  103. class="mt42rpx mb42rpx border_bottom_ccc"
  104. >
  105. <div style="height: 73rpx; line-height: 73rpx; width: 100%">
  106. <input
  107. v-model="form.handleUserName"
  108. style="
  109. height: 73rpx;
  110. line-height: 73rpx;
  111. width: 100%;
  112. color: #777;
  113. "
  114. />
  115. <!-- <span style="color: #777">{{ form.handleUserName }}</span> -->
  116. </div>
  117. </uni-forms-item>
  118. <div style="margin-top: 16rpx">
  119. <van-row>
  120. <van-col :span="24" style="margin-top: 15rpx"> 处理结果 </van-col>
  121. <van-col :span="24">
  122. <div class="margint16rpx">
  123. <uni-easyinput
  124. type="textarea"
  125. inputBorder
  126. class="textarea_info"
  127. style="margin-top: 16rpx"
  128. v-model="form.handleResult"
  129. placeholder="请输入"
  130. />
  131. </div>
  132. </van-col>
  133. </van-row>
  134. </div>
  135. <uni-forms-item
  136. label="处理时间"
  137. class="mt42rpx pd42rpx border_bottom_ccc"
  138. >
  139. <div style="height: 73rpx; line-height: 73rpx; width: 100%">
  140. <span style="color: #777">{{ form.handleTime }}</span>
  141. </div>
  142. </uni-forms-item>
  143. </uni-forms>
  144. </div>
  145. <!-- <multiple-select
  146. v-model="show"
  147. model="false"
  148. :all-show="false"
  149. :data="companyAllList"
  150. :default-selected="defaultSelected"
  151. @confirm="confirm"
  152. ></multiple-select> -->
  153. <view class="btn-view">
  154. <button
  155. class="btn"
  156. @click="dialogInputConfirm()"
  157. style="margin-left: 10rpx"
  158. >
  159. 编辑完成
  160. </button>
  161. </view>
  162. </div>
  163. </template>
  164. <script>
  165. import multipleSelect from "../../../subPackages/components/momo-multipleSelect/momo-multipleSelect";
  166. import {
  167. getByCodes,
  168. addInterview,
  169. getBySaveStatus,
  170. editInterview,
  171. getCompanyAll,
  172. getInterviewDetails,
  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. isStatus: 2,
  199. range: [
  200. { value: 2, text: "是" },
  201. { value: 1, text: "否" },
  202. ],
  203. defaultSelected: [],
  204. dic_key: ["interviewType"],
  205. dic_SelectList: {},
  206. companyIndex: null,
  207. companyAllList: [],
  208. defaultSelected: [],
  209. show: false,
  210. active: 0,
  211. form: { ...form },
  212. index: 0,
  213. };
  214. },
  215. onLoad: function (option) {
  216. this.getCompanyAll();
  217. this.id = option.id; //打印出上个页面传递的参数。\
  218. this.getByCodes();
  219. },
  220. methods: {
  221. async dialogInputConfirm() {
  222. let data = await editInterview({ ...this.form });
  223. if (data.code == 200) {
  224. this.$showToast("修改成功");
  225. uni.navigateBack({});
  226. }
  227. },
  228. async getInterviewDetails() {
  229. let detail = await getInterviewDetails(this.id);
  230. this.form = detail;
  231. this.getCompanyIdByApiList({ companyId: detail.companyId });
  232. this.getInterviewLableByApiList({
  233. interviewType: this.form.interviewType,
  234. });
  235. this.form.isStatus = detail.isStatus;
  236. },
  237. getCompanyIdByApiList(params) {
  238. this.form.companyId = params.companyId;
  239. let companyIndex = this.companyAllList.findIndex(
  240. (e) => e.value == params.companyId
  241. );
  242. this.form.companyIndex = companyIndex;
  243. },
  244. getInterviewLableByApiList(params) {
  245. let interviewTypeIndex = this.dic_SelectList.interviewType.findIndex(
  246. (e) => e.value == params.interviewType
  247. );
  248. this.form.interviewType =
  249. this.dic_SelectList.interviewType[interviewTypeIndex].value;
  250. this.form.interviewTypeIndex = interviewTypeIndex;
  251. },
  252. getInterviewTime(e) {
  253. this.form.interviewTime = e.detail.value;
  254. },
  255. async takeParamsGoBack(e) {
  256. const token = uni.getStorageSync("laocui_user_info");
  257. let data;
  258. if (this.form.id) {
  259. data = await editInterview({
  260. ...this.form,
  261. status: e,
  262. createdBy: JSON.parse(token).user.id,
  263. });
  264. } else {
  265. if (this.form.companyId == null) {
  266. return this.$showToast("请选择走访公司");
  267. }
  268. if (this.form.interviewTime == null || this.form.interviewTime == "") {
  269. return this.$showToast("请选择走访时间");
  270. }
  271. if (this.form.interviewType == null) {
  272. return this.$showToast("请选择走访类型");
  273. }
  274. if (this.form.isStatus == null) {
  275. return this.$showToast("请选择是否需要处理");
  276. }
  277. data = await addInterview({
  278. ...this.form,
  279. status: e,
  280. createdBy: JSON.parse(token).user.id,
  281. });
  282. }
  283. if (data.code == 200) {
  284. if (e == 1) {
  285. this.$emit("changeActive");
  286. this.$showToast("提交成功");
  287. this.form = { ...form };
  288. }
  289. if (e == 0) {
  290. this.$showToast("保存成功");
  291. }
  292. }
  293. },
  294. getCompany(e) {
  295. this.form.companyIndex = e.detail.value;
  296. this.form.companyId = this.companyAllList[e.detail.value].value;
  297. },
  298. chosseAboutCompany() {
  299. this.show = true;
  300. },
  301. async getCompanyAll() {
  302. let companyAllList = await getCompanyAll();
  303. this.getInterviewDetails();
  304. this.companyAllList = companyAllList.map((e) => {
  305. return {
  306. label: e.qymc,
  307. value: e.id,
  308. };
  309. });
  310. },
  311. async getByCodes() {
  312. let data = await getByCodes(JSON.stringify(this.dic_key));
  313. this.dic_SelectList = this.$common.handleDicList(data);
  314. },
  315. confirm(e) {
  316. let associationCompanyString = [];
  317. let associationCompany = [];
  318. for (var p in e) {
  319. associationCompanyString.push(e[p].label);
  320. associationCompany.push(e[p].value);
  321. }
  322. this.form.associationCompanyString = associationCompanyString.join(",");
  323. this.form.associationCompany = associationCompany.join(",");
  324. },
  325. bindPickerChange(e) {
  326. this.form.interviewTypeIndex = e.detail.value;
  327. this.form.interviewType =
  328. this.dic_SelectList.interviewType[e.detail.value].value;
  329. },
  330. },
  331. // onLoad: function (){
  332. // this.$refs.findYuanQuList()
  333. // },
  334. };
  335. </script>
  336. <style lang="scss">
  337. .gaisideshurukuang {
  338. .btn-view {
  339. width: 100%;
  340. height: 100rpx;
  341. padding: 20rpx 10%;
  342. background-color: #ffffff;
  343. position: fixed;
  344. bottom: 0;
  345. left: 0;
  346. }
  347. .btn {
  348. width: 80%;
  349. height: 90rpx;
  350. border-radius: 50rpx 50rpx 50rpx 50rpx;
  351. background: #1d18bc;
  352. line-height: 90rpx;
  353. color: white;
  354. }
  355. font-size: 26rpx !important;
  356. .is-input-border {
  357. border-top: none !important;
  358. border-left: none !important;
  359. border-right: none !important;
  360. border: none;
  361. border-radius: 0 !important;
  362. }
  363. .uni-forms-item {
  364. margin-bottom: 0px;
  365. border-bottom: 2rpx solid #cccccc !important;
  366. }
  367. }
  368. .btn-view {
  369. width: 100%;
  370. height: 100rpx;
  371. padding: 20rpx 10%;
  372. background-color: #ffffff;
  373. position: fixed;
  374. bottom: 0;
  375. left: 0;
  376. }
  377. .btn {
  378. width: 80%;
  379. height: 90rpx;
  380. border-radius: 50rpx 50rpx 50rpx 50rpx;
  381. background: #1d18bc;
  382. line-height: 90rpx;
  383. color: white;
  384. }
  385. .goreport {
  386. .uni-forms-item {
  387. margin-bottom: 0px;
  388. border-bottom: 2rpx solid #cccccc !important;
  389. }
  390. .textarea_info {
  391. textarea {
  392. background: #f9f9f9;
  393. }
  394. }
  395. .is-disabled {
  396. background: white !important;
  397. color: #777;
  398. }
  399. .form {
  400. width: calc(100% - 128rpx);
  401. margin: 32rpx;
  402. background: #ffffff;
  403. padding: 32rpx;
  404. .label {
  405. height: 53rpx;
  406. line-height: 53rpx;
  407. }
  408. .is-input-border {
  409. }
  410. .uni-forms-item {
  411. border-bottom: 2rpx solid #cccccc !important;
  412. }
  413. }
  414. }
  415. </style>