研发图纸文件管理系统-前端项目
longyvfengyun
2022-07-29 5f98dd6140006b7b90ddd46d3b37f5e322ea20bf
内容提交
1个文件已添加
4个文件已修改
141 ■■■■■ 已修改文件
src/pages/workplace/handlingList/HandlingList.vue 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/workplace/myDraw/MyDraw.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/workplace/notApproved/NotApproved.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/workplace/workForm/SubmitForm.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/workplace/workForm/approveForm.vue 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/workplace/handlingList/HandlingList.vue
@@ -32,7 +32,25 @@
          centered
          :footer="false"
          :width="1300">
        <draw-upload v-if="isReload" :list="subList" @success="showAudit" text="审核结果"></draw-upload>
        <draw-upload v-if="isReload" :list="subList" @success="showVisibleModal" 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>
      <a-modal
          v-model="approveFormVisible"
          title="总经理审核"
          centered
          :maskClosable="false"
          :footer="false"
          :width="500">
        <approve-form @success="approveSuccess"></approve-form>
      </a-modal>
    </div>
  </page-toggle-transition>
@@ -42,13 +60,18 @@
import PageToggleTransition from "@/components/transition/PageToggleTransition";
import AdvanceTable from "@/components/table/advance/AdvanceTable";
import {mapState} from "vuex";
import {handlingListPage, linkInfo, audit} from "@/pages/workplace/apis";
import {handlingListPage, linkInfo, audit, approve} from "@/pages/workplace/apis";
import DrawUpload from "@/pages/components/drawUpload/DrawUpload";
import AuditForm from "@/pages/workplace/workForm/auditForm";
import const_total from "@/pages/workplace/const_total";
import ApprovedList from "@/pages/workplace/approvedList/ApprovedList";
import ApproveForm from "@/pages/workplace/workForm/approveForm";
export default {
  name: "HandlingList",
  components: {
    ApproveForm,
    ApprovedList,
    DrawUpload,
    PageToggleTransition,
    AdvanceTable,
@@ -65,6 +88,7 @@
      loading: false,
      workDetailVisible: false,
      auditFormVisible: false,
      approveFormVisible: false,
      page: 1,
      pageSize: 10,
      total: 0,
@@ -112,7 +136,6 @@
        mainId: 0,    // 主id
        linkStatus: 1,    // 审批状态 1:通过,2:驳回
        dealReason: "",   // 审核建议
        nextUser: 0,    // 下一个审核的用户id
      }
    }
  },
@@ -180,8 +203,16 @@
        this.dataSource = data;
      });
    },
    showAudit() {
      this.auditFormVisible = true;
    showVisibleModal() {
      let roles = this.roles;
      switch (Number(roles[0].id)) {
        case 1003:
          this.approveFormVisible = true;
          break;
        default:
          this.auditFormVisible = true;
          break;
      }
    },
    auditSuccess(info) {
      let data = {...this.formData, ...info};
@@ -204,10 +235,36 @@
        console.log(error);
        this.$message.error("提交失败,请检查网络");
      });
    },
    approveSuccess(info) {
      let data = {...this.formData, ...info};
      this.approve(data);
    },
    approve(data) {
      let loading = this.$layer.loading();
      approve(data).then(res=>{
        this.$layer.close(loading);
        let rs = res.data;
        if(rs.code == 1 && res.data) {
          this.$message.success("提交成功");
          this.approveFormVisible = false;
          this.$nextTick(()=>{
            this.workDetailVisible = false;
          });
          this.searchData();
        }else {
          this.$message.warn("提交失败")
        }
      }).catch(error=>{
        this.$layer.close(loading);
        console.log(error);
        this.$message.error("提交失败,请检查网络");
      });
    }
  },
  computed: {
    ...mapState('setting', ['animate']),
    ...mapState('account', ["roles"]),
    workDetailTitle() {
      return this.title;
    },
@@ -217,6 +274,7 @@
  },
  mounted() {
    this.searchData();
  }
}
</script>
src/pages/workplace/myDraw/MyDraw.vue
@@ -82,7 +82,7 @@
        :maskClosable="false"
        :footer="false"
        :width="500">
        <submit-form v-if="isReload" :list="subList" @success="successSubmit" @cancel="cancelSubmit"></submit-form>
        <submit-form :title="title" v-if="isReload" :list="subList" @success="successSubmit" @cancel="cancelSubmit"></submit-form>
      </a-modal>
    </div>
  </page-toggle-transition>
@@ -205,8 +205,6 @@
      console.log(scope);
    },
    onSearch(conditions, searchOptions) {
      console.log(conditions);
      console.log(searchOptions);
      this.page = 1
      this.conditions = conditions
      this.searchData();
@@ -252,6 +250,7 @@
          let rs = res.data;
          if(rs.code == 1 && rs.data) {
            this.subList = rs.data2;
            this.title = rs.data3;
            this.drawUploadVisible = true;
            this.$message.success(rs.msg);
          }else {
src/pages/workplace/notApproved/NotApproved.vue
@@ -66,9 +66,9 @@
          align: "center"
        },
        {
          title: '创建人',
          dataIndex: 'createUserName',
          key: 'createUserName',
          title: '审批人',
          dataIndex: 'approvingUserName',
          key: 'approvingUserName',
          align: "center"
        },
        {
@@ -125,6 +125,7 @@
        let data = [];
        if(rs.code == 1) {
          data = rs.data.list.map(item=>{
            item.approvingUserName = item.approvingUser.name;
            return item;
          });
        }
src/pages/workplace/workForm/SubmitForm.vue
@@ -5,7 +5,7 @@
        <a-col :span="24">
          <a-form-item label="工单标题">
            <a-input
                v-decorator="['title', { initialValue: '', rules: [{ required: true, message: '请输入工单标题!' }] }]"
                v-decorator="['title', { initialValue: title, rules: [{ required: true, message: '请输入工单标题!' }] }]"
            />
          </a-form-item>
        </a-col>
@@ -88,6 +88,10 @@
      default() {
        return []
      }
    },
    title: {
      type: String,
      default: ""
    }
  },
  data() {
src/pages/workplace/workForm/approveForm.vue
New file
@@ -0,0 +1,55 @@
<template>
  <div>
    <a-form :form="form">
      <a-row :gutter="12">
        <a-col :span="24">
          <a-form-item label="审批建议">
            <a-textarea
                v-decorator="[
                  'dealReason',
                  {
                    initialValue: '',
                    rules: [{ required: true, message: '请输入审批建议' }]
                  },
                ]"
                placeholder="请输入审批建议" :rows="4" />
          </a-form-item>
        </a-col>
      </a-row>
    </a-form>
    <div class="modal-footer">
      <a-button type="primary" @click="handleAudit(1)">通过</a-button>
      <a-button style="margin-left: 8px;" type="danger" @click="handleAudit(2)">驳回</a-button>
    </div>
  </div>
</template>
<script>
import getItemByKey from "@/assets/js/tools/getItemByKey";
export default {
  name: "approveForm",
  data() {
    return {
      form: this.$form.createForm(this, { name: 'submitForm' }),
    }
  },
  methods: {
    handleAudit(linkStatus) {
      this.form.validateFields((err, values) => {
        if (!err) {
          values.linkStatus = linkStatus;
          this.$emit("success", values);
        }
      });
    }
  }
}
</script>
<style scoped>
.modal-footer {
  padding: 8px;
  text-align: right;
}
</style>