}, | }, | ||||
updatePoints(params){ | updatePoints(params){ | ||||
return axios.post('/basictask/updateExpectedPoints',params) | return axios.post('/basictask/updateExpectedPoints',params) | ||||
}, | |||||
updateLeaderDept(params){ | |||||
return axios.post('/basictask/updateLeaderDept',params) | |||||
} | } | ||||
} | } |
import axios from "@/config/axios" | import axios from "@/config/axios" | ||||
export default { | export default { | ||||
getList(params) { | getList(params) { | ||||
console.log(params) | |||||
return axios.get("/rigidityconstraint/index", { params }) | return axios.get("/rigidityconstraint/index", { params }) | ||||
}, | }, | ||||
updatePoints(params) { | updatePoints(params) { | ||||
return axios.post('/rigidityconstraint/updateExpectedPoints', params) | return axios.post('/rigidityconstraint/updateExpectedPoints', params) | ||||
}, | |||||
updateLeaderDept(params) { | |||||
return axios.post('/rigidityconstraint/updateLeaderDept', params) | |||||
} | } | ||||
} | } |
}, | }, | ||||
updatePoints(params) { | updatePoints(params) { | ||||
return axios.post('/specialpower/updateExpectedPoints', params) | return axios.post('/specialpower/updateExpectedPoints', params) | ||||
}, | |||||
updateLeaderDept(params) { | |||||
return axios.post('/specialpower/updateLeaderDept', params) | |||||
} | } | ||||
} | } |
export default { | export default { | ||||
theme: state => state.theme, | theme: state => state.theme, | ||||
user: state => state.user, | user: state => state.user, | ||||
quota1:state=>state.base.quota1, | quota1:state=>state.base.quota1, | ||||
quota2:state=>state.base.quota2, | quota2:state=>state.base.quota2, | ||||
department:state=>state.base.department | |||||
department:state=>state.base.department, | |||||
formatDep:state=>state.base.formatDep | |||||
} | } |
export default { | export default { | ||||
namespaced: true, | namespaced: true, | ||||
state: { | state: { | ||||
department: [], | |||||
formatDep: [], | |||||
quota1: [], | quota1: [], | ||||
quota2: [] | |||||
quota2: [], | |||||
department:[], | |||||
}, | }, | ||||
mutations: { | mutations: { | ||||
SET_DEPARTMENT(state, data) { | SET_DEPARTMENT(state, data) { | ||||
}, | }, | ||||
SET_QUOTAL2(state, data) { | SET_QUOTAL2(state, data) { | ||||
state.quota2 = data; | state.quota2 = data; | ||||
}, | |||||
SET_FORMATDEP(state,data){ | |||||
console.log(data) | |||||
state.formatDep=data; | |||||
} | } | ||||
}, | }, | ||||
actions: { | actions: { | ||||
getDepartment({ commit, state }, data) { | getDepartment({ commit, state }, data) { | ||||
return new Promise((resolve, reject) => { | return new Promise((resolve, reject) => { | ||||
if (state.department.length > 0) { | if (state.department.length > 0) { | ||||
resolve(state.department) | |||||
return; | return; | ||||
} else { | } else { | ||||
axios.get('dept/getDeptList/' + data).then(res => { | axios.get('dept/getDeptList/' + data).then(res => { | ||||
let data = res.data.data; | let data = res.data.data; | ||||
console.log(formatDet(data)); | |||||
commit('SET_DEPARTMENT',formatDet(data)); | |||||
return formatDet(data); | |||||
commit('SET_DEPARTMENT',data); | |||||
commit('SET_FORMATDEP',formatDet(data)) | |||||
}).catch(()=>{ | }).catch(()=>{ | ||||
commit('SET_DEPARTMENT',[]); | commit('SET_DEPARTMENT',[]); | ||||
return [] | |||||
commit('SET_FORMATDEP',[]); | |||||
}) | }) | ||||
} | } | ||||
}) | }) |
export let base = { | export let base = { | ||||
methods: { | methods: { | ||||
reduceData(data) { | reduceData(data) { | ||||
let arr = data; | |||||
let year, code, quota1; | |||||
return arr.map(item => { | |||||
if (item.quota1 != quota1 && (code == undefined || item.code == code) && (item.year == year || year == undefined)) { | |||||
quota1 = item.quota1; | |||||
item.quota1Row = arr.filter(child => { | |||||
return child.year == item.year && child.code == item.code && item.quota1 == child.quota1 | |||||
}).length | |||||
} | |||||
if (item.code != code && (year == undefined || year == item.year)) { | |||||
code = item.code; | |||||
quota1 = ietm.quota1; | |||||
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 | |||||
} | |||||
if (item.year != year) { | |||||
year = item.year; | |||||
code = item.code; | |||||
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; | |||||
} | |||||
return item; | |||||
}) | |||||
try { | |||||
let arr = data; | |||||
let year, code, quota1; | |||||
return arr.map(item => { | |||||
if (item.quota1 != quota1 && (code == undefined || item.code == code) && (item.year == year || year == undefined)) { | |||||
quota1 = item.quota1; | |||||
item.quota1Row = arr.filter(child => { | |||||
return child.year == item.year && child.code == item.code && item.quota1 == child.quota1 | |||||
}).length | |||||
} | |||||
if (item.code != code && (year == undefined || year == item.year)) { | |||||
code = item.code; | |||||
quota1 = item.quota1; | |||||
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 | |||||
} | |||||
if (item.year != year) { | |||||
year = item.year; | |||||
code = item.code; | |||||
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; | |||||
} | |||||
return item; | |||||
}) | |||||
} catch(e) { | |||||
console.log(e) | |||||
} | |||||
}, | }, | ||||
arraySpanMethod({ row, column, rowIndex, columnIndex }) { | arraySpanMethod({ row, column, rowIndex, columnIndex }) { | ||||
if (columnIndex == 2) { | |||||
if (columnIndex == 1) { | |||||
if (row.yearRow) { | if (row.yearRow) { | ||||
return { | return { | ||||
rowspan: row.yearRow, | rowspan: row.yearRow, | ||||
} | } | ||||
} | } | ||||
} | } | ||||
if (columnIndex == 3 || columnIndex == 4) { | |||||
if (columnIndex == 2 || columnIndex == 3) { | |||||
if (row.codeRow) { | if (row.codeRow) { | ||||
return { | return { | ||||
rowspan: row.codeRow, | rowspan: row.codeRow, | ||||
} | } | ||||
} | } | ||||
} | } | ||||
if (columnIndex == 5) { | |||||
if (columnIndex == 4) { | |||||
if (row.quota1Row) { | if (row.quota1Row) { | ||||
return { | return { | ||||
rowspan: row.quota1Row, | rowspan: row.quota1Row, | ||||
}).length | }).length | ||||
} | } | ||||
return item; | return item; | ||||
}) | }) | ||||
}, | }, | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
}, | }, | ||||
} | } |
align="center" | align="center" | ||||
prop="leaderUnit" | prop="leaderUnit" | ||||
></el-table-column> | ></el-table-column> | ||||
<el-table-column | |||||
label="牵头部门" | |||||
min-width="150" | |||||
align="center" | |||||
prop="leaderDept" | |||||
> | |||||
<template slot-scope="{ row, $index }"> | |||||
<div | |||||
@dblclick="showDep($index, true)" | |||||
style="height: 45px;width:100%" | |||||
> | |||||
<treeselect | |||||
@blur=" | |||||
showSelect($index, false); | |||||
updateDep(row); | |||||
" | |||||
v-if="row.selectFocus" | |||||
v-model="row.leaderDept" | |||||
:options="department" | |||||
placeholder="请选择牵头部门" | |||||
:defaultExpandLevel="2" | |||||
:normalizer=" | |||||
(d) => { | |||||
return { | |||||
id: d.name, | |||||
label: d.name, | |||||
children: | |||||
d.children && d.children.length > 0 | |||||
? d.children | |||||
: undefined, | |||||
}; | |||||
} | |||||
" | |||||
/> | |||||
<span v-else>{{ row.leaderDept }}</span> | |||||
</div> | |||||
<el-table-column label="牵头部门" min-width="150" align="center"> | |||||
<template slot-scope="{ row }"> | |||||
<span>{{ row.leaderDeptList | formatList }}</span> | |||||
</template> | </template> | ||||
</el-table-column> | </el-table-column> | ||||
<el-table-column | <el-table-column | ||||
min-width="80" | min-width="80" | ||||
align="center" | align="center" | ||||
prop="leaderPrincipal" | prop="leaderPrincipal" | ||||
></el-table-column> | |||||
> | |||||
<template slot-scope="{ row }"> | |||||
{{ row.leaderPrincipalList | formatList }} | |||||
</template> | |||||
</el-table-column> | |||||
<el-table-column | <el-table-column | ||||
label="备注" | label="备注" | ||||
align="center" | align="center" | ||||
min-width="150" | min-width="150" | ||||
prop="note" | prop="note" | ||||
></el-table-column> | ></el-table-column> | ||||
<el-table-column label="操作" min-width="100" align="center"> | |||||
<template slot-scope="{ row }"> | |||||
<el-button | |||||
type="warning" | |||||
size="small" | |||||
@click="showLeaderDept(row)" | |||||
>设置牵头部门</el-button | |||||
> | |||||
</template> | |||||
</el-table-column> | |||||
</el-table> | </el-table> | ||||
<el-pagination | <el-pagination | ||||
:current-page.sync="page.page" | :current-page.sync="page.page" | ||||
layout="total, prev, pager, next, jumper" | layout="total, prev, pager, next, jumper" | ||||
:pager-count="5" | :pager-count="5" | ||||
class="ele-pagination-circle" | class="ele-pagination-circle" | ||||
:flat="true" | |||||
@current-change="getDataList()" | @current-change="getDataList()" | ||||
/> | /> | ||||
<el-dialog | |||||
title="设置牵头部门" | |||||
:visible.sync="showDep" | |||||
width="400px" | |||||
custom-class="ele-dialog-form" | |||||
:lock-scroll="false" | |||||
:destroy-on-class="true" | |||||
> | |||||
<treeselect | |||||
v-model="updateData.leaderDept" | |||||
:options="formatDep" | |||||
:multiple="true" | |||||
placeholder="请选择牵头部门" | |||||
:defaultExpandLevel="1" | |||||
:normalizer=" | |||||
(d) => { | |||||
return { | |||||
id: d.id, | |||||
label: d.name, | |||||
children: | |||||
d.children && d.children.length > 0 ? d.children : undefined, | |||||
}; | |||||
} | |||||
" | |||||
/> | |||||
<div slot="footer"> | |||||
<el-button @click="showDep = false">取消</el-button> | |||||
<el-button type="primary" @click="updateLeaderDept" | |||||
>保存</el-button | |||||
> | |||||
</div> | |||||
</el-dialog> | |||||
</el-card> | </el-card> | ||||
</div> | </div> | ||||
</template> | </template> | ||||
<script> | <script> | ||||
import tab from "./tab"; | import tab from "./tab"; | ||||
import search from "./search"; | import search from "./search"; | ||||
import taskTable from "./taskTable"; | |||||
import api from "@/api/assessingTarget/basicTarget"; | import api from "@/api/assessingTarget/basicTarget"; | ||||
import { assessing } from "@/utils/mixin"; | import { assessing } from "@/utils/mixin"; | ||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; | import "@riophae/vue-treeselect/dist/vue-treeselect.css"; | ||||
quota1: "", | quota1: "", | ||||
quota2: "", | quota2: "", | ||||
}, | }, | ||||
<<<<<<< HEAD | |||||
class:{type:0} | class:{type:0} | ||||
======= | |||||
updateData: [], | |||||
showDep: false, | |||||
>>>>>>> 279c27f4171c882a90872dbed98b219a3783bec7 | |||||
}; | }; | ||||
}, | }, | ||||
created() { | created() { | ||||
this.getDataList(); | this.getDataList(); | ||||
}, | }, | ||||
computed: { | computed: { | ||||
...mapGetters(["department"]), | |||||
...mapGetters(["formatDep"]), | |||||
}, | |||||
filters: { | |||||
formatList(val) { | |||||
if (val) { | |||||
return val.join(","); | |||||
} | |||||
}, | |||||
}, | }, | ||||
methods: { | methods: { | ||||
updateLeaderDept(){ | |||||
api.updateLeaderDept({itemId:this.updateData.id,leaderDept:this.updateData.leaderDept}).then(()=>{ | |||||
this.$message({type:"success",message:"设置牵头部门成功"}) | |||||
}).catch(()=>{ | |||||
this.$message.error('设置牵头部门失败') | |||||
}).finally(()=>{ | |||||
this.getDataList(); | |||||
}) | |||||
}, | |||||
showLeaderDept(data) { | |||||
this.showDep = true; | |||||
console.log(data) | |||||
data.leaderDept=(data.leaderDept&&data.leaderDept.split(','))||[]; | |||||
this.updateData = data | |||||
}, | |||||
updateParams(data) { | updateParams(data) { | ||||
this.searchParams = data; | this.searchParams = data; | ||||
this.resetCurrentPage(); | this.resetCurrentPage(); | ||||
data[index].focus = bool; | data[index].focus = bool; | ||||
this.dataList = data; | this.dataList = data; | ||||
}, | }, | ||||
showDep(index, bool) { | |||||
let data = this.dataList; | |||||
data[index].selectFocus = bool; | |||||
this.dataList = data; | |||||
}, | |||||
getDataList() { | getDataList() { | ||||
this.loading = true; | this.loading = true; | ||||
api | api | ||||
}; | }; | ||||
</script> | </script> | ||||
<style> | |||||
<style scoped> | |||||
</style> | </style> |
align="center" | align="center" | ||||
prop="leaderUnit" | prop="leaderUnit" | ||||
></el-table-column> | ></el-table-column> | ||||
<el-table-column | |||||
label="牵头部门" | |||||
min-width="80" | |||||
align="center" | |||||
prop="leaderDept" | |||||
></el-table-column> | |||||
<el-table-column label="牵头部门" min-width="150" align="center"> | |||||
<template slot-scope="{ row }"> | |||||
<span>{{ row.leaderDeptList | formatList }}</span> | |||||
</template> | |||||
</el-table-column> | |||||
<el-table-column | <el-table-column | ||||
label="责任领导" | label="责任领导" | ||||
min-width="80" | min-width="80" | ||||
min-width="150" | min-width="150" | ||||
prop="note" | prop="note" | ||||
></el-table-column> | ></el-table-column> | ||||
<el-table-column label="操作" min-width="100" align="center"> | |||||
<template slot-scope="{ row }"> | |||||
<el-button type="warning" size="small" @click="showLeaderDept(row)" | |||||
>设置牵头部门</el-button | |||||
> | |||||
</template> | |||||
</el-table-column> | |||||
</el-table> | </el-table> | ||||
<el-pagination | <el-pagination | ||||
:current-page.sync="page.page" | :current-page.sync="page.page" | ||||
class="ele-pagination-circle" | class="ele-pagination-circle" | ||||
@current-change="getDataList()" | @current-change="getDataList()" | ||||
/> | /> | ||||
<el-dialog | |||||
title="设置牵头部门" | |||||
:visible.sync="showDep" | |||||
width="400px" | |||||
custom-class="ele-dialog-form" | |||||
:lock-scroll="false" | |||||
:destroy-on-class="true" | |||||
> | |||||
<treeselect | |||||
v-model="updateData.leaderDept" | |||||
:options="formatDep" | |||||
:multiple="true" | |||||
placeholder="请选择牵头部门" | |||||
:defaultExpandLevel="1" | |||||
:normalizer=" | |||||
(d) => { | |||||
return { | |||||
id: d.id, | |||||
label: d.name, | |||||
children: | |||||
d.children && d.children.length > 0 ? d.children : undefined, | |||||
}; | |||||
} | |||||
" | |||||
/> | |||||
<div slot="footer"> | |||||
<el-button @click="showDep = false">取消</el-button> | |||||
<el-button type="primary" @click="updateLeaderDept">保存</el-button> | |||||
</div> | |||||
</el-dialog> | |||||
</el-card> | </el-card> | ||||
</div> | </div> | ||||
</template> | </template> | ||||
import tab from "./tab"; | import tab from "./tab"; | ||||
import search from "./search"; | import search from "./search"; | ||||
import api from "@/api/assessingTarget/reward"; | import api from "@/api/assessingTarget/reward"; | ||||
import {assessing} from "@/utils/mixin" | |||||
import { assessing } from "@/utils/mixin"; | |||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; | |||||
import Treeselect from "@riophae/vue-treeselect"; // 下拉树 | |||||
import { mapGetters } from "vuex"; | |||||
export default { | export default { | ||||
components: { | components: { | ||||
tab, | tab, | ||||
search, | search, | ||||
}, | }, | ||||
mixins:[assessing], | |||||
mixins: [assessing], | |||||
data() { | data() { | ||||
return { | return { | ||||
dataList: [], | dataList: [], | ||||
quota1: "", | quota1: "", | ||||
quota2: "", | quota2: "", | ||||
}, | }, | ||||
updateData:[], | |||||
showDep:false, | |||||
}; | }; | ||||
}, | }, | ||||
created() { | created() { | ||||
this.getDataList(); | this.getDataList(); | ||||
}, | }, | ||||
computed: { | |||||
...mapGetters(["formatDep"]), | |||||
}, | |||||
filters: { | |||||
formatList(val) { | |||||
if (val) { | |||||
return val.join(","); | |||||
} | |||||
}, | |||||
}, | |||||
methods: { | methods: { | ||||
updateLeaderDept() { | |||||
api | |||||
.updateLeaderDept({ | |||||
itemId: this.updateData.id, | |||||
leaderDept: this.updateData.leaderDept, | |||||
}) | |||||
.then(() => { | |||||
this.$message({ type: "success", message: "设置牵头部门成功" }); | |||||
}) | |||||
.catch(() => { | |||||
this.$message.error("设置牵头部门失败"); | |||||
}) | |||||
.finally(() => { | |||||
this.getDataList(); | |||||
}); | |||||
}, | |||||
showLeaderDept(data) { | |||||
this.showDep = true; | |||||
console.log(data); | |||||
data.leaderDept = (data.leaderDept && data.leaderDept.split(",")) || []; | |||||
this.updateData = data; | |||||
}, | |||||
updateParams(data) { | updateParams(data) { | ||||
this.searchParams = data; | this.searchParams = data; | ||||
this.resetCurrentPage(); | this.resetCurrentPage(); |
<el-form-item label="牵头部门:"> | <el-form-item label="牵头部门:"> | ||||
<treeselect | <treeselect | ||||
v-model="searchParams.leaderDept" | v-model="searchParams.leaderDept" | ||||
:options="department" | |||||
:options="formatDep" | |||||
placeholder="请选择牵头部门" | placeholder="请选择牵头部门" | ||||
:defaultExpandLevel="2" | |||||
:defaultExpandLevel="1" | |||||
:normalizer=" | :normalizer=" | ||||
(d) => { | (d) => { | ||||
return { | return { | ||||
id: d.name, | |||||
id: d.id, | |||||
label: d.name, | label: d.name, | ||||
children: (d.children&&d.children.length>0)?d.children:undefined, | children: (d.children&&d.children.length>0)?d.children:undefined, | ||||
}; | }; | ||||
<el-form-item label="配合部门:"> | <el-form-item label="配合部门:"> | ||||
<treeselect | <treeselect | ||||
v-model="searchParams.cooperateDept" | v-model="searchParams.cooperateDept" | ||||
:options="department" | |||||
:options="formatDep" | |||||
placeholder="请选择配合部门" | placeholder="请选择配合部门" | ||||
:defaultExpandLevel="2" | |||||
:defaultExpandLevel="1" | |||||
:normalizer=" | :normalizer=" | ||||
(d) => { | (d) => { | ||||
return { | return { | ||||
id: d.name, | |||||
id: d.id, | |||||
label: d.name, | label: d.name, | ||||
children: (d.children&&d.children.length>0)?d.children:undefined, | children: (d.children&&d.children.length>0)?d.children:undefined, | ||||
}; | }; | ||||
}, | }, | ||||
}, | }, | ||||
computed: { | computed: { | ||||
...mapGetters(["quota1", "quota2", "department"]), | |||||
...mapGetters(["quota1", "quota2", "formatDep"]), | |||||
}, | }, | ||||
watch: { | watch: { | ||||
"searchParams.quota1"(val) { | "searchParams.quota1"(val) { |
this.loading = fa; | this.loading = fa; | ||||
se; | se; | ||||
this.$message.error("删失败"); | this.$message.error("删失败"); | ||||
}).finally(()=>{ | |||||
this.getDataList(); | |||||
}); | }); | ||||
}) | }) | ||||
.catch(() => 0); | .catch(() => 0); | ||||
.catch(() => { | .catch(() => { | ||||
this.loading = false; | this.loading = false; | ||||
this.$message.error("删除失败"); | this.$message.error("删除失败"); | ||||
}).finally(()=>{ | |||||
this.getDataList(); | |||||
}); | }); | ||||
} | } | ||||
}, | }, | ||||
type: "success", | type: "success", | ||||
message: this.form.id ? "修改成功" : "添加成功", | message: this.form.id ? "修改成功" : "添加成功", | ||||
}); | }); | ||||
this.getDataList(this.page); | |||||
this.getDataList(); | |||||
}) | }) | ||||
.catch(() => { | .catch(() => { | ||||
this.loading = false; | this.loading = false; |
border | border | ||||
:data="dataList" | :data="dataList" | ||||
:height="tableHeight" | :height="tableHeight" | ||||
:sort-by="['year', 'code', 'quota1']" | |||||
:span-method="arraySpanMethod" | |||||
v-loading="loading" | v-loading="loading" | ||||
:span-method="arraySpanMethod" | |||||
> | > | ||||
<el-table-column | |||||
type="selection" | |||||
width="50" | |||||
align="center" | |||||
></el-table-column> | |||||
<el-table-column | <el-table-column | ||||
type="index" | type="index" | ||||
label="序号" | label="序号" | ||||
<script> | <script> | ||||
import search from "./search"; | import search from "./search"; | ||||
import api from "@/api/basicTable/conventionl.js"; | import api from "@/api/basicTable/conventionl.js"; | ||||
import {base} from "@/utils/mixin"; | |||||
import { base } from "@/utils/mixin"; | |||||
export default { | export default { | ||||
components: { | components: { | ||||
search, | search, | ||||
this.getDataList(); | this.getDataList(); | ||||
}, | }, | ||||
methods: { | methods: { | ||||
updateParams(data){ | |||||
this.searchParams=data; | |||||
updateParams(data) { | |||||
this.searchParams = data; | |||||
this.resetCurrentPage(); | this.resetCurrentPage(); | ||||
this.getDataList(); | this.getDataList(); | ||||
}, | }, | ||||
getDataList() { | getDataList() { | ||||
this.loading = true; | this.loading = true; | ||||
api | api | ||||
.getList(Object.assign({},this.searchParams,this.page)) | |||||
.getList(Object.assign({}, this.searchParams, this.page)) | |||||
.then((res) => { | .then((res) => { | ||||
this.loading = false; | this.loading = false; | ||||
console.log(res.data.data.records); | console.log(res.data.data.records); | ||||
item.year = item.year + ""; | item.year = item.year + ""; | ||||
return item; | return item; | ||||
}); | }); | ||||
this.dataList = this.reduceData(data); | this.dataList = this.reduceData(data); | ||||
this.count = res.data.data.total; | this.count = res.data.data.total; | ||||
}) | }) |