fix: 性能检验列表展示用户名

This commit is contained in:
caoqianming 2024-01-25 10:05:25 +08:00
parent 5c5a0bafc0
commit 0a12e323f9
1 changed files with 105 additions and 120 deletions

View File

@ -5,16 +5,8 @@
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'ptest.create'">新增</el-button> <el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'ptest.create'">新增</el-button>
</div> </div>
<div class="right-panel"> <div class="right-panel">
<el-date-picker <el-date-picker v-model="query.test_date" type="date" value-format="YYYY-MM-DD" />
v-model="query.test_date" <el-button type="primary" icon="el-icon-search" @click="handleQuery">查询</el-button>
type="date"
value-format="YYYY-MM-DD"
/>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
>查询</el-button>
</div> </div>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
@ -36,51 +28,44 @@
</el-tabs> </el-tabs>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<scTable <scTable ref="table" :data="tableData" :apiObj="apiObj" row-key="id" stripe :params="query">
ref="table" <el-table-column type="index" width="50" />
:data="tableData"
:apiObj="apiObj"
row-key="id"
stripe
:params="query"
>
<el-table-column type="index" width="50"/>
<el-table-column label="实验日期" prop="test_date" show-overflow-tooltip> <el-table-column label="实验日期" prop="test_date" show-overflow-tooltip>
</el-table-column> </el-table-column>
<el-table-column label="样品编号" prop="sample_number"> <el-table-column label="样品编号" prop="sample_number">
</el-table-column> </el-table-column>
<el-table-column label="样品厚度/mm" prop="val_hd" v-if="activeName=='透过率'"> <el-table-column label="样品厚度/mm" prop="val_hd" v-if="activeName == '透过率'">
</el-table-column> </el-table-column>
<el-table-column label="型号规格" prop="specification" v-if="activeName=='中温粘度'||activeName=='膨胀'"> <el-table-column label="型号规格" prop="specification" v-if="activeName == '中温粘度' || activeName == '膨胀'">
</el-table-column> </el-table-column>
<el-table-column label="样品数量" prop="sample_count" v-if="activeName=='析晶'"> <el-table-column label="样品数量" prop="sample_count" v-if="activeName == '析晶'">
</el-table-column> </el-table-column>
<el-table-column label="样品密度" prop="sample_density" v-if="activeName=='高温粘度'"> <el-table-column label="样品密度" prop="sample_density" v-if="activeName == '高温粘度'">
</el-table-column> </el-table-column>
<el-table-column label="检验员" prop="test_user" show-overflow-tooltip> <el-table-column label="检验员" prop="test_user_name" show-overflow-tooltip>
</el-table-column> </el-table-column>
<el-table-column label="实验温度及保温时间" prop="sample_number" v-if="activeName=='析晶'"> <el-table-column label="实验温度及保温时间" prop="sample_number" v-if="activeName == '析晶'">
</el-table-column> </el-table-column>
<el-table-column label="升至最高温度/℃" prop="val_zgwd" v-if="activeName=='高温粘度'"> <el-table-column label="升至最高温度/℃" prop="val_zgwd" v-if="activeName == '高温粘度'">
</el-table-column> </el-table-column>
<el-table-column label="仪器状态" prop="factory" show-overflow-tooltip> <el-table-column label="仪器状态" prop="factory" show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
<el-tag>{{ state_[scope.row.equip_state] }}</el-tag> <el-tag>{{ state_[scope.row.equip_state] }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="折射率(589nm)" prop="val_zsl" v-if="activeName=='折射率'"> <el-table-column label="折射率(589nm)" prop="val_zsl" v-if="activeName == '折射率'">
</el-table-column> </el-table-column>
<el-table-column label="透过率(550nm)" prop="val_tgl" v-if="activeName=='透过率'"> <el-table-column label="透过率(550nm)" prop="val_tgl" v-if="activeName == '透过率'">
</el-table-column> </el-table-column>
<el-table-column label="Ts/℃" prop="val_ts" v-if="activeName=='中温粘度'"> <el-table-column label="Ts/℃" prop="val_ts" v-if="activeName == '中温粘度'">
</el-table-column> </el-table-column>
<el-table-column label="30-300℃膨胀系数" prop="val_pzxs" v-if="activeName=='膨胀'"> <el-table-column label="30-300℃膨胀系数" prop="val_pzxs" v-if="activeName == '膨胀'">
</el-table-column> </el-table-column>
<el-table-column label="Tg/℃" prop="val_tg" v-if="activeName=='膨胀'"> <el-table-column label="Tg/℃" prop="val_tg" v-if="activeName == '膨胀'">
</el-table-column> </el-table-column>
<el-table-column label="Tf/℃" prop="val_tf" v-if="activeName=='膨胀'"> <el-table-column label="Tf/℃" prop="val_tf" v-if="activeName == '膨胀'">
</el-table-column> </el-table-column>
<el-table-column label="析晶" prop="val_xj" v-if="activeName=='析晶'"> <el-table-column label="析晶" prop="val_xj" v-if="activeName == '析晶'">
<template #default="scope"> <template #default="scope">
<el-tag>{{ state_xj[scope.row.val_xj] }}</el-tag> <el-tag>{{ state_xj[scope.row.val_xj] }}</el-tag>
</template> </template>
@ -95,10 +80,10 @@
</scTable> </scTable>
</el-main> </el-main>
</el-container> </el-container>
</el-main> </el-main>
<save-dialog v-if="visible" ref="saveDialog" :activeName="activeName" :activeId="activeId" <save-dialog v-if="visible" ref="saveDialog" :activeName="activeName" :activeId="activeId" @success="handleSuccess"
@success="handleSuccess" @closed="visible = false"> @closed="visible = false">
</save-dialog> </save-dialog>
<!-- <el-dialog <!-- <el-dialog
title="上传" title="上传"
@ -135,92 +120,92 @@
</template> </template>
<script> <script>
import saveDialog from './behavior_form.vue'; import saveDialog from './behavior_form.vue';
export default { export default {
name: "rparty", name: "rparty",
components:{ saveDialog }, components: { saveDialog },
data() { data() {
return { return {
apiObj: null, apiObj: null,
query: { query: {
testitem:'', testitem: '',
test_date:'' test_date: ''
}, },
state_:{ state_: {
'R':'正常', 'R': '正常',
'T':'异常' 'T': '异常'
}, },
state_xj:{ state_xj: {
'S':'析晶', 'S': '析晶',
'K':'不析晶', 'K': '不析晶',
'θ':'未化' 'θ': '未化'
}, },
form:{ form: {
file:'', file: '',
fileName:'', fileName: '',
}, },
rules: { rules: {
file:[{required:true, message:'请上传上传文件', trigger: "blur"}] file: [{ required: true, message: '请上传上传文件', trigger: "blur" }]
}, },
activeId:'3442815297965547520', activeId: '3442815297965547520',
activeName:'折射率', activeName: '折射率',
visible:false, visible: false,
isSaveing:false, isSaveing: false,
selection: [], selection: [],
behaviors:[], behaviors: [],
tableData:[], tableData: [],
}; };
},
mounted() {
this.getTextItem();
},
methods: {
//
getTextItem() {
let that = this;
that.$API.qm.getTestItem.get({ tag: 'performance', page: 0 }).then(res => {
that.behaviors = res;
that.query.testitem = res[0].id;
that.apiObj = that.$API.qm.ptest.list;
})
}, },
mounted(){ handleClick(val) {
this.getTextItem(); this.activeId = val.props.name;
this.activeName = val.props.label;
this.query.testitem = val.props.name;
this.$refs.table.refresh();
}, },
methods: { add() {
// this.visible = true;
getTextItem(){ this.$nextTick(() => {
let that = this; this.$refs.saveDialog.open("add");
that.$API.qm.getTestItem.get({tag:'performance',page:0}).then(res=>{ });
that.behaviors = res; },
that.query.testitem = res[0].id; importInspect() {
that.apiObj = that.$API.qm.ptest.list; this.visible = true;
}) },
}, submitFile() {
handleClick(val){
this.activeId = val.props.name;
this.activeName = val.props.label;
this.query.testitem = val.props.name;
this.$refs.table.refresh();
},
add(){
this.visible = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("add");
});
},
importInspect(){
this.visible = true;
},
submitFile(){
},
closeVisible(){
this.visible = false;
},
handleSuccess(){
this.visible = false;
this.$refs.table.refresh();
},
//
table_show(row) {
this.visible = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("show").setData(row);
});
},
handleQuery() {
this.$refs.table.queryData(this.query)
},
resetQuery() {
this.query = {};
},
}, },
}; closeVisible() {
this.visible = false;
},
handleSuccess() {
this.visible = false;
this.$refs.table.refresh();
},
//
table_show(row) {
this.visible = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("show").setData(row);
});
},
handleQuery() {
this.$refs.table.queryData(this.query)
},
resetQuery() {
this.query = {};
},
},
};
</script> </script>