detailsPage.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535
  1. <template>
  2. <div>
  3. <div class="borderless">
  4. <div class="customer-head">
  5. <div class="customer-back">
  6. <el-button
  7. type="danger"
  8. style="border: none;background: none;color: red"
  9. icon="el-icon-arrow-left"
  10. @click="backToList"
  11. >返回列表
  12. </el-button>
  13. </div>
  14. <el-button
  15. class="el-button--small-yh add-customer-btn"
  16. type="primary"
  17. size="small"
  18. @click="editCustomer"
  19. >保存数据
  20. </el-button>
  21. </div>
  22. <containerTitle
  23. title="基础资料"
  24. style="margin-top: 60px"
  25. ></containerTitle>
  26. <basic-container>
  27. <el-row>
  28. <el-col :span="18">
  29. <avue-form
  30. ref="form"
  31. class="trading-form"
  32. v-model="form"
  33. :option="option"
  34. />
  35. </el-col>
  36. <el-col :span="6">
  37. <avue-form class="img-form" :option="option4" v-model="form" />
  38. </el-col>
  39. </el-row>
  40. <avue-form
  41. ref="form"
  42. class="trading-form"
  43. v-model="form"
  44. :option="option2"
  45. />
  46. </basic-container>
  47. <containerTitle title="详细信息"></containerTitle>
  48. <basic-container>
  49. <avue-form
  50. ref="form"
  51. class="trading-form"
  52. v-model="form"
  53. :option="option3"
  54. />
  55. </basic-container>
  56. </div>
  57. </div>
  58. </template>
  59. <script>
  60. import { detail, submit } from "@/api/basicData/facultyManagement";
  61. export default {
  62. name: "index",
  63. data() {
  64. return {
  65. form: {},
  66. option: {
  67. menuBtn: false,
  68. labelWidth: 100,
  69. column: [
  70. {
  71. label: "姓名",
  72. prop: "cname",
  73. rules: [
  74. {
  75. required: true,
  76. message: "",
  77. trigger: "blur"
  78. }
  79. ],
  80. span: 8
  81. },
  82. {
  83. label: "工号",
  84. prop: "code",
  85. rules: [
  86. {
  87. required: true,
  88. message: "",
  89. trigger: "blur"
  90. }
  91. ],
  92. span: 8
  93. },
  94. {
  95. label: "曾用名",
  96. prop: "usedName",
  97. span: 8
  98. },
  99. {
  100. label: "性别",
  101. prop: "gender",
  102. type: "select",
  103. dicUrl: "/api/blade-system/dict-biz/dictionary?code=sex",
  104. props: {
  105. label: "dictValue",
  106. value: "dictValue"
  107. },
  108. span: 8
  109. },
  110. {
  111. label: "籍贯",
  112. prop: "nativePlace",
  113. span: 8
  114. },
  115. {
  116. label: "民族",
  117. prop: "nation",
  118. type: "select",
  119. dicUrl: "/api/blade-system/dict-biz/dictionary?code=nationa_lity",
  120. props: {
  121. label: "dictValue",
  122. value: "dictValue"
  123. },
  124. span: 8
  125. },
  126. {
  127. label: "身份证",
  128. prop: "idNumber",
  129. rules: [
  130. {
  131. required: true,
  132. message: "",
  133. trigger: "blur"
  134. }
  135. ],
  136. span: 8
  137. },
  138. {
  139. label: "出生日期",
  140. prop: "birthdate",
  141. type: "date",
  142. valueFormat: "yyyy-MM-dd",
  143. span: 8
  144. },
  145. {
  146. label: "婚姻状况",
  147. prop: "maritalStatus",
  148. type: "select",
  149. dicUrl: "/api/blade-system/dict-biz/dictionary?code=marital_status",
  150. props: {
  151. label: "dictValue",
  152. value: "dictValue"
  153. },
  154. span: 8
  155. },
  156. {
  157. label: "政治面貌",
  158. prop: "politicsStatus",
  159. type: "select",
  160. dicUrl:
  161. "/api/blade-system/dict-biz/dictionary?code=politics_status",
  162. props: {
  163. label: "dictValue",
  164. value: "dictValue"
  165. },
  166. span: 8
  167. },
  168. {
  169. label: "加入日期",
  170. prop: "joiningDate",
  171. type: "date",
  172. valueFormat: "yyyy-MM-dd",
  173. span: 8
  174. },
  175. {
  176. label: "健康状况",
  177. prop: "healthCondition",
  178. type: "select",
  179. dicUrl:
  180. "/api/blade-system/dict-biz/dictionary?code=health_condition",
  181. props: {
  182. label: "dictValue",
  183. value: "dictValue"
  184. },
  185. span: 8
  186. }
  187. ]
  188. },
  189. option2: {
  190. menuBtn: false,
  191. labelWidth: 100,
  192. column: [
  193. {
  194. label: "血型",
  195. prop: "bloodType",
  196. type: "select",
  197. dicUrl: "/api/blade-system/dict-biz/dictionary?code=blood_type",
  198. props: {
  199. label: "dictValue",
  200. value: "dictValue"
  201. },
  202. span: 6
  203. },
  204. {
  205. label: "家庭住址",
  206. prop: "familyAddress",
  207. span: 6
  208. },
  209. {
  210. label: "邮政编码",
  211. prop: "postalCode",
  212. span: 6
  213. },
  214. {
  215. label: "户口性质",
  216. prop: "category",
  217. type: "select",
  218. dicUrl: "/api/blade-system/dict-biz/dictionary?code=category",
  219. props: {
  220. label: "dictValue",
  221. value: "dictValue"
  222. },
  223. span: 6
  224. },
  225. {
  226. label: "户口所在地",
  227. prop: "residentCity",
  228. span: 6
  229. },
  230. {
  231. label: "联系电话",
  232. prop: "phone",
  233. span: 6
  234. },
  235. {
  236. label: "电子邮箱",
  237. prop: "emailAddress",
  238. span: 6
  239. },
  240. {
  241. label: "宗教信仰",
  242. prop: "faith",
  243. type: "select",
  244. dicUrl: "/api/blade-system/dict-biz/dictionary?code=faith",
  245. props: {
  246. label: "dictValue",
  247. value: "dictValue"
  248. },
  249. span: 6
  250. },
  251. {
  252. label: "紧急联系人",
  253. prop: "contacts",
  254. span: 6
  255. },
  256. {
  257. label: "紧急联系人电话",
  258. prop: "contactNumber",
  259. span: 6
  260. },
  261. {
  262. label: "国别",
  263. prop: "nationnality",
  264. type: "select",
  265. dicUrl: "/api/blade-system/dict-biz/dictionary?code=nationnality",
  266. props: {
  267. label: "dictValue",
  268. value: "dictValue"
  269. },
  270. span: 6
  271. },
  272. {
  273. label: "港澳台侨",
  274. prop: "indentation",
  275. type: "select",
  276. dicUrl: "/api/blade-system/dict-biz/dictionary?code=TF_status",
  277. props: {
  278. label: "dictValue",
  279. value: "dictValue"
  280. },
  281. span: 6
  282. }
  283. ]
  284. },
  285. option3: {
  286. menuBtn: false,
  287. labelWidth: 100,
  288. column: [
  289. {
  290. label: "编制类别",
  291. prop: "compileCategory",
  292. type: "select",
  293. dicUrl:
  294. "/api/blade-system/dict-biz/dictionary?code=compile_category",
  295. props: {
  296. label: "dictValue",
  297. value: "dictValue"
  298. },
  299. span: 6
  300. },
  301. {
  302. label: "身份类别",
  303. prop: "identityCategory",
  304. type: "select",
  305. dicUrl:
  306. "/api/blade-system/dict-biz/dictionary?code=identity_category",
  307. props: {
  308. label: "dictValue",
  309. value: "dictValue"
  310. },
  311. span: 6
  312. },
  313. {
  314. label: "教师类别",
  315. prop: "teacherCategory",
  316. type: "select",
  317. dataType: "string",
  318. multiple: true,
  319. dicUrl:
  320. "/api/blade-system/dict-biz/dictionary?code=teacher_category",
  321. props: {
  322. label: "dictValue",
  323. value: "dictValue"
  324. },
  325. span: 6
  326. },
  327. {
  328. label: "工作状态",
  329. prop: "workingCondition",
  330. type: "select",
  331. dicUrl:
  332. "/api/blade-system/dict-biz/dictionary?code=working_condition",
  333. props: {
  334. label: "dictValue",
  335. value: "dictValue"
  336. },
  337. span: 6
  338. },
  339. {
  340. label: "现工作单位",
  341. prop: "currentEmployer",
  342. span: 12
  343. },
  344. {
  345. label: "所在校区",
  346. prop: "inCampus",
  347. type: "select",
  348. dicUrl: "/api/blade-system/dict-biz/dictionary?code=in_campus",
  349. props: {
  350. label: "dictValue",
  351. value: "dictValue"
  352. },
  353. rules: [
  354. {
  355. required: true,
  356. message: "",
  357. trigger: "blur"
  358. }
  359. ],
  360. span: 6
  361. },
  362. {
  363. label: "所在部门",
  364. prop: "inSection",
  365. type: "select",
  366. dicUrl: "/api/blade-system/dict-biz/dictionary?code=in_section",
  367. props: {
  368. label: "dictValue",
  369. value: "dictValue"
  370. },
  371. rules: [
  372. {
  373. required: true,
  374. message: "",
  375. trigger: "blur"
  376. }
  377. ],
  378. span: 6
  379. },
  380. {
  381. label: "所在院系",
  382. prop: "department",
  383. type: "select",
  384. dicUrl: "/api/blade-system/dict-biz/dictionary?code=department",
  385. props: {
  386. label: "dictValue",
  387. value: "dictValue"
  388. },
  389. span: 6
  390. },
  391. {
  392. label: "所在教研室",
  393. prop: "inStaffRoom",
  394. type: "select",
  395. dataType: "string",
  396. multiple: true,
  397. dicUrl: "/api/blade-system/dict-biz/dictionary?code=in_staff_room",
  398. props: {
  399. label: "dictValue",
  400. value: "dictValue"
  401. },
  402. span: 6,
  403. row: true
  404. },
  405. {
  406. label: "双师",
  407. prop: "doubleTeachers",
  408. type: "radio",
  409. dataType: "string",
  410. dicUrl: "/api/blade-system/dict-biz/dictionary?code=TF_status",
  411. props: {
  412. label: "dictValue",
  413. value: "dictValue"
  414. },
  415. span: 6
  416. },
  417. {
  418. label: "专业带头人",
  419. prop: "professionalLeader",
  420. type: "radio",
  421. dataType: "string",
  422. dicUrl: "/api/blade-system/dict-biz/dictionary?code=TF_status",
  423. props: {
  424. label: "dictValue",
  425. value: "dictValue"
  426. },
  427. span: 6
  428. },
  429. {
  430. label: "骨干教师",
  431. prop: "coreTeacher",
  432. type: "radio",
  433. dataType: "string",
  434. dicUrl: "/api/blade-system/dict-biz/dictionary?code=TF_status",
  435. props: {
  436. label: "dictValue",
  437. value: "dictValue"
  438. },
  439. span: 6,
  440. row: true
  441. },
  442. {
  443. label: "专业特长",
  444. prop: "professionalExpertise",
  445. type: "textarea",
  446. span: 24
  447. }
  448. ]
  449. },
  450. option4: {
  451. menuBtn: false,
  452. labelWidth: 100,
  453. column: [
  454. {
  455. label: "个人头像",
  456. prop: "headPortrait",
  457. type: "upload",
  458. listType: "picture-img",
  459. dataType: "string",
  460. action: "/api/blade-resource/oss/endpoint/put-file",
  461. propsHttp: {
  462. res: "data",
  463. url: "link"
  464. }
  465. }
  466. ]
  467. }
  468. };
  469. },
  470. props: {
  471. detailData: {
  472. type: Object
  473. }
  474. },
  475. created() {
  476. if (this.detailData.id) {
  477. this.getDetail(this.detailData.id);
  478. }
  479. },
  480. methods: {
  481. getDetail(id) {
  482. detail(id)
  483. .then(res => {
  484. this.form = res.data.data;
  485. })
  486. .finally(() => {
  487. // this.loading = false;
  488. // this.showBut = true;
  489. // this.pageLoading = false;
  490. });
  491. },
  492. //修改提交触发
  493. editCustomer() {
  494. this.$refs["form"].validate((valid, done) => {
  495. done();
  496. if (valid) {
  497. submit({ ...this.form })
  498. .then(res => {
  499. this.$message.success("保存成功");
  500. this.form = res.data.data;
  501. })
  502. .finally(() => {});
  503. } else {
  504. return false;
  505. }
  506. });
  507. },
  508. //返回列表
  509. backToList() {
  510. this.$emit("goBack");
  511. }
  512. }
  513. };
  514. </script>
  515. <style lang="scss" scoped>
  516. .trading-form ::v-deep .el-form-item {
  517. margin-bottom: 8px !important;
  518. }
  519. ::v-deep .el-form-item__error {
  520. display: none !important;
  521. }
  522. .img-form ::v-deep .el-form-item {
  523. height: 150px;
  524. line-height: 150px;
  525. margin-bottom: 8px !important;
  526. }
  527. .img-form ::v-deep .avue-upload__icon {
  528. font-size: 20px;
  529. width: 150px;
  530. height: 150px;
  531. line-height: 150px;
  532. }
  533. </style>