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>
......
This diff is collapsed.
......@@ -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>
......
This diff is collapsed.
......@@ -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