|
@@ -14,7 +14,7 @@
|
|
|
:scheduleEvents="scheduleEvents"
|
|
:scheduleEvents="scheduleEvents"
|
|
|
@addOrUpdateOption="OpenTodoDialog"
|
|
@addOrUpdateOption="OpenTodoDialog"
|
|
|
@deleteToDo="OpenDeleteDialog"
|
|
@deleteToDo="OpenDeleteDialog"
|
|
|
- @detailToDo="">
|
|
|
|
|
|
|
+ @detailToDo="OpenFollowDialog">
|
|
|
</CalendarTodoList>
|
|
</CalendarTodoList>
|
|
|
|
|
|
|
|
<!-- 新增/修改 待办日程弹窗 -->
|
|
<!-- 新增/修改 待办日程弹窗 -->
|
|
@@ -32,6 +32,18 @@
|
|
|
@confirm="HandleDeleteConfirm"
|
|
@confirm="HandleDeleteConfirm"
|
|
|
@close="CloseDeleteDialog">
|
|
@close="CloseDeleteDialog">
|
|
|
</Dialog>
|
|
</Dialog>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 查看待办详情弹窗 -->
|
|
|
|
|
+ <FollowFormDialog
|
|
|
|
|
+ v-if="followVisible"
|
|
|
|
|
+ title="查看详情"
|
|
|
|
|
+ :previewForm="true"
|
|
|
|
|
+ v-model:submitLoading="followDetailLoading"
|
|
|
|
|
+ v-model:visible="followVisible"
|
|
|
|
|
+ :defaultFormData="followDefaultFormData"
|
|
|
|
|
+ @confirm="HandleFollowDialogConfirm"
|
|
|
|
|
+ @close="CloseFollowDialog">
|
|
|
|
|
+ </FollowFormDialog>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -52,7 +64,12 @@ import { ElMessage } from 'element-plus';
|
|
|
import dayjs from 'dayjs';
|
|
import dayjs from 'dayjs';
|
|
|
import Dialog from '@/baseComponents/Dialog.vue'
|
|
import Dialog from '@/baseComponents/Dialog.vue'
|
|
|
|
|
|
|
|
|
|
+import FollowFormDialog from '@/components/FollowFormDialog/index.vue'
|
|
|
|
|
+
|
|
|
import {formatTime} from '@/utils/timeRangeGet'
|
|
import {formatTime} from '@/utils/timeRangeGet'
|
|
|
|
|
+
|
|
|
|
|
+import {closeToDoTaskApi} from '@/api/appointmentAndTodo'
|
|
|
|
|
+
|
|
|
const currentYear = defineModel('currentYear')
|
|
const currentYear = defineModel('currentYear')
|
|
|
const currentMonth = defineModel('currentMonth')
|
|
const currentMonth = defineModel('currentMonth')
|
|
|
|
|
|
|
@@ -164,7 +181,8 @@ const GetToDoList = async ()=>{
|
|
|
isCustomToDo:itm.type === 1 ? true : false,
|
|
isCustomToDo:itm.type === 1 ? true : false,
|
|
|
productName:itm.productName,
|
|
productName:itm.productName,
|
|
|
customerName:itm.customerName,
|
|
customerName:itm.customerName,
|
|
|
- time:itm.orderDatetime
|
|
|
|
|
|
|
+ time:itm.orderDatetime,
|
|
|
|
|
+ ...itm,
|
|
|
}
|
|
}
|
|
|
}) || []
|
|
}) || []
|
|
|
scheduleEvents.value[item.day] = toDoList
|
|
scheduleEvents.value[item.day] = toDoList
|
|
@@ -179,8 +197,6 @@ watch(()=>currentYear.value+'-'+currentMonth.value,async (newVal)=>{
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
/** 4. 删除 待办日程弹窗 */
|
|
/** 4. 删除 待办日程弹窗 */
|
|
|
const deleteVisible = ref(false)
|
|
const deleteVisible = ref(false)
|
|
|
const deleteSubmitLoading = ref(false)
|
|
const deleteSubmitLoading = ref(false)
|
|
@@ -205,6 +221,68 @@ const HandleDeleteConfirm = async () => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/** 5. 查看待办日程弹窗 */
|
|
|
|
|
+const followVisible = ref(false)
|
|
|
|
|
+const followSubmitloading = ref(false)
|
|
|
|
|
+const followDetailLoading = ref(false)
|
|
|
|
|
+const currentFollowRow = ref({}) //当前查看的跟进数据
|
|
|
|
|
+const followDefaultFormData = ref({})
|
|
|
|
|
+// 打开待办详情弹窗
|
|
|
|
|
+const OpenFollowDialog = (row) => {
|
|
|
|
|
+ followVisible.value = true
|
|
|
|
|
+ currentFollowRow.value = row
|
|
|
|
|
+ followDefaultFormData.value = {
|
|
|
|
|
+ id:row.id,
|
|
|
|
|
+ school:row.customerName,
|
|
|
|
|
+ product:row.productName,
|
|
|
|
|
+ status:row.followName,
|
|
|
|
|
+ contact:row.customerPersonName,
|
|
|
|
|
+ position:row.positionName,
|
|
|
|
|
+ content:row.followContent,
|
|
|
|
|
+ appointmentTime:row.orderDatetime,
|
|
|
|
|
+ todoTime:row.orderDatetime,
|
|
|
|
|
+ appointmentType:[0,1].includes(row.orderType) && [0,1].includes(row.orderStatus), // extraAppointmentType 有值(为待办1)的前提下,—— 当前值为false 表示 待办已手动关闭
|
|
|
|
|
+ extraAppointmentType:row.orderType, //查看时候—— 附加的项
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+// 关闭待办详情弹窗
|
|
|
|
|
+const CloseFollowDialog = () => {
|
|
|
|
|
+ followVisible.value = false
|
|
|
|
|
+ followSubmitloading.value = false
|
|
|
|
|
+ followDefaultFormData.value = {}
|
|
|
|
|
+}
|
|
|
|
|
+// 待办详情弹窗确认
|
|
|
|
|
+const HandleFollowDialogConfirm = async (params) => {
|
|
|
|
|
+ const {formData} = params
|
|
|
|
|
+ if([1].includes(currentFollowRow.value.orderType)){
|
|
|
|
|
+ // 待办
|
|
|
|
|
+ // orderStatus 0 待开始 1 已结束 null 已关闭
|
|
|
|
|
+ // 如果是为关闭的待办 变成了关闭状态,调用关闭待办接口
|
|
|
|
|
+ if([0,1].includes(currentFollowRow.value.orderStatus) && !(formData.appointmentType)){
|
|
|
|
|
+ followDetailLoading.value = true
|
|
|
|
|
+ // 关闭待办
|
|
|
|
|
+ let res = undefined
|
|
|
|
|
+ try{
|
|
|
|
|
+ res = await closeToDoTaskApi(formData.id)
|
|
|
|
|
+ }catch{}
|
|
|
|
|
+ if(res?.code == 200){
|
|
|
|
|
+ ElMessage.success('关闭成功')
|
|
|
|
|
+ CloseFollowDialog()
|
|
|
|
|
+ // 刷新待办数据
|
|
|
|
|
+ await GetToDoList()
|
|
|
|
|
+ }else{
|
|
|
|
|
+ followDetailLoading.value = false
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ CloseFollowDialog()
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ CloseFollowDialog()
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
onMounted(async ()=>{
|
|
onMounted(async ()=>{
|
|
|
await GetToDoList()
|
|
await GetToDoList()
|
|
|
|
|
|