wsx 11 місяців тому
батько
коміт
7697320b52

+ 9 - 1
src/api/project-manage/team.js

@@ -7,7 +7,15 @@ import request from '@/utils/request';
 export async function projectsTeamPageAPI(data) {
 export async function projectsTeamPageAPI(data) {
   const res = await request.post('/pro/projectteam/page', data);
   const res = await request.post('/pro/projectteam/page', data);
   if (res.data.code == 0) {
   if (res.data.code == 0) {
-    console.log(res)
+    return res.data.data.list;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 前面的改了到处都会有bug,所以这里单独给项目团队列表
+export async function projectsTeamPage(data) {
+  const res = await request.post('/pro/projectteam/page', data);
+  if (res.data.code == 0) {
     return res.data.data;
     return res.data.data;
   }
   }
   return Promise.reject(new Error(res.data.message));
   return Promise.reject(new Error(res.data.message));

+ 0 - 2
src/components/linkParentDialog/index.vue

@@ -32,8 +32,6 @@
             :columns="tableColumns"
             :columns="tableColumns"
             :datasource="datasource"
             :datasource="datasource"
             row-key="id"
             row-key="id"
-            :pageSize="3"
-            :pageSizes="[3, 4, 30, 40, 50, 100]"
             height="calc(100vh - 430px)"
             height="calc(100vh - 430px)"
             class="dict-table"
             class="dict-table"
             @cell-click="cellClick"
             @cell-click="cellClick"

+ 168 - 167
src/views/project-manage/project-initiation/components/addOrEditDialog.vue

@@ -30,185 +30,186 @@
   </ele-modal>
   </ele-modal>
 </template>
 </template>
 
 
-
 <script>
 <script>
-import projectForm from './project-form.vue';
-import projectInfoTable from './projectInfoTable.vue';
-import {
-  projectsGetByIdAPI,
-  projectsSaveAPI,
-  projectsUpdateAPI,
-  submit
-} from '@/api/project-manage';
-import { listOrganizations } from '@/api/system/organization';
-import {
-  projectsTeamGetByIdAPI,
-  projectsTeamPageAPI
-} from '@/api/project-manage/team';
-import { deepClone } from '@/utils';
+  import projectForm from './project-form.vue';
+  import projectInfoTable from './projectInfoTable.vue';
+  import {
+    projectsGetByIdAPI,
+    projectsSaveAPI,
+    projectsUpdateAPI,
+    submit
+  } from '@/api/project-manage';
+  import { listOrganizations } from '@/api/system/organization';
+  import {
+    projectsTeamGetByIdAPI,
+    projectsTeamPageAPI
+  } from '@/api/project-manage/team';
+  import { deepClone } from '@/utils';
 
 
-export default {
-  name: 'addOrEditDialog',
-  components: {
-    projectForm,
-    projectInfoTable
-  },
-  props: {
-    addOrEditDialogFlag: {
-      type: Boolean,
-      default: false
-    }
-  },
-  data() {
-    return {
-      title: '',
-      dialogType: '',
-      dialogForm: {
-        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: [],
-      userList: [],
-      deptList: [],
-      deptTreeList: []
-    };
-  },
-  created() {
-    this.getDeptList();
-    this.getTeamList();
-  },
-  methods: {
-    init(row = {}, type) {
-      this.title = type === 'add' ? '新增' : '编辑';
-      this.dialogType = type;
-      if (type === 'add') {
-        console.log(row);
-        this.$set(this.dialogForm, 'parentId', row.id);
-      } else {
-        this.getInfo(row.id);
-      }
+  export default {
+    name: 'addOrEditDialog',
+    components: {
+      projectForm,
+      projectInfoTable
     },
     },
-    async getInfo(id) {
-      this.dialogForm = await projectsGetByIdAPI(id);
-      this.dialogForm.type = this.dialogForm.type + '';
-      this.dialogForm.level = this.dialogForm.level + '';
-      this.dialogForm.parentId =
-        this.dialogForm.parentId == 0 ? '' : this.dialogForm.parentId;
-      this.dialogForm.stageList.forEach((item, index) => {
-        let userIds = item.responsibleUserList.map((i) => i.userId) || [];
-        this.$set(item, 'responsibleUserIds', userIds);
-      });
-      if (this.dialogForm.teamId) this.getUserList(this.dialogForm.teamId);
-    },
-    // 获取部门数据
-    getDeptList() {
-      listOrganizations().then((list) => {
-        this.deptList = list;
-        this.deptTreeList = this.$util.toTreeData({
-          data: list,
-          idField: 'id',
-          parentIdField: 'parentId'
-        });
-      });
+    props: {
+      addOrEditDialogFlag: {
+        type: Boolean,
+        default: false
+      }
     },
     },
-    // 获取项目团队集合
-    getTeamList() {
-      projectsTeamPageAPI({
-        pageNum: 1,
-        size: 999,
-        processStatus: 2
-      }).then((list) => {
-        this.teamList = list;
-      });
+    data() {
+      return {
+        title: '',
+        dialogType: '',
+        dialogForm: {
+          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: [],
+          contactAddress: ''
+        },
+        teamList: [],
+        userList: [],
+        deptList: [],
+        deptTreeList: []
+      };
     },
     },
-    // 获取项目团队下团队人员集合
-    getUserList(val) {
-      if (!val) {
-        this.userList = [];
-        return;
-      }
-      projectsTeamGetByIdAPI(val).then((list) => {
-        this.userList = list.teamUserList;
-      });
+    created() {
+      this.getDeptList();
+      this.getTeamList();
     },
     },
+    methods: {
+      init(row = {}, type) {
+        this.title = type === 'add' ? '新增' : '编辑';
+        this.dialogType = type;
+        if (type === 'add') {
+          console.log(row);
+          this.$set(this.dialogForm, 'parentId', row.id);
+        } else {
+          this.getInfo(row.id);
+        }
+      },
+      async getInfo(id) {
+        this.dialogForm = await projectsGetByIdAPI(id);
+        this.dialogForm.type = this.dialogForm.type + '';
+        this.dialogForm.level = this.dialogForm.level + '';
+        this.dialogForm.parentId =
+          this.dialogForm.parentId == 0 ? '' : this.dialogForm.parentId;
+        this.dialogForm.stageList.forEach((item, index) => {
+          let userIds = item.responsibleUserList.map((i) => i.userId) || [];
+          this.$set(item, 'responsibleUserIds', userIds);
+        });
+        if (this.dialogForm.teamId) this.getUserList(this.dialogForm.teamId);
+      },
+      // 获取部门数据
+      getDeptList() {
+        listOrganizations().then((list) => {
+          this.deptList = list;
+          this.deptTreeList = this.$util.toTreeData({
+            data: list,
+            idField: 'id',
+            parentIdField: 'parentId'
+          });
+        });
+      },
+      // 获取项目团队集合
+      getTeamList() {
+        projectsTeamPageAPI({
+          pageNum: 1,
+          size: 999
+          // processStatus: 2
+        }).then((list) => {
+          this.teamList = list;
+        });
+      },
+      // 获取项目团队下团队人员集合
+      getUserList(val) {
+        if (!val) {
+          this.userList = [];
+          return;
+        }
+        projectsTeamGetByIdAPI(val).then((list) => {
+          this.userList = list.teamUserList;
+        });
+      },
 
 
-    async submit(type = '') {
-      let form = await this.$refs.projectForm.validForm();
-      // form.stageList = await this.$refs.projectInfoTable.getTableValidate();
-      form.realStartDate = null;
-      form.realEndDate = null;
-      // form.stageList.forEach((item) => {
-      //   item.responsibleUserList = item.responsibleUserIds.map(
-      //     i => {
-      //       return {
-      //         userId: i,
-      //         userName: this.userList.find(u => u.id === i).name
-      //       }
-      //     }
-      //   ) || []
-      // })
+      async submit(type = '') {
+        let form = await this.$refs.projectForm.validForm();
+        // form.stageList = await this.$refs.projectInfoTable.getTableValidate();
+        form.realStartDate = null;
+        form.realEndDate = null;
+        // form.stageList.forEach((item) => {
+        //   item.responsibleUserList = item.responsibleUserIds.map(
+        //     i => {
+        //       return {
+        //         userId: i,
+        //         userName: this.userList.find(u => u.id === i).name
+        //       }
+        //     }
+        //   ) || []
+        // })
 
 
-      const API =
-        this.dialogType === 'add' ? projectsSaveAPI : projectsUpdateAPI;
-      const id = await API(form);
-      if (type === 'sub') {
-        this.processSubmit(id);
-        return;
-      }
-      this.$message.success('操作成功');
-      this.cancel();
-      this.$emit('reload');
-    },
-    //流程提交
-    processSubmit(id = '') {
-      submit({
-        projectId: this.dialogType === 'add' ? id : this.dialogForm.id
-      }).then((res) => {
-        this.$message.success('提交成功');
+        const API =
+          this.dialogType === 'add' ? projectsSaveAPI : projectsUpdateAPI;
+        const id = await API(form);
+        if (type === 'sub') {
+          this.processSubmit(id);
+          return;
+        }
+        this.$message.success('操作成功');
         this.cancel();
         this.cancel();
         this.$emit('reload');
         this.$emit('reload');
-      });
-    },
-    cancel() {
-      this.$emit('update:addOrEditDialogFlag', false);
+      },
+      //流程提交
+      processSubmit(id = '') {
+        submit({
+          projectId: this.dialogType === 'add' ? id : this.dialogForm.id
+        }).then((res) => {
+          this.$message.success('提交成功');
+          this.cancel();
+          this.$emit('reload');
+        });
+      },
+      cancel() {
+        this.$refs.projectForm.$refs.form.resetFields();
+
+        this.$emit('update:addOrEditDialogFlag', false);
+      }
     }
     }
-  }
-};
+  };
 </script>
 </script>
 
 
-
 <style scoped lang="scss">
 <style scoped lang="scss">
-:deep(.el-dialog) {
-  margin-top: 0 !important;
-}
+  :deep(.el-dialog) {
+    margin-top: 0 !important;
+  }
 </style>
 </style>

+ 6 - 2
src/views/project-manage/project-initiation/components/project-form.vue

@@ -272,7 +272,7 @@
               style="width: 35%"
               style="width: 35%"
             ></el-cascader>
             ></el-cascader>
             <el-input
             <el-input
-              placeholder="请输入"
+              placeholder="请输入详细地址"
               v-model="form.contactAddress"
               v-model="form.contactAddress"
               :disabled="dialogType == 'view'"
               :disabled="dialogType == 'view'"
               style="width: 65%"
               style="width: 65%"
@@ -405,6 +405,8 @@ export default {
     watch: {
     watch: {
       dialogForm: {
       dialogForm: {
         handler(val) {
         handler(val) {
+          console.log();
+          
           this.form = { ...this.dialogForm };
           this.form = { ...this.dialogForm };
           // 回显地址选择器
           // 回显地址选择器
           if (
           if (
@@ -717,7 +719,7 @@ export default {
       this.typeTreeList = res1;
       this.typeTreeList = res1;
       // 根id为了tree不能选择树节点
       // 根id为了tree不能选择树节点
       this.rootId = res1.map((item) => item.id);
       this.rootId = res1.map((item) => item.id);
-      let res2 = await projectsTeamPageAPI({ pageNum: 1, size: 10 });
+      let res2 = await projectsTeamPageAPI({ pageNum: 1, size: 999 });
       this.grouplist = res2;
       this.grouplist = res2;
       this.ruleCode = this.typeTreeList[0].ruleCode;
       this.ruleCode = this.typeTreeList[0].ruleCode;
     },
     },
@@ -840,6 +842,8 @@ export default {
       },
       },
       //选择客户信息回调
       //选择客户信息回调
       async getCusInfo(obj) {
       async getCusInfo(obj) {
+        console.log(obj);
+        
         const { base, other } = await contactDetail(obj.id);
         const { base, other } = await contactDetail(obj.id);
         this.form = Object.assign({}, this.form, {
         this.form = Object.assign({}, this.form, {
           contactId: base.id,
           contactId: base.id,

+ 2 - 2
src/views/project-manage/team-manage/index.vue

@@ -109,7 +109,7 @@
   import popModal from '@/components/pop-modal';
   import popModal from '@/components/pop-modal';
   import {
   import {
     projectsTeamDeleteAPI,
     projectsTeamDeleteAPI,
-    projectsTeamPageAPI,
+    projectsTeamPage,
     submit
     submit
   } from '@/api/project-manage/team';
   } from '@/api/project-manage/team';
   import { reviewStatusEnum } from '@/enum/dict';
   import { reviewStatusEnum } from '@/enum/dict';
@@ -206,7 +206,7 @@
     methods: {
     methods: {
       /* 表格数据源 */
       /* 表格数据源 */
       async datasource({ page, limit, where, parent }) {
       async datasource({ page, limit, where, parent }) {
-        return projectsTeamPageAPI({
+        return projectsTeamPage({
           pageNum: page,
           pageNum: page,
           size: limit,
           size: limit,
           ...where
           ...where