Commit 61574e7b authored by zhengke's avatar zhengke

销售 另存为 模版

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