Commit 5108d0f3 by 胡悦

上牌资料接口

1 parent 028cc576
......@@ -18,18 +18,20 @@
:type="item.inputType || 'text'"
:placeholder="item.placeholder || '请输入'"
:readonly="item.readonly || false"
clearable
></el-input>
</template>
<template v-else-if="item.type === 'select'">
<el-select
v-model="formModel[item.prop]"
:placeholder="item.placeholder || '请选择'"
clearable
>
<el-option
v-for="i in item.options"
:key="i[item.value] || i.value"
:label="i[item.key] || i.label"
:value="i[item.value] || i.value"
:key="i[item.value] || i.value || i.dictValue"
:label="i[item.key] || i.label || i.dictLabel"
:value="i[item.value] || i.value || i.dictValue"
:disabled="i.disabled"
>
</el-option>
......@@ -78,6 +80,13 @@
>
</el-date-picker>
</template>
<template
name="self"
slot-scope="scope"
>
<slot :scope="scope">
</slot>
</template>
</template>
</el-form-item>
<el-form-item>
......
......@@ -32,7 +32,8 @@ const VEHICLEDOC_API = {
DOC_SEARCH: '/trialdrive/vehicleDoc/search',
DOC_BY_CONDITION: '/trialdrive/vehicleDoc/findVehDocByCondition',
CHENCK_SEARCH: '/trialdrive/approval/searchVehiclelicApp',
SAVE_DOC: '/trialdrive/vehicleDoc/saveOrUpdateVehDoc'
SAVE_DOC: '/trialdrive/vehicleDoc/saveOrUpdateVehDoc',
UPDATE_APPROVAL: '/trialdrive/approval/updateApproval'
}
// 试驾车辆管理接口
const VEHICLE_API = {
......
......@@ -9,7 +9,7 @@ function getProvinceList (params) {
// 获取字典详情
function dictInfo (params) {
const url = `${DICT_API.DICTDATA_TYPE}/${params}`
const url = `${COMMON_API.DICTDATA_TYPE}/${params}`
return request({}, url)
}
......
......@@ -22,7 +22,13 @@ function findVehDoc (params) {
// 保存或者更新上牌资料
function saveDoc (params) {
const url = VEHICLEDOC_API.SAVE_DOC
return request(params, url)
return request(params, url, 'post')
}
// 修改审批的流程
function updateApproval (params) {
const url = VEHICLEDOC_API.UPDATE_APPROVAL
return request(params, url, 'post')
}
export { getDocList, getCheckList, findVehDoc, saveDoc }
export { getDocList, getCheckList, findVehDoc, saveDoc, updateApproval }
......@@ -6,6 +6,10 @@
float: left;
}
.m-l-md {
margin-left: 20px;
}
.table-btn {
margin-bottom: 20px;
}
......
......@@ -72,10 +72,10 @@ export default {
value: ''
}, {
label: '未处理',
value: 0
value: 1
}, {
label: '已处理',
value: 1
value: 2
}]
},
{
......@@ -126,6 +126,7 @@ export default {
switch (type) {
case 'todo':
// 跳转
console.log(scope)
break
}
}
......
......@@ -145,7 +145,7 @@ export default {
label: '关键字:',
type: 'input',
inputType: 'text',
prop: 'status',
prop: 'searchKey',
placeholder: '特约店编码|店名称|车架号|设备号|车型',
}
],
......@@ -314,7 +314,7 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteVehicle({}).then(res => {
deleteVehicle({ tempId: scope.tempId }).then(res => {
this.$message({
type: 'success',
message: '删除成功!'
......@@ -328,7 +328,7 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
unbindVehicle({}).then(res => {
unbindVehicle({ tempId: scope.tempId }).then(res => {
this.$message({
type: 'success',
message: '解绑成功!'
......
<template>
<div style="width: calc(100% - 500px)">
<div style="width: calc(100% - 300px)">
<h2>基础信息</h2>
<el-divider></el-divider>
<rule-form
......@@ -15,12 +15,13 @@
:rules="vehicleRules"
ref="vehicleImgForm"
label-width="120px"
:inline="true"
>
<el-form-item
v-for="(item, index) in vehicleForm.picList"
:label="item.label"
v-for="(item, index) in vehicleForm.list"
:label="item.docName"
:key="index"
:prop="'picList.' + index + '.docUrl'"
:prop="'list.' + index + '.docUrl'"
:rules="{
required: true, message: '图片不能为空', trigger: 'blur'
}"
......@@ -37,26 +38,38 @@
<i class="el-icon-picture-outline"></i>
</div>
</el-image>
<el-button
class="import-btn"
style="display: block;"
type="primary"
>上传{{item.label}}
<input
type="file"
id="fileUpload"
class="import-input"
accept="image/png, image/jpeg, image/jpg"
@change="uploadImg($event, index)"
/>
</el-button>
<div v-if="$route.params.url == 'submit'">
<el-button
class="import-btn"
style="display: block;"
type="primary"
>上传{{item.docName}}
<input
type="file"
id="fileUpload"
class="import-input"
accept="image/png, image/jpeg, image/jpg"
@change="uploadImg($event, index)"
/>
</el-button>
<span
v-show="!item.docUrl"
class="red-text"
>未选择任何文件</span>
</div>
</el-form-item>
</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"
>确定</el-button>
@click="handleConfirm($route.params.url)"
>{{$route.params.url == 'submit' ? '确定' : '通过'}}</el-button>
</div>
</template>
......@@ -65,72 +78,123 @@ import _ from 'lodash'
import axios from 'axios'
import sign from 'services/sign'
import qs from 'qs'
import { findVehDoc, saveDoc, updateApproval } from 'services/vehicledoc'
export default {
data() {
return {
baseURL: 'http://qcdidicb.glsx.net:7060',
vehicleForm: {
picList: [
list: [
{
label: '车辆登记证',
docName: '车辆登记证',
docType: 1,
docUrl: ''
},
{
label: '车辆发票',
docName: '车辆发票',
docType: 2,
docUrl: ''
},
{
label: '交强险',
docName: '交强险',
docType: 3,
docUrl: ''
},
{
label: '商业险',
docName: '商业险',
docType: 4,
docUrl: ''
},
{
label: '行驶证',
docName: '行驶证',
docType: 5,
docUrl: ''
},
{
label: '车身照',
docName: '车身照',
docType: 6,
docUrl: ''
}
]
},
submitData: ['shopName', 'vin', 'modelName'],
checkData: ['shopName', 'vin', 'modelName', 'licensePlate', 'buyType', 'registrationDate', 'saleManager', 'saleManagerPhone', 'remark'],
vehicleData: [
{ label: '特约店名称:', prop: 'shopName', type: 'input' },
{ label: '车架号:', prop: 'vin', type: 'input' },
{ label: '车型:', prop: 'modelId', type: 'select', options: [], clearable: true },
{ label: '审核状态:', prop: 'configDesc', type: 'select', options: [], clearable: true },
{ label: '特约店名称:', prop: 'shopName', type: 'input', disabled: true },
{ label: '车架号:', prop: 'vin', type: 'input', disabled: true },
{ label: '车型:', prop: 'modelName', type: 'input', disabled: true },
{ label: '车牌:', prop: 'licensePlate', type: 'input', clearable: true },
{ label: '服役类型:', prop: 'serveType', type: 'select', options: [], clearable: true },
{ label: '上牌日期:', prop: 'sn', type: 'input', clearable: true },
{ label: '销售经理:', prop: 'sn', type: 'input', clearable: true },
{ label: '销售经理电话:', prop: 'sn', type: 'input', clearable: true },
{ label: '备注:', prop: 'sn', type: 'input', inputText: 'textarea', 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 },
{ label: '备注:', prop: 'remark', type: 'input', inputText: 'textarea', clearable: true }
],
defalutData: [
{ label: '特约店名称:', prop: 'shopName', type: 'input', disabled: true },
{ 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: 'registrationDate', type: 'input', disabled: true },
{ label: '销售经理:', prop: 'saleManager', type: 'input', clearable: true },
{ label: '销售经理电话:', prop: 'saleManagerPhone', type: 'input', clearable: true },
{ label: '备注:', prop: 'remark', type: 'input', inputText: 'textarea', clearable: true }
],
vehicleRules: {
shopName: [{ required: true }],
vin: [{ required: true, message: '请输入车架号', trigger: 'blur' }],
modelId: [{ required: true, message: '请选择车型', trigger: 'change' }],
configDesc: [{ required: true, message: '请输入配置', trigger: 'blur' }],
licensePlate: [{ required: true, message: '请输入车牌', trigger: 'blur' }],
color: [{ required: true, message: '请输入外色', trigger: 'blur' }],
innerColor: [{ required: true, message: '请输入内色', trigger: 'blur' }],
serveType: [{ required: true, message: '请选择服役类型', trigger: 'blur' }]
serveType: [{ required: true, message: '请选择购置方式', trigger: 'change' }],
saleManager: [{ required: true, message: '请输入销售经理', trigger: 'blur' }],
saleManagerPhone: [{ required: true, message: '请输入销售经理电话', trigger: 'blur' }]
},
picList: [
{
key: 1,
label: '车辆登记证',
docUrl: ''
},
{
key: 2,
label: '车辆发票',
docUrl: ''
}
]
}
},
watch: {
'$route.params'(val) {
console.log(val, 'watch')
if (val.vehicleId) {
findVehDoc({ vehicleId: val.vehicleId }).then(res => {
if (val.url == 'submit') {
this.submitData.forEach(item => {
this.$set(this.vehicleForm, item, res.data[item])
})
} else {
this.checkData.forEach(item => {
this.$set(this.vehicleForm, item, res.data[item])
})
this.$set(this.vehicleForm, 'list', res.data.vehicleDocDtoList)
}
})
}
if (val.url == 'check') {
this.vehicleData.forEach(item => {
this.$set(item, 'disabled', true)
})
} else if ('submit') {
this.vehicleData = _.cloneDeep(this.defalutData)
}
}
},
mounted() {
let params = this.$route.params
findVehDoc({ vehicleId: params.vehicleId }).then(res => {
if (params.url == 'submit') {
this.submitData.forEach(item => {
this.$set(this.vehicleForm, item, res.data[item])
})
} else {
this.checkData.forEach(item => {
this.$set(this.vehicleForm, item, res.data[item])
})
this.$set(this.vehicleForm, 'list', res.data.vehicleDocDtoList)
}
})
if (params.url == 'check') {
this.vehicleData.forEach(item => {
this.$set(item, 'disabled', true)
})
} else if ('submit') {
this.vehicleData = _.cloneDeep(this.defalutData)
}
},
methods: {
......@@ -140,17 +204,90 @@ export default {
case 'submit':
console.log(this.vehicleForm)
this.$refs.vehicleSubmitForm.$children[0].validate((valid) => {
if (valid) {
// addVehicle({}).then(res => {
// console.log(res)
// })
let errorFlag = false
this.vehicleForm.list.forEach(item => {
if (!item.docUrl) errorFlag = true
})
if (valid && !errorFlag) {
const params = JSON.parse(JSON.stringify(this.vehicleForm))
params.tempId = this.$route.params.vehicleId
saveDoc(params).then(res => {
console.log(res)
if (res.code == 200) {
this.$message({
message: '操作成功',
type: 'success'
})
this.$router.replace('/vehicleSubmit')
} else {
this.$message({
message: '操作失败',
type: 'error'
})
}
})
}
})
break
case 'check':
const params = {
id: this.$route.params.approvalId,
status: 2
}
updateApproval(params).then(res => {
if (res.code == 200) {
this.$message({
message: '操作成功',
type: 'success'
})
this.$router.replace('/vehicleCheck')
} else {
this.$message({
message: '操作失败',
type: 'error'
})
}
})
break
}
},
handleClose() {
handleClose(type) {
switch (type) {
case 'submit':
this.$router.go(-1)
break
case 'check':
this.$prompt('请输入驳回原因', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
}).then(({ value }) => {
const params = {
id: this.$route.params.approvalId,
status: 3,
remark: value
}
updateApproval(params).then(res => {
if (res.code == 200) {
this.$message({
message: '操作成功',
type: 'success'
})
this.$router.replace('/vehicleCheck')
} else {
this.$message({
message: '操作失败',
type: 'error'
})
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '取消输入'
})
})
break
}
},
// 上传图片
uploadImg(e, index) {
......@@ -182,7 +319,7 @@ export default {
const data = sign(params, noSignAttr)
axios.post(`${fileUploadURL}/router?method=${method}`, qs.stringify(data)).then(res => {
if (res.status === 200) {
this.$set(this.vehicleForm.picList[index], 'docUrl', res.data.data)
this.$set(this.vehicleForm.list[index], 'docUrl', res.data.data)
targetObj.url = res.data.data
}
const fileData = new Array(targetObj)
......
......@@ -17,6 +17,7 @@
type="primary"
:size="btn_size"
icon="el-icon-refresh"
@click="reset"
>重置</el-button>
</slot>
</search-form>
......@@ -43,6 +44,7 @@
slot-scope="scope"
>
<el-button
v-if="scope.scope.isbutton"
type="text"
@click="btnClick('submit', scope.scope)"
>
......@@ -56,6 +58,7 @@
<script>
import { getDocList } from 'services/vehicledoc'
import { dictInfo } from 'services/common'
export default {
data() {
return {
......@@ -65,20 +68,20 @@ export default {
label: '关键字:',
type: 'input',
inputType: 'text',
prop: 'status',
prop: 'keywords',
placeholder: '特约店编码|店名称|围栏名称',
},
{
label: '提交状态:',
type: 'select',
prop: '',
prop: 'submitStatus',
placeholder: '请选择',
options: []
},
{
label: '审核状态:',
type: 'select',
prop: '',
prop: 'approvalStatus',
placeholder: '请选择',
options: []
}
......@@ -90,7 +93,7 @@ export default {
tableColumns: [
{
label: '所属大区',
prop: 'tempId'
prop: 'area'
}, {
label: '所属省',
prop: 'province'
......@@ -108,7 +111,7 @@ export default {
prop: 'shopLevel'
}, {
label: '车辆类型',
prop: 'shopLevel'
prop: 'vehicleType'
}, {
label: '车架号',
prop: 'vin'
......@@ -119,33 +122,50 @@ export default {
label: '配置',
prop: 'configDesc'
}, {
label: '车牌',
prop: 'licensePlate'
}, {
label: '外色',
prop: 'sns'
prop: 'color'
}, {
label: '内色',
prop: 'installedTime'
prop: 'innerColor'
}, {
label: '提交状态',
prop: 'installedTime'
prop: 'submitStatus',
formatter: (cellValue) => {
return this.submitStatusList.find(item => item.dictValue == cellValue.submitStatus).dictLabel
}
}, {
label: '审核状态',
prop: 'installedTime'
prop: 'approvalStatus'
}, {
label: '审核结果备注',
prop: 'installedTime'
prop: 'remark'
}
]
},
getListApi: getDocList,
submitStatusList: [],
approvalStatusList: []
}
},
mounted() {
dictInfo('submitStatus').then(res => {
this.submitFormList[1].options = res.data
this.submitStatusList = res.data
})
dictInfo('approval_status').then(res => {
this.submitFormList[2].options = res.data
this.approvalStatusList = res.data
})
},
methods: {
reset() {
this.searchForm = {}
},
btnClick(pType, scope) {
console.log(scope)
switch (pType) {
case 'submit':
this.$router.push({ name: 'addVehicle', params: { vehicleId: scope.vehicleId, url: 'submit' } })
break
}
},
......
......@@ -17,6 +17,7 @@
type="primary"
:size="btn_size"
icon="el-icon-refresh"
@click="reset"
>重置</el-button>
</slot>
</search-form>
......@@ -43,10 +44,11 @@
slot-scope="scope"
>
<el-button
v-if="scope.scope.approvalStatus == 1"
type="text"
@click="btnClick('submit', scope.scope)"
@click="btnClick('check', scope.scope)"
>
提交上牌资料
审核
</el-button>
</span>
</basic-table>
......@@ -56,6 +58,7 @@
<script>
import { getCheckList } from 'services/vehicledoc'
import { dictInfo } from 'services/common'
export default {
data() {
return {
......@@ -71,14 +74,14 @@ export default {
{
label: '提交状态:',
type: 'select',
prop: '',
prop: 'submitStatus',
placeholder: '请选择',
options: []
},
{
label: '审核状态:',
type: 'select',
prop: '',
prop: 'approvalStatus',
placeholder: '请选择',
options: []
}
......@@ -90,7 +93,7 @@ export default {
tableColumns: [
{
label: '所属大区',
prop: 'tempId'
prop: 'area'
}, {
label: '所属省',
prop: 'province'
......@@ -108,7 +111,7 @@ export default {
prop: 'shopLevel'
}, {
label: '车辆类型',
prop: 'shopLevel'
prop: 'vehicleType'
}, {
label: '车架号',
prop: 'vin'
......@@ -120,36 +123,60 @@ export default {
prop: 'configDesc'
}, {
label: '外色',
prop: 'sns'
prop: 'color'
}, {
label: '内色',
prop: 'installedTime'
prop: 'innerColor'
}, {
label: '提交时间',
prop: 'installedTime'
prop: 'submitTime'
}, {
label: '销售经理',
prop: 'installedTime'
prop: 'saleManager'
}, {
label: '销售经理电话',
prop: 'installedTime'
prop: 'saleManagerPhone'
}, {
label: '上牌备注',
prop: 'installedTime'
prop: 'velRemark'
}, {
label: '审核结果',
prop: 'approvalResult'
}, {
label: '审核结果备注',
prop: 'installedTime'
label: '备注',
prop: 'remark'
}
]
},
getListApi: getCheckList,
submitStatusList: [],
approvalStatusList: []
}
},
watch: {
'$router'(val) {
console.log(val)
}
},
mounted() {
dictInfo('submitStatus').then(res => {
this.checkFormList[1].options = res.data
this.submitStatusList = res.data
})
dictInfo('approval_status').then(res => {
this.checkFormList[2].options = res.data
this.approvalStatusList = res.data
})
},
methods: {
reset() {
this.searchForm = {}
},
btnClick(pType, scope) {
console.log(scope)
switch (pType) {
case 'submit':
this.$router.push({ name: 'addVehicle' })
case 'check':
this.$router.push({ name: 'addVehicle', params: { vehicleId: scope.vehicleId, approvalId: scope.approvalId, url: 'check' } })
break
}
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!