Commit 81e6f5c3 by 胡悦

修复bug

1 parent 8b0f3772
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
</template> </template>
<template v-else-if="item.type === 'daterange'"> <template v-else-if="item.type === 'daterange'">
<el-date-picker <el-date-picker
style="width: 100%;"
v-model="formModel[item.prop]" v-model="formModel[item.prop]"
type="daterange" type="daterange"
range-separator="至" range-separator="至"
...@@ -51,6 +52,7 @@ ...@@ -51,6 +52,7 @@
</template> </template>
<template v-else-if="item.type === 'singleDate'"> <template v-else-if="item.type === 'singleDate'">
<el-date-picker <el-date-picker
style="width: 100%;"
v-model="formModel[item.prop]" v-model="formModel[item.prop]"
:type="item.dateType" :type="item.dateType"
:value-format="item.format || 'yyyy-MM'" :value-format="item.format || 'yyyy-MM'"
......
...@@ -40,7 +40,7 @@ const routes = [ ...@@ -40,7 +40,7 @@ const routes = [
{ {
path: '/vehicleSubmit/addVehicle', path: '/vehicleSubmit/addVehicle',
name: 'addVehicle', name: 'addVehicle',
meta: {title: '新增车辆'}, meta: {title: '资料详情'},
component: () => import('../views/vehicleSubmit/addVehicle/index.vue'), component: () => import('../views/vehicleSubmit/addVehicle/index.vue'),
meta: { meta: {
keepAlive: true keepAlive: true
......
...@@ -10,6 +10,10 @@ ...@@ -10,6 +10,10 @@
margin-left: 20px; margin-left: 20px;
} }
.m-b-md {
margin-bottom: 20px;
}
.inline-b { .inline-b {
display: inline-block; display: inline-block;
} }
...@@ -35,8 +39,8 @@ ...@@ -35,8 +39,8 @@
} }
.system-container { .system-container {
padding: 0 0 0 10px; // padding: 0 0 0 10px;
margin: 20px 24px; // margin: 20px 24px;
background-color: #ffffff; background-color: #ffffff;
overflow: hidden; overflow: hidden;
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
type="primary" type="primary"
:size="btn_size" :size="btn_size"
icon="el-icon-refresh" icon="el-icon-refresh"
@click="refresh"
>重置</el-button> >重置</el-button>
</span> </span>
</search-form> </search-form>
...@@ -146,13 +147,21 @@ export default { ...@@ -146,13 +147,21 @@ export default {
} }
}, },
methods: { methods: {
refresh() {
this.searchForm = {}
this.searchDataForm = {}
this.$refs.removeAlarmForm.refreshTable()
},
beforeSearchFn() { beforeSearchFn() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (this.searchForm.daterange) { if (this.searchForm.daterange) {
this.searchDataForm.startTime = this.searchForm.daterange[0] this.searchDataForm.startTime = this.searchForm.daterange[0]
this.searchDataForm.endTime = this.searchForm.daterange[1] this.searchDataForm.endTime = this.searchForm.daterange[1]
} } else {
if (this.searchForm.keywords) this.searchDataForm.keywords = this.searchForm.keywords this.searchDataForm.startTime = ''
this.searchDataForm.endTime = ''
}/* */
this.searchDataForm.keywords = this.searchForm.keywords
resolve() resolve()
}) })
}, },
......
<template> <template>
<div class="system-container"> <div class="system-container">
<div class="container"> <div class="container">
<h1>有效试驾(日报)</h1>
<div class="m-b-md">用于<span class="red-text">展示日运营数据并支持下载Excel文件</span></div>
<search-form <search-form
class="searchTop border-shadow" class="searchTop border-shadow"
:formModel="searchForm" :formModel="searchForm"
...@@ -20,6 +22,7 @@ ...@@ -20,6 +22,7 @@
type="primary" type="primary"
:size="btn_size" :size="btn_size"
icon="el-icon-refresh" icon="el-icon-refresh"
@click="refresh"
>重置</el-button> >重置</el-button>
</span> </span>
...@@ -123,13 +126,22 @@ export default { ...@@ -123,13 +126,22 @@ export default {
}, },
methods: { methods: {
refresh() {
this.searchForm = {}
this.searchDataForm = {}
this.$refs.reportTable.refreshTable()
},
beforeSearchFn() { beforeSearchFn() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
console.log(this.searchForm.date)
if (this.searchForm.date) { if (this.searchForm.date) {
this.searchDataForm.year = this.searchForm.date.split('-')[0] this.searchDataForm.year = this.searchForm.date.split('-')[0]
this.searchDataForm.month = this.searchForm.date.split('-')[1] this.searchDataForm.month = this.searchForm.date.split('-')[1]
} else {
this.searchDataForm.year = ''
this.searchDataForm.month = ''
} }
if (this.searchForm.keywords) this.searchDataForm.keywords = this.searchForm.keywords this.searchDataForm.keywords = this.searchForm.keywords
resolve() resolve()
}) })
}, },
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
type="primary" type="primary"
:size="btn_size" :size="btn_size"
icon="el-icon-refresh" icon="el-icon-refresh"
@click="reset" @click="refresh"
>重置</el-button> >重置</el-button>
</span> </span>
</search-form> </search-form>
...@@ -211,8 +211,9 @@ export default { ...@@ -211,8 +211,9 @@ export default {
}) })
}, },
methods: { methods: {
reset() { refresh() {
this.searchForm = {} this.searchForm = {}
this.$refs.shopTable.refreshTable()
}, },
btnClick(pType, scope) { btnClick(pType, scope) {
const shopId = scope && scope.shopId; const shopId = scope && scope.shopId;
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
type="primary" type="primary"
:size="btn_size" :size="btn_size"
icon="el-icon-refresh" icon="el-icon-refresh"
@click="reset" @click="refresh"
>重置</el-button> >重置</el-button>
</span> </span>
</search-form> </search-form>
...@@ -124,8 +124,8 @@ export default { ...@@ -124,8 +124,8 @@ export default {
} }
}, },
methods: { methods: {
reset() { refresh() {
this.searchForm = {} this.searchForm = { status: 1 }
this.$refs.todoTable.refreshTable() this.$refs.todoTable.refreshTable()
}, },
btnClick(type, scope) { btnClick(type, scope) {
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
type="primary" type="primary"
:size="btn_size" :size="btn_size"
icon="el-icon-refresh" icon="el-icon-refresh"
@click="refresh"
>重置</el-button> >重置</el-button>
</span> </span>
</search-form> </search-form>
...@@ -356,6 +357,10 @@ export default { ...@@ -356,6 +357,10 @@ export default {
}, },
methods: { methods: {
refresh() {
this.searchForm = {}
this.$refs.vehicleForm.refreshTable()
},
btnClick(pType, scope) { btnClick(pType, scope) {
switch (pType) { switch (pType) {
case 'create': case 'create':
......
...@@ -59,13 +59,20 @@ ...@@ -59,13 +59,20 @@
>未选择任何文件</span> >未选择任何文件</span>
</div> </div>
</el-form-item> </el-form-item>
<div v-if="$route.params.url != 'checkView'"> <div>
<el-button <el-button
class="pull-right m-l-md" class="pull-right m-l-md"
type="defalut" type="defalut"
@click="handleClose()"
>取消</el-button>
<el-button
v-if="$route.params.url == 'check'"
class="pull-right m-l-md"
type="defalut"
@click="handleClose($route.params.url)" @click="handleClose($route.params.url)"
>{{$route.params.url == 'submit' ? '取消' : '驳回'}}</el-button> >驳回</el-button>
<el-button <el-button
v-if="$route.params.url != 'checkView'"
class="pull-right" class="pull-right"
type="primary" type="primary"
@click="handleConfirm($route.params.url)" @click="handleConfirm($route.params.url)"
...@@ -154,7 +161,7 @@ export default { ...@@ -154,7 +161,7 @@ export default {
} }
] ]
}, },
submitData: ['shopName', 'vin', 'modelName', 'buyType'], submitData: ['shopName', 'vin', 'modelName', 'buyType', 'licensePlate'],
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 },
...@@ -188,16 +195,27 @@ export default { ...@@ -188,16 +195,27 @@ export default {
}, },
watch: { watch: {
'$route.params'(val) { '$route.params'(val) {
console.log(val, 'watch') this.initData(val)
}
},
mounted() {
this.initData(this.$route.params)
},
methods: {
initData(val) {
if (val.vehicleId) { if (val.vehicleId) {
this.vehicleForm = _.cloneDeep(this.vehicleDefalutForm) this.vehicleForm = _.cloneDeep(this.vehicleDefalutForm)
if (this.$refs.vehicleSubmitForm) this.$refs.vehicleSubmitForm.$children[0].clearValidate() if (this.$refs.vehicleSubmitForm) this.$refs.vehicleSubmitForm.$children[0].clearValidate()
findVehDoc({ vehicleId: val.vehicleId }).then(res => { findVehDoc({ vehicleId: val.vehicleId }).then(res => {
if (val.url == 'submit') { if (val.url == 'submit') {
this.submitData.forEach(item => { let arr = this.submitData
if (val.status == 3) {
arr = this.checkData
}
arr.forEach(item => {
this.$set(this.vehicleForm, item, res.data[item]) this.$set(this.vehicleForm, item, res.data[item])
}) })
if (res.data.vehicleDocDtoList.length != 0) this.$set(this.vehicleForm, 'list', res.data.vehicleDocDtoList)
} else { } else {
this.checkData.forEach(item => { this.checkData.forEach(item => {
this.$set(this.vehicleForm, item, res.data[item]) this.$set(this.vehicleForm, item, res.data[item])
...@@ -213,33 +231,7 @@ export default { ...@@ -213,33 +231,7 @@ export default {
} else if ('submit') { } else if ('submit') {
this.vehicleData = _.cloneDeep(this.defalutData) this.vehicleData = _.cloneDeep(this.defalutData)
} }
} },
},
mounted() {
let params = this.$route.params
this.vehicleForm = _.cloneDeep(this.vehicleDefalutForm)
if (this.$refs.vehicleSubmitForm) this.$refs.vehicleSubmitForm.$children[0].clearValidate()
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: {
handleConfirm(type) { handleConfirm(type) {
console.log(type) console.log(type)
switch (type) { switch (type) {
...@@ -273,37 +265,49 @@ export default { ...@@ -273,37 +265,49 @@ export default {
}) })
break break
case 'check': case 'check':
const params = { this.$confirm('请再次确认是否要执行当前操作!', '提示', {
id: this.$route.params.approvalId, confirmButtonText: '确定',
status: 2 cancelButtonText: '取消',
} type: 'warning'
updateApproval(params).then(res => { }).then(() => {
if (res.code == 200) { const params = {
this.$message({ id: this.$route.params.approvalId,
message: '操作成功', status: 2
type: 'success'
})
this.$router.replace('/vehicleCheck')
this.vehicleForm = _.cloneDeep(this.vehicleDefalutForm)
} else {
this.$message({
message: '操作失败',
type: 'error'
})
} }
updateApproval(params).then(res => {
if (res.code == 200) {
this.$message({
message: '操作成功',
type: 'success'
})
this.$router.replace('/vehicleCheck')
this.vehicleForm = _.cloneDeep(this.vehicleDefalutForm)
} else {
this.$message({
message: '操作失败',
type: 'error'
})
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
})
}) })
break break
} }
}, },
handleClose(type) { handleClose(type) {
switch (type) { switch (type) {
case 'submit':
this.$router.go(-1)
break
case 'check': case 'check':
this.$prompt('请输入驳回原因', '提示', { this.$prompt('请输入驳回原因', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
inputPattern: /^(a-z|A-Z|0-9)*[^$%^&*;:,<>?()\""\']{1,200}$/,
closeOnClickModal: false,
closeOnPressEscape: false
}).then(({ value }) => { }).then(({ value }) => {
const params = { const params = {
id: this.$route.params.approvalId, id: this.$route.params.approvalId,
...@@ -332,6 +336,9 @@ export default { ...@@ -332,6 +336,9 @@ export default {
}) })
}) })
break break
default:
this.$router.go(-1)
break
} }
}, },
// 上传图片 // 上传图片
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
type="primary" type="primary"
:size="btn_size" :size="btn_size"
icon="el-icon-refresh" icon="el-icon-refresh"
@click="reset" @click="refresh"
>重置</el-button> >重置</el-button>
</span> </span>
</search-form> </search-form>
...@@ -113,7 +113,11 @@ export default { ...@@ -113,7 +113,11 @@ export default {
prop: 'shopLevel' prop: 'shopLevel'
}, { }, {
label: '车辆类型', label: '车辆类型',
prop: 'vehicleType' prop: 'vehicleType',
width: 120,
formatter: () => {
return '试乘试驾车辆'
}
}, { }, {
label: '车架号', label: '车架号',
prop: 'vin', prop: 'vin',
...@@ -169,14 +173,15 @@ export default { ...@@ -169,14 +173,15 @@ export default {
}) })
}, },
methods: { methods: {
reset() { refresh() {
this.searchForm = {} this.searchForm = {}
this.$refs.vehicleSubmitTable.refreshTable()
}, },
btnClick(pType, scope) { btnClick(pType, scope) {
console.log(scope) console.log(scope)
switch (pType) { switch (pType) {
case 'submit': case 'submit':
this.$router.push({ name: 'addVehicle', params: { vehicleId: scope.vehicleId, url: 'submit' } }) this.$router.push({ name: 'addVehicle', params: { vehicleId: scope.vehicleId, url: 'submit', status: scope.status } })
break break
} }
}, },
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
type="primary" type="primary"
:size="btn_size" :size="btn_size"
icon="el-icon-refresh" icon="el-icon-refresh"
@click="reset" @click="refresh"
>重置</el-button> >重置</el-button>
</span> </span>
</search-form> </search-form>
...@@ -89,12 +89,6 @@ export default { ...@@ -89,12 +89,6 @@ export default {
prop: 'keywords', prop: 'keywords',
placeholder: '特约店编码|店名称|围栏名称', placeholder: '特约店编码|店名称|围栏名称',
}, },
// {
// type: 'select',
// prop: 'submitStatus',
// placeholder: '请选择',
// options: []
// },
{ {
type: 'select', type: 'select',
prop: 'approvalStatus', prop: 'approvalStatus',
...@@ -185,18 +179,15 @@ export default { ...@@ -185,18 +179,15 @@ export default {
} }
}, },
mounted() { mounted() {
dictInfo('submitStatus').then(res => {
this.checkFormList[1].options = res.data
this.submitStatusList = res.data
})
dictInfo('approval_status').then(res => { dictInfo('approval_status').then(res => {
this.checkFormList[2].options = res.data this.checkFormList[1].options = res.data
this.approvalStatusList = res.data this.approvalStatusList = res.data
}) })
}, },
methods: { methods: {
reset() { refresh() {
this.searchForm = {} this.searchForm = {}
this.$refs.vehicleCheckTable.refreshTable()
}, },
btnClick(pType, scope) { btnClick(pType, scope) {
console.log(scope) console.log(scope)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!