<template>
|
<div class="work-time-config">
|
<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.number"
|
@keyup.enter.native="refreshTable()"
|
></el-input>
|
</div>
|
</div>
|
<div class="search_thing">
|
<div class="search_label">实验室:</div>
|
<el-select
|
v-model="queryParams.laboratory"
|
placeholder="全部"
|
size="small"
|
@change="refreshTable()"
|
clearable
|
>
|
<el-option
|
v-for="item in laboratoryList"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value"
|
>
|
</el-option>
|
</el-select>
|
</div>
|
<div class="search_thing">
|
<div class="search_label">部门:</div>
|
<div class="search_input">
|
<el-input
|
size="small"
|
placeholder="请输入"
|
clearable
|
v-model="queryParams.department"
|
@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>
|
<el-button
|
size="small"
|
type="primary"
|
style="position: absolute; right: 50px"
|
@click="openAdd"
|
>新 增</el-button
|
>
|
</div>
|
<div class="table">
|
<lims-table
|
:tableData="tableData"
|
:column="column"
|
:page="page"
|
:tableLoading="tableLoading"
|
:height="'calc(100vh - 150px)'"
|
@pagination="pagination"
|
></lims-table>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import ValueTable from "@/components/Table/value-table.vue";
|
import limsTable from "@/components/Table/lims-table.vue";
|
import { checkPermi } from "@/utils/permission"; // 权限判断函数
|
import {
|
selectAuxiliaryWorkingHours,
|
insertAuxiliaryWorkingHoursDay,
|
obtainItemParameterList,
|
} from "@/api/performance/manHour";
|
export default {
|
components: {
|
ValueTable,
|
limsTable,
|
},
|
data() {
|
return {
|
laboratoryList: [],
|
partList: [],
|
addPower: true,
|
queryParams: {},
|
tableData: [],
|
column: [
|
{ label: "编号", prop: "number" },
|
{ label: "辅助项目名称", prop: "auxiliaryProject", width: "120px" },
|
{ label: "实验室", prop: "laboratory" },
|
{ label: "单位", prop: "unit" },
|
{ label: "核准工时", prop: "approvedWorkingHour" },
|
{ label: "部门", prop: "department" },
|
{ label: "备注", prop: "remarks" },
|
{
|
dataType: "action",
|
fixed: "right",
|
label: "操作",
|
width: "160px",
|
operation: [
|
{
|
name: "编辑",
|
type: "text",
|
clickFun: (row) => {
|
this.handleEdit(row);
|
},
|
showHide: (row) => {
|
return this.checkPermi(["standard:model:edit"]);
|
},
|
},
|
{
|
name: "删除",
|
type: "text",
|
clickFun: (row) => {
|
this.handleDelete(row);
|
},
|
showHide: (row) => {
|
return this.checkPermi(["standard:model:del"]);
|
},
|
},
|
],
|
},
|
],
|
page: {
|
total: 0,
|
size: 10,
|
current: 0,
|
},
|
tableLoading: false,
|
unitList: [],
|
};
|
},
|
mounted() {
|
this.entityCopy = this.HaveJson(this.componentData.entity);
|
this.getPower();
|
this.obtainItemParameterList();
|
this.selectEnumByCategoryForUnit();
|
},
|
methods: {
|
checkPermi,
|
getList() {
|
this.tableLoading = true;
|
let param = { ...this.queryParams, ...this.page };
|
delete param.total;
|
selectAuxiliaryWorkingHours({ ...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(current, size) {
|
this.page.current = current;
|
this.getList();
|
},
|
refresh() {
|
this.queryParams = {};
|
this.page.current = 1;
|
this.getList();
|
},
|
refreshTable() {
|
this.page.current = 1;
|
this.getList();
|
},
|
getPower(radio) {
|
let power = JSON.parse(sessionStorage.getItem("power"));
|
let up = false;
|
let del = false;
|
let add = false;
|
for (var i = 0; i < power.length; i++) {
|
if (power[i].menuMethod == "upDeviceParameter") {
|
up = true;
|
}
|
if (power[i].menuMethod == "delDeviceParameter") {
|
del = true;
|
}
|
if (power[i].menuMethod == "addDeviceParameter") {
|
add = true;
|
}
|
}
|
if (!up) {
|
this.componentData.do.splice(1, 1);
|
}
|
if (!del) {
|
this.componentData.do.splice(0, 1);
|
}
|
this.addPower = add;
|
},
|
openAdd() {
|
// this.$refs.ValueTable0.openAddDia(
|
// this.$api.auxiliaryWorkingHours.insertAuxiliaryWorkingHours
|
// );
|
},
|
obtainItemParameterList() {
|
obtainItemParameterList().then((res) => {
|
let data = [];
|
res.data.forEach((a) => {
|
data.push({
|
label: a.laboratoryName,
|
value: a.id,
|
});
|
});
|
this.laboratoryList = data;
|
});
|
},
|
selectEnumByCategoryForUnit() {
|
this.getDicts("sys_unit").then((response) => {
|
this.unitList = response.data;
|
});
|
},
|
},
|
};
|
</script>
|
|
<style scoped>
|
.work-time-config {
|
height: 100%;
|
}
|
.search {
|
background-color: #fff;
|
height: 80px;
|
display: flex;
|
align-items: center;
|
}
|
|
.search_thing {
|
width: 250px;
|
display: flex;
|
align-items: center;
|
}
|
|
.search_label {
|
width: 70px;
|
font-size: 14px;
|
text-align: right;
|
}
|
|
.search_input {
|
width: calc(100% - 70px);
|
}
|
.table {
|
margin-top: 10px;
|
background-color: #fff;
|
width: calc(100% - 40px);
|
height: calc(100% - 60px - 80px - 10px - 24px);
|
padding: 20px;
|
}
|
</style>
|