Commit 369ce4bf authored by zs嵩's avatar zs嵩

主营类别重复校验

parents eee8b6cd 54b4d9d4
......@@ -228,8 +228,8 @@
</el-select>
</el-col>
<el-col :span="6">
<el-button type="primary" @click="form.products.splice(INDEX, 1)" style="padding: 10px" :disabled="!INDEX"><i class="el-icon-minus"></i></el-button>
<el-button type="danger" @click="handleAddProduct" style="padding: 10px" v-if="INDEX === form.products.length - 1"><i class="el-icon-plus"></i></el-button>
<el-button type="danger" @click="form.products.splice(INDEX, 1)" style="padding: 10px" :disabled="!INDEX"><i class="el-icon-minus"></i></el-button>
<el-button type="primary" @click="handleAddProduct" style="padding: 10px" v-if="INDEX === form.products.length - 1"><i class="el-icon-plus"></i></el-button>
</el-col>
</el-row>
</div>
......@@ -1021,6 +1021,11 @@ export default {
return true
}
})
let typeIds = this.form.products.map(item=>item.typeId)
if(new Set(typeIds).size !== typeIds.length) {
callback(new Error(this.$t("主营类别不能重复")))
return
}
if (!r) {
callback()
}
......
......@@ -164,7 +164,7 @@
<el-date-picker type="datetimerange" clearable v-model="firstDealTime" value-format="yyyy-MM-dd HH:mm:ss" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" />
</el-form-item>
<el-form-item :label="$t('创建时间')" v-show="showSearch">
<el-form-item :label="$t('创建时间')">
<el-date-picker type="datetimerange" clearable v-model="createTime" value-format="yyyy-MM-dd HH:mm:ss" range-separator="-" :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" />
</el-form-item>
<el-form-item style="padding-left: 20px">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment