From e5454b769d44a34af423bf87ac8a740bf8c20341 Mon Sep 17 00:00:00 2001 From: Crunchy <3114200645@qq.com> Date: 星期二, 29 四月 2025 13:25:29 +0800 Subject: [PATCH] Merge branch 'dev' into dev_tides --- src/views/business/reportPreparation/index.vue | 346 ++++++++++++++++++++++++++++++--------------------------- 1 files changed, 183 insertions(+), 163 deletions(-) diff --git a/src/views/business/reportPreparation/index.vue b/src/views/business/reportPreparation/index.vue index 0da6616..785e9f1 100644 --- a/src/views/business/reportPreparation/index.vue +++ b/src/views/business/reportPreparation/index.vue @@ -3,8 +3,8 @@ <div> <el-form :model="entity" ref="entity" size="small" :inline="true"> <el-form-item label="鎶ュ憡缂栧彿" prop="code"> - <el-input v-model="entity.code" clearable placeholder="璇疯緭鍏�" - size="small" @keyup.enter.native="refreshTable()"></el-input> + <el-input v-model="entity.code" clearable placeholder="璇疯緭鍏�" size="small" + @keyup.enter.native="refreshTable()"></el-input> </el-form-item> <el-form-item label="鐘舵��" prop="queryStatus"> <el-select v-model="entity.queryStatus" clearable size="small" @change="refreshTable()"> @@ -22,34 +22,39 @@ </el-select> </el-form-item> <el-form-item> - <el-button size="mini" @click="refresh()">閲嶇疆</el-button> <el-button size="mini" type="primary" @click="refreshTable()">鏌ヨ</el-button> - <el-button :loading="outLoading" size="mini" type="primary" @click="handleDowns">鎵归噺涓嬭浇</el-button> + <el-button size="mini" @click="refresh()">閲嶇疆</el-button> </el-form-item> </el-form> </div> + <div style="text-align: right;margin-bottom: 10px"> + <el-button :loading="outLoading" size="mini" type="primary" @click="handleDowns">鎵归噺涓嬭浇</el-button> + <el-button :loading="outExportLoading" size="mini" type="primary" @click="handleExport">鎶ヨ〃瀵煎嚭</el-button> + </div> <div> <lims-table :tableData="valueTableData" :column="column" :page="page" :tableLoading="tableLoading" - :isSelection="true" :handleSelectionChange="handleChange" - :height="'calc(100vh - 290px)'" @pagination="pagination" key="valueTableData"> + :isSelection="true" :handleSelectionChange="handleChange" :height="'calc(100vh - 290px)'" + @pagination="pagination" key="valueTableData"> <div slot="action" slot-scope="scope"> <el-button size="small" type="text" @click="viewIssued(scope.row)">鏌ョ湅鎶ュ憡</el-button> - <el-upload ref='upload1' - style="display: inline;margin: 0 6px" - :action="fileAction1 +'?id='+ scope.row.id" - :auto-upload="true" - :before-upload="fileBeforeUpload1" - :headers="uploadHeader" :on-error="onError1" - :on-success="handleSuccessUp1" - :show-file-list="false" - accept='.doc,.docx'> - <el-button size="small" type="text" :disabled="scope.row.state != 0 || nickName !== scope.row.writeUserName">涓婁紶</el-button> + <el-upload ref='upload1' style="display: inline;margin: 0 6px" :action="fileAction1 + '?id=' + scope.row.id" + :auto-upload="true" :before-upload="fileBeforeUpload1" :headers="uploadHeader" :on-error="onError1" + :on-success="handleSuccessUp1" :show-file-list="false" accept='.doc,.docx'> + <el-button size="small" type="text" + :disabled="scope.row.state != 0 || nickName !== scope.row.writeUserName">涓婁紶</el-button> </el-upload> - <el-button type="text" size="small" :disabled="scope.row.state != 0 || nickName !== scope.row.writeUserName" @click="handleRestore(scope.row)">杩樺師</el-button> - <el-button type="text" size="small" :disabled="scope.row.state != 0 || nickName !== scope.row.writeUserName" @click="sendBackTask(scope.row)">閫�鍥炰换鍔�</el-button> - <el-button type="text" size="small" :disabled="scope.row.state != 0 || nickName !== scope.row.writeUserName" @click="handle(scope.row)">鎻愪氦</el-button> - <el-button type="text" size="small" :disabled="scope.row.state == null || scope.row.state == 0 ||scope.row.isExamine == 1 || nickName !== scope.row.examineUser" @click="handleIssued(scope.row)">瀹℃牳</el-button> - <el-button type="text" size="small" :disabled="scope.row.state == null || scope.row.state == 0 || scope.row.isExamine == 0 || scope.row.isExamine == null || scope.row.isRatify == 1 || nickName !== scope.row.ratifyUser" @click="handleApprove(scope.row)">鎵瑰噯</el-button> + <el-button type="text" size="small" :disabled="scope.row.state != 0 || nickName !== scope.row.writeUserName" + @click="handleRestore(scope.row)">杩樺師</el-button> + <el-button type="text" size="small" :disabled="scope.row.state != 0 || nickName !== scope.row.writeUserName" + @click="sendBackTask(scope.row)">閫�鍥炰换鍔�</el-button> + <el-button type="text" size="small" :disabled="scope.row.state != 0 || nickName !== scope.row.writeUserName" + @click="handle(scope.row)">鎻愪氦</el-button> + <el-button type="text" size="small" + :disabled="scope.row.state == null || scope.row.state == 0 || scope.row.isExamine == 1 || nickName !== scope.row.examineUser" + @click="handleIssued(scope.row)">瀹℃牳</el-button> + <el-button type="text" size="small" + :disabled="scope.row.state == null || scope.row.state == 0 || scope.row.isExamine == 0 || scope.row.isExamine == null || scope.row.isRatify == 1 || nickName !== scope.row.ratifyUser" + @click="handleApprove(scope.row)">鎵瑰噯</el-button> <el-popover placement="bottom" trigger="hover" style="margin-left: 6px"> <template #reference> <el-button link type="text" size="small">鏇村</el-button> @@ -64,31 +69,32 @@ </lims-table> </div> <el-dialog :fullscreen="fullscreen" :modal-append-to-body="false" :visible.sync="claimVisible" title="鍦ㄧ嚎缂栧埗" - width="22cm"> + width="22cm"> <div class="full-screen"> <i v-if="!fullscreen" class="el-icon-full-screen" style="cursor: pointer;font-size: 18px" - @click="fullscreen=true;"></i> - <img v-else alt="" src="@/assets/images/no-full.svg" style="cursor: pointer;" @click="fullscreen=false;"> + @click="fullscreen = true;"></i> + <img v-else alt="" src="@/assets/images/no-full.svg" style="cursor: pointer;" @click="fullscreen = false;"> </div> - <Word v-if="claimVisible" ref="Word" :class="{fullscreen:fullscreen}" :value="value" style="height:70vh" /> + <Word v-if="claimVisible" ref="Word" :class="{ fullscreen: fullscreen }" :value="value" style="height:70vh" /> <span slot="footer" class="dialog-footer"> <el-button @click="claimVisible = false">鍙� 娑�</el-button> <el-button type="primary" @click="confirmClaim">纭� 瀹�</el-button> </span> </el-dialog> <el-dialog :fullscreen="fullscreen" :modal-append-to-body="false" :visible.sync="issuedVisible" title="鎶ュ憡瀹℃牳" - width="80vw"> + width="80vw"> <div class="full-screen"> - <i v-if="!fullscreen" class="el-icon-full-screen" style="cursor: pointer;font-size: 18px" @click="fullscreen=true;"></i> - <img v-else alt="" src="@/assets/images/no-full.svg" style="cursor: pointer;" @click="fullscreen=false;" > + <i v-if="!fullscreen" class="el-icon-full-screen" style="cursor: pointer;font-size: 18px" + @click="fullscreen = true;"></i> + <img v-else alt="" src="@/assets/images/no-full.svg" style="cursor: pointer;" @click="fullscreen = false;"> </div> - <div v-if="issuedVisible" style="height: 80vh;"> + <div v-if="issuedVisible" style="height: 70vh;"> <onlyoffice ref="onlyoffice" :options="option" style="width: 100%;height: 100%;" /> </div> <span slot="footer" class="dialog-footer"> - <el-button :disabled="loadingIssued" @click="issuedReasonVisible=true">涓嶉�氳繃</el-button> - <el-button type="primary" @click="subIssued">閫� 杩�</el-button> - </span> + <el-button :disabled="loadingIssued" @click="issuedReasonVisible = true">涓嶉�氳繃</el-button> + <el-button type="primary" @click="subIssued">閫� 杩�</el-button> + </span> </el-dialog> <el-dialog :modal-append-to-body="false" :visible.sync="issuedReasonVisible" title="涓嶉�氳繃鍘熷洜" width="400px"> <div class="search_thing"> @@ -96,22 +102,24 @@ <div class="search_input"><el-input v-model="reason" clearable placeholder="璇疯緭鍏�" size="small"></el-input></div> </div> <span slot="footer" class="dialog-footer"> - <el-button :disabled="loadingIssuedReason" @click="issuedReasonVisible=false">鍙栨秷</el-button> - <el-button :loading="loadingIssuedReason" type="primary" @click="handleIssuedReason">纭畾</el-button> - </span> + <el-button :disabled="loadingIssuedReason" @click="issuedReasonVisible = false">鍙栨秷</el-button> + <el-button :loading="loadingIssuedReason" type="primary" @click="handleIssuedReason">纭畾</el-button> + </span> </el-dialog> - <el-dialog :fullscreen="fullscreen" :modal-append-to-body="false" :visible.sync="approveVisible" title="鎶ュ憡鎵瑰噯" width="80vw"> + <el-dialog :fullscreen="fullscreen" :modal-append-to-body="false" :visible.sync="approveVisible" title="鎶ュ憡鎵瑰噯" + width="80vw"> <div class="full-screen"> - <i v-if="!fullscreen" class="el-icon-full-screen" style="cursor: pointer;font-size: 18px" @click="fullscreen=true;"></i> - <img v-else alt="" src="@/assets/images/no-full.svg" style="cursor: pointer;" @click="fullscreen=false;" > + <i v-if="!fullscreen" class="el-icon-full-screen" style="cursor: pointer;font-size: 18px" + @click="fullscreen = true;"></i> + <img v-else alt="" src="@/assets/images/no-full.svg" style="cursor: pointer;" @click="fullscreen = false;"> </div> - <div v-if="approveVisible" style="height: 80vh;"> + <div v-if="approveVisible" style="height: 70vh;"> <onlyoffice ref="onlyoffice" :options="option" style="width: 100%;height: 100%;" /> </div> <span slot="footer" class="dialog-footer"> - <el-button :disabled="loadingApprove" @click="approveReasonVisible=true">涓嶆壒鍑�</el-button> - <el-button :loading="loadingApprove" type="primary" @click="subApprove">鎵� 鍑�</el-button> - </span> + <el-button :disabled="loadingApprove" @click="approveReasonVisible = true">涓嶆壒鍑�</el-button> + <el-button :loading="loadingApprove" type="primary" @click="subApprove">鎵� 鍑�</el-button> + </span> </el-dialog> <el-dialog :modal-append-to-body="false" :visible.sync="approveReasonVisible" title="涓嶆壒鍑嗗師鍥�" width="400px"> <div class="search_thing"> @@ -119,18 +127,17 @@ <div class="search_input"><el-input v-model="reason" clearable placeholder="璇疯緭鍏�" size="small"></el-input></div> </div> <span slot="footer" class="dialog-footer"> - <el-button :disabled="loadingApproveReason" @click="approveReasonVisible=false">鍙栨秷</el-button> - <el-button :loading="loadingApproveReason" type="primary" @click="handleApproveReason">纭畾</el-button> - </span> + <el-button :disabled="loadingApproveReason" @click="approveReasonVisible = false">鍙栨秷</el-button> + <el-button :loading="loadingApproveReason" type="primary" @click="handleApproveReason">纭畾</el-button> + </span> </el-dialog> - <el-dialog :close-on-click-modal="false" :visible.sync="addApproverDia" title="鎸囧畾鎵瑰噯浜哄憳" - width="400px" - @close="closeAddApproverDia"> + <el-dialog :close-on-click-modal="false" :visible.sync="addApproverDia" title="鎸囧畾鎵瑰噯浜哄憳" width="400px" + @close="closeAddApproverDia"> <div class="body" style="display: flex;padding: 10px;align-items: center;"> <div class="search_label" style="width: 150px;"><span class="required-span">*</span>鎵瑰噯浜猴細</div> <div class="search_input" style="width: 100%;"> <el-select v-model="approver" clearable filterable placeholder="璇烽�夋嫨" size="small" style="width: 100%;"> - <el-option v-for="(item,i) in approverList" :key="i" :label="item.label" :value="item.value"> + <el-option v-for="(item, i) in approverList" :key="i" :label="item.label" :value="item.value"> </el-option> </el-select> </div> @@ -140,15 +147,13 @@ <el-button :loading="loadingIssued" type="primary" @click="submitAddApprover">纭� 瀹�</el-button> </span> </el-dialog> - <el-dialog :close-on-click-modal="false" :visible.sync="addVerifyDia" - title="鎸囧畾瀹℃牳浜哄憳" - width="400px" - @close="closeAddVerifyDia"> + <el-dialog :close-on-click-modal="false" :visible.sync="addVerifyDia" title="鎸囧畾瀹℃牳浜哄憳" width="400px" + @close="closeAddVerifyDia"> <div class="body" style="display: flex;padding: 10px;align-items: center;"> <div class="search_label" style="width: 150px;"><span class="required-span">*</span>瀹℃牳浜猴細</div> <div class="search_input" style="width: 100%;"> <el-select v-model="verifyUser" clearable filterable placeholder="璇烽�夋嫨" size="small" style="width: 100%;"> - <el-option v-for="(item,i) in approverList" :key="i" :label="item.label" :value="item.value"> + <el-option v-for="(item, i) in approverList" :key="i" :label="item.label" :value="item.value"> </el-option> </el-select> </div> @@ -159,13 +164,14 @@ </span> </el-dialog> <!--浜т笟閾句俊鎭煡鐪�--> -<!-- <ShowInfo v-if="showInfoDialog" ref="showInfoDialog" :showInfoDialog="showInfoDialog"></ShowInfo>--> + <!-- <ShowInfo v-if="showInfoDialog" ref="showInfoDialog" :showInfoDialog="showInfoDialog"></ShowInfo>--> <!--鎶ュ憡鏌ョ湅--> <el-dialog :fullscreen="fullscreen" :modal-append-to-body="false" :visible.sync="viewIssuedVisible" title="鎶ュ憡鏌ョ湅" - width="80vw"> + width="80vw"> <div class="full-screen"> - <i v-if="!fullscreen" class="el-icon-full-screen" style="cursor: pointer;font-size: 18px" @click="fullscreen=true;"></i> - <img v-else alt="" src="@/assets/images/no-full.svg" style="cursor: pointer;" @click="fullscreen=false;" > + <i v-if="!fullscreen" class="el-icon-full-screen" style="cursor: pointer;font-size: 18px" + @click="fullscreen = true;"></i> + <img v-else alt="" src="@/assets/images/no-full.svg" style="cursor: pointer;" @click="fullscreen = false;"> </div> <div v-if="viewIssuedVisible" style="height: 80vh;"> <onlyoffice ref="onlyoffice" :options="option" style="width: 100%;height: 100%;" /> @@ -174,19 +180,15 @@ <!--闄勪欢鏌ョ湅--> <el-dialog :visible.sync="filesDialogVisible" title="闄勪欢鏌ョ湅" width="80%" @closed="closeFilesLook"> <div style="margin-bottom: 10px"> - <el-upload ref='upload' - :action="fileAction" - :auto-upload="true" - :before-upload="fileBeforeUpload" :data="{orderId: filesLookInfo.insOrderId}" - :headers="uploadHeader" :on-error="onError" - :on-success="handleSuccessUp" - :show-file-list="false" - accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar' style="width: 80px !important;"> + <el-upload ref='upload' :action="fileAction" :auto-upload="true" :before-upload="fileBeforeUpload" + :data="{ orderId: filesLookInfo.insOrderId }" :headers="uploadHeader" :on-error="onError" + :on-success="handleSuccessUp" :show-file-list="false" + accept='.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar' style="width: 80px !important;"> <el-button size="small" style="height: 38px" type="primary">闄勪欢涓婁紶</el-button> </el-upload> </div> - <lims-table :tableData="tableDataFile" :column="columnFile" @pagination="paginationFile" height="500px" - key="tableDataFile" :page="pageFile" :tableLoading="tableLoadingFile"></lims-table> + <lims-table :tableData="tableDataFile" :column="columnFile" height="600px" + key="tableDataFile" :tableLoading="tableLoadingFile"></lims-table> </el-dialog> </div> </template> @@ -194,7 +196,6 @@ <script> import onlyoffice from "@/components/Onlyoffice/onlyoffice.vue"; // import ShowInfo from "../do/b1-material-ins-order/showInfo.vue"; -import file from "@/utils/file"; import { downAll, examineReport, @@ -202,20 +203,23 @@ ratifyReport, sendBackTask, upReportUrl, - writeReport + writeReport, + reportAllExport } from "@/api/business/insReport"; -import {mapGetters} from "vuex"; -import {selectUserCondition} from "@/api/business/inspectionTask"; +import { mapGetters } from "vuex"; +import { selectUserCondition } from "@/api/business/inspectionTask"; import limsTable from "@/components/Table/lims-table.vue"; -import {delfile, downFile, getFileList} from "@/api/business/rawMaterialOrder"; +import {delFile, downFile, getFileList} from "@/api/business/rawMaterialOrder"; export default { - components: {limsTable, onlyoffice}, + name: 'ReportPreparation', + components: { limsTable, onlyoffice }, data() { return { entity: { queryStatus: null, code: null, typeSource: null, + orderType: null, }, page: { current: 1, @@ -237,10 +241,11 @@ value: ``, reason: '', currentInfo: null, - option:null, - mutiList:[], - outLoading:false, - inLoading:false, + option: null, + mutiList: [], + outLoading: false, + outExportLoading: false, + inLoading: false, addApproverDia: false, // 鎸囧畾瀹℃壒浜哄憳寮规 approver: '', // 瀹℃壒浜哄憳 approverId: '', // 瀹℃壒浜哄憳 @@ -249,14 +254,14 @@ verifyUser: null, // 瀹℃牳浜哄憳 loadingVerify: false, // 瀹℃牳浜哄憳 typeSourceList: [ - {label: '鎴愬搧涓嬪崟', value: 0}, - {label: '鍘熸潗鏂欎笅鍗�', value: 1}, + { label: '鎴愬搧涓嬪崟', value: 0 }, + { label: '鍘熸潗鏂欎笅鍗�', value: 1 }, ], orderTypeList: [ - {label: '濮旀墭璇曢獙', value: 'Customer-ordered test'}, - {label: '鎶芥', value: '鎶芥'}, - {label: '杩涘巶妫�楠�', value: '杩涘巶妫�楠�'}, - {label: '瀛e害妫�楠�', value: 'Quarterly inspection'}, + { label: '濮旀墭璇曢獙', value: 'Customer-ordered test' }, + { label: '鎶芥', value: '鎶芥' }, + { label: '杩涘巶妫�楠�', value: '杩涘巶妫�楠�' }, + { label: '瀛e害妫�楠�', value: 'Quarterly inspection' }, ], showInfoDialog: false, // 浜т笟閾句俊鎭煡鐪� isReport: 1, @@ -266,9 +271,9 @@ examine: null, viewIssuedVisible: false, queryStatusList: [ - {label: '寰呮彁浜�', value: 0}, - {label: '寰呭鏍�', value: 1}, - {label: '寰呮壒鍑�', value: 2}, + { label: '寰呮彁浜�', value: 0 }, + { label: '寰呭鏍�', value: 1 }, + { label: '寰呮壒鍑�', value: 2 }, ], state: 0, orderId: 0, @@ -330,11 +335,6 @@ ] } ], - pageFile: { - total: 0, - size: 10, - current: 1 - }, isCopper: null, tableLoading: false, valueTableData: [], @@ -404,15 +404,19 @@ formatData: (params) => { if (params == 0) { return "涓嶉�氳繃"; - } else { + } else if (params == 1) { return "閫氳繃"; + } else { + return null } }, formatType: (params) => { if (params == 0) { return "danger"; - } else { + } else if (params == 1) { return "success"; + } else { + return null } }, }, @@ -427,15 +431,19 @@ formatData: (params) => { if (params == 0) { return "涓嶆壒鍑�"; - } else { + } else if (params == 1) { return "鎵瑰噯"; + } else { + return null } }, formatType: (params) => { if (params == 0) { return "danger"; - } else { + } else if (params == 1) { return "success"; + } else { + return null } }, }, @@ -457,7 +465,7 @@ return this.javaApi + '/insReport/upAll' }, fileAction() { - return this.javaApi + '/unqualifiedHandler/uploadFileByUnqualified' + return this.javaApi + '/insOrderPlan/uploadFile' }, fileAction1() { return this.javaApi + '/insReport/inReport' @@ -470,7 +478,7 @@ refreshTable() { this.tableLoading = true pageInsReport({ - ...this.page,...this.entity + ...this.page, ...this.entity }).then(res => { this.tableLoading = false this.page.total = res.data.body.total @@ -486,14 +494,14 @@ this.resetForm('entity') this.refreshTable(); }, - handleChange(arr){ + handleChange(arr) { this.mutiList = arr }, // 鏌ョ湅妫�楠屾暟鎹� - viewInspectInfo (row) { + viewInspectInfo(row) { //褰撳墠妫�楠屼换鍔$殑妫�楠屼汉鍒楄〃 let inspectorList = [] - if(row.userName){ + if (row.userName) { inspectorList = row.userName.split(',') } inspectorList.push(this.nickName) @@ -509,7 +517,7 @@ }) }, // 鎵撳紑鏌ョ湅闄勪欢寮规 - handleFileLook (row) { + handleFileLook(row) { this.filesLookInfo = row this.filesDialogVisible = true this.getFileList() @@ -517,104 +525,109 @@ // 鏌ヨ闄勪欢鏌ョ湅鍒楄〃鍥炶皟 getFileList() { this.tableLoadingFile = true - getFileList({insOrderId: this.filesLookInfo.insOrderId}).then(res => { + getFileList({ insOrderId: this.filesLookInfo.insOrderId,current: -1, size: -1 }).then(res => { this.tableLoadingFile = false if (res.code === 200) { this.tableDataFile = res.data.records - this.pageFile.total = res.data.total } }).catch(err => { this.tableLoadingFile = false }) }, - paginationFile(page) { - this.pageFile.size = page.limit - this.getFileList() - }, - closeFilesLook () { + closeFilesLook() { this.filesDialogVisible = false }, - handleSuccessUp(response, ) { + handleSuccessUp(response,) { this.upLoading = false; if (response.code == 200) { this.$message.success('涓婁紶鎴愬姛'); this.getFileList() } }, - handleSuccessUp1(response, ) { + handleSuccessUp1(response,) { if (response.code == 200) { this.$message.success('涓婁紶鎴愬姛'); } }, // 涓嬭浇闄勪欢鐨勬枃浠� - handleDown(row){ + handleDown(row) { downFile({ id: row.id, }).then(res => { - if (res.code === 200) { - let url = ''; - if(res.data.type==1){ - url = this.javaApi+'/img/'+res.data.fileUrl - this.$download.saveAs(url, row.fileName); - }else{ - url = this.javaApi+'/word/'+res.data.fileUrl - this.$download.saveAs(url, row.fileName); - } - } + this.$download.saveAs(res.data.fileUrl, row.fileName); }).catch(error => { }) }, // 鍒犻櫎闄勪欢鏂囦欢 delete(row) { - this.$confirm('鏄惁鍒犻櫎褰撳墠鏁版嵁?', "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" + this.$confirm('姝ゆ搷浣滃皢鍒犻櫎璇ユ暟鎹�, 鏄惁缁х画?', '鎻愮ず', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + type: 'warning' }).then(() => { - delfile({ id: row.id }).then(res => { - if (res.code === 500) { - return - } + this.tableLoadingFile = true + delFile({ id: row.id }).then(res => { + this.tableLoadingFile = false this.$message.success('鍒犻櫎鎴愬姛') - this.getList() - }).catch(e => { - this.$message.error('鍒犻櫎澶辫触') + this.getFileList() + }).catch(err => { + this.tableLoadingFile = false + console.log('err---', err); }) - }).catch(() => { }) + }).catch(() => { + this.$message({ + type: 'info', + message: '宸插彇娑堝垹闄�' + }); + }) }, // 鏌ョ湅浜т笟閾句俊鎭� - openInfoDialog (row) { + openInfoDialog(row) { this.showInfoDialog = true this.$nextTick(() => { this.$refs.showInfoDialog.getInfo(row.ifsInventoryId) }) }, - handleDowns(){ - if(this.mutiList.length==0){ + handleDowns() { + if (this.mutiList.length == 0) { this.$message.error('璇烽�夋嫨鎶ュ憡') return } - let str = this.mutiList.map(m=>m.id).join(',') + let str = this.mutiList.map(m => m.id).join(',') this.outLoading = true - downAll({ids: str}).then(res => { + downAll({ ids: str }).then(res => { this.outLoading = false - this.$message.success('瀵煎嚭鎴愬姛') - this.$download.saveAs(this.javaApi + res.message, row.fileName); + this.$download.zip(res.data, '鎶ュ憡.zip'); + }).catch(() => { + this.outLoading = false + }) + + }, + // 鎶ヨ〃瀵煎嚭 + handleExport() { + this.outExportLoading = true + reportAllExport({ + ...this.entity + }).then(res => { + this.outExportLoading = false + const blob = new Blob([res], { type: 'application/octet-stream' }); + this.$download.saveAs(blob, "鎶ュ憡鎶ヨ〃瀵煎嚭.xlsx"); }) }, - beforeUpload(file){ + beforeUpload(file) { const isZip = file.type === 'application/zip' || file.name.endsWith('.zip'); if (!isZip) { this.$message.error('涓婁紶鏂囦欢鍙兘鏄� ZIP 鏍煎紡!'); } - if(isZip){ + if (isZip) { this.inLoading = true; } return isZip; }, fileBeforeUpload(file) { let flag = true + console.log('file----', file) if (file.size > 1024 * 1024 * 10) { this.$message.error('涓婁紶鏂囦欢涓嶈秴杩�10M'); this.$refs.upload.clearFiles() @@ -635,20 +648,20 @@ return Promise.reject(flag); //姝g‘鐨勭粓姝� } }, - handleSuccess(response,){ + handleSuccess(response,) { this.inLoading = false; if (response.code == 200) { this.$message.success('瀵煎叆鎴愬姛') this.refreshTable() - }else{ + } else { this.$message.error(response.message) } }, - onError(err, file, fileList,type) { + onError(err, file, fileList, type) { this.$message.error('涓婁紶澶辫触') this.$refs.upload.clearFiles() }, - onError1(err, file, fileList,type) { + onError1(err, file, fileList, type) { this.$message.error('涓婁紶澶辫触') this.$refs.upload1.clearFiles() }, @@ -666,7 +679,7 @@ case 0: // 鍘熸潗鏂� this.$router.push({ - path: "/materialOrder/customsInspection", query: { + path: "/materialOrder/customsInspectionView", query: { customsInspection: row, active: this.activeFace, currentId: row.insOrderId, @@ -677,7 +690,7 @@ case null: // 鎴愬搧 this.$router.push({ - path: "/productOrder/add", query: { + path: "/productOrder/addView", query: { examine: this.examine, active: this.activeFace, currentId: row.insOrderId @@ -687,7 +700,7 @@ case 1: // 閾滄潗 this.$router.push({ - path: "/materialOrder/copperOrder", query: { + path: "/materialOrder/CopperView", query: { active: this.activeFace, currentId: row.insOrderId } @@ -697,7 +710,11 @@ }, download(row) { let url = row.urlS ? row.urlS : row.url; - this.$download.saveAs(url, row.fileName); + const link = document.createElement('a'); + link.href = this.javaApi + url; + link.target = '_blank'; + document.body.appendChild(link); + link.click(); }, // 杩樺師鎿嶄綔 handleRestore(row) { @@ -713,13 +730,13 @@ // 瀹℃牳鎸夐挳 handleIssued(row) { this.currentInfo = row; - let fileName = (row.urlS===null||row.urlS==='')?row.url:row.urlS + let fileName = (row.urlS === null || row.urlS === '') ? row.url : row.urlS let fileType = "docx" if (row.tempUrlPdf != null || row.tempUrlPdf === '') { fileName = row.tempUrlPdf fileType = "pdf" } - fileName = fileName.replace('/word/','') + fileName = fileName.replace('/word/', '') const userName = this.nickName this.option = { url: this.javaApi + "/word/" + fileName, @@ -736,14 +753,15 @@ }, // 鏌ョ湅鎶ュ憡 viewIssued(row) { + console.log('this.javaApi', this.javaApi) this.currentInfo = row; - let fileName = (row.urlS===null||row.urlS==='')?row.url:row.urlS + let fileName = (row.urlS === null || row.urlS === '') ? row.url : row.urlS let fileType = "docx" if (row.tempUrlPdf != null || row.tempUrlPdf === '') { fileName = row.tempUrlPdf fileType = "pdf" } - fileName = fileName.replace('/word/','') + fileName = fileName.replace('/word/', '') const userName = this.nickName this.option = { url: this.javaApi + "/word/" + fileName, @@ -766,7 +784,7 @@ type: 'warning' }).then(() => { this.upLoad = true - sendBackTask({id: row.id}).then(res => { + sendBackTask({ id: row.id }).then(res => { this.upLoad = false this.$message.success('閫�鍥炴垚鍔燂紒') this.refreshTable('page') @@ -781,7 +799,7 @@ }); }, // 瀹℃牳閫氳繃 - submitAddApprover () { + submitAddApprover() { if (!this.approver) { this.$message.error('璇烽�夋嫨瀹℃壒浜�') return @@ -803,7 +821,7 @@ this.loadingIssued = false; }) }, - closeAddApproverDia () { + closeAddApproverDia() { this.addApproverDia = false this.approver = '' }, @@ -814,7 +832,7 @@ }, // 鑾峰彇浜哄憳鍒楄〃 getAuthorizedPerson() { - selectUserCondition({ type: 0 }).then((res) => { + selectUserCondition({ type: 1 }).then((res) => { let data = []; res.data.forEach((a) => { data.push({ @@ -828,13 +846,13 @@ // 鎵瑰噯鎸夐挳 handleApprove(row) { this.currentInfo = row; - let fileName = (row.urlS===null||row.urlS==='')?row.url:row.urlS + let fileName = (row.urlS === null || row.urlS === '') ? row.url : row.urlS let fileType = "docx" if (row.tempUrlPdf != null || row.tempUrlPdf === '') { fileName = row.tempUrlPdf fileType = "pdf" } - fileName = fileName.replace('/word/','') + fileName = fileName.replace('/word/', '') const userName = this.nickName this.option = { url: this.javaApi + "/word/" + fileName, @@ -861,9 +879,11 @@ this.refreshTable('page') this.currentInfo = null; this.approveVisible = false; + }).catch(() => { + this.loadingApprove = false; }) }, - handle (row) { + handle(row) { this.getAuthorizedPerson() this.currentInfo = row; this.addVerifyDia = true @@ -884,7 +904,7 @@ this.$message.error('鎻愪氦澶辫触') }) }, - closeAddVerifyDia () { + closeAddVerifyDia() { this.addVerifyDia = false this.verifyUser = '' }, -- Gitblit v1.9.3