liuhj 4 kuukautta sitten
vanhempi
commit
6dfb607336
3 muutettua tiedostoa jossa 955 lisäystä ja 31 poistoa
  1. 338 0
      src/components/Resource/InsCountry.vue
  2. 611 31
      src/components/Resource/PerformanceT.vue
  3. 6 0
      src/router/index.js

+ 338 - 0
src/components/Resource/InsCountry.vue

@@ -0,0 +1,338 @@
+<template>
+    <div class="InsCountry-all">
+        <el-dialog width="830px" class="InsCountry-dialog" title="新增编辑" :visible.sync="dialogTableVisible">
+            <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="110px" class="demo-ruleForm">
+                <div class="InsCountry-form">
+                    <el-form-item label="国家名称" prop="countryName">
+                        <el-input v-model="ruleForm.countryName"></el-input>
+                    </el-form-item>
+                    <el-form-item label="是否为申根国" prop="isSchengen">
+                        <el-radio-group v-model="ruleForm.isSchengen">
+                            <el-radio label="是申根国"></el-radio>
+                            <el-radio label="不是申根国"></el-radio>
+                        </el-radio-group>
+                    </el-form-item>
+                    <el-form-item label="保险费用" prop="cost">
+                        <el-input-number class="append_unit" data-unit="CNY" :controls="false" v-model="ruleForm.cost" :precision="2">
+                            
+                        </el-input-number>
+                    </el-form-item>
+                    <el-form-item style="width:100%;" label="备注">
+                        <el-input type="textarea" :rows="2" v-model="ruleForm.remark"></el-input>
+                    </el-form-item>
+                </div>
+                <el-form-item style="text-align: right;width:100%;">
+                    <el-button type="primary" @click="submitForm('ruleForm')">保存</el-button>
+                    <el-button @click="resetForm('ruleForm')">重置</el-button>
+                    <el-button @click="dialogTableVisible=false">取消</el-button>
+                </el-form-item>
+            </el-form>
+        </el-dialog>
+        <div>国家保险标准</div>
+        <div class="InsCountry-search">
+            <div>
+                <el-input clearable size="small" style="width:250px;" v-model="searchinput" placeholder="请输入国家"></el-input>
+                <el-button @click="InsuranceCostPageItem" size="small" type="primary">查询</el-button>
+            </div>
+            <el-button @click="InsCountryadd" size="small" type="primary">新增</el-button>
+        </div>
+        <div class="InsCountry-table">
+            <el-table
+            :data="tableData"
+            border
+            style="width: 100%">
+                <el-table-column
+                prop="countryName"
+                label="国家"    
+                width="180">
+                </el-table-column>
+                <el-table-column
+                prop="cost"
+                label="金额"
+                width="180">
+                <template slot-scope="scope">
+                    {{ townum(scope.row.cost) }}
+                </template>
+                </el-table-column>
+                <el-table-column
+                prop="createTime"
+                label="更新时间"
+                width="180">
+                </el-table-column>
+                <el-table-column
+                prop="createUserName"
+                label="录入人"
+                width="180">
+                </el-table-column>
+                <el-table-column
+                prop="remark"
+                label="备注">
+                </el-table-column>
+                <el-table-column
+                label="操作"
+                width="180">
+                    <template slot-scope="scope">
+                        <el-button size="mini" @click="upDate(scope.row)">编辑</el-button>
+                        <el-button size="mini" type="danger" @click="del(scope.row)">删除</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+            <div class="block">
+                <el-pagination
+                  @size-change="handleSizeChange"
+                  @current-change="handleCurrentChange"
+                  :current-page="currentPage"
+                  :page-sizes="[10,14, 15, 20, 30]"
+                  :page-size="pagesize"
+                  layout="total, sizes, prev, pager, next, jumper"
+                  :total="total">
+                </el-pagination>
+            </div>
+        </div>
+    </div>
+</template>
+<script>
+export default {
+    data() {
+        return {
+            token:'',
+            userid:'',
+            tableData:[],
+            searchinput:'',
+            currentPage:1,
+            pagesize:14,
+            total:0,
+            dialogTableVisible:false,
+            ruleForm: {
+                id:'',
+                countryName:'',
+                cost:0,
+                isSchengen:'',
+                remark: '',
+            },
+            rules: {
+                countryName: [
+                    { required: true, message: '请输入', trigger: 'blur' },
+                ],
+                cost: [
+                    { required: true, message: '请输入', trigger: 'blur' }
+                ],
+                isSchengen: [
+                    { required: true, message: '请选择', trigger: 'change' }
+                ],
+            },
+        }
+    },
+    methods:{
+        //保留两位小数
+        townum(val){
+            val=Number(val);
+            return val.toFixed(2);
+        },
+        handleSizeChange(val) {
+            this.currentPage=1;
+            this.pagesize=val;
+            this.InsuranceCostPageItem();
+        },
+        handleCurrentChange(val) {
+            this.currentPage=val;
+            this.InsuranceCostPageItem();
+        },
+        //获取表格
+        InsuranceCostPageItem(){
+            var url = "/api/Resource/InsuranceCostPageItem"
+            var that = this
+            this.$axios({
+                method: 'post',
+                url: url,
+                headers: {
+                    Authorization: 'Bearer '
+                },
+                data:{
+                    portType:1,
+                    pageIndex:that.currentPage,
+                    pageSize:that.pagesize,
+                    search:that.searchinput,
+                }
+            }).then(function (res) {
+                if(res.data.code==200){
+                    that.tableData=res.data.data;
+                    that.total=res.data.count;
+                }else{
+                    that.$message({
+                        message: '加载失败!原因:'+res.data.msg,
+                        type: 'warning'
+                    });
+                }
+            })
+        },
+        InsCountryadd(){
+            this.dialogTableVisible=true;
+            this.ruleForm={
+                id:'',
+                countryName:'',
+                cost:0,
+                isSchengen:'',
+                remark: '',
+            }
+        },
+
+        //编辑
+        upDate(val){
+            this.InsCountryadd();
+            this.InsuranceCostInfo(val.id)
+        },
+        //获取详情
+        InsuranceCostInfo(val){
+            var url = "/api/Resource/InsuranceCostInfo"
+            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){
+                    let infobxbz=res.data.data
+                    that.ruleForm.id=infobxbz.id;
+                    that.ruleForm.countryName=infobxbz.countryName;
+                    that.ruleForm.cost=infobxbz.cost;
+                    that.ruleForm.isSchengen=infobxbz.isSchengen==1?'是申根国':'不是申根国';
+                    that.ruleForm.remark=infobxbz.remark;
+                }else{
+                    that.$message({
+                        message: '加载失败!原因:'+res.data.msg,
+                        type: 'warning'
+                    });
+                }
+            })
+        },
+        del(row) {
+            this.$confirm('此操作将删除该数据, 是否继续?', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                var url = "/api/Resource/InsuranceCostSoftDel"
+                var that = this
+                this.$axios({
+                    method: 'post',
+                    url: url,
+                    headers: {
+                        Authorization: 'Bearer '
+                    },
+                    data: {
+                        portType:1,
+                        currUserId: that.userid,
+                        id: row.id,
+                    }
+                }).then(function (res) {
+                    if (res.data.code == 200) {
+                        that.dialogTableVisible=false;
+                        that.$message({
+                            message:res.data.msg,
+                            type: 'success'
+                        });
+                        that.InsuranceCostPageItem();
+                    } else {
+                        that.$message.error(res.data.msg);
+                    }
+                }).catch(function (error) {
+                    that.$message.error("出错!请联系信息部");
+                });
+            }).catch(() => {
+                this.$message({
+                    type: 'info',
+                    message: '操作已取消!'
+                });
+            });
+        },
+        //新增api
+        InsuranceCostOp(){
+            var url = "/api/Resource/InsuranceCostOp"
+            var that = this
+            this.$axios({
+                method: 'post',
+                url: url,
+                headers: {
+                    Authorization: 'Bearer '
+                },
+                data:{
+                    portType:1,
+                    id:that.ruleForm.id==''?0:that.ruleForm.id,
+                    currUserId:that.userid,
+                    isSchengen:that.ruleForm.isSchengen=='是申根国'?1:0,
+                    countryName:that.ruleForm.countryName,
+                    cost:that.ruleForm.cost,
+                    remark:that.ruleForm.remark,
+                }
+            }).then(function (res) {
+                if(res.data.code==200){
+                    that.dialogTableVisible=false
+                    that.$message({
+                        type: 'success',
+                        message: res.data.msg
+                    });
+                    that.InsuranceCostPageItem();
+                }else{
+                    that.$message({
+                        message: '加载失败!原因:'+res.data.msg,
+                        type: 'warning'
+                    });
+                }
+            })
+        },
+        submitForm(formName) {
+            this.$refs[formName].validate((valid) => {
+            if (valid) {
+                this.InsuranceCostOp();
+            } else {
+                console.log('error submit!!');
+                return false;
+            }
+            });
+        },
+        resetForm(formName) {
+            this.$refs[formName].resetFields();
+        },
+    },
+    mounted(){
+        this.token = JSON.parse(localStorage.getItem('userinif')).token;
+        this.userid=JSON.parse(localStorage.getItem('userinif')).userInfo.userId;
+        this.InsuranceCostPageItem();
+    },
+}
+</script>
+<style>
+.InsCountry-all {
+    background-color: #fff;
+    padding: 10px;
+    box-shadow: 0 0 5px #0005;
+    border-radius: 10px;
+    min-height: 830px;
+}
+.InsCountry-search{
+    display: flex;
+    justify-content: space-between;
+    margin: 10px 0 ;
+}
+.InsCountry-table .block{
+    text-align: center;
+    margin-top: 15px;
+}
+.InsCountry-dialog .el-form-item{
+    width: 395px;
+}
+.InsCountry-dialog .el-select,.el-input,.el-input-number{
+    width: 100%;
+}
+.InsCountry-form{
+    display: flex;
+    flex-wrap:wrap ;
+}
+</style>

+ 611 - 31
src/components/Resource/PerformanceT.vue

@@ -14,18 +14,19 @@
                         </el-select>
                     </el-form-item> -->
                     <el-form-item label="上级菜单">
-                        <el-select filterable clearable v-model="ruleForm.parentmenu" placeholder="请选择上级菜单">
-                            <el-option v-for="(item,index) in parentmenuarr" :key="index" :label="item.name" :value="item.parentId"></el-option>
+                        <el-select filterable clearable v-model="ruleForm.parentId" placeholder="请选择上级菜单">
+                            <el-option v-for="(item,index) in parentmenuarr" :key="index" :label="item.name"
+                                :value="item.id"></el-option>
                         </el-select>
                     </el-form-item>
                     <el-form-item label="名称" prop="name">
                         <el-input v-model="ruleForm.name"></el-input>
                     </el-form-item>
-                    <el-form-item label="评估比例" prop="name">
+                    <el-form-item label="评估比例" prop="assessmentProportion">
                         <el-input v-model="ruleForm.assessmentProportion"></el-input>
                     </el-form-item>
                     <el-form-item style="width:100%;" label="评估标准">
-                        <el-input type="textarea" :rows="2" v-model="ruleForm.assessmentStandard"></el-input>
+                        <el-input type="textarea" :rows="6" v-model="ruleForm.assessmentStandard"></el-input>
                     </el-form-item>
                     <el-form-item style="width:100%;" label="备注">
                         <el-input type="textarea" :rows="2" v-model="ruleForm.remark"></el-input>
@@ -37,20 +38,110 @@
                     </el-select>
                 </el-form-item> -->
                 <el-form-item style="text-align: right;width:100%;">
-                    <el-button type="primary" @click="submitForm('ruleForm')">立即创建</el-button>
+                    <el-button type="primary" @click="submitForm('ruleForm')">立即设置</el-button>
                     <el-button @click="resetForm('ruleForm')">重置</el-button>
+                    <el-button @click="dialogTableVisible=false">取消</el-button>
                 </el-form-item>
             </el-form>
         </el-dialog>
+        <el-dialog width="830px" class="allocation-dialog" title="分配设置" :visible.sync="allocationVisible">
+            <el-form :model="allocationArgument" :rules="allocationrules" ref="allocationArgument" label-width="100px"
+                class="demo-ruleForm">
+                <div class="allocation-form">
+                    <el-form-item prop="assessmentSettingId" label="分配菜单">
+                        <el-select filterable clearable @change="caidanchange" v-model="allocationArgument.id"
+                            placeholder="请选择上级菜单">
+                            <el-option v-for="(item,index) in parentmenuarr" :key="index" :label="item.name"
+                                :value="item.id"></el-option>
+                        </el-select>
+                    </el-form-item>
+                    <el-form-item label="占比" prop="assessmentProportionChi">
+                        <el-input v-model="allocationArgument.assessmentProportionChi"></el-input>
+                    </el-form-item>
+                    <el-form-item label="目标值" prop="targetValue">
+                        <el-input v-model="allocationArgument.targetValue"></el-input>
+                    </el-form-item>
+                    <el-form-item prop="fixed" label="是否固定">
+                        <el-radio-group v-model="allocationArgument.fixed">
+                            <el-radio label="是"></el-radio>
+                            <el-radio label="否"></el-radio>
+                        </el-radio-group>
+                    </el-form-item>
+                    <el-form-item label="所属公司" prop="Corporation">
+                        <el-select v-model="allocationArgument.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="Division">
+                        <el-select v-model="allocationArgument.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="jobId">
+                        <el-select @change="QueryUserList" v-model="allocationArgument.jobId" 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="userId">
+                        <el-select v-model="allocationArgument.userId" placeholder="请选择职位">
+                            <el-option v-for="item in userinfoarr" :key="item.id" :label="item.cnName" :value="item.id">
+                            </el-option>
+                        </el-select>
+                    </el-form-item>
+                    <!-- <el-form-item prop="assessmentStandard" style="width:100%;" label="评估标准">
+                        <el-input type="textarea" :rows="2" v-model="allocationArgument.assessmentStandard"></el-input>
+                    </el-form-item> -->
+                    <el-form-item style="width:100%;" label="备注">
+                        <el-input type="textarea" :rows="2" v-model="allocationArgument.remark"></el-input>
+                    </el-form-item>
+                </div>
+                <el-form-item style="text-align: right;width:100%;">
+                    <el-button type="primary" @click="submitFormallocation('allocationArgument')">立即分配</el-button>
+                    <el-button @click="resetFormallocation('allocationArgument')">重置</el-button>
+                    <el-button @click="allocationVisible=false">取消</el-button>
+                </el-form-item>
+            </el-form>
+        </el-dialog>
+        <el-dialog width="400px" class="allocation-dialog" title="删除设置项" :visible.sync="deleteVisible">
+            <div class="deleteXM">
+                <label>项目名称:</label>
+                <el-select filterable clearable v-model="deleteXMid"
+                    placeholder="请选择项目名称">
+                    <el-option v-for="(item,index) in parentmenuarr" :key="index" :label="item.name"
+                        :value="item.id"></el-option>
+                </el-select>
+            </div>
+            <div style="text-align: right;margin-top: 20px;">
+                <el-button size="mini" @click="deleteXMbtn" type="danger">删除</el-button>
+                <el-button size="mini" @click="deleteVisible=false">取消</el-button>
+            </div>
+        </el-dialog>
         <div class="PerformanceT-hade">
             <div>
                 <el-select @change="userchange" style="width:200px;" v-model="value" filterable placeholder="请选择">
                     <el-option v-for="item in options" :key="item.id" :label="item.cnName" :value="item.id">
                     </el-option>
                 </el-select>
+                <el-date-picker
+                v-model="monthdate"
+                type="month"
+                style="width:200px;"
+                placeholder="选择月">
+                </el-date-picker>
             </div>
             <div>
                 <el-button @click="ondialog" type="primary">设 置</el-button>
+                <el-button @click="dlexmclick" type="primary">删除设置项</el-button>
+                <el-button @click="onallocation" type="primary">分配绩效</el-button>
+                <el-button @click="saveclick" type="primary">保 存</el-button>
             </div>
         </div>
         <div class="PerformanceT-title">
@@ -60,29 +151,52 @@
         </div>
         <div class="pf-table">
             <div class="PerformanceT-table-box" :ref="'tbox'+indexs" v-for="(tables,indexs) in tablelist" :key="indexs">
-                <div style="width:90px;text-align: center;">{{ tables.name }}</div>
+                <div @click="itemclick(tables)" style="width:90px;text-align: center;">
+                    <div>{{tables.name}}</div>
+                    <div>{{'('+tables.assessmentProportion_Percentage+'%)'}}</div>
+                </div>
                 <div class="calibrate-box">
                     <div class="second-box" v-for="(item,indexss) in tables.children" :key="indexss">
                         <div style="display: -webkit-box;">
-                            <div class="pf-onename">{{item.name}}</div>
+                            <div @click="itemclick(item)" class="pf-onename">
+                                <div>{{item.name}}</div>
+                                <div>{{'('+item.assessmentProportion_Percentage+'%)'}}</div>
+                            </div>
                             <div class="calibrate-box">
                                 <div class="pf-twoname" v-for="(itemchildren,indexsss) in item.children"
                                     :key="indexsss">
-                                    <div style="width: 150px;border-right: 1px solid #ebeef5;">{{ itemchildren.name }}
+                                    <div @click="itemclick(itemchildren)" style="width: 150px;border-right: 1px solid #ebeef5;">
+                                        <div>{{itemchildren.name}}</div>
+                                        <div>{{'('+itemchildren.assessmentProportion_Percentage+'%)'}}</div>
                                     </div>
-                                    <div class="pf-zb">10%</div>
-                                    <div style="width: 100px;border-right: 1px solid #ebeef5;">
+                                    <div class="pf-zb">{{ itemchildren.assessmentProportion_Percentage+"%" }}</div>
+                                    <div @click="goalclick(itemchildren)" style="width: 100px;border-right: 1px solid #ebeef5;">
                                         {{itemchildren.targetValue}}</div>
                                     <div style="width: 380px;padding: 10px;border-right: 1px solid #ebeef5;">{{
                                         itemchildren.assessmentStandard }}</div>
-                                    <div style="width: 300px;border-right: 1px solid #ebeef5;"></div>
-                                    <div style="width: 80px;border-right: 1px solid #ebeef5;">{{
-                                        itemchildren.selfAssessment }}</div>
-                                    <div style="width: 80px;border-right: 1px solid #ebeef5;">{{
-                                        itemchildren.selfAssessment }}</div>
-                                    <div style="width: 80px;border-right: 1px solid #ebeef5;">{{
-                                        itemchildren.higherUpAssessment }}</div>
-                                    <div style="width: 90px;"></div>
+                                    <div style="width: 250px;border-right: 1px solid #ebeef5;">
+                                        <el-input style="width:98%" type="textarea" :rows="4" placeholder="请输入内容" v-model="itemchildren.status">
+                                        </el-input>
+                                    </div>
+                                    <div style="width: 80px;border-right: 1px solid #ebeef5;">
+                                        <el-input-number style="width: 50px;" size="mini" :controls="false"
+                                            v-model="itemchildren.selfAssessment"></el-input-number>
+                                    </div>
+                                    <div style="width: 80px;border-right: 1px solid #ebeef5;">
+                                        <el-input-number style="width: 50px;" size="mini" :controls="false"
+                                            v-model="itemchildren.higherUpAssessment"></el-input-number>
+                                    </div>
+                                    <div style="width: 80px;border-right: 1px solid #ebeef5;">
+                                        <el-input-number disabled style="width: 50px;" size="mini" :controls="false"
+                                            v-model="itemchildren.score"></el-input-number>
+                                    </div>
+                                    <div style="width: 80px;border-right: 1px solid #ebeef5;">
+                                        <el-input-number disabled style="width: 50px;" size="mini" :controls="false"
+                                            v-model="itemchildren.scoreTotal"></el-input-number>
+                                    </div>
+                                    <div style="width: 74px;">
+                                        <el-button @click="deletecontent(itemchildren)" size="mini" icon="el-icon-delete" type="danger"></el-button>
+                                    </div>
                                 </div>
                             </div>
                         </div>
@@ -96,6 +210,12 @@
 export default {
     data() {
         return {
+            CorporationOption:[],//公司
+            DivisionOption:[],//部门
+            PostsOption:[],//职位
+            token:'',
+            monthdate:'',
+            userId:'',
             tablelist:[],
             tabletitle:[
                 {
@@ -123,7 +243,7 @@ export default {
                     name:'评价标准'
                 },
                 {
-                    width:'width:300px',
+                    width:'width:250px',
                     name:'达成情况'
                 },
                 {
@@ -139,9 +259,13 @@ export default {
                     name:'该项得分'
                 },
                 {
-                    width:'width:90px',
+                    width:'width:80px',
                     name:'绩效分'
                 },
+                {
+                    width:'width:74px',
+                    name:'操作'
+                },
             ],
             tboxheight:0,
             immobilizationarr:[
@@ -412,9 +536,13 @@ export default {
                     higherUpUserId: 0
                 },
             ],
+
+            deleteVisible:false,
+            userinfoarr:[],
             options: [],
             value: '',
-            dialogTableVisible:true,
+            dialogTableVisible:false,
+            allocationVisible:false,
             Assessmentrules:[],
             parentmenuarr:[],
             ruleForm: {
@@ -427,18 +555,296 @@ export default {
                 createId: '',
                 remark: '',
             },
+            //分配参数
+            allocationArgument:{
+                id:'',
+                Corporation:'',
+                Division:'',
+                createUserId:'',
+                assessmentSettingId:'',
+                assessmentProportionChi:'',//占比
+                targetValue:'',//目标值
+                jobId:'',//岗位id
+                userId:'',//员工id
+                fixed:'',//固定标识 (1 是固定 2 是灵活)
+                remark:'',//备注
+            },
+            deleteXMid:'',
             rules: {
                 name: [
                     { required: true, message: '请输入', trigger: 'blur' },
-                    { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
                 ],
                 assessmentProportion: [
                     { required: true, message: '请输入', trigger: 'blur' }
                 ],
+            },
+            allocationrules:{
+                assessmentSettingId: [
+                    { required: true, message: '请选择', trigger: 'change' }
+                ],
+                assessmentProportionChi: [
+                    { required: true, message: '请输入', trigger: 'blur' }
+                ],
+                targetValue: [
+                    { required: true, message: '请输入', trigger: 'blur' }
+                ],
+                Corporation: [
+                    { required: true, message: '请选择', trigger: 'change' }
+                ],
+                Division: [
+                    { required: true, message: '请选择', trigger: 'change' }
+                ],
+                jobId: [
+                    { required: true, message: '请选择', trigger: 'change' }
+                ],
+                userId: [
+                    { required: true, message: '请选择', trigger: 'change' }
+                ],
+                fixed: [
+                    { required: true, message: '请选择', trigger: 'change' }
+                ],
+                assessmentStandard: [
+                    { required: true, message: '请填写', trigger: 'blur' }
+                ],
             }
         }
     },
     methods:{
+        //处理日期
+        datetime(val) {
+            var date = new Date(val);
+            var y = date.getFullYear();
+            var m = date.getMonth() + 1 >= 10 ? date.getMonth() + 1 : '0' + (date.getMonth() + 1).toString();
+            var d = date.getDate() >= 10 ? date.getDate() : '0' + (date.getDate()).toString();
+            return y + '-' + m
+        },
+        //获取公司
+        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){
+                    that.CorporationOption=res.data.data;
+                }else{
+                    that.$message({
+                        message: '加载失败!原因:'+res.data.msg,
+                        type: 'warning'
+                    });
+                }
+            })
+        },
+        dlexmclick(){
+            this.deleteXMid='';
+            this.deleteVisible=true;
+        },
+        deleteXMbtn(){
+            this.$confirm('此操作将删除该数据, 是否继续?', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                this.DeleteAssessmentSetting(this.deleteXMid)
+            }).catch(() => {
+                this.$message({
+                    type: 'info',
+                    message: '操作已取消!'
+                });
+            });
+        },
+        deletecontent(val){
+            this.$confirm('此操作将删除该数据, 是否继续?', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                this.DeleteAssessmentContentSetting(val.contentId)
+            }).catch(() => {
+                this.$message({
+                    type: 'info',
+                    message: '操作已取消!'
+                });
+            });
+        },
+        //删除内容
+        DeleteAssessmentContentSetting(val){
+            var url = "/api/PersonnelModule/DeleteAssessmentContentSetting"
+            var that = this
+            this.$axios({
+                method: 'post',
+                url: url,
+                headers: {
+                    Authorization: 'Bearer '
+                },
+                data:{
+                    idArr:[val],
+                    userId:that.userId
+                }
+            }).then(function (res) {
+                if(res.data.code==200){
+                    that.$message({
+                        type: 'success',
+                        message: res.data.msg
+                    });
+                    that.GetPerformanceList();
+                }else{
+                    that.$message({
+                        message: '加载失败!原因:'+res.data.msg,
+                        type: 'warning'
+                    });
+                }
+            })
+        },
+        //删除项
+        DeleteAssessmentSetting(val){
+            var url = "/api/PersonnelModule/DeleteAssessmentSetting"
+            var that = this
+            this.$axios({
+                method: 'post',
+                url: url,
+                headers: {
+                    Authorization: 'Bearer '
+                },
+                data:{
+                    idArr:[val],
+                    userId:that.userId
+                }
+            }).then(function (res) {
+                if(res.data.code==200){
+                    that.deleteVisible=false;
+                    that.$message({
+                        type: 'success',
+                        message: res.data.msg
+                    });
+                    that.QueryAssessmentSettingListOffset();
+                }else{
+                    that.deleteVisible=false;
+                    that.$message({
+                        message: '加载失败!原因:'+res.data.msg,
+                        type: 'warning'
+                    });
+                }
+            })
+        },
+        //获取员工
+        QueryUserList(num){
+            if (num!=0) {
+                this.allocationArgument.userId = '';
+            }
+            var url = "/api/System/QueryUserList"
+            var that = this
+            this.$axios({
+                method: 'post',
+                url: url,
+                headers: {
+                    Authorization: 'Bearer ' + this.token
+                },
+                data:{
+                    CompanyId:that.allocationArgument.Corporation,
+                    DepId:that.allocationArgument.Division,
+                    JobPostId:that.allocationArgument.jobId,
+                    PortType:1,
+                }
+            }).then(function (res) {
+                if(res.data.code==200){
+                    that.userinfoarr=res.data.data;
+                }else{
+                    that.$message({
+                        message: '加载失败!原因:'+res.data.msg,
+                        type: 'warning'
+                    });
+                }
+            })
+        },
+        //切换公司
+        changeCorporation(item,num) {
+            console.log(item);
+            if (num!=0) {
+                this.allocationArgument.Division = '';
+                this.allocationArgument.jobId = '';
+                this.allocationArgument.userId = '';
+            }
+            for (let i = 0; i < this.CorporationOption.length; i++) {
+                if (this.CorporationOption[i].companyId == item) {
+                    this.DivisionOption = this.CorporationOption[i].subDep
+                }
+            }
+        },
+        //切换部门
+        changeDivision(item,num) {
+            if (num!=0) {
+                this.allocationArgument.jobId = '';
+                this.allocationArgument.userId = '';
+            }
+            for (let j = 0; j < this.DivisionOption.length; j++) {
+                if (this.DivisionOption[j].depId == item) {
+                    this.PostsOption = this.DivisionOption[j].subJob
+                }
+            }
+        },
+        //项目名点击
+        itemclick(val){
+            console.log(val);
+            this.dialogTableVisible=true;
+            this.ruleForm.parentId=val.parentId==0?'':val.parentId;
+            this.ruleForm.name=val.name;
+            this.ruleForm.id=val.id;
+            this.ruleForm.assessmentProportion=val.assessmentProportion;
+            this.ruleForm.assessmentStandard=val.assessmentStandard;
+            this.ruleForm.remark=val.assessmentStandard;
+        },
+        //细则名点击
+        // thinclick(val){
+        //     console.log(val);
+        //     this.dialogTableVisible=true;
+        //     this.ruleForm.parentId=val.parentId==0?'':val.parentId;
+        //     this.ruleForm.name=val.name;
+        //     this.ruleForm.id=val.id;
+        //     this.ruleForm.assessmentProportion=val.assessmentProportion;
+        //     this.ruleForm.assessmentStandard=val.assessmentStandard;
+        //     this.ruleForm.remark=val.assessmentStandard;
+        // },
+        //细则名点击
+        // KPIclick(val){
+        //     console.log(val);
+        //     this.dialogTableVisible=true;
+        //     this.ruleForm.parentId=val.parentId==0?'':val.parentId;
+        //     this.ruleForm.name=val.name;
+        //     this.ruleForm.id=val.id;
+        //     this.ruleForm.assessmentProportion=val.assessmentProportion;
+        //     this.ruleForm.assessmentStandard=val.assessmentStandard;
+        //     this.ruleForm.remark=val.assessmentStandard;
+        // },
+        //目标
+        goalclick(val){
+            console.log(val);
+            
+            this.onallocation()
+            for (let b = 0; b < this.CorporationOption.length; b++) {
+                for (let g = 0; g < this.CorporationOption[b].subDep.length; g++) {
+                    for (let m = 0; m < this.CorporationOption[b].subDep[g].subJob.length; m++) {
+                        if (val.jobId==this.CorporationOption[b].subDep[g].subJob[m].jobId) {
+                            this.allocationArgument.Corporation=this.CorporationOption[b].companyId;
+                            this.allocationArgument.Division=this.CorporationOption[b].subDep[g].depId;
+                        }
+                    }
+                }
+            }
+           this.allocationArgument.id=val.contentId;
+           this.allocationArgument.assessmentSettingId=val.id;
+           this.allocationArgument.targetValue=val.targetValue;
+           this.allocationArgument.jobId=val.jobId;
+           this.allocationArgument.userId=val.userId;
+           this.allocationArgument.fixed=val.fixed==1?'是':'否';
+           this.changeCorporation(this.allocationArgument.Corporation,0);
+           this.changeDivision(this.allocationArgument.Division,0);
+           this.QueryUserList(0);
+        },
         //获取基础数据
         GetWageSheetBasicsDataSource(){
             var url = "/api/PersonnelModule/GetWageSheetBasicsDataSource"
@@ -488,7 +894,7 @@ export default {
         },
         //获取数据
         GetPerformanceList(){
-            var url = "/api/PersonnelModule/GetPerformanceList?userid="+this.value
+            var url = "/api/PersonnelModule/GetPerformanceList?userid="+this.value+"&date="+this.datetime(this.monthdate)
             var that = this
             this.$axios({
                 method: 'get',
@@ -499,9 +905,9 @@ export default {
             }).then(function (res) {
                 if (res.data.code == 200) {
                     that.tablelist=res.data.data;
-                    for(let i=0;i<that.immobilizationarr.length;i++){
-                        that.tablelist.push(that.immobilizationarr[i])
-                    }
+                    // for(let i=0;i<that.immobilizationarr.length;i++){
+                    //     that.tablelist.push(that.immobilizationarr[i])
+                    // }
                 } else {
                     that.$message.error(res.data.msg);
                 }
@@ -566,13 +972,71 @@ export default {
                     assessmentStandard:that.ruleForm.assessmentStandard,
                     parentId:that.ruleForm.parentId==''?0:that.ruleForm.parentId,
                     id:that.ruleForm.id==''?0:that.ruleForm.id,
-                    createId:that.value,
+                    createId:that.userId,
                     remark:that.ruleForm.remark,
                 }
             }).then(function (res) {
                 if (res.data.code == 200) {
-                    
+                    that.dialogTableVisible=false;
+                    that.$message({
+                        type: 'success',
+                        message: res.data.msg
+                    });
+                    if (that.ruleForm.id!=0) {
+                        that.GetPerformanceList();
+                    }
+                    that.QueryAssessmentSettingListOffset();
                 } else {
+                    that.dialogTableVisible=false;
+                    that.$message.error(res.data.msg);
+                }
+            }).catch(function (error) {
+                that.$message.error("出错!,请联系信息部。");
+            });
+        },
+        //菜单切换
+        caidanchange(val){
+            this.allocationArgument.assessmentSettingId='';
+            var savejob ={};
+            this.parentmenuarr.forEach(item => {
+                if(item.id==val){
+                    savejob=item
+                }
+            });
+            this.allocationArgument.assessmentSettingId=savejob.id;
+        },
+        //分配api
+        AssessmentSettingOperationContent(){
+            console.log(this.allocationArgument);
+            var url = "/api/PersonnelModule/AssessmentSettingOperationContent"
+            var that = this
+            this.$axios({
+                method: 'post',
+                url: url,
+                headers: {
+                    Authorization: 'Bearer '
+                },
+                data:{
+                    id:that.allocationArgument.id==""?0:that.allocationArgument.id,
+                    createUserId:that.userId,
+                    assessmentSettingId:that.allocationArgument.assessmentSettingId,
+                    assessmentProportionChi:that.allocationArgument.assessmentProportionChi,
+                    targetValue:that.allocationArgument.targetValue,
+                    jobId:that.allocationArgument.jobId,
+                    userId:that.allocationArgument.userId,
+                    fixed:that.allocationArgument.fixed=='是'?1:2,
+                    remark:that.allocationArgument.remark,
+                }
+            }).then(function (res) {
+                if (res.data.code == 200) {
+                    that.allocationVisible=false;
+                    that.$message({
+                        type: 'success',
+                        message: res.data.msg
+                    });
+                    that.GetPerformanceList();
+                } else {
+                    that.allocationVisible=false;
                     that.$message.error(res.data.msg);
                 }
             }).catch(function (error) {
@@ -581,7 +1045,82 @@ export default {
         },
         //打开对话框
         ondialog(){
-            this.dialogTableVisible=true
+            this.ruleForm= {
+                name: '',
+                assessmentProportion: '',
+                assessmentStandard: '',
+                parentId: '',
+                parentmenu:'',
+                id:'',
+                createId: '',
+                remark: '',
+            },
+            this.dialogTableVisible=true;
+        },
+        //保存分数api
+        SaveUserAssessmen(data,date){
+            var url = "/api/PersonnelModule/SaveUserAssessmen"
+            var that = this
+            this.$axios({
+                method: 'post',
+                url: url,
+                headers: {
+                    Authorization: 'Bearer '
+                },
+                data:{
+                    createUserId:that.userId,
+                    assessmenData:date,
+                    data:data
+                }
+            }).then(function (res) {
+                if (res.data.code == 200) {
+                    that.$message({
+                        type: 'success',
+                        message: res.data.msg
+                    });
+                    that.GetPerformanceList();
+                } else {
+                    that.$message.error(res.data.msg);
+                }
+            }).catch(function (error) {
+                that.$message.error("出错!,请联系信息部。");
+            });
+        },
+        //保存分数
+        saveclick(){
+            console.log(this.datetime(this.monthdate));
+            var itemdata=[];
+            for (let y = 0; y <this.tablelist.length; y++) {
+                for(let e=0;e<this.tablelist[y].children.length;e++){
+                    for (let s = 0; s < this.tablelist[y].children[e].children.length; s++) {
+                        console.log(this.tablelist[y].children[e].children[s]);
+                        itemdata.push({
+                            assessmentContentSettingId:this.tablelist[y].children[e].children[s].contentId,
+                            selfAssessment:this.tablelist[y].children[e].children[s].selfAssessment,
+                            higherUpAssessment:this.tablelist[y].children[e].children[s].higherUpAssessment,
+                            leadersId:0,
+                            status:this.tablelist[y].children[e].children[s].status,
+                        })
+                    }
+                }
+            }
+            this.SaveUserAssessmen(itemdata,this.datetime(this.monthdate));
+        },
+        onallocation(){
+            this.allocationArgument={
+                id:'',
+                Corporation:'',
+                Division:'',
+                createUserId:'',
+                assessmentSettingId:'',
+                assessmentProportionChi:'',//占比
+                targetValue:'',//目标值
+                jobId:'',//岗位id
+                userId:'',//员工id
+                fixed:'',//固定标识 (1 是固定 2 是灵活)
+                remark:'',//备注
+            }
+            this.allocationVisible=true
         },
         submitForm(formName) {
             this.$refs[formName].validate((valid) => {
@@ -595,6 +1134,19 @@ export default {
         },
         resetForm(formName) {
             this.$refs[formName].resetFields();
+        },
+        submitFormallocation(formName) {
+            this.$refs[formName].validate((valid) => {
+            if (valid) {
+                this.AssessmentSettingOperationContent();
+            } else {
+                console.log('error submit!!');
+                return false;
+            }
+            });
+        },
+        resetFormallocation(formName) {
+            this.$refs[formName].resetFields();
         }
     },
     mounted(){
@@ -603,7 +1155,11 @@ export default {
         this.QueryAssessmentSettingListOffset();
     },
     created(){
-        window.addEventListener('resixe',this.getheight)
+        this.monthdate=new Date();
+        this.userId = JSON.parse(localStorage.getItem('userinif')).userInfo.userId;
+        this.token = JSON.parse(localStorage.getItem('userinif')).token;
+        this.daraSource();
+        window.addEventListener('resixe',this.getheight);
     }
 }
 </script>
@@ -647,6 +1203,7 @@ export default {
 .pf-onename{
     width:150px;
     display: flex;
+    flex-direction: column;
     justify-content: center;
     align-items: center;
     border-left: 1px solid #ebeef5;
@@ -666,6 +1223,7 @@ export default {
 }
 .pf-twoname>div{
     display: flex;
+    flex-direction: column;
     align-items: center;
     justify-content: center;
 }
@@ -692,8 +1250,30 @@ export default {
 .settings-form{
     display: flex;
     flex-wrap:wrap ;
-    
 }
+.allocation-dialog .el-form-item{
+    width: 395px;
+}
+.allocation-dialog .el-select,.el-input{
+    width: 100%;
+}
+.allocation-form{
+    display: flex;
+    flex-wrap:wrap ;
+}
+.pf-table .el-input-number.is-without-controls .el-input__inner{
+    padding-left: 10px;
+    padding-right: 10px;
+}
+.deleteXM{
+    display: flex;
+    align-items:center ;
+
+}
+.deleteXM label{
+    width: 90px;
+}
+
 </style>
 
 

+ 6 - 0
src/router/index.js

@@ -127,6 +127,7 @@ import CardReconciliation from '@/components/Finance/CardReconciliation';
 import EvaluationForm from '@/components/EvaluationForm'
 import TranslatorBase from '@/components/Resource/TranslatorBase'
 import PerformanceT from '@/components/Resource/PerformanceT'
+import InsCountry from '@/components/Resource/InsCountry'
 
 Vue.use(Router)
 
@@ -763,6 +764,11 @@ export default new Router({
           name: 'PerformanceT',
           component: PerformanceT
         },
+        {
+          path: '/home/InsCountry',
+          name: 'InsCountry',
+          component: InsCountry
+        },
       ]
     },
     {