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.
 
 
 
 

364 lines
13 KiB

<template>
<div class="app-container">
<div class="filter-container">
<!-- sticky style="margin-bottom: 10px;">
<div class="sub-navbar">
<el-button type="success" icon="el-icon-printer" @click="printSfd">
收费通知单
</el-button>
<el-button type="primary" icon="el-icon-printer" @click="batchToPrint('JYBG')">
检验报告
</el-button>
<el-button type="warning" @click="openGrant()">
<svg-icon icon-class="form" />
报告发放
</el-button>
</div>
</sticky -->
<el-form>
<el-form-item>
<el-input v-model="listQuery.serialNumber" placeholder="(全部)报检单编号" clearable style="width: 200px" @keyup.enter.native="handleFilter" />
<el-input v-model="listQuery.baogaobianhao" placeholder="报告编号" clearable style="width: 200px" @keyup.enter.native="handleFilter" />
<el-input v-model="listQuery.zhucedaima" placeholder="注册代码" clearable style="width: 200px" @keyup.enter.native="handleFilter" />
<el-input v-model="listQuery.shiyongdanwei" placeholder="使用单位" clearable style="width: 350px" @keyup.enter.native="handleFilter" />
<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>
<br>
<el-input v-model="listQuery.shiyongdengjibianhao" placeholder="请输入使用登记证编号" clearable style="width: 200px" @keyup.enter.native="handleFilter" />
<el-input v-model="listQuery.chanpinbianhao" placeholder="请输入产品编号" clearable style="width: 185px" @keyup.enter.native="handleFilter" />
<el-select v-model="listQuery.jianyanleibie" placeholder="请选择检验类别" style="width: 165px" filterable clearable @change="handleFilter">
<el-option v-for="item in jylbList" v-show="item.parentId" :key="item.code" :label="item.name" :value="item.code" />
</el-select>
<el-date-picker v-model="listQuery.xiacijianyanriqi" type="date" value-format="yyyy-MM-dd" placeholder="请选择下次检验日期" style="width:145px" />
<el-select v-model="listQuery.jianyanrenyuan" placeholder="请选择检验人员" style="width: 165px" filterable clearable @change="handleFilter">
<el-option v-for="item in userList" :key="item.id" :label="item.nickname" :value="item.id" />
</el-select>
</el-form-item>
</el-form>
</div>
<el-table
ref="list"
v-adaptive="{bottomOffset: 50}"
height="0"
:data="list"
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="baogaobianhao" width="180" sortable="custom" />
<el-table-column align="center" label="检验类别" prop="jianyanleibie" width="80">
<template slot-scope="scope">
<span v-if="scope.row.jianyanleibie === 'DJ'">定期检验</span>
<span v-else-if="scope.row.jianyanleibie === 'JJ'">监督检验</span>
</template>
</el-table-column>
<el-table-column align="center" label="使用登记证号" prop="shiyongdengjibianhao" width="180" sortable="custom" />
<el-table-column align="center" label="设备(注册)代码" prop="zhucedaima" width="180" sortable="custom">
<template slot-scope="scope">
<span v-if="scope.row.zhucedaima">
<span v-if="scope.row.zhucedaima.length > 6">
{{ scope.row.zhucedaima }}
</span>
<span v-else>
{{ scope.row.shebeidaima }}
</span>
</span>
<span v-else>
{{ scope.row.shebeidaima }}
</span>
</template>
</el-table-column>
<el-table-column align="center" label="使用单位" prop="shiyongdanwei" width="240" />
<el-table-column align="center" label="制造单位" prop="zhizaodanwei" width="240" />
<el-table-column align="center" label="产品编号/出厂编号" prop="chanpinbianhao" width="220" />
<el-table-column align="center" label="单位内编号" prop="danweineibubianhao" width="150" sortable="custom" />
<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 align="center" label="下次检验日期" prop="xiacijianyanriqi" width="130" sortable="custom" />
<el-table-column align="center" label="检验结论" prop="jianyanjielun" width="80" />
<el-table-column align="center" label="收费单状态" prop="sfdId" width="90" fixed="right">
<template slot-scope="scope">
<el-tag v-if="scope.row.sfdId !== null" type="success">
已添加
</el-tag>
<el-tag v-else type="danger">
未添加
</el-tag>
</template>
</el-table-column>
<el-table-column align="center" label="操作" prop="access" width="100" fixed="right">
<template slot-scope="scope">
<el-button size="mini" type="primary" title="整合" circle @click="sfdZh(scope.row)">
整合
</el-button>
</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" />
<sign-info v-if="fafangVisible" :fafanglisttable="multipleSelection" @closeFafang="fafangVisible = false" @refulshList="handleFilter" />
<!-- 高级查询窗口 -->
<iframe :src="printbutton" frameborder="0" scrolling="no" height="0px" aria-disabled="true" />
<el-dialog
v-if="complexShow"
title="收费单创建/添加"
:visible.sync="complexShow"
:before-close="handleClose"
@close="complexShow = false"
>
<complex-bill :ysjl="ysjl" />
</el-dialog>
</div>
</template>
<script>
// import Sticky from '@/components/Sticky'
import Pagination from '@/components/Pagination'
import SignInfo from '../sign_info'
export default {
name: 'GrantReportGlCreate',
components: { Pagination, SignInfo },
data() {
return {
total: 0,
list: [],
listQuery: {
pageNum: 1, // 页码
pageRow: 20, // 每页条数
orderBy: 'id desc', // 排序字段
hasChild: false,
hasFinish: true,
flowstatus: undefined,
shebeizhongleidaima: '1000',
printState: 1,
fafangState: 0,
departmentId: this.$store.getters.departmentId === 75 ? 75 : null
},
flowUserList: [],
dialogFormVisible: false,
multipleSelection: [],
multipleSelectionLink: [],
jylbList: [],
userList: [],
printbutton: '',
fafangVisible: false,
complexShow: false,
ysjl: {}
}
},
created() {
this.getList()
this.jylbList = this.$store.getters.allCategory
this.userList = this.$store.getters.allUser.filter(user => user.departmentId === this.$store.getters.departmentId)
},
mounted() {
const that = this
this.common.$on('bggl-print-list', function() {
that.handleFilter()
})
},
methods: {
async validator(rule, value, callback) {
if (!value) {
callback(new Error(rule.message))
} else {
callback()
}
},
getList() {
this.api({
url: '/ysjl/getList',
method: 'get',
params: this.listQuery
}).then(data => {
this.list = data.list
this.total = data.total
})
},
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.listQuery = {
shebeizhongleidaima: '1000',
printState: 1,
fafangState: 0
}
this.getList()
},
openGrant() {
if (this.multipleSelection.length <= 0) {
this.$message({
type: 'info',
message: '请先选择需要发放的报告!'
})
return false
}
this.fafangVisible = true
},
handleClose() {
this.complexShow = false
this.ysjl = {}
this.getList()
},
sfdZh(row) {
this.ysjl = row
this.complexShow = true
},
printSfd() {
if (this.multipleSelection.length > 1) {
this.$message({
type: 'info',
message: '只能打印一份收费通知单!'
})
return false
}
if (this.multipleSelection[0].sfdId === null) {
this.$message({
type: 'warning',
message: '该台设备没有收费通知单!!'
})
return false
}
if (this.multipleSelection[0].shebeizhongleidaima !== '1000') {
this.$message({
type: 'info',
message: '只能锅炉打印收费通知单!'
})
return false
}
// 组织数据
this.apibjd({
url: '/sfd/getSfdPrintData',
method: 'get',
params: {
ysjlId: this.multipleSelection[0].id
}
}).then(data => {
this.preview({
url: '/print/generatePdfListing',
method: 'post',
data: {
info: data.info,
paramList: data.paramList,
viewType: 'SFD'
}
}).then(data => {
data = data.replace(/\\/g, '/')
window.open(data)
})
})
},
batchToPrint(type) {
const ysjl = this.multipleSelection[0]
if (this.multipleSelection.length === 0) {
this.$message('请选择单条或者多条设备进行打印。')
return false
}
let ids = ''
for (let i = 0; i < this.multipleSelection.length; i++) {
ids += this.multipleSelection[i].id + ','
if (i + 1 === this.multipleSelection.length) {
ids = ids.substring(0, ids.length - 1)
}
if (type === 'HGZ' && this.multipleSelection[i].jianyanjielun === '不合格') {
this.$message('请选择合格的报告进行打印。')
return false
}
// if (!this.multipleSelection[i].jfState) {
// this.$message.error('存在未收费的报告,请联系收费核实后再进行打印。')
// return false
// }
}
this.api({ // 记录打印详细,不做打印状态改变。
url: '/ysjl/getListBanjie',
method: 'get',
params: {
pageNum: 1,
pageRow: 20,
searchYsjl: {
baogaobianhao: '(' + new Date().getFullYear() + ')',
shiyongdanwei: ysjl.shiyongdanwei,
jfState: false,
shebeizhongleidaima: '1000'
}
}
}).then(data => {
if (data.total !== 0) {
this.$message({
type: 'warning',
message: '该单位名下存在未收费的检验项,请确认后在进行操作!'
})
return false
} else {
this.preview({
url: '/print/createXml',
method: 'post',
params: {
ids: ids,
type: type
}
}).then(data => {
this.printbutton = 'ReportPrintApp://' + data
this.api({ // 记录打印详细,不做打印状态改变。
url: '/ysjl/batchRecordPrintState',
method: 'get',
params: {
ids: ids,
type: type
}
})
if (type === 'JYBG') {
this.api({ // 标记为打印状态。
url: '/ysjl/batchUpdPrintState',
method: 'get',
params: {
ids: ids,
type: type
}
})
}
})
}
})
}
}
}
</script>
<style scoped>
.app-container {
padding-bottom: 0px;
}
</style>