| | |
| | | <template> |
| | | <div class="Complaint"> |
| | | <div class="capacity-scope"> |
| | | <div class="search"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">样品编号:</div> |
| | | <div class="search_input"><el-input v-model="queryParams.sampleCode" clearable placeholder="请输入" size="small" |
| | | @keyup.enter.native="refreshTable()"></el-input></div> |
| | | <div> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true"> |
| | | <el-form-item label="样品编号" prop="sampleCode"> |
| | | <el-input v-model="queryParams.sampleCode" clearable placeholder="请输入" size="small" |
| | | @keyup.enter.native="refreshTable()"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="投诉名称" prop="complainName"> |
| | | <el-input v-model="queryParams.complainName" clearable placeholder="请输入" size="small" |
| | | @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 v-model="queryParams.complainName" clearable placeholder="请输入" size="small" |
| | | @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"> |
| | | <div> |
| | | <el-button :loading="outLoading" size="small" type="primary" @click="handleDown">导出</el-button> |
| | | <el-button size="small" type="primary" @click="openAdd">新增</el-button> |
| | | </div> |
| | |
| | | } from '@/api/cnas/process/complaint.js' |
| | | import { mapGetters } from "vuex"; |
| | | export default { |
| | | name: 'Complaint', |
| | | components: { |
| | | limsTable |
| | | }, |
| | | data() { |
| | | return { |
| | | tableLoading: false, |
| | | addPower: false, |
| | | outLoading: false, |
| | | addDialogVisible: false, |
| | |
| | | ...mapGetters(["userId"]), |
| | | }, |
| | | mounted() { |
| | | // this.entityCopy = this.HaveJson(this.componentData.entity); |
| | | this.getList() |
| | | }, |
| | | methods: { |
| | | // 权限分配 |
| | | getPower() { |
| | | let power = JSON.parse(sessionStorage.getItem('power')) |
| | | let up = false |
| | | let del = false |
| | | let add = false |
| | | let out = false |
| | | for (var i = 0; i < power.length; i++) { |
| | | if (power[i].menuMethod == 'doProcessComplain') { |
| | | up = true |
| | | } |
| | | if (power[i].menuMethod == 'addProcessComplain') { |
| | | add = true |
| | | } |
| | | if (power[i].menuMethod == 'delProcessComplain') { |
| | | del = true |
| | | } |
| | | if (power[i].menuMethod == 'exportProcessComplain') { |
| | | out = true |
| | | } |
| | | } |
| | | if (!up) { |
| | | this.componentData.do.splice(2, 1) |
| | | } |
| | | if (!del) { |
| | | this.componentData.do.splice(1, 1) |
| | | } |
| | | this.outPower = out |
| | | this.addPower = add |
| | | }, |
| | | openAdd() { |
| | | this.addInfo = {} |
| | | this.addDialogVisible = true |
| | |
| | | this.addLoading = true |
| | | addProcessComplain(this.addInfo).then((res) => { |
| | | this.addLoading = false |
| | | if (res.code == 201) { |
| | | this.$message({ |
| | | type: 'error', |
| | | message: '新增失败' |
| | | }) |
| | | return |
| | | } |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '新增成功' |
| | |
| | | } |
| | | doProcessComplain(this.currentInfo0).then((res) => { |
| | | this.addLoading = false |
| | | if (res.code == 201) { |
| | | this.$message({ |
| | | type: 'error', |
| | | message: '提交失败' |
| | | }) |
| | | return |
| | | } |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '提交成功' |
| | |
| | | this.outLoading = true |
| | | exportProcessComplain(this.queryParams).then(res => { |
| | | this.outLoading = false |
| | | if (res.code == 201) { |
| | | return |
| | | } |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }); |
| | | this.$download.saveAs(blob, '投诉情况汇总表.xlsx'); |
| | | }) |
| | | }, |
| | | handleOut(row) { |
| | | getProcessComplain({ id: row.id }).then((res) => { |
| | | if (res.code == 201) { |
| | | return |
| | | } |
| | | this.currentInfo = res.data |
| | | this.currentInfo0 = this.HaveJson(res.data) |
| | | this.title = '导出' |
| | |
| | | }) |
| | | .then(() => { |
| | | delProcessComplain({ id: row.id }).then((res) => { |
| | | if (res.code == 201) return; |
| | | this.$message.success("删除成功"); |
| | | this.refresh(); |
| | | }); |
| | |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .title { |
| | | height: 60px; |
| | | line-height: 60px; |
| | | } |
| | | |
| | | .search { |
| | | background-color: #fff; |
| | | height: 80px; |
| | | height: 46px; |
| | | display: flex; |
| | | align-items: center; |
| | | position: relative; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | .search_thing { |
| | | width: 350px; |
| | | display: flex; |
| | |
| | | |
| | | .search_input { |
| | | width: calc(100% - 110px); |
| | | } |
| | | |
| | | .table { |
| | | background-color: #fff; |
| | | height: calc(100% - 60px - 80px - 10px - 40px); |
| | | padding: 20px; |
| | | } |
| | | |
| | | .dialog-body { |
| | |
| | | .user-info { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: end; |
| | | justify-content: flex-end; |
| | | } |
| | | |
| | | .user-content { |