Browse Source

Merge branch 'master' of http://132.232.92.186:3000/XinXiBu/oa-system

yuanrf 11 months ago
parent
commit
8a8f378c92

+ 1 - 0
src/components/Finance/royaltypg.vue

@@ -279,6 +279,7 @@ export default {
                 });
                 return
             }
+            this.tableData=[];
             var url = "/api/Financial/ComputeRoyalties"
             var that = this
             this.$axios({

+ 10 - 0
src/components/statistics/Reportstbale.vue

@@ -90,6 +90,16 @@
                                     {{ scope.row.itemSumPrice.toFixed(2)}}
                                 </template>
                             </el-table-column>
+                            <el-table-column
+                            prop="statusStr"
+                            label="审核状态"
+                            width="80">
+                            </el-table-column>
+                            <el-table-column
+                            prop="auditorStr"
+                            label="审核人"
+                            width="80">
+                            </el-table-column>
                         </el-table-column>
                     </el-table>
                 </div>

+ 89 - 53
src/components/statistics/Statistically.vue

@@ -1,11 +1,20 @@
 <template>
     <div>
         <div class="statistically-all">
+            <div class="yeardate">
+                <el-date-picker
+                    @change="yearchange"
+                    style="width:200px;"
+                    v-model="year"
+                    type="year"
+                    placeholder="选择年">
+                </el-date-picker>
+            </div>
             <div class="canvas-box">
-                <div id="statisticallyone" style="width: 50%;height:400px;"></div>
-                <div id="grossmargin" style="width: 50%;height:400px;"></div>
-                <div id="grossmargins" style="width: 50%;height:400px;"></div>
-                <div id="grossmarginss" style="width: 50%;height:400px;"></div>
+                <div id="statisticallyone" style="width: 100%;height:400px;"></div>
+                <div id="grossmargin" style="width: 100%;height:400px;"></div>
+                <div id="grossmargins" style="width: 100%;height:400px;"></div>
+                <!-- <div id="grossmarginss" style="width: 50%;height:400px;"></div> -->
             </div>
         </div>
     </div>
@@ -15,6 +24,10 @@ import * as echarts from 'echarts';
 export default {
     data () {
         return {
+            year:new Date(),
+            businessincome:[],
+            Grossprofit:[],
+            costing:[],
             aaa:[
                 ['product', '去年销售额', '今年销售额'],
                 ['1月', 43.3, 85.8],
@@ -48,101 +61,121 @@ export default {
         }
     }, 
     methods: {
+        //处理时间
+        getdate(val){
+            var date=new Date(val);
+            var y=date.getFullYear();
+            return y
+        },
         statisone(){
+            console.log(this.businessincome,this.Grossprofit,this.costing);
             var myChart = echarts.init(document.getElementById('statisticallyone'));
             myChart.setOption({
                 title:{
-                    text: '业务总收入额',
+                    text: '业务总营业额',
                 },
                 legend: {},
                 tooltip: {},
                 dataset: {
-                    source: this.aaa
+                    source: this.businessincome
                 },
                 xAxis: { type: 'category' },
                 yAxis: {
-                    name: '销售额',
+                    name: '营业额',
                 },
-                
-                // Declare several bar series, each will be mapped
-                // to a column of dataset.source by default.
                 series: [{ type: 'bar' }, { type: 'bar' },]
             });
             var grossmargins = echarts.init(document.getElementById('grossmargins'));
             grossmargins.setOption({
                 title:{
-                    text: '业务总收入额',
-                },
-                legend: {},
-                tooltip: {},
-                dataset: {
-                    source: this.aaa
-                },
-                xAxis: { type: 'category' },
-                yAxis: {
-                    name: '销售额',
-                },
-                
-                // Declare several bar series, each will be mapped
-                // to a column of dataset.source by default.
-                series: [{ type: 'bar' }, { type: 'bar' },]
-            });
-            var grossmarginss = echarts.init(document.getElementById('grossmarginss'));
-            grossmarginss.setOption({
-                title:{
-                    text: '业务总收入额',
+                    text: '成本',
                 },
                 legend: {},
                 tooltip: {},
                 dataset: {
-                    source: this.aaa
+                    source: this.costing
                 },
                 xAxis: { type: 'category' },
                 yAxis: {
-                    name: '销售额',
+                    name: '成本额',
                 },
-                
-                // Declare several bar series, each will be mapped
-                // to a column of dataset.source by default.
                 series: [{ type: 'bar' }, { type: 'bar' },]
             });
             var grossmargin = echarts.init(document.getElementById('grossmargin'));
             grossmargin.setOption({
                 title:{
-                    text: '毛利',
+                    text: '毛利润',
                 },
                 legend: {},
                 tooltip: {
-                    formatter:function(params){
-                        // console.log(params);
-                        console.log(params.data)
-                        var html = params.data[0]+'毛利率'+"<br/>"+ params.data[1]+"%";
-                    // for(var i=0;i<params.length;i++){
-
-                    // html +=
-                    //     params[i].marker +params[i].seriesName+
-                    //     params[i].value +"人"+"<br/>";
+                    // formatter:function(params){
+                    //     var html = params.data[0]+'毛利率'+"<br/>"+ params.data[1]+"%";
+                    //     return html 
                     // }
-                    return html 
-                }
 
                 },
                 dataset: {
-                    source: this.bbb
+                    source: this.Grossprofit
                 },
                 xAxis: { type: 'category' },
                 yAxis: {
                     name: '毛利额',
                 },
-                color:['#EEAD0E'],
+                color:['#EEAD0E','#a0a7e6'],
                 // Declare several bar series, each will be mapped
                 // to a column of dataset.source by default.
-                series: [{ type: 'bar' },]
+                series: [{ type: 'bar' },{ type: 'bar' }]
             });
-        }
+        },
+        //年change
+        yearchange(){
+            this.businessincome=[];
+            this.Grossprofit=[];
+            this.costing=[];
+            this.StatisticsYOY()
+        },
+        //获取数据
+        StatisticsYOY(){
+            var url = "/api/Statistics/StatisticsYOY"
+            var that = this
+            this.$axios({
+                method: 'post',
+                url: url,
+                headers: {
+                    Authorization: 'Bearer '
+                },
+                data:{
+                    year:that.getdate(that.year),
+                }
+            }).then(function (res) {
+                if(res.data.code==200){
+                    //营业额
+                    that.businessincome.push(['product', '前一年该月营业额', '本年该月营业额']);
+                    for(let i=0;i<res.data.data.salesYOYData.length;i++){
+                        that.businessincome.push([res.data.data.salesYOYData[i].month+'月',res.data.data.salesYOYData[i].lastAmount,res.data.data.salesYOYData[i].thisAmount]);
+                    }
+                    //毛利润
+                    that.Grossprofit.push(['product', '前一年该月毛利润', '本年该月毛利润']);
+                    for(let j=0;j<res.data.data.grossProfitYOYData.length;j++){
+                        that.Grossprofit.push([res.data.data.grossProfitYOYData[j].month+'月',res.data.data.grossProfitYOYData[j].lastAmount,res.data.data.grossProfitYOYData[j].thisAmount]);
+                    }
+                    //成本
+                    that.costing.push(['product', '前一年该月成本', '本年该月成本']);
+                    for(let g=0;g<res.data.data.costYOYData.length;g++){
+                        that.costing.push([res.data.data.costYOYData[g].month+'月',res.data.data.costYOYData[g].lastAmount,res.data.data.costYOYData[g].thisAmount]);
+                    }
+                    that.statisone()
+                }else{
+                    that.$message({
+                        message: res.data.msg,
+                        type: 'warning'
+                    });
+                }
+            })
+        },
     },
     mounted(){
-        this.statisone()
+        this.StatisticsYOY();
     }
 }
 </script>
@@ -158,5 +191,8 @@ export default {
 .canvas-box{
     display: flex;
     flex-wrap: wrap;
-  }
+}
+.yeardate{
+    margin-bottom: 10px;
+}
 </style>

+ 552 - 127
src/components/system/User.vue

@@ -1,7 +1,6 @@
 <template>
     <div>
-
-        <div class="communal-list">
+        <div class="communal-list userlist">
             <div class="communal-title">
                 <div>员工列表</div>
                 <div class="communal-box">
@@ -58,55 +57,136 @@
                 </el-pagination>
             </div>
         </div>
-        <el-dialog  style="z-index:2013" title="修改员工" :visible.sync="upUserVisible" width="30%" :before-close="handleClose">
+        <el-dialog top="1vh" style="z-index:2013" title="修改员工信息" :visible.sync="upUserVisible" width="900px" :before-close="handleClose">
             <div>
-                <el-form :model="upData" :rules="rules" ref="upData" label-width="100px" class="demo-ruleForm">
-                    <el-form-item label="姓名" prop="cnName">
-                        <el-input placeholder="" v-model="upData.cnName" :disabled="true">
-                        </el-input>
-                    </el-form-item>
-                    <el-form-item label="工号" prop="Number">
-                        <el-input placeholder="请输入内容" v-model="upData.Number">
-                        </el-input>
-                    </el-form-item>
-                    <el-form-item label="分机号" prop="Ext">
-                        <el-input placeholder="请输入内容" v-model="upData.Ext">
-                        </el-input>
-                    </el-form-item>
-                    <el-form-item label="公司" prop="CompanyId">
-                        <el-select v-model="upData.CompanyId" filterable placeholder="请选择公司" @change="companyChange">
-                            <el-option v-for="item in companyData" :key="item.id" :label="item.companyName"
-                                :value="item.id">
+                <el-form
+                    :model="ruleForm"
+                    :rules="rules"
+                    ref="ruleForm"
+                    label-width="100px"
+                    class="demo-ruleForm"
+                >
+                    <div class="form-lis">
+                        <el-form-item label="中文名称" prop="mandarinName">
+                            <el-input @blur="emailpj" v-model="ruleForm.mandarinName" placeholder="与企业微信名称一致"></el-input>
+                        </el-form-item>
+                        <el-form-item label="英文名称" prop="eflName">
+                            <el-input @blur="emailpj" v-model="ruleForm.eflName" placeholder="请输入英文名称"></el-input>
+                        </el-form-item>
+                    </div>
+                    <div class="form-lis">
+                        <el-form-item label="邮箱" prop="email">
+                            <el-input v-model="ruleForm.email" placeholder="会自动识别">
+                            <template slot="append">@pan-american-intl.com</template>
+                            </el-input>
+                        </el-form-item>
+                        <el-form-item label="性别" prop="sex">
+                            <el-radio-group v-model="ruleForm.sex">
+                            <el-radio label="男"></el-radio>
+                            <el-radio label="女"></el-radio>
+                            </el-radio-group>
+                        </el-form-item>
+                        <el-form-item label="工号" prop="number">
+                            <el-input v-model="ruleForm.number" placeholder="请填写工号"></el-input>
+                        </el-form-item>
+                        <el-form-item label="手机号" prop="phone">
+                            <el-input v-model="ruleForm.phone" placeholder="与企业微信注册的手机号一致"></el-input>
+                        </el-form-item>
+                        <el-form-item label="紧急电话" prop="urgentphone">
+                            <el-input v-model="ruleForm.urgentphone" placeholder="不能与使用的手机号相同"></el-input>
+                        </el-form-item>
+                        <el-form-item label="密码" prop="pass">
+                            <el-input v-model="ruleForm.pass" show-password placeholder="输入密码"></el-input>
+                        </el-form-item>
+                        <el-form-item label="确认密码" prop="checkPass">
+                            <el-input v-model="ruleForm.checkPass" show-password placeholder="确认密码"></el-input>
+                        </el-form-item>
+                        <el-form-item label="身份证号" prop="IDnumber">
+                            <el-input v-model="ruleForm.IDnumber" placeholder="输入身份证号"></el-input>
+                        </el-form-item>
+                        <el-form-item label="入职时间" prop="datebirth">
+                            <el-date-picker type="date" placeholder="选择日期" v-model="ruleForm.datebirth" style="width: 100%;"></el-date-picker>
+                            <!-- <el-input v-model="ruleForm.datebirth"></el-input> -->
+                        </el-form-item>
+                        <el-form-item label="学历" prop="educated">
+                            <el-select v-model="ruleForm.educated" placeholder="请选择学历">
+                                <el-option
+                                v-for="item in educatedarr"
+                                :key="item.value"
+                                :label="item.label"
+                                :value="item.value">
+                                </el-option>
+                            </el-select>
+                        </el-form-item>
+                        <el-form-item label="专业" prop="specialized">
+                            <el-input v-model="ruleForm.specialized" placeholder="输入专业"></el-input>
+                        </el-form-item>
+                        <el-form-item label="毕业院校" prop="school">
+                            <el-input v-model="ruleForm.school" placeholder="输入毕业院校"></el-input>
+                        </el-form-item>
+                        <el-form-item label="教育类型" prop="recruitment">
+                            <el-select v-model="ruleForm.recruitment" placeholder="请选择教育类型">
+                                <el-option
+                                v-for="item in recruitmentarr"
+                                :key="item.value"
+                                :label="item.label"
+                                :value="item.value">
+                                </el-option>
+                            </el-select>
+                        </el-form-item>
+                        <el-form-item label="婚姻状况" prop="maritalstatus">
+                            <el-input v-model="ruleForm.maritalstatus" placeholder="输入婚姻状况"></el-input>
+                        </el-form-item>
+                        <el-form-item label="居住住址" prop="address">
+                            <el-input v-model="ruleForm.address" placeholder="输入居住住址"></el-input>
+                        </el-form-item>
+                        <el-form-item label="家庭地址" prop="homeAddress">
+                            <el-input v-model="ruleForm.homeAddress" placeholder="输入家庭地址"></el-input>
+                        </el-form-item>
+                        <el-form-item label="所属公司" prop="corporation">
+                            <el-select v-model="ruleForm.corporation" value-key="id" @change="changeCorporation" placeholder="请选择所属公司">
+                            <el-option
+                            v-for="item in CorporationOption"
+                            :key="item.companyId"
+                            :label="item.companyName"
+                            :value="item.companyId">
                             </el-option>
-                        </el-select>
-                    </el-form-item>
-                    <el-form-item label="部门" prop="DepId">
-                        <el-select v-model="upData.DepId" filterable placeholder="请选择部门" @change="depChange">
-                            <el-option v-for="item in depData" :key="item.id" :label="item.depName" :value="item.id">
+                            </el-select>
+                        </el-form-item>
+                        <el-form-item label="所属部门" prop="division">
+                            <el-select v-model="ruleForm.division" value-key="id" @change="changeDivision" placeholder="请选择所属部门">
+                            <el-option
+                            v-for="item in DivisionOption"
+                            :key="item.depId"
+                            :label="item.depName"
+                            :value="item.depId">
                             </el-option>
-                        </el-select>
-                    </el-form-item>
-                    <el-form-item label="职位" prop="JobPostId">
-                        <el-select v-model="upData.JobPostId" filterable placeholder="请选择职位">
-                            <el-option v-for="item in JobData" :key="item.id" :label="item.jobName" :value="item.id">
+                            </el-select>
+                        </el-form-item>
+                        <el-form-item label="职位" prop="posts">
+                            <el-select v-model="ruleForm.posts" placeholder="请选择职位">
+                            <el-option
+                            v-for="item in PostsOption"
+                            :key="item.jobId"
+                            :label="item.jobName"
+                            :value="item.jobId">
                             </el-option>
-                        </el-select>
-                    </el-form-item>
-                    <el-form-item label="试用期" prop="UsePeriod">
-                        <el-input type="textarea" :rows="3" placeholder="请输入内容" v-model="upData.UsePeriod"></el-input>
+                            </el-select>
+                        </el-form-item>
+                    </div>
+                    <el-form-item label="工作经历">
+                    <el-input type="textarea" v-model="ruleForm.desc"></el-input>
                     </el-form-item>
-                    <!-- <el-form-item label="人事审核" prop="HrAudit">
-                        <el-select v-model="upData.HrAudit" filterable placeholder="请选择状态">
-                            <el-option v-for="item in HrAuditSelect" :key="item.value" :label="item.label"
-                                :value="item.value">
-                            </el-option>
-                        </el-select>
-                    </el-form-item> -->
+                    <!-- <div class="enroll-btn">
+                        <el-button type="primary" @click="submitForm('ruleForm')">立即注册</el-button>
+                        <el-button @click="resetForm('ruleForm')">重置</el-button>
+                        <el-button @click="houtui()">返回</el-button>
+                    </div> -->
                 </el-form>
             </div>
             <span slot="footer" class="dialog-footer">
                 <el-button @click="upUserVisible = false">取 消</el-button>
-                <el-button type="primary" @click="upBtn">确 定</el-button>
+                <el-button type="primary" @click="confirmbtn('ruleForm')">确 定</el-button>
             </span>
         </el-dialog>
     </div>
@@ -116,21 +196,51 @@ import { co, el } from '@fullcalendar/core/internal-common';
 import { del } from 'vue';
 export default {
     data() {
+        var validatePass = (rule, value, callback) => {
+            if (value === "") {
+                callback(new Error("请输入密码"));
+            } else {
+                if (this.ruleForm.checkPass !== "") {
+                this.$refs.ruleForm.validateField("checkPass");
+                }
+                callback();
+            }
+        };
+        var validatePass2 = (rule, value, callback) => {
+            if (value === "") {
+                callback(new Error("请再次输入密码"));
+            } else if (value !== this.ruleForm.pass) {
+                callback(new Error("两次输入密码不一致!"));
+            } else {
+                callback();
+            }
+        };
+        var phonePass = (rule, value, callback) => {
+            console.log(value)
+            console.log(this.ruleForm.phone)
+            if (value === "") {
+                callback(new Error("请输入紧急电话"));
+            }else if (value === this.ruleForm.phone) {
+                callback(new Error("紧急电话与联系电话不能一致!"));
+            }else {
+                callback();
+            }
+        };
         return {
-            rules: {
-                Number: [
-                    { required: true, message: '请输入工号', trigger: 'blur' },
-                ],
-                CompanyId: [
-                    { required: true, message: '请选择所属公司', trigger: 'blur' },
-                ],
-                DepId: [
-                    { required: true, message: '请选择所属部门', trigger: 'change' }
-                ],
-                JobPostId: [
-                    { required: true, message: '请选择所属职位', trigger: 'change' }
-                ],
-            },
+            // rules: {
+            //     Number: [
+            //         { required: true, message: '请输入工号', trigger: 'blur' },
+            //     ],
+            //     CompanyId: [
+            //         { required: true, message: '请选择所属公司', trigger: 'blur' },
+            //     ],
+            //     DepId: [
+            //         { required: true, message: '请选择所属部门', trigger: 'change' }
+            //     ],
+            //     JobPostId: [
+            //         { required: true, message: '请选择所属职位', trigger: 'change' }
+            //     ],
+            // },
             tableDatas: [],
             tableData: [],
             companyData: [],
@@ -138,9 +248,12 @@ export default {
             JobData: [],
             currentPage: 1, // 当前页码
             pageSize: 15,// 每页的数据条数
+
+
             input: '',
             token: '',
             userId: 0,
+            ID:0,
             upUserVisible: false,
             upData: {
                 Id: 0,
@@ -166,7 +279,175 @@ export default {
                 label: '已拒绝'
             },],
             Permissions:[],
-            examine:false
+            examine:false,
+            CorporationOption:[],//公司
+            DivisionOption:[],//部门
+            PostsOption:[],//职位
+            ruleForm: {
+                mandarinName: "",//中文名称
+                eflName: "",//英文名称
+                sex: "",//性别
+                number:"",//工号
+                email: "",//邮箱
+                phone: "",//手机号
+                urgentphone: "",//紧急电话
+                pass: "",//密码
+                checkPass: "",//确认密码
+                IDnumber: "",//身份证号
+                educated: "",//学历
+                specialized: "",//专业
+                school: "",//毕业院校
+                recruitment: "",//统招/成教
+                datebirth: "",//入职时间
+                homeAddress:"",//家庭地址
+                maritalstatus: "",//婚姻状况
+                address: "",//现在居住住址
+                corporation: "",//所属公司
+                division: "",//所属部门
+                posts:"",//职位
+                desc: "",//工作经历
+            },
+            educatedarr:[
+                {
+                    
+                    label:'未设置',
+                    value:0
+                },
+                {
+                    label:'小学',
+                    value:1
+                },{
+                    label:'初中',
+                    value:2
+                },{
+                    label:'高中',
+                    value:3
+                },{
+                    label:'专科',
+                    value:4
+                },{
+                    label:'本科',
+                    value:5
+                },{
+                    label:'研究生',
+                    value:6
+                }
+            ],
+            recruitmentarr:[
+                {
+                    label:'未设置',
+                    value:0
+                },
+                {
+                    label:'统招',
+                    value:1
+                }, {
+                    label:'成教',
+                    value:2
+                },{
+                    label:'留学',
+                    value:3
+                },
+            ],
+            rules: {
+                mandarinName: [
+                { required: true, message: "中文名称", trigger: "blur" },
+                { min: 2, max: 6, message: "长度在 3 到 5 个字符", trigger: "blur" },
+                ],
+                eflName: [
+                { required: true, message: "英文名称", trigger: "blur" },
+                { min: 0, max: 10, message: "长度在 0 到 10 个字符", trigger: "blur" },
+                ],
+                sex: [{ required: true, message: "请选择性别", trigger: "change" }],
+                email: [
+                { required: true, message: "请输入邮箱地址", trigger: "blur" },
+                // {
+                //   type: "email",
+                //   message: "请输入正确的邮箱地址",
+                //   trigger: ["blur", "change"],
+                // },
+                ],
+                phone: [
+                { required: true, message: "手机号必填", trigger: "blur" },
+                {
+                    pattern: /^1[3456789]\d{9}$/,
+                    message: "手机号码格式不正确",
+                    trigger: "blur",
+                },
+                ],
+                urgentphone: [
+                { required: true,validator: phonePass, trigger: "blur" },
+                {
+                    pattern: /^1[3456789]\d{9}$/,
+                    message: "紧急号码格式不正确",
+                    trigger: "blur",
+                },
+                ],
+                pass: [
+                { required: true, validator: validatePass, trigger: "blur" },
+                {
+                    min: 6,
+                    max: 18,
+                    message: "长度在 6 到 18 个字符",
+                    trigger: "blur",
+                },
+                ],
+                checkPass: [
+                { required: true, validator: validatePass2, trigger: "blur" },
+                {
+                    min: 6,
+                    max: 18,
+                    message: "长度在 6 到 18 个字符",
+                    trigger: "blur",
+                },
+                ],
+                IDnumber: [
+                { required: true, message: "请填写证件号码", trigger: "blur" },
+                {
+                    pattern:
+                    /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}$)/,
+                    message: "证件号码格式有误!",
+                    trigger: "blur",
+                },
+                ],
+                datebirth: [
+                {
+                    required: true,
+                    message: "请选择入职日期",
+                    trigger: "change",
+                },
+                ],
+                educated: [{ required: true, message: "请选择学历", trigger: "change" }],
+                specialized: [
+                { required: true, message: "请填写专业", trigger: "blur" },
+                ],
+                school: [
+                { required: true, message: "请填写毕业院校", trigger: "blur" },
+                ],
+                recruitment: [
+                { required: true, message: "请填写统招/成教", trigger: "blur" },
+                ],
+                maritalstatus: [
+                { required: true, message: "请填写婚姻状况", trigger: "blur" },
+                ],
+                address: [
+                { required: true, message: "请填写现在居住住址", trigger: "blur" },
+                ],
+                homeAddress: [
+                { required: true, message: "请填写家庭地址", trigger: "blur" },
+                ],
+                corporation: [
+                { required: true, message: "请选择所属公司", trigger: "change" },
+                ],
+                division: [
+                { required: true, message: "请选择所属部门", trigger: "blur" },
+                ],
+                posts: [
+                { required: true, message: "请选择职位", trigger: "blur" },
+                ],
+                desc: [{ required: true, message: "请填写工作经历", trigger: "blur" }],
+                number: [{ required: true, message: "请填写工号", trigger: "blur" }],
+            },
         }
     },
     methods: {
@@ -179,6 +460,125 @@ export default {
         handleCurrentChange(val) {
             this.currentPage = val;
         },
+        //获取公司
+        daraSource(){
+            var url = "/api/register/daraSource"
+            var that = this
+            this.$axios({
+                method: 'post',
+                url: url,
+                headers: {
+                    Authorization: 'Bearer ' + this.token
+                }
+            }).then(function (res) {
+                if(res.data.code==200){
+                    console.log(res)
+                    that.CorporationOption=res.data.data;
+                }else{
+                    that.$message({
+                        message: res.data.msg,
+                        type: 'warning'
+                    });
+                }
+            })
+        },
+        //切换公司
+        changeCorporation(item){
+            this.ruleForm.division='';
+            this.ruleForm.posts='';
+            for(let i=0;i<this.CorporationOption.length;i++){
+                if(this.CorporationOption[i].companyId==item){
+                    this.DivisionOption=this.CorporationOption[i].subDep
+                }
+            }
+        },
+        //切换部门
+        changeDivision(item){
+            this.ruleForm.posts='';
+            for(let j=0;j<this.DivisionOption.length;j++){
+                if(this.DivisionOption[j].depId==item){
+                    this.PostsOption=this.DivisionOption[j].subJob
+                }
+            }
+        },
+        //邮箱拼接
+        emailpj(){
+            let emailall;
+            let surname=pinyin(this.ruleForm.mandarinName[0], {toneType: 'none'})
+            this.ruleForm.email=this.ruleForm.eflName+'.'+surname
+            emailall=this.ruleForm.eflName+'.'+surname+'@pan-american-intl.com'
+        },
+        //确定
+        confirmbtn(ruleForm){
+            this.$refs[ruleForm].validate((valid) => {
+                if (valid) {
+                    this.EditUserInfo()
+                } else {
+                    this.$message.error('请完善信息在保存!');
+                    return false;
+                }
+            });
+        },
+        //修改
+        EditUserInfo() {
+            var url = "/api/System/EditUserInfo"
+            var that = this
+            that.depData = [];
+            that.$axios({
+                method: 'post',
+                url: url,
+                headers: {
+                    Authorization: 'Bearer '
+                },
+                data: {
+                    currUserId:that.userId,
+                    id: that.ID,
+                    cnName: that.ruleForm.mandarinName,//中文姓名
+                    enName: that.ruleForm.eflName,//英文姓名
+                    number: that.ruleForm.number,//工号
+                    companyId: that.ruleForm.corporation,//公司Id
+                    depId: that.ruleForm.division,//部门Id
+                    jobPostId: that.ruleForm.posts,//岗位Id
+                    password: that.ruleForm.pass,//密码
+                    comfirmPassword: that.ruleForm.checkPass,//确认密码
+                    sex: that.ruleForm.sex=='男'?0:1,//性别0 男 1 女 2 未设置
+                    ext: '',//分机号
+                    phone: that.ruleForm.phone,//手机号
+                    urgentPhone:that.ruleForm.urgentphone,//紧急联系人 手机号
+                    email: that.ruleForm.email+'@pan-american-intl.com',//邮箱
+                    address: that.ruleForm.address,//住址
+                    edate: that.ruleForm.datebirth,//入职时间
+                    birthday: '',//生日
+                    idCard: that.ruleForm.IDnumber,//身份证号码
+                    startWorkDate: '',//开始工作时
+                    graduateInstitutions: that.ruleForm.school,//毕业学校
+                    professional: that.ruleForm.specialized,//专业
+                    education: that.ruleForm.educated,//学历 0 未设置 1 小学、2 初中、3 高中、4 专科、5 本科、6 研究生
+                    theOrAdultEducation:  that.ruleForm.recruitment,//学历类型 0 未设置 1 成教 2 统招 3 留学
+                    maritalStatus: that.ruleForm.maritalstatus,//婚姻状态
+                    homeAddress: that.ruleForm.homeAddress,//家庭地址
+                    usePeriod: '',//试用期
+                    workExperience: that.ruleForm.desc,//工作经历
+                    certificate: '',//证书上传
+                    qiyeChatUserId: '',//企微Id
+                    remark: '',//备注
+                }
+            }).then(function (res) {
+                if (res.data.code == 200) {
+                    that.$message({
+                        type: 'success',
+                        message: res.data.msg,
+                    });
+                    that.upUserVisible=false;
+                    that.user();
+                }else{
+                    that.$message({
+                        message: res.data.msg,
+                        type: 'warning'
+                    });
+                }
+            })
+        },
         //部门数据查询
         Department(companyId) {
             var url = "/api/System/QueryDepartmentList"
@@ -228,7 +628,6 @@ export default {
         depChange(event) {
             this.upData.JobPostId = null;
             this.Job(this.upData.CompanyId, event)
-
         },
         //职位数据查询
         Job(companyId, depId) {
@@ -265,8 +664,6 @@ export default {
                     portType: 1,
                 }
             }).then(function (res) {
-                console.log(res)
-
                 if (res.data.code == 200) {
                     that.tableDatas = res.data.data;
                     that.tableData = that.tableDatas
@@ -300,78 +697,94 @@ export default {
         },
         //#region  修改操作
         upDate(index, row) {
-
+            this.ruleForm= {
+                mandarinName: "",//中文名称
+                eflName: "",//英文名称
+                sex: "",//性别
+                number:"",//工号
+                email: "",//邮箱
+                phone: "",//手机号
+                urgentphone: "",//紧急电话
+                pass: "",//密码
+                checkPass: "",//确认密码
+                IDnumber: "",//身份证号
+                educated: "",//学历
+                specialized: "",//专业
+                school: "",//毕业院校
+                recruitment: "",//统招/成教
+                datebirth: "",//入职时间
+                homeAddress:"",//家庭地址
+                maritalstatus: "",//婚姻状况
+                address: "",//现在居住住址
+                corporation: "",//所属公司
+                division: "",//所属部门
+                posts:"",//职位
+                desc: "",//工作经历
+            }
+            this.ID=row.id;
             this.upUserVisible = true;
-            this.upData.cnName = row.cnName;
-            this.upData.Id = row.id;
-            this.upData.Number = row.number;
-            this.upData.CompanyId = row.companyId;
-            this.upData.DepId = row.depId;
-            this.upData.JobPostId = row.jobPostId;
-            this.upData.Ext = row.ext;
-            this.upData.UsePeriod = row.usePeriod;
-            this.upData.HrAudit = row.hrAudit;
-            this.Job(row.companyId, row.depId)
+            this.getuserinfo(row.id);
         },
-        upBtn() {
-
-            this.$refs.upData.validate((valid) => {
-                if (valid) {
-                    var that = this
-                    if (that.upData.DepId == "" || that.upData.DepId == undefined) {
-                        that.$message.error("部门不能为空");
-                        return
-                    }
-                    if (that.upData.CompanyId == "") {
-                        that.$message.error("公司不能为空");
-                        return
-                    }
-                    if (that.upData.JobPostId == "") {
-                        that.$message.error("岗位不能为空");
-                        return
-                    }
-                    if (that.upData.Number == "") {
-                        that.$message.error("工号不能为空");
-                        return
+        //获取详细信息
+        getuserinfo(val){
+            var url = "/api/System/UserInfo"
+            var that = this
+            this.$axios({
+                method: 'post',
+                url: url,
+                headers: {
+                    Authorization: 'Bearer '
+                },
+                data: {
+                    portType:1,
+                    id: val,
+                }
+            }).then(function (res) {
+                if (res.data.code == 200) {
+                    var datainfo=res.data.data;
+                    that.ruleForm.mandarinName=datainfo.cnName;
+                    that.ruleForm.eflName=datainfo.enName; 
+                    that.ruleForm.number=datainfo.number;
+                    that.ruleForm.email=datainfo.email.split('@')[0];
+                    that.ruleForm.sex=datainfo.sex==0?'男':'女';
+                    that.ruleForm.phone=datainfo.phone;
+                    that.ruleForm.urgentphone=datainfo.urgentPhone;
+                    that.ruleForm.pass=datainfo.password;
+                    that.ruleForm.checkPass=datainfo.password;
+                    that.ruleForm.IDnumber=datainfo.idCard;
+                    that.ruleForm.educated=datainfo.education;
+                    that.ruleForm.specialized=datainfo.professional;
+                    that.ruleForm.school=datainfo.graduateInstitutions;
+                    that.ruleForm.recruitment=datainfo.theOrAdultEducation;
+                    that.ruleForm.datebirth=datainfo.edate;
+                    that.ruleForm.homeAddress=datainfo.homeAddress;
+                    that.ruleForm.maritalstatus=datainfo.maritalStatus;
+                    that.ruleForm.address=datainfo.address;
+                    that.ruleForm.corporation=datainfo.companyId;
+                    that.ruleForm.division=datainfo.depId;
+                    that.ruleForm.posts=datainfo.jobPostId;
+                    that.ruleForm.desc=datainfo.workExperience;
+                    for(let i=0;i<that.CorporationOption.length;i++){
+                        if(that.CorporationOption[i].companyId==that.ruleForm.corporation){
+                            that.DivisionOption=that.CorporationOption[i].subDep
+                        }
                     }
-                    console.log(that.upData.Ext)
-                    if (that.upData.Ext == null || that.upData.Ext == undefined) that.upData.Ext = ""
-                    if (that.upData.UsePeriod == null || that.upData.UsePeriod == undefined) that.upData.UsePeriod = ""
-                    var url = "/api/System/EditUser"
-
-                    that.$axios({
-                        method: 'post',
-                        url: url,
-                        headers: {
-                            Authorization: 'Bearer ' + that.token
-                        },
-                        data: that.upData
-                    }).then(function (res) {
-                        console.log(res)
-
-                        if (res.data.code == 200) {
-                            that.$message({
-                                message: '修改成功',
-                                type: 'success'
-                            });
-
-
-
-
-
-
-
-
-
-
-                            
-                            that.upUserVisible = false;
-                            that.user();
-                        } else {
-                            that.$message.error('修改失败!');
+                    for(let j=0;j<that.DivisionOption.length;j++){
+                        if(that.DivisionOption[j].depId==that.ruleForm.division){
+                            that.PostsOption=that.DivisionOption[j].subJob
                         }
-                    })
+                    }
                 } else {
+                    that.$message.error(res.data.msg);
+                }
+            })
+        },
+        upBtn() {
+            this.$refs.upData.validate((valid) => {
+                if (valid) {
+                    
+                    
+                } else { 
                     this.$message.error('请完善信息在保存!');
                     return false;
                 }
@@ -478,6 +891,7 @@ export default {
                 this.examine=true;
             }
         }
+        this.daraSource()
         this.Department(0);
         this.company();
         this.user();
@@ -511,4 +925,15 @@ export default {
     margin-left: 10px;
     padding: 8px 20px;
 }
+
+.form-lis {
+    display: flex;
+    flex-wrap: wrap;
+}
+.form-lis > div {
+    width: 50%;
+}
+.form-lis .el-select{
+    width: 100%;
+}
 </style>