<template>
|
<div class="contract-review">
|
<div class="search">
|
<div class="search_thing">
|
<div class="search_label">试样名称:</div>
|
<div class="search_input"><el-input v-model="queryParams.sample" clearable placeholder="请输入" size="small"
|
@keyup.enter.native="refreshTable()"></el-input></div>
|
</div>
|
<div class="search_thing">
|
<div class="search_label">委托单位:</div>
|
<div class="search_input">
|
<el-input v-model="queryParams.company" clearable placeholder="请输入" size="small"
|
@keyup.enter.native="refreshTable()"></el-input>
|
</div>
|
</div>
|
<div class="search_thing">
|
<div class="search_label">生产单位:</div>
|
<div class="search_input">
|
<el-input v-model="queryParams.production" clearable placeholder="请输入" size="small"
|
@keyup.enter.native="refreshTable()"></el-input>
|
</div>
|
</div>
|
<div class="search_thing">
|
<div class="search_label">委托人:</div>
|
<div class="search_input">
|
<el-input v-model="queryParams.prepareUser" clearable placeholder="请输入" size="small"
|
@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 - 270px)'"
|
:page="page" @pagination="pagination"></lims-table>
|
<!-- <ValueTable :key="upIndex" ref="ValueTable" :componentData="componentData"
|
:delUrl="$api.processOrder.delProcessOrder" :url="$api.processOrder.pageProcessOrder" /> -->
|
</div>
|
<el-dialog :visible.sync="addDialogVisible" title="补充信息" width="400px">
|
<el-row>
|
<el-col :span="24" style="margin-bottom: 16px;">
|
<div class="search_thing">
|
<div class="search_label">判定规则:</div>
|
<div class="search_input" style="display: flex;align-items: center;">
|
<!-- <el-input size="small" placeholder="请输入" clearable v-model="addInfo.rule"></el-input> -->
|
<el-radio-group v-model="addInfo.rule" size="small" style="width: 60%;">
|
<el-radio label="不考虑不确定度">不考虑不确定度</el-radio>
|
<el-radio label="考虑不确定度">考虑不确定度</el-radio>
|
</el-radio-group>
|
<el-input v-if="addInfo.rule == '考虑不确定度'" v-model="addInfo.num" placeholder="请输入" size="small"
|
style="width: 80px;margin-right: 10px;"></el-input>
|
<span v-if="addInfo.rule == '考虑不确定度'"> %</span>
|
</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.comprehensiveUser" 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-date-picker v-model="addInfo.comprehensiveTime" format="yyyy-MM-dd" placeholder="选择日期" size="small"
|
style="width: 100%;" type="date" value-format="yyyy-MM-dd">
|
</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.issueUser" 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-date-picker v-model="addInfo.issueTime" format="yyyy-MM-dd" placeholder="选择日期" size="small"
|
style="width: 100%;" type="date" value-format="yyyy-MM-dd">
|
</el-date-picker>
|
</div>
|
</div>
|
</el-col>
|
</el-row>
|
<span slot="footer" class="dialog-footer">
|
<el-button @click="addDialogVisible = false">取 消</el-button>
|
<el-button :loading="addLoading" type="primary" @click="handleAdd">确 定</el-button>
|
</span>
|
</el-dialog>
|
<el-dialog :class="{ downPdf: title == '下载' }" :modal="title != '下载'" :title="title"
|
:visible.sync="detailDialogVisible" top="20px" width="900px">
|
<div style="max-height: 75vh;overflow-y: auto;">
|
<div id="dialogBody">
|
<table border="1" cellpadding="10" class="tables heads" style="border: 1px dashed black;">
|
<tr>
|
<td rowspan="2">
|
<img alt="" src="@/assets/images/logo2.png" style="width: 80%;">
|
</td>
|
<td>
|
<p>记录名称:检验委托单</p>
|
<p class="en">Record name: Commission List of Testing</p>
|
</td>
|
<td>
|
<p>保存期限:6年</p>
|
<p class="en">Record retention:6 years</p>
|
</td>
|
</tr>
|
<tr>
|
<td>
|
<p>记录编号: ZTT/QR-16-04-a</p>
|
<p class="en">Record number: ZTT/QR-16-04-a</p>
|
</td>
|
<td>
|
<p>归档部门:综合室</p>
|
<p class="en">Archive department: general office</p>
|
</td>
|
</tr>
|
</table>
|
<h4 style="display: flex;align-items: center;flex-direction: column;justify-content: center;">
|
<span style="font-size: 28px;">检 验 委 托 单</span>
|
<span>Commission List of Testing</span>
|
</h4>
|
<p style="margin-top: 16px;margin-left: 600px;">委托编号:{{ currentInfo.entrustCode }}</p>
|
<p class="en" style="margin-left: 600px;">Report No:{{ currentInfo.entrustCode }}</p>
|
<table border="1" cellpadding="10" class="tables">
|
<tr>
|
<td colspan="2">
|
<p>试样名称</p>
|
<p class="en">Sample name</p>
|
</td>
|
<td>{{ currentInfo.sample }}</td>
|
<td>
|
<p>委托时间</p>
|
<p class="en">Commission date</p>
|
</td>
|
<td colspan="2">{{ currentInfo.createTime }}</td>
|
</tr>
|
<tr>
|
<td colspan="2">
|
<p>型 号</p>
|
<p class="en">Model NO.</p>
|
</td>
|
<td>{{ currentInfo.sampleType }}</td>
|
<td>
|
<p>委托单位</p>
|
<p class="en">Commission unit</p>
|
</td>
|
<td colspan="2">{{ currentInfo.company }}</td>
|
</tr>
|
<tr>
|
<td colspan="2">
|
<p>生产单位</p>
|
<p class="en">Production unit</p>
|
</td>
|
<td>{{ currentInfo.production }}</td>
|
<td>
|
<p>委托人</p>
|
<p class="en">Commission by</p>
|
</td>
|
<td colspan="2">{{ currentInfo.prepareUser }}</td>
|
</tr>
|
<tr>
|
<td colspan="2">
|
<p>样品数量</p>
|
<p class="en">Quantity</p>
|
</td>
|
<td>{{ currentInfo.sampleNum }}</td>
|
<td>
|
<p>样品状态</p>
|
<p class="en">Sample status</p>
|
</td>
|
<td colspan="2">{{
|
insStateList.find(m => m.value == currentInfo.insState) ? insStateList.find(m => m.value ==
|
currentInfo.insState).label : '/'
|
}}</td>
|
</tr>
|
<tr>
|
<td colspan="2">
|
<p>是否留样</p>
|
<p class="en">Reserve sample or not</p>
|
</td>
|
<td>
|
<span v-if="currentInfo.isLeave == 1">是 <span class="en">Yes</span></span>
|
<span v-else>否 <span class="en">No</span></span>
|
</td>
|
<td>
|
<p>样品处理方式</p>
|
<p class="en">Sample treatment</p>
|
</td>
|
<td colspan="2">
|
<span v-if="currentInfo.processing == 0">委托单位取回 <span class="en">Taken away by commission
|
unit</span></span>
|
<span v-else>实验室处理 <span class="en">Laboratory treatment</span></span>
|
</td>
|
</tr>
|
<tr>
|
<td colspan="2">
|
<p>约定完成时间(报告日期)</p>
|
<p class="en">Agreed completion time</p>
|
</td>
|
<td>{{ currentInfo.appointed }}</td>
|
<td>
|
<p>报告发送方式</p>
|
<p class="en">Way of report sending</p>
|
</td>
|
<td colspan="2">
|
<span v-if="currentInfo.send == 1">自取 <span class="en">Taken by themselves</span></span>
|
<span v-else>其他 <span class="en">Other:</span></span>
|
</td>
|
</tr>
|
<tr>
|
<td>
|
<p>序号</p>
|
<p class="en">NO.</p>
|
</td>
|
<td>
|
<p>样品编号</p>
|
<p class="en">Sample number</p>
|
</td>
|
<td>
|
<p>试验项目</p>
|
<p class="en">Test item</p>
|
</td>
|
<td colspan="2">
|
<p>检验依据</p>
|
<p class="en">Test standard</p>
|
</td>
|
<!-- <td>
|
<p>试验要求</p>
|
<p class="en">Test standard</p>
|
</td> -->
|
<td>
|
<p>备注</p>
|
<p class="en">Note</p>
|
</td>
|
</tr>
|
<tr v-for="(item, index) in currentInfo.sampleItems
|
" :key="index">
|
<td>{{ index + 1 }}</td>
|
<td>
|
<p>{{ item.code }}</p>
|
<p>{{ item.model }}</p>
|
</td>
|
<td>{{ item.product }}</td>
|
<td colspan="2">{{ item.standardMethodList }}</td>
|
<!-- <td>{{ item.groupConcatTell }}</td> -->
|
<td>{{ item.remark }}</td>
|
</tr>
|
<tr>
|
<td colspan="2">
|
<p>判定规则</p>
|
<p class="en">Criterion rule</p>
|
</td>
|
<td colspan="4">
|
<span v-if="currentInfo.rule && !currentInfo.rule.includes('-')">不考虑不确定度 <span class="en">Not
|
considering
|
uncertainty</span></span>
|
<span v-else-if="currentInfo.rule && currentInfo.rule.includes('-')">考虑不确定度 <span class="en">Consider
|
uncertainty ( {{ currentInfo.rule.split('-')[1] }}%)</span></span>
|
<span v-else>/</span>
|
</td>
|
</tr>
|
<tr>
|
<td colspan="2">
|
<p>委托人签名</p>
|
<p class="en">Signature of consignor</p>
|
</td>
|
<td>
|
<img :alt="currentInfo.prepareUser" :src="javaApi + '/img/' + currentInfo.prepareUserUrl"
|
style="height: 100%;" />
|
</td>
|
<td>
|
<p>委托日期</p>
|
<p class="en">Date of consignation</p>
|
</td>
|
<td colspan="2">{{ currentInfo.createTime }}</td>
|
</tr>
|
<tr>
|
<td colspan="2">
|
<p>委托人联系电话</p>
|
<p class="en">Contact number</p>
|
</td>
|
<td colspan="4">{{ currentInfo.phone }}</td>
|
</tr>
|
<tr>
|
<td colspan="2">
|
<p>综合室签名</p>
|
<p class="en">Signature of general office</p>
|
</td>
|
<td><img :alt="currentInfo.comprehensiveUser" :src="javaApi + '/img/' + currentInfo.comprehensiveUserUrl"
|
style="height: 100%;" /></td>
|
<td>
|
<p>接收日期</p>
|
<p class="en">Receipt date</p>
|
</td>
|
<td colspan="2">{{ currentInfo.comprehensiveTime }}</td>
|
</tr>
|
<tr>
|
<td colspan="2">
|
<p>领样员签名</p>
|
<p class="en">Signature of sample taker</p>
|
</td>
|
<td><img :alt="currentInfo.issueUser" :src="javaApi + '/img/' + currentInfo.issueUserUrl"
|
style="height: 100%;" /></td>
|
<td>
|
<p>领样日期</p>
|
<p class="en">Sample date</p>
|
</td>
|
<td colspan="2">{{ currentInfo.issueTime }}</td>
|
</tr>
|
<tr>
|
<td colspan="2" rowspan="3">
|
<p>检测机构信息</p>
|
<p class="en">Information about Test center</p>
|
</td>
|
<td colspan="4">
|
<p>江苏中天科技股份有限公司检测中心</p>
|
<p class="en">Test cnter of Jiangsu ZhongtianTechnology CO.,Ltd</p>
|
</td>
|
</tr>
|
<tr>
|
<td colspan="4">
|
<p>地址:江苏省如东县河口镇中天路1号</p>
|
<p class="en">Address:No.1,Zhongtian Village,Hekou Town,Rudong County,Nantong City,JiangsuProvince</p>
|
</td>
|
</tr>
|
<tr>
|
<td colspan="4">
|
<p>电话:0513-84885175</p>
|
<p class="en">Telephone:0513-84885175</p>
|
</td>
|
</tr>
|
</table>
|
<p style="margin-top: 10px;margin-left: 20px;">注:本检验委托单一式二份,一份综合室归档,一份委托单位留存。</p>
|
<p class="en" style="margin-left: 20px;">Note:The commission list of testing is done in duplicate, general
|
office and client shall retain their respective one.</p>
|
</div>
|
</div>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import limsTable from "@/components/Table/lims-table.vue";
|
import {
|
exportInspectionOrder,
|
doProcessOrder,
|
getProcessOrder,
|
delProcessOrder,
|
pageProcessOrder,
|
} from '@/api/cnas/process/demand.js'
|
import { selectUserCondition } from "@/api/system/user";
|
export default {
|
components: {
|
limsTable
|
},
|
data() {
|
return {
|
title: '检验委托单',
|
detailDialogVisible: false,
|
addLoading: false,
|
addDialogVisible: false,
|
outLoading: false,
|
componentData: {
|
entity: {
|
sample: null,
|
company: null,
|
production: null,
|
prepareUser: null,
|
orderBy: {
|
field: 'createTime',
|
order: 'desc'
|
}
|
},
|
isIndex: true,
|
showSelect: false,
|
select: false,
|
do: [{
|
id: 'handleLook',
|
font: '查看',
|
type: 'text',
|
method: 'handleLook'
|
}, {
|
id: 'handleDown',
|
font: '导出',
|
type: 'text',
|
method: 'handleDown'
|
}, {
|
id: 'delete',
|
font: '删除',
|
type: 'text',
|
method: 'doDiy'
|
}, {
|
id: 'handleWork',
|
font: '补充信息',
|
type: 'text',
|
method: 'handleWork'
|
}],
|
tagField: {
|
insState: {
|
select: [
|
{
|
label: '待审核',
|
value: 0
|
}, {
|
label: '待检验',
|
value: 1
|
},
|
{
|
label: '已检验',
|
value: 4
|
},
|
{
|
label: '退回',
|
value: 2
|
},
|
{
|
label: '撤销',
|
value: 3
|
},
|
]
|
},
|
isLeave: {
|
select: [
|
{
|
value: 0,
|
label: '不留样'
|
},
|
{
|
value: 1,
|
label: '留样'
|
},
|
]
|
},
|
processing: {
|
select: [
|
{
|
value: 0,
|
label: '委托单位取回'
|
},
|
{
|
value: 1,
|
label: '实验室处理'
|
},
|
]
|
},
|
},
|
selectField: {
|
sendUser: {
|
select: []
|
},
|
signatory: {
|
select: []
|
},
|
},
|
requiredAdd: [],
|
requiredUp: [],
|
needSort: [],
|
inputType: ''
|
},
|
entityCopy: {},
|
upIndex: 0,
|
currentInfo: {},
|
personList: [],
|
addInfo: {},
|
insStateList: [
|
{
|
label: '待审核',
|
value: 0,
|
type: 'primary'
|
}, {
|
label: '待检验',
|
value: 1,
|
type: 'warning'
|
},
|
{
|
label: '已检验',
|
value: 4,
|
type: 'success'
|
},
|
{
|
label: '退回',
|
value: 2,
|
type: 'danger'
|
},
|
{
|
label: '撤销',
|
value: 3,
|
type: 'info'
|
},
|
],
|
queryParams: {},
|
tableData: [],
|
column: [
|
{ label: "试样名称", prop: "sample" },
|
{ label: "委托时间", prop: "createTime" },
|
{
|
label: "型号",
|
prop: "sampleType",
|
},
|
{ label: "委托单位", prop: "company" },
|
{ label: "生产单位", prop: "production" },
|
{ label: "委托人", prop: "prepareUser" },
|
{ label: "样品数量", prop: "sampleNum" },
|
{
|
label: "样品状态", prop: "insState", dataType: 'tag',
|
formatData: (params) => {
|
return this.insStateList.find((m) => m.value == params).label;
|
},
|
formatType: (params) => {
|
return this.insStateList.find((m) => m.value == params).type;
|
},
|
},
|
{
|
label: "是否留样", prop: "isLeave", dataType: 'tag',
|
formatData: (params) => {
|
if (params == 0) {
|
return '不留样'
|
} else if (params == 1) {
|
return '留样'
|
}
|
},
|
formatType: (params) => {
|
if (params == 0) {
|
return 'warning'
|
} else if (params == 1) {
|
return 'success'
|
}
|
},
|
},
|
{
|
label: "样品处理方式", prop: "processing", dataType: 'tag',
|
formatData: (params) => {
|
if (params == 0) {
|
return '委托单位取回'
|
} else if (params == 1) {
|
return '实验室处理'
|
}
|
},
|
},
|
{
|
dataType: "action",
|
fixed: "right",
|
label: "操作",
|
operation: [
|
{
|
name: "查看",
|
type: "text",
|
clickFun: (row) => {
|
this.handleLook(row);
|
},
|
},
|
{
|
name: "导出",
|
type: "text",
|
clickFun: (row) => {
|
this.handleDown(row);
|
},
|
},
|
{
|
name: "补充信息",
|
type: "text",
|
clickFun: (row) => {
|
this.handleWork(row);
|
},
|
},
|
{
|
name: "删除",
|
type: "text",
|
clickFun: (row) => {
|
this.handleDelete(row);
|
},
|
},
|
],
|
},
|
],
|
page: {
|
total: 0,
|
size: 10,
|
current: 0,
|
},
|
tableLoading: false,
|
};
|
},
|
mounted() {
|
this.getList()
|
this.getAuthorizedPerson()
|
},
|
methods: {
|
getPower() {
|
let power = JSON.parse(sessionStorage.getItem('power'))
|
let del = false
|
for (var i = 0; i < power.length; i++) {
|
if (power[i].menuMethod == 'delProcessOrder') {
|
del = true
|
}
|
}
|
if (!del) {
|
this.componentData.do.splice(2, 1)
|
}
|
},
|
getList() {
|
this.tableLoading = true;
|
let param = { ...this.queryParams, ...this.page };
|
delete param.total;
|
pageProcessOrder({ ...param })
|
.then((res) => {
|
this.tableLoading = false;
|
if (res.code === 200) {
|
this.tableData = res.data.records;
|
this.page.total = res.data.total;
|
}
|
})
|
.catch((err) => {
|
this.tableLoading = false;
|
});
|
},
|
pagination({ page, limit }) {
|
this.page.current = page;
|
this.page.size = limit;
|
this.getList();
|
},
|
refresh() {
|
this.queryParams = {};
|
this.page.current = 1;
|
this.getList();
|
},
|
refreshTable() {
|
this.page.current = 1;
|
this.getList();
|
},
|
// 导出
|
handleDown(row) {
|
exportInspectionOrder({ id: row.id }).then(res => {
|
const blob = new Blob([res], {
|
type: 'application/force-download'
|
})
|
this.$download.saveAs(blob, row.sample + '-' + row.sampleType + '-' + '检验委托单.docx')
|
}).catch(err => {
|
})
|
},
|
// 补充
|
handleWork(row) {
|
this.addInfo = { ...row }
|
this.currentInfo = row;
|
this.addDialogVisible = true;
|
},
|
// 人员列表
|
getAuthorizedPerson() {
|
selectUserCondition().then(res => {
|
let data = []
|
res.data.forEach(a => {
|
data.push({
|
label: a.name,
|
value: a.id
|
})
|
})
|
this.personList = data
|
})
|
},
|
// 补充保存
|
handleAdd() {
|
if (this.addInfo.rule == '考虑不确定度' && !this.addInfo.num) {
|
return this.$message({
|
type: 'error',
|
message: '请输入考虑不确定度'
|
});
|
} else if (this.addInfo.rule == '考虑不确定度' && this.addInfo.num) {
|
this.addInfo.rule = '考虑不确定度-' + this.addInfo.num
|
}
|
this.addLoading = true;
|
doProcessOrder({ id: this.currentInfo.id, ...this.addInfo }).then(res => {
|
this.addLoading = false;
|
if (res.code == 201) {
|
return
|
}
|
this.$message({
|
type: 'success',
|
message: '补充成功'
|
});
|
this.refreshTable()
|
this.addDialogVisible = false;
|
}).catch(err => {
|
})
|
},
|
// 查看
|
handleLook(row) {
|
getProcessOrder({ id: row.id }).then(res => {
|
if (res.code == 200) {
|
this.currentInfo = res.data
|
this.title = '检验委托单';
|
this.detailDialogVisible = true
|
}
|
}).catch(err => {
|
})
|
},
|
handleDelete(row) {
|
this.$confirm("是否删除该条数据?", "提示", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning",
|
})
|
.then(() => {
|
delProcessOrder({ id: row.id }).then((res) => {
|
console.log('res', res)
|
if (res.code == 200) {
|
this.$message.success("删除成功");
|
this.refresh();
|
}
|
});
|
})
|
.catch(() => { });
|
},
|
},
|
}
|
</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 {
|
background-color: #fff;
|
height: calc(100% - 60px - 80px - 10px - 40px);
|
padding: 20px;
|
padding-top: 0;
|
}
|
|
.tables {
|
table-layout: fixed;
|
width: 100%;
|
}
|
|
.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;
|
/* 默认换行 */
|
}
|
|
.heads td {
|
border: 1px dashed black;
|
/* 单元格的虚线 */
|
padding: 8px;
|
text-align: left;
|
}
|
|
.downPdf {
|
opacity: 0 !important;
|
}
|
</style>
|