|
|
@@ -1,28 +1,50 @@
|
|
|
<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"
|
|
|
+ >
|
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item
|
|
|
- prop="code"
|
|
|
- label="项目编码">
|
|
|
- <el-input :disabled="dialogType=='view'" v-model="form.code"></el-input>
|
|
|
+ <el-form-item prop="code" label="项目编码">
|
|
|
+ <el-input
|
|
|
+ :disabled="dialogType == 'view'"
|
|
|
+ v-model="form.code"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item
|
|
|
- prop="type"
|
|
|
- label="项目类型">
|
|
|
- <dict-selection dict-name="项目类型" v-model="form.type" :disabled="dialogType=='view'"
|
|
|
- @change="changeType"></dict-selection>
|
|
|
+ <el-form-item prop="type" label="项目类型">
|
|
|
+ <!-- <dict-selection
|
|
|
+ dict-name="项目类型"
|
|
|
+ v-model="form.type"
|
|
|
+ :disabled="dialogType == 'view'"
|
|
|
+ @change="changeType"
|
|
|
+ ></dict-selection> -->
|
|
|
+ <ele-tree-select
|
|
|
+ filterable
|
|
|
+ :disabled="dialogType == 'view'"
|
|
|
+ clearable
|
|
|
+ :data="typeTreeList"
|
|
|
+ v-model="form.type"
|
|
|
+ valueKey="id"
|
|
|
+ labelKey="name"
|
|
|
+ placeholder="请选择"
|
|
|
+ @change="changeType"
|
|
|
+ default-expand-all
|
|
|
+ expand-on-click-node
|
|
|
+ />
|
|
|
</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-row>
|
|
|
@@ -30,7 +52,7 @@
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="从属项目">
|
|
|
<ele-tree-select
|
|
|
- :disabled="dialogType=='view'"
|
|
|
+ :disabled="dialogType == 'view'"
|
|
|
clearable
|
|
|
filterable
|
|
|
:data="projectList"
|
|
|
@@ -44,11 +66,9 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item
|
|
|
- label="负责部门"
|
|
|
- prop="applyDeptId">
|
|
|
+ <el-form-item label="负责部门" prop="applyDeptId">
|
|
|
<ele-tree-select
|
|
|
- :disabled="dialogType=='view'"
|
|
|
+ :disabled="dialogType == 'view'"
|
|
|
clearable
|
|
|
:data="deptTreeList"
|
|
|
v-model="form.responsibleDeptId"
|
|
|
@@ -61,96 +81,120 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item
|
|
|
- prop="responsibleUserId"
|
|
|
- label="项目经理">
|
|
|
+ <el-form-item prop="responsibleUserId" label="项目经理">
|
|
|
<personSelect
|
|
|
- :disabled="dialogType=='view'"
|
|
|
+ :disabled="dialogType == 'view'"
|
|
|
ref="directorRef"
|
|
|
:init="false"
|
|
|
v-model="form.responsibleUserId"
|
|
|
- @selfChange="personChange"/>
|
|
|
+ @selfChange="personChange"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
-
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
-
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item
|
|
|
- prop="teamId"
|
|
|
- label="项目团队">
|
|
|
- <el-select v-model="form.teamId" placeholder="请选择" style="width: 100%;" :disabled="dialogType=='view'" clearable @change="teamChange">
|
|
|
+ <el-form-item prop="teamId" label="项目团队">
|
|
|
+ <el-select
|
|
|
+ v-model="form.teamId"
|
|
|
+ placeholder="请选择"
|
|
|
+ style="width: 100%"
|
|
|
+ :disabled="dialogType == 'view'"
|
|
|
+ clearable
|
|
|
+ @change="teamChange"
|
|
|
+ >
|
|
|
<el-option
|
|
|
v-for="item in teamList"
|
|
|
:key="item.id"
|
|
|
:label="item.name"
|
|
|
- :value="item.id">
|
|
|
+ :value="item.id"
|
|
|
+ >
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
-
|
|
|
<el-form-item label="项目预算">
|
|
|
<el-row>
|
|
|
<el-col :span="18">
|
|
|
- <el-input type="number" :min="0" v-model="form.budget" :disabled="dialogType=='view'">
|
|
|
+ <el-input
|
|
|
+ type="number"
|
|
|
+ :min="0"
|
|
|
+ v-model="form.budget"
|
|
|
+ :disabled="dialogType == 'view'"
|
|
|
+ >
|
|
|
</el-input>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
- <dict-selection dict-name="预算单位" v-model="form.unit"
|
|
|
- :disabled="dialogType=='view'"></dict-selection>
|
|
|
+ <dict-selection
|
|
|
+ dict-name="预算单位"
|
|
|
+ v-model="form.unit"
|
|
|
+ :disabled="dialogType == 'view'"
|
|
|
+ ></dict-selection>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="项目优先级">
|
|
|
- <dict-selection dict-name="项目优先级别" v-model="form.level"
|
|
|
- :disabled="dialogType=='view'"></dict-selection>
|
|
|
+ <dict-selection
|
|
|
+ dict-name="项目优先级别"
|
|
|
+ v-model="form.level"
|
|
|
+ :disabled="dialogType == 'view'"
|
|
|
+ ></dict-selection>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item
|
|
|
- prop="cycle"
|
|
|
- label="项目周期">
|
|
|
- <el-input v-model="form.cycle" :disabled="dialogType=='view'"></el-input>
|
|
|
+ <el-form-item prop="cycle" label="项目周期">
|
|
|
+ <el-input
|
|
|
+ v-model="form.cycle"
|
|
|
+ :disabled="dialogType == 'view'"
|
|
|
+ ></el-input>
|
|
|
</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>
|
|
|
|
|
|
-
|
|
|
<!-- <el-col :span="8">-->
|
|
|
<!-- <el-form-item label="权重占比">-->
|
|
|
<!-- <el-input type="number" :min="0" :max="100" v-model="form.proportion" :disabled="dialogType=='view'">-->
|
|
|
@@ -160,9 +204,8 @@
|
|
|
<!-- </el-input>-->
|
|
|
<!-- </el-form-item>-->
|
|
|
<!-- </el-col>-->
|
|
|
-
|
|
|
</el-row>
|
|
|
- <el-row>
|
|
|
+ <!-- <el-row>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item
|
|
|
label="关联合同"
|
|
|
@@ -190,43 +233,130 @@
|
|
|
</el-col>
|
|
|
|
|
|
<!-- <el-col :span="8">-->
|
|
|
- <!-- <el-form-item-->
|
|
|
- <!-- prop="stage"-->
|
|
|
- <!-- label="项目阶段">-->
|
|
|
- <!-- <el-input v-model="form.stage" :disabled="dialogType=='view'"></el-input>-->
|
|
|
- <!-- </el-form-item>-->
|
|
|
- <!-- </el-col>-->
|
|
|
+ <!-- <el-form-item-->
|
|
|
+ <!-- prop="stage"-->
|
|
|
+ <!-- label="项目阶段">-->
|
|
|
+ <!-- <el-input v-model="form.stage" :disabled="dialogType=='view'"></el-input>-->
|
|
|
+ <!-- </el-form-item>-->
|
|
|
+ <!-- </el-col>-->
|
|
|
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
+ <!-- </el-row> -->
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item prop="relationType" label="关联类型">
|
|
|
+ <el-select
|
|
|
+ v-model="form.relationType"
|
|
|
+ placeholder="请选择"
|
|
|
+ @change="typeChange"
|
|
|
+ style="width: 100%"
|
|
|
+ :disabled="dialogType == 'view'"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in typeOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="8" v-if="form.relationType == 3">
|
|
|
+ <el-form-item label="关联合同" prop="contractName">
|
|
|
+ <el-input
|
|
|
+ :disabled="dialogType == 'view'"
|
|
|
+ clearable
|
|
|
+ v-model="form.contractName"
|
|
|
+ @click.native="handleContractBtn"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="8" v-if="form.relationType == 1">
|
|
|
+ <el-form-item label="关联订单" prop="relationCode">
|
|
|
+ <el-input
|
|
|
+ :disabled="dialogType == 'view'"
|
|
|
+ clearable
|
|
|
+ v-model="form.relationCode"
|
|
|
+ @click.native="handleOrder"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="客户名称">
|
|
|
+ <el-input
|
|
|
+ v-model="form.contactName"
|
|
|
+ @click.native="handleGetCus"
|
|
|
+ readonly
|
|
|
+ :disabled="dialogType == 'view' || !!form.relationId"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="联系人">
|
|
|
+ <el-input
|
|
|
+ v-model="form.contactRelationUserName"
|
|
|
+ :disabled="dialogType == 'view'"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item prop="contactRelationPhone" label="客户联系电话">
|
|
|
+ <el-input
|
|
|
+ v-model="form.contactRelationPhone"
|
|
|
+ :disabled="dialogType == 'view'"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="16">
|
|
|
+ <el-form-item label="联系地址" prop="contactAddressId">
|
|
|
+ <el-cascader
|
|
|
+ clearable
|
|
|
+ v-model="form.contactAddressId"
|
|
|
+ :options="cityData"
|
|
|
+ ref="sendAddress"
|
|
|
+ :disabled="dialogType == 'view'"
|
|
|
+ style="width: 35%"
|
|
|
+ ></el-cascader>
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入详细地址"
|
|
|
+ v-model="form.contactAddress"
|
|
|
+ :disabled="dialogType == 'view'"
|
|
|
+ style="width: 65%"
|
|
|
+ ></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.content" :disabled="dialogType=='view'"></el-input>
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ :rows="2"
|
|
|
+ v-model="form.content"
|
|
|
+ :disabled="dialogType == 'view'"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item
|
|
|
- label="附件">
|
|
|
+ <el-form-item label="附件">
|
|
|
<fileMain v-model="form.files" :type="dialogType"></fileMain>
|
|
|
-<!-- <fileUpload-->
|
|
|
-<!-- v-if="dialogType!='view'"-->
|
|
|
-<!-- style="position: absolute"-->
|
|
|
-<!-- v-model="form.files"-->
|
|
|
-<!-- module="main"-->
|
|
|
-<!-- :showLib="false"-->
|
|
|
-<!-- />-->
|
|
|
-<!-- <el-link-->
|
|
|
-<!-- v-else-->
|
|
|
-<!-- v-for="item in form.files"-->
|
|
|
-<!-- type="primary"-->
|
|
|
-<!-- :underline="false"-->
|
|
|
-<!-- @click="downloadFile(item)">-->
|
|
|
-<!-- {{ item.name }}-->
|
|
|
-<!-- </el-link>-->
|
|
|
-
|
|
|
+ <!-- <fileUpload-->
|
|
|
+ <!-- v-if="dialogType!='view'"-->
|
|
|
+ <!-- style="position: absolute"-->
|
|
|
+ <!-- v-model="form.files"-->
|
|
|
+ <!-- module="main"-->
|
|
|
+ <!-- :showLib="false"-->
|
|
|
+ <!-- />-->
|
|
|
+ <!-- <el-link-->
|
|
|
+ <!-- v-else-->
|
|
|
+ <!-- v-for="item in form.files"-->
|
|
|
+ <!-- type="primary"-->
|
|
|
+ <!-- :underline="false"-->
|
|
|
+ <!-- @click="downloadFile(item)">-->
|
|
|
+ <!-- {{ item.name }}-->
|
|
|
+ <!-- </el-link>-->
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
@@ -238,211 +368,274 @@
|
|
|
<!-- </el-col>-->
|
|
|
<!-- </el-row>-->
|
|
|
</el-form>
|
|
|
-
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {projectsToTreeAPI} from "@/api/bpm/components/project-manage";
|
|
|
-import PersonSelect from "@/components/CommomSelect/person-select.vue";
|
|
|
-import {getFile} from "@/api/system/file";
|
|
|
-// import fileMain from "@/components/addDoc/index.vue";
|
|
|
-export default {
|
|
|
- name: "project-form",
|
|
|
- components: {
|
|
|
- // fileMain,
|
|
|
-
|
|
|
- PersonSelect},
|
|
|
- props: {
|
|
|
- dialogType: {
|
|
|
- type: String,
|
|
|
- default: '',
|
|
|
+ import {
|
|
|
+ projectsToTreeAPI,
|
|
|
+ getProduceTreeByCode
|
|
|
+ } from '@/api/bpm/components/project-manage';
|
|
|
+
|
|
|
+ import PersonSelect from '@/components/CommomSelect/person-select.vue';
|
|
|
+ import { getFile } from '@/api/system/file';
|
|
|
+ import { cityData } from 'ele-admin/packages/utils/regions';
|
|
|
+ // import fileMain from "@/components/addDoc/index.vue";
|
|
|
+ export default {
|
|
|
+ name: 'project-form',
|
|
|
+ components: {
|
|
|
+ // fileMain,
|
|
|
+
|
|
|
+ PersonSelect
|
|
|
},
|
|
|
- dialogForm: {
|
|
|
- type: Object,
|
|
|
- default: () => {
|
|
|
- return {
|
|
|
- ...this.form
|
|
|
+ props: {
|
|
|
+ dialogType: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
+ dialogForm: {
|
|
|
+ type: Object,
|
|
|
+ default: () => {
|
|
|
+ return {
|
|
|
+ ...this.form
|
|
|
+ };
|
|
|
}
|
|
|
- }
|
|
|
- },
|
|
|
- teamList: {
|
|
|
- type: Array,
|
|
|
- default: () => {
|
|
|
- return []
|
|
|
- }
|
|
|
- },
|
|
|
- deptList: {
|
|
|
- type: Array,
|
|
|
- default: () => {
|
|
|
- return []
|
|
|
- }
|
|
|
- },
|
|
|
- deptTreeList: {
|
|
|
- type: Array,
|
|
|
- default: () => {
|
|
|
- return []
|
|
|
- }
|
|
|
- },
|
|
|
- },
|
|
|
- watch: {
|
|
|
- dialogForm: {
|
|
|
- handler(val) {
|
|
|
- this.form = {...this.dialogForm}
|
|
|
- this.$nextTick(async () => {
|
|
|
- await this.getUserList(this.dialogForm.responsibleDeptId);
|
|
|
- })
|
|
|
},
|
|
|
- deep: true,
|
|
|
- },
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- form: {
|
|
|
- budget: '',
|
|
|
- unit: '1',
|
|
|
- code: "",
|
|
|
- contactId: '',
|
|
|
- contactName: "",
|
|
|
- contactRelationPhone: "",
|
|
|
- contactRelationUserId: '',
|
|
|
- contactRelationUserName: "",
|
|
|
- content: "",
|
|
|
- cycle: "",
|
|
|
- deptUserId: '',
|
|
|
- deptUserName: "",
|
|
|
- level: "",
|
|
|
- monitorUserId: '',
|
|
|
- monitorUserName: "",
|
|
|
- planStartDate: "",
|
|
|
- planEndDate: "",
|
|
|
- proportion: undefined,
|
|
|
- name: "",
|
|
|
- parentId: '',
|
|
|
- remark: "",
|
|
|
- responsibleUserId: '',
|
|
|
- responsibleUserName: "",
|
|
|
- responsibleDeptId: "",
|
|
|
- responsibleDeptName: "",
|
|
|
- stage: "",
|
|
|
- teamId: "",
|
|
|
- teamName: "",
|
|
|
- type: '',
|
|
|
- contractId: '',
|
|
|
- contractName: '',
|
|
|
- files: [],
|
|
|
+ teamList: {
|
|
|
+ type: Array,
|
|
|
+ default: () => {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deptList: {
|
|
|
+ type: Array,
|
|
|
+ default: () => {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
},
|
|
|
- projectList: [],
|
|
|
- customDialogFlag: false,
|
|
|
- contractDialogFlag: false,
|
|
|
- rules: {
|
|
|
- type: {required: true, message: '请选择项目类型', trigger: 'change'},
|
|
|
- name: {required: true, message: '请输入项目名称', trigger: 'blur'},
|
|
|
- teamId: {required: true, message: '请选择项目团队', trigger: 'blur'},
|
|
|
- responsibleUserId: {required: true, message: '请选择项目经理', trigger: 'blur'},
|
|
|
- planStartDate: {required: true, message: '请选择计划开始日期', trigger: 'blur'},
|
|
|
- planEndDate: {required: true, message: '请选择计划完成日期', trigger: 'blur'},
|
|
|
- code: {required: true, message: '请输入项目编码', trigger: ['blur', 'change']},
|
|
|
+ deptTreeList: {
|
|
|
+ type: Array,
|
|
|
+ default: () => {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- },
|
|
|
- async created() {
|
|
|
- this.projectList = await projectsToTreeAPI({processStatus: '2', treeType: '0'})
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- methods: {
|
|
|
- async changeType(val) {
|
|
|
- this.form.code = await getProjectCode(val)
|
|
|
},
|
|
|
- async teamChange(val) {
|
|
|
- let find = this.teamList.find(e => e.id == val) || {}
|
|
|
- this.form.teamName = find.name
|
|
|
- this.$emit('teamChange', val)
|
|
|
- },
|
|
|
- // 选择负责人部门
|
|
|
- changeDeptInfo(id) {
|
|
|
- const info = this.deptList.find((e) => e.id == id) || {};
|
|
|
- this.form.responsibleDeptName = info.name;
|
|
|
- this.form.responsibleUserId = '';
|
|
|
- this.form.responsibleUserName = '';
|
|
|
- this.getUserList(id);
|
|
|
- },
|
|
|
- // 获取人员数据
|
|
|
- getUserList(groupId) {
|
|
|
- if (groupId) {
|
|
|
- this.$refs.directorRef.getList({groupId});
|
|
|
+ watch: {
|
|
|
+ dialogForm: {
|
|
|
+ handler(val) {
|
|
|
+ console.log();
|
|
|
+
|
|
|
+ this.form = { ...this.dialogForm };
|
|
|
+ // 回显地址选择器
|
|
|
+ if (
|
|
|
+ this.form.contactAddressId &&
|
|
|
+ this.form.contactAddressId.length > 0
|
|
|
+ ) {
|
|
|
+ this.form.contactAddressId = this.form.contactAddressId.split(',');
|
|
|
+ }
|
|
|
+ this.$nextTick(async () => {
|
|
|
+ await this.getUserList(this.dialogForm.responsibleDeptId);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ deep: true
|
|
|
}
|
|
|
},
|
|
|
- handleContractBtn(e) {
|
|
|
- if (e.target.nodeName == 'I') {
|
|
|
- this.form = Object.assign({}, this.form, {
|
|
|
- contractName: '',
|
|
|
- contractId: '',
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ form: {
|
|
|
+ budget: '',
|
|
|
+ unit: '1',
|
|
|
+ code: '',
|
|
|
contactId: '',
|
|
|
contactName: '',
|
|
|
contactRelationPhone: '',
|
|
|
- });
|
|
|
- return
|
|
|
- }
|
|
|
- this.contractDialogFlag = true;
|
|
|
- },
|
|
|
- //选择合同信息回调
|
|
|
- getContractInfo(obj) {
|
|
|
-
|
|
|
- this.form.contractId = obj.id
|
|
|
- this.form.contractName = obj.contractName
|
|
|
- if (obj.type == 1) {
|
|
|
- this.form.contactId = obj.partaId
|
|
|
- this.form.contactName = obj.partaName
|
|
|
- this.form.contactRelationPhone = obj.partaTel
|
|
|
- } else {
|
|
|
- this.form.contactId = obj.partbId
|
|
|
- this.form.contactName = obj.partbName
|
|
|
- this.form.contactRelationPhone = obj.partbTel
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
- //获取客户信息
|
|
|
- handleGetCus() {
|
|
|
- this.customDialogFlag = true;
|
|
|
- let item = {id: this.form.contactId};
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.customRef.open(item);
|
|
|
- })
|
|
|
-
|
|
|
+ contactRelationUserId: '',
|
|
|
+ contactRelationUserName: '',
|
|
|
+ content: '',
|
|
|
+ cycle: '',
|
|
|
+ deptUserId: '',
|
|
|
+ deptUserName: '',
|
|
|
+ level: '',
|
|
|
+ monitorUserId: '',
|
|
|
+ monitorUserName: '',
|
|
|
+ planStartDate: '',
|
|
|
+ planEndDate: '',
|
|
|
+ proportion: undefined,
|
|
|
+ name: '',
|
|
|
+ parentId: '',
|
|
|
+ remark: '',
|
|
|
+ responsibleUserId: '',
|
|
|
+ responsibleUserName: '',
|
|
|
+ responsibleDeptId: '',
|
|
|
+ responsibleDeptName: '',
|
|
|
+ stage: '',
|
|
|
+ teamId: '',
|
|
|
+ teamName: '',
|
|
|
+ type: '',
|
|
|
+ contractId: '',
|
|
|
+ contractName: '',
|
|
|
+ files: []
|
|
|
+ },
|
|
|
+ projectList: [],
|
|
|
+ customDialogFlag: false,
|
|
|
+ contractDialogFlag: false,
|
|
|
+ rules: {
|
|
|
+ type: {
|
|
|
+ required: true,
|
|
|
+ message: '请选择项目类型',
|
|
|
+ trigger: 'change'
|
|
|
+ },
|
|
|
+ name: { required: true, message: '请输入项目名称', trigger: 'blur' },
|
|
|
+ teamId: {
|
|
|
+ required: true,
|
|
|
+ message: '请选择项目团队',
|
|
|
+ trigger: 'blur'
|
|
|
+ },
|
|
|
+ responsibleUserId: {
|
|
|
+ required: true,
|
|
|
+ message: '请选择项目经理',
|
|
|
+ trigger: 'blur'
|
|
|
+ },
|
|
|
+ planStartDate: {
|
|
|
+ required: true,
|
|
|
+ message: '请选择计划开始日期',
|
|
|
+ trigger: 'blur'
|
|
|
+ },
|
|
|
+ planEndDate: {
|
|
|
+ required: true,
|
|
|
+ message: '请选择计划完成日期',
|
|
|
+ trigger: 'blur'
|
|
|
+ },
|
|
|
+ code: {
|
|
|
+ required: true,
|
|
|
+ message: '请输入项目编码',
|
|
|
+ trigger: ['blur', 'change']
|
|
|
+ }
|
|
|
+ },
|
|
|
+ typeOptions: [
|
|
|
+ {
|
|
|
+ value: 1,
|
|
|
+ label: '订单'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 2,
|
|
|
+ label: '客户'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 3,
|
|
|
+ label: '合同'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ cityData,
|
|
|
+ getProduceTreeByCode: '',
|
|
|
+ typeTreeList:[]
|
|
|
+ };
|
|
|
},
|
|
|
- //选择客户信息回调
|
|
|
- getCusInfo(obj) {
|
|
|
- this.form = Object.assign({}, this.form, {
|
|
|
- contactId: obj.id,
|
|
|
- contactName: obj.name,
|
|
|
- contactRelationPhone: obj.phone,
|
|
|
+ async created() {
|
|
|
+ this.projectList = await projectsToTreeAPI({
|
|
|
+ processStatus: '2',
|
|
|
+ treeType: '0'
|
|
|
});
|
|
|
+ const res1 = await getProduceTreeByCode('XM1');
|
|
|
+ this.typeTreeList = res1;
|
|
|
},
|
|
|
- downloadFile(file) {
|
|
|
- getFile({objectName: file.storePath}, file.type);
|
|
|
- },
|
|
|
- personChange(val, info) {
|
|
|
- this.form.responsibleUserName = info.name;
|
|
|
- },
|
|
|
- validForm() {
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
- this.$refs.form.validate(valid => {
|
|
|
- if (!valid) {
|
|
|
- this.$message.warning('有必填项未填,请检查')
|
|
|
- resolve('')
|
|
|
- } else {
|
|
|
- resolve(this.form)
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
+
|
|
|
+ methods: {
|
|
|
+ // async changeType(val) {
|
|
|
+ // this.form.code = await getProjectCode(val);
|
|
|
+ // },
|
|
|
+ async teamChange(val) {
|
|
|
+ let find = this.teamList.find((e) => e.id == val) || {};
|
|
|
+ this.form.teamName = find.name;
|
|
|
+ this.$emit('teamChange', val);
|
|
|
+ },
|
|
|
+ // 选择负责人部门
|
|
|
+ changeDeptInfo(id) {
|
|
|
+ const info = this.deptList.find((e) => e.id == id) || {};
|
|
|
+ this.form.responsibleDeptName = info.name;
|
|
|
+ this.form.responsibleUserId = '';
|
|
|
+ this.form.responsibleUserName = '';
|
|
|
+ this.getUserList(id);
|
|
|
+ },
|
|
|
+ // 获取人员数据
|
|
|
+ getUserList(groupId) {
|
|
|
+ if (groupId) {
|
|
|
+ this.$refs.directorRef.getList({ groupId });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleContractBtn(e) {
|
|
|
+ if (e.target.nodeName == 'I') {
|
|
|
+ this.form = Object.assign({}, this.form, {
|
|
|
+ contractName: '',
|
|
|
+ contractId: '',
|
|
|
+ contactId: '',
|
|
|
+ contactName: '',
|
|
|
+ contactRelationPhone: ''
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.contractDialogFlag = true;
|
|
|
+ },
|
|
|
+ //选择合同信息回调
|
|
|
+ getContractInfo(obj) {
|
|
|
+ this.form.contractId = obj.id;
|
|
|
+ this.form.contractName = obj.contractName;
|
|
|
+ if (obj.type == 1) {
|
|
|
+ this.form.contactId = obj.partaId;
|
|
|
+ this.form.contactName = obj.partaName;
|
|
|
+ this.form.contactRelationPhone = obj.partaTel;
|
|
|
+ } else {
|
|
|
+ this.form.contactId = obj.partbId;
|
|
|
+ this.form.contactName = obj.partbName;
|
|
|
+ this.form.contactRelationPhone = obj.partbTel;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //获取客户信息
|
|
|
+ handleGetCus() {
|
|
|
+ this.customDialogFlag = true;
|
|
|
+ let item = { id: this.form.contactId };
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.customRef.open(item);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //选择客户信息回调
|
|
|
+ getCusInfo(obj) {
|
|
|
+ this.form = Object.assign({}, this.form, {
|
|
|
+ contactId: obj.id,
|
|
|
+ contactName: obj.name,
|
|
|
+ contactRelationPhone: obj.phone
|
|
|
+ });
|
|
|
+ },
|
|
|
+ downloadFile(file) {
|
|
|
+ getFile({ objectName: file.storePath }, file.type);
|
|
|
+ },
|
|
|
+ personChange(val, info) {
|
|
|
+ this.form.responsibleUserName = info.name;
|
|
|
+ },
|
|
|
+ validForm() {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ this.$refs.form.validate((valid) => {
|
|
|
+ if (!valid) {
|
|
|
+ this.$message.warning('有必填项未填,请检查');
|
|
|
+ resolve('');
|
|
|
+ } else {
|
|
|
+ resolve(this.form);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ typeChange() {
|
|
|
+ this.clearInfo();
|
|
|
+ },
|
|
|
+ async changeType(e) {
|
|
|
+ if (this.rootId.includes(e)) {
|
|
|
+ console.log('不饿能');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.form.code = await getProjectCodeG(this.ruleCode);
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
-}
|
|
|
+ };
|
|
|
</script>
|
|
|
|
|
|
-
|
|
|
-<style scoped lang="scss">
|
|
|
-
|
|
|
-</style>
|
|
|
+<style scoped lang="scss"></style>
|