| | |
| | | <template> |
| | | <div class="work-time-config"> |
| | | <div class="capacity-scope"> |
| | | <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> |
| | | <el-form :model="queryParams" ref="queryParams" size="small" :inline="true"> |
| | | <el-form-item label="编号" prop="number"> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="queryParams.number" |
| | | @keyup.enter.native="refreshTable()"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="实验室" prop="laboratory"> |
| | | <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> |
| | | </el-form-item> |
| | | <el-form-item label="部门" prop="department"> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="queryParams.department" |
| | | @keyup.enter.native="refreshTable()"></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" size="mini" @click="refreshTable">查询</el-button> |
| | | <el-button size="mini" @click="refresh">重置</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </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> |
| | | <el-button size="small" type="primary" @click="openAdd('新增')" |
| | | v-if="checkPermi(['performance:manHour:workTimeConfig:add'])">新 增</el-button> |
| | | </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> |
| | | <lims-table :tableData="tableData" :column="column" :tableLoading="tableLoading" :height="'calc(100vh - 290px)'" |
| | | :page="page" @pagination="pagination"></lims-table> |
| | | </div> |
| | | <!-- 新增/编辑 --> |
| | | <el-dialog :title="title" :visible.sync="timeDia" width="500px"> |
| | | <el-form :model="timeForm" ref="timeForm" :rules="timeRules" label-position="right" label-width="120px"> |
| | | <el-form-item label="编号" prop="number"> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="timeForm.number"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="辅助项目名称" prop="auxiliaryProject"> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="timeForm.auxiliaryProject"> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="部门" prop="department"> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="timeForm.department"> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="实验室" prop="laboratory"> |
| | | <el-select v-model="timeForm.laboratory" size="small" clearable placeholder="请选择" style="width: 100%"> |
| | | <el-option v-for="item in laboratoryList" :key="item.value" :label="item.label" :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="单位" prop="unit"> |
| | | <el-select v-model="timeForm.unit" size="small" clearable placeholder="请选择" style="width: 100%"> |
| | | <el-option v-for="item in unitList" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="核准工时" prop="approvedWorkingHour"> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="timeForm.approvedWorkingHour"> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="备注" prop="remarks"> |
| | | <el-input size="small" placeholder="请输入" type="textarea" :rows="2" clearable v-model="timeForm.remarks"> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="timeDia = false">取 消</el-button> |
| | | <el-button :loading="uploading" type="primary" @click="submitProduct('timeForm')">确 认</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </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, |
| | | insertAuxiliaryWorkingHours, |
| | | obtainItemParameterList, |
| | | upAuxiliaryWorkingHours, |
| | | deleteAuxiliaryWorkingHours, |
| | | } from "@/api/performance/manHour"; |
| | | export default { |
| | | components: { |
| | | ValueTable, |
| | | limsTable, |
| | | }, |
| | | dicts: ["sys_unit"], |
| | | data() { |
| | | return { |
| | | laboratoryList: [], |
| | | partList: [], |
| | | addPower: true, |
| | | queryParams: {}, |
| | | tableData: [], |
| | | column: [ |
| | | { label: "编号", prop: "number" }, |
| | | { label: "辅助项目名称", prop: "auxiliaryProject", width: "120px" }, |
| | | { label: "实验室", prop: "laboratory" }, |
| | | { |
| | | 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: "操作", |
| | | width: "160px", |
| | | operation: [ |
| | | { |
| | | name: "编辑", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleEdit(row); |
| | | this.openAdd("编辑", row); |
| | | }, |
| | | showHide: (row) => { |
| | | return this.checkPermi(["standard:model:edit"]); |
| | | return this.checkPermi([ |
| | | "performance:manHour:workTimeConfig:edit", |
| | | ]); |
| | | }, |
| | | }, |
| | | { |
| | |
| | | this.handleDelete(row); |
| | | }, |
| | | showHide: (row) => { |
| | | return this.checkPermi(["standard:model:del"]); |
| | | return this.checkPermi([ |
| | | "performance:manHour:workTimeConfig:del", |
| | | ]); |
| | | }, |
| | | }, |
| | | ], |
| | |
| | | ], |
| | | page: { |
| | | total: 0, |
| | | size: 10, |
| | | size: 20, |
| | | current: 0, |
| | | }, |
| | | tableLoading: false, |
| | | unitList: [], |
| | | title: "新增", |
| | | timeDia: false, |
| | | timeForm: {}, |
| | | timeRules: { |
| | | number: [{ required: true, message: "请输入编号", trigger: "blur" }], |
| | | auxiliaryProject: [ |
| | | { required: true, message: "请输入辅助项目名称", trigger: "blur" }, |
| | | ], |
| | | laboratory: [ |
| | | { required: true, message: "请选择实验室", trigger: "change" }, |
| | | ], |
| | | unit: [{ required: true, message: "请选择单位", trigger: "change" }], |
| | | approvedWorkingHour: [ |
| | | { required: true, message: "请输入核准工时", trigger: "blur" }, |
| | | ], |
| | | }, |
| | | uploading: false, |
| | | }; |
| | | }, |
| | | mounted() { |
| | | this.entityCopy = this.HaveJson(this.componentData.entity); |
| | | this.getPower(); |
| | | this.obtainItemParameterList(); |
| | | this.selectEnumByCategoryForUnit(); |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | checkPermi, |
| | | getList() { |
| | | this.tableLoading = true; |
| | | let param = { ...this.queryParams, ...this.page }; |
| | |
| | | this.tableLoading = false; |
| | | }); |
| | | }, |
| | | pagination(current, size) { |
| | | this.page.current = current; |
| | | pagination({ page, limit }) { |
| | | this.page.current = page; |
| | | this.page.size = limit; |
| | | this.getList(); |
| | | }, |
| | | refresh() { |
| | |
| | | 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; |
| | | } |
| | | openAdd(title, row) { |
| | | this.title = title; |
| | | if (row) { |
| | | this.timeForm = row; |
| | | this.timeForm.laboratory = Number(this.timeForm.laboratory); |
| | | } else { |
| | | this.timeForm = {}; |
| | | } |
| | | 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 |
| | | // ); |
| | | this.timeDia = true; |
| | | }, |
| | | obtainItemParameterList() { |
| | | obtainItemParameterList().then((res) => { |
| | |
| | | this.unitList = response.data; |
| | | }); |
| | | }, |
| | | submitProduct(formName) { |
| | | this.$refs[formName].validate((valid) => { |
| | | if (valid) { |
| | | this.uploading = true; |
| | | if (this.title == "新增") { |
| | | insertAuxiliaryWorkingHours(this.timeForm) |
| | | .then((res) => { |
| | | this.uploading = false; |
| | | if (res.code != 200) { |
| | | return; |
| | | } |
| | | this.$message.success("提交成功"); |
| | | this.refresh(); |
| | | this.timeDia = false; |
| | | }) |
| | | .catch((err) => { |
| | | this.uploading = false; |
| | | }); |
| | | } else { |
| | | upAuxiliaryWorkingHours(this.timeForm) |
| | | .then((res) => { |
| | | this.uploading = false; |
| | | if (res.code != 200) { |
| | | return; |
| | | } |
| | | this.$message.success("提交成功"); |
| | | this.refresh(); |
| | | this.timeDia = false; |
| | | }) |
| | | .catch((err) => { |
| | | this.uploading = false; |
| | | }); |
| | | } |
| | | } else { |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | handleDelete(row) { |
| | | this.$confirm("是否删除该条数据?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | deleteAuxiliaryWorkingHours({ id: row.id }).then((res) => { |
| | | if (res.code == 200){ |
| | | this.$message.success("删除成功"); |
| | | this.refresh(); |
| | | } |
| | | }); |
| | | }) |
| | | .catch(() => { }); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .work-time-config { |
| | | height: 100%; |
| | | } |
| | | .search { |
| | | background-color: #fff; |
| | | height: 80px; |
| | | height: 46px; |
| | | 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; |
| | | justify-content: space-between; |
| | | } |
| | | </style> |