Commit 52a645b4 authored by 耿迪迪's avatar 耿迪迪

服务费用申请

parent 201eeeb2
......@@ -8,6 +8,7 @@ import com.zehong.common.utils.StringUtils;
import com.zehong.framework.web.service.TokenService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
......@@ -88,6 +89,12 @@ public class TAccountController extends BaseController
@PostMapping
public AjaxResult add(@RequestBody TAccount tAccount)
{
TAccount accountInfo = new TAccount();
accountInfo.setDeptId(tAccount.getDeptId());
List<TAccount> existAccount = tAccountService.selectTAccountList(accountInfo);
if(!CollectionUtils.isEmpty(existAccount)){
return AjaxResult.error("部门账户已存在");
}
return toAjax(tAccountService.insertTAccount(tAccount));
}
......
......@@ -118,6 +118,8 @@ public class TPurchase extends BaseEntity
private String purchaseDeptManagerName;
private String purchaseType;
public void setPurchaseId(Long purchaseId)
{
this.purchaseId = purchaseId;
......@@ -278,6 +280,14 @@ public class TPurchase extends BaseEntity
this.purchaseDeptManagerName = purchaseDeptManagerName;
}
public String getPurchaseType() {
return purchaseType;
}
public void setPurchaseType(String purchaseType) {
this.purchaseType = purchaseType;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
......@@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="TPurchase" id="TPurchaseResult">
<result property="purchaseId" column="purchase_id" />
<result property="purchaseDeptId" column="purchase_dept_id" />
<result property="purchaseType" column="purchase_type" />
<result property="handledByUserId" column="handled_by_user_id" />
<result property="purchaseName" column="purchase_name" />
<result property="specifications" column="specifications" />
......@@ -35,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT
p.purchase_id,
p.purchase_dept_id,
p.purchase_type,
p.handled_by_user_id,
p.purchase_name,
p.specifications,
......@@ -63,7 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select (select dept_name from sys_dept where dept_id =purchase_dept_id)purchase_dept_name,
t2.nick_name user_name,
(SELECT t1.nick_name FROM sys_user t1 WHERE t1.user_id = t.approved_user_id) approved_user_name,
t.purchase_id, t.handled_by_user_id,t.purchase_dept_id, t.purchase_name, t.specifications, t.model_type, t.application_description, t.user_id, price, count, total, purchase_dept_manager_id, approved_user_id, t.remark, t.create_time, t.is_del, t.update_time, t.purchase_status, t.approved_time from t_purchase t,sys_user t2
t.purchase_id, t.purchase_type,t.handled_by_user_id,t.purchase_dept_id, t.purchase_name, t.specifications, t.model_type, t.application_description, t.user_id, price, count, total, purchase_dept_manager_id, approved_user_id, t.remark, t.create_time, t.is_del, t.update_time, t.purchase_status, t.approved_time from t_purchase t,sys_user t2
<where>
t.user_id=t2.user_id
<if test="purchaseDeptId != null "> and t.purchase_dept_id = #{purchaseDeptId}</if>
......@@ -82,6 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isDel != null and isDel != ''"> and t.is_del = #{isDel}</if>
<if test="purchaseStatus != null and purchaseStatus != ''"> and t.purchase_status = #{purchaseStatus}</if>
<if test="approvedTime != null "> and t.approved_time = #{approvedTime}</if>
<if test="purchaseType != null and purchaseType != ''"> and purchase_type = #{purchaseType}</if>
</where>
</select>
......@@ -95,6 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="purchaseId != null">purchase_id,</if>
<if test="purchaseDeptId != null">purchase_dept_id,</if>
<if test="purchaseType != null">purchase_type,</if>
<if test="handledByUserId != null">handled_by_user_id,</if>
<if test="purchaseName != null">purchase_name,</if>
<if test="specifications != null">specifications,</if>
......@@ -116,6 +120,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="purchaseId != null">#{purchaseId},</if>
<if test="purchaseDeptId != null">#{purchaseDeptId},</if>
<if test="purchaseType != null">#{purchaseType},</if>
<if test="handledByUserId != null">#{handledByUserId},</if>
<if test="purchaseName != null">#{purchaseName},</if>
<if test="specifications != null">#{specifications},</if>
......@@ -140,6 +145,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update t_purchase
<trim prefix="SET" suffixOverrides=",">
<if test="purchaseDeptId != null">purchase_dept_id = #{purchaseDeptId},</if>
<if test="purchaseType != null">purchase_type = #{purchaseType},</if>
<if test="handledByUserId != null">handled_by_user_id = #{handledByUserId},</if>
<if test="purchaseName != null">purchase_name = #{purchaseName},</if>
<if test="specifications != null">specifications = #{specifications},</if>
......
......@@ -32,7 +32,7 @@
</el-form-item>
</el-form>
<!--<el-row :gutter="10" class="mb8">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
......@@ -43,7 +43,7 @@
v-hasPermi="['system:account:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<!--<el-col :span="1.5">
<el-button
type="success"
plain
......@@ -76,8 +76,8 @@
v-hasPermi="['system:account:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
</el-row>
<el-table v-loading="loading" :data="accountList">
<el-table-column
......@@ -154,14 +154,25 @@
/>
<!-- 添加或修改账户对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="部门" prop="deptId">
<el-input v-model="form.deptId" placeholder="请输入部门" />
</el-form-item>
<el-form-item label="可用金额" prop="ableAmount">
<el-input v-model="form.ableAmount" placeholder="请输入可用金额" />
</el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="部门" prop="deptId">
<treeselect
v-model="form.deptId"
:options="deptOptions"
:show-count="true"
placeholder="请选择部门"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="可用金额" prop="ableAmount">
<el-input v-model="form.ableAmount" type="number" placeholder="请输入可用金额" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
......@@ -455,6 +466,7 @@ export default {
this.reset();
this.open = true;
this.title = "添加账户";
this.getTreeselect();
},
/** 修改按钮操作 */
handleUpdate(row) {
......
<template>
<div class="common">
<el-form label-width="100px">
<el-form-item label="采购名称">{{ purchaseData.purchaseName }}</el-form-item>
<el-form-item label="物品名称">{{ purchaseData.purchaseName }}</el-form-item>
<el-divider></el-divider>
<el-row>
<el-col :span="12">
......
......@@ -80,7 +80,7 @@
this.$emit("getList");
this.$message.success("审核成功!");
if(this.$refs.currentCom.submitSuggestion().purchaseStatus == '3'){
sendNotice({noticeTitle:"您的采购申请被驳回",noticeType:"1",noticeContent:"您的采购申请被驳回",userId:this.purchaseInfo.handledByUserId});
sendNotice({noticeTitle:"您的物品采购申请被驳回",noticeType:"1",noticeContent:"您的物品采购申请被驳回",userId:this.purchaseInfo.handledByUserId});
}
}else{
this.$message.error("审核失败!");
......@@ -94,7 +94,7 @@
this.open = false;
this.$emit("getList");
this.$message.success("提交成功!");
sendNotice({noticeTitle:"您有新采购信息待审批",noticeType:"1",noticeContent:"您有新采购信息待审批",roles:"calculator"})
sendNotice({noticeTitle:"您有新物品采购信息待审批",noticeType:"1",noticeContent:"您有新物品采购信息待审批",roles:"calculator"})
}else{
this.$message.error("提交失败!");
}
......
......@@ -10,10 +10,10 @@
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="采购名称" prop="purchaseName">
<el-form-item label="物品名称" prop="purchaseName">
<el-input
v-model="queryParams.purchaseName"
placeholder="请输入采购名称"
placeholder="请输入物品名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
......@@ -120,7 +120,7 @@
<!--<el-table-column type="selection" width="55" align="center" />-->
<!-- <el-table-column label="采购主键" align="center" prop="purchaseId" />-->
<!-- <el-table-column label="采购申请部门" align="center" prop="purchaseDeptName" />-->
<el-table-column label="采购名称" align="center" prop="purchaseName" :show-overflow-tooltip="true" width="150"/>
<el-table-column label="物品名称" align="center" prop="purchaseName" :show-overflow-tooltip="true" width="150"/>
<!-- <el-table-column label="规格" align="center" prop="specifications" />-->
<!-- <el-table-column label="型号" align="center" prop="modelType" />-->
<el-table-column label="用途说明" align="center" prop="applicationDescription" :show-overflow-tooltip="true"/>
......@@ -199,8 +199,8 @@
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="24">
<el-form-item label="采购名称" prop="purchaseName">
<el-input v-model="form.purchaseName" placeholder="请输入采购名称" />
<el-form-item label="物品名称" prop="purchaseName">
<el-input v-model="form.purchaseName" placeholder="请输入物品名称" />
</el-form-item>
</el-col>
</el-row>
......@@ -318,6 +318,7 @@ export default {
pageNum: 1,
pageSize: 10,
purchaseDeptId: null,
purchaseType: '0',
purchaseName: null,
specifications: null,
modelType: null,
......@@ -337,7 +338,7 @@ export default {
// 表单校验
rules: {
purchaseName: [
{ required: true, message: "采购名称不能为空", trigger: "blur" },
{ required: true, message: "物品名称不能为空", trigger: "blur" },
],
specifications: [
{ required: true, message: "规格不能为空", trigger: "blur" },
......@@ -467,7 +468,7 @@ export default {
handleAdd() {
this.reset();
this.open = true;
this.title = "添加外部采购(报销)申请";
this.title = "添加物品采购申请";
},
/** 修改按钮操作 */
handleUpdate(row) {
......@@ -476,7 +477,7 @@ export default {
getPurchase(purchaseId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改外部采购(报销)申请";
this.title = "修改物品采购申请";
});
},
/** 提交按钮 */
......@@ -502,13 +503,13 @@ export default {
},
//通知下一个人
noticeNext(){
sendNotice({noticeTitle:"您有新采购信息待确认",noticeType:"1",noticeContent:"您有新采购信息待确认",
sendNotice({noticeTitle:"您有新物品采购信息待确认",noticeType:"1",noticeContent:"您有新物品采购信息待确认",
deptId:this.$store.state.user.deptId,roles:"deptLeader"})
},
/** 删除按钮操作 */
handleDelete(row) {
const purchaseIds = row.purchaseId || this.ids;
this.$confirm('是否确认删除外部采购(报销)申请编号为"' + row.purchaseName + '"的数据项?', "警告", {
this.$confirm('是否确认删除物品采购申请名称为"' + row.purchaseName + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
......@@ -522,7 +523,7 @@ export default {
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有外部采购(报销)申请数据项?', "警告", {
this.$confirm('是否确认导出所有物品采购申请数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
......
<template>
<div>
<CommonInfo :purchaseData="purchaseData"/>
<div style="margin: 11px 30px;color: #1890ff;">部门长审核</div>
<el-form label-width="100px">
<el-form-item label="审核人">{{ purchaseData.purchaseDeptManagerName }}</el-form-item>
</el-form>
<el-divider></el-divider>
<div style="margin: 11px 30px;color: #1890ff;">核算部审批</div>
<el-row style="margin-left:97px">
<el-col :span="10">
<el-row>
<el-col :span="6">
<el-radio v-model="radio" label="1">通过</el-radio>
</el-col>
<el-col :span="6">
<el-radio v-model="radio" label="2">不通过</el-radio>
</el-col>
</el-row>
</el-col>
<el-col :span="10">
<el-row>
<el-col :span="5">审核人</el-col>
<el-col :span="16"><el-input :value="$store.state.user.nickName" style="width: 90px" disabled/></el-col>
</el-row>
</el-col>
</el-row>
</div>
</template>
<script>
import CommonInfo from "./CommonInfo";
export default {
name: "calculate",
props: {
purchaseData:{
type: Object
}
},
components:{
CommonInfo
},
watch:{
radio(newVal,oldVal){
if(newVal== "1"){
this.purchaseStatus = "2";
}
if(newVal== "2"){
this.purchaseStatus = "3";
}
}
},
data(){
return{
radio: "1",
purchaseStatus: "2"
}
},
methods:{
resetSuggestion(){
this.radio = "1";
},
checkParam(){
return false;
},
submitSuggestion(){
let param = {...this.purchaseData};
param.purchaseStatus = this.purchaseStatus;
param.approvedUserId = this.$store.state.user.userId;
param.approvedTime =this.getNowTime();
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;
}
}
}
</script>
<style scoped>
</style>
<template>
<div class="common">
<el-form label-width="100px">
<el-row>
<el-col :span="12">
<el-form-item label="费用名称">{{ purchaseData.purchaseName }}</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="金额">{{ purchaseData.total }}</el-form-item>
</el-col>
</el-row>
<el-divider></el-divider>
<el-row>
<el-col :span="12">
<el-form-item label="用途">{{ purchaseData.applicationDescription }}</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="报销人">{{ purchaseData.userName }}</el-form-item>
</el-col>
</el-row>
<el-divider></el-divider>
<el-form-item label="备注">{{ purchaseData.remark==null?"-":purchaseData.remark }}</el-form-item>
<el-divider></el-divider>
</el-form>
</div>
</template>
<script>
export default {
name: "common-info",
props: {
purchaseData:{
type: Object
}
},
}
</script>
<style>
.common{
.el-form-item {
margin-bottom: 0px;
}
.el-divider--horizontal {
margin: 5px 0;
}
}
</style>
<style scoped>
</style>
<template>
<div>
<CommonInfo :purchaseData="purchaseData"/>
<el-row style="margin-left:95px">
<el-col :span="8" style="margin-top: 15px">
<el-checkbox v-model="checked">我已知晓</el-checkbox>
</el-col>
<el-col :span="8" style="margin-top: 10px">
<span style="margin: 0px 5px;">审批人</span>
<el-input :value="$store.state.user.nickName" style="width: 130px" disabled/>
</el-col>
</el-row>
<el-divider></el-divider>
</div>
</template>
<script>
import CommonInfo from "./CommonInfo";
export default {
name: "confirm",
props: {
purchaseData:{
type: Object
}
},
components:{
CommonInfo
},
data(){
return{
checked: false
}
},
methods:{
resetSuggestion(){
this.checked = false;
},
checkParam(){
if(!this.checked){
this.$message.error("请勾选须知!");
return true;
}
return false;
},
submitSuggestion(){
return {purchaseId:this.purchaseData.purchaseId,purchaseStatus:"1",purchaseDeptManagerId:this.$store.state.user.userId};
}
}
}
</script>
<style scoped>
</style>
<template>
<div style="display: inline-block;margin: 0px 5px">
<el-button type="text" @click="openPurchaseDialog" size="mini">{{getOperatorName()}}</el-button>
<el-dialog :title="getOperatorName()" :visible.sync="open" width="800px" append-to-body :close-on-click-modal="false" destroy-on-close>
<component :is="currentTabComponent" :purchaseData="purchaseData" ref="currentCom" v-if="open"></component>
<div slot="footer" class="dialog-footer" style="text-align: center" v-if="operatorName != 'purchaseDetail'">
<el-button style="width: 150px;border-color: #1890ff;color: #1890ff;" @click="resetSuggestion">重置意见</el-button>
<el-button type="primary" style="width: 150px" @click="submitSuggestion">提交</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { getPurchase, updatePurchase, approvalPurchase } from "@/api/transaction/purchase";
import calculate from "./Calculate";
import confirm from "./Confirm";
import purchaseDetail from "./PurchaseDetail";
import { sendNotice } from "@/api/system/notice";
export default {
name: "operator-button",
components:{
calculate,
confirm,
purchaseDetail
},
props:{
operatorName: {
type: String
},
purchaseInfo: {
type: Object
}
},
created(){
this.currentTabComponent = this.operatorName;
},
data(){
return{
open: false,
currentTabComponent: "",
purchaseData: {}
}
},
methods:{
getOperatorName(){
switch(this.operatorName){
case "purchaseDetail":
return "详情";
case "confirm" :
return "部门长审核";
case "calculate":
return "核算部审批";
default:
return "";
}
},
openPurchaseDialog(){
getPurchase(this.purchaseInfo.purchaseId).then(res =>{
if(res.code == 200){
this.purchaseData = res.data;
this.open = true;
}
})
},
//重置意见
resetSuggestion(){
this.$refs.currentCom.resetSuggestion();
},
//提交
submitSuggestion(){
if(this.$refs.currentCom.checkParam()){
return;
}
if("calculate" == this.operatorName){
approvalPurchase(this.$refs.currentCom.submitSuggestion()).then(res =>{
if(res.code == 200){
this.open = false;
this.$emit("getList");
this.$message.success("审核成功!");
if(this.$refs.currentCom.submitSuggestion().purchaseStatus == '3'){
sendNotice({noticeTitle:"您的服务费用申请被驳回",noticeType:"1",noticeContent:"您的服务费用申请被驳回",userId:this.purchaseInfo.handledByUserId});
}
}else{
this.$message.error("审核失败!");
}
});
return;
}
updatePurchase(this.$refs.currentCom.submitSuggestion()).then(res =>{
if(res.code == 200){
this.open = false;
this.$emit("getList");
this.$message.success("提交成功!");
sendNotice({noticeTitle:"您有新服务费用信息待审批",noticeType:"1",noticeContent:"您有新服务费用信息待审批",roles:"calculator"})
}else{
this.$message.error("提交失败!");
}
})
},
}
}
</script>
<style scoped>
</style>
<template>
<div class="detail">
<CommonInfo :purchaseData="purchaseData"/>
<div v-if="purchaseData.purchaseStatus > 0">
<div style="margin: 11px 30px;color: #1890ff;">部门长审核</div>
<el-form label-width="100px">
<el-form-item label="审核人">{{ purchaseData.purchaseDeptManagerName }}</el-form-item>
</el-form>
<el-divider></el-divider>
<div v-if="purchaseData.purchaseStatus > 1">
<div style="margin: 11px 30px;color: #1890ff;">核算部审批</div>
<el-form label-width="100px">
<el-row>
<el-col :span="8">
<el-form-item>
<el-radio v-model="this.purchaseData.purchaseStatus =='2'?radio ='1':radio='2'" label="1" disabled>通过</el-radio>
<el-radio v-model="radio" label="2" disabled>不通过</el-radio>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="审核人">{{purchaseData.approvedUserName}}</el-form-item>
</el-col>
<el-col :span="8"></el-col>
</el-row>
</el-form>
<el-divider></el-divider>
</div>
</div>
</div>
</template>
<script>
import CommonInfo from "./CommonInfo";
export default {
name: "purchase-detail",
props: {
purchaseData:{
type: Object
}
},
components:{
CommonInfo
}
}
</script>
<style scoped lang="scss">
.detail{
height: 460px;
overflow-y: auto;
&::-webkit-scrollbar {
/* 设置滚动条宽度 */
width: 4px;
/* 设置滚动条背景色 */
//background: black;
}
//滚动条轨道
&::-webkit-scrollbar-track {
background-color:transparent;
-webkit-border-radius: 2em;
-moz-border-radius: 2em;
border-radius:2em;
}
//滚动条滑块
&::-webkit-scrollbar-thumb {
background-color: rgb(147,147,153,0.5);
-webkit-border-radius: 2em;
-moz-border-radius: 2em;
border-radius:2em;
}
}
</style>
This diff is collapsed.
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