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