fix:性能检验加一个编号搜索

This commit is contained in:
shijing 2024-04-01 15:09:09 +08:00
parent 29de95414a
commit 142233e6c0
1 changed files with 325 additions and 187 deletions

View File

@ -1,16 +1,37 @@
<template> <template>
<el-container> <el-container>
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'ptest.create'">新增</el-button> <el-button
</div> type="primary"
<div class="right-panel"> icon="el-icon-plus"
<el-date-picker v-model="query.test_date" type="date" value-format="YYYY-MM-DD" /> @click="add"
<el-button type="primary" icon="el-icon-search" @click="handleQuery">查询</el-button> v-auth="'ptest.create'"
</div> >新增</el-button
</el-header> >
<el-main class="nopadding"> </div>
<!-- <el-radio-group v-model="radio1" class="ml-4"> <div class="right-panel">
<el-date-picker
v-model="query.test_date"
type="date"
value-format="YYYY-MM-DD"
/>
<el-input
v-model="query.search"
placeholder="编号"
clearable
style="width: 200px"
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
>查询</el-button
>
</div>
</el-header>
<el-main class="nopadding">
<!-- <el-radio-group v-model="radio1" class="ml-4">
<el-radio <el-radio
v-for="item in behaviors" v-for="item in behaviors"
:key="item.id" :key="item.id"
@ -20,75 +41,186 @@
{{ item.name }} {{ item.name }}
</el-radio> </el-radio>
</el-radio-group> --> </el-radio-group> -->
<el-container> <el-container>
<el-header style="padding:13px 15px 7px;"> <el-header style="padding: 13px 15px 7px">
<el-tabs v-model="activeId" class="demo-tabs" @tab-click="handleClick" type="card"> <el-tabs
<el-tab-pane v-for="item in behaviors" v-bind:key="item.id" :label="item.name" :name="item.id"> v-model="activeId"
</el-tab-pane> class="demo-tabs"
</el-tabs> @tab-click="handleClick"
</el-header> type="card"
<el-main class="nopadding"> >
<scTable ref="table" :data="tableData" :apiObj="apiObj" row-key="id" stripe :params="query"> <el-tab-pane
<el-table-column type="index" width="50" /> v-for="item in behaviors"
<el-table-column label="实验日期" prop="test_date" show-overflow-tooltip> v-bind:key="item.id"
</el-table-column> :label="item.name"
<el-table-column label="样品编号" prop="sample_number"> :name="item.id"
</el-table-column> >
<el-table-column label="样品厚度/mm" prop="val_hd" v-if="activeName == '透过率'"> </el-tab-pane>
</el-table-column> </el-tabs>
<el-table-column label="型号规格" prop="specification" </el-header>
v-if="activeName == '中温粘度' || activeName == '膨胀'"> <el-main class="nopadding">
</el-table-column> <scTable
<el-table-column label="样品数量" prop="sample_count" v-if="activeName == '析晶'"> ref="table"
</el-table-column> :data="tableData"
<el-table-column label="样品密度" prop="sample_density" v-if="activeName == '高温粘度'"> :apiObj="apiObj"
</el-table-column> row-key="id"
<el-table-column label="检验员" prop="test_user_name" show-overflow-tooltip> stripe
</el-table-column> :params="query"
<el-table-column label="实验温度及保温时间" prop="sample_number" v-if="activeName == '析晶'"> >
</el-table-column> <el-table-column type="index" width="50" />
<el-table-column label="升至最高温度/℃" prop="val_zgwd" v-if="activeName == '高温粘度'"> <el-table-column
</el-table-column> label="实验日期"
<el-table-column label="仪器状态" prop="factory" show-overflow-tooltip> prop="test_date"
<template #default="scope"> show-overflow-tooltip
<el-tag>{{ state_[scope.row.equip_state] }}</el-tag> >
</template> </el-table-column>
</el-table-column> <el-table-column label="样品编号" prop="sample_number">
<el-table-column label="折射率(589nm)" prop="val_zsl" v-if="activeName == '折射率'"> </el-table-column>
</el-table-column> <el-table-column
<el-table-column label="透过率(550nm)" prop="val_tgl" v-if="activeName == '透过率'"> label="样品厚度/mm"
</el-table-column> prop="val_hd"
<el-table-column label="Ts/℃" prop="val_ts" v-if="activeName == '中温粘度'"> v-if="activeName == '透过率'"
</el-table-column> >
<el-table-column label="30-300℃膨胀系数" prop="val_pzxs" v-if="activeName == '膨胀'"> </el-table-column>
</el-table-column> <el-table-column
<el-table-column label="Tg/℃" prop="val_tg" v-if="activeName == '膨胀'"> label="型号规格"
</el-table-column> prop="specification"
<el-table-column label="Tf/℃" prop="val_tf" v-if="activeName == '膨胀'"> v-if="
</el-table-column> activeName == '中温粘度' || activeName == '膨胀'
<el-table-column label="析晶" prop="val_xj" v-if="activeName == '析晶'"> "
<template #default="scope"> >
<el-tag>{{ state_xj[scope.row.val_xj] }}</el-tag> </el-table-column>
</template> <el-table-column
</el-table-column> label="样品数量"
<el-table-column label="操作" fixed="right" width="160"> prop="sample_count"
<template #default="scope"> v-if="activeName == '析晶'"
<el-link type="primary" @click="table_edit(scope.row)" v-auth="'ptest.update'">编辑</el-link> >
<el-divider direction="vertical" v-auth="'ptest.update'"></el-divider> </el-table-column>
<el-link type="primary" @click="table_show(scope.row)">查看</el-link> <el-table-column
<el-divider direction="vertical" v-auth="'ptest.delete'"></el-divider> label="样品密度"
<el-link type="danger" @click="table_del(scope.row)" v-auth="'ptest.delete'">删除</el-link> prop="sample_density"
</template> v-if="activeName == '高温粘度'"
</el-table-column> >
</scTable> </el-table-column>
</el-main> <el-table-column
</el-container> label="检验员"
prop="test_user_name"
</el-main> show-overflow-tooltip
<save-dialog v-if="visible" ref="saveDialog" :activeName="activeName" :activeId="activeId" @success="handleSuccess" >
@closed="visible = false"> </el-table-column>
</save-dialog> <el-table-column
<!-- <el-dialog label="实验温度及保温时间"
prop="sample_number"
v-if="activeName == '析晶'"
>
</el-table-column>
<el-table-column
label="升至最高温度/℃"
prop="val_zgwd"
v-if="activeName == '高温粘度'"
>
</el-table-column>
<el-table-column
label="仪器状态"
prop="factory"
show-overflow-tooltip
>
<template #default="scope">
<el-tag>{{
state_[scope.row.equip_state]
}}</el-tag>
</template>
</el-table-column>
<el-table-column
label="折射率(589nm)"
prop="val_zsl"
v-if="activeName == '折射率'"
>
</el-table-column>
<el-table-column
label="透过率(550nm)"
prop="val_tgl"
v-if="activeName == '透过率'"
>
</el-table-column>
<el-table-column
label="Ts/℃"
prop="val_ts"
v-if="activeName == '中温粘度'"
>
</el-table-column>
<el-table-column
label="30-300℃膨胀系数"
prop="val_pzxs"
v-if="activeName == '膨胀'"
>
</el-table-column>
<el-table-column
label="Tg/℃"
prop="val_tg"
v-if="activeName == '膨胀'"
>
</el-table-column>
<el-table-column
label="Tf/℃"
prop="val_tf"
v-if="activeName == '膨胀'"
>
</el-table-column>
<el-table-column
label="析晶"
prop="val_xj"
v-if="activeName == '析晶'"
>
<template #default="scope">
<el-tag>{{
state_xj[scope.row.val_xj]
}}</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="160">
<template #default="scope">
<el-link
type="primary"
@click="table_edit(scope.row)"
v-auth="'ptest.update'"
>编辑</el-link
>
<el-divider
direction="vertical"
v-auth="'ptest.update'"
></el-divider>
<el-link
type="primary"
@click="table_show(scope.row)"
>查看</el-link
>
<el-divider
direction="vertical"
v-auth="'ptest.delete'"
></el-divider>
<el-link
type="danger"
@click="table_del(scope.row)"
v-auth="'ptest.delete'"
>删除</el-link
>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</el-main>
<save-dialog
v-if="visible"
ref="saveDialog"
:activeName="activeName"
:activeId="activeId"
@success="handleSuccess"
@closed="visible = false"
>
</save-dialog>
<!-- <el-dialog
title="上传" title="上传"
destroy-on-close destroy-on-close
v-model="visible" v-model="visible"
@ -119,113 +251,119 @@
<el-button @click="visible = false">取消</el-button> <el-button @click="visible = false">取消</el-button>
</el-footer> </el-footer>
</el-dialog> --> </el-dialog> -->
</el-container> </el-container>
</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: [
}, {
activeId: '3442815297965547520', required: true,
activeName: '折射率', message: "请上传上传文件",
visible: false, trigger: "blur",
isSaveing: false, },
selection: [], ],
behaviors: [], },
tableData: [], activeId: "3442815297965547520",
}; activeName: "折射率",
}, visible: false,
mounted() { isSaveing: false,
this.getTextItem(); selection: [],
}, behaviors: [],
methods: { tableData: [],
// };
getTextItem() { },
let that = this; mounted() {
that.$API.qm.getTestItem.get({ tag: 'performance', page: 0 }).then(res => { this.getTextItem();
that.behaviors = res; },
that.query.testitem = res[0].id; methods: {
that.apiObj = that.$API.qm.ptest.list; //
}) getTextItem() {
}, let that = this;
handleClick(val) { that.$API.qm.getTestItem
this.activeId = val.props.name; .get({ tag: "performance", page: 0 })
this.activeName = val.props.label; .then((res) => {
this.query.testitem = val.props.name; that.behaviors = res;
this.$refs.table.refresh(); that.query.testitem = res[0].id;
}, that.apiObj = that.$API.qm.ptest.list;
add() { });
this.visible = true; },
this.$nextTick(() => { handleClick(val) {
this.$refs.saveDialog.open("add"); this.activeId = val.props.name;
}); this.activeName = val.props.label;
}, this.query.testitem = val.props.name;
table_edit(row) { this.$refs.table.refresh();
this.visible = true; },
this.$nextTick(() => { add() {
this.$refs.saveDialog.open("edit").setData(row); this.visible = true;
}); this.$nextTick(() => {
}, this.$refs.saveDialog.open("add");
table_del(row) { });
let that = this; },
that.$confirm(`确定删除吗?`, "提示", { table_edit(row) {
type: "warning", this.visible = true;
}).then(() => { this.$nextTick(() => {
that.$API.qm.ptest.delete.req(row.id).then(res => { this.$refs.saveDialog.open("edit").setData(row);
that.$message.success("操作成功"); });
that.$refs.table.refresh(); },
}) table_del(row) {
}) let that = this;
}, that.$confirm(`确定删除吗?`, "提示", {
importInspect() { type: "warning",
this.visible = true; }).then(() => {
}, that.$API.qm.ptest.delete.req(row.id).then((res) => {
submitFile() { that.$message.success("操作成功");
that.$refs.table.refresh();
}, });
closeVisible() { });
this.visible = false; },
}, importInspect() {
handleSuccess() { this.visible = true;
this.visible = false; },
this.$refs.table.refresh(); submitFile() {},
}, closeVisible() {
// this.visible = false;
table_show(row) { },
this.visible = true; handleSuccess() {
this.$nextTick(() => { this.visible = false;
this.$refs.saveDialog.open("show").setData(row); this.$refs.table.refresh();
}); },
}, //
handleQuery() { table_show(row) {
this.$refs.table.queryData(this.query) this.visible = true;
}, this.$nextTick(() => {
resetQuery() { this.$refs.saveDialog.open("show").setData(row);
this.query = {}; });
}, },
}, handleQuery() {
this.$refs.table.queryData(this.query);
},
resetQuery() {
this.query = {};
},
},
}; };
</script> </script>