研发图纸文件管理系统-前端项目
longyvfengyun
2022-07-27 312d34ac315181c4b04ca4bcf6375e56b68fdd66
内容修改
2个文件已添加
7个文件已修改
334 ■■■■ 已修改文件
.env 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/components/drawUpload/DrawUpload.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/workplace/WorkPlace.vue 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/workplace/apis.js 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/workplace/handledList/HandledList.vue 202 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/workplace/handledList/index.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/workplace/handlingList/HandlingList.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/workplace/notApproved/NotApproved.vue 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/modules/account.js 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.env
@@ -8,3 +8,5 @@
VUE_APP_TBAS_KEY=admin.tabs
VUE_APP_TBAS_TITLES_KEY=admin.tabs.titles
VUE_APP_API_BASE_URL=http://api.iczer.com
VUE_APP_ROLE_LIST=admin.roleList
VUE_APP_DEPARTMENT_LIST=admin.department
src/pages/components/drawUpload/DrawUpload.vue
@@ -36,8 +36,10 @@
          </div>
        </template>
      </a-table>
      <div class="modal-footer">
        <a-button type="primary" @click="handleClick">{{ text }}</a-button>
      <div class="modal-footer" v-if="!noFooter">
        <slot name="footer">
          <a-button type="primary" @click="handleClick">{{ text }}</a-button>
        </slot>
      </div>
    </a-spin>
  </div>
@@ -60,6 +62,10 @@
    text: {
      type: String,
      default: "提交审核"
    },
    noFooter: {
      type: Boolean,
      default: false,
    }
  },
  data() {
src/pages/workplace/WorkPlace.vue
@@ -11,6 +11,7 @@
      <rejected-list :is-show="'rejected'==cardName"></rejected-list>
      <approved-list :is-show="'approved'==cardName"></approved-list>
      <handling-list :is-show="'handling'==cardName"></handling-list>
      <handled-list :is-show="'handled'==cardName"></handled-list>
    </div>
  </div>
</template>
@@ -27,9 +28,11 @@
import getItemByKey from "@/assets/js/tools/getItemByKey";
import {statusStatistic} from "@/pages/workplace/apis";
import HandlingList from "@/pages/workplace/handlingList/HandlingList";
import HandledList from "@/pages/workplace/handledList/HandledList";
export default {
  name: 'WorkPlace',
  components: {
    HandledList,
    HandlingList,
    ApprovedList,
    RejectedList,
src/pages/workplace/apis.js
@@ -80,13 +80,18 @@
/**
 * 查看分页-审批中
 * @param pageNum 当前页
 * @param pageSize 每页的数据量
 * @returns {AxiosPromise}
 */
export const approvingListPage = ()=>{
export const approvingListPage = (pageNum, pageSize)=>{
  return axios({
    method: "GET",
    url: "worksheetMain/approvingListPage",
    params: null
    params: {
      pageNum,
      pageSize
    }
  });
}
src/pages/workplace/handledList/HandledList.vue
New file
@@ -0,0 +1,202 @@
<template>
  <page-toggle-transition v-if="isShow" :disabled="animate.disabled" :animate="animate.name" :direction="animate.direction">
    <div class="page-content">
      <advance-table
          :data-source="dataSource"
          :columns="columns"
          :loading="loading"
          title="已处理"
          row-key="beginTime"
          @search="onSearch"
          @refresh="onRefresh"
          @reset="onReset"
          :format-conditions="true"
          :pagination="{
        current: page,
        pageSize: pageSize,
        total: total,
        showSizeChanger: true,
        showLessItems: true,
        showQuickJumper: true,
        showTotal: (total, range) => `第 ${range[0]}-${range[1]} 条,总计 ${total} 条`,
        onChange: onPageChange,
        onShowSizeChange: onSizeChange,
      }">
        <template slot="action" slot-scope="scope">
          <a @click="show(scope)">详情</a>
        </template>
      </advance-table>
      <a-modal
          v-model="workDetailVisible"
          :title="workDetailTitle"
          centered
          :footer="false"
          :width="1300">
        <draw-upload v-if="isReload" :list="subList" text="审核结果" no-footer></draw-upload>
      </a-modal>
    </div>
  </page-toggle-transition>
</template>
<script>
import PageToggleTransition from "@/components/transition/PageToggleTransition";
import AdvanceTable from "@/components/table/advance/AdvanceTable";
import {mapState} from "vuex";
import {handledListPage, linkInfo} from "@/pages/workplace/apis";
import DrawUpload from "@/pages/components/drawUpload/DrawUpload";
import AuditForm from "@/pages/workplace/workForm/auditForm";
export default {
  name: "HandledList",
  components: {
    DrawUpload,
    PageToggleTransition,
    AdvanceTable,
    AuditForm,
  },
  props: {
    isShow: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {
      loading: false,
      workDetailVisible: false,
      auditFormVisible: false,
      page: 1,
      pageSize: 10,
      total: 0,
      conditions: {},
      columns: [
        {
          title: '工单标题',
          dataIndex: 'title',
          key: 'title',
          align: "center"
        },
        {
          title: '工单描述',
          dataIndex: 'description',
          key: 'description',
          align: "center"
        },
        {
          title: '创建人',
          dataIndex: 'createUserName',
          key: 'createUserName',
          align: "center"
        },
        {
          title: '创建日期',
          dataIndex: 'beginTime',
          key: 'beginTime',
          align: "center"
        },
        {
          title: '操作',
          dataIndex: "operation",
          key: 'operation',
          align: "center",
          fixed: 'right',
          width: 100,
          scopedSlots: { customRender: 'action' }
        },
      ],
      dataSource: [],
      title: "",
      subList: [],
      formData: {
        id: 0,    // 连接id
        mainId: 0,    // 主id
        linkStatus: 1,    // 审批状态 1:通过,2:驳回
        dealReason: "",   // 审核建议
        nextUser: 0,    // 下一个审核的用户id
      }
    }
  },
  methods: {
    show(scope) {
      let record = scope.record;
      this.title = record.title;
      this.searchBomList(record.id);
    },
    searchBomList(id) {
      let loading = this.$layer.loading();
      linkInfo(id).then(res=>{
        this.$layer.close(loading);
        let rs = res.data;
        let rsData = rs.data;
        let data = [];
        if(rs.code == 1) {
          data = rsData.approvingBomList;
        }
        this.subList = data;
        this.workDetailVisible = true;
        // 设置审核表单
        this.formData.id = rsData.links[rsData.links.length-1].id;
        this.formData.mainId = rsData.id;
      }).catch(error=>{
        console.log(error);
        this.$layer.close(loading);
      });
    },
    onSearch(conditions, searchOptions) {
      this.page = 1
      this.conditions = conditions
      this.searchData();
    },
    onPageChange(page, pageSize) {
      this.page = page;
      this.pageSize = pageSize;
      this.searchData();
    },
    onSizeChange(current, size) {
      this.page = 1;
      this.pageSize = size;
      this.searchData();
    },
    onRefresh(conditions) {
      this.conditions = conditions
      this.searchData()
    },
    onReset(conditions) {
      this.conditions = conditions
      this.searchData()
    },
    searchData() {
      handledListPage(this.page, this.pageSize).then(res=>{
        let rs = res.data;
        console.log(rs);
        let data = [];
        if(rs.code == 1) {
          data = rs.data.list.map(item=>{
            item.createUserName = item.createUser.name;
            return item;
          });
        }
        this.total = rs.data.total;
        this.dataSource = data;
      });
    },
  },
  computed: {
    ...mapState('setting', ['animate']),
    workDetailTitle() {
      return this.title;
    },
    isReload() {
      return this.workDetailVisible || this.auditFormVisible?true:false;
    }
  },
  mounted() {
    this.searchData();
  }
}
</script>
<style scoped>
</style>
src/pages/workplace/handledList/index.js
New file
@@ -0,0 +1,2 @@
import HandledList from "./HandledList";
export default HandledList;
src/pages/workplace/handlingList/HandlingList.vue
@@ -34,15 +34,6 @@
          :width="1300">
        <draw-upload v-if="isReload" :list="subList" @success="showAudit" text="审核结果"></draw-upload>
      </a-modal>
      <a-modal
          v-model="auditFormVisible"
          title="审核"
          centered
          :maskClosable="false"
          :footer="false"
          :width="500">
        <audit-form v-if="isReload" @success="auditSuccess"></audit-form>
      </a-modal>
    </div>
  </page-toggle-transition>
</template>
src/pages/workplace/notApproved/NotApproved.vue
@@ -5,7 +5,7 @@
        :columns="columns"
        :loading="loading"
        title="审批中"
        row-key="name"
        row-key="beginTime"
        @search="onSearch"
        @refresh="onRefresh"
        @reset="onReset"
@@ -22,8 +22,6 @@
        onShowSizeChange: onSizeChange,
      }">
      <template slot="action" slot-scope="scope">
        <a @click="scope.record">下载</a>
        <a-divider type="vertical"></a-divider>
        <a @click="scope.record">详情</a>
      </template>
    </advance-table>
@@ -34,6 +32,7 @@
import PageToggleTransition from "@/components/transition/PageToggleTransition";
import AdvanceTable from "@/components/table/advance/AdvanceTable";
import {mapState} from "vuex";
import {approvingListPage} from "@/pages/workplace/apis";
export default {
  name: "NotApproved",
  components: {
@@ -51,32 +50,32 @@
      loading: false,
      page: 1,
      pageSize: 10,
      total: 100,
      total: 0,
      conditions: {},
      columns: [
        {
          title: '图纸编码',
          dataIndex: 'name',
          key: 'name',
          align: "center",
          searchAble: true
          title: '工单标题',
          dataIndex: 'title',
          key: 'title',
          align: "center"
        },
        {
          title: '图纸类型',
          dataIndex: 'type',
          key: 'type',
          align: "center",
          searchAble: true,
          dataType: 'select',
          search: {
            selectOptions: []
          }
          title: '工单描述',
          dataIndex: 'description',
          key: 'description',
          align: "center"
        },
        {
          title: '上传日期',
          dataIndex: 'uploadDate',
          key: 'uploadDate',
          align: "center",
          title: '创建人',
          dataIndex: 'createUserName',
          key: 'createUserName',
          align: "center"
        },
        {
          title: '创建日期',
          dataIndex: 'beginTime',
          key: 'beginTime',
          align: "center"
        },
        {
          title: '操作',
@@ -84,6 +83,7 @@
          key: 'operation',
          align: "center",
          fixed: 'right',
          width: 100,
          scopedSlots: { customRender: 'action' }
        },
      ],
@@ -120,11 +120,24 @@
      this.searchData()
    },
    searchData() {
      console.log("查询后台返回参数");
      approvingListPage(this.page, this.pageSize).then(res=>{
        let rs = res.data;
        let data = [];
        if(rs.code == 1) {
          data = rs.data.list.map(item=>{
            return item;
          });
        }
        this.total = rs.data.total;
        this.dataSource = data;
      });
    },
  },
  computed: {
    ...mapState('setting', ['animate']),
  },
  mounted() {
    this.searchData();
  }
}
</script>
src/store/modules/account.js
@@ -4,7 +4,9 @@
    user: undefined,
    permissions: null,
    roles: null,
    routesConfig: null
    routesConfig: null,
    roleList: null,
    departmentList: null
  },
  getters: {
    user: state => {
@@ -53,7 +55,31 @@
        }
      }
      return state.routesConfig
    }
    },
    departmentList: state => {
      if(!state.departmentList) {
        try {
          const departmentList = localStorage.getItem(process.env.VUE_APP_DEPARTMENT_LIST);
          state.departmentList = JSON.parse(departmentList);
          state.departmentList = state.departmentList?state.departmentList:[];
        }catch (e){
          console.error(e.message);
        }
      }
      return state.departmentList;
    },
    roleList: state => {
      if(!state.roleList) {
        try {
          const roleList = localStorage.getItem(process.env.VUE_APP_ROLE_LIST);
          state.roleList = JSON.parse(roleList);
          state.roleList = state.roleList?state.roleList:[];
        }catch (e){
          console.error(e.message);
        }
      }
      return state.roleList;
    },
  },
  mutations: {
    setUser (state, user) {
@@ -71,6 +97,14 @@
    setRoutesConfig(state, routesConfig) {
      state.routesConfig = routesConfig
      localStorage.setItem(process.env.VUE_APP_ROUTES_KEY, JSON.stringify(routesConfig))
    },
    setRoleList(state, roleList) {
      state.roleList = roleList;
      localStorage.setItem(process.env.VUE_APP_ROLE_LIST, JSON.stringify(roleList));
    },
    setDepartmentList(state, departmentList) {
      state.departmentList = departmentList;
      localStorage.setItem(process.env.VUE_APP_DEPARTMENT_LIST, JSON.stringify(departmentList));
    }
  }
}