|
|
@@ -1,16 +1,25 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <el-form ref="form" :model="form" :rules="rules" class="el-form-box" label-width="120px">
|
|
|
+ <el-form
|
|
|
+ ref="form"
|
|
|
+ :model="form"
|
|
|
+ :rules="rules"
|
|
|
+ class="el-form-box"
|
|
|
+ label-width="120px"
|
|
|
+ >
|
|
|
<!-- prop="projectId"-->
|
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item
|
|
|
-
|
|
|
- label="关联项目">
|
|
|
+ <el-form-item label="关联项目">
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
+ <el-input
|
|
|
+ v-if="dialogType == 'view'"
|
|
|
+ v-model="form.projectName"
|
|
|
+ :disabled="dialogType == 'view'"
|
|
|
+ ></el-input>
|
|
|
<ele-tree-select
|
|
|
- :disabled="dialogType=='view'"
|
|
|
+ v-else
|
|
|
clearable
|
|
|
ref="projectRef"
|
|
|
filterable
|
|
|
@@ -24,43 +33,32 @@
|
|
|
@change="changeProjectInfo"
|
|
|
/>
|
|
|
</el-col>
|
|
|
- <!-- <el-col :span="1">-->
|
|
|
-
|
|
|
- <!-- <el-popover-->
|
|
|
- <!-- placement="right"-->
|
|
|
- <!-- v-model="popoverFlag"-->
|
|
|
- <!-- width="1000"-->
|
|
|
- <!-- trigger="click">-->
|
|
|
- <!-- <headerTitle title="项目信息"></headerTitle>-->
|
|
|
- <!-- <project-form ref="projectForm" dialog-type="view"></project-form>-->
|
|
|
- <!-- <el-button :disabled="!form.projectId" type="text" slot="reference"-->
|
|
|
- <!-- @click="getProjectInfo(form.projectId)">详情-->
|
|
|
- <!-- </el-button>-->
|
|
|
- <!-- </el-popover>-->
|
|
|
-
|
|
|
- <!-- </el-col>-->
|
|
|
</el-row>
|
|
|
-
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item
|
|
|
- label="关联项目阶段"
|
|
|
- prop="projectStageId">
|
|
|
- <el-select v-model="form.projectStageId" clearable filterable :disabled="dialogType=='view'"
|
|
|
- @change="changeProjectStagInfo"
|
|
|
- style="width: 100%">
|
|
|
- <el-option v-for="item in projectStageList" :label="item.name" :value="item.id"
|
|
|
- :key="item.id"></el-option>
|
|
|
+ <el-form-item label="关联项目阶段" prop="projectStageId">
|
|
|
+ <el-select
|
|
|
+ v-model="form.projectStageId"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ :disabled="dialogType == 'view'"
|
|
|
+ @change="changeProjectStagInfo"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in projectStageList"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ :key="item.id"
|
|
|
+ ></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item
|
|
|
- label="关联项目BOM"
|
|
|
- prop="projectBomId">
|
|
|
+ <el-form-item label="关联项目BOM" prop="projectBomId">
|
|
|
<ele-tree-select
|
|
|
- :disabled="dialogType=='view'"
|
|
|
+ :disabled="dialogType == 'view'"
|
|
|
clearable
|
|
|
ref="projectRef"
|
|
|
@change="changeProjectBomInfo"
|
|
|
@@ -78,12 +76,11 @@
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item
|
|
|
- label="关联计划">
|
|
|
+ <el-form-item label="关联计划">
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
<ele-tree-select
|
|
|
- :disabled="dialogType=='view'"
|
|
|
+ :disabled="dialogType == 'view'"
|
|
|
clearable
|
|
|
ref="planTreeRef"
|
|
|
filterable
|
|
|
@@ -114,20 +111,22 @@
|
|
|
|
|
|
<!-- </el-col>-->
|
|
|
</el-row>
|
|
|
-
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item
|
|
|
- label="计划编码">
|
|
|
- <el-input v-model="form.code" :disabled="dialogType=='view'"></el-input>
|
|
|
+ <el-form-item label="计划编码">
|
|
|
+ <el-input
|
|
|
+ v-model="form.code"
|
|
|
+ :disabled="dialogType == 'view'"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item
|
|
|
- prop="name"
|
|
|
- label="计划名称">
|
|
|
- <el-input v-model="form.name" :disabled="dialogType=='view'"></el-input>
|
|
|
+ <el-form-item prop="name" label="计划名称">
|
|
|
+ <el-input
|
|
|
+ v-model="form.name"
|
|
|
+ :disabled="dialogType == 'view'"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<!-- <el-col :span="8">-->
|
|
|
@@ -148,63 +147,77 @@
|
|
|
<!-- <!– />–>-->
|
|
|
<!-- <!– </el-form-item>–>-->
|
|
|
<!-- </el-col>-->
|
|
|
-
|
|
|
-
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item
|
|
|
- prop="responsibleUserIds"
|
|
|
- label="负责人">
|
|
|
- <el-select v-if="form.projectId" v-model="form.responsibleUserIds" multiple
|
|
|
- :collapse-tags="dialogType!='view'"
|
|
|
- filterable
|
|
|
- placeholder="请选择" style="width: 100%;"
|
|
|
- clearable
|
|
|
- size="medium"
|
|
|
- :disabled="dialogType=='view'">
|
|
|
+ <el-form-item prop="responsibleUserIds" label="负责人">
|
|
|
+ <el-select
|
|
|
+ v-if="form.projectId"
|
|
|
+ v-model="form.responsibleUserIds"
|
|
|
+ multiple
|
|
|
+ :collapse-tags="dialogType != 'view'"
|
|
|
+ filterable
|
|
|
+ placeholder="请选择"
|
|
|
+ style="width: 100%"
|
|
|
+ clearable
|
|
|
+ size="medium"
|
|
|
+ :disabled="dialogType == 'view'"
|
|
|
+ >
|
|
|
<el-option
|
|
|
v-for="item in userList"
|
|
|
:key="item.id"
|
|
|
:label="item.name"
|
|
|
- :value="item.id">
|
|
|
+ :value="item.id"
|
|
|
+ >
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
<personSelect
|
|
|
v-else
|
|
|
- :disabled="dialogType=='view'"
|
|
|
+ :disabled="dialogType == 'view'"
|
|
|
ref="userRef"
|
|
|
multiple
|
|
|
- :collapse-tags="dialogType!='view'"
|
|
|
- v-model="form.responsibleUserIds"/>
|
|
|
-
|
|
|
+ :collapse-tags="dialogType != 'view'"
|
|
|
+ v-model="form.responsibleUserIds"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item
|
|
|
- prop="planStartDate"
|
|
|
- label="计划开始日期">
|
|
|
+ <el-form-item prop="planStartDate" label="计划开始日期">
|
|
|
<el-date-picker
|
|
|
style="width: 100%"
|
|
|
- :disabled="dialogType=='view'"
|
|
|
+ :disabled="dialogType == 'view'"
|
|
|
v-model="form.planStartDate"
|
|
|
- :picker-options="{disabledDate:(time)=>{return form.planEndDate&&time.getTime()>new Date(form.planEndDate)}}"
|
|
|
+ :picker-options="{
|
|
|
+ disabledDate: (time) => {
|
|
|
+ return (
|
|
|
+ form.planEndDate &&
|
|
|
+ time.getTime() > new Date(form.planEndDate)
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }"
|
|
|
type="date"
|
|
|
- placeholder="选择日期">
|
|
|
+ placeholder="选择日期"
|
|
|
+ >
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item
|
|
|
- prop="planEndDate"
|
|
|
- label="计划完成日期">
|
|
|
+ <el-form-item prop="planEndDate" label="计划完成日期">
|
|
|
<el-date-picker
|
|
|
style="width: 100%"
|
|
|
- :disabled="dialogType=='view'"
|
|
|
- :picker-options="{disabledDate:(time)=>{return form.planStartDate&&time.getTime()<new Date(form.planStartDate)}}"
|
|
|
+ :disabled="dialogType == 'view'"
|
|
|
+ :picker-options="{
|
|
|
+ disabledDate: (time) => {
|
|
|
+ return (
|
|
|
+ form.planStartDate &&
|
|
|
+ time.getTime() < new Date(form.planStartDate)
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }"
|
|
|
v-model="form.planEndDate"
|
|
|
type="date"
|
|
|
- placeholder="选择日期">
|
|
|
+ placeholder="选择日期"
|
|
|
+ >
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -218,19 +231,21 @@
|
|
|
<!-- </el-input>-->
|
|
|
<!-- </el-form-item>-->
|
|
|
<!-- </el-col>-->
|
|
|
-
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="16">
|
|
|
<el-form-item label="备注">
|
|
|
- <el-input type="textarea" :rows="2" v-model="form.remark" :disabled="dialogType=='view'"></el-input>
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ :rows="2"
|
|
|
+ v-model="form.remark"
|
|
|
+ :disabled="dialogType == 'view'"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item
|
|
|
- label="附件">
|
|
|
-
|
|
|
- <fileUpload v-model="form.files" :type="dialogType" ></fileUpload>
|
|
|
+ <el-form-item label="附件">
|
|
|
+ <fileUpload v-model="form.files" :type="dialogType"></fileUpload>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
@@ -239,212 +254,264 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {projectsBomGetTreeDataAPI, projectsSelectTreeDataAPI} from "@/api/project-manage";
|
|
|
-import PersonSelect from "@/components/CommomSelect/person-select.vue";
|
|
|
-import ProjectForm from "@/views/project-manage/project-initiation/components/project-form.vue";
|
|
|
-import fileUpload from "@/BIZComponents/addDoc/index.vue";
|
|
|
-import {getFile} from "@/api/system/file";
|
|
|
-import {getTargetPlanTreeAPI} from "@/api/project-manage/plan";
|
|
|
-import userSelectDialog from '@/BIZComponents/user-select/user-select.vue'
|
|
|
-
|
|
|
-export default {
|
|
|
- name: "plan-form",
|
|
|
- components: {fileUpload, ProjectForm, PersonSelect, userSelectDialog},
|
|
|
- props: {
|
|
|
- dialogType: {
|
|
|
- type: String,
|
|
|
- default: '',
|
|
|
+ import {
|
|
|
+ projectsBomGetTreeDataAPI,
|
|
|
+ projectsSelectTreeDataAPI
|
|
|
+ } from '@/api/project-manage';
|
|
|
+ import PersonSelect from '@/components/CommomSelect/person-select.vue';
|
|
|
+ import ProjectForm from '@/views/project-manage/project-initiation/components/project-form.vue';
|
|
|
+ import fileUpload from '@/BIZComponents/addDoc/index.vue';
|
|
|
+ import { getFile } from '@/api/system/file';
|
|
|
+ import { getTargetPlanTreeAPI } from '@/api/project-manage/plan';
|
|
|
+ import userSelectDialog from '@/BIZComponents/user-select/user-select.vue';
|
|
|
|
|
|
- },
|
|
|
- dialogForm: {
|
|
|
- type: Object,
|
|
|
- default: () => {
|
|
|
- return {
|
|
|
- ...this.form
|
|
|
+ export default {
|
|
|
+ name: 'plan-form',
|
|
|
+ components: { fileUpload, ProjectForm, PersonSelect, userSelectDialog },
|
|
|
+ props: {
|
|
|
+ dialogType: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
+ dialogForm: {
|
|
|
+ type: Object,
|
|
|
+ default: () => {
|
|
|
+ return {
|
|
|
+ ...this.form
|
|
|
+ };
|
|
|
}
|
|
|
- }
|
|
|
- },
|
|
|
- deptList: {
|
|
|
- type: Array,
|
|
|
- default() {
|
|
|
- return []
|
|
|
- }
|
|
|
- },
|
|
|
- userList: {
|
|
|
- type: Array,
|
|
|
- default() {
|
|
|
- return []
|
|
|
- }
|
|
|
- },
|
|
|
- deptTreeList: {
|
|
|
- type: Array,
|
|
|
- default() {
|
|
|
- return []
|
|
|
- }
|
|
|
- },
|
|
|
- },
|
|
|
- watch: {
|
|
|
- dialogForm: {
|
|
|
- handler(val) {
|
|
|
- this.form = {
|
|
|
- ...this.form,
|
|
|
- ...this.dialogForm
|
|
|
+ },
|
|
|
+ deptList: {
|
|
|
+ type: Array,
|
|
|
+ default() {
|
|
|
+ return [];
|
|
|
}
|
|
|
- this.$nextTick(async () => {
|
|
|
- //通过项目去查
|
|
|
- if (this.dialogForm.projectId) {
|
|
|
- this.projectBOMList = await projectsBomGetTreeDataAPI(this.dialogForm.projectId)
|
|
|
- //查项目阶段
|
|
|
- await this.getProjectsSelectTreeData({
|
|
|
- treeType: 0,
|
|
|
- id: this.dialogForm.projectId,
|
|
|
- isTask: 0,
|
|
|
- isPlan: 0
|
|
|
- }, 'projectStageList')
|
|
|
- let params = {
|
|
|
- projectId: this.form.projectId,
|
|
|
- projectBomId: this.form.projectBomId,
|
|
|
- projectStageId: this.form.projectStageId,
|
|
|
- processStatus: [2],
|
|
|
- status: [0, 1]
|
|
|
- }
|
|
|
- this.planList = await this.getTargetPlanTree(params)
|
|
|
- }
|
|
|
-
|
|
|
- })
|
|
|
-
|
|
|
},
|
|
|
- deep: true,
|
|
|
- },
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- form: {
|
|
|
- id: '',
|
|
|
- projectId: '',
|
|
|
- projectStageId: '',
|
|
|
- projectBomId: '',
|
|
|
- parentId: '',
|
|
|
- name: '',
|
|
|
- code: '',
|
|
|
- responsibleDeptId: "",
|
|
|
- responsibleDeptName: "",
|
|
|
- responsibleUserName: '',
|
|
|
- responsibleUserId: '',
|
|
|
- responsibleUserIds: [],
|
|
|
- remark: '',
|
|
|
- proportion: '',
|
|
|
- planStartDate: '',
|
|
|
- planEndDate: '',
|
|
|
- files: [],
|
|
|
+ userList: {
|
|
|
+ type: Array,
|
|
|
+ default() {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
},
|
|
|
- popoverFlag: false,
|
|
|
- projectList: [],
|
|
|
- projectStageList: [],
|
|
|
- projectBOMList: [],
|
|
|
- planList: [],
|
|
|
- rules: {
|
|
|
- projectId: {required: true, message: '请选择项目', trigger: 'change'},
|
|
|
- name: {required: true, message: '请输入计划名称', trigger: 'blur'},
|
|
|
- planStartDate: {required: true, message: '请选择计划开始日期', trigger: 'change'},
|
|
|
- planEndDate: {required: true, message: '请选择计划完成日期', trigger: 'change'},
|
|
|
- responsibleUserIds: {required: true, message: '请选择负责人', trigger: 'change'},
|
|
|
- responsibleDeptId: {required: true, message: '请选择部门', trigger: 'change'},
|
|
|
+ deptTreeList: {
|
|
|
+ type: Array,
|
|
|
+ default() {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- },
|
|
|
- async created() {
|
|
|
- this.planList = await this.getTargetPlanTree({projectId: '', processStatus: [2], status: [0, 1]})
|
|
|
- await this.getProjectsSelectTreeData({
|
|
|
- treeType: 0,
|
|
|
- isTask: 0,
|
|
|
- isPlan: 0,
|
|
|
- }, 'projectList')
|
|
|
- },
|
|
|
- methods: {
|
|
|
- async changeProjectInfo(val) {
|
|
|
- this.projectStageList = []
|
|
|
- this.form.projectStageId = null
|
|
|
- this.projectBOMList = []
|
|
|
- this.form.projectBomId = null
|
|
|
- this.form.parentId = null
|
|
|
- this.planList = await this.getTargetPlanTree({projectId: val, processStatus: [2], status: [0, 1]})
|
|
|
- if (!val) return
|
|
|
- await this.getProjectsSelectTreeData({
|
|
|
- treeType: 0,
|
|
|
- id: val,
|
|
|
- isTask: 0,
|
|
|
- isPlan: 0
|
|
|
- }, 'projectStageList')
|
|
|
- this.projectBOMList = await projectsBomGetTreeDataAPI(val)
|
|
|
- this.planList = await this.getTargetPlanTree({projectId: val, processStatus: [2], status: [0, 1]})
|
|
|
- this.$emit('changeProject', val)
|
|
|
},
|
|
|
- async changeProjectStagInfo(val = '') {
|
|
|
- this.form.parentId = null
|
|
|
- let params = {
|
|
|
- projectId: this.form.projectId,
|
|
|
- projectStageId: val,
|
|
|
- projectBomId: this.form.projectBomId,
|
|
|
- processStatus: [2],
|
|
|
- status: [0, 1]
|
|
|
+ watch: {
|
|
|
+ dialogForm: {
|
|
|
+ handler(val) {
|
|
|
+ this.form = {
|
|
|
+ ...this.form,
|
|
|
+ ...this.dialogForm
|
|
|
+ };
|
|
|
+ if(this.projectList.length==0){
|
|
|
+ this.projectList=[{
|
|
|
+ id:this.form.projectId,
|
|
|
+ name:this.form.projectName
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ this.$nextTick(async () => {
|
|
|
+ //通过项目去查
|
|
|
+ if (this.dialogForm.projectId) {
|
|
|
+ this.projectBOMList = await projectsBomGetTreeDataAPI(
|
|
|
+ this.dialogForm.projectId
|
|
|
+ );
|
|
|
+ //查项目阶段
|
|
|
+ await this.getProjectsSelectTreeData(
|
|
|
+ {
|
|
|
+ treeType: 0,
|
|
|
+ id: this.dialogForm.projectId,
|
|
|
+ isTask: 0,
|
|
|
+ isPlan: 0
|
|
|
+ },
|
|
|
+ 'projectStageList'
|
|
|
+ );
|
|
|
+ let params = {
|
|
|
+ projectId: this.form.projectId,
|
|
|
+ projectBomId: this.form.projectBomId,
|
|
|
+ projectStageId: this.form.projectStageId,
|
|
|
+ processStatus: [2],
|
|
|
+ status: [0, 1]
|
|
|
+ };
|
|
|
+ this.planList = await this.getTargetPlanTree(params);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ deep: true
|
|
|
}
|
|
|
- this.planList = await this.getTargetPlanTree(params)
|
|
|
},
|
|
|
- async changeProjectBomInfo(val = '') {
|
|
|
- this.form.parentId = null
|
|
|
- let params = {
|
|
|
- projectId: this.form.projectId,
|
|
|
- projectBomId: val,
|
|
|
- projectStageId: this.form.projectStageId,
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ form: {
|
|
|
+ id: '',
|
|
|
+ projectId: '',
|
|
|
+ projectStageId: '',
|
|
|
+ projectBomId: '',
|
|
|
+ parentId: '',
|
|
|
+ name: '',
|
|
|
+ code: '',
|
|
|
+ responsibleDeptId: '',
|
|
|
+ responsibleDeptName: '',
|
|
|
+ responsibleUserName: '',
|
|
|
+ responsibleUserId: '',
|
|
|
+ responsibleUserIds: [],
|
|
|
+ remark: '',
|
|
|
+ proportion: '',
|
|
|
+ planStartDate: '',
|
|
|
+ planEndDate: '',
|
|
|
+ files: []
|
|
|
+ },
|
|
|
+ popoverFlag: false,
|
|
|
+ projectList: [],
|
|
|
+ projectStageList: [],
|
|
|
+ projectBOMList: [],
|
|
|
+ planList: [],
|
|
|
+ rules: {
|
|
|
+ projectId: {
|
|
|
+ required: true,
|
|
|
+ message: '请选择项目',
|
|
|
+ trigger: 'change'
|
|
|
+ },
|
|
|
+ name: { required: true, message: '请输入计划名称', trigger: 'blur' },
|
|
|
+ planStartDate: {
|
|
|
+ required: true,
|
|
|
+ message: '请选择计划开始日期',
|
|
|
+ trigger: 'change'
|
|
|
+ },
|
|
|
+ planEndDate: {
|
|
|
+ required: true,
|
|
|
+ message: '请选择计划完成日期',
|
|
|
+ trigger: 'change'
|
|
|
+ },
|
|
|
+ responsibleUserIds: {
|
|
|
+ required: true,
|
|
|
+ message: '请选择负责人',
|
|
|
+ trigger: 'change'
|
|
|
+ },
|
|
|
+ responsibleDeptId: {
|
|
|
+ required: true,
|
|
|
+ message: '请选择部门',
|
|
|
+ trigger: 'change'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ async created() {
|
|
|
+ this.planList = await this.getTargetPlanTree({
|
|
|
+ projectId: '',
|
|
|
processStatus: [2],
|
|
|
status: [0, 1]
|
|
|
- }
|
|
|
- this.planList = await this.getTargetPlanTree(params)
|
|
|
- },
|
|
|
- async changeParentInfo(val) {
|
|
|
- if (!val) return
|
|
|
- let nodeData = this.$refs?.planTreeRef?.$refs?.tree?.getCurrentNode() || {}
|
|
|
- await this.getProjectsSelectTreeData({
|
|
|
- treeType: 0,
|
|
|
- id: nodeData.projectId,
|
|
|
- isTask: 0,
|
|
|
- isPlan: 0
|
|
|
- }, 'projectStageList')
|
|
|
- this.projectBOMList = await projectsBomGetTreeDataAPI(nodeData.projectId)
|
|
|
- this.form.projectId = nodeData.projectId
|
|
|
- this.form.projectBomId = nodeData.projectBomId
|
|
|
- this.form.projectStageId = nodeData.projectStageId
|
|
|
- this.$emit('changeProject', this.form.projectId)
|
|
|
- },
|
|
|
- async getProjectsSelectTreeData(params, listName) {
|
|
|
- params.ifFilter = this.dialogType == 'view' ? '0' : '1'
|
|
|
- this[listName] = await projectsSelectTreeDataAPI(params)
|
|
|
- },
|
|
|
- async getTargetPlanTree(data = {}) {
|
|
|
- return await getTargetPlanTreeAPI(data)
|
|
|
- },
|
|
|
- downloadFile(file) {
|
|
|
- getFile({objectName: file.storePath}, file.type);
|
|
|
+ });
|
|
|
+ await this.getProjectsSelectTreeData(
|
|
|
+ {
|
|
|
+ treeType: 0,
|
|
|
+ isTask: 0,
|
|
|
+ isPlan: 0
|
|
|
+ },
|
|
|
+ 'projectList'
|
|
|
+ );
|
|
|
},
|
|
|
+ methods: {
|
|
|
+ async changeProjectInfo(val) {
|
|
|
+ this.projectStageList = [];
|
|
|
+ this.form.projectStageId = null;
|
|
|
+ this.projectBOMList = [];
|
|
|
+ this.form.projectBomId = null;
|
|
|
+ this.form.parentId = null;
|
|
|
+ this.planList = await this.getTargetPlanTree({
|
|
|
+ projectId: val,
|
|
|
+ processStatus: [2],
|
|
|
+ status: [0, 1]
|
|
|
+ });
|
|
|
+ if (!val) return;
|
|
|
+ await this.getProjectsSelectTreeData(
|
|
|
+ {
|
|
|
+ treeType: 0,
|
|
|
+ id: val,
|
|
|
+ isTask: 0,
|
|
|
+ isPlan: 0
|
|
|
+ },
|
|
|
+ 'projectStageList'
|
|
|
+ );
|
|
|
+ this.projectBOMList = await projectsBomGetTreeDataAPI(val);
|
|
|
+ this.planList = await this.getTargetPlanTree({
|
|
|
+ projectId: val,
|
|
|
+ processStatus: [2],
|
|
|
+ status: [0, 1]
|
|
|
+ });
|
|
|
+ this.$emit('changeProject', val);
|
|
|
+ },
|
|
|
+ async changeProjectStagInfo(val = '') {
|
|
|
+ this.form.parentId = null;
|
|
|
+ let params = {
|
|
|
+ projectId: this.form.projectId,
|
|
|
+ projectStageId: val,
|
|
|
+ projectBomId: this.form.projectBomId,
|
|
|
+ processStatus: [2],
|
|
|
+ status: [0, 1]
|
|
|
+ };
|
|
|
+ this.planList = await this.getTargetPlanTree(params);
|
|
|
+ },
|
|
|
+ async changeProjectBomInfo(val = '') {
|
|
|
+ this.form.parentId = null;
|
|
|
+ let params = {
|
|
|
+ projectId: this.form.projectId,
|
|
|
+ projectBomId: val,
|
|
|
+ projectStageId: this.form.projectStageId,
|
|
|
+ processStatus: [2],
|
|
|
+ status: [0, 1]
|
|
|
+ };
|
|
|
+ this.planList = await this.getTargetPlanTree(params);
|
|
|
+ },
|
|
|
+ async changeParentInfo(val) {
|
|
|
+ if (!val) return;
|
|
|
+ let nodeData =
|
|
|
+ this.$refs?.planTreeRef?.$refs?.tree?.getCurrentNode() || {};
|
|
|
+ await this.getProjectsSelectTreeData(
|
|
|
+ {
|
|
|
+ treeType: 0,
|
|
|
+ id: nodeData.projectId,
|
|
|
+ isTask: 0,
|
|
|
+ isPlan: 0
|
|
|
+ },
|
|
|
+ 'projectStageList'
|
|
|
+ );
|
|
|
+ this.projectBOMList = await projectsBomGetTreeDataAPI(
|
|
|
+ nodeData.projectId
|
|
|
+ );
|
|
|
+ this.form.projectId = nodeData.projectId;
|
|
|
+ this.form.projectBomId = nodeData.projectBomId;
|
|
|
+ this.form.projectStageId = nodeData.projectStageId;
|
|
|
+ this.$emit('changeProject', this.form.projectId);
|
|
|
+ },
|
|
|
+ async getProjectsSelectTreeData(params, listName) {
|
|
|
+ params.ifFilter = this.dialogType == 'view' ? '0' : '1';
|
|
|
+ this[listName] = await projectsSelectTreeDataAPI(params);
|
|
|
+ },
|
|
|
+ async getTargetPlanTree(data = {}) {
|
|
|
+ return await getTargetPlanTreeAPI(data);
|
|
|
+ },
|
|
|
+ downloadFile(file) {
|
|
|
+ getFile({ objectName: file.storePath }, file.type);
|
|
|
+ },
|
|
|
|
|
|
- validForm() {
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
- this.$refs.form.validate(valid => {
|
|
|
- if (!valid) {
|
|
|
- this.$message.warning('有必填项未填,请检查')
|
|
|
- reject('有必填项未填,请检查')
|
|
|
- } else {
|
|
|
- resolve(this.form)
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
+ validForm() {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ this.$refs.form.validate((valid) => {
|
|
|
+ if (!valid) {
|
|
|
+ this.$message.warning('有必填项未填,请检查');
|
|
|
+ reject('有必填项未填,请检查');
|
|
|
+ } else {
|
|
|
+ resolve(this.form);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
-}
|
|
|
+ };
|
|
|
</script>
|
|
|
|
|
|
-
|
|
|
-<style scoped lang="scss">
|
|
|
-
|
|
|
-</style>
|
|
|
+<style scoped lang="scss"></style>
|