From 893161871417a5c280de5e0a4792d3f43e3d3b40 Mon Sep 17 00:00:00 2001
From: guanqb <18720758508@163.com>
Date: Tue, 02 Jan 2024 11:07:29 +0800
Subject: [PATCH] 基本信息使用接口值

---
 src/views/securityMan/index.vue                 |   35 -----------------
 src/views/securityGuard/securityGuardDetail.vue |   77 ++++++++++++++++++++++++++++++--------
 2 files changed, 62 insertions(+), 50 deletions(-)

diff --git a/src/views/securityGuard/securityGuardDetail.vue b/src/views/securityGuard/securityGuardDetail.vue
index e1993bf..63c36fe 100644
--- a/src/views/securityGuard/securityGuardDetail.vue
+++ b/src/views/securityGuard/securityGuardDetail.vue
@@ -96,6 +96,8 @@
     getER,
 } from "@/api/performance/performance"
 
+import { getUser, getUserPractitionersInfo } from "@/api/system/user"
+
 // import vueQr from "vue-qr";
 import securityCertificate from "./securityCertificate.vue"
 import baoanz from "./baoanz.vue"
@@ -731,24 +733,67 @@
     mounted () {
         this.typeTABS = this.optionTABS.column[0]
         var data = JSON.parse(this.$route.query.row)
+        getUser(data.id).then(res => {
+            let form = res.data.data
+            var d = {
+                education1: res.data.data.education
+            }
+            form = {
+                ...form,
+                ...d
+            }
+            if (form.userDetail) {
+                form.userDetailId = form.userDetail.id
+                form.marriageStatus = form.userDetail.marriageStatus
+                form.signLevel = form.userDetail.signLevel
+                form.permanentResidenceAddress = form.userDetail.permanentResidenceAddress
+                form.dwellAddress = form.userDetail.dwellAddress
+                form.memberOfFamily = form.userDetail.memberOfFamily
+                form.educationExperience = form.userDetail.educationExperience
+                form.workExperience = form.userDetail.workExperience
+                form.healthCertificateUrl = form.userDetail.healthCertificateUrl
+                form.noCriminalRecordProveUrl = form.userDetail.noCriminalRecordProveUrl
+                form.acceptancePoliceUnit = form.userDetail.acceptancePoliceUnit
+                form.acceptancePerson = form.userDetail.acceptancePerson
+                form.acceptanceTime = form.userDetail.acceptanceTime
+                form.unitName = form.userDetail.unitName
+            }
+            // this.from["education1"] = res.data.data.education;
+            if (form.hasOwnProperty("deptId")) {
+                form.deptId = form.deptId
+            }
+            if (form.hasOwnProperty("roleId")) {
+                form.roleId = form.roleId.split(",")
+            }
+            // if (form.hasOwnProperty("postId")) {
+            //   form.postId = form.postId.split(",");
+            // }
+            var userInfo = res.data.data
+            //获取用户从业信息
+            getUserPractitionersInfo(data.id).then(res1 => {
+                form.UserPractitionersInfo = res1.data.data
+            })
+            this.obj0 = form
+        })
         // console.log(data);
         if (data) {
-            var row = data
-            // var row = this.$route.query.row;
-            for (var k in row) {
-                this.obj0[k] = row[k]
-            }
-            this.obj0.title = ""
-            this.cardid = row.id
-            this.name = row.name
-            this.dispatcherCompany = row.dispatcherCompany
-            this.id = row.id
-            this.hold = row.hold
-            let year = row.cardid.slice(6, 10)
-            let mouth = row.cardid.slice(10, 12)
-            let day = row.cardid.slice(12, 14)
-            this.obj0.birthdayData = year + '-' + mouth + '-' + day
-            console.log(this.obj0)
+            // var row = data
+            // // var row = this.$route.query.row;
+            // for (var k in row) {
+            //     this.obj0[k] = row[k]
+            // }
+            // this.obj0.title = ""
+            // this.cardid = row.id
+            // this.name = row.name
+            // this.dispatcherCompany = row.dispatcherCompany
+            // this.id = row.id
+            // this.hold = row.hold
+            // let year = row.cardid.slice(6, 10)
+            // let mouth = row.cardid.slice(10, 12)
+            // let day = row.cardid.slice(12, 14)
+            // this.obj0.birthdayData = year + '-' + mouth + '-' + day
+            // console.log(this.obj0)
+
         }
 
         var flag = false,
diff --git a/src/views/securityMan/index.vue b/src/views/securityMan/index.vue
index 3055634..432c80f 100644
--- a/src/views/securityMan/index.vue
+++ b/src/views/securityMan/index.vue
@@ -4,7 +4,7 @@
     <span v-if="typeTABS.prop === 'tab1'"> -->
         <div class="avue-page" id="avuePageEle"
             style="width: 1000px;margin: 0 auto;padding: 0 20px;position: relative;background-color: #fff;">
-            <avue-form ref="form" v-model="form" :option="option0" :before-open="beforeOpen">
+            <avue-form ref="form" v-model="form" :option="option0">
                 <template slot="menuLeft">
                     <el-button type="primary" size="small" plain icon="el-icon-s-check" @click="printBA">打印
                     </el-button>
@@ -441,9 +441,6 @@
         }
     },
 
-    created () {
-    },
-
     computed: {
         ids1 () {
             let ids1 = []
@@ -457,35 +454,6 @@
         }),
     },
     methods: {
-        beforeOpen () {
-            getUser(this.userInfo.Id).then(res => {
-                console.log('getUser', res)
-                let userData = res.data.data
-                if (this.obj0) {
-                    // this.obj0.userDetailId = userData.id
-                    this.obj0.education1 = userData.education1
-                    this.obj0.marriageStatus = userData.marriageStatus
-                    this.obj0.signLevel = userData.signLevel
-                    this.obj0.permanentResidenceAddress = userData.permanentResidenceAddress
-                    this.obj0.dwellAddress = userData.dwellAddress
-                    this.obj0.memberOfFamily = userData.memberOfFamily
-                    this.obj0.educationExperience = userData.educationExperience
-                    this.obj0.workExperience = userData.workExperience
-                    this.obj0.healthCertificateUrl = userData.healthCertificateUrl
-                    this.obj0.noCriminalRecordProveUrl = userData.noCriminalRecordProveUrl
-                    this.obj0.acceptancePoliceUnit = userData.acceptancePoliceUnit
-                    this.obj0.acceptancePerson = userData.acceptancePerson
-                    this.obj0.acceptanceTime = userData.acceptanceTime
-                    this.obj0.unitName = userData.unitName
-                }
-                //获取用户从业信息
-                getUserPractitionersInfo(userInfo.id).then(res1 => {
-                    userData.UserPractitionersInfo = res1.data.data
-                    console.log('res1', res1)
-                })
-            })
-        },
-
         // 打印保安信息
         printBAInfo () {
             var printDom = document.getElementById("avuePageEle")
@@ -680,7 +648,6 @@
         //查询保安员信息
         console.log(this.userInfo, 456)
         this.id = this.userInfo.Id
-        // this.beforeOpen()
         var roleName = this.userInfo.role_name
         // debugger;
         //如果保安,才能看保安证

--
Gitblit v1.9.3