虚拟清单调取功能

This commit is contained in:
zyx.net
2022-12-12 16:07:20 +08:00
parent de7bfab8d1
commit e57a5ec6e3
3 changed files with 541 additions and 0 deletions
@@ -0,0 +1,261 @@
<template>
<a-drawer
:title="$t('Transfer')"
:maskClosable="false"
:width="1000"
placement="right"
:closable="true"
@close="handleCancel"
:visible="visible"
style="height: 100%;overflow: auto;padding-bottom: 53px;">
<div style="margin-bottom: 60px">
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="12" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('VirtualListName')">
<span>{{$t('VirtualListName')}}</span>
</div>
<j-input class="box-input" :placeholder="$t('PleaseEnter')+$t('VirtualListName')"
v-model="queryParam.name"></j-input>
</div>
</a-col>
<span style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
<a-col :md="12" :sm="24">
<a-button class="box-button" type="primary" @click="searchQuery">{{$t('query')}}</a-button>
<a-button class="box-button" style="margin-left: 8px" @click="searchReset">{{$t('reset')}}</a-button>
</a-col>
</span>
</a-row>
</a-form>
</div>
<a-table
:columns="columns"
rowKey="id"
:scroll="{x: 800}"
:data-source="dataList"
:pagination="false"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange,columnTitle:' ' }"
:loading="loading">
</a-table>
<div class="page" v-if="dataList.length > 0">
<a-pagination
:show-total="total => $t('total')+` ${total} `+$t('strip')"
show-quick-jumper
show-size-changer
:page-size.sync="pageSize"
:total="total"
:current="pageNo"
@change="onChange"
@showSizeChange="SizeChange"
/>
</div>
</div>
<div class="drawer-bootom-button">
<a-button @click="handleCancel" style="margin-right: 16px">{{$t('cancel')}}</a-button>
<a-button @click="handleSubmit(undefined)" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
</div>
</a-drawer>
</template>
<script>
import { getAction, postAction } from '@/api/manage'
export default {
name: 'transferList',
components: {},
props: ['url'],
data() {
return {
visible: false,
queryParam: {},
confirmLoading: false,
selectedRowKeys: [],
columns: [
{
title: this.$t('VirtualListName'),
dataIndex: 'name',
align: 'center',
ellipsis: true
},
{
title: this.$t('instructionForUse'),
dataIndex: 'useExplain',
align: 'center',
ellipsis: true
},
{
title: this.$t('updateTime'),
dataIndex: 'updateTime',
align: 'center',
ellipsis: true
},
{
title: this.$t('creater'),
dataIndex: 'createBy',
align: 'center',
ellipsis: true
}
],
dataList: [],
content: [],
loading: false,
pageNo: 1,
pageSize: 10,
total: 0
}
},
mounted() {
},
methods: {
transferModel() {
this.visible = true
this.queryParam = {}
this.selectedRowKeys = []
this.replacePage()
},
searchQuery() {
this.pageNo = 1
this.replacePage()
},
searchReset() {
this.pageNo = 1
this.queryParam = {}
this.replacePage()
},
onChange(page, pageSize) {
this.pageNo = page
this.replacePage()
},
SizeChange(page, pageSize) {
this.pageNo = 1
this.pageSize = pageSize
this.replacePage()
},
replacePage() {
let query = {
pageNo: this.pageNo,
pageSize: this.pageSize,
...this.queryParam
}
this.loading = true
postAction('/project/projectLawsInventoryEO/getPageInfoDummy', query).then((res) => {
if (res.success) {
this.dataList = res.result.records || []
this.total = res.result.total
this.loading = false
} else {
this.loading = false
}
})
},
onSelectChange(value) {
this.selectedRowKeys = value
if (this.selectedRowKeys.length > 1) {
this.selectedRowKeys.shift()
}
},
handleCancel() {
this.visible = false
},
handleSubmit(flag) {
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
this.confirmLoading = true
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
this.confirmLoading = false
this.selectedRowKeys = []
this.$emit('transferListForm',selectedRowKeys.join(','))
// postAction('project/projectLawsInventoryEO/add', {
// dummyInventoryBaseId: selectedRowKeys.join(','),
// projectLibraryId: this.$route.query.id,
// flag: flag
// }).then((res) => {
// if (res.success) {
// this.confirmLoading = false
// // this.$message.success(this.$t('OperationSuccessful'))
// // this.visible = false
// this.selectedRowKeys = []
// this.$emit('transferListForm',selectedRowKeys.join(','))
// } else {
// // if (res.message == '该虚拟清单的维护清单中没有数据,是否需要添加') {
// // this.confirmLoading = false
// // this.getAdd()
// // return
// // }
// this.$message.warning(this.$t('operationFailed'))
// this.confirmLoading = false
// }
// })
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
},
getAdd() {
let _this = this
this.$confirm({
content: _this.$t('TheDoesNotContainData'),
onOk() {
_this.handleSubmit('1')
}
})
}
}
}
</script>
<style scoped>
.page {
text-align: right;
margin-top: 20px;
}
.drawer-bootom-button {
position: absolute;
bottom: 0;
z-index: 100;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
.box-title-text {
line-height: 1.4;
display: flex;
align-items: center;
margin-bottom: 10px;
}
.title-text {
width: 20%;
min-width: 110px;
color: #000F16;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
margin-top: 3px;
text-align: right;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.box-input {
display: inline-block;
width: 70%;
height: 38px;
margin-top: 2px;
}
.box-button {
height: 38px;
}
</style>
@@ -0,0 +1,254 @@
<template>
<a-drawer
:title="$t('VirtualList')"
:maskClosable="false"
:width="1000"
placement="right"
:closable="true"
@close="handleCancel"
:visible="visible"
style="height: 100%;overflow: auto;padding-bottom: 53px;">
<div style="margin-bottom: 60px">
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="12" :sm="5">
<div class="box-title-text">
<div class="title-text" :title="$t('standard')">
<span>{{$t('standard')}}</span>
</div>
<j-input class="box-input" :placeholder="$t('PleaseEnter')+$t('standard')"
v-model="queryParam.serialNumber"></j-input>
</div>
</a-col>
<a-col :md="12" :sm="5">
<div class="box-title-text">
<div class="title-text" :title="$t('title')">
<span>{{$t('title')}}</span>
</div>
<j-input class="box-input" :placeholder="$t('PleaseEnter')+$t('title')"
v-model="queryParam.title"></j-input>
</div>
</a-col>
<span style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
<a-col :md="12" :sm="24">
<a-button class="box-button" type="primary" @click="searchQuery">{{$t('query')}}</a-button>
<a-button class="box-button" style="margin-left: 8px" @click="searchReset">{{$t('reset')}}</a-button>
</a-col>
</span>
</a-row>
</a-form>
</div>
<a-table
:columns="columns"
rowKey="id"
:scroll="{x: 800}"
:data-source="dataList"
:pagination="false"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange,columnTitle:' ' }"
:loading="loading">
</a-table>
<!-- <div class="page" v-if="dataList.length > 0">-->
<!-- <a-pagination-->
<!-- :show-total="total => $t('total')+` ${total} `+$t('strip')"-->
<!-- show-quick-jumper-->
<!-- show-size-changer-->
<!-- :page-size.sync="pageSize"-->
<!-- :total="total"-->
<!-- :current="pageNo"-->
<!-- @change="onChange"-->
<!-- @showSizeChange="SizeChange"-->
<!-- />-->
<!-- </div>-->
</div>
<div class="drawer-bootom-button">
<a-button @click="handleCancel" style="margin-right: 16px">{{$t('cancel')}}</a-button>
<a-button @click="handleSubmit(undefined)" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
</div>
</a-drawer>
</template>
<script>
import { getAction, postAction } from '@/api/manage'
export default {
name: 'transferList',
components: {},
props: ['url'],
data() {
return {
visible: false,
queryParam: {},
confirmLoading: false,
selectedRowKeys: [],
columns: [
{
title: this.$t('standard'),
align: 'center',
dataIndex: 'serialNumber',
scopedSlots: { customRender: 'standard' }
},
{
title: this.$t('title'),
align: 'center',
dataIndex: 'title',
scopedSlots: { customRender: 'titleName' }
},
{
title: this.$t('subtitle'),
align: 'center',
dataIndex: 'subtitle',
ellipsis: true
},
{
title: this.$t('areaOfResponsibility'),
align: 'center',
ellipsis: true,
dataIndex: 'dutyTerritory_dictText'
},
],
dataList: [],
content: [],
loading: false,
dummyInventoryBaseId:'',
pageNo: 1,
pageSize: 10,
total: 0
}
},
mounted() {
},
methods: {
transferModel(id) {
this.visible = true
this.dummyInventoryBaseId = id
this.queryParam = {}
this.selectedRowKeys = []
this.replacePage()
},
searchQuery() {
this.pageNo = 1
this.replacePage()
},
searchReset() {
this.pageNo = 1
this.queryParam = {}
this.replacePage()
},
onChange(page, pageSize) {
this.pageNo = page
this.replacePage()
},
SizeChange(page, pageSize) {
this.pageNo = 1
this.pageSize = pageSize
this.replacePage()
},
replacePage() {
let query = {
// pageNo: this.pageNo,
// pageSize: this.pageSize,
...this.queryParam,
dummyInventoryBaseId: this.dummyInventoryBaseId
}
this.loading = true
getAction('/dummy/dummyInventoryInfoEO/list', query).then((res) => {
if (res.success) {
this.dataList = res.result || []
this.loading = false
} else {
this.loading = false
}
})
},
onSelectChange(value) {
this.selectedRowKeys = value
// if (this.selectedRowKeys.length > 1) {
// this.selectedRowKeys.shift()
// }
},
handleCancel() {
this.visible = false
},
handleSubmit(flag) {
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
this.confirmLoading = true
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
postAction('/dummy/dummyInventoryInfoEO/acquireAdd', {
dummyInventoryBaseId: this.dummyInventoryBaseId,
ids: selectedRowKeys.join(','),
}).then((res) => {
if (res.success) {
this.confirmLoading = false
this.$message.success(this.$t('OperationSuccessful'))
this.visible = false
this.selectedRowKeys = []
this.$emit('transferListFormHomo')
} else {
this.$message.warning(this.$t('operationFailed'))
this.confirmLoading = false
}
})
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
},
}
}
</script>
<style scoped>
.page {
text-align: right;
margin-top: 20px;
}
.drawer-bootom-button {
position: absolute;
bottom: 0;
z-index: 100;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
.box-title-text {
line-height: 1.4;
display: flex;
align-items: center;
margin-bottom: 10px;
}
.title-text {
width: 20%;
min-width: 110px;
color: #000F16;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
margin-top: 3px;
text-align: right;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.box-input {
display: inline-block;
width: 70%;
height: 38px;
margin-top: 2px;
}
.box-button {
height: 38px;
}
</style>
@@ -90,6 +90,7 @@
<!-- style="float: left;font-size: 16px;font-weight: 400;color: #040B29;">-->
<!-- {{$t('DocumentStandard')}}-->
<!-- </div>-->
<div class="operator-text" v-has="'dummyInventoryInfo:importData'" v-if="isTrue">
<ImportFile :url="url" :dummyInventoryBaseId="$route.query.id" :isTrue="true" @getList="getPersonnelList"
:accept="'.zip'"/>
@@ -122,6 +123,13 @@
<a-icon type="setting"/>
{{$t('batSetting')}}
</div>
<!-- 调取-->
<div @click="transferClick"
v-has="'dummyInventoryInfo:copyInfoByIds'"
class="operator-text" v-if="isTrue">
<a-icon type="profile"/>
{{$t('Transfer')}}
</div>
<!-- 添加-->
<div @click="handleAdd"
v-has="'dummyInventoryInfo:add'"
@@ -215,6 +223,8 @@
<addModel :url="url" ref="addModelRef" @addModelList="addModelList"/>
<editModel :url="url" ref="editModelRef" @editModelList="editModelList"/>
<UpdateLog :url="url" ref="UpdateLogRef"/>
<transferList :url="url" @transferListForm="transferListForm" ref="transferListRef"/>
<transferListvirtal :url="url" @transferListFormHomo="transferListFormHomo" ref="transferListvirtalRef"/>
<batSetting :url="url" ref="batSettingRef" @batSettingList="batSettingList"/>
<a-modal
:title="$t('deliverableTemplate')"
@@ -258,6 +268,8 @@
import UpdateLog from '@/components/UpdateLog/index'
import batSetting from './batSetting'
import globalAdvancedQuery from '@/components/globalAdvancedQuery/index'
import transferList from './transferList'
import transferListvirtal from './transferListvirtal'
import { getAction, postAction, downloadFile } from '@/api/manage'
import { Base64 } from 'js-base64'
import { mapGetters } from 'vuex'
@@ -267,6 +279,8 @@
components: {
ImportFile,
addModel,
transferList,
transferListvirtal,
editModel,
UpdateLog,
batSetting,
@@ -278,6 +292,7 @@
queryParam: {},
components: {},
visibleFile: false,
transferList: false,
downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download',
downLoadImgUrl: window._CONFIG['domianWebImgURL'] + '/sys/common/download',
dataSourceFile: [],
@@ -674,6 +689,10 @@
handleModule() {
downloadFile(this.url.exportTemplate, this.$t('VirtualList') + this.$t('importTemplate') + '.xls', {})
},
//调取
transferClick() {
this.$refs.transferListRef.transferModel()
},
//导出
handleExport() {
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
@@ -717,6 +736,13 @@
editModelList() {
this.getList()
},
transferListForm(id){
this.$refs.transferListvirtalRef.transferModel(id)
},
transferListFormHomo(){
this.$refs.transferListRef.handleCancel()
this.getList()
},
getList() {
let query = {
...this.queryParam,