fix:投放取消投放判断修改

This commit is contained in:
du.meimei
2025-03-19 10:08:41 +08:00
parent 6085fd4a3c
commit 1b411684dd
5 changed files with 42 additions and 19 deletions

View File

@@ -30,9 +30,9 @@
@change="getNode" @change="getNode"
allowClear> allowClear>
<a-select-option <a-select-option
v-for="item in channelList" v-for="(item,index) in channelList"
:value="item.appId" :value="item.appId"
:key="item.appId"> :key="index">
{{ item.appName }} {{ item.appName }}
</a-select-option> </a-select-option>
</a-select> </a-select>
@@ -52,12 +52,11 @@
style="border-radius: 4px" style="border-radius: 4px"
placeholder="请选择投放触点" placeholder="请选择投放触点"
allowClear allowClear
:not-found-content="fetching ? undefined : null"
> >
<a-select-option <a-select-option
v-for="item in nodeList" v-for="(item,index) in nodeList"
:value="item.appId" :value="item.appId"
:key="item.appId"> :key="index">
{{ item.appName }} {{ item.appName }}
</a-select-option> </a-select-option>
</a-select> </a-select>
@@ -134,8 +133,10 @@
style="margin-right: 10px" style="margin-right: 10px"
>查看</a> >查看</a>
<a @click="handleCopy(record)" style="margin-right: 10px">复制</a> <a @click="handleCopy(record)" style="margin-right: 10px">复制</a>
<a @click="delClick(record)" <a v-if="record.taskProgress === '3' || record.taskProgress === '4'"
:class="{ disabled: ![3,4].includes(record.taskProgress) }">取消投放</a> @click="delClick(record)"
>取消投放</a>
<a v-else disabled>取消投放</a>
</template> </template>
</a-table> </a-table>
</div> </div>
@@ -437,7 +438,7 @@ function getNode(){
// nodeList.value = [] // nodeList.value = []
// return // return
// } // }
ruleForm.value.appId = null // ruleForm.value.appId = null
let params = { let params = {
"pageNum": 1, "pageNum": 1,
"pageSize": 999, "pageSize": 999,
@@ -447,7 +448,7 @@ function getNode(){
} }
getNodeList(params).then(res=>{ getNodeList(params).then(res=>{
console.log(res); console.log(res);
nodeList.value.concat( res.data) nodeList.value = nodeList.value.concat( res.data)
}) })
} }
// 获取投放来源列表 // 获取投放来源列表

View File

@@ -123,7 +123,8 @@ const getContactList = async () => {
const res = await getTeamSigns({ const res = await getTeamSigns({
"findType": "NODE", "findType": "NODE",
"parentAppId": props.channel.appId, "parentAppId": props.channel.appId,
...formState.value ...formState.value,
appType:'APPLICATION'
// "parentAppId": '' // "parentAppId": ''
}); });
dataSource.value = res.data; dataSource.value = res.data;

View File

@@ -6,10 +6,10 @@
:label-col="labelCol" :label-col="labelCol"
:wrapper-col="wrapperCol"> :wrapper-col="wrapperCol">
<a-form-item label="投放名称" name="launchName"> <a-form-item label="投放名称" name="launchName">
<a-input v-model:value="formState.launchName" placeholder="请输入投放名称" :maxlength="30"/> <a-input v-model:value="formState.launchName" placeholder="请输入投放名称" showCount :maxlength="30"/>
</a-form-item> </a-form-item>
<a-form-item label="投放描述" name="launchMessage"> <a-form-item label="投放描述" name="launchMessage">
<a-textarea v-model:value="formState.launchMessage" :rows="4" :maxlength="150" <a-textarea v-model:value="formState.launchMessage" :rows="4" :maxlength="150" showCount
placeholder="请描述您本次投放的需求,包含投放位置、投放时段等,运营会根据您的描述配置投放任务"/> placeholder="请描述您本次投放的需求,包含投放位置、投放时段等,运营会根据您的描述配置投放任务"/>
</a-form-item> </a-form-item>
<a-form-item label="投放应用" name="desc"> <a-form-item label="投放应用" name="desc">
@@ -71,7 +71,6 @@ const formState = ref({
launchName: '', launchName: '',
launchMessage: '' launchMessage: ''
}); });
const isHasLink = ref(false);
const rules = { const rules = {
launchName: [ launchName: [
@@ -203,7 +202,6 @@ watch(() => props.channel, (newVal) => {
launchMessage: '' launchMessage: ''
}; };
dataSource.value = []; dataSource.value = [];
isHasLink.value = false;
} }
}); });
</script> </script>

View File

@@ -36,7 +36,7 @@
</template> </template>
<script setup> <script setup>
import { defineProps, onMounted, ref, watch } from 'vue'; import { defineProps, onMounted, ref, watch } from 'vue';
import { getTeamSigns, savePublish } from '@/api/accurate'; import { getTeamSigns, savePublish,getPublishDetail } from '@/api/accurate';
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
import { useRoute,useRouter } from 'vue-router'; import { useRoute,useRouter } from 'vue-router';
const route = useRoute() const route = useRoute()
@@ -82,6 +82,7 @@ const getContactList = async () => {
const res = await getTeamSigns({ const res = await getTeamSigns({
"findType": "NODE", "findType": "NODE",
"parentAppId": props.channel.appId, "parentAppId": props.channel.appId,
appType:'APPLICATION'
}); });
console.log(res); console.log(res);
applicationList.value = res.data; applicationList.value = res.data;
@@ -111,7 +112,7 @@ async function submitData(){
window.location.href = res.data.linkUrl; window.location.href = res.data.linkUrl;
} }
message.success('提交成功'); message.success('提交成功');
cancel() onCancel()
} else { } else {
message.error(res.msg || '提交失败'); message.error(res.msg || '提交失败');
} }
@@ -131,8 +132,31 @@ watch(() => props.channel, (newVal) => {
if (newVal.appId === 'SHOPPING_GUIDE'){ if (newVal.appId === 'SHOPPING_GUIDE'){
getContactList() getContactList()
} }
});
// 获取详情数据
const getDetail = async (id) => {
try {
const res = await getPublishDetail({ surveyPublishId: id });
if (res.data) {
// 填充表单数据
formState.value = {
launchName: res.data.launchName,
launchMessage: res.data.launchMessage
};
}
} catch (error) {
console.error('获取详情失败:', error);
}
};
// 组件挂载时检查路由参数
onMounted(() => {
const { record } = route.query;
if (record) {
const recordObj = JSON.parse(decodeURIComponent(record));
if (recordObj.surveyPublishId) {
getDetail(recordObj.surveyPublishId);
}
}
}); });
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

View File

@@ -171,7 +171,6 @@ async function getChannels(page = 1, size = pagination.value.pageSize) {
page, page,
per_page: size, per_page: size,
app_name: '', app_name: '',
appType:'ACTIVITY'
}); });
loading.value = false; loading.value = false;