editPersonnel.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2.   <!-- 修改人员信息 -->
  3.   <div id="contractDetails">
  4.     <page-title>编辑</page-title>
  5.     <div class="main">
  6.       <span class="text">人员信息</span>
  7.     </div>
  8.     <div class="contractTitle">
  9.       <div class="form-box">
  10.         <div class="form-one">
  11.           <dil-form :formId="324" v-model="form1"></dil-form>
  12.         </div>
  13.       </div>
  14.     </div>
  15.     <div class="button-box">
  16.       <el-button type="primary" @click="onClickConfirm">确认</el-button>
  17.       <el-button @click="onClickCancel">返回</el-button>
  18.     </div>
  19.   </div>
  20. </template>
  21. <script>
  22. import PageTitle from "@/components/Page/Title";
  23. //import { sjTime } from "@/js/sharedJsFile";
  24. export default {
  25.   components: { PageTitle },
  26.   data() {
  27.     return {
  28.       form1: {},
  29.     };
  30.   },
  31.   mounted() {
  32.     this.information();
  33.   },
  34.   methods: {
  35.     information() {
  36.       //编辑
  37. console.log(this.$route.params)
  38.       this.$axios
  39.         .post(
  40. "/api/v1/rms/getPersonnelById/" +
  41.             this.$route.params.personnelId
  42.         )
  43.         .then((res) => {
  44. console.log(res.data.data)
  45.           res.data.data.forEach((e) => {
  46.             this.form1 = e;
  47.           });
  48.         });
  49.     },
  50.     // 返回
  51.     onClickCancel() {
  52.       this.$router.go(-1);
  53.     },
  54.     // 确认
  55.     onClickConfirm() {
  56.       console.log(this.form1)
  57.     let RmsPersonnel={
  58. personnelId:this.form1.personnelId,
  59. personnelJobNumber: this.form1.personnelJobNumber,
  60. personnelName: this.form1.personnelName,
  61. personnelPost: this.form1.personnelPost,
  62. personnelWorkshopid: this.form1.personnelWorkshopid,
  63. personnelShifts: this.form1.personnelShifts,
  64. shipperId: this.form1.shipperId,
  65. }
  66.         this.$axios
  67.           .post(
  68.             "/api/v1/rms/updatePersonnel",
  69.             RmsPersonnel
  70.           )
  71.           .then((res) => {
  72.             if (res.data.code == "200") {
  73.               this.$router.go(-1);
  74.             }
  75.           });
  76.     },
  77.   },
  78. };
  79. </script>
  80. <style lang="scss" scoped>
  81. </style>