From ff2f7d7bad0132c130c305364a863ff446e926b2 Mon Sep 17 00:00:00 2001 From: 小小儁爺 <1694218219@qq.com> Date: 星期一, 30 十二月 2024 13:47:24 +0800 Subject: [PATCH] 1.在缓存模式下 页面切换会请求接口 --- src/views/mouldManager/mouldMaintainRecord.vue | 989 +++++++++++++++++++++++++++++---------------------------- 1 files changed, 497 insertions(+), 492 deletions(-) diff --git a/src/views/mouldManager/mouldMaintainRecord.vue b/src/views/mouldManager/mouldMaintainRecord.vue index 957487f..0e62a0d 100644 --- a/src/views/mouldManager/mouldMaintainRecord.vue +++ b/src/views/mouldManager/mouldMaintainRecord.vue @@ -1,492 +1,497 @@ -<template> - <div> - <div class="body" :style="{height:mainHeight+'px'}"> - <div class="bodyTopButtonGroup"> - <el-button v-waves type="primary" icon="el-icon-download" @click="download">瀵煎嚭</el-button> - </div> - - <div class="bodyTopFormGroup"> - <el-form - ref="form" - :model="form" - label-width="100px" - inline - style="display: flex;" - > - <div class="elForm"> - <el-form-item label="妯″叿缂栫爜" style=" display: flex;"> - <el-input v-model="form.mouldcode" placeholder="璇疯緭鍏�" style="width: 200px" /> - </el-form-item> - <el-form-item label="妯″叿鍚嶇О" style=" display: flex;"> - <el-input v-model="form.mouldname" placeholder="璇疯緭鍏�" style="width: 200px" /> - </el-form-item> - <el-form-item label="瑙勬牸鍨嬪彿" style=" display: flex;"> - <el-input v-model="form.mouldspec" style="width: 200px" placeholder="璇疯緭鍏�" /> - </el-form-item> - <el-form-item label="淇濆吇鏍囧噯缂栫爜" style=" display: flex;"> - <el-input v-model="form.stanedcode" style="width: 200px" placeholder="璇疯緭鍏�" /> - </el-form-item> - <el-form-item v-show="isExpandForm" label="淇濆吇鏍囧噯鍚嶇О" style=" display: flex;"> - <el-input v-model="form.stanedname" style="width: 200px" placeholder="璇疯緭鍏�" /> - </el-form-item> - <el-form-item v-show="isExpandForm" label="淇濆吇浜哄憳" style=" display: flex;"> - <el-input v-model="form.repairuser" style="width: 200px" placeholder="璇疯緭鍏�" /> - </el-form-item> - <el-form-item - v-show="isExpandForm" - style="display: flex;align-items: center" - label="淇濆吇鏃堕棿" - > - <el-date-picker - v-model="form.repairdate" - type="daterange" - range-separator="~" - class="timeMini" - size="mini" - style="width: 200px;display: flex;line-height: 34px;height: 34px;" - :clearable="false" - start-placeholder="寮�濮嬫棩鏈�" - end-placeholder="缁撴潫鏃ユ湡" - /> - <!-- font-size: 14px!important;--> - <!-- :picker-options="expireTimeOption"--> - - </el-form-item> - - <el-form-item v-show="isExpandForm" label="淇濆吇缁撴灉" style=" display: flex;"> - <el-select v-model="form.repairresult" style="width: 200px" placeholder="璇烽�夋嫨"> - <el-option - v-for="item in checkrequestArr" - :key="item.code" - :label="item.name" - :value="item.code" - /> - </el-select> - </el-form-item> - </div> - <div - class="bodySearchReset" - :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}" - > - <el-button v-waves type="primary" icon="el-icon-search" @click="search">鏌ヨ</el-button> - <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">閲嶇疆</el-button> - </div> - </el-form> - <div - class="bodyTopFormExpand" - > - <svg-icon - v-show="mouseHoverType==='mouseout'" - style="cursor: pointer" - :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'" - @mouseenter="mouseHoverType=$event.type" - /> - <svg-icon - v-show="mouseHoverType==='mouseenter'" - style="cursor: pointer" - :icon-class="!isExpandForm?'doubleDown':'doubleUp'" - @click="isExpandForm=!isExpandForm" - @mouseout="mouseHoverType=$event.type" - /> - </div> - </div> - - <div class="elTableDiv"> - <el-table - ref="tableDataRef" - class="tableFixed" - :data="tableData" - :height="isExpandForm?tableHeight:(tableHeight+40)+'px'" - border - :row-class-name="tableRowClassName" - :style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+40)+'px',}" - highlight-current-row - :header-cell-style="this.$headerCellStyle" - :cell-style="this.$cellStyle" - @sort-change="sortChange" - > - <el-table-column - prop="rowNum" - width="50" - fixed - label="搴忓彿" - /> - <el-table-column - prop="bywo" - label="淇濆吇鍗曞彿" - sortable="custom" - /> - <el-table-column - prop="mould_code" - label="妯″叿缂栫爜" - show-tooltip-when-overflow - sortable="custom" - /> - <el-table-column - prop="mould_name" - label="妯″叿鍚嶇О" - show-tooltip-when-overflow - sortable="custom" - /> - <el-table-column - prop="mould_spec" - label="浜у搧瑙勬牸" - show-tooltip-when-overflow - sortable="custom" - > - <template slot-scope="{row}"> - <div v-if="row.mould_spec">{{ row.mould_spec }}</div> - <div v-else>/</div> - </template> - </el-table-column> - <el-table-column - prop="stanedcode" - label="鐐规鏍囧噯缂栫爜" - sortable="custom" - /> - <el-table-column - prop="stanedname" - label="鐐规鏍囧噯鍚嶇О" - sortable="custom" - /> - - <el-table-column - prop="maint_user" - label="鐐规浜哄憳" - sortable="custom" - /> - <el-table-column - prop="maint_result" - label="鐐规缁撴灉" - sortable="custom" - > - <template slot-scope="{row}"> - <el-tag v-if="row.maint_result==='OK'" size="small" type="success">鍚堟牸</el-tag> - <el-tag v-if="row.maint_result==='NG'" size="small" type="danger">寮傚父</el-tag> - </template> - </el-table-column> - - <el-table-column - prop="maint_date" - label="鐐规鏃堕棿" - sortable="custom" - /> - - <el-table-column - label="鎿嶄綔" - width="120" - fixed="right" - > - <template slot-scope="{row}"> - <div class="operationClass"> - - <el-tooltip class="item" effect="dark" content="鏄庣粏" placement="top"> - <i - class="el-icon-tickets" - :style="{color:$store.state.settings.theme}" - style="cursor: pointer;margin-right: 15px" - @click="edit(row)" - /> - </el-tooltip> - </div> - </template> - </el-table-column> - </el-table> - </div> - <!--鍒嗛〉--> - <pagination - :total="total" - :page.sync="form.page" - :limit.sync="form.rows" - align="right" - layout="total,prev, pager, next,sizes" - popper-class="select_bottom" - @pagination="getMouldRepairTakeSearch" - /> - </div> - - <el-dialog - v-el-drag-dialog - title="鏄庣粏" - :visible.sync="dialogVisible" - width="800px" - :close-on-click-modal="false" - top="15vh" - @closed="handleClose" - @close="handleClose" - > - <div class="elTableDiv" style="margin-top: 0"> - <el-table - :data="tableDataDialog" - :height="500+'px'" - border - :row-class-name="tableRowClassName" - :style="{width: 100+'%',height:500+'px'}" - highlight-current-row - :header-cell-style="this.$headerCellStyle" - :cell-style="this.$cellStyle" - @sort-change="sortChange" - > - <el-table-column - prop="seq" - width="50" - fixed - label="搴忓彿" - /> - <el-table-column - prop="itemcode" - label="閮ㄤ綅缂栫爜" - /> - <el-table-column - prop="itemname" - label="閮ㄤ綅鍚嶇О" - /> - <el-table-column - prop="result" - label="鐐规缁撴灉" - > - <template slot-scope="{row}"> - <div v-if="row.result==='OK'" style="display: flex;align-items: center"> - <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" /> - 姝e父 - </div> - <div v-if="row.result==='NG'" style="display: flex;align-items: center"> - <i class="el-icon-info" style="margin-right: 2px" /> - 寮傚父 - </div> - </template> - </el-table-column> - <el-table-column - prop="chk_value" - label="鏁板��" - > - <template slot-scope="{row}"> - {{ row.chk_value ? row.chk_value : '/' }} - </template> - </el-table-column> - <!-- <el-table-column--> - <!-- prop="remark"--> - <!-- label="澶囨敞"--> - <!-- show-tooltip-when-overflow--> - <!-- />--> - </el-table> - </div> - - <span slot="footer" class="dialog-footer"> - <div class="footerButton"> - <el-button v-waves @click="dialogVisibleCancel">鍙� 娑�</el-button> - <!-- <el-button v-waves type="primary" @click="dialogVisibleConfirm">纭� 瀹�</el-button>--> - </div> - </span> - </el-dialog> - - </div> -</template> - -<script> -import Pagination from '@/components/Pagination' -import { handleDatetime } from '@/utils/global' -import elDragDialog from '@/directive/el-drag-dialog' -import waves from '@/directive/waves' -import { - MouldRepairSubTakeSearch, - MouldRepairTakeOutExcel, - MouldRepairTakeSearch -} from '@/api/MouldManager' - -export default { - name: 'MouldMaintainRecord', - components: { - Pagination - }, - directives: { elDragDialog, waves }, - data() { - return { - mouseHoverType: 'mouseout', - isExpandForm: false, - mainHeight: 0, - tableHeight: 0, - form: { - mouldcode: '', - mouldname: '', - mouldspec: '', - stanedcode: '', - stanedname: '', - repairuser: '', - repairresult: '', - repairdate: '', - prop: 'maint_date', // 鎺掑簭瀛楁 - order: 'desc', // 鎺掑簭瀛楁 - page: 1, // 绗嚑椤� - rows: 20 // 姣忛〉澶氬皯鏉� - }, - checkrequestArr: [ - { code: 'OK', name: '鍚堟牸' }, - { code: 'NG', name: '寮傚父' } - ], - total: 10, - tableData: [], - dialogVisible: false, - tableDataDialog: [] - - } - }, - - activated() { window.addEventListener('resize', this.getHeight) this.getHeight() }, created() { - this.getMouldRepairTakeSearch() - }, - mounted() { - window.addEventListener('resize', this.getHeight) - this.getHeight() - }, - methods: { - async getMouldRepairTakeSearch() { - let tempDate = this.form.repairdate - if (tempDate.length > 0) { - tempDate = handleDatetime(tempDate[0]) + '~' + handleDatetime(tempDate[1]) - } - - const data = { - mouldcode: this.form.mouldcode, - mouldname: this.form.mouldname, - mouldspec: this.form.mouldspec, - stanedcode: this.form.stanedcode, - stanedname: this.form.stanedname, - repairuser: this.form.repairuser, - repairresult: this.form.repairresult, - repairdate: tempDate, - prop: this.form.prop, - order: this.form.order, - page: this.form.page, - rows: this.form.rows - - } - console.log(data, 1) - const res = await MouldRepairTakeSearch(data) - this.tableData = res.data - this.total = res.count - }, - // 鎺掑簭鏀瑰彉鏃� - sortChange({ column, prop, order }) { - if (order === 'descending') { - order = 'desc' - } else if (order === 'ascending') { - order = 'asc' - } else { - order = 'desc' - } - this.form.order = order - this.form.prop = prop - this.getMouldRepairTakeSearch() - }, - async download() { - let tempDate = this.form.repairdate - if (tempDate.length > 0) { - tempDate = handleDatetime(tempDate[0]) + '~' + handleDatetime(tempDate[1]) - } - - const data = { - mouldcode: this.form.mouldcode, - mouldname: this.form.mouldname, - mouldspec: this.form.mouldspec, - stanedcode: this.form.stanedcode, - stanedname: this.form.stanedname, - repairuser: this.form.repairuser, - repairresult: this.form.repairresult, - repairdate: tempDate - } - - const { data: res } = await MouldRepairTakeOutExcel(data) - window.location.href = res - }, - // 鏌ヨ - search() { - this.getMouldRepairTakeSearch() - }, - - // 閲嶇疆 - reset() { - this.form.mouldcode = '' - this.form.mouldname = '' - this.form.mouldspec = '' - this.form.stanedcode = '' - this.form.stanedname = '' - this.form.repairuser = '' - this.form.repairresult = '' - this.form.repairdate = '' - this.getMouldRepairTakeSearch() - }, - - // 淇敼鎸夐挳 - async edit(row) { - this.dialogVisible = true - - const { data: res } = await MouldRepairSubTakeSearch({ id: row.id }) - this.tableDataDialog = res - - // this.$nextTick(() => { - // this.dialogForm.OrgCode = row.org_code - // this.dialogForm.OrgName = row.org_name - // this.dialogForm.SupUnit = row.parent_id - // }) - }, - - // 瀵硅瘽妗嗗叧闂簨浠� - handleClose() { - this.tableDataDialog = [] - }, - // 瀵硅瘽妗嗗彇娑� - dialogVisibleCancel() { - this.dialogVisible = false - }, - - // 鑾峰彇椤甸潰楂樺害 - getHeight() { - this.$nextTick(() => { - this.mainHeight = window.innerHeight - 85 - this.tableHeight = this.mainHeight - 255 - this.$refs.tableDataRef.doLayout() - }) - }, - tableRowClassName({ row, rowIndex }) { - return 'custom-row' - } - } -} -</script> - -<style scoped lang="scss"> -::v-deep .el-select__caret { - display: flex; - align-items: center; - justify-content: center; -} - -::v-deep .el-range__icon { - line-height: 28px !important; -} - -::v-deep .el-range-separator { - line-height: 28px !important; -} - -::v-deep .el-range-input { - font-size: 14px; -} - -::v-deep .el-range-separator { - display: flex; - justify-content: center; - align-items: center; -} - -::v-deep .el-progress-bar__innerText { - display: none !important; -} -</style> -<style> - -.el-table .custom-row { - background: #f8f8fa; -} -</style> +<template> + <div> + <div class="body" :style="{height:mainHeight+'px'}"> + <div class="bodyTopButtonGroup"> + <el-button v-waves type="primary" icon="el-icon-download" @click="download">瀵煎嚭</el-button> + </div> + + <div class="bodyTopFormGroup"> + <el-form + ref="form" + :model="form" + label-width="100px" + inline + style="display: flex;" + > + <div class="elForm"> + <el-form-item label="妯″叿缂栫爜" style=" display: flex;"> + <el-input v-model="form.mouldcode" placeholder="璇疯緭鍏�" style="width: 200px" /> + </el-form-item> + <el-form-item label="妯″叿鍚嶇О" style=" display: flex;"> + <el-input v-model="form.mouldname" placeholder="璇疯緭鍏�" style="width: 200px" /> + </el-form-item> + <el-form-item label="瑙勬牸鍨嬪彿" style=" display: flex;"> + <el-input v-model="form.mouldspec" style="width: 200px" placeholder="璇疯緭鍏�" /> + </el-form-item> + <el-form-item label="淇濆吇鏍囧噯缂栫爜" style=" display: flex;"> + <el-input v-model="form.stanedcode" style="width: 200px" placeholder="璇疯緭鍏�" /> + </el-form-item> + <el-form-item v-show="isExpandForm" label="淇濆吇鏍囧噯鍚嶇О" style=" display: flex;"> + <el-input v-model="form.stanedname" style="width: 200px" placeholder="璇疯緭鍏�" /> + </el-form-item> + <el-form-item v-show="isExpandForm" label="淇濆吇浜哄憳" style=" display: flex;"> + <el-input v-model="form.repairuser" style="width: 200px" placeholder="璇疯緭鍏�" /> + </el-form-item> + <el-form-item + v-show="isExpandForm" + style="display: flex;align-items: center" + label="淇濆吇鏃堕棿" + > + <el-date-picker + v-model="form.repairdate" + type="daterange" + range-separator="~" + class="timeMini" + size="mini" + style="width: 200px;display: flex;line-height: 34px;height: 34px;" + :clearable="false" + start-placeholder="寮�濮嬫棩鏈�" + end-placeholder="缁撴潫鏃ユ湡" + /> + <!-- font-size: 14px!important;--> + <!-- :picker-options="expireTimeOption"--> + + </el-form-item> + + <el-form-item v-show="isExpandForm" label="淇濆吇缁撴灉" style=" display: flex;"> + <el-select v-model="form.repairresult" style="width: 200px" placeholder="璇烽�夋嫨"> + <el-option + v-for="item in checkrequestArr" + :key="item.code" + :label="item.name" + :value="item.code" + /> + </el-select> + </el-form-item> + </div> + <div + class="bodySearchReset" + :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}" + > + <el-button v-waves type="primary" icon="el-icon-search" @click="search">鏌ヨ</el-button> + <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">閲嶇疆</el-button> + </div> + </el-form> + <div + class="bodyTopFormExpand" + > + <svg-icon + v-show="mouseHoverType==='mouseout'" + style="cursor: pointer" + :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'" + @mouseenter="mouseHoverType=$event.type" + /> + <svg-icon + v-show="mouseHoverType==='mouseenter'" + style="cursor: pointer" + :icon-class="!isExpandForm?'doubleDown':'doubleUp'" + @click="isExpandForm=!isExpandForm" + @mouseout="mouseHoverType=$event.type" + /> + </div> + </div> + + <div class="elTableDiv"> + <el-table + ref="tableDataRef" + class="tableFixed" + :data="tableData" + :height="isExpandForm?tableHeight:(tableHeight+40)+'px'" + border + :row-class-name="tableRowClassName" + :style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+40)+'px',}" + highlight-current-row + :header-cell-style="this.$headerCellStyle" + :cell-style="this.$cellStyle" + @sort-change="sortChange" + > + <el-table-column + prop="rowNum" + width="50" + fixed + label="搴忓彿" + /> + <el-table-column + prop="bywo" + label="淇濆吇鍗曞彿" + sortable="custom" + /> + <el-table-column + prop="mould_code" + label="妯″叿缂栫爜" + show-tooltip-when-overflow + sortable="custom" + /> + <el-table-column + prop="mould_name" + label="妯″叿鍚嶇О" + show-tooltip-when-overflow + sortable="custom" + /> + <el-table-column + prop="mould_spec" + label="浜у搧瑙勬牸" + show-tooltip-when-overflow + sortable="custom" + > + <template slot-scope="{row}"> + <div v-if="row.mould_spec">{{ row.mould_spec }}</div> + <div v-else>/</div> + </template> + </el-table-column> + <el-table-column + prop="stanedcode" + label="鐐规鏍囧噯缂栫爜" + sortable="custom" + /> + <el-table-column + prop="stanedname" + label="鐐规鏍囧噯鍚嶇О" + sortable="custom" + /> + + <el-table-column + prop="maint_user" + label="鐐规浜哄憳" + sortable="custom" + /> + <el-table-column + prop="maint_result" + label="鐐规缁撴灉" + sortable="custom" + > + <template slot-scope="{row}"> + <el-tag v-if="row.maint_result==='OK'" size="small" type="success">鍚堟牸</el-tag> + <el-tag v-if="row.maint_result==='NG'" size="small" type="danger">寮傚父</el-tag> + </template> + </el-table-column> + + <el-table-column + prop="maint_date" + label="鐐规鏃堕棿" + sortable="custom" + /> + + <el-table-column + label="鎿嶄綔" + width="120" + fixed="right" + > + <template slot-scope="{row}"> + <div class="operationClass"> + + <el-tooltip class="item" effect="dark" content="鏄庣粏" placement="top"> + <i + class="el-icon-tickets" + :style="{color:$store.state.settings.theme}" + style="cursor: pointer;margin-right: 15px" + @click="edit(row)" + /> + </el-tooltip> + </div> + </template> + </el-table-column> + </el-table> + </div> + <!--鍒嗛〉--> + <pagination + :total="total" + :page.sync="form.page" + :limit.sync="form.rows" + align="right" + layout="total,prev, pager, next,sizes" + popper-class="select_bottom" + @pagination="getMouldRepairTakeSearch" + /> + </div> + + <el-dialog + v-el-drag-dialog + title="鏄庣粏" + :visible.sync="dialogVisible" + width="800px" + :close-on-click-modal="false" + top="15vh" + @closed="handleClose" + @close="handleClose" + > + <div class="elTableDiv" style="margin-top: 0"> + <el-table + :data="tableDataDialog" + :height="500+'px'" + border + :row-class-name="tableRowClassName" + :style="{width: 100+'%',height:500+'px'}" + highlight-current-row + :header-cell-style="this.$headerCellStyle" + :cell-style="this.$cellStyle" + @sort-change="sortChange" + > + <el-table-column + prop="seq" + width="50" + fixed + label="搴忓彿" + /> + <el-table-column + prop="itemcode" + label="閮ㄤ綅缂栫爜" + /> + <el-table-column + prop="itemname" + label="閮ㄤ綅鍚嶇О" + /> + <el-table-column + prop="result" + label="鐐规缁撴灉" + > + <template slot-scope="{row}"> + <div v-if="row.result==='OK'" style="display: flex;align-items: center"> + <i class="el-icon-success" :style="{color:$store.state.settings.theme}" style="margin-right: 2px" /> + 姝e父 + </div> + <div v-if="row.result==='NG'" style="display: flex;align-items: center"> + <i class="el-icon-info" style="margin-right: 2px" /> + 寮傚父 + </div> + </template> + </el-table-column> + <el-table-column + prop="chk_value" + label="鏁板��" + > + <template slot-scope="{row}"> + {{ row.chk_value ? row.chk_value : '/' }} + </template> + </el-table-column> + <!-- <el-table-column--> + <!-- prop="remark"--> + <!-- label="澶囨敞"--> + <!-- show-tooltip-when-overflow--> + <!-- />--> + </el-table> + </div> + + <span slot="footer" class="dialog-footer"> + <div class="footerButton"> + <el-button v-waves @click="dialogVisibleCancel">鍙� 娑�</el-button> + <!-- <el-button v-waves type="primary" @click="dialogVisibleConfirm">纭� 瀹�</el-button>--> + </div> + </span> + </el-dialog> + + </div> +</template> + +<script> +import Pagination from '@/components/Pagination' +import { handleDatetime } from '@/utils/global' +import elDragDialog from '@/directive/el-drag-dialog' +import waves from '@/directive/waves' +import { + MouldRepairSubTakeSearch, + MouldRepairTakeOutExcel, + MouldRepairTakeSearch +} from '@/api/MouldManager' + +export default { + name: 'MouldMaintainRecord', + components: { + Pagination + }, + directives: { elDragDialog, waves }, + data() { + return { + mouseHoverType: 'mouseout', + isExpandForm: false, + mainHeight: 0, + tableHeight: 0, + form: { + mouldcode: '', + mouldname: '', + mouldspec: '', + stanedcode: '', + stanedname: '', + repairuser: '', + repairresult: '', + repairdate: '', + prop: 'maint_date', // 鎺掑簭瀛楁 + order: 'desc', // 鎺掑簭瀛楁 + page: 1, // 绗嚑椤� + rows: 20 // 姣忛〉澶氬皯鏉� + }, + checkrequestArr: [ + { code: 'OK', name: '鍚堟牸' }, + { code: 'NG', name: '寮傚父' } + ], + total: 10, + tableData: [], + dialogVisible: false, + tableDataDialog: [] + + } + }, + + activated() { + window.addEventListener('resize', this.getHeight) + this.getHeight() + this.getMouldRepairTakeSearch() + }, + created() { + this.getMouldRepairTakeSearch() + }, + mounted() { + window.addEventListener('resize', this.getHeight) + this.getHeight() + }, + methods: { + async getMouldRepairTakeSearch() { + let tempDate = this.form.repairdate + if (tempDate.length > 0) { + tempDate = handleDatetime(tempDate[0]) + '~' + handleDatetime(tempDate[1]) + } + + const data = { + mouldcode: this.form.mouldcode, + mouldname: this.form.mouldname, + mouldspec: this.form.mouldspec, + stanedcode: this.form.stanedcode, + stanedname: this.form.stanedname, + repairuser: this.form.repairuser, + repairresult: this.form.repairresult, + repairdate: tempDate, + prop: this.form.prop, + order: this.form.order, + page: this.form.page, + rows: this.form.rows + + } + console.log(data, 1) + const res = await MouldRepairTakeSearch(data) + this.tableData = res.data + this.total = res.count + }, + // 鎺掑簭鏀瑰彉鏃� + sortChange({ column, prop, order }) { + if (order === 'descending') { + order = 'desc' + } else if (order === 'ascending') { + order = 'asc' + } else { + order = 'desc' + } + this.form.order = order + this.form.prop = prop + this.getMouldRepairTakeSearch() + }, + async download() { + let tempDate = this.form.repairdate + if (tempDate.length > 0) { + tempDate = handleDatetime(tempDate[0]) + '~' + handleDatetime(tempDate[1]) + } + + const data = { + mouldcode: this.form.mouldcode, + mouldname: this.form.mouldname, + mouldspec: this.form.mouldspec, + stanedcode: this.form.stanedcode, + stanedname: this.form.stanedname, + repairuser: this.form.repairuser, + repairresult: this.form.repairresult, + repairdate: tempDate + } + + const { data: res } = await MouldRepairTakeOutExcel(data) + window.location.href = res + }, + // 鏌ヨ + search() { + this.getMouldRepairTakeSearch() + }, + + // 閲嶇疆 + reset() { + this.form.mouldcode = '' + this.form.mouldname = '' + this.form.mouldspec = '' + this.form.stanedcode = '' + this.form.stanedname = '' + this.form.repairuser = '' + this.form.repairresult = '' + this.form.repairdate = '' + this.getMouldRepairTakeSearch() + }, + + // 淇敼鎸夐挳 + async edit(row) { + this.dialogVisible = true + + const { data: res } = await MouldRepairSubTakeSearch({ id: row.id }) + this.tableDataDialog = res + + // this.$nextTick(() => { + // this.dialogForm.OrgCode = row.org_code + // this.dialogForm.OrgName = row.org_name + // this.dialogForm.SupUnit = row.parent_id + // }) + }, + + // 瀵硅瘽妗嗗叧闂簨浠� + handleClose() { + this.tableDataDialog = [] + }, + // 瀵硅瘽妗嗗彇娑� + dialogVisibleCancel() { + this.dialogVisible = false + }, + + // 鑾峰彇椤甸潰楂樺害 + getHeight() { + this.$nextTick(() => { + this.mainHeight = window.innerHeight - 85 + this.tableHeight = this.mainHeight - 255 + this.$refs.tableDataRef.doLayout() + }) + }, + tableRowClassName({ row, rowIndex }) { + return 'custom-row' + } + } +} +</script> + +<style scoped lang="scss"> +::v-deep .el-select__caret { + display: flex; + align-items: center; + justify-content: center; +} + +::v-deep .el-range__icon { + line-height: 28px !important; +} + +::v-deep .el-range-separator { + line-height: 28px !important; +} + +::v-deep .el-range-input { + font-size: 14px; +} + +::v-deep .el-range-separator { + display: flex; + justify-content: center; + align-items: center; +} + +::v-deep .el-progress-bar__innerText { + display: none !important; +} +</style> +<style> + +.el-table .custom-row { + background: #f8f8fa; +} +</style> -- Gitblit v1.9.3