<template>
    <fullscreen :fullscreen.sync="fullscreen" class="container">
        <div class="container-box">
            <toolList @iconCli='iconCli' :tooltit='tooltit'></toolList>
            <div class="search">
                <mySearch :searchList="searchList" @searchInfo="searchInfo"></mySearch>
                <span style="line-height: 36px;height: 36px;overflow: hidden;">保存说明：{{remark}}</span>
                <el-button type="primary" @click="dialogCheck" size="medium">保存</el-button>
            </div>
            <div class="tabbox">
                <table cellspacing='0' style="width: auto;">
                    <tr>
                        <th colspan="8">{{nowmouth}}月 业务外包合作商考评扣罚表</th>
                    </tr>
                    <tr>
                        <th colspan="5">评分规则</th>
                        <th colspan="3">{{region}}</th>
                    </tr>
                    <tr>
                        <th>序号</th>
                        <th>一级指标</th>
                        <th>二级指标</th>
                        <th>分值</th>
                        <th>评分标准</th>
                        <th>合作商名称</th>
                        <th>得分</th>
                        <th>扣款原因</th>
                    </tr>
                    <tr v-for="(item,index) in tabList">
                        <td>
                            <div style="text-align: left;width: 50px;">{{index+1}}</div>
                        </td>
                        <td>
                            <div style="text-align: left;width: 120px;">{{item.one}}</div>
                        </td>
                        <td>
                            <div style="text-align: left;width: 200px;">{{item.two}}</div>
                        </td>
                        <td>
                            <div style="text-align: left;width: 50px;">{{item.num}}</div>
                        </td>
                        <td>
                            <div style="text-align: left;width: 500px;">{{item.bz}}</div>
                        </td>
                        <td rowspan="11" v-if="index == 0">
                            <el-input v-model="factoryName" :disabled="disableStatus"
                                style="text-align: left;width: 200px;">
                            </el-input>
                        </td>
                        <td style="text-align: left;width: 120px;">
                            <el-input v-model="item.score" :disabled="disableStatus"
                                style="text-align: left;width: 120px;">
                            </el-input>
                        </td>
                        <td style="text-align: left;width: 500px;">
                            <el-input v-model="item.reason" :disabled="disableStatus"
                                style="text-align: left;width: 200px;">
                            </el-input>
                        </td>
                    </tr>
                </table>
            </div>
        </div>


    </fullscreen>

</template>
<script>
    import mySearch from "../../../components/search.vue";
    import myMessage from "../../../components/myMessage.vue"
    import toolList from '../../../components/toolList'
    import myUpload from '../../../components/upload'
    import uploadDown from '../../../components/uploadDown.vue'
    import deptTreeOnly from "../../../components/deptTreeOnly.vue"

    export default {
        components: {
            mySearch,
            myMessage,
            toolList,
            myUpload,
            uploadDown,
            deptTreeOnly
        },
        data() {
            return {
                tooltit: '结算考评',
                fullscreen: false,
                total: 0,
                pageSize: 1,
                tableData: [{}],
                dialogStatus: false,
                disableStatus: false,
                titname: '',
                infolist: {},
                userInfo: {},
                params: {},
                centerDialogVisible: false,
                messTit: '',
                delid: '',
                uploadstatus: false,
                rovaList: [],
                mydisable: 1,
                opname: '',
                opno: '',
                tabList: [{
                    one: '业务营销能力',
                    two: '考核合作商重点营业营销能力营销项目及目标由地市结合当前营销重点而制定',
                    num: '50',
                    bz: '单项业务得分标准为：完成目标值此项得满分，完成50%以上线性得分，低于50%不得分。',
                    checkId: "",
                    id: "",
                    idPks: null,
                    itemId: "",
                    reason: "",
                    score: "",
                }, {
                    one: '客户服务能力',
                    two: '考核合作商客户服务能力服务规范及要求由地市制定',
                    num: '20',
                    bz: '根据服务考核要求及规范，符合要求得满分，未达标的，每次没台席扣0.5分，扣完为止。',
                    checkId: "",
                    id: "",
                    idPks: null,
                    itemId: "",
                    reason: "",
                    score: "",
                }, {
                    one: '台席运营能力',
                    two: '考核合作商外包台席稳定性及人员招聘及时率',
                    num: '5',
                    bz: '在甲方提出业务外包营业人员使用需求后，乙方应在“15个”工作日内到位。每延迟完成一天扣1分。合同期内乙方业务外包营业人员无故离岗，导致台席无法正常运营的，每出现一次扣2分。',
                    checkId: "",
                    id: "",
                    idPks: null,
                    itemId: "",
                    reason: "",
                    score: "",
                }, {
                    one: '资产安全管理',
                    two: '考核合作商营业物资使用及安全',
                    num: '5',
                    bz: '乙方在承接业务外包工作中，如涉及营业人员需使用、借用甲方的固定、流动资产、低值易耗品时，必须保障相关资产及物品的安全，如出现丢失或人为损坏，需按相关资产的残值进行赔偿甲方外，每出现一次此类情况扣当月考评分2分。',
                    checkId: "",
                    id: "",
                    idPks: null,
                    itemId: "",
                    reason: "",
                    score: "",
                }, {
                    one: '外包合作情况',
                    two: '考核合作商与项目相关的日常及临时性工作执行或合作效果',
                    num: '10',
                    bz: '及时配合甲方项目经理要求提供相关材料及相应文件，视情节严重，延误1次扣0.5-2分。',
                    checkId: "",
                    id: "",
                    idPks: null,
                    itemId: "",
                    reason: "",
                    score: "",
                }, {
                    one: '纠纷处理效果',
                    two: '考察合作商的纠纷处理措施是否满足我司的需求',
                    num: '10',
                    bz: '因乙方在承接业务外包工作中，涉及到人员用工、劳务等问题，造成不良的社会影响，视情节严重及处理效果得分：纠纷处理措施完全满足我司需求，8分＜得分≤10分；纠纷处理措施较好满足我司需求，6分＜得分≤8分；纠纷处理措施一般满足我司需求，4分＜得分≤6分；纠纷处理措施较差满足我司需求，0分＜得分≤4分',
                    checkId: "",
                    id: "",
                    idPks: null,
                    itemId: "",
                    reason: "",
                    score: "",
                }, {
                    one: '信息安全管理（扣分项）',
                    two: '考核合作商客户资料、数据及企业机密信息保密情况',
                    num: '-10',
                    bz: '乙方工作人员应严格遵守通信企业保密纪律，不准泄露任何客户资料和甲方数据。一旦发现违反此条款规定，甲方有权进行严格考核，每出现一次扣2分，如经查证，非营业员个人原因（即合作商主观指使或默许的）。甲方有权立即中止合作，给甲方及甲方的客户方造成的损失，甲方有权向乙方追究法律责任和经济补偿，当月扣10分。',
                    checkId: "",
                    id: "",
                    idPks: null,
                    itemId: "",
                    reason: "",
                    score: "",
                }, {
                    one: '不良社会影响（扣分项）',
                    two: '考核合作商客户满意度及社会影响',
                    num: '-10',
                    bz: '1、在业务外包合作项目中，如因乙方业务外包人员个人主观原因（殴打或漫骂客户、窃取客户信息或隐私等）造成的客户升级投诉、上访或其它原因给甲方造成不良影响的，扣5分。2、乙方业务外包台席所在厅店，若单店当月客户满意度打分99分以上不扣分，97分-99分之间每厅扣2分，低于97分每厅扣3分，扣完为止。',
                    checkId: "",
                    id: "",
                    idPks: null,
                    itemId: "",
                    reason: "",
                    score: "",
                }, {
                    one: '业务发展真实性（扣分项）',
                    two: '考核合作商业务发展真实性',
                    num: '-5',
                    bz: '根据省市公司数据核查，若发现虚假发展业务，则根据严重程度进行扣分，每次扣1-5分',
                    checkId: "",
                    id: "",
                    idPks: null,
                    itemId: "",
                    reason: "",
                    score: "",
                }, {
                    one: '重点业务营销（加分项）',
                    two: '考核合作商业务贡献，鼓励业务发展',
                    num: '10',
                    bz: '根据当前重点推广业务下发各类营销指标，最多加10分，加分标准由地市自行制定。',
                    checkId: "",
                    id: "",
                    idPks: null,
                    itemId: "",
                    reason: "",
                    score: "",
                }, {
                    one: '团队建设能力（加分项）',
                    two: '考核合作商团队建设及合作情况',
                    num: '10',
                    bz: '从合作商工作配合、驻地支撑、外包台席工资发放及时率等多维度评估团队运营效果.团队建设及合作完全满足我司需求，8分＜得分≤10分；团队建设及合作较好满足我司需求，6分＜得分≤8分；团队建设及合作一般满足我司需求，4分＜得分≤6分；团队建设及合作较差满足我司需求，0分＜得分≤4分。',
                    checkId: "",
                    id: "",
                    idPks: null,
                    itemId: "",
                    reason: "",
                    score: "",
                }, ],
                nowmouth: '',
                region: '',
                factoryName: '',
                searchList: [{
                    type: 'month',
                    tit: '月度标识',
                    value: '',
                    width: '98%'
                }],
                nowTime:'',
                detailList:[],
                companyFlag:'',
                remark:'',
            }
        },
        methods: {
            dialogCheck() {
                let v= {};
                let _this = this;
                this.detailList = [];
                for (let i = 0; i < this.tabList.length; i++) {
                    this.detailList.push({
                        checkId:'',
                        itemId:'',
                        reason:'',
                        score:'',
                        idPks:'',
                        id:'',
                    });
                        this.detailList[i].checkId = this.tabList[i].checkId;
                    this.detailList[i].id = this.tabList[i].id;
                    this.detailList[i].itemId = i+1;
                    this.detailList[i].reason = this.tabList[i].reason;
                    this.detailList[i].score = this.tabList[i].score;
                    this.detailList[i].idPks = this.tabList[i].idPks;
                }
                v.detailList = this.detailList;
                v.factoryName = this.factoryName;
                v.fillTime = this.nowTime;
                this.$http({
                    url: "/market/cStoreOutCheck/add",
                    method: "post",
                    headers: {
                        "Content-Type": "application/json",
                    },
                    data: v,
                }).then((res) => {
                    if (res.data.result === 1) {
                        _this.$message({
                            message: res.data.desc,
                            type: 'error'
                        });
                    } else {
                        _this.$message({
                            message: '成功',
                            type: 'success'
                        });
                        _this.getList(this.params, this.pageSize);
                    }
                });
            },
            //搜索数据
            searchInfo(v) {
                this.params = {};
                v[0] ? this.params.fillTime = this.$formatDate(v[0], "YYYY-MM") : '';
                this.nowTime = this.params.fillTime;
                this.nowmouth = this.nowTime.split("-")[1];
                this.getList(this.params, this.pageSize);
            },
            //获取列表
            getList(v, n) {
                this.pageSize = n;
                let _this = this;
                let time = this.$formatDate(new Date(), "YYYY-MM");
                if(!v.fillTime){
                    this.nowTime = time;
                    this.nowmouth = time.split("-")[1];
                    v.fillTime = time;
                }
                this.$http({
                    url: "/market/cStoreOutCheck/queryByCity",
                    method: "post",
                    headers: {
                        "Content-Type": "application/json",
                    },
                    data: v,
                }).then((res) => {
                    if(res.data.detailList){
                        for (let i = 0; i < this.tabList.length; i++) {
                            this.tabList[i].checkId = res.data.detailList[i].checkId;
                            this.tabList[i].id = res.data.detailList[i].id;
                            this.tabList[i].itemId = res.data.detailList[i].itemId;
                            this.tabList[i].reason = res.data.detailList[i].reason;
                            this.tabList[i].score = res.data.detailList[i].score;
                        }
                        this.factoryName = res.data.factoryName;
                    }else{
                        for (let i = 0; i < this.tabList.length; i++) {
                            this.tabList[i].checkId = '';
                            this.tabList[i].id = '';
                            this.tabList[i].itemId = '';
                            this.tabList[i].reason = '';
                            this.tabList[i].score = '';
                        }
                        this.factoryName = res.data.factoryName;
                    }
                });
            },
            //功能栏
            iconCli(v) {
                if (v === 1) {
                    this.getList(this.params, this.pageSize);
                }
                if (v === 2) {
                    this.fullscreen = !this.fullscreen
                }
            },
            getUser() {
                this.userInfo = JSON.parse(window.sessionStorage.userInfo);
                this.$http({
                    url: "/sysmgr/csysuserinfo/queryUserInfoByLoginNo",
                    method: "post",
                    headers: {
                        "Content-Type": "application/json",
                    },
                    data: {},
                }).then((res) => {
                    this.region = res.data.description;
                    this.companyFlag=res.data.companyFlag;
                    if(this.companyFlag == 1){
                        this.region = res.data.description.split("/")[1]
                    }else if(this.companyFlag == 0){
                        this.region = '省公司'
                    }
                });

                this.$http({
                    url: "/market/cStoreOutCheck/queryMkStoreOutCheckRemark",
                    method: "post",
                    headers: {
                        "Content-Type": "application/json",
                    },
                    data: {},
                }).then((res) => {
                    this.remark = res.data.remark;
                });

            }
        },
        mounted() {
            this.getList({}, 1);
            this.getUser();
        },
        created() {

        }
    }
</script>
<style scoped lang="scss">
    .onetab {
        margin-bottom: 20px;
        padding: 0 20px;
    }

    .titbox {
        div {
            float: right;

            i {
                font-size: 22px;
                margin-left: 20px;
                cursor: pointer;
            }
        }
    }

    .tabbox {
        margin-top: 15px;
        height: calc(100vh - 300px);
        overflow: scroll;

        table {
            border-bottom: 1px solid #ddd;
            border-right: 1px solid #ddd;
            text-align: center;
        }

        tr {
            // width: 100%;
        }

        th {
            border: 1px solid #ddd;
            border-bottom: 0;
            border-right: 0;
            padding: 5px 10px;
            font-size: 14px;
        }

        td {
            border: 1px solid #ddd;
            border-bottom: 0;
            border-right: 0;
            padding: 5px 10px;
            font-size: 12px;
        }
    }
</style>
