From b4f13431dafc42c189af2380218909b9931bacc6 Mon Sep 17 00:00:00 2001 From: chenrui <1187576398@qq.com> Date: 星期二, 25 二月 2025 16:25:42 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev --- src/views/business/inspectionTask/components/InspectionWord.vue | 7 src/views/CNAS/systemManagement/documentControl/components/DistributionCollectionRecord.vue | 28 src/views/CNAS/systemManagement/managementReview/components/reviewReport.vue | 27 src/views/business/productSamplingInfo/components/addQuarterItem.vue | 290 ++++++++ src/views/business/inspectionReview/index.vue | 8 src/views/business/materialOrderComponents/materialOrder/downFileDialog.vue | 22 src/views/business/rawMaterialInspection/index.vue | 11 src/views/business/reportPreparation/index.vue | 39 src/views/CNAS/systemManagement/managementReview/components/managementReviewPlan.vue | 33 src/api/cnas/process/reportResults.js | 29 src/views/CNAS/process/reportResults/index.vue | 431 +++++++++++ src/api/business/rawMaterialOrder.js | 5 src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue | 7 src/views/business/productOrder/index.vue | 26 src/views/CNAS/systemManagement/managementReview/components/meetingRecords.vue | 27 src/views/business/materialOrder/index.vue | 12 src/api/business/productOrder.js | 3 src/views/CNAS/systemManagement/customerSatisfaction/index.vue | 7 src/api/business/materialInspection.js | 3 src/views/structural/capabilityAndLaboratory/laboratory/index.vue | 257 +----- src/views/CNAS/resourceDemand/standardMaterialAccept/index.vue | 89 - src/api/business/productSamplingInfo.js | 101 ++ src/views/business/productSamplingInfo/index.vue | 647 +++++++++++++++++ 23 files changed, 1,628 insertions(+), 481 deletions(-) diff --git a/src/api/business/materialInspection.js b/src/api/business/materialInspection.js index 3f592b1..4104e1c 100644 --- a/src/api/business/materialInspection.js +++ b/src/api/business/materialInspection.js @@ -93,6 +93,7 @@ return request({ url: '/rawMaterialOrder/rawAllExport', method: 'post', - data: query + data: query, + responseType: "blob" }) } diff --git a/src/api/business/productOrder.js b/src/api/business/productOrder.js index 8ae703b..00862c6 100644 --- a/src/api/business/productOrder.js +++ b/src/api/business/productOrder.js @@ -22,7 +22,8 @@ return request({ url: '/insOrder/rawAllInsOrderExport', method: 'post', - data: query + data: query, + responseType: "blob" }) } // 灏嗗緟妫�楠岀殑鐨勬挙閿�杩涜鏇存敼 diff --git a/src/api/business/productSamplingInfo.js b/src/api/business/productSamplingInfo.js new file mode 100644 index 0000000..b954bfe --- /dev/null +++ b/src/api/business/productSamplingInfo.js @@ -0,0 +1,101 @@ +// 鎶芥牱淇℃伅璇︽儏椤甸潰鐩稿叧鎺ュ彛 +import request from '@/utils/request' + +// 鎶芥牱淇℃伅-瀛e害鏌ヨ +export function getQuarterPage(query) { + return request({ + url: '/finishProductSpotCheck/getQuarterPage', + method: 'get', + params: query + }) +} +// 鎶芥牱淇℃伅-骞村害鏌ヨ +export function getSpotCheckYearPage(query) { + return request({ + url: '/finishProductSpotCheck/getSpotCheckYearPage', + method: 'get', + params: query + }) +} +// 鍒犻櫎瀛e害鎶芥 +export function deleteQuarter(query) { + return request({ + url: '/finishProductSpotCheck/deleteQuarter', + method: 'delete', + params: query + }) +} +// 鐢熸垚瀛e害鎶ュ憡 +export function finalReportQuarter(query) { + return request({ + url: '/finishProductSpotCheck/finalReportQuarter', + method: 'get', + params: query, + responseType: "blob" + }) +} +// 鐢熸垚骞村害鎶ュ憡 +export function finalReportSpotCheckYear(query) { + return request({ + url: '/finishProductSpotCheck/finalReportSpotCheckYear', + method: 'get', + params: query, + responseType: "blob" + }) +} +// 鍒犻櫎骞村害鎶芥 +export function deleteSpotCheckYear(query) { + return request({ + url: '/finishProductSpotCheck/deleteSpotCheckYear', + method: 'delete', + params: query, + }) +} +// 骞村害鎶芥鏌ョ湅璇︽儏 +export function getSpotCheckYear(query) { + return request({ + url: '/finishProductSpotCheck/getSpotCheckYear', + method: 'get', + params: query, + }) +} +// 鎻愪氦骞村害鎶芥牱 +export function addSpotCheckYear(query) { + return request({ + url: '/finishProductSpotCheck/addSpotCheckYear', + method: 'post', + data: query, + }) +} +// 缂栬緫骞村害鎶芥牱 +export function updateSpotCheckYear(query) { + return request({ + url: '/finishProductSpotCheck/updateSpotCheckYear', + method: 'post', + data: query, + }) +} +// 瀛e害鎶芥鏌ョ湅璇︽儏 +export function getQuarter(query) { + return request({ + url: '/finishProductSpotCheck/getQuarter', + method: 'get', + params: query, + }) +} +// 鎻愪氦瀛e害鎶芥牱 +export function addQuarter(query) { + return request({ + url: '/finishProductSpotCheck/addQuarter', + method: 'post', + data : query, + }) +} +// 缂栬緫瀛e害妫�楠� +export function updateQuarterOnOrder(query) { + return request({ + url: '/finishProductSpotCheck/updateQuarterOnOrder', + method: 'post', + data : query, + }) +} diff --git a/src/api/business/rawMaterialOrder.js b/src/api/business/rawMaterialOrder.js index 4b5c746..31f9cb3 100644 --- a/src/api/business/rawMaterialOrder.js +++ b/src/api/business/rawMaterialOrder.js @@ -214,12 +214,13 @@ data: query }) } -// 鍘熸潗鏂欎笅鍗曞嚭鍘傛挙閿� +// 鍘熸潗鏂欐姤妫�鍏ㄩ儴瀵煎嚭 export function rawAllExport(query) { return request({ url: '/rawMaterialOrder/rawAllExport', method: 'post', - data: query + data: query, + responseType: "blob" }) } // 鍘熸潗鏂欎笅鍗曞嚭鍘傛挙閿� diff --git a/src/api/cnas/process/reportResults.js b/src/api/cnas/process/reportResults.js new file mode 100644 index 0000000..4f140af --- /dev/null +++ b/src/api/cnas/process/reportResults.js @@ -0,0 +1,29 @@ +// 鎶ュ憡缁撴灉鐩稿叧鎺ュ彛 +import request from "@/utils/request"; + +//8鎶ュ憡缁撴灉-瀵煎嚭 +export function exportProcessReport(query) { + return request({ + url: "/processReport/exportProcessReport", + method: "get", + params: query, + }); +} + +// 8鎶ュ憡缁撴灉-鏂板 +export function addProcessReport(data) { + return request({ + url: "/processReport/addProcessReport", + method: "post", + data: data, + }); +} + +// 8鎶ュ憡缁撴灉-淇敼 +export function doProcessReport(data) { + return request({ + url: "/processReport/doProcessReport", + method: "post", + data: data, + }); +} diff --git a/src/views/CNAS/process/reportResults/index.vue b/src/views/CNAS/process/reportResults/index.vue new file mode 100644 index 0000000..dd4403e --- /dev/null +++ b/src/views/CNAS/process/reportResults/index.vue @@ -0,0 +1,431 @@ +<template> + <div class="report-results"> + <el-row class="title"> + <el-col :span="12" style="padding-left: 20px;text-align: left;">鎶ュ憡缁撴灉</el-col> + <el-col :span="12" style="text-align: right;"> + <el-button size="medium" type="primary" @click="handleDown" :loading="outLoading" v-if="outPower">瀵煎嚭</el-button> + <el-button size="medium" type="primary" @click="openAdd" v-if="addPower">鏂板</el-button> + </el-col> + </el-row> + <div class="search"> + <div class="search_thing"> + <div class="search_label">妫�楠屾姤鍛婄紪鍙凤細</div> + <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="queryParams.insReportCode" + @keyup.enter.native="refreshTable()"></el-input></div> + </div> + <div class="search_thing" style="padding-left: 30px;"> + <el-button size="small" @click="refresh()">閲� 缃�</el-button> + <el-button size="small" type="primary" @click="refreshTable()">鏌� 璇�</el-button> + </div> + </div> + <div class="table"> + <lims-table :tableData="tableData" :column="column" :tableLoading="tableLoading" :height="'calc(100vh - 290px)'" + :page="page" @pagination="pagination"></lims-table> + <!-- <ValueTable ref="ValueTable" :url="$api.processReport.pageProcessReport" + :delUrl="$api.processReport.delProcessReport" :componentData="componentData" :key="upIndex" /> --> + </div> + <el-dialog :title="title" :visible.sync="addDialogVisible" width="400px" top="6vh"> + <el-row> + <el-col :span="24" style="margin-bottom: 16px;"> + <div class="search_thing"> + <div class="search_label">妫�楠屾姤鍛婄紪鍙凤細</div> + <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable + v-model="addInfo.insReportCode"></el-input></div> + </div> + </el-col> + <el-col :span="24" style="margin-bottom: 16px;"> + <div class="search_thing"> + <div class="search_label">椤垫暟锛�</div> + <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable + v-model="addInfo.pages"></el-input></div> + </div> + </el-col> + <el-col :span="24" style="margin-bottom: 16px;"> + <div class="search_thing"> + <div class="search_label">鍙戦�佷唤鏁帮細</div> + <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable + v-model="addInfo.number"></el-input></div> + </div> + </el-col> + <el-col :span="24" style="margin-bottom: 16px;"> + <div class="search_thing"> + <div class="search_label">鍙戝線浣曞锛�</div> + <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable + v-model="addInfo.send"></el-input></div> + </div> + </el-col> + <el-col :span="24" style="margin-bottom: 16px;"> + <div class="search_thing"> + <div class="search_label">鍙戦�佹柟寮忥細</div> + <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable + v-model="addInfo.method"></el-input></div> + </div> + </el-col> + <el-col :span="24" style="margin-bottom: 16px;"> + <div class="search_thing"> + <div class="search_label">鍙戦�佹棩鏈燂細</div> + <div class="search_input"> + <el-date-picker v-model="addInfo.sendTime" type="date" size="small" placeholder="閫夋嫨鏃ユ湡" format="yyyy-MM-dd" + value-format="yyyy-MM-dd" style="width: 100%;"> + </el-date-picker> + </div> + </div> + </el-col> + <el-col :span="24" style="margin-bottom: 16px;"> + <div class="search_thing"> + <div class="search_label">鍙戦�佷汉锛�</div> + <div class="search_input"> + <el-select v-model="addInfo.sendUser" placeholder="璇烽�夋嫨" size="small" style="width: 100%;"> + <el-option v-for="item in personList" :key="item.value" :label="item.label" :value="item.value"> + </el-option> + </el-select> + </div> + </div> + </el-col> + <el-col :span="24" style="margin-bottom: 16px;"> + <div class="search_thing"> + <div class="search_label">绛炬敹浜猴細</div> + <div class="search_input"> + <el-select v-model="addInfo.signatory" placeholder="璇烽�夋嫨" size="small" style="width: 100%;" multiple> + <el-option v-for="item in personList" :key="item.value" :label="item.label" :value="item.value"> + </el-option> + </el-select> + </div> + </div> + </el-col> + <el-col :span="24" style="margin-bottom: 16px;"> + <div class="search_thing"> + <div class="search_label">澶囨敞锛�</div> + <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addInfo.remark" + type="textarea" :rows="2"></el-input></div> + </div> + </el-col> + </el-row> + <span slot="footer" class="dialog-footer"> + <el-button @click="addDialogVisible = false">鍙� 娑�</el-button> + <el-button type="primary" @click="handleAdd" :loading="addLoading">纭� 瀹�</el-button> + </span> + </el-dialog> + </div> +</template> + +<script> +import limsTable from "@/components/Table/lims-table.vue"; +import { + exportProcessReport, + doProcessReport, + addProcessReport +} from '@/api/cnas/process/reportResults.js' +import { + selectUserCondition, +} from "@/api/business/inspectionTask.js"; +export default { + components: { + limsTable + }, + data() { + return { + outLoading: false, + addPower: true, + outPower: true, + componentData: { + entity: { + insReportCode: null, + // sendUserName: null, + orderBy: { + field: 'createTime', + order: 'desc' + } + }, + isIndex: true, + showSelect: true, + select: true, + selectMethod: 'handleChangeTask', + do: [ + { + id: 'handleWork', + font: '淇敼', + type: 'text', + method: 'handleWork' + }, + { + id: 'delete', + font: '鍒犻櫎', + type: 'text', + method: 'doDiy' + } + ], + tagField: {}, + selectField: { + sendUser: { + select: [] + }, + signatory: { + select: [] + }, + }, + // addUpload:['signatoryUrl'], + requiredAdd: [], + requiredUp: [], + needSort: [], + inputType: '' + }, + entityCopy: {}, + upIndex: 0, + personList: [], + title: '鏂板', + addDialogVisible: false, + addInfo: { + signatory: [] + }, + addLoading: false, + mutilSelect: [], + queryParams: {}, + tableData: [], + column: [ + { label: "缂栧彿", prop: "number" }, + { label: "杈呭姪椤圭洰鍚嶇О", prop: "auxiliaryProject", width: "120px" }, + { + label: "瀹為獙瀹�", + prop: "laboratory", + dataType: "tag", + formatData: (params) => { + return this.laboratoryList.find((m) => m.value == params).label; + }, + }, + { label: "鍗曚綅", prop: "unit" }, + { label: "鏍稿噯宸ユ椂", prop: "approvedWorkingHour" }, + { label: "閮ㄩ棬", prop: "department" }, + { label: "澶囨敞", prop: "remarks" }, + { + dataType: "action", + fixed: "right", + label: "鎿嶄綔", + operation: [ + { + name: "缂栬緫", + type: "text", + clickFun: (row) => { + this.openAdd("缂栬緫", row); + }, + showHide: (row) => { + return this.checkPermi([ + "performance:manHour:workTimeConfig:edit", + ]); + }, + }, + { + name: "鍒犻櫎", + type: "text", + clickFun: (row) => { + this.handleDelete(row); + }, + showHide: (row) => { + return this.checkPermi([ + "performance:manHour:workTimeConfig:del", + ]); + }, + }, + ], + }, + ], + page: { + total: 0, + size: 10, + current: 0, + }, + tableLoading: false, + } + }, + mounted() { + // this.entityCopy = this.HaveJson(this.componentData.entity); + // this.getPower() + this.getAuthorizedPerson() + }, + methods: { + getPower() { + let power = JSON.parse(sessionStorage.getItem('power')) + let up = false + let del = false + let add = false + let out = false + for (var i = 0; i < power.length; i++) { + if (power[i].menuMethod == 'doProcessReport') { + up = true + } + if (power[i].menuMethod == 'addProcessReport') { + add = true + } + if (power[i].menuMethod == 'delProcessReport') { + del = true + } + if (power[i].menuMethod == 'exportProcessReport') { + out = true + } + } + if (!up) { + this.componentData.do.splice(1, 1) + } + if (!del) { + this.componentData.do.splice(0, 1) + } + this.outPower = out + this.addPower = add + }, + handleDown() { + if (this.mutilSelect.length == 0) { + this.$message.warning('璇烽�夋嫨瑕佸鍑虹殑鏁版嵁') + return + } + // html瀵煎嚭涓簑ord锛屾牱瀛愬お涓戜簡锛屼唬鐮佸厛鏀剧潃鍚� + // exportHtmlToWord(this.$refs.content,'妫�楠屾姤鍛婂彂鏀剧櫥璁拌〃') + this.outLoading = true + exportProcessReport({ ids: this.mutilSelect.map(m => m.id) }).then(res => { + this.outLoading = false + if (res.code === 201) return + this.$message.success('瀵煎嚭鎴愬姛') + const url = this.javaApi + '/word/' + res.message; + this.$download.saveAs(url, "鎶ュ憡缁撴灉"); + }) + }, + openAdd() { + this.title = '鏂板' + this.addInfo = { + signatory: [] + } + this.addDialogVisible = true; + }, + refreshTable() { + this.$refs['ValueTable'].selectList() + }, + refresh() { + this.componentData.entity = this.HaveJson(this.entityCopy) + this.upIndex++ + this.refreshTable() + }, + getAuthorizedPerson() { + selectUserCondition().then(res => { + let data = [] + res.data.forEach(a => { + data.push({ + label: a.name, + value: a.id + }) + }) + this.personList = data + }) + }, + handleAdd() { + this.addLoading = true + delete this.addInfo.createTime + delete this.addInfo.createUser + delete this.addInfo.updateTime + delete this.addInfo.signatoryUrl + delete this.addInfo.updateUserer + delete this.addInfo.sendUserName + let addInfo = this.HaveJson(this.addInfo) + addInfo.signatory = addInfo.signatory.join(',') + if (this.title == '鏂板') { + addProcessReport(addInfo).then(res => { + this.addLoading = false + if (res.code == 201) { + return + } + this.addDialogVisible = false + this.$message({ + type: 'success', + message: '鎿嶄綔鎴愬姛!' + }); + this.refreshTable() + }).catch(err => { }) + } else { + doProcessReport(addInfo).then(res => { + this.addLoading = false + if (res.code == 201) { + return + } + this.addDialogVisible = false + this.$message({ + type: 'success', + message: '鎿嶄綔鎴愬姛!' + }); + this.refreshTable() + }).catch(err => { }) + } + }, + handleWork(row) { + this.title = '淇敼' + this.addInfo = row + console.log(this.addInfo) + this.addInfo.signatory = this.addInfo.signatory ? this.addInfo.signatory.split(',').map(m => Number(m)) : [] + this.addDialogVisible = true; + }, + handleChangeTask(list) { + this.mutilSelect = list + } + } +} +</script> + +<style scoped> +.title { + height: 60px; + line-height: 60px; +} + +.search { + background-color: #fff; + height: 80px; + display: flex; + align-items: center; +} + +.search_thing { + width: 350px; + display: flex; + align-items: center; +} + +.search_label { + width: 110px; + font-size: 14px; + text-align: right; +} + +.search_input { + width: calc(100% - 110px); +} + +.table { + margin-top: 10px; + background-color: #fff; + width: calc(100% - 40px); + height: calc(100% - 60px - 80px - 10px - 40px); + padding: 20px; +} + +.tables { + table-layout: fixed; + width: 100%; + margin-top: 10px; +} + +.tables td { + height: 40px; + width: 100px; + text-align: center; + font-size: 14px; + word-wrap: break-word; + white-space: normal; +} + +.en { + font-size: 12px; + word-break: break-word; + /* 鑷姩鏂 */ + overflow-wrap: break-word; + /* 闃叉婧㈠嚭 */ + white-space: normal; + /* 榛樿鎹㈣ */ +} +</style> diff --git a/src/views/CNAS/resourceDemand/standardMaterialAccept/index.vue b/src/views/CNAS/resourceDemand/standardMaterialAccept/index.vue index b6bb91f..1a67d66 100644 --- a/src/views/CNAS/resourceDemand/standardMaterialAccept/index.vue +++ b/src/views/CNAS/resourceDemand/standardMaterialAccept/index.vue @@ -19,34 +19,34 @@ </div> <div class="table"> <lims-table :tableData="tableData" :column="columns" :height="'calc(100vh - 250px)'" @pagination="pagination" - :page="page" :tableLoading="tableLoading"></lims-table> + :page="page" :tableLoading="tableLoading"></lims-table> </div> <AddRecord ref="addRecordRef" @submit="submit"></AddRecord> </div> -<!-- <div class="tables">--> -<!-- <ZTTable--> -<!-- :column="columns"--> -<!-- :table-data="tableData"--> -<!-- >--> -<!-- <template slot="action" slot-scope="{ row }">--> -<!-- <el-button type="text" @click="edit(row)">缂栬緫</el-button>--> -<!-- </template>--> -<!-- </ZTTable>--> -<!-- <div class="pagination">--> -<!-- <div></div>--> -<!-- <el-pagination--> -<!-- :page-size="pagination.pageSize"--> -<!-- :page-sizes="[10, 20, 30, 40]"--> -<!-- :total="pagination.total"--> -<!-- layout="total, sizes, prev, pager, next, jumper"--> -<!-- @current-change="handleCurrent"--> -<!-- @size-change="handleSize"--> -<!-- >--> -<!-- </el-pagination>--> -<!-- </div>--> -<!-- </div>--> -<!-- <AddRecord ref="addRecordRef" @submit="submit"></AddRecord>--> + <!-- <div class="tables">--> + <!-- <ZTTable--> + <!-- :column="columns"--> + <!-- :table-data="tableData"--> + <!-- >--> + <!-- <template slot="action" slot-scope="{ row }">--> + <!-- <el-button type="text" @click="edit(row)">缂栬緫</el-button>--> + <!-- </template>--> + <!-- </ZTTable>--> + <!-- <div class="pagination">--> + <!-- <div></div>--> + <!-- <el-pagination--> + <!-- :page-size="pagination.pageSize"--> + <!-- :page-sizes="[10, 20, 30, 40]"--> + <!-- :total="pagination.total"--> + <!-- layout="total, sizes, prev, pager, next, jumper"--> + <!-- @current-change="handleCurrent"--> + <!-- @size-change="handleSize"--> + <!-- >--> + <!-- </el-pagination>--> + <!-- </div>--> + <!-- </div>--> + <!-- <AddRecord ref="addRecordRef" @submit="submit"></AddRecord>--> </template> <script> @@ -138,8 +138,8 @@ }, methods: { async getTableData() { - const res = await getPageAcceptance(this.form); - if(res.code === 200){ + const res = await getPageAcceptance(this.form); + if (res.code === 200) { this.tableData = res.data.records; this.page.total = res.data.total; } @@ -150,9 +150,9 @@ }, async submit(form) { - const {code} = await form.acceptance.id ? updateAcceptanc(this.form):addAcceptance((this.form)); - if(code == 200) { - this.$message.success(`${form.acceptance.id ? '缂栬緫':'娣诲姞'}鎴愬姛`) + const { code } = await form.acceptance.id ? updateAcceptanc(this.form) : addAcceptance((this.form)); + if (code == 200) { + this.$message.success(`${form.acceptance.id ? '缂栬緫' : '娣诲姞'}鎴愬姛`) this.getTableData() } }, @@ -169,7 +169,7 @@ url: getAcceptanceDetails, params: { id } }) - if(code == 200) { + if (code == 200) { return data; } }, @@ -183,33 +183,8 @@ url: `${exportAcceptance}`, responseType: "blob" }) - const blob = new Blob([res], {type: 'application/octet-stream'}); - //灏咮lob 瀵硅薄杞崲鎴愬瓧绗︿覆 - let reader = new FileReader(); - reader.readAsText(blob, 'utf-8'); - reader.onload = () => { - try { - let result = JSON.parse(reader.result); - if (result.message) { - this.$message.error(result.message); - } else { - const url = URL.createObjectURL(blob); - const link = document.createElement('a'); - link.href = url; - link.download = '鏍囧噯鐗╄川楠屾敹.xlsx'; - link.click(); - this.$message.success('瀵煎嚭鎴愬姛') - } - } catch (err) { - console.log(err); - const url = URL.createObjectURL(blob); - const link = document.createElement('a'); - link.href = url; - link.download = '鏍囧噯鐗╄川楠屾敹.xlsx'; - link.click(); - this.$message.success('瀵煎嚭鎴愬姛') - } - } + const blob = new Blob([res], { type: 'application/octet-stream' }); + this.$download.saveAs(blob, '鏍囧噯鐗╄川楠屾敹.xlsx'); }, // 鍒嗛〉鍒囨崲 diff --git a/src/views/CNAS/systemManagement/customerSatisfaction/index.vue b/src/views/CNAS/systemManagement/customerSatisfaction/index.vue index 414a023..a85c943 100644 --- a/src/views/CNAS/systemManagement/customerSatisfaction/index.vue +++ b/src/views/CNAS/systemManagement/customerSatisfaction/index.vue @@ -310,13 +310,10 @@ let url = ''; if (row.type == 1) { url = this.javaApi + '/img/' + row.fileUrl - file.downloadIamge(url, row.fileName) + this.$download.saveAs(url, row.fileName); } else { url = this.javaApi + '/word/' + row.fileUrl - const link = document.createElement('a'); - link.href = url; - link.download = row.fileName; - link.click(); + this.$download.saveAs(url, row.fileName); } }, // 鍒犻櫎瀹㈡埛鍒嗘瀽闄勪欢 diff --git a/src/views/CNAS/systemManagement/documentControl/components/DistributionCollectionRecord.vue b/src/views/CNAS/systemManagement/documentControl/components/DistributionCollectionRecord.vue index 0548ea4..257bc6b 100644 --- a/src/views/CNAS/systemManagement/documentControl/components/DistributionCollectionRecord.vue +++ b/src/views/CNAS/systemManagement/documentControl/components/DistributionCollectionRecord.vue @@ -394,33 +394,7 @@ exportManageDocumentIssueRecycle(this.queryParams).then(res => { this.outLoading = false const blob = new Blob([res], { type: 'application/octet-stream' }); - // this.$download.saveAs(blob, '鍙戞斁鍥炴敹璁板綍.xlsx') - //灏咮lob 瀵硅薄杞崲鎴愬瓧绗︿覆 - let reader = new FileReader(); - reader.readAsText(blob, 'utf-8'); - reader.onload = () => { - try { - let result = JSON.parse(reader.result); - if (result.message) { - this.$message.error(result.message); - } else { - const url = URL.createObjectURL(blob); - const link = document.createElement('a'); - link.href = url; - link.download = '鍙戞斁鍥炴敹璁板綍.xlsx'; - link.click(); - this.$message.success('瀵煎嚭鎴愬姛') - } - } catch (err) { - console.log(err); - const url = URL.createObjectURL(blob); - const link = document.createElement('a'); - link.href = url; - link.download = '鍙戞斁鍥炴敹璁板綍.xlsx'; - link.click(); - this.$message.success('瀵煎嚭鎴愬姛') - } - } + this.$download.saveAs(blob, '鍙戞斁鍥炴敹璁板綍.xlsx'); }) }, changeFileList(e) { diff --git a/src/views/CNAS/systemManagement/managementReview/components/managementReviewPlan.vue b/src/views/CNAS/systemManagement/managementReview/components/managementReviewPlan.vue index db15a30..20cd3c2 100644 --- a/src/views/CNAS/systemManagement/managementReview/components/managementReviewPlan.vue +++ b/src/views/CNAS/systemManagement/managementReview/components/managementReviewPlan.vue @@ -276,33 +276,7 @@ return } const blob = new Blob([res], { type: 'application/octet-stream' }); - //灏咮lob 瀵硅薄杞崲鎴愬瓧绗︿覆 - let reader = new FileReader(); - reader.readAsText(blob, 'utf-8'); - reader.onload = () => { - try { - let result = JSON.parse(reader.result); - if (result.message) { - this.$message.error(result.message); - } else { - const url = URL.createObjectURL(blob); - const link = document.createElement('a'); - link.href = url; - link.download = '璇勫璁″垝.docx'; - link.click(); - this.$download.saveAs(blob, name) - this.$message.success('瀵煎嚭鎴愬姛') - } - } catch (err) { - console.log(err); - const url = URL.createObjectURL(blob); - const link = document.createElement('a'); - link.href = url; - link.download = '璇勫璁″垝.docx'; - link.click(); - this.$message.success('瀵煎嚭鎴愬姛') - } - } + this.$download.saveAs(blob, '璇勫璁″垝.docx'); }) }, lookFile(url, name) { @@ -313,10 +287,7 @@ handleDown0(url, name) { if (!url) return this.$message.warning('鏂囦欢鏈笂浼�') let url0 = this.javaApi + '/word/' + url - const link = document.createElement('a'); - link.href = url0; - link.target = '_blank'; - link.click(); + this.$download.saveAs(url0, name); } } }; diff --git a/src/views/CNAS/systemManagement/managementReview/components/meetingRecords.vue b/src/views/CNAS/systemManagement/managementReview/components/meetingRecords.vue index 819fa92..890ae93 100644 --- a/src/views/CNAS/systemManagement/managementReview/components/meetingRecords.vue +++ b/src/views/CNAS/systemManagement/managementReview/components/meetingRecords.vue @@ -172,32 +172,7 @@ return } const blob = new Blob([res], { type: 'application/octet-stream' }); - //灏咮lob 瀵硅薄杞崲鎴愬瓧绗︿覆 - let reader = new FileReader(); - reader.readAsText(blob, 'utf-8'); - reader.onload = () => { - try { - let result = JSON.parse(reader.result); - if (result.message) { - this.$message.error(result.message); - } else { - const url = URL.createObjectURL(blob); - const link = document.createElement('a'); - link.href = url; - link.download = '浼氳璁板綍.docx'; - link.click(); - this.$message.success('瀵煎嚭鎴愬姛') - } - } catch (err) { - console.log(err); - const url = URL.createObjectURL(blob); - const link = document.createElement('a'); - link.href = url; - link.download = '浼氳璁板綍.docx'; - link.click(); - this.$message.success('瀵煎嚭鎴愬姛') - } - } + this.$download.saveAs(blob, '浼氳璁板綍.docx'); }) }, } diff --git a/src/views/CNAS/systemManagement/managementReview/components/reviewReport.vue b/src/views/CNAS/systemManagement/managementReview/components/reviewReport.vue index 72a90bc..1599da1 100644 --- a/src/views/CNAS/systemManagement/managementReview/components/reviewReport.vue +++ b/src/views/CNAS/systemManagement/managementReview/components/reviewReport.vue @@ -231,32 +231,7 @@ return } const blob = new Blob([res], { type: 'application/octet-stream' }); - //灏咮lob 瀵硅薄杞崲鎴愬瓧绗︿覆 - let reader = new FileReader(); - reader.readAsText(blob, 'utf-8'); - reader.onload = () => { - try { - let result = JSON.parse(reader.result); - if (result.message) { - this.$message.error(result.message); - } else { - const url = URL.createObjectURL(blob); - const link = document.createElement('a'); - link.href = url; - link.download = '璇勫鎶ュ憡.docx'; - link.click(); - this.$message.success('瀵煎嚭鎴愬姛') - } - } catch (err) { - console.log(err); - const url = URL.createObjectURL(blob); - const link = document.createElement('a'); - link.href = url; - link.download = '璇勫鎶ュ憡.docx'; - link.click(); - this.$message.success('瀵煎嚭鎴愬姛') - } - } + this.$download.saveAs(blob, '璇勫鎶ュ憡.docx'); }) }, submit(type, row) { diff --git a/src/views/business/inspectionReview/index.vue b/src/views/business/inspectionReview/index.vue index 7586d81..8c19573 100644 --- a/src/views/business/inspectionReview/index.vue +++ b/src/views/business/inspectionReview/index.vue @@ -362,12 +362,8 @@ }, // 涓嬭浇鎶ュ憡 download(row) { - let url = (row.urlS===null||row.urlS==='')?row.url:row.urlS - const link = document.createElement('a'); - link.href = this.javaApi + url; - link.target = '_blank'; - document.body.appendChild(link); - link.click(); + let url = this.javaApi+'/word/' + (row.urlS===null||row.urlS==='')?row.url:row.urlS + this.$download.saveAs(url, row.fileName); }, // 杩樺師鎿嶄綔 handleRestore(row) { diff --git a/src/views/business/inspectionTask/components/InspectionWord.vue b/src/views/business/inspectionTask/components/InspectionWord.vue index 4b88e82..862f456 100644 --- a/src/views/business/inspectionTask/components/InspectionWord.vue +++ b/src/views/business/inspectionTask/components/InspectionWord.vue @@ -2039,13 +2039,10 @@ let url = ''; if(res.data.type==1){ url = this.javaApi+'/img/'+res.data.fileUrl - file.downloadIamge(url,row.fileName) + this.$download.saveAs(url, row.fileName); }else{ url = this.javaApi+'/word/'+res.data.fileUrl - const link = document.createElement('a'); - link.href = url; - link.download = row.fileName; - link.click(); + this.$download.saveAs(url, row.fileName); } } }).catch(error => { diff --git a/src/views/business/materialOrder/index.vue b/src/views/business/materialOrder/index.vue index 4a20344..c8e8854 100644 --- a/src/views/business/materialOrder/index.vue +++ b/src/views/business/materialOrder/index.vue @@ -1073,17 +1073,11 @@ let entity = this.tabIndex === 3 ? { ...this.entity, isInspect: 2 } : { ...this.entity, state: 2, orderState: 4, } delete entity.orderBy this.outLoading = true - rawAllExport({ - entity: entity - }, { responseType: "blob" }).then(res => { + rawAllExport({entity: entity}).then(res => { this.outLoading = false this.$message.success('瀵煎嚭鎴愬姛') - const blob = new Blob([res], { type: 'application/octet-stream' }); - const url = URL.createObjectURL(blob); - const link = document.createElement('a'); - link.href = url; - link.download = '鍘熸潗鏂欐娴嬩俊鎭鍑�.xlsx'; - link.click(); + let url = this.javaApi + '/word/' + res.data + this.$download.saveAs(url, '鍘熸潗鏂欐娴嬩俊鎭鍑�.xlsx'); }) }, // 鎻愪氦淇敼濮旀墭缂栧彿淇℃伅 diff --git a/src/views/business/materialOrderComponents/materialOrder/downFileDialog.vue b/src/views/business/materialOrderComponents/materialOrder/downFileDialog.vue index 6ff5627..1f2faab 100644 --- a/src/views/business/materialOrderComponents/materialOrder/downFileDialog.vue +++ b/src/views/business/materialOrderComponents/materialOrder/downFileDialog.vue @@ -46,27 +46,13 @@ methods: { // 杩涘巶妫�楠屾姤鍛婁笅杞� downLoad0 () { - let url = this.downLoadInfo.enterUrlS ? this.downLoadInfo.enterUrlS : this.downLoadInfo.enterUrl - if(url){ - url = url.split('.')[0]+'.pdf' - const link = document.createElement('a'); - link.href = this.javaApi + url; - link.target = '_blank'; - document.body.appendChild(link); - link.click(); - } + let url = this.javaApi+'/word/' + this.downLoadInfo.enterUrlS ? this.downLoadInfo.enterUrlS : this.downLoadInfo.enterUrl + this.$download.saveAs(url, this.downLoadInfo.fileName); }, // 瀛e害妫�楠屾姤鍛婁笅杞� downLoad1 () { - let url = this.downLoadInfo.quarterUrlS ? this.downLoadInfo.quarterUrlS : this.downLoadInfo.quarterUrl - if(url){ - url = url.split('.')[0]+'.pdf' - const link = document.createElement('a'); - link.href = this.javaApi + url; - link.target = '_blank'; - document.body.appendChild(link); - link.click(); - } + let url = this.javaApi+'/word/' + this.downLoadInfo.quarterUrlS ? this.downLoadInfo.quarterUrlS : this.downLoadInfo.quarterUrl + this.$download.saveAs(url, this.downLoadInfo.fileName); } }, } diff --git a/src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue b/src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue index db188d7..8dc8ee0 100644 --- a/src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue +++ b/src/views/business/materialOrderComponents/materialOrder/filesLookVisible.vue @@ -158,13 +158,10 @@ let url = ''; if (res.data.type == 1) { url = this.javaApi + '/img/' + res.data.fileUrl - file.downloadIamge(url, row.fileName) + this.$download.saveAs(url, row.fileName); } else { url = this.javaApi + '/word/' + res.data.fileUrl - const link = document.createElement('a'); - link.href = url; - link.download = row.fileName; - link.click(); + this.$download.saveAs(url, row.fileName); } } }).catch(error => { diff --git a/src/views/business/productOrder/index.vue b/src/views/business/productOrder/index.vue index 757f49d..135973f 100644 --- a/src/views/business/productOrder/index.vue +++ b/src/views/business/productOrder/index.vue @@ -865,14 +865,10 @@ }, // 瀵煎嚭璁板綍 downLoad () { - rawAllInsOrderExport({...this.entity, responseType: "blob"}).then(res => { + rawAllInsOrderExport({...this.entity}).then(res => { this.$message.success('瀵煎嚭鎴愬姛') - const blob = new Blob([res],{ type: 'application/octet-stream' }); - const url = URL.createObjectURL(blob); - const link = document.createElement('a'); - link.href = url; - link.download = '濮旀墭妫�娴嬩俊鎭鍑�' + '.xlsx'; - link.click(); + let url = this.javaApi + '/word/' + res.data + this.$download.saveAs(url, '濮旀墭妫�娴嬩俊鎭鍑�.xlsx'); }).catch(err => { console.log('err---', err); }) @@ -984,13 +980,10 @@ let url = ''; if(res.data.type==1){ url = this.javaApi+'/img/'+res.data.fileUrl - file.downloadIamge(url,row.fileName) + this.$download.saveAs(url, row.fileName); }else{ url = this.javaApi+'/word/'+res.data.fileUrl - const link = document.createElement('a'); - link.href = url; - link.download = row.fileName; - link.click(); + this.$download.saveAs(url, row.fileName); } } }).catch(error => { @@ -999,14 +992,9 @@ }, // 涓嬭浇鎶ュ憡 download(row) { - let url = row.urlS?row.urlS:row.url; + let url = this.javaApi+'/word/' + row.urlS?row.urlS:row.url; if(url){ - url = url.split('.')[0]+'.pdf' - const link = document.createElement('a'); - link.href = this.javaApi + url; - link.target = '_blank'; - document.body.appendChild(link); - link.click(); + this.$download.saveAs(url, this.downLoadInfo.fileName); } }, // 鎾ら攢 diff --git a/src/views/business/productSamplingInfo/components/addQuarterItem.vue b/src/views/business/productSamplingInfo/components/addQuarterItem.vue new file mode 100644 index 0000000..765ed43 --- /dev/null +++ b/src/views/business/productSamplingInfo/components/addQuarterItem.vue @@ -0,0 +1,290 @@ +<template> + <div> + <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="quarterSampleDia" title="瀛e害鎶芥牱" width="90%" @close="quarterSampleDia = false"> + <div style="display: flex;align-items: center;justify-content: space-between;margin-bottom: 10px"> + <div style="width: 30%;display: flex;align-items: center;" > + <span style="width: 50px">缂栧彿锛�</span> + <el-input v-model="quarterSampleForm.quarterNo" :disabled="operationType !== 'add'" size="small"></el-input> + </div> + <div v-if="operationType === 'add'"> + <el-button size="small" type="primary" @click="addQuarter">娣诲姞</el-button> + <el-button size="small" type="danger" @click="clearTable">娓呯┖</el-button> + </div> + </div> + <div> + <el-table v-loading="tableLoading" :data="quarterItems" border height="400" style="width: 100%"> + <el-table-column label="浜у搧绫诲瀷" prop="productType" width="200"> + <template slot-scope="{row}"> + <template> + <el-input v-model="row.productType" size="small"/> + </template> + </template> + </el-table-column> + <el-table-column label="璐d换浜�" prop="dutyUser" width="100"></el-table-column> + <el-table-column label="鍨嬪彿" prop="productModel" width="120"> + <template slot-scope="{row}"> + <template> + <el-input v-model="row.productModel" size="small" :disabled="operationType === 'view'"/> + </template> + </template> + </el-table-column> + <el-table-column label="鎶芥牱鏁伴噺" min-width="340" prop="spotCheckNumber"> + <template slot-scope="{row}"> + <template> + <el-input v-model="row.spotCheckNumber" size="small" :disabled="operationType === 'view'"/> + </template> + </template> + </el-table-column> + <el-table-column v-if="operationType === 'add'" label="鏁伴噺" min-width="120" prop="number"> + <template slot-scope="{row}"> + <template> + <el-input v-model="row.number" size="small" :disabled="operationType === 'view'"/> + </template> + </template> + </el-table-column> + <el-table-column v-if="operationType !== 'add'" label="鎶芥牱鏃堕棿" prop="spotCheckTime" width="160"> + <template slot-scope="{row}"> + <template> + <el-date-picker v-model="row.spotCheckTime" + format="yyyy-MM-dd" + :disabled="operationType === 'view'" + placeholder="閫夋嫨鏃ユ湡" + size="small" + clearable + style="width:100%" + type="date" + value-format="yyyy-MM-dd"> + </el-date-picker> + </template> + </template> + </el-table-column> + <el-table-column v-if="operationType !== 'add'" label="璇曟牱缁撹" prop="result" width="130"> + <template v-slot="scope"> + <el-select v-model="scope.row.result" placeholder="璇烽�夋嫨" size="small" clearable :disabled="operationType === 'view'"> + <el-option label="鍚堟牸" value="鍚堟牸"></el-option> + <el-option label="涓嶅悎鏍�" value="涓嶅悎鏍�"></el-option> + </el-select> + </template> + </el-table-column> + <el-table-column v-if="operationType !== 'add'" label="鍙栨牱浜哄憳" prop="samplingUser" width="120"> + <template slot-scope="{row}"> + <template> + <el-input v-model="row.samplingUser" size="small" :disabled="operationType === 'view'"/> + </template> + </template> + </el-table-column> + <el-table-column label="澶囨敞" prop="itemRemark" width="200"> + <template slot-scope="{row}"> + <template> + <el-input v-model="row.itemRemark" size="small" :disabled="operationType === 'view'"/> + </template> + </template> + </el-table-column> + <el-table-column v-if="operationType !== 'view'" fixed="right" label="鎿嶄綔" width="100"> + <template slot-scope="scope"> + <el-button size="small" style="color: #f56c6c" type="text" @click="deleteScope(scope.$index)">鍒犻櫎</el-button> + </template> + </el-table-column> + </el-table> + </div> + <div style="display: flex;align-items: center;margin: 10px 0"> + <span style="width: 70px">澶囨敞锛�</span> + <el-input v-model="quarterSampleForm.remark" :disabled="operationType === 'view'" size="small" style="width: 43%" type="textarea"></el-input> + </div> + <div v-if="operationType !== 'add'"> + <el-form ref="form" :model="editForm" label-width="70px"> + <el-col :span="12"> + <el-form-item label="缂栧埗浜猴細"> + <el-select v-model="editForm.writeUser" :disabled="operationType !=='edit'" placeholder="璇烽�夋嫨" size="small" style="width: 100%"> + <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="浼氱浜猴細"> + <el-select v-model="editForm.countersignUser" :disabled="operationType !=='edit'" multiple placeholder="璇烽�夋嫨" size="small" style="width: 100%"> + <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="瀹℃牳浜猴細"> + <el-select v-model="editForm.examineUser" :disabled="operationType !=='edit'" placeholder="璇烽�夋嫨" size="small" style="width: 100%"> + <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="鎵瑰噯浜猴細"> + <el-select v-model="editForm.ratifyUser" :disabled="operationType !=='edit'" placeholder="璇烽�夋嫨" size="small" style="width: 100%"> + <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </el-form-item> + </el-col> + </el-form> + </div> + <span slot="footer" class="dialog-footer"> + <el-button @click="quarterSampleDia = false">鍙� 娑�</el-button> + <el-button v-if="operationType === 'add'" @click="quarterSampleDia = false">淇� 瀛�</el-button> + <el-button v-if="operationType !== 'add' && operationType !== 'view'" type="primary" @click="handleSample">纭� 瀹�</el-button> + </span> + </el-dialog> + </div> +</template> + +<script> +import {addQuarter, getQuarter, updateQuarterOnOrder} from "@/api/business/productSamplingInfo"; +import {selectUserCondition} from "@/api/performance/class"; + +export default { + name: "addQuarterItem", + // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢� + components: {}, + data() { + // 杩欓噷瀛樻斁鏁版嵁 + return { + tableLoading: false, + quarterSampleDia: false, // 瀛e害鎶芥牱寮规 + quarterSampleForm: { + quarterNo: '', // 缂栧彿 + }, + quarterItems: [], + quarterTemItems: [], + operationType: '', + editForm: { + quarterId: '', + writeUser: '', // 缂栧埗浜� + countersignUser: [], // 浼氱浜� + examineUser: '', // 瀹℃牳浜� + ratifyUser: '', // 鎵瑰噯浜� + }, + userList: [], + quarterRow: {}, + } + }, + mounted() { + this.getUserList() + }, + // 鏂规硶闆嗗悎 + methods: { + openDia (quarterTemItems, type) { + this.quarterSampleDia = true + this.operationType = type + if (type === 'add') { + if (quarterTemItems.length > 0) { + this.quarterItems = quarterTemItems + } + this.quarterSampleForm.quarterNo = getCurrentMonthTwoDigits() + } else { + this.tableLoading = true + this.quarterRow = quarterTemItems + getQuarter({quarterId: quarterTemItems.quarterId}).then(res => { + this.tableLoading = false + if (res.code === 200) { + this.quarterItems = res.data.quarterItems + this.quarterSampleForm.quarterNo = res.data.quarterNo + this.quarterSampleForm.remark = res.data.remark + this.editForm.quarterId = res.data.quarterId + this.editForm.writeUser = res.data.writeUser + this.editForm.examineUser = res.data.examineUser + this.editForm.ratifyUser = res.data.ratifyUser + if (res.data.countersignUser) { + this.editForm.countersignUser = res.data.countersignUser.split(",").map(Number) + } + } + }) + } + }, + // 鎵嬪姩娣诲姞 + addQuarter () { + this.quarterItems.push({ + productType: '', + dutyUser: JSON.parse(localStorage.getItem("user")).name, + productModel: '', + spotCheckNumber: '', + number: '', + spotCheckTime: '', + result: '', + samplingUser: '', + itemRemark: '', + }) + }, + // 鎻愪氦瀛e害鎶芥牱 + handleSample () { + this.$confirm('鏄惁鎻愪氦璇ユ暟鎹�', '鎻愮ず', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + type: 'warning' + }).then(() => { + if (this.operationType === 'add') { + this.quarterSampleForm.quarterItems = JSON.parse(JSON.stringify(this.quarterItems)) + this.quarterSampleForm.quarterItems.forEach(item => { + item.spotCheckNumber = item.spotCheckNumber + ' ' + (item.number == null ? "" : item.number) + }) + addQuarter(this.quarterSampleForm).then(res => { + if (res.code == 200) { + this.$message.success('鎻愪氦鎴愬姛') + this.quarterItems = [] + this.$parent.quarterTemItems = [] + this.closeQuarterSampleDia() + } + }) + } else { + const params = {...this.editForm} + if (params.countersignUser.length > 0) { + params.countersignUser = params.countersignUser.join(',') + } else { + params.countersignUser = '' + } + params.quarterItems = JSON.parse(JSON.stringify(this.quarterItems)) + updateQuarterOnOrder(params).then(res => { + if (res.code == 200) { + this.$message.success('鎻愪氦鎴愬姛') + this.quarterItems = [] + this.closeQuarterSampleDia() + } + }) + } + }).catch(() => { + this.$message({ + type: 'info', + message: '宸插彇娑�' + }); + }); + + }, + // 娓呯┖鎶芥牱璁″垝 + clearTable () { + this.quarterItems = [] + this.$parent.quarterTemItems = [] + }, + // 鎵嬪姩鍒犻櫎 + deleteScope (index) { + this.quarterItems.splice(index, 1) + }, + // 鍏抽棴瀛e害鎶芥牱寮规 + closeQuarterSampleDia () { + this.quarterSampleDia = false + if (this.operationType === 'add') { + this.$parent.handleStockList() + } else { + this.$parent.refreshTable() + } + }, + getUserList(){ + selectUserCondition({ type: 0 }).then((res) => { + this.userList = res.data; + }) + }, + }, +} +function getCurrentMonthTwoDigits() { + const currentDate = new Date(); + const year = currentDate.getFullYear(); + const currentMonth = currentDate.getMonth() + 1; + return year + currentMonth.toString().padStart(2, '0'); +} +</script> + +<style scoped> +</style> diff --git a/src/views/business/productSamplingInfo/index.vue b/src/views/business/productSamplingInfo/index.vue new file mode 100644 index 0000000..a7c2831 --- /dev/null +++ b/src/views/business/productSamplingInfo/index.vue @@ -0,0 +1,647 @@ +<template> + <div class="capacity-scope"> + <div style="display: flex;justify-content: space-between"> + <el-form :model="entity" ref="entity" size="small" :inline="true"> + <el-form-item label="缂栧彿" prop="quarterNo" v-show="tabIndex === 0"> + <el-input v-model="entity.quarterNo" clearable placeholder="璇疯緭鍏�" + size="small" + @keyup.enter.native="refreshTable"> + </el-input> + </el-form-item> + <el-form-item> + <el-button type="primary" icon="el-icon-search" size="mini" @click="refreshTable">鏌� 璇�</el-button> + <el-button icon="el-icon-refresh" size="mini" @click="refresh">閲� 缃�</el-button> + </el-form-item> + </el-form> + <div> + <el-button v-if="tabIndex === 1" size="small" type="primary" @click="yearSample('add')">骞村害鎶芥牱</el-button> + </div> + </div> + <div> + <div class="table"> + <ul class="tab"> + <li v-for="(m,i) in tabList" :key="i" :class="{active:i===tabIndex}" @click="handleTab(m,i)">{{m.label}}</li> + </ul> + <!--瀛e害--> + <lims-table :tableData="tableData" :column="column" v-if="tabIndex === 0" + @pagination="pagination" :height="'calc(100vh - 290px)'" + :page="page" :tableLoading="tableLoading"></lims-table> + <!--骞村害--> + <lims-table :tableData="tableData1" :column="column1" v-if="tabIndex === 1" + @pagination="pagination1" :height="'calc(100vh - 290px)'" + key="tableData1" :page="page1" :tableLoading="tableLoading1"></lims-table> + </div> + </div> + <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="yearSampleDia" title="骞村害鎶芥牱" width="70%" + @close="closeYearSampleDia"> + <div style="display: flex;align-items: center;justify-content: space-between;margin-bottom: 10px"> + <div style="width: 30%;display: flex;align-items: center;" > + <el-input v-if="operationType !=='view'" v-model="currentYear" size="small"/> + <span v-if="operationType ==='view'" style="width: 160px;font-size: 18px;font-weight: 600">{{currentYear}}</span> + </div> + <div v-if="operationType !== 'view'"> + <el-button size="small" type="primary" @click="addQuarter">娣诲姞</el-button> + <el-button size="small" type="danger" @click="clearTable">娓呯┖</el-button> + </div> + </div> + <div> + <el-table :data="yearItems" border height="450" style="width: 100%"> + <el-table-column label="绫诲埆" prop="yearType" width="240"> + <template slot-scope="{row}"> + <template v-if="operationType !== 'view'"> + <el-input v-model="row.yearType" size="small" type="textarea" :rows="4"/> + </template> + <template v-else> + <span size="small">{{row.yearType}}</span> + </template> + </template> + </el-table-column> + <el-table-column header-align="center" label="1" prop="january" width="160"> + <template slot-scope="{row}"> + <template v-if="operationType !== 'view'"> + <el-input v-model="row.january" size="small" type="textarea" :rows="4"/> + </template> + <template v-else> + <span size="small">{{row.january}}</span> + </template> + </template> + </el-table-column> + <el-table-column header-align="center" label="2" prop="february" width="160"> + <template slot-scope="{row}"> + <template v-if="operationType !== 'view'"> + <el-input v-model="row.february" size="small" type="textarea" :rows="4"/> + </template> + <template v-else> + <span size="small">{{row.february}}</span> + </template> + </template> + </el-table-column> + <el-table-column header-align="center" label="3" prop="march" width="160"> + <template slot-scope="{row}"> + <template v-if="operationType !== 'view'"> + <el-input v-model="row.march" size="small" type="textarea" :rows="4"/> + </template> + <template v-else> + <span size="small">{{row.march}}</span> + </template> + </template> + </el-table-column> + <el-table-column header-align="center" label="4" prop="april" width="160"> + <template slot-scope="{row}"> + <template v-if="operationType !== 'view'"> + <el-input v-model="row.april" size="small" type="textarea" :rows="4"/> + </template> + <template v-else> + <span size="small">{{row.april}}</span> + </template> + </template> + </el-table-column> + <el-table-column header-align="center" label="5" prop="may" width="160"> + <template slot-scope="{row}"> + <template v-if="operationType !== 'view'"> + <el-input v-model="row.may" size="small" type="textarea" :rows="4"/> + </template> + <template v-else> + <span size="small">{{row.may}}</span> + </template> + </template> + </el-table-column> + <el-table-column header-align="center" label="6" prop="june" width="160"> + <template slot-scope="{row}"> + <template v-if="operationType !== 'view'"> + <el-input v-model="row.june" size="small" type="textarea" :rows="4"/> + </template> + <template v-else> + <span size="small">{{row.june}}</span> + </template> + </template> + </el-table-column> + <el-table-column header-align="center" label="7" prop="july" width="160"> + <template slot-scope="{row}"> + <template v-if="operationType !== 'view'"> + <el-input v-model="row.july" size="small" type="textarea" :rows="4"/> + </template> + <template v-else> + <span size="small">{{row.july}}</span> + </template> + </template> + </el-table-column> + <el-table-column header-align="center" label="8" prop="august" width="160"> + <template slot-scope="{row}"> + <template v-if="operationType !== 'view'"> + <el-input v-model="row.august" size="small" type="textarea" :rows="4"/> + </template> + <template v-else> + <span size="small">{{row.august}}</span> + </template> + </template> + </el-table-column> + <el-table-column header-align="center" label="9" prop="september" width="160"> + <template slot-scope="{row}"> + <template v-if="operationType !== 'view'"> + <el-input v-model="row.september" size="small" type="textarea" :rows="4"/> + </template> + <template v-else> + <span size="small">{{row.september}}</span> + </template> + </template> + </el-table-column> + <el-table-column header-align="center" label="10" prop="october" width="160"> + <template slot-scope="{row}"> + <template v-if="operationType !== 'view'"> + <el-input v-model="row.october" size="small" type="textarea" :rows="4"/> + </template> + <template v-else> + <span size="small">{{row.october}}</span> + </template> + </template> + </el-table-column> + <el-table-column header-align="center" label="11" prop="november" width="160"> + <template slot-scope="{row}"> + <template v-if="operationType !== 'view'"> + <el-input v-model="row.november" size="small" type="textarea" :rows="4"/> + </template> + <template v-else> + <span size="small">{{row.november}}</span> + </template> + </template> + </el-table-column> + <el-table-column header-align="center" label="12" prop="december" width="160"> + <template slot-scope="{row}"> + <template v-if="operationType !== 'view'"> + <el-input v-model="row.december" size="small" type="textarea" :rows="4"/> + </template> + <template v-else> + <span size="small">{{row.december}}</span> + </template> + </template> + </el-table-column> + <el-table-column v-if="operationType !== 'view'" fixed="right" label="鎿嶄綔" width="100"> + <template slot-scope="scope"> + <el-button size="small" style="color: #f56c6c" type="text" @click="deleteScope(scope.$index)">鍒犻櫎</el-button> + </template> + </el-table-column> + </el-table> + </div> + <div style="display: flex;align-items: center;margin-top: 10px"> + <span style="width: 70px">娉ㄦ剰浜嬮」锛�</span> + <el-input v-model="yearSampleForm.tableRemark" :disabled="operationType === 'view'" size="small" style="width: 50%" type="textarea"></el-input> + </div> + <div style="display: flex;align-items: center;margin-top: 10px"> + <span style="width: 70px">澶囨敞锛�</span> + <el-input v-model="yearSampleForm.remark" :disabled="operationType === 'view'" size="small" style="width: 50%" type="textarea"></el-input> + </div> + <div v-if="operationType !== 'add'"> + <el-form ref="form" :model="editYearFormRow" label-width="70px"> + <el-col :span="12"> + <el-form-item label="缂栧埗浜猴細"> + <el-select v-model="editYearFormRow.writeUser" :disabled="operationType !=='edit'" placeholder="璇烽�夋嫨" size="small" style="width: 100%"> + <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="浼氱浜猴細"> + <el-select v-model="editYearFormRow.countersignUser" :disabled="operationType !=='edit'" multiple placeholder="璇烽�夋嫨" size="small" style="width: 100%"> + <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="瀹℃牳浜猴細"> + <el-select v-model="editYearFormRow.examineUser" :disabled="operationType !=='edit'" placeholder="璇烽�夋嫨" size="small" style="width: 100%"> + <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="鎵瑰噯浜猴細"> + <el-select v-model="editYearFormRow.ratifyUser" :disabled="operationType !=='edit'" placeholder="璇烽�夋嫨" size="small" style="width: 100%"> + <el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </el-form-item> + </el-col> + </el-form> + </div> + <span slot="footer" class="dialog-footer"> + <el-button @click="closeYearSampleDia">鍙� 娑�</el-button> + <el-button v-if="operationType !== 'view'" type="primary" @click="handleSample">纭� 瀹�</el-button> + </span> + </el-dialog> + <add-quarter-item ref="addQuarterItem"></add-quarter-item> + </div> +</template> + +<script> +import AddQuarterItem from "./components/addQuarterItem.vue"; +import limsTable from "@/components/Table/lims-table.vue"; +import { + addSpotCheckYear, + deleteQuarter, deleteSpotCheckYear, + finalReportQuarter, + finalReportSpotCheckYear, + getQuarterPage, getSpotCheckYear, getSpotCheckYearPage, updateSpotCheckYear +} from "@/api/business/productSamplingInfo"; +import {selectUserCondition} from "@/api/performance/class"; + +export default { + name: "b1-product-sampling-info", + // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢� + components: {limsTable, AddQuarterItem}, + data() { + // 杩欓噷瀛樻斁鏁版嵁 + return { + upIndex: 0, + tabIndex: 0, + tabList: [ + { + label: '瀛e害', + value: 0 + }, + { + label: '骞村害', + value: 1 + }, + ], + entity: { + quarterNo: null, + }, + tableData: [], + tableLoading: false, + column: [ + {label: '缂栧彿', prop: 'quarterNo'}, + {label: '澶囨敞', prop: 'remark'}, + {label: '鍒涘缓浜�', prop: 'createUserName'}, + {label: '鍒涘缓鏃堕棿', prop: 'createTime'}, + { + dataType: 'action', + label: '鎿嶄綔', + operation: [ + { + name: '缂栬緫', + type: 'text', + clickFun: (row) => { + this.editForm(row); + }, + }, + { + name: '鏌ョ湅', + type: 'text', + clickFun: (row) => { + this.viewQuarterInfo(row); + }, + }, + { + name: '涓嬭浇', + type: 'text', + clickFun: (row) => { + this.handleDown(row); + }, + }, + { + name: '鍒犻櫎', + type: 'text', + clickFun: (row) => { + this.deleteQuarterInfo(row); + }, + } + ] + } + ], + page: { + total:0, + size:10, + current:1 + }, + tableData1: [], + tableLoading1: false, + column1: [ + { label: '鍚嶇О', prop: 'yearHead' }, + { label: '鍒涘缓浜�', prop: 'createUserName' }, + { label: '鍒涘缓鏃堕棿', prop: 'createTime' }, + { + dataType: 'action', + label: '鎿嶄綔', + operation: [ + { + name: '缂栬緫', + type: 'text', + clickFun: (row) => { + this.editYearForm(row); + }, + }, + { + name: '鏌ョ湅', + type: 'text', + clickFun: (row) => { + this.viewYearInfo(row); + }, + }, + { + name: '涓嬭浇', + type: 'text', + clickFun: (row) => { + this.download(row); + }, + }, + { + name: '鍒犻櫎', + type: 'text', + clickFun: (row) => { + this.deleteYearInfo(row); + }, + }, + ] + } + ], + page1: { + total: 0, + size: 10, + current: 1 + }, + yearSampleDia: false, // 骞村害鎶芥牱 + yearSampleForm: { + tableRemark: '', + remark: '' + }, + yearItems: [], + currentYear: '', + operationType: '', + userList: [], + yearRow: {}, + editYearFormRow: { + yearId: '', + writeUser: '', // 缂栧埗浜� + countersignUser: null, // 浼氱浜� + examineUser: '', // 瀹℃牳浜� + ratifyUser: '', // 鎵瑰噯浜� + } + } + }, + mounted() { + this.refreshTable() + }, + // 鏂规硶闆嗗悎 + methods: { + // 鏌ヨ鍥炶皟 + refreshTable(e) { + if (this.tabIndex === 0) { + this.getQuarterPageList() + } else if (this.tabIndex === 1) { + this.getSpotCheckYearPageList() + } + }, + getQuarterPageList () { + this.tableLoading = true + getQuarterPage({ + ...this.page,...this.entity + }).then(res => { + this.tableLoading = false + this.page.total = res.data.total + this.tableData = res.data.records + }).catch(err => { + this.tableLoading = false + }) + }, + getSpotCheckYearPageList () { + this.tableLoading1 = true + getSpotCheckYearPage({ + ...this.page1 + }).then(res => { + this.tableLoading1 = false + this.page1.total = res.data.total + this.tableData1 = res.data.records + }).catch(err => { + this.tableLoading1 = false + }) + }, + // 閲嶇疆 + refresh() { + this.resetForm('entity') + this.refreshTable() + }, + pagination (page) { + this.page.size = page.limit + this.refreshTable() + }, + pagination1 (page) { + this.page1.size = page.limit + this.refreshTable() + }, + // 缂栬緫瀛e害鎶芥牱 + editForm (row) { + this.$refs.addQuarterItem.openDia(row, 'edit') + }, + // 鏌ョ湅瀛e害鎶芥牱 + viewQuarterInfo (row) { + this.$refs.addQuarterItem.openDia(row, 'view') + }, + // 鍒犻櫎瀛e害鎶芥牱 + deleteQuarterInfo (row) { + this.$confirm('鏄惁鍒犻櫎褰撳墠鏁版嵁?', "璀﹀憡", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }).then(() => { + deleteQuarter({quarterId: row.quarterId}).then(res => { + if (res.code === 200) { + this.$message.success('鍒犻櫎鎴愬姛') + this.refreshTable() + } + }) + }).catch(() => {}) + }, + // 瀵煎嚭 + handleDown (row) { + let randomNum = Math.random(); + finalReportQuarter({quarterId: row.quarterId, random: randomNum}).then(res => { + this.outLoading = false + const blob = new Blob([res], { type: 'application/octet-stream' }); + this.$download.saveAs(blob, '瀛e害鎶芥牱淇℃伅瀵煎嚭.docx') + this.$message.success('瀵煎嚭鎴愬姛') + }) + }, + // 骞村害涓嬭浇 + download(row) { + finalReportSpotCheckYear({yearId: row.yearId}).then(res => { + this.outLoading = false + const blob = new Blob([res], { type: 'application/octet-stream' }); + this.$download.saveAs(blob, row.yearHead + '.docx') + this.$message.success('瀵煎嚭鎴愬姛') + }) + }, + // 鍒犻櫎骞村害鎶芥牱 + deleteYearInfo (row) { + this.$confirm('鏄惁鍒犻櫎褰撳墠鏁版嵁?', "璀﹀憡", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" + }).then(() => { + deleteSpotCheckYear({yearId: row.yearId}).then(res => { + if (res.code === 200) { + this.$message.success('鍒犻櫎鎴愬姛') + this.refreshTable() + } + }) + }).catch(() => {}) + }, + // 鏌ョ湅骞村害璇︽儏 + viewYearInfo (row) { + this.operationType = 'view' + this.getUserList() + this.yearSampleDia = true + this.yearRow = row + getSpotCheckYear({yearId: row.yearId}).then(res => { + if (res.code === 200) { + this.currentYear = res.data.yearHead + this.yearItems = res.data.yearItems + this.yearSampleForm.tableRemark = res.data.tableRemark + this.yearSampleForm.remark = res.data.remark + this.editYearFormRow.yearId = res.data.yearId + this.editYearFormRow.writeUser = res.data.writeUser + this.editYearFormRow.examineUser = res.data.examineUser + this.editYearFormRow.ratifyUser = res.data.ratifyUser + if (res.data.countersignUser) { + this.editYearFormRow.countersignUser = res.data.countersignUser.split(",").map(Number) + } + } + }) + }, + // 缂栬緫骞村害鎶芥牱 + editYearForm (row) { + this.operationType = 'edit' + this.getUserList() + this.yearSampleDia = true + getSpotCheckYear({yearId: row.yearId}).then(res => { + if (res.code === 200) { + this.currentYear = res.data.yearHead + this.yearItems = res.data.yearItems + this.yearSampleForm.tableRemark = res.data.tableRemark + this.yearSampleForm.remark = res.data.remark + this.editYearFormRow.yearId = res.data.yearId + this.editYearFormRow.writeUser = res.data.writeUser + this.editYearFormRow.examineUser = res.data.examineUser + this.editYearFormRow.ratifyUser = res.data.ratifyUser + if (res.data.countersignUser) { + this.editYearFormRow.countersignUser = res.data.countersignUser.split(",").map(Number) + } + } + }) + }, + // 鎻愪氦骞村害璁″垝 + handleSample () { + if (this.operationType === 'add') { + this.yearSampleForm.yearItems = JSON.parse(JSON.stringify(this.yearItems)) + this.yearSampleForm.yearHead = this.currentYear + addSpotCheckYear(this.yearSampleForm).then(res => { + if (res.code == 200) { + this.$message.success('鎻愪氦鎴愬姛') + this.yearSampleForm = {} + this.yearItems = [] + this.closeYearSampleDia() + this.refreshTable() + } + }) + } else { + const params = {...this.editYearFormRow} + if (params.countersignUser != null) { + params.countersignUser = params.countersignUser.join(',') + } + params.yearItems = JSON.parse(JSON.stringify(this.yearItems)) + params.tableRemark = this.yearSampleForm.tableRemark + params.remark = this.yearSampleForm.remark + updateSpotCheckYear(params).then(res => { + if (res.code == 200) { + this.$message.success('淇敼鎴愬姛') + this.yearSampleForm = {} + this.editYearFormRow = { + yearId: '', + writeUser: '', // 缂栧埗浜� + countersignUser: [], // 浼氱浜� + examineUser: '', // 瀹℃牳浜� + ratifyUser: '', // 鎵瑰噯浜� + } + this.yearItems = [] + this.closeYearSampleDia() + this.refreshTable() + } + }) + } + }, + yearSample (type) { + this.operationType = type + const currentDate = new Date(); + this.yearSampleDia = true + this.currentYear = currentDate.getFullYear() + '骞村勾搴︽娊妫�璁″垝' + }, + // 娣诲姞骞村害璁″垝 + addQuarter () { + this.yearItems.push({}) + }, + // 娓呯┖鎶芥牱璁″垝 + clearTable () { + this.yearItems = [] + }, + // 鎵嬪姩鍒犻櫎 + deleteScope (index) { + this.yearItems.splice(index, 1) + }, + // 鍒囨崲涓嬪崟tab琛ㄦ牸 + handleTab(m, i) { + this.tabIndex = i; + if (this.tabIndex === 0) { + this.componentData.entity.quarterNo = this.entity.quarterNo + } + this.refreshTable() + }, + closeYearSampleDia () { + this.yearSampleForm = { + tableRemark: '', + remark: '' + } + this.yearItems = [] + this.yearSampleDia = false + }, + getStyle(){ + return 'height: calc(100% - '+'44'+'px)' + }, + getUserList(){ + selectUserCondition({ type: 0 }).then((res) => { + this.userList = res.data; + }) + }, + }, +} +</script> + +<style scoped> +.tab { + list-style-type: none; + display: flex; + margin-bottom: 12px; + margin-top: 0; + padding-left: 0; +} + +.tab li { + line-height: 24px; + padding: 6px 14px; + font-size: 14px; + color: #333333; + border: 1px solid #EEEEEE; + cursor: pointer; +} + +.tab li:nth-child(1) { + border-radius: 8px 0 0 8px; +} + +.tab li:nth-child(2) { + border-radius: 0 8px 8px 0; +} + +.tab li.active { + border-color: #3A7BFA; + color: #3A7BFA; +} +</style> diff --git a/src/views/business/rawMaterialInspection/index.vue b/src/views/business/rawMaterialInspection/index.vue index 2ea2eb7..a993bac 100644 --- a/src/views/business/rawMaterialInspection/index.vue +++ b/src/views/business/rawMaterialInspection/index.vue @@ -795,16 +795,11 @@ this.outLoading = true rawAllExport({ entity:entity - },{ - responseType: "blob"}).then(res => { + }).then(res => { this.outLoading = false this.$message.success('瀵煎嚭鎴愬姛') - const blob = new Blob([res],{ type: 'application/octet-stream' }); - const url = URL.createObjectURL(blob); - const link = document.createElement('a'); - link.href = url; - link.download = '鍘熸潗鏂欐娴嬩俊鎭鍑�.xlsx'; - link.click(); + let url = this.javaApi + '/word/' + res.data + this.$download.saveAs(url, "鍘熸潗鏂欐娴嬩俊鎭鍑�.xlsx"); }) }, clear() { diff --git a/src/views/business/reportPreparation/index.vue b/src/views/business/reportPreparation/index.vue index 60a78b9..640fd87 100644 --- a/src/views/business/reportPreparation/index.vue +++ b/src/views/business/reportPreparation/index.vue @@ -43,13 +43,13 @@ :on-success="handleSuccessUp1" :show-file-list="false" accept='.doc,.docx'> - <el-button size="small" type="text" :disabled="scope.row.state != 0 || userName !== scope.row.writeUserName">涓婁紶</el-button> + <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 || userName !== scope.row.writeUserName" @click="handleRestore(scope.row)">杩樺師</el-button> - <el-button type="text" size="small" :disabled="scope.row.state != 0 || userName !== scope.row.writeUserName" @click="sendBackTask(scope.row)">閫�鍥炰换鍔�</el-button> - <el-button type="text" size="small" :disabled="scope.row.state != 0 || userName !== 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 || userName !== 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 || userName !== 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> @@ -555,13 +555,10 @@ let url = ''; if(res.data.type==1){ url = this.javaApi+'/img/'+res.data.fileUrl - file.downloadIamge(url,row.fileName) + this.$download.saveAs(url, row.fileName); }else{ url = this.javaApi+'/word/'+res.data.fileUrl - const link = document.createElement('a'); - link.href = url; - link.download = row.fileName; - link.click(); + this.$download.saveAs(url, row.fileName); } } }).catch(error => { @@ -603,17 +600,7 @@ downAll({ids: str}).then(res => { this.outLoading = false this.$message.success('瀵煎嚭鎴愬姛') - // const blob = new Blob([res],{ type: 'application/octet-stream' }); - // const url = URL.createObjectURL(blob); - // const link = document.createElement('a'); - // link.href = url; - // link.download = '鎶ュ憡.zip'; - // link.click(); - const link = document.createElement('a'); - link.href = this.javaApi + res.message; - link.target = '_blank'; - document.body.appendChild(link); - link.click(); + this.$download.saveAs(this.javaApi + res.message, row.fileName); }) }, beforeUpload(file){ @@ -709,12 +696,8 @@ } }, download(row) { - let url = row.urlS ? row.urlS : row.url; - const link = document.createElement('a'); - link.href = this.javaApi + url; - link.target = '_blank'; - document.body.appendChild(link); - link.click(); + let url = this.javaApi+'/word/' + row.urlS ? row.urlS : row.url; + this.$download.saveAs(url, row.fileName); }, // 杩樺師鎿嶄綔 handleRestore(row) { diff --git a/src/views/structural/capabilityAndLaboratory/laboratory/index.vue b/src/views/structural/capabilityAndLaboratory/laboratory/index.vue index 820d8d2..5e33081 100644 --- a/src/views/structural/capabilityAndLaboratory/laboratory/index.vue +++ b/src/views/structural/capabilityAndLaboratory/laboratory/index.vue @@ -3,103 +3,50 @@ <div> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true"> <el-form-item label="璧勮川鍚嶇О" prop="name"> - <el-select - v-model="queryParams.name" - placeholder="閫夋嫨璧勮川鍚嶇О" - size="small" - @change="refreshTable()" - > - <el-option - v-for="dict in dict.type.cnas_method_qualification" - :key="dict.value" - :label="dict.label" - :value="dict.value" - > + <el-select v-model="queryParams.name" placeholder="閫夋嫨璧勮川鍚嶇О" size="small" @change="refreshTable()"> + <el-option v-for="dict in dict.type.cnas_method_qualification" :key="dict.value" :label="dict.label" + :value="dict.value"> {{ dict.label }} </el-option> </el-select> </el-form-item> <el-form-item> - <el-button - type="primary" - icon="el-icon-search" - size="mini" - @click="refreshTable" - >鏌� 璇�</el-button - > - <el-button icon="el-icon-refresh" size="mini" @click="refresh" - >閲� 缃�</el-button - > + <el-button type="primary" icon="el-icon-search" size="mini" @click="refreshTable">鏌� 璇�</el-button> + <el-button icon="el-icon-refresh" size="mini" @click="refresh">閲� 缃�</el-button> </el-form-item> </el-form> </div> <div> <el-row class="title"> <el-col :span="12" style="text-align: left"> - <el-radio-group - v-model="radio" - @input="selectorSwitch" - size="medium" - fill="#409EFF" - > + <el-radio-group v-model="radio" @input="selectorSwitch" size="medium" fill="#409EFF"> <el-radio-button :label="0">璧勮川鏄庣粏</el-radio-button> <el-radio-button :label="1">璧勮川鎬昏</el-radio-button> </el-radio-group> </el-col> <el-col :span="12" style="text-align: right" v-if="radio === 0"> - <el-button size="small" type="primary" @click="openAdd" - >璧勮川鏇存柊</el-button - > - <el-button size="small" icon="el-icon-delete" @click="handleDel" - >鍒犻櫎</el-button - > + <el-button size="small" type="primary" @click="openAdd">璧勮川鏇存柊</el-button> + <el-button size="small" icon="el-icon-delete" @click="handleDel">鍒犻櫎</el-button> </el-col> </el-row> </div> <div v-if="radio === 0"> - <lims-table - :tableData="tableData" - :column="column" - :isSelection="true" - :handleSelectionChange="handleSelectionChange" - @pagination="pagination" - :height="'calc(100vh - 300px)'" - :page="page" - :tableLoading="tableLoading" - ></lims-table> + <lims-table :tableData="tableData" :column="column" :isSelection="true" + :handleSelectionChange="handleSelectionChange" @pagination="pagination" :height="'calc(100vh - 300px)'" + :page="page" :tableLoading="tableLoading"></lims-table> </div> - <div - class="table" - v-if="radio === 1" - v-loading="pageLoading" - @scroll="scrollFn" - > + <div class="table" v-if="radio === 1" v-loading="pageLoading" @scroll="scrollFn"> <el-row :gutter="16"> - <el-col - :span="8" - v-for="(m, i) in list" - :key="i" - :xs="24" - :sm="12" - :md="8" - :lg="8" - :xl="6" - style="margin-bottom: 16px" - > + <el-col :span="8" v-for="(m, i) in list" :key="i" :xs="24" :sm="12" :md="8" :lg="8" :xl="6" + style="margin-bottom: 16px"> <div class="table-item"> - <el-image - style=" + <el-image style=" width: 102px; height: 102px; margin-right: 20px; border-radius: 16px; - " - :src="javaApi + '/img/' + m.imageUrl" - > - <div - slot="error" - class="image-error" - style=" + " :src="javaApi + '/img/' + m.imageUrl"> + <div slot="error" class="image-error" style=" width: 100px; height: 100px; border-radius: 16px; @@ -107,18 +54,11 @@ align-items: center; justify-content: center; border: 1px solid #eeeeee; - " - > - <i - class="el-icon-picture-outline" - style="font-size: 30px; color: #666666" - ></i> + "> + <i class="el-icon-picture-outline" style="font-size: 30px; color: #666666"></i> </div> </el-image> - <div - class="table-item-right" - style="flex: 1; font-size: 12px; color: #666666" - > + <div class="table-item-right" style="flex: 1; font-size: 12px; color: #666666"> <p style="line-height: 26px"> 璧勮川鍚嶇О锛�<span style="color: #3a7bfa">{{ m.name }}</span> </p> @@ -126,168 +66,76 @@ <p style="line-height: 26px">鍒版湡鏃堕棿锛歿{ m.expireTime }}</p> <p> <span>鐘舵�侊細</span> - <el-tag - :type="m.state === 0 ? 'danger' : 'success'" - size="small" - >{{ m.state === 0 ? "澶辨晥" : "鏈夋晥" }}</el-tag - > + <el-tag :type="m.state === 0 ? 'danger' : 'success'" size="small">{{ m.state === 0 ? "澶辨晥" : "鏈夋晥" + }}</el-tag> </p> </div> </div> </el-col> </el-row> - <div - v-if="list.length < 1 && !pageLoading && !isLoding" - style=" + <div v-if="list.length < 1 && !pageLoading && !isLoding" style=" color: #909399; font-size: 14px; text-align: center; margin-top: 200px; - " - > + "> 鏆傛棤鏁版嵁 </div> <div v-if="list.length > 0"> - <el-button - v-if="isLoding" - type="text" - style="display: flex; margin: 0 auto; color: #909399" - > + <el-button v-if="isLoding" type="text" style="display: flex; margin: 0 auto; color: #909399"> <i class="el-icon-loading" style="font-size: 20px"></i> </el-button> - <el-button - type="text" - v-if="finishLoding" - style="display: flex; margin: 0 auto; color: #909399" - >宸茬粡娌℃湁鏇村鍟</el-button - > + <el-button type="text" v-if="finishLoding" + style="display: flex; margin: 0 auto; color: #909399">宸茬粡娌℃湁鏇村鍟</el-button> </div> </div> - <el-dialog - title="璧勮川鏇存柊" - :visible.sync="qualificationsConnectVisible" - width="400px" - > - <el-form - ref="formDataRef" - :model="formData" - label-position="right" - :rules="formDataRules" - label-width="78px" - > + <el-dialog title="璧勮川鏇存柊" :visible.sync="qualificationsConnectVisible" width="400px"> + <el-form ref="formDataRef" :model="formData" label-position="right" :rules="formDataRules" label-width="78px"> <el-form-item label="璧勮川鍚嶇О" prop="name"> - <el-select - v-model="formData.name" - placeholder="璇烽�夋嫨" - style="width: 100%" - size="small" - clearable - > - <el-option - v-for="dict in dict.type.cnas_method_qualification" - :key="dict.value" - :label="dict.label" - :value="dict.value" - > + <el-select v-model="formData.name" placeholder="璇烽�夋嫨" style="width: 100%" size="small" clearable> + <el-option v-for="dict in dict.type.cnas_method_qualification" :key="dict.value" :label="dict.label" + :value="dict.value"> {{ dict.label }} </el-option> </el-select> </el-form-item> <el-form-item label="璧勮川缂栫爜" prop="code"> - <el-input - size="small" - placeholder="璇疯緭鍏�" - clearable - v-model="formData.code" - ></el-input> + <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="formData.code"></el-input> </el-form-item> <el-form-item label="棰佸彂鏈烘瀯" prop="organization"> - <el-input - size="small" - placeholder="璇疯緭鍏�" - clearable - v-model="formData.organization" - ></el-input> + <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="formData.organization"></el-input> </el-form-item> <el-form-item label="璧勮川璇存槑" prop="explanation"> - <el-input - size="small" - placeholder="璇疯緭鍏�" - clearable - v-model="formData.explanation" - ></el-input> + <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="formData.explanation"></el-input> </el-form-item> <el-form-item label="棰佸彂鏃堕棿" prop="dateOfIssuance"> - <el-date-picker - style="width: 100%" - v-model="formData.dateOfIssuance" - type="datetime" - size="small" - format="yyyy-MM-dd HH:mm:ss" - value-format="yyyy-MM-dd HH:mm:ss" - clearable - placeholder="閫夋嫨鏃ユ湡" - > + <el-date-picker style="width: 100%" v-model="formData.dateOfIssuance" type="datetime" size="small" + format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" clearable placeholder="閫夋嫨鏃ユ湡"> </el-date-picker> </el-form-item> <el-form-item label="鍒版湡鏃堕棿" prop="expireTime"> - <el-date-picker - style="width: 100%" - v-model="formData.expireTime" - type="datetime" - size="small" - format="yyyy-MM-dd HH:mm:ss" - value-format="yyyy-MM-dd HH:mm:ss" - clearable - placeholder="閫夋嫨鏃ユ湡" - > + <el-date-picker style="width: 100%" v-model="formData.expireTime" type="datetime" size="small" + format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" clearable placeholder="閫夋嫨鏃ユ湡"> </el-date-picker> </el-form-item> <el-form-item label="璧勮川鍥剧墖"> - <el-upload - ref="upload" - :action="uploadAction" - :on-success="(m) => handleSuccessUpImg(m, 'imageUrl')" - accept="image/jpg,image/jpeg,image/png" - :multiple="false" - :limit="1" - :headers="headers" - :on-change="beforeUpload" - :on-error="onError" - > - <el-button slot="trigger" size="small" type="primary" - >閫夊彇鍥剧墖</el-button - > + <el-upload ref="upload" :action="uploadAction" :on-success="(m) => handleSuccessUpImg(m, 'imageUrl')" + accept="image/jpg,image/jpeg,image/png" :multiple="false" :limit="1" :headers="headers" + :on-change="beforeUpload" :on-error="onError"> + <el-button slot="trigger" size="small" type="primary">閫夊彇鍥剧墖</el-button> </el-upload> </el-form-item> <el-form-item label="璧勮川闄勪欢"> - <el-upload - ref="upload1" - :action="uploadAction" - :on-success="(m) => handleSuccessUpImg(m, 'fileUrl')" - accept="image/jpg,image/jpeg,image/png,application/pdf,.doc,.docx" - :headers="headers" - :multiple="false" - :limit="1" - :on-change="beforeUpload1" - :on-error="onError1" - > - <el-button slot="trigger" size="small" type="primary" - >閫夊彇鏂囦欢</el-button - > + <el-upload ref="upload1" :action="uploadAction" :on-success="(m) => handleSuccessUpImg(m, 'fileUrl')" + accept="image/jpg,image/jpeg,image/png,application/pdf,.doc,.docx" :headers="headers" :multiple="false" + :limit="1" :on-change="beforeUpload1" :on-error="onError1"> + <el-button slot="trigger" size="small" type="primary">閫夊彇鏂囦欢</el-button> </el-upload> </el-form-item> </el-form> <span slot="footer" class="dialog-footer"> - <el-button @click="qualificationsConnectVisible = false" - >鍙� 娑�</el-button - > - <el-button - type="primary" - @click="confirmQualifications" - :loading="loading" - >纭� 瀹�</el-button - > + <el-button @click="qualificationsConnectVisible = false">鍙� 娑�</el-button> + <el-button type="primary" @click="confirmQualifications" :loading="loading">纭� 瀹�</el-button> </span> </el-dialog> </div> @@ -480,12 +328,6 @@ }, // 璧勮川鏄庣粏闄勪欢涓嬭浇 handleDownLoad(row) { - // let url = row.fileUrl; - // const link = document.createElement('a'); - // link.href = this.javaApi + '/img/'+ url; - // document.body.appendChild(link); - // link.target = '_blank'; - // link.click(); const url = process.env.VUE_APP_BASE_API + "/img/" + row.fileUrl; this.$download.saveAs(url, row.fileUrl); }, @@ -595,6 +437,7 @@ line-height: 40px; margin-bottom: 10px; } + .table-item { border-radius: 8px 8px 8px 8px; box-shadow: 4px 4px 8px 0px rgba(51, 51, 51, 0.04); -- Gitblit v1.9.3