Commit 90da43e5 by zhangquan

修复bug

1 parent 21eea0ac
<!-- 搜索 --> <!-- 搜索 -->
<template> <template>
<div :class="['glsx-combi-form', isEdit ? 'gl-form-page' : '']"> <div :class="['glsx-combi-form', isEdit ? 'gl-form-page' : '']">
<el-form :ref="formRef" :inline="isInline" :model="formObj" :rules="formRules" size="small" class="glsx-combi-form-block"> <el-form @submit.native.prevent :ref="formRef" :inline="isInline" :model="formObj" :rules="formRules" size="small" class="glsx-combi-form-block">
<template v-for="(item, index) in formData"> <template v-for="(item, index) in formData">
<el-form-item v-if="!item.isHide" :key="index" :id="item.name" :labelWidth="isEdit ? '154px' : labelWidth" :class="[{ 'no-label': !item.label, isBlock: isBlock }, { textBox: item.type == 'textBox' }]" :style="{ 'margin-bottom': isEdit ? '24px' : '', 'margin-right': isEdit ? '0px' : '30px', ...item.style }" :label="item.label" :prop="item.name"> <el-form-item v-if="!item.isHide" :key="index" :id="item.name" :labelWidth="isEdit ? '154px' : labelWidth" :class="[{ 'no-label': !item.label, isBlock: isBlock }, { textBox: item.type == 'textBox' }]" :style="{ 'margin-bottom': isEdit ? '24px' : '', 'margin-right': isEdit ? '0px' : '30px', ...item.style }" :label="item.label" :prop="item.name">
<span v-if="!item.isHide && item.tips" class="tips-block" slot="label"> <span v-if="!item.isHide && item.tips" class="tips-block" slot="label">
......
...@@ -6,8 +6,13 @@ ...@@ -6,8 +6,13 @@
:close-on-click-modal="false" :close-on-click-modal="false"
@onOk="handleConfirm" @onOk="handleConfirm"
@onCancel="handleClose"> @onCancel="handleClose">
<div class="search-wrap">
<el-input size="small" placeholder="请输入搜索关键字" v-model="curbrandName">
<i slot="suffix" class="el-input__icon el-icon-search"></i>
</el-input>
</div>
<el-checkbox-group v-model="checkedList"> <el-checkbox-group v-model="checkedList">
<el-checkbox v-for="item in carSeriesList" :key="item.id" :label="item.id">{{item.name}}</el-checkbox> <el-checkbox v-for="item in filterBrandList" :key="item.id" :label="item.id">{{item.name}}</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</GLDialog> </GLDialog>
</template> </template>
...@@ -16,8 +21,10 @@ export default { ...@@ -16,8 +21,10 @@ export default {
name: 'selectCarSeriesDialog', name: 'selectCarSeriesDialog',
data() { data() {
return { return {
curbrandName: '',
checkedList:[], checkedList:[],
carSeriesList: [] carSeriesList: [],
filterBrandList: []
} }
}, },
props: { props: {
...@@ -29,6 +36,14 @@ export default { ...@@ -29,6 +36,14 @@ export default {
type: Array type: Array
} }
}, },
watch:{
curbrandName:{
handler(nVal, oVal){
this.filterBrandList = this.carSeriesList.filter(item => item.name.indexOf(nVal)>-1)
},
deep: true
}
},
created(){ created(){
this.checkedList = this?.listData.map(item => item.id) this.checkedList = this?.listData.map(item => item.id)
this.getCarSeriesList() this.getCarSeriesList()
...@@ -64,4 +79,13 @@ export default { ...@@ -64,4 +79,13 @@ export default {
height: 32px; height: 32px;
line-height: 32px; line-height: 32px;
} }
.search-wrap{
margin-bottom: 12px;
/deep/ .el-input {
&, .el-input__inner{
height: 36px;
width: 432px;
}
}
}
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -312,6 +312,15 @@ export default { ...@@ -312,6 +312,15 @@ export default {
} }
}, },
methods:{ methods:{
validateField(field){
if(Array.isArray(field)){
field.forEach(item => {
this.$refs.baseInfoRef.$refs.formRef.validateField(item)
})
}else{
this.$refs.baseInfoRef.$refs.formRef.validateField(field)
}
},
retainagePriceFn(price){ retainagePriceFn(price){
let depositPrice = this.formObj.paymentType==1 ? 0 : this.formObj.depositPrice let depositPrice = this.formObj.paymentType==1 ? 0 : this.formObj.depositPrice
if(this.formObj.paymentType==1) return '--' if(this.formObj.paymentType==1) return '--'
...@@ -335,6 +344,7 @@ export default { ...@@ -335,6 +344,7 @@ export default {
retailPrice = retailPrice ? Number(Number(retailPrice/100).toFixed(2)) : 0 retailPrice = retailPrice ? Number(Number(retailPrice/100).toFixed(2)) : 0
this.formObj = {...this.formObj, smartcarlifeInfoId, goodsName, goodsImage, coverList: [goodsImage], minSellPrice, retailPrice} this.formObj = {...this.formObj, smartcarlifeInfoId, goodsName, goodsImage, coverList: [goodsImage], minSellPrice, retailPrice}
this.handleGoodsClose() this.handleGoodsClose()
this.validateField(['selectGoodsName','goodsInfoName'])
}, },
handleCarSeriesClose(){ handleCarSeriesClose(){
this.carDialogVisible = !this.carDialogVisible this.carDialogVisible = !this.carDialogVisible
...@@ -358,10 +368,12 @@ export default { ...@@ -358,10 +368,12 @@ export default {
} }
}) })
this.handleCarSeriesClose() this.handleCarSeriesClose()
this.validateField('carSeriesName')
}, },
confirmDialog(e){ confirmDialog(e){
this.merchantRequestList = e || [] this.merchantRequestList = e || []
this.closeDialog() this.closeDialog()
this.validateField('saleStore')
}, },
closeDialog(){ closeDialog(){
if(!this.merchantDialogVisible && !this.formObj.smartcarlifeInfoId){ if(!this.merchantDialogVisible && !this.formObj.smartcarlifeInfoId){
...@@ -372,11 +384,11 @@ export default { ...@@ -372,11 +384,11 @@ export default {
handleDel(row) { handleDel(row) {
const idx = this.merchantRequestList.findIndex(item => item.id == row.id) const idx = this.merchantRequestList.findIndex(item => item.id == row.id)
this.merchantRequestList.splice(idx, 1) this.merchantRequestList.splice(idx, 1)
// this.validateGoods()
}, },
selectCategory(e){ selectCategory(e){
this.formObj.associationClassifyFirstId = e?.parent?.id this.formObj.associationClassifyFirstId = e?.parent?.id
this.formObj.associationClassifySecondId = e?.data?.id this.formObj.associationClassifySecondId = e?.data?.id
this.validateField('categoryName')
}, },
getParams(){ getParams(){
let obj = JSON.parse(JSON.stringify(this.formObj)) let obj = JSON.parse(JSON.stringify(this.formObj))
......
...@@ -284,8 +284,8 @@ ...@@ -284,8 +284,8 @@
getParams() { getParams() {
var params = JSON.parse(JSON.stringify(this.tableSearchForm)) var params = JSON.parse(JSON.stringify(this.tableSearchForm))
if (this.tableSearchForm.createDate.length) { if (this.tableSearchForm.createDate.length) {
params.createdDateStrat = new Date(this.tableSearchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00' params.startCreatedDate = new Date(this.tableSearchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.createdDateEnd = new Date(this.tableSearchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59' params.endCreatedDate = new Date(this.tableSearchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
} }
return params return params
}, },
......
...@@ -358,6 +358,8 @@ export default { ...@@ -358,6 +358,8 @@ export default {
const {associationClassifyFirstId, associationClassifySecondId} = this.ClassifyInfo const {associationClassifyFirstId, associationClassifySecondId} = this.ClassifyInfo
this.searchForm.associationClassifyFirstId = associationClassifyFirstId this.searchForm.associationClassifyFirstId = associationClassifyFirstId
this.searchForm.associationClassifySecondId = associationClassifySecondId this.searchForm.associationClassifySecondId = associationClassifySecondId
this.searchForm.startCreatedDate = this.searchForm.createdDate ? this.searchForm.createdDate + ' 00:00:00' : ''
delete this.searchForm.createdDate
} }
// delete this.searchForm.createDate // delete this.searchForm.createDate
resolve() resolve()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!