Commit 61574e7b authored by zhengke's avatar zhengke

销售 另存为 模版

parent 0a7d6f3b
...@@ -74,16 +74,50 @@ ...@@ -74,16 +74,50 @@
<IconDownload class="icon" /> <IconDownload class="icon" />
</div> </div>
<el-button type="primary" <el-button type="primary"
v-if="userInfo.IsEditTripTemplate==1||ConfigId>0||model==2" v-if="(userInfo.IsEditTripTemplate==1||ConfigId>0)&&model!=2"
size="small" :loading="datas.loading" size="small" :loading="datas.loading"
@click="setTemplate" style="color: #ffff;margin-left: 10px;"> @click="setTemplate" style="color: #ffff;margin-left: 10px;">
<template v-if="(userInfo.IsEditTripTemplate==1&&model==1)||model==2"> <template v-if="userInfo.IsEditTripTemplate==1&&model==1">
保存模板 保存模板
</template> </template>
<template v-if="(ConfigId>0&&model!=2)"> <template v-if="(ConfigId>0&&model!=2)">
保存行程 保存行程
</template> </template>
</el-button> </el-button>
<template v-if="model==2">
<Popover trigger="click" placement="bottom-start" v-model:value="sellSaveVisible">
<template #content>
<div>
<el-button type="primary"
size="small" :loading="datas.loading"
style="color: #ffff;margin-left: 10px;"
@click="setTemplate(0)">
保存模板
</el-button>
</div>
<div class="q-mt-md">
<el-button type="primary"
size="small" :loading="datas.loading"
style="color: #ffff;margin-left: 10px;"
@click="setTemplate(1)">
另存模板
</el-button>
</div>
</template>
<el-button v-if="searchData.sellId>0" type="primary"
size="small" :loading="datas.loading"
style="color: #ffff;margin-left: 10px;">
保存
</el-button>
</Popover>
<el-button v-if="!searchData.sellId" type="primary"
size="small" :loading="datas.loading"
style="color: #ffff;margin-left: 10px;"
@click="setTemplate(0)">
保存模板
</el-button>
</template>
</div> </div>
<Drawer <Drawer
...@@ -153,6 +187,7 @@ const hotkeyDrawerVisible = ref(false) ...@@ -153,6 +187,7 @@ const hotkeyDrawerVisible = ref(false)
const editingTitle = ref(false) const editingTitle = ref(false)
const titleInputRef = ref<InstanceType<typeof Input>>() const titleInputRef = ref<InstanceType<typeof Input>>()
const titleValue = ref('') const titleValue = ref('')
const sellSaveVisible = ref(false)
const { setNewDatasList } = useEditor() const { setNewDatasList } = useEditor()
...@@ -234,16 +269,19 @@ const setNewDatas = (type,i) => { ...@@ -234,16 +269,19 @@ const setNewDatas = (type,i) => {
CoverImgStore.setCoverImg(null) CoverImgStore.setCoverImg(null)
} }
} }
// 导入PSD // 导入PSD6
const UploadPsdHandler = () => { const UploadPsdHandler = () => {
psdVisibleStatus.value = true psdVisibleStatus.value = true
} }
// 销售新增修改模版 // 销售新增修改模版
const SetSellTemplate = async () => { const SetSellTemplate = async (type) => {
try { try {
let Id = 0
if(searchData.value.sellId&&!type) Id = searchData.value.sellId
if(type==1) Id = 0
let queryMsg = { let queryMsg = {
Id: searchData.value.sellId?searchData.value.sellId:0, Id: Id,
TempId: queryObj.value.TempId, TempId: queryObj.value.TempId,
TempData: queryObj.value.TempData, TempData: queryObj.value.TempData,
Title: queryObj.value.Title Title: queryObj.value.Title
...@@ -255,7 +293,10 @@ const SetSellTemplate = async () => { ...@@ -255,7 +293,10 @@ const SetSellTemplate = async () => {
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
}) })
sellSaveVisible.value = false
setTimeout(()=>{
SalesEditorStore.setSalesEditor(0) SalesEditorStore.setSalesEditor(0)
},100)
}else{ }else{
ElMessage({ ElMessage({
showClose: true, showClose: true,
...@@ -396,7 +437,7 @@ const SetTripTemplateConfig = async () => { ...@@ -396,7 +437,7 @@ const SetTripTemplateConfig = async () => {
} }
// 保存 // 保存
const setTemplate = async () =>{ const setTemplate = async (type) =>{
queryObj.value.Title = title.value queryObj.value.Title = title.value
datas.loading = true datas.loading = true
if(SourceLoading.value) setNewDatasList(datas.DataSource) if(SourceLoading.value) setNewDatasList(datas.DataSource)
...@@ -465,7 +506,7 @@ const setTemplate = async () =>{ ...@@ -465,7 +506,7 @@ const setTemplate = async () =>{
}else if(ConfigId.value&&model.value!=2){ }else if(ConfigId.value&&model.value!=2){
await SetTripTemplateConfig() await SetTripTemplateConfig()
}else if(model.value==2){ }else if(model.value==2){
await SetSellTemplate() await SetSellTemplate(type)
} }
} }
......
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