|
@@ -23,17 +23,17 @@
|
|
|
</el-select>
|
|
|
<div v-else>{{this.downList0.some(i => i.id === form.sceneId) ? this.downList0.find(i => i.id === form.sceneId).sceneName : ''}}</div>
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-if="!form.sceneId||form.sceneId === 1" label="邮件内容" prop="templateIntroduce">
|
|
|
+ <el-form-item v-if="form.sceneId === 1||form.sceneId === 4" label="邮件内容" prop="templateIntroduce">
|
|
|
<el-input v-if="state !== 2" type="textarea" :rows="4" resize="none" placeholder="请输入邮件内容" v-model="form.templateIntroduce" maxlength="1024" show-word-limit></el-input>
|
|
|
<div v-else>{{form.templateIntroduce}}</div>
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-if="!form.sceneId||form.sceneId !== 2" label="关联岗位" prop="processId">
|
|
|
+ <el-form-item v-if="form.sceneId == 1||form.sceneId == 3" label="关联岗位" prop="processId">
|
|
|
<el-select v-if="state !== 2" filterable clearable v-model="form.processId" placeholder="请选择关联岗位">
|
|
|
<el-option v-for="item in downList1" :key="item.id" :label="item.processName" :value="item.id"></el-option>
|
|
|
</el-select>
|
|
|
<div v-else>{{this.downList1.some(i => i.id === form.processId) ? this.downList1.find(i => i.id === form.processId).processName : ''}}</div>
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-if="!form.sceneId||form.sceneId !== 1" label="关联表单" prop="formId">
|
|
|
+ <el-form-item v-if="form.sceneId == 2||form.sceneId == 3" label="关联表单" prop="formId">
|
|
|
<el-select v-if="state !== 2" filterable clearable v-model="form.formId" placeholder="请选择关联表单">
|
|
|
<el-option v-for="item in downList2" :key="item.id" :label="item.formName" :value="item.id"></el-option>
|
|
|
</el-select>
|
|
@@ -258,7 +258,7 @@ export default {
|
|
|
item.sceneName = this.downList0.some(i => i.id === item.sceneId) ? this.downList0.find(i => i.id === item.sceneId).sceneName : ''
|
|
|
item.processName = this.downList1.some(i => i.id === item.processId) ? this.downList1.find(i => i.id === item.processId).processName : ''
|
|
|
item.formName = this.downList2.some(i => i.id === item.formId) ? this.downList2.find(i => i.id === item.formId).formName : ''
|
|
|
- item.type = !(item.sceneId > 1)
|
|
|
+ item.type = !(item.sceneId !== 1 && item.sceneId !== 4)
|
|
|
return item
|
|
|
})
|
|
|
this.restaurants = res.list.map(item => ({ value: item.templateName }))
|
|
@@ -345,7 +345,24 @@ export default {
|
|
|
? '/template/updateTemplate'
|
|
|
: '/template/saveTemplate'
|
|
|
let { id, templateName, sceneId, processId, formId, templateIntroduce, companyId } = this.form
|
|
|
- let reqdata = sceneId === 1 ? { id, templateName, sceneId, companyId, templateIntroduce, processId } : sceneId === 2 ? { id, templateName, sceneId, companyId, formId } : { id, templateName, sceneId, companyId, processId, formId }
|
|
|
+ let reqdata
|
|
|
+ switch (sceneId) {
|
|
|
+ case 1:
|
|
|
+ reqdata = { id, templateName, sceneId, companyId, templateIntroduce, processId }
|
|
|
+ break
|
|
|
+ case 2:
|
|
|
+ reqdata = { id, templateName, sceneId, companyId, formId }
|
|
|
+ break
|
|
|
+ case 3:
|
|
|
+ reqdata = { id, templateName, sceneId, companyId, processId, formId }
|
|
|
+ break
|
|
|
+ case 4:
|
|
|
+ reqdata = { id, templateName, sceneId, companyId, templateIntroduce }
|
|
|
+ break
|
|
|
+ default:
|
|
|
+ reqdata = {}
|
|
|
+ break
|
|
|
+ }
|
|
|
this.$api
|
|
|
.post(url, {
|
|
|
reqdata
|