Commit 804f07f4 authored by 耿迪迪's avatar 耿迪迪

交易中心-借贷-采购 修改

parent 62d51c1b
......@@ -120,6 +120,8 @@ public class TPurchase extends BaseEntity
private String purchaseType;
private String handledByUserName;
public void setPurchaseId(Long purchaseId)
{
this.purchaseId = purchaseId;
......@@ -288,6 +290,14 @@ public class TPurchase extends BaseEntity
this.purchaseType = purchaseType;
}
public String getHandledByUserName() {
return handledByUserName;
}
public void setHandledByUserName(String handledByUserName) {
this.handledByUserName = handledByUserName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
......@@ -29,6 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="userName" column="user_name" />
<result property="approvedUserName" column="approved_user_name"/>
<result property="purchaseDeptManagerName" column="purchase_dept_manager_name"/>
<result property="handledByUserName" column="handled_by_user_name"/>
</resultMap>
......@@ -56,7 +57,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
p.approved_time,
(SELECT t1.nick_name FROM sys_user t1 WHERE t1.user_id = p.user_id) user_name,
(SELECT t1.nick_name FROM sys_user t1 WHERE t1.user_id = p.approved_user_id) approved_user_name,
(SELECT t1.nick_name FROM sys_user t1 WHERE t1.user_id = p.purchase_dept_manager_id) purchase_dept_manager_name
(SELECT t1.nick_name FROM sys_user t1 WHERE t1.user_id = p.purchase_dept_manager_id) purchase_dept_manager_name,
(SELECT t1.nick_name FROM sys_user t1 WHERE t1.user_id = t.handled_by_user_id) handled_by_user_name
FROM
t_purchase p
</sql>
......@@ -65,6 +67,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,
(SELECT t1.nick_name FROM sys_user t1 WHERE t1.user_id = t.handled_by_user_id) handled_by_user_name,
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
......
......@@ -169,7 +169,7 @@
handleRemove(file, fileList) {
console.log("列表移除", file, fileList);
this.addShow = fileList.length > 0 ? true : false;
this.$emit("remove", fileList);
this.$emit("remove", file);
},
handleFileClick(file, fileList) {
this.dialogImageUrl = file.response ? file.response.url : file.url;
......
......@@ -107,12 +107,13 @@
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-edit"-->
<!-- @click="details(scope.row)"-->
<!-- >修改</el-button>-->
<el-button
v-if="(scope.row.approvalStatus == '1' || scope.row.approvalStatus == '3') && scope.row.handledByUserId == $store.state.user.userId"
size="mini"
type="text"
icon="el-icon-edit"
@click="editFor(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
......@@ -258,6 +259,81 @@
</el-dialog>
<!-- 借支修改 -->
<el-dialog :title="title" :visible.sync="editOpen" width="800px" :close-on-click-modal="false" destroy-on-close>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row>
<el-col :span="12">
<el-form-item label="费用名称" prop="feeName">
<el-input v-model="form.feeName" placeholder="请输入费用名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="使用人" prop="userId">
<el-select v-model="form.userId" placeholder="请选择使用人" style="width: 100%">
<el-option v-for="item in transactorList"
:key="item.userId"
:label="item.nickName"
:value="item.userId"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="小写合计" prop="totalFigures">
<el-input v-model="form.totalFigures" placeholder="请输入小写合计" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="用途说明" prop="applicationDescription">
<el-input v-model="form.applicationDescription" type="textarea" placeholder="请输入用途说明" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
</el-form-item>
<el-form-item label="附件" prop="attachmentUrl">
<FileUpload
listType="picture"
@resFun="getFileInfo"
@remove="listRemove"
:fileArr="fileList"
:fileSize="500"
:fileType="[
'png',
'jpg',
'jpeg',
'mp4',
'doc',
'xls',
'ppt',
'txt',
'pdf',
]"
/>
<el-input
v-show="false"
disabled
v-model="form.attachmentUrl"
></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer" style="text-align: center" >
<el-button type="primary" style="width: 150px" @click="editSubmitForm()"
>提交申请</el-button
>
<el-button style="width: 150px; border-color: #1890ff; color: #1890ff" @click="cancel">取 消</el-button>
</div>
</el-dialog>
<!-- 审批 -->
<el-dialog :title="title" :visible.sync="open" width="800px" :close-on-click-modal="false" destroy-on-close>
<!-- <el-form ref="form" :model="form" :rules="rules" label-width="100px">-->
......@@ -523,6 +599,7 @@ import Treeselect from "@riophae/vue-treeselect";
import { treeselect } from "@/api/system/dept";
import FileUpload from "@/components/FileUpload";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import uploadfile from "@/assets/uploadfile.png";
export default {
name: "For",
components: {
......@@ -590,6 +667,7 @@ export default {
formDeptOptions: [],
transactorList: [],
fileList: [],
editOpen: false
};
},
......@@ -714,6 +792,42 @@ export default {
this.inser = true;
this.title = "借支申请";
},
editFor(row) {
this.fileList = [];
this.reset();
const borrowing = row.borrowing || this.ids
getFor(borrowing).then(response => {
this.form = response.data;
this.editOpen = true;
this.title = "借支修改";
if(this.form.attachmentUrl){
let nameSplit = this.form.attachmentUrl.split("/");
this.fileList = [
{
name: nameSplit[nameSplit.length -1],
url: uploadfile,
},
];
}
});
treeselect().then((response) => {
this.formDeptOptions = response.data;
// 申请服务时买方不能选自己部门
var items = this.formDeptOptions[0].children;
var result = [];
var j=0;
for(var i=0; i<items.length; i++){
if(items[i].id != this.$store.state.user.deptId){
result[j] = items[i];
j++;
}
}
this.formDeptOptions[0].children = result;
});
},
/**详情*/
details(row){
this.reset();
......@@ -823,6 +937,17 @@ export default {
}
});
},
editSubmitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
updateFor(this.form).then(response => {
this.msgSuccess("修改成功");
this.editOpen = false;
this.getList();
});
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const borrowings = row.borrowing || this.ids;
......
......@@ -124,6 +124,7 @@
<!-- <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"/>
<el-table-column label="经办人" align="center" prop="handledByUserName"/>
<el-table-column label="使用人" align="center" prop="userName" />
<el-table-column label="单价" align="center" prop="price" />
<el-table-column label="数量" align="center" prop="count" />
......@@ -149,13 +150,14 @@
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="220">
<template slot-scope="scope">
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-edit"-->
<!-- @click="handleUpdate(scope.row)"-->
<!-- v-hasPermi="['system:purchase:edit']"-->
<!-- >修改</el-button>-->
<el-button
v-if="(scope.row.purchaseStatus == '0' || scope.row.purchaseStatus == '3') && scope.row.handledByUserId == $store.state.user.userId"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:purchase:edit']"
>修改</el-button>
<OperatorButton
operatorName="purchaseDetail"
:purchaseInfo="scope.row"
......
......@@ -98,6 +98,7 @@
<el-table-column label="金额" align="center" prop="total" />
<el-table-column label="用途" align="center" prop="applicationDescription" :show-overflow-tooltip="true"/>
<el-table-column label="报销人" align="center" prop="userName" />
<el-table-column label="经办人" align="center" prop="handledByUserName"/>
<el-table-column label="申请时间" align="center" prop="createTime" width="150">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
......@@ -118,13 +119,14 @@
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="220">
<template slot-scope="scope">
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-edit"-->
<!-- @click="handleUpdate(scope.row)"-->
<!-- v-hasPermi="['system:purchase:edit']"-->
<!-- >修改</el-button>-->
<el-button
v-if="(scope.row.purchaseStatus == '0' || scope.row.purchaseStatus == '3') && scope.row.handledByUserId == $store.state.user.userId"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:purchase:edit']"
>修改</el-button>
<OperatorButton
operatorName="purchaseDetail"
:purchaseInfo="scope.row"
......
......@@ -56,15 +56,15 @@
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<!-- <el-button-->
<!-- v-if="scope.row.tradeStatus == '0' || scope.row.tradeStatus == '4'"-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-edit"-->
<!-- @click="handleUpdate(scope.row)"-->
<!-- v-hasPermi="['system:project:edit']"-->
<!-- >修改</el-button-->
<!-- >-->
<el-button
v-if="(scope.row.tradeStatus == '0' || scope.row.tradeStatus == '4') && scope.row.applyId == $store.state.user.userId"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:project:edit']"
>修改</el-button
>
<OperatorButton
operatorName="tradeDetail"
:tradeInfo="scope.row"
......
......@@ -203,6 +203,7 @@
append-to-body
:close-on-click-modal="false"
destroy-on-close
:before-close="beforeCloseDialog"
>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
......@@ -437,6 +438,7 @@ export default {
tab: "0",
transactionOptions: [],
transactorList: [],
count: 0
};
},
created() {
......@@ -530,13 +532,40 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.count = 0;
const tradeId = row.tradeId || this.ids;
getProject(tradeId).then((response) => {
this.form = response.data;
this.priceTypeInfo(this.form.relationTransactionProjectId);
if(this.form.attachmentUrl){
let attachmentUrl = JSON.parse(this.form.attachmentUrl);
if(attachmentUrl.length > 0){
attachmentUrl.forEach(item =>{
let nameSplit = item.url.split("/");
let name = nameSplit[nameSplit.length-1];
this.fileList.push({name:item.name?item.name:name, url:uploadfile})
})
}
}
this.open = true;
this.title = "修改交易项目";
});
},
beforeCloseDialog(){
this.count = 0;
this.open = false;
},
priceTypeInfo(val){
let transactionProject = this.transactionProjects.find(
(item) => item.transactionProjectId == val
);
if (transactionProject.priceType == "1") {
this.priceType = "1";
this.form.tradePrice = transactionProject.price;
} else {
this.priceType = transactionProject.priceType;
}
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
......@@ -670,25 +699,43 @@ export default {
);
},
getFileInfo(res) {
if(!this.form.attachmentUrl){
let param = [];
if(res.length >0){
res.forEach(item =>{
param.push({url: item.url})
param.push({url: item.url,name:item.name});
this.fileList.push({url:uploadfile,name:item.name});
})
}
this.form.attachmentUrl = JSON.stringify(param);
//this.fileList = res;
return
}
let attachmentUrlList = JSON.parse(this.form.attachmentUrl);
if(res.length >0){
res.forEach(item =>{
attachmentUrlList.push({url: item.url,name:item.name});
this.fileList.push({url:uploadfile,name:item.name});
})
}
this.form.attachmentUrl = JSON.stringify(attachmentUrlList);
},
listRemove(fileList) {
console.log("remove",fileList);
listRemove(file) {
//this.fileList = [];
let param = [];
if(fileList.length >0){
fileList.forEach(item =>{
param.push({url: item.url})
})
let index = this.fileList.findIndex(item => (item.name?item.name:item.url.split("/")[item.url.split("/").length -1]) == file.name);
if(index != -1){
this.fileList.splice(index,1);
}
this.form.attachmentUrl = JSON.stringify(param);
let attachmentUrlList = JSON.parse(this.form.attachmentUrl);
let listIndex = attachmentUrlList.findIndex(item => (item.name?item.name:item.url.split("/")[item.url.split("/").length -1]) == file.name);
if(listIndex != -1){
attachmentUrlList.splice(listIndex,1);
}
this.form.attachmentUrl = JSON.stringify(attachmentUrlList);
},
//切换tab
changeTab(tabNum) {
......@@ -713,11 +760,14 @@ export default {
this.relationTransactionProjectId = null;
},
getTransactor() {
if(this.count > 0){
this.form.tradeTransactor = null;
}
if (this.form.tradeDeptId && this.form.tradeDeptId != null) {
selectTransactorByDeptId({ deptId: this.form.tradeDeptId }).then(
(res) => {
this.transactorList = res.data;
this.count++;
}
);
}
......
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