Commit 70315c35 authored by 柳 佳乐's avatar 柳 佳乐
Browse files

20221116

parent 528a0908
...@@ -116,7 +116,7 @@ export function pathValid(rule, value, callback) { ...@@ -116,7 +116,7 @@ export function pathValid(rule, value, callback) {
} }
//定义金额校验 //定义金额校验
export function money(rule, value, callback) { export function money(rule, value, callback) {
let RegExp = /(^([-]?)[1-9]([0-9]+)?(\.[0-9]{1,6})?$)|(^([-]?)(0){1}$)|(^([-]?)[0-9]\.[0-9]([0-9])?$)/; let RegExp = /(^([-]?)[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^([-]?)(0){1}$)|(^([-]?)[0-9]\.[0-9]([0-9])?$)/;
if (value === null || value === undefined || value === '') { if (value === null || value === undefined || value === '') {
callback(new Error('金额不能为空')) callback(new Error('金额不能为空'))
} else if (RegExp.test(value)) { } else if (RegExp.test(value)) {
...@@ -168,6 +168,6 @@ export function Invoice_code(rule, value, callback) { ...@@ -168,6 +168,6 @@ export function Invoice_code(rule, value, callback) {
} else if (reg.test(value)) { } else if (reg.test(value)) {
callback(); callback();
} else { } else {
callback(new Error("输入数字格式为8位数字")); callback(new Error("输入数字格式为12位数字"));
} }
} }
...@@ -373,7 +373,7 @@ ...@@ -373,7 +373,7 @@
</el-form> </el-form>
</el-drawer> </el-drawer>
</div> </div>
<!-- 同意驳回 --> <!-- 同意驳回 -->
<el-drawer <el-drawer
title="核实金额" title="核实金额"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
...@@ -617,7 +617,7 @@ export default { ...@@ -617,7 +617,7 @@ export default {
tableData: [], tableData: [],
// 随从人员 // 随从人员
entouragelist: [], entouragelist: [],
// 同意驳回 // 同意驳回
agreeOrapproval: { agreeOrapproval: {
tripId: null, tripId: null,
tripStatus: 0, //状态 tripStatus: 0, //状态
......
...@@ -502,7 +502,7 @@ export default { ...@@ -502,7 +502,7 @@ export default {
entouragelist: [], entouragelist: [],
drawer: false, drawer: false,
paramlist: {}, paramlist: {},
// 同意驳回 // 同意驳回
agreeOrapproval: { agreeOrapproval: {
tripStatus: 0, //状态 tripStatus: 0, //状态
headmanId: null, // userid headmanId: null, // userid
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<el-form <el-form
ref="ruleform" ref="ruleform"
:model="spendreimbursementform" :model="spendreimbursementform"
:label-position="labelPosition"
label-width="120px" label-width="120px"
:rules="rules" :rules="rules"
> >
...@@ -139,7 +140,7 @@ ...@@ -139,7 +140,7 @@
<el-form-item <el-form-item
label="申报总金额(大写)" label="申报总金额(大写)"
prop="applyTotalAmountLarge" prop="applyTotalAmountLarge"
label-width="140" label-width="120"
> >
<el-input <el-input
disabled disabled
...@@ -150,7 +151,7 @@ ...@@ -150,7 +151,7 @@
<el-form-item <el-form-item
label="申报总金额(小写)" label="申报总金额(小写)"
prop="applyTotalAmountSmall" prop="applyTotalAmountSmall"
label-width="140" label-width="120"
> >
<el-input <el-input
v-model="spendreimbursementform.applyTotalAmountSmall" v-model="spendreimbursementform.applyTotalAmountSmall"
...@@ -184,6 +185,8 @@ ...@@ -184,6 +185,8 @@
<!-- nobillExplain --> <!-- nobillExplain -->
<el-form-item label="无票据说明" prop="nobillExplain"> <el-form-item label="无票据说明" prop="nobillExplain">
<el-input <el-input
type="textarea"
:rows="5"
v-model="spendreimbursementform.nobillExplain" v-model="spendreimbursementform.nobillExplain"
></el-input> ></el-input>
</el-form-item> </el-form-item>
...@@ -193,7 +196,6 @@ ...@@ -193,7 +196,6 @@
v-model="spendreimbursementform.fromList" v-model="spendreimbursementform.fromList"
multiple multiple
filterable filterable
default-first-option default-first-option
placeholder="请选择" placeholder="请选择"
> >
...@@ -214,6 +216,24 @@ ...@@ -214,6 +216,24 @@
v-model="spendreimbursementform.remarks" v-model="spendreimbursementform.remarks"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<!-- 附件上传 -->
<el-form-item label="附件上传">
<el-upload
class="upload-demo"
drag
:action="action1"
ref="enclosureUpload"
:data="enclosurelist"
:auto-upload="false"
multiple
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">
将文件拖到此处,或<em>点击上传</em>
</div>
</el-upload>
</el-form-item>
</div> </div>
</el-col> </el-col>
<!-- 第四列表单 --> <!-- 第四列表单 -->
...@@ -245,7 +265,7 @@ ...@@ -245,7 +265,7 @@
trigger: 'blur', trigger: 'blur',
}" }"
> >
<el-col :span="8" <el-col :span="12"
><div class="grid-content bg-purple-light"> ><div class="grid-content bg-purple-light">
<el-input <el-input
v-model.trim="item.personnelName" v-model.trim="item.personnelName"
...@@ -255,8 +275,10 @@ ...@@ -255,8 +275,10 @@
><div class="grid-content bg-purple"> ><div class="grid-content bg-purple">
<el-button <el-button
style="margin-left: 5px" style="margin-left: 5px"
:disabled="deletestaus"
@click.prevent="removeDomain(item)" @click.prevent="removeDomain(item)"
:disabled="
peopleList.insertBatch.length == 1 ? true : false
"
>删除</el-button >删除</el-button
> >
</div></el-col </div></el-col
...@@ -309,6 +331,7 @@ export default { ...@@ -309,6 +331,7 @@ export default {
this.Projectpeople.companyId = this.$store.getters.companyId; this.Projectpeople.companyId = this.$store.getters.companyId;
this.spendreimbursementform.companyId = this.$store.getters.companyId; this.spendreimbursementform.companyId = this.$store.getters.companyId;
this.spendreimbursementform.userId = this.$store.getters.urId; this.spendreimbursementform.userId = this.$store.getters.urId;
this.action1 = process.env.VUE_APP_BASE_API + "/file/updataEnclosures";
this.Selectinsertlsit(); this.Selectinsertlsit();
this.reimebursementtypeItem(); this.reimebursementtypeItem();
this.reimebursementprojectItem(); this.reimebursementprojectItem();
...@@ -316,12 +339,23 @@ export default { ...@@ -316,12 +339,23 @@ export default {
}, },
data() { data() {
return { return {
// 文字对齐方式
labelPosition: "left",
// 图片提交地址
action1: null,
//附件提交附带参数
enclosurelist: {
Id: null,
companyId: null,
enclosureDescribe: "",
status: 3,
userId: null,
},
dialogFormVisible: false, dialogFormVisible: false,
labelPosition: "left", labelPosition: "left",
values: false, values: false,
timeSlot: null, timeSlot: null,
userId: [], userId: [],
// fromList: [], //发票号码
form: [], form: [],
// 收集的是页面表单的数据 // 收集的是页面表单的数据
spendreimbursementform: { spendreimbursementform: {
...@@ -348,7 +382,6 @@ export default { ...@@ -348,7 +382,6 @@ export default {
lodgingCost: 0, lodgingCost: 0,
insuranceCost: 0, insuranceCost: 0,
otherCost: 0, otherCost: 0,
remarks: "",
nobillExplain: "", nobillExplain: "",
applyTotalAmountLarge: "", applyTotalAmountLarge: "",
applyTotalAmountSmall: null, applyTotalAmountSmall: null,
...@@ -358,6 +391,7 @@ export default { ...@@ -358,6 +391,7 @@ export default {
days: null, days: null,
userId: null, userId: null,
tripStatus: 0, tripStatus: 0,
enclosureDescribe: "描述", //附件描述
}, },
peopleList: { peopleList: {
insertBatch: [ insertBatch: [
...@@ -388,7 +422,10 @@ export default { ...@@ -388,7 +422,10 @@ export default {
// 收集随从人员进行展示 // 收集随从人员进行展示
collectProjectpeople: [], collectProjectpeople: [],
getinvoivelist: [], getinvoivelist: [],
deletestaus: true,
// 附件上传
fileTypepdf: false, //判断合同文件是否存在
// 验证规则 // 验证规则
rules: { rules: {
fromList: [ fromList: [
...@@ -412,9 +449,7 @@ export default { ...@@ -412,9 +449,7 @@ export default {
purposePlace: [{ required: true, message: "此项不能为空!" }], purposePlace: [{ required: true, message: "此项不能为空!" }],
transitPlace: [{ required: true, message: "此项不能为空!" }], transitPlace: [{ required: true, message: "此项不能为空!" }],
applyTotalAmountLarge: [{ required: true, message: "此项不能为空!" }], applyTotalAmountLarge: [{ required: true, message: "此项不能为空!" }],
applyTotalAmountSmall: [ applyTotalAmountSmall: [{ validator: money, trigger: "blur" }],
{ validator: money, trigger: "blur" },
],
applyTime: [ applyTime: [
{ {
required: true, required: true,
...@@ -424,32 +459,14 @@ export default { ...@@ -424,32 +459,14 @@ export default {
], ],
planeTicket: [{ required: true, message: "此项不能为空!" }], planeTicket: [{ required: true, message: "此项不能为空!" }],
vehicle: [{ required: true, message: "此项不能为空!" }], vehicle: [{ required: true, message: "此项不能为空!" }],
foodAllowance: [ foodAllowance: [{ validator: money, trigger: "blur" }],
{ validator: money, trigger: "blur" }, publicMiscellaneousSubsidy: [{ validator: money, trigger: "blur" }],
], tripCost: [{ validator: money, trigger: "blur" }],
publicMiscellaneousSubsidy: [ planeTicket: [{ validator: money, trigger: "blur" }],
{ validator: money, trigger: "blur" }, trafficCost: [{ validator: money, trigger: "blur" }],
], lodgingCost: [{ validator: money, trigger: "blur" }],
tripCost: [ insuranceCost: [{ validator: money, trigger: "blur" }],
{ validator: money, trigger: "blur" }, otherCost: [{ validator: money, trigger: "blur" }],
],
planeTicket: [
{ validator: money, trigger: "blur" },
],
trafficCost: [
{ validator: money, trigger: "blur" },
],
lodgingCost: [
{ validator: money, trigger: "blur" },
],
insuranceCost: [
{ validator: money, trigger: "blur" },
],
otherCost: [
{ validator: money, trigger: "blur" },
],
remarks: [{ required: true, message: "此项不能为空!" }],
projectId: [ projectId: [
{ {
required: true, required: true,
...@@ -459,11 +476,6 @@ export default { ...@@ -459,11 +476,6 @@ export default {
], ],
startTime: [{ required: true, message: "此项不能为空!" }], startTime: [{ required: true, message: "此项不能为空!" }],
endTime: [{ required: true, message: "此项不能为空!" }], endTime: [{ required: true, message: "此项不能为空!" }],
trafficCost: [{ required: true, message: "此项不能为空!" }],
lodgingCost: [{ required: true, message: "此项不能为空!" }],
insuranceCost: [{ required: true, message: "此项不能为空!" }],
otherCost: [{ required: true, message: "此项不能为空!" }],
nobillExplain: [{ required: true, message: "此项不能为空!" }],
}, },
}; };
}, },
...@@ -492,6 +504,7 @@ export default { ...@@ -492,6 +504,7 @@ export default {
}, },
// 添加数据的方法 // 添加数据的方法
submitForm() { submitForm() {
this.$refs.ruleform.validate((valid) => { this.$refs.ruleform.validate((valid) => {
if (valid) { if (valid) {
insert(this.spendreimbursementform) insert(this.spendreimbursementform)
...@@ -502,19 +515,19 @@ export default { ...@@ -502,19 +515,19 @@ export default {
let obj1 = {}; let obj1 = {};
obj1.personnelName = this.$store.getters.name; obj1.personnelName = this.$store.getters.name;
obj1.tripId = tid; obj1.tripId = tid;
addpeopleList[0] = obj1;
this.peopleList.insertBatch.forEach((e) => { this.peopleList.insertBatch.forEach((e) => {
if(e.personnelName != null && e.personnelName != ''){
let obj = {}; let obj = {};
obj.personnelName = e.personnelName; obj.personnelName = e.personnelName;
addpeopleList.push(obj1, obj); obj.tripId = res.data;
addpeopleList.push(obj);
}
}); });
// 第二个方法 添加随从人员 // 第二个方法 添加随从人员
insertId(addpeopleList) insertId(addpeopleList)
.then((result) => { .then((result) => {
if (result.success) { if (result.success) {
// 添加成功以后 把表单的数据清空
this.$refs.ruleform.resetFields();
} else { } else {
this.$message.error(result.msg); this.$message.error(result.msg);
} }
...@@ -522,6 +535,7 @@ export default { ...@@ -522,6 +535,7 @@ export default {
.catch((error) => { .catch((error) => {
this.$message.error("失败"); this.$message.error("失败");
}); });
this.spendreimbursementform.fromList.forEach((e) => { this.spendreimbursementform.fromList.forEach((e) => {
let obj = {}; let obj = {};
obj.companyId = this.$store.getters.companyId; obj.companyId = this.$store.getters.companyId;
...@@ -530,6 +544,17 @@ export default { ...@@ -530,6 +544,17 @@ export default {
obj.invoiceId = e; obj.invoiceId = e;
this.form.push(obj); this.form.push(obj);
}); });
// 上传附件
this.enclosurelist.Id = res.data;
this.enclosurelist.companyId =
this.spendreimbursementform.companyId;
this.enclosurelist.enclosureDescribe =
this.spendreimbursementform.enclosureDescribe;
this.enclosurelist.userId =
this.spendreimbursementform.userId;
this.$refs.enclosureUpload.submit();
// 第三个方法 添加发票 // 第三个方法 添加发票
Addinvoice(this.form) Addinvoice(this.form)
.then((resu) => { .then((resu) => {
...@@ -550,15 +575,11 @@ export default { ...@@ -550,15 +575,11 @@ export default {
.catch((error) => { .catch((error) => {
this.$message.error("添加失败"); this.$message.error("添加失败");
}); });
} else {
console.log("error submit!!");
return false;
} }
}); });
}, },
// //
addDomain() { addDomain() {
this.deletestaus = false;
this.peopleList.insertBatch.push({ this.peopleList.insertBatch.push({
personnelName: "", personnelName: "",
tripId: null, tripId: null,
...@@ -616,7 +637,6 @@ export default { ...@@ -616,7 +637,6 @@ export default {
}, },
// 弹窗按钮 // 弹窗按钮
addBtn1() { addBtn1() {
this.peopleList.insertBatch = [0];
this.deletestaus = true; this.deletestaus = true;
this.dialogFormVisible = true; this.dialogFormVisible = true;
}, },
......
...@@ -10,10 +10,7 @@ ...@@ -10,10 +10,7 @@
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="审批状态:"> <el-form-item label="审批状态:">
<el-select <el-select placeholder="请选择" v-model="queryitem.tripStatus">
placeholder="请选择"
v-model="queryitem.tripStatus"
>
<el-option label="待审批" value="0"></el-option> <el-option label="待审批" value="0"></el-option>
<el-option label="小组长通过" value="1"></el-option> <el-option label="小组长通过" value="1"></el-option>
<el-option label="小组长驳回" value="2"></el-option> <el-option label="小组长驳回" value="2"></el-option>
...@@ -162,7 +159,7 @@ ...@@ -162,7 +159,7 @@
align="center" align="center"
> >
</el-table-column> </el-table-column>
<el-table-column align="center" label="发票图片"> <el-table-column align="center" label="发票图片" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
style="margin: 5px" style="margin: 5px"
...@@ -172,16 +169,16 @@ ...@@ -172,16 +169,16 @@
>点击查看</el-button >点击查看</el-button
> >
<el-button <el-button
style="margin: 5px"
size="mini" size="mini"
icon="el-icon-edit"
type="success" type="success"
@click="updateinvoice()" @click="updateinvoice()"
v-if="scope.row.tripStatus == 0" v-if="scope.row.tripStatus == 0"
>修改发票号码</el-button >修改发票</el-button
> >
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="下载附件"> <el-table-column align="center" label="下载附件" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="primary" type="primary"
...@@ -218,25 +215,25 @@ ...@@ -218,25 +215,25 @@
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="操作"> <el-table-column align="center" label="操作" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
style="margin: 5px" style="margin: 5px"
size="mini" size="mini"
icon="el-icon-edit" icon="el-icon-user-solid"
type="info" type="info"
@click="updatereimbursementList(scope.row)" @click="updatebtn(scope.row)"
v-if="scope.row.tripStatus == 0" v-if="scope.row.tripStatus == 0"
>修改信息</el-button >修改随行人员</el-button
> >
<el-button <el-button
style="margin: 5px" style="margin: 5px"
size="mini" size="mini"
icon="el-icon-user-solid" icon="el-icon-edit"
type="success" type="info"
@click="updatebtn(scope.row)" @click="updatereimbursementList(scope.row)"
v-if="scope.row.tripStatus == 0" v-if="scope.row.tripStatus == 0"
>修改随行人员</el-button >修改信息</el-button
> >
<el-button <el-button
style="margin: 5px" style="margin: 5px"
...@@ -249,7 +246,7 @@ ...@@ -249,7 +246,7 @@
<el-button <el-button
style="margin: 5px" style="margin: 5px"
size="mini" size="mini"
type="info" type="warning"
@click="withdraw(scope.row)" @click="withdraw(scope.row)"
v-if="scope.row.tripStatus == 0" v-if="scope.row.tripStatus == 0"
> >
...@@ -432,17 +429,18 @@ ...@@ -432,17 +429,18 @@
<el-table-column label="序号" width="50" type="index"> <el-table-column label="序号" width="50" type="index">
</el-table-column> </el-table-column>
<el-table-column label="发票号码"> <el-table-column label="发票号码">
<template slot-scope="scope"> <template slot-scope="props">
{{ scope.row.number }} {{ props.row.number }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作"> <el-table-column label="操作">
<template slot-scope="scope"> <template slot-scope="props">
<el-button <el-button
type="danger" type="danger"
size="mini" size="mini"
icon="el-icon-delete" icon="el-icon-delete"
@click="deleteinvoice(scope.row)" :disabled="invoicestatus == true ? true : false"
@click="deleteinvoice(props.row)"
>删除</el-button >删除</el-button
> >
</template> </template>
...@@ -451,10 +449,10 @@ ...@@ -451,10 +449,10 @@
</el-drawer> </el-drawer>
<!-- 添加发票号码 --> <!-- 添加发票号码 -->
<el-dialog title="发票号码" :visible.sync="insertvioiceFrom"> <el-dialog title="发票号码" :visible.sync="insertvioiceFrom">
<el-form :model="fromList"> <el-form :model="invoicelistform">
<el-form-item label="发票号码(可多选):"> <el-form-item label="发票号码(可多选):">
<el-select <el-select
v-model="fromList" v-model="invoicelistform.fromList"
multiple multiple
filterable filterable
default-first-option default-first-option
...@@ -475,7 +473,7 @@ ...@@ -475,7 +473,7 @@
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
<!-- 对话框1 --> <!-- 修改随从人员 -->
<el-dialog title="修改随从人员" :visible.sync="dialogFormVisible"> <el-dialog title="修改随从人员" :visible.sync="dialogFormVisible">
<el-form :model="peopleList" ref="peopleForm"> <el-form :model="peopleList" ref="peopleForm">
<el-row <el-row
...@@ -546,7 +544,7 @@ ...@@ -546,7 +544,7 @@
<el-button <el-button
type="primary" type="primary"
style="margin-left: 5%; margin: 30px 50px" style="margin-left: 5%; margin: 30px 50px"
:disabled="disabled" :disabled="disabled2"
@click="updatecard" @click="updatecard"
>添加附件</el-button >添加附件</el-button
> >
...@@ -674,11 +672,7 @@ import { ...@@ -674,11 +672,7 @@ import {
} from "@/api/spendreimbursement"; } from "@/api/spendreimbursement";
// insertId // insertId
import { insertId } from "@/api/spendreimbursement.js"; import { insertId } from "@/api/spendreimbursement.js";
import { import { deletBystatus, selectAllBystatus } from "@/api/project";
selectByinvoice,
deletBystatus,
selectAllBystatus,
} from "@/api/project";
//selectProjectpeople //selectProjectpeople
import { selectProjectpeople } from "@/api/spendreimbursement.js"; import { selectProjectpeople } from "@/api/spendreimbursement.js";
export default { export default {
...@@ -719,6 +713,8 @@ export default { ...@@ -719,6 +713,8 @@ export default {
companyId: null, companyId: null,
}, },
getinvoivelist: [], getinvoivelist: [],
// 发票状态
invoicestatus: false,
//查看详情 //查看详情
paramlist: {}, paramlist: {},
// 收集随从人员名字 // 收集随从人员名字
...@@ -737,7 +733,7 @@ export default { ...@@ -737,7 +733,7 @@ export default {
//drawer1: false, //drawer1: false,
direction: "rtl", direction: "rtl",
fileList1: [], //合同文件 fileList1: [], //合同文件
disabled: false, //隐藏 disabled2: false, //隐藏
getshow: 1, //判断show的显示与隐藏, getshow: 1, //判断show的显示与隐藏,
//查询附件 //查询附件
queryDTO: { queryDTO: {
...@@ -773,9 +769,11 @@ export default { ...@@ -773,9 +769,11 @@ export default {
table: false, table: false,
insertvioiceFrom: false, insertvioiceFrom: false,
invoicelist: [], invoicelist: [],
invoicelistform: {
fromList: [], //发票号码 fromList: [], //发票号码
form: [], },
formtripid: null, formtripid: null,
form: [],
parm: { parm: {
tripId: null, tripId: null,
...@@ -784,14 +782,14 @@ export default { ...@@ -784,14 +782,14 @@ export default {
}; };
}, },
methods: { methods: {
// //添加人员
addDomain() { addDomain() {
this.peopleList.collectName.push({ this.peopleList.collectName.push({
personnelName: "", personnelName: "",
tripId: null, tripId: null,
}); });
}, },
// //删除人员
removeDomain(item) { removeDomain(item) {
var index = this.peopleList.collectName.indexOf(item); var index = this.peopleList.collectName.indexOf(item);
this.$confirm("此操作将永久删除该随从人员, 是否继续?", "提示", { this.$confirm("此操作将永久删除该随从人员, 是否继续?", "提示", {
...@@ -870,7 +868,6 @@ export default { ...@@ -870,7 +868,6 @@ export default {
//查询出要添加的发票编号 //查询出要添加的发票编号
Selectinvoicelsit() { Selectinvoicelsit() {
this.insertvioiceFrom = true; this.insertvioiceFrom = true;
this.fromList = [];
let param = { let param = {
companyId: this.$store.getters.companyId, companyId: this.$store.getters.companyId,
status: 0, status: 0,
...@@ -894,7 +891,7 @@ export default { ...@@ -894,7 +891,7 @@ export default {
// 添加发票号码 // 添加发票号码
insertInvoice() { insertInvoice() {
// 第三个方法 添加发票 // 第三个方法 添加发票
this.fromList.forEach((e) => { this.invoicelistform.fromList.forEach((e) => {
let obj = {}; let obj = {};
obj.companyId = this.$store.getters.companyId; obj.companyId = this.$store.getters.companyId;
obj.status = 1; obj.status = 1;
...@@ -902,11 +899,15 @@ export default { ...@@ -902,11 +899,15 @@ export default {
obj.invoiceId = e; obj.invoiceId = e;
this.form.push(obj); this.form.push(obj);
}); });
if (this.form.length == 0) {
this.insertvioiceFrom = false;
} else {
Addinvoice(this.form) Addinvoice(this.form)
.then((resu) => { .then((resu) => {
if (resu.success) { if (resu.success) {
this.$message.success("添加成功!"); this.$message.success("添加成功!");
this.insertvioiceFrom = false; this.insertvioiceFrom = false;
this.table = false;
} else { } else {
this.$message.error(resu.msg); this.$message.error(resu.msg);
} }
...@@ -914,6 +915,7 @@ export default { ...@@ -914,6 +915,7 @@ export default {
.catch((error) => { .catch((error) => {
this.$message.error("失败"); this.$message.error("失败");
}); });
}
}, },
// 修改发票号码 // 修改发票号码
updateinvoice() { updateinvoice() {
...@@ -1052,6 +1054,11 @@ export default { ...@@ -1052,6 +1054,11 @@ export default {
.then((res) => { .then((res) => {
if (res.success) { if (res.success) {
this.invoicelist = res.data; this.invoicelist = res.data;
if (this.invoicelist.length == 1) {
this.invoicestatus = true;
} else {
this.invoicestatus = false;
}
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
this.back(); this.back();
...@@ -1079,11 +1086,28 @@ export default { ...@@ -1079,11 +1086,28 @@ export default {
}, },
// 撤回申请 // 撤回申请
withdraw(data) { withdraw(data) {
this.$confirm("此操作将永久删除该记录!, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
reimbursementListid(data.tripId).then((res) => { reimbursementListid(data.tripId).then((res) => {
if (res.success) { if (res.success) {
this.$message({
type: "success",
message: "撤回成功!",
});
this.getpagelist(); this.getpagelist();
} }
}); });
})
.catch(() => {
this.$message({
type: "info",
message: "已取消删除",
});
});
}, },
//查看图片的方法 //查看图片的方法
ReviseImage(row) { ReviseImage(row) {
...@@ -1122,6 +1146,11 @@ export default { ...@@ -1122,6 +1146,11 @@ export default {
selectImage(row) { selectImage(row) {
this.queryDTO.tripId = row.tripId; this.queryDTO.tripId = row.tripId;
this.proutlist1.Id = row.tripId; this.proutlist1.Id = row.tripId;
if (row.tripStatus == 2 || row.tripStatus == 0) {
this.disabled2 = false;
} else {
this.disabled2 = true;
}
selectByIdF(this.queryDTO) selectByIdF(this.queryDTO)
.then((res) => { .then((res) => {
if (res.success) { if (res.success) {
...@@ -1225,10 +1254,12 @@ export default { ...@@ -1225,10 +1254,12 @@ export default {
if (this.queryDTOList.length > 0) { if (this.queryDTOList.length > 0) {
this.getshow = 1; this.getshow = 1;
this.disabled = false; this.disabled = false;
this.backii();
this.delfile1(); this.delfile1();
} else { } else {
this.getshow = 3; this.getshow = 3;
this.disabled = false; this.disabled = false;
this.backii();
this.delfile1(); this.delfile1();
} }
}, },
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<el-form <el-form
ref="ruleform" ref="ruleform"
:model="spendreimbursementform" :model="spendreimbursementform"
:label-position="labelPosition"
label-width="120px" label-width="120px"
:rules="rules" :rules="rules"
:data="spendreimbursementform" :data="spendreimbursementform"
...@@ -12,10 +13,7 @@ ...@@ -12,10 +13,7 @@
<el-col :span="6"> <el-col :span="6">
<div class="grid-content bg-purple"> <div class="grid-content bg-purple">
<!-- projectId --> <!-- projectId -->
<el-form-item <el-form-item label="报销项目" prop="projectId">
label="报销项目"
prop="projectId"
>
<el-select <el-select
placeholder="请选择" placeholder="请选择"
v-model="spendreimbursementform.projectId" v-model="spendreimbursementform.projectId"
...@@ -233,6 +231,8 @@ export default { ...@@ -233,6 +231,8 @@ export default {
data() { data() {
return { return {
dialogFormVisible: false, dialogFormVisible: false,
// 文字对齐方式
labelPosition: "left",
values: false, values: false,
timeSlot: [], timeSlot: [],
userId: [], userId: [],
...@@ -314,9 +314,7 @@ export default { ...@@ -314,9 +314,7 @@ export default {
purposePlace: [{ required: true, message: "此项不能为空!" }], purposePlace: [{ required: true, message: "此项不能为空!" }],
transitPlace: [{ required: true, message: "此项不能为空!" }], transitPlace: [{ required: true, message: "此项不能为空!" }],
applyTotalAmountLarge: [{ required: true, message: "此项不能为空!" }], applyTotalAmountLarge: [{ required: true, message: "此项不能为空!" }],
applyTotalAmountSmall: [ applyTotalAmountSmall: [{ validator: money, trigger: "blur" }],
{ validator: money, trigger: "blur" },
],
applyTime: [ applyTime: [
{ {
required: true, required: true,
...@@ -326,30 +324,14 @@ export default { ...@@ -326,30 +324,14 @@ export default {
], ],
planeTicket: [{ required: true, message: "此项不能为空!" }], planeTicket: [{ required: true, message: "此项不能为空!" }],
vehicle: [{ required: true, message: "此项不能为空!" }], vehicle: [{ required: true, message: "此项不能为空!" }],
foodAllowance: [ foodAllowance: [{ validator: money, trigger: "blur" }],
{ validator: money, trigger: "blur" }, publicMiscellaneousSubsidy: [{ validator: money, trigger: "blur" }],
], tripCost: [{ validator: money, trigger: "blur" }],
publicMiscellaneousSubsidy: [ planeTicket: [{ validator: money, trigger: "blur" }],
{ validator: money, trigger: "blur" }, trafficCost: [{ validator: money, trigger: "blur" }],
], lodgingCost: [{ validator: money, trigger: "blur" }],
tripCost: [ insuranceCost: [{ validator: money, trigger: "blur" }],
{ validator: money, trigger: "blur" }, otherCost: [{ validator: money, trigger: "blur" }],
],
planeTicket: [
{ validator: money, trigger: "blur" },
],
trafficCost: [
{ validator: money, trigger: "blur" },
],
lodgingCost: [
{ validator: money, trigger: "blur" },
],
insuranceCost: [
{ validator: money, trigger: "blur" },
],
otherCost: [
{ validator: money, trigger: "blur" },
],
remarks: [{ required: true, message: "此项不能为空!" }], remarks: [{ required: true, message: "此项不能为空!" }],
projectId: [ projectId: [
...@@ -361,10 +343,6 @@ export default { ...@@ -361,10 +343,6 @@ export default {
], ],
startTime: [{ required: true, message: "此项不能为空!" }], startTime: [{ required: true, message: "此项不能为空!" }],
endTime: [{ required: true, message: "此项不能为空!" }], endTime: [{ required: true, message: "此项不能为空!" }],
trafficCost: [{ required: true, message: "此项不能为空!" }],
lodgingCost: [{ required: true, message: "此项不能为空!" }],
insuranceCost: [{ required: true, message: "此项不能为空!" }],
otherCost: [{ required: true, message: "此项不能为空!" }],
nobillExplain: [{ required: true, message: "此项不能为空!" }], nobillExplain: [{ required: true, message: "此项不能为空!" }],
}, },
}; };
...@@ -453,7 +431,6 @@ export default { ...@@ -453,7 +431,6 @@ export default {
// console.log(values); // console.log(values);
if (values == true) { if (values == true) {
this.spendreimbursementform.receiveSubsidy = 1; this.spendreimbursementform.receiveSubsidy = 1;
} else { } else {
this.spendreimbursementform.receiveSubsidy = 0; this.spendreimbursementform.receiveSubsidy = 0;
this.spendreimbursementform.foodAllowance = 0; this.spendreimbursementform.foodAllowance = 0;
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<span class="nowDate">{{nowDate}}</span> <span class="nowDate">{{nowDate}}</span>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="登记详情"> <el-form-item label="登记详情" prop="fixedDetails">
<el-input <el-input
type="textarea" type="textarea"
:rows="2" :rows="2"
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
v-model="FixedAssetsAddDTO.fixedDetails" v-model="FixedAssetsAddDTO.fixedDetails"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="登记备注"> <el-form-item label="登记备注" prop="registerRemarks">
<el-input v-model="FixedAssetsAddDTO.registerRemarks" laceholder="请输入登记备注"></el-input> <el-input v-model="FixedAssetsAddDTO.registerRemarks" laceholder="请输入登记备注"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="资产负责人" style="width:500px;"> <el-form-item label="资产负责人" style="width:500px;">
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
placeholder="请输入关键词" placeholder="请输入关键词"
:remote-method="remoteMethod" :remote-method="remoteMethod"
:loading="loading" :loading="loading"
:disabled="falesId" @change="grtselect()"
> >
<el-option <el-option
v-for="item in options" v-for="item in options"
...@@ -57,11 +57,6 @@ ...@@ -57,11 +57,6 @@
:value="item.userId" :value="item.userId"
></el-option> ></el-option>
</el-select> </el-select>
<el-button
style="width:110px;margin:0px 10px"
type="primary"
@click="grtselect()"
>{{name}}</el-button>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item style="margin-top:60px"> <el-form-item style="margin-top:60px">
...@@ -78,12 +73,10 @@ ...@@ -78,12 +73,10 @@
<script> <script>
import { insert } from "@/api/assets"; import { insert } from "@/api/assets";
import { secletAllStaff } from "@/api/user"; import { secletAllStaff } from "@/api/user";
import user from "../../store/modules/user";
import { money,account_password_valid } from "@/utils/myValidate"; import { money,account_password_valid } from "@/utils/myValidate";
export default { export default {
data() { data() {
return { return {
falesId: true,
FixedAssetsAddDTO: { FixedAssetsAddDTO: {
companyId: null, companyId: null,
fixedAddress: null, //资产地址 fixedAddress: null, //资产地址
...@@ -110,7 +103,7 @@ export default { ...@@ -110,7 +103,7 @@ export default {
{ required: true, message: "请输入活动名称", trigger: "change" } { required: true, message: "请输入活动名称", trigger: "change" }
], ],
fixedCode: [ fixedCode: [
{ validator:account_password_valid, trigger: "blur" } { required: true, validator:account_password_valid, trigger: "blur" }
], ],
fixedAddress: [ fixedAddress: [
{ {
...@@ -121,6 +114,7 @@ export default { ...@@ -121,6 +114,7 @@ export default {
], ],
fixedMoney: [ fixedMoney: [
{ {
required: true,
validator: money, validator: money,
trigger: "change" trigger: "change"
} }
...@@ -171,10 +165,6 @@ export default { ...@@ -171,10 +165,6 @@ export default {
}, },
//负责人添加 //负责人添加
grtselect() { grtselect() {
if (this.falesId == true) {
this.falesId = false;
this.name = "确定负责人";
} else {
if (this.options.length > 0) { if (this.options.length > 0) {
this.FixedAssetsAddDTO.fixedController = this.user.userId; this.FixedAssetsAddDTO.fixedController = this.user.userId;
this.falesId = true; this.falesId = true;
...@@ -183,7 +173,6 @@ export default { ...@@ -183,7 +173,6 @@ export default {
} else { } else {
this.$message.error("没有负责人哦亲"); this.$message.error("没有负责人哦亲");
} }
}
}, },
//计时器 //计时器
getTime() { getTime() {
...@@ -281,17 +270,18 @@ export default { ...@@ -281,17 +270,18 @@ export default {
}, },
//重置 //重置
resetForm() { resetForm() {
this.FixedAssetsAddDTO = { this.$refs.ruleForm.resetFields()
fixedAddress: null, //资产地址 // this.FixedAssetsAddDTO = {
fixedCode: null, //资产编号(不重复) // fixedAddress: null, //资产地址
fixedController: null, //选择资产负责人 // fixedCode: null, //资产编号(不重复)
fixedDetails: null, //登记详情 // fixedController: null, //选择资产负责人
fixedMoney: null, //资产金额 // fixedDetails: null, //登记详情
fixedName: null, //资产名称 // fixedMoney: null, //资产金额
fixedState: 0, //默认为0 // fixedName: null, //资产名称
registerRemarks: null, //登记备注 // fixedState: 0, //默认为0
registerTime: null //登记时间 // registerRemarks: null, //登记备注
}; // registerTime: null //登记时间
// };
}, },
}, },
beforeDestroy() { beforeDestroy() {
......
<template> <template>
<div> <div>
<!-- 发票模块 --> <!-- 头部 -->
<div class="QueryInvoice" style="margin: 10px 15px"> <div class="QueryInvoice" style="margin: 10px 15px">
<el-row :gutter="30"> <el-row :gutter="30">
<el-col :span="30"> <el-col :span="30">
<el-form :inline="true" :model="invoiceList"> <el-form :inline="true" :model="invoiceQruey">
<el-form-item label="发票号码" style="margin-left"> <el-form-item label="发票号码" style="margin-left">
<el-input <el-input
v-model="invoiceList.number" v-model="invoiceQruey.number"
placeholder="发票号码" placeholder="发票号码"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="发票代码"> <el-form-item label="发票代码">
<el-input <el-input
v-model="invoiceList.code" v-model="invoiceQruey.code"
placeholder="发票代码" placeholder="发票代码"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="发票类型"> <el-form-item label="发票类型">
<el-select v-model="invoiceList.category" placeholder="请选择"> <el-select v-model="invoiceQruey.category" placeholder="请选择">
<el-option <el-option
v-for="item in options" v-for="item in categoryOptions"
:key="item.value" :key="item.value"
:label="item.category" :label="item.category"
:value="item.value" :value="item.value"
...@@ -28,9 +28,9 @@ ...@@ -28,9 +28,9 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="发票类别"> <el-form-item label="发票类别">
<el-select v-model="invoiceList.type" placeholder="请选择"> <el-select v-model="invoiceQruey.type" placeholder="请选择">
<el-option <el-option
v-for="item in options1" v-for="item in typeOptions"
:key="item.value" :key="item.value"
:label="item.type" :label="item.type"
:value="item.value" :value="item.value"
...@@ -38,9 +38,9 @@ ...@@ -38,9 +38,9 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="发票状态"> <el-form-item label="发票状态">
<el-select v-model="invoiceList.status" placeholder="请选择"> <el-select v-model="invoiceQruey.status" placeholder="请选择">
<el-option <el-option
v-for="item in options2" v-for="item in statusOptions"
:key="item.value" :key="item.value"
:label="item.status" :label="item.status"
:value="item.value" :value="item.value"
...@@ -57,8 +57,11 @@ ...@@ -57,8 +57,11 @@
@click="selectexpend()" @click="selectexpend()"
>查询</el-button >查询</el-button
> >
<el-button type="info" icon="el-icon-refresh" @click="upddlist()" <el-button
>刷新</el-button type="info"
icon="el-icon-refresh-right"
@click="upddlist()"
>重置</el-button
> >
<el-button <el-button
type="success" type="success"
...@@ -72,7 +75,7 @@ ...@@ -72,7 +75,7 @@
<!-- 表格区域 --> <!-- 表格区域 -->
<div class="drawer" v-show="isgetid == 0" style="margin-left: 15px"> <div class="drawer" v-show="isgetid == 0" style="margin-left: 15px">
<el-table <el-table
:data="invoicegetList.list" :data="invoicegetList"
border border
style="width: 99%" style="width: 99%"
:cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
...@@ -81,7 +84,7 @@ ...@@ -81,7 +84,7 @@
<el-table-column label="序号" width="50" style> <el-table-column label="序号" width="50" style>
<template slot-scope="scope"> <template slot-scope="scope">
{{ {{
(invoiceList.pageNum - 1) * invoiceList.pageSize + (invoiceQruey.pageNum - 1) * invoiceQruey.pageSize +
scope.$index + scope.$index +
1 1
}} }}
...@@ -183,112 +186,12 @@ ...@@ -183,112 +186,12 @@
@current-change="getincomeSelectlist" @current-change="getincomeSelectlist"
layout="total, prev, pager, next" layout="total, prev, pager, next"
:total="invoicegetList.total" :total="invoicegetList.total"
:current-page="invoiceList.pages" :current-page="invoiceQruey.pages"
></el-pagination> ></el-pagination>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<!-- 添加区域 -->
<div class="getadd" v-show="isgetid == 1" style="margin-left: 5%">
<el-row>
<el-col :xl="8" :lg="10" :md="8" :sm="12" :xs="24">
<el-form
style="width: 100%; margin: 30px 0px"
:model="addTO"
:rules="rules"
ref="addTO"
label-width="80px"
class="demo-ruleForm"
>
<el-form-item label="发票代码" prop="code">
<el-input
v-model="addTO.code"
maxlength="12"
minlength="12"
onkeyup="this.value=this.value.replace(/\D|^/g,'')"
></el-input>
</el-form-item>
<el-form-item label="发票号码" prop="number">
<el-input
v-model="addTO.number"
maxlength="8"
minlength="8"
onkeyup="this.value=this.value.replace(/\D|^/g,'')"
></el-input>
</el-form-item>
<el-form-item label="发票时间" required prop="time">
<el-date-picker
v-model="addTO.time"
type="datetime"
placeholder="选择日期时间"
@change="timestampToTime1()"
></el-date-picker>
</el-form-item>
<el-form-item label="发票类型" prop="category">
<el-select v-model="addTO.category" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.category"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="发票类别" prop="type">
<el-select v-model="addTO.type" placeholder="请选择">
<el-option
v-for="item in options1"
:key="item.value"
:label="item.type"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="发票金额" prop="mone">
<el-input v-model="addTO.mone"></el-input>
</el-form-item>
<el-form-item>
<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 @click="cancel()">取消</el-button>
</el-form-item>
</el-form>
</el-col>
<el-col :xs="4" :sm="6" :md="8" :lg="10" :xl="11">
<el-upload
class="upload-demo"
ref="upload"
:file-list="fileList"
:action="action"
:auto-upload="false"
:data="proutlist"
:on-change="onChange"
:on-remove="delfile"
:limit="1"
style="margin-left: 90px"
>
<el-button
slot="trigger"
size="small"
type="primary"
style="margin-left: 20px; margin-top: 40px"
>选取文件</el-button
>
<div slot="tip" class="el-upload__tip">
只能上传jpg/png/pdf文件,且不超过500kb
</div>
</el-upload>
</el-col>
</el-row>
</div>
</div> </div>
</template> </template>
...@@ -298,29 +201,19 @@ import { money, Invoice_code, Invoice_No } from "@/utils/myValidate"; ...@@ -298,29 +201,19 @@ import { money, Invoice_code, Invoice_No } from "@/utils/myValidate";
export default { export default {
data() { data() {
return { return {
//查询发票单的数据集合 //搜索条件
QueryInvoiceList: [], invoiceQruey: {
//发票参数 number: null,
invoicegetList: { code: null,
list: [], //发票列表 category: null,
//查询发票条件 type: null,
qurey: { status: null,
pageNum: 1, pageNum: 1,
pageSize: 5, pageSize: 10,
companyId: null, companyId: null,
userId: null,
}, },
total: 0, categoryOptions: [
},
fileList: [],
proutlist: {
Id: 1,
status: 0,
},
companyId: 0,
isgetid: 0,
typeList: [],
projectData: {},
options: [
{ {
value: 0, value: 0,
category: "普票", category: "普票",
...@@ -330,7 +223,7 @@ export default { ...@@ -330,7 +223,7 @@ export default {
category: "专票", category: "专票",
}, },
], ],
options1: [ typeOptions: [
{ {
value: 0, value: 0,
type: "收入", type: "收入",
...@@ -344,7 +237,7 @@ export default { ...@@ -344,7 +237,7 @@ export default {
type: "报销", type: "报销",
}, },
], ],
options2: [ statusOptions: [
{ {
value: 0, value: 0,
status: "未报销", status: "未报销",
...@@ -354,176 +247,41 @@ export default { ...@@ -354,176 +247,41 @@ export default {
status: "已报销", status: "已报销",
}, },
], ],
//添加发票的数组 total: 0,
addTO: {
category: null,
code: null,
companyId: null,
mone: null,
number: null,
status: 0,
time: null,
type: null,
},
//抽屉的临时数据
//表单验证内容
rules: {
time: [
{ required: true, message: "请输入发票时间", trigger: "change" },
],
number: [
{
validator: Invoice_No,
trigger: "blur",
},
],
code: [
{ required: true, validator: Invoice_code, trigger: "change" },
],
category: [
{
required: true,
message: "请至少选择一个发票类型",
trigger: "change",
},
],
type: [
{
required: true,
message: "请至少选择一个发票类别",
trigger: "change",
},
],
mone: [
{
validator: money,
trigger: "change",
},
],
},
//查询发票数据
invoiceList: {
category: null,
code: null,
companyId: null,
invoiceId: null,
mone: null,
number: null,
pageNum: 1,
pageSize: 10,
pages: 1,
searchCount: null,
status: null,
time: null,
type: null,
},
//发票状态
status: 0,
//发票的数组
invoicegetList: [], invoicegetList: [],
//发票编号数组
getinvoivelist: [],
//收集发票编号
invoiceListAdd: {},
//查询发票编号的数组
getinvoiveId: {
companyId: null,
type: 0,
},
pageNum: 10,
total: 10,
//收集数据
newList: [],
visible: false, //确认删除
//查看发票图片
srcList: [], srcList: [],
fileTypeJpg: false,
}; };
}, },
computed: {
// projectId() {
// return this.$route.query.id;
// }
},
created() { created() {
this.addTO.companyId = this.$store.getters.companyId; this.invoiceQruey.companyId = this.$store.getters.companyId;
this.invoiceList.companyId = this.$store.getters.companyId; this.invoiceQruey.userId = this.$store.getters.urId;
this.getinvoiveId.companyId = this.$store.getters.companyId;
//发票上传地址
this.action = process.env.VUE_APP_BASE_API + "/file/uploadFile";
this.getincomeSelectlist(); this.getincomeSelectlist();
}, },
methods: { methods: {
//返回
back() {
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.push({
path: "/incomeList",
query: {
id: this.$route.query.id,
backid: this.$route.query.backid,
},
});
},
//时间处理 yyyy-MM-dd hh:mm:ss
timestampToTime1() {
var date = this.addTO.time;
var Y = date.getFullYear() + "-";
var M =
(date.getMonth() + 1 < 10
? "0" + (date.getMonth() + 1)
: date.getMonth() + 1) + "-";
var D =
(date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " ";
var h =
(date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":";
var m =
(date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes()) +
":";
var s =
date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
this.addTO.time = Y + M + D + h + m + s;
},
//抽屉的关闭
handleClose(done) {
this.$confirm("确认关闭?")
.then((_) => {
this.isgetid = 0;
done();
})
.catch((_) => {});
},
//发票页面的按钮事件
drawerAdd() {
this.drawer = true;
this.getincomeSelectlist();
},
//查询 //查询
selectexpend() { selectexpend() {
this.invoiceQruey.pageNum = 1;
this.getincomeSelectlist(); this.getincomeSelectlist();
}, },
selectggb() { //重置
let list = []; upddlist() {
this.invoicegetList.forEach((item) => { this.invoiceQruey.pageNum = 1;
list.push({ this.invoiceQruey.number = null;
status: item.status, this.invoiceQruey.code = null;
}); this.invoiceQruey.category = null;
}); this.invoiceQruey.type = null;
this.invoiceQruey.status = null;
this.getincomeSelectlist();
}, },
//添加发票
Reimbursement() {},
//发票的分页查询 //发票的分页查询
getincomeSelectlist(pager = 1) { getincomeSelectlist() {
this.invoiceList.pageNum = pager; queryBypageIncomeAdd(this.invoiceQruey)
queryBypageIncomeAdd(this.invoiceList)
.then((res) => { .then((res) => {
if (res.success) { if (res.success) {
this.invoicegetList = res.data; this.invoicegetList = res.data.list;
this.total = res.data.total; this.total = res.data.total;
// let list = [];
// res.data.list.forEach((item, index) => {
// list.push({
// status: item.status
// });
// });
this.srcList = []; this.srcList = [];
res.data.list.forEach((e) => { res.data.list.forEach((e) => {
let fileNamepdf = e.filePath; let fileNamepdf = e.filePath;
...@@ -535,147 +293,13 @@ export default { ...@@ -535,147 +293,13 @@ export default {
} }
}); });
} else { } else {
this.$message.errror(res.msg); this.$message.error(res.msg);
} }
}) })
.catch((error) => { .catch((error) => {
this.$message.error("查询发票数据失败"); this.$message.error("查询发票数据失败");
}); });
}, },
//分页
handleSizeChange(val) {
this.invoicegetList.pageSize = val;
},
handleCurrentChange: function (currentPage) {
this.total = this.invoicegetList.length;
this.currentPage = currentPage;
},
//取消隐藏tatle
cancel() {
this.fileList = this.fileList.filter((item) => item.uid !== file.uid);
this.isgetid = 0;
this.getincomeSelectlist();
},
//显示报销单添加页面
Reimbursement() {
this.isgetid = 1;
this.$refs.addTO.resetFields();
this.fileList = this.fileList.filter((item) => item.uid !== file.uid);
},
//发票提交页面的提交
getlistForm() {
if (this.fileTypeJpg == true) {
this.$refs.addTO.validate((valid) => {
if (valid) {
this.addTO.userId = this.$store.getters.urId;
this.addTO.companyId = this.$store.getters.companyId;
insertList(this.addTO)
.then((res) => {
if (res.success) {
//发票记录添加成功
//提交发票文件
this.proutlist.Id = res.data;
this.$refs.upload.submit();
this.$message.success(res.msg);
this.isgetid = 0;
this.addTO = {
category: 0, //0收入 1支出 2报销
code: null,
companyId: null,
mone: null,
number: null,
status: 0, //状态 0未报销 1已报销
time: null,
type: 0, //0 普票 1专票
userId: null,
pages: 1,
};
//this.$refs.upload.clearFiles();
this.getincomeSelectlist();
//this.Selectinsertlsit();
} else {
this.$message.error(res.msg);
}
})
.catch((e) => {
this.$message.error("发票添加失败,检测是否重复");
});
}
});
} else {
this.$message.warning("没有发票文件,无法提交");
}
},
//校验发票文件格式
onChange(file) {
const fileNamepdf = file.name;
console.log(file.name);
let fileType = fileNamepdf.substring(fileNamepdf.lastIndexOf("."));
if (fileType == ".pdf" || fileType == ".png" || fileType == ".jpg") {
this.fileTypeJpg = true;
} else {
this.fileTypeJpg = false;
this.$message.warning("发票文件只能是pdf,png,jpg格式文件");
this.$refs.upload.clearFiles();
}
},
//清除发片文件
delfile() {
this.fileTypeJpg = false;
},
//数据清除
delectdd() {
this.$refs.addTO.resetFields();
},
//刷新
upddlist() {
(this.invoiceList = {
category: null,
code: null,
companyId: null,
invoiceId: null,
mone: null,
number: null,
orders: [
{
asc: null,
column: null,
},
],
pageNum: 1,
pageSize: 10,
searchCount: null,
status: null,
time: null,
type: null,
}),
(this.invoiceList.companyId = this.$store.getters.companyId);
this.invoiceList.pageNum = 1;
this.getincomeSelectlist();
},
//发票的删除操作
YesGet(row) {
deleteexpen(row)
.then((res) => {
if (res.success) {
this.visible = false;
this.$message({
message: "发票删除成功",
type: "success",
});
this.getincomeSelectlist(
this.invoicegetList.list.length > 1
? this.invoiceList.pageNum
: this.invoiceList.pageNum - 1
);
} else {
this.$message.error(res.msg);
}
})
.catch((e) => {
this.$message.error(e.msg);
});
},
//图片格式 //图片格式
formatProtocolType(row) { formatProtocolType(row) {
//这里判断的是是否有文件 //这里判断的是是否有文件
...@@ -691,6 +315,10 @@ export default { ...@@ -691,6 +315,10 @@ export default {
} }
} }
}, },
getimagin(row) {
return process.env.VUE_APP_BASE_API + row.filePath;
},
//时间处理
getFroms: function (value) { getFroms: function (value) {
var dt = new Date(value.time); var dt = new Date(value.time);
let year = dt.getFullYear(); let year = dt.getFullYear();
...@@ -698,27 +326,9 @@ export default { ...@@ -698,27 +326,9 @@ export default {
let date = dt.getDate(); let date = dt.getDate();
return `${year}${month}${date}日`; return `${year}${month}${date}日`;
}, },
getimagin(row) {
return process.env.VUE_APP_BASE_API + row.filePath;
},
//点击查看发票
handlePreView(row) {
const photopath = process.env.VUE_APP_BASE_API + row.filePath;
console.log(photopath);
window.open(photopath, "_blank");
},
}, },
}; };
</script> </script>
<style scoped> <style>
.container {
padding: 10px;
}
.QueryInvoice .el-form-item {
margin: 10px 15px;
}
.drawer .foot_yi {
margin: 10px 10px;
}
</style> </style>
\ No newline at end of file
...@@ -138,10 +138,6 @@ export default { ...@@ -138,10 +138,6 @@ export default {
projectAmount: [ projectAmount: [
{ {
required: true, required: true,
message: "请输入项目合同金额(起始金额)",
trigger: "blur"
},
{
validator: money, validator: money,
trigger: "change" trigger: "change"
} }
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
v-model="from.fromList" v-model="from.fromList"
multiple multiple
filterable filterable
allow-create
default-first-option default-first-option
placeholder="请选择" placeholder="请选择"
> >
......
...@@ -415,7 +415,6 @@ ...@@ -415,7 +415,6 @@
v-model="invoiceQurey.fromList" v-model="invoiceQurey.fromList"
multiple multiple
filterable filterable
allow-create
default-first-option default-first-option
placeholder="请选择发票号码" placeholder="请选择发票号码"
> >
......
...@@ -60,7 +60,12 @@ ...@@ -60,7 +60,12 @@
</el-col> </el-col>
</el-row> </el-row>
<el-button type="primary" @click="submitForm()">提交</el-button> <el-button
type="primary"
:disabled="reimebursementItemform.reimebursementItemlist.length == 0"
@click="submitForm()"
>提交</el-button
>
<el-button @click="addDomain">新增类型</el-button> <el-button @click="addDomain">新增类型</el-button>
<el-button @click="resetForm()">重置</el-button> <el-button @click="resetForm()">重置</el-button>
<el-button @click="back()">返回</el-button> <el-button @click="back()">返回</el-button>
...@@ -86,26 +91,44 @@ export default { ...@@ -86,26 +91,44 @@ export default {
}, },
}; };
}, },
created() { created() {},
},
methods: { methods: {
//添加 //提交
submitForm() { submitForm() {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
let getl = [];
console.log(this.reimebursementItemform.reimebursementItemlist);
this.reimebursementItemform.reimebursementItemlist.forEach((e) => {
getl.push(e.name);
});
var mySet = new Set(getl);
console.log([...mySet]);
if (getl.length == [...mySet].length) {
console.log("11111");
insert(this.reimebursementItemform.reimebursementItemlist) insert(this.reimebursementItemform.reimebursementItemlist)
.then((res) => { .then((res) => {
if (res.success) { if (res.success) {
this.$message.success("添加成功!"); this.$message.success("添加成功!");
this.back() this.back();
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}) })
.catch((error) => { .catch((error) => {
console.log(error);
this.$message.error("添加失败"); this.$message.error("添加失败");
}); });
} else {
console.log("no");
this.$message({
showClose: true,
message: "相同类型的名称不可以相同",
type: "warning",
});
}
} else { } else {
console.log("error submit!!"); console.log("error submit!!");
return false; return false;
...@@ -120,10 +143,11 @@ export default { ...@@ -120,10 +143,11 @@ export default {
companyId: this.$store.getters.companyId, companyId: this.$store.getters.companyId,
}); });
}, },
removeDomain(item){ removeDomain(item) {
var index = this.reimebursementItemform.reimebursementItemlist.indexOf(item) var index =
this.reimebursementItemform.reimebursementItemlist.indexOf(item);
if (index !== -1) { if (index !== -1) {
this.reimebursementItemform.reimebursementItemlist.splice(index, 1) this.reimebursementItemform.reimebursementItemlist.splice(index, 1);
} }
}, },
// 返回上一级 // 返回上一级
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
<el-form-item> <el-form-item>
<el-button type="primary" @click="submitForm()">提交</el-button> <el-button type="primary" :disabled="typefrom.typeList.length==0" @click="submitForm()">提交</el-button>
<el-button @click="addDomain">新增类型</el-button> <el-button @click="addDomain">新增类型</el-button>
<el-button @click="resetForm()">重置</el-button> <el-button @click="resetForm()">重置</el-button>
<el-button @click="back()">返回</el-button> <el-button @click="back()">返回</el-button>
...@@ -86,24 +86,44 @@ ...@@ -86,24 +86,44 @@
methods: { methods: {
//提交 //提交
submitForm() { submitForm() {
this.$refs.from.validate((valid) => { this.$refs.from.validate(valid => {
if (valid) { if (valid) {
console.log(this.typefrom) let getl = [];
insert(this.typefrom.typeList).then((res)=>{ let getog = [];
if(res.success){ this.typefrom.typeList.forEach(e => {
this.$message.success("添加成功") if (e.typeCategory == 1) {
this.$store.dispatch('tagsView/delView', this.$route) getl.push(e.typeName);
this.$router.push("/typeList") } else if (e.typeCategory == 0) {
}else{ getog.push(e.typeName);
this.$message.error(res.msg) }
});
var mySet = new Set(getl);
var mySetlist = new Set(getog);
if (
getl.length == [...mySet].length &&
getog.length == [...mySetlist].length
) {
insert(this.typefrom.typeList)
.then(res => {
if (res.success) {
this.$message.success("添加成功");
this.$store.dispatch("tagsView/delView", this.$route);
this.$router.push("/typeList");
} else {
this.$message.error(res.msg);
} }
}).catch((error)=>{
console.log(error)
this.$message.error("添加失败")
}) })
.catch(error => {
console.log(error);
this.$message.error("添加失败");
});
} else { } else {
console.log('error submit!!'); this.$message({
return false; showClose: true,
message: "相同类型的名称不可以相同",
type: "warning"
});
}
} }
}); });
}, },
......
<template> <template>
<div class="container"> <div class="container">
<el-row > <el-row>
<el-col :xl="8" :lg="8" :md="8" :sm="12" :xs="24"> <el-col :xl="8" :lg="8" :md="8" :sm="12" :xs="24">
<el-form <el-form
:model="typedata" :model="typedata"
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
class="demo-ruleForm" class="demo-ruleForm"
> >
<el-form-item label="类型" prop="typeName"> <el-form-item label="类型" prop="typeName">
<el-input v-model="typedata.typeName" ></el-input> <el-input v-model="typedata.typeName"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="类别" prop="typeCategory"> <el-form-item label="类别" prop="typeCategory">
<el-select v-model="typedata.typeCategory" disabled > <el-select v-model="typedata.typeCategory" disabled>
<el-option <el-option
v-for="item in options" v-for="item in options"
:key="item.value" :key="item.value"
...@@ -24,26 +24,31 @@ ...@@ -24,26 +24,31 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="success" icon="el-icon-upload2" @click="updateType()">提交</el-button> <el-button
<el-button type="info" icon="el-icon-refresh-left" @click="cancel()">取消</el-button> type="success"
icon="el-icon-upload2"
@click="updateType()"
>提交</el-button
>
<el-button type="info" icon="el-icon-refresh-left" @click="cancel()"
>取消</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
</template> </template>
<script> <script>
import { selectById, updata } from "@/api/type";
import {selectById,updata} from "@/api/type"
export default { export default {
data() { data() {
return { return {
typedata:{ typedata: {
typeName:null, typeName: null,
typeCategory:null, typeCategory: null,
}, },
options: [ options: [
{ {
...@@ -70,42 +75,50 @@ export default { ...@@ -70,42 +75,50 @@ export default {
return this.$route.query.id; return this.$route.query.id;
}, },
}, },
created(){ created() {
this.getTypeData() this.getTypeData();
}, },
methods:{ methods: {
//获取数据 //获取数据
getTypeData(){ getTypeData() {
selectById({typeId:this.typeId}).then((res)=>{ selectById({ typeId: this.typeId })
if(res.success){ .then((res) => {
this.typedata = res.data if (res.success) {
}else{ this.typedata = res.data;
this.$message.error(res.msg) } else {
this.$message.error(res.msg);
} }
}).catch((error)=>{
this.$message.error("查询数据失败")
}) })
.catch((error) => {
this.$message.error("查询数据失败");
});
}, },
//提交 //提交
updateType(){ updateType() {
updata(this.typedata).then((res)=>{ this.$refs.form.validate((valid) => {
if(res.success){ if (valid) {
this.$message.success("修改成功") updata(this.typedata)
this.$store.dispatch('tagsView/delView', this.$route) .then((res) => {
this.$router.push("/typeList") if (res.success) {
}else{ this.$message.success("修改成功");
this.$message.error(res.msg) this.$store.dispatch("tagsView/delView", this.$route);
this.$router.push("/typeList");
} else {
this.$message.error(res.msg);
} }
}).catch((error)=>{
this.$message.error("修改失败")
}) })
.catch((error) => {
this.$message.error("修改失败");
});
}
});
}, },
//返回 //返回
cancel(){ cancel() {
this.$store.dispatch('tagsView/delView', this.$route) this.$store.dispatch("tagsView/delView", this.$route);
this.$router.push("/typeList") this.$router.push("/typeList");
} },
} },
}; };
</script> </script>
......
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