You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
305 lines
11 KiB
305 lines
11 KiB
<template>
|
|
<div class="app-container">
|
|
<div class="tab-header webtop">
|
|
<!--标题-->
|
|
<div>{{ viewTitle }}</div>
|
|
<!--start 添加修改按钮-->
|
|
<div>
|
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="handleSave()">保存
|
|
</el-button>
|
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="handleSubmit()">确认
|
|
</el-button>
|
|
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
|
</div>
|
|
</div>
|
|
<div class="listconadd">
|
|
<div class="titwu">发票信息</div>
|
|
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
|
|
<el-row style="border-top: 1px solid #E0E3EB">
|
|
<el-col :span="24">
|
|
<div class="span-sty">开票单位</div>
|
|
<el-form-item><span class="addinputInfo">{{ formobj.invoiceTitle }}</span></el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="8">
|
|
<div class="span-sty">合同编号</div>
|
|
<el-form-item><span class="addinputInfo">{{ formobj.contractNo }}</span></el-form-item>
|
|
</el-col>
|
|
<el-col :span="8">
|
|
<div class="span-sty">客户名称</div>
|
|
<el-form-item><span class="addinputInfo">{{ formobj.customerName }}</span></el-form-item>
|
|
</el-col>
|
|
<el-col :span="8">
|
|
<div class="span-sty">车架号</div>
|
|
<el-form-item><span class="addinputInfo">{{ formobj.vinNo }}</span></el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="8">
|
|
<div class="span-sty">开票类型</div>
|
|
<el-form-item><span class="addinputInfo">{{ formobj.invoiceType }}</span></el-form-item>
|
|
</el-col>
|
|
<el-col :span="8">
|
|
<div class="span-sty">开票金额</div>
|
|
<el-form-item><span class="addinputInfo">{{ formobj.invoiceAmount }}</span></el-form-item>
|
|
</el-col>
|
|
<el-col :span="8">
|
|
<div class="span-sty">开票状态</div>
|
|
<el-form-item><span class="addinputInfo">{{ formobj.billingState }}</span></el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<div class="span-sty">开票名称</div>
|
|
<el-form-item><span class="addinputInfo">{{ formobj.invoicingName }}</span></el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="12">
|
|
<div class="span-sty">开票人</div>
|
|
<el-form-item><span class="addinputInfo">{{ formobj.name }}</span></el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<div class="span-sty"><span class="icon">*</span>开票日期</div>
|
|
<el-form-item><el-date-picker v-model="formobj.createTime" class="addinputw" type="date" clearable value-format="yyyy-MM-dd" placeholder="选择日期"/></el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="12">
|
|
<div class="span-sty"><span class="icon">*</span>发票号</div>
|
|
<el-form-item><el-input v-model="formobj.invoiceNo" clearable class="addinputw" /></el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<div class="span-sty"><span class="icon">*</span>发票代码</div>
|
|
<el-form-item><el-input v-model="formobj.invoiceCode" clearable class="addinputw" /></el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<div class="span-sty" style="display: flex;flex-direction: row;justify-content: flex-end;align-items: center"><span class="icon">*</span>发票照片</div>
|
|
<el-form-item>
|
|
<upload ref="uploadImg" v-model="diploma_list" :accept="accept" class="addinputw" :limit="50" bucket="map" :upload-data="{ type: '0001' }"/>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<div class="span-sty">开票申请附件</div>
|
|
<el-form-item>
|
|
<div class="addinputInfo">
|
|
<el-image style="width: 178px;height: 178px;padding-left: 5px" v-for="(item,index) in formobj.billingFilePaths" :key="index" :src="item" :preview-src-list="formobj.billingFilePaths"></el-image>
|
|
</div>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<div class="span-sty">合格证</div>
|
|
<el-form-item>
|
|
<div class="addinputInfo">
|
|
<el-image style="width: 178px;height: 178px;padding-left: 5px" v-for="(item,index) in formobj.certificatePaths" :key="index" :src="item" :preview-src-list="formobj.certificatePaths"></el-image>
|
|
</div>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<div class="title">开票信息</div>
|
|
<el-row>
|
|
<el-col :span="12">
|
|
<div class="span-sty">开票名称</div>
|
|
<el-form-item><span class="addinputInfo">{{ formobj.invoicingName }}</span></el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<div class="span-sty">纳税人识别号</div>
|
|
<el-form-item><span class="addinputInfo">{{ formobj.taxpayerNo }}</span></el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="12">
|
|
<div class="span-sty">地址</div>
|
|
<el-form-item><span class="addinputInfo">{{ formobj.address }}</span></el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<div class="span-sty">电话</div>
|
|
<el-form-item><span class="addinputInfo">{{ formobj.telPhone }}</span></el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="12">
|
|
<div class="span-sty">开户行</div>
|
|
<el-form-item><span class="addinputInfo">{{ formobj.openingBank }}</span></el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<div class="span-sty">银行账号</div>
|
|
<el-form-item><span class="addinputInfo">{{ formobj.bankNum }}</span></el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
</el-form>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { fetchDetailsBySid, saveOrUpdate } from '@/api/anruifinmanagement/fininvoiceapply'
|
|
import upload from '@/components/uploadFile/upload'
|
|
|
|
export default {
|
|
name: 'billingmanagementAdd',
|
|
components: {
|
|
upload
|
|
},
|
|
data() {
|
|
return {
|
|
viewTitle: '',
|
|
submitdisabled: false,
|
|
diploma_list: [],
|
|
accept: '.jpg,.jpeg,.png,.JPG,.JPEG',
|
|
formobj: {
|
|
sid: '',
|
|
invoiceTitle: '',
|
|
contractNo: '',
|
|
customerName: '',
|
|
invoiceType: '',
|
|
invoiceAmount: '',
|
|
billingState: '',
|
|
invoicingName: '',
|
|
name: '',
|
|
createTime: '',
|
|
invoiceNo: '',
|
|
invoiceCode: '',
|
|
filePaths: [],
|
|
billingFilePaths: [],
|
|
certificatePaths: [],
|
|
vinNo: '',
|
|
tempSave: ''
|
|
},
|
|
rules: {}
|
|
}
|
|
},
|
|
methods: {
|
|
showEdit(sid) {
|
|
this.viewTitle = '【编辑】发票信息'
|
|
this.$nextTick(() => {
|
|
this.$refs['form_obj'].clearValidate()
|
|
})
|
|
fetchDetailsBySid(sid).then((res) => {
|
|
if (res.success) {
|
|
this.formobj = res.data
|
|
if (this.formobj.filePaths.length > 0) {
|
|
for (var i = 0; i < this.formobj.filePaths.length; i++) {
|
|
this.diploma_list.push({
|
|
name: '',
|
|
url: this.formobj.filePaths[i]
|
|
})
|
|
}
|
|
}
|
|
}
|
|
})
|
|
},
|
|
handleSave() {
|
|
this.$refs['form_obj'].validate((valid) => {
|
|
if (valid) {
|
|
this.getUrl()
|
|
this.submitdisabled = true
|
|
this.formobj.tempSave = true
|
|
saveOrUpdate(this.formobj).then((res) => {
|
|
if (res.success) {
|
|
this.$message({ showClose: true, type: 'success', message: '保存成功' })
|
|
this.handleReturn('true')
|
|
} else {
|
|
this.submitdisabled = false
|
|
}
|
|
}).catch(() => {
|
|
this.submitdisabled = false
|
|
})
|
|
}
|
|
})
|
|
},
|
|
handleSubmit() {
|
|
this.$refs['form_obj'].validate((valid) => {
|
|
if (valid) {
|
|
if (this.formobj.invoiceNo === '') {
|
|
this.$message({ showClose: true, type: 'error', message: '发票号不能为空' })
|
|
return
|
|
}
|
|
if (this.formobj.invoiceCode === '') {
|
|
this.$message({ showClose: true, type: 'error', message: '发票代码不能为空' })
|
|
return
|
|
}
|
|
if (this.formobj.createTime === '') {
|
|
this.$message({ showClose: true, type: 'error', message: '开票日期不能为空' })
|
|
return
|
|
}
|
|
this.getUrl()
|
|
if (this.formobj.filePaths === 0) {
|
|
this.$message({ showClose: true, type: 'error', message: '请上传发票照片' })
|
|
return
|
|
}
|
|
this.submitdisabled = true
|
|
this.formobj.tempSave = false
|
|
saveOrUpdate(this.formobj).then((res) => {
|
|
if (res.success) {
|
|
this.$message({ showClose: true, type: 'success', message: '操作陈工' })
|
|
this.handleReturn('true')
|
|
} else {
|
|
this.submitdisabled = false
|
|
}
|
|
}).catch(() => {
|
|
this.submitdisabled = false
|
|
})
|
|
}
|
|
})
|
|
},
|
|
getUrl() {
|
|
if (this.diploma_list.length > 0) {
|
|
const aa = []
|
|
for (var i = 0; i < this.diploma_list.length; i++) {
|
|
aa.push(this.diploma_list[i].url)
|
|
}
|
|
this.formobj.filePaths = aa
|
|
} else {
|
|
this.formobj.filePaths = []
|
|
}
|
|
console.log(this.formobj, this.diploma_list)
|
|
},
|
|
handleReturn(isreload) {
|
|
if (isreload === 'true') this.$emit('reloadlist')
|
|
this.formobj = {
|
|
sid: '',
|
|
invoiceTitle: '',
|
|
contractNo: '',
|
|
customerName: '',
|
|
invoiceType: '',
|
|
invoiceAmount: '',
|
|
billingState: '',
|
|
invoicingName: '',
|
|
name: '',
|
|
createTime: '',
|
|
invoiceNo: '',
|
|
invoiceCode: '',
|
|
filePaths: [],
|
|
vinNo: '',
|
|
tempSave: ''
|
|
}
|
|
this.diploma_list = []
|
|
this.submitdisabled = false
|
|
this.$refs['form_obj'].resetFields()
|
|
this.$emit('doback')
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.span-sty {
|
|
width: 100px !important;
|
|
}
|
|
.addinputInfo {
|
|
margin-left: 90px !important;
|
|
}
|
|
.addinputw {
|
|
margin-left: 90px !important;
|
|
}
|
|
</style>
|
|
|