Commit 90da43e5 by zhangquan

修复bug

1 parent 21eea0ac
<!-- 搜索 -->
<template>
<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">
<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">
......
......@@ -6,8 +6,13 @@
:close-on-click-modal="false"
@onOk="handleConfirm"
@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 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>
</GLDialog>
</template>
......@@ -16,8 +21,10 @@ export default {
name: 'selectCarSeriesDialog',
data() {
return {
curbrandName: '',
checkedList:[],
carSeriesList: []
carSeriesList: [],
filterBrandList: []
}
},
props: {
......@@ -29,6 +36,14 @@ export default {
type: Array
}
},
watch:{
curbrandName:{
handler(nVal, oVal){
this.filterBrandList = this.carSeriesList.filter(item => item.name.indexOf(nVal)>-1)
},
deep: true
}
},
created(){
this.checkedList = this?.listData.map(item => item.id)
this.getCarSeriesList()
......@@ -64,4 +79,13 @@ export default {
height: 32px;
line-height: 32px;
}
.search-wrap{
margin-bottom: 12px;
/deep/ .el-input {
&, .el-input__inner{
height: 36px;
width: 432px;
}
}
}
</style>
\ No newline at end of file
......@@ -312,6 +312,15 @@ export default {
}
},
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){
let depositPrice = this.formObj.paymentType==1 ? 0 : this.formObj.depositPrice
if(this.formObj.paymentType==1) return '--'
......@@ -335,6 +344,7 @@ export default {
retailPrice = retailPrice ? Number(Number(retailPrice/100).toFixed(2)) : 0
this.formObj = {...this.formObj, smartcarlifeInfoId, goodsName, goodsImage, coverList: [goodsImage], minSellPrice, retailPrice}
this.handleGoodsClose()
this.validateField(['selectGoodsName','goodsInfoName'])
},
handleCarSeriesClose(){
this.carDialogVisible = !this.carDialogVisible
......@@ -358,10 +368,12 @@ export default {
}
})
this.handleCarSeriesClose()
this.validateField('carSeriesName')
},
confirmDialog(e){
this.merchantRequestList = e || []
this.closeDialog()
this.validateField('saleStore')
},
closeDialog(){
if(!this.merchantDialogVisible && !this.formObj.smartcarlifeInfoId){
......@@ -372,11 +384,11 @@ export default {
handleDel(row) {
const idx = this.merchantRequestList.findIndex(item => item.id == row.id)
this.merchantRequestList.splice(idx, 1)
// this.validateGoods()
},
selectCategory(e){
this.formObj.associationClassifyFirstId = e?.parent?.id
this.formObj.associationClassifySecondId = e?.data?.id
this.validateField('categoryName')
},
getParams(){
let obj = JSON.parse(JSON.stringify(this.formObj))
......
......@@ -284,8 +284,8 @@
getParams() {
var params = JSON.parse(JSON.stringify(this.tableSearchForm))
if (this.tableSearchForm.createDate.length) {
params.createdDateStrat = 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.startCreatedDate = new Date(this.tableSearchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endCreatedDate = new Date(this.tableSearchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
return params
},
......
......@@ -358,6 +358,8 @@ export default {
const {associationClassifyFirstId, associationClassifySecondId} = this.ClassifyInfo
this.searchForm.associationClassifyFirstId = associationClassifyFirstId
this.searchForm.associationClassifySecondId = associationClassifySecondId
this.searchForm.startCreatedDate = this.searchForm.createdDate ? this.searchForm.createdDate + ' 00:00:00' : ''
delete this.searchForm.createdDate
}
// delete this.searchForm.createDate
resolve()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!