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

202211201

parent 979e03ac
...@@ -275,16 +275,12 @@ export default { ...@@ -275,16 +275,12 @@ export default {
} }
}, },
methods: { methods: {
// closeDrawer() {
// this.$emit('closeDrawer')
// },
getParentContractList() { getParentContractList() {
const params = { const params = {
companyId: this.companyId || this.$store.getters.companyId companyId: this.companyId || this.$store.getters.companyId
} }
selectAllContractList(params).then(res => { selectAllContractList(params).then(res => {
if (res.success) { if (res.success) {
// console.log(res.data)
this.contractParentList = res.data this.contractParentList = res.data
} else { } else {
this.$message.warning("获取合同类型失败") this.$message.warning("获取合同类型失败")
...@@ -292,12 +288,6 @@ export default { ...@@ -292,12 +288,6 @@ export default {
}) })
}, },
addContract() { addContract() {
// let validRes = this.validFormData()
// if (validRes.length) {
// this.$message.warning("带 * 号必填,请正确填写信息")
// return
// }
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
if (this.formData.contractStartTime > this.formData.contractEndTime) { if (this.formData.contractStartTime > this.formData.contractEndTime) {
...@@ -366,7 +356,6 @@ export default { ...@@ -366,7 +356,6 @@ export default {
} }
selectAllContractTypeList(params).then(res => { selectAllContractTypeList(params).then(res => {
if (res.success) { if (res.success) {
// console.log(res.data)
this.contractTypeList = res.data this.contractTypeList = res.data
} else { } else {
this.$message.warning("获取合同类型失败") this.$message.warning("获取合同类型失败")
...@@ -380,7 +369,6 @@ export default { ...@@ -380,7 +369,6 @@ export default {
} }
getContractById(params).then(res => { getContractById(params).then(res => {
if (res.success) { if (res.success) {
// console.log(res.data)
if (res.data.contractNature.toString() === '2') { if (res.data.contractNature.toString() === '2') {
this.getParentContractList() this.getParentContractList()
} }
......
...@@ -85,19 +85,16 @@ ...@@ -85,19 +85,16 @@
<el-button @click="dialogTableVisible = false">取消</el-button> <el-button @click="dialogTableVisible = false">取消</el-button>
</span> </span>
</el-dialog> </el-dialog>
<!-- <add-conctract :drawerVisible="drawerVisible" @addConctract="addConctract" @closeDrawer="drawerVisible=false"></add-conctract> -->
</div> </div>
</template> </template>
<script> <script>
// import AddConctract from './components/addContract.vue'
import { selectContractList, selectAllContractTypeList } from "@/api/contract" import { selectContractList, selectAllContractTypeList } from "@/api/contract"
import { deepClone } from "@/utils" import { deepClone } from "@/utils"
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { contractNatures as contractNatureList } from './contractStaticData' import { contractNatures as contractNatureList } from './contractStaticData'
export default { export default {
// components: {
// AddConctract
// },
computed: { computed: {
...mapGetters([ ...mapGetters([
'companyId' 'companyId'
...@@ -139,7 +136,6 @@ export default { ...@@ -139,7 +136,6 @@ export default {
} }
selectAllContractTypeList(params).then(res => { selectAllContractTypeList(params).then(res => {
if (res.success) { if (res.success) {
// console.log(res.data)
this.contractTypeList = res.data this.contractTypeList = res.data
} else { } else {
this.$message.warning("获取合同类型失败") this.$message.warning("获取合同类型失败")
...@@ -171,9 +167,6 @@ export default { ...@@ -171,9 +167,6 @@ export default {
} }
}) })
}, },
addConctract(params) {
console.log(params)
}
} }
} }
</script> </script>
......
...@@ -27,8 +27,8 @@ export default { ...@@ -27,8 +27,8 @@ export default {
}, },
parentFn(val) { parentFn(val) {
console.log(val);
this.activeName=val; this.activeName=val;
this.$refs.eaxmine.getincomeSelectlist()
} }
} }
}; };
......
...@@ -80,13 +80,22 @@ ...@@ -80,13 +80,22 @@
将文件拖到此处,或 将文件拖到此处,或
<em>点击上传</em> <em>点击上传</em>
</div> </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-upload>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-col> <el-col>
<el-button type="success" icon="el-icon-folder-checked" @click="getlistForm()">立即创建</el-button> <el-button
<el-button type="info" icon="el-icon-refresh" @click="delectdd">重置信息</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-col>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -104,7 +113,7 @@ import { ...@@ -104,7 +113,7 @@ import {
addRecordRules as rules, addRecordRules as rules,
categoryOptions, categoryOptions,
typeOptions, typeOptions,
statusOptions statusOptions,
} from "../expense"; } from "../expense";
export default { export default {
created() { created() {
...@@ -112,7 +121,7 @@ export default { ...@@ -112,7 +121,7 @@ export default {
this.fileUploadHeader["X-Token"] = this.$store.getters.token; this.fileUploadHeader["X-Token"] = this.$store.getters.token;
}, },
computed: { computed: {
...mapGetters(["companyId", "urId"]) ...mapGetters(["companyId", "urId"]),
}, },
data() { data() {
return { return {
...@@ -125,7 +134,7 @@ export default { ...@@ -125,7 +134,7 @@ export default {
number: null, number: null,
status: 0, status: 0,
time: null, time: null,
type: null type: null,
}, },
categoryOptions, categoryOptions,
typeOptions, typeOptions,
...@@ -134,9 +143,8 @@ export default { ...@@ -134,9 +143,8 @@ export default {
loading: false, loading: false,
action: null, action: null,
fileUploadHeader: { fileUploadHeader: {
"X-Token": null "X-Token": null,
}, },
dataValue: "first"
}; };
}, },
methods: { methods: {
...@@ -162,17 +170,11 @@ export default { ...@@ -162,17 +170,11 @@ export default {
if (res.success) { if (res.success) {
//发票提交 //发票提交
this.delectdd(); this.delectdd();
console.log("123456");
this.$emit("childFnGetParent", "first"); this.$emit("childFnGetParent", "first");
this.$message.success(res.msg); this.$message.success(res.msg);
} else { } else {
this.loading = false; this.loading = false;
this.$message.error(res.msg); 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; this.isgetid = true;
}, },
...@@ -201,7 +203,7 @@ export default { ...@@ -201,7 +203,7 @@ export default {
//发票提交页面的提交 //发票提交页面的提交
getlistForm() { getlistForm() {
if (this.fileTypeJpg == true) { if (this.fileTypeJpg == true) {
this.$refs.addTO.validate(valid => { this.$refs.addTO.validate((valid) => {
if (valid) { if (valid) {
this.addTO.companyId = this.companyId; this.addTO.companyId = this.companyId;
this.addTO.userId = this.urId; this.addTO.userId = this.urId;
...@@ -215,9 +217,9 @@ export default { ...@@ -215,9 +217,9 @@ export default {
//数据清除 //数据清除
delectdd() { delectdd() {
this.$refs.addTO.resetFields(); 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> </script>
......
...@@ -63,7 +63,6 @@ ...@@ -63,7 +63,6 @@
class="margin-top" class="margin-top"
title="关于发票" title="关于发票"
:column="1" :column="1"
:size="medium"
style="width:60%; margin:20px 20px" style="width:60%; margin:20px 20px"
border border
> >
...@@ -201,7 +200,7 @@ export default { ...@@ -201,7 +200,7 @@ export default {
return { return {
invoiceQruey: { invoiceQruey: {
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 1
}, },
invoicegetList: [], invoicegetList: [],
categoryOptions, categoryOptions,
...@@ -244,7 +243,6 @@ export default { ...@@ -244,7 +243,6 @@ export default {
} }
}) })
.catch(error => { .catch(error => {
console.log(error);
this.$message.error("查询发票数据失败"); this.$message.error("查询发票数据失败");
}); });
}, },
...@@ -301,15 +299,17 @@ export default { ...@@ -301,15 +299,17 @@ export default {
message: "发票删除成功", message: "发票删除成功",
type: "success" type: "success"
}); });
if(this.invoicegetList.length == 1 && this.invoiceQruey.pageNum != 1){
this.invoiceQruey.pageNum--
}
this.getincomeSelectlist(); this.getincomeSelectlist();
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}) })
.catch(e => { .catch(e => {
console.log(e.msg); this.$message.error("删除失败");
this.$message.error(e.msg);
}); });
}, },
//点击查看发票 //点击查看发票
......
...@@ -168,7 +168,6 @@ export default { ...@@ -168,7 +168,6 @@ export default {
this.loading = false; this.loading = false;
}); });
} else { } else {
console.log("error submit!!");
return false; return false;
} }
}); });
......
...@@ -233,7 +233,7 @@ export default { ...@@ -233,7 +233,7 @@ export default {
if(res.success){ if(res.success){
this.company = res.data this.company = res.data
}else{ }else{
this.$message.error(res.data) this.$message.error(res.msg)
} }
}).catch((error)=>{ }).catch((error)=>{
this.$message.error("获取公司名称失败") this.$message.error("获取公司名称失败")
......
...@@ -163,7 +163,7 @@ export default { ...@@ -163,7 +163,7 @@ export default {
if(res.success){ if(res.success){
this.company = res.data this.company = res.data
}else{ }else{
this.$message.error(res.data) this.$message.error(res.msg)
} }
}).catch((error)=>{ }).catch((error)=>{
this.$message.error("获取公司名称失败") this.$message.error("获取公司名称失败")
......
...@@ -141,7 +141,7 @@ export default { ...@@ -141,7 +141,7 @@ export default {
message: '删除成功!' message: '删除成功!'
}) })
} else { } else {
this.$message.error(res.data) this.$message.error(res.msg)
} }
}) })
...@@ -189,7 +189,7 @@ export default { ...@@ -189,7 +189,7 @@ export default {
} else { } else {
this.$message({ this.$message({
type: 'error', type: 'error',
message: res.data message: res.msg
}) })
} }
}).catch(err => { }).catch(err => {
...@@ -224,7 +224,7 @@ export default { ...@@ -224,7 +224,7 @@ export default {
} else { } else {
this.$message({ this.$message({
type: 'error', type: 'error',
message: res.data message: res.msg
}) })
} }
......
...@@ -124,7 +124,7 @@ export default { ...@@ -124,7 +124,7 @@ export default {
this.rolesList = res.data.list this.rolesList = res.data.list
this.total = res.data.total this.total = res.data.total
} else { } else {
this.$message.error(res.data) this.$message.error(res.msg)
} }
}).catch((error) => { }).catch((error) => {
this.$message.error("查询数据失败") this.$message.error("查询数据失败")
...@@ -229,7 +229,7 @@ export default { ...@@ -229,7 +229,7 @@ export default {
this.$message.success("删除成功") this.$message.success("删除成功")
this.rolesList.splice($index, 1) this.rolesList.splice($index, 1)
} else { } else {
this.$message.error(res.data) this.$message.error(res.msg)
} }
}).catch((error) => { }).catch((error) => {
this.$message.error("删除失败") this.$message.error("删除失败")
...@@ -259,7 +259,7 @@ export default { ...@@ -259,7 +259,7 @@ export default {
this.$message.success("修改成功") this.$message.success("修改成功")
this.getRoles() this.getRoles()
} else { } else {
this.$message.error(res.data) this.$message.error(res.msg)
} }
}).catch((error) => { }).catch((error) => {
this.$message.error("修改失败") this.$message.error("修改失败")
...@@ -272,7 +272,7 @@ export default { ...@@ -272,7 +272,7 @@ export default {
this.$message.success("添加成功") this.$message.success("添加成功")
this.getRoles() this.getRoles()
} else { } else {
this.$message.error(res.data) this.$message.error(res.msg)
} }
}).catch((error) => { }).catch((error) => {
this.$message.error("添加失败") this.$message.error("添加失败")
......
...@@ -130,13 +130,13 @@ export default { ...@@ -130,13 +130,13 @@ export default {
{required:true, validator:chinaIdentityValid, trigger:'blur'}, {required:true, validator:chinaIdentityValid, trigger:'blur'},
], ],
originalPassword:[ originalPassword:[
{ required: true, message: '请输入原密码', trigger: 'blur' }, { required: true,validator:account_password_valid, trigger: 'blur' },
], ],
newPassword:[ newPassword:[
{ required: true, message: '请输入新密码', trigger: 'blur' }, { required: true, validator:account_password_valid, trigger: 'blur' },
], ],
confirmPassword:[ confirmPassword:[
{ required: true, message: '请输入确认密码', trigger: 'blur' }, { required: true,validator:account_password_valid, trigger: 'blur' },
] ]
} }
} }
...@@ -165,7 +165,7 @@ export default { ...@@ -165,7 +165,7 @@ export default {
this.userData = res.data this.userData = res.data
this.backupsData = Object.assign({}, res.data) this.backupsData = Object.assign({}, res.data)
}else{ }else{
this.$message.error(res.data) this.$message.error(res.msg)
} }
}).catch((error)=>{ }).catch((error)=>{
this.$message.error("获取个人信息失败") this.$message.error("获取个人信息失败")
...@@ -181,7 +181,7 @@ export default { ...@@ -181,7 +181,7 @@ export default {
this.getUser() this.getUser()
this.userupdata = true this.userupdata = true
}else{ }else{
this.$message.error(res.data) this.$message.error(res.msg)
} }
}).catch((error)=>{ }).catch((error)=>{
this.$message.error("修改失败") this.$message.error("修改失败")
...@@ -212,7 +212,7 @@ export default { ...@@ -212,7 +212,7 @@ export default {
this.$router.push('/login') this.$router.push('/login')
}) })
}else{ }else{
this.$message.error(res.data) this.$message.error(res.msg)
} }
}).catch((error)=>{ }).catch((error)=>{
this.$message.error("修改失败") this.$message.error("修改失败")
......
...@@ -112,11 +112,11 @@ export default { ...@@ -112,11 +112,11 @@ export default {
// console.log(1) // console.log(1)
}, },
methods: { methods: {
// back(){ back(){
// this.$store.dispatch("tagsView/delView", this.$route); this.$store.dispatch("tagsView/delView", this.$route);
// this.$router.back(); this.$router.back();
// }, },
addPettyMoneyRecord() { addPettyMoneyRecord() {
this.$refs.form.validate(valida => { this.$refs.form.validate(valida => {
......
...@@ -132,7 +132,7 @@ export default { ...@@ -132,7 +132,7 @@ export default {
pettyMoneyQuery: {}, pettyMoneyQuery: {},
isConditionSelect: false, isConditionSelect: false,
pettyMoneyPageQuery: { pettyMoneyPageQuery: {
pageSize: 10, pageSize: 7,
pageNum: 1, pageNum: 1,
total: 0 total: 0
}, },
...@@ -151,10 +151,13 @@ export default { ...@@ -151,10 +151,13 @@ export default {
}, },
methods: { methods: {
checkRepayMoney(rule, value, callback) { 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) // console.log(1)
if (value === null || value === undefined || value === '') { if (value === null || value === undefined || value === '') {
callback(new Error('还款金额不能为空')); 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的金额')); callback(new Error('请输入大于0的金额'));
} else if (value > this.checkedRow.pettySurplus) { } else if (value > this.checkedRow.pettySurplus) {
callback(new Error('超出应还款金额')); callback(new Error('超出应还款金额'));
......
...@@ -3,7 +3,12 @@ ...@@ -3,7 +3,12 @@
<div class="container"> <div class="container">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :xl="8" :lg="10" :md="8" :sm="12" :xs="24"> <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-form-item label="项目名称" prop="projectName">
<el-input v-model="expendFrom.projectName" disabled></el-input> <el-input v-model="expendFrom.projectName" disabled></el-input>
</el-form-item> </el-form-item>
...@@ -71,15 +76,17 @@ ...@@ -71,15 +76,17 @@
</el-col> </el-col>
<!-- 附件上传 --> <!-- 附件上传 -->
<el-col :xl="8" :lg="10" :md="8" :sm="12" :xs="24" class="contract"> <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%"> <el-dialog title="附件" :visible.sync="dialogFormVisible" width="55%">
<div style="width:60%;margin-left:30px"> <div style="width: 60%; margin-left: 30px">
<el-input <el-input
type="textarea" type="textarea"
:rows="2" :rows="2"
placeholder="请输入附件详情" placeholder="请输入附件详情"
v-model="proutlist1.enclosureDescribe" v-model="proutlist1.enclosureDescribe"
style="margin:20px 0px;" style="margin: 20px 0px"
></el-input> ></el-input>
<el-upload <el-upload
class="upload-demo" class="upload-demo"
...@@ -91,32 +98,40 @@ ...@@ -91,32 +98,40 @@
:auto-upload="false" :auto-upload="false"
:on-change="onChangepdf" :on-change="onChangepdf"
:data="proutlist1" :data="proutlist1"
:on-success="fileSuccess"
multiple multiple
style="margin:20px 0px;" style="margin: 20px 0px"
> >
<i class="el-icon-upload"></i> <i class="el-icon-upload"></i>
<div class="el-upload__text"> <div class="el-upload__text">
将文件拖到此处,或 将文件拖到此处,或
<em>点击上传附件</em> <em>点击上传附件</em>
</div> </div>
<div class="el-upload__tip" slot="tip">只能上传jpd文件,且不超过500kb</div> <div class="el-upload__tip" slot="tip">
只能上传jpd文件,且不超过500kb
</div>
</el-upload> </el-upload>
</div> </div>
<div style="margin-left:75%;"> <div style="margin-left: 75%">
<el-button @click="remove()">取 消</el-button> <el-button @click="remove()">取 消</el-button>
<el-button <el-button
type="primary" type="primary"
@click="dialogFormVisible = false" @click="dialogFormVisible = false"
style="margin-top:20px;" style="margin-top: 20px"
>确 定</el-button> >确 定</el-button
>
</div> </div>
</el-dialog> </el-dialog>
</el-col> </el-col>
<!-- 按钮区域 --> <!-- 按钮区域 -->
<el-col :span="24" style="margin-left:120px;"> <el-col :span="24" style="margin-left: 120px">
<!-- <el-form-item> --> <!-- <el-form-item> -->
<el-button type="success" icon="el-icon-upload2" @click="submitForm()">提交</el-button> <el-button type="success" icon="el-icon-upload2" @click="submitForm()"
<el-button type="info" icon="el-icon-refresh-left" @click="resetForm()">重置信息</el-button> >提交</el-button
>
<el-button type="info" icon="el-icon-refresh-left" @click="resetForm()"
>重置信息</el-button
>
<el-button @click="back()">返回</el-button> <el-button @click="back()">返回</el-button>
<!-- </el-form-item> --> <!-- </el-form-item> -->
</el-col> </el-col>
...@@ -128,7 +143,7 @@ ...@@ -128,7 +143,7 @@
import { import {
selectByProjectId, selectByProjectId,
selectAllBystatus, selectAllBystatus,
updatesubmit updatesubmit,
} from "@/api/project"; } from "@/api/project";
import { selectAll } from "@/api/type"; import { selectAll } from "@/api/type";
import { insert } from "@/api/expend"; import { insert } from "@/api/expend";
...@@ -149,7 +164,7 @@ export default { ...@@ -149,7 +164,7 @@ export default {
expendType: null, expendType: null,
projectId: null, projectId: null,
userId: null, userId: null,
projectName: null projectName: null,
}, },
typeList: [], typeList: [],
projectData: {}, projectData: {},
...@@ -166,7 +181,7 @@ export default { ...@@ -166,7 +181,7 @@ export default {
getinvoiveId: { getinvoiveId: {
userId: null, userId: null,
companyId: null, companyId: null,
type: 1 type: 1,
}, },
pageNum: 10, pageNum: 10,
total: 1, total: 1,
...@@ -175,34 +190,36 @@ export default { ...@@ -175,34 +190,36 @@ export default {
//保存图片 //保存图片
proutlist: { proutlist: {
Id: null, Id: null,
status: 1 status: 1,
}, },
//保存合同 //保存支出附件
proutlist1: { proutlist1: {
Id: null, Id: null,
enclosureDescribe: "", enclosureDescribe: "",
status: 1, //0收入 1支出 status: 1, //0收入 1支出
companyId: null, companyId: null,
userId: null userId: null,
"X-Token": null,
}, },
fileType: null, fileType: null,
fileTypepdf: false, fileTypepdf: false,
backlistid: null, backlistid: null,
fileTypeJpg: null, fileTypeJpg: null,
//附件 //附件
dialogFormVisible: false dialogFormVisible: false,
}; };
}, },
computed: { computed: {
projectId() { projectId() {
return this.$route.query.id; return this.$route.query.id;
} },
}, },
created() { created() {
this.expendFrom.userId = this.$store.getters.urId; this.expendFrom.userId = this.$store.getters.urId;
this.getinvoiveId.companyId = this.$store.getters.companyId; this.getinvoiveId.companyId = this.$store.getters.companyId;
this.getinvoiveId.userId = this.$store.getters.urId; this.getinvoiveId.userId = this.$store.getters.urId;
this.action2 = process.env.VUE_APP_BASE_API + "/file/updataEnclosures"; 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.userId = this.$store.getters.urId;
this.proutlist1.companyId = this.$store.getters.companyId; this.proutlist1.companyId = this.$store.getters.companyId;
this.backlistid = this.$route.query.backlistid; this.backlistid = this.$route.query.backlistid;
...@@ -215,10 +232,10 @@ export default { ...@@ -215,10 +232,10 @@ export default {
getTypeList() { getTypeList() {
let param = { let param = {
companyId: this.$store.getters.companyId, companyId: this.$store.getters.companyId,
typeCategory: 1 typeCategory: 1,
}; };
selectAll(param) selectAll(param)
.then(res => { .then((res) => {
if (res.success) { if (res.success) {
this.typeList = res.data; this.typeList = res.data;
} else { } else {
...@@ -226,7 +243,7 @@ export default { ...@@ -226,7 +243,7 @@ export default {
this.back(); this.back();
} }
}) })
.catch(error => { .catch((error) => {
this.$message.error("获取类型失败"); this.$message.error("获取类型失败");
this.back(); this.back();
}); });
...@@ -234,10 +251,10 @@ export default { ...@@ -234,10 +251,10 @@ export default {
//获取项目 //获取项目
getProject() { getProject() {
let param = { let param = {
projectId: this.projectId projectId: this.projectId,
}; };
selectByProjectId(param) selectByProjectId(param)
.then(res => { .then((res) => {
if (res.success) { if (res.success) {
this.projectData = res.data; this.projectData = res.data;
this.expendFrom.projectName = res.data.projectName; this.expendFrom.projectName = res.data.projectName;
...@@ -247,39 +264,36 @@ export default { ...@@ -247,39 +264,36 @@ export default {
this.back(); this.back();
} }
}) })
.catch(error => { .catch((error) => {
this.$message.error("获取项目失败"); this.$message.error("获取项目失败");
this.back(); this.back();
}); });
}, },
//提交 //提交
submitForm() { submitForm() {
this.$refs.form.validate(valid => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
insert(this.expendFrom) insert(this.expendFrom)
.then(res => { .then((res) => {
if (res.success) { if (res.success) {
this.$message.success(res.msg); this.$message.success(res.msg);
console.log(this.fileTypepdf);
if (this.fileTypepdf) { if (this.fileTypepdf) {
//进行合同的上传 //进行支出附件的上传
//上传合同 //上传支出附件
this.proutlist1.Id = res.data; this.proutlist1.Id = res.data;
console.log(this.proutlist1.Id);
this.$refs.upload1.submit(); this.$refs.upload1.submit();
} }
if (this.invoiceListAdd.length > 0) { if (this.invoiceListAdd.length > 0) {
let list = []; let list = [];
this.invoiceListAdd.forEach(item => { this.invoiceListAdd.forEach((item) => {
list.push({ list.push({
invoiceId: item, invoiceId: item,
expendId: res.data, expendId: res.data,
status: 1 status: 1,
}); });
}); });
//上传发票记录 //上传发票记录
updatesubmit(list).then(res => { updatesubmit(list).then((res) => {
if (res.success) { if (res.success) {
this.$message.success(res.msg); this.$message.success(res.msg);
this.back(); this.back();
...@@ -294,7 +308,7 @@ export default { ...@@ -294,7 +308,7 @@ export default {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}) })
.catch(error => { .catch((error) => {
this.$message.error("新建失败"); this.$message.error("新建失败");
}); });
} }
...@@ -313,8 +327,8 @@ export default { ...@@ -313,8 +327,8 @@ export default {
path: "/expendList", path: "/expendList",
query: { query: {
id: this.$route.query.id, id: this.$route.query.id,
backlistid: this.$route.query.backlistid backlistid: this.$route.query.backlistid,
} },
}); });
}, },
//时间处理 yyyy-MM-dd hh:mm:ss //时间处理 yyyy-MM-dd hh:mm:ss
...@@ -336,7 +350,7 @@ export default { ...@@ -336,7 +350,7 @@ export default {
date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds(); date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
this.expendFrom.expendTime = Y + M + D + h + m + s; this.expendFrom.expendTime = Y + M + D + h + m + s;
}, },
//合同图片 //支出附件图片
onChangepdf(file) { onChangepdf(file) {
const fileNamepdf = file.name; const fileNamepdf = file.name;
let fileType = fileNamepdf.substring(fileNamepdf.lastIndexOf(".")); let fileType = fileNamepdf.substring(fileNamepdf.lastIndexOf("."));
...@@ -349,16 +363,24 @@ export default { ...@@ -349,16 +363,24 @@ export default {
} }
console.log(this.fileTypepdf); console.log(this.fileTypepdf);
}, },
//清楚合同文件 //清楚支出附件文件
delfile1() { delfile1(file) {
this.fileTypepdf = false; 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() { Selectinsertlsit() {
selectAllBystatus(this.getinvoiveId) selectAllBystatus(this.getinvoiveId)
.then(res => { .then((res) => {
if (res.success) { if (res.success) {
this.getinvoivelist = res.data; this.getinvoivelist = res.data;
} else { } else {
...@@ -366,7 +388,7 @@ export default { ...@@ -366,7 +388,7 @@ export default {
this.back(); this.back();
} }
}) })
.catch(error => { .catch((error) => {
this.$message.error("获取发票编号失败"); this.$message.error("获取发票编号失败");
this.back(); this.back();
}); });
...@@ -374,28 +396,28 @@ export default { ...@@ -374,28 +396,28 @@ export default {
//取消 //取消
remove() { remove() {
this.proutlist1.enclosureDescribe = null; 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; this.dialogFormVisible = false;
}, },
//添加发票金额 //添加发票金额
getchange() { getchange() {
let sum = 0; let sum = 0;
let list = []; let list = [];
this.invoiceListAdd.forEach(g => { this.invoiceListAdd.forEach((g) => {
this.getinvoivelist.forEach(item => { this.getinvoivelist.forEach((item) => {
if (item.invoiceId == g) { if (item.invoiceId == g) {
list.push({ list.push({
mone: item.mone mone: item.mone,
}); });
} }
}); });
}); });
list.forEach(item => { list.forEach((item) => {
sum += item.mone; sum += item.mone;
}); });
this.expendFrom.expendMoney = sum; this.expendFrom.expendMoney = sum;
} },
} },
}; };
</script> </script>
......
This diff is collapsed.
...@@ -2,7 +2,12 @@ ...@@ -2,7 +2,12 @@
<div class="container"> <div class="container">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :xl="8" :lg="10" :md="8" :sm="12" :xs="24"> <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-form-item label="项目名称" prop="projectName">
<el-input v-model="incomeFrom.projectName" disabled></el-input> <el-input v-model="incomeFrom.projectName" disabled></el-input>
</el-form-item> </el-form-item>
...@@ -66,7 +71,9 @@ ...@@ -66,7 +71,9 @@
</el-col> </el-col>
<!-- 附件上传 --> <!-- 附件上传 -->
<el-col :xl="8" :lg="10" :md="8" :sm="12" :xs="24" class="contract"> <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%"> <el-dialog title="附件" :visible.sync="dialogFormVisible" width="55%">
<div style="width: 60%; margin-left: 30px"> <div style="width: 60%; margin-left: 30px">
<el-input <el-input
...@@ -85,6 +92,7 @@ ...@@ -85,6 +92,7 @@
:on-remove="delfile1" :on-remove="delfile1"
:auto-upload="false" :auto-upload="false"
:on-change="onChangepdf" :on-change="onChangepdf"
:on-success="Refresh"
:data="proutlist1" :data="proutlist1"
multiple multiple
style="margin: 20px 0px" style="margin: 20px 0px"
...@@ -94,7 +102,9 @@ ...@@ -94,7 +102,9 @@
将文件拖到此处,或 将文件拖到此处,或
<em>点击上传附件</em> <em>点击上传附件</em>
</div> </div>
<div class="el-upload__tip" slot="tip">只能上传文件,且不超过500kb</div> <div class="el-upload__tip" slot="tip">
只能上传文件,且不超过500kb
</div>
</el-upload> </el-upload>
</div> </div>
<div style="margin-left: 75%"> <div style="margin-left: 75%">
...@@ -103,14 +113,19 @@ ...@@ -103,14 +113,19 @@
type="primary" type="primary"
@click="dialogFormVisible = false" @click="dialogFormVisible = false"
style="margin-top: 20px" style="margin-top: 20px"
>确 定</el-button> >确 定</el-button
>
</div> </div>
</el-dialog> </el-dialog>
</el-col> </el-col>
<!-- 按钮 --> <!-- 按钮 -->
<el-col :span="24" style="margin-left: 120px"> <el-col :span="24" style="margin-left: 120px">
<el-button type="success" icon="el-icon-upload2" @click="submitForm()">提交</el-button> <el-button type="success" icon="el-icon-upload2" @click="submitForm()"
<el-button type="info" icon="el-icon-refresh-left" @click="resetForm()">重置信息</el-button> >提交</el-button
>
<el-button type="info" icon="el-icon-refresh-left" @click="resetForm()"
>重置信息</el-button
>
<el-button @click="back()">返回</el-button> <el-button @click="back()">返回</el-button>
</el-col> </el-col>
</el-row> </el-row>
...@@ -121,15 +136,15 @@ ...@@ -121,15 +136,15 @@
import { import {
selectByProjectId, selectByProjectId,
selectAllBystatus, selectAllBystatus,
updatesubmit updatesubmit,
} from "@/api/project"; } from "@/api/project";
import { selectAll } from "@/api/type"; import { selectAll } from "@/api/type";
import { insert } from "@/api/imcome"; import { insert } from "@/api/imcome";
import { incomeAdd as rules} from "../rules"; import { incomeAdd as rules } from "../rules";
export default { export default {
data() { data() {
return { return {
rules:rules, rules: rules,
//表单 //表单
incomeFrom: { incomeFrom: {
incomeBody: null, incomeBody: null,
...@@ -142,8 +157,9 @@ export default { ...@@ -142,8 +157,9 @@ export default {
projectId: null, projectId: null,
userId: null, userId: null,
projectName: null, projectName: null,
incomebaoxioa: null //报销的字段 incomebaoxioa: null, //报销的字段
}, },
action1: null,
invoiceListAdd: [], //选择的发票号 invoiceListAdd: [], //选择的发票号
getinvoivelist: [], //查询的能选择的表单信息 getinvoivelist: [], //查询的能选择的表单信息
typeList: [], //收入类型列表 typeList: [], //收入类型列表
...@@ -155,27 +171,29 @@ export default { ...@@ -155,27 +171,29 @@ export default {
enclosureDescribe: "", enclosureDescribe: "",
status: 0, //0收入 1支出 status: 0, //0收入 1支出
companyId: null, companyId: null,
userId: null userId: null,
"X-Token": null,
}, },
//查询发票编号的参数 //查询发票编号的参数
getinvoiveId: { getinvoiveId: {
userId: null, userId: null,
companyId: null, companyId: null,
type: 0 type: 0,
}, },
//附件 //附件
dialogFormVisible: false dialogFormVisible: false,
}; };
}, },
computed: { computed: {
projectId() { projectId() {
return this.$route.query.id; return this.$route.query.id;
} },
}, },
created() { created() {
//用户id //用户id
this.incomeFrom.userId = this.$store.getters.urId; 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.action1 = process.env.VUE_APP_BASE_API + "/file/updataEnclosures";
this.getinvoiveId.userId = this.$store.getters.urId; this.getinvoiveId.userId = this.$store.getters.urId;
this.getinvoiveId.companyId = this.$store.getters.companyId; this.getinvoiveId.companyId = this.$store.getters.companyId;
...@@ -210,10 +228,10 @@ export default { ...@@ -210,10 +228,10 @@ export default {
}, },
//提交 //提交
submitForm() { submitForm() {
this.$refs.form.validate(valid => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
insert(this.incomeFrom) insert(this.incomeFrom)
.then(res => { .then((res) => {
if (res.success) { if (res.success) {
//判断是否有附件文件 //判断是否有附件文件
if (this.fileTypepdf) { if (this.fileTypepdf) {
...@@ -224,14 +242,14 @@ export default { ...@@ -224,14 +242,14 @@ export default {
if (this.invoiceListAdd.length > 0) { if (this.invoiceListAdd.length > 0) {
let list = []; let list = [];
//提交发票与收入关系 status默认为1 表示发票已报销 //提交发票与收入关系 status默认为1 表示发票已报销
this.invoiceListAdd.forEach(item => { this.invoiceListAdd.forEach((item) => {
list.push({ list.push({
invoiceId: item, invoiceId: item,
incomeId: res.data, incomeId: res.data,
status: 1 status: 1,
}); });
}); });
updatesubmit(list).then(res => { updatesubmit(list).then((res) => {
if (res.success) { if (res.success) {
this.$message.success(res.msg); this.$message.success(res.msg);
this.back(); this.back();
...@@ -246,7 +264,7 @@ export default { ...@@ -246,7 +264,7 @@ export default {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}) })
.catch(error => { .catch((error) => {
this.$message.error("提交失败"); this.$message.error("提交失败");
}); });
} }
...@@ -265,8 +283,8 @@ export default { ...@@ -265,8 +283,8 @@ export default {
path: "/incomeList", path: "/incomeList",
query: { query: {
id: this.$route.query.id, id: this.$route.query.id,
backid: this.$route.query.backid backid: this.$route.query.backid,
} },
}); });
}, },
//合同文件校验 //合同文件校验
...@@ -286,10 +304,10 @@ export default { ...@@ -286,10 +304,10 @@ export default {
getTypeList() { getTypeList() {
let param = { let param = {
companyId: this.$store.getters.companyId, companyId: this.$store.getters.companyId,
typeCategory: 0 typeCategory: 0,
}; };
selectAll(param) selectAll(param)
.then(res => { .then((res) => {
if (res.success) { if (res.success) {
this.typeList = res.data; this.typeList = res.data;
} else { } else {
...@@ -297,18 +315,26 @@ export default { ...@@ -297,18 +315,26 @@ export default {
this.back(); this.back();
} }
}) })
.catch(error => { .catch((error) => {
this.$message.error("获取类型失败"); this.$message.error("获取类型失败");
this.back(); this.back();
}); });
}, },
//附件上传成功的回调
Refresh(res) {
if (res.success) {
this.$message.success(res.msg);
} else {
this.$message.error(res.msg);
}
},
//获取项目 //获取项目
getProject() { getProject() {
let param = { let param = {
projectId: this.projectId projectId: this.projectId,
}; };
selectByProjectId(param) selectByProjectId(param)
.then(res => { .then((res) => {
if (res.success) { if (res.success) {
this.projectData = res.data; this.projectData = res.data;
this.incomeFrom.projectName = res.data.projectName; this.incomeFrom.projectName = res.data.projectName;
...@@ -318,7 +344,7 @@ export default { ...@@ -318,7 +344,7 @@ export default {
this.back(); this.back();
} }
}) })
.catch(error => { .catch((error) => {
this.$message.error("获取项目失败"); this.$message.error("获取项目失败");
this.back(); this.back();
}); });
...@@ -326,7 +352,7 @@ export default { ...@@ -326,7 +352,7 @@ export default {
//查询发票编号 //查询发票编号
Selectinsertlsit() { Selectinsertlsit() {
selectAllBystatus(this.getinvoiveId) selectAllBystatus(this.getinvoiveId)
.then(res => { .then((res) => {
if (res.success) { if (res.success) {
this.getinvoivelist = res.data; this.getinvoivelist = res.data;
} else { } else {
...@@ -334,41 +360,46 @@ export default { ...@@ -334,41 +360,46 @@ export default {
this.back(); this.back();
} }
}) })
.catch(error => { .catch((error) => {
this.$message.error("获取发票编号失败"); this.$message.error("获取发票编号失败");
this.back(); this.back();
}); });
}, },
//清楚合同文件 //清楚合同文件
delfile1() { delfile1(file) {
this.fileTypepdf = false; this.fileTypepdf = false;
this.fileList1 = this.fileList1.filter(item => item.uid !== file.uid); this.fileList1 = this.fileList1.filter((item) => item.uid !== file.uid);
}, },
//取消 //取消
remove() { remove() {
this.proutlist1.enclosureDescribe = null; this.proutlist1.enclosureDescribe = null;
this.delfile1(); this.clearFile();
this.dialogFormVisible = false; this.dialogFormVisible = false;
},
//文件清除
clearFile(){
this.fileList1 = []
}, },
//添加发票金额 //添加发票金额
getchange() { getchange() {
let sum = 0; let sum = 0;
let list = []; let list = [];
this.invoiceListAdd.forEach(g => { this.invoiceListAdd.forEach((g) => {
this.getinvoivelist.forEach(item => { this.getinvoivelist.forEach((item) => {
if (item.invoiceId == g) { if (item.invoiceId == g) {
list.push({ list.push({
mone: item.mone mone: item.mone,
}); });
} }
}); });
}); });
list.forEach(item => { list.forEach((item) => {
sum += item.mone; sum += item.mone;
}); });
this.incomeFrom.incomeMoney = sum; this.incomeFrom.incomeMoney = sum;
} },
} },
}; };
</script> </script>
......
This diff is collapsed.
...@@ -84,7 +84,7 @@ export default { ...@@ -84,7 +84,7 @@ export default {
this.memberList = res.data.list; this.memberList = res.data.list;
this.total = res.data.total; this.total = res.data.total;
} else { } else {
this.$message.error(res.data); this.$message.error(res.msg);
} }
}) })
.catch(error => { .catch(error => {
......
...@@ -136,7 +136,7 @@ export default { ...@@ -136,7 +136,7 @@ export default {
this.$message.error("获取员工信息失败"); this.$message.error("获取员工信息失败");
}); });
} else { } else {
this.$message.error(res.data); this.$message.error(res.msg);
this.back(); this.back();
} }
}) })
......
...@@ -2,7 +2,12 @@ ...@@ -2,7 +2,12 @@
<div class="container"> <div class="container">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :xl="12" :lg="12" :md="12" :sm="12" :xs="24"> <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-form-item label="项目名称" prop="projectName">
<el-input v-model="projectFrom.projectName"></el-input> <el-input v-model="projectFrom.projectName"></el-input>
</el-form-item> </el-form-item>
...@@ -38,15 +43,25 @@ ...@@ -38,15 +43,25 @@
<el-form-item label="项目详情" prop="projectInformation"> <el-form-item label="项目详情" prop="projectInformation">
<el-input <el-input
type="textarea" type="textarea"
:autosize="{ minRows: 4, maxRows: 6}" :autosize="{ minRows: 4, maxRows: 6 }"
placeholder="请输入内容" placeholder="请输入内容"
v-model="projectFrom.projectInformation" v-model="projectFrom.projectInformation"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="success" icon="el-icon-upload2" @click="submitForm()">提交</el-button> <el-button
<el-button type="info" icon="el-icon-refresh-left" @click="resetForm()">重置信息</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-button @click="back()">返回</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -57,18 +72,23 @@ ...@@ -57,18 +72,23 @@
负责人: 负责人:
<el-tag <el-tag
:key="index" :key="index"
v-for="(projectLeader,index) in userIdAdd" v-for="(projectLeader, index) in userIdAdd"
closable closable
:disable-transitions="false" :disable-transitions="false"
@close="delectTag(index)" @close="delectTag(index)"
style="margin:0px 10px" style="margin: 0px 10px"
>{{projectLeader}}</el-tag> >{{ projectLeader }}</el-tag
>
</div> </div>
<div class="projectLeader"> <div class="projectLeader">
<div style="marrgin">选择区:</div> <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 <el-option
v-for="item in rolesList" v-for="item in rolesList"
:key="item.rlId" :key="item.rlId"
...@@ -76,15 +96,16 @@ ...@@ -76,15 +96,16 @@
:value="item.rlId" :value="item.rlId"
></el-option> ></el-option>
</el-select> </el-select>
<!-- <el-button type="primary" @click="ggb()" :disabled="isgetrules">搜索</el-button> -->
<div class="personList"> <div class="personList">
<el-checkbox-group v-model="projectLeaderList"> <el-checkbox-group v-model="projectLeaderList">
<el-checkbox <el-checkbox
:label="ch.userId" :label="ch.userId"
v-for="ch in checkList" v-for="ch in checkList"
:key="ch.userId" :key="ch.userId"
style="margin: 10px 20px"
@change="AddSelect(ch)" @change="AddSelect(ch)"
>{{ch.userName}}</el-checkbox> >{{ ch.userName }}</el-checkbox
>
</el-checkbox-group> </el-checkbox-group>
</div> </div>
</div> </div>
...@@ -97,7 +118,7 @@ ...@@ -97,7 +118,7 @@
<script> <script>
import { insert } from "@/api/project"; import { insert } from "@/api/project";
import { selectAllByCompanyId, insertBatch, secletAllByRlid } from "@/api/role"; 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 { export default {
data() { data() {
return { return {
...@@ -106,7 +127,7 @@ export default { ...@@ -106,7 +127,7 @@ export default {
//收集查询员工数据 //收集查询员工数据
list: { list: {
rlId: 0, rlId: 0,
companyId: 0 companyId: 0,
}, },
//添加负责人数组 //添加负责人数组
insertBatch: [], insertBatch: [],
...@@ -126,33 +147,31 @@ export default { ...@@ -126,33 +147,31 @@ export default {
projectPartyb: null, projectPartyb: null,
projectInformation: null, projectInformation: null,
timeSlot: null timeSlot: null,
}, },
rules: { rules: {
projectName: [ projectName: [
{ required: true, message: "请输入项目名称", trigger: "blur" } { required: true, message: "请输入项目名称", trigger: "blur" },
],
projectNumber: [
{ validator: account_password_valid, trigger: "blur" }
], ],
projectNumber: [{ validator: account_password_valid, trigger: "blur" }],
projectAmount: [ projectAmount: [
{ {
required: true, required: true,
validator: money, validator: money,
trigger: "change" trigger: "change",
} },
], ],
timeSlot: [ timeSlot: [
{ required: true, message: "请选择日期", trigger: "change" } { required: true, message: "请选择日期", trigger: "change" },
], ],
projectPartyb: [ projectPartyb: [
{ {
required: true, required: true,
message: "请输入项目合作方", message: "请输入项目合作方",
trigger: "blur" trigger: "blur",
} },
] ],
}, },
isgetrules: false, isgetrules: false,
//显示tag //显示tag
...@@ -162,8 +181,8 @@ export default { ...@@ -162,8 +181,8 @@ export default {
//收集userId //收集userId
userIdAdd: [], userIdAdd: [],
personListForm: { personListForm: {
rlId: null rlId: null,
} },
}; };
}, },
created() { created() {
...@@ -175,14 +194,14 @@ export default { ...@@ -175,14 +194,14 @@ export default {
//获取公司全部角色 //获取公司全部角色
getRoleList() { getRoleList() {
selectAllByCompanyId({ companyId: this.$store.getters.companyId }) selectAllByCompanyId({ companyId: this.$store.getters.companyId })
.then(res => { .then((res) => {
if (res.success) { if (res.success) {
this.rolesList = res.data; this.rolesList = res.data;
} else { } else {
this.$message.error(res.data); this.$message.error(res.msg);
} }
}) })
.catch(error => { .catch((error) => {
this.$message.error("查询数据失败"); this.$message.error("查询数据失败");
}); });
//添加负责人 //添加负责人
...@@ -192,7 +211,7 @@ export default { ...@@ -192,7 +211,7 @@ export default {
this.list.rlId = this.personListForm.rlId; this.list.rlId = this.personListForm.rlId;
this.list.companyId = this.$store.getters.companyId; this.list.companyId = this.$store.getters.companyId;
let result = await secletAllByRlid(this.list); let result = await secletAllByRlid(this.list);
if (result.code == 20000) { if (result.success) {
this.checkList = result.data; this.checkList = result.data;
} }
}, },
...@@ -200,7 +219,6 @@ export default { ...@@ -200,7 +219,6 @@ export default {
delectTag(index) { delectTag(index) {
this.projectLeaderList.splice(index, 1); this.projectLeaderList.splice(index, 1);
this.userIdAdd.splice(index, 1); this.userIdAdd.splice(index, 1);
console.log(this.userIdAdd);
}, },
AddSelect(row) { AddSelect(row) {
if (this.projectLeaderList.indexOf(row.userId) > -1) { if (this.projectLeaderList.indexOf(row.userId) > -1) {
...@@ -209,7 +227,6 @@ export default { ...@@ -209,7 +227,6 @@ export default {
let index = this.userIdAdd.indexOf(row.userName); let index = this.userIdAdd.indexOf(row.userName);
this.userIdAdd.splice(index, 1); this.userIdAdd.splice(index, 1);
} }
console.log(this.userIdAdd);
}, },
//时间处理 //时间处理
time(val) { time(val) {
...@@ -228,38 +245,38 @@ export default { ...@@ -228,38 +245,38 @@ export default {
//提交数据 //提交数据
submitForm() { submitForm() {
//第一步校验数据完整性 //第一步校验数据完整性
this.$refs.form.validate(valid => { this.$refs.form.validate((valid) => {
if (this.projectLeaderList.length < 1) { if (this.projectLeaderList.length < 1) {
this.$message.warning("请选择项目负责人"); this.$message.warning("请选择项目负责人");
} else if (valid) { } else if (valid) {
//第四步提交 //第四步提交
console.log(this.projectFrom);
insert(this.projectFrom) insert(this.projectFrom)
.then(res => { .then((res) => {
if (res.success) { if (res.success) {
let dateadd = []; let dateadd = [];
this.projectLeaderList.forEach(item => { this.projectLeaderList.forEach((item) => {
dateadd.push({ dateadd.push({
userId: item, userId: item,
projectId: res.data, projectId: res.data,
memberPression: 0 memberPression: 0,
}); });
}); });
console.log(dateadd); insertBatch(dateadd).then((res) => {
let restle = insertBatch(dateadd); if (res.success) {
if ((restle.success = true)) {
console.log("保存成功");
this.$message.success("新建成功"); this.$message.success("新建成功");
this.back(); this.back();
} else { } else {
this.$message.success("发生错误"); this.$message.error("发生错误");
} }
}).catch(e=>{
this.$message.error("提交失败");
})
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}) })
.catch(error => { .catch((error) => {
this.$message.error("插入失败"); this.$message.error(error.msg);
}); });
} }
}); });
...@@ -287,7 +304,7 @@ export default { ...@@ -287,7 +304,7 @@ export default {
date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds(); date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
return Y + M + D + h + m + s; return Y + M + D + h + m + s;
}, },
} },
}; };
</script> </script>
...@@ -305,5 +322,6 @@ export default { ...@@ -305,5 +322,6 @@ export default {
} }
.personList { .personList {
margin-top: 20px; margin-top: 20px;
width: 400px;
} }
</style> </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