<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.checkuser" 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.checkdate"
|
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.checkrequest" 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="djwo"
|
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="chk_user"
|
label="点检人员"
|
sortable="custom"
|
/>
|
<el-table-column
|
prop="chk_result"
|
label="点检结果"
|
sortable="custom"
|
>
|
<template slot-scope="{row}">
|
<el-tag v-if="row.chk_result==='OK'" size="small" type="success">合格</el-tag>
|
<el-tag v-if="row.chk_result==='NG'" size="small" type="danger">异常</el-tag>
|
</template>
|
</el-table-column>
|
|
<el-table-column
|
prop="chk_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="getMouldCheckTakeSearch"
|
/>
|
</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" />
|
正常
|
</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 { MouldCheckSubTakeSearch, MouldCheckTakeOutExcel, MouldCheckTakeSearch } from '@/api/MouldManager'
|
|
export default {
|
name: 'MouldCheckRecord',
|
components: {
|
Pagination
|
},
|
directives: { elDragDialog, waves },
|
data() {
|
return {
|
mouseHoverType: 'mouseout',
|
isExpandForm: false,
|
mainHeight: 0,
|
tableHeight: 0,
|
form: {
|
mouldcode: '',
|
mouldname: '',
|
mouldspec: '',
|
stanedcode: '',
|
stanedname: '',
|
checkuser: '',
|
checkrequest: '',
|
checkdate: '',
|
prop: 'chk_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.getMouldCheckTakeSearch()
|
},
|
created() {
|
this.getMouldCheckTakeSearch()
|
},
|
mounted() {
|
window.addEventListener('resize', this.getHeight)
|
this.getHeight()
|
},
|
methods: {
|
async getMouldCheckTakeSearch() {
|
let tempDate = this.form.checkdate
|
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,
|
checkuser: this.form.checkuser,
|
checkrequest: this.form.checkrequest,
|
checkdate: tempDate,
|
prop: this.form.prop,
|
order: this.form.order,
|
page: this.form.page,
|
rows: this.form.rows
|
|
}
|
console.log(data, 1)
|
const res = await MouldCheckTakeSearch(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.getMouldCheckTakeSearch()
|
},
|
async download() {
|
let tempDate = this.form.checkdate
|
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,
|
checkuser: this.form.checkuser,
|
checkrequest: this.form.checkrequest,
|
checkdate: tempDate
|
}
|
|
const { data: res } = await MouldCheckTakeOutExcel(data)
|
window.location.href = res
|
},
|
// 查询
|
search() {
|
this.getMouldCheckTakeSearch()
|
},
|
|
// 重置
|
reset() {
|
this.form.mouldcode = ''
|
this.form.mouldname = ''
|
this.form.mouldspec = ''
|
this.form.stanedcode = ''
|
this.form.stanedname = ''
|
this.form.checkuser = ''
|
this.form.checkrequest = ''
|
this.form.checkdate = ''
|
this.getMouldCheckTakeSearch()
|
},
|
|
// 修改按钮
|
async edit(row) {
|
this.dialogVisible = true
|
|
const { data: res } = await MouldCheckSubTakeSearch({ 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>
|