Commit 233786d7 authored by 耿迪迪's avatar 耿迪迪

采购代码优化

parents e08800cf 26dff63c
...@@ -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;
}
}
/** /**
* 修改借支申请 * 修改借支申请
*/ */
......
...@@ -105,8 +105,8 @@ public class TPurchase extends BaseEntity ...@@ -105,8 +105,8 @@ public class TPurchase extends BaseEntity
private String purchaseStatus; private String purchaseStatus;
/** 审核时间 */ /** 审核时间 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date approvedTime; private Date approvedTime;
/** /**
......
...@@ -162,6 +162,7 @@ public class TPurchaseServiceImpl implements ITPurchaseService ...@@ -162,6 +162,7 @@ public class TPurchaseServiceImpl implements ITPurchaseService
operate.setOperateTime(new Date()); operate.setOperateTime(new Date());
operate.setRelationDoc(String.valueOf(tPurchase.getPurchaseId())); operate.setRelationDoc(String.valueOf(tPurchase.getPurchaseId()));
operate.setOperateType("4"); operate.setOperateType("4");
operate.setDocumentType("3");//1.交易单 2.借支单 3.外部采购单 4.借贷单
tCashOperateMapper.insertTCashOperate(operate); tCashOperateMapper.insertTCashOperate(operate);
} }
} }
...@@ -118,7 +118,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -118,7 +118,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="queryApplyDeptId != null">and apply_dept_id = #{queryApplyDeptId}</if> <if test="queryApplyDeptId != null">and apply_dept_id = #{queryApplyDeptId}</if>
<if test="queryTradeDeptId != null">and trade_dept_id = #{queryTradeDeptId}</if> <if test="queryTradeDeptId != null">and trade_dept_id = #{queryTradeDeptId}</if>
</where> </where>
order by update_time desc order by update_time,create_time desc
</select> </select>
<select id="selectTTradeProjectById" parameterType="Long" resultMap="TTradeProjectResult"> <select id="selectTTradeProjectById" parameterType="Long" resultMap="TTradeProjectResult">
......
...@@ -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>
...@@ -446,7 +448,8 @@ ...@@ -446,7 +448,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-col :span="8">
<el-form-item label="审批时间">{{form.approvalTime}}</el-form-item> <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-col>
</el-row> </el-row>
<el-divider></el-divider> <el-divider></el-divider>
...@@ -454,10 +457,12 @@ ...@@ -454,10 +457,12 @@
<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="8"> <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>
...@@ -466,14 +471,16 @@ ...@@ -466,14 +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="24"> <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-form-item label="审批人" v-else>-</el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -495,7 +502,7 @@ ...@@ -495,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";
...@@ -769,17 +776,7 @@ export default { ...@@ -769,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("审批成功");
...@@ -789,11 +786,20 @@ export default { ...@@ -789,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();
});
}
})
} }
} }
}); });
......
...@@ -68,8 +68,15 @@ ...@@ -68,8 +68,15 @@
let param = {...this.purchaseData}; let param = {...this.purchaseData};
param.purchaseStatus = this.purchaseStatus; param.purchaseStatus = this.purchaseStatus;
param.approvedUserId = this.$store.state.user.userId; param.approvedUserId = this.$store.state.user.userId;
param.approvedTime = new Date(); param.approvedTime =this.getNowTime();
return param; return param;
},
getNowTime(){
var date = new Date();
var seperator = "-";
var currentdate =date.getFullYear()+seperator+date.getMonth()+seperator+date.getDate() +" "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds();
console.log(currentdate,"currentdate")
return currentdate;
} }
} }
} }
......
...@@ -42,15 +42,15 @@ ...@@ -42,15 +42,15 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<!-- <el-form-item label="使用人" prop="userId"> <el-form-item label="使用人" prop="userName">
<el-input <el-input
v-model="queryParams.userId" v-model="queryParams.userName"
placeholder="请输入使用人" placeholder="请输入使用人"
clearable clearable
size="small" size="small"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item>--> </el-form-item>
<el-form-item label="采购状态" prop="purchaseStatus"> <el-form-item label="采购状态" prop="purchaseStatus">
<el-select v-model="queryParams.purchaseStatus" placeholder="请选择采购状态" clearable size="small"> <el-select v-model="queryParams.purchaseStatus" placeholder="请选择采购状态" clearable size="small">
......
...@@ -84,6 +84,7 @@ ...@@ -84,6 +84,7 @@
this.price = ""; this.price = "";
this.socre = ""; this.socre = "";
this.dealPrice = ""; this.dealPrice = "";
this.dealRemark="";
}, },
checkParam(){ checkParam(){
if(!this.dealPrice){ if(!this.dealPrice){
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
/> />
<el-table-column label="交易评分" align="center" prop="tradeScore" /> <el-table-column label="交易评分" align="center" prop="tradeScore" />
<el-table-column label="交易成交价" align="center" prop="dealPrice" /> <el-table-column label="交易成交价" align="center" prop="dealPrice" />
<el-table-column label="尾款" align="center" prop="pendingPayment" width="80"/>
<el-table-column <el-table-column
label="操作" label="操作"
align="center" align="center"
......
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