reportDetails.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  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. <div class="btn" @click="dialogInputConfirm()" style="margin-left: 10rpx">
  155. 编辑完成
  156. </div>
  157. </view>
  158. </div>
  159. </template>
  160. <script>
  161. import multipleSelect from "../../../subPackages/components/momo-multipleSelect/momo-multipleSelect";
  162. import {
  163. getByCodes,
  164. addInterview,
  165. getBySaveStatus,
  166. editInterview,
  167. getCompanyAll,
  168. getInterviewDetails,
  169. } from "@/js_sdk/http.js";
  170. import vanRow from "../../../../wxcomponents/weapp/dist/row";
  171. import vanCol from "../../../../wxcomponents/weapp/dist/col";
  172. // import { findYuanQuList } from "@/js_sdk/http.js";
  173. const form = {
  174. id: null,
  175. isStatus: null,
  176. interviewTime: null,
  177. interviewType: null,
  178. interviewTypeIndex: null,
  179. companyId: null,
  180. companyIndex: null,
  181. projectType: "",
  182. interviewRecord: "",
  183. associationCompanyString: [],
  184. };
  185. export default {
  186. components: {
  187. vanRow,
  188. vanCol,
  189. multipleSelect,
  190. },
  191. data() {
  192. return {
  193. id: "",
  194. isStatus: 2,
  195. range: [
  196. { value: 2, text: "是" },
  197. { value: 1, text: "否" },
  198. ],
  199. defaultSelected: [],
  200. dic_key: ["interviewType"],
  201. dic_SelectList: {},
  202. companyIndex: null,
  203. companyAllList: [],
  204. defaultSelected: [],
  205. show: false,
  206. active: 0,
  207. form: { ...form },
  208. index: 0,
  209. };
  210. },
  211. onLoad: function (option) {
  212. this.getCompanyAll();
  213. this.id = option.id; //打印出上个页面传递的参数。\
  214. this.getByCodes();
  215. },
  216. methods: {
  217. async dialogInputConfirm() {
  218. let data = await editInterview({ ...this.form });
  219. if (data.code == 200) {
  220. this.$showToast("修改成功");
  221. uni.navigateBack({});
  222. }
  223. },
  224. async getInterviewDetails() {
  225. let detail = await getInterviewDetails(this.id);
  226. this.form = detail;
  227. this.getCompanyIdByApiList({ companyId: detail.companyId });
  228. this.getInterviewLableByApiList({
  229. interviewType: this.form.interviewType,
  230. });
  231. this.form.isStatus = detail.isStatus;
  232. },
  233. getCompanyIdByApiList(params) {
  234. this.form.companyId = params.companyId;
  235. let companyIndex = this.companyAllList.findIndex(
  236. (e) => e.value == params.companyId
  237. );
  238. this.form.companyIndex = companyIndex;
  239. },
  240. getInterviewLableByApiList(params) {
  241. let interviewTypeIndex = this.dic_SelectList.interviewType.findIndex(
  242. (e) => e.value == params.interviewType
  243. );
  244. this.form.interviewType =
  245. this.dic_SelectList.interviewType[interviewTypeIndex].value;
  246. this.form.interviewTypeIndex = interviewTypeIndex;
  247. },
  248. getInterviewTime(e) {
  249. this.form.interviewTime = e.detail.value;
  250. },
  251. async takeParamsGoBack(e) {
  252. const token = uni.getStorageSync("laocui_user_info");
  253. let data;
  254. if (this.form.id) {
  255. data = await editInterview({
  256. ...this.form,
  257. status: e,
  258. createdBy: JSON.parse(token).user.id,
  259. });
  260. } else {
  261. if (this.form.companyId == null) {
  262. return this.$showToast("请选择走访公司");
  263. }
  264. if (this.form.interviewTime == null || this.form.interviewTime == "") {
  265. return this.$showToast("请选择走访时间");
  266. }
  267. if (this.form.interviewType == null) {
  268. return this.$showToast("请选择走访类型");
  269. }
  270. if (this.form.isStatus == null) {
  271. return this.$showToast("请选择是否需要处理");
  272. }
  273. data = await addInterview({
  274. ...this.form,
  275. status: e,
  276. createdBy: JSON.parse(token).user.id,
  277. });
  278. }
  279. if (data.code == 200) {
  280. if (e == 1) {
  281. this.$emit("changeActive");
  282. this.$showToast("提交成功");
  283. this.form = { ...form };
  284. }
  285. if (e == 0) {
  286. this.$showToast("保存成功");
  287. }
  288. }
  289. },
  290. getCompany(e) {
  291. this.form.companyIndex = e.detail.value;
  292. this.form.companyId = this.companyAllList[e.detail.value].value;
  293. },
  294. chosseAboutCompany() {
  295. this.show = true;
  296. },
  297. async getCompanyAll() {
  298. let companyAllList = await getCompanyAll();
  299. this.getInterviewDetails();
  300. this.companyAllList = companyAllList.map((e) => {
  301. return {
  302. label: e.qymc,
  303. value: e.id,
  304. };
  305. });
  306. },
  307. async getByCodes() {
  308. let data = await getByCodes(JSON.stringify(this.dic_key));
  309. this.dic_SelectList = this.$common.handleDicList(data);
  310. },
  311. confirm(e) {
  312. let associationCompanyString = [];
  313. let associationCompany = [];
  314. for (var p in e) {
  315. associationCompanyString.push(e[p].label);
  316. associationCompany.push(e[p].value);
  317. }
  318. this.form.associationCompanyString = associationCompanyString.join(",");
  319. this.form.associationCompany = associationCompany.join(",");
  320. },
  321. bindPickerChange(e) {
  322. this.form.interviewTypeIndex = e.detail.value;
  323. this.form.interviewType =
  324. this.dic_SelectList.interviewType[e.detail.value].value;
  325. },
  326. },
  327. // onLoad: function (){
  328. // this.$refs.findYuanQuList()
  329. // },
  330. };
  331. </script>
  332. <style lang="scss">
  333. .gaisideshurukuang {
  334. .btn-view {
  335. width: 100%;
  336. height: 100rpx;
  337. padding: 20rpx 10%;
  338. background-color: #ffffff;
  339. position: fixed;
  340. bottom: 0;
  341. text-align: center;
  342. left: 0;
  343. }
  344. .btn {
  345. width: 80%;
  346. height: 90rpx;
  347. border-radius: 50rpx 50rpx 50rpx 50rpx;
  348. background: #1d18bc;
  349. line-height: 90rpx;
  350. text-align: center;
  351. color: white;
  352. }
  353. font-size: 26rpx !important;
  354. .is-input-border {
  355. border-top: none !important;
  356. border-left: none !important;
  357. border-right: none !important;
  358. border: none;
  359. border-radius: 0 !important;
  360. }
  361. .uni-forms-item {
  362. margin-bottom: 0px;
  363. border-bottom: 2rpx solid #cccccc !important;
  364. }
  365. }
  366. .btn-view {
  367. width: 100%;
  368. height: 100rpx;
  369. padding: 20rpx 10%;
  370. background-color: #ffffff;
  371. position: fixed;
  372. bottom: 0;
  373. left: 0;
  374. }
  375. .btn {
  376. width: 80%;
  377. height: 90rpx;
  378. border-radius: 50rpx 50rpx 50rpx 50rpx;
  379. background: #1d18bc;
  380. line-height: 90rpx;
  381. text-align: center;
  382. color: white;
  383. }
  384. .goreport {
  385. .uni-forms-item {
  386. margin-bottom: 0px;
  387. border-bottom: 2rpx solid #cccccc !important;
  388. }
  389. .textarea_info {
  390. textarea {
  391. background: #f9f9f9;
  392. }
  393. }
  394. .is-disabled {
  395. background: white !important;
  396. color: #777;
  397. }
  398. .form {
  399. width: calc(100% - 128rpx);
  400. margin: 32rpx;
  401. background: #ffffff;
  402. padding: 32rpx;
  403. .label {
  404. height: 53rpx;
  405. line-height: 53rpx;
  406. }
  407. .is-input-border {
  408. }
  409. .uni-forms-item {
  410. border-bottom: 2rpx solid #cccccc !important;
  411. }
  412. }
  413. }
  414. </style>