|
|
@ -41,12 +41,13 @@ |
|
|
|
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;" @selection-change="handleSelectionChange"> |
|
|
|
<el-table-column width="50" type="selection" align="center"/> |
|
|
|
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center"/> |
|
|
|
<el-table-column label="操作" align="center" width="100"> |
|
|
|
<el-table-column label="操作" align="center" width="180"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button type="primary" v-show="scope.row.downloadPath !== ''" size="mini" @click="toDownLoad(scope.row)">下载</el-button> |
|
|
|
<el-button type="primary" size="mini" @click="toInfo(scope.row)">查看</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="完成状态" align="center"> |
|
|
|
<el-table-column label="完成状态" align="center" width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.completeStateValue }}</span> |
|
|
|
</template> |
|
|
@ -56,7 +57,7 @@ |
|
|
|
<span>{{ scope.row.contractNo }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="客户名称" align="center"> |
|
|
|
<el-table-column label="客户名称" align="center" width="180"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.customerName }}</span> |
|
|
|
</template> |
|
|
@ -66,24 +67,29 @@ |
|
|
|
<span>{{ scope.row.model }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="车架号" align="center"> |
|
|
|
<el-table-column label="车架号" align="center" width="180"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.vinNo }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="创建人" align="center"> |
|
|
|
<el-table-column label="单据编号" align="center" width="190"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.billNo }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="创建人" align="center" width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.createName }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="创建日期" align="center"> |
|
|
|
<el-table-column label="创建日期" align="center" width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.createTime }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="图片" align="center" width="180px" class-name="small-padding fixed-width"> |
|
|
|
<el-table-column label="图片" align="center" width="100" class-name="small-padding fixed-width"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button size="mini" v-show="scope.row.witMatUrl !== ''" type="primary" @click="handleGetCheck(scope.row)">查看</el-button> |
|
|
|
<el-button size="mini" v-show="scope.row.imgs.length > 0" type="primary" @click="handleGetCheck(scope.row)">查看</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
@ -99,6 +105,27 @@ |
|
|
|
<datapreparationAdd v-show="viewState == 2" ref="divAdd" @doback="reseaState" @reloadlist="getList"/> |
|
|
|
<!-- 交车确认详情 --> |
|
|
|
<datapreparationInfo v-show="viewState == 3" ref="divInfo" @doback="reseaState"/> |
|
|
|
<!-- 上传确认单 --> |
|
|
|
<el-dialog title="上传确认单" :append-to-body="true" :visible.sync="dialogFileVisible"> |
|
|
|
<el-form class="formadd"> |
|
|
|
<el-row style="border-top: 1px solid #E0E3EB"> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item> |
|
|
|
<el-upload ref="imgUpload" class="avatar-uploader" :headers="accessToken" :action="uploadFile" :data="uploadData" accept=".jpg,.jpeg,.png,.JPG,.JPEG" list-type="picture-card" :file-list="files" :on-preview="handlePictureCardPreview" :on-success="handleSuccess"> |
|
|
|
<i class="el-icon-plus avatar-uploader-icon"/> |
|
|
|
</el-upload> |
|
|
|
<el-dialog :visible.sync="dialogVisible" :append-to-body="true" title="查看图片"> |
|
|
|
<img width="100%" :src="dialogImageUrl" alt=""> |
|
|
|
</el-dialog> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="primary" size="small" @click="dialogFileVisible = false">确定</el-button> |
|
|
|
<el-button size="small" @click="dialogFileVisible = false">取消</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
<!-- 照片弹窗 --> |
|
|
|
<el-dialog :append-to-body="true" :visible.sync="dialogImgVisible"> |
|
|
|
<el-image v-for="(item,index) in dialogUrl" :key="index" :src="item" style="width: 100px; height: 100px" :preview-src-list="dialogUrl"> |
|
|
@ -115,14 +142,13 @@ import pageye from '@/components/pagination/pageye' |
|
|
|
import ButtonBar from '@/components/ButtonBar' |
|
|
|
import datapreparationAdd from './datapreparationAdd' |
|
|
|
import datapreparationInfo from './datapreparationInfo' |
|
|
|
// import upload from '@/components/uploadFileimg/upload' |
|
|
|
import { getStorage } from '@/utils/auth' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'Datapreparation', |
|
|
|
components: { |
|
|
|
Pagination, |
|
|
|
pageye, |
|
|
|
// upload, |
|
|
|
ButtonBar, |
|
|
|
datapreparationAdd, |
|
|
|
datapreparationInfo |
|
|
@ -143,7 +169,7 @@ export default { |
|
|
|
type: 'primary', |
|
|
|
size: 'small', |
|
|
|
icon: '', |
|
|
|
btnKey: 'doDel', |
|
|
|
btnKey: 'toUpload', |
|
|
|
btnLabel: '上传确认单' |
|
|
|
}, |
|
|
|
{ |
|
|
@ -158,6 +184,14 @@ export default { |
|
|
|
searchxianshitit: '显示查询条件', |
|
|
|
dialogImgVisible: false, |
|
|
|
dialogFileVisible: false, |
|
|
|
dialogVisible: false, |
|
|
|
uploadFile: process.env.VUE_APP_BASE_API + '/buscenter/v1/busvehicledatahandover/upload', |
|
|
|
uploadData: { |
|
|
|
sid: '' |
|
|
|
}, |
|
|
|
accessToken: {}, |
|
|
|
files: [], |
|
|
|
dialogImageUrl: '', |
|
|
|
// 查询条件 ----------- |
|
|
|
tableKey: 0, |
|
|
|
list: [], |
|
|
@ -188,6 +222,9 @@ export default { |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
this.$refs['btnbar'].setButtonList(this.btnList) |
|
|
|
this.accessToken = { |
|
|
|
token: getStorage() |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 搜索条件效果 |
|
|
@ -205,8 +242,8 @@ export default { |
|
|
|
case 'toAdd': |
|
|
|
this.toAdd() |
|
|
|
break |
|
|
|
case 'doDel': |
|
|
|
this.doDel() |
|
|
|
case 'toUpload': |
|
|
|
this.toUpload() |
|
|
|
break |
|
|
|
case 'doClose': |
|
|
|
this.doClose() |
|
|
@ -293,13 +330,53 @@ export default { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '请至少选择一条记录进行操作' }) |
|
|
|
} |
|
|
|
}, |
|
|
|
toUpload() { |
|
|
|
if (this.sids.length === 1) { |
|
|
|
this.dialogFileVisible = true |
|
|
|
this.files = [] |
|
|
|
this.uploadData.sid = this.sids[0] |
|
|
|
} else { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '请选择一条记录进行操作' }) |
|
|
|
return |
|
|
|
} |
|
|
|
}, |
|
|
|
handlePictureCardPreview(file) { |
|
|
|
this.dialogVisible = true |
|
|
|
this.dialogImageUrl = file.url |
|
|
|
}, |
|
|
|
handleSuccess(file) { |
|
|
|
this.$message({ showClose: true, type: 'success', message: '上传成功' }) |
|
|
|
this.getList() |
|
|
|
}, |
|
|
|
toDownLoad(row) { |
|
|
|
var xhr = new XMLHttpRequest() |
|
|
|
xhr.open('GET', process.env.VUE_APP_BASE_API + '/base/file/download?filePath=' + row.downloadPath + '&outFileName=' + '交车资料确认单', true) |
|
|
|
xhr.setRequestHeader('token', getStorage()) |
|
|
|
xhr.responseType = 'blob' |
|
|
|
xhr.onload = function(e) { |
|
|
|
// 如果请求执行成功 |
|
|
|
var blob = this.response |
|
|
|
var filename = '交车资料确认单.pdf' |
|
|
|
var a = document.createElement('a') |
|
|
|
// blob.type="application/octet-stream"; |
|
|
|
// 创键临时url对象 |
|
|
|
var url = URL.createObjectURL(blob) |
|
|
|
a.href = url |
|
|
|
a.download = filename |
|
|
|
a.click() |
|
|
|
// 释放之前创建的URL对象 |
|
|
|
window.URL.revokeObjectURL(url) |
|
|
|
} |
|
|
|
// 发送请求 |
|
|
|
xhr.send() |
|
|
|
}, |
|
|
|
toInfo(row) { |
|
|
|
this.viewState = 3 |
|
|
|
this.$refs['divInfo'].showInfo(row) |
|
|
|
}, |
|
|
|
handleGetCheck(row) { |
|
|
|
this.dialogImgVisible = true |
|
|
|
this.dialogImageUrl = row.witMatUrl |
|
|
|
this.dialogUrl = row.imgs |
|
|
|
}, |
|
|
|
reseaState() { |
|
|
|
this.viewState = 1 |
|
|
|