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.
421 lines
14 KiB
421 lines
14 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="8">
|
|
<div class="span-sty"><span>合同编号</span></div>
|
|
<el-form-item><span class="addinputInfo">{{ formobj.contractNo }}</span></el-form-item>
|
|
</el-col>
|
|
<el-col :span="16">
|
|
<div class="span-sty"><span>客户名称</span></div>
|
|
<el-form-item><span class="addinputInfo">{{ formobj.customerName }}</span></el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="8">
|
|
<div class="span-sty"><span>接收人</span></div>
|
|
<el-form-item><span class="addinputInfo">{{ formobj.recipient }}</span></el-form-item>
|
|
</el-col>
|
|
<el-col :span="16">
|
|
<div class="span-sty"><span>身份证号</span></div>
|
|
<el-form-item><span class="addinputInfo">{{ formobj.idNo }}</span></el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="8">
|
|
<div class="span-sty"><span>交付日期</span></div>
|
|
<el-form-item><span class="addinputInfo">{{ formobj.deliverDate }}</span></el-form-item>
|
|
</el-col>
|
|
<el-col :span="16">
|
|
<div class="span-sty"><span>交付地点</span></div>
|
|
<el-form-item><span class="addinputInfo">{{ formobj.deliverAddress }}</span></el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<div class="span-sty"><span>备注</span></div>
|
|
<el-form-item>
|
|
<el-input v-model="formobj.remarks" class="addinputInfo" style="width: 80%" clearable placeholder="" />
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<div class="span-sty"><span>车型</span></div>
|
|
<el-form-item><span class="addinputInfo">{{ formobj.modelName }}</span></el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<div class="title">
|
|
交付车辆信息
|
|
</div>
|
|
<el-table :key="tableKey" :data="formobj.carList" :index="index" border style="width: 100%">
|
|
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/>
|
|
<el-table-column label="车架号" align="center">
|
|
<template slot-scope="scope">
|
|
<span>{{ scope.row.vinNo }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="交车照片" align="center">
|
|
<template slot-scope="scope">
|
|
<el-button type="primary" size="mini" @click="handleUpload(scope.row, scope.$index, '交车')">上传</el-button>
|
|
<el-button type="primary" size="mini" style="padding-left: 5px" v-show="scope.row.deliveryImages.length > 0" @click="handleLook(scope.row.deliveryImages)">查看</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="保单" align="center">
|
|
<template slot-scope="scope">
|
|
<el-button type="primary" size="mini" @click="handleUpload(scope.row, scope.$index, '保单')">上传</el-button>
|
|
<el-button type="primary" size="mini" v-show="scope.row.policyImages.length > 0" @click="handleLook(scope.row.policyImages)">查看</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<div class="span-sty" style="display: flex;flex-direction: row;justify-content: flex-end;align-items: center"><span>接收车辆确认书</span></div>
|
|
<el-form-item>
|
|
<upload ref="uploadImg" class="addinputInfo" v-model="image_list1" :accept="accept" :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" style="display: flex;flex-direction: row;justify-content: flex-end;align-items: center"><span>委托提车授权书及委托人身份证</span></div>
|
|
<el-form-item>
|
|
<upload ref="uploadImg" class="addinputInfo" v-model="image_list2" :accept="accept" :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" style="display: flex;flex-direction: row;justify-content: flex-end;align-items: center"><span>交车资料确认单</span></div>
|
|
<el-form-item>
|
|
<upload ref="uploadImg" class="addinputInfo" v-model="image_list3" :accept="accept" :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" style="display: flex;flex-direction: row;justify-content: flex-end;align-items: center"><span>出门证照片</span></div>
|
|
<el-form-item>
|
|
<upload ref="uploadImg" class="addinputInfo" v-model="image_list4" :accept="accept" :limit="50" bucket="map" :upload-data="{ type: '0001' }"/>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
</el-form>
|
|
</div>
|
|
<!-- 交车照片、保单上传 -->
|
|
<el-dialog center :visible.sync="uploadVisible" :show-close="false">
|
|
<el-form class="formadd" :model="accessory">
|
|
<el-row style="border-top: 1px solid #E0E3EB">
|
|
<el-col :span="4" class="tleftb" style="display: flex;flex-direction: row;justify-content: flex-end;align-items: center">
|
|
<span>{{ accessory.title }}</span>
|
|
</el-col>
|
|
<el-col :span="20">
|
|
<el-form-item>
|
|
<upload v-if="accessory.title == '保单'" ref="uploadImg" v-model="accessory.policyImages" :accept="accept" :limit="50" bucket="map" :upload-data="{ type: '0001' }"/>
|
|
<upload v-else ref="uploadImg" v-model="accessory.deliveryImages" :accept="accept" :limit="50" bucket="map" :upload-data="{ type: '0001' }"/>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
</el-form>
|
|
<span slot="footer" class="dialog-footer">
|
|
<el-button type="primary" size="small" @click="handleConfirm">确定</el-button>
|
|
<el-button size="small" @click="handleColse">取消</el-button>
|
|
</span>
|
|
</el-dialog>
|
|
<!-- 交车照片、保单上传 -->
|
|
<el-dialog :visible.sync="dialogVisible">
|
|
<el-image v-for="(item, index) in list" :key="index" :src="item" :preview-src-list="list"/>
|
|
</el-dialog>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { fetchDetailsBySid, saveDeliveryConfirmInfo, submit } from '@/api/jiaochebanli/cardelivery'
|
|
import upload from '@/components/uploadFile/upload'
|
|
|
|
export default {
|
|
name: 'JiaoCheQueRen',
|
|
components: {
|
|
upload
|
|
},
|
|
data() {
|
|
return {
|
|
viewTitle: '',
|
|
submitdisabled: false,
|
|
uploadVisible: false,
|
|
dialogVisible: false,
|
|
list: [],
|
|
tableKey: 0,
|
|
index: 0,
|
|
accept: '.jpg,.jpeg,.png,.JPG,.JPEG',
|
|
image_list1: [],
|
|
image_list2: [],
|
|
image_list3: [],
|
|
image_list4: [],
|
|
image_list5: [],
|
|
formobj: {
|
|
sid: '',
|
|
contractNo: '',
|
|
deliverDate: '',
|
|
modelName: '',
|
|
customerName: '',
|
|
idNo: '',
|
|
deliverAddress: '',
|
|
recipient: '',
|
|
remarks: '',
|
|
carList: [],
|
|
receiveCarImages: [],
|
|
entrustImages: [],
|
|
entrustConfirmImages: [],
|
|
exitTicketImages: [],
|
|
userSid: '',
|
|
orgSidPath: '',
|
|
procInsId: '',
|
|
taskId: ''
|
|
},
|
|
accessory: {
|
|
title: '',
|
|
index: '',
|
|
policyImages: [],
|
|
deliveryImages: []
|
|
},
|
|
rules: {}
|
|
}
|
|
},
|
|
methods: {
|
|
showInfo(row) {
|
|
fetchDetailsBySid(row.sid).then((res) => {
|
|
if (res.success) {
|
|
this.formobj = res.data
|
|
this.formobj.instanceId = res.data.procInsId
|
|
this.formobj.userSid = window.sessionStorage.getItem('userSid')
|
|
if (this.formobj.receiveCarImages.length > 0) {
|
|
this.formobj.receiveCarImages.forEach((e) => {
|
|
this.image_list1.push({
|
|
name: '',
|
|
url: e
|
|
})
|
|
})
|
|
}
|
|
if (this.formobj.entrustImages.length > 0) {
|
|
this.formobj.entrustImages.forEach((e) => {
|
|
this.image_list2.push({
|
|
name: '',
|
|
url: e
|
|
})
|
|
})
|
|
}
|
|
if (this.formobj.entrustConfirmImages.length > 0) {
|
|
this.formobj.entrustConfirmImages.forEach((e) => {
|
|
this.image_list3.push({
|
|
name: '',
|
|
url: e
|
|
})
|
|
})
|
|
}
|
|
if (this.formobj.exitTicketImages.length > 0) {
|
|
this.formobj.exitTicketImages.forEach((e) => {
|
|
this.image_list4.push({
|
|
name: '',
|
|
url: e
|
|
})
|
|
})
|
|
}
|
|
}
|
|
})
|
|
},
|
|
// 上传
|
|
handleUpload(row, index, title) {
|
|
this.uploadVisible = true
|
|
this.accessory.title = title
|
|
this.accessory.index = index
|
|
if (title === '保单') {
|
|
if (row.policyImages.length > 0) {
|
|
for (var i = 0; i < row.policyImages.length; i++) {
|
|
this.accessory.policyImages.push({
|
|
name: '',
|
|
url: row.policyImages[i]
|
|
})
|
|
}
|
|
}
|
|
} else {
|
|
if (row.deliveryImages.length > 0) {
|
|
for (var k = 0; k < row.deliveryImages.length; k++) {
|
|
this.accessory.deliveryImages.push({
|
|
name: '',
|
|
url: row.deliveryImages[i]
|
|
})
|
|
}
|
|
}
|
|
}
|
|
},
|
|
handleLook(row) {
|
|
this.dialogVisible = true
|
|
this.list = row
|
|
},
|
|
// 确定
|
|
handleConfirm() {
|
|
if (this.accessory.title === '保单') {
|
|
if (this.accessory.policyImages.length > 0) {
|
|
const aa = []
|
|
for (var l = 0; l < this.accessory.policyImages.length; l++) {
|
|
aa.push(this.accessory.policyImages[l].url)
|
|
}
|
|
this.formobj.carList[this.accessory.index].policyImages = aa
|
|
}
|
|
} else {
|
|
if (this.accessory.deliveryImages.length > 0) {
|
|
const bb = []
|
|
for (var m = 0; m < this.accessory.deliveryImages.length; m++) {
|
|
bb.push(this.accessory.deliveryImages[m].url)
|
|
}
|
|
this.formobj.carList[this.accessory.index].deliveryImages = bb
|
|
}
|
|
}
|
|
this.handleColse()
|
|
},
|
|
// 取消
|
|
handleColse() {
|
|
this.uploadVisible = false
|
|
this.accessory = {
|
|
title: '',
|
|
index: '',
|
|
policyImages: [],
|
|
deliveryImages: []
|
|
}
|
|
},
|
|
handleSave() {
|
|
this.$refs['form_obj'].validate((valid) => {
|
|
if (valid) {
|
|
this.getUrl()
|
|
this.submitdisabled = true
|
|
saveDeliveryConfirmInfo(this.formobj).then((resp) => {
|
|
if (resp.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) {
|
|
this.getUrl()
|
|
this.submitdisabled = true
|
|
submit(this.formobj).then((respsone) => {
|
|
if (respsone.success) {
|
|
this.$message({ showClose: true, type: 'success', message: '提交成功' })
|
|
this.handleReturn('true')
|
|
} else {
|
|
this.submitdisabled = false
|
|
}
|
|
}).catch(() => {
|
|
this.submitdisabled = false
|
|
})
|
|
}
|
|
})
|
|
},
|
|
getUrl() {
|
|
if (this.image_list1.length > 0) {
|
|
const aa = []
|
|
for (var i = 0; i < this.image_list1.length; i++) {
|
|
aa.push(this.image_list1[i].url)
|
|
}
|
|
this.formobj.receiveCarImages = aa
|
|
} else {
|
|
this.formobj.receiveCarImages = []
|
|
}
|
|
if (this.image_list2.length > 0) {
|
|
const bb = []
|
|
for (var k = 0; k < this.image_list2.length; k++) {
|
|
bb.push(this.image_list2[k].url)
|
|
}
|
|
this.formobj.entrustImages = bb
|
|
} else {
|
|
this.formobj.entrustImages = []
|
|
}
|
|
if (this.image_list3.length > 0) {
|
|
const cc = []
|
|
for (var m = 0; m < this.image_list3.length; m++) {
|
|
cc.push(this.image_list3[m].url)
|
|
}
|
|
this.formobj.entrustConfirmImages = cc
|
|
} else {
|
|
this.formobj.entrustConfirmImages = []
|
|
}
|
|
if (this.image_list4.length > 0) {
|
|
const dd = []
|
|
for (var n = 0; n < this.image_list4.length; n++) {
|
|
dd.push(this.image_list4[n].url)
|
|
}
|
|
this.formobj.exitTicketImages = dd
|
|
} else {
|
|
this.formobj.exitTicketImages = []
|
|
}
|
|
},
|
|
handleReturn(isreload) {
|
|
if (isreload === 'true') this.$emit('reloadlist')
|
|
this.formobj = {
|
|
sid: '',
|
|
contractNo: '',
|
|
deliverDate: '',
|
|
modelName: '',
|
|
customerName: '',
|
|
idNo: '',
|
|
deliverAddress: '',
|
|
recipient: '',
|
|
remarks: '',
|
|
carList: [],
|
|
receiveCarImages: [],
|
|
entrustImages: [],
|
|
entrustConfirmImages: [],
|
|
exitTicketImages: [],
|
|
userSid: '',
|
|
orgSidPath: '',
|
|
procInsId: '',
|
|
taskId: ''
|
|
}
|
|
this.accessory = {
|
|
title: '',
|
|
index: '',
|
|
policyImages: [],
|
|
deliveryImages: []
|
|
}
|
|
this.image_list1 = []
|
|
this.image_list2 = []
|
|
this.image_list3 = []
|
|
this.image_list4 = []
|
|
this.submitdisabled = false
|
|
this.$emit('doback')
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.span-sty {
|
|
width: 150px !important;
|
|
}
|
|
.addinputInfo {
|
|
margin-left: 140px !important;
|
|
}
|
|
</style>
|
|
|