@@ -1,6 +1,6 @@ | |||
<template> | |||
<div class="basic-target" v-loading="loading"> | |||
<search :type="1" @search:task="updateParams($event)"/> | |||
<search :type="1" @search:task="updateParams($event)" /> | |||
<el-table | |||
:data="dataList" | |||
border | |||
@@ -53,7 +53,9 @@ | |||
<el-table-column label="牵头部门" width="100" align="center"> | |||
<template slot-scope="{ row }"> | |||
<span><pre>{{ row.leaderDeptList | formatList }}</pre></span> | |||
<span> | |||
<pre>{{ row.leaderDeptList | formatList }}</pre> | |||
</span> | |||
</template> | |||
</el-table-column> | |||
@@ -64,7 +66,9 @@ | |||
</el-table-column> | |||
<el-table-column label="配合部门" width="100" align="center"> | |||
<template slot-scope="{ row }"> | |||
<span><pre>{{ row.cooperateDeptList | formatList }}</pre></span> | |||
<span> | |||
<pre>{{ row.cooperateDeptList | formatList }}</pre> | |||
</span> | |||
</template> | |||
</el-table-column> | |||
@@ -75,14 +79,14 @@ | |||
</el-table-column> | |||
<el-table-column label="操作" width="80" align="center"> | |||
<template slot-scope="{ row }"> | |||
<el-link | |||
@click="edit(row)" | |||
icon="el-icon-edit" | |||
type="primary" | |||
:underline="false" | |||
:disabled="judge(row)" | |||
>申请</el-link | |||
> | |||
<el-link | |||
@click="edit(row)" | |||
icon="el-icon-edit" | |||
type="primary" | |||
:underline="false" | |||
:disabled="judge(row)" | |||
>申请</el-link | |||
> | |||
</template> | |||
</el-table-column> | |||
</el-table> | |||
@@ -137,7 +141,7 @@ import { mapGetters } from "vuex"; | |||
import api from "@/api/second/taskSummary"; | |||
import { mergeSpan } from "@/utils/mixin"; | |||
import applyApi from "@/api/second/coordinationManage/applyCooperation"; | |||
import successVue from '../../../result/success.vue'; | |||
import successVue from "../../../result/success.vue"; | |||
export default { | |||
components: { | |||
search, | |||
@@ -163,20 +167,23 @@ export default { | |||
count: 0, | |||
showEdit: false, | |||
loading: false, | |||
form:{note: ''} | |||
form: { note: "" }, | |||
}; | |||
}, | |||
computed: { | |||
...mapGetters(["formatDep",'user']), | |||
...mapGetters(["formatDep", "user"]), | |||
}, | |||
created() { | |||
this.getDataList(); | |||
}, | |||
methods: { | |||
judge(row){ | |||
let arr=[].concat(row.cooperateDept.split(',').map(item=>parseInt(item)),row.leaderDept.split(',').map(item=>parseInt(item))) | |||
let bool=arr.includes(this.user.user.deptId) | |||
return bool | |||
judge(row) { | |||
let arr = [].concat( | |||
row.cooperateDept.split(",").map((item) => parseInt(item)), | |||
row.leaderDept.split(",").map((item) => parseInt(item)) | |||
); | |||
let bool = arr.includes(this.user.user.deptId); | |||
return bool; | |||
}, | |||
updateParams(data) { | |||
this.searchParams = data; | |||
@@ -190,17 +197,17 @@ export default { | |||
this.page = page; | |||
}, | |||
getDataList() { | |||
api | |||
api | |||
.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); | |||
console.log(this.dataList); | |||
}) | |||
.catch((e) => { | |||
this.dataList = []; | |||
this.count=0 | |||
this.count = 0; | |||
}) | |||
.finally(() => { | |||
this.loading = false; | |||
@@ -208,29 +215,29 @@ export default { | |||
}, | |||
edit(row) { | |||
this.showEdit = true; | |||
this.form.type = 1 | |||
this.form.itemId = row.id | |||
this.form.leaderDept = row.leaderDept | |||
this.form.type = 1; | |||
this.form.itemId = row.id; | |||
this.form.leaderDept = row.leaderDept; | |||
}, | |||
save() { | |||
console.log(this.form); | |||
applyApi. | |||
applyCooperate(Object.assign({}, this.form)) | |||
.then((res)=> { | |||
this.showEdit = false; | |||
this.$message({ | |||
type:'success', | |||
message: '提交申请成功' | |||
}) | |||
this.getDataList() | |||
}) | |||
.catch((e)=>{ | |||
this.showEdit = false; | |||
this.$message({ | |||
type:'error', | |||
message: '提交申请失败' | |||
console.log(this.form); | |||
applyApi | |||
.applyCooperate(Object.assign({}, this.form)) | |||
.then((res) => { | |||
this.showEdit = false; | |||
this.$message({ | |||
type: "success", | |||
message: "提交申请成功", | |||
}); | |||
this.getDataList(); | |||
}) | |||
}) | |||
.catch((e) => { | |||
this.showEdit = false; | |||
this.$message({ | |||
type: "error", | |||
message: "提交申请失败", | |||
}); | |||
}); | |||
}, | |||
}, | |||
filters: { |
@@ -1,6 +1,6 @@ | |||
<template> | |||
<div class="constraint" v-loading="loading"> | |||
<search :type="3" @search:task="updateParams($event)"/> | |||
<search :type="3" @search:task="updateParams($event)" /> | |||
<el-table | |||
:data="dataList" | |||
border | |||
@@ -47,7 +47,9 @@ | |||
<el-table-column label="牵头部门" width="100" align="center"> | |||
<template slot-scope="{ row }"> | |||
<span><pre>{{ row.leaderDeptList | formatList }}</pre></span> | |||
<span> | |||
<pre>{{ row.leaderDeptList | formatList }}</pre> | |||
</span> | |||
</template> | |||
</el-table-column> | |||
@@ -58,7 +60,9 @@ | |||
</el-table-column> | |||
<el-table-column label="配合部门" width="100" align="center"> | |||
<template slot-scope="{ row }"> | |||
<span><pre>{{ row.cooperateDeptList | formatList }}</pre></span> | |||
<span> | |||
<pre>{{ row.cooperateDeptList | formatList }}</pre> | |||
</span> | |||
</template> | |||
</el-table-column> | |||
@@ -68,13 +72,16 @@ | |||
</template> | |||
</el-table-column> | |||
<el-table-column label="操作" width="80" align="center"> | |||
<el-link | |||
@click="edit" | |||
icon="el-icon-edit" | |||
type="primary" | |||
:underline="false" | |||
>申请</el-link | |||
> | |||
<template slot-scope="{ row }"> | |||
<el-link | |||
@click="edit" | |||
icon="el-icon-edit" | |||
type="primary" | |||
:underline="false" | |||
:disabled="judge(row)" | |||
>申请</el-link | |||
> | |||
</template> | |||
</el-table-column> | |||
</el-table> | |||
<el-pagination | |||
@@ -107,7 +114,7 @@ | |||
> | |||
<el-form-item label="申请理由:"> | |||
<el-input | |||
v-model="form.note" | |||
v-model="form.note" | |||
type="textarea" | |||
placeholder="请输入申请理由" | |||
:rows="5" | |||
@@ -151,16 +158,24 @@ export default { | |||
count: 0, | |||
showEdit: false, | |||
loading: false, | |||
form:{} | |||
form: {}, | |||
}; | |||
}, | |||
created() { | |||
this.getDataList(); | |||
}, | |||
computed: { | |||
...mapGetters(["formatDep"]), | |||
...mapGetters(["formatDep","user"]), | |||
}, | |||
methods: { | |||
judge(row) { | |||
let arr = [].concat( | |||
row.cooperateDept.split(",").map((item) => parseInt(item)), | |||
row.leaderDept.split(",").map((item) => parseInt(item)) | |||
); | |||
let bool = arr.includes(this.user.user.deptId); | |||
return bool; | |||
}, | |||
updateParams(data) { | |||
this.searchParams = data; | |||
this.resetCurrentPage(); | |||
@@ -187,31 +202,31 @@ export default { | |||
this.loading = false; | |||
}); | |||
}, | |||
edit(row) { | |||
edit(row) { | |||
this.showEdit = true; | |||
this.form.type = 3 | |||
this.form.itemId = row.id | |||
this.form.leaderDept = row.leaderDept | |||
this.form.type = 3; | |||
this.form.itemId = row.id; | |||
this.form.leaderDept = row.leaderDept; | |||
}, | |||
save() { | |||
console.log(this.form); | |||
applyApi. | |||
applyCooperate(Object.assign({}, this.form)) | |||
.then((res)=> { | |||
this.showEdit = false; | |||
this.$message({ | |||
type:'success', | |||
message: '提交申请成功' | |||
}) | |||
this.getDataList() | |||
}) | |||
.catch((e)=>{ | |||
this.showEdit = false; | |||
this.$message({ | |||
type:'error', | |||
message: '提交申请失败' | |||
console.log(this.form); | |||
applyApi | |||
.applyCooperate(Object.assign({}, this.form)) | |||
.then((res) => { | |||
this.showEdit = false; | |||
this.$message({ | |||
type: "success", | |||
message: "提交申请成功", | |||
}); | |||
this.getDataList(); | |||
}) | |||
}) | |||
.catch((e) => { | |||
this.showEdit = false; | |||
this.$message({ | |||
type: "error", | |||
message: "提交申请失败", | |||
}); | |||
}); | |||
}, | |||
}, | |||
filters: { |
@@ -53,7 +53,9 @@ | |||
<el-table-column label="牵头部门" width="100" align="center"> | |||
<template slot-scope="{ row }"> | |||
<span><pre>{{ row.leaderDeptList | formatList }}</pre></span> | |||
<span> | |||
<pre>{{ row.leaderDeptList | formatList }}</pre> | |||
</span> | |||
</template> | |||
</el-table-column> | |||
@@ -64,7 +66,9 @@ | |||
</el-table-column> | |||
<el-table-column label="配合部门" width="100" align="center"> | |||
<template slot-scope="{ row }"> | |||
<span><pre>{{ row.cooperateDeptList | formatList }}</pre></span> | |||
<span> | |||
<pre>{{ row.cooperateDeptList | formatList }}</pre> | |||
</span> | |||
</template> | |||
</el-table-column> | |||
@@ -74,13 +78,16 @@ | |||
</template> | |||
</el-table-column> | |||
<el-table-column label="操作" width="80" align="center"> | |||
<el-link | |||
@click="edit" | |||
icon="el-icon-edit" | |||
type="primary" | |||
:underline="false" | |||
>申请</el-link | |||
> | |||
<template slot-scope="{ row }"> | |||
<el-link | |||
@click="edit" | |||
icon="el-icon-edit" | |||
type="primary" | |||
:underline="false" | |||
:disabled="judge(row)" | |||
>申请</el-link | |||
> | |||
</template> | |||
</el-table-column> | |||
</el-table> | |||
<el-pagination | |||
@@ -113,7 +120,7 @@ | |||
> | |||
<el-form-item label="申请理由:"> | |||
<el-input | |||
v-model="form.note" | |||
v-model="form.note" | |||
type="textarea" | |||
placeholder="请输入申请理由" | |||
:rows="5" | |||
@@ -159,16 +166,24 @@ export default { | |||
count: 0, | |||
showEdit: false, | |||
loading: false, | |||
form:{} | |||
form: {}, | |||
}; | |||
}, | |||
created() { | |||
this.getDataList(); | |||
}, | |||
computed: { | |||
...mapGetters(["formatDep"]), | |||
...mapGetters(["formatDep","user"]), | |||
}, | |||
methods: { | |||
judge(row) { | |||
let arr = [].concat( | |||
row.cooperateDept.split(",").map((item) => parseInt(item)), | |||
row.leaderDept.split(",").map((item) => parseInt(item)) | |||
); | |||
let bool = arr.includes(this.user.user.deptId); | |||
return bool; | |||
}, | |||
updateParams(data) { | |||
this.searchParams = data; | |||
this.resetCurrentPage(); | |||
@@ -184,12 +199,12 @@ export default { | |||
.getRewardList(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; | |||
@@ -197,29 +212,29 @@ export default { | |||
}, | |||
edit(row) { | |||
this.showEdit = true; | |||
this.form.type = 2 | |||
this.form.itemId = row.id | |||
this.form.leaderDept = row.leaderDept | |||
this.form.type = 2; | |||
this.form.itemId = row.id; | |||
this.form.leaderDept = row.leaderDept; | |||
}, | |||
save() { | |||
console.log(this.form); | |||
applyApi. | |||
applyCooperate(Object.assign({}, this.form)) | |||
.then((res)=> { | |||
this.showEdit = false; | |||
this.$message({ | |||
type:'success', | |||
message: '提交申请成功' | |||
}) | |||
this.getDataList() | |||
}) | |||
.catch((e)=>{ | |||
this.showEdit = false; | |||
this.$message({ | |||
type:'error', | |||
message: '提交申请失败' | |||
console.log(this.form); | |||
applyApi | |||
.applyCooperate(Object.assign({}, this.form)) | |||
.then((res) => { | |||
this.showEdit = false; | |||
this.$message({ | |||
type: "success", | |||
message: "提交申请成功", | |||
}); | |||
this.getDataList(); | |||
}) | |||
}) | |||
.catch((e) => { | |||
this.showEdit = false; | |||
this.$message({ | |||
type: "error", | |||
message: "提交申请失败", | |||
}); | |||
}); | |||
}, | |||
}, | |||
filters: { |