|
@@ -16,8 +16,8 @@
|
|
|
@pageChange="pageChange"
|
|
|
@onEditSuccess="queryMainData($route.query.id)">
|
|
|
<div slot="customOperation">
|
|
|
- <complete-task :data="mainData" v-if="tool.checkAuth($route.name,'complete')" style="display:inline" @onSuccess="queryMainData()"></complete-task>
|
|
|
- <el-button class="inline-16" v-if="tool.checkAuth($route.name,'delete') && !disable" type="primary" size="mini" @click="deleteTask">删 除</el-button>
|
|
|
+ <complete-task :data="mainData" v-if="tool.checkAuth($route.name,'complete') && mainData.disabled" style="display:inline" @onSuccess="queryMainData()"></complete-task>
|
|
|
+ <el-button class="inline-16" v-if="tool.checkAuth($route.name,'delete') && nowUserid === mainData.createuserid" type="primary" size="mini" @click="deleteTask">删 除</el-button>
|
|
|
</div>
|
|
|
<div slot="slot0" >
|
|
|
<!-- <p class="mt-10">标题:{{mainData.title}}</p>
|
|
@@ -43,7 +43,10 @@
|
|
|
<el-descriptions-item label-class-name="my-label" label="结束日期">{{mainData.endtime?mainData.endtime:'无限'}}</el-descriptions-item>
|
|
|
<el-descriptions-item label-class-name="my-label" label="提醒时间">{{mainData.remindday? mainData.remindday + '天' :'无需提醒'}}</el-descriptions-item>
|
|
|
<el-descriptions-item label-class-name="my-label" label="关联应用数据">
|
|
|
- <el-button type="text" v-if="mainData.systemapp.length !== 0" @click="onGoto">{{mainData.systemapp[0].systemappname}}</el-button>
|
|
|
+ <span v-if="mainData.systemapp">
|
|
|
+ <el-button type="text" v-if="mainData.systemapp.length >0" @click="onGoto">{{mainData.systemapp[0].systemappname}}</el-button>
|
|
|
+ <span v-else>--</span>
|
|
|
+ </span>
|
|
|
<span v-else>--</span>
|
|
|
</el-descriptions-item>
|
|
|
<el-descriptions-item label-class-name="my-label" label="负责人">{{mainData.leader?mainData.leader.length !== 0 ?mainData.leader[0].name:'--':"--" }}</el-descriptions-item>
|
|
@@ -82,10 +85,13 @@ export default {
|
|
|
name: "detail",
|
|
|
data() {
|
|
|
return {
|
|
|
- mainData:{},
|
|
|
+ mainData:{
|
|
|
+ disabled:false
|
|
|
+ },
|
|
|
mainAreaData:{},
|
|
|
disable:false,
|
|
|
- team:[]
|
|
|
+ team:[],
|
|
|
+ nowUserid: JSON.parse(sessionStorage.getItem('active_account')).userid,
|
|
|
}
|
|
|
},
|
|
|
computed:{
|
|
@@ -104,14 +110,52 @@ export default {
|
|
|
"sys_taskid": this.$route.query.id
|
|
|
}
|
|
|
})
|
|
|
- this.mainData = res.data
|
|
|
+ this.mainData = Object.assign({},this.mainData,res.data)
|
|
|
this.changeDataStructure()
|
|
|
- this.$refs['details'].$refs['group'].queryGroup()
|
|
|
+ this.queryAuthority()
|
|
|
+ /* this.$refs['details'].$refs['group'].queryGroup()*/
|
|
|
console.log(this.mainData.createuserid)
|
|
|
console.log(JSON.parse(sessionStorage.getItem('active_account')).userid)
|
|
|
this.mainData.createuserid === JSON.parse(sessionStorage.getItem('active_account')).userid ?this.disable = false : this.disable = true
|
|
|
|
|
|
},
|
|
|
+ async queryAuthority(){
|
|
|
+ console.log(this.team,'team列表')
|
|
|
+ const agent = await this.$api.requested({
|
|
|
+ "id":20230329122604,
|
|
|
+ "content": {
|
|
|
+ "ownertable":"sys_task",
|
|
|
+ "ownerid":this.$route.query.id
|
|
|
+ }
|
|
|
+ })
|
|
|
+ console.log(agent,'agent')
|
|
|
+ if (this.mainData.leader.length > 0){
|
|
|
+ if (JSON.parse(window.sessionStorage.getItem('active_account')).userid === this.mainData.leader[0].userid){
|
|
|
+ /*是负责人*/
|
|
|
+ this.mainData.disabled = true
|
|
|
+ }else {
|
|
|
+ let flag = 0
|
|
|
+ for (var i=0;i<this.team.length;i++){
|
|
|
+ if (this.team[i].userid === JSON.parse(window.sessionStorage.getItem('active_account')).userid){
|
|
|
+ if (this.team[i].editable === 1){
|
|
|
+ this.mainData.disabled = true
|
|
|
+ flag =1
|
|
|
+ break
|
|
|
+ }else {
|
|
|
+ flag = 0
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /*不是负责人*/
|
|
|
+ flag === 0?agent.data.editable === 0?this.mainData.disabled = false:this.mainData.disabled = true:this.mainData.disabled = true
|
|
|
+ this.$refs.details.$refs.group.editdataleader = agent.data.editdataleader
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ this.mainData.disabled = false
|
|
|
+ }
|
|
|
+ console.log("权限结果", this.mainData.disabled)
|
|
|
+ },
|
|
|
changeDataStructure() {
|
|
|
let that = this
|
|
|
this.mainAreaData = [
|