wsx 1 vuosi sitten
vanhempi
commit
eb1def58b2

+ 10 - 1
src/api/project-manage/index.js

@@ -332,7 +332,7 @@ export async function projectsStageTerminationAPI(id) {
  * @id id
  */
 export async function getProjectAndCategoryLevelTree(id) {
-  const res = await request.get(`/pro/projects/getProjectAndCategoryLevelTree`,{});
+  const res = await request.get(`/pro/projects/getProjectAndCategoryLevelTree/${id}`,{});
   if (res.data.code == 0) {
     return res.data;
   }
@@ -351,3 +351,12 @@ export async function getProjectCalender(data) {
 }
 
 
+export async function getTaskByProject(data) {
+  const res = await request.post(`/pro/projectstask/getTaskByProject`,data);
+
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+

+ 9 - 2
src/components/AssetTree/index.vue

@@ -96,7 +96,11 @@
     async mounted() {
       if (this.init) {
         if (this.code) {
+          console.log('有code', this.code);
+
           let typeObj = await getProduceTreeByCode(this.code);
+          console.log(typeObj);
+
           await this.getTreeData(typeObj[0]?.id);
         } else {
           await this.getTreeData(this.id);
@@ -109,11 +113,14 @@
       },
       // 获取树结构数据
       async getTreeData(id, defChecked) {
+        let rootObj = await getProduceTreeByCode('XM1');
+        let rootId = rootObj[0].id;
+
         try {
           this.treeLoading = true;
 
           const res = this.isProjects
-            ? await getProjectAndCategoryLevelTree()
+            ? await getProjectAndCategoryLevelTree(rootId)
             : await getTreeByPid(id);
 
           this.treeLoading = false;
@@ -124,7 +131,7 @@
               this.treeList = this.treeFormate(this.treeList);
             }
             this.$nextTick(() => {
-              if(this.isProjects){
+              if (this.isProjects) {
                 this.setCurrentKey(defChecked);
               }
               // 默认高亮第一级树节点

+ 15 - 5
src/components/linkParentDialog/index.vue

@@ -32,6 +32,8 @@
             :columns="tableColumns"
             :datasource="datasource"
             row-key="id"
+            :pageSize="3"
+            :pageSizes="[3, 4, 30, 40, 50, 100]"
             height="calc(100vh - 430px)"
             class="dict-table"
             @cell-click="cellClick"
@@ -296,8 +298,9 @@
         this.handleClose();
       },
       reload(where) {
-        this.$refs.table.reload({ page: 1, pageNum: 1, where });
-        this.$refs.table.reRenderTable();
+        console.log(where);
+        this.$refs.table.reload({ pageNum: 1, where });
+        // this.$refs.table.reRenderTable();
       },
       handleNodeClick(data) {
         this.params.type = data.id;
@@ -341,7 +344,11 @@
       },
       /* 表格数据源 */
       async datasource({ page, limit, where, order }) {
-        if (!this.rootId) {
+        console.log(this.rootId);
+
+        if (this.rootId) {
+          console.log(this.parentId);
+
           await this.getTreeList();
           console.log();
 
@@ -353,6 +360,8 @@
         }
         console.log(this.rootId);
 
+        this.$refs.treeListRef.$refs.tree.setCurrentKey(this.rootId);
+
         return projectsPageAPI({
           pageNum: page,
           size: limit,
@@ -372,13 +381,14 @@
         const res = await this.treeApi(this.treeApiCode);
         this.treeList = res;
         this.rootId = res[0].id;
-        this.params = { ...this.tableDataParams, type: this.rootId };
+        this.params = { type: this.rootId };
       }
     },
 
     created() {
-      // this.getTreeList();
+      this.getTreeList();
       this.getDictList();
+      // this.treeList();
       console.log(this.parentId);
       // this.radio=this.parentId
       // 这里以后可能要带出选择的项,应该是后端返回的数据列表的数据中带一个page的字段,每个子项目在哪个页

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 572 - 593
src/views/BOMmanage/ProjectDetailDialog.vue


+ 530 - 529
src/views/project-manage/project-initiation/components/project-form.vue

@@ -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>

+ 2 - 2
src/views/project-manage/team-manage/components/add-or-edit-dialog.vue

@@ -22,9 +22,9 @@
     ></team-info-table>
     <div slot="footer">
       <el-button type="primary" size="small" @click="submit">保 存</el-button>
-      <el-button type="primary" size="small" @click="submit('sub')"
+      <!-- <el-button type="primary" size="small" @click="submit('sub')"
         >提 交</el-button
-      >
+      > -->
       <el-button size="small" @click="cancel">关 闭</el-button>
     </div>
   </ele-modal>

+ 1 - 2
src/views/project-manage/team-manage/components/detail-dialog.vue

@@ -116,12 +116,11 @@ export default {
           fixed: 'left'
         },
         {
-          prop: 'type',
+          prop: 'typeName',
           label: '项目类型',
           showOverflowTooltip: true,
           minWidth: 150,
           align: 'center',
-          slot: 'type',
         },
         {
           prop: 'code',

+ 161 - 160
src/views/project-manage/team-manage/components/team-Info-table.vue

@@ -1,7 +1,6 @@
 <template>
   <div>
     <el-form ref="form" :model="form">
-
       <!-- 数据表格 -->
       <ele-pro-table
         ref="table"
@@ -17,26 +16,27 @@
         <!-- 表头工具栏 -->
         <template v-slot:toolbar>
           <el-button
-            v-if="dialogType!=='view'"
+            v-if="dialogType !== 'view'"
             size="small"
             type="primary"
             icon="el-icon-plus"
             class="ele-btn-icon"
-            @click="handleAddInfo">
+            @click="handleAddInfo"
+          >
             选择人员
           </el-button>
         </template>
 
-        <template v-slot:action="{row,$index}">
+        <template v-slot:action="{ row, $index }">
           <el-popconfirm
             class="ele-action"
             title="确定要删除此信息吗?"
-            :disabled="form.datasource.length==1"
+            :disabled="form.datasource.length == 1"
             @confirm="handleDelInfo($index)"
           >
             <template v-slot:reference>
               <el-link
-                :disabled="form.datasource.length==1"
+                :disabled="form.datasource.length == 1"
                 type="danger"
                 :underline="false"
                 icon="el-icon-delete"
@@ -49,176 +49,177 @@
       </ele-pro-table>
     </el-form>
 
-    <select-person-dialog :select-person-dialog-flag.sync="selectPersonDialogFlag" :multiple="true"
-                          ref="selectPersonDialogRef"
-                          v-if="selectPersonDialogFlag" @changeParent="changeParent"></select-person-dialog>
+    <select-person-dialog
+      :select-person-dialog-flag.sync="selectPersonDialogFlag"
+      :multiple="true"
+      ref="selectPersonDialogRef"
+      v-if="selectPersonDialogFlag"
+      @changeParent="changeParent"
+    ></select-person-dialog>
   </div>
 </template>
 
-
 <script>
+  import fileUpload from '@/components/upload/fileUpload.vue';
+  import selectPersonDialog from '@/BIZComponents/user-select/user-select.vue';
 
-
-import fileUpload from "@/components/upload/fileUpload.vue";
-import selectPersonDialog from "@/BIZComponents/user-select/user-select.vue";
-
-export default {
-  type: "team-Info-table",
-  components: {
-    fileUpload,
-    selectPersonDialog
-
-  },
-  props: {
-    dialogForm: {
-      type: Object,
-      default: () => {
-        return {
-          ...this.form
+  export default {
+    type: 'team-Info-table',
+    components: {
+      fileUpload,
+      selectPersonDialog
+    },
+    props: {
+      dialogForm: {
+        type: Object,
+        default: () => {
+          return {
+            ...this.form
+          };
         }
+      },
+      dialogType: {
+        type: String,
+        default: ''
       }
     },
-    dialogType: {
-      type: String,
-      default: ''
+    watch: {
+      dialogForm: {
+        handler(val) {
+          this.form.datasource = this.dialogForm.teamUserList || [];
+        },
+        deep: true
+      }
     },
-  },
-  watch: {
-    dialogForm: {
-      handler(val) {
-        this.form.datasource = this.dialogForm.teamUserList || []
-      },
-      deep: true,
+    data() {
+      return {
+        editIndex: undefined, //当前修改数据的下标
+        selectPersonDialogFlag: false,
+        statusOptions: [
+          { value: 1, label: '全职' },
+          { value: 2, label: '兼职' },
+          { value: 3, label: '实习' },
+          { value: 4, label: '正式' },
+          { value: 5, label: '试用' },
+          { value: 6, label: '离职' }
+        ],
+        form: {
+          datasource: []
+        }
+      };
     },
-  },
-  data() {
-    return {
-      editIndex: undefined,//当前修改数据的下标
-      selectPersonDialogFlag: false,
-      statusOptions: [
-        {value: 1, label: '全职'},
-        {value: 2, label: '兼职'},
-        {value: 3, label: '实习'},
-        {value: 4, label: '正式'},
-        {value: 5, label: '试用'},
-        {value: 6, label: '离职'}
-      ],
-      form: {
-        datasource: []
-      },
-
-    }
-  },
-  computed: {
-    columns() {
-      let list = [
-        {
-          columnKey: 'index',
-          label: '序号',
-          type: 'index',
-          width: 55,
-          align: 'center',
-          showOverflowTooltip: true,
-          fixed: 'left'
-        },
-        {
-          prop: 'name',
-          label: '姓名',
-          showOverflowTooltip: true,
-          align: 'center',
-          minWidth: 110
-        },
-        {
-          prop: 'deptName',
-          label: '部门',
-          showOverflowTooltip: true,
-          align: 'center',
-          minWidth: 110
-        },
-        {
-          prop: 'jobNumber',
-          label: '工号',
-          showOverflowTooltip: true,
-          align: 'center',
-          minWidth: 110
-        },
-        {
-          prop: 'sex',
-          label: '性别',
-          showOverflowTooltip: true,
-          minWidth: 80,
-          align: 'center',
-          formatter: (_row, _column, cellValue) => {
-            return cellValue == 1 ? '男' : cellValue == 2 ? '女' : '';
+    computed: {
+      columns() {
+        let list = [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'name',
+            label: '姓名',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            prop: 'deptName',
+            label: '部门',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            prop: 'jobNumber',
+            label: '工号',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            prop: 'sex',
+            label: '性别',
+            showOverflowTooltip: true,
+            minWidth: 80,
+            align: 'center',
+            formatter: (_row, _column, cellValue) => {
+              return cellValue == 1 ? '男' : cellValue == 2 ? '女' : '';
+            }
+          },
+          {
+            prop: 'status',
+            label: '状态',
+            align: 'center',
+            width: 100,
+            formatter: (_row, _column, cellValue) => {
+              const dom = this.statusOptions.find((item) => {
+                return item.value == cellValue;
+              });
+              return dom ? dom.label : '';
+            }
           }
-        },
-        {
-          prop: 'status',
-          label: '状态',
-          align: 'center',
-          width: 100,
-          formatter: (_row, _column, cellValue) => {
-            const dom = this.statusOptions.find((item) => {
-              return item.value == cellValue;
-            });
-            return dom ? dom.label : '';
+        ];
+        let action = [
+          {
+            columnKey: 'action',
+            slot: 'action',
+            label: '操作',
+            resizable: false,
+            width: 90,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'right'
           }
-        }
-
-      ]
-      let action = [{
-        columnKey: 'action',
-        slot: 'action',
-        label: '操作',
-        resizable: false,
-        width: 90,
-        align: 'center',
-        showOverflowTooltip: true,
-        fixed: 'right'
-      },]
-      this.dialogType === 'view' ? list = [...list] : list = [...list, ...action]
-      return list
-    },
-  },
-  methods: {
-
-    //新增人员
-    handleAddInfo() {
-      this.selectPersonDialogFlag = true
+        ];
+        this.dialogType === 'view'
+          ? (list = [...list])
+          : (list = [...list, ...action]);
+        return list;
+      }
     },
+    methods: {
+      //新增人员
+      handleAddInfo() {
+        this.selectPersonDialogFlag = true;
+      },
 
-    changeParent(list) {
-      list.forEach(item => {
-        this.$delete(item, 'createTime')
-        if (!this.form.datasource.some(i => i.id == item.id)) {
-          this.form.datasource.push(item)
-        }
-      });
-    },
-    //删除关联信息数据
-    handleDelInfo(index) {
-      this.form.datasource.splice(index, 1)
-    },
-    getTableValidate() {
-      return new Promise((resolve, reject) => {
-        if (this.form.datasource.length == 0) return this.$message.warning('请添加至少一位人员')
-        this.$refs.form.validate((valid) => {
-          if (!valid) {
-            this.$message.warning('有必填项未填,请检查')
-            reject('有必填项未填,请检查')
-          } else {
-            resolve(this.form.datasource)
+      changeParent(list) {
+        list.forEach((item) => {
+          this.$delete(item, 'createTime');
+          if (!this.form.datasource.some((i) => i.id == item.id)) {
+            this.form.datasource.push(item);
           }
-        })
-      })
-    },
-  }
-}
+        });
+      },
+      //删除关联信息数据
+      handleDelInfo(index) {
+        this.form.datasource.splice(index, 1);
+      },
+      getTableValidate() {
+        return new Promise((resolve, reject) => {
+          if (this.form.datasource.length == 0)
+            return this.$message.warning('请添加至少一位人员');
+          this.$refs.form.validate((valid) => {
+            if (!valid) {
+              this.$message.warning('有必填项未填,请检查');
+              reject('有必填项未填,请检查');
+            } else {
+              resolve(this.form.datasource);
+            }
+          });
+        });
+      }
+    }
+  };
 </script>
 
-
 <style scoped lang="scss">
-:deep(.el-form-item) {
-  margin-bottom: 0;
-}
+  :deep(.el-form-item) {
+    margin-bottom: 0;
+  }
 </style>

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä