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/CNAS/process/reportResults/index.vue | 292 +++++++++++++++++---------------------------------------- 1 files changed, 88 insertions(+), 204 deletions(-) diff --git a/src/views/CNAS/process/reportResults/index.vue b/src/views/CNAS/process/reportResults/index.vue index dd4403e..88b1c7c 100644 --- a/src/views/CNAS/process/reportResults/index.vue +++ b/src/views/CNAS/process/reportResults/index.vue @@ -1,28 +1,25 @@ <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 class="capacity-scope"> + <div style="display: flex;justify-content: space-between"> + <div style="display: flex;"> + <div style="margin-bottom: 18px;margin-right: 10px;display: flex;align-items: center;line-height: 32px;"> + <span style="width: 128px;font-size: 14px;font-weight: 700;color: #606266;">妫�楠屾姤鍛婄紪鍙�</span> + <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="queryParams.insReportCode" + @keyup.enter.native="refreshTable()"></el-input> + </div> + <div style="line-height: 30px;"> + <el-button type="primary" size="mini" @click="refreshTable">鏌ヨ</el-button> + <el-button size="mini" @click="refresh">閲嶇疆</el-button> + </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 style="line-height: 30px;"> + <el-button size="small" type="primary" @click="handleDown" :loading="outLoading" v-if="outPower">瀵煎嚭</el-button> + <el-button size="small" type="primary" @click="openAdd" v-if="addPower">鏂板</el-button> </div> </div> <div class="table"> - <lims-table :tableData="tableData" :column="column" :tableLoading="tableLoading" :height="'calc(100vh - 290px)'" + <lims-table :tableData="tableData" :column="column" :tableLoading="tableLoading" :height="'calc(100vh - 270px)'" :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> @@ -85,12 +82,8 @@ <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 class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable + v-model="addInfo.signatory"></el-input></div> </div> </el-col> <el-col :span="24" style="margin-bottom: 16px;"> @@ -114,12 +107,15 @@ import { exportProcessReport, doProcessReport, - addProcessReport + addProcessReport, + pageProcessReport, + delProcessReport } from '@/api/cnas/process/reportResults.js' import { selectUserCondition, } from "@/api/business/inspectionTask.js"; export default { + name: 'ReportResults', components: { limsTable }, @@ -128,75 +124,28 @@ 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: [] - }, + addInfo: {}, addLoading: false, - mutilSelect: [], - queryParams: {}, + queryParams: { + insReportCode: '' + }, tableData: [], column: [ - { label: "缂栧彿", prop: "number" }, - { label: "杈呭姪椤圭洰鍚嶇О", prop: "auxiliaryProject", width: "120px" }, + { label: "妫�楠屾姤鍛婄紪鍙�", prop: "insReportCode" }, + { label: "椤垫暟", prop: "pages", width: "120px" }, { - label: "瀹為獙瀹�", - prop: "laboratory", - dataType: "tag", - formatData: (params) => { - return this.laboratoryList.find((m) => m.value == params).label; - }, + label: "鍙戦�佷唤鏁�", + prop: "number", }, - { label: "鍗曚綅", prop: "unit" }, - { label: "鏍稿噯宸ユ椂", prop: "approvedWorkingHour" }, - { label: "閮ㄩ棬", prop: "department" }, - { label: "澶囨敞", prop: "remarks" }, + { label: "鍙戝線浣曞", prop: "send" }, + { label: "鍙戦�佹柟寮�", prop: "method" }, + { label: "鍙戦�佹棩鏈�", prop: "sendTime" }, + { label: "鍙戦�佷汉", prop: "sendUserName" }, + { label: "绛炬敹浜�", prop: "signatory" }, + { label: "澶囨敞", prop: "remark" }, { dataType: "action", fixed: "right", @@ -206,12 +155,7 @@ name: "缂栬緫", type: "text", clickFun: (row) => { - this.openAdd("缂栬緫", row); - }, - showHide: (row) => { - return this.checkPermi([ - "performance:manHour:workTimeConfig:edit", - ]); + this.handleWork(row); }, }, { @@ -220,18 +164,13 @@ clickFun: (row) => { this.handleDelete(row); }, - showHide: (row) => { - return this.checkPermi([ - "performance:manHour:workTimeConfig:del", - ]); - }, }, ], }, ], page: { total: 0, - size: 10, + size: 20, current: 0, }, tableLoading: false, @@ -239,69 +178,52 @@ }, mounted() { // this.entityCopy = this.HaveJson(this.componentData.entity); - // this.getPower() + this.getList() 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 => { + exportProcessReport(this.queryParams).then(res => { this.outLoading = false - if (res.code === 201) return - this.$message.success('瀵煎嚭鎴愬姛') - const url = this.javaApi + '/word/' + res.message; - this.$download.saveAs(url, "鎶ュ憡缁撴灉"); + const blob = new Blob([res], { type: 'application/msword' }); + this.$download.saveAs(blob, '鎶ュ憡缁撴灉' + '.docx'); }) }, openAdd() { this.title = '鏂板' - this.addInfo = { - signatory: [] - } + this.addInfo = {} this.addDialogVisible = true; }, - refreshTable() { - this.$refs['ValueTable'].selectList() + getList() { + this.tableLoading = true; + let param = { ...this.queryParams, ...this.page }; + delete param.total; + pageProcessReport({ ...param }) + .then((res) => { + this.tableLoading = false; + if (res.code === 200) { + this.tableData = res.data.records; + this.page.total = res.data.total; + } + }) + .catch((err) => { + this.tableLoading = false; + }); + }, + pagination({ page, limit }) { + this.page.current = page; + this.page.size = limit; + this.getList(); }, refresh() { - this.componentData.entity = this.HaveJson(this.entityCopy) - this.upIndex++ - this.refreshTable() + this.queryParams = {}; + this.page.current = 1; + this.getList(); + }, + refreshTable() { + this.page.current = 1; + this.getList(); }, getAuthorizedPerson() { selectUserCondition().then(res => { @@ -320,17 +242,11 @@ 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 => { + addProcessReport(this.addInfo).then(res => { this.addLoading = false - if (res.code == 201) { - return - } this.addDialogVisible = false this.$message({ type: 'success', @@ -339,11 +255,8 @@ this.refreshTable() }).catch(err => { }) } else { - doProcessReport(addInfo).then(res => { + doProcessReport(this.addInfo).then(res => { this.addLoading = false - if (res.code == 201) { - return - } this.addDialogVisible = false this.$message({ type: 'success', @@ -357,27 +270,31 @@ 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 - } + handleDelete(row) { + this.$confirm("鏄惁鍒犻櫎璇ユ潯鏁版嵁?", "鎻愮ず", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning", + }) + .then(() => { + delProcessReport({ id: row.id }).then((res) => { + this.$message.success("鍒犻櫎鎴愬姛"); + this.refresh(); + }); + }) + .catch(() => { }); + }, } } </script> <style scoped> -.title { - height: 60px; - line-height: 60px; -} - .search { - background-color: #fff; - height: 80px; + height: 46px; display: flex; - align-items: center; + justify-content: space-between; } .search_thing { @@ -394,38 +311,5 @@ .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> -- Gitblit v1.9.3