| | |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * @website https://eladmin.vip |
| | | * @author 赵士淞 |
| | |
| | | businessExpenseFlowableService.reject(processInstanceId); |
| | | return new ResponseEntity<>(HttpStatus.OK); |
| | | } |
| | | |
| | | @GetMapping(value = "/processDiagram") |
| | | @Log("查询营业费用流程图(Flowable)") |
| | | @ApiOperation("查询营业费用流程图(Flowable)") |
| | | @PreAuthorize("@el.check('businessExpense:list')") |
| | | public void processDiagramBusinessExpense(HttpServletRequest request, HttpServletResponse response, @RequestParam String processInstanceId) throws Exception { |
| | | businessExpenseFlowableService.processDiagram(request, response, processInstanceId); |
| | | } |
| | | } |
| | |
| | | |
| | | import me.zhengjie.modules.business.service.dto.BusinessExpenseDto; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | * @param processInstanceId / |
| | | */ |
| | | void reject(String processInstanceId) throws Exception; |
| | | |
| | | /** |
| | | * 流程图 |
| | | * @param request |
| | | * @param response |
| | | * @param processInstanceId |
| | | * @throws Exception |
| | | */ |
| | | void processDiagram(HttpServletRequest request, HttpServletResponse response, String processInstanceId) throws Exception; |
| | | } |
| | |
| | | import me.zhengjie.modules.system.domain.User; |
| | | import me.zhengjie.modules.system.repository.RoleRepository; |
| | | import me.zhengjie.modules.system.repository.UserRepository; |
| | | import me.zhengjie.utils.FileUtil; |
| | | import me.zhengjie.utils.ObjectUtil; |
| | | import me.zhengjie.utils.SecurityUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.ByteArrayInputStream; |
| | | import java.io.File; |
| | | import java.io.InputStream; |
| | | import java.math.BigDecimal; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | // 发起通信 |
| | | api.post(flowableUrl + "/api/common/next?processInstanceId=" + processInstanceId, paramsMap); |
| | | } |
| | | |
| | | /** |
| | | * 流程图 |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void processDiagram(HttpServletRequest request, HttpServletResponse response, String processInstanceId) throws Exception { |
| | | // 发起通信 |
| | | byte[] obj = api.postStream(flowableUrl + "/api/common/processDiagram?processInstanceId=" + processInstanceId, new HashMap<>()); |
| | | // 输入流 |
| | | InputStream in = new ByteArrayInputStream(obj); |
| | | // inputStream 转 File |
| | | File file = FileUtil.inputStreamToFile(in, "流程图.jpeg"); |
| | | // 下载文件 |
| | | FileUtil.downloadFile(request, response, file, true); |
| | | } |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | export default { add, agree, reject } |
| | | export function processDiagram(processInstanceId) { |
| | | return request({ |
| | | url: 'api/businessExpenseFlowable/processDiagram?processInstanceId=' + processInstanceId, |
| | | method: 'get', |
| | | responseType: 'blob' |
| | | }) |
| | | } |
| | | |
| | | export default { add, agree, reject, processDiagram } |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="remarks" label="备注" /> |
| | | <el-table-column prop="createTime" label="创建时间" /> |
| | | <el-table-column label="流程图"> |
| | | <template slot-scope="scope"> |
| | | <el-link @click="toProcessDiagram(scope.row)">查看</el-link> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column v-if="checkPer(['admin','businessExpenseFlowable:agree','businessExpenseFlowable:reject'])" label="操作" width="150px" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-popover |
| | |
| | | </el-table> |
| | | <!--分页组件--> |
| | | <pagination /> |
| | | <!--表单组件--> |
| | | <el-dialog :close-on-click-modal="false" :before-close="cancelImage" :visible.sync="imageStatus" :title="imageTitle" width="630px"> |
| | | <!-- 图片 --> |
| | | <el-image :src="imageUrl" :preview-src-list="imageUrlList" /> |
| | | </el-dialog> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | // 同意按钮加载状态 |
| | | agreeLoading: false, |
| | | // 拒绝按钮加载状态 |
| | | rejectLoading: false |
| | | rejectLoading: false, |
| | | // 图片路径 |
| | | imageUrl: null, |
| | | imageUrlList: [], |
| | | // 图片表单状态 |
| | | imageStatus: false, |
| | | // 图片表单标题 |
| | | imageTitle: '流程图' |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | canelReject(data) { |
| | | // 关闭弹出框 |
| | | this.$refs[`reject_${data.processInstanceId}`].showPopper = false |
| | | }, |
| | | // 查看流程图 |
| | | toProcessDiagram(data) { |
| | | // 查看流程图 |
| | | crudBusinessExpenseFlowable.processDiagram(data.processInstanceId).then(res => { |
| | | // 图片路径 |
| | | this.imageUrl = window.URL.createObjectURL(new Blob([res])) |
| | | this.imageUrlList = [window.URL.createObjectURL(new Blob([res]))] |
| | | // 图片表单状态 |
| | | this.imageStatus = true |
| | | }) |
| | | }, |
| | | cancelImage() { |
| | | // 图片路径 |
| | | this.imageUrl = null |
| | | this.imageUrlList = [] |
| | | // 图片表单状态 |
| | | this.imageStatus = false |
| | | } |
| | | } |
| | | } |
| | |
| | | {{ scope.row.approve == 'true' ? '同意' : scope.row.approve == 'false' ? '拒绝' : '审核中' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="流程图"> |
| | | <template slot-scope="scope"> |
| | | <el-link v-if="scope.row.approve != 'true' && scope.row.approve != 'false'" @click="toProcessDiagram(scope.row)">查看</el-link> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <!--分页组件--> |
| | | <pagination /> |
| | |
| | | <el-button type="text" @click="reimbursementCancel">取消</el-button> |
| | | <el-button :loading="reimbursementLoading" type="primary" @click="reimbursementSubmit('reimbursementForm')">确认</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <!--表单组件--> |
| | | <el-dialog :close-on-click-modal="false" :before-close="cancelImage" :visible.sync="imageStatus" :title="imageTitle" width="630px"> |
| | | <!-- 图片 --> |
| | | <el-image :src="imageUrl" :preview-src-list="imageUrlList" /> |
| | | </el-dialog> |
| | | </div> |
| | | </div> |
| | |
| | | // 营业费用明细弹窗操作 |
| | | reimbursementExecute: {}, |
| | | // 营业费用明细弹窗加载 |
| | | reimbursementLoading: false |
| | | reimbursementLoading: false, |
| | | // 图片路径 |
| | | imageUrl: null, |
| | | imageUrlList: [], |
| | | // 图片表单状态 |
| | | imageStatus: false, |
| | | // 图片表单标题 |
| | | imageTitle: '流程图' |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | } |
| | | // 营业费用明细弹窗关闭 |
| | | this.reimbursementCancel() |
| | | }, |
| | | // 查看流程图 |
| | | toProcessDiagram(data) { |
| | | // 查看流程图 |
| | | crudBusinessExpenseFlowable.processDiagram(data.processInstanceId).then(res => { |
| | | // 图片路径 |
| | | this.imageUrl = window.URL.createObjectURL(new Blob([res])) |
| | | this.imageUrlList = [window.URL.createObjectURL(new Blob([res]))] |
| | | // 图片表单状态 |
| | | this.imageStatus = true |
| | | }) |
| | | }, |
| | | cancelImage() { |
| | | // 图片路径 |
| | | this.imageUrl = null |
| | | this.imageUrlList = [] |
| | | // 图片表单状态 |
| | | this.imageStatus = false |
| | | } |
| | | } |
| | | } |