数据申请按钮不跟角色绑定
Showing
3 changed files
with
27 additions
and
47 deletions
| ... | @@ -40,7 +40,7 @@ | ... | @@ -40,7 +40,7 @@ |
| 40 | </div> | 40 | </div> |
| 41 | <ContentWrap id="id-baseInfo" title="数据申请信息" description="" :expand-swicth="false"> | 41 | <ContentWrap id="id-baseInfo" title="数据申请信息" description="" :expand-swicth="false"> |
| 42 | <div class="list_panel"> | 42 | <div class="list_panel"> |
| 43 | <div v-if="!isDataUse" class="list_item is_block" style="font-weight: 600;"> | 43 | <div class="list_item is_block" style="font-weight: 600;"> |
| 44 | <span class="item_label">数据申请方:</span> | 44 | <span class="item_label">数据申请方:</span> |
| 45 | <span class="item_value">{{ detailInfo.tenantName || '--' }}</span> | 45 | <span class="item_value">{{ detailInfo.tenantName || '--' }}</span> |
| 46 | </div> | 46 | </div> |
| ... | @@ -93,7 +93,8 @@ | ... | @@ -93,7 +93,8 @@ |
| 93 | </div> | 93 | </div> |
| 94 | <div class="tool_btns"> | 94 | <div class="tool_btns"> |
| 95 | <div class="btns"> | 95 | <div class="btns"> |
| 96 | <el-button v-for="btn in toolBtns" :type="btn.type" :plain="btn.plain" @click="btn.click ? btn.click() : btnClick(btn)">{{ btn.label | 96 | <el-button v-for="btn in toolBtns" :type="btn.type" :plain="btn.plain" |
| 97 | @click="btn.click ? btn.click() : btnClick(btn)">{{ btn.label | ||
| 97 | }}</el-button> | 98 | }}</el-button> |
| 98 | </div> | 99 | </div> |
| 99 | </div> | 100 | </div> |
| ... | @@ -132,20 +133,27 @@ const viewProductDetail = () => { | ... | @@ -132,20 +133,27 @@ const viewProductDetail = () => { |
| 132 | }); | 133 | }); |
| 133 | } | 134 | } |
| 134 | 135 | ||
| 135 | /** 是否是数据提供方 */ | ||
| 136 | const isDataUse = computed(() => { | ||
| 137 | return localStorage.getItem('userRole') == USERROLE.USE; | ||
| 138 | }) | ||
| 139 | |||
| 140 | const toolBtns: any = computed(() => { | 136 | const toolBtns: any = computed(() => { |
| 141 | if (isDataUse.value) { | ||
| 142 | let btnsArr: any = [{ | 137 | let btnsArr: any = [{ |
| 143 | label: "关闭", value: "cancel", plain: true | 138 | label: "关闭", value: "cancel", plain: true |
| 144 | }]; | 139 | }]; |
| 145 | const approveVO = detailInfo.value.applicationApproveRSVO || {} | ||
| 146 | let approveState = approveVO.approveState || null; | ||
| 147 | const staffGuid = detailInfo.value.createUserId || ''; | 140 | const staffGuid = detailInfo.value.createUserId || ''; |
| 148 | const currentStaffGuid = userData.userGuid; | 141 | const currentStaffGuid = userData.userGuid; |
| 142 | // 获取审批人。 | ||
| 143 | const approveVO = detailInfo.value.applicationApproveRSVO || {} | ||
| 144 | let approveState = approveVO.approveState || null; | ||
| 145 | let approveStaffGuid = approveVO?.approveInstanceRSVOS?.[1]?.operator || ''; | ||
| 146 | if (approveState == 'A' && approveStaffGuid == userData.tenantGuid) { | ||
| 147 | btnsArr.push(...[{ | ||
| 148 | label: "通过", value: "pass", type: 'primary', click: () => { | ||
| 149 | passDialogInfo.value.visible = true; | ||
| 150 | } | ||
| 151 | }, { | ||
| 152 | label: "驳回", value: "reject", type: 'danger', plain: true, click: () => { | ||
| 153 | rejectDialogInfo.value.visible = true; | ||
| 154 | } | ||
| 155 | }]) | ||
| 156 | } | ||
| 149 | if (approveState == 'A' && staffGuid == currentStaffGuid) { | 157 | if (approveState == 'A' && staffGuid == currentStaffGuid) { |
| 150 | btnsArr.push({ | 158 | btnsArr.push({ |
| 151 | label: "撤销", value: "revoke", click: () => { | 159 | label: "撤销", value: "revoke", click: () => { |
| ... | @@ -170,27 +178,6 @@ const toolBtns: any = computed(() => { | ... | @@ -170,27 +178,6 @@ const toolBtns: any = computed(() => { |
| 170 | }) | 178 | }) |
| 171 | } | 179 | } |
| 172 | return btnsArr; | 180 | return btnsArr; |
| 173 | } else { | ||
| 174 | let btnsArr: any = [{ | ||
| 175 | label: "关闭", value: "cancel", plain: true | ||
| 176 | }]; | ||
| 177 | // 获取审批人。 | ||
| 178 | const approveVO = detailInfo.value.applicationApproveRSVO || {} | ||
| 179 | let approveState = approveVO.approveState || null; | ||
| 180 | let approveStaffGuid = approveVO?.approveInstanceRSVOS?.[1]?.operator || ''; | ||
| 181 | if (approveState == 'A' && approveStaffGuid == userData.tenantGuid) { | ||
| 182 | btnsArr.push(...[{ | ||
| 183 | label: "通过", value: "pass", type: 'primary', click: () => { | ||
| 184 | passDialogInfo.value.visible = true; | ||
| 185 | } | ||
| 186 | }, { | ||
| 187 | label: "驳回", value: "reject", type: 'danger', plain: true, click: () => { | ||
| 188 | rejectDialogInfo.value.visible = true; | ||
| 189 | } | ||
| 190 | }]) | ||
| 191 | } | ||
| 192 | return btnsArr; | ||
| 193 | } | ||
| 194 | }); | 181 | }); |
| 195 | 182 | ||
| 196 | const btnClick = (btn: any) => { | 183 | const btnClick = (btn: any) => { | ... | ... |
| ... | @@ -143,7 +143,6 @@ const tableInfo = ref({ | ... | @@ -143,7 +143,6 @@ const tableInfo = ref({ |
| 143 | if (approveState == 'N') { | 143 | if (approveState == 'N') { |
| 144 | flowState = 1; | 144 | flowState = 1; |
| 145 | } | 145 | } |
| 146 | if (isDataUse.value) { | ||
| 147 | let isShowCancel = false; | 146 | let isShowCancel = false; |
| 148 | let list: any = []; | 147 | let list: any = []; |
| 149 | const staffGuid = row.createUserId || ''; | 148 | const staffGuid = row.createUserId || ''; |
| ... | @@ -160,17 +159,6 @@ const tableInfo = ref({ | ... | @@ -160,17 +159,6 @@ const tableInfo = ref({ |
| 160 | if (flowState !== 1) { | 159 | if (flowState !== 1) { |
| 161 | list.push({ label: "详情", value: "detail", click: btnHandlers.detail }) | 160 | list.push({ label: "详情", value: "detail", click: btnHandlers.detail }) |
| 162 | } | 161 | } |
| 163 | if (flowState === 3 && bizApproveState !== 'D') { //重新提交过的不能再重新提交 && bizApproveState != 'D' | ||
| 164 | list.push({ label: "重新提交", value: "redit", click: btnHandlers.redit }) //已驳回 | ||
| 165 | } | ||
| 166 | isShowCancel && list.push({ label: "撤销", value: "revoke", click: btnHandlers.revoke }) | ||
| 167 | if (flowState === 3) { | ||
| 168 | list.push({ label: "删除", value: "del", click: btnHandlers.del }) | ||
| 169 | } | ||
| 170 | return list | ||
| 171 | } else { //数据提供方需要进行审批驳回和通过。 | ||
| 172 | let list: any = []; | ||
| 173 | list.push({ label: "详情", value: "detail", click: btnHandlers.detail }); | ||
| 174 | // 获取审批人。 | 162 | // 获取审批人。 |
| 175 | let approveStaffGuid = approveVO?.approveInstanceRSVOS?.[1]?.operator || ''; | 163 | let approveStaffGuid = approveVO?.approveInstanceRSVOS?.[1]?.operator || ''; |
| 176 | if (approveState == 'A' && approveStaffGuid == userData.tenantGuid) { | 164 | if (approveState == 'A' && approveStaffGuid == userData.tenantGuid) { |
| ... | @@ -179,8 +167,14 @@ const tableInfo = ref({ | ... | @@ -179,8 +167,14 @@ const tableInfo = ref({ |
| 179 | if (flowState === 2) { | 167 | if (flowState === 2) { |
| 180 | list.push(...[{ label: "通过", value: "pass", click: btnHandlers.pass }, { label: "驳回", value: "reject", click: btnHandlers.reject }]) | 168 | list.push(...[{ label: "通过", value: "pass", click: btnHandlers.pass }, { label: "驳回", value: "reject", click: btnHandlers.reject }]) |
| 181 | } | 169 | } |
| 182 | return list; | 170 | if (flowState === 3 && bizApproveState !== 'D') { //重新提交过的不能再重新提交 && bizApproveState != 'D' |
| 171 | list.push({ label: "重新提交", value: "redit", click: btnHandlers.redit }) //已驳回 | ||
| 172 | } | ||
| 173 | isShowCancel && list.push({ label: "撤销", value: "revoke", click: btnHandlers.revoke }) | ||
| 174 | if (flowState === 3) { | ||
| 175 | list.push({ label: "删除", value: "del", click: btnHandlers.del }) | ||
| 183 | } | 176 | } |
| 177 | return list | ||
| 184 | }, | 178 | }, |
| 185 | } | 179 | } |
| 186 | }); | 180 | }); |
| ... | @@ -276,8 +270,7 @@ const getTableData = () => { | ... | @@ -276,8 +270,7 @@ const getTableData = () => { |
| 276 | pageSize: page.value.limit, | 270 | pageSize: page.value.limit, |
| 277 | damName: page.value.damName, | 271 | damName: page.value.damName, |
| 278 | damType: page.value.damType, | 272 | damType: page.value.damType, |
| 279 | approveState: page.value.approveState, | 273 | approveState: page.value.approveState |
| 280 | characterType: isDataUse.value ? '1' : '2' | ||
| 281 | }).then((res: any) => { | 274 | }).then((res: any) => { |
| 282 | tableInfo.value.loading = false; | 275 | tableInfo.value.loading = false; |
| 283 | if (res?.code == proxy.$passCode) { | 276 | if (res?.code == proxy.$passCode) { | ... | ... |
| ... | @@ -350,7 +350,7 @@ const tableInfo = ref({ | ... | @@ -350,7 +350,7 @@ const tableInfo = ref({ |
| 350 | actionInfo: { | 350 | actionInfo: { |
| 351 | label: "操作", | 351 | label: "操作", |
| 352 | type: "btn", | 352 | type: "btn", |
| 353 | show: isDataUse.value, // 仅对数据使用方显示 | 353 | // show: isDataUse.value, // 都可以显示 |
| 354 | width: 120, | 354 | width: 120, |
| 355 | // 操作按钮定义 | 355 | // 操作按钮定义 |
| 356 | btns: (scope) => { | 356 | btns: (scope) => { | ... | ... |
-
Please register or sign in to post a comment