Commit 26dff63c authored by 吴卿华's avatar 吴卿华

借支申请修改

parent 0075a3d2
...@@ -94,6 +94,7 @@ public class TBorrowingApplyForController extends BaseController ...@@ -94,6 +94,7 @@ public class TBorrowingApplyForController extends BaseController
@PostMapping @PostMapping
public AjaxResult add(@RequestBody TBorrowingApplyFor tBorrowingApplyFor) public AjaxResult add(@RequestBody TBorrowingApplyFor tBorrowingApplyFor)
{ {
// 获取当前用户 // 获取当前用户
SysUser user = tokenService.getLoginUser(ServletUtils.getRequest()).getUser(); SysUser user = tokenService.getLoginUser(ServletUtils.getRequest()).getUser();
if (StringUtils.isNotNull(user)) { if (StringUtils.isNotNull(user)) {
...@@ -107,6 +108,26 @@ public class TBorrowingApplyForController extends BaseController ...@@ -107,6 +108,26 @@ public class TBorrowingApplyForController extends BaseController
return toAjax(tBorrowingApplyForService.insertTBorrowingApplyFor(tBorrowingApplyFor)); return toAjax(tBorrowingApplyForService.insertTBorrowingApplyFor(tBorrowingApplyFor));
} }
/**
* 查询部门余额是否足够
* @param tBorrowingApplyFor
* @return
*/
@GetMapping("/departmentBalance")
public int departmentBalance(TBorrowingApplyFor tBorrowingApplyFor){
SysUser user = tokenService.getLoginUser(ServletUtils.getRequest()).getUser();
tBorrowingApplyFor.setApprovedUserId(user.getUserId());
/**查询部门余额是否足够*/
int isSufficient = tBorrowingApplyForService.selectTacc(tBorrowingApplyFor);
//0部门余额不足 1余额足够
if (isSufficient!=0){
return 1;
}else {
return 2;
}
}
/** /**
* 修改借支申请 * 修改借支申请
*/ */
......
...@@ -9,6 +9,15 @@ export function listFor(query) { ...@@ -9,6 +9,15 @@ export function listFor(query) {
}) })
} }
//查询部门余额是否足够
export function getDepartmentBalance(data) {
return request({
url: '/system/for/departmentBalance',
method: 'get',
data: data
})
}
// 查询借支申请详细 // 查询借支申请详细
export function getFor(borrowing) { export function getFor(borrowing) {
return request({ return request({
...@@ -50,4 +59,4 @@ export function exportFor(query) { ...@@ -50,4 +59,4 @@ export function exportFor(query) {
method: 'get', method: 'get',
params: query params: query
}) })
} }
\ No newline at end of file
...@@ -380,13 +380,15 @@ ...@@ -380,13 +380,15 @@
<el-divider></el-divider> <el-divider></el-divider>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="用途说明">{{form.applicationDescription}}</el-form-item> <el-form-item label="用途说明" v-if="form.applicationDescription!=null">{{form.applicationDescription}}</el-form-item>
<el-form-item label="用途说明">-</el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-divider></el-divider> <el-divider></el-divider>
<el-row > <el-row >
<el-col :span="24"> <el-col :span="24">
<el-form-item label="备注">{{form.remark}}</el-form-item> <el-form-item label="备注" v-if="form.remark!=null">{{form.remark}}</el-form-item>
<el-form-item label="备注">-</el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-divider></el-divider> <el-divider></el-divider>
...@@ -445,17 +447,22 @@ ...@@ -445,17 +447,22 @@
<el-col :span="8"> <el-col :span="8">
<el-form-item label="申请时间">{{form.registrationDate}}</el-form-item> <el-form-item label="申请时间">{{form.registrationDate}}</el-form-item>
</el-col> </el-col>
<el-col :span="8">
<el-form-item label="审批时间" v-if="form.approvalTime!=null">{{form.approvalTime}}</el-form-item>
<el-form-item label="审批时间" v-else>-</el-form-item>
</el-col>
</el-row> </el-row>
<el-divider></el-divider> <el-divider></el-divider>
<el-row style="height: 15px"> <el-row style="height: 15px">
<el-col :span="7"> <el-col :span="7">
<el-form-item label="小写合计">{{form.totalFigures}}</el-form-item> <el-form-item label="小写合计" v-if="form.totalFigures!=null">{{form.totalFigures}}</el-form-item>
<el-form-item label="小写合计" v-else>-</el-form-item>
</el-col> </el-col>
<el-col :span="17"> <el-col :span="8">
<el-form-item label="用途说明">{{form.applicationDescription}}</el-form-item> <el-form-item label="用途说明" v-if="form.applicationDescription!=null">{{form.applicationDescription}}</el-form-item>
<el-form-item label="用途说明" v-else>-</el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -464,18 +471,16 @@ ...@@ -464,18 +471,16 @@
<el-divider></el-divider> <el-divider></el-divider>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="备注">{{form.remark}}</el-form-item> <el-form-item label="备注" v-if="form.remark!=null">{{form.remark}}</el-form-item>
<el-form-item label="备注" v-else>-</el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-divider></el-divider> <el-divider></el-divider>
<el-row> <el-row>
<el-col :span="7"> <el-col :span="24">
<el-form-item label="审批人">{{form.approvedUserIdName}}</el-form-item> <el-form-item label="审批人" v-if="form.approvedUserIdName!=null">{{form.approvedUserIdName}}</el-form-item>
</el-col> <el-form-item label="审批人" v-else>-</el-form-item>
<el-col :span="8">
<el-form-item label="审批时间">{{form.approvalTime}}</el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -497,7 +502,7 @@ ...@@ -497,7 +502,7 @@
</template> </template>
<script> <script>
import { listFor, getFor, delFor, addFor, updateFor, exportFor } from "@/api/system/for"; import { listFor, getFor, delFor, addFor, updateFor, exportFor ,getDepartmentBalance } from "@/api/system/for";
import { selectTransactorByDeptId,listUser,listpersonnel } from "@/api/system/user"; import { selectTransactorByDeptId,listUser,listpersonnel } from "@/api/system/user";
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import { treeselect } from "@/api/system/dept"; import { treeselect } from "@/api/system/dept";
...@@ -771,17 +776,7 @@ export default { ...@@ -771,17 +776,7 @@ export default {
this.form.approvalStatus=row; this.form.approvalStatus=row;
updateFor(this.form).then(response => { updateFor(this.form).then(response => {
if (response==2){ if (response==2){
// alert("部门余额不足,审批拒绝") this.$message.error('部门余额不足');
// this.msgSuccess("部门余额不足,审批拒绝");
// this.$alert('部门余额不足,审批拒绝', '提示', {
// confirmButtonText: '确定',
// })
// this.msgSuccess("部门余额不足");
this.$message({
message: '部门余额不足',
type: 'warning'
});
}else{ }else{
// alert("审批成功") // alert("审批成功")
this.msgSuccess("审批成功"); this.msgSuccess("审批成功");
...@@ -791,11 +786,20 @@ export default { ...@@ -791,11 +786,20 @@ export default {
}); });
} else { } else {
addFor(this.form).then(response => { getDepartmentBalance(this.form).then(response => {
this.msgSuccess("申请提交"); if (response==2){
this.inser = false; this.$message.error('部门余额不足');
this.getList();
}); }else{
addFor(this.form).then(response => {
this.msgSuccess("申请提交");
this.inser = false;
this.getList();
});
}
})
} }
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment