123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867 |
- <template>
-
- <div class="form-container">
- <el-form :model="form" :rules="rules" ref="form" label-width="auto">
- <blocks title="基本信息">
- <el-row :gutter="24">
- <el-col :span="12">
- <el-form-item label="会议名称:" prop="name" style="height: 45px">
- <el-input
- v-model="form.name"
- size="small"
- maxlength="15"
- :disabled="isOpt ? (optionType == 0 ? true : false) : true"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="会议内容:" style="height: 45px">
- <el-input
- v-model="form.content"
- size="small"
- maxlength="50"
- :disabled="isOpt ? (optionType == 0 ? true : false) : true"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="地点:" style="height: 45px" prop="relationId">
- <el-select
- v-model="form.relationId"
- clearable
- placeholder="请选择会议室列表"
- size="small"
- style="width: 100%"
- :disabled="isOpt ? (optionType == 0 ? true : false) : true"
- >
- <el-option
- v-for="item in meetRooms"
- :key="item.id"
- :label="item.roomName"
- :value="item.id"
- />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item
- label="会议开始时间:"
- style="height: 45px"
- prop="startTime"
- >
- <el-date-picker
- v-model="form.startTime"
- type="datetime"
- size="small"
- placeholder="年/月/日"
- style="width: 100%"
- @change="startTimeChange"
- :disabled="isOpt ? (optionType == 0 ? true : false) : true"
- >
- </el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item
- label="会议结束时间:"
- style="height: 45px; width: 100%"
- prop="endTime"
- >
- <el-date-picker
- v-model="form.endTime"
- type="datetime"
- size="small"
- placeholder="年/月/日"
- style="width: 100%"
- @change="endTimeChange"
- :disabled="isOpt ? (optionType == 0 ? true : false) : true"
- >
- </el-date-picker>
- </el-form-item>
- </el-col>
-
-
- <el-col :span="8">
- <el-form-item label="参会部门:" prop="dept" style="height: 45px">
- <el-select
- v-model="form.dept"
- multiple
- collapse-tags
- filterable
- placeholder="请选择参会部门"
- style="width: 100%"
- size="mini"
- :disabled="isOpt ? (optionType == 0 ? true : false) : true"
- @change="superviseDeptChange"
- >
- <el-option
- v-for="item in option"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item
- label="参会人员:"
- prop="deptStaff"
- style="height: 45px"
- >
- <el-select
- v-model="form.deptStaff"
- multiple
- filterable
- collapse-tags
- :disabled="isOpt ? (optionType == 0 ? true : false) : true"
- placeholder="请选择参会人员"
- style="width: 100%"
- size="mini"
- @change="superviseUserChange"
- >
- <el-option-group
- v-for="group in superviseUsers"
- :key="group.id"
- :label="group.label"
- >
- <el-option
- v-for="item in group.users"
- :key="item.id"
- :label="item.realName"
- :value="item.id"
- >
- </el-option>
- </el-option-group>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="参会人数:" style="height: 45px">
- <el-input
- v-model="form.totalPrice"
- size="small"
- disabled
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item
- label="申请部门:"
- prop="useDept"
- style="height: 45px"
- >
- <el-select
- v-model="form.useDept"
- filterable
- collapse-tags
- placeholder="请选择申请部门"
- size="small"
- style="width: 100%"
- disabled
- >
- <el-option
- v-for="item in departments"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item
- label="申请人:"
- prop="personLiable"
- style="height: 45px"
- >
- <el-input
- v-model="form.personLiable"
- size="small"
- disabled
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item
- label="申请时间:"
- prop="registerTime"
- style="height: 45px"
- >
- <el-date-picker
- v-model="form.registerTime"
- type="datetime"
- placeholder="选择日期时间"
- style="width: 100%"
- size="small"
- disabled
- >
- </el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="发送通知:" style="height: 45px">
- <el-select
- v-model="form.typeOne"
- size="small"
- style="width: 100%"
- clearable
- :disabled="isOpt ? (optionType == 0 ? true : false) : true"
- >
- <el-option
- v-for="item in optionMes"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- </blocks>
- <blocks title="附件">
- <el-row :gutter="24">
- <el-col
- v-for="(file, index) in existsFiles"
- :key="index"
- class="tf-col"
- :span="8"
- >
- <div class="file">
- <div
- class="file-name"
- @click="downloadFile(file)"
- :style="isOpt && optionType != 0 ? '' : 'width:100%;'"
- >
- {{ file.fileName }}
- </div>
- <div
- v-if="isOpt ? optionType != 0 : false"
- class="btn-file"
- @click="deleteFile(file)"
- >
- x
- </div>
- </div>
- </el-col>
- </el-row>
- <upload
- ref="upload"
- :files="files"
- v-if="isOpt ? (optionType == 0 ? false : true) : false"
- ></upload>
- </blocks>
- <blocks title="处理信息">
- <examineForm
- ref="examine"
- :cfgParam="{ isOpt, optionType }"
- :step="step"
- :steps="steps"
- :process="process"
- :editData="editData"
- :allDeptAndUser="allDeptAndUser"
- ></examineForm>
- </blocks>
- </el-form>
-
- <el-dialog
- class="tf-dialog"
- :title="title"
- :visible.sync="dialogFormVisible"
- width="1200px"
- top="60px"
- style="padding: 10px"
- append-to-body
- >
- <vehicle-transfer
- v-if="dialogFormVisible"
- ref="transfer"
- :currSelects="tableData"
- ></vehicle-transfer>
- <div slot="footer" class="dialog-footer" style="text-align: center">
- <el-button @click="cancelSubmit" size="small">取 消</el-button>
- <el-button type="primary" @click="submitData" size="small"
- >提 交</el-button
- >
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import blocks from "@/views/mbsys/components/Blocks.vue";
- import examineForm from "@/views/mbsys/components/examineForm.vue";
- import vehicleTransfer from "@/views/mbsys/components/vehicleTransfer.vue";
- import upload from "@/views/mbsys/components/upload.vue";
- import { getCompanyAll, getFiles, getAllUserInfo } from "@/api/base";
- import { getMatterTypes, getSupplier } from "@/api/mbsys/materialmanage";
- import { getconferenceroom } from "@/api/mbsys/collaborative.js";
- import { config } from "../../../components/cfgOrderProcess";
- import { parseTime } from "@/utils/index";
- export default {
- components: { blocks, examineForm, upload, vehicleTransfer },
- props: {
-
- isOpt: {
- type: Boolean,
- required: true,
- },
-
- optionType: {
- type: Number,
- required: true,
- },
-
- step: {
- type: Object,
- required: true,
- },
-
- steps: {
- type: Array,
- required: true,
- },
-
- process: {
- type: Object,
- required: true,
- },
-
- editData: {
- type: Object,
- required: true,
- },
-
- allDeptAndUser: {
- type: Array,
- required: true,
- },
- },
- data() {
- return {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- config: config,
- curUser: null,
- optionMes: [
- {
- label: "是",
- value: 0,
- },
- {
- label: "否",
- value: 1,
- },
- ],
- title: "添加物资类型",
- categoryType: [],
- form: {
- name: "",
- content: "",
- useDept: "",
- relationId: "",
- startTime: "",
- endTime: "",
- dept: "",
- deptStaff: "",
- dept: "",
- totalPrice: "",
- typeOne: "",
- },
- files: [],
- allDept: [],
- existsFiles: [],
- param: {},
- dialogFormVisible: false,
- departments: [],
- meetRooms: [],
- tableData: [],
- Materials: [],
- otherCost: [],
- option: [],
- superviseUsers: [],
- allSuperviseUsers: [],
- itemKey: 1,
- rules: {
- name: [{ required: true, message: "填写会议名称" }],
- relationId: [{ required: true, message: "请选择会议室" }],
- dept: [{ required: true, message: "请选择参会部门" }],
- deptStaff: [{ required: true, message: "请选择参会人员" }],
- useDept: [{ required: true, message: "请选择申请部门" }],
- personLiable: [{ required: true, message: "请选择申请人" }],
- startTime: [{ required: true, message: "请选择会议开始时间" }],
- endTime: [{ required: true, message: "请选择会议结束时间" }],
- },
- };
- },
- async created() {
- if (this.config && this.config.hasOwnProperty("metrialCategories"))
- this.categoryType = this.config.metrialCategories;
-
- getCompanyAll().then((res) => {
- if (res.code == 1) {
- this.departments = res.result;
- }
- });
-
- getconferenceroom().then((res) => {
- if (res.code === 1) {
- this.meetRooms = res.result.records;
- }
- });
-
- getAllUserInfo().then((res) => {
- 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.option = data;
- });
-
- if (this.isOpt && JSON.stringify(this.editData) === "{}") {
- this.curUser = this.$store.state.user;
- this.form.personLiable = this.curUser.realName;
- this.form.useDept = parseInt(this.curUser.departmentId);
- this.form.registerTime = parseTime(new Date(), "{y}-{m}-{d} {h}:{i}:{s}");
- } else {
- this.paramMappingToFrom();
- }
- },
- mounted() {},
- methods: {
-
- paramMappingToFrom() {
- if (!(JSON.stringify(this.editData) === "{}")) {
- this.form["name"] = this.editData.name;
- this.form["useDept"] = this.editData.registerDept;
- this.form["personLiable"] = this.editData.registerStaffName;
- this.form["totalPrice"] = this.editData.totalPrice;
- this.form["remark"] = this.editData.remark;
- this.form["registerTime"] = parseTime(
- new Date(this.editData.registerTime),
- "{y}-{m}-{d} {h}:{i}:{s}"
- );
- this.form["startTime"] = parseTime(
- new Date(this.editData.startTime),
- "{y}-{m}-{d} {h}:{i}:{s}"
- );
- this.form["endTime"] = parseTime(
- new Date(this.editData.endTime),
- "{y}-{m}-{d} {h}:{i}:{s}"
- );
- if (this.editData.hasOwnProperty("processNodeVos")) {
-
- let processNodeVos = this.editData.processNodeVos.filter(
- (pn) => pn.processStep == this.step.stepOrder
- );
- if (processNodeVos.length > 0) {
- this.form["typeOne"] = processNodeVos[0].typeOne;
- this.form["content"] = processNodeVos[0].documentVo.content;
- this.form["relationId"] =
- processNodeVos[0].relationInfoVo[0].relationId;
- let dept = [];
- let deptStaff = [];
- processNodeVos[0].processStaffVos.forEach((item) => {
- dept.push(item.dept);
- deptStaff.push(item.deptStaffName);
- });
- this.form["dept"] = this.unique(dept);
- this.form["deptStaff"] = deptStaff;
-
- if (processNodeVos[0].hasOwnProperty("files")) {
- const files = processNodeVos[0].files;
- if (files) {
- this.existsFiles = [];
- files.forEach((file) => {
- this.existsFiles.push(file);
- });
- }
- }
- }
- }
- }
- },
- unique(arr) {
- return Array.from(new Set(arr));
- },
-
- startTimeChange(value) {
- this.form.startTime = parseTime(
- new Date(value),
- "{y}-{m}-{d} {h}:{i}:{s}"
- );
- },
-
- endTimeChange(value) {
- this.form.endTime = parseTime(new Date(value), "{y}-{m}-{d} {h}:{i}:{s}");
- },
-
- superviseDeptChange(value) {
- this.superviseUsers = [];
- this.allSuperviseUsers = [];
-
- this.form.deptStaff = [];
- value.forEach((item) => {
- const obj = this.option.find((it) => it.id == item);
- if (obj && obj.hasOwnProperty("users") && obj.users.length > 0)
- this.allSuperviseUsers = this.allSuperviseUsers.concat(obj.users);
- });
- this.superviseUsers = this.option.filter(
- (item) => value.indexOf(item.id) > -1
- );
- this.form.staffDtos = [];
-
- this.superviseUsers.forEach((item) => {
- this.form.staffDtos.push({
- dept: item.id,
- staffType: 1,
- deptStaff: "",
- });
- });
- this.form.totalPrice = this.form.deptStaff.length;
- },
-
- superviseUserChange(value) {
- this.form.staffDtos = [];
- value.forEach((item) => {
- const obj = this.allSuperviseUsers.find((p) => p.id == item);
- if (obj)
- this.form.staffDtos.push({
- dept: obj.departmentId,
- staffType: 1,
- deptStaff: obj.id,
- });
- });
- this.form.totalPrice = this.form.deptStaff.length;
- },
-
- downloadFile(file) {
- if (
- file &&
- file.hasOwnProperty("filePath") &&
- file.hasOwnProperty("fileName")
- ) {
- const token = this.$store.state.user.token;
- const fileName = file.fileName;
- getFiles({
- access_token: token,
- fileName: fileName,
- remotePath: file.filePath,
- }).then((src) => {
- const reader = new FileReader();
- reader.readAsDataURL(src);
- reader.onload = (e) => {
- const a = document.createElement("a");
- a.download = fileName;
-
- a.href = e.target.result;
- document.body.appendChild(a);
- a.click();
- document.body.removeChild(a);
- };
- });
- }
- },
-
- deleteFile(file) {
- this.$confirm(
- "此操作将永久删除【" + file.fileName + "】文件, 是否继续?",
- "提示",
- {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- }
- )
- .then(() => {
- this.existsFiles = this.existsFiles.filter(
- (item) => item.id != file.id
- );
- })
- .catch(() => {
- this.$message({
- type: "info",
- message: "已取消删除",
- });
- });
- },
-
- getCategoryName(code) {
- const obj = this.categoryType.find((item) => item.code == code);
- return obj.name;
- },
-
- delMaterial(row) {
- this.tableData = this.tableData.filter((item) => item.id != row.id);
- },
-
- getExamineInfo() {
- return this.$refs["examine"].submitForm();
- },
- submitData() {
- this.dialogFormVisible = false;
- this.tableData = this.$refs.transfer.submitData();
- },
-
- cancelSubmit() {
- this.dialogFormVisible = false;
- },
-
- submitForm() {
- let flag = false;
- this.$refs["form"].validate((valid) => {
- flag = valid;
- if (valid) {
- return true;
- } else {
- return false;
- }
- });
- const files = this.$refs["upload"].submitFiles();
- let existsFilesId = "";
- this.existsFiles.forEach((item, index) => {
- existsFilesId =
- existsFilesId +
- (index < this.existsFiles - 1 ? item.id + "," : item.id);
- });
- if (flag) {
- const examine = this.$refs["examine"].submitForm();
-
-
-
-
-
-
-
-
- return {
- form: this.form,
- vehicles: this.tableData,
- examine: examine,
- existsFilesId: existsFilesId,
- files: files,
- };
- } else return null;
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .form-container {
- width: 100%;
- padding: 0 10px;
- box-sizing: border-box;
- bottom: 0;
- .el-pagination {
- margin-top: 16px;
- }
- .addBtn {
- height: 30px;
- font-size: 22px;
- color: #409eff;
- font-weight: bold;
- text-align: center;
- border: 1px solid #ebeef5;
- border-top: 0px;
- cursor: pointer;
- }
- .addBtn:hover {
- background: #ebeef5;
- }
- .tf-input-table {
- >>> .el-table__body-wrapper {
- max-height: 110px;
- overflow-y: auto !important;
- }
- }
- .tf-input-border {
- >>> input {
- border: 0 solid;
- }
- }
- .tf-col {
- .file {
- border: 1px solid #ebeef5;
- height: 40px;
- width: calc(100% - 20px);
- .file-name {
- width: calc(100% - 40px);
- float: left;
- padding: 0 10px;
- height: 40px;
- line-height: 40px;
- }
- .file-name:hover {
- background-color: #ebeef5;
- cursor: pointer;
- }
- .btn-file {
- width: 40px;
- float: left;
- height: 40px;
- line-height: 40px;
- text-align: center;
- background-color: #ebeef5;
- }
- .btn-file:hover {
- color: #abbac7;
- cursor: pointer;
- }
- }
- }
- }
- .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;
- }
- }
- }
- }
- }
- .el-dialog__wrapper {
- >>> .el-form-item {
- margin-bottom: 15px !important;
- }
- .item-title {
- width: 100%;
- height: 30px;
- line-height: 30px;
- margin-bottom: 10px;
- font-weight: 600;
- &::before {
- content: "";
- display: inline-block;
- width: 5px;
- height: 18px;
- vertical-align: text-bottom;
- background-color: #2d74e7;
- margin-right: 5px;
- }
- }
- }
- .tf-dialog {
- >>> .el-dialog__header {
- background: #2d74e7;
- .el-dialog__title {
- color: aliceblue !important;
- }
- .el-dialog__close {
- color: aliceblue !important;
- }
- }
- >>> .el-dialog__body {
- padding: 10px;
- }
- }
- >>> .el-form-item__error {
- margin-top: -7px;
- }
- </style>
|