Browse Source

完善交车资料管理

master
yunuo970428 2 years ago
parent
commit
5fdb9b72aa
  1. 7
      anrui-buscenter/anrui-buscenter-ui/src/api/suicheziliao/jiaocheziliao.js
  2. 105
      anrui-buscenter/anrui-buscenter-ui/src/views/xiaoshouguanli/suicheziliaoguanli/datapreparation.vue
  3. 6
      anrui-buscenter/anrui-buscenter-ui/src/views/xiaoshouguanli/suicheziliaoguanli/datapreparationInfo.vue

7
anrui-buscenter/anrui-buscenter-ui/src/api/suicheziliao/jiaocheziliao.js

@ -24,6 +24,13 @@ export function fetchDetailsBySid(data) {
}) })
} }
export function details(data) {
return request({
url: '/buscenter/v1/busvehicledatahandover/details/' + data,
method: 'get'
})
}
// 确认 // 确认
export function saveDeliveryInfo(data) { export function saveDeliveryInfo(data) {
return request({ return request({

105
anrui-buscenter/anrui-buscenter-ui/src/views/xiaoshouguanli/suicheziliaoguanli/datapreparation.vue

@ -41,12 +41,13 @@
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;" @selection-change="handleSelectionChange"> <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 width="50" type="selection" align="center"/>
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" 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"> <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> <el-button type="primary" size="mini" @click="toInfo(scope.row)">查看</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="完成状态" align="center"> <el-table-column label="完成状态" align="center" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.completeStateValue }}</span> <span>{{ scope.row.completeStateValue }}</span>
</template> </template>
@ -56,7 +57,7 @@
<span>{{ scope.row.contractNo }}</span> <span>{{ scope.row.contractNo }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="客户名称" align="center"> <el-table-column label="客户名称" align="center" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.customerName }}</span> <span>{{ scope.row.customerName }}</span>
</template> </template>
@ -66,24 +67,29 @@
<span>{{ scope.row.model }}</span> <span>{{ scope.row.model }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="车架号" align="center"> <el-table-column label="车架号" align="center" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.vinNo }}</span> <span>{{ scope.row.vinNo }}</span>
</template> </template>
</el-table-column> </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"> <template slot-scope="scope">
<span>{{ scope.row.createName }}</span> <span>{{ scope.row.createName }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建日期" align="center"> <el-table-column label="创建日期" align="center" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.createTime }}</span> <span>{{ scope.row.createTime }}</span>
</template> </template>
</el-table-column> </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"> <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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -99,6 +105,27 @@
<datapreparationAdd v-show="viewState == 2" ref="divAdd" @doback="reseaState" @reloadlist="getList"/> <datapreparationAdd v-show="viewState == 2" ref="divAdd" @doback="reseaState" @reloadlist="getList"/>
<!-- 交车确认详情 --> <!-- 交车确认详情 -->
<datapreparationInfo v-show="viewState == 3" ref="divInfo" @doback="reseaState"/> <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-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"> <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 ButtonBar from '@/components/ButtonBar'
import datapreparationAdd from './datapreparationAdd' import datapreparationAdd from './datapreparationAdd'
import datapreparationInfo from './datapreparationInfo' import datapreparationInfo from './datapreparationInfo'
// import upload from '@/components/uploadFileimg/upload' import { getStorage } from '@/utils/auth'
export default { export default {
name: 'Datapreparation', name: 'Datapreparation',
components: { components: {
Pagination, Pagination,
pageye, pageye,
// upload,
ButtonBar, ButtonBar,
datapreparationAdd, datapreparationAdd,
datapreparationInfo datapreparationInfo
@ -143,7 +169,7 @@ export default {
type: 'primary', type: 'primary',
size: 'small', size: 'small',
icon: '', icon: '',
btnKey: 'doDel', btnKey: 'toUpload',
btnLabel: '上传确认单' btnLabel: '上传确认单'
}, },
{ {
@ -158,6 +184,14 @@ export default {
searchxianshitit: '显示查询条件', searchxianshitit: '显示查询条件',
dialogImgVisible: false, dialogImgVisible: false,
dialogFileVisible: false, dialogFileVisible: false,
dialogVisible: false,
uploadFile: process.env.VUE_APP_BASE_API + '/buscenter/v1/busvehicledatahandover/upload',
uploadData: {
sid: ''
},
accessToken: {},
files: [],
dialogImageUrl: '',
// ----------- // -----------
tableKey: 0, tableKey: 0,
list: [], list: [],
@ -188,6 +222,9 @@ export default {
}, },
mounted() { mounted() {
this.$refs['btnbar'].setButtonList(this.btnList) this.$refs['btnbar'].setButtonList(this.btnList)
this.accessToken = {
token: getStorage()
}
}, },
methods: { methods: {
// //
@ -205,8 +242,8 @@ export default {
case 'toAdd': case 'toAdd':
this.toAdd() this.toAdd()
break break
case 'doDel': case 'toUpload':
this.doDel() this.toUpload()
break break
case 'doClose': case 'doClose':
this.doClose() this.doClose()
@ -293,13 +330,53 @@ export default {
this.$message({ showClose: true, type: 'error', message: '请至少选择一条记录进行操作' }) 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) { toInfo(row) {
this.viewState = 3 this.viewState = 3
this.$refs['divInfo'].showInfo(row) this.$refs['divInfo'].showInfo(row)
}, },
handleGetCheck(row) { handleGetCheck(row) {
this.dialogImgVisible = true this.dialogImgVisible = true
this.dialogImageUrl = row.witMatUrl this.dialogUrl = row.imgs
}, },
reseaState() { reseaState() {
this.viewState = 1 this.viewState = 1

6
anrui-buscenter/anrui-buscenter-ui/src/views/xiaoshouguanli/suicheziliaoguanli/datapreparationInfo.vue

@ -51,7 +51,7 @@
</template> </template>
<script> <script>
import { fetchDetailsBySid } from '@/api/suicheziliao/jiaocheziliao' import { details } from '@/api/suicheziliao/jiaocheziliao'
export default { export default {
name: 'DatapreparationInfo', name: 'DatapreparationInfo',
@ -74,9 +74,7 @@ export default {
methods: { methods: {
showInfo(row) { showInfo(row) {
this.viewTitle = '交车资料确认详情' this.viewTitle = '交车资料确认详情'
const aa = [] details(row.sid).then((resp) => {
aa.push(row.sid)
fetchDetailsBySid(aa).then((resp) => {
if (resp.success) { if (resp.success) {
this.formobj = resp.data this.formobj = resp.data
} }

Loading…
Cancel
Save