| | |
| | | <style scoped> |
| | | .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 { |
| | |
| | | </style> |
| | | |
| | | <template> |
| | | <div class="standard_method"> |
| | | <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.code" |
| | | @keyup.enter.native="refreshTable()"></el-input> |
| | | </div> |
| | | <div> |
| | | <el-form :model="queryParams" ref="queryParams" size="small" :inline="true"> |
| | | <el-form-item label="标准编号" prop="code"> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="queryParams.code" |
| | | @keyup.enter.native="refreshTable()"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="标准名称" prop="name"> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="queryParams.name" |
| | | @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> |
| | | <div class="search_input"> |
| | | <el-input size="small" placeholder="请输入" clearable v-model="queryParams.name" |
| | | @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 class="btn"> |
| | | <el-button size="small" @click="$refs.ValueTable.openUpload()" v-if="inPower"> |
| | | <i class="el-icon-upload2" style="color: #3a7bfa"></i> |
| | | <span style="color: #3a7bfa">导入</span></el-button> |
| | | <el-button size="small" type="primary" @click="openAdd" v-if="addPower">新增</el-button> |
| | | <div class="btn" style="padding-top: 0px;"> |
| | | <el-upload ref='upload' style="display: inline;margin-right: 8px" :action="uploadAction" |
| | | :before-upload="beforeUpload" :headers="uploadHeader" :on-error="onError" :on-success="handleSuccessUp" |
| | | :show-file-list="false" accept='.xls,.xlsx'> |
| | | <el-button size="mini" type="primary">导入</el-button> |
| | | </el-upload> |
| | | <el-button size="mini" type="primary" @click="openAdd">新增</el-button> |
| | | </div> |
| | | </div> |
| | | <lims-table :tableData="tableData" :column="column" :page="page" :tableLoading="tableLoading" |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | uploadAction: process.env.VUE_APP_BASE_API + '/standardMethod/importStandardDetails', |
| | | addPower: true, |
| | | title: "新增", |
| | | inPower: true, |
| | |
| | | name: "编辑", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.title = "编辑"; |
| | | this.addForm = row; |
| | | this.addForm.structureTestObjectId = JSON.parse( |
| | | this.addForm.structureTestObjectId |
| | | ); |
| | | this.addDlog = true; |
| | | this.openEdit(row) |
| | | }, |
| | | }, |
| | | { |
| | |
| | | this.queryParams = {}; |
| | | this.getList(); |
| | | }, |
| | | // 权限分配 |
| | | getPower() { |
| | | let power = JSON.parse(sessionStorage.getItem("power")); |
| | | let up = false; |
| | | let del = false; |
| | | let add = false; |
| | | let inPower = false; |
| | | for (var i = 0; i < power.length; i++) { |
| | | if (power[i].menuMethod == "addStandardMethod") { |
| | | add = true; |
| | | } |
| | | if (power[i].menuMethod == "delStandardMethod") { |
| | | del = true; |
| | | } |
| | | if (power[i].menuMethod == "upStandardMethod") { |
| | | up = true; |
| | | } |
| | | if (power[i].menuMethod == "importStandardDetails") { |
| | | inPower = true; |
| | | } |
| | | } |
| | | this.addPower = add; |
| | | this.inPower = inPower; |
| | | }, |
| | | openAdd() { |
| | | this.title = "新增"; |
| | | this.addForm = {}; |
| | | this.addDlog = true; |
| | | }, |
| | | openEdit(row) { |
| | | this.title = "编辑"; |
| | | this.addDlog = true; |
| | | this.addForm = this.HaveJson(row) |
| | | this.addForm.structureTestObjectId = JSON.parse( |
| | | this.addForm.structureTestObjectId |
| | | ); |
| | | }, |
| | | getQualificationList() { |
| | | this.getDicts("cnas_method_qualification").then((response) => { |
| | |
| | | } |
| | | }); |
| | | }, |
| | | // 删除 |
| | | handleDelete(row) { |
| | | this.$confirm("是否删除该条数据?", "提示", { |
| | | confirmButtonText: "确定", |
| | |
| | | }) |
| | | .then(() => { |
| | | delStandardMethod({ id: row.id }).then((res) => { |
| | | if (res.code == 201) return; |
| | | this.$message.success("删除成功"); |
| | | this.getList(); |
| | | }); |
| | | }) |
| | | .catch(() => { }); |
| | | }, |
| | | // 上传文件 |
| | | beforeUpload(file, fileList) { |
| | | if (file.size > 1024 * 1024 * 10) { |
| | | this.$message.error('上传文件不超过10M'); |
| | | this.$refs.upload.clearFiles() |
| | | return false; |
| | | } else { |
| | | return true; |
| | | } |
| | | }, |
| | | onError(err, file, fileList) { |
| | | this.$message.error('上传失败') |
| | | this.$refs.upload.clearFiles() |
| | | }, |
| | | handleSuccessUp(response, file, fileList) { |
| | | this.$refs.upload.clearFiles() |
| | | if (response.code !== 200) { |
| | | this.$message.error(response.msg) |
| | | return |
| | | } |
| | | this.$message.success('上传成功') |
| | | this.refreshTable() |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |