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

20221116

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