You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
206 lines
7.9 KiB
206 lines
7.9 KiB
<template>
|
|
<div class="app-container">
|
|
<div class="filter-container">
|
|
<sticky v-show="hasPerm('ysjl:done-ysjl:regenerate')" style="margin-bottom: 10px;">
|
|
<div class="sub-navbar">
|
|
<el-button v-if="hasPerm('ysjl:done-ysjl:regenerate')" type="warning" icon="el-icon-view" @click="generatePdf('YSJL')">
|
|
重新生成记录预览
|
|
</el-button>
|
|
</div>
|
|
</sticky>
|
|
<el-form style="margin-top: 10px;">
|
|
<el-form-item>
|
|
<el-input v-model="listQuery.jilubianhao" placeholder="记录编号" clearable style="width: 200px" @keyup.enter.native="handleFilter" />
|
|
<el-input v-model="listQuery.zhucedaima" placeholder="注册代码" clearable style="width: 240px" @keyup.enter.native="handleFilter" />
|
|
<el-input v-model="listQuery.shiyongdanwei" placeholder="使用单位" clearable style="width: 400px" @keyup.enter.native="handleFilter" />
|
|
<el-select v-model="listQuery.bglx" placeholder="报告类型" style="width: 160px">
|
|
<el-option
|
|
v-for="item in bglxOptions"
|
|
:key="item.value"
|
|
:label="item.label"
|
|
:value="item.value"
|
|
/>
|
|
</el-select>
|
|
<br>
|
|
<el-button type="primary" size="small" icon="el-icon-search" @click="handleFilter">
|
|
查询
|
|
</el-button>
|
|
<el-button type="info" size="small" icon="el-icon-close" @click="clearQuery">
|
|
清空条件
|
|
</el-button>
|
|
</el-form-item>
|
|
</el-form>
|
|
</div>
|
|
<el-table
|
|
ref="list"
|
|
v-adaptive="{bottomOffset: 50}"
|
|
height="0"
|
|
:data="list"
|
|
:default-sort="{prop:'jilubianhao', order:'descending'}"
|
|
border
|
|
fit
|
|
highlight-current-row
|
|
stripe
|
|
width="100%"
|
|
size="small"
|
|
@row-click="onRowClick"
|
|
@selection-change="handleSelectionChange"
|
|
@sort-change="sortChange"
|
|
>
|
|
<el-table-column type="selection" width="40" />
|
|
<el-table-column fixed="left" align="center" label="序号" width="60">
|
|
<template slot-scope="scope">
|
|
<span v-text="getIndex(scope.$index)" />
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column align="center" label="记录编号" prop="jilubianhao" width="180" sortable="custom" />
|
|
<el-table-column :formatter="formatter.formatterCategory" align="center" label="检验类别" prop="neibuleibie" width="100" />
|
|
<template v-if="$store.getters.departmentId === 69">
|
|
<el-table-column align="center" label="使用单位" prop="shiyongdanwei" width="240" />
|
|
<el-table-column align="center" label="产品编号/出厂编号" prop="chanpinbianhao" width="220" />
|
|
<el-table-column align="center" label="制造单位" prop="zhizaodanwei" width="240" />
|
|
</template>
|
|
<template v-else-if="$store.getters.departmentId === 74">
|
|
<el-table-column align="center" label="制造单位" prop="zhizaodanwei" width="200" />
|
|
<el-table-column align="center" label="设备代码" prop="shebeidaima" width="200" />
|
|
<el-table-column align="center" label="锅炉型号" prop="guigexinghao" width="200" />
|
|
<el-table-column align="center" label="产品编号/出厂编号" prop="chanpinbianhao" width="130" />
|
|
</template>
|
|
<template v-else>
|
|
<el-table-column align="center" label="使用登记证号" prop="shiyongdengjibianhao" width="180" sortable="custom" />
|
|
<el-table-column align="center" label="注册代码" prop="zhucedaima" width="180" sortable="custom" />
|
|
<el-table-column align="center" label="使用单位" prop="shiyongdanwei" width="240" />
|
|
<el-table-column align="center" label="设备品种" prop="shebeipinzhong" width="220" />
|
|
<el-table-column align="center" label="设备名称" prop="shebeimingcheng" width="220" />
|
|
<el-table-column align="center" label="产品编号/出厂编号" prop="chanpinbianhao" width="220" />
|
|
<el-table-column align="center" label="单位内编号" prop="danweineibubianhao" width="150" sortable="custom" />
|
|
</template>
|
|
<el-table-column :formatter="formatter.getChineseName" align="center" label="检验人员" prop="jianyanrenyuan" width="140" />
|
|
<el-table-column align="center" label="检验日期" prop="jianyanjieshuriqi" width="110" sortable="custom" />
|
|
<el-table-column v-if="$store.getters.departmentId !== 74" align="center" label="下次检验日期" prop="xiacijianyanriqi" width="130" sortable="custom" />
|
|
<el-table-column fixed="right" align="center" label="类型" prop="inspectionItems" width="95">
|
|
<template slot-scope="scope">
|
|
<el-tag v-if="scope.row.bglx===1">
|
|
主报告
|
|
</el-tag>
|
|
<el-tag v-if="scope.row.bglx===2" type="success">
|
|
{{ scope.row.inspectionItems }}
|
|
</el-tag>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column fixed="right" align="center" label="操作" prop="" width="120">
|
|
<template slot-scope="scope">
|
|
<el-button
|
|
v-show="scope.row.shebeizhongleidaima === '2000' || scope.row.shebeizhongleidaima === '7000'"
|
|
type="info"
|
|
size="mini"
|
|
circle
|
|
icon="el-icon-view"
|
|
:title="'预览' + (scope.row.shebeizhongleidaima === '2000' ? '原始资料' : '附件')"
|
|
@click="common.viewRawRecords(scope.row.renwuId)"
|
|
/>
|
|
<el-button type="primary" size="mini" circle icon="el-icon-view" title="预览 原始记录" @click="common.viewYsjl(scope.row.id, 'YSJL')" />
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
<pagination v-show="total>0" :total="total" :page-num.sync="listQuery.pageNum" :page-row.sync="listQuery.pageRow" @pagination="getList" />
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import Sticky from '@/components/Sticky'
|
|
import Pagination from '@/components/Pagination'
|
|
export default {
|
|
components: { Sticky, Pagination },
|
|
data() {
|
|
return {
|
|
total: 0,
|
|
list: [],
|
|
listQuery: {
|
|
pageNum: 1, // 页码
|
|
pageRow: 20, // 每页条数
|
|
orderBy: undefined, // 排序字段
|
|
hasChild: true
|
|
},
|
|
multipleSelection: [],
|
|
bglxOptions: [{
|
|
value: '1',
|
|
label: '主报告'
|
|
}, {
|
|
value: '2',
|
|
label: '无损报告'
|
|
}]
|
|
}
|
|
},
|
|
created() {
|
|
this.getList()
|
|
},
|
|
mounted() {
|
|
const that = this
|
|
this.common.$on('ysjl-yb-list', function() {
|
|
that.handleFilter()
|
|
})
|
|
},
|
|
methods: {
|
|
getList() {
|
|
this.listQuery.cjState = 'jybg'
|
|
this.api({
|
|
url: '/ysjl/getListDoneYsjl',
|
|
method: 'get',
|
|
params: this.listQuery
|
|
}).then(data => {
|
|
this.list = data.list
|
|
this.total = data.total
|
|
this.common.switchInspection(this.list)
|
|
})
|
|
},
|
|
sortChange(column) {
|
|
this.listQuery.orderBy = column.prop + ' ' + column.order.replace('ending', '')
|
|
this.getList()
|
|
},
|
|
getIndex($index) {
|
|
// 表格序号
|
|
return (this.listQuery.pageNum - 1) * this.listQuery.pageRow + $index + 1
|
|
},
|
|
handleFilter() {
|
|
// 查询事件
|
|
this.listQuery.pageNum = 1
|
|
this.getList()
|
|
},
|
|
onRowClick(row) {
|
|
this.$refs.list.toggleRowSelection(row)
|
|
},
|
|
handleSelectionChange: function(val) {
|
|
this.multipleSelection = val
|
|
},
|
|
clearQuery() {
|
|
this.$set(this.listQuery, {})
|
|
this.getList()
|
|
},
|
|
generatePdf(viewType) {
|
|
let ids = ''
|
|
for (let i = 0; i < this.multipleSelection.length; i++) {
|
|
if (i === 0) {
|
|
ids = this.multipleSelection[i].id
|
|
} else {
|
|
ids += ',' + this.multipleSelection[i].id
|
|
}
|
|
if (this.multipleSelection[i].bglx !== 1) {
|
|
this.$message({
|
|
type: 'info',
|
|
message: '请选择主报告进行重新生成!'
|
|
})
|
|
return false
|
|
}
|
|
}
|
|
this.common.viewYsjlNoOpen(ids, viewType)
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.app-container {
|
|
padding-bottom: 0px;
|
|
}
|
|
</style>
|
|
|