Commit d4314cad by 冒粤蓉
2 parents 5c216463 6f3409ee
...@@ -14,9 +14,13 @@ ...@@ -14,9 +14,13 @@
<div slot="footer"> <div slot="footer">
<slot name="btn-front"></slot> <slot name="btn-front"></slot>
<el-button @click="handleClose">取消</el-button> <el-button
@click="handleClose"
:size="btn_size"
>取消</el-button>
<el-button <el-button
type="primary" type="primary"
:size="btn_size"
@click="handleConfirm" @click="handleConfirm"
>{{btnOkLabel}}</el-button> >{{btnOkLabel}}</el-button>
<slot name="btn-behind"></slot> <slot name="btn-behind"></slot>
......
...@@ -44,10 +44,12 @@ const VEHICLE_API = { ...@@ -44,10 +44,12 @@ const VEHICLE_API = {
VEHICLE_ADD: '/trialdrive/vehicle/drivevehicle/add', VEHICLE_ADD: '/trialdrive/vehicle/drivevehicle/add',
VEHICLE_EDIT: '/trialdrive/vehicle/drivevehicle/update', VEHICLE_EDIT: '/trialdrive/vehicle/drivevehicle/update',
VEHICLE_DELETE: '/trialdrive/vehicle/drivevehicle/delete', VEHICLE_DELETE: '/trialdrive/vehicle/drivevehicle/delete',
VEHICLE_UNBIND: '/trialdrive/vehicle/drivevehicle/unbindSn', VEHICLE_UNBIND: '/trialdrive/vehicle/unbindSn',
DOWNLOAD_TEMPLATE: '/trialdrice/vehicle/drivevehicle/downloadtemplate', DOWNLOAD_TEMPLATE: '/trialdrive/vehicle/drivevehicle/downloadtemplate',
VEHICLE_IMPORT: '/trialdrice/vehicle/drivevehicle/import', VEHICLE_IMPORT: '/trialdrive/vehicle/drivevehicle/import',
VEHICLE_FAILFILE: '/trialdrive/vehicle/drivevehicle/downloadFailFile',
VEHICLE_EXPORT: '/trialdrive/vehicle/drivevehicle/export', VEHICLE_EXPORT: '/trialdrive/vehicle/drivevehicle/export',
VEHICLE_INFO: '/trialdrive/vehicle/drivevehicle/findbyid',
SPECIAL_SHOP_LIST: '/trialdrive/specialshop/shopusers' SPECIAL_SHOP_LIST: '/trialdrive/specialshop/shopusers'
} }
// 审批管理 // 审批管理
......
...@@ -7,7 +7,6 @@ function getList (params) { ...@@ -7,7 +7,6 @@ function getList (params) {
return request(params, url) return request(params, url)
} }
/*特约店列表*/ /*特约店列表*/
function getSpecialShopList (params) { function getSpecialShopList (params) {
const url = VEHICLE_API.SPECIAL_SHOP_LIST const url = VEHICLE_API.SPECIAL_SHOP_LIST
...@@ -26,6 +25,12 @@ function editVehicle (params) { ...@@ -26,6 +25,12 @@ function editVehicle (params) {
return request(params, url, 'post') return request(params, url, 'post')
} }
// 解绑车辆
function infoVehicle (params) {
const url = VEHICLE_API.VEHICLE_INFO
return request(params, url)
}
// 批量删除车辆 // 批量删除车辆
function deleteVehicle (params) { function deleteVehicle (params) {
const url = VEHICLE_API.VEHICLE_DELETE const url = VEHICLE_API.VEHICLE_DELETE
...@@ -47,7 +52,7 @@ function downloadtemplate (params) { ...@@ -47,7 +52,7 @@ function downloadtemplate (params) {
// 导入车辆 // 导入车辆
function importVehicle (params) { function importVehicle (params) {
const url = VEHICLE_API.VEHICLE_IMPORT const url = VEHICLE_API.VEHICLE_IMPORT
return request(params, url) return request(params, url, 'post')
} }
// 导出车辆 // 导出车辆
...@@ -56,4 +61,4 @@ function exportVehicle (params) { ...@@ -56,4 +61,4 @@ function exportVehicle (params) {
return request(params, url) return request(params, url)
} }
export { getList, getSpecialShopList, addVehicle, downloadtemplate, editVehicle, deleteVehicle, unbindVehicle, importVehicle, exportVehicle } export { getList, getSpecialShopList, addVehicle, downloadtemplate, editVehicle, deleteVehicle, unbindVehicle, importVehicle, exportVehicle, infoVehicle }
const MAP_KEY = '75116f653f3b2e4568116dad8cd9b899'; const MAP_KEY = '75116f653f3b2e4568116dad8cd9b899'
const Constants = { const Constants = {
AMAP_URL: `https://webapi.amap.com/maps?v=1.4.2&key=${MAP_KEY}&plugin=AMap.PolyEditor,AMap.CircleEditor,AMap.DistrictSearch,AMap.Autocomplete,AMap.MarkerClusterer,AMap.MouseTool,AMap.Text`, AMAP_URL: `https://webapi.amap.com/maps?v=1.4.2&key=${MAP_KEY}&plugin=AMap.PolyEditor,AMap.CircleEditor,AMap.DistrictSearch,AMap.Autocomplete,AMap.MarkerClusterer,AMap.MouseTool,AMap.Text`,
// 处理状态 // 处理状态
......
...@@ -127,6 +127,8 @@ export default { ...@@ -127,6 +127,8 @@ export default {
case 'todo': case 'todo':
// 跳转 // 跳转
console.log(scope) console.log(scope)
if (scope.bizType == 1) this.$router.push({ name: 'testDriveCheckList' })
else if (scope.bizType == 2) this.$router.push({ name: 'vehicleCheck', params: { approvalId: scope.approvalId, url: 'check' } })
break break
} }
} }
......
...@@ -62,6 +62,12 @@ ...@@ -62,6 +62,12 @@
plain plain
@click="btnClick(j.pType, scope.scope)" @click="btnClick(j.pType, scope.scope)"
>{{j.name}}</el-button> >{{j.name}}</el-button>
<el-button
v-if="scope.scope.sns"
type="text"
size="mini"
@click="btnClick('unbind', scope.scope)"
>解绑</el-button>
</span> </span>
</basic-table> </basic-table>
<basic-dialog <basic-dialog
...@@ -101,6 +107,7 @@ ...@@ -101,6 +107,7 @@
<el-col :span="14"> <el-col :span="14">
<el-input <el-input
readonly readonly
:size="btn_size"
v-model="importForm.fileName" v-model="importForm.fileName"
ref="importInput" ref="importInput"
></el-input> ></el-input>
...@@ -109,8 +116,12 @@ ...@@ -109,8 +116,12 @@
:span="6" :span="6"
class="m-l-md" class="m-l-md"
> >
<el-button class="import-btn">导入文件 <el-button
class="import-btn"
:size="btn_size"
>导入文件
<input <input
:size="btn_size"
type="file" type="file"
id="importFile" id="importFile"
class="import-input" class="import-input"
...@@ -123,14 +134,21 @@ ...@@ -123,14 +134,21 @@
type="text" type="text"
class="import-template" class="import-template"
icon="el-icon-link" icon="el-icon-link"
target="_blank"
@click="downloadTemplate" @click="downloadTemplate"
>模版下载</el-button> >模版下载</el-button>
</el-form-item> </el-form-item>
<el-form-item>
<div v-show="exportData.total">操作数据<span class="red-text">{{exportData.total}}</span>条,成功<span class="red-text">{{exportData.succNum}}</span>条,失败<span class="red-text">{{exportData.failNum}}</span>条。</div>
<el-button
v-show="exportData.failNum"
type="primary"
:size="btn_size"
@click="downloadFailFile"
>导出失败记录</el-button>
</el-form-item>
</el-form> </el-form>
</slot> </slot>
</basic-dialog> </basic-dialog>
<basic-dialog <basic-dialog
:title="filterDialogTitle" :title="filterDialogTitle"
:isVisible="filterVisible" :isVisible="filterVisible"
...@@ -162,7 +180,12 @@ ...@@ -162,7 +180,12 @@
</template> </template>
<script> <script>
import { getList, getSpecialShopList, addVehicle, editVehicle, downloadtemplate, deleteVehicle, unbindVehicle, importVehicle, exportVehicle } from 'services/vehicle' import _ from 'lodash'
import axios from 'axios'
import { dictInfo } from 'services/common'
import { VEHICLE_API } from '@/config/config'
import store from '@/store'
import { getList, getSpecialShopList, addVehicle, editVehicle, downloadtemplate, deleteVehicle, unbindVehicle, importVehicle, exportVehicle, infoVehicle } from 'services/vehicle'
export default { export default {
data() { data() {
return { return {
...@@ -222,6 +245,7 @@ export default { ...@@ -222,6 +245,7 @@ export default {
} }
], ],
tableOption: { tableOption: {
width: 160,
btnList: [ btnList: [
{ {
name: '编辑', name: '编辑',
...@@ -234,10 +258,6 @@ export default { ...@@ -234,10 +258,6 @@ export default {
{ {
name: '查看', name: '查看',
pType: 'view' pType: 'view'
},
{
name: '解绑',
pType: 'unbind'
} }
] ]
} }
...@@ -266,32 +286,42 @@ export default { ...@@ -266,32 +286,42 @@ export default {
// 弹窗 // 弹窗
vehicleVisible: false, vehicleVisible: false,
vehicleTitle: '', vehicleTitle: '',
vehicleForm: { vehicleForm: {},
shopName: '' vehicleArr: ['shopName', 'vin', 'modelId', 'configId', 'licensePlate', 'color', 'innerColor', 'serveType', 'sn'],
},
vehicleData: [ vehicleData: [
{ label: '特约店名称:', prop: 'shopName', type: 'input', readonly: true, clickFunc: this.selectStore }, { label: '特约店名称:', prop: 'shopName', type: 'input', readonly: true, clickFunc: this.selectStore },
{ label: '车架号:', prop: 'vin', type: 'input', clearable: true }, { label: '车架号:', prop: 'vin', type: 'input', clearable: true },
{ label: '车型:', prop: 'modelId', type: 'select', options: [], clearable: true }, { label: '车型:', prop: 'modelId', type: 'select', options: [], key: 'dictLabel', value: 'id', clearable: true },
{ label: '配置:', prop: 'configDesc', type: 'input', clearable: true }, { label: '配置:', prop: 'configId', type: 'select', options: [], key: 'dictLabel', value: 'id', clearable: true },
{ label: '车牌:', prop: 'licensePlate', type: 'input', clearable: true },
{ label: '外色:', prop: 'color', type: 'input', clearable: true },
{ label: '内色:', prop: 'innerColor', type: 'input', clearable: true },
{ label: '服役类型:', prop: 'serveType', type: 'select', options: [{ label: '未上牌', value: 0 }, { label: '已上牌', value: 1 }], clearable: true },
{ label: '设备号:', prop: 'sn', type: 'input', clearable: true }
],
vehicleDefalutData: [
{ label: '特约店名称:', prop: 'shopName', type: 'input', readonly: true, clickFunc: this.selectStore },
{ label: '车架号:', prop: 'vin', type: 'input', clearable: true },
{ label: '车型:', prop: 'modelId', type: 'select', options: [], key: 'dictLabel', value: 'id', clearable: true },
{ label: '配置:', prop: 'configId', type: 'select', options: [], key: 'dictLabel', value: 'id', clearable: true },
{ label: '车牌:', prop: 'licensePlate', type: 'input', clearable: true }, { label: '车牌:', prop: 'licensePlate', type: 'input', clearable: true },
{ label: '外色:', prop: 'color', type: 'input', clearable: true }, { label: '外色:', prop: 'color', type: 'input', clearable: true },
{ label: '内色:', prop: 'innerColor', type: 'input', clearable: true }, { label: '内色:', prop: 'innerColor', type: 'input', clearable: true },
{ label: '服役类型:', prop: 'serveType', type: 'select', options: [], clearable: true }, { label: '服役类型:', prop: 'serveType', type: 'select', options: [{ label: '未上牌', value: 0 }, { label: '已上牌', value: 1 }], clearable: true },
{ label: '设备号:', prop: 'sn', type: 'input', clearable: true } { label: '设备号:', prop: 'sn', type: 'input', clearable: true }
], ],
vehicleRules: { vehicleRules: {
shopName: [{ required: true, message: '请选择特约店名称', trigger: 'change' }], shopName: [{ required: true, message: '请选择特约店名称', trigger: 'change' }],
vin: [{ required: true, message: '请输入车架号', trigger: 'blur' }], vin: [{ required: true, message: '请输入车架号', trigger: 'blur' }],
modelId: [{ required: true, message: '请选择车型', trigger: 'change' }], modelId: [{ required: true, message: '请选择车型', trigger: 'change' }],
configDesc: [{ required: true, message: '请输入配置', trigger: 'blur' }], configId: [{ required: true, message: '请输入配置', trigger: 'blur' }],
licensePlate: [{ required: true, message: '请输入车牌', trigger: 'blur' }],
color: [{ required: true, message: '请输入外色', trigger: 'blur' }], color: [{ required: true, message: '请输入外色', trigger: 'blur' }],
innerColor: [{ required: true, message: '请输入内色', trigger: 'blur' }], innerColor: [{ required: true, message: '请输入内色', trigger: 'blur' }],
serveType: [{ required: true, message: '请选择服役类型', trigger: 'blur' }] serveType: [{ required: true, message: '请选择服役类型', trigger: 'blur' }]
}, },
isReadonly: false,
// 特约店名称弹窗 // 特约店名称弹窗
filterDialogTitle: '选择组织', filterDialogTitle: '选择特约店',
filterVisible: false, filterVisible: false,
filterText: '', filterText: '',
filterTextData: [], filterTextData: [],
...@@ -301,50 +331,69 @@ export default { ...@@ -301,50 +331,69 @@ export default {
vehicleImport: false, vehicleImport: false,
importForm: {}, importForm: {},
importRules: {}, importRules: {},
deviceList: [] deviceList: [],
exportData: {}
} }
}, },
watch: {
filterText(val) { mounted() {
this.$refs.tree.filter(val) dictInfo('trialdrive_vehicle_model').then(res => {
} this.vehicleData.find(item => item.prop == 'modelId').options = res.data
this.vehicleDefalutData.find(item => item.prop == 'modelId').options = res.data
})
dictInfo('trialdrive_vehicle_config').then(res => {
this.vehicleData.find(item => item.prop == 'configId').options = res.data
this.vehicleDefalutData.find(item => item.prop == 'configId').options = res.data
})
}, },
methods: { methods: {
btnClick(pType, scope) { btnClick(pType, scope) {
switch (pType) { switch (pType) {
case 'create': case 'create':
this.vehicleVisible = !this.vehicleVisible this.vehicleVisible = !this.vehicleVisible
this.isReadonly = false
if (this.vehicleVisible) { if (this.vehicleVisible) {
this.vehicleTitle = '新增车辆' this.vehicleTitle = '新增车辆'
this.vehicleForm = {} this.vehicleForm = {}
this.vehicleData.map(item => { this.vehicleData = _.cloneDeep(this.vehicleDefalutData)
if (item.type == 'input' && !item.readonly) return item.readonly = false
else return item.disabled = false
})
} }
if (this.$refs.vehicleRuleForm) this.$refs.vehicleRuleForm.$children[0].clearValidate() if (this.$refs.vehicleRuleForm) this.$refs.vehicleRuleForm.$children[0].clearValidate()
break break
case 'edit': case 'edit':
console.log(scope)
this.vehicleVisible = !this.vehicleVisible this.vehicleVisible = !this.vehicleVisible
this.isReadonly = false
if (this.vehicleVisible) { if (this.vehicleVisible) {
this.vehicleTitle = '编辑车辆' this.vehicleTitle = '编辑车辆'
this.vehicleForm = JSON.parse(JSON.stringify(scope)) this.vehicleData = _.cloneDeep(this.vehicleDefalutData)
this.vehicleData.map(item => { infoVehicle({ tempId: scope.tempId }).then(res => {
if (item.type == 'input') return item.readonly = false const { code, data } = res
else return item.disabled = false if (code == 200) {
this.vehicleArr.forEach(item => {
this.$set(this.vehicleForm, item, data[item])
})
this.vehicleForm.tempId = data.id
}
}) })
} }
break break
case 'view': case 'view':
console.log('view') console.log('view')
this.vehicleVisible = !this.vehicleVisible this.vehicleVisible = !this.vehicleVisible
this.isReadonly = true
if (this.vehicleVisible) { if (this.vehicleVisible) {
this.vehicleForm = JSON.parse(JSON.stringify(scope)) infoVehicle({ tempId: scope.tempId }).then(res => {
const { code, data } = res
if (code == 200) {
this.vehicleArr.forEach(item => {
this.$set(this.vehicleForm, item, data[item])
})
}
})
this.vehicleTitle = '查看车辆' this.vehicleTitle = '查看车辆'
this.vehicleData.map(item => { this.vehicleData.map(item => {
if (item.type == 'input') return item.readonly = true if (item.type == 'input') this.$set(item, 'readonly', true)
else return item.disabled = true else this.$set(item, 'disabled', true)
}) })
} }
break break
...@@ -358,7 +407,8 @@ export default { ...@@ -358,7 +407,8 @@ export default {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '删除成功!' message: '删除成功!'
}); })
this.$refs.vehicleForm.refreshTable()
}) })
}) })
break break
...@@ -372,7 +422,8 @@ export default { ...@@ -372,7 +422,8 @@ export default {
this.$message({ this.$message({
type: 'success', type: 'success',
message: '解绑成功!' message: '解绑成功!'
}); })
this.$refs.vehicleForm.refreshTable()
}) })
}) })
break break
...@@ -380,40 +431,62 @@ export default { ...@@ -380,40 +431,62 @@ export default {
this.vehicleImport = !this.vehicleImport this.vehicleImport = !this.vehicleImport
break break
case 'export': case 'export':
if (this.$refs.vehicleRuleForm.mutiSelectArr[this.vehicleTableParams.mutiSelectName].length) { this.$Common.exportExcel({
console.log(this.$refs.vehicleRuleForm.mutiSelectArr[this.vehicleTableParams.mutiSelectName]) url: `${store.state.baseURL}${VEHICLE_API.VEHICLE_EXPORT}`,
exportVehicle({}).then(res => { method: 'GET',
data: this.searchForm
}) })
}
break break
} }
}, },
handleConfirm(type) { handleConfirm(type) {
console.log(type)
switch (type) { switch (type) {
case 'create': case 'create':
console.log(this.vehicleForm) console.log(this.vehicleForm)
this.$refs.vehicleRuleForm.$children[0].validate((valid) => { this.$refs.vehicleRuleForm.$children[0].validate((valid) => {
if (valid) { if (valid) {
addVehicle({}).then(res => { let params = _.cloneDeep(this.vehicleForm)
console.log(res) const { modelId, configId } = params
}) params.modelName = this.vehicleData.find(item => item.prop == 'modelId').options.find(j => j.id == modelId).dictLabel
} params.configDesc = this.vehicleData.find(item => item.prop == 'configId').options.find(j => j.id == configId).dictLabel
}) let api = addVehicle
break if (params.tempId) api = editVehicle
case 'edit': api(params).then(res => {
this.$refs.vehicleRuleForm.$children[0].validate((valid) => { const { code } = res
if (valid) { if (code == 200) {
editVehicle({}).then(res => { this.$message({
console.log(res) message: '操作成功',
type: 'success'
})
this.vehicleVisible = !this.vehicleVisible
this.$refs.vehicleForm.refreshTable()
} else {
this.$message({
message: '操作失败',
type: 'error'
})
}
}) })
} }
}) })
break break
case 'import': case 'import':
importVehicle({}).then(res => { console.log(this.importForm.file)
var data = new FormData()
data.append('file', this.importForm.file)
axios({
headers: {
'Content-Type': 'multipart/form-data',
"Authorization": localStorage.getItem('token') || ''
},
method: 'post',
url: `${store.state.baseURL}${VEHICLE_API.VEHICLE_IMPORT}`,
data
}).then(res => {
console.log(res)
if (res.data.code == 200) {
this.exportData = res.data.data
}
}) })
break break
} }
...@@ -423,6 +496,7 @@ export default { ...@@ -423,6 +496,7 @@ export default {
}, },
// 特约店弹窗 // 特约店弹窗
selectStore() { selectStore() {
if (this.isReadonly) return
this.filterText = '' this.filterText = ''
this.filterDialogTitle = '选择特约店' this.filterDialogTitle = '选择特约店'
this.getStoreList(); this.getStoreList();
...@@ -433,15 +507,16 @@ export default { ...@@ -433,15 +507,16 @@ export default {
}, },
getStoreList() { getStoreList() {
getSpecialShopList().then(res => { getSpecialShopList().then(res => {
const { code, data } = res; const { code, data } = res;
if(code == 200) { if (code == 200) {
this.filterTextData = data; this.filterTextData = data;
} }
}) })
}, },
filterConfirm() { filterConfirm() {
const { label } = this.$refs.tree.getCurrentNode(); const { label, id } = this.$refs.tree.getCurrentNode();
this.$set(this.vehicleForm, 'shopName', label); this.$set(this.vehicleForm, 'shopName', label);
this.vehicleForm.shopNameId = id
this.closeFilter(); this.closeFilter();
}, },
filterNode(value, data) { filterNode(value, data) {
...@@ -449,19 +524,33 @@ export default { ...@@ -449,19 +524,33 @@ export default {
return data.label.indexOf(value) !== -1 return data.label.indexOf(value) !== -1
}, },
downloadTemplate() { downloadTemplate() {
downloadtemplate({}).then(res => { this.$Common.exportExcel({
console.log('下载模板') url: `${store.state.baseURL}${VEHICLE_API.DOWNLOAD_TEMPLATE}`,
method: 'GET',
data: '',
fileName: '车辆导入模板'
})
},
downloadFailFile() {
this.$Common.exportExcel({
url: `${store.state.baseURL}${VEHICLE_API.VEHICLE_FAILFILE}`,
method: 'GET',
data: { failSeqNoFile: this.exportData.failSeqNoFile },
fileName: '车辆导入失败记录'
}) })
}, },
importFile(e) { importFile(e) {
console.log(e)
this.importForm.file = e.target.files[0]
this.$set(this.importForm, 'fileName', e.target.files[0].name) this.$set(this.importForm, 'fileName', e.target.files[0].name)
const reader = new FileReader() console.log(this.importForm)
reader.readAsDataURL(e.target.files[0]) // const reader = new FileReader()
reader.onload = event => { // reader.readAsDataURL(e.target.files[0])
const imgFile = event.target.result // reader.onload = event => {
const arrBase64 = imgFile.split(',') // const imgFile = event.target.result
this.importFileInfo = e.target.files[0].name.split('.')[1] + '@' + arrBase64[1] // const arrBase64 = imgFile.split(',')
} // this.importFileInfo = e.target.files[0].name.split('.')[1] + '@' + arrBase64[1]
// }
}, },
}, },
} }
...@@ -469,6 +558,6 @@ export default { ...@@ -469,6 +558,6 @@ export default {
<style scope> <style scope>
.vehicle .el-form .el-input__inner { .vehicle .el-form .el-input__inner {
width: 300px; width: 320px;
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -58,17 +58,19 @@ ...@@ -58,17 +58,19 @@
>未选择任何文件</span> >未选择任何文件</span>
</div> </div>
</el-form-item> </el-form-item>
<div v-if="$route.params.url != 'checkView'">
<el-button
class="pull-right m-l-md"
type="defalut"
@click="handleClose($route.params.url)"
>{{$route.params.url == 'submit' ? '取消' : '驳回'}}</el-button>
<el-button
class="pull-right"
type="primary"
@click="handleConfirm($route.params.url)"
>{{$route.params.url == 'submit' ? '确定' : '通过'}}</el-button>
</div>
</el-form> </el-form>
<el-button
class="pull-right m-l-md"
type="defalut"
@click="handleClose($route.params.url)"
>{{$route.params.url == 'submit' ? '取消' : '驳回'}}</el-button>
<el-button
class="pull-right"
type="primary"
@click="handleConfirm($route.params.url)"
>{{$route.params.url == 'submit' ? '确定' : '通过'}}</el-button>
</div> </div>
</template> </template>
...@@ -117,14 +119,48 @@ export default { ...@@ -117,14 +119,48 @@ export default {
} }
] ]
}, },
submitData: ['shopName', 'vin', 'modelName'], vehicleDefalutForm: {
list: [
{
docName: '车辆登记证',
docType: 1,
docUrl: ''
},
{
docName: '车辆发票',
docType: 2,
docUrl: ''
},
{
docName: '交强险',
docType: 3,
docUrl: ''
},
{
docName: '商业险',
docType: 4,
docUrl: ''
},
{
docName: '行驶证',
docType: 5,
docUrl: ''
},
{
docName: '车身照',
docType: 6,
docUrl: ''
}
]
},
submitData: ['shopName', 'vin', 'modelName', 'buyType'],
checkData: ['shopName', 'vin', 'modelName', 'licensePlate', 'buyType', 'registrationDate', 'saleManager', 'saleManagerPhone', 'remark'], checkData: ['shopName', 'vin', 'modelName', 'licensePlate', 'buyType', 'registrationDate', 'saleManager', 'saleManagerPhone', 'remark'],
vehicleData: [ vehicleData: [
{ label: '特约店名称:', prop: 'shopName', type: 'input', disabled: true }, { label: '特约店名称:', prop: 'shopName', type: 'input', disabled: true },
{ label: '车架号:', prop: 'vin', type: 'input', disabled: true }, { label: '车架号:', prop: 'vin', type: 'input', disabled: true },
{ label: '车型:', prop: 'modelName', type: 'input', disabled: true }, { label: '车型:', prop: 'modelName', type: 'input', disabled: true },
{ label: '车牌:', prop: 'licensePlate', type: 'input', clearable: true }, { label: '车牌:', prop: 'licensePlate', type: 'input', clearable: true },
{ label: '购置方式:', prop: 'buyType', type: 'select', options: [{ label: '租赁方式购置', value: 1 }], clearable: true }, { label: '购置方式:', prop: 'buyType', type: 'select', options: [{ label: '租赁方式购置', value: '1' }], clearable: true },
{ label: '上牌日期:', prop: 'registrationDate', type: 'input', disabled: true }, { label: '上牌日期:', prop: 'registrationDate', type: 'input', disabled: true },
{ label: '销售经理:', prop: 'saleManager', type: 'input', clearable: true }, { label: '销售经理:', prop: 'saleManager', type: 'input', clearable: true },
{ label: '销售经理电话:', prop: 'saleManagerPhone', type: 'input', clearable: true }, { label: '销售经理电话:', prop: 'saleManagerPhone', type: 'input', clearable: true },
...@@ -135,7 +171,7 @@ export default { ...@@ -135,7 +171,7 @@ export default {
{ label: '车架号:', prop: 'vin', type: 'input', disabled: true }, { label: '车架号:', prop: 'vin', type: 'input', disabled: true },
{ label: '车型:', prop: 'modelName', type: 'input', disabled: true }, { label: '车型:', prop: 'modelName', type: 'input', disabled: true },
{ label: '车牌:', prop: 'licensePlate', type: 'input', clearable: true }, { label: '车牌:', prop: 'licensePlate', type: 'input', clearable: true },
{ label: '购置方式:', prop: 'buyType', type: 'select', options: [{ label: '租赁方式购置', value: 1 }], clearable: true }, { label: '购置方式:', prop: 'buyType', type: 'select', options: [{ label: '租赁方式购置', value: '1' }], clearable: true },
{ label: '上牌日期:', prop: 'registrationDate', type: 'input', disabled: true }, { label: '上牌日期:', prop: 'registrationDate', type: 'input', disabled: true },
{ label: '销售经理:', prop: 'saleManager', type: 'input', clearable: true }, { label: '销售经理:', prop: 'saleManager', type: 'input', clearable: true },
{ label: '销售经理电话:', prop: 'saleManagerPhone', type: 'input', clearable: true }, { label: '销售经理电话:', prop: 'saleManagerPhone', type: 'input', clearable: true },
...@@ -143,7 +179,7 @@ export default { ...@@ -143,7 +179,7 @@ export default {
], ],
vehicleRules: { vehicleRules: {
licensePlate: [{ required: true, message: '请输入车牌', trigger: 'blur' }], licensePlate: [{ required: true, message: '请输入车牌', trigger: 'blur' }],
serveType: [{ required: true, message: '请选择购置方式', trigger: 'change' }], buyType: [{ required: true, message: '请选择购置方式', trigger: 'change' }],
saleManager: [{ required: true, message: '请输入销售经理', trigger: 'blur' }], saleManager: [{ required: true, message: '请输入销售经理', trigger: 'blur' }],
saleManagerPhone: [{ required: true, message: '请输入销售经理电话', trigger: 'blur' }] saleManagerPhone: [{ required: true, message: '请输入销售经理电话', trigger: 'blur' }]
}, },
...@@ -219,6 +255,7 @@ export default { ...@@ -219,6 +255,7 @@ export default {
type: 'success' type: 'success'
}) })
this.$router.replace('/vehicleSubmit') this.$router.replace('/vehicleSubmit')
this.vehicleForm = _.cloneDeep(this.vehicleDefalutForm)
} else { } else {
this.$message({ this.$message({
message: '操作失败', message: '操作失败',
...@@ -241,6 +278,7 @@ export default { ...@@ -241,6 +278,7 @@ export default {
type: 'success' type: 'success'
}) })
this.$router.replace('/vehicleCheck') this.$router.replace('/vehicleCheck')
this.vehicleForm = _.cloneDeep(this.vehicleDefalutForm)
} else { } else {
this.$message({ this.$message({
message: '操作失败', message: '操作失败',
...@@ -273,6 +311,7 @@ export default { ...@@ -273,6 +311,7 @@ export default {
type: 'success' type: 'success'
}) })
this.$router.replace('/vehicleCheck') this.$router.replace('/vehicleCheck')
this.vehicleForm = _.cloneDeep(this.vehicleDefalutForm)
} else { } else {
this.$message({ this.$message({
message: '操作失败', message: '操作失败',
...@@ -322,8 +361,6 @@ export default { ...@@ -322,8 +361,6 @@ export default {
this.$set(this.vehicleForm.list[index], 'docUrl', res.data.data) this.$set(this.vehicleForm.list[index], 'docUrl', res.data.data)
targetObj.url = res.data.data targetObj.url = res.data.data
} }
const fileData = new Array(targetObj)
return batchSaveFile(fileData, this.baseURL)
}).then(r => (this.vehicleForm[name] = r[0].id)) }).then(r => (this.vehicleForm[name] = r[0].id))
}, },
} }
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
</search-form> </search-form>
<h3>上牌资料信息</h3> <h3>上牌资料信息</h3>
<basic-table <basic-table
ref="vehicleForm" ref="vehicleSubmitTable"
:tableParams="submitTableParams" :tableParams="submitTableParams"
:getListApi="getListApi" :getListApi="getListApi"
:searchForm="searchForm" :searchForm="searchForm"
...@@ -147,6 +147,12 @@ export default { ...@@ -147,6 +147,12 @@ export default {
approvalStatusList: [] approvalStatusList: []
} }
}, },
watch: {
'$route'(val) {
console.log(val)
if (val.path == '/vehicleSubmit') this.$refs.vehicleSubmitTable.refreshTable()
}
},
mounted() { mounted() {
dictInfo('submitStatus').then(res => { dictInfo('submitStatus').then(res => {
this.submitFormList[1].options = res.data this.submitFormList[1].options = res.data
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
</search-form> </search-form>
<h3>上牌资料审核</h3> <h3>上牌资料审核</h3>
<basic-table <basic-table
ref="vehicleForm" ref="vehicleCheckTable"
:tableParams="checkTableParams" :tableParams="checkTableParams"
:getListApi="getListApi" :getListApi="getListApi"
:searchForm="searchForm" :searchForm="searchForm"
...@@ -50,6 +50,13 @@ ...@@ -50,6 +50,13 @@
> >
审核 审核
</el-button> </el-button>
<el-button
v-else
type="text"
@click="btnClick('view', scope.scope)"
>
查看
</el-button>
</span> </span>
</basic-table> </basic-table>
</div> </div>
...@@ -154,8 +161,9 @@ export default { ...@@ -154,8 +161,9 @@ export default {
} }
}, },
watch: { watch: {
'$router'(val) { '$route'(val) {
console.log(val) console.log(val)
if (val.path == '/vehicleCheck') this.$refs.vehicleCheckTable.refreshTable()
} }
}, },
mounted() { mounted() {
...@@ -178,6 +186,9 @@ export default { ...@@ -178,6 +186,9 @@ export default {
case 'check': case 'check':
this.$router.push({ name: 'addVehicle', params: { vehicleId: scope.vehicleId, approvalId: scope.approvalId, url: 'check' } }) this.$router.push({ name: 'addVehicle', params: { vehicleId: scope.vehicleId, approvalId: scope.approvalId, url: 'check' } })
break break
case 'view':
this.$router.push({ name: 'addVehicle', params: { vehicleId: scope.vehicleId, approvalId: scope.approvalId, url: 'checkView' } })
break
} }
}, },
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!