|
@@ -269,7 +269,7 @@
|
|
|
:projectId.sync="projectIdDownLoad"
|
|
|
ref="selectTableProjectDownLoad"
|
|
|
></selectTableProject>
|
|
|
- <a-button type="primary" icon="plus" @click="handleOkDownLoad" style="margin-left:85px;margin-bottom:15px"
|
|
|
+ <a-button type="primary" @click="handleOkDownLoad" style="margin-left:85px;margin-bottom:15px"
|
|
|
>导出单品模板</a-button
|
|
|
>
|
|
|
<a-form :form="formDownLoad">
|
|
@@ -311,9 +311,10 @@
|
|
|
>
|
|
|
<a-button type="primary" @click="addOneItem" style="margin-bottom:10px">添加单品信息</a-button>
|
|
|
<a-form-model ref="ruleForm" :model="addItemForm" v-bind="formItemLayout">
|
|
|
- <a-collapse accordion v-model="activeKey" ref="collapse">
|
|
|
+ <a-collapse accordion v-model="activeKey" ref="collapse" v-if="visibleAddItem">
|
|
|
<template v-for="(item, index) in addItemForm.items">
|
|
|
<a-collapse-panel
|
|
|
+ :forceRender="true"
|
|
|
:header="item.itemName"
|
|
|
style="background: #f9f9fa;border-radius: 4px;margin-bottom:15px;overflow: hidden;border: 1px solid #d9d9d9;"
|
|
|
>
|
|
@@ -326,7 +327,7 @@
|
|
|
label="项目"
|
|
|
ref="projectId"
|
|
|
:prop="'items.' + index + '.projectId'"
|
|
|
- :rules="[{ required: true, message: '请选择项目', trigger: 'blur' }]"
|
|
|
+ :rules="[{ required: true, message: '请选择项目', trigger: 'change' }]"
|
|
|
>
|
|
|
<!-- <a-input v-model="item.projectId" placeholder="请输入规则名称" /> -->
|
|
|
<Treeselect v-model="item.projectId" style="width:100%" />
|
|
@@ -337,7 +338,7 @@
|
|
|
:prop="'items.' + index + '.keyword'"
|
|
|
:rules="[
|
|
|
{ required: true, message: '请填写素材关键字', trigger: 'blur' },
|
|
|
- { min: 1, message: '长度不得小于1', trigger: 'blur' }
|
|
|
+ { min: 1, max: 15, message: '长度不得小于1,最大长度为15', trigger: 'blur' }
|
|
|
]"
|
|
|
>
|
|
|
<a-input v-model="item.keyword" placeholder="请输入素材关键字" />
|
|
@@ -348,7 +349,7 @@
|
|
|
:prop="'items.' + index + '.itemName'"
|
|
|
:rules="[
|
|
|
{ required: true, message: '请填写单品名称', trigger: 'blur' },
|
|
|
- { min: 1, message: '长度不得小于1', trigger: 'blur' }
|
|
|
+ { min: 1, max: 10, message: '长度不得小于1,最大长度为10', trigger: 'blur' }
|
|
|
]"
|
|
|
>
|
|
|
<a-input v-model="item.itemName" placeholder="请输入单品名称" />
|
|
@@ -547,6 +548,10 @@ export default {
|
|
|
this.keyWord = undefined
|
|
|
},
|
|
|
bidChangeOk(record) {
|
|
|
+ if (this.keyWord.length > 15) {
|
|
|
+ this.$message.error('素材关键字最多15个字')
|
|
|
+ return
|
|
|
+ }
|
|
|
record.visible = false
|
|
|
const paramsData = {
|
|
|
id: record.id,
|
|
@@ -619,7 +624,7 @@ export default {
|
|
|
if (!result) {
|
|
|
this.$message.error('不支持该文件类型')
|
|
|
this.loadDisabled = false
|
|
|
- return false
|
|
|
+ return Promise.reject()
|
|
|
}
|
|
|
},
|
|
|
...mapGetters(['userInfo']),
|
|
@@ -659,6 +664,7 @@ export default {
|
|
|
if (res.success) {
|
|
|
this.visibleAddItem = false
|
|
|
this.addItemForm.items = [{ projectId: '', keyWord: '', itemName: '默认名称-单品1' }]
|
|
|
+ this.handleResetForm()
|
|
|
} else {
|
|
|
this.$message.error(res.message)
|
|
|
}
|
|
@@ -832,6 +838,14 @@ export default {
|
|
|
this.$refs.selectTableProject.keyValue = ''
|
|
|
this.$refs.selectTableProject.getData(n)
|
|
|
}
|
|
|
+ },
|
|
|
+ visibleAddItem: function(n, o) {
|
|
|
+ if (!n) {
|
|
|
+ this.addItemForm = {
|
|
|
+ items: [{ projectId: '', keyWord: '', itemName: '默认名称-单品1' }]
|
|
|
+ }
|
|
|
+ this.addItemForm.items[0].projectId = ''
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
computed: {
|