529 lines
17 KiB
Vue
529 lines
17 KiB
Vue
<template>
|
||
<!--标准/译文获取申请管理-->
|
||
<div class="standardTranslationAcquisitionRequest">
|
||
<div class="search-area">
|
||
<el-form :inline="true" :model="StandardApplyForEOPage">
|
||
<el-form-item class="el-form-item search-item" label="类型">
|
||
<el-select
|
||
v-model="StandardApplyForEOPage.type"
|
||
:placeholder="'请选择类型'"
|
||
clearable
|
||
>
|
||
<el-option
|
||
v-for="opt in typeList"
|
||
:key="opt.value"
|
||
:value="opt.value === undefined ? '' :opt.value"
|
||
:label="opt.label"
|
||
>
|
||
{{ opt.label }}
|
||
</el-option>
|
||
</el-select>
|
||
</el-form-item>
|
||
<el-form-item class="el-form-item search-item" label="申请单位">
|
||
<el-select
|
||
v-model="StandardApplyForEOPage.applyForUnitIds"
|
||
:placeholder="'请选择申请单位'"
|
||
clearable
|
||
>
|
||
<el-option
|
||
v-for="opt in applicantUnitList"
|
||
:key="opt.value"
|
||
:value="opt.value === undefined ? '' :opt.value"
|
||
:label="opt.label"
|
||
>
|
||
{{ opt.label }}
|
||
</el-option>
|
||
</el-select>
|
||
</el-form-item>
|
||
<el-form-item class="el-form-item search-item" label="申请人">
|
||
<el-input v-model="applyForUserName" placeholder="选择请选择申请人" @click.native="choiceWSSMR('wssmr', '请选择申请人', StandardApplyForEOPage.applyForUserIds)" />
|
||
</el-form-item>
|
||
<el-form-item class="el-form-item search-item" label="需求时间">
|
||
<el-input v-model="StandardApplyForEOPage.requiredTime" clearable placeholder="请输入需求时间" />
|
||
</el-form-item>
|
||
<el-form-item class="el-form-item search-item" label="申请状态">
|
||
<el-select
|
||
v-model="StandardApplyForEOPage.status"
|
||
:placeholder="'请选择申请状态'"
|
||
clearable
|
||
>
|
||
<el-option
|
||
v-for="opt in statusList"
|
||
:key="opt.value"
|
||
:value="opt.value === undefined ? '' :opt.value"
|
||
:label="opt.label"
|
||
>
|
||
{{ opt.label }}
|
||
</el-option>
|
||
</el-select>
|
||
</el-form-item>
|
||
<el-form-item>
|
||
<el-button size="mini" type="primary" @click="searchData">查询</el-button>
|
||
<el-button size="mini" @click="clearSerach">清空</el-button>
|
||
</el-form-item>
|
||
</el-form>
|
||
</div>
|
||
<div class="table-container">
|
||
<div class="operate-options">
|
||
<div>
|
||
<el-button v-btn-permission="'34ea84f51eb01a166b7acfe4f7b02c8d'" size="mini" type="danger" @click="batchOverrule(selectedList)">批量驳回</el-button>
|
||
<el-button v-btn-permission="'a8218ff15358a5265e5571e49acf1f4e'" size="mini" type="primary" @click="batchPass(selectedList)">批量通过</el-button>
|
||
</div>
|
||
<div>
|
||
<el-button v-btn-permission="'33809866b2fda3f52058299b5e2584c3'" size="mini" type="primary" @click="standardsAndTranslationRequestShowModal">标准/译文获取申请</el-button>
|
||
<el-button v-btn-permission="'b899c22e27baa561b8c2ecb0f35d7302'" size="mini" @click="exportList">列表导出</el-button>
|
||
</div>
|
||
</div>
|
||
<el-table
|
||
ref="selections"
|
||
tooltip-effect="dark"
|
||
style="width: 100%; flex: auto;"
|
||
class="drag-table"
|
||
row-key="id"
|
||
border
|
||
v-loading="tableLoading"
|
||
:data="StandardApplyForEO"
|
||
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px', fontWeight: 'bold', height: '48px'}"
|
||
@selection-change="handleSelectionChange"
|
||
>
|
||
<el-table-column
|
||
type="selection"
|
||
width="55"
|
||
/>
|
||
<el-table-column
|
||
type="index"
|
||
fixed="left"
|
||
width="55"
|
||
label="序号"
|
||
align="center"
|
||
/>
|
||
<el-table-column
|
||
show-overflow-tooltip
|
||
label="类型"
|
||
prop="typeShow"
|
||
align="center"
|
||
min-width="100"
|
||
/>
|
||
<el-table-column
|
||
show-overflow-tooltip
|
||
label="标准编号"
|
||
width="150"
|
||
align="center"
|
||
prop="standNumShow"
|
||
/>
|
||
<el-table-column
|
||
show-overflow-tooltip
|
||
label="标准名称"
|
||
prop="standName"
|
||
align="center"
|
||
min-width="150"
|
||
/>
|
||
<el-table-column
|
||
show-overflow-tooltip
|
||
label="原语言"
|
||
prop="sourceLanguage"
|
||
align="center"
|
||
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="statusShow"
|
||
align="center"
|
||
min-width="100"
|
||
/>
|
||
<el-table-column label="操作" align="center" width="200" fixed="right">
|
||
<template slot-scope="scope">
|
||
<div class="table-operate-btn" @click="toView(scope.row)">查看</div>
|
||
<div v-btn-permission="'3bc041e58bcb4b0510bcc1aad0b9ce89'" v-show="scope.row.buttonFlag ==='Audit'" class="table-operate-btn" @click="batchPass([scope.row.id])">通过</div>
|
||
<div v-btn-permission="'92adace8c9a703b3b2472f684808db98'" v-show="scope.row.buttonFlag ==='Audit'" class="table-operate-btn" @click="batchOverrule([scope.row.id])">驳回</div>
|
||
<div v-btn-permission="'08d4e36d7580c108f3a4ee8a66bbe04e'" v-show="scope.row.status ==='pendingApproval'" class="table-operate-btn" @click="ResubmitOrWithdraw (scope.row.id,'Staging')">撤回</div>
|
||
<div v-btn-permission="'a2a193e87244b42fb2f989a1a9b40330'" v-show="scope.row.status === 'refuse' || scope.row.status === 'draft'" class="table-operate-btn" @click="edit(scope.row)">编辑</div>
|
||
<div v-btn-permission="'c3944c3c309ba5bc5d11b6b5a2773454'" v-show="scope.row.status === 'refuse' || scope.row.status === 'draft'" class="table-operate-btn" @click="ResubmitOrWithdraw (scope.row.id,'pendingApproval')">重新提交</div>
|
||
</template>
|
||
</el-table-column>
|
||
</el-table>
|
||
<pagination
|
||
style="position: relative;"
|
||
:page="StandardApplyForEOPage.page"
|
||
:total="total"
|
||
@pageChange="pageChange"
|
||
@pageSizeChange="pageSizeChange"
|
||
/>
|
||
</div>
|
||
<standardsAndTranslationModal ref="standardsAndTranslationModalRef" @updateIndexList="getList" />
|
||
<detailModal ref="detailModalRef" />
|
||
<addModal ref="addModalRef" @updateList="getList"></addModal>
|
||
<exportDialog ref="exportDialogRef" @exportData="exportName" />
|
||
<Role-tree
|
||
:is-title="drawerTitle"
|
||
:is-visible.sync="modalShowRoleFlag"
|
||
:nodeList="nodeList"
|
||
@checkedRole="checkedRole"
|
||
/>
|
||
</div>
|
||
</template>
|
||
|
||
<script>
|
||
import standardsAndTranslationModal from './components/standardTranslationAcquisitionRequestModal';
|
||
import detailModal from './components/detailModal';
|
||
import addModal from './components/addModal';
|
||
import exportDialog from './components/exportDialog';
|
||
import axios from '@/common/axiosV2'
|
||
|
||
export default {
|
||
name: 'StandardTranslationAcquisitionRequest',
|
||
components: {
|
||
standardsAndTranslationModal,
|
||
detailModal,
|
||
exportDialog,
|
||
addModal
|
||
},
|
||
data () {
|
||
return {
|
||
tableLoading: false,
|
||
selectedTag: true,
|
||
total: 0,
|
||
StandardApplyForEOPage: {
|
||
page: 1,
|
||
pageSize: this.$store.getters.userInfo.configContent,
|
||
},
|
||
applyForUserName: '',
|
||
StandardApplyForEO: [],
|
||
selectedList: [],
|
||
url: {
|
||
getList: '/lawss/standardApplyFor/queryByPage',
|
||
updateState: '/lawss/standardApplyFor/batchUpdateStatus',
|
||
exportData: '/lawss/standardApplyFor/exportStandardApplyForEOExcel'
|
||
},
|
||
typeList: [],
|
||
applicantUnitList: [],
|
||
statusList: [
|
||
{
|
||
label: '通过',
|
||
value: 'pass',
|
||
},
|
||
{
|
||
label: '驳回',
|
||
value: 'refuse',
|
||
},
|
||
{
|
||
label: '待审批',
|
||
value: 'pendingApproval',
|
||
},
|
||
{
|
||
label: '草稿',
|
||
value: 'draft',
|
||
}
|
||
],
|
||
nodeList: [],
|
||
userType: '',
|
||
drawerTitle: '',
|
||
modalShowRoleFlag: false
|
||
}
|
||
},
|
||
mounted () {
|
||
if (this.$route.query && this.$route.query.tag === 'fromSearchCenter') {
|
||
this.standardsAndTranslationRequestShowModal()
|
||
this.$router.replace({ query: { ...this.$route.query, tag: undefined } })
|
||
}
|
||
this.getList()
|
||
this.getDicTypeListCode()
|
||
},
|
||
methods: {
|
||
ResubmitOrWithdraw (id, status) {
|
||
const query = {
|
||
status: status ? status : '',
|
||
ids: id
|
||
}
|
||
this.$http.postData('/lawss/standardApplyFor/batchUpdateStatus', query, { _this: this }, res => {
|
||
if (res.ok) {
|
||
this.$message.success('操作成功')
|
||
this.getList()
|
||
}else{
|
||
this.$message.warning(res.message)
|
||
}
|
||
})
|
||
},
|
||
edit (item) {
|
||
this.$refs.addModalRef.showModal(item)
|
||
},
|
||
checkedRole (data) {
|
||
let idList = ''
|
||
let nameList = ''
|
||
data.forEach(item => {
|
||
if (nameList.length > 0) {
|
||
nameList += ','
|
||
idList += ','
|
||
}
|
||
idList += item.id
|
||
nameList += item.name
|
||
})
|
||
this.StandardApplyForEOPage.applyForUserIds = idList
|
||
this.applyForUserName = nameList
|
||
},
|
||
choiceWSSMR (type, title, id) {
|
||
this.nodeList = []
|
||
if(id) {
|
||
const nameId = id.split(',')
|
||
let idList = []
|
||
nameId.forEach(item => {
|
||
idList.push(item)
|
||
})
|
||
idList = idList.join(',')
|
||
this.nodeList.push(idList)
|
||
}
|
||
this.userType = type
|
||
this.drawerTitle = title
|
||
this.modalShowRoleFlag = true
|
||
},
|
||
getDicTypeListCode () {
|
||
this.$http.get('sys/dictype/getDicTypeListCode', '', {
|
||
_this: this
|
||
}, res => {
|
||
this.typeList = res.data.BZJYWTYPE // 标准类别
|
||
this.applicantUnitList = res.data.GKGLBM // 归口管理部门
|
||
}, e => {
|
||
})
|
||
},
|
||
searchData () {
|
||
this.page = 1
|
||
this.getList()
|
||
},
|
||
clearSerach () {
|
||
this.applyForUserName = ''
|
||
this.StandardApplyForEOPage = {
|
||
page: 1,
|
||
pageSize: this.$store.getters.userInfo.configContent
|
||
}
|
||
this.getList()
|
||
},
|
||
getList () {
|
||
this.tableLoading = true
|
||
this.$http.get(this.url.getList, {
|
||
...this.StandardApplyForEOPage
|
||
}, {
|
||
_this: this
|
||
}, res => {
|
||
if (res.ok) {
|
||
this.StandardApplyForEO = res.data.records
|
||
this.total = res.data.total
|
||
}else {
|
||
this.StandardApplyForEO = []
|
||
this.total = 0
|
||
}
|
||
this.selectedList = []
|
||
this.$refs.selections.clearSelection()
|
||
this.tableLoading = false
|
||
this.$http.get('/lawss/standardApplyFor/queryPendingApprovalCount', '', { _this: this }, res => {
|
||
if (res.ok) {
|
||
this.$store.commit('SET_STANDARD_TRANSLATION_TODO', res.data)
|
||
}
|
||
})
|
||
})
|
||
},
|
||
batchPass (id) {
|
||
if (id.length === 0) {
|
||
this.$message({
|
||
message: '请选择至少一条数据',
|
||
type: 'warning',
|
||
offset: 20
|
||
})
|
||
return
|
||
}
|
||
if (!this.selectedTag) {
|
||
this.$message({
|
||
message: '只能选择待审批的数据,请重新选择',
|
||
type: 'warning',
|
||
offset: 20
|
||
})
|
||
return
|
||
}
|
||
const ids = id.join(',')
|
||
this.$confirm('确定通过?', '提示', {
|
||
confirmButtonText: '确定',
|
||
confirmButtonClass: 'common-button-primary',
|
||
cancelButtonText: '取消',
|
||
type: 'warning',
|
||
roundButton: false
|
||
}).then(() => {
|
||
this.$http.postData(this.url.updateState, { status: 'pass', ids: ids }, { _this: this }, res => {
|
||
if (res.ok) {
|
||
this.$message.success('操作成功')
|
||
this.getList()
|
||
} else {
|
||
this.$message.warning(res.message)
|
||
}
|
||
})
|
||
}).catch(() => {
|
||
// 取消删除,清空选择
|
||
this.$refs.selections.clearSelection()
|
||
})
|
||
},
|
||
batchOverrule (id) {
|
||
if (id.length === 0) {
|
||
this.$message({
|
||
message: '请选择至少一条数据',
|
||
type: 'warning',
|
||
offset: 20
|
||
})
|
||
return
|
||
}
|
||
if (!this.selectedTag) {
|
||
this.$message({
|
||
message: '只能选择待审批的数据,请重新选择',
|
||
type: 'warning',
|
||
offset: 20
|
||
})
|
||
return
|
||
}
|
||
const ids = id.join(',')
|
||
this.$prompt('请输入驳回原因', '提示', {
|
||
confirmButtonText: '确定',
|
||
confirmButtonClass: 'common-button-primary',
|
||
cancelButtonText: '取消',
|
||
type: 'warning',
|
||
roundButton: false,
|
||
inputValidator: (value) => {
|
||
if (value === null || value === undefined) {
|
||
return '驳回原因不能为空'
|
||
} else if (value.length > 500) {
|
||
return '驳回原因不能超过500个字符'
|
||
} else if (value.length === 0) {
|
||
return '驳回原因不能为空'
|
||
} else {
|
||
return true
|
||
}
|
||
},
|
||
inputErrorMessage: ''
|
||
}).then(({ value }) => {
|
||
this.$http.postData(this.url.updateState, { status: 'refuse', refuseCause: value, ids }, { _this: this }, res => {
|
||
if (res.ok) {
|
||
this.$message.success('操作成功')
|
||
this.getList()
|
||
} else {
|
||
this.$message.warning(res.message)
|
||
}
|
||
})
|
||
}).catch(() => {
|
||
// 取消删除,清空选择
|
||
this.$refs.selections.clearSelection()
|
||
})
|
||
},
|
||
exportName (name) {
|
||
const params = {
|
||
...this.StandardApplyForEOPage,
|
||
exportFileName: name,
|
||
ids: this.selectedList.length > 0 ? this.selectedList.join(',') : '',
|
||
};
|
||
axios({
|
||
url: '/api/lawss/standardApplyFor/exportStandardApplyForEOExcel',
|
||
method: 'get',
|
||
responseType: 'blob',
|
||
params: params
|
||
}).then(res => {
|
||
const blob = new Blob([ res ], { type: 'application/vnd.ms-excel' });
|
||
// 浏览器兼容,Google和火狐支持a标签的download,IE不支持
|
||
if (window.navigator && window.navigator.msSaveBlob) {
|
||
// IE浏览器、微软浏览器
|
||
/* 经过测试,微软浏览器Microsoft Edge下载文件时必须要重命名文件才可以打开,
|
||
IE可不重命名,以防万一,所以都写上比较好 */
|
||
window.navigator.msSaveBlob(blob, name + '.xlsx');
|
||
} else {
|
||
// 其他浏览器
|
||
const link = document.createElement('a'); // 创建a标签
|
||
link.style.display = 'none';
|
||
const objectUrl = URL.createObjectURL(blob);
|
||
link.href = objectUrl;
|
||
link.download = name + '.xlsx';
|
||
link.click();
|
||
URL.revokeObjectURL(objectUrl);
|
||
}
|
||
})
|
||
},
|
||
exportList () {
|
||
this.$refs.exportDialogRef.openModel()
|
||
},
|
||
toView (id) {
|
||
this.$refs.detailModalRef.showModal(id)
|
||
},
|
||
standardsAndTranslationRequestShowModal () {
|
||
this.$refs.standardsAndTranslationModalRef.showModal()
|
||
},
|
||
pageChange (page) {
|
||
this.StandardApplyForEOPage.page = page
|
||
this.getList()
|
||
},
|
||
pageSizeChange (pageSize) {
|
||
this.StandardApplyForEOPage.pageSize = pageSize
|
||
this.getList()
|
||
},
|
||
handleSelectionChange (value) {
|
||
const ids = []
|
||
value.forEach(item => {
|
||
ids.push(item.id)
|
||
this.selectedTag = true
|
||
if (item.status !== 'pendingApproval') {
|
||
this.selectedTag = false
|
||
}
|
||
})
|
||
this.selectedList = [ ...ids ]
|
||
}
|
||
},
|
||
}
|
||
</script>
|
||
|
||
<style scoped lang="less">
|
||
.standardTranslationAcquisitionRequest {
|
||
height: 100%;
|
||
display: flex;
|
||
flex-direction: column;
|
||
|
||
.table-container {
|
||
background-color: white;
|
||
padding: 0 10px;
|
||
flex-grow: 1;
|
||
display: flex;
|
||
flex-direction: column;
|
||
|
||
.drag-table {
|
||
flex-grow: 1;
|
||
}
|
||
|
||
.operate-options {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
padding-bottom: 10px;
|
||
}
|
||
}
|
||
|
||
.table-operate-btn {
|
||
display: inline-block;
|
||
cursor: pointer;
|
||
color: #409EFF;
|
||
margin: 0 5px;
|
||
}
|
||
|
||
.stand-date-range-picker {
|
||
/deep/ .el-range-separator {
|
||
width: auto;
|
||
}
|
||
}
|
||
}
|
||
</style>
|