Commit 6f3409ee by 胡悦

提交车辆相关接口

2 parents e77b2b95 2c8e4fb1
......@@ -41,14 +41,21 @@ const VEHICLE_API = {
VEHICLE_ADD: '/trialdrive/vehicle/drivevehicle/add',
VEHICLE_EDIT: '/trialdrive/vehicle/drivevehicle/update',
VEHICLE_DELETE: '/trialdrive/vehicle/drivevehicle/delete',
VEHICLE_UNBIND: '/trialdrive/vehicle/drivevehicle/unbindSn',
DOWNLOAD_TEMPLATE: '/trialdrice/vehicle/drivevehicle/downloadtemplate',
VEHICLE_IMPORT: '/trialdrice/vehicle/drivevehicle/import',
VEHICLE_UNBIND: '/trialdrive/vehicle/unbindSn',
DOWNLOAD_TEMPLATE: '/trialdrive/vehicle/drivevehicle/downloadtemplate',
VEHICLE_IMPORT: '/trialdrive/vehicle/drivevehicle/import',
VEHICLE_FAILFILE: '/trialdrive/vehicle/drivevehicle/downloadFailFile',
VEHICLE_EXPORT: '/trialdrive/vehicle/drivevehicle/export',
VEHICLE_INFO: '/trialdrive/vehicle/drivevehicle/findbyid'
VEHICLE_INFO: '/trialdrive/vehicle/drivevehicle/findbyid',
SPECIAL_SHOP_LIST: '/trialdrive/specialshop/shopusers'
}
// 审批管理
const APPROVAL_API = {
TODO_SEARCH: '/trialdrive/approval/searchTodoApproval'
}
export { API, COMMON_API, SPECIALSHOP_API, VEHICLE_API, APPROVAL_API, REPORT_API, VEHICLEDOC_API }
// 试驾围栏审批接口
const TEST_DRIVE_API = {
TEST_DRIVE_SEARCH: '/trialdrive/approval/searchFenceApp',
UPDATE_FENCE_APPROVAL: '/trialdrive/approval/updateApproval'
}
export { API, COMMON_API, SPECIALSHOP_API, VEHICLE_API, APPROVAL_API, REPORT_API, VEHICLEDOC_API, TEST_DRIVE_API }
import { VEHICLE_API } from '@/config/config'
import { TEST_DRIVE_API } from '@/config/config'
import request from '@/services/request'
// 获取车辆列表
// 获取试驾围栏审核列表
function getList (params) {
const url = VEHICLE_API.VEHICLE_SEARCH
const url = TEST_DRIVE_API.TEST_DRIVE_SEARCH
return request(params, url)
}
// 新增车辆
function addVehicle (params) {
const url = VEHICLE_API.VEHICLE_ADD
function updateFenceApproval (params) {
const url = TEST_DRIVE_API.UPDATE_FENCE_APPROVAL
return request(params, url, 'post')
}
// 编辑车辆
function editVehicle (params) {
const url = VEHICLE_API.VEHICLE_EDIT
return request(params, url, 'post')
}
// 批量删除车辆
function deleteVehicle (params) {
const url = VEHICLE_API.VEHICLE_DELETE
return request(params, url)
}
// 解绑车辆
function unbindVehicle (params) {
const url = VEHICLE_API.VEHICLE_UNBIND
return request(params, url)
}
// 下载模板
function downloadtemplate (params) {
const url = VEHICLE_API.DOWNLOAD_TEMPLATE
return request(params, url)
}
// 导入车辆
function importVehicle (params) {
const url = VEHICLE_API.VEHICLE_IMPORT
return request(params, url)
}
// 导出车辆
function exportVehicle (params) {
const url = VEHICLE_API.VEHICLE_EXPORT
return request(params, url)
}
export { getList, addVehicle, downloadtemplate, editVehicle, deleteVehicle, unbindVehicle, importVehicle, exportVehicle }
export { getList, updateFenceApproval }
......@@ -7,6 +7,12 @@ function getList (params) {
return request(params, url)
}
/*特约店列表*/
function getSpecialShopList (params) {
const url = VEHICLE_API.SPECIAL_SHOP_LIST
return request(params, url)
}
// 新增车辆
function addVehicle (params) {
const url = VEHICLE_API.VEHICLE_ADD
......@@ -46,7 +52,7 @@ function downloadtemplate (params) {
// 导入车辆
function importVehicle (params) {
const url = VEHICLE_API.VEHICLE_IMPORT
return request(params, url)
return request(params, url, 'post')
}
// 导出车辆
......@@ -55,4 +61,4 @@ function exportVehicle (params) {
return request(params, url)
}
export { getList, addVehicle, downloadtemplate, editVehicle, deleteVehicle, unbindVehicle, importVehicle, exportVehicle, infoVehicle }
export { getList, getSpecialShopList, addVehicle, downloadtemplate, editVehicle, deleteVehicle, unbindVehicle, importVehicle, exportVehicle, infoVehicle }
......@@ -4,7 +4,7 @@
<search-form
class="searchTop border-shadow testDrive"
:formModel="searchForm"
:formList="todoFormList"
:formList="checkFormList"
>
<slot name="form-slot">
<el-button
......@@ -17,6 +17,7 @@
type="primary"
:size="btn_size"
icon="el-icon-refresh"
@click="refresh"
>重置</el-button>
</slot>
</search-form>
......@@ -34,22 +35,35 @@
>
<span
class="dot"
:class="scope.scope.enableStatus ? USERSTATUS[scope.scope.enableStatus].split(',')[1] : ''"
:class="scope.scope.approvalStatus ? USERSTATUS[scope.scope.approvalStatus].split(',')[1] : ''"
></span>
<span class="statusText">{{ scope.scope.enableStatus ? USERSTATUS[scope.scope.enableStatus].split(',')[0] : '--'}}</span>
<span class="statusText">{{ scope.scope.approvalStatus ? USERSTATUS[scope.scope.approvalStatus].split(',')[0] : '--'}}</span>
</span>
<span
slot="table-button"
slot-scope="scope"
>
<el-button
v-for="(j, idx) in testDriveTableParams.tableOption.btnList"
:key="idx"
:type="j.type || 'text'"
size="mini"
plain
@click="btnClick(j.pType, scope.scope)"
>{{j.name}}</el-button>
<template v-for="(j, idx) in testDriveTableParams.tableOption.btnList">
<!-- approvalStatus为1也就是未审核状态才展示通过/驳回 -->
<template v-if="(j.pType == 'pass' || j.pType == 'reject') && scope.scope.approvalStatus == 1">
<el-button
:key="idx"
:type="j.type || 'text'"
size="mini"
plain
@click="btnClick(j.pType, scope.scope)"
>{{j.name}}</el-button>
</template>
<template v-if="(j.pType !== 'pass' && j.pType !== 'reject') && scope.scope.approvalStatus != 1">
<el-button
:key="idx"
:type="j.type || 'text'"
size="mini"
plain
@click="btnClick(j.pType, scope.scope)"
>{{j.name}}</el-button>
</template>
</template>
</span>
</basic-table>
</div>
......@@ -57,23 +71,25 @@
</template>
<script>
import { getList } from 'services/testDrive'
import { getList, updateFenceApproval } from 'services/testDrive'
export default {
data() {
return {
searchForm: {},
todoFormList: [
searchForm: {
keywords: ''
},
checkFormList: [
{
label: '关键字:',
type: 'input',
inputType: 'text',
prop: 'status',
prop: 'keywords',
placeholder: '特约店编码|店名称',
},
{
label: '审核状态:',
type: 'select',
prop: 'enableStatus',
prop: 'approvalStatus',
placeholder: '请选择审核状态',
options: [{
value: '1',
......@@ -115,6 +131,9 @@ export default {
}, {
label: '店级别',
prop: 'shopLevel'
}, {
label: '审核结果',
prop: 'approvalResult'
}
],
tableOption: {
......@@ -122,23 +141,28 @@ export default {
btnList: [
{
name: '查看原围栏',
pType: 'viewOrigin'
pType: 'view',
},
{
name: '查看修改后围栏',
pType: 'viewUpdatedData'
pType: 'view',
},
{
name: '通过',
pType: 'pass'
pType: 'pass',
},
{
name: '驳回',
pType: 'reject'
pType: 'reject',
}
]
}
},
approvalParams: {
id: '',
status: 2,
remark: ''
},
getListApi: getList,
// 弹窗
testDriveVisible: false,
......@@ -159,57 +183,60 @@ export default {
},
methods: {
btnClick(pType, scope) {
const { approvalId } = scope;
this.approvalParams.id = approvalId;
switch (pType) {
case 'create':
case 'pass':
this.approvalParams.status = 2;
delete this.approvalParams.remark;
this.updateFenceApproval();
break
case 'edit':
case 'reject':
this.approvalParams.status = 3;
this.showRejectRemarks();
break
case 'view':
break
case 'delete':
this.$confirm('是否要删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
})
break
case 'unbind':
this.$confirm('是否要解绑, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
})
break
case 'import':
break
case 'export':
let query = {
fenceId: scope.bizId,
readonlyStatus: true
};
const path = '/oEshield#/monitor/editFence';
history.pushState(query, path, path);
break
}
},
handleConfirm(type) {
console.log(type)
switch (type) {
case 'create':
break
case 'edit':
break
case 'import':
break
}
showRejectRemarks() {
this.$prompt('请输入驳回原因', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消'
}).then(({ value }) => {
this.approvalParams.remark = value;
this.updateFenceApproval();
}).catch(() => {
});
},
handleClose(type) {
this.btnClick(type)
updateFenceApproval() {
updateFenceApproval(this.approvalParams).then(res => {
const { code, message } = res;
if(code == 200) {
this.$message({
type: 'success',
message: '操作成功!'
});
this.$refs.testDriveForm.refreshTable()
} else {
this.$message({
type: 'error',
message
});
}
})
},
refresh() {
this.searchForm = {
keywords: ''
}
this.$refs.testDriveForm.refreshTable()
}
},
}
......
......@@ -127,6 +127,8 @@ export default {
case 'todo':
// 跳转
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
}
}
......
......@@ -58,17 +58,19 @@
>未选择任何文件</span>
</div>
</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-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>
</template>
......@@ -117,7 +119,41 @@ 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'],
vehicleData: [
{ label: '特约店名称:', prop: 'shopName', type: 'input', disabled: true },
......@@ -135,7 +171,7 @@ export default {
{ label: '车架号:', prop: 'vin', type: 'input', disabled: true },
{ label: '车型:', prop: 'modelName', type: 'input', disabled: 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: 'saleManager', type: 'input', clearable: true },
{ label: '销售经理电话:', prop: 'saleManagerPhone', type: 'input', clearable: true },
......@@ -219,6 +255,7 @@ export default {
type: 'success'
})
this.$router.replace('/vehicleSubmit')
this.vehicleForm = _.cloneDeep(this.vehicleDefalutForm)
} else {
this.$message({
message: '操作失败',
......@@ -241,6 +278,7 @@ export default {
type: 'success'
})
this.$router.replace('/vehicleCheck')
this.vehicleForm = _.cloneDeep(this.vehicleDefalutForm)
} else {
this.$message({
message: '操作失败',
......@@ -273,6 +311,7 @@ export default {
type: 'success'
})
this.$router.replace('/vehicleCheck')
this.vehicleForm = _.cloneDeep(this.vehicleDefalutForm)
} else {
this.$message({
message: '操作失败',
......@@ -322,8 +361,6 @@ export default {
this.$set(this.vehicleForm.list[index], 'docUrl', 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))
},
}
......
......@@ -50,6 +50,13 @@
>
审核
</el-button>
<el-button
v-else
type="text"
@click="btnClick('view', scope.scope)"
>
查看
</el-button>
</span>
</basic-table>
</div>
......@@ -179,6 +186,9 @@ export default {
case 'check':
this.$router.push({ name: 'addVehicle', params: { vehicleId: scope.vehicleId, approvalId: scope.approvalId, url: 'check' } })
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!