Commit cd0d970bbc5dec434d07b14ddccb10fc68195883

Authored by 史婷婷
1 parent aad414e9

feat: 审核-通过&驳回-接口逻辑

@@ -42,4 +42,22 @@ export function getInstanceByBusinessIdApi(params) { @@ -42,4 +42,22 @@ export function getInstanceByBusinessIdApi(params) {
42 method: 'get', 42 method: 'get',
43 params 43 params
44 }) 44 })
45 -}  
  45 +}
  46 +
  47 +// 审核通过
  48 +export function approvePassApi(data) {
  49 + return request({
  50 + url: '/flow/task/approve/pass',
  51 + method: 'post',
  52 + data: data
  53 + })
  54 +}
  55 +
  56 +// 审核驳回(也就是pc端的 审核拒绝)
  57 +export function approveRefuseApi(data) {
  58 + return request({
  59 + url: '/flow/task/approve/refuse',
  60 + method: 'post',
  61 + data: data
  62 + })
  63 +}
@@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
25 <view class="action-modal_header">{{ approveType === 'PASS' ? '通过' : '驳回' }}</view> 25 <view class="action-modal_header">{{ approveType === 'PASS' ? '通过' : '驳回' }}</view>
26 <view class="action-modal_body"> 26 <view class="action-modal_body">
27 <text class="tip">{{ approveType === 'PASS' ? '您将通过该信息的审核' : '您将驳回该信息的审核' }}</text> 27 <text class="tip">{{ approveType === 'PASS' ? '您将通过该信息的审核' : '您将驳回该信息的审核' }}</text>
28 - <uni-easyinput v-model="approveComment" 28 + <uni-easyinput v-model="message"
29 :placeholder="approveType === 'PASS' ? '请输入通过原因' : '请输入驳回原因'" /> 29 :placeholder="approveType === 'PASS' ? '请输入通过原因' : '请输入驳回原因'" />
30 </view> 30 </view>
31 <view class="action-modal_footer"> 31 <view class="action-modal_footer">
@@ -40,7 +40,7 @@ @@ -40,7 +40,7 @@
40 <script> 40 <script>
41 import FlowTimeline from '@/components/flow-timeline/index.vue' 41 import FlowTimeline from '@/components/flow-timeline/index.vue'
42 import { getSysFlowComponentPath } from '@/utils/flow-components.js' 42 import { getSysFlowComponentPath } from '@/utils/flow-components.js'
43 -import { getFlowLinkByInstanceIdApi } from '@/api/flow.js' 43 +import { getFlowLinkByInstanceIdApi, getInstanceByBusinessIdApi, approvePassApi, approveRefuseApi } from '@/api/flow.js'
44 export default { 44 export default {
45 components: { 45 components: {
46 FlowTimeline 46 FlowTimeline
@@ -58,11 +58,12 @@ export default { @@ -58,11 +58,12 @@ export default {
58 nodeList: [], 58 nodeList: [],
59 extraBtnText: '客户信息', 59 extraBtnText: '客户信息',
60 approveType: 'PASS', 60 approveType: 'PASS',
61 - approveComment: '' 61 + message: ''
62 } 62 }
63 }, 63 },
64 computed: { 64 computed: {
65 componentName() { 65 componentName() {
  66 + // sourceBusinessType 业务类型 todo 待处理--主要是合同那边使用
66 const name = getSysFlowComponentPath(this.auditCtx.bizFlag || '') 67 const name = getSysFlowComponentPath(this.auditCtx.bizFlag || '')
67 return name || '' 68 return name || ''
68 } 69 }
@@ -129,14 +130,17 @@ export default { @@ -129,14 +130,17 @@ export default {
129 ...vals 130 ...vals
130 } 131 }
131 }, 132 },
  133 + // 驳回
132 onReject() { 134 onReject() {
133 this.approveType = 'REFUSE' 135 this.approveType = 'REFUSE'
134 - this.approveComment = '' 136 + this.message = ''
135 this.$refs.approvePopup.open() 137 this.$refs.approvePopup.open()
136 }, 138 },
  139 + // 通过
  140 + // 在这里增加业务判断 比如 资信管理,判断有没有填写客户信息、公司评审(这些是不同角色进行操作的)
137 onPass() { 141 onPass() {
138 this.approveType = 'PASS' 142 this.approveType = 'PASS'
139 - this.approveComment = '' 143 + this.message = ''
140 this.$refs.approvePopup.open() 144 this.$refs.approvePopup.open()
141 }, 145 },
142 onExtra() { 146 onExtra() {
@@ -151,10 +155,39 @@ export default { @@ -151,10 +155,39 @@ export default {
151 }, 155 },
152 confirmApprove() { 156 confirmApprove() {
153 const payload = { 157 const payload = {
154 - ...this.getPayload(),  
155 - approveType: this.approveType,  
156 - approveComment: this.approveComment 158 + variables:this.getPayload(),
  159 + message: this.message,
  160 + taskId: this.auditCtx.taskId
157 } 161 }
  162 + console.log('审核__confirmApprove', payload)
  163 + if (this.approveType === 'PASS') {
  164 + approvePassApi(payload).then(res => {
  165 + console.log('审核__approvePass', res)
  166 + if (res.code === 200) {
  167 + uni.showToast({
  168 + title: '已通过',
  169 + icon: 'none'
  170 + })
  171 + setTimeout(() => {
  172 + uni.redirectTo({ url: '/pages/flow/approval' })
  173 + }, 300)
  174 + }
  175 + }).catch(() => { })
  176 + } else {
  177 + approveRefuseApi(payload).then(res => {
  178 + console.log('审核__approveRefuse', res)
  179 + if (res.code === 200) {
  180 + uni.showToast({
  181 + title: '已驳回',
  182 + icon: 'none'
  183 + })
  184 + setTimeout(() => {
  185 + uni.redirectTo({ url: '/pages/flow/approval' })
  186 + }, 300)
  187 + }
  188 + }).catch(() => { })
  189 + }
  190 + console.log('审核__confirmApprove', payload)
158 this.$refs.approvePopup.close() 191 this.$refs.approvePopup.close()
159 uni.showToast({ 192 uni.showToast({
160 title: this.approveType === 'PASS' ? '已通过' : '已驳回', 193 title: this.approveType === 'PASS' ? '已通过' : '已驳回',
@@ -39,6 +39,7 @@ export default { @@ -39,6 +39,7 @@ export default {
39 }, 39 },
40 computed: { 40 computed: {
41 componentName() { 41 componentName() {
  42 + // sourceBusinessType 业务类型 todo 待处理--主要是合同那边使用
42 const name = getSysFlowComponentPath(this.auditCtx.bizFlag || '') 43 const name = getSysFlowComponentPath(this.auditCtx.bizFlag || '')
43 return name || '' 44 return name || ''
44 } 45 }