| | |
| | | <div class="footer"> |
| | | <a-space> |
| | | <a-button @click="fileListCancel">关闭</a-button> |
| | | <a-button type="primary" v-if="canUpload" @click="fileUploadShow">上传附件</a-button> |
| | | <a-button type="primary" v-if="canUpload" @click="fileUploadShow" |
| | | >上传附件</a-button |
| | | > |
| | | </a-space> |
| | | </div> |
| | | </a-modal> |
| | |
| | | @cancel="fileUploadCancel" |
| | | @ok="fileUploadChange" |
| | | > |
| | | <a-upload :before-upload="beforeUpload" @change="uploadListChange" multiple> |
| | | <div class="type-grp"> |
| | | <a-radio-group v-model="uploadType" button-style="solid"> |
| | | <a-radio-button value="normal"> 普通附件 </a-radio-button> |
| | | <a-radio-button value="pic"> 图片 </a-radio-button> |
| | | <a-radio-button value="dwg"> 图纸 </a-radio-button> |
| | | </a-radio-group> |
| | | </div> |
| | | <a-upload |
| | | :before-upload="beforeUpload" |
| | | @change="uploadListChange" |
| | | multiple |
| | | > |
| | | <!-- :showUploadList="false" --> |
| | | <a-button type="primary">选择附件</a-button> |
| | | </a-upload> |
| | |
| | | import FilesTable from "@/pages/components/filesTable"; |
| | | |
| | | import getWebUrl from "@/assets/js/tools/getWebUrl"; |
| | | import { uploadOthers, zipParse, getFileList } from "./apis"; |
| | | import { |
| | | uploadOthers, |
| | | picOrDwg, |
| | | zipParse, |
| | | getFileList, |
| | | addMaterial, |
| | | } from "./apis"; |
| | | import { dwgReview } from "@/pages/workplace/apis"; |
| | | import { downloadLog } from "@/pages/system/logs/apis"; |
| | | import { mapGetters } from "vuex"; |
| | |
| | | mixins: [WSMixin], |
| | | data() { |
| | | return { |
| | | uploadType: "normal", |
| | | fileUploadVisible: false, |
| | | uploadFileList: [], |
| | | info: {}, |
| | |
| | | if (rs.code == 1 && rs.data) { |
| | | this.resList = rs.data2; |
| | | this.title = rs.data3; |
| | | rs.data2[0].fileUrl = rs.msg |
| | | this.resShow = true; |
| | | this.$message.success(rs.msg); |
| | | this.$message.success('解析成功'); |
| | | } else { |
| | | this.$message.error(rs.msg); |
| | | } |
| | |
| | | this.uploadFileList = data.fileList; |
| | | }, |
| | | fileUploadChange(data) { |
| | | if (!this.uploadFileList.length) { |
| | | this.$message.error("请选择要上传的附件"); |
| | | return false; |
| | | } |
| | | let loading = this.$layer.loading(); |
| | | const formData = new FormData(); |
| | | const { id, subModel, subCode } = this.currentObj; |
| | |
| | | this.uploadFileList.forEach((v, i) => { |
| | | formData.append("file", v.originFileObj); |
| | | }); |
| | | uploadOthers(formData) |
| | | let upload = this.uploadType != "normal" ? picOrDwg : uploadOthers; |
| | | upload(formData) |
| | | .then((res) => { |
| | | this.$layer.close(loading); |
| | | const { code, data, msg } = res.data; |
| | |
| | | resCancel() { |
| | | this.resShow = false; |
| | | }, |
| | | resOk() { |
| | | this.submitShow = true; |
| | | resOk(data) { |
| | | // 不走审批 |
| | | // this.submitShow = true; |
| | | addMaterial(data).then((res) => { |
| | | let { code, data, msg } = res.data; |
| | | if (code && data) { |
| | | this.$message.success('上传成功'); |
| | | this.resShow = false; |
| | | } else { |
| | | this.$message.error(msg); |
| | | } |
| | | }); |
| | | }, |
| | | successSubmit() { |
| | | this.submitShow = false; |
| | |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | } |
| | | .type-grp { |
| | | margin-bottom: 20px; |
| | | } |
| | | </style> |