Showing
1 changed file
with
13 additions
and
14 deletions
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-07-18 10:22:22 | 2 | * @Date: 2022-07-18 10:22:22 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2024-07-22 16:44:27 | 4 | + * @LastEditTime: 2024-07-22 17:30:54 |
| 5 | * @FilePath: /data-table/src/views/index.vue | 5 | * @FilePath: /data-table/src/views/index.vue |
| 6 | * @Description: 首页 | 6 | * @Description: 首页 |
| 7 | --> | 7 | --> |
| ... | @@ -151,7 +151,7 @@ | ... | @@ -151,7 +151,7 @@ |
| 151 | <van-dialog v-model:show="show_reject" title="选择驳回节点" show-cancel-button :confirm-button-color="themeVars.buttonPrimaryBackground" @confirm="onConfirmDialog" @cancel="onCancelDialog"> | 151 | <van-dialog v-model:show="show_reject" title="选择驳回节点" show-cancel-button :confirm-button-color="themeVars.buttonPrimaryBackground" @confirm="onConfirmDialog" @cancel="onCancelDialog"> |
| 152 | <div style="padding: 1rem 0;"> | 152 | <div style="padding: 1rem 0;"> |
| 153 | <van-checkbox-group v-model="checked_reject" shape="square" :checked-color="themeVars.buttonPrimaryBackground"> | 153 | <van-checkbox-group v-model="checked_reject" shape="square" :checked-color="themeVars.buttonPrimaryBackground"> |
| 154 | - <van-checkbox v-for="(node, index) in reject_nodes" :key="index" :name="node.id" style="margin: 0 0 8px 20px;">{{ node.name }}</van-checkbox> | 154 | + <van-checkbox v-for="(node, index) in reject_nodes" :key="index" :name="node.code" style="margin: 0 0 8px 20px;">{{ node.name }}</van-checkbox> |
| 155 | </van-checkbox-group> | 155 | </van-checkbox-group> |
| 156 | </div> | 156 | </div> |
| 157 | </van-dialog> | 157 | </van-dialog> |
| ... | @@ -295,18 +295,19 @@ const myForm = ref(null); | ... | @@ -295,18 +295,19 @@ const myForm = ref(null); |
| 295 | const approval_actions = ref([]); | 295 | const approval_actions = ref([]); |
| 296 | const show_reject = ref(false); | 296 | const show_reject = ref(false); |
| 297 | const checked_reject = ref([]); | 297 | const checked_reject = ref([]); |
| 298 | -const reject_nodes = ref([{ id: '123', name: 'node1' }, { id: '456', name: 'node2' }]); // TODO: 待完善,节点数据需要后台获取 | 298 | +const reject_nodes = ref([]); |
| 299 | const onApprovalSelect = (item) => { | 299 | const onApprovalSelect = (item) => { |
| 300 | flow_node_action_id.value = item.id; | 300 | flow_node_action_id.value = item.id; |
| 301 | if (page_type === 'add') { // 新增页面统一处理为提交 | 301 | if (page_type === 'add') { // 新增页面统一处理为提交 |
| 302 | myForm.value.submit(); | 302 | myForm.value.submit(); |
| 303 | } | 303 | } |
| 304 | if (page_type === 'flow') { | 304 | if (page_type === 'flow') { |
| 305 | - // TODO:待完善,驳回选择分支操作 | 305 | + // 驳回选择分支操作 |
| 306 | - // if (item.id === 'reject') { // 点击驳回按钮 | 306 | + if (item.id === 'reject' && item?.parent_nodes?.length) { // 点击驳回按钮 |
| 307 | - // show_reject.value = true; | 307 | + show_reject.value = true; |
| 308 | - // return; | 308 | + reject_nodes.value = item.parent_nodes; // 驳回操作对应的上级节点 |
| 309 | - // } | 309 | + return; |
| 310 | + } | ||
| 310 | myForm.value.submit(); | 311 | myForm.value.submit(); |
| 311 | } | 312 | } |
| 312 | // switch (item.id) { | 313 | // switch (item.id) { |
| ... | @@ -337,13 +338,11 @@ const onApprovalCancel = () => { | ... | @@ -337,13 +338,11 @@ const onApprovalCancel = () => { |
| 337 | // } | 338 | // } |
| 338 | 339 | ||
| 339 | const onConfirmDialog = () => { // 提交驳回节点操作 | 340 | const onConfirmDialog = () => { // 提交驳回节点操作 |
| 340 | - // TODO: 提交驳回节点操作,需要驳回的节点需要传递到后台数据中 | 341 | + // 提交驳回节点操作,需要驳回的节点需要传递到后台数据中 |
| 341 | - // myForm.value.submit(); | 342 | + myForm.value.submit(); |
| 342 | - console.warn('onConfirmDialog', checked_reject.value); | ||
| 343 | } | 343 | } |
| 344 | const onCancelDialog = () => { // 取消驳回节点操作 | 344 | const onCancelDialog = () => { // 取消驳回节点操作 |
| 345 | checked_reject.value = []; | 345 | checked_reject.value = []; |
| 346 | - console.warn('onCancelDialog'); | ||
| 347 | } | 346 | } |
| 348 | 347 | ||
| 349 | // TODO: 等待调试发送短信接口 | 348 | // TODO: 等待调试发送短信接口 |
| ... | @@ -376,7 +375,6 @@ const onBindSubmit = (values) => { | ... | @@ -376,7 +375,6 @@ const onBindSubmit = (values) => { |
| 376 | }) | 375 | }) |
| 377 | }; | 376 | }; |
| 378 | 377 | ||
| 379 | -// const flow_node_code = getUrlParams(location.href) ? getUrlParams(location.href).flow_node_code : formSetting.value.flow_node_code; // flow_node_code 表示随机选择的流程节点的ID | ||
| 380 | const flow_node_code = $route.query.flow_node_code ? $route.query.flow_node_code :formSetting.value.flow_node_code; // flow_node_code 表示随机选择的流程节点的ID | 378 | const flow_node_code = $route.query.flow_node_code ? $route.query.flow_node_code :formSetting.value.flow_node_code; // flow_node_code 表示随机选择的流程节点的ID |
| 381 | 379 | ||
| 382 | onMounted(async () => { | 380 | onMounted(async () => { |
| ... | @@ -1115,7 +1113,8 @@ const onSubmit = async (values) => { | ... | @@ -1115,7 +1113,8 @@ const onSubmit = async (values) => { |
| 1115 | data_id, | 1113 | data_id, |
| 1116 | flow_node_code, | 1114 | flow_node_code, |
| 1117 | flow_node_action_id: flow_node_action_id.value, | 1115 | flow_node_action_id: flow_node_action_id.value, |
| 1118 | - flow_content: approval_note.value | 1116 | + flow_content: approval_note.value, |
| 1117 | + flow_reject_to_node_codes: checked_reject.value.length ? checked_reject.value.join(',') : '', | ||
| 1119 | }); | 1118 | }); |
| 1120 | if (result.code) { | 1119 | if (result.code) { |
| 1121 | // 提交按钮禁用状态 | 1120 | // 提交按钮禁用状态 | ... | ... |
-
Please register or login to post a comment