Commit cd0d970bbc5dec434d07b14ddccb10fc68195883

Authored by 史婷婷
1 parent aad414e9

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

... ... @@ -42,4 +42,22 @@ export function getInstanceByBusinessIdApi(params) {
42 42 method: 'get',
43 43 params
44 44 })
45   -}
\ No newline at end of file
  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 25 <view class="action-modal_header">{{ approveType === 'PASS' ? '通过' : '驳回' }}</view>
26 26 <view class="action-modal_body">
27 27 <text class="tip">{{ approveType === 'PASS' ? '您将通过该信息的审核' : '您将驳回该信息的审核' }}</text>
28   - <uni-easyinput v-model="approveComment"
  28 + <uni-easyinput v-model="message"
29 29 :placeholder="approveType === 'PASS' ? '请输入通过原因' : '请输入驳回原因'" />
30 30 </view>
31 31 <view class="action-modal_footer">
... ... @@ -40,7 +40,7 @@
40 40 <script>
41 41 import FlowTimeline from '@/components/flow-timeline/index.vue'
42 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 44 export default {
45 45 components: {
46 46 FlowTimeline
... ... @@ -58,11 +58,12 @@ export default {
58 58 nodeList: [],
59 59 extraBtnText: '客户信息',
60 60 approveType: 'PASS',
61   - approveComment: ''
  61 + message: ''
62 62 }
63 63 },
64 64 computed: {
65 65 componentName() {
  66 + // sourceBusinessType 业务类型 todo 待处理--主要是合同那边使用
66 67 const name = getSysFlowComponentPath(this.auditCtx.bizFlag || '')
67 68 return name || ''
68 69 }
... ... @@ -129,14 +130,17 @@ export default {
129 130 ...vals
130 131 }
131 132 },
  133 + // 驳回
132 134 onReject() {
133 135 this.approveType = 'REFUSE'
134   - this.approveComment = ''
  136 + this.message = ''
135 137 this.$refs.approvePopup.open()
136 138 },
  139 + // 通过
  140 + // 在这里增加业务判断 比如 资信管理,判断有没有填写客户信息、公司评审(这些是不同角色进行操作的)
137 141 onPass() {
138 142 this.approveType = 'PASS'
139   - this.approveComment = ''
  143 + this.message = ''
140 144 this.$refs.approvePopup.open()
141 145 },
142 146 onExtra() {
... ... @@ -151,10 +155,39 @@ export default {
151 155 },
152 156 confirmApprove() {
153 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 191 this.$refs.approvePopup.close()
159 192 uni.showToast({
160 193 title: this.approveType === 'PASS' ? '已通过' : '已驳回',
... ...
... ... @@ -39,6 +39,7 @@ export default {
39 39 },
40 40 computed: {
41 41 componentName() {
  42 + // sourceBusinessType 业务类型 todo 待处理--主要是合同那边使用
42 43 const name = getSysFlowComponentPath(this.auditCtx.bizFlag || '')
43 44 return name || ''
44 45 }
... ...