|
@@ -4,15 +4,14 @@
|
|
<HcNewSwitch :datas="tabTab" :keys="tabKey" @change="tabChange" :round="false"/>
|
|
<HcNewSwitch :datas="tabTab" :keys="tabKey" @change="tabChange" :round="false"/>
|
|
</template>
|
|
</template>
|
|
<HcTable :isIndex="false" :column="tableColumn" :datas="tableData" :loading="tableLoading">
|
|
<HcTable :isIndex="false" :column="tableColumn" :datas="tableData" :loading="tableLoading">
|
|
- <template #key9="{row}">
|
|
|
|
- <el-select v-model="row.key9" size="small">
|
|
|
|
- <el-option label="选项1" value="选项1"/>
|
|
|
|
- <el-option label="选项2" value="选项2"/>
|
|
|
|
|
|
+ <template #taskUser="{row}">
|
|
|
|
+ <el-select v-model="row.taskUser" size="small">
|
|
|
|
+ <el-option v-for="item in department" :label="item.name" :value="item.id"/>
|
|
</el-select>
|
|
</el-select>
|
|
</template>
|
|
</template>
|
|
- <template #action="{row,index}">
|
|
|
|
- <el-button size="small" type="primary" @click="openPlanModalShow(row)">开启</el-button>
|
|
|
|
- <el-button size="small" type="danger" @click="pausePlanModalShow(row)">暂停</el-button>
|
|
|
|
|
|
+ <template #action="{row,index}" >
|
|
|
|
+ <el-button size="small" type="primary" @click="openPlanModalShow(row)" :disabled="row.startOrStop==1||row.startOrStop==0">开启</el-button>
|
|
|
|
+ <el-button size="small" type="danger" @click="pausePlanModalShow(row)" :disabled="row.startOrStop==2||row.startOrStop==0">暂停</el-button>
|
|
</template>
|
|
</template>
|
|
</HcTable>
|
|
</HcTable>
|
|
<template #action>
|
|
<template #action>
|
|
@@ -77,27 +76,25 @@
|
|
import {useRouter,useRoute} from 'vue-router'
|
|
import {useRouter,useRoute} from 'vue-router'
|
|
import {onActivated, ref,watch} from "vue";
|
|
import {onActivated, ref,watch} from "vue";
|
|
import sectionApi from '~api/program/section.js';
|
|
import sectionApi from '~api/program/section.js';
|
|
-import {getArrValue,getObjValue,formValidate} from "js-fast-way"
|
|
|
|
-
|
|
|
|
|
|
+import {getArrValue,getObjValue,formValidate, arrIndex} from "js-fast-way"
|
|
|
|
+import { getuserList} from "~api/other";
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
const useRoutes = useRoute()
|
|
const useRoutes = useRoute()
|
|
const dataId = ref(useRoutes?.query?.id ?? '')
|
|
const dataId = ref(useRoutes?.query?.id ?? '')
|
|
const dataType = ref(useRoutes?.query?.type ?? '')
|
|
const dataType = ref(useRoutes?.query?.type ?? '')
|
|
const planDate=ref(useRoutes?.query?.month ?? '')
|
|
const planDate=ref(useRoutes?.query?.month ?? '')
|
|
const departmentType=ref(useRoutes?.query?.section ?? '')
|
|
const departmentType=ref(useRoutes?.query?.section ?? '')
|
|
|
|
+const deptId=ref(useRoutes?.query?.deptId ?? '')
|
|
//缓存页面被激活时
|
|
//缓存页面被激活时
|
|
onActivated(() => {
|
|
onActivated(() => {
|
|
dataId.value = useRoutes?.query?.id ?? ''
|
|
dataId.value = useRoutes?.query?.id ?? ''
|
|
dataType.value = useRoutes?.query?.type ?? ''
|
|
dataType.value = useRoutes?.query?.type ?? ''
|
|
planDate.value = useRoutes?.query?.month ?? ''
|
|
planDate.value = useRoutes?.query?.month ?? ''
|
|
departmentType.value = useRoutes?.query?.section ?? ''
|
|
departmentType.value = useRoutes?.query?.section ?? ''
|
|
|
|
+ deptId.value = useRoutes?.query?.deptId ?? ''
|
|
|
|
+ setTabData(departmentType.value)
|
|
getDepartmentPlan()
|
|
getDepartmentPlan()
|
|
- if(dataType.value!=='add'){
|
|
|
|
- // getDepartmentPlan()
|
|
|
|
-
|
|
|
|
- }else if(dataType.value=='add'){
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
|
|
+ getDepartmentuserDict()//获取部门人员字典
|
|
|
|
|
|
|
|
|
|
})
|
|
})
|
|
@@ -106,6 +103,7 @@ const getDepartmentPlan=async()=>{
|
|
const {error, code, data} = await sectionApi.getDepartmentPlan(
|
|
const {error, code, data} = await sectionApi.getDepartmentPlan(
|
|
{
|
|
{
|
|
departmentType:departmentType.value,
|
|
departmentType:departmentType.value,
|
|
|
|
+ deptId:deptId.value,
|
|
planDate:planDate.value,
|
|
planDate:planDate.value,
|
|
|
|
|
|
}
|
|
}
|
|
@@ -120,20 +118,47 @@ const getDepartmentPlan=async()=>{
|
|
// milestoneData.value=[]
|
|
// milestoneData.value=[]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+const department=ref([])
|
|
|
|
+//获取部门人员列表
|
|
|
|
+const getDepartmentuserDict=async()=>{
|
|
|
|
+ const {error, code, data} = await getuserList({deptId:deptId.value})
|
|
|
|
+ if (!error && code === 200) {
|
|
|
|
+ department.value = getArrValue(data)
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ department.value = []
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
|
|
//类型tab数据和相关处理
|
|
//类型tab数据和相关处理
|
|
-const tabKey = ref('key1')
|
|
|
|
|
|
+const tabKey = ref('1')
|
|
const tabTab = ref([
|
|
const tabTab = ref([
|
|
- {key: 'key1', name: '市场部月度预算'},
|
|
|
|
- {key: 'key2', name: '研发部月度预算'},
|
|
|
|
- {key: 'key3', name: '实施部月度预算'},
|
|
|
|
- {key: 'key4', name: '维护部月度预算'},
|
|
|
|
- {key: 'key5', name: '人事行政(财务)部月度预算'},
|
|
|
|
|
|
+ {key: '1', name: '市场部月度预算'},
|
|
|
|
+ {key: '2', name: '研发部月度预算'},
|
|
|
|
+ {key: '3', name: '实施部月度预算'},
|
|
|
|
+ {key: '4', name: '维护部月度预算'},
|
|
|
|
+ {key: '5', name: '人事行政(财务)部月度预算'},
|
|
]);
|
|
]);
|
|
const tabChange = ({key}) => {
|
|
const tabChange = ({key}) => {
|
|
tabKey.value = key
|
|
tabKey.value = key
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+//设置tab
|
|
|
|
+const setTabData=(key)=>{
|
|
|
|
+ tabKey.value=key
|
|
|
|
+ if(key=='1'){
|
|
|
|
+ tabTab.value=[{key: '1', name: '市场部月度预算'}]
|
|
|
|
+ }else if(key=='2'){
|
|
|
|
+ console.log(2222222);
|
|
|
|
+ tabTab.value=[{key: '2', name: '研发部月度预算'},]
|
|
|
|
+ }else if(key=='3'){
|
|
|
|
+ tabTab.value=[ {key: '3', name: '实施部月度预算'},]
|
|
|
|
+ }else if(key=='4'){
|
|
|
|
+ tabTab.value=[ {key: '4', name: '维护部月度预算'},]
|
|
|
|
+ }else if(key=='5'){
|
|
|
|
+ tabTab.value=[{key: '5', name: '人事行政(财务)部月度预算'},]
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
|
|
//获取数据
|
|
//获取数据
|
|
const tableLoading = ref(false)
|
|
const tableLoading = ref(false)
|
|
@@ -165,8 +190,21 @@ const getTableData = () => {
|
|
//开启计划
|
|
//开启计划
|
|
const openPlanModal = ref(false)
|
|
const openPlanModal = ref(false)
|
|
const openPlanModalShow = (row) => {
|
|
const openPlanModalShow = (row) => {
|
|
|
|
+ getPlanInOpen(row.id)
|
|
openPlanModal.value = true
|
|
openPlanModal.value = true
|
|
}
|
|
}
|
|
|
|
+//获取开启计划
|
|
|
|
+const openPlan=ref({})
|
|
|
|
+const getPlanInOpen=async(id)=>{
|
|
|
|
+ const {error, code, data} = await sectionApi.getPlanInOpen({id})
|
|
|
|
+ if (!error && code === 200) {
|
|
|
|
+ openPlan.value = getObjValue(data)
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ openPlan.value = {}
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+}
|
|
const openPlanCloseClick = () => {
|
|
const openPlanCloseClick = () => {
|
|
openPlanModal.value = false
|
|
openPlanModal.value = false
|
|
}
|
|
}
|
|
@@ -185,8 +223,21 @@ const betweenTimeUpdate = ({arr, query}) => {
|
|
//暂停计划
|
|
//暂停计划
|
|
const pausePlanModal = ref(false)
|
|
const pausePlanModal = ref(false)
|
|
const pausePlanModalShow = (row) => {
|
|
const pausePlanModalShow = (row) => {
|
|
|
|
+ getPlanInPause(row.id)
|
|
pausePlanModal.value = true
|
|
pausePlanModal.value = true
|
|
}
|
|
}
|
|
|
|
+//获取暂停计划
|
|
|
|
+const pausePlan=ref({})
|
|
|
|
+const getPlanInPause=async(id)=>{
|
|
|
|
+ const {error, code, data} = await sectionApi.getPlanInPause({id})
|
|
|
|
+ if (!error && code === 200) {
|
|
|
|
+ pausePlan.value = getObjValue(data)
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ pausePlan.value = {}
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+}
|
|
const pausePlanCloseClick = () => {
|
|
const pausePlanCloseClick = () => {
|
|
pausePlanModal.value = false
|
|
pausePlanModal.value = false
|
|
}
|
|
}
|
|
@@ -199,9 +250,16 @@ const pausePlanSaveClick = () => {
|
|
const goBackClick = () => {
|
|
const goBackClick = () => {
|
|
router.back()
|
|
router.back()
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+const saveLoaing=ref(false)
|
|
//提交保存
|
|
//提交保存
|
|
-const saveClick = () => {
|
|
|
|
|
|
+const saveClick = async() => {
|
|
|
|
+ console.log(tableData.value,'tableData');
|
|
|
|
+ saveLoaing.value=true
|
|
|
|
+ const {error, code, data,msg} = await sectionApi.updateDepartmentPlan( tableData.value)
|
|
|
|
+ saveLoaing.value=false
|
|
|
|
+ if (!error && code === 200) {
|
|
|
|
+ window.$message.success(msg)
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|