标准/译文获取申请管理 对话框批量删除/删除

This commit is contained in:
baoyu
2024-03-27 19:09:20 +08:00
parent d361662e3f
commit f7ec289695
@@ -9,108 +9,105 @@
<el-button size="mini" type="primary" @click="standardTranslationAcquisitionRequestAdd">新增标准/译文获取申请</el-button> <el-button size="mini" type="primary" @click="standardTranslationAcquisitionRequestAdd">新增标准/译文获取申请</el-button>
<el-button size="mini" type="primary" @click="importData">导入</el-button> <el-button size="mini" type="primary" @click="importData">导入</el-button>
<el-button size="mini" @click="templateDownload">模版下载</el-button> <el-button size="mini" @click="templateDownload">模版下载</el-button>
<el-button size="mini" @click="batchDelete">批量删除</el-button> <el-button size="mini" @click="batchDelete(selectedList)">批量删除</el-button>
</div> </div>
<div class="table-container"> <div class="table-container">
<el-table <el-table
ref="selections" ref="selections"
tooltip-effect="dark" tooltip-effect="dark"
style="width: 100%; flex: auto;" style="width: 100%; flex: auto;"
class="drag-table" class="drag-table"
height="300px" height="300px"
row-key="id" row-key="id"
border border
:loading="tableLoading" :loading="tableLoading"
:data="tableData" :data="StandardApplyForEO"
@selection-change="handleSelectionChange" :header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px', fontWeight: 'bold', height: '48px'}"
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px', fontWeight: 'bold', height: '48px'}" @selection-change="handleSelectionChange"
> >
<el-table-column <el-table-column
type="selection" type="selection"
width="55" width="55"
/>
<el-table-column
type="index"
fixed="left"
width="55"
label="序号"
align="center"
/>
<el-table-column
show-overflow-tooltip
label="类型"
prop="classification"
align="center"
min-width="100"
/>
<el-table-column
show-overflow-tooltip
label="标准编号"
width="150"
align="center"
prop="standardEncdoing"
/> />
<el-table-column <el-table-column
show-overflow-tooltip type="index"
label="标准名称" fixed="left"
prop="standardName" width="55"
align="center" label="序号"
min-width="150" align="center"
/> />
<el-table-column <el-table-column
show-overflow-tooltip show-overflow-tooltip
label="原语言" label="类型"
prop="problemDescription" prop="type"
align="center" align="center"
min-width="100" min-width="100"
/> />
<el-table-column <el-table-column
show-overflow-tooltip show-overflow-tooltip
label="目标语言" label="标准编号"
prop="problemDescription" width="150"
align="center" align="center"
min-width="100" prop="standNum"
/> />
<el-table-column <el-table-column
show-overflow-tooltip show-overflow-tooltip
label="理由" label="标准名称"
prop="problemDescription" prop="standName"
align="center" align="center"
min-width="300" min-width="150"
/> />
<el-table-column <el-table-column
show-overflow-tooltip show-overflow-tooltip
label="申请状态" label="原语言"
prop="problemDescription" prop="sourceLanguage"
align="center" align="center"
min-width="100" min-width="100"
/>
<el-table-column
show-overflow-tooltip
label="目标语言"
prop="targetLanguage"
align="center"
min-width="100"
/>
<el-table-column
show-overflow-tooltip
label="理由"
prop="reason"
align="center"
min-width="300"
/>
<el-table-column
show-overflow-tooltip
label="申请状态"
prop="status"
align="center"
min-width="100"
/> />
<el-table-column label="操作" align="center" width="200" fixed="right"> <el-table-column label="操作" align="center" width="200" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="table-operate-btn" @click="toView(scope.row.id)">查看</div> <div class="table-operate-btn" @click="toView(scope.row.id)">查看</div>
<div class="table-operate-btn" @click="edit(scope.row.id)">编辑</div> <div class="table-operate-btn" @click="edit(scope.row.id)">编辑</div>
<div class="table-operate-btn" @click="deleteItem(scope.row.id)">删除</div> <div class="table-operate-btn" @click="batchDelete([scope.row.id])">删除</div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!--分页--> <!--分页-->
<pagination <pagination
style="position: relative;" style="position: relative;"
:page="serachForm.page" :page="page"
:total="serachForm.total" :total="total"
@pageChange="pageChange" @pageChange="pageChange"
@pageSizeChange="pageSizeChange" @pageSizeChange="pageSizeChange"
/> />
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button size="mini" type="primary" @click="submitData(0)">保存</el-button> <el-button size="mini" type="primary" @click="submitData(0)">保存</el-button>
<el-button size="mini" type="primary" @click="submitData(1)">提交</el-button> <el-button size="mini" type="primary" @click="submitData(1)">提交</el-button>
</span> </span>
<addModal ref="addModalRef"></addModal> <addModal ref="addModalRef" />
<detailModal ref="detailModalRef"></detailModal> <detailModal ref="detailModalRef" />
</el-dialog> </el-dialog>
</template> </template>
@@ -127,50 +124,78 @@ export default {
return { return {
visible: false, visible: false,
tableLoading: false, tableLoading: false,
tableData: [], StandardApplyForEO: [],
serachForm: {}, selectedList: [],
selectedList: [] page: 1,
pageSize: this.$store.getters.userInfo.configContent,
total: 0,
url: {
deleteUrl: '/lawss/standardApplyFor/batchUpdateValidFlag',
getList: '/lawss/standardApplyFor/queryStagingByPage'
}
} }
}, },
methods: { methods: {
showModal () { showModal () {
this.visible = true this.visible = true
this.StandardApplyForEO = []
this.page = 1
this.getList()
}, },
handleClose () { handleClose () {
this.visible = false this.visible = false
}, },
handleSelectionChange (value) {
this.selectedList = value
},
toView (id) { toView (id) {
this.$refs.addModalRef.detailModalRef(id) this.$refs.addModalRef.showModal(id)
}, },
edit (id) { edit (id) {
this.$refs.addModalRef.showModal(id) this.$refs.addModalRef.showModal(id)
}, },
deletItem(id){ importData () {
}, },
templateDownload () { templateDownload () {
}, },
batchDelete () { getList () {
if (this.selectedList.length === 0) { this.tableLoading = true
this.$http.get(this.url.getList, { page: this.page, pageSize: this.pageSize }, {
_this: this,
}, res => {
if (res.ok) {
this.StandardApplyForEO = res.data.list
this.total = res.data.total
}else {
this.StandardApplyForEO = []
this.total = 0
}
})
},
batchDelete (id) {
if (id.length === 0) {
this.$message({ this.$message({
message: '请选择至少一条数据', message: '请选择至少一条数据',
type: 'warning', type: 'warning',
offset: 20 offset: 20
}) })
return
} }
const ids = id.join(',')
this.$http.postData(this.url.deleteUrl, ids, { _this: this }, res => {
this.$message.success('操作成功')
this.getList()
})
}, },
importData () { submitData (tag) {
},
handleSelectionChange (value) {
const ids = []
value.forEach(item => {
ids.push(item.id)
})
this.selectedList = [ ...ids ]
}, },
standardTranslationAcquisitionRequestAdd () { standardTranslationAcquisitionRequestAdd () {
this.$refs.addModalRef.showModal() this.$refs.addModalRef.showModal()
}, },
submitData (tag) {
if (tag) {
return
}
},
pageChange (page) { pageChange (page) {
this.questionSerach.page = page this.questionSerach.page = page
this.getList() this.getList()
@@ -184,12 +209,13 @@ export default {
</script> </script>
<style scoped> <style scoped>
.operate{ .operate {
display: flex; display: flex;
justify-content: right; justify-content: right;
margin-bottom: 5px; margin-bottom: 5px;
} }
.table-operate-btn{
.table-operate-btn {
display: inline-block; display: inline-block;
cursor: pointer; cursor: pointer;
color: #409EFF; color: #409EFF;