Commit cb1df2f6 authored by guoyou's avatar guoyou

提交代码

parents 97105fe7 68a42fef
......@@ -681,7 +681,7 @@
<el-row>
<el-col :span="12">
<el-form-item label="交强险单号" prop="strongInsuranceNo">
<el-input v-model="form.strongInsuranceNo" placeholder="请输入交强险单号"></el-input>
<el-input v-model.text="form.strongInsuranceNo" @input="handleInput" placeholder="请输入交强险单号"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
......@@ -770,6 +770,26 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col>
<el-form-item label="保单pdf" prop="insurancePDF" :style="{display:'block'}">
<el-upload
ref="uploadPdf"
:action="BASE_API + '/api/universal/file/app/unauth/admin/upload'"
:show-file-list="false"
:headers="getHeaderWithToken"
:on-success="handleAvatarSuccessPDF"
:style="{display:'inline-block'}"
accept=".pdf"
>
<el-button size="small" plain>选择文件</el-button>
</el-upload>
<div v-for="(item, i) in pdfList" :key = i @click="downloadPDF(i)">
<span>{{item.name}}</span>
</div>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
......@@ -1040,6 +1060,7 @@ export default {
licenceSrcUrl: undefined,
showLoadingBody: false,
allVehicleList: [], //全部车型
pdfList:[],
form: {
insuranceEndDate: null, //商业险日期
vehicleModelName: '', //车型
......@@ -1073,7 +1094,8 @@ export default {
strongInsuranceCompany: undefined,
strongInsuranceEndDate: undefined,
strongInsuranceNo: undefined,
strongInsuranceCompany: undefined
strongInsuranceCompany: undefined,
insurancePDF:undefined
},
rules: {
subordinateBranchName: [
......@@ -1841,6 +1863,9 @@ export default {
},
methods: {
handleInput(e){
this.form.strongInsuranceNo=e.target.value.replace(/[^\d]/g,'');
},
cityRegions4Query() {
let that = this
if (!this.$utils.isInteger(this.listQuery.addrProvince)) {
......@@ -2408,9 +2433,31 @@ export default {
this.form.drivingLicenseDuplicatePath = res.data
this.showLoadingBody = false
},
handleAvatarSuccessPDF(res, file) {
if (res.data) {
if(this.pdfList.length >= 0) {
var data = {
"id": this.pdfList.length + 1,
"name": "车辆保单" + (this.pdfList.length + 1),
"url":res.data
}
this.pdfList.push(data)
}
}
this.showLoadingBody = false
},
downloadPDF(i) {
var data = this.pdfList[i].url;
if(data) {
window.open(data, '_blank');
} else {
alert("车辆保单不存在")
}
},
beforeAvatarUpload(file) {
const isJPG =
file.type === 'image/jpeg' || file.type === 'image/gif'
file.type === 'image/jpeg' || file.type === 'image/gif' || file.type === 'image/pdf'
const isLt2M = file.size / 1024 / 1024 < 10
if (!isJPG) {
......@@ -2759,6 +2806,7 @@ export default {
this.$utils.objectEach(response.data, (item, key) => {
this.form[key] = item
})
that.pdfList = []
selectArry.map(function(iitem) {
if (that.form['subordinateBranch'] == iitem.id) {
that.form.subordinateBranchName = iitem.name
......@@ -2768,6 +2816,9 @@ export default {
that.form.parkBranchCompanyName = iitem.name
that.form.parkBranchCompanyId = iitem.id
}
if (that.form.insurancePDF) {
that.pdfList = JSON.parse(that.form.insurancePDF)
}
})
selectVehicleModelArry.map(function(value) {
if (that.form['modelId'] == value.id) {
......@@ -2869,6 +2920,7 @@ export default {
const set = this.$refs
set[formName].validate(valid => {
if (valid) {
this.form.insurancePDF = JSON.stringify(this.pdfList)
let formTemp = this.fillDateRange2Object(
this.form,
'insuranceDateRange4form',
......
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