Browse Source

考评得分规则整改,增删改查服务联调

SunZehao 2 năm trước cách đây
mục cha
commit
8e1e84ad23

+ 38 - 5
src/components/evaluationSystem/evaluationCompanyPage.vue

@@ -89,7 +89,14 @@
                     <div class="periodFrom">
                         <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm" :validate-on-rule-change="false">
                             <el-form-item label="单位名称" prop="organizationName">
-                                <el-input v-model="ruleForm.organizationName" placeholder="请输入单位名称名称"></el-input>
+                                <el-select v-model="ruleForm.organizationName" multiple collapse-tags placeholder="请输入单位名称名称">
+                                    <el-option
+                                    v-for="item in companyDatas"
+                                    :key="item.id"
+                                    :label="item.name"
+                                    :value="item.id">
+                                    </el-option>
+                                </el-select>
                             </el-form-item>
                             <el-form-item label="考评规则" prop="evaluateRule">
                                 <el-select v-model="ruleForm.evaluateRule" placeholder="请选择考评规则" @change="changeRule">
@@ -163,7 +170,7 @@
 
 <script>
 import importDailog from '../importPage/importDailog.vue'
-import {apiGetOrganizationList, apiGetorganizationSaveList, apiGetorganizationdeleteList,
+import {apiGetOrganizationList, apiGetorganizationSaveList, apiGetorganizationdeleteList,apiGetorganizationgetTree,
  apiGetdatadictionaryList, apiGetevaluateListAll} from '../../api/api'
 export default {
   components: { importDailog },
@@ -181,7 +188,7 @@ export default {
             ruleDataAll: [],
             periodData: [],
             ruleForm: {
-                organizationName: '',
+                organizationName: [],
                 evaluateRule: '',
                 binSection: '',
                 binStage: '',
@@ -217,6 +224,7 @@ export default {
             },
             evalradio: {},
             loadingImport: false,
+            companyDatas: []
         }
     },
     created() {
@@ -225,6 +233,7 @@ export default {
         this.getDataDictionary('MK0001') //模块
         this.getDataDictionary('JD0001') //阶段
         this.getPeriodData()
+        this.getOrganizetionData(23031000, 2)
     },
     methods:{
         // 查询单位数据
@@ -245,6 +254,19 @@ export default {
                 }
             })
         },
+        //查询组织数据
+        getOrganizetionData(id, num) {
+            let that = this
+            let params = {
+                id: id,
+                num: num
+            }
+            apiGetorganizationgetTree(params).then(datas =>{
+                if (datas && datas.data && datas.data[0].children.length>0) {
+                    that.companyDatas = datas.data[0].children
+                }
+            })
+        },
         // 查询规则模块和阶段数据
         getDataDictionary(val) {
             let that = this
@@ -296,7 +318,7 @@ export default {
             this.$nextTick(() =>{
                 // this.$refs['ruleForm'].resetFields()
                 this.ruleForm = {
-                    organizationName: '',
+                    organizationName: [],
                     evaluateRule: '',
                     binSection: '',
                     binStage: '',
@@ -334,8 +356,19 @@ export default {
         //新增/修改指标数据
         saveAndEditIndicatorData() {
             let that = this
+            let unitListArr = []
+            for(let i =0; i<that.companyDatas.length; i++) {
+                let item = that.companyDatas[i]
+                for(let j =0; j<that.ruleForm.organizationName.length; j++) {
+                    let itn = that.ruleForm.organizationName[j]
+                    if (item.id === itn) {
+                        unitListArr.push(item)
+                    }
+                }
+            }
             let params = {
-                organizationName: that.ruleForm.organizationName,
+                // organizationName: that.ruleForm.organizationName,
+                unitList: unitListArr,
                 evaluationCycle: that.ruleForm.evaluationCycle,
                 organizationType: 'DWKP',
                 evaluateRuleId: that.ruleForm.evaluateRule,

+ 69 - 6
src/components/knowledgePage/scoringRulesDetailPage.vue

@@ -63,7 +63,8 @@
                             <div class="periodFrom">
                                 <div class="fromLeft">
                                     <el-tabs type="border-card">
-                                        <el-tab-pane label="指标项名称">
+                                        <el-tab-pane label="子指标">
+                                                <!-- @row-dblclick="rowDbclick" -->
                                             <el-table
                                                 size="mini"
                                                 :show-header="false"
@@ -71,8 +72,27 @@
                                                 :stripe="false"
                                                 :border="false"
                                                 height="240"
-                                                @row-dblclick="rowDbclick"
+                                                ref="multipleTable"
                                                 :data="indicItemoptions"
+                                                @select-all="onSelectAll"
+                                                @selection-change="selectItem"
+                                                @row-click="onSelectOp"
+                                            >
+                                                <el-table-column type="selection" width="55" align="center" />
+                                                <el-table-column prop="childName" />
+                                                <el-table-column prop="childCode" />
+                                            </el-table>
+                                        </el-tab-pane>
+                                        <el-tab-pane label="指标项">
+                                            <el-table
+                                                size="mini"
+                                                :show-header="false"
+                                                :highlight-current-row="true"
+                                                :stripe="false"
+                                                :border="false"
+                                                height="240"
+                                                @row-dblclick="rowDbclick"
+                                                :data="multipleSelectionObj.list"
                                             >
                                                 <el-table-column prop="optionName" />
                                                 <el-table-column prop="optionCode" />
@@ -210,7 +230,9 @@ export default {
             },
             evalradio: {},
             rowevalradio: {},
-            dialogVisible: false
+            dialogVisible: false,
+            multipleSelection: [],
+            multipleSelectionObj: {}
         }
     },
     created() {
@@ -444,7 +466,7 @@ export default {
             }
             apiGetindicatorselectByCode(params).then(datas =>{
                 if (datas && datas.data) {
-                    that.indicItemoptions = datas.data[row.indicatorId]
+                    that.indicItemoptions = datas.data
                 }
             })
         },
@@ -454,6 +476,36 @@ export default {
         changeRank(val) {
             this.isrepresentation = !val
         },
+        onSelectAll() {
+            this.$refs.multipleTable.clearSelection();
+        },
+        selectItem(rows) {
+            if (rows.length > 1) {
+                const newRows = rows.filter((it, index) => {
+                if (index == rows.length - 1) {
+                    this.$refs.multipleTable.toggleRowSelection(it, true);
+                    return true;
+                } else {
+                    this.$refs.multipleTable.toggleRowSelection(it, false);
+                    return false;
+                }
+                });
+                this.multipleSelection = newRows;
+            } else {
+                this.multipleSelection = rows;
+                this.multipleSelectionObj = {}
+                this.multipleSelectionObj = rows[0]
+            }
+        },
+        onSelectOp(row) {
+            this.$refs.multipleTable.clearSelection();
+            this.$refs.multipleTable.toggleRowSelection(row, true);
+            this.multipleSelection = [];
+            this.multipleSelectionObj = {}
+            this.multipleSelectionObj = row;
+            debugger
+            this.multipleSelection.push(row);
+        },
         tabFuncRowClickHandle(row) {
             let elInput = null
             if (this.isrepresentation) {
@@ -515,6 +567,8 @@ export default {
                     range: '',
                     desc: ''
                 }
+                this.multipleSelectionObj = this.indicItemoptions[0]
+                this.$refs.multipleTable.toggleRowSelection(this.indicItemoptions[0], true);
             })
         },
         handleEdit() {
@@ -540,8 +594,8 @@ export default {
             let that = this
             let params = {
                 ruleId: that.rowevalradio.id,
-                regularExpression: document.getElementById("representation").value,
-                range: document.getElementById("range").value,
+                regularExpression: encodeURI(document.getElementById("representation").value),
+                range: encodeURI(document.getElementById("range").value),
                 ruleDescription: that.itemForm.desc
             }
             if (that.isSave) {
@@ -654,6 +708,15 @@ export default {
                                         margin-right: 20px;
                                         .el-tabs{
                                             height: 100%;
+                                            .el-tabs__content{
+                                                .el-table{
+                                                    .el-table__body-wrapper{
+                                                        .el-checkbox__inner{
+                                                            border-radius: 10px;
+                                                        }
+                                                    }
+                                                }
+                                            }
                                         }
                                     }
                                     .fromRight{

+ 2 - 1
src/components/knowledgePage/scoringRulesPage.vue

@@ -259,6 +259,7 @@ export default {
                 indicatorId: evalradio.indicatorId,
                 desc: evalradio.describe
             }
+            this.getEvaluationData(evalradio.businessPhase)
         },
         saveevaluscoringruleMsg(formName) {
             let that = this
@@ -426,7 +427,7 @@ export default {
     padding: 10px 20px;
     .el-table{
         .el-table__body-wrapper{
-            max-height: 64vh !important;
+            height: 64vh !important;
         }
         .el-input__inner{
             height: 30px !important;