<template>
|
<div class="report-results">
|
<el-row class="title">
|
<el-col :span="12" style="padding-left: 20px;text-align: left;">报告结果</el-col>
|
<el-col :span="12" style="text-align: right;">
|
<el-button size="medium" type="primary" @click="handleDown" :loading="outLoading" v-if="outPower">导出</el-button>
|
<el-button size="medium" type="primary" @click="openAdd" v-if="addPower">新增</el-button>
|
</el-col>
|
</el-row>
|
<div class="search">
|
<div class="search_thing">
|
<div class="search_label">检验报告编号:</div>
|
<div class="search_input"><el-input size="small" placeholder="请输入" clearable v-model="queryParams.insReportCode"
|
@keyup.enter.native="refreshTable()"></el-input></div>
|
</div>
|
<div class="search_thing" style="padding-left: 30px;">
|
<el-button size="small" @click="refresh()">重 置</el-button>
|
<el-button size="small" type="primary" @click="refreshTable()">查 询</el-button>
|
</div>
|
</div>
|
<div class="table">
|
<lims-table :tableData="tableData" :column="column" :tableLoading="tableLoading" :height="'calc(100vh - 290px)'"
|
:page="page" @pagination="pagination"></lims-table>
|
<!-- <ValueTable ref="ValueTable" :url="$api.processReport.pageProcessReport"
|
:delUrl="$api.processReport.delProcessReport" :componentData="componentData" :key="upIndex" /> -->
|
</div>
|
<el-dialog :title="title" :visible.sync="addDialogVisible" width="400px" top="6vh">
|
<el-row>
|
<el-col :span="24" style="margin-bottom: 16px;">
|
<div class="search_thing">
|
<div class="search_label">检验报告编号:</div>
|
<div class="search_input"><el-input size="small" placeholder="请输入" clearable
|
v-model="addInfo.insReportCode"></el-input></div>
|
</div>
|
</el-col>
|
<el-col :span="24" style="margin-bottom: 16px;">
|
<div class="search_thing">
|
<div class="search_label">页数:</div>
|
<div class="search_input"><el-input size="small" placeholder="请输入" clearable
|
v-model="addInfo.pages"></el-input></div>
|
</div>
|
</el-col>
|
<el-col :span="24" style="margin-bottom: 16px;">
|
<div class="search_thing">
|
<div class="search_label">发送份数:</div>
|
<div class="search_input"><el-input size="small" placeholder="请输入" clearable
|
v-model="addInfo.number"></el-input></div>
|
</div>
|
</el-col>
|
<el-col :span="24" style="margin-bottom: 16px;">
|
<div class="search_thing">
|
<div class="search_label">发往何处:</div>
|
<div class="search_input"><el-input size="small" placeholder="请输入" clearable
|
v-model="addInfo.send"></el-input></div>
|
</div>
|
</el-col>
|
<el-col :span="24" style="margin-bottom: 16px;">
|
<div class="search_thing">
|
<div class="search_label">发送方式:</div>
|
<div class="search_input"><el-input size="small" placeholder="请输入" clearable
|
v-model="addInfo.method"></el-input></div>
|
</div>
|
</el-col>
|
<el-col :span="24" style="margin-bottom: 16px;">
|
<div class="search_thing">
|
<div class="search_label">发送日期:</div>
|
<div class="search_input">
|
<el-date-picker v-model="addInfo.sendTime" type="date" size="small" placeholder="选择日期" format="yyyy-MM-dd"
|
value-format="yyyy-MM-dd" style="width: 100%;">
|
</el-date-picker>
|
</div>
|
</div>
|
</el-col>
|
<el-col :span="24" style="margin-bottom: 16px;">
|
<div class="search_thing">
|
<div class="search_label">发送人:</div>
|
<div class="search_input">
|
<el-select v-model="addInfo.sendUser" placeholder="请选择" size="small" style="width: 100%;">
|
<el-option v-for="item in personList" :key="item.value" :label="item.label" :value="item.value">
|
</el-option>
|
</el-select>
|
</div>
|
</div>
|
</el-col>
|
<el-col :span="24" style="margin-bottom: 16px;">
|
<div class="search_thing">
|
<div class="search_label">签收人:</div>
|
<div class="search_input">
|
<el-select v-model="addInfo.signatory" placeholder="请选择" size="small" style="width: 100%;" multiple>
|
<el-option v-for="item in personList" :key="item.value" :label="item.label" :value="item.value">
|
</el-option>
|
</el-select>
|
</div>
|
</div>
|
</el-col>
|
<el-col :span="24" style="margin-bottom: 16px;">
|
<div class="search_thing">
|
<div class="search_label">备注:</div>
|
<div class="search_input"><el-input size="small" placeholder="请输入" clearable v-model="addInfo.remark"
|
type="textarea" :rows="2"></el-input></div>
|
</div>
|
</el-col>
|
</el-row>
|
<span slot="footer" class="dialog-footer">
|
<el-button @click="addDialogVisible = false">取 消</el-button>
|
<el-button type="primary" @click="handleAdd" :loading="addLoading">确 定</el-button>
|
</span>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import limsTable from "@/components/Table/lims-table.vue";
|
import {
|
exportProcessReport,
|
doProcessReport,
|
addProcessReport
|
} from '@/api/cnas/process/reportResults.js'
|
import {
|
selectUserCondition,
|
} from "@/api/business/inspectionTask.js";
|
export default {
|
components: {
|
limsTable
|
},
|
data() {
|
return {
|
outLoading: false,
|
addPower: true,
|
outPower: true,
|
componentData: {
|
entity: {
|
insReportCode: null,
|
// sendUserName: null,
|
orderBy: {
|
field: 'createTime',
|
order: 'desc'
|
}
|
},
|
isIndex: true,
|
showSelect: true,
|
select: true,
|
selectMethod: 'handleChangeTask',
|
do: [
|
{
|
id: 'handleWork',
|
font: '修改',
|
type: 'text',
|
method: 'handleWork'
|
},
|
{
|
id: 'delete',
|
font: '删除',
|
type: 'text',
|
method: 'doDiy'
|
}
|
],
|
tagField: {},
|
selectField: {
|
sendUser: {
|
select: []
|
},
|
signatory: {
|
select: []
|
},
|
},
|
// addUpload:['signatoryUrl'],
|
requiredAdd: [],
|
requiredUp: [],
|
needSort: [],
|
inputType: ''
|
},
|
entityCopy: {},
|
upIndex: 0,
|
personList: [],
|
title: '新增',
|
addDialogVisible: false,
|
addInfo: {
|
signatory: []
|
},
|
addLoading: false,
|
mutilSelect: [],
|
queryParams: {},
|
tableData: [],
|
column: [
|
{ label: "编号", prop: "number" },
|
{ label: "辅助项目名称", prop: "auxiliaryProject", width: "120px" },
|
{
|
label: "实验室",
|
prop: "laboratory",
|
dataType: "tag",
|
formatData: (params) => {
|
return this.laboratoryList.find((m) => m.value == params).label;
|
},
|
},
|
{ label: "单位", prop: "unit" },
|
{ label: "核准工时", prop: "approvedWorkingHour" },
|
{ label: "部门", prop: "department" },
|
{ label: "备注", prop: "remarks" },
|
{
|
dataType: "action",
|
fixed: "right",
|
label: "操作",
|
operation: [
|
{
|
name: "编辑",
|
type: "text",
|
clickFun: (row) => {
|
this.openAdd("编辑", row);
|
},
|
showHide: (row) => {
|
return this.checkPermi([
|
"performance:manHour:workTimeConfig:edit",
|
]);
|
},
|
},
|
{
|
name: "删除",
|
type: "text",
|
clickFun: (row) => {
|
this.handleDelete(row);
|
},
|
showHide: (row) => {
|
return this.checkPermi([
|
"performance:manHour:workTimeConfig:del",
|
]);
|
},
|
},
|
],
|
},
|
],
|
page: {
|
total: 0,
|
size: 10,
|
current: 0,
|
},
|
tableLoading: false,
|
}
|
},
|
mounted() {
|
// this.entityCopy = this.HaveJson(this.componentData.entity);
|
// this.getPower()
|
this.getAuthorizedPerson()
|
},
|
methods: {
|
getPower() {
|
let power = JSON.parse(sessionStorage.getItem('power'))
|
let up = false
|
let del = false
|
let add = false
|
let out = false
|
for (var i = 0; i < power.length; i++) {
|
if (power[i].menuMethod == 'doProcessReport') {
|
up = true
|
}
|
if (power[i].menuMethod == 'addProcessReport') {
|
add = true
|
}
|
if (power[i].menuMethod == 'delProcessReport') {
|
del = true
|
}
|
if (power[i].menuMethod == 'exportProcessReport') {
|
out = true
|
}
|
}
|
if (!up) {
|
this.componentData.do.splice(1, 1)
|
}
|
if (!del) {
|
this.componentData.do.splice(0, 1)
|
}
|
this.outPower = out
|
this.addPower = add
|
},
|
handleDown() {
|
if (this.mutilSelect.length == 0) {
|
this.$message.warning('请选择要导出的数据')
|
return
|
}
|
// html导出为word,样子太丑了,代码先放着吧
|
// exportHtmlToWord(this.$refs.content,'检验报告发放登记表')
|
this.outLoading = true
|
exportProcessReport({ ids: this.mutilSelect.map(m => m.id) }).then(res => {
|
this.outLoading = false
|
if (res.code === 201) return
|
this.$message.success('导出成功')
|
const url = this.javaApi + '/word/' + res.message;
|
this.$download.saveAs(url, "报告结果");
|
})
|
},
|
openAdd() {
|
this.title = '新增'
|
this.addInfo = {
|
signatory: []
|
}
|
this.addDialogVisible = true;
|
},
|
refreshTable() {
|
this.$refs['ValueTable'].selectList()
|
},
|
refresh() {
|
this.componentData.entity = this.HaveJson(this.entityCopy)
|
this.upIndex++
|
this.refreshTable()
|
},
|
getAuthorizedPerson() {
|
selectUserCondition().then(res => {
|
let data = []
|
res.data.forEach(a => {
|
data.push({
|
label: a.name,
|
value: a.id
|
})
|
})
|
this.personList = data
|
})
|
},
|
handleAdd() {
|
this.addLoading = true
|
delete this.addInfo.createTime
|
delete this.addInfo.createUser
|
delete this.addInfo.updateTime
|
delete this.addInfo.signatoryUrl
|
delete this.addInfo.updateUserer
|
delete this.addInfo.sendUserName
|
let addInfo = this.HaveJson(this.addInfo)
|
addInfo.signatory = addInfo.signatory.join(',')
|
if (this.title == '新增') {
|
addProcessReport(addInfo).then(res => {
|
this.addLoading = false
|
if (res.code == 201) {
|
return
|
}
|
this.addDialogVisible = false
|
this.$message({
|
type: 'success',
|
message: '操作成功!'
|
});
|
this.refreshTable()
|
}).catch(err => { })
|
} else {
|
doProcessReport(addInfo).then(res => {
|
this.addLoading = false
|
if (res.code == 201) {
|
return
|
}
|
this.addDialogVisible = false
|
this.$message({
|
type: 'success',
|
message: '操作成功!'
|
});
|
this.refreshTable()
|
}).catch(err => { })
|
}
|
},
|
handleWork(row) {
|
this.title = '修改'
|
this.addInfo = row
|
console.log(this.addInfo)
|
this.addInfo.signatory = this.addInfo.signatory ? this.addInfo.signatory.split(',').map(m => Number(m)) : []
|
this.addDialogVisible = true;
|
},
|
handleChangeTask(list) {
|
this.mutilSelect = list
|
}
|
}
|
}
|
</script>
|
|
<style scoped>
|
.title {
|
height: 60px;
|
line-height: 60px;
|
}
|
|
.search {
|
background-color: #fff;
|
height: 80px;
|
display: flex;
|
align-items: center;
|
}
|
|
.search_thing {
|
width: 350px;
|
display: flex;
|
align-items: center;
|
}
|
|
.search_label {
|
width: 110px;
|
font-size: 14px;
|
text-align: right;
|
}
|
|
.search_input {
|
width: calc(100% - 110px);
|
}
|
|
.table {
|
margin-top: 10px;
|
background-color: #fff;
|
width: calc(100% - 40px);
|
height: calc(100% - 60px - 80px - 10px - 40px);
|
padding: 20px;
|
}
|
|
.tables {
|
table-layout: fixed;
|
width: 100%;
|
margin-top: 10px;
|
}
|
|
.tables td {
|
height: 40px;
|
width: 100px;
|
text-align: center;
|
font-size: 14px;
|
word-wrap: break-word;
|
white-space: normal;
|
}
|
|
.en {
|
font-size: 12px;
|
word-break: break-word;
|
/* 自动断行 */
|
overflow-wrap: break-word;
|
/* 防止溢出 */
|
white-space: normal;
|
/* 默认换行 */
|
}
|
</style>
|