|
@@ -29,10 +29,44 @@
|
|
|
<van-cell title="联系人号码" :value="infoData.contactsPhone" v-if="!infoData.clueId" />
|
|
|
</div>
|
|
|
<div class="bottomButton">
|
|
|
- <van-button type="success" class="w-full block" @click="completeTheTask(2)" v-if="infoData.status != 2">完成任务</van-button>
|
|
|
- <van-button type="primary" class="w-full block" @click="completeTheTask(0)" v-if="infoData.status == 2">重启任务</van-button>
|
|
|
+ <van-button type="success" class="w-full block" @click="completeTheTask(2)"
|
|
|
+ v-if="infoData.status != 2">完成任务</van-button>
|
|
|
+ <!-- <van-button type="primary" class="w-full block" @click="completeTheTask(0)" v-if="infoData.status == 2">重启任务</van-button> -->
|
|
|
+ <van-button type="primary" class="w-full block" @click="restartTask()"
|
|
|
+ v-if="infoData.status == 2">重启任务</van-button>
|
|
|
<van-button type="danger" class="w-full block" @click="deleteTask">删除任务</van-button>
|
|
|
</div>
|
|
|
+
|
|
|
+ <van-popup v-model:show="showDelay" closeable position="bottom" round>
|
|
|
+ <div class="newModuleAdded relative">
|
|
|
+ <div class="text-size-large text-[#474A56] absolute topTitle">重启时间</div>
|
|
|
+ <div class="flex flex-col overflow-y-auto h-52">
|
|
|
+ <div class="flex-1">
|
|
|
+ <div class="px-6 py-4 bg-[#F8F8FA] flex justify-between items-center mt-2" @click="showDatePickerCli('showStartDelayData')">
|
|
|
+ <div>选择开始时间</div>
|
|
|
+ <div class="flex items-center">
|
|
|
+ {{ showStartDelayData }}
|
|
|
+ <van-icon name="arrow" size="1.2rem" class="ml-2" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="flex-1">
|
|
|
+ <div class="px-6 py-4 bg-[#F8F8FA] flex justify-between items-center mt-2" @click="showDatePickerCli('showEndtDelayData')">
|
|
|
+ <div>选择结束时间</div>
|
|
|
+ <div class="flex items-center">
|
|
|
+ {{ showEndtDelayData }}
|
|
|
+ <van-icon name="arrow" size="1.2rem" class="ml-2" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <van-button type="primary" :disabled="showEndtDelayData < todaySDate" @click="delayTimeEvent()">重启</van-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </van-popup>
|
|
|
+
|
|
|
+ <van-popup v-model:show="showDatePicker" destroy-on-close position="bottom" :style="{ height: '50%' }">
|
|
|
+ <van-date-picker v-model="showDatePickerVal" @confirm="showPickerConfirm" @cancel="showDatePicker = false" />
|
|
|
+ </van-popup>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -48,6 +82,7 @@ import { routingInfos } from "@utility/generalVariables"
|
|
|
import useInfoStore from '@store/useInfoStore'
|
|
|
import useFixedData from "@store/useFixedData.js"
|
|
|
import useRouterStore from "@store/useRouterStore.js";
|
|
|
+import dayjs from 'dayjs';
|
|
|
|
|
|
const router = useRouterStore()
|
|
|
const fixedData = useFixedData()
|
|
@@ -63,11 +98,52 @@ const props = defineProps({
|
|
|
const routingInformation = routingInfos['tasks']
|
|
|
const infoData = ref(props.info);
|
|
|
const timeout = ref(null);
|
|
|
+const showDelay = ref(false);
|
|
|
+const showDatePicker = ref(false);
|
|
|
+const showDatePickerVal = ref([])
|
|
|
+const todaySDate = dayjs(new Date()).format('YYYY-MM-DD')
|
|
|
+const showStartDelayData = ref('');
|
|
|
+const showEndtDelayData = ref('');
|
|
|
+const showDateType = ref('');
|
|
|
|
|
|
watch(() => props.info, (newValue) => {
|
|
|
initializeData(newValue.id)
|
|
|
})
|
|
|
|
|
|
+function showPickerConfirm({ selectedValues }) {
|
|
|
+ const dates = selectedValues.join('-')
|
|
|
+ if(showDateType.value = 'showStartDelayData') {
|
|
|
+ showStartDelayData.value = dates
|
|
|
+ }
|
|
|
+
|
|
|
+ if(showDateType.value = 'showEndtDelayData') {
|
|
|
+ showEndtDelayData.value = dates
|
|
|
+ }
|
|
|
+
|
|
|
+ showDatePicker.value = false
|
|
|
+}
|
|
|
+
|
|
|
+function showDatePickerCli(type) {
|
|
|
+ showDateType.value = type
|
|
|
+ const types = type == 'showStartDelayData' ? showStartDelayData.value : showEndtDelayData.value
|
|
|
+ showDatePickerVal.value = types.split('-')
|
|
|
+ showDatePicker.value = true
|
|
|
+}
|
|
|
+
|
|
|
+function restartTask() {
|
|
|
+ showStartDelayData.value = infoData.value.startDate ? infoData.value.startDate : dayjs().format("YYYY-MM-DD")
|
|
|
+ showEndtDelayData.value = infoData.value.endDate ? infoData.value.endDate : dayjs().format("YYYY-MM-DD")
|
|
|
+ showDelay.value = true
|
|
|
+}
|
|
|
+function delayTimeEvent() {
|
|
|
+ const id = infoData.value.id
|
|
|
+ requests.post(TASK_OPERATION, { id, status: 0, startDate: showStartDelayData.value, endDate: showEndtDelayData.value }).then(({ data }) => {
|
|
|
+ toastSuccess('操作成功')
|
|
|
+ showDelay.value = false
|
|
|
+ getTaskDetails(id)
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
function completeTheTask(status) {
|
|
|
const id = infoData.value.id
|
|
|
requests.post(TASK_OPERATION, { id, status }).then(({ data }) => {
|
|
@@ -139,7 +215,20 @@ useLifecycle({
|
|
|
margin-bottom: 20px;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.info {
|
|
|
margin: 8px 14px 30px 14px;
|
|
|
}
|
|
|
+
|
|
|
+.newModuleAdded {
|
|
|
+ padding: 45px 25px 45px 25px;
|
|
|
+}
|
|
|
+
|
|
|
+.topTitle {
|
|
|
+ top: 14px;
|
|
|
+}
|
|
|
+
|
|
|
+.boxLxr {
|
|
|
+ max-height: 180px;
|
|
|
+}
|
|
|
</style>
|