Commit 01e9384f authored by 柳 佳乐's avatar 柳 佳乐
Browse files

202211201

parent 979e03ac
......@@ -275,16 +275,12 @@ export default {
}
},
methods: {
// closeDrawer() {
// this.$emit('closeDrawer')
// },
getParentContractList() {
const params = {
companyId: this.companyId || this.$store.getters.companyId
}
selectAllContractList(params).then(res => {
if (res.success) {
// console.log(res.data)
this.contractParentList = res.data
} else {
this.$message.warning("获取合同类型失败")
......@@ -292,12 +288,6 @@ export default {
})
},
addContract() {
// let validRes = this.validFormData()
// if (validRes.length) {
// this.$message.warning("带 * 号必填,请正确填写信息")
// return
// }
this.$refs.form.validate((valid) => {
if (valid) {
if (this.formData.contractStartTime > this.formData.contractEndTime) {
......@@ -366,7 +356,6 @@ export default {
}
selectAllContractTypeList(params).then(res => {
if (res.success) {
// console.log(res.data)
this.contractTypeList = res.data
} else {
this.$message.warning("获取合同类型失败")
......@@ -380,7 +369,6 @@ export default {
}
getContractById(params).then(res => {
if (res.success) {
// console.log(res.data)
if (res.data.contractNature.toString() === '2') {
this.getParentContractList()
}
......
......@@ -85,19 +85,16 @@
<el-button @click="dialogTableVisible = false">取消</el-button>
</span>
</el-dialog>
<!-- <add-conctract :drawerVisible="drawerVisible" @addConctract="addConctract" @closeDrawer="drawerVisible=false"></add-conctract> -->
</div>
</template>
<script>
// import AddConctract from './components/addContract.vue'
import { selectContractList, selectAllContractTypeList } from "@/api/contract"
import { deepClone } from "@/utils"
import { mapGetters } from 'vuex'
import { contractNatures as contractNatureList } from './contractStaticData'
export default {
// components: {
// AddConctract
// },
computed: {
...mapGetters([
'companyId'
......@@ -139,7 +136,6 @@ export default {
}
selectAllContractTypeList(params).then(res => {
if (res.success) {
// console.log(res.data)
this.contractTypeList = res.data
} else {
this.$message.warning("获取合同类型失败")
......@@ -171,9 +167,6 @@ export default {
}
})
},
addConctract(params) {
console.log(params)
}
}
}
</script>
......
......@@ -27,8 +27,8 @@ export default {
},
parentFn(val) {
console.log(val);
this.activeName=val;
this.$refs.eaxmine.getincomeSelectlist()
}
}
};
......
......@@ -80,13 +80,22 @@
将文件拖到此处,或
<em>点击上传</em>
</div>
<div class="el-upload__tip" slot="tip">只能上传jpg/png/pdf文件,且不超过500kb</div>
<div class="el-upload__tip" slot="tip">
只能上传jpg/png/pdf文件,且不超过500kb
</div>
</el-upload>
</el-form-item>
<el-form-item>
<el-col>
<el-button type="success" icon="el-icon-folder-checked" @click="getlistForm()">立即创建</el-button>
<el-button type="info" icon="el-icon-refresh" @click="delectdd">重置信息</el-button>
<el-button
type="success"
icon="el-icon-folder-checked"
@click="getlistForm()"
>立即创建</el-button
>
<el-button type="info" icon="el-icon-refresh" @click="delectdd"
>重置信息</el-button
>
</el-col>
</el-form-item>
</el-form>
......@@ -104,7 +113,7 @@ import {
addRecordRules as rules,
categoryOptions,
typeOptions,
statusOptions
statusOptions,
} from "../expense";
export default {
created() {
......@@ -112,7 +121,7 @@ export default {
this.fileUploadHeader["X-Token"] = this.$store.getters.token;
},
computed: {
...mapGetters(["companyId", "urId"])
...mapGetters(["companyId", "urId"]),
},
data() {
return {
......@@ -125,7 +134,7 @@ export default {
number: null,
status: 0,
time: null,
type: null
type: null,
},
categoryOptions,
typeOptions,
......@@ -134,9 +143,8 @@ export default {
loading: false,
action: null,
fileUploadHeader: {
"X-Token": null
"X-Token": null,
},
dataValue: "first"
};
},
methods: {
......@@ -162,17 +170,11 @@ export default {
if (res.success) {
//发票提交
this.delectdd();
console.log("123456");
this.$emit("childFnGetParent", "first");
this.$message.success(res.msg);
} else {
this.loading = false;
this.$message.error(res.msg);
if (res.code == 4) {
//执行退出功能
this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}
}
this.isgetid = true;
},
......@@ -201,7 +203,7 @@ export default {
//发票提交页面的提交
getlistForm() {
if (this.fileTypeJpg == true) {
this.$refs.addTO.validate(valid => {
this.$refs.addTO.validate((valid) => {
if (valid) {
this.addTO.companyId = this.companyId;
this.addTO.userId = this.urId;
......@@ -215,9 +217,9 @@ export default {
//数据清除
delectdd() {
this.$refs.addTO.resetFields();
this.fileList = this.fileList.filter(item => item.uid !== file.uid);
}
}
this.fileList = this.fileList.filter((item) => item.uid !== file.uid);
},
},
};
</script>
......
......@@ -63,7 +63,6 @@
class="margin-top"
title="关于发票"
:column="1"
:size="medium"
style="width:60%; margin:20px 20px"
border
>
......@@ -201,7 +200,7 @@ export default {
return {
invoiceQruey: {
pageNum: 1,
pageSize: 10
pageSize: 1
},
invoicegetList: [],
categoryOptions,
......@@ -244,7 +243,6 @@ export default {
}
})
.catch(error => {
console.log(error);
this.$message.error("查询发票数据失败");
});
},
......@@ -301,15 +299,17 @@ export default {
message: "发票删除成功",
type: "success"
});
if(this.invoicegetList.length == 1 && this.invoiceQruey.pageNum != 1){
this.invoiceQruey.pageNum--
}
this.getincomeSelectlist();
} else {
this.$message.error(res.msg);
}
})
.catch(e => {
console.log(e.msg);
this.$message.error(e.msg);
this.$message.error("删除失败");
});
},
//点击查看发票
......
......@@ -168,7 +168,6 @@ export default {
this.loading = false;
});
} else {
console.log("error submit!!");
return false;
}
});
......
......@@ -233,7 +233,7 @@ export default {
if(res.success){
this.company = res.data
}else{
this.$message.error(res.data)
this.$message.error(res.msg)
}
}).catch((error)=>{
this.$message.error("获取公司名称失败")
......
......@@ -163,7 +163,7 @@ export default {
if(res.success){
this.company = res.data
}else{
this.$message.error(res.data)
this.$message.error(res.msg)
}
}).catch((error)=>{
this.$message.error("获取公司名称失败")
......
......@@ -141,12 +141,12 @@ export default {
message: '删除成功!'
})
} else {
this.$message.error(res.data)
this.$message.error(res.msg)
}
})
})
.catch(err => { console.error(err) })
.catch(err => { console.error(err) })
},
......@@ -189,7 +189,7 @@ export default {
} else {
this.$message({
type: 'error',
message: res.data
message: res.msg
})
}
}).catch(err => {
......@@ -224,7 +224,7 @@ export default {
} else {
this.$message({
type: 'error',
message: res.data
message: res.msg
})
}
......
......@@ -124,7 +124,7 @@ export default {
this.rolesList = res.data.list
this.total = res.data.total
} else {
this.$message.error(res.data)
this.$message.error(res.msg)
}
}).catch((error) => {
this.$message.error("查询数据失败")
......@@ -229,7 +229,7 @@ export default {
this.$message.success("删除成功")
this.rolesList.splice($index, 1)
} else {
this.$message.error(res.data)
this.$message.error(res.msg)
}
}).catch((error) => {
this.$message.error("删除失败")
......@@ -259,7 +259,7 @@ export default {
this.$message.success("修改成功")
this.getRoles()
} else {
this.$message.error(res.data)
this.$message.error(res.msg)
}
}).catch((error) => {
this.$message.error("修改失败")
......@@ -272,7 +272,7 @@ export default {
this.$message.success("添加成功")
this.getRoles()
} else {
this.$message.error(res.data)
this.$message.error(res.msg)
}
}).catch((error) => {
this.$message.error("添加失败")
......
......@@ -130,13 +130,13 @@ export default {
{required:true, validator:chinaIdentityValid, trigger:'blur'},
],
originalPassword:[
{ required: true, message: '请输入原密码', trigger: 'blur' },
{ required: true,validator:account_password_valid, trigger: 'blur' },
],
newPassword:[
{ required: true, message: '请输入新密码', trigger: 'blur' },
{ required: true, validator:account_password_valid, trigger: 'blur' },
],
confirmPassword:[
{ required: true, message: '请输入确认密码', trigger: 'blur' },
{ required: true,validator:account_password_valid, trigger: 'blur' },
]
}
}
......@@ -165,7 +165,7 @@ export default {
this.userData = res.data
this.backupsData = Object.assign({}, res.data)
}else{
this.$message.error(res.data)
this.$message.error(res.msg)
}
}).catch((error)=>{
this.$message.error("获取个人信息失败")
......@@ -181,7 +181,7 @@ export default {
this.getUser()
this.userupdata = true
}else{
this.$message.error(res.data)
this.$message.error(res.msg)
}
}).catch((error)=>{
this.$message.error("修改失败")
......@@ -212,7 +212,7 @@ export default {
this.$router.push('/login')
})
}else{
this.$message.error(res.data)
this.$message.error(res.msg)
}
}).catch((error)=>{
this.$message.error("修改失败")
......
......@@ -112,11 +112,11 @@ export default {
// console.log(1)
},
methods: {
// back(){
// this.$store.dispatch("tagsView/delView", this.$route);
// this.$router.back();
back(){
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.back();
// },
},
addPettyMoneyRecord() {
this.$refs.form.validate(valida => {
......
......@@ -132,7 +132,7 @@ export default {
pettyMoneyQuery: {},
isConditionSelect: false,
pettyMoneyPageQuery: {
pageSize: 10,
pageSize: 7,
pageNum: 1,
total: 0
},
......@@ -151,10 +151,13 @@ export default {
},
methods: {
checkRepayMoney(rule, value, callback) {
let RegExp = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^0-9]\.[0-9]([0-9])?$)/;
// console.log(1)
if (value === null || value === undefined || value === '') {
callback(new Error('还款金额不能为空'));
} else if (parseFloat(value) <= 0) {
}else if(!RegExp.test(value)){
callback(new Error("金额格式错误"));
}else if (parseFloat(value) <= 0) {
callback(new Error('请输入大于0的金额'));
} else if (value > this.checkedRow.pettySurplus) {
callback(new Error('超出应还款金额'));
......
......@@ -3,7 +3,12 @@
<div class="container">
<el-row :gutter="20">
<el-col :xl="8" :lg="10" :md="8" :sm="12" :xs="24">
<el-form ref="form" :model="expendFrom" label-width="120px" :rules="rules">
<el-form
ref="form"
:model="expendFrom"
label-width="120px"
:rules="rules"
>
<el-form-item label="项目名称" prop="projectName">
<el-input v-model="expendFrom.projectName" disabled></el-input>
</el-form-item>
......@@ -71,15 +76,17 @@
</el-col>
<!-- 附件上传 -->
<el-col :xl="8" :lg="10" :md="8" :sm="12" :xs="24" class="contract">
<el-button type="primary" @click="dialogFormVisible = true">上传附件</el-button>
<el-button type="primary" @click="dialogFormVisible = true"
>上传附件</el-button
>
<el-dialog title="附件" :visible.sync="dialogFormVisible" width="55%">
<div style="width:60%;margin-left:30px">
<div style="width: 60%; margin-left: 30px">
<el-input
type="textarea"
:rows="2"
placeholder="请输入附件详情"
v-model="proutlist1.enclosureDescribe"
style="margin:20px 0px;"
style="margin: 20px 0px"
></el-input>
<el-upload
class="upload-demo"
......@@ -91,32 +98,40 @@
:auto-upload="false"
:on-change="onChangepdf"
:data="proutlist1"
:on-success="fileSuccess"
multiple
style="margin:20px 0px;"
style="margin: 20px 0px"
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">
将文件拖到此处,或
<em>点击上传附件</em>
</div>
<div class="el-upload__tip" slot="tip">只能上传jpd文件,且不超过500kb</div>
<div class="el-upload__tip" slot="tip">
只能上传jpd文件,且不超过500kb
</div>
</el-upload>
</div>
<div style="margin-left:75%;">
<div style="margin-left: 75%">
<el-button @click="remove()">取 消</el-button>
<el-button
type="primary"
@click="dialogFormVisible = false"
style="margin-top:20px;"
>确 定</el-button>
style="margin-top: 20px"
>确 定</el-button
>
</div>
</el-dialog>
</el-col>
<!-- 按钮区域 -->
<el-col :span="24" style="margin-left:120px;">
<el-col :span="24" style="margin-left: 120px">
<!-- <el-form-item> -->
<el-button type="success" icon="el-icon-upload2" @click="submitForm()">提交</el-button>
<el-button type="info" icon="el-icon-refresh-left" @click="resetForm()">重置信息</el-button>
<el-button type="success" icon="el-icon-upload2" @click="submitForm()"
>提交</el-button
>
<el-button type="info" icon="el-icon-refresh-left" @click="resetForm()"
>重置信息</el-button
>
<el-button @click="back()">返回</el-button>
<!-- </el-form-item> -->
</el-col>
......@@ -128,7 +143,7 @@
import {
selectByProjectId,
selectAllBystatus,
updatesubmit
updatesubmit,
} from "@/api/project";
import { selectAll } from "@/api/type";
import { insert } from "@/api/expend";
......@@ -149,7 +164,7 @@ export default {
expendType: null,
projectId: null,
userId: null,
projectName: null
projectName: null,
},
typeList: [],
projectData: {},
......@@ -166,7 +181,7 @@ export default {
getinvoiveId: {
userId: null,
companyId: null,
type: 1
type: 1,
},
pageNum: 10,
total: 1,
......@@ -175,34 +190,36 @@ export default {
//保存图片
proutlist: {
Id: null,
status: 1
status: 1,
},
//保存合同
//保存支出附件
proutlist1: {
Id: null,
enclosureDescribe: "",
status: 1, //0收入 1支出
companyId: null,
userId: null
userId: null,
"X-Token": null,
},
fileType: null,
fileTypepdf: false,
backlistid: null,
fileTypeJpg: null,
//附件
dialogFormVisible: false
dialogFormVisible: false,
};
},
computed: {
projectId() {
return this.$route.query.id;
}
},
},
created() {
this.expendFrom.userId = this.$store.getters.urId;
this.getinvoiveId.companyId = this.$store.getters.companyId;
this.getinvoiveId.userId = this.$store.getters.urId;
this.action2 = process.env.VUE_APP_BASE_API + "/file/updataEnclosures";
this.proutlist1["X-Token"] = this.$store.getters.token;
this.proutlist1.userId = this.$store.getters.urId;
this.proutlist1.companyId = this.$store.getters.companyId;
this.backlistid = this.$route.query.backlistid;
......@@ -215,10 +232,10 @@ export default {
getTypeList() {
let param = {
companyId: this.$store.getters.companyId,
typeCategory: 1
typeCategory: 1,
};
selectAll(param)
.then(res => {
.then((res) => {
if (res.success) {
this.typeList = res.data;
} else {
......@@ -226,7 +243,7 @@ export default {
this.back();
}
})
.catch(error => {
.catch((error) => {
this.$message.error("获取类型失败");
this.back();
});
......@@ -234,10 +251,10 @@ export default {
//获取项目
getProject() {
let param = {
projectId: this.projectId
projectId: this.projectId,
};
selectByProjectId(param)
.then(res => {
.then((res) => {
if (res.success) {
this.projectData = res.data;
this.expendFrom.projectName = res.data.projectName;
......@@ -247,39 +264,36 @@ export default {
this.back();
}
})
.catch(error => {
.catch((error) => {
this.$message.error("获取项目失败");
this.back();
});
},
//提交
submitForm() {
this.$refs.form.validate(valid => {
this.$refs.form.validate((valid) => {
if (valid) {
insert(this.expendFrom)
.then(res => {
.then((res) => {
if (res.success) {
this.$message.success(res.msg);
console.log(this.fileTypepdf);
if (this.fileTypepdf) {
//进行合同的上传
//上传合同
//进行支出附件的上传
//上传支出附件
this.proutlist1.Id = res.data;
console.log(this.proutlist1.Id);
this.$refs.upload1.submit();
}
if (this.invoiceListAdd.length > 0) {
let list = [];
this.invoiceListAdd.forEach(item => {
this.invoiceListAdd.forEach((item) => {
list.push({
invoiceId: item,
expendId: res.data,
status: 1
status: 1,
});
});
//上传发票记录
updatesubmit(list).then(res => {
updatesubmit(list).then((res) => {
if (res.success) {
this.$message.success(res.msg);
this.back();
......@@ -294,7 +308,7 @@ export default {
this.$message.error(res.msg);
}
})
.catch(error => {
.catch((error) => {
this.$message.error("新建失败");
});
}
......@@ -313,8 +327,8 @@ export default {
path: "/expendList",
query: {
id: this.$route.query.id,
backlistid: this.$route.query.backlistid
}
backlistid: this.$route.query.backlistid,
},
});
},
//时间处理 yyyy-MM-dd hh:mm:ss
......@@ -336,7 +350,7 @@ export default {
date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
this.expendFrom.expendTime = Y + M + D + h + m + s;
},
//合同图片
//支出附件图片
onChangepdf(file) {
const fileNamepdf = file.name;
let fileType = fileNamepdf.substring(fileNamepdf.lastIndexOf("."));
......@@ -349,16 +363,24 @@ export default {
}
console.log(this.fileTypepdf);
},
//清楚合同文件
delfile1() {
//清楚支出附件文件
delfile1(file) {
this.fileTypepdf = false;
this.fileList1 = this.fileList1.filter(item => item.uid !== file.uid);
this.fileList1 = this.fileList1.filter((item) => item.uid !== file.uid);
},
//文件上传成功
fileSuccess(res) {
if (res.success) {
this.$message.success(res.msg);
} else {
this.$message.error(res.msg);
}
},
//////发票区域//////
//查询发票编号
Selectinsertlsit() {
selectAllBystatus(this.getinvoiveId)
.then(res => {
.then((res) => {
if (res.success) {
this.getinvoivelist = res.data;
} else {
......@@ -366,7 +388,7 @@ export default {
this.back();
}
})
.catch(error => {
.catch((error) => {
this.$message.error("获取发票编号失败");
this.back();
});
......@@ -374,28 +396,28 @@ export default {
//取消
remove() {
this.proutlist1.enclosureDescribe = null;
this.fileList1 = this.fileList1.filter(item => item.uid !== file.uid);
this.fileList1 = this.fileList1.filter((item) => item.uid !== file.uid);
this.dialogFormVisible = false;
},
//添加发票金额
getchange() {
let sum = 0;
let list = [];
this.invoiceListAdd.forEach(g => {
this.getinvoivelist.forEach(item => {
this.invoiceListAdd.forEach((g) => {
this.getinvoivelist.forEach((item) => {
if (item.invoiceId == g) {
list.push({
mone: item.mone
mone: item.mone,
});
}
});
});
list.forEach(item => {
list.forEach((item) => {
sum += item.mone;
});
this.expendFrom.expendMoney = sum;
}
}
},
},
};
</script>
......
......@@ -3,7 +3,10 @@
<div class="header">
<el-form :inline="true" :model="expendQurey">
<el-form-item label="支出对象">
<el-input v-model="expendQurey.expendObject" placeholder="收入对象"></el-input>
<el-input
v-model="expendQurey.expendObject"
placeholder="收入对象"
></el-input>
</el-form-item>
<el-form-item label="支出类别">
<el-select v-model="expendQurey.expendType">
......@@ -17,7 +20,10 @@
</el-form-item>
<el-form-item label="支出内容">
<el-input v-model="expendQurey.expendBody" placeholder="收入内容"></el-input>
<el-input
v-model="expendQurey.expendBody"
placeholder="收入内容"
></el-input>
</el-form-item>
<el-form-item label="支出时间">
......@@ -31,14 +37,22 @@
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="qurey()">查询</el-button>
<el-button type="primary" icon="el-icon-refresh-right" @click="reset()">重置</el-button>
<el-button type="primary" icon="el-icon-search" @click="qurey()"
>查询</el-button
>
<el-button
type="primary"
icon="el-icon-refresh-right"
@click="reset()"
>重置</el-button
>
<el-button
type="success"
icon="el-icon-circle-plus-outline"
@click="addexpend()"
v-if="state != 0"
>新增支出</el-button>
>新增支出</el-button
>
<el-button @click="back()">返回</el-button>
</el-form-item>
</el-form>
......@@ -49,8 +63,8 @@
:data="expendList"
style="width: 100%; text-align: center"
border
:cell-style="{'text-align':'center'}"
:header-cell-style="{'text-align':'center'}"
:cell-style="{ 'text-align': 'center' }"
:header-cell-style="{ 'text-align': 'center' }"
>
<el-table-column type="expand">
<template slot-scope="props">
......@@ -58,20 +72,30 @@
class="margin-top"
title="关于项目"
:column="1"
style="width:40%; margin:20px 20px"
style="width: 40%; margin: 20px 20px"
border
>
<el-descriptions-item label="收入附言:">
<el-descriptions-item label="支出备注:">
<span>{{ props.row.expendRemarks }}</span>
</el-descriptions-item>
<el-descriptions-item label="收入详情:">
<el-descriptions-item label="支出详情:">
<span>{{ props.row.expendInformation }}</span>
</el-descriptions-item>
<el-descriptions-item label="发票文件:">
<el-button type="primary" size="mini" @click="ReviseImage(props.row)">点击查看</el-button>
<el-button
type="primary"
size="mini"
@click="ReviseImage(props.row)"
>点击查看</el-button
>
</el-descriptions-item>
<el-descriptions-item label="附件下载">
<el-button type="success" size="mini" @click="selectImage(props.row)">点击查看</el-button>
<el-button
type="success"
size="mini"
@click="selectImage(props.row)"
>点击查看</el-button
>
</el-descriptions-item>
</el-descriptions>
</template>
......@@ -79,9 +103,9 @@
<el-table-column label="序号" width="50px">
<template slot-scope="scope">
{{
(expendQurey.pageNum - 1) * expendQurey.pageSize +
scope.$index +
1
(expendQurey.pageNum - 1) * expendQurey.pageSize +
scope.$index +
1
}}
</template>
</el-table-column>
......@@ -102,7 +126,12 @@
<el-tag effect="plain">{{ scope.row.userName }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="projectAmount" label="操作" v-if="state != 0" width="120px">
<el-table-column
prop="projectAmount"
label="操作"
v-if="state != 0"
width="120px"
>
<template slot-scope="scope">
<el-button
style="margin: 5px"
......@@ -110,7 +139,8 @@
icon="el-icon-edit"
type="info"
@click="updatain(scope.row)"
>修改信息</el-button>
>修改信息</el-button
>
</template>
</el-table-column>
</el-table>
......@@ -127,39 +157,62 @@
</div>
<!-- 附件抽屉 -->
<div>
<el-drawer title="附件操作" :visible.sync="drawer2" :direction="direction" size="50%">
<el-drawer
title="附件操作"
:visible.sync="drawer2"
:direction="direction"
size="50%"
>
<el-button
type="primary"
style=" margin-left:5%;margin-top:40px "
style="margin-left: 5%; margin-top: 40px"
:disabled="disabled"
@click="updatecard"
>添加附件</el-button>
>添加附件</el-button
>
<el-card
class="box-card"
style="width:90%; margin-left:5%; margin-top:20px"
v-show="getshow==1"
style="width: 90%; margin-left: 5%; margin-top: 20px"
v-show="getshow == 1"
>
<el-row class="row-bg">
<div v-for="index in queryDTOList" :key="index.enclosureId" class="lsitall">
<div
v-for="index in queryDTOList"
:key="index.enclosureId"
class="lsitall"
>
<el-col :span="10">
<div style=" margin-top: 6px;margin-left:40px">附件{{index.enclosureId}}</div>
<div style="margin-top: 6px; margin-left: 40px">
附件{{ index.enclosureId }}
</div>
</el-col>
<el-col :span="12" style="margin-left:-50px">
<el-col :span="12" style="margin-left: -50px">
<el-button
type="primary"
icon="el-icon-folder-checked"
class="a-style"
size="mini"
style=" font-size: 13px"
style="font-size: 13px"
@click="delProject(index)"
>下载</el-button>
>下载</el-button
>
<el-popover placement="top" width="160" v-model="index.visible">
<p>确定要删除此条附件吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="index.visible = false">取消</el-button>
<el-button type="primary" size="mini" @click="deleteProject(index)">确定</el-button>
<el-button
size="mini"
type="text"
@click="index.visible = false"
>取消</el-button
>
<el-button
type="primary"
size="mini"
@click="deleteProject(index)"
>确定</el-button
>
</div>
<el-button
type="danger"
......@@ -168,7 +221,8 @@
size="mini "
style="font-size: 13px"
slot="reference"
>删除</el-button>
>删除</el-button
>
</el-popover>
</el-col>
</div>
......@@ -177,16 +231,16 @@
<!-- 附件上传 -->
<el-card
class="box-card"
style="width:90%; margin-left:5%; margin-top:20px"
v-show="getshow==0"
style="width: 90%; margin-left: 5%; margin-top: 20px"
v-show="getshow == 0"
>
<div style="width:60%;margin-left:30px">
<div style="width: 60%; margin-left: 30px">
<el-input
type="textarea"
:rows="2"
placeholder="请输入附件详情"
v-model="proutlist1.enclosureDescribe"
style="margin:20px 0px;"
style="margin: 20px 0px"
></el-input>
<el-upload
class="upload-demo"
......@@ -200,34 +254,52 @@
:on-success="Refresh"
:data="proutlist1"
multiple
style="margin:20px 0px;"
style="margin: 20px 0px"
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">
将文件拖到此处,或
<em>点击上传附件</em>
</div>
<div class="el-upload__tip" slot="tip">只能上传文件,且不超过500kb</div>
<div class="el-upload__tip" slot="tip">
只能上传文件,且不超过500kb
</div>
</el-upload>
</div>
<div style="margin-left:75%;">
<div style="margin-left: 75%">
<el-button @click="remove()">取 消</el-button>
<el-button type="primary" @click="determine()" style="margin-top:20px;">确 定</el-button>
<el-button
type="primary"
@click="determine()"
style="margin-top: 20px"
>确 定</el-button
>
</div>
</el-card>
<div class="box-card" v-show="getshow==3"></div>
<div class="box-card" v-show="getshow == 3">
<el-empty description="还没有添加附件哦"></el-empty>
</div>
</el-drawer>
</div>
<div>
<!--抽屉-->
<el-drawer title="发票详情" :visible.sync="drawer" :direction="direction" size="50%">
<el-drawer
title="发票详情"
:visible.sync="drawer"
:direction="direction"
size="50%"
>
<el-table
:data="getinvoivelist"
style="width: 90%; margin:10px 5%; text-align: center"
style="width: 90%; margin: 10px 5%; text-align: center"
border
>
<el-table-column type="index" label="序号" width="80"></el-table-column>
<el-table-column
type="index"
label="序号"
width="80"
></el-table-column>
<el-table-column prop="code" label="发票代码"></el-table-column>
<el-table-column prop="number" label="号码"></el-table-column>
<el-table-column prop="mone" label="金额"></el-table-column>
......@@ -241,7 +313,9 @@
></el-image>
</div>
<div v-else>
<a class="a-style" @click="handlePreView(scope.row)">点击查看文件</a>
<a class="a-style" @click="handlePreView(scope.row)"
>点击查看文件</a
>
</div>
</template>
</el-table-column>
......@@ -254,14 +328,7 @@
<script>
import { selectAll } from "@/api/type";
import { selectByProjectId } from "@/api/expend";
import {
selectAllById,
selectByIdF,
selectAllBystatus,
updatesubmit,
deletBystatus,
deleteById
} from "@/api/project";
import { selectAllById, selectByIdF, deleteById } from "@/api/project";
import { getFileUrl } from "@/api/companyFile";
export default {
data() {
......@@ -275,7 +342,7 @@ export default {
expendType: null,
expendBody: null,
expendTimeStart: null,
expendTimeEnd: null
expendTimeEnd: null,
},
expendList: [],
options: [],
......@@ -287,7 +354,7 @@ export default {
//查询图片给的值
getinvoiveId: {
companyId: null,
expendId: 0
expendId: 0,
},
//图片的数组
getinvoivelist: [],
......@@ -298,7 +365,7 @@ export default {
// //查询附件
queryDTO: {
companyId: null,
expendId: null
expendId: null,
},
//附件抽屉
drawer2: false,
......@@ -312,17 +379,18 @@ export default {
enclosureDescribe: "",
status: 1, //0收入 1支出
companyId: null,
userId: null
userId: null,
"X-Token": null,
},
fileTypepdf: false, //判断合同文件是否存在
fileList1: [], //合同文件
disabled: false //隐藏
disabled: false, //隐藏
};
},
computed: {
state: function() {
state: function () {
return this.$route.query.state;
}
},
},
created() {
this.getinvoiveId.companyId = this.$store.getters.companyId;
......@@ -330,8 +398,8 @@ export default {
this.backlistid = this.$route.query.backlistid;
this.queryDTO.companyId = this.$store.getters.companyId;
this.action1 = process.env.VUE_APP_BASE_API + "/file/updataEnclosures";
this.proutlist1.userId = this.$store.getters.urId;
this.proutlist1.companyId = this.$store.getters.companyId;
this.proutlist1["X-Token"] = this.$store.getters.token;
this.getexpend();
this.getTypeList();
},
......@@ -339,7 +407,7 @@ export default {
//获取支出情况
getexpend() {
selectByProjectId(this.expendQurey)
.then(res => {
.then((res) => {
if (res.success) {
this.expendList = res.data.list;
this.total = res.data.total;
......@@ -347,7 +415,7 @@ export default {
this.$message.errror(res.msg);
}
})
.catch(error => {
.catch((error) => {
this.$message.error("查询数据失败");
});
},
......@@ -355,10 +423,10 @@ export default {
getTypeList() {
let param = {
companyId: this.$store.getters.companyId,
typeCategory: 1
typeCategory: 1,
};
selectAll(param)
.then(res => {
.then((res) => {
if (res.success) {
this.options = res.data;
} else {
......@@ -366,7 +434,7 @@ export default {
this.back();
}
})
.catch(error => {
.catch((error) => {
this.$message.error("获取类型失败");
this.back();
});
......@@ -374,6 +442,7 @@ export default {
//换页
handleCurrentChange(val) {
this.expendQurey.pageNum = val;
this.getexpend()
},
//新增支出信息
addexpend() {
......@@ -381,8 +450,8 @@ export default {
path: "/expendAdd",
query: {
id: this.$route.query.id,
backlistid: this.backlistid
}
backlistid: this.backlistid,
},
});
},
//修改支出信息
......@@ -392,8 +461,8 @@ export default {
query: {
id: data.expendId,
projectId: this.$route.query.id,
backlistid: this.backlistid
}
backlistid: this.backlistid,
},
});
},
//时间处理
......@@ -426,7 +495,7 @@ export default {
},
//下载附件
delProject(row) {
getFileUrl(row.enclosureFile).then(res => {
getFileUrl(row.enclosureFile).then((res) => {
if (res.success) {
let url = res.data;
console.log(url);
......@@ -467,14 +536,14 @@ export default {
//查询发票图片
Selectinsertlsit() {
selectAllById(this.getinvoiveId)
.then(res => {
.then((res) => {
if (res.success) {
res.data.forEach(e => {
res.data.forEach((e) => {
let fileNamepdf = e.filePath;
let fileType = fileNamepdf.substring(
fileNamepdf.lastIndexOf(".")
);
getFileUrl(e.filePath).then(res => {
getFileUrl(e.filePath).then((res) => {
if (res.success) {
let url = res.data;
e.fileUrl = url;
......@@ -491,7 +560,7 @@ export default {
//this.back();
}
})
.catch(error => {
.catch((error) => {
console.log(error);
this.$message.error("获取发票图片失败");
//this.back();
......@@ -502,22 +571,22 @@ export default {
this.$router.push({
path: "/projectList",
query: {
id: this.$route.query.id
}
id: this.$route.query.id,
},
});
} else if (this.backlistid == 1) {
this.$router.push({
path: "/beresponsibleforList",
query: {
id: this.$route.query.id
}
id: this.$route.query.id,
},
});
} else {
this.$router.push({
path: "/participateinList",
query: {
id: this.$route.query.id
}
id: this.$route.query.id,
},
});
}
},
......@@ -531,7 +600,7 @@ export default {
this.queryDTO.expendId = row.expendId;
this.proutlist1.Id = row.expendId;
selectByIdF(this.queryDTO)
.then(res => {
.then((res) => {
if (res.success) {
this.queryDTOList = res.data;
if (this.queryDTOList.length > 0) {
......@@ -547,7 +616,7 @@ export default {
this.$message.error(res.msg);
}
})
.catch(error => {
.catch((error) => {
this.$message.error("获取附件文件失败");
});
},
......@@ -575,62 +644,67 @@ export default {
updatecard() {
this.getshow = 0;
this.disabled = true;
this.delfile1();
this.clearFile();
},
//删除附件
deleteProject(row) {
deleteById(row)
.then(res => {
.then((res) => {
if (res.success) {
this.selectImage(row);
this.$message({
message: "删除成功",
type: "success"
type: "success",
});
this.visible = false;
}
})
.catch(errror => {
.catch((errror) => {
this.$message.error(res.msg);
});
},
//清除附件文件
delfile1() {
this.fileList1 = this.fileList1.filter(item => item.uid !== file.uid);
delfile1(file) {
this.fileList1 = this.fileList1.filter((item) => item.uid !== file.uid);
this.fileTypepdf = false;
},
clearFile() {
this.fileList1 = [];
this.fileTypepdf = false;
},
//确定提交附件
determine() {
//判断是否有附件文件
if (this.fileTypepdf) {
this.proutlist1.userId = this.$store.getters.urId;
this.proutlist1.companyId = this.$store.getters.companyId;
this.$refs.upload1.submit();
this.getshow = 1;
this.disabled = false;
this.$message({
showClose: true,
message: "上传附件成功",
type: "success"
});
this.Refresh();
} else {
this.$message.error("请添加附件,在进行提交");
}
},
//刷新附件
Refresh() {
Refresh(res) {
this.queryDTO.expendId = this.proutlist1.Id;
selectByIdF(this.queryDTO)
.then(res => {
if (res.success) {
this.queryDTOList = res.data;
this.proutlist1.enclosureDescribe = ""; //初始化数据
} else {
this.$message.error(res.msg);
}
})
.catch(error => {
this.$message.error("获取附件文件失败");
});
this.getshow = 1;
this.disabled = false;
if (res.success) {
this.$message.success("上传附件成功");
selectByIdF(this.queryDTO)
.then((res) => {
if (res.success) {
this.queryDTOList = res.data;
this.proutlist1.enclosureDescribe = ""; //初始化数据
} else {
this.$message.error(res.msg);
}
})
.catch((error) => {
this.$message.error("获取附件文件失败");
});
} else {
this.$message.error(res.msg);
}
},
//初始化数据
backii() {
......@@ -639,7 +713,7 @@ export default {
enclosureDescribe: "",
status: 0, //0收入 1支出
companyId: null,
userId: null
userId: null,
};
},
//附件取消
......@@ -648,12 +722,12 @@ export default {
this.getshow = 1;
this.disabled = false;
this.backii();
this.delfile1();
this.clearFile();
} else {
this.getshow = 3;
this.disabled = false;
this.backii();
this.delfile1();
this.clearFile();
}
},
//附件文件校验
......@@ -667,8 +741,8 @@ export default {
this.$refs.upload1.clearFiles();
this.fileTypepdf = false;
}
}
}
},
},
};
</script>
......
......@@ -2,7 +2,12 @@
<div class="container">
<el-row :gutter="20">
<el-col :xl="8" :lg="10" :md="8" :sm="12" :xs="24">
<el-form ref="form" :model="incomeFrom" label-width="120px" :rules="rules">
<el-form
ref="form"
:model="incomeFrom"
label-width="120px"
:rules="rules"
>
<el-form-item label="项目名称" prop="projectName">
<el-input v-model="incomeFrom.projectName" disabled></el-input>
</el-form-item>
......@@ -66,7 +71,9 @@
</el-col>
<!-- 附件上传 -->
<el-col :xl="8" :lg="10" :md="8" :sm="12" :xs="24" class="contract">
<el-button type="primary" @click="dialogFormVisible = true">上传附件</el-button>
<el-button type="primary" @click="dialogFormVisible = true"
>上传附件</el-button
>
<el-dialog title="附件" :visible.sync="dialogFormVisible" width="55%">
<div style="width: 60%; margin-left: 30px">
<el-input
......@@ -85,6 +92,7 @@
:on-remove="delfile1"
:auto-upload="false"
:on-change="onChangepdf"
:on-success="Refresh"
:data="proutlist1"
multiple
style="margin: 20px 0px"
......@@ -94,7 +102,9 @@
将文件拖到此处,或
<em>点击上传附件</em>
</div>
<div class="el-upload__tip" slot="tip">只能上传文件,且不超过500kb</div>
<div class="el-upload__tip" slot="tip">
只能上传文件,且不超过500kb
</div>
</el-upload>
</div>
<div style="margin-left: 75%">
......@@ -103,14 +113,19 @@
type="primary"
@click="dialogFormVisible = false"
style="margin-top: 20px"
>确 定</el-button>
>确 定</el-button
>
</div>
</el-dialog>
</el-col>
<!-- 按钮 -->
<el-col :span="24" style="margin-left: 120px">
<el-button type="success" icon="el-icon-upload2" @click="submitForm()">提交</el-button>
<el-button type="info" icon="el-icon-refresh-left" @click="resetForm()">重置信息</el-button>
<el-button type="success" icon="el-icon-upload2" @click="submitForm()"
>提交</el-button
>
<el-button type="info" icon="el-icon-refresh-left" @click="resetForm()"
>重置信息</el-button
>
<el-button @click="back()">返回</el-button>
</el-col>
</el-row>
......@@ -121,15 +136,15 @@
import {
selectByProjectId,
selectAllBystatus,
updatesubmit
updatesubmit,
} from "@/api/project";
import { selectAll } from "@/api/type";
import { insert } from "@/api/imcome";
import { incomeAdd as rules} from "../rules";
import { incomeAdd as rules } from "../rules";
export default {
data() {
return {
rules:rules,
rules: rules,
//表单
incomeFrom: {
incomeBody: null,
......@@ -142,8 +157,9 @@ export default {
projectId: null,
userId: null,
projectName: null,
incomebaoxioa: null //报销的字段
incomebaoxioa: null, //报销的字段
},
action1: null,
invoiceListAdd: [], //选择的发票号
getinvoivelist: [], //查询的能选择的表单信息
typeList: [], //收入类型列表
......@@ -155,27 +171,29 @@ export default {
enclosureDescribe: "",
status: 0, //0收入 1支出
companyId: null,
userId: null
userId: null,
"X-Token": null,
},
//查询发票编号的参数
getinvoiveId: {
userId: null,
companyId: null,
type: 0
type: 0,
},
//附件
dialogFormVisible: false
dialogFormVisible: false,
};
},
computed: {
projectId() {
return this.$route.query.id;
}
},
},
created() {
//用户id
this.incomeFrom.userId = this.$store.getters.urId;
//合同上传地址
this.proutlist1["X-Token"] = this.$store.getters.token;
this.action1 = process.env.VUE_APP_BASE_API + "/file/updataEnclosures";
this.getinvoiveId.userId = this.$store.getters.urId;
this.getinvoiveId.companyId = this.$store.getters.companyId;
......@@ -210,10 +228,10 @@ export default {
},
//提交
submitForm() {
this.$refs.form.validate(valid => {
this.$refs.form.validate((valid) => {
if (valid) {
insert(this.incomeFrom)
.then(res => {
.then((res) => {
if (res.success) {
//判断是否有附件文件
if (this.fileTypepdf) {
......@@ -224,14 +242,14 @@ export default {
if (this.invoiceListAdd.length > 0) {
let list = [];
//提交发票与收入关系 status默认为1 表示发票已报销
this.invoiceListAdd.forEach(item => {
this.invoiceListAdd.forEach((item) => {
list.push({
invoiceId: item,
incomeId: res.data,
status: 1
status: 1,
});
});
updatesubmit(list).then(res => {
updatesubmit(list).then((res) => {
if (res.success) {
this.$message.success(res.msg);
this.back();
......@@ -246,7 +264,7 @@ export default {
this.$message.error(res.msg);
}
})
.catch(error => {
.catch((error) => {
this.$message.error("提交失败");
});
}
......@@ -265,8 +283,8 @@ export default {
path: "/incomeList",
query: {
id: this.$route.query.id,
backid: this.$route.query.backid
}
backid: this.$route.query.backid,
},
});
},
//合同文件校验
......@@ -286,10 +304,10 @@ export default {
getTypeList() {
let param = {
companyId: this.$store.getters.companyId,
typeCategory: 0
typeCategory: 0,
};
selectAll(param)
.then(res => {
.then((res) => {
if (res.success) {
this.typeList = res.data;
} else {
......@@ -297,18 +315,26 @@ export default {
this.back();
}
})
.catch(error => {
.catch((error) => {
this.$message.error("获取类型失败");
this.back();
});
},
//附件上传成功的回调
Refresh(res) {
if (res.success) {
this.$message.success(res.msg);
} else {
this.$message.error(res.msg);
}
},
//获取项目
getProject() {
let param = {
projectId: this.projectId
projectId: this.projectId,
};
selectByProjectId(param)
.then(res => {
.then((res) => {
if (res.success) {
this.projectData = res.data;
this.incomeFrom.projectName = res.data.projectName;
......@@ -318,7 +344,7 @@ export default {
this.back();
}
})
.catch(error => {
.catch((error) => {
this.$message.error("获取项目失败");
this.back();
});
......@@ -326,7 +352,7 @@ export default {
//查询发票编号
Selectinsertlsit() {
selectAllBystatus(this.getinvoiveId)
.then(res => {
.then((res) => {
if (res.success) {
this.getinvoivelist = res.data;
} else {
......@@ -334,41 +360,46 @@ export default {
this.back();
}
})
.catch(error => {
.catch((error) => {
this.$message.error("获取发票编号失败");
this.back();
});
},
//清楚合同文件
delfile1() {
delfile1(file) {
this.fileTypepdf = false;
this.fileList1 = this.fileList1.filter(item => item.uid !== file.uid);
this.fileList1 = this.fileList1.filter((item) => item.uid !== file.uid);
},
//取消
remove() {
this.proutlist1.enclosureDescribe = null;
this.delfile1();
this.clearFile();
this.dialogFormVisible = false;
},
//文件清除
clearFile(){
this.fileList1 = []
},
//添加发票金额
getchange() {
let sum = 0;
let list = [];
this.invoiceListAdd.forEach(g => {
this.getinvoivelist.forEach(item => {
this.invoiceListAdd.forEach((g) => {
this.getinvoivelist.forEach((item) => {
if (item.invoiceId == g) {
list.push({
mone: item.mone
mone: item.mone,
});
}
});
});
list.forEach(item => {
list.forEach((item) => {
sum += item.mone;
});
this.incomeFrom.incomeMoney = sum;
}
}
},
},
};
</script>
......
......@@ -3,7 +3,10 @@
<div class="header">
<el-form :inline="true" :model="incomeQurey">
<el-form-item label="收入对象">
<el-input v-model="incomeQurey.incomeObject" placeholder="收入对象"></el-input>
<el-input
v-model="incomeQurey.incomeObject"
placeholder="收入对象"
></el-input>
</el-form-item>
<el-form-item label="收入类别">
<el-select v-model="incomeQurey.incomeType">
......@@ -16,7 +19,10 @@
</el-select>
</el-form-item>
<el-form-item label="收入内容">
<el-input v-model="incomeQurey.incomeBody" placeholder="收入内容"></el-input>
<el-input
v-model="incomeQurey.incomeBody"
placeholder="收入内容"
></el-input>
</el-form-item>
<el-form-item label="收入时间">
<el-date-picker
......@@ -29,14 +35,22 @@
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="qurey()">查询</el-button>
<el-button type="primary" icon="el-icon-refresh-right" @click="reset()">重置</el-button>
<el-button type="primary" icon="el-icon-search" @click="qurey()"
>查询</el-button
>
<el-button
type="primary"
icon="el-icon-refresh-right"
@click="reset()"
>重置</el-button
>
<el-button
type="success"
icon="el-icon-circle-plus-outline"
@click="addincome()"
v-if="state != 0"
>新增收入</el-button>
>新增收入</el-button
>
<el-button @click="back()">返回</el-button>
</el-form-item>
</el-form>
......@@ -47,8 +61,8 @@
:data="incomeList"
style="width: 100%; text-align: center"
border
:cell-style="{'text-align':'center'}"
:header-cell-style="{'text-align':'center'}"
:cell-style="{ 'text-align': 'center' }"
:header-cell-style="{ 'text-align': 'center' }"
>
<el-table-column type="expand">
<template slot-scope="props">
......@@ -56,20 +70,30 @@
class="margin-top"
title="关于项目"
:column="1"
style="width:40%; margin:20px 20px"
style="width: 40%; margin: 20px 20px"
border
>
<el-descriptions-item label="收入附言:">
<el-descriptions-item label="收入备注:">
<span>{{ props.row.incomeRemarks }}</span>
</el-descriptions-item>
<el-descriptions-item label="收入详情:">
<span>{{ props.row.incomeInformation }}</span>
</el-descriptions-item>
<el-descriptions-item label="发票文件:">
<el-button type="primary" size="mini" @click="ReviseImage(props.row)">点击查看</el-button>
<el-button
type="primary"
size="mini"
@click="ReviseImage(props.row)"
>点击查看</el-button
>
</el-descriptions-item>
<el-descriptions-item label="附件下载">
<el-button type="success" size="mini" @click="selectImage(props.row)">点击查看</el-button>
<el-button
type="success"
size="mini"
@click="selectImage(props.row)"
>点击查看</el-button
>
</el-descriptions-item>
</el-descriptions>
</template>
......@@ -77,9 +101,9 @@
<el-table-column label="序号" width="50px">
<template slot-scope="scope">
{{
(incomeQurey.pageNum - 1) * incomeQurey.pageSize +
scope.$index +
1
(incomeQurey.pageNum - 1) * incomeQurey.pageSize +
scope.$index +
1
}}
</template>
</el-table-column>
......@@ -110,7 +134,8 @@
icon="el-icon-edit"
type="info"
@click="updatain(scope.row)"
>修改信息</el-button>
>修改信息</el-button
>
</template>
</el-table-column>
</el-table>
......@@ -129,18 +154,27 @@
<!--发票抽屉-->
<div>
<el-drawer title="发票详情" :visible.sync="drawer" :direction="direction" size="50%">
<el-drawer
title="发票详情"
:visible.sync="drawer"
:direction="direction"
size="50%"
>
<!-- filePath-->
<el-table
:data="getinvoivelist"
style="width: 90%; margin:10px 5%; text-align: center"
style="width: 90%; margin: 10px 5%; text-align: center"
border
:cell-style="{'text-align':'center'}"
:header-cell-style="{'text-align':'center'}"
:cell-style="{ 'text-align': 'center' }"
:header-cell-style="{ 'text-align': 'center' }"
>
<el-table-column type="index" label="序号" width="80px"></el-table-column>
<el-table-column
type="index"
label="序号"
width="80px"
></el-table-column>
<el-table-column prop="code" label="发票代码"></el-table-column>
<el-table-column prop="number" label="发票号码" ></el-table-column>
<el-table-column prop="number" label="发票号码"></el-table-column>
<el-table-column prop="mone" label="发票金额"></el-table-column>
<el-table-column prop="prop" label="查看PDF文件或图片">
<template slot-scope="scope">
......@@ -152,7 +186,9 @@
></el-image>
</div>
<div v-else>
<a class="a-style" @click="handlePreView(scope.row)">点击查看文件</a>
<a class="a-style" @click="handlePreView(scope.row)"
>点击查看文件</a
>
</div>
</template>
</el-table-column>
......@@ -161,39 +197,62 @@
</div>
<!-- 附件抽屉 -->
<div>
<el-drawer title="附件操作" :visible.sync="drawer2" :direction="direction" size="50%">
<el-drawer
title="附件操作"
:visible.sync="drawer2"
:direction="direction"
size="50%"
>
<el-button
type="primary"
style=" margin-left:5%;margin-top:40px "
style="margin-left: 5%; margin-top: 40px"
:disabled="disabled"
@click="updatecard"
>添加附件</el-button>
>添加附件</el-button
>
<el-card
class="box-card"
style="width:90%; margin-left:5%; margin-top:20px"
v-show="getshow==1"
style="width: 90%; margin-left: 5%; margin-top: 20px"
v-show="getshow == 1"
>
<el-row class="row-bg">
<div v-for="index in queryDTOList" :key="index.enclosureId" class="lsitall">
<div
v-for="index in queryDTOList"
:key="index.enclosureId"
class="lsitall"
>
<el-col :span="10">
<div style=" margin-top: 6px;margin-left:40px">附件{{index.enclosureId}}</div>
<div style="margin-top: 6px; margin-left: 40px">
附件{{ index.enclosureId }}
</div>
</el-col>
<el-col :span="12" style="margin-left:-50px">
<el-col :span="12" style="margin-left: -50px">
<el-button
type="primary"
icon="el-icon-folder-checked"
class="a-style"
size="mini"
style=" font-size: 13px"
style="font-size: 13px"
@click="delProject(index)"
>下载</el-button>
>下载</el-button
>
<el-popover placement="top" width="160" v-model="index.visible">
<p>确定要删除此条附件吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="index.visible= false">取消</el-button>
<el-button type="primary" size="mini" @click="deleteProject(index)">确定</el-button>
<el-button
size="mini"
type="text"
@click="index.visible = false"
>取消</el-button
>
<el-button
type="primary"
size="mini"
@click="deleteProject(index)"
>确定</el-button
>
</div>
<el-button
type="danger"
......@@ -202,7 +261,8 @@
size="mini "
style="font-size: 13px"
slot="reference"
>删除</el-button>
>删除</el-button
>
</el-popover>
</el-col>
</div>
......@@ -211,16 +271,16 @@
<!-- 附件上传 -->
<el-card
class="box-card"
style="width:90%; margin-left:5%; margin-top:20px"
v-show="getshow==0"
style="width: 90%; margin-left: 5%; margin-top: 20px"
v-show="getshow == 0"
>
<div style="width:60%;margin-left:30px">
<div style="width: 60%; margin-left: 30px">
<el-input
type="textarea"
:rows="2"
placeholder="请输入附件详情"
v-model="proutlist1.enclosureDescribe"
style="margin:20px 0px;"
style="margin: 20px 0px"
></el-input>
<el-upload
class="upload-demo"
......@@ -234,23 +294,32 @@
:on-success="Refresh"
:data="proutlist1"
multiple
style="margin:20px 0px;"
style="margin: 20px 0px"
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">
将文件拖到此处,或
<em>点击上传附件</em>
</div>
<div class="el-upload__tip" slot="tip">只能上传文件,且不超过500kb</div>
<div class="el-upload__tip" slot="tip">
只能上传文件,且不超过500kb
</div>
</el-upload>
</div>
<div style="margin-left:75%;">
<div style="margin-left: 75%">
<el-button @click="remove()">取 消</el-button>
<el-button type="primary" @click="determine()" style="margin-top:20px;">确 定</el-button>
<el-button
type="primary"
@click="determine()"
style="margin-top: 20px"
>确 定</el-button
>
</div>
</el-card>
<div class="box-card" v-show="getshow==3"></div>
<div class="box-card" v-show="getshow == 3">
<el-empty description="还没有添加附件哦"></el-empty>
</div>
</el-drawer>
</div>
</div>
......@@ -260,7 +329,6 @@
import { selectByProjectId } from "@/api/imcome";
import { selectAll } from "@/api/type";
import { selectAllById, selectByIdF, deleteById } from "@/api/project";
import { componentMap } from "../../../router";
import { getFileUrl } from "@/api/companyFile";
const InitialData = {
......@@ -273,7 +341,7 @@ const InitialData = {
incomeType: null,
projectId: null,
userId: null,
projectName: null
projectName: null,
};
export default {
......@@ -287,7 +355,7 @@ export default {
incomeType: null,
incomeBody: null,
incomeTimeStart: null,
incomeTimeEnd: null
incomeTimeEnd: null,
},
incomeList: [],
options: [],
......@@ -301,7 +369,7 @@ export default {
//查询图片给的值
getinvoiveId: {
companyId: null,
incomeId: 0
incomeId: 0,
},
//图片的数组
getinvoivelist: [],
......@@ -310,7 +378,7 @@ export default {
//查询附件
queryDTO: {
companyId: null,
incomeId: null
incomeId: null,
},
queryDTOList: [], //收集附件的数据
//附件抽屉
......@@ -324,17 +392,18 @@ export default {
enclosureDescribe: "",
status: 0, //0收入 1支出
companyId: null,
userId: null
userId: null,
"X-Token": null,
},
fileTypepdf: false, //判断合同文件是否存在
fileList1: [], //合同文件
disabled: false //隐藏,
disabled: false, //隐藏,
};
},
computed: {
state: function() {
state: function () {
return this.$route.query.state;
}
},
},
created() {
this.getinvoiveId.companyId = this.$store.getters.companyId;
......@@ -342,6 +411,7 @@ export default {
this.backid = this.$route.query.backid;
this.queryDTO.companyId = this.$store.getters.companyId;
this.action1 = process.env.VUE_APP_BASE_API + "/file/updataEnclosures";
this.proutlist1["X-Token"] = this.$store.getters.token;
this.getIncome();
this.getTypeList();
},
......@@ -350,24 +420,24 @@ export default {
getTypeList() {
let param = {
companyId: this.$store.getters.companyId,
typeCategory: 0
typeCategory: 0,
};
selectAll(param)
.then(res => {
.then((res) => {
if (res.success) {
this.options = res.data;
} else {
this.$message.error(res.msg);
}
})
.catch(error => {
.catch((error) => {
this.$message.error("获取类型失败");
});
},
//获取收入情况
getIncome() {
selectByProjectId(this.incomeQurey)
.then(res => {
.then((res) => {
if (res.success) {
this.incomeList = res.data.list;
this.total = res.data.total;
......@@ -375,7 +445,7 @@ export default {
this.$message.errror(res.msg);
}
})
.catch(error => {
.catch((error) => {
this.$message.error("查询数据失败");
});
},
......@@ -452,8 +522,8 @@ export default {
path: "/incomeAdd",
query: {
id: this.$route.query.id,
backid: this.backid
}
backid: this.backid,
},
});
},
//查看项目附件.....
......@@ -461,7 +531,7 @@ export default {
this.queryDTO.incomeId = row.incomeId;
this.proutlist1.Id = row.incomeId;
selectByIdF(this.queryDTO)
.then(res => {
.then((res) => {
if (res.success) {
this.queryDTOList = res.data;
if (this.queryDTOList.length > 0) {
......@@ -477,7 +547,7 @@ export default {
this.$message.error(res.msg);
}
})
.catch(error => {
.catch((error) => {
this.$message.error("获取附件文件失败");
});
},
......@@ -492,15 +562,15 @@ export default {
//查询发票图片
Selectinsertlsit() {
selectAllById(this.getinvoiveId)
.then(res => {
.then((res) => {
if (res.success) {
res.data.forEach(e => {
res.data.forEach((e) => {
let fileNamepdf = e.filePath;
console.log(fileNamepdf);
let fileType = fileNamepdf.substring(
fileNamepdf.lastIndexOf(".")
);
getFileUrl(e.filePath).then(res => {
getFileUrl(e.filePath).then((res) => {
if (res.success) {
let url = res.data;
e.fileUrl = url;
......@@ -517,7 +587,7 @@ export default {
this.back();
}
})
.catch(error => {
.catch((error) => {
console.log(error);
this.$message.error("获取发票图片失败");
this.back();
......@@ -530,8 +600,8 @@ export default {
query: {
id: data.incomeId,
projectId: this.$route.query.id,
backid: this.backid
}
backid: this.backid,
},
});
},
//返回开始
......@@ -540,22 +610,22 @@ export default {
this.$router.push({
path: "/projectList",
query: {
id: this.$route.query.id
}
id: this.$route.query.id,
},
});
} else if (this.backid == 1) {
this.$router.push({
path: "/beresponsibleforList",
query: {
id: this.$route.query.id
}
id: this.$route.query.id,
},
});
} else {
this.$router.push({
path: "/participateinList",
query: {
id: this.$route.query.id
}
id: this.$route.query.id,
},
});
}
},
......@@ -568,7 +638,7 @@ export default {
//下载附件
delProject(row) {
getFileUrl(row.enclosureFile)
.then(res => {
.then((res) => {
if (res.success) {
let url = res.data;
console.log(url);
......@@ -583,8 +653,8 @@ export default {
this.$message.error("下载失败");
}
})
.catch(e => {
this.$message.error(e.msg);
.catch((e) => {
this.$message.error("下载失败");
});
},
......@@ -593,31 +663,37 @@ export default {
updatecard() {
this.getshow = 0;
this.disabled = true;
this.delfile1();
this.clearFile();
},
//删除附件
deleteProject(row) {
deleteById(row)
.then(res => {
.then((res) => {
if (res.success) {
this.selectImage(row);
this.$message({
message: "删除成功",
type: "success"
type: "success",
});
this.visible = false;
}
})
.catch(errror => {
.catch((errror) => {
this.$message.error(res.msg);
});
},
//清除附件文件
delfile1(file) {
this.fileList1 = this.fileList1.filter(item => item.uid !== file.uid);
this.proutlist1.enclosureDescribe = ""; //初始化数据
this.fileList1 = this.fileList1.filter((item) => item.uid !== file.uid);
this.proutlist1.enclosureDescribe = "";
//初始化数据
this.fileTypepdf = false;
},
//文件清除
clearFile(){
this.fileList1 = []
this.proutlist1.enclosureDescribe = "";
},
//确定提交附件
determine() {
//判断是否有附件文件
......@@ -625,24 +701,24 @@ export default {
this.proutlist1.userId = this.$store.getters.urId;
this.proutlist1.companyId = this.$store.getters.companyId;
this.$refs.upload1.submit();
this.getshow = 1; //隐藏与显示
this.disabled = false;
this.$message({
showClose: true,
message: "上传附件成功",
type: "success"
type: "success",
});
this.Refresh();
} else {
this.$message.error("请添加附件,在进行提交");
}
},
//刷新附件
Refresh() {
Refresh(res) {
this.queryDTO.incomeId = this.proutlist1.Id;
selectByIdF(this.queryDTO)
.then(res => {
this.getshow = 1; //隐藏与显示
this.disabled = false;
if (res.success) {
this.$message.success("上传附件成功")
selectByIdF(this.queryDTO)
.then((res) => {
if (res.success) {
this.queryDTOList = res.data;
this.proutlist1.enclosureDescribe = ""; //初始化数据
......@@ -650,20 +726,24 @@ export default {
this.$message.error(res.msg);
}
})
.catch(error => {
.catch((error) => {
this.$message.error("获取附件文件失败");
});
}else{
this.$message.error(res.msg);
}
},
//附件取消
remove() {
if (this.queryDTOList.length > 0) {
this.getshow = 1;
this.disabled = false;
this.delfile1();
this.clearFile();
} else {
this.getshow = 3;
this.disabled = false;
this.delfile1();
this.clearFile();
}
},
//附件文件校验
......@@ -692,8 +772,8 @@ export default {
return false;
}
}
}
}
},
},
};
</script>
......
......@@ -84,7 +84,7 @@ export default {
this.memberList = res.data.list;
this.total = res.data.total;
} else {
this.$message.error(res.data);
this.$message.error(res.msg);
}
})
.catch(error => {
......
......@@ -136,7 +136,7 @@ export default {
this.$message.error("获取员工信息失败");
});
} else {
this.$message.error(res.data);
this.$message.error(res.msg);
this.back();
}
})
......
......@@ -2,7 +2,12 @@
<div class="container">
<el-row :gutter="20">
<el-col :xl="12" :lg="12" :md="12" :sm="12" :xs="24">
<el-form ref="form" :model="projectFrom" label-width="120px" :rules="rules">
<el-form
ref="form"
:model="projectFrom"
label-width="120px"
:rules="rules"
>
<el-form-item label="项目名称" prop="projectName">
<el-input v-model="projectFrom.projectName"></el-input>
</el-form-item>
......@@ -38,15 +43,25 @@
<el-form-item label="项目详情" prop="projectInformation">
<el-input
type="textarea"
:autosize="{ minRows: 4, maxRows: 6}"
:autosize="{ minRows: 4, maxRows: 6 }"
placeholder="请输入内容"
v-model="projectFrom.projectInformation"
></el-input>
</el-form-item>
<el-form-item>
<el-button type="success" icon="el-icon-upload2" @click="submitForm()">提交</el-button>
<el-button type="info" icon="el-icon-refresh-left" @click="resetForm()">重置信息</el-button>
<el-button
type="success"
icon="el-icon-upload2"
@click="submitForm()"
>提交</el-button
>
<el-button
type="info"
icon="el-icon-refresh-left"
@click="resetForm()"
>重置信息</el-button
>
<el-button @click="back()">返回</el-button>
</el-form-item>
</el-form>
......@@ -57,18 +72,23 @@
负责人:
<el-tag
:key="index"
v-for="(projectLeader,index) in userIdAdd"
v-for="(projectLeader, index) in userIdAdd"
closable
:disable-transitions="false"
@close="delectTag(index)"
style="margin:0px 10px"
>{{projectLeader}}</el-tag>
style="margin: 0px 10px"
>{{ projectLeader }}</el-tag
>
</div>
<div class="projectLeader">
<div style="marrgin">选择区:</div>
<div style="padding:20px">
<div style="padding: 20px">
角色:
<el-select v-model="personListForm.rlId" placeholder="请选择" @change="selsetperson()">
<el-select
v-model="personListForm.rlId"
placeholder="请选择"
@change="selsetperson()"
>
<el-option
v-for="item in rolesList"
:key="item.rlId"
......@@ -76,15 +96,16 @@
:value="item.rlId"
></el-option>
</el-select>
<!-- <el-button type="primary" @click="ggb()" :disabled="isgetrules">搜索</el-button> -->
<div class="personList">
<el-checkbox-group v-model="projectLeaderList">
<el-checkbox
:label="ch.userId"
v-for="ch in checkList"
:key="ch.userId"
style="margin: 10px 20px"
@change="AddSelect(ch)"
>{{ch.userName}}</el-checkbox>
>{{ ch.userName }}</el-checkbox
>
</el-checkbox-group>
</div>
</div>
......@@ -97,7 +118,7 @@
<script>
import { insert } from "@/api/project";
import { selectAllByCompanyId, insertBatch, secletAllByRlid } from "@/api/role";
import { money,account_password_valid } from "@/utils/myValidate";
import { money, account_password_valid } from "@/utils/myValidate";
export default {
data() {
return {
......@@ -106,7 +127,7 @@ export default {
//收集查询员工数据
list: {
rlId: 0,
companyId: 0
companyId: 0,
},
//添加负责人数组
insertBatch: [],
......@@ -126,33 +147,31 @@ export default {
projectPartyb: null,
projectInformation: null,
timeSlot: null
timeSlot: null,
},
rules: {
projectName: [
{ required: true, message: "请输入项目名称", trigger: "blur" }
],
projectNumber: [
{ validator: account_password_valid, trigger: "blur" }
{ required: true, message: "请输入项目名称", trigger: "blur" },
],
projectNumber: [{ validator: account_password_valid, trigger: "blur" }],
projectAmount: [
{
required: true,
validator: money,
trigger: "change"
}
trigger: "change",
},
],
timeSlot: [
{ required: true, message: "请选择日期", trigger: "change" }
{ required: true, message: "请选择日期", trigger: "change" },
],
projectPartyb: [
{
required: true,
message: "请输入项目合作方",
trigger: "blur"
}
]
trigger: "blur",
},
],
},
isgetrules: false,
//显示tag
......@@ -162,8 +181,8 @@ export default {
//收集userId
userIdAdd: [],
personListForm: {
rlId: null
}
rlId: null,
},
};
},
created() {
......@@ -175,14 +194,14 @@ export default {
//获取公司全部角色
getRoleList() {
selectAllByCompanyId({ companyId: this.$store.getters.companyId })
.then(res => {
.then((res) => {
if (res.success) {
this.rolesList = res.data;
} else {
this.$message.error(res.data);
this.$message.error(res.msg);
}
})
.catch(error => {
.catch((error) => {
this.$message.error("查询数据失败");
});
//添加负责人
......@@ -192,7 +211,7 @@ export default {
this.list.rlId = this.personListForm.rlId;
this.list.companyId = this.$store.getters.companyId;
let result = await secletAllByRlid(this.list);
if (result.code == 20000) {
if (result.success) {
this.checkList = result.data;
}
},
......@@ -200,7 +219,6 @@ export default {
delectTag(index) {
this.projectLeaderList.splice(index, 1);
this.userIdAdd.splice(index, 1);
console.log(this.userIdAdd);
},
AddSelect(row) {
if (this.projectLeaderList.indexOf(row.userId) > -1) {
......@@ -209,7 +227,6 @@ export default {
let index = this.userIdAdd.indexOf(row.userName);
this.userIdAdd.splice(index, 1);
}
console.log(this.userIdAdd);
},
//时间处理
time(val) {
......@@ -228,38 +245,38 @@ export default {
//提交数据
submitForm() {
//第一步校验数据完整性
this.$refs.form.validate(valid => {
this.$refs.form.validate((valid) => {
if (this.projectLeaderList.length < 1) {
this.$message.warning("请选择项目负责人");
} else if (valid) {
//第四步提交
console.log(this.projectFrom);
insert(this.projectFrom)
.then(res => {
.then((res) => {
if (res.success) {
let dateadd = [];
this.projectLeaderList.forEach(item => {
this.projectLeaderList.forEach((item) => {
dateadd.push({
userId: item,
projectId: res.data,
memberPression: 0
memberPression: 0,
});
});
console.log(dateadd);
let restle = insertBatch(dateadd);
if ((restle.success = true)) {
console.log("保存成功");
this.$message.success("新建成功");
this.back();
} else {
this.$message.success("发生错误");
}
insertBatch(dateadd).then((res) => {
if (res.success) {
this.$message.success("新建成功");
this.back();
} else {
this.$message.error("发生错误");
}
}).catch(e=>{
this.$message.error("提交失败");
})
} else {
this.$message.error(res.msg);
}
})
.catch(error => {
this.$message.error("插入失败");
.catch((error) => {
this.$message.error(error.msg);
});
}
});
......@@ -287,7 +304,7 @@ export default {
date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
return Y + M + D + h + m + s;
},
}
},
};
</script>
......@@ -305,5 +322,6 @@ export default {
}
.personList {
margin-top: 20px;
width: 400px;
}
</style>
\ No newline at end of file
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