浏览代码

Merge branch 'master' into test-dev

duy 1 月之前
父节点
当前提交
65dcc5ad04

+ 14 - 1
src/api/modules/systemService/service.js

@@ -83,5 +83,18 @@ export default {
         })
     },
    
-
+    async cancelServicePlan(form) {
+        return HcApi({
+            url: '/api/blade-manager/serviceplan/cancelServicePlan',
+            method: 'get',
+            params: form,
+        })
+    },
+      async confirmServicePlan(form) {
+        return HcApi({
+            url: '/api/blade-manager/serviceplan/confirmServicePlan',
+            method: 'get',
+            params: form,
+        })
+    },
 }

+ 9 - 0
src/views/data-fill/division.vue

@@ -1476,6 +1476,15 @@ const ElTreeMenuClick = async ({ key, node, data, keys }) => {
         changeStandType(formEditNodeModel.value?.className)
         editNodeModal.value = true
     } else if (key === 'sort') {
+            if (
+            data['colorStatus'] !== 1 || data['colorStatus'] === 2 || data['colorStatus'] === null
+            || data['colorStatus'] === -1
+           
+        ) {
+             window?.$message?.warning('该节点已存在上报数据,不允许排序节点数据')
+             return
+
+        }
         let nodes = [],
             childNodes = []
         childNodes = node?.parent?.childNodes || []

+ 9 - 0
src/views/data-fill/wbs.vue

@@ -1995,6 +1995,15 @@ const setTreeMenuDataClick = ({ key, node, data }) => {
             window?.$message?.warning('该节点已存在上报数据,不允许删除')
         }
     } else if (key === 'sort') {
+            if (
+            data['colorStatus'] !== 1 || data['colorStatus'] === 2 || data['colorStatus'] === null
+            || data['colorStatus'] === -1
+           
+        ) {
+             window?.$message?.warning('该节点已存在上报数据,不允许排序节点数据')
+             return
+
+        }
         let nodes = [],
             childNodes = []
         if (tabKey === 'tree') {

+ 106 - 22
src/views/systemService/fromDrawer.vue

@@ -7,6 +7,22 @@
             <template #extra>
                 <HcTooltip keys="system-service-plan-save-btn">
                     <el-button
+                        v-if="status === 2 "
+                        :disabled="!isSendUserAuthorized"
+                        class="ml-6"
+                        hc-btn
+                        keys="system-service-plan-save-btn"
+                        type="primary"
+                        :loading="saveLoading"
+                       
+                        @click="savePlan"
+                    >
+                        <HcIcon name="save" />
+                        保存数据
+                    </el-button>
+                    <el-button
+                        v-else
+                       
                         class="ml-6"
                         hc-btn
                         keys="system-service-plan-save-btn"
@@ -34,43 +50,44 @@
                 </HcTooltip>
                 <HcTooltip keys="system-service-plan-send-btn">
                     <el-button
-                        v-if="status === 1 "
+                        v-if="status === 1"
                         class="node-card-plan-btn ml-6"
                         hc-btn
                         keys="system-service-plan-send-btn"
                         type="warning"
                         :loading="sendPlanLoad"
-                        :disabled="!isWriteUserAuthorized"
+                      
                         @click="sendPlan"
                     >
                         <HcIcon name="send-plane" />
                         发送计划
                     </el-button>
-                </HcTooltip>
-                <HcTooltip keys="system-service-plan-send-btn">
                     <el-button
-                        v-if="status === 3 "
+                        v-if="status === 3"
                         class="node-card-plan-btn ml-6"
                         hc-btn
                         keys="system-service-plan-send-btn"
                         type="warning"
                         :loading="sendPlanLoad"
+                        :disabled="!isWriteUserAuthorized || dataId.length === 0 "
                         @click="sendPlan"
                     >
                         <HcIcon name="send-plane" />
                         发送计划
                     </el-button>
                 </HcTooltip>
+           
                 <HcTooltip keys="system-service-plan-back-btn">
                     <el-button
                         v-if="status === 2"
                         class="node-card-plan-btn ml-6"
                         hc-btn
                         keys="system-service-plan-back-btn"
-                        :loading="sendPlanLoad"
+               
                         type="warning"
                         :disabled="!isSendUserAuthorized"
-                        @click="sendPlanClick(3)"
+                        :loading="backPlanLoad"
+                        @click="backPlan"
                     >
                         <HcIcon name="arrow-go-back" />
                         计划回退
@@ -79,13 +96,13 @@
                 <HcTooltip keys="system-service-plan-comfirm-btn">
                     <el-button
                         v-if="status === 2"
-                        :loading="sendPlanLoad"
+                        :loading="confirmPlanLoad"
                         class="node-card-plan-btn ml-6"
                         hc-btn
                         keys="system-service-plan-comfirm-btn"
                         type="success"
                         :disabled="!isSendUserAuthorized"
-                        @click="sendPlanClick(4)"
+                        @click="confirmPlan"
                     >
                         <HcIcon name="check" />
                         确认计划
@@ -112,12 +129,13 @@
 </template>
 
 <script setup>
-import { computed, ref, watch } from 'vue'
+import { computed, nextTick, ref, watch } from 'vue'
 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: {
@@ -144,11 +162,11 @@ const isTableForm = ref(false)
 const useAppState = useAppStore()
 const projectId = ref(useAppState.getProjectId)
 const contractId = ref(useAppState.getContractId)
-const { user_id } = ref(useAppState.getUserInfo)
+const user_id = ref(useAppState.getUserInfo.user_id ?? '')
 const status = ref()
 
-watch(isShow, (val) => {
-
+watch(isShow, async (val) => {
+  await nextTick() 
     
     if (val) {
           if (val) getExcelHtml()
@@ -156,15 +174,22 @@ watch(isShow, (val) => {
                 excelHtmlData.value = ''
                 isTableForm.value = false
 
-            if (dataId.value) {
+      
+                   if (dataId.value) {
                
 
                 getDetailData()
                  getAddLogBusinessData()
             }
+        
+
+    } else {
+        status.value = ''
+          sendUser.value = ''
+        writeUser.value = ''
 
     }
-})
+}, { immediate: true })
 //监听
 watch(() => [
     props.type,
@@ -178,10 +203,13 @@ watch(() => [
     } else {
         excelIdVal.value = '1937773223861026822'
     }
-    
+    if (id) {
+          getAddLogBusinessData()
+           getDetailData()
+    }
    
     
-})
+}, { immediate: true })
 
 //获取模板标签数据
 
@@ -253,11 +281,24 @@ const sendPlan = ()=>{
 }
 // 计算属性:判断 writeUser 是否包含 user_id
 const isWriteUserAuthorized = computed(() => {
-    return writeUser.value.includes(user_id.value)
+ 
+    const writeUserStr = writeUser.value
+    const writeUserArray = writeUserStr.split(',')
+    const cleanedArray = writeUserArray.filter(item => item.trim() !== '')
+   
+    console.log(cleanedArray, 'cleanedArray')
+    console.log(user_id.value, 'user_id.value')
+    
+    
+    return cleanedArray.includes(user_id.value)
+
 })
 // 计算属性:判断 sendUser 是否包含 user_id
 const isSendUserAuthorized = computed(() => {
-    return sendUser.value.includes(user_id.value)
+    const writeUserStr = sendUser.value
+    const writeUserArray = writeUserStr.split(',')
+    const cleanedArray = writeUserArray.filter(item => item.trim() !== '')
+    return cleanedArray.includes(user_id.value)
 })
 const isUserModalShow = ref(false)
 const userData = ref([])
@@ -283,7 +324,7 @@ const sendPlanClick = async (type)=>{
             {
                 id: dataId.value,
                 sendUser: userIds.value,
-                status:type,
+
                
             }
          
@@ -300,6 +341,45 @@ const sendPlanClick = async (type)=>{
           
         }
 }
+//回退计划
+const backPlanLoad = ref(false)
+const backPlan = async ()=>{
+    backPlanLoad.value = true
+    const { error, code, msg, data } = await dataApi.cancelServicePlan(
+            {
+                id: dataId.value,
+              
+            }
+         
+        , false)
+        backPlanLoad.value = false
+      if (!error && code === 200) {
+        
+            window?.$message?.success(msg)
+            getDetailData()
+           
+        } 
+}
+//确认计划
+const confirmPlanLoad = ref(false)
+const confirmPlan = async ()=>{
+    confirmPlanLoad.value = true
+      const { error, code, msg, data } = await dataApi.confirmServicePlan(
+            {
+                id: dataId.value,
+              
+            }
+         
+        , false)
+      confirmPlanLoad.value = false
+        if (!error && code === 200) {
+        
+            window?.$message?.success(msg)
+            getDetailData()
+           
+        } 
+          
+}
 //保存数据
 const saveLoading = ref(false)
 const savePlan = async ()=>{
@@ -310,7 +390,7 @@ const savePlan = async ()=>{
         projectId: projectId.value,
         contractId: contractId.value,
         pkeyId: excelIdVal.value,
-        groupId: dataId.value,
+        group_id: dataId.value,
        
        
     }
@@ -367,8 +447,12 @@ const getDetailData = async ()=>{
        const res = getObjVal(data)
        
         status.value = res.status
+        console.log( status.value, ' status.value')
+        console.log(user_id, ' user_id.value')
+        
+        
        sendUser.value = res.sendUser
-       writeUser.value = res.updateUser
+       writeUser.value = res.writeUser
 
         
     } else {

+ 3 - 3
src/views/systemService/plan.vue

@@ -20,7 +20,7 @@
                 </el-select>
             </div>
             <div class="ml-3 w-32">
-                <el-select v-model="searchForm.sendUser" placeholder="发送人" clearable multiple block @change="getTableData">
+                <el-select v-model="searchForm.sendUser" placeholder="发送人" clearable block @change="getTableData">
                     <el-option v-for="item in postList" :key="item.userId" :label="item.userName" :value="item.userId" />
                 </el-select>
             </div>
@@ -106,8 +106,8 @@ const postList = ref([
 const betweenTime = ref(null)
 const betweenTimeUpdate = ({ val, arr }) => {
     betweenTime.value = arr
-    searchForm.value.planStartTime = val['start']
-    searchForm.value.planEndTime = val['end']
+    searchForm.value.planStartTime1 = val['start']
+    searchForm.value.planEndTime1 = val['end']
     getTableData()
 
 }

+ 1 - 0
src/views/user/index.vue

@@ -242,6 +242,7 @@
                     <div class="foot-recycle">
                         <el-button
                             :loading="recycleBtnLoading" hc-btn type="primary"
+                            :disabled="userTypeKey === '2'"
                             @click="recycleBtnClick"
                         >
                             <HcIcon fill name="reply" />