|
|
@ -1,28 +1,19 @@ |
|
|
|
<template> |
|
|
|
<div class="app-container"> |
|
|
|
<div class="tab-header webtop"> |
|
|
|
<div>预订车辆</div> |
|
|
|
<!-- <div v-else>11</div> --> |
|
|
|
<div>{{ viewTitle }}</div> |
|
|
|
<div> |
|
|
|
<el-button type="primary" size="small" @click="handleCreate()">保存</el-button> |
|
|
|
<el-button type="primary" size="small" :disabled="disabled" @click="handleSubmit()">提交 |
|
|
|
</el-button> |
|
|
|
<el-button v-show="buttonState" type="primary" size="small">预览</el-button> |
|
|
|
<el-button v-show="buttonState" type="primary" size="small">打印</el-button> |
|
|
|
<el-button type="info" size="small" @click="handleReturn()">返回</el-button> |
|
|
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="handleCreate()">保存</el-button> |
|
|
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="handleSubmit()">提交</el-button> |
|
|
|
<el-button type="primary" size="small">预览</el-button> |
|
|
|
<el-button type="primary" size="small">打印</el-button> |
|
|
|
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="listconadd"> |
|
|
|
<el-form ref="dataForm" :model="temp" label-position="right" label-width="190px" class="formadd" :rules="rules"> |
|
|
|
<div style="text-align: center; font-size: 25px; font-weight: bold; margin-bottom: 20px; margin-top: 20px;">合同 |
|
|
|
</div> |
|
|
|
<div style="border-top: 1px solid #e0e3eb"/> |
|
|
|
<!-- <el-input v-model="temp.contractType" maxlength="125" placeholder="" class="addinputw" clearable hidden /> --> |
|
|
|
<el-form-item prop="customerSid" hidden> |
|
|
|
<span slot="label"/> |
|
|
|
<el-input v-model="temp.customerSid" maxlength="125" placeholder="" class="addinputw" clearable/> |
|
|
|
</el-form-item> |
|
|
|
<el-row> |
|
|
|
<div class="titwu">合同审核</div> |
|
|
|
<el-form ref="temp_obj" :model="temp" label-position="right" label-width="190px" class="formadd" :rules="rules"> |
|
|
|
<el-row style="border-top: 1px solid #e0e3eb"> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item prop="contractNo"> |
|
|
|
<span slot="label">合同编号</span> |
|
|
@ -32,9 +23,8 @@ |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item prop="contractType"> |
|
|
|
<span slot="label">合同类型</span> |
|
|
|
<el-select v-model="temp.contractType" placeholder="请选择" class="addinputw" @change="typeChange"> |
|
|
|
<el-option v-for="item in typeList" :key="item.dictKey" :label="item.dictValue" |
|
|
|
:value="item.dictValue"/> |
|
|
|
<el-select v-model="temp.contractType" placeholder="请选择" filterable class="addinputw" @change="typeChange"> |
|
|
|
<el-option v-for="item in typeList" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
@ -43,13 +33,13 @@ |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item prop="partyA"> |
|
|
|
<span slot="label">甲方名称</span> |
|
|
|
<el-input v-model="temp.partyA" maxlength="125" placeholder="" class="addinputw" clearable/> |
|
|
|
<el-input v-model="temp.partyA" placeholder="" class="addinputw" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item prop="partyB"> |
|
|
|
<span slot="label">乙方名称</span> |
|
|
|
<el-input v-model="temp.partyB" maxlength="125" placeholder="" class="addinputw" clearable/> |
|
|
|
<el-input v-model="temp.partyB" placeholder="" class="addinputw" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
@ -57,16 +47,13 @@ |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item prop="partyC"> |
|
|
|
<span slot="label">其他方名称</span> |
|
|
|
<el-input v-model="temp.partyC" maxlength="125" placeholder="" class="addinputw" clearable/> |
|
|
|
<!-- <span>完善客户信息</span> --> |
|
|
|
<el-input v-model="temp.partyC" placeholder="" class="addinputw" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item prop="createDate"> |
|
|
|
<span slot="label">签订日期</span> |
|
|
|
<!-- <el-input v-model="temp.createDate" maxlength="125" placeholder="" class="addinputw" clearable /> --> |
|
|
|
<el-date-picker v-model="temp.createDate" type="date" value-format="yyyy-MM-dd" format="yyyy-MM-dd" |
|
|
|
clearable placeholder="选择日期" class="addinputw"/> |
|
|
|
<el-date-picker v-model="temp.createDate" type="date" value-format="yyyy-MM-dd" format="yyyy-MM-dd" clearable placeholder="选择日期" class="addinputw"/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
@ -80,8 +67,7 @@ |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item prop="contractAmount"> |
|
|
|
<span slot="label">合同金额</span> |
|
|
|
<el-input v-model="temp.contractAmount" maxlength="125" placeholder="" type="Number" class="addinputw" |
|
|
|
clearable/> |
|
|
|
<el-input v-model="temp.contractAmount" maxlength="125" placeholder="" type="Number" class="addinputw" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
@ -89,8 +75,7 @@ |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item prop="deposit"> |
|
|
|
<span slot="label">订金</span> |
|
|
|
<el-input v-model="temp.deposit" maxlength="125" placeholder="" type="Number" class="addinputw" |
|
|
|
clearable/> |
|
|
|
<el-input v-model="temp.deposit" maxlength="125" placeholder="" type="Number" class="addinputw" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
@ -100,729 +85,193 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<div class="title" style="text-align: left;margin-bottom: 3px;">上传合同扫描件( pdf、图片 )</div> |
|
|
|
<div class="title">新车买卖合同</div> |
|
|
|
<el-row> |
|
|
|
<el-col :span="24"> |
|
|
|
<!-- <el-button size="small" type="primary">选择文件</el-button> --> |
|
|
|
<span slot="label">文件</span> |
|
|
|
<Upload ref="uploadImg" v-model="list1" :limit="1" bucket="map" :upload-data="{type:'0001'}"/> |
|
|
|
</el-col> |
|
|
|
<!-- <el-col>--> |
|
|
|
<!-- <div v-for="(url,index) in list3" v-if="list3.length>0 && url.filePath!=='' " :key="index">--> |
|
|
|
<!-- <div class="nameStyle"><span @click="lookFile(url.filePath,url.type)">{{ url.name }}</span><i--> |
|
|
|
<!-- v-show="deleteTubiaoStyle" class="el-icon-delete" style="color:grey;size:10px"--> |
|
|
|
<!-- @click="deleteFile(url.filePath,index)"/></div>--> |
|
|
|
<!-- </div>--> |
|
|
|
<!-- </el-col>--> |
|
|
|
<!-- <el-col :span="24">--> |
|
|
|
<!-- <div v-for="(url,index) in list2" v-if="list2.length>0 && url.filePath!=='' " :key="index"--> |
|
|
|
<!-- class="imgcontent">--> |
|
|
|
<!-- <div class="dtp"><i v-show="deleteTubiaoStyle" class="el-icon-delete" style="color:grey;size:10px"--> |
|
|
|
<!-- @click="deleteJpg(url.filePath,index)"/></div>--> |
|
|
|
<!-- <el-image :src="url.filePath" lazy style="width:200px;height:200px"/>--> |
|
|
|
<!-- </div>--> |
|
|
|
<!-- <!– <el-image v-for="url in pictureUrls" :key="url" :src="url" lazy />–>--> |
|
|
|
<!-- </el-col>--> |
|
|
|
|
|
|
|
<!-- <el-upload--> |
|
|
|
<!-- action="https://jsonplaceholder.typicode.com/posts/"--> |
|
|
|
<!-- list-type="picture-card"--> |
|
|
|
<!-- :on-preview="handlePictureCardPreview"--> |
|
|
|
<!-- :on-remove="handleRemove">--> |
|
|
|
<!-- <i class="el-icon-plus"></i>--> |
|
|
|
<!-- </el-upload>--> |
|
|
|
<!-- <el-dialog :visible.sync="dialogVisible">--> |
|
|
|
<!-- <img width="100%" :src="dialogImageUrl" alt="">--> |
|
|
|
<!-- </el-dialog>--> |
|
|
|
|
|
|
|
</el-row> |
|
|
|
<div class="title">现场签署照片</div> |
|
|
|
<el-row> |
|
|
|
<el-col :span="24"> |
|
|
|
<Upload ref="uploadImg" v-model="list2" :limit="1" bucket="map" :upload-data="{type:'0001'}"/> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<div class="title">证件照片</div> |
|
|
|
<el-row> |
|
|
|
<el-col :span="24"> |
|
|
|
<Upload ref="uploadImg" v-model="list3" :limit="1" bucket="map" :upload-data="{type:'0001'}"/> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
<el-dialog style="margin-top: -15vh!important;" width="60%" :append-to-body="true" :visible.sync="contractPdfView" |
|
|
|
title="合同"> |
|
|
|
<embed id="plugin" width="100%" height="600" name="plugin" :src="contractPdf" type="application/pdf" |
|
|
|
internalinstanceid="119"> |
|
|
|
</el-dialog> |
|
|
|
<!-- <el-dialog style="margin-top: -15vh!important;" width="60%" :append-to-body="true" :visible.sync="contractPdfView" title="合同">--> |
|
|
|
<!-- <embed id="plugin" width="100%" height="600" name="plugin" :src="contractPdf" type="application/pdf" internalinstanceid="119">--> |
|
|
|
<!-- </el-dialog>--> |
|
|
|
</div> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import {mapGetters} from 'vuex' |
|
|
|
import { |
|
|
|
getSaveByOrderSid, |
|
|
|
saveOrderContract, |
|
|
|
getXiaoShouHeTongByOrderSid, |
|
|
|
} from '@/api/salesManagement/orderManagement' |
|
|
|
import { |
|
|
|
postsave, |
|
|
|
getByBusSid, |
|
|
|
generateContractNo, |
|
|
|
} from '@/api/jichuxinxi/commoncontract' |
|
|
|
import { |
|
|
|
saveContract, |
|
|
|
getOneContract, |
|
|
|
updateContract, |
|
|
|
download, |
|
|
|
deleteFilesOss, |
|
|
|
} from '@/api/jichuxinxi/contract' |
|
|
|
import {submitCarSale, updateCarSale} from '@/api/portal/workFlow' |
|
|
|
import {getPcAppendix} from '@/api/jichuxinxi/commonappendix' |
|
|
|
import Upload from '@/components/uploadFile/upload.vue' // 上传文件 |
|
|
|
import {dictType} from '@/api/salesManagement/orderManagement' |
|
|
|
import {loginDetails} from '@/api/dictcommons/basemanufacturer' |
|
|
|
import {getStorage} from '@/utils/auth' |
|
|
|
|
|
|
|
import { saveContract, getOneContract, updateContract, download, deleteFilesOss } from '@/api/jichuxinxi/contract' |
|
|
|
import Upload from '@/components/uploadFile/upload.vue' // 上传文件 |
|
|
|
import { typeValues } from '@/api/dictcommons/dictcommons' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'HetongdanganguanliAdd', |
|
|
|
components: {Upload}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
disabled: false, // 提交按钮 |
|
|
|
// 图片上传 |
|
|
|
dialogImageUrl: '', |
|
|
|
dialogVisible: false, |
|
|
|
// |
|
|
|
fileList: [], |
|
|
|
typeList: [], |
|
|
|
YongHuid: '', |
|
|
|
list1: [], |
|
|
|
list2: [], |
|
|
|
list3: [], |
|
|
|
pictlist: [], |
|
|
|
contractPdf: '', |
|
|
|
text: '', |
|
|
|
pictureUrls: [], |
|
|
|
visible: false, |
|
|
|
file_list: { |
|
|
|
attachType: '0001', |
|
|
|
linkSid: '', |
|
|
|
}, |
|
|
|
contractPdfView: false, |
|
|
|
deleteTubiaoStyle: false, |
|
|
|
buttonState: true, |
|
|
|
stateId: 0, |
|
|
|
FormLoading: false, |
|
|
|
listLoading: false, |
|
|
|
nodeState: '', // 节点状态 |
|
|
|
submitDto: { |
|
|
|
businessSid: '', |
|
|
|
userSid: window.sessionStorage.getItem('userSid') |
|
|
|
}, |
|
|
|
updateDto: { |
|
|
|
nodeState: '', |
|
|
|
sid: '', |
|
|
|
}, |
|
|
|
temp: {}, // 添加和修改 |
|
|
|
rules: { |
|
|
|
contractType: [{required: true, message: '请填写', trigger: 'blur'},], |
|
|
|
contractNo: [{required: true, message: '请填写', trigger: 'blur'}], |
|
|
|
address: [{required: true, message: '请填写', trigger: 'blur'}], |
|
|
|
contractAmount: [ |
|
|
|
{required: true, message: '请填写', trigger: 'blur'}, |
|
|
|
], |
|
|
|
createDate: [{required: true, message: '请选择', trigger: 'blur'}], |
|
|
|
// mobile: [ |
|
|
|
// { |
|
|
|
// required: true, |
|
|
|
// message: '请填写联系电话', |
|
|
|
// trigger: 'blur' |
|
|
|
// }, |
|
|
|
// { |
|
|
|
// pattern: /^1[3-9]\d{9}$/, |
|
|
|
// message: '手机号格式错误' |
|
|
|
// } |
|
|
|
// ] |
|
|
|
}, |
|
|
|
// ------------------------------------ |
|
|
|
export default { |
|
|
|
name: 'HetongdanganguanliAdd', |
|
|
|
components: { Upload }, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
submitdisabled: false, // 提交按钮 |
|
|
|
viewTitle: '', |
|
|
|
// 图片上传 |
|
|
|
dialogImageUrl: '', |
|
|
|
dialogVisible: false, |
|
|
|
typeList: [], |
|
|
|
list1: [], |
|
|
|
list2: [], |
|
|
|
list3: [], |
|
|
|
contractPdf: '', |
|
|
|
visible: false, |
|
|
|
file_list: { |
|
|
|
attachType: '0001', |
|
|
|
linkSid: '' |
|
|
|
}, |
|
|
|
contractPdfView: false, |
|
|
|
temp: { |
|
|
|
address: '', |
|
|
|
appdixUrl: '', |
|
|
|
busSid: '', |
|
|
|
contractAmount: '', |
|
|
|
contractNo: '', |
|
|
|
contractType: '', |
|
|
|
contractTypeKey: '', |
|
|
|
createDate: '', |
|
|
|
deposit: '', |
|
|
|
partyA: '', |
|
|
|
partyB: '', |
|
|
|
partyC: '', |
|
|
|
pcCommonAppendixDtoList: [], |
|
|
|
remarks: '', |
|
|
|
sceneSignUrl: '', |
|
|
|
sceneSignUrlList: '', |
|
|
|
sid: '', |
|
|
|
staffName: '', |
|
|
|
staffSid: '' |
|
|
|
}, |
|
|
|
rules: { |
|
|
|
contractType: [{ required: true, message: '合同类型不能为空', trigger: 'blur' }], |
|
|
|
contractNo: [{ required: true, message: '合同编号不能为空', trigger: 'blur' }], |
|
|
|
address: [{ required: true, message: '签订地点不能为空', trigger: 'blur' }], |
|
|
|
contractAmount: [{ required: true, message: '合同金额不能为空', trigger: 'blur' }], |
|
|
|
createDate: [{ required: true, message: '签订日期不能为空', trigger: 'blur' }] |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 合同类型 |
|
|
|
init() { |
|
|
|
typeValues({ type: 'contractType' }).then((response) => { |
|
|
|
if (response.success) { |
|
|
|
this.typeList = response.data |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
...mapGetters([ |
|
|
|
'id', |
|
|
|
'roles', |
|
|
|
'rolesIds', |
|
|
|
'departmentId', |
|
|
|
'departmentCode', |
|
|
|
]), |
|
|
|
}, |
|
|
|
created() { |
|
|
|
// 初始化变量 |
|
|
|
this.getType() |
|
|
|
this.postHuoquyonghu() |
|
|
|
showAdd() { |
|
|
|
this.init() |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs['temp_obj'].clearValidate() |
|
|
|
}) |
|
|
|
this.viewTitle = '【新增】合同审核' |
|
|
|
this.temp.staffName = window.sessionStorage.getItem('name') |
|
|
|
this.temp.staffSid = window.sessionStorage.getItem('staffSid') |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
lookFile(val, type) { |
|
|
|
console.log(val + '-------' + type) |
|
|
|
if (type == 'pdf' && val != '') { |
|
|
|
this.contractPdfView = true |
|
|
|
this.contractPdf = val |
|
|
|
} else { |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '没有pdf', |
|
|
|
type: 'warning', |
|
|
|
duration: 2000, |
|
|
|
}) |
|
|
|
showEdit(row) { |
|
|
|
this.init() |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs['temp_obj'].clearValidate() |
|
|
|
}) |
|
|
|
getOneContract(row.sid).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.temp = res.data |
|
|
|
} |
|
|
|
}, |
|
|
|
// 删除文件 |
|
|
|
deleteFile(url, index) { |
|
|
|
deleteFilesOss(url).then((re) => { |
|
|
|
if (re.code === '200') { |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '删除成功', |
|
|
|
type: 'success', |
|
|
|
duration: 2000, |
|
|
|
}) |
|
|
|
this.list3.splice(index, 1) |
|
|
|
var index2 = this.temp.pcCommonAppendixDtoList.findIndex((item) => { |
|
|
|
if (item.filePath === url) { |
|
|
|
return true |
|
|
|
} |
|
|
|
}) |
|
|
|
this.temp.pcCommonAppendixDtoList.splice(index2, 1) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
deleteJpg(url, index) { |
|
|
|
deleteFilesOss(url).then((re) => { |
|
|
|
if (re.code === '200') { |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '删除成功', |
|
|
|
type: 'success', |
|
|
|
duration: 2000, |
|
|
|
}) |
|
|
|
this.list2.splice(index, 1) |
|
|
|
var index2 = this.temp.pcCommonAppendixDtoList.findIndex((item) => { |
|
|
|
if (item.filePath === url) { |
|
|
|
return true |
|
|
|
} |
|
|
|
}) |
|
|
|
this.temp.pcCommonAppendixDtoList.splice(index2, 1) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 合同类型 |
|
|
|
getType() { |
|
|
|
dictType({type: 'contractType'}).then((response) => { |
|
|
|
if (response.code === '200' && response.data) { |
|
|
|
this.typeList = response.data |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
typeChange(val) { |
|
|
|
const choosetItem = this.typeList.filter((item) => item.dictValue == val) |
|
|
|
this.temp.contractTypeKey = choosetItem[0].dictKey |
|
|
|
}, |
|
|
|
|
|
|
|
openUpdate(sid, showed) { |
|
|
|
this.list3 = [] |
|
|
|
this.list2 = [] |
|
|
|
this.updateDto.sid = sid |
|
|
|
this.submitDto.businessSid = sid |
|
|
|
this.temp.sid = sid |
|
|
|
this.stateId = 'xiugai' |
|
|
|
|
|
|
|
console.log('编辑sid', sid) |
|
|
|
if (this.stateId !== '0') { |
|
|
|
getOneContract(sid).then((response) => { |
|
|
|
if (response.code === '200') { |
|
|
|
this.$refs['dataForm'].clearValidate() |
|
|
|
this.temp = response.data |
|
|
|
if(this.temp.nodeState !==''){ |
|
|
|
this.disabled = true |
|
|
|
} |
|
|
|
if (response.data.appdixUrl.indexOf(',') > 0) { |
|
|
|
const da = response.data.appdixUrl.split(',') |
|
|
|
for (var i = 0; i < da.length; i++) { |
|
|
|
const imgName = da[i].split('/') |
|
|
|
this.list2.push({ |
|
|
|
name: imgName[imgName.length - 1], |
|
|
|
url: da[i] |
|
|
|
}) |
|
|
|
} |
|
|
|
const imgList = this.list2 |
|
|
|
this.$refs['uploadImg'].showImg(imgList) |
|
|
|
console.log('123456', this.list2) |
|
|
|
} |
|
|
|
const imgName = response.data.appdixUrl.split('/') |
|
|
|
this.list2.push({ |
|
|
|
name: imgName[imgName.length - 1], |
|
|
|
url: response.data.appdixUrl |
|
|
|
}) |
|
|
|
const imgList = this.list2 |
|
|
|
this.$refs['uploadImg'].showImg(imgList) |
|
|
|
// this.deleteTubiaoStyle = true |
|
|
|
// dialogImageUrl |
|
|
|
// const data = response.data.pcCommonAppendixDtoList |
|
|
|
// this.list2 = response.data.pcCommonAppendixDtoList |
|
|
|
// da.forEach((element) => { |
|
|
|
// if (element.fileType == 'pdf' || element.fileType == 'docx') { |
|
|
|
// this.list3.push({ |
|
|
|
// name: element.fileName, |
|
|
|
// filePath: element.filePath, |
|
|
|
// type: element.fileType, |
|
|
|
// }) |
|
|
|
// } else if ( |
|
|
|
// element.fileType == 'jpg' || |
|
|
|
// element.fileType == 'jpeg' || |
|
|
|
// element.fileType == 'png' |
|
|
|
// ) { |
|
|
|
// this.list2.push({ |
|
|
|
// name: element.fileName, |
|
|
|
// filePath: element.filePath, |
|
|
|
// }) |
|
|
|
// } |
|
|
|
// }) |
|
|
|
if (showed && typeof showed === 'function') { |
|
|
|
showed() |
|
|
|
} |
|
|
|
}) |
|
|
|
this.viewTitle = '【编辑】合同审核' |
|
|
|
}, |
|
|
|
typeChange(val) { |
|
|
|
const choosetItem = this.typeList.filter((item) => item.dictValue === val) |
|
|
|
this.temp.contractTypeKey = choosetItem[0].dictKey |
|
|
|
}, |
|
|
|
// 添加数据 |
|
|
|
handleCreate() { |
|
|
|
this.$refs['temp_obj'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
this.submitdisabled = true |
|
|
|
updateContract(this.temp).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.$message({ showClose: true, type: 'success', message: '保存成功' }) |
|
|
|
this.handleReturn('true') |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
openCreate(showed) { |
|
|
|
this.resetTemp() |
|
|
|
this.$refs['dataForm'].clearValidate() |
|
|
|
this.stateId = '0' |
|
|
|
// this.visible = false |
|
|
|
if (showed && typeof showed === 'function') { |
|
|
|
showed() |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 保存并提交、更新 |
|
|
|
handleSubmit() { |
|
|
|
this.$refs['temp_obj'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
this.submitdisabled = true |
|
|
|
} |
|
|
|
}, |
|
|
|
// ----------------------------------方法-------------------- |
|
|
|
// 返回 |
|
|
|
handleReturn() { |
|
|
|
this.list3 = [] |
|
|
|
this.list2 = [] |
|
|
|
this.list1 = [] |
|
|
|
// this.visible = false |
|
|
|
this.$emit('handleReturn') |
|
|
|
}, |
|
|
|
downloadData() { |
|
|
|
download({ |
|
|
|
filePath: '20211126/test2_20211126133452425549.pdf', |
|
|
|
outFileName: 'test2.pdf', |
|
|
|
}).then((res) => { |
|
|
|
this.FormLoading = false |
|
|
|
// const blob = new Blob([res], { |
|
|
|
// type: 'application/vnd.ms-excel' |
|
|
|
// }) |
|
|
|
|
|
|
|
// const objectUrl = URL.createObjectURL(blob) |
|
|
|
// window.location.href = objectUrl |
|
|
|
// window.open(routeUrl.href, '_blank') |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '下载', |
|
|
|
type: 'success', |
|
|
|
duration: 2000, |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 添加前数据初始化 |
|
|
|
resetTemp() { |
|
|
|
this.temp = {} |
|
|
|
}, |
|
|
|
// 获取用户信息 |
|
|
|
postHuoquyonghu() { |
|
|
|
var token = getStorage() |
|
|
|
loginDetails(token).then((response) => { |
|
|
|
if (response.code === '200') { |
|
|
|
this.YongHuid = response.data |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 添加数据 |
|
|
|
handleCreate() { |
|
|
|
this.$refs['dataForm'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
this.FormLoading = true |
|
|
|
this.temp.staffSid = this.YongHuid.staffSid |
|
|
|
console.log(this.temp.staffSid) |
|
|
|
if (this.stateId === '0') { |
|
|
|
this.temp.pcCommonAppendixDtoList = [] |
|
|
|
this.getUrl() |
|
|
|
// this.temp.deposit = Number(this.temp.deposit) |
|
|
|
saveContract(this.temp).then((response) => { |
|
|
|
this.FormLoading = false |
|
|
|
if (response.code === '200') { |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '添加成功', |
|
|
|
type: 'success', |
|
|
|
duration: 2000, |
|
|
|
}) |
|
|
|
// this.visible = false |
|
|
|
this.$emit('created') |
|
|
|
this.$refs['dataForm'].resetFields() // |
|
|
|
this.temp = {} |
|
|
|
this.list1 = [] |
|
|
|
} else { |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '添加失败', |
|
|
|
type: 'error', |
|
|
|
duration: 2000, |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} else if (this.stateId === 'xt') { |
|
|
|
// 销售合同 |
|
|
|
// this.temp.pcCommonAppendixDtoList = [] |
|
|
|
this.getUrl() |
|
|
|
saveOrderContract(this.temp).then((response) => { |
|
|
|
this.FormLoading = false |
|
|
|
if (response.code === '200') { |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '修改成功', |
|
|
|
type: 'success', |
|
|
|
duration: 2000, |
|
|
|
}) |
|
|
|
this.$emit('updated') |
|
|
|
} else { |
|
|
|
this.$notify({ |
|
|
|
title: '失败', |
|
|
|
message: '修改失败', |
|
|
|
type: 'error', |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} else if (this.stateId === 'ht') { |
|
|
|
// 订车合同 |
|
|
|
this.temp.staffSid = this.YongHuid.staffSid |
|
|
|
this.temp.busSid = this.contractsid |
|
|
|
this.temp.pcCommonAppendixDtoList = [] |
|
|
|
this.getUrl() |
|
|
|
postsave(this.temp).then((response) => { |
|
|
|
this.FormLoading = false |
|
|
|
if (response.code === '200') { |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '订车合同添加成功', |
|
|
|
type: 'success', |
|
|
|
duration: 2000, |
|
|
|
}) |
|
|
|
this.$emit('handleReturn') |
|
|
|
} else { |
|
|
|
this.$notify({ |
|
|
|
title: '失败', |
|
|
|
message: '订车合同添加失败', |
|
|
|
type: 'error', |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.getUrl() |
|
|
|
updateContract(this.temp).then((response) => { |
|
|
|
this.FormLoading = false |
|
|
|
if (response.code === '200') { |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '保存成功', |
|
|
|
type: 'success', |
|
|
|
duration: 2000, |
|
|
|
}) |
|
|
|
// this.visible = false |
|
|
|
this.$emit('updated') |
|
|
|
} else { |
|
|
|
this.$notify({ |
|
|
|
title: '失败', |
|
|
|
message: '保存失败', |
|
|
|
type: 'error', |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 提交、更新 |
|
|
|
submitIt() { |
|
|
|
this.$confirm('是否确定提交该业务', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
console.log('submitDto', this.submitDto) |
|
|
|
// 提交流程 |
|
|
|
submitCarSale(this.submitDto).then((response) => { |
|
|
|
if (response.code === '200') { |
|
|
|
this.updateDto.nodeState = response.data.nodeState |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '添加成功', |
|
|
|
type: 'success', |
|
|
|
duration: 2000, |
|
|
|
}) |
|
|
|
// 更新审批 状态 |
|
|
|
updateCarSale(this.updateDto).then((response) => { |
|
|
|
if (response.code === '200') { |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '更新成功', |
|
|
|
type: 'success', |
|
|
|
duration: 2000, |
|
|
|
}) |
|
|
|
console.log('提交更新时页面状态',this.stateId) |
|
|
|
if (this.stateId === '0') { |
|
|
|
this.$emit('created') |
|
|
|
} else if (this.stateId === 'xiugai') { |
|
|
|
this.$emit('updated') |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.$notify({ |
|
|
|
title: '更新失败', |
|
|
|
message: response.msg, |
|
|
|
type: 'error', |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$notify({ |
|
|
|
title: '添加失败', |
|
|
|
message: response.msg, |
|
|
|
type: 'error', |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 保存并提交、更新 |
|
|
|
handleSubmit() { |
|
|
|
this.$refs['dataForm'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
this.FormLoading = true |
|
|
|
this.temp.staffSid = this.YongHuid.staffSid |
|
|
|
console.log(this.temp.staffSid) |
|
|
|
if (this.stateId === '0') { |
|
|
|
this.temp.pcCommonAppendixDtoList = [] |
|
|
|
this.getUrl() |
|
|
|
// this.temp.deposit = Number(this.temp.deposit) |
|
|
|
saveContract(this.temp).then((response) => { |
|
|
|
this.FormLoading = false |
|
|
|
if (response.code === '200') { |
|
|
|
this.submitDto.businessSid = response.data |
|
|
|
this.updateDto.sid = response.data |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '添加成功', |
|
|
|
type: 'success', |
|
|
|
duration: 2000, |
|
|
|
}) |
|
|
|
this.submitIt() |
|
|
|
this.$refs['dataForm'].resetFields() // |
|
|
|
this.temp = {} |
|
|
|
this.list1 = [] |
|
|
|
} else { |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '添加失败', |
|
|
|
type: 'error', |
|
|
|
duration: 2000, |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} else if (this.stateId === 'xt') { |
|
|
|
// 销售合同 |
|
|
|
// this.temp.pcCommonAppendixDtoList = [] |
|
|
|
this.getUrl() |
|
|
|
saveOrderContract(this.temp).then((response) => { |
|
|
|
this.FormLoading = false |
|
|
|
if (response.code === '200') { |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '修改成功', |
|
|
|
type: 'success', |
|
|
|
duration: 2000, |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$notify({ |
|
|
|
title: '失败', |
|
|
|
message: '修改失败', |
|
|
|
type: 'error', |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} else if (this.stateId === 'ht') { |
|
|
|
// 订车合同 |
|
|
|
this.temp.staffSid = this.YongHuid.staffSid |
|
|
|
this.temp.busSid = this.contractsid |
|
|
|
this.temp.pcCommonAppendixDtoList = [] |
|
|
|
this.getUrl() |
|
|
|
postsave(this.temp).then((response) => { |
|
|
|
this.FormLoading = false |
|
|
|
if (response.code === '200') { |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '订车合同添加成功', |
|
|
|
type: 'success', |
|
|
|
duration: 2000, |
|
|
|
}) |
|
|
|
this.$emit('handleReturn') |
|
|
|
} else { |
|
|
|
this.$notify({ |
|
|
|
title: '失败', |
|
|
|
message: '订车合同添加失败', |
|
|
|
type: 'error', |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.getUrl() |
|
|
|
updateContract(this.temp).then((response) => { |
|
|
|
this.FormLoading = false |
|
|
|
if (response.code === '200') { |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '保存成功', |
|
|
|
type: 'success', |
|
|
|
duration: 2000, |
|
|
|
}) |
|
|
|
this.submitIt() |
|
|
|
} else { |
|
|
|
this.$notify({ |
|
|
|
title: '失败', |
|
|
|
message: '保存失败', |
|
|
|
type: 'error', |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
getUrl() { |
|
|
|
for (var i = 0; i < this.list1.length; i++) { |
|
|
|
var namese = this.list1[i].name |
|
|
|
var nameArr = namese.split('.') |
|
|
|
console.log(this.temp) |
|
|
|
this.temp.pcCommonAppendixDtoList.push({ |
|
|
|
attachType: '0001', |
|
|
|
fileName: this.list1[i].name, |
|
|
|
filePath: this.list1[i].url, |
|
|
|
fileSize: this.list1[i].size, |
|
|
|
createBySid: '', |
|
|
|
fileType: nameArr[nameArr.length - 1] |
|
|
|
}) |
|
|
|
}, |
|
|
|
getUrl() { |
|
|
|
for (var i = 0; i < this.list1.length; i++) { |
|
|
|
var namese = this.list1[i].name |
|
|
|
var nameArr = namese.split('.') |
|
|
|
console.log(this.temp) |
|
|
|
this.temp.pcCommonAppendixDtoList.push({ |
|
|
|
attachType: '0001', |
|
|
|
fileName: this.list1[i].name, |
|
|
|
filePath: this.list1[i].url, |
|
|
|
fileSize: this.list1[i].size, |
|
|
|
// linkSid: this.temp.customerSid, |
|
|
|
createBySid: this.YongHuid.sid, |
|
|
|
fileType: nameArr[nameArr.length - 1], |
|
|
|
}) |
|
|
|
console.log('11223344', this.temp.pcCommonAppendixDtoList) |
|
|
|
} |
|
|
|
}, |
|
|
|
// 从销售订单跳过来的 |
|
|
|
showOrderHeTong(type, userSid, order, state) { |
|
|
|
this.buttonState = false |
|
|
|
this.stateId = 'xt' |
|
|
|
this.resetTemp() |
|
|
|
this.list3 = [] |
|
|
|
this.list2 = [] |
|
|
|
if (state == '0') { |
|
|
|
// 添加回显 |
|
|
|
getSaveByOrderSid({userSid: userSid, orderSid: order}).then( |
|
|
|
(response) => { |
|
|
|
if (response.code === '200') { |
|
|
|
this.temp = response.data |
|
|
|
this.postHuoquyonghu() |
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
} else { |
|
|
|
// 修改回显 |
|
|
|
this.temp.orderSid = order |
|
|
|
getXiaoShouHeTongByOrderSid({orderSid: order}).then((response) => { |
|
|
|
if (response.code === '200') { |
|
|
|
this.temp = response.data |
|
|
|
this.text = response.data |
|
|
|
|
|
|
|
const data = response.data.pcCommonAppendixDtoList |
|
|
|
// data.forEach((element) => { |
|
|
|
// if (element.fileType == 'pdf' || element.fileType == 'docx') { |
|
|
|
// this.list3.push({ |
|
|
|
// name: element.fileName, |
|
|
|
// filePath: element.filePath, |
|
|
|
// type: element.fileType, |
|
|
|
// }) |
|
|
|
// } else if ( |
|
|
|
// element.fileType == 'jpg' || |
|
|
|
// element.fileType == 'jpeg' || |
|
|
|
// element.fileType == 'png' |
|
|
|
// ) { |
|
|
|
// this.list2.push({ |
|
|
|
// name: element.fileName, |
|
|
|
// filePath: element.filePath, |
|
|
|
// }) |
|
|
|
// } |
|
|
|
// this.deleteTubiaoStyle = true |
|
|
|
// }) |
|
|
|
|
|
|
|
this.postHuoquyonghu() |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
// 接收订单合同传值 |
|
|
|
agreement(type, contract, state) { |
|
|
|
this.stateId = 'ht' |
|
|
|
this.contractsid = contract |
|
|
|
this.file_list.linkSid = contract |
|
|
|
if (state == 0) { |
|
|
|
generateContractNo(this.YongHuid.sid).then((res) => { |
|
|
|
this.temp = res |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.list3 = [] |
|
|
|
this.list2 = [] |
|
|
|
getByBusSid(this.contractsid).then((response) => { |
|
|
|
if (response.code === '200') { |
|
|
|
this.temp = response.data |
|
|
|
const data = response.data.pcCommonAppendixDtoList |
|
|
|
this.deleteTubiaoStyle = true |
|
|
|
data.forEach((element) => { |
|
|
|
if (element.fileType == 'pdf' || element.fileType == 'docx') { |
|
|
|
this.list3.push({ |
|
|
|
name: element.fileName, |
|
|
|
filePath: element.filePath, |
|
|
|
type: element.fileType, |
|
|
|
}) |
|
|
|
} else if ( |
|
|
|
element.fileType == 'jpg' || |
|
|
|
element.fileType == 'jpeg' || |
|
|
|
element.fileType == 'png' |
|
|
|
) { |
|
|
|
this.list2.push({ |
|
|
|
name: element.fileName, |
|
|
|
filePath: element.filePath, |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
console.log('11223344', this.temp.pcCommonAppendixDtoList) |
|
|
|
} |
|
|
|
}, |
|
|
|
// 返回 |
|
|
|
handleReturn(isreload) { |
|
|
|
if (isreload === 'true') this.$emit('reloadlist') |
|
|
|
this.temp = { |
|
|
|
address: '', |
|
|
|
appdixUrl: '', |
|
|
|
busSid: '', |
|
|
|
contractAmount: '', |
|
|
|
contractNo: '', |
|
|
|
contractType: '', |
|
|
|
contractTypeKey: '', |
|
|
|
createDate: '', |
|
|
|
deposit: '', |
|
|
|
partyA: '', |
|
|
|
partyB: '', |
|
|
|
partyC: '', |
|
|
|
pcCommonAppendixDtoList: [], |
|
|
|
remarks: '', |
|
|
|
sceneSignUrl: '', |
|
|
|
sceneSignUrlList: '', |
|
|
|
sid: '', |
|
|
|
staffName: '', |
|
|
|
staffSid: '' |
|
|
|
} |
|
|
|
this.list3 = [] |
|
|
|
this.list2 = [] |
|
|
|
this.list1 = [] |
|
|
|
this.$refs['temp_obj'].resetFields() |
|
|
|
this.$emit('handleReturn') |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
<style scoped> |
|
|
|
.dtp { |
|
|
|
z-index: 999; |
|
|
|
position: absolute; |
|
|
|
cursor: pointer; |
|
|
|
right: 0px; |
|
|
|
} |
|
|
|
|
|
|
|
.imgcontent { |
|
|
|
position: relative; |
|
|
|
display: inline-block; |
|
|
|
} |
|
|
|
|
|
|
|
.nameStyle { |
|
|
|
cursor: pointer; |
|
|
|
} |
|
|
|
</style> |
|
|
|