<template>
|
<div>
|
<div>
|
<div class="view-title">
|
<span>标准方法的变更</span>
|
<span>
|
<el-button size="medium" type="primary" @click="openFormDia('add')">新 增</el-button>
|
</span>
|
</div>
|
<div class="search-background">
|
<span class="search-group">
|
<span style="width: 120px">标准方法:</span>
|
<!-- <el-input size="small" v-model="searchForm.methodName" clearable></el-input> -->
|
<el-input v-model="searchForm.methodName" clearable size="small"></el-input>
|
</span>
|
<span class="search-group">
|
<el-button size="medium" @click="resetSearchForm">重 置</el-button>
|
<el-button size="medium" type="primary" @click="searchList">查 询</el-button>
|
</span>
|
</div>
|
<div class="table">
|
<div>
|
<TableCard :showForm="false" :showTitle="false">
|
<template v-slot:table>
|
<ZTTable
|
:column="tableColumn"
|
:table-data="tableData"
|
:table-loading="tableLoading"
|
:height="'calc(100vh - 23em)'"
|
style="padding: 0 15px;margin-bottom: 16px">
|
</ZTTable>
|
</template>
|
</TableCard>
|
<el-pagination :current-page="1" :page-size="page.size" :page-sizes="[10, 20, 30, 50, 100]"
|
:total="total" layout="->,total, sizes, prev, pager, next, jumper"
|
@size-change="handleSizeChange"
|
@current-change="handleCurrentChange">
|
</el-pagination>
|
</div>
|
</div>
|
</div>
|
<formDIaChange ref="formDIa" v-if="formDIa" :operationType="operationType" @closeDia="closeDia"></formDIaChange>
|
</div>
|
</template>
|
|
<script>
|
import ZTTable from '../caorui/ZTTable/index.vue';
|
import TableCard from '../caorui/TableCard/index.vue';
|
import formDIaChange from '../do/a7-changes-standard-methods/formDIaChange.vue';
|
|
export default {
|
name: 'a7-changes-standard-methods',
|
// import 引入的组件需要注入到对象中才能使用
|
components: { formDIaChange, TableCard, ZTTable },
|
data() {
|
// 这里存放数据
|
return {
|
searchForm: {
|
methodName: '',
|
operationType: 0,
|
},
|
options: [
|
{ label: '上半年', value: '1' },
|
{ label: '下半年', value: '2' },
|
],
|
tableColumn: [
|
{
|
label: '标准方法',
|
prop: 'methodName',
|
minWidth: '100'
|
},
|
{
|
label: '验证原因',
|
prop: 'verifyReason',
|
minWidth: '100'
|
},
|
{
|
label: '主要技术变化',
|
prop: 'technologyChange',
|
minWidth: '100'
|
},
|
{
|
dataType: 'action',
|
minWidth: '60',
|
label: '操作',
|
operation: [
|
{
|
name: '编辑',
|
type: 'text',
|
clickFun: (row) => {
|
this.openFormDia('edit', row);
|
},
|
},
|
{
|
name: '导出',
|
type: 'text',
|
clickFun: (row) => {
|
this.downLoadPost(row);
|
},
|
},
|
{
|
name: '删除',
|
type: 'text',
|
color: '#f56c6c',
|
clickFun: (row) => {
|
this.deleteRow(row);
|
},
|
}
|
|
]
|
}
|
],
|
tableData: [],
|
tableLoading: false,
|
page: {
|
size: 20,
|
current: 1,
|
},
|
total: 0,
|
formDIa: false,
|
operationType: '',
|
};
|
},
|
mounted() {
|
this.searchList()
|
},
|
// 方法集合
|
methods: {
|
// 查询列表
|
searchList() {
|
const entity = {
|
methodName: this.searchForm.methodName,
|
operationType: this.searchForm.operationType,
|
}
|
const page = this.page
|
this.tableLoading = true
|
this.$axios.post(this.$api.processMethodVerify.pagesMethodVerify, { entity, page }, {
|
headers: {
|
"Content-Type": "application/json"
|
},
|
noQs: true
|
}).then(res => {
|
this.tableLoading = false
|
if (res.code === 201) return
|
this.tableData = res.data.records
|
this.total = res.data.total
|
}).catch(err => {
|
console.log('err---', err);
|
this.tableLoading = false
|
})
|
},
|
// 删除
|
deleteRow (row) {
|
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
this.tableLoading = true
|
this.$axios.get(this.$api.processMethodVerify.delMethodVerify + '?methodVerifyId=' + row.methodVerifyId).then(res => {
|
this.tableLoading = false
|
if (res.code === 201) return
|
this.$message.success('删除成功')
|
this.searchList()
|
}).catch(err => {
|
this.tableLoading = false
|
console.log('err---', err);
|
})
|
})
|
},
|
// 重置查询条件
|
resetSearchForm() {
|
this.searchForm.methodName = '';
|
this.searchList()
|
},
|
openFormDia (type, row) {
|
this.formDIa = true
|
this.operationType = type
|
this.$nextTick(() => {
|
this.$refs.formDIa.openDia(row)
|
})
|
},
|
// 关闭弹框
|
closeDia () {
|
this.formDIa = false
|
this.searchList()
|
},
|
// 导出
|
downLoadPost(row) {
|
this.$axios.get(this.$api.processMethodVerify.exportMethodVerify + '?methodVerifyId=' + row.methodVerifyId,{responseType: "blob"}).then(res => {
|
this.outLoading = false
|
this.$message.success('导出成功')
|
const blob = new Blob([res],{ type: 'application/msword' });
|
const url = URL.createObjectURL(blob);
|
const link = document.createElement('a');
|
link.href = url;
|
link.download = '标准(方法)确认记录.docx';
|
link.click();
|
})
|
},
|
// 分页
|
handleSizeChange(val) {
|
this.page.size = val;
|
this.searchList();
|
},
|
handleCurrentChange(val) {
|
this.page.current = val;
|
this.searchList();
|
},
|
}
|
};
|
</script>
|
|
<style scoped>
|
.view-title {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
height: 60px;
|
padding-left: 20px;
|
}
|
|
.search-background {
|
width: 100%;
|
height: 80px;
|
line-height: 80px;
|
background-color: #ffffff;
|
display: flex;
|
}
|
|
.search-group {
|
display: flex;
|
align-items: center;
|
margin: 0 20px;
|
}
|
|
.table {
|
margin-top: 20px;
|
background-color: #ffffff;
|
padding-top: 20px;
|
}
|
</style>
|