Commit d5548d4dccabc3a15ab1149de089b96e5c71615c

Authored by gesilong
1 parent 15542ca9

commit:优化

... ... @@ -110,6 +110,7 @@ export default {
110 110 event: 'cancel',
111 111 }],
112 112 currentUserId: '',
  113 + createById: '',
113 114 }
114 115 },
115 116 computed: {
... ... @@ -120,12 +121,14 @@ export default {
120 121 const isAudit = status === 'AUDIT';
121 122 const isPass = status === 'PASS';
122 123 const isRefuse = status === 'REFUSE';
  124 + console.log('displayButtons__', row);
  125 + console.log('this.currentUserId', this.currentUserId);
123 126 return [
124 127 { ...this.buttons[0], visible: (isAudit || isPass)&& this.form?.showExamineDetail === true && this.$auth.hasPermi('agreement-manage:domestic-agreement:view') },
125 128 { ...this.buttons[1], visible: isAudit && this.form?.showExamine === true && this.$auth.hasPermi('agreement-manage:domestic-agreement:approve') },
126 129 { ...this.buttons[2], visible: this.$auth.hasPermi('agreement-manage:domestic-agreement:modify') },
127   - { ...this.buttons[3], visible: (isDraft || isRefuse) && row.createById === this.currentUserId&& this.$auth.hasPermi('agreement-manage:domestic-agreement:submit') },
128   - { ...this.buttons[4], visible:(isRefuse || !status) && this.currentUserId === row?.createById && this.$auth.hasPermi('agreement-manage:domestic-agreement:cancel') },
  130 + { ...this.buttons[3], visible: (isDraft || isRefuse) && this.createById === this.currentUserId && this.$auth.hasPermi('agreement-manage:domestic-agreement:submit') },
  131 + { ...this.buttons[4], visible:(isRefuse || !status) && this.currentUserId === this.createById && this.$auth.hasPermi('agreement-manage:domestic-agreement:cancel') },
129 132 ]
130 133 },
131 134 approvalStatusVisible() {
... ... @@ -134,6 +137,7 @@ export default {
134 137 },
135 138 onLoad(query) {
136 139 this.id = (query && query.id) || ''
  140 + this.createById = (query && query.createById) || ''
137 141 this.loadDicData()
138 142 this.loadDetail()
139 143 this.getUserInfo()
... ... @@ -241,7 +245,8 @@ export default {
241 245 async getUserInfo() {
242 246 try {
243 247 var res = await getInfo()
244   - this.currentUserId = (res && res.id) ? res.id : ''
  248 + console.log('getUserInfo__', res);
  249 + this.currentUserId = res.data.id || ''
245 250 } catch (e) {
246 251 this.currentUserId = ''
247 252 }
... ...
... ... @@ -319,7 +319,7 @@ export default {
319 319 uni.showToast({ title: '缺少ID', icon: 'none' })
320 320 return
321 321 }
322   - uni.navigateTo({ url: '/pages/domestic-agreement/detail?id=' + id })
  322 + uni.navigateTo({ url: '/pages/domestic-agreement/detail?id=' + id + '&createById=' + item.createById })
323 323 }
324 324 }
325 325 }
... ...