From f2fbb3b07155274408d68084e2d607760c765ad6 Mon Sep 17 00:00:00 2001 From: gaoluyang <2820782392@qq.com> Date: 星期五, 14 三月 2025 11:09:51 +0800 Subject: [PATCH] 前端跳转路由修改 --- src/views/CNAS/process/sampleDisposal/index.vue | 305 ++++++++++++++++++++------------------------------ 1 files changed, 123 insertions(+), 182 deletions(-) diff --git a/src/views/CNAS/process/sampleDisposal/index.vue b/src/views/CNAS/process/sampleDisposal/index.vue index 705000e..b3df7ab 100644 --- a/src/views/CNAS/process/sampleDisposal/index.vue +++ b/src/views/CNAS/process/sampleDisposal/index.vue @@ -1,20 +1,12 @@ <template> - <div class="sample-disposal"> - <el-row class="title"> - <el-col :span="20" style="padding-left: 20px;text-align: left;">妫�娴嬫垨鏍″噯鐗╁搧鐨勫缃�</el-col> - <el-col :span="4" style="text-align: right;"> - <!-- <el-button size="medium" type="primary" @click="handleDown" v-loading="outLoading" style="margin-right: 16px;">瀵煎嚭</el-button> --> - </el-col> - </el-row> + <div class="capacity-scope"> <el-tabs type="border-card" v-model="activeName" style="height: 100%;" @tab-click="queryParams.totaldealId = ''"> <el-tab-pane label="濉啓" name="濉啓" style="height: 100%;" :key="1"> - <el-button size="small" type="primary" @click="handleAdd0" style="margin-left: 20px;" - v-if="addPower">鏂板</el-button> + <el-button size="small" type="primary" @click="handleAdd0" style="margin-left: 20px;">鏂板</el-button> <div class="table" style="height: calc(100% - 200px)" v-if="activeName == '濉啓'"> <lims-table :tableData="tableData" :column="column" :tableLoading="tableLoading" + key="tableData" :height="'calc(100vh - 290px)'" :page="page" @pagination="pagination"></lims-table> - <!-- <ValueTable ref="ValueTable0" :url="$api.processTotaldeal.pageProcessDeal" :componentData="componentData0" - :key="upIndex0" :delUrl="$api.processTotaldeal.delProcessDeal" /> --> </div> </el-tab-pane> <el-tab-pane label="鍘嗗彶璁板綍" name="鍘嗗彶璁板綍" style="height: 100%;" :key="2"> @@ -22,7 +14,7 @@ <div class="search_thing"> <div class="search_label">骞存湀锛�</div> <div class="search_input"> - <el-date-picker v-model="componentData.entity.month" type="month" placeholder="閫夋嫨鏈�" format="yyyy-MM" + <el-date-picker v-model="queryParams0.month" type="month" placeholder="閫夋嫨鏈�" format="yyyy-MM" value-format="yyyy-MM" size="small" @change="refreshTable()"> </el-date-picker> </div> @@ -33,8 +25,9 @@ </div> </div> <div class="table"> - <!-- <ValueTable ref="ValueTable" :url="$api.processTotaldeal.pageProcessTotaldeal" :componentData="componentData" - :key="upIndex" /> --> + <lims-table :tableData="tableData0" :column="column0" :tableLoading="tableLoading" + key="tableData0" + :height="'calc(100vh - 300px)'" :page="page0" @pagination="pagination0"></lims-table> </div> </el-tab-pane> </el-tabs> @@ -122,13 +115,14 @@ checkProcessTotaldeal, ratifyProcessTotaldeal, delProcessDeal, + pageProcessTotaldeal, } from "@/api/cnas/process/sampleDisposal"; export default { + name: 'SampleDisposal', components: { limsTable, filePreview, }, - name: "SampleDisposal", data() { return { activeName: '濉啓', @@ -142,105 +136,6 @@ noCheckLoading: false, checkLoading: false, // 鍘嗗彶鍒楄〃 - componentData: { - entity: { - month: null, - orderBy: { - field: 'id', - order: 'desc' - } - }, - isIndex: true, - showSelect: false, - select: false, - do: [{ - id: 'handleLook', - font: '鏌ョ湅', - type: 'text', - method: 'handleLook', - }, { - id: 'handleDown0', - font: '涓嬭浇', - type: 'text', - method: 'handleDown0', - disabFun: (row, index) => { - return !row.url - } - }, - // { - // id: 'handleAdd', - // font: '濉啓', - // type: 'text', - // method: 'handleAdd', - // disabFun: (row, index) => { - // return row.submitState=='宸叉彁浜�' - // } - // }, - { - id: 'handleSubmit', - font: '鎻愪氦', - type: 'text', - method: 'handleSubmit', - disabFun: (row, index) => { - return !!row.submitState && row.submitState != '寰呮彁浜�' - } - }, { - id: 'handleCheck', - font: '瀹℃牳', - type: 'text', - method: 'handleCheck', - disabFun: (row, index) => { - return row.examineState == '閫氳繃' || row.submitState == '寰呮彁浜�' - } - }, { - id: 'handleApproval', - font: '鎵瑰噯', - type: 'text', - method: 'handleApproval', - disabFun: (row, index) => { - return row.ratifyState == '閫氳繃' || row.submitState == '寰呮彁浜�' - } - }], - tagField: {}, - selectField: {}, - requiredAdd: [], - requiredUp: [], - needSort: [], - inputType: '' - }, - // 鏍峰搧鍒楄〃 - componentData0: { - entity: { - totaldealId: null, - orderBy: { - field: 'id', - order: 'desc' - } - }, - isIndex: true, - showSelect: false, - select: false, - do: [{ - id: 'handleAdd0', - font: '淇敼', - type: 'text', - method: 'handleAdd0' - }, { - id: 'delete', - font: '鍒犻櫎', - type: 'text', - method: 'doDiy' - }], - tagField: {}, - selectField: {}, - requiredAdd: [], - requiredUp: [], - needSort: [], - inputType: '' - }, - upIndex0: 100, - entityCopy: {}, - upIndex: 0, addInfo: {},//鏂板鏍峰搧 customPageList: [], currentInfo: { @@ -285,60 +180,89 @@ current: 0, }, tableLoading: false, + queryParams0: {}, + tableData0: [], + column0: [ + { label: "鏈堜唤", prop: "month" }, + { label: "鎬绘暟閲�", prop: "totalNum" }, + { label: "鎻愪氦浜�", prop: "submitUserName" }, + { label: "瀹℃牳浜�", prop: "examineUserName" }, + { label: "鎵瑰噯浜�", prop: "ratifyUserName" }, + { + dataType: "action", + fixed: "right", + label: "鎿嶄綔", + operation: [ + { + name: "鏌ョ湅", + type: "text", + clickFun: (row) => { + this.handleLook(row); + }, + }, + { + name: "涓嬭浇", + type: "text", + clickFun: (row) => { + this.handleDown0(row); + }, + disabled: (row) => { + return !row.url + } + }, + { + name: "鎻愪氦", + type: "text", + clickFun: (row) => { + this.handleSubmit(row); + }, + disabled: (row) => { + return !!row.submitState && row.submitState != '寰呮彁浜�' + } + }, + { + name: "瀹℃牳", + type: "text", + clickFun: (row) => { + this.handleCheck(row); + }, + disabled: (row) => { + return row.examineState == '閫氳繃' || row.submitState == '寰呮彁浜�' + } + }, + { + name: "鎵瑰噯", + type: "text", + clickFun: (row) => { + this.handleApproval(row); + }, + disabled: (row) => { + return row.ratifyState == '閫氳繃' || row.submitState == '寰呮彁浜�' + } + }, + ], + }, + ], + page0: { + total: 0, + size: 10, + current: 0, + }, }; }, mounted() { - // this.entityCopy = this.HaveJson(this.componentData.entity); this.getCustomPageList() - // this.getPower() + this.getList() + this.getList0() }, methods: { - getPower() { - let power = JSON.parse(sessionStorage.getItem('power')) - let add = false - let out = false - let submitProcessTotaldeal = false - let checkProcessTotaldeal = false - let ratifyProcessTotaldeal = false - for (var i = 0; i < power.length; i++) { - if (power[i].menuMethod == 'addProcessDeal') { - add = true - } - // if (power[i].menuMethod == 'exportProcessEvaluate') { - // out = true - // } - if (power[i].menuMethod == 'submitProcessTotaldeal') { - submitProcessTotaldeal = true - } - if (power[i].menuMethod == 'checkProcessTotaldeal') { - checkProcessTotaldeal = true - } - if (power[i].menuMethod == 'ratifyProcessTotaldeal') { - ratifyProcessTotaldeal = true - } - } - if (!ratifyProcessTotaldeal) { - this.componentData.do.splice(4, 1) - } - if (!checkProcessTotaldeal) { - this.componentData.do.splice(3, 1) - } - if (!submitProcessTotaldeal) { - this.componentData.do.splice(2, 1) - } - if (!add) { - this.componentData0.do.splice(1, 1) - this.componentData0.do.splice(0, 1) - } - this.addPower = add - }, // 鑾峰彇閫佹牱鍗曚綅鍒楄〃 getCustomPageList() { selectCustomPageList({ current: -1, size: -1 }).then(res => { - this.customPageList = res.data.body.records + this.customPageList = res.data.records }).catch(err => { }); }, handleDown() { }, @@ -364,13 +288,34 @@ this.getList(); }, refresh() { - this.queryParams = {}; - this.page.current = 1; - this.getList(); + this.queryParams0 = {}; + this.page0.current = 1; + this.getList0(); }, refreshTable() { - this.page.current = 1; - this.getList(); + this.page0.current = 1; + this.getList0(); + }, + getList0() { + this.tableLoading = true; + let param = { ...this.queryParams0, ...this.page }; + delete param.total; + pageProcessTotaldeal({ ...param }) + .then((res) => { + this.tableLoading = false; + if (res.code === 200) { + this.tableData0 = res.data.records; + this.page0.total = res.data.total; + } + }) + .catch((err) => { + this.tableLoading = false; + }); + }, + pagination0({ page, limit }) { + this.page0.current = page; + this.page0.size = limit; + this.getList0(); }, // 濉啓 // handleAdd(row){ @@ -398,13 +343,13 @@ ...this.addInfo }).then(res => { this.addLoading = false - if (res.code === 201) return this.addDialogVisible = false this.$message({ type: 'success', message: '缂栬緫鎴愬姛!' }); - this.$refs.ValueTable0.selectList() + this.page.current = 0; + this.getList(); }).catch(err => { }); } else { // 鏂板 @@ -414,13 +359,13 @@ ...this.addInfo }).then(res => { this.addLoading = false - if (res.code === 201) return this.addDialogVisible = false this.$message({ type: 'success', message: '鏂板鎴愬姛!' }); - this.$refs.ValueTable0.selectList() + this.page.current = 0; + this.getList(); }).catch(err => { }); } }, @@ -434,24 +379,21 @@ submitProcessTotaldeal({ id: row.id }).then(res => { - if (res.code === 201) return this.$message({ type: 'success', message: '鎻愪氦鎴愬姛!' }); - this.$refs['ValueTable'].selectList() + this.refreshTable() }).catch(err => { }); }) }, // 鏌ョ湅 handleLook(row) { - // console.log(row) - // this.title0 = '鏌ョ湅' - // this.commonFun(row) this.activeName = '濉啓' this.queryParams.totaldealId = row.id this.$nextTick(() => { - this.$refs['ValueTable0'].selectList() + this.page.current = 1; + this.getList(); }) }, commonFun(row, callbanck) { @@ -461,8 +403,8 @@ current: -1, size: -1, ...this.queryParams }).then(res => { - this.currentInfo.arr = res.data.body.records this.lookDialogVisible = true + this.currentInfo.arr = res.data.records if (callbanck) { callbanck() } @@ -492,12 +434,11 @@ }).then(res => { this.checkLoading = false this.noCheckLoading = false - if (res.code === 201) return this.$message({ type: 'success', message: '鎿嶄綔鎴愬姛!' }); - this.$refs['ValueTable'].selectList() + this.refreshTable() this.lookDialogVisible = false }).catch(err => { }); } else if (this.title0 == '鎵瑰噯') { @@ -507,21 +448,23 @@ }).then(res => { this.checkLoading = false this.noCheckLoading = false - if (res.code === 201) return this.$message({ type: 'success', message: '鎿嶄綔鎴愬姛!' }); - this.$refs['ValueTable'].selectList() + this.refreshTable() this.lookDialogVisible = false }).catch(err => { }); } }, // 瀵煎嚭璇︽儏 handleDown0(row) { + if (!row.url) { + this.$message.warning('鏆傛棤鏂囦欢') + return + } // 鍚庣涓嬭浇 - let url = this.javaApi + '/word/' + row.url - this.$download.saveAs(url, row.month + ' 鏍峰搧澶勭悊鐢宠琛�'); + this.$download.saveAs(row.url, row.month + ' 鏍峰搧澶勭悊鐢宠琛�'); }, handleDelete(row) { this.$confirm("鏄惁鍒犻櫎璇ユ潯鏁版嵁?", "鎻愮ず", { @@ -531,9 +474,9 @@ }) .then(() => { delProcessDeal({ id: row.id }).then((res) => { - if (res.code == 201) return; this.$message.success("鍒犻櫎鎴愬姛"); - this.refresh(); + this.page.current = 0; + this.getList(); }); }) .catch(() => { }); @@ -574,7 +517,6 @@ .table { background-color: #fff; - width: calc(100% - 40px); height: calc(100% - 60px - 140px); padding: 20px; } @@ -586,7 +528,6 @@ .tables { table-layout: fixed; width: 100%; - margin-top: 10px; } .tables td { -- Gitblit v1.9.3