|
|
@@ -332,563 +332,564 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {
|
|
|
- getProjectCode,
|
|
|
- projectsToTreeAPI,
|
|
|
- getProjectCodeG,
|
|
|
- projectsPageAPI
|
|
|
-} from '@/api/project-manage';
|
|
|
-import { projectsTeamPageAPI } from '@/api/project-manage/team';
|
|
|
+ import {
|
|
|
+ getProjectCode,
|
|
|
+ projectsToTreeAPI,
|
|
|
+ getProjectCodeG,
|
|
|
+ projectsPageAPI
|
|
|
+ } from '@/api/project-manage';
|
|
|
+ import { projectsTeamPageAPI } from '@/api/project-manage/team';
|
|
|
|
|
|
-import linkParentDialog from '@/components/linkParentDialog';
|
|
|
+ import linkParentDialog from '@/components/linkParentDialog';
|
|
|
|
|
|
-import PersonSelect from '@/components/CommomSelect/person-select.vue';
|
|
|
-import customDialog from '../../components/custom-dialog.vue';
|
|
|
-import fileUpload from '@/BIZComponents/addDoc/index.vue';
|
|
|
-import { getFile } from '@/api/system/file';
|
|
|
-import contractListDialog from '@/views/project-manage/components/contractListDialog.vue';
|
|
|
-import orderListDialog from '@/BIZComponents/orderListDialog/orderListDialog.vue';
|
|
|
-import { getProduceTreeByCode } from '@/api/custom';
|
|
|
-import moment from 'moment';
|
|
|
-import { cityData } from 'ele-admin/packages/utils/regions';
|
|
|
+ import PersonSelect from '@/components/CommomSelect/person-select.vue';
|
|
|
+ import customDialog from '../../components/custom-dialog.vue';
|
|
|
+ import fileUpload from '@/BIZComponents/addDoc/index.vue';
|
|
|
+ import { getFile } from '@/api/system/file';
|
|
|
+ import contractListDialog from '@/views/project-manage/components/contractListDialog.vue';
|
|
|
+ import orderListDialog from '@/BIZComponents/orderListDialog/orderListDialog.vue';
|
|
|
+ import { getProduceTreeByCode } from '@/api/custom';
|
|
|
+ import moment from 'moment';
|
|
|
+ import { cityData } from 'ele-admin/packages/utils/regions';
|
|
|
|
|
|
-import { contactDetail } from '@/api/eos';
|
|
|
+ import { contactDetail } from '@/api/eos';
|
|
|
|
|
|
-import { reviewStatusEnum } from '@/enum/dict';
|
|
|
-export default {
|
|
|
- name: 'project-form',
|
|
|
- components: {
|
|
|
- fileUpload,
|
|
|
- PersonSelect,
|
|
|
- customDialog,
|
|
|
- contractListDialog,
|
|
|
- orderListDialog,
|
|
|
- linkParentDialog
|
|
|
- },
|
|
|
- props: {
|
|
|
- code: {
|
|
|
- type: String,
|
|
|
- default: ''
|
|
|
+ import { reviewStatusEnum } from '@/enum/dict';
|
|
|
+ export default {
|
|
|
+ name: 'project-form',
|
|
|
+ components: {
|
|
|
+ fileUpload,
|
|
|
+ PersonSelect,
|
|
|
+ customDialog,
|
|
|
+ contractListDialog,
|
|
|
+ orderListDialog,
|
|
|
+ linkParentDialog
|
|
|
},
|
|
|
- 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 };
|
|
|
- // 回显地址选择器
|
|
|
- if (
|
|
|
- this.form.contactAddressId &&
|
|
|
- this.form.contactAddressId.length > 0
|
|
|
- ) {
|
|
|
- this.form.contactAddressId = this.form.contactAddressId.split(',');
|
|
|
+ props: {
|
|
|
+ code: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
+ dialogType: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
+ dialogForm: {
|
|
|
+ type: Object,
|
|
|
+ default: () => {
|
|
|
+ return {
|
|
|
+ ...this.form
|
|
|
+ };
|
|
|
}
|
|
|
- this.$nextTick(async () => {
|
|
|
- await this.getUserList(this.dialogForm.responsibleDeptId);
|
|
|
- });
|
|
|
},
|
|
|
- deep: true
|
|
|
- }
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- tableDataParams: {
|
|
|
- code: '',
|
|
|
- name: ''
|
|
|
+ teamList: {
|
|
|
+ type: Array,
|
|
|
+ default: () => {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deptList: {
|
|
|
+ type: Array,
|
|
|
+ default: () => {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
},
|
|
|
- tableColumns: [
|
|
|
- {
|
|
|
- width: 45,
|
|
|
- type: 'selection',
|
|
|
- columnKey: 'selection',
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- columnKey: 'index',
|
|
|
- label: '序号',
|
|
|
- type: 'index',
|
|
|
- width: 55,
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'typeName',
|
|
|
- label: '项目类型',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 150,
|
|
|
- align: 'center'
|
|
|
- // slot: 'type',
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'code',
|
|
|
- label: '项目编码',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 160,
|
|
|
- slot: 'code',
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'name',
|
|
|
- label: '项目名称',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 140
|
|
|
- },
|
|
|
|
|
|
- {
|
|
|
- prop: 'responsibleDeptName',
|
|
|
- label: '负责部门',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 100
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'responsibleUserName',
|
|
|
- label: '项目经理',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 100
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'teamName',
|
|
|
- label: '项目团队',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 100
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'cycle',
|
|
|
- label: '项目周期',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 100
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'budget',
|
|
|
- label: '项目预算',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110,
|
|
|
- formatter: (_row, _column, cellValue) => {
|
|
|
- return cellValue
|
|
|
- ? cellValue + this.getDictV('pro_projects_budget_unit', _row.unit)
|
|
|
- : '';
|
|
|
+ deptTreeList: {
|
|
|
+ type: Array,
|
|
|
+ default: () => {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ dialogForm: {
|
|
|
+ handler(val) {
|
|
|
+ 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);
|
|
|
+ });
|
|
|
},
|
|
|
- {
|
|
|
- prop: 'planStartDate',
|
|
|
- label: '计划开始日期',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 120
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'planEndDate',
|
|
|
- label: '计划完成日期',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 120
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'realStartTime',
|
|
|
- label: '实际开始日期',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 120
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'realEndTime',
|
|
|
- label: '实际完成日期',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 120
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'cost',
|
|
|
- label: '费用(元)',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 140
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'status',
|
|
|
- label: '项目状态',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 100,
|
|
|
- slot: 'status'
|
|
|
+ deep: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ tableDataParams: {
|
|
|
+ code: '',
|
|
|
+ name: ''
|
|
|
},
|
|
|
- {
|
|
|
- prop: 'processStatus',
|
|
|
- label: '审核状态',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 100,
|
|
|
- formatter: (_row, _column, cellValue) => {
|
|
|
- return reviewStatusEnum[_row.processStatus].label;
|
|
|
+ tableColumns: [
|
|
|
+ {
|
|
|
+ width: 45,
|
|
|
+ type: 'selection',
|
|
|
+ columnKey: 'selection',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnKey: 'index',
|
|
|
+ label: '序号',
|
|
|
+ type: 'index',
|
|
|
+ width: 55,
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'typeName',
|
|
|
+ label: '项目类型',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 150,
|
|
|
+ align: 'center'
|
|
|
+ // slot: 'type',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'code',
|
|
|
+ label: '项目编码',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 160,
|
|
|
+ slot: 'code',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'name',
|
|
|
+ label: '项目名称',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 140
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'responsibleDeptName',
|
|
|
+ label: '负责部门',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 100
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'responsibleUserName',
|
|
|
+ label: '项目经理',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 100
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'teamName',
|
|
|
+ label: '项目团队',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 100
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'cycle',
|
|
|
+ label: '项目周期',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 100
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'budget',
|
|
|
+ label: '项目预算',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110,
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
+ return cellValue
|
|
|
+ ? cellValue +
|
|
|
+ this.getDictV('pro_projects_budget_unit', _row.unit)
|
|
|
+ : '';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'planStartDate',
|
|
|
+ label: '计划开始日期',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 120
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'planEndDate',
|
|
|
+ label: '计划完成日期',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 120
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'realStartTime',
|
|
|
+ label: '实际开始日期',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 120
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'realEndTime',
|
|
|
+ label: '实际完成日期',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 120
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'cost',
|
|
|
+ label: '费用(元)',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 140
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'status',
|
|
|
+ label: '项目状态',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 100,
|
|
|
+ slot: 'status'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'processStatus',
|
|
|
+ label: '审核状态',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 100,
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
+ return reviewStatusEnum[_row.processStatus].label;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'isOverTime',
|
|
|
+ label: '是否超时',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 100,
|
|
|
+ slot: 'isOverTime'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'isOverbudget',
|
|
|
+ label: '是否超预算',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 100,
|
|
|
+ slot: 'isOverbudget'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'speedPercent',
|
|
|
+ label: '项目进度',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 150,
|
|
|
+ slot: 'speedPercent'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnKey: 'action',
|
|
|
+ label: '操作',
|
|
|
+ width: 280,
|
|
|
+ align: 'center',
|
|
|
+ resizable: false,
|
|
|
+ slot: 'action',
|
|
|
+ fixed: 'right'
|
|
|
}
|
|
|
+ ],
|
|
|
+
|
|
|
+ getProduceTreeByCode: '',
|
|
|
+ linkParentDialogFlag: false,
|
|
|
+ rootId: [],
|
|
|
+ // 编码规则要传的参数
|
|
|
+ ruleCode: '',
|
|
|
+ cityData,
|
|
|
+ typeOptions: [
|
|
|
+ {
|
|
|
+ value: 1,
|
|
|
+ label: '订单'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 2,
|
|
|
+ label: '客户'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 3,
|
|
|
+ label: '合同'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ 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: [],
|
|
|
+ relationType: 1
|
|
|
},
|
|
|
- {
|
|
|
- prop: 'isOverTime',
|
|
|
- label: '是否超时',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 100,
|
|
|
- slot: 'isOverTime'
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'isOverbudget',
|
|
|
- label: '是否超预算',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 100,
|
|
|
- slot: 'isOverbudget'
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'speedPercent',
|
|
|
- label: '项目进度',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 150,
|
|
|
- slot: 'speedPercent'
|
|
|
- },
|
|
|
- {
|
|
|
- columnKey: 'action',
|
|
|
- label: '操作',
|
|
|
- width: 280,
|
|
|
- align: 'center',
|
|
|
- resizable: false,
|
|
|
- slot: 'action',
|
|
|
- fixed: 'right'
|
|
|
+ typeTreeList: [],
|
|
|
+ projectList: [],
|
|
|
+ grouplist: [],
|
|
|
+ customDialogFlag: false,
|
|
|
+ contractDialogFlag: false,
|
|
|
+ rules: {
|
|
|
+ type: {
|
|
|
+ required: true,
|
|
|
+ message: '请选择项目类型',
|
|
|
+ trigger: 'change'
|
|
|
+ },
|
|
|
+ name: { required: true, message: '请输入项目名称', trigger: 'blur' },
|
|
|
+ budget: {
|
|
|
+ required: true,
|
|
|
+ message: '请输入项目预算',
|
|
|
+ trigger: 'blur'
|
|
|
+ },
|
|
|
+ // contactId: {
|
|
|
+ // required: true,
|
|
|
+ // message: '请选择客户',
|
|
|
+ // trigger: 'blur'
|
|
|
+ // },
|
|
|
+
|
|
|
+ teamId: {
|
|
|
+ required: true,
|
|
|
+ message: '请选择项目团队',
|
|
|
+ trigger: 'change'
|
|
|
+ },
|
|
|
+ responsibleDeptId: {
|
|
|
+ required: true,
|
|
|
+ message: '请选择负责部门',
|
|
|
+ trigger: 'change'
|
|
|
+ },
|
|
|
+ responsibleUserId: {
|
|
|
+ required: true,
|
|
|
+ message: '请选择项目经理',
|
|
|
+ trigger: 'change'
|
|
|
+ },
|
|
|
+ planStartDate: {
|
|
|
+ required: true,
|
|
|
+ message: '请选择计划开始日期',
|
|
|
+ trigger: 'change'
|
|
|
+ },
|
|
|
+ planEndDate: {
|
|
|
+ required: true,
|
|
|
+ message: '请选择计划完成日期',
|
|
|
+ trigger: 'change'
|
|
|
+ },
|
|
|
+ code: {
|
|
|
+ required: true,
|
|
|
+ message: '请输入项目编码',
|
|
|
+ trigger: ['blur', 'change']
|
|
|
+ }
|
|
|
}
|
|
|
- ],
|
|
|
+ };
|
|
|
+ },
|
|
|
+ async created() {
|
|
|
+ // this.projectsPageAPI = projectsPageAPI;
|
|
|
+ this.projectList = await projectsToTreeAPI({
|
|
|
+ processStatus: '2',
|
|
|
+ treeType: '0'
|
|
|
+ });
|
|
|
+ console.log(this.projectList);
|
|
|
+ this.getProduceTreeByCode = getProduceTreeByCode;
|
|
|
+ const res1 = await getProduceTreeByCode('XM1');
|
|
|
+ this.typeTreeList = res1;
|
|
|
+ // 根id为了tree不能选择树节点
|
|
|
+ this.rootId = res1.map((item) => item.id);
|
|
|
+ let res2 = await projectsTeamPageAPI({ pageNum: 1, size: 10 });
|
|
|
+ this.grouplist = res2;
|
|
|
+ this.ruleCode = this.typeTreeList[0].ruleCode;
|
|
|
+ },
|
|
|
|
|
|
- getProduceTreeByCode: '',
|
|
|
- linkParentDialogFlag: false,
|
|
|
- rootId: [],
|
|
|
- // 编码规则要传的参数
|
|
|
- ruleCode: '',
|
|
|
- cityData,
|
|
|
- typeOptions: [
|
|
|
- {
|
|
|
- value: 1,
|
|
|
- label: '订单'
|
|
|
- },
|
|
|
- {
|
|
|
- value: 2,
|
|
|
- label: '客户'
|
|
|
- },
|
|
|
- {
|
|
|
- value: 3,
|
|
|
- label: '合同'
|
|
|
+ methods: {
|
|
|
+ clearParentId() {
|
|
|
+ this.form.parentId = null;
|
|
|
+ this.form.parentName = null;
|
|
|
+ console.log('qing');
|
|
|
+ },
|
|
|
+ projectsPageAPI,
|
|
|
+ close() {
|
|
|
+ this.linkParentDialogFlag = false;
|
|
|
+ },
|
|
|
+ openLinkParent(...arg) {
|
|
|
+ console.log(arg);
|
|
|
+ let _this = this;
|
|
|
+ _this.$refs.selectRef.blur();
|
|
|
+ this.linkParentDialogFlag = true;
|
|
|
+ },
|
|
|
+ linkParentFn(obj) {
|
|
|
+ console.log(obj);
|
|
|
+ this.form.parentId = obj.id;
|
|
|
+ this.form.parentName = obj.name;
|
|
|
+ },
|
|
|
+ setCycleValue(val, prop) {
|
|
|
+ if (!this.form[prop] || !val) return (this.form.cycle = '');
|
|
|
+ const a = moment(this.form.planEndDate);
|
|
|
+ const b = moment(this.form.planStartDate);
|
|
|
+ this.form.cycle = a.diff(b, 'days') + 1 + ' 天'; // 1
|
|
|
+ },
|
|
|
+ async changeType(e) {
|
|
|
+ if (this.rootId.includes(e)) {
|
|
|
+ console.log('不饿能');
|
|
|
+ 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: [],
|
|
|
- relationType: 1
|
|
|
+ this.form.code = await getProjectCodeG(this.ruleCode);
|
|
|
},
|
|
|
- typeTreeList: [],
|
|
|
- projectList: [],
|
|
|
- grouplist: [],
|
|
|
- customDialogFlag: false,
|
|
|
- contractDialogFlag: false,
|
|
|
- rules: {
|
|
|
- type: {
|
|
|
- required: true,
|
|
|
- message: '请选择项目类型',
|
|
|
- trigger: 'change'
|
|
|
- },
|
|
|
- name: { required: true, message: '请输入项目名称', trigger: 'blur' },
|
|
|
- budget: {
|
|
|
- required: true,
|
|
|
- message: '请输入项目预算',
|
|
|
- trigger: 'blur'
|
|
|
- },
|
|
|
- // contactId: {
|
|
|
- // required: true,
|
|
|
- // message: '请选择客户',
|
|
|
- // trigger: 'blur'
|
|
|
- // },
|
|
|
-
|
|
|
- teamId: {
|
|
|
- required: true,
|
|
|
- message: '请选择项目团队',
|
|
|
- trigger: 'change'
|
|
|
- },
|
|
|
- responsibleDeptId: {
|
|
|
- required: true,
|
|
|
- message: '请选择负责部门',
|
|
|
- trigger: 'change'
|
|
|
- },
|
|
|
- responsibleUserId: {
|
|
|
- required: true,
|
|
|
- message: '请选择项目经理',
|
|
|
- trigger: 'change'
|
|
|
- },
|
|
|
- planStartDate: {
|
|
|
- required: true,
|
|
|
- message: '请选择计划开始日期',
|
|
|
- trigger: 'change'
|
|
|
- },
|
|
|
- planEndDate: {
|
|
|
- required: true,
|
|
|
- message: '请选择计划完成日期',
|
|
|
- trigger: 'change'
|
|
|
- },
|
|
|
- code: {
|
|
|
- required: true,
|
|
|
- message: '请输入项目编码',
|
|
|
- trigger: ['blur', 'change']
|
|
|
+ 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 && this.$refs.directorRef.getList({ groupId });
|
|
|
}
|
|
|
- }
|
|
|
- };
|
|
|
- },
|
|
|
- async created() {
|
|
|
- // this.projectsPageAPI = projectsPageAPI;
|
|
|
- this.projectList = await projectsToTreeAPI({
|
|
|
- processStatus: '2',
|
|
|
- treeType: '0'
|
|
|
- });
|
|
|
- console.log(this.projectList);
|
|
|
- this.getProduceTreeByCode = getProduceTreeByCode;
|
|
|
- const res1 = await getProduceTreeByCode('XM1');
|
|
|
- this.typeTreeList = res1;
|
|
|
- // 根id为了tree不能选择树节点
|
|
|
- this.rootId = res1.map((item) => item.id);
|
|
|
- let res2 = await projectsTeamPageAPI({ pageNum: 1, size: 10 });
|
|
|
- this.grouplist = res2;
|
|
|
- this.ruleCode = this.typeTreeList[0].ruleCode;
|
|
|
- },
|
|
|
+ },
|
|
|
+ handleContractBtn(e) {
|
|
|
+ if (e.target.nodeName == 'I') {
|
|
|
+ this.clearInfo();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.contractDialogFlag = true;
|
|
|
+ },
|
|
|
+ handleOrder() {
|
|
|
+ this.$refs.orderListRef.open();
|
|
|
+ },
|
|
|
|
|
|
- methods: {
|
|
|
- clearParentId() {
|
|
|
- this.form.parentId = null;
|
|
|
- this.form.parentName = null;
|
|
|
- console.log('qing');
|
|
|
- },
|
|
|
- projectsPageAPI,
|
|
|
- close() {
|
|
|
- this.linkParentDialogFlag = false;
|
|
|
- },
|
|
|
- openLinkParent(...arg) {
|
|
|
- console.log(arg);
|
|
|
- let _this = this;
|
|
|
- _this.$refs.selectRef.blur();
|
|
|
- this.linkParentDialogFlag = true;
|
|
|
- },
|
|
|
- linkParentFn(obj) {
|
|
|
- console.log(obj);
|
|
|
- this.form.parentId = obj.id;
|
|
|
- this.form.parentName = obj.name;
|
|
|
- },
|
|
|
- setCycleValue(val, prop) {
|
|
|
- if (!this.form[prop] || !val) return (this.form.cycle = '');
|
|
|
- const a = moment(this.form.planEndDate);
|
|
|
- const b = moment(this.form.planStartDate);
|
|
|
- this.form.cycle = a.diff(b, 'days') + 1 + ' 天'; // 1
|
|
|
- },
|
|
|
- async changeType(e) {
|
|
|
- if (this.rootId.includes(e)) {
|
|
|
- console.log('不饿能');
|
|
|
- return;
|
|
|
- }
|
|
|
- this.form.code = await getProjectCodeG(this.ruleCode);
|
|
|
- },
|
|
|
- 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 && this.$refs.directorRef.getList({ groupId });
|
|
|
- }
|
|
|
- },
|
|
|
- handleContractBtn(e) {
|
|
|
- if (e.target.nodeName == 'I') {
|
|
|
+ clearInfo() {
|
|
|
+ this.form = Object.assign({}, this.form, {
|
|
|
+ contractName: '',
|
|
|
+ contractId: '',
|
|
|
+ contactId: '',
|
|
|
+ contactName: '',
|
|
|
+ contactRelationPhone: '',
|
|
|
+ contactRelationUserName: '',
|
|
|
+ contactAddressId: '',
|
|
|
+ contactAddress: '',
|
|
|
+ relationId: '',
|
|
|
+ relationId: '',
|
|
|
+ relationName: '',
|
|
|
+ relationCode: ''
|
|
|
+ });
|
|
|
+ },
|
|
|
+ typeChange() {
|
|
|
this.clearInfo();
|
|
|
- return;
|
|
|
- }
|
|
|
- this.contractDialogFlag = true;
|
|
|
- },
|
|
|
- handleOrder() {
|
|
|
- this.$refs.orderListRef.open();
|
|
|
- },
|
|
|
-
|
|
|
- clearInfo() {
|
|
|
- this.form = Object.assign({}, this.form, {
|
|
|
- contractName: '',
|
|
|
- contractId: '',
|
|
|
- contactId: '',
|
|
|
- contactName: '',
|
|
|
- contactRelationPhone: '',
|
|
|
- contactRelationUserName: '',
|
|
|
- contactAddressId: '',
|
|
|
- contactAddress: '',
|
|
|
- relationId: '',
|
|
|
- relationId: '',
|
|
|
- relationName: '',
|
|
|
- relationCode: ''
|
|
|
- });
|
|
|
- },
|
|
|
- typeChange() {
|
|
|
- this.clearInfo();
|
|
|
- },
|
|
|
+ },
|
|
|
|
|
|
- //选择合同信息回调
|
|
|
- getContractInfo(obj) {
|
|
|
- this.form.contractId = obj.id;
|
|
|
- this.form.contractName = obj.contractName;
|
|
|
- this.form.relationId = obj.id;
|
|
|
- this.form.relationName = obj.contractName;
|
|
|
- this.form.relationCode = obj.contractNo;
|
|
|
+ //选择合同信息回调
|
|
|
+ getContractInfo(obj) {
|
|
|
+ this.form.contractId = obj.id;
|
|
|
+ this.form.contractName = obj.contractName;
|
|
|
+ this.form.relationId = obj.id;
|
|
|
+ this.form.relationName = obj.contractName;
|
|
|
+ this.form.relationCode = obj.contractNo;
|
|
|
|
|
|
- if (obj.type == 1) {
|
|
|
- this.form.contactId = obj.partaId;
|
|
|
- this.form.contactName = obj.partaName;
|
|
|
+ if (obj.type == 1) {
|
|
|
+ this.form.contactId = obj.partaId;
|
|
|
+ this.form.contactName = obj.partaName;
|
|
|
+ this.getCusInfo({ id: obj.partaId });
|
|
|
+ } else {
|
|
|
+ this.form.contactId = obj.partbId;
|
|
|
+ this.form.contactName = obj.partbName;
|
|
|
+ this.getCusInfo({ id: obj.partbId });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //选择订单信息回调
|
|
|
+ getOrderDialog(obj) {
|
|
|
+ this.form.relationId = obj.id;
|
|
|
+ this.form.relationCode = obj.orderNo;
|
|
|
this.getCusInfo({ id: obj.partaId });
|
|
|
- } else {
|
|
|
- this.form.contactId = obj.partbId;
|
|
|
- this.form.contactName = obj.partbName;
|
|
|
- this.getCusInfo({ id: obj.partbId });
|
|
|
- }
|
|
|
- },
|
|
|
- //选择订单信息回调
|
|
|
- getOrderDialog(obj) {
|
|
|
- this.form.relationId = obj.id;
|
|
|
- this.form.relationCode = obj.orderNo;
|
|
|
- this.getCusInfo({ id: obj.partaId });
|
|
|
- },
|
|
|
- //获取客户信息
|
|
|
- handleGetCus() {
|
|
|
- this.customDialogFlag = true;
|
|
|
- let item = { id: this.form.contactId };
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.customRef.open(item);
|
|
|
- });
|
|
|
- },
|
|
|
- //选择客户信息回调
|
|
|
- async getCusInfo(obj) {
|
|
|
- const { base, other } = await contactDetail(obj.id);
|
|
|
- this.form = Object.assign({}, this.form, {
|
|
|
- contactId: base.id,
|
|
|
- contactName: base.name,
|
|
|
- contactRelationPhone: obj.linkPhone || obj.phone,
|
|
|
- contactRelationUserName: obj.linkName
|
|
|
- });
|
|
|
- if (other.addressId) {
|
|
|
- this.form.contactAddressId =
|
|
|
- other.addressId && other.addressId.split(',');
|
|
|
- this.form.contactAddressName = other.addressName;
|
|
|
- this.form.contactAddress = other.address;
|
|
|
- } else if (base.addressId) {
|
|
|
- this.form.contactAddressId =
|
|
|
- base.addressId && base.addressId.split(',');
|
|
|
- this.form.contactAddressName = base.addressName;
|
|
|
- this.form.contactAddress = base.address;
|
|
|
- }
|
|
|
- },
|
|
|
- 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('有必填项未填,请检查');
|
|
|
- reject('有必填项未填,请检查');
|
|
|
- } else {
|
|
|
- // 基本信息处理
|
|
|
- if (this.$refs.sendAddress.getCheckedNodes()) {
|
|
|
- let node = this.$refs.sendAddress.getCheckedNodes()[0];
|
|
|
- if (node) {
|
|
|
- this.form.contactAddressId = node.path.join();
|
|
|
- this.form.contactAddressName = node.pathLabels.join();
|
|
|
- } else {
|
|
|
- this.form.contactAddressId = '';
|
|
|
- this.form.contactAddressName = '';
|
|
|
+ },
|
|
|
+ //获取客户信息
|
|
|
+ handleGetCus() {
|
|
|
+ this.customDialogFlag = true;
|
|
|
+ let item = { id: this.form.contactId };
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.customRef.open(item);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //选择客户信息回调
|
|
|
+ async getCusInfo(obj) {
|
|
|
+ const { base, other } = await contactDetail(obj.id);
|
|
|
+ this.form = Object.assign({}, this.form, {
|
|
|
+ contactId: base.id,
|
|
|
+ contactName: base.name,
|
|
|
+ contactRelationPhone: obj.linkPhone || obj.phone,
|
|
|
+ contactRelationUserName: obj.linkName
|
|
|
+ });
|
|
|
+ if (other.addressId) {
|
|
|
+ this.form.contactAddressId =
|
|
|
+ other.addressId && other.addressId.split(',');
|
|
|
+ this.form.contactAddressName = other.addressName;
|
|
|
+ this.form.contactAddress = other.address;
|
|
|
+ } else if (base.addressId) {
|
|
|
+ this.form.contactAddressId =
|
|
|
+ base.addressId && base.addressId.split(',');
|
|
|
+ this.form.contactAddressName = base.addressName;
|
|
|
+ this.form.contactAddress = base.address;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 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('有必填项未填,请检查');
|
|
|
+ reject('有必填项未填,请检查');
|
|
|
+ } else {
|
|
|
+ // 基本信息处理
|
|
|
+ if (this.$refs.sendAddress.getCheckedNodes()) {
|
|
|
+ let node = this.$refs.sendAddress.getCheckedNodes()[0];
|
|
|
+ if (node) {
|
|
|
+ this.form.contactAddressId = node.path.join();
|
|
|
+ this.form.contactAddressName = node.pathLabels.join();
|
|
|
+ } else {
|
|
|
+ this.form.contactAddressId = '';
|
|
|
+ this.form.contactAddressName = '';
|
|
|
+ }
|
|
|
}
|
|
|
+ resolve(this.form);
|
|
|
}
|
|
|
- resolve(this.form);
|
|
|
- }
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
-};
|
|
|
+ };
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss"></style>
|