no message
This commit is contained in:
parent
47d2aca331
commit
8e0b4dacb5
|
|
@ -4,8 +4,8 @@ const prodEnv = require('./prod.env')
|
|||
|
||||
module.exports = merge(prodEnv, {
|
||||
NODE_ENV: '"development"',
|
||||
BASE_API: '"http://localhost:8000"',
|
||||
// BASE_API: '"http://139.224.54.200:8888"'
|
||||
// BASE_API: '"http://localhost:8000"',
|
||||
BASE_API: '"http://139.224.54.200:8888"'
|
||||
// BASE_API: '"https://api.auauz.net"'
|
||||
// BASE_API: '"http://139.224.57.82:8015"'
|
||||
//BASE_API: '"http://139.224.57.82:8015"'
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
'use strict'
|
||||
module.exports = {
|
||||
NODE_ENV: '"production"',
|
||||
// BASE_API: '"http://139.224.54.200:8000"',
|
||||
// BASE_API: '"http://139.224.54.200:8888"',
|
||||
BASE_API: '"/"'
|
||||
// BASE_API: '"http://139.224.54.200:8000"',
|
||||
BASE_API: '"http://139.224.54.200:8888"',
|
||||
// BASE_API: '"http://139.224.57.82:8015"'
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@
|
|||
"html-webpack-plugin": "^3.0.0",
|
||||
"mini-css-extract-plugin": "0.4.1",
|
||||
"node-notifier": "5.2.1",
|
||||
"node-sass": "^4.7.2",
|
||||
|
||||
"optimize-css-assets-webpack-plugin": "5.0.0",
|
||||
"ora": "3.0.0",
|
||||
"portfinder": "1.0.16",
|
||||
|
|
|
|||
|
|
@ -7,6 +7,15 @@ export function fetchList(params) {
|
|||
})
|
||||
|
||||
}
|
||||
export function cstContracts(params) {
|
||||
return request({
|
||||
url: 'api/cstContracts',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 合同列表
|
||||
export function contractList(params) {
|
||||
return request({
|
||||
|
|
@ -15,6 +24,66 @@ export function contractList(params) {
|
|||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function addcstContracts(data) {
|
||||
return request({
|
||||
url: 'api/cstContracts',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function editcstContracts(data) {
|
||||
return request({
|
||||
url: 'api/cstContracts',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function delcstContracts(id) {
|
||||
return request({
|
||||
url: 'api/cstContracts/' + id,
|
||||
|
||||
method: 'delete',
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
export function invoicesContractInfo(params) {
|
||||
return request({
|
||||
url: 'api/invoicesContractInfo',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
export function addinvoicesContractInfo(data) {
|
||||
return request({
|
||||
url: 'api/invoicesContractInfo',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function editinvoicesContractInfo(data) {
|
||||
return request({
|
||||
url: 'api/invoicesContractInfo',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function delinvoicesContractInfo(id) {
|
||||
return request({
|
||||
url: 'api/invoicesContractInfo/' + id,
|
||||
method: 'delete',
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 新增合同
|
||||
export function contractListAdd(data) {
|
||||
return request({
|
||||
|
|
|
|||
|
|
@ -1,17 +1,16 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-button type="primary" size="mini" @click="toGen">生成代码</el-button>
|
||||
<el-dialog :visible.sync="dialog" :close-on-click-modal="false" :before-close="cancel" title="代码生成配置" append-to-body
|
||||
width="880px">
|
||||
<el-dialog :visible.sync="dialog" :close-on-click-modal="false" :before-close="cancel" title="代码生成配置" append-to-body width="880px">
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="90px">
|
||||
<el-form-item label="模块名称" prop="moduleName">
|
||||
<el-input v-model="form.moduleName" />
|
||||
<el-input v-model="form.moduleName"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="至于包下" prop="pack">
|
||||
<el-input v-model="form.pack" />
|
||||
<el-input v-model="form.pack"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="前端路径" prop="path">
|
||||
<el-input v-model="form.path" />
|
||||
<el-input v-model="form.path"/>
|
||||
</el-form-item>
|
||||
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;margin-bottom: 15px">
|
||||
<el-table-column label="序号" width="80" align="center">
|
||||
|
|
@ -19,36 +18,43 @@
|
|||
<div>{{ scope.$index + 1 }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="columnName" label="字段名称" />
|
||||
<el-table-column prop="columnType" label="字段类型" />
|
||||
<el-table-column prop="columnName" label="字段名称"/>
|
||||
<el-table-column prop="columnType" label="字段类型"/>
|
||||
<el-table-column prop="columnComment" label="字段标题">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="data[scope.$index].columnComment" class="edit-input" />
|
||||
<el-input v-model="data[scope.$index].columnComment" class="edit-input"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="查询方式">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="data[scope.$index].columnQuery" class="edit-input" clearable placeholder="请选择">
|
||||
<el-option label="模糊查询" value="1" />
|
||||
<el-option label="精确查询" value="2" />
|
||||
<el-option label="范围查询" value="3" />
|
||||
<el-option
|
||||
label="模糊查询"
|
||||
value="1"/>
|
||||
<el-option
|
||||
label="精确查询"
|
||||
value="2"/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="columnShow" label="列表显示">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip :content="scope.row.columnShow === 'true' ? '显示' : '不显示'" placement="top">
|
||||
<el-switch v-model="data[scope.$index].columnShow" active-color="#13ce66" inactive-color="#ff4949"
|
||||
active-value="true" inactive-value="false" />
|
||||
<el-tooltip :content="scope.row.columnShow === 'true' ?'显示':'不显示'" placement="top">
|
||||
<el-switch
|
||||
v-model="data[scope.$index].columnShow"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
active-value="true"
|
||||
inactive-value="false"/>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-form-item label="作者名称" prop="author">
|
||||
<el-input v-model="form.author" />
|
||||
<el-input v-model="form.author"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="去表前缀" prop="prefix">
|
||||
<el-input v-model="form.prefix" placeholder="默认不去除表前缀" />
|
||||
<el-input v-model="form.prefix" placeholder="默认不去除表前缀"/>
|
||||
</el-form-item>
|
||||
<!-- 可自定义显示配置 -->
|
||||
<!-- <el-form-item label="Api路径">-->
|
||||
|
|
@ -159,19 +165,18 @@ export default {
|
|||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss">
|
||||
.edit-input {
|
||||
.el-input__inner {
|
||||
border: none;
|
||||
.edit-input {
|
||||
.el-input__inner {
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
/deep/ .el-dialog__body {
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
/deep/ .input-with-select .el-input-group__prepend {
|
||||
background-color: #fff;
|
||||
}
|
||||
/deep/ .el-dialog__body{
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
/deep/ .input-with-select .el-input-group__prepend {
|
||||
background-color: #fff;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -3,16 +3,16 @@
|
|||
<div class="head-container" style="margin: 20px 0px">
|
||||
<!-- 搜索 -->
|
||||
<el-input
|
||||
v-model="searchObj.reimburseNum"
|
||||
v-model="searchObj.contractName"
|
||||
clearable
|
||||
placeholder="项目名称"
|
||||
placeholder="合同名称"
|
||||
style="width: 200px; margin-right: 10px"
|
||||
class="filter-item"
|
||||
maxlength="100"
|
||||
/>
|
||||
|
||||
<el-input
|
||||
v-model="searchObj.empName"
|
||||
v-model="searchObj.invoicingNamePartyA"
|
||||
clearable
|
||||
placeholder="发票抬头(甲方)"
|
||||
style="width: 200px; margin-right: 10px"
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
maxlength="100"
|
||||
/>
|
||||
<el-input
|
||||
v-model="searchObj.jobNum"
|
||||
v-model="searchObj.invoicingNamePartyB"
|
||||
clearable
|
||||
placeholder="发票抬头(乙方)"
|
||||
style="width: 200px; margin-right: 10px"
|
||||
|
|
@ -31,19 +31,18 @@
|
|||
|
||||
<el-date-picker class="filter-item"
|
||||
style="width: 200px;margin-right: 10px"
|
||||
v-model="searchObj.reimburseDate"
|
||||
v-model="searchObj.invoiceDateGt"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="发票开始日期"
|
||||
placeholder="开票日期开始"
|
||||
></el-date-picker>
|
||||
<el-date-picker class="filter-item"
|
||||
<el-date-picker class="filter-item"
|
||||
style="width: 200px;margin-right: 10px"
|
||||
v-model="searchObj.reimburseDate"
|
||||
v-model="searchObj.invoiceDateLt"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="发票结束日期"
|
||||
placeholder="开票日期结束"
|
||||
></el-date-picker>
|
||||
|
||||
<el-button
|
||||
class="filter-item"
|
||||
type="success"
|
||||
|
|
@ -65,50 +64,37 @@
|
|||
</div>
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="list2"
|
||||
:data="list"
|
||||
border
|
||||
stripe
|
||||
highlight-current-row
|
||||
style="width: 100%"
|
||||
>
|
||||
<af-table-column align="center" label="No." width="90">
|
||||
|
||||
<af-table-column prop="contractId" align="center" label="合同编号" >
|
||||
</af-table-column>
|
||||
|
||||
|
||||
<af-table-column prop="reimburseCont" align="center" label="项目名称" >
|
||||
|
||||
<af-table-column prop="contractName" align="center" label="合同名称" >
|
||||
</af-table-column>
|
||||
<af-table-column prop="reimburseNum" align="center" label="项目名称" >
|
||||
|
||||
<af-table-column prop="invoicingNamePartyA" align="center" label="发票抬头(甲方)" >
|
||||
</af-table-column>
|
||||
|
||||
<af-table-column prop="reimburseCont" align="center" label="发票抬头(甲方)" >
|
||||
|
||||
<af-table-column prop="invoicingNamePartyB" align="center" label="发票抬头(乙方)" >
|
||||
</af-table-column>
|
||||
<af-table-column prop="reimburseCont" align="center" label="发票抬头(乙方)" >
|
||||
|
||||
<af-table-column prop="totalAmount" align="center" label="合同总⾦额" >
|
||||
</af-table-column>
|
||||
<af-table-column prop="jobNum" align="center" label="项目总额" >
|
||||
<af-table-column prop="invoiceAmount" align="center" label="本次开票⾦额" >
|
||||
</af-table-column>
|
||||
<af-table-column prop="empName" align="center" class-name="status-col" label="本期开票" >
|
||||
<af-table-column prop="paidAmount" align="center" label="已付款⾦额" >
|
||||
</af-table-column>
|
||||
<af-table-column prop="reimburseAmt" align="center" label="付款金额" >
|
||||
<af-table-column prop="invoiceDate" align="center" label="开票⽇期" >
|
||||
</af-table-column>
|
||||
<af-table-column prop="reimburseDate" align="center" label="状态" width="120" >
|
||||
|
||||
<af-table-column prop="paymentDate" align="center" label="付款⽇期" >
|
||||
</af-table-column>
|
||||
<af-table-column prop="invoiceAccessory" align="center" label="备注" >
|
||||
|
||||
<af-table-column prop="notes" align="center" label="备注" >
|
||||
</af-table-column>
|
||||
<af-table-column prop="otherAccessory" align="center" label="开票日期" >
|
||||
|
||||
</af-table-column>
|
||||
|
||||
|
||||
<af-table-column align="center" label="操作" width="150">
|
||||
<template slot-scope="scope">
|
||||
|
||||
<el-button type="primary" size='mini' @click="deleteContract(scope)">删除</el-button>
|
||||
<el-button type="primary" size='mini' @click="editBtn(scope)">修改</el-button>
|
||||
<el-button type="primary" size='mini' @click="del(scope)">删除</el-button>
|
||||
</template>
|
||||
</af-table-column>
|
||||
</el-table>
|
||||
|
|
@ -127,16 +113,16 @@
|
|||
<!-- let len = data.split('/').length;
|
||||
let fileName = data.split('/')[len-1]; -->
|
||||
<script>
|
||||
import { xyReimbursementList ,xyReimburseinfoDelte ,xyProjectinfoSelectXm } from '@/api/article'
|
||||
import { xyReimburseinfoDelte ,xyProjectinfoSelectXm,invoicesContractInfo,delinvoicesContractInfo } from '@/api/article'
|
||||
import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
|
||||
|
||||
import moment from 'moment'
|
||||
export default {
|
||||
name: 'reimbursement',
|
||||
components: { Pagination },
|
||||
|
||||
data() {
|
||||
return {
|
||||
list2: [{reimburseCont:1}],
|
||||
list: [],
|
||||
|
||||
listLoading: true,
|
||||
listQuery: {
|
||||
|
|
@ -148,11 +134,8 @@ export default {
|
|||
currentPage : 0,//当前页数
|
||||
|
||||
searchObj : {
|
||||
reimburseNum : "",//报销编号
|
||||
jobNum : "" ,//工号
|
||||
empName : "" ,//姓名
|
||||
reimburseDate : "" ,//日期
|
||||
sort : 'reimburseDate,desc',
|
||||
|
||||
sort : 'desc',
|
||||
},
|
||||
nameOption : [],//姓名下拉框
|
||||
|
||||
|
|
@ -164,27 +147,25 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
// 姓名下拉框
|
||||
getNameSelect(){
|
||||
xyProjectinfoSelectXm().then(res=>{
|
||||
console.log(res);
|
||||
this.nameOption = res
|
||||
}).catch(err=>{
|
||||
console.log(err)
|
||||
})
|
||||
},
|
||||
|
||||
// 查询表格数据 expenseDate,asc/expenseDate,desc
|
||||
getList(reimburseNum='',jobNum='',empName='', reimburseDate='',sort='reimburseDate,desc') {
|
||||
getList(sort='desc') {
|
||||
this.listLoading = true
|
||||
let obj = {
|
||||
page : this.listQuery.page-1,
|
||||
size : this.listQuery.limit,
|
||||
reimburseNum,jobNum,empName ,
|
||||
reimburseDate : reimburseDate==''||reimburseDate==null?'':reimburseDate +" 00:00:00",
|
||||
...this.searchObj,
|
||||
sort
|
||||
}
|
||||
console.log(obj);
|
||||
xyReimbursementList(obj).then(res=>{
|
||||
invoicesContractInfo(obj).then(res=>{
|
||||
this.listLoading = false;
|
||||
res.content.map(item=>{
|
||||
item.invoiceDate = item.invoiceDate ? moment(item.invoiceDate).format('YYYY-MM-DD') : ''
|
||||
item.paymentDate = item.paymentDate ? moment(item.paymentDate).format('YYYY-MM-DD') : ''
|
||||
|
||||
return item
|
||||
})
|
||||
this.list = res.content;
|
||||
this.total = res.totalElements;
|
||||
})
|
||||
|
|
@ -193,18 +174,18 @@ export default {
|
|||
console.log(item);
|
||||
this.listQuery.page = item.page;
|
||||
this.listQuery.limit = item.limit;
|
||||
let {reimburseNum,jobNum,empName ,reimburseDate,sort} = this.searchObj;
|
||||
this.getList(reimburseNum,jobNum,empName ,reimburseDate,sort);
|
||||
|
||||
this.getList();
|
||||
},
|
||||
// 搜索
|
||||
searchBtn(){
|
||||
let {reimburseNum,jobNum,empName ,reimburseDate,sort} = this.searchObj;
|
||||
|
||||
this.listQuery.page = 1;
|
||||
this.getList(reimburseNum,jobNum,empName ,reimburseDate,sort);
|
||||
this.getList();
|
||||
},
|
||||
// // 删除
|
||||
deleteContract(scope){
|
||||
if (!this.$delectAuth()) return;
|
||||
del(scope){
|
||||
if (!this.$delectAuth()) return;
|
||||
// console.log(scope.row);
|
||||
let id = scope.row.id
|
||||
this.$confirm('确定删除?', '提示', {
|
||||
|
|
@ -216,20 +197,9 @@ export default {
|
|||
// type: 'success',
|
||||
// message: '删除成功!'
|
||||
// });
|
||||
xyReimburseinfoDelte(id).then(res=>{
|
||||
delinvoicesContractInfo(id).then(res=>{
|
||||
// console.log(res);
|
||||
if(res=='200'){
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功!'
|
||||
});
|
||||
this.getList();
|
||||
}else{
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除失败!状态码:'+res,
|
||||
});
|
||||
}
|
||||
this.getList();
|
||||
|
||||
})
|
||||
}).catch(() => {
|
||||
|
|
@ -243,7 +213,7 @@ export default {
|
|||
// // 修改
|
||||
editBtn(scope){
|
||||
localStorage.setItem('editData',JSON.stringify(scope.row) );
|
||||
this.$router.push('/reimbursement/create');
|
||||
this.$router.push('/reimbursement/creatInvoice');
|
||||
},
|
||||
// // 新增
|
||||
add(){
|
||||
|
|
|
|||
|
|
@ -1,329 +1,324 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form size="mini" label-width="160px" :rules="rules" ref="ruleForm" :model="formInline">
|
||||
<el-form
|
||||
size="mini"
|
||||
label-width="160px"
|
||||
:rules="rules"
|
||||
ref="ruleForm"
|
||||
:model="formInline"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目编号" >
|
||||
|
||||
<el-select style='width:100%' filterable v-model="formInline.xoProjectname" placeholder="请选择" @change="selectFn">
|
||||
<el-option
|
||||
v-for="item in xxProjectList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同编号:">
|
||||
<el-select
|
||||
:disabled="editState==1"
|
||||
style="width: 100%;"
|
||||
v-model="formInline.contractId"
|
||||
clearable
|
||||
@change="setcontractdata"
|
||||
placeholder="合同编号"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in contracts"
|
||||
:key="item.id"
|
||||
:label="item.contractName"
|
||||
:value="item.contractId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item
|
||||
></el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同名称:">
|
||||
<el-input disabled
|
||||
v-model="formInline.contractName"
|
||||
placeholder="合同名称"
|
||||
></el-input> </el-form-item
|
||||
></el-col>
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="合同类型:" prop="marketAmount">
|
||||
<el-select disabled style="width: 100%" v-model="formInline.contractType">
|
||||
<el-option label="实施类" :value="0"></el-option>
|
||||
<el-option label="人月类" :value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同总⾦额:">
|
||||
<el-input disabled
|
||||
v-model="formInline.totalAmount"
|
||||
@input="
|
||||
formInline.totalAmount = changeNum(formInline.totalAmount)
|
||||
"
|
||||
></el-input> </el-form-item
|
||||
></el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="发票抬头(甲方)">
|
||||
<el-input disabled v-model="formInline.invoicingNamePartyA" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目名称" >
|
||||
<el-select style='width:100%' filterable v-model="formInline.xoProjectname" placeholder="请选择" @change="selectFn">
|
||||
<el-option
|
||||
v-for="item in xxProjectList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="发票抬头(甲方)" >
|
||||
<el-input v-model="formInline.xoProjectnum" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="发票抬头(乙方)" >
|
||||
<el-input v-model="formInline.xoProjectnum" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目总额" >
|
||||
<el-input v-model="formInline.xoProjectnum" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="本期开票" >
|
||||
<el-input v-model="formInline.xoProjectnum" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="付款金额" >
|
||||
<el-input v-model="formInline.xoProjectnum" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注" >
|
||||
<el-input v-model="formInline.xoProjectnum" />
|
||||
</el-form-item>
|
||||
<el-form-item label="发票抬头(乙方)">
|
||||
<el-input disabled v-model="formInline.invoicingNamePartyB" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="本次开票⾦额:">
|
||||
<el-input
|
||||
v-model="formInline.invoiceAmount"
|
||||
@input="
|
||||
formInline.invoiceAmount = changeNum(formInline.invoiceAmount)
|
||||
"
|
||||
></el-input> </el-form-item
|
||||
></el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="已付款⾦额:">
|
||||
<el-input
|
||||
v-model="formInline.paidAmount"
|
||||
@input="
|
||||
formInline.paidAmount = changeNum(formInline.paidAmount)
|
||||
"
|
||||
></el-input> </el-form-item
|
||||
></el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开票⽇期:">
|
||||
<el-date-picker
|
||||
style="width: 100%"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
v-model="formInline.invoiceDate"
|
||||
placeholder="开票⽇期"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="付款⽇期:">
|
||||
<el-date-picker
|
||||
style="width: 100%"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
v-model="formInline.paymentDate"
|
||||
placeholder="付款⽇期"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="formInline.notes" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="float: right;">
|
||||
<el-button @click="cancelBtn('ruleForm')">取 消</el-button>
|
||||
<el-button type="primary" @click="onSubmit('ruleForm')">确 定</el-button>
|
||||
</div>
|
||||
<div style="float: right">
|
||||
<el-button @click="cancelBtn('ruleForm')">取 消</el-button>
|
||||
<el-button type="primary" @click="onSubmit('ruleForm')"
|
||||
>确 定</el-button
|
||||
>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { contractListAdd ,contractListPost, contractListPut,contractDownload,xyProjectinfoSelectXm,
|
||||
xyUploadReimburse,//上传发票,其他附件
|
||||
xyReimburseinfoAdd,//新增
|
||||
xyReimburseinfoPut,//修改
|
||||
} from '@/api/article'
|
||||
import {getProjectList} from '@/api/xyPersoninfo'
|
||||
import {
|
||||
contractDownload,
|
||||
xyUploadReimburse, //上传发票,其他附件
|
||||
xyReimburseinfoAdd, //新增
|
||||
xyReimburseinfoPut, //修改
|
||||
cstContracts,
|
||||
addinvoicesContractInfo,
|
||||
editinvoicesContractInfo,
|
||||
} from "@/api/article";
|
||||
import { getProjectList } from "@/api/xyPersoninfo";
|
||||
export default {
|
||||
data() {
|
||||
var validateInput = (rule, value, callback) => {
|
||||
if (value === '') {
|
||||
callback(new Error('没有数据'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
if (value === "") {
|
||||
callback(new Error("没有数据"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
return {
|
||||
uploadUrl :"www.baidu.com",
|
||||
headerObj :{
|
||||
Authorization:"",
|
||||
uploadUrl: "www.baidu.com",
|
||||
headerObj: {
|
||||
Authorization: "",
|
||||
},
|
||||
contracts: [],
|
||||
// fileNames : "",
|
||||
// contractNameOption:[],
|
||||
formInline: {
|
||||
// reimburseNum : '',//报销编号
|
||||
jobNum : "",//工号
|
||||
empName : "",//姓名
|
||||
reimburseAmt :"",//报销金额
|
||||
reimburseDate :"",//日期
|
||||
reimburseCont : "",//报销内容
|
||||
invoiceAccessory : '',//发票
|
||||
otherAccessory : '',//其他附件
|
||||
remark :"",//备注
|
||||
},
|
||||
formInline: {},
|
||||
rules: {
|
||||
jobNum: [{ validator: validateInput, trigger: 'blur' }],
|
||||
empName: [ { validator: validateInput, trigger: 'blur' }],
|
||||
reimburseAmt: [ { validator: validateInput, trigger: 'blur' }],
|
||||
reimburseDate: [{ validator: validateInput, trigger: 'blur' }],
|
||||
reimburseCont: [ { validator: validateInput, trigger: 'blur' } ],
|
||||
invoiceAccessory: [ { validator: validateInput, trigger: 'blur' }],
|
||||
otherAccessory: [{ validator: validateInput, trigger: 'blur' } ],
|
||||
|
||||
jobNum: [{ validator: validateInput, trigger: "blur" }],
|
||||
empName: [{ validator: validateInput, trigger: "blur" }],
|
||||
reimburseAmt: [{ validator: validateInput, trigger: "blur" }],
|
||||
reimburseDate: [{ validator: validateInput, trigger: "blur" }],
|
||||
reimburseCont: [{ validator: validateInput, trigger: "blur" }],
|
||||
invoiceAccessory: [{ validator: validateInput, trigger: "blur" }],
|
||||
otherAccessory: [{ validator: validateInput, trigger: "blur" }],
|
||||
},
|
||||
xxProjectList:[],
|
||||
editState : 0,//0:新增,1:编辑
|
||||
editId :'',//编辑id-xpId
|
||||
nameOption : [],//姓名下拉框
|
||||
|
||||
xxProjectList: [],
|
||||
editState: 0, //0:新增,1:编辑
|
||||
editId: "", //编辑id-xpId
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
var param={};
|
||||
param.xpStatus="1";
|
||||
// getProjectList(param).then(res =>{
|
||||
// this.xxProjectList=[]
|
||||
// for(let item of res){
|
||||
// console.log("res=====",res);
|
||||
// // let vl= item.split("-")
|
||||
// let data={
|
||||
// label:item.xpProName,
|
||||
// value:item.xpProjectnum
|
||||
// }
|
||||
// this.xxProjectList.push(data)
|
||||
// }
|
||||
// }).catch(err => {})
|
||||
this.getNameSelect();// 姓名下拉框
|
||||
async mounted() {
|
||||
var param = {};
|
||||
|
||||
|
||||
|
||||
this.gecontractLists();
|
||||
// this.getXmOption();
|
||||
// this.getcontractName();//合同选项-下拉
|
||||
let data = JSON.parse(localStorage.getItem('editData'));
|
||||
if(data != null){
|
||||
this.initInput(data);
|
||||
let data = JSON.parse(localStorage.getItem("editData"));
|
||||
if (data != null) {
|
||||
this.formInline = { ...data };
|
||||
|
||||
this.editState = 1;
|
||||
}else{
|
||||
} else {
|
||||
this.editState = 0;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
selectFn(e){
|
||||
this.form.xoProjectnum=e
|
||||
var xxProjectList=this.xxProjectList;
|
||||
for(var i=0;i<xxProjectList.length;i++){
|
||||
if(e==xxProjectList[i].value){
|
||||
this.form.xoProjectname=xxProjectList[i].label
|
||||
return;
|
||||
}
|
||||
}
|
||||
changeNum(objt) {
|
||||
let obj = {
|
||||
value: objt,
|
||||
};
|
||||
//如果用户第一位输入的是小数点,则重置输入框内容
|
||||
if (obj.value != "" && obj.value.substr(0, 1) == ".") {
|
||||
obj.value = "";
|
||||
}
|
||||
obj.value = obj.value.replace(/^0*(0\.|[1-9])/, "$1"); //粘贴不生效
|
||||
obj.value = obj.value.replace(/[^\d.]/g, ""); //清除“数字”和“.”以外的字符
|
||||
obj.value = obj.value.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的
|
||||
obj.value = obj.value
|
||||
.replace(".", "$#$")
|
||||
.replace(/\./g, "")
|
||||
.replace("$#$", ".");
|
||||
obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3"); //只能输入两个小数
|
||||
if (obj.value.indexOf(".") < 0 && obj.value != "") {
|
||||
//以上已经过滤,此处控制的是如果没有小数点,首位不能为类似于 01、02的金额
|
||||
if (obj.value.substr(0, 1) == "0" && obj.value.length == 2) {
|
||||
obj.value = obj.value.substr(1, obj.value.length);
|
||||
}
|
||||
}
|
||||
return obj.value;
|
||||
// this.formInline.marketAmount = obj.value;
|
||||
},
|
||||
setcontractdata(value) {
|
||||
if (value) {
|
||||
let obj = this.contracts.find((item) => item);
|
||||
this.formInline.contractId = obj.contractId;
|
||||
this.formInline.contractName = obj.contractName;
|
||||
|
||||
this.formInline.invoicingNamePartyA = obj.invoicingNamePartyA;
|
||||
this.formInline.invoicingNamePartyB = obj.invoicingNamePartyB;
|
||||
this.formInline.totalAmount = obj.totalAmount;
|
||||
|
||||
},
|
||||
// 姓名下拉框
|
||||
getNameSelect(){
|
||||
xyProjectinfoSelectXm().then(res=>{
|
||||
console.log(res);
|
||||
this.nameOption = res.content
|
||||
}).catch(err=>{
|
||||
console.log(err)
|
||||
})
|
||||
},
|
||||
// 姓名下拉:选中值发生变化时触发
|
||||
nameChange(val){
|
||||
console.log(val);
|
||||
if(val !=""){
|
||||
this.formInline.empName = val.split('-')[0]
|
||||
this.formInline.jobNum = val.split('-')[1]
|
||||
}else{
|
||||
this.formInline.empName = '' ;
|
||||
this.formInline.jobNum = '' ;
|
||||
} else {
|
||||
this.formInline.contractId = '';
|
||||
this.formInline.contractName = '';
|
||||
|
||||
this.formInline.invoicingNamePartyA = '';
|
||||
this.formInline.invoicingNamePartyB = '';
|
||||
this.formInline.totalAmount = '';
|
||||
}
|
||||
},
|
||||
|
||||
gecontractLists() {
|
||||
cstContracts({
|
||||
page: 0,
|
||||
size: 300,
|
||||
})
|
||||
.then((res) => {
|
||||
this.contracts = res.content;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
},
|
||||
|
||||
// 保存
|
||||
onSubmit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
// let obj =this.formInline;
|
||||
let editState = this.editState;
|
||||
let formdata=new FormData();
|
||||
|
||||
let {
|
||||
jobNum ,//工号
|
||||
empName ,//姓名
|
||||
reimburseAmt ,//报销金额
|
||||
reimburseDate ,//日期
|
||||
reimburseCont ,//报销内容
|
||||
invoiceAccessory ,//发票
|
||||
otherAccessory ,//其他附件
|
||||
remark ,//备注
|
||||
} = this.formInline;
|
||||
|
||||
let obj = {
|
||||
jobNum ,//工号
|
||||
empName ,//姓名
|
||||
reimburseAmt ,//报销金额
|
||||
reimburseDate ,//日期
|
||||
reimburseCont ,//报销内容
|
||||
invoiceAccessory ,//发票
|
||||
otherAccessory ,//其他附件
|
||||
remark ,//备注
|
||||
id : '',
|
||||
}
|
||||
if(editState==0){
|
||||
delete obj.id;
|
||||
// 新增
|
||||
xyReimburseinfoAdd(obj).then(res=>{
|
||||
if(res == '200'){
|
||||
this.initInput();
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '新增成功!'
|
||||
});
|
||||
this.$router.push('/reimbursement/list');
|
||||
}else if(res == '203'){
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '当前已新增!'
|
||||
});
|
||||
}
|
||||
})
|
||||
}else{
|
||||
// 编辑
|
||||
let id = this.editId;
|
||||
// formdata.append("id",id);
|
||||
// formdata.append("contractState",contractState);
|
||||
obj.id = id
|
||||
xyReimburseinfoPut(obj).then(res=>{
|
||||
if(res=='200'){
|
||||
localStorage.setItem('editData',null);
|
||||
this.initInput();
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '修改成功!'
|
||||
});
|
||||
this.$router.push('/reimbursement/list');
|
||||
}
|
||||
})
|
||||
|
||||
if (editState == 0) {
|
||||
addinvoicesContractInfo({ ...this.formInline }).then((res) => {
|
||||
this.$router.push("/reimbursement/createcustomer");
|
||||
});
|
||||
} else {
|
||||
editinvoicesContractInfo({ ...this.formInline }).then((res) => {
|
||||
this.$router.push("/reimbursement/createcustomer");
|
||||
});
|
||||
}
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
console.log("error submit!!");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
initInput(data=null){
|
||||
this.editId = data==null?"":data.id;//编辑id
|
||||
this.formInline =
|
||||
{
|
||||
// jobNum : "",//工号
|
||||
// empName : "",//姓名
|
||||
// reimburseAmt :"",//报销金额
|
||||
// reimburseDate :"",//日期
|
||||
// reimburseCont : "",//报销内容
|
||||
// invoiceAccessory : '',//发票
|
||||
// otherAccessory : '',//其他附件
|
||||
// remark :"",//备注
|
||||
|
||||
jobNum : data==null?"":data.jobNum,//
|
||||
empName : data==null?"":data.empName,//
|
||||
reimburseAmt : data==null?"":data.reimburseAmt,//
|
||||
reimburseDate : data==null?"":data.reimburseDate,//
|
||||
reimburseCont: data==null?"":data.reimburseCont,//
|
||||
invoiceAccessory: data==null?"":data.invoiceAccessory ,//
|
||||
otherAccessory: data==null?"":data.otherAccessory,//
|
||||
remark: data==null?"":data.remark,//备注
|
||||
|
||||
}
|
||||
console.log(this.formInline);
|
||||
// this.fileNames = data==null?"":data.contractAttachment;
|
||||
},
|
||||
// 取消 :是编辑会转成新增
|
||||
cancelBtn(formName){
|
||||
cancelBtn(formName) {
|
||||
this.editState = 0;
|
||||
localStorage.setItem('editData',null);
|
||||
this.initInput();
|
||||
localStorage.setItem("editData", null);
|
||||
|
||||
this.$refs[formName].resetFields();
|
||||
this.$router.push('/reimbursement/list');
|
||||
this.$router.push("/reimbursement/list");
|
||||
},
|
||||
// 两位小数
|
||||
changeNum(objt) {
|
||||
let obj = {
|
||||
value: objt,
|
||||
}
|
||||
};
|
||||
//如果用户第一位输入的是小数点,则重置输入框内容
|
||||
if (obj.value != '' && obj.value.substr(0, 1) == '.') {
|
||||
if (obj.value != "" && obj.value.substr(0, 1) == ".") {
|
||||
obj.value = "";
|
||||
}
|
||||
obj.value = obj.value.replace(/^0*(0\.|[1-9])/, '$1');//粘贴不生效
|
||||
obj.value = obj.value.replace(/[^\d.]/g, ""); //清除“数字”和“.”以外的字符
|
||||
obj.value = obj.value.replace(/^0*(0\.|[1-9])/, "$1"); //粘贴不生效
|
||||
obj.value = obj.value.replace(/[^\d.]/g, ""); //清除“数字”和“.”以外的字符
|
||||
obj.value = obj.value.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的
|
||||
obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
|
||||
obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3');//只能输入两个小数
|
||||
if (obj.value.indexOf(".") < 0 && obj.value != "") {//以上已经过滤,此处控制的是如果没有小数点,首位不能为类似于 01、02的金额
|
||||
if (obj.value.substr(0, 1) == '0' && obj.value.length == 2) {
|
||||
obj.value = obj.value
|
||||
.replace(".", "$#$")
|
||||
.replace(/\./g, "")
|
||||
.replace("$#$", ".");
|
||||
obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3"); //只能输入两个小数
|
||||
if (obj.value.indexOf(".") < 0 && obj.value != "") {
|
||||
//以上已经过滤,此处控制的是如果没有小数点,首位不能为类似于 01、02的金额
|
||||
if (obj.value.substr(0, 1) == "0" && obj.value.length == 2) {
|
||||
obj.value = obj.value.substr(1, obj.value.length);
|
||||
}
|
||||
}
|
||||
return obj.value
|
||||
return obj.value;
|
||||
// this.formInline.marketAmount = obj.value;
|
||||
},
|
||||
// 下载
|
||||
downloadFile(data){
|
||||
downloadFile(data) {
|
||||
// console.log(data);
|
||||
if(data == ''||data == null){
|
||||
if (data == "" || data == null) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '还未上传过电子合同附件,先上传才可以下载'
|
||||
type: "error",
|
||||
message: "还未上传过电子合同附件,先上传才可以下载",
|
||||
});
|
||||
}else{
|
||||
let len = data.split('/').length;
|
||||
let fileName = data.split('/')[len-1];
|
||||
} else {
|
||||
let len = data.split("/").length;
|
||||
let fileName = data.split("/")[len - 1];
|
||||
let formdatas = new FormData();
|
||||
formdatas.append("contractAttachment",data);
|
||||
formdatas.append("contractAttachment", data);
|
||||
let obj = {
|
||||
contractAttachment : data,
|
||||
}
|
||||
contractDownload(obj).then(res=>{
|
||||
contractAttachment: data,
|
||||
};
|
||||
contractDownload(obj).then((res) => {
|
||||
const blob = new Blob([res]);
|
||||
if (window.navigator.msSaveBlob) {
|
||||
window.navigator.msSaveBlob(blob,fileName);
|
||||
window.navigator.msSaveBlob(blob, fileName);
|
||||
} else {
|
||||
const downloadElement = document.createElement("a");
|
||||
const href = window.URL.createObjectURL(blob); // 创建下载的链接
|
||||
|
|
@ -334,38 +329,39 @@ export default {
|
|||
document.body.removeChild(downloadElement); // 下载完成移除元素
|
||||
window.URL.revokeObjectURL(href); // 释放掉blob对象
|
||||
}
|
||||
|
||||
})
|
||||
});
|
||||
}
|
||||
},
|
||||
// 自定义
|
||||
uploadCustomfp(e){
|
||||
console.log(e)
|
||||
uploadCustomfp(e) {
|
||||
console.log(e);
|
||||
// this.fileNames = e.file.name;
|
||||
// this.formInline.file = e.file;
|
||||
let formdata=new FormData();
|
||||
formdata.append("file",e.file);
|
||||
let formdata = new FormData();
|
||||
formdata.append("file", e.file);
|
||||
xyUploadReimburse(formdata)
|
||||
.then(res=>{
|
||||
console.log(res)
|
||||
this.formInline.invoiceAccessory = res;
|
||||
}).catch(err=>{
|
||||
console.log(err)
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
this.formInline.invoiceAccessory = res;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
},
|
||||
uploadCustom(e){
|
||||
console.log(e)
|
||||
uploadCustom(e) {
|
||||
console.log(e);
|
||||
// this.fileNames = e.file.name;
|
||||
// this.formInline.file = e.file;
|
||||
let formdata=new FormData();
|
||||
formdata.append("file",e.file);
|
||||
let formdata = new FormData();
|
||||
formdata.append("file", e.file);
|
||||
xyUploadReimburse(formdata)
|
||||
.then(res=>{
|
||||
console.log(res)
|
||||
this.formInline.otherAccessory = res;
|
||||
}).catch(err=>{
|
||||
console.log(err)
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
this.formInline.otherAccessory = res;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
},
|
||||
// 获取 项目经理(项目负责人) 下拉框数据
|
||||
// getXmOption(){
|
||||
|
|
|
|||
329
src/views/reimbursement/creatcustomer.vue
Normal file
329
src/views/reimbursement/creatcustomer.vue
Normal file
|
|
@ -0,0 +1,329 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
size="mini"
|
||||
label-width="160px"
|
||||
:rules="rules"
|
||||
ref="ruleForm"
|
||||
:model="formInline"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同名称:">
|
||||
<el-input
|
||||
v-model="formInline.contractName"
|
||||
placeholder="合同名称"
|
||||
></el-input> </el-form-item
|
||||
></el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同编号:">
|
||||
<el-input
|
||||
v-model="formInline.contractId"
|
||||
placeholder="合同编号"
|
||||
></el-input> </el-form-item
|
||||
></el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同类型:" prop="marketAmount">
|
||||
<el-select style="width: 100%" v-model="formInline.contractType">
|
||||
<el-option label="实施类" :value="0"></el-option>
|
||||
<el-option label="人月类" :value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同总⾦额:">
|
||||
<el-input
|
||||
v-model="formInline.totalAmount"
|
||||
@input="
|
||||
formInline.totalAmount = changeNum(formInline.totalAmount)
|
||||
"
|
||||
></el-input> </el-form-item
|
||||
></el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同开始⽇期:">
|
||||
<el-date-picker
|
||||
style="width: 100%"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
v-model="formInline.startDate"
|
||||
placeholder="合同开始⽇期"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同结束⽇期:">
|
||||
<el-date-picker
|
||||
style="width: 100%"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
v-model="formInline.endDate"
|
||||
placeholder="合同结束⽇期"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="发票抬头(甲方)">
|
||||
<el-input v-model="formInline.invoicingNamePartyA" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="发票抬头(乙方)">
|
||||
<el-input v-model="formInline.invoicingNamePartyB" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="formInline.notes" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="float: right">
|
||||
<el-button @click="cancelBtn('ruleForm')">取 消</el-button>
|
||||
<el-button type="primary" @click="onSubmit('ruleForm')"
|
||||
>确 定</el-button
|
||||
>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
contractDownload,
|
||||
xyUploadReimburse, //上传发票,其他附件
|
||||
xyReimburseinfoAdd, //新增
|
||||
xyReimburseinfoPut, //修改
|
||||
contractList,
|
||||
addcstContracts,
|
||||
editcstContracts,
|
||||
} from "@/api/article";
|
||||
import { getProjectList } from "@/api/xyPersoninfo";
|
||||
export default {
|
||||
data() {
|
||||
var validateInput = (rule, value, callback) => {
|
||||
if (value === "") {
|
||||
callback(new Error("没有数据"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
return {
|
||||
uploadUrl: "www.baidu.com",
|
||||
headerObj: {
|
||||
Authorization: "",
|
||||
},
|
||||
contracts: [],
|
||||
// fileNames : "",
|
||||
// contractNameOption:[],
|
||||
formInline: {},
|
||||
rules: {
|
||||
jobNum: [{ validator: validateInput, trigger: "blur" }],
|
||||
empName: [{ validator: validateInput, trigger: "blur" }],
|
||||
reimburseAmt: [{ validator: validateInput, trigger: "blur" }],
|
||||
reimburseDate: [{ validator: validateInput, trigger: "blur" }],
|
||||
reimburseCont: [{ validator: validateInput, trigger: "blur" }],
|
||||
invoiceAccessory: [{ validator: validateInput, trigger: "blur" }],
|
||||
otherAccessory: [{ validator: validateInput, trigger: "blur" }],
|
||||
},
|
||||
xxProjectList: [],
|
||||
editState: 0, //0:新增,1:编辑
|
||||
editId: "", //编辑id-xpId
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
var param = {};
|
||||
|
||||
this.gecontractLists();
|
||||
// this.getXmOption();
|
||||
// this.getcontractName();//合同选项-下拉
|
||||
let data = JSON.parse(localStorage.getItem("editData"));
|
||||
if (data != null) {
|
||||
this.formInline = { ...data };
|
||||
|
||||
this.editState = 1;
|
||||
} else {
|
||||
this.editState = 0;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeNum(objt) {
|
||||
let obj = {
|
||||
value: objt,
|
||||
};
|
||||
//如果用户第一位输入的是小数点,则重置输入框内容
|
||||
if (obj.value != "" && obj.value.substr(0, 1) == ".") {
|
||||
obj.value = "";
|
||||
}
|
||||
obj.value = obj.value.replace(/^0*(0\.|[1-9])/, "$1"); //粘贴不生效
|
||||
obj.value = obj.value.replace(/[^\d.]/g, ""); //清除“数字”和“.”以外的字符
|
||||
obj.value = obj.value.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的
|
||||
obj.value = obj.value
|
||||
.replace(".", "$#$")
|
||||
.replace(/\./g, "")
|
||||
.replace("$#$", ".");
|
||||
obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3"); //只能输入两个小数
|
||||
if (obj.value.indexOf(".") < 0 && obj.value != "") {
|
||||
//以上已经过滤,此处控制的是如果没有小数点,首位不能为类似于 01、02的金额
|
||||
if (obj.value.substr(0, 1) == "0" && obj.value.length == 2) {
|
||||
obj.value = obj.value.substr(1, obj.value.length);
|
||||
}
|
||||
}
|
||||
return obj.value;
|
||||
// this.formInline.marketAmount = obj.value;
|
||||
},
|
||||
setcontractdata(value) {
|
||||
if (value) {
|
||||
let obj = this.contracts.find((item) => item);
|
||||
this.formInline.contractId = obj.contractCode;
|
||||
this.formInline.contractName = obj.contractName;
|
||||
} else {
|
||||
this.formInline.contractId = "";
|
||||
this.formInline.contractName = "";
|
||||
}
|
||||
},
|
||||
|
||||
gecontractLists() {
|
||||
contractList({
|
||||
page: 0,
|
||||
size: 300,
|
||||
})
|
||||
.then((res) => {
|
||||
this.contracts = res.content;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
},
|
||||
|
||||
// 保存
|
||||
onSubmit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
let editState = this.editState;
|
||||
|
||||
if (editState == 0) {
|
||||
addcstContracts({ ...this.formInline }).then((res) => {
|
||||
this.$router.push("/reimbursement/customer");
|
||||
});
|
||||
} else {
|
||||
editcstContracts({ ...this.formInline }).then((res) => {
|
||||
this.$router.push("/reimbursement/customer");
|
||||
});
|
||||
}
|
||||
} else {
|
||||
console.log("error submit!!");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 取消 :是编辑会转成新增
|
||||
cancelBtn(formName) {
|
||||
this.editState = 0;
|
||||
localStorage.setItem("editData", null);
|
||||
|
||||
this.$refs[formName].resetFields();
|
||||
this.$router.push("/reimbursement/list");
|
||||
},
|
||||
// 两位小数
|
||||
changeNum(objt) {
|
||||
let obj = {
|
||||
value: objt,
|
||||
};
|
||||
//如果用户第一位输入的是小数点,则重置输入框内容
|
||||
if (obj.value != "" && obj.value.substr(0, 1) == ".") {
|
||||
obj.value = "";
|
||||
}
|
||||
obj.value = obj.value.replace(/^0*(0\.|[1-9])/, "$1"); //粘贴不生效
|
||||
obj.value = obj.value.replace(/[^\d.]/g, ""); //清除“数字”和“.”以外的字符
|
||||
obj.value = obj.value.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的
|
||||
obj.value = obj.value
|
||||
.replace(".", "$#$")
|
||||
.replace(/\./g, "")
|
||||
.replace("$#$", ".");
|
||||
obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3"); //只能输入两个小数
|
||||
if (obj.value.indexOf(".") < 0 && obj.value != "") {
|
||||
//以上已经过滤,此处控制的是如果没有小数点,首位不能为类似于 01、02的金额
|
||||
if (obj.value.substr(0, 1) == "0" && obj.value.length == 2) {
|
||||
obj.value = obj.value.substr(1, obj.value.length);
|
||||
}
|
||||
}
|
||||
return obj.value;
|
||||
// this.formInline.marketAmount = obj.value;
|
||||
},
|
||||
// 下载
|
||||
downloadFile(data) {
|
||||
// console.log(data);
|
||||
if (data == "" || data == null) {
|
||||
this.$message({
|
||||
type: "error",
|
||||
message: "还未上传过电子合同附件,先上传才可以下载",
|
||||
});
|
||||
} else {
|
||||
let len = data.split("/").length;
|
||||
let fileName = data.split("/")[len - 1];
|
||||
let formdatas = new FormData();
|
||||
formdatas.append("contractAttachment", data);
|
||||
let obj = {
|
||||
contractAttachment: data,
|
||||
};
|
||||
contractDownload(obj).then((res) => {
|
||||
const blob = new Blob([res]);
|
||||
if (window.navigator.msSaveBlob) {
|
||||
window.navigator.msSaveBlob(blob, fileName);
|
||||
} else {
|
||||
const downloadElement = document.createElement("a");
|
||||
const href = window.URL.createObjectURL(blob); // 创建下载的链接
|
||||
downloadElement.href = href;
|
||||
downloadElement.download = fileName; // 下载后文件名
|
||||
document.body.appendChild(downloadElement);
|
||||
downloadElement.click(); // 点击下载
|
||||
document.body.removeChild(downloadElement); // 下载完成移除元素
|
||||
window.URL.revokeObjectURL(href); // 释放掉blob对象
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
// 自定义
|
||||
uploadCustomfp(e) {
|
||||
console.log(e);
|
||||
// this.fileNames = e.file.name;
|
||||
// this.formInline.file = e.file;
|
||||
let formdata = new FormData();
|
||||
formdata.append("file", e.file);
|
||||
xyUploadReimburse(formdata)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
this.formInline.invoiceAccessory = res;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
},
|
||||
uploadCustom(e) {
|
||||
console.log(e);
|
||||
// this.fileNames = e.file.name;
|
||||
// this.formInline.file = e.file;
|
||||
let formdata = new FormData();
|
||||
formdata.append("file", e.file);
|
||||
xyUploadReimburse(formdata)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
this.formInline.otherAccessory = res;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
},
|
||||
// 获取 项目经理(项目负责人) 下拉框数据
|
||||
// getXmOption(){
|
||||
// xyProjectinfoSelectXm().then(res=>{
|
||||
// // console.log(res)
|
||||
// this.xmOption = res;
|
||||
// })
|
||||
// },
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
@ -67,7 +67,7 @@
|
|||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="工号:" >
|
||||
<el-input disabled
|
||||
v-model="formInline.jobNum"
|
||||
|
|
@ -75,7 +75,7 @@
|
|||
maxlength="100"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="报销金额:" prop="reimburseAmt">
|
||||
<el-input
|
||||
|
|
|
|||
268
src/views/reimbursement/customer.vue
Normal file
268
src/views/reimbursement/customer.vue
Normal file
|
|
@ -0,0 +1,268 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container" style="margin: 20px 0px">
|
||||
<el-input
|
||||
v-model="searchObj.contractName"
|
||||
clearable
|
||||
placeholder="合同名称"
|
||||
style="width: 200px; margin-right: 10px"
|
||||
class="filter-item"
|
||||
/>
|
||||
<el-input
|
||||
v-model="searchObj.invoicingNamePartyA"
|
||||
clearable
|
||||
placeholder="甲⽅发票抬头"
|
||||
style="width: 200px; margin-right: 10px"
|
||||
class="filter-item"
|
||||
/>
|
||||
<el-input
|
||||
v-model="searchObj.invoicingNamePartyB"
|
||||
clearable
|
||||
placeholder="⼄⽅发票抬头"
|
||||
style="width: 200px; margin-right: 10px"
|
||||
class="filter-item"
|
||||
/>
|
||||
<el-select
|
||||
style="width: 200px; margin-right: 10px"
|
||||
v-model="searchObj.sort"
|
||||
placeholder="查询排序"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
label="正序"
|
||||
value="asc"
|
||||
></el-option>
|
||||
<el-option
|
||||
label="倒序"
|
||||
value="desc"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<el-button
|
||||
class="filter-item"
|
||||
type="success"
|
||||
|
||||
icon="el-icon-search"
|
||||
@click="searchBtn"
|
||||
>搜索</el-button
|
||||
>
|
||||
<!-- 新增 -->
|
||||
<div style="display: inline-block; margin: 0px 2px; float: right">
|
||||
<el-button
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="add"
|
||||
>新增</el-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="list"
|
||||
border
|
||||
stripe
|
||||
highlight-current-row
|
||||
style="width: 100%"
|
||||
>
|
||||
<af-table-column align="center" prop="contractId" label="合同编号" width="200">
|
||||
|
||||
</af-table-column>
|
||||
|
||||
|
||||
<af-table-column prop="contractName" align="center" label="合同名称" >
|
||||
|
||||
</af-table-column>
|
||||
<af-table-column prop="contractType" align="center" label="合同类型" >
|
||||
<template slot-scope="scope">
|
||||
<!-- 只判断是人月类的,合同金额和未付款合同金额写0,其它的逻辑不变 -->
|
||||
<span v-if="scope.row.contractType=='1'">人月类</span>
|
||||
<span v-else-if="scope.row.contractType=='0'">实施类</span>
|
||||
</template>
|
||||
</af-table-column>
|
||||
|
||||
<af-table-column prop="invoicingNamePartyA" align="center" label="甲⽅发票抬头" >
|
||||
|
||||
</af-table-column>
|
||||
|
||||
|
||||
<af-table-column prop="invoicingNamePartyB" align="center" label="⼄⽅发票抬头" >
|
||||
</af-table-column>
|
||||
<af-table-column prop="totalAmount" align="center" label="合同总⾦额" >
|
||||
</af-table-column>
|
||||
|
||||
<af-table-column prop="startDate" align="center" label="合同开始⽇期" >
|
||||
|
||||
</af-table-column>
|
||||
<af-table-column prop="endDate" align="center" label="合同结束⽇期" >
|
||||
|
||||
</af-table-column>
|
||||
<af-table-column prop="notes" align="center" label="备注" >
|
||||
</af-table-column>
|
||||
|
||||
<af-table-column align="center" label="操作" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size='mini' @click="editBtn(scope)">修改</el-button>
|
||||
<el-button type="primary" size='mini' @click="del(scope)">删除</el-button>
|
||||
</template>
|
||||
</af-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
layout="total, prev, pager, next"
|
||||
:total="total"
|
||||
:page.sync="listQuery.page"
|
||||
:limit.sync="listQuery.limit"
|
||||
@pagination="paginations"
|
||||
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<!-- let len = data.split('/').length;
|
||||
let fileName = data.split('/')[len-1]; -->
|
||||
<script>
|
||||
import { xyReimbursementList ,xyReimburseinfoDelte ,xyProjectinfoSelectXm,cstContracts,delcstContracts } from '@/api/article'
|
||||
import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
|
||||
import moment from 'moment'
|
||||
|
||||
export default {
|
||||
name: 'reimbursement',
|
||||
components: { Pagination },
|
||||
|
||||
data() {
|
||||
return {
|
||||
list: null,
|
||||
|
||||
listLoading: true,
|
||||
listQuery: {
|
||||
page: 1,
|
||||
limit: 10
|
||||
},
|
||||
total: 0,
|
||||
pageSize : 10,//每页显示条目个数
|
||||
currentPage : 0,//当前页数
|
||||
|
||||
searchObj : {
|
||||
|
||||
sort : 'desc',
|
||||
},
|
||||
nameOption : [],//姓名下拉框
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
this.getList();
|
||||
// this.getNameSelect();
|
||||
},
|
||||
methods: {
|
||||
// 姓名下拉框
|
||||
getNameSelect(){
|
||||
xyProjectinfoSelectXm().then(res=>{
|
||||
console.log(res);
|
||||
this.nameOption = res
|
||||
}).catch(err=>{
|
||||
console.log(err)
|
||||
})
|
||||
},
|
||||
// 查询表格数据 expenseDate,asc/expenseDate,desc
|
||||
getList(sort='desc') {
|
||||
this.listLoading = true
|
||||
let obj = {
|
||||
page : this.listQuery.page-1,
|
||||
size : this.listQuery.limit,
|
||||
...this.searchObj,
|
||||
sort
|
||||
}
|
||||
console.log(obj);
|
||||
cstContracts(obj).then(res=>{
|
||||
this.listLoading = false;
|
||||
res.content.map(item=>{
|
||||
item.startDate = item.startDate ? moment(item.startDate).format('YYYY-MM-DD') : ''
|
||||
item.endDate = item.endDate ? moment(item.endDate).format('YYYY-MM-DD') : ''
|
||||
|
||||
return item
|
||||
})
|
||||
this.list = res.content;
|
||||
this.total = res.totalElements;
|
||||
})
|
||||
},
|
||||
paginations(item){
|
||||
console.log(item);
|
||||
this.listQuery.page = item.page;
|
||||
this.listQuery.limit = item.limit;
|
||||
|
||||
this.getList();
|
||||
},
|
||||
// 搜索
|
||||
searchBtn(){
|
||||
let {sort} = this.searchObj;
|
||||
this.listQuery.page = 1;
|
||||
this.getList(sort);
|
||||
},
|
||||
// // 删除
|
||||
del(scope){
|
||||
if (!this.$delectAuth()) return;
|
||||
// console.log(scope.row);
|
||||
let id = scope.row.id
|
||||
this.$confirm('确定删除?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// this.$message({
|
||||
// type: 'success',
|
||||
// message: '删除成功!'
|
||||
// });
|
||||
delcstContracts(id).then(res=>{
|
||||
// console.log(res);
|
||||
this.getList();
|
||||
|
||||
})
|
||||
}).catch(() => {
|
||||
// this.$message({
|
||||
// type: 'info',
|
||||
// message: '已取消删除'
|
||||
// });
|
||||
});
|
||||
|
||||
},
|
||||
// // 修改
|
||||
editBtn(scope){
|
||||
localStorage.setItem('editData',JSON.stringify(scope.row) );
|
||||
this.$router.push('/reimbursement/createcustomer');
|
||||
},
|
||||
// // 新增
|
||||
add(){
|
||||
localStorage.setItem('editData',null );
|
||||
this.$router.push('/reimbursement/createcustomer');
|
||||
},
|
||||
// 姓名下拉:选中值发生变化时触发
|
||||
nameChange(val){
|
||||
console.log(val);
|
||||
console.log(this.searchObj.empName,this.searchObj.jobNum);
|
||||
if(val !=""){
|
||||
this.searchObj.empName = val.split('-')[0]
|
||||
this.searchObj.jobNum = val.split('-')[1]
|
||||
}else{
|
||||
this.searchObj.empName = '' ;
|
||||
this.searchObj.jobNum = '' ;
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.edit-input {
|
||||
padding-right: 100px;
|
||||
}
|
||||
/deep/ .el-table th {
|
||||
background: #f5f7fa;
|
||||
}
|
||||
.cancel-btn {
|
||||
position: absolute;
|
||||
right: 15px;
|
||||
top: 10px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -107,7 +107,7 @@
|
|||
</af-table-column>
|
||||
|
||||
|
||||
<af-table-column prop="reimburseCont" align="center" label="项目名称" >
|
||||
<af-table-column prop="xpProName" align="center" label="项目名称" >
|
||||
<!-- <template slot-scope="scope">
|
||||
<span>{{ scope.row.projectName }}</span>
|
||||
</template> -->
|
||||
|
|
@ -121,8 +121,8 @@
|
|||
</template> -->
|
||||
</af-table-column>
|
||||
|
||||
<af-table-column prop="jobNum" align="center" label="工号" >
|
||||
</af-table-column>
|
||||
<!-- <af-table-column prop="jobNum" align="center" label="工号" >
|
||||
</af-table-column> -->
|
||||
<af-table-column prop="empName" align="center" class-name="status-col" label="姓名" >
|
||||
</af-table-column>
|
||||
<af-table-column prop="reimburseAmt" align="center" label="报销金额" >
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user