Browse Source

修改

master
yangzhou-cyber 3 years ago
parent
commit
91f62867de
5 changed files with 163 additions and 94 deletions
  1. +0
    -45
      src/utils/mixin.js
  2. +0
    -1
      src/views/assessingTarget/basicTarget.vue
  3. +18
    -3
      src/views/second/segmentation/basicTable.vue
  4. +3
    -3
      src/views/second/segmentation/constraint.vue
  5. +142
    -42
      src/views/second/segmentation/reward.vue

+ 0
- 45
src/utils/mixin.js View File

@@ -3,12 +3,6 @@
let getNumber = (item, index, arr, props) => {
let number = 1
while (arr[++index]) {
// props.forEach(prop => {
// debugger
// if (arr[index][prop].trim() != item[prop].trim()) {
// return number;
// }
// })
for (let prop of props) {
if (arr[index][prop].trim() != item[prop].trim()) {
return number;
@@ -28,32 +22,17 @@ export let base = {
return arr.map((item, index) => {
if (item.quota1.trim() != quota1 && (code == undefined || item.code.trim() == code) && (item.year.trim() == year || year == undefined)) {
quota1 = item.quota1.trim();
// item.quota1Row = arr.filter(child => {
// return child.year == item.year && child.code == item.code && item.quota1 == child.quota1
// }).length
item.quota1Row = getNumber(item, index, arr, ["quota1", "code", "year"])
}
if (item.code.trim() != code && (year == undefined || year == item.year.trim())) {
code = item.code.trim();
quota1 = item.quota1.trim();
// item.quota1Row = arr.filter(child => {
// return child.year == item.year && child.code == item.code && item.quota1 == child.quota1
// }).length
// item.codeRow = arr.filter(child => {
// return child.year == item.year && child.code == item.code
// }).length
item.quota1Row = getNumber(item, index, arr, ['quota1', "code", "year"])
item.codeRow = getNumber(item, index, arr, ['code', "year"])
}
if (item.year.trim() != year) {
year = item.year.trim();
code = item.code.trim();
// item.codeRow = arr.filter(child => {
// return child.year == item.year && child.code == item.code
// }).length
// item.yearRow = arr.filter(child => {
// return child.year == item.year
// }).length;
item.yearRow = getNumber(item, index, arr, ['year'])
item.codeRow = getNumber(item, index, arr, ['code', 'year'])
}
@@ -116,30 +95,14 @@ export let assessing = {
return arr.map((item, index) => {
if (item.quota2.trim() != quota2 && (quota1 == undefined || quota1 == item.quota1.trim())) {
quota2 = item.quota2.trim();
// item.quota2Row = arr.filter(child => {
// if (child.quota1 == item.quota1 && child.quota2 == item.quota2) {
// return true
// }
// return false
// }).length
item.quota2Row = getNumber(item, index, arr, ['quota2', 'quota1']);
// console.log(item.quota2Row)
}

if (item.quota1.trim() != quota1) {
quota1 = item.quota1.trim();
quota2 = item.quota2.trim();
// item.quota2Row = arr.filter(child => {
// return child.quota1 == item.quota1 && child.quota2 == item.quota2
// }).length
// item.quota1Row = arr.filter(child => {
// return child.quota1 == item.quota1
// }).length;
// return item;
item.quota1Row = getNumber(item, index, arr, ['quota1'])
item.quota2Row = getNumber(item, index, arr, ['quota2', 'quota1'])
// console.log(item.quota2Row,item.quota1Row)
// console.log(item.quota1Row)
}
return item;
})
@@ -185,9 +148,6 @@ export let quota = {
return arr.map((item, index) => {
if (item.quota.trim() != quota) {
quota = item.quota.trim();
// item.quotaRow = arr.filter(child => {
// return child.quota == item.quota
// }).length
item.quotaRow = getNumber(item, index, arr, ['quota'])
}
return item;
@@ -225,9 +185,6 @@ export let categoryName = {
console.log(item)
if (item.categoryName.trim() != categoryName) {
categoryName = item.categoryName.trim();
// item.quotaRow = arr.filter(child => {
// return child.quota == item.quota
// }).length
item.quotaRow = getNumber(item, index, arr, ['categoryName'])
}
return item;
@@ -263,7 +220,6 @@ export function mergeSpan(params) {
methods: {
reduceData(data) {
let arr = data;
console.log(arr)
let prev = new Array(params.length).fill(undefined);
try {
return arr.map((item, index) => {
@@ -285,7 +241,6 @@ export function mergeSpan(params) {
}
}
})
console.log(item)
return item;
})
} catch (e) {

+ 0
- 1
src/views/assessingTarget/basicTarget.vue View File

@@ -274,7 +274,6 @@ export default {
this.page = page;
},
updatePoints(row, index) {
console.log(row.deptPoints > row.points);
if (row.deptPoints == this.preValue) {
return;
}

+ 18
- 3
src/views/second/segmentation/basicTable.vue View File

@@ -5,7 +5,7 @@
v-loading="loading"
element-loading-background="rgba(255, 255, 255, 1)"
>
<search :type="1" :search-params="searchParams" />
<search :type="1" @search:task="updateParams($event)" />
<div class="operating">
<el-button size="small" type="primary">导出</el-button>
</div>
@@ -15,6 +15,7 @@
:height="tableHeight"
border
:span-method="arraySpanMethod"
ref="table"
>
<el-table-column
type="index"
@@ -151,18 +152,32 @@ export default {
this.getDataList();
},
methods: {
updateParams(data) {
console.log(data);
this.searchParams = data;
this.resetCurrentPage();
this.getDataList();
},
resetCurrentPage() {
let page = this.page;
page.page = 1;
this.page = page;
},
getDataList() {
try {
this.$refs.table.bodyWrapper.scrollTop = 0;
} catch (e) {}
this.loading = true;
apiSummary
.getBasicTableList(Object.assign({}, this.page, this.searchParams))
.then((res) => {
let data = res.data.data;
this.count=data.total
this.count = data.total;
this.dataList = this.reduceData(data.records);
})
.catch((e) => {
this.dataList = [];
this.count=0
this.count = 0;
})
.finally(() => {
this.loading = false;

+ 3
- 3
src/views/second/segmentation/constraint.vue View File

@@ -26,6 +26,7 @@
label="考核指标"
min-width="150"
align="center"
prop="quota"
></el-table-column>
<el-table-column
label="考核内容和计分细则"
@@ -134,9 +135,8 @@ export default {
},
mixins: [
mergeSpan([
{ name: "quota1", col: [1] },
{ name: "quota2", col: [2] },
{ name: "content", col: [3] },
{ name: "quota", col: [1] },
{ name: "content", col: [2] },
]),
],
created() {

+ 142
- 42
src/views/second/segmentation/reward.vue View File

@@ -1,37 +1,107 @@
<template>
<div class="assessing-content ele-body">
<el-card shadow="never" v-loading="loading" element-loading-background="rgba(255, 255, 255, 1)">
<search :type="1" :search-params="searchParams" />
<div class="operating">
<el-card
shadow="never"
v-loading="loading"
element-loading-background="rgba(255, 255, 255, 1)"
>
<search :type="1" :search-params="searchParams" />
<div class="operating">
<el-button size="small" type="primary">导出</el-button>
</div>
<el-table highlight-current-row :data="dataList" :height="tableHeight" border>
<el-table-column type="index" width="50" align="center" label="编号"></el-table-column>
<el-table-column label="一级指标" min-width="150" align="center" prop="quota1"></el-table-column>
<el-table-column label="二级指标" min-width="150" align="center" prop="quota2"></el-table-column>
<el-table-column label="考核内容和计分细则" min-width="200" align="center" prop="content"></el-table-column>
<el-table-column label="小条内容" min-width="150" align="center" prop="littleContent"></el-table-column>
<el-table-column label="分值" min-width="60" align="center" prop="points"></el-table-column>
<el-table-column label="区牵头单位" min-width="80" align="center" prop="leaderUnit"></el-table-column>
<el-table-column label="牵头部门" min-width="80" align="center" prop="leaderDeptList"></el-table-column>
<el-table-column label="责任领导" min-width="80" align="center"></el-table-column>
<el-table-column label="配合部门" min-width="80" align="center" prop="cooperateDept"></el-table-column>
<el-table-column label="责任领导" min-width="80" align="center" prop="cooperateDeptList"></el-table-column>
<el-table-column
label="操作"
width="125"
align="center"
:key="Math.random()"
</div>
<el-table
highlight-current-row
:data="dataList"
:height="tableHeight"
border
:span-method="arraySpanMethod"
>
<template slot-scope="{ row }">
<router-link
:to="{name:'segmentation', params:{row, type: 2}}"
>分项</router-link
>
</template>
</el-table-column>
</el-table>
<el-pagination
<el-table-column
type="index"
width="50"
align="center"
label="编号"
></el-table-column>
<el-table-column
label="一级指标"
min-width="150"
align="center"
prop="quota1"
></el-table-column>
<el-table-column
label="二级指标"
min-width="150"
align="center"
prop="quota2"
></el-table-column>
<el-table-column
label="考核内容和计分细则"
min-width="200"
align="center"
prop="content"
></el-table-column>
<el-table-column
label="小条内容"
min-width="150"
align="center"
prop="littleContent"
></el-table-column>
<el-table-column
label="分值"
min-width="60"
align="center"
prop="points"
></el-table-column>
<el-table-column
label="区牵头单位"
min-width="80"
align="center"
prop="leaderUnit"
></el-table-column>
<el-table-column label="牵头部门" min-width="80" align="center">
<template slot-scope="{ row }">
{{ row.leaderDeptList | formatList }}
</template>
</el-table-column>
<el-table-column label="责任领导" min-width="80" align="center">
<template slot-scope="{ row }">
{{ row.leaderPrincipalList | formatList }}
</template>
</el-table-column>
<el-table-column
label="配合部门"
min-width="80"
align="center"
prop="cooperateDept"
>
<template slot-scope="{ row }">
{{ row.cooperateDeptList | formatList }}
</template>
</el-table-column>
<el-table-column
label="责任领导"
min-width="80"
align="center"
prop="cooperateDeptList"
>
<template slot-scope="{ row }">
{{ row.cooperatePrincipalList | formatList }}
</template>
</el-table-column>
<el-table-column
label="操作"
width="125"
align="center"
>
<template slot-scope="{ row }">
<router-link
:to="{ name: 'segmentation', params: { row, type: 2 } }"
>分项</router-link
>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page.sync="page.page"
:page-size="page.limit"
:total="count"
@@ -48,7 +118,9 @@

<script>
import search from "../search";

import api from "@/api/second/segmentation/reward";
import apiSummary from "@/api/second/taskSummary";
import { mergeSpan } from "@/utils/mixin";
export default {
components: {
search,
@@ -56,13 +128,11 @@ export default {
data() {
return {
searchParams: {},
dataList: [
{quota1:'sdewfdewd',}
],
dataList: [{ quota1: "sdewfdewd" }],
loading: false,
form: {},
quota1List:[],
quota2List:[],
quota1List: [],
quota2List: [],
count: 0,
tableHeight: document.documentElement.clientHeight - 360,
page: {
@@ -73,18 +143,48 @@ export default {
},
};
},
mixins: [
mergeSpan([
{ name: "quota1", col: [1] },
{ name: "quota2", col: [2] },
{ name: "content", col: [3] },
]),
],
created() {
this.getDataList();
},
methods: {
getDataList() {},
}
getDataList() {
this.loading = true;
apiSummary
.getBasicTableList(Object.assign({}, this.page, this.searchParams))
.then((res) => {
let data = res.data.data;
this.count = data.total;
this.dataList = this.reduceData(data.records);
})
.catch((e) => {
this.dataList = [];
this.count = 0;
})
.finally(() => {
this.loading = false;
});
},
},
filters: {
formatList(val) {
if (val) {
return val.join(",");
}
},
},
};
</script>

<style scoped>
a {
text-decoration:none;
color:#66B1FF;
}
a {
text-decoration: none;
color: #66b1ff;
}
</style>

Loading…
Cancel
Save