|
@@ -405,7 +405,12 @@
|
|
|
|
|
|
|
|
<!-- SOP 序列模板 -->
|
|
<!-- SOP 序列模板 -->
|
|
|
<div class="sop-section">
|
|
<div class="sop-section">
|
|
|
- <h5><i class="fas fa-magic"></i> SOP 序列模板</h5>
|
|
|
|
|
|
|
+ <div style="display: flex;justify-content: space-between;">
|
|
|
|
|
+ <h5><i class="fas fa-magic"></i> SOP 序列模板</h5>
|
|
|
|
|
+ <button class="btn-link" @click="editSopTemplate('add')" v-if="sopTemplates.length == 0">
|
|
|
|
|
+ 添加序列
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
<div class="sop-grid">
|
|
<div class="sop-grid">
|
|
|
<div v-for="sop in sopTemplates" :key="sop.id" class="sop-card"
|
|
<div v-for="sop in sopTemplates" :key="sop.id" class="sop-card"
|
|
|
:class="{ selected: newCampaign.sopTemplate === sop.id }"
|
|
:class="{ selected: newCampaign.sopTemplate === sop.id }"
|
|
@@ -425,7 +430,7 @@
|
|
|
<div class="sop-preview" v-if="selectedSopTemplate">
|
|
<div class="sop-preview" v-if="selectedSopTemplate">
|
|
|
<div class="sop-preview-header">
|
|
<div class="sop-preview-header">
|
|
|
<span>{{ selectedSopTemplate.name }} - 序列步骤预览</span>
|
|
<span>{{ selectedSopTemplate.name }} - 序列步骤预览</span>
|
|
|
- <button class="btn-link" @click="editSopTemplate">
|
|
|
|
|
|
|
+ <button class="btn-link" @click="editSopTemplate('edit')">
|
|
|
自定义
|
|
自定义
|
|
|
</button>
|
|
</button>
|
|
|
</div>
|
|
</div>
|
|
@@ -723,7 +728,7 @@
|
|
|
<button class="btn btn-primary" @click="addNewSop">
|
|
<button class="btn btn-primary" @click="addNewSop">
|
|
|
<i class="fas fa-save"></i> 保存为新序列
|
|
<i class="fas fa-save"></i> 保存为新序列
|
|
|
</button>
|
|
</button>
|
|
|
- <button class="btn btn-primary" @click="saveCustomSop">
|
|
|
|
|
|
|
+ <button class="btn btn-primary" @click="saveCustomSop" v-if="sopType != 'add'">
|
|
|
<i class="fas fa-save"></i> 保存自定义SOP
|
|
<i class="fas fa-save"></i> 保存自定义SOP
|
|
|
</button>
|
|
</button>
|
|
|
</div>
|
|
</div>
|
|
@@ -910,6 +915,11 @@
|
|
|
ElMessage.error('目标客户数量限500个以内')
|
|
ElMessage.error('目标客户数量限500个以内')
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
+ if (!newCampaign.value.sopTemplate) {
|
|
|
|
|
+ currentStep.value = 4
|
|
|
|
|
+ ElMessage.error('请关联SOP序列模板')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
try {
|
|
try {
|
|
|
loading.value = true
|
|
loading.value = true
|
|
|
const typeMap = { prospect: 1, nurture: 2, reactivate: 3, promote: 4, seasonal: 5, exhibition: 6, other: 7 }
|
|
const typeMap = { prospect: 1, nurture: 2, reactivate: 3, promote: 4, seasonal: 5, exhibition: 6, other: 7 }
|
|
@@ -1031,8 +1041,15 @@
|
|
|
const showCustomSopModal = ref(false)
|
|
const showCustomSopModal = ref(false)
|
|
|
const selectedSopTemplate = computed(() => sopTemplates.value.find(s => s.id === newCampaign.value.sopTemplate))
|
|
const selectedSopTemplate = computed(() => sopTemplates.value.find(s => s.id === newCampaign.value.sopTemplate))
|
|
|
const customSopData = ref({})
|
|
const customSopData = ref({})
|
|
|
- const editSopTemplate = () => {
|
|
|
|
|
- customSopData.value = JSON.parse(JSON.stringify(selectedSopTemplate.value))
|
|
|
|
|
|
|
+ const sopType = ref('')
|
|
|
|
|
+ const editSopTemplate = (type) => {
|
|
|
|
|
+ sopType.value = type
|
|
|
|
|
+ customSopData.value = type == 'add' ? {
|
|
|
|
|
+ name: '',
|
|
|
|
|
+ details: [
|
|
|
|
|
+ { name: '', days: 1, type: 'email' }
|
|
|
|
|
+ ]
|
|
|
|
|
+ } : JSON.parse(JSON.stringify(selectedSopTemplate.value))
|
|
|
showCustomSopModal.value = true
|
|
showCustomSopModal.value = true
|
|
|
}
|
|
}
|
|
|
|
|
|