123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784 |
- <template>
-
- <div class="content-container">
- <div class="right-box">
- <div class="top">
- <el-form
- ref="form"
- :inline="true"
- :model="form"
- style="float: left; height: 45px"
- >
- <el-form-item label="关键字:">
- <el-input
- v-model="form.content"
- size="small"
- placeholder="请输入会议单号、会议名称"
- style="width: 220px"
- ></el-input>
- </el-form-item>
- <el-form-item label="申请部门:">
- <el-select
- v-model="form.registerDept"
- filterable
- clearable
- collapse-tags
- placeholder="请选择申请部门"
- size="small"
- >
- <el-option
- v-for="item in allDept"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="申请时间:">
- <el-date-picker
- v-model="form.purchaseTime"
- type="daterange"
- align="right"
- value-format="yyyy-MM-dd"
- unlink-panels
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- :picker-options="pickerOptions"
- size="small"
- style="width: 240px"
- />
- </el-form-item>
- <el-button
- type="primary"
- icon="el-icon-search"
- size="small"
- @click="queryProcess"
- style="margin-top: 4px"
- >查询</el-button
- >
- </el-form>
- <el-button
- type="primary"
- @click="orderRegister"
- icon="el-icon-plus"
- size="small"
- >会议申请</el-button
- >
- </div>
- <div class="table-div">
- <el-table
- :data="tableData"
- style="width: 100%"
- :style="{ width: '100%' }"
- height="100%"
- :header-cell-style="{
- background: 'rgba(250,250,250)',
- color: 'rgb(50,59,65)',
- height: '38px',
- textAlign: 'center',
- }"
- >
- <template slot="empty">
- <img src="@/assets/icon/null.png" alt="" />
- <p class="empty-p">暂无数据</p>
- </template>
- <el-table-column type="selection" align="center"></el-table-column>
- <el-table-column
- type="index"
- label="序号"
- align="center"
- width="60px"
- ></el-table-column>
- <el-table-column
- prop="processNumber"
- label="会议单号"
- align="center"
- ></el-table-column>
- <el-table-column
- prop="name"
- label="会议名称"
- align="center"
- ></el-table-column>
- <el-table-column
- prop="roomName"
- label="地点"
- align="center"
- ></el-table-column>
- <el-table-column
- prop="startTime"
- label="开始时间"
- align="center"
- ></el-table-column>
- <el-table-column
- prop="endTime"
- label="结束时间"
- align="center"
- ></el-table-column>
- <el-table-column
- prop="registerDeptName"
- label="申请部门"
- align="center"
- >
- <template slot-scope="{ row }">
- <span>{{ getDeptName(row.registerDept) }}</span>
- </template>
- </el-table-column>
- <el-table-column
- prop="registerStaffName"
- label="申请人"
- align="center"
- >
- <template slot-scope="{ row }">
- <span>{{
- getUserName(row.registerDept, row.registerStaff)
- }}</span>
- </template>
- </el-table-column>
- <el-table-column
- prop="registerTime"
- label="申请时间"
- align="center"
- ></el-table-column>
- <el-table-column prop="processState" label="流程状态" align="center">
- <template slot-scope="{ row }">
- <span>{{ getOrderStateNameById(row.processState) }}</span>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center">
- <template slot-scope="scope">
- <el-button
- @click="queryOrderProcessById(scope.row, false)"
- icon="el-icon-tickets"
- title="查看"
- type="text"
- size="small"
- style="font-size: 16px"
- ></el-button>
- <el-button
- v-if="scope.row.processState == 1"
- @click="queryOrderProcessById(scope.row, true)"
- icon="el-icon-edit"
- title="修改"
- type="text"
- size="small"
- style="font-size: 16px"
- ></el-button>
- <el-button
- v-if="scope.row.processState == 1"
- @click="delOrderProcessById(scope.row)"
- icon="el-icon-delete"
- title="删除"
- type="text"
- size="small"
- style="font-size: 16px; color: red"
- ></el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <el-pagination
- :current-page="pagination.current"
- :page-sizes="[20, 30, 50, 100, 200]"
- :page-size="pagination.size"
- :total="pagination.total"
- @size-change="changePaginationSize"
- @current-change="changePaginationCurrent"
- layout="total, sizes, prev, pager, next, jumper"
- />
- </div>
-
- <el-dialog
- class="tf-dialog"
- :title="title"
- :visible.sync="dialogFormVisible"
- width="1200px"
- top="60px"
- style="padding: 10px"
- >
- <process-order
- v-if="dialogFormVisible"
- ref="merge"
- :orderName="orderName"
- :orderCode="orderCode"
- :businessType="businessType"
- :proId="processId"
- :optionType="optionType"
- :editData="editData"
- :comps="compts"
- @remind="remind"
- ></process-order>
- <div slot="footer" class="dialog-footer">
- <el-button @click="dialogFormVisible = false" size="small"
- >取 消</el-button
- >
- <el-button
- v-if="optionType != 0"
- @click="preserveHandler(0)"
- size="small"
- >保 存</el-button
- >
- <el-button
- v-if="optionType != 0"
- type="primary"
- @click="preserveHandler(1)"
- size="small"
- >提 交</el-button
- >
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import { getAllUserInfo } from "@/api/base";
- import {
- getTypetree,
- getProcessPageList,
- queryProcessPage,
- getProcessList2,
- qOrderProcessById,
- addOrderProcess,
- delOrderProcess,
- querySupervisePage,
- } from "@/api/process/process";
- import { config } from "../../../components/cfgOrderProcess";
- import processOrder from "@/views/mbsys/publicOrder/orderProcess/detail";
- import { publicComponents } from "../processForm/config";
- export default {
- components: { processOrder },
- data() {
- return {
-
- config: config,
- pickerOptions: {
- shortcuts: [
- {
- text: "最近一周",
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
- picker.$emit("pick", [start, end]);
- },
- },
- {
- text: "最近一个月",
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
- picker.$emit("pick", [start, end]);
- },
- },
- {
- text: "最近三个月",
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
- picker.$emit("pick", [start, end]);
- },
- },
- ],
- },
- allDept: [],
- curUser: null,
- orderName: "会议申请单",
- orderCode: "",
- form: {
- content: "",
- supplierId: "",
- },
- tableData: [],
- title: "",
- pagination: { current: 1, size: 20, total: 0 },
- dialogFormVisible: false,
- curProcess: null,
- businessType: 0,
- optionType: 0,
- editData: {},
- processId: 0,
- compts: publicComponents,
- curEditRow: null,
- };
- },
- watch: {},
- created() {
- this.curUser = this.$store.state.user;
-
- getTypetree({ datatypes: 0, id: "" })
- .then((res) => {
- if (res.code === 1) {
- if (res.result.length > 0)
- if (res.result[0].vos.length > 1)
- this.businessTypes = res.result[0].vos[0].vos;
- }
- })
- .catch((ex) => {
- this.$message.error("获取数据出错!");
- });
-
- getAllUserInfo().then((res) => {
- if (res.code == 1) {
- const data = res.result;
- for (const i in data) {
- data[i].value = data[i].id;
- data[i].label = data[i].name;
- if (data[i].users) {
- data[i].children = data[i].users;
- for (const j in data[i].children) {
- data[i].children[j].value = data[i].children[j].id;
- data[i].children[j].label = data[i].children[j].realName;
- }
- }
- }
- this.allDept = data;
- }
- });
- this.getProcess();
- },
- methods: {
-
- getDeptName(deptId) {
- if (this.allDept.length > 0) {
- const dept = this.allDept.find((item) => item.id == deptId);
- if (dept) return dept.name;
- else deptId;
- } else return deptId;
- },
-
- getUserName(deptId, userId) {
- if (this.allDept.length > 0) {
- const dept = this.allDept.find((item) => item.id == deptId);
- if (dept) {
- const user = dept.users.find((p) => p.id == userId);
- if (user) return user.realName;
- else return userId;
- } else return userId;
- } else return userId;
- },
- changePaginationSize(value) {
- this.pagination.size = value;
- this.queryProcess();
- },
- changePaginationCurrent(value) {
- this.pagination.current = value;
- this.queryProcess();
- },
-
- async getUrgeInfo(data) {
-
-
- let tableList = data;
- for (let i = 0; i < tableList.length; i++) {
- tableList[i]["urgeInfo"] = "";
- if (tableList[i].urgeNumber > 0) {
- let data = {
- processId: tableList[i].id,
- nodeBranch: tableList[i].nodeBranch,
- processNode: tableList[i].processNode,
- superviseDept: parseInt(this.curUser.departmentId),
- superviseStaff: this.curUser.userId,
- };
- const res = await this.querySupervisePage(data);
- let result = [];
- if (res) {
- res.result.records.forEach((item) => {
- const dept = this.getDeptName(item.handleDept);
- result.push(
- item.createTime +
- " " +
- dept +
- " " +
- item.createUserName +
- " " +
- item.remark
- );
- });
- }
- tableList[i]["urgeInfo"] = result;
- }
- }
- this.tableData = tableList;
- },
-
- queryProcess() {
-
-
-
-
-
- let map = {
-
- configId: this.processId,
- registerStaff: Number(this.curUser.userId),
- };
- let params = {
- id: 3,
- map,
- };
- let { current, size, total } = this.pagination;
- let url = `current=${current}&size=${size}&total=${total}`;
- if (this.form.content != "")
- Object.assign(map, { content: this.form.content });
- if (this.form.registerDept != "")
- Object.assign(map, { registerDept: this.form.registerDept });
- if (this.form.purchaseTime) {
- Object.assign(map, {
- stratTime: this.form.purchaseTime[0] + " 00:00:00",
- endTime: this.form.purchaseTime[1] + " 23:59:59",
- });
- }
- getProcessList2(params, url).then((res) => {
- if (res.code == 1) {
-
- this.getUrgeInfo(res.result.records);
- this.pagination.total = res.result.total;
- }
- });
- },
-
- getProcess() {
- let data = {
- current: 1,
- size: 999,
- };
- getProcessPageList(data)
- .then((res) => {
- this.curProcess = res.result.records.find(
- (item) => item.processNumber === "HYLC"
- );
- if (this.curProcess) {
- this.processId = this.curProcess.id;
- this.businessType = this.curProcess.hasOwnProperty("processType")
- ? this.curProcess.processType
- : null;
- }
- this.queryProcess();
- })
- .catch((ex) => {
- this.$message.error("获取流程列表失败!");
- });
- },
-
- remind(data) {
- this.dialogFormVisible = false;
-
- this.optionType = 1;
- this.queryProcess();
- },
- orderRegister() {
- this.title = "会议申请-新增";
- this.optionType = 1;
- this.editData = {};
- this.curEditRow = null;
- this.dialogFormVisible = true;
- },
-
- getOrderStateNameById(id) {
- if (this.config && this.config.hasOwnProperty("orderState")) {
- const obj = this.config.orderState.find((item) => item.key === id);
- if (obj) return obj.value;
- else return id;
- } else {
- return id;
- }
- },
-
- queryOrderProcessById(row, type) {
- this.curEditRow = type ? row : null;
- qOrderProcessById(row.id).then((res) => {
- if (res.code == 1) {
- this.title = type ? "会议申请-修改" : "会议申请-详情";
- this.optionType = type ? 2 : 0;
- this.editData = res.result;
- this.dialogFormVisible = true;
- }
- });
- },
-
- delOrderProcessById(row) {
- this.$confirm(
- `此操作将永久删除单号为【${row.processNumber}】名称为【${row.name}】的单, 是否继续?`,
- "提示",
- {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }
- )
- .then(() => {
- this.deleteOrder(row.id);
- })
- .catch(() => {
- this.$message({
- type: "info",
- message: "已取消删除",
- });
- });
- },
-
- deleteOrder(id) {
- delOrderProcess(id).then((res) => {
- if (res.code == 1) {
- this.queryProcess();
- this.$message({
- type: "success",
- message: "删除成功!",
- });
- } else {
- this.$message({
- type: "error",
- message: "删除失败",
- });
- }
- });
- },
-
- addOrder(param) {
- addOrderProcess(param).then((res) => {
- if (res.code == 1) {
- this.dialogFormVisible = false;
- this.queryProcess();
- this.$message.success("编辑成功!");
- }
- });
- },
-
- preserveHandler(state) {
- let params = this.$refs.merge.submitForm();
- console.log("提交数据", params);
- if (params == null) return;
-
- let data = this.formParamMapping(params, state);
- if (data) this.addOrder(data);
- },
-
- formParamMapping(data, state) {
- let params = {
- operateState: 0,
- };
- let formData = new FormData();
- if (this.curEditRow != null)
- Object.assign(params, { id: this.curEditRow.id });
-
- if (data.hasOwnProperty("configId")) {
- params = Object.assign(params, { configId: data.configId });
- }
- let documentDto = {
- content: data.form.content,
- theme: data.form.name,
- };
-
- let prdtos = [];
- prdtos.push({
- relationId: data.form.relationId,
- tableId: 1,
- });
- let processNode = {
-
- handleResults: 0,
- saveState: state,
- annex: data.hasOwnProperty("existsFilesId") ? data.existsFilesId : "",
- remark: data.hasOwnProperty("examine") ? data.examine.remarks : "",
- typeOne: data.form.typeOne,
- documentDto,
- prdtos,
- staffDtos: data.form.staffDtos,
- };
- if (data.hasOwnProperty("form")) {
- Object.assign(params, {
- name: data.form.name,
- registerTime: data.form.registerTime,
- startTime:
- data.form.startTime.length > 11
- ? data.form.startTime
- : data.form.startTime + " 00:00:00",
- endTime:
- data.form.endTime.length > 11
- ? data.form.endTime
- : data.form.endTime + " 00:00:00",
- remark: data.form.remark,
- totalPrice: data.form.totalPrice,
- });
- }
- Object.assign(params, { ywType: this.businessType });
-
- if (data.hasOwnProperty("examine")) {
-
- let nextStep = {
- dept: data.examine.hasOwnProperty("dept") ? data.examine.dept : "",
- deptStaff: data.examine.hasOwnProperty("deptStaff")
- ? data.examine.deptStaff
- : "",
- processStep: data.examine.hasOwnProperty("processStep")
- ? data.examine.processStep
- : 1,
- stepNode: data.examine.hasOwnProperty("stepNode")
- ? data.examine.stepNode
- : 1,
- };
- Object.assign(processNode, {
- headleState: data.examine.headleState,
- nextStep: nextStep,
- processStep: 1,
- stepNode: 1,
- });
- if (
- state == 1 &&
- data.examine.headleState == 1 &&
- (nextStep.deptStaff == "" || nextStep.deptStaff == null)
- ) {
- this.$message.warning("提交请选择下一步审核人");
- return null;
- }
- }
-
- Object.assign(params, { stepNode: 1 });
- Object.assign(params, { processNode: processNode });
- const json = JSON.stringify(params);
-
- const blob = new Blob([json], {
- type: "application/json",
- });
- formData.append("dto", blob);
-
- if (data.hasOwnProperty("files")) {
- let files = [];
- data.files.forEach((file, index) => {
- formData.append("fileList", file.file);
- });
- }
- return formData;
- },
-
- newPlanForMonthDia(bool, e) {},
-
- applicationFn() {
- if (!this.sizeForm.name) return this.$message.error("请输入会议名称");
- if (!this.sizeForm.address) return this.$message.error("请输入地点");
- if (!this.sizeForm.startDate)
- return this.$message.error("请输入会议时间");
- if (!this.sizeForm.people) return this.$message.error("请输入参会人员");
- if (!this.sizeForm.department)
- return this.$message.error("请输入申请部门");
- if (!this.sizeForm.name2) return this.$message.error("请输入申请人");
- if (!this.sizeForm.value1) return this.$message.error("请输入申请时间");
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .content-container {
- width: 100%;
- box-sizing: border-box;
- padding: 10px;
- position: absolute;
- top: 43px;
- bottom: 0;
- .right-box {
- height: 100%;
- overflow-y: auto;
- box-sizing: border-box;
- .top {
- height: 33px;
- text-align: right;
- .upload-demo {
- display: inline-block;
- }
- }
- // /deep/.el-form-item__content {
- // display: flex;
- // align-items: center;
- // }
- .table-div {
- height: calc(100% - 81px);
- }
- .el-pagination {
- margin-top: 16px;
- }
- }
- }
- .el-table {
- >>> .el-table__body {
- tr {
- &:nth-child(2n) {
- background-color: #f0f9eb;
- }
- td {
- height: 23px;
- line-height: 23px;
- padding: 2px 1px !important;
- .el-button {
- padding: 0;
- }
- }
- }
- }
- }
- .tf-dialog {
- >>> .el-dialog__header {
- background: #2d74e7;
- .el-dialog__title {
- color: aliceblue !important;
- }
- .el-dialog__close {
- color: aliceblue !important;
- }
- }
- }
- </style>
|