|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <hc-drawer v-model="isShow" to-id="node-card-plan" is-close>
|
|
|
+ <hc-drawer v-model="isShow" to-id="node-card-plan" is-close @close="goBack">
|
|
|
<hc-card>
|
|
|
<template #header>
|
|
|
<el-link type="primary" @click="goBack">返回</el-link>
|
|
@@ -24,6 +24,9 @@
|
|
|
hc-btn
|
|
|
keys="system-service-plan-preview-btn"
|
|
|
color="#3F9EFF"
|
|
|
+ :loading="preViewLoad"
|
|
|
+ :disabled="dataId.length === 0 "
|
|
|
+ @click="previewPlan"
|
|
|
>
|
|
|
<HcIcon name="eye" />
|
|
|
预览
|
|
@@ -35,6 +38,7 @@
|
|
|
hc-btn
|
|
|
keys="system-service-plan-send-btn"
|
|
|
type="warning"
|
|
|
+ :loading="sendPlanLoad"
|
|
|
@click="sendPlan"
|
|
|
>
|
|
|
<HcIcon name="send-plane" />
|
|
@@ -46,8 +50,9 @@
|
|
|
class="node-card-plan-btn ml-6"
|
|
|
hc-btn
|
|
|
keys="system-service-plan-back-btn"
|
|
|
-
|
|
|
+ :loading="sendPlanLoad"
|
|
|
type="warning"
|
|
|
+ @click="sendPlanClick(2)"
|
|
|
>
|
|
|
<HcIcon name="arrow-go-back" />
|
|
|
计划回退
|
|
@@ -55,11 +60,12 @@
|
|
|
</HcTooltip>
|
|
|
<HcTooltip keys="system-service-plan-comfirm-btn">
|
|
|
<el-button
|
|
|
+ :loading="sendPlanLoad"
|
|
|
class="node-card-plan-btn ml-6"
|
|
|
hc-btn
|
|
|
keys="system-service-plan-comfirm-btn"
|
|
|
-
|
|
|
type="success"
|
|
|
+ @click="sendPlanClick(3)"
|
|
|
>
|
|
|
<HcIcon name="check" />
|
|
|
确认计划
|
|
@@ -91,6 +97,7 @@ import { arrToKey, deepClone, getObjVal, isString } from 'js-fast-way'
|
|
|
import HcUserModal from './hc-tasks-user/user-modal.vue'
|
|
|
import { useAppStore } from '~src/store'
|
|
|
import dataApi from '~api/systemService/service'
|
|
|
+import { toPdfPage } from '~uti/btn-auth'
|
|
|
//参数
|
|
|
const props = defineProps({
|
|
|
type: {
|
|
@@ -102,6 +109,7 @@ const props = defineProps({
|
|
|
default:'',
|
|
|
},
|
|
|
})
|
|
|
+const emit = defineEmits(['close'])
|
|
|
const type = ref(props.type)
|
|
|
const dataId = ref(props.dataId)
|
|
|
const isShow = defineModel('modelValue', {
|
|
@@ -116,10 +124,14 @@ const isTableForm = ref(false)
|
|
|
const useAppState = useAppStore()
|
|
|
const projectId = ref(useAppState.getProjectId)
|
|
|
const contractId = ref(useAppState.getContractId)
|
|
|
+const status = ref()
|
|
|
|
|
|
watch(isShow, (val) => {
|
|
|
if (val) {
|
|
|
- if (dataId.value) getAddLogBusinessData()
|
|
|
+ if (dataId.value) {
|
|
|
+ getDetailData()
|
|
|
+ getAddLogBusinessData()
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
//监听
|
|
@@ -200,6 +212,7 @@ const tableFormRender = (form) => {
|
|
|
}
|
|
|
const goBack = () => {
|
|
|
isShow.value = false
|
|
|
+ emit('close')
|
|
|
}
|
|
|
const sendPlan = ()=>{
|
|
|
isUserModalShow.value = true
|
|
@@ -211,13 +224,39 @@ const dataInfo = ref({
|
|
|
projectId:projectId.value,
|
|
|
contractId:contractId.value,
|
|
|
})
|
|
|
-const fixedUserFinish = (data) => {
|
|
|
+const userIds = ref('')
|
|
|
+const fixedUserFinish = async (data) => {
|
|
|
const res = deepClone(data)
|
|
|
- console.log(res, 'res')
|
|
|
userData.value = res
|
|
|
- const userIds = arrToKey(res, 'userId', ',')
|
|
|
- let userIdsArr = userIds.split(',')
|
|
|
-
|
|
|
+ userIds.value = arrToKey(res, 'userId', ',')
|
|
|
+
|
|
|
+ console.log(userIds, 'userIds')
|
|
|
+ sendPlanClick(1)
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+const sendPlanLoad = ref(false)
|
|
|
+const sendPlanClick = async (type)=>{
|
|
|
+ sendPlanLoad.value = true
|
|
|
+ const { error, code, msg, data } = await dataApi.sendServicePlan(
|
|
|
+ {
|
|
|
+ id: dataId.value,
|
|
|
+ sendUser: userIds.value,
|
|
|
+ status:type,
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ , false)
|
|
|
+ sendPlanLoad.value = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+
|
|
|
+ window?.$message?.success(msg)
|
|
|
+
|
|
|
+ } else {
|
|
|
+ sendPlanLoad.value = false
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
//保存数据
|
|
|
const saveLoading = ref(false)
|
|
@@ -229,6 +268,8 @@ const savePlan = async ()=>{
|
|
|
projectId: projectId.value,
|
|
|
contractId: contractId.value,
|
|
|
pkeyId: excelIdVal.value,
|
|
|
+ id: dataId.value,
|
|
|
+
|
|
|
|
|
|
}
|
|
|
saveLoading.value = true
|
|
@@ -238,7 +279,8 @@ const savePlan = async ()=>{
|
|
|
, false)
|
|
|
saveLoading.value = false
|
|
|
if (!error && code === 200) {
|
|
|
-
|
|
|
+ dataId.value = data
|
|
|
+
|
|
|
window?.$message?.success(msg)
|
|
|
|
|
|
} else {
|
|
@@ -247,6 +289,44 @@ const savePlan = async ()=>{
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+//预览
|
|
|
+const preViewLoad = ref(false)
|
|
|
+const previewPlan = async ()=>{
|
|
|
+ preViewLoad.value = true
|
|
|
+ const { error, code, data } = await dataApi.getDetail({
|
|
|
+ id: dataId.value,
|
|
|
+
|
|
|
+ }, false)
|
|
|
+ preViewLoad.value = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ const res = getObjVal(data)
|
|
|
+ const { pdfUrl } = res
|
|
|
+ if (pdfUrl) {
|
|
|
+ toPdfPage(pdfUrl)
|
|
|
+
|
|
|
+ } else {
|
|
|
+ window?.$message?.error('暂无预览文件')
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ window?.$message?.error('暂无预览文件')
|
|
|
+ }
|
|
|
+}
|
|
|
+const getDetailData = async ()=>{
|
|
|
+ const { error, code, data } = await dataApi.getDetail({
|
|
|
+ id: dataId.value,
|
|
|
+
|
|
|
+ }, false)
|
|
|
+ if (!error && code === 200) {
|
|
|
+ const res = getObjVal(data)
|
|
|
+ const { status } = res
|
|
|
+ status.value = status
|
|
|
+ } else {
|
|
|
+
|
|
|
+ status.value = ''
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|