@@ -6,5 +6,8 @@ export default{ | |||
}, | |||
updatePoints(params){ | |||
return axios.post('/basictask/updateExpectedPoints',params) | |||
}, | |||
updateLeaderDept(params){ | |||
return axios.post('/basictask/updateLeaderDept',params) | |||
} | |||
} |
@@ -1,10 +1,12 @@ | |||
import axios from "@/config/axios" | |||
export default { | |||
getList(params) { | |||
console.log(params) | |||
return axios.get("/rigidityconstraint/index", { params }) | |||
}, | |||
updatePoints(params) { | |||
return axios.post('/rigidityconstraint/updateExpectedPoints', params) | |||
}, | |||
updateLeaderDept(params) { | |||
return axios.post('/rigidityconstraint/updateLeaderDept', params) | |||
} | |||
} |
@@ -6,5 +6,8 @@ export default { | |||
}, | |||
updatePoints(params) { | |||
return axios.post('/specialpower/updateExpectedPoints', params) | |||
}, | |||
updateLeaderDept(params) { | |||
return axios.post('/specialpower/updateLeaderDept', params) | |||
} | |||
} |
@@ -1,7 +1,10 @@ | |||
export default { | |||
theme: state => state.theme, | |||
user: state => state.user, | |||
quota1:state=>state.base.quota1, | |||
quota2:state=>state.base.quota2, | |||
department:state=>state.base.department | |||
department:state=>state.base.department, | |||
formatDep:state=>state.base.formatDep | |||
} |
@@ -17,9 +17,10 @@ function formatDet(data) { | |||
export default { | |||
namespaced: true, | |||
state: { | |||
department: [], | |||
formatDep: [], | |||
quota1: [], | |||
quota2: [] | |||
quota2: [], | |||
department:[], | |||
}, | |||
mutations: { | |||
SET_DEPARTMENT(state, data) { | |||
@@ -30,23 +31,25 @@ export default { | |||
}, | |||
SET_QUOTAL2(state, data) { | |||
state.quota2 = data; | |||
}, | |||
SET_FORMATDEP(state,data){ | |||
console.log(data) | |||
state.formatDep=data; | |||
} | |||
}, | |||
actions: { | |||
getDepartment({ commit, state }, data) { | |||
return new Promise((resolve, reject) => { | |||
if (state.department.length > 0) { | |||
resolve(state.department) | |||
return; | |||
} else { | |||
axios.get('dept/getDeptList/' + data).then(res => { | |||
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(()=>{ | |||
commit('SET_DEPARTMENT',[]); | |||
return [] | |||
commit('SET_FORMATDEP',[]); | |||
}) | |||
} | |||
}) |
@@ -60,41 +60,9 @@ | |||
align="center" | |||
prop="leaderUnit" | |||
></el-table-column> | |||
<el-table-column | |||
label="牵头部门" | |||
min-width="150" | |||
align="center" | |||
prop="leaderDept" | |||
class-name="select" | |||
> | |||
<template slot-scope="{ row, $index }"> | |||
<div | |||
@dblclick="showDep($index, true)" | |||
style="height:45px;width:100%;display:flex;align-item:center;justify-content:center" | |||
> | |||
<treeselect | |||
@blur="showDep($index,false)" | |||
:multiple="true" | |||
v-if="row.selectFocus" | |||
v-model="row.leaderDept" | |||
:options="department" | |||
placeholder="请选择牵头部门" | |||
:defaultExpandLevel="1" | |||
:normalizer=" | |||
(d) => { | |||
return { | |||
id: d.id, | |||
label: d.name, | |||
children: | |||
d.children && d.children.length > 0 | |||
? d.children | |||
: undefined, | |||
}; | |||
} | |||
" | |||
/> | |||
<span v-else style="line-height:45px;">{{ row.leaderDept }}</span> | |||
</div> | |||
<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 | |||
@@ -102,13 +70,27 @@ | |||
min-width="80" | |||
align="center" | |||
prop="leaderPrincipal" | |||
></el-table-column> | |||
> | |||
<template slot-scope="{ row }"> | |||
{{ row.leaderPrincipalList | formatList }} | |||
</template> | |||
</el-table-column> | |||
<el-table-column | |||
label="备注" | |||
align="center" | |||
min-width="150" | |||
prop="note" | |||
></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-pagination | |||
:current-page.sync="page.page" | |||
@@ -121,6 +103,39 @@ | |||
:flat="true" | |||
@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> | |||
</div> | |||
</template> | |||
@@ -128,7 +143,6 @@ | |||
<script> | |||
import tab from "./tab"; | |||
import search from "./search"; | |||
import taskTable from "./taskTable"; | |||
import api from "@/api/assessingTarget/basicTarget"; | |||
import { assessing } from "@/utils/mixin"; | |||
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; | |||
@@ -158,15 +172,39 @@ export default { | |||
quota1: "", | |||
quota2: "", | |||
}, | |||
updateData: [], | |||
showDep: false, | |||
}; | |||
}, | |||
created() { | |||
this.getDataList(); | |||
}, | |||
computed: { | |||
...mapGetters(["department"]), | |||
...mapGetters(["formatDep"]), | |||
}, | |||
filters: { | |||
formatList(val) { | |||
if (val) { | |||
return val.join(","); | |||
} | |||
}, | |||
}, | |||
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) { | |||
this.searchParams = data; | |||
this.resetCurrentPage(); | |||
@@ -197,11 +235,6 @@ export default { | |||
data[index].focus = bool; | |||
this.dataList = data; | |||
}, | |||
showDep(index, bool) { | |||
let data = this.dataList; | |||
data[index].selectFocus = bool; | |||
this.dataList = data; | |||
}, | |||
getDataList() { | |||
this.loading = true; | |||
api | |||
@@ -213,8 +246,6 @@ export default { | |||
item.year = item.year + ""; | |||
item.focus = false; | |||
item.selectFocus = false; | |||
item.leaderDept=(item.leaderDept&&item.leaderDept.split(',').map(item=>parseInt(item)))||[]; | |||
console.log(item.leaderDept); | |||
return item; | |||
}); | |||
this.dataList = this.reduceData(data); | |||
@@ -231,7 +262,4 @@ export default { | |||
</script> | |||
<style scoped> | |||
/deep/ .select, /deep/.select .cell { | |||
overflow: visible !important; | |||
} | |||
</style> |
@@ -60,12 +60,11 @@ | |||
align="center" | |||
prop="leaderUnit" | |||
></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 | |||
label="责任领导" | |||
min-width="80" | |||
@@ -78,6 +77,13 @@ | |||
min-width="150" | |||
prop="note" | |||
></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-pagination | |||
:current-page.sync="page.page" | |||
@@ -89,6 +95,36 @@ | |||
class="ele-pagination-circle" | |||
@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> | |||
</div> | |||
</template> | |||
@@ -97,13 +133,16 @@ | |||
import tab from "./tab"; | |||
import search from "./search"; | |||
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 { | |||
components: { | |||
tab, | |||
search, | |||
}, | |||
mixins:[assessing], | |||
mixins: [assessing], | |||
data() { | |||
return { | |||
dataList: [], | |||
@@ -120,12 +159,46 @@ export default { | |||
quota1: "", | |||
quota2: "", | |||
}, | |||
updateData:[], | |||
showDep:false, | |||
}; | |||
}, | |||
created() { | |||
this.getDataList(); | |||
}, | |||
computed: { | |||
...mapGetters(["formatDep"]), | |||
}, | |||
filters: { | |||
formatList(val) { | |||
if (val) { | |||
return val.join(","); | |||
} | |||
}, | |||
}, | |||
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) { | |||
this.searchParams = data; | |||
this.resetCurrentPage(); |
@@ -53,13 +53,13 @@ | |||
<el-form-item label="牵头部门:"> | |||
<treeselect | |||
v-model="searchParams.leaderDept" | |||
:options="department" | |||
:options="formatDep" | |||
placeholder="请选择牵头部门" | |||
:defaultExpandLevel="1" | |||
:normalizer=" | |||
(d) => { | |||
return { | |||
id: d.name, | |||
id: d.id, | |||
label: d.name, | |||
children: (d.children&&d.children.length>0)?d.children:undefined, | |||
}; | |||
@@ -70,7 +70,7 @@ | |||
<el-form-item label="配合部门:"> | |||
<treeselect | |||
v-model="searchParams.cooperateDept" | |||
:options="department" | |||
:options="formatDep" | |||
placeholder="请选择配合部门" | |||
:defaultExpandLevel="1" | |||
:normalizer=" | |||
@@ -147,7 +147,7 @@ export default { | |||
}, | |||
}, | |||
computed: { | |||
...mapGetters(["quota1", "quota2", "department"]), | |||
...mapGetters(["quota1", "quota2", "formatDep"]), | |||
}, | |||
watch: { | |||
"searchParams.quota1"(val) { |