文档工具-认证清单维护-添加

This commit is contained in:
刘彦泽
2023-03-14 15:11:50 +08:00
parent f24e0db421
commit ff64c3c809
3 changed files with 369 additions and 17 deletions
@@ -18,19 +18,7 @@
<span class="title-text-text" :title="$t ('regulationNo')">{{$t('regulationNo')}}</span>
</div>
<a-form-model-item class="itemModel" prop="serialNumber">
<a-select showSearch
allowClear
:placeholder="$t('PleaseSelect')+$t('regulationNo')"
@change="serialNumberChange"
v-model="formInline.bussDocumentLibraryId">
<a-select-option v-for="(item, key) in projectNameList"
:key="key"
:value="item.id">
<span style="display: inline-block;width: 100%" :title=" item.serialNumber ">
{{ item.serialNumber}}
</span>
</a-select-option>
</a-select>
<codeNumber @regulation="regulation"/>
</a-form-model-item>
</div>
</a-col>
@@ -135,12 +123,12 @@
<span class="title-text-text" :title="$t('typeOfDeliverables')">{{$t('typeOfDeliverables')}}</span>
</div>
<a-form-model-item class="itemModel"
:prop="'dataList.'+index+'.deliverableType'"
:prop="'dataList.'+index+'.deliverable'"
:rules="[{ required: true, message: $t('typeOfDeliverables') + $t('cannotEmpty'), trigger: 'change'},]"
>
<a-tree-select
tree-node-filter-prop="title"
v-model="item.deliverableType"
v-model="item.deliverable"
:maxTagCount="1"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
class="box-input"
@@ -164,12 +152,16 @@
</template>
<script>
import codeNumber from './codeNumber'
import { getAction, postAction } from '@/api/manage'
import { mapGetters } from 'vuex'
export default {
name:"addModel",
props: ['url'],
components:{
codeNumber
},
data() {
return {
visible: false,
@@ -179,7 +171,7 @@ export default {
projectNameList: [],
DeliverableTreeList: [],
rules: {
serialNumber: [
regulation: [
{
required: true,
message: this.$t('entryName') + this.$t('regulationNo'),
@@ -229,6 +221,7 @@ export default {
handleSubmit() {
this.$refs.ruleForm.validate(valid => {
if (valid) {
this.formInline.authDummyInventoryBaseId = this.$route.query.id
let query = JSON.parse(JSON.stringify(this.formInline))
this.confirmLoading = true
postAction(this.url.addModel, query).then((res) => {
@@ -282,6 +275,10 @@ export default {
}
})
},
regulation(item,data) {
this.formInline.serialNumber = item
this.formInline.bussDocumentLibraryId = data
}
}
}
</script>
@@ -0,0 +1,355 @@
<template>
<div>
<a-input allowClear
@click="add"
:placeholder="$t('PleaseSelect')+$t('regulationNo')"
v-model="regulation"></a-input>
<a-drawer
:title="$t('regulationNo')"
:width="1000"
:visible="visible"
placement="right"
:maskClosable="false"
:closable="true"
@close="handleCancel"
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('standard')">
<span>{{$t('standard')}}</span>
</div>
<a-input class="box-input" :placeholder="$t('PleaseEnter')+$t('standard')"
v-model="queryParam.serial_number"></a-input>
</div>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :md="12" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('title')">
<span>{{$t('title')}}</span>
</div>
<a-input class="box-input" :placeholder="$t('PleaseEnter')+$t('title')"
v-model="queryParam.title"></a-input>
</div>
</a-col>
<a-col :md="12" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('status')">
<span>{{$t('status')}}</span>
</div>
<j-dict-select-tag class="box-input" v-model="queryParam.state"
:placeholder="$t('PleaseSelect')+$t('status')"
:type="'select'"
:triggerChange="false" :dictCode="'state'"/>
</div>
</a-col>
</template>
<span style="float: right;overflow: hidden;" class="table-page-search-submitButtons">
<a-col :md="12" :sm="24">
<globalAdvancedQuery ref="globalAdvancedQueryRef"
@handleSuperQuery="handleSuperQuery"
:fieldList="fieldList"/>
<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 @click="handleToggleSearch" style="margin-left: 8px">
{{ !toggleSearchStatus ? $t('open') : $t('away') }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</a-col>
</span>
</a-row>
</a-form>
</div>
<div style="width: 100%">
<a-table
:columns="columns"
:components="drag(columns,'columns')"
rowKey="id"
:scroll="{x: 1200}"
:data-source="dataList"
:pagination="false"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:loading="loading">
</a-table>
</div>
<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" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
</div>
</a-drawer>
</div>
</template>
<script>
import { getAction, postAction } from '@/api/manage'
import globalAdvancedQuery from '@/components/globalAdvancedQuery/index'
import { ResizeHeader, ResizeColumnProvide } from '@/mixins/header'
export default {
name: 'codeNumber',
components: {
globalAdvancedQuery
},
mixins: [ResizeHeader, ResizeColumnProvide],
data() {
return {
url: {
addModelList: '/dummy/dummyInventoryInfoEO/queryPageDummy',
},
selectedRowList: [],
visible:false,
queryParam: {},
regulation: '',
confirmLoading: false,
toggleSearchStatus: false,
columns: [
{
title: this.$t('standard'),
dataIndex: 'serial_number',
align: 'left',
ellipsis: true,
width: 228
},
{
title: this.$t('title'),
dataIndex: 'title',
align: 'left',
ellipsis: true,
width: 228
},
{
title: this.$t('zoneOfApplication'),
dataIndex: 'region',
align: 'left',
ellipsis: true,
width: 228
},
// {
// title: this.$t('status'),
// dataIndex: 'state',
// align: 'center',
// ellipsis: true
// },
// {
// title: this.$t('technicalField'),
// dataIndex: 'technology_territory',
// align: 'center',
// ellipsis: true
// },
{
title: this.$t('ImplementationDate'),
dataIndex: 'xin1_che1_xing2_shi2_shi1_ri4_qi1',
align: 'left',
ellipsis: true,
width: 228
},
{
title: this.$t('vehicleInProductionDate'),
dataIndex: 'implement_time',
align: 'left',
ellipsis: true,
width: 228
}
// {
// title: this.$t('correspondingStandard'),
// dataIndex: 'corresponding_standard',
// align: 'center',
// ellipsis: true
// }
],
dataList: [],
selectedRowKeys: [],
loading: false,
pageNo: 1,
pageSize: 10,
total: 0,
fieldList: [],
queryParamQuery: {},
queryConditionVOList: []
}
},
mounted() {
},
methods: {
handleToggleSearch() {
this.toggleSearchStatus = !this.toggleSearchStatus
},
add() {
this.visible = true
this.queryParam = {}
this.selectedRowKeys = []
this.queryConditionVOList = []
this.replacePage()
this.queryConditionInventory()
},
searchQuery() {
this.pageNo = 1
this.replacePage()
},
searchReset() {
this.pageNo = 1
this.queryParam = {}
this.queryConditionVOList = []
this.$refs.globalAdvancedQueryRef.resetLine()
this.$refs.globalAdvancedQueryRef.emitCallback()
this.replacePage()
},
onChange(page, pageSize) {
this.pageNo = page
this.replacePage()
},
SizeChange(page, pageSize) {
this.pageNo = 1
this.pageSize = pageSize
this.replacePage()
},
queryConditionInventory() {
let query = {
flag: 1
}
getAction(this.url.queryConditionInventory, query).then((res) => {
if (res.success) {
this.fieldList = res.result || []
} else {
this.fieldList = []
}
})
},
replacePage() {
let queryConditionVOList = JSON.parse(JSON.stringify(this.queryConditionVOList))
let query = {
pageNo: this.pageNo,
pageSize: this.pageSize,
...this.queryParam,
queryConditionVOList: JSON.stringify(queryConditionVOList)
}
this.loading = true
postAction(this.url.addModelList, query).then((res) => {
if (res.success) {
this.dataList = res.result.records || []
this.total = res.result.total
this.loading = false
} else {
this.dataList = []
this.total = 0
this.loading = false
}
})
},
onSelectChange(value,row) {
this.selectedRowKeys = value
this.selectedRowList = row
},
handleCancel() {
this.visible = false
},
handleSuperQuery(params, matchType) {
let sqp = {}
if (!params || (params && params.length == 0)) {
this.queryConditionVOList = []
this.$refs.globalAdvancedQueryRef.superQueryFlag = false
} else {
this.$refs.globalAdvancedQueryRef.superQueryFlag = true
this.queryConditionVOList = params
this.queryConditionVOList.forEach(res => {
res.type = matchType
})
}
this.replacePage()
},
handleSubmit() {
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
this.confirmLoading = true
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
if (this.selectedRowKeys.length < 2){
let fgid = ''
this.fgid = this.selectedRowList[0].id
this.regulation = this.selectedRowList[0].serial_number
this.confirmLoading = false
this.visible = false
this.$emit('regulation',this.regulation,this.fgid)
} else {
this.$message.warning(this.$t('OnlyOneSelected'))
this.confirmLoading = false
}
} else {
this.$message.warning(this.$t('selectLeastOne'))
this.confirmLoading = false
}
}
}
}
</script>
<style scoped>
.box-title-text {
line-height: 1.4;
display: flex;
align-items: center;
margin-bottom: 10px;
}
.title-text {
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: 100%;
height: 38px;
}
.box-button {
height: 38px;
}
.page {
text-align: right;
margin-top: 20px;
}
.drawer-bootom-button {
position: absolute;
bottom: 0;
width: 100%;
z-index: 100;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>
@@ -261,7 +261,7 @@ export default {
logList: '',//更新log
exportTemplate: '/authDummy/authDummyInventoryInfoEO/exportTemplate',//模板下载
exportData: '/authDummy/authDummyInventoryInfoEO/exportData',//导出
addModel: '/authDummy/authDummyInventoryInfoEO/add',//添加
addModel: '/authDummy/authDummyInventoryInfoEO/batchAdd',//添加
copyInfo: '/authDummy/authDummyInventoryInfoEO/copyInfoByIds',//复制
deleteBatch: '/authDummy/authDummyInventoryInfoEO/deleteBatch',//批量删除
editModel: '/authDummy/authDummyInventoryInfoEO/edit',//编辑