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.
416 lines
13 KiB
416 lines
13 KiB
<template>
|
|
<div class="app-container">
|
|
<div class="filter-container">
|
|
<sticky style="margin-bottom: 10px;">
|
|
<div class="sub-navbar">
|
|
<el-button type="danger" icon="el-icon-delete" @click="delYsjl">
|
|
删除记录
|
|
</el-button>
|
|
</div>
|
|
</sticky>
|
|
<el-form>
|
|
<el-form-item>
|
|
<el-select v-model="listQuery.shebeizhongleidaima" placeholder="请选择设备种类" style="width: 165px" clearable>
|
|
<el-option v-for="item in sbzlList" :key="item.value" :label="item.label" :value="item.value" />
|
|
</el-select>
|
|
<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" />
|
|
<br>
|
|
<el-button size="small" type="primary" icon="el-icon-search" @click="handleFilter">
|
|
查询
|
|
</el-button>
|
|
<el-button size="small" type="info" 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'}"
|
|
:row-class-name="tableRowClassName"
|
|
element-loading-text="拼命加载中"
|
|
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" />
|
|
<el-table-column align="center" label="设备品种" prop="shebeipinzhong" width="220" />
|
|
<el-table-column align="center" label="注册代码" prop="zhucedaima" width="180" sortable="custom" />
|
|
<el-table-column align="center" label="使用登记证号" prop="shiyongdengjibianhao" width="180" sortable="custom" />
|
|
<el-table-column align="center" label="使用单位" prop="shiyongdanwei" width="240" />
|
|
<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="guigexinghao" width="180" sortable="custom" />
|
|
<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 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="200">
|
|
<template slot-scope="scope">
|
|
<el-button type="primary" size="mini" circle icon="el-icon-edit" title="编辑" @click="editYsjl(scope.$index)" />
|
|
<el-button type="success" size="mini" circle icon="el-icon-view" title="预览 原始记录" @click="common.viewYsjl(scope.row.bglx === 1 ? scope.row.id : scope.row.parentId, 'YSJL')" />
|
|
<el-button type="info" size="mini" icon="el-icon-message" title="查看驳回意见" circle @click="viewAllRejection(list[scope.$index].renwuId)" />
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
<pagination v-show="total>0" :total="total" :page-num.sync="listQuery.pageNum" :page-row.sync="listQuery.pageRow" style="float: left;" @pagination="getList" />
|
|
<div style="float: right;margin-top:8px;">
|
|
<div style="width: 80px;float:left;margin-left: 50px;">
|
|
重启流程:
|
|
</div>
|
|
<div class="identification" style="background-color:red;" />
|
|
<div style="width: 50px;float:left;margin-left: 20px;">
|
|
驳回:
|
|
</div>
|
|
<div class="identification" style="background-color: orange;" />
|
|
<div style="width: 50px;float:left;margin-left: 20px;">
|
|
复制:
|
|
</div>
|
|
<div class="identification" style="background-color:#690cff;" />
|
|
</div>
|
|
|
|
<!-- 驳回意见 -->
|
|
<el-dialog :visible.sync="dialogBohuiyijianVisible" title="驳回意见" width="50%">
|
|
<el-table :data="infoNotes">
|
|
<el-table-column align="center" label="驳回人" prop="infoSend" />
|
|
<el-table-column align="center" label="驳回意见" prop="infoNotes" />
|
|
<el-table-column align="center" label="驳回时间" prop="createTime" />
|
|
</el-table>
|
|
</el-dialog>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import Sticky from '@/components/Sticky'
|
|
import Pagination from '@/components/Pagination'
|
|
import { getListUnDoneYsjl } from '@/api/ysjl'
|
|
import Utils from '../../../utils/contact.js'
|
|
export default {
|
|
components: { Sticky, Pagination },
|
|
data() {
|
|
return {
|
|
total: 0,
|
|
list: [],
|
|
listQuery: {
|
|
pageNum: 1, // 页码
|
|
pageRow: 20, // 每页条数
|
|
orderBy: undefined, // 排序字段
|
|
hasChild: true
|
|
},
|
|
multipleSelection: [],
|
|
ysjlId: '',
|
|
sbzlList: [],
|
|
sblbList: [],
|
|
sbpzList: [],
|
|
modelList: [],
|
|
sbzldm: '',
|
|
sblbdm: '',
|
|
sbpzdm: '',
|
|
modelId: '',
|
|
isQm: true,
|
|
infoNotes: '',
|
|
dialogBohuiyijianVisible: false
|
|
}
|
|
},
|
|
created() {
|
|
this.getList()
|
|
this.getSbzlList()
|
|
},
|
|
mounted() {
|
|
const that = this
|
|
this.common.$on('ysjl-list', function() {
|
|
that.handleFilter()
|
|
})
|
|
},
|
|
methods: {
|
|
getList() {
|
|
this.listQuery.cjState = 'ysjl'
|
|
getListUnDoneYsjl(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
|
|
},
|
|
getSbzlList() {
|
|
this.api({
|
|
url: '/sedirectory/getList',
|
|
method: 'get',
|
|
params: {
|
|
sbzl: undefined,
|
|
level: '1'
|
|
}
|
|
}).then(data => {
|
|
this.sbzlList = data
|
|
})
|
|
},
|
|
delYsjl() {
|
|
for (let i = 0; i < this.multipleSelection.length; i++) {
|
|
if (this.multipleSelection[i].bglx !== 1) {
|
|
this.$message({
|
|
message: '请选择主原始记录进行删除!',
|
|
type: 'warning'
|
|
})
|
|
return false
|
|
}
|
|
}
|
|
const ids = []
|
|
for (let i = 0; i < this.multipleSelection.length; i++) {
|
|
ids.push(this.multipleSelection[i].id)
|
|
}
|
|
// 查询是否有无损原始记录生成报告
|
|
this.api({
|
|
url: '/ysjl/judgeState',
|
|
method: 'get',
|
|
params: {
|
|
ysjlIds: ids,
|
|
bglx: '2',
|
|
isDel: true
|
|
},
|
|
paramsSerializer: function(data) {
|
|
return require('qs').stringify(data, { indices: false })
|
|
}
|
|
}).then(data => {
|
|
if (data === 0) {
|
|
this.$confirm('已有无损原始记录生成报告, 是否继续?', '提示', {
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
}).then(() => {
|
|
this.del(ids)
|
|
}).catch(() => {
|
|
this.$message({
|
|
type: 'info',
|
|
message: '已取消删除'
|
|
})
|
|
return false
|
|
})
|
|
} else {
|
|
this.$confirm('确定删除当前选中记录?', '提示', {
|
|
confirmButtonText: '确定',
|
|
type: 'warning'
|
|
}).then(() => {
|
|
this.del(ids)
|
|
}).catch(() => {
|
|
this.$message({
|
|
type: 'info',
|
|
message: '已取消删除'
|
|
})
|
|
return false
|
|
})
|
|
}
|
|
})
|
|
},
|
|
del(ids) {
|
|
this.api({
|
|
url: '/ysjl',
|
|
method: 'delete',
|
|
params: {
|
|
ids: ids
|
|
},
|
|
paramsSerializer: function(data) {
|
|
return require('qs').stringify(data, { indices: false })
|
|
}
|
|
}).then(() => {
|
|
this.$message({
|
|
message: '删除成功',
|
|
type: 'success',
|
|
duration: 1000,
|
|
onClose: () => {
|
|
this.getList()
|
|
Utils.$emit('task-list')
|
|
}
|
|
})
|
|
})
|
|
},
|
|
editYsjl($index) {
|
|
const ysjl = this.list[$index]
|
|
this.api({
|
|
url: '/template',
|
|
method: 'get',
|
|
params: {
|
|
id: ysjl.templateId
|
|
}
|
|
}).then(data => {
|
|
const queryParam = this.common.buildEditYsjlRouterParam(ysjl)
|
|
if (ysjl.bglx === 1) {
|
|
this.$router.push({ path: data.tempPath + '/' + ysjl.id, query: queryParam })
|
|
} else {
|
|
this.$router.push({ path: data.tempPath, query: queryParam })
|
|
}
|
|
})
|
|
},
|
|
clearQuery() {
|
|
this.$set(this.listQuery, 'searchYsjl', {
|
|
bglx: 1,
|
|
createBy: this.$store.getters.userId
|
|
})
|
|
this.getList()
|
|
},
|
|
tableRowClassName({ row, rowIndex }) {
|
|
if (row.retreatState === 1) {
|
|
return 'reject-row'
|
|
} else if (row.retreatState === 2) {
|
|
return 'restart-row'
|
|
} else if (row.copyState === true) {
|
|
return 'copy-row'
|
|
}
|
|
return ''
|
|
},
|
|
closeDialog() {
|
|
this.isQm = true
|
|
},
|
|
getSblbList(val) {
|
|
this.sblbdm = ''
|
|
this.sbpzList = []
|
|
this.sbpzdm = ''
|
|
this.modelList = []
|
|
this.modelId = ''
|
|
this.getSbList(val, undefined, 2)
|
|
},
|
|
getSbpzList(val) {
|
|
this.modelList = []
|
|
this.modelId = ''
|
|
this.sbpzdm = ''
|
|
this.getSbList(this.sbzldm, val, 3)
|
|
},
|
|
getModelList(val) {
|
|
let tempJylb = ''
|
|
let category = ''
|
|
let nbleibie = ''
|
|
if (val === '7310') {
|
|
tempJylb = 'DJ'
|
|
category = 'YSJL'
|
|
nbleibie = 'DQ'
|
|
}
|
|
this.api({
|
|
url: '/template/getTemplateBySbpz',
|
|
method: 'get',
|
|
params: {
|
|
sbpz: val,
|
|
jianyanleibie: tempJylb,
|
|
category: category,
|
|
neibuleibie: nbleibie
|
|
}
|
|
}).then(data => {
|
|
this.modelList = data
|
|
this.modelId = data[0].value
|
|
})
|
|
},
|
|
getSbList(sbzl, sblb, level) {
|
|
this.api({
|
|
url: '/sedirectory/getList',
|
|
method: 'get',
|
|
params: {
|
|
sbzl: sbzl,
|
|
sblb: sblb,
|
|
level: level
|
|
}
|
|
}).then(data => {
|
|
switch (level) {
|
|
case 2:
|
|
this.sblbList = data
|
|
return ''
|
|
case 3:
|
|
this.sbpzList = data
|
|
return ''
|
|
default:
|
|
this.sbzlList = data
|
|
return ''
|
|
}
|
|
})
|
|
},
|
|
/**
|
|
* 根据报告ID查看驳回原因
|
|
* @param renwuId
|
|
*/
|
|
viewAllRejection(renwuId) {
|
|
this.api({
|
|
url: '/taskinfo/viewRejection',
|
|
method: 'get',
|
|
params: {
|
|
renwuId: renwuId
|
|
}
|
|
}).then(data => {
|
|
this.infoNotes = data
|
|
if (!this.infoNotes.length) {
|
|
this.$alert('暂无驳回意见!', '驳回意见', {
|
|
confirmButtonText: '关闭'
|
|
})
|
|
} else {
|
|
this.dialogBohuiyijianVisible = true
|
|
}
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
<style>
|
|
.el-table .reject-row {
|
|
color: orange;
|
|
}
|
|
.el-table .restart-row {
|
|
color: red;
|
|
}
|
|
.el-table .copy-row {
|
|
color: #690cff;
|
|
}
|
|
.identification{
|
|
width: 30px;
|
|
height:15px;
|
|
display: inline-block;
|
|
border:gray 1px solid;
|
|
border-radius:15px;
|
|
float: left;
|
|
}
|
|
button.el-button.el-button--mini.is-circle{
|
|
margin: 1px;
|
|
}
|
|
</style>
|
|
|