update
This commit is contained in:
@@ -777,6 +777,13 @@ const admin = {
|
||||
data: {id},
|
||||
});
|
||||
},
|
||||
plTaskChildren: async (ids) => {
|
||||
return request({
|
||||
url: '/admin/TaskChildren/plTaskChildren',
|
||||
method: Method.POST,
|
||||
data: {ids},
|
||||
});
|
||||
},
|
||||
}
|
||||
|
||||
export default admin;
|
||||
|
||||
@@ -9,7 +9,8 @@ import AddMaterial from "../../pages/merchant/components/AddMaterial.vue";
|
||||
import AddComment from "../../pages/merchant/components/AddComment.vue";
|
||||
import RejectTaskModal from "../../pages/manage/pages/manage-reward-mission/components/RejectTaskModal.vue";
|
||||
|
||||
const emits = defineEmits(['success']);
|
||||
const emits = defineEmits(['success', 'checkChange']);
|
||||
const checked = ref(false);
|
||||
const selecdKey = ref([]);
|
||||
const {id} = defineProps({
|
||||
id: {
|
||||
@@ -44,43 +45,20 @@ watch(
|
||||
const passTaskChildren = async () => {
|
||||
console.log(selecdKey.value);
|
||||
|
||||
const pro_list = [];
|
||||
if (selecdKey.value.length === 0) {
|
||||
pro_list.push(new Promise((reactive, reject) => {
|
||||
Api.admin.passChildrenMaterial(detail.content[activeKey.value]).then((res) => {
|
||||
reactive(res);
|
||||
}).catch((err) => {
|
||||
reject(err);
|
||||
})
|
||||
}));
|
||||
}
|
||||
selecdKey.value.forEach(v => {
|
||||
pro_list.push(new Promise((reactive, reject) => {
|
||||
Api.admin.passChildrenMaterial(v).then((res) => {
|
||||
reactive(res);
|
||||
}).catch((err) => {
|
||||
reject(err);
|
||||
})
|
||||
}));
|
||||
})
|
||||
|
||||
const res = await Promise.all(pro_list);
|
||||
|
||||
let flag = true;
|
||||
|
||||
for (const v of res) {
|
||||
if (v.code !== 1) {
|
||||
Message.warning(v.msg)
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (flag) {
|
||||
Message.success(res[0].msg);
|
||||
const {msg} = await Api.admin.passChildrenMaterial({
|
||||
id: detail.id,
|
||||
data: detail.content.map(v => ({
|
||||
id: v.id,
|
||||
title: v.title,
|
||||
content: v.content,
|
||||
tags: v.tags,
|
||||
material: v.material,
|
||||
}))
|
||||
});
|
||||
Message.success(msg);
|
||||
visible.value = false;
|
||||
emits('success');
|
||||
}
|
||||
}
|
||||
|
||||
const refuseTaskChildren = async () => {
|
||||
const {code, msg} = await Api.admin.refuseTaskChildren(id);
|
||||
@@ -88,6 +66,14 @@ const refuseTaskChildren = async () => {
|
||||
visible.value = false;
|
||||
emits('success');
|
||||
}
|
||||
|
||||
watch(
|
||||
() => checked.value,
|
||||
(val) => {
|
||||
emits('checkChange', val)
|
||||
},
|
||||
{deep: true}
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -172,12 +158,7 @@ const refuseTaskChildren = async () => {
|
||||
|
||||
<template #footer>
|
||||
<div class="flex items-center gap-[8px]">
|
||||
<a-checkbox-group v-model:model-value="selecdKey">
|
||||
<template v-for="(item, index) in detail.content" :key="item">
|
||||
<a-checkbox v-show="activeKey === index" :value="item">选中
|
||||
</a-checkbox>
|
||||
</template>
|
||||
</a-checkbox-group>
|
||||
<a-checkbox v-model:model-value="checked">选中</a-checkbox>
|
||||
|
||||
<template v-if="detail.check_status === 0">
|
||||
<a-button @click="passTaskChildren" type="primary" class="ml-auto">通过
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script setup>
|
||||
import {nextTick, ref, useTemplateRef, watch} from "vue";
|
||||
import {Message} from "@arco-design/web-vue";
|
||||
import {debounce} from "lodash";
|
||||
|
||||
const {limit} = defineProps({
|
||||
limit: {
|
||||
@@ -25,23 +26,22 @@ watch(
|
||||
{deep: true}
|
||||
)
|
||||
|
||||
const changeInput = (e) => {
|
||||
if (e.match(/#(\S+?)(?=\s)/g)) {
|
||||
if (modelValue.value === void 0) {
|
||||
}
|
||||
modelValue.value.push(...e.match(/#(\S+?)(?=\s)/g).map(tag => tag.slice(1)));
|
||||
const changeInput = debounce((value) => {
|
||||
const temp = value.split('#').filter(Boolean).map(item => `#${item}`);
|
||||
if (temp.length > 0) {
|
||||
input.value = null;
|
||||
nextTick(() => {
|
||||
inputTagRef.value.blur();
|
||||
nextTick(() => {
|
||||
inputTagRef.value.focus();
|
||||
})
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
modelValue.value.push(...temp);
|
||||
}
|
||||
}, 2000);
|
||||
|
||||
const pressEnter = () => {
|
||||
modelValue.value = modelValue.value.filter(v => v.match(/#(\S+?)(?=\s)/g));
|
||||
modelValue.value.push(...input.value.split('#').filter(Boolean).map(item => `#${item}`));
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup>
|
||||
import {reactive} from "vue";
|
||||
import {reactive, ref} from "vue";
|
||||
import Filter from "../../../../components/Filter/index.vue";
|
||||
import useTableQuery from "../../../../hooks/useTableQuery.js";
|
||||
import Api from "../../../../api/index.js";
|
||||
@@ -72,7 +72,12 @@ const FilterConfig = [
|
||||
placeholder: '请输入达人任务编号'
|
||||
},
|
||||
];
|
||||
|
||||
const selectedKeys = ref([]);
|
||||
const rowSelection = reactive({
|
||||
type: 'checkbox',
|
||||
showCheckedAll: true,
|
||||
onlyCurrent: false,
|
||||
});
|
||||
const po = reactive({});
|
||||
const vo = reactive({
|
||||
page: '',
|
||||
@@ -100,6 +105,21 @@ const refuseTaskChildren = async (id) => {
|
||||
if (code === 1) Message.success(msg);
|
||||
await fetchData();
|
||||
}
|
||||
|
||||
const checkChange = (checked, record) => {
|
||||
console.log(checked, record);
|
||||
if (checked) {
|
||||
selectedKeys.value.push(record.id);
|
||||
} else {
|
||||
selectedKeys.value = selectedKeys.value.filter(item => item !== record.id);
|
||||
}
|
||||
}
|
||||
|
||||
const plTaskChildren = async () => {
|
||||
const {msg} = await Api.admin.plTaskChildren(selectedKeys.value);
|
||||
Message.success(msg);
|
||||
await fetchData();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -111,8 +131,14 @@ const refuseTaskChildren = async (id) => {
|
||||
:config="FilterConfig">
|
||||
</Filter>
|
||||
|
||||
<div class="mb-[24px]">
|
||||
<a-button type="primary">批量通过</a-button>
|
||||
</div>
|
||||
|
||||
<a-table
|
||||
:data="vo.rows"
|
||||
v-model:selectedKeys="selectedKeys"
|
||||
:row-selection="rowSelection"
|
||||
@page-change="(e) => pagination.current = e"
|
||||
:pagination="pagination"
|
||||
:loading="loading"
|
||||
@@ -135,7 +161,8 @@ const refuseTaskChildren = async (id) => {
|
||||
</template>
|
||||
<template v-slot:action="{record}">
|
||||
<div class="flex items-center gap-[20px] justify-between">
|
||||
<PreviewTaskModal :id="record.id" @success="fetchData"></PreviewTaskModal>
|
||||
<PreviewTaskModal :id="record.id" @success="fetchData"
|
||||
@checkChange="checkChange($event, record)"></PreviewTaskModal>
|
||||
<a-popconfirm content="确定通过?" @ok="passTaskChildren(record.id)">
|
||||
<a-link :disabled="record.check_status !== 0 && record.check_status !== -1" :hoverable="false"
|
||||
status="success">通过
|
||||
|
||||
@@ -57,7 +57,7 @@ const next = async () => {
|
||||
<div class="px-[30px] py-[16px]">
|
||||
<a-config-provider size="mini">
|
||||
<refuse-modal-form1 :taskId="taskId" ref="formRef" v-if="step === 1"></refuse-modal-form1>
|
||||
<refuse-modal-form2 ref="formRef" v-if="step === 2"></refuse-modal-form2>
|
||||
<refuse-modal-form2 ref="formRef" v-if="step === 2" :taskId="task.task_id"></refuse-modal-form2>
|
||||
</a-config-provider>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -18,7 +18,10 @@ const success = () => {
|
||||
<a-result title="创建成功" subtitle="任务创建成功" status="success">
|
||||
<template #extra>
|
||||
<a-space>
|
||||
<a-button type="secondary" @click="toPath('/home/task-center/reward-mission')">查看任务</a-button>
|
||||
<a-button type="secondary"
|
||||
@click="toPath(!SystemStore.isRoot ? '/home/task-center/reward-mission' : '/home/manage-reward-mission/task-review')">
|
||||
查看任务
|
||||
</a-button>
|
||||
<a-button type="primary" @click="emits('init')" v-if="!SystemStore.isRoot">再次创建</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
@@ -22,10 +22,10 @@ const formRef = useTemplateRef('formRef');
|
||||
const rules = reactive({
|
||||
refund_images: [{
|
||||
required: true,
|
||||
message: '其他原因截图不完整',
|
||||
message: '拒绝原因截图不完整',
|
||||
validator: (value, callback) => {
|
||||
if (value.length === 0) {
|
||||
callback('原因截图不能为空');
|
||||
callback('拒绝原因截图');
|
||||
}
|
||||
}
|
||||
}],
|
||||
|
||||
@@ -4,7 +4,15 @@ import Api from "../../../../../api/index.js";
|
||||
import XImage from "../../../../../components/XImage/Index.vue";
|
||||
import UploadButton from "../../../../../components/upload/UploadButton.vue";
|
||||
import {Message} from "@arco-design/web-vue";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
const {taskId} = defineProps({
|
||||
taskId: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
});
|
||||
const taskDetail = reactive({});
|
||||
const Suggestion = reactive([]);
|
||||
const form = reactive({
|
||||
is_suggestion: 1,
|
||||
@@ -48,8 +56,27 @@ onMounted(() => {
|
||||
Suggestion.length = 0;
|
||||
Suggestion.push(...data);
|
||||
});
|
||||
Api.merchant.getTaskInfo(taskId).then(({data}) => {
|
||||
Object.assign(taskDetail, data);
|
||||
console.log(taskDetail);
|
||||
});
|
||||
})
|
||||
|
||||
function range(start, end) {
|
||||
const result = [];
|
||||
for (let i = start; i < end; i++) {
|
||||
result.push(i);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
const getDisabledTime = (date) => {
|
||||
return {
|
||||
disabledHours: () => range(0, dayjs(taskDetail.start_time).hour()),
|
||||
disabledMinutes: () => range(0, dayjs(taskDetail.start_time).add(1, 'minute').minute()),
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
success,
|
||||
});
|
||||
@@ -110,6 +137,8 @@ defineExpose({
|
||||
<a-radio :value="1">
|
||||
是 请最晚于
|
||||
<a-date-picker
|
||||
:disabledDate="(current) => dayjs(current).isBefore(dayjs(taskDetail.start_time))"
|
||||
:disabledTime="getDisabledTime"
|
||||
v-if="form.is_backfill===1"
|
||||
v-model="form.back_time"
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
|
||||
@@ -156,9 +156,27 @@ const passTask = async (id, task_backfill_id) => {
|
||||
|
||||
<template v-slot:content="{record}">
|
||||
<div v-for="(item, index) in record?.task_content" class="flex flex-col">
|
||||
<template v-if="item?.back?.material_type === 1">
|
||||
<div v-for="v in item?.back?.content_arr" class="!flex items-center gap-[12px]">
|
||||
<div class="flex-shrink-0">
|
||||
<a-image width="30" height="30" :src="v"></a-image>
|
||||
</div>
|
||||
<a-link @click="openUrl(v)" :hoverable="false">
|
||||
{{ v }}
|
||||
</a-link>
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="item?.back?.material_type === 2">
|
||||
<a-link v-for="v in item?.back?.content_arr" @click="openUrl(v)" :hoverable="false">
|
||||
{{ v }}
|
||||
</a-link>
|
||||
</template>
|
||||
<template v-if="item?.back?.material_type === 3">
|
||||
<div v-for="v in item?.back?.content_arr">
|
||||
{{ v }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<a-divider v-if="index+1 !== record?.task_content.length"></a-divider>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user