修改标准选择

This commit is contained in:
qq787203167
2022-03-01 11:42:52 +08:00
parent 6b0404ceaa
commit 78a9d15bd5
4 changed files with 194 additions and 39 deletions
@@ -6,7 +6,8 @@
<!-- <span :class="{'title-text-text':false}">{{query.enName}}</span><br>-->
<!-- <span :class="{'title-text-text':false}">{{query.name}}</span>-->
<!-- </div>-->
<a-input class="box-input" :value="value" @input="indexclick($event)" :placeholder="$t('PleaseEnterOrSelect')+query.db_field_txt"/>
<a-input class="box-input" :value="value" @input="indexclick($event)"
:placeholder="$t('PleaseEnterOrSelect')+query.db_field_txt"/>
<a-button type="primary" class="button-box" @click="standardClick">
标准选择
</a-button>
@@ -20,32 +21,12 @@
@close="handleCancel"
:visible="visible"
style="height: 100%;overflow: auto;padding-bottom: 53px;">
<a-form layout="inline" @keyup.enter.native="searchQuery" style="margin-bottom: 20px">
<a-row :gutter="24">
<a-col :md="6" :sm="8" style="line-height: 48px">
<div class="box-title-text-index">
<div class="title-text-index">
<span>{{$t('standard')}}</span>
</div>
<a-input class="box-input-index" :placeholder="this.$t('PleaseEnter') +' '+ this.$t('standard')"
v-model="queryParam.serialNumber"></a-input>
</div>
</a-col>
<a-col :md="6" :sm="8" style="line-height: 48px">
<div class="box-title-text-index">
<div class="title-text-index">
<span>{{$t('title')}}</span>
</div>
<a-input class="box-input-index" :placeholder="this.$t('PleaseEnter') +' '+ this.$t('title')"
v-model="queryParam.title"></a-input>
</div>
</a-col>
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<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>
</span>
</a-row>
</a-form>
<currencySearch
:flag="'1'"
:url="url"
@searchQuery="searchQuery"
@searchReset="searchReset"
/>
<a-table
:columns="columns"
rowKey="id"
@@ -76,10 +57,14 @@
<script>
import { getAction, postAction } from '@/api/manage'
import currencySearch from '@/components/currencySearch/index'
export default {
name: 'index',
props: ['query', 'value'],
components:{
currencySearch
},
props: ['query', 'value', 'replace_standard_id'],
data() {
return {
visible: false,
@@ -92,23 +77,26 @@
{
title: this.$t('standard'),
dataIndex: 'serial_number',
align: 'center',
align: 'center'
},
{
title: this.$t('title'),
dataIndex: 'title',
align: 'center',
align: 'center'
},
{
title: this.$t('TextStatus'),
dataIndex: 'state',
align: 'center',
align: 'center'
}
],
dataList: [],
pageNo: 1,
pageSize: 10,
total: 0
total: 0,
url: {
seachList: 'document/bussDocumentLibraryEO/queryCondition' //搜索字段
}
}
},
mounted() {
@@ -118,7 +106,7 @@
standardClick() {
this.visible = true
this.queryParam = {}
this.replacePage()
this.replacePage(this.replace_standard_id)
},
replacePage() {
let query = {
@@ -126,12 +114,16 @@
pageNo: this.pageNo,
pageSize: this.pageSize
}
this.selectedRowKeys = []
this.loading = true
postAction('document/bussDocumentLibraryEO/replacePageInfo', query).then((res) => {
this.loading = false
if (res.success) {
this.dataList = res.result.records
this.total = res.result.total
if (this.replace_standard_id) {
this.selectedRowKeys = this.replace_standard_id.split(',')
}
} else {
this.dataList = []
}
@@ -142,10 +134,13 @@
},
handleSubmit() {
let content = []
let replace_standard_id = []
this.content.forEach(res => {
content.push(res.title)
replace_standard_id.push(res.id)
})
this.$emit('input', content.join(','))
this.$emit('change', replace_standard_id.join(','))
this.visible = false
},
indexclick(event) {
@@ -162,11 +157,12 @@
})
})
},
searchQuery() {
searchQuery(queryParam) {
this.queryParam = queryParam
this.replacePage()
},
searchReset() {
this.queryParam = {}
searchReset(queryParam) {
this.queryParam = queryParam
this.replacePage()
},
onChange(page, pageSize) {
@@ -176,7 +172,7 @@
SizeChange(page, pageSize) {
this.pageSize = pageSize
this.replacePage()
},
}
}
}
</script>
@@ -237,6 +233,7 @@
height: 38px;
margin-top: 2px;
}
.page {
text-align: right;
margin-top: 20px;
@@ -0,0 +1,154 @@
<template>
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="12" :sm="8" v-for="(item,index) in searchList" :key="index" style="line-height: 48px">
<template>
<div class="box-title-text" v-if="item.field_show_type == '1'">
<div class="title-text" :title="item.db_field_txt">
<span>{{item.db_field_txt}}</span>
</div>
<a-input class="box-input" :placeholder="$t('PleaseEnter')+item.db_field_txt"
v-model="queryParam[item.db_field_name]"></a-input>
</div>
<div class="box-title-text" v-if="item.field_show_type == '2'">
<div class="title-text" :title="item.db_field_txt">
<span>{{item.db_field_txt}}</span>
</div>
<a-input-number class="box-input" :placeholder="$t('PleaseEnter')+item.db_field_txt"
v-model="queryParam[item.db_field_name]" :min="1" :max="99999999"/>
</div>
<div class="box-title-text" v-else-if="item.field_show_type == '3'">
<div class="title-text" :title="item.db_field_txt">
<span>{{item.db_field_txt}}</span>
</div>
<j-multi-select-tag class="box-input" v-model="queryParam[item.db_field_name]"
:placeholder="$t('PleaseSelect')+item.db_field_txt" :type="'select'"
:triggerChange="false" :dictCode="item.dict_field"/>
</div>
<div class="box-title-text" v-else-if="item.field_show_type == '6'">
<div class="title-text" :title="item.db_field_txt">
<span>{{item.db_field_txt}}</span>
</div>
<a-range-picker class="box-input" v-model="queryParam[item.db_field_name]"
:placeholder="$t('PleaseSelect')+item.db_field_txt"
@change="onChange(item.db_field_name)"></a-range-picker>
</div>
<div class="box-title-text" v-else-if="item.field_show_type == '5'">
<div class="title-text" :title="item.db_field_txt">
<span>{{item.db_field_txt}}</span>
</div>
<a-date-picker class="box-input"
:placeholder="$t('PleaseSelect')+item.db_field_txt"
@change="dateChange(item.db_field_name)"
v-model="queryParam[item.db_field_name]"/>
</div>
<div class="box-title-text" v-else-if="item.field_show_type == '4'">
<div class="title-text" :title="item.db_field_txt">
<span>{{item.db_field_txt}}</span>
</div>
<j-dict-select-tag class="box-input" v-model="queryParam[item.db_field_name]"
:placeholder="$t('PleaseSelect')+item.db_field_txt"
:type="'select'"
:triggerChange="false" :dictCode="item.dict_field"/>
</div>
</template>
</a-col>
<span style="float: right;overflow: hidden;margin-right: 41px;margin-bottom: 20px" class="table-page-search-submitButtons">
<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>
</span>
</a-row>
</a-form>
</template>
<script>
import moment from 'moment'
import { getAction } from '@/api/manage'
export default {
name: 'index',
props: {
url: {
type: Object,
default: {}
},
flag: {
type: String,
default: ''
}
},
data() {
return {
queryParam: {},
toggleSearchStatus: false,
searchList: []
}
},
mounted() {
this.getSeach()
},
methods: {
searchQuery() {
this.$emit('searchQuery', this.queryParam)
},
searchReset() {
this.queryParam = {}
this.$emit('searchReset', this.queryParam)
},
getSeach() {
let params = {
flag: this.flag
}
getAction(this.url.seachList, params).then((res) => {
if (res.success) {
this.searchList = res.result
}
})
},
dateChange(item) {
this.queryParam[item] = moment(this.queryParam[item]).format('YYYY-MM-DD')
},
onChange(item) {
let dateOne = moment(this.queryParam[item][0]).format('YYYY-MM-DD')
let dateTwo = moment(this.queryParam[item][1]).format('YYYY-MM-DD')
this.queryParam[item] = [dateOne, dateTwo]
}
}
}
</script>
<style scoped>
.box-title-text {
line-height: 1.4;
display: flex;
align-items: center;
margin-bottom: 10px;
}
.title-text {
width: 20%;
min-width: 90px;
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;
/*margin-top: 2px;*/
}
</style>
@@ -156,7 +156,9 @@
</div>
<a-form-model-item class="itemModel" :prop="item.db_field_name">
<Standardselection :query="item"
@change="StandardselectionChange"
:disabled="disabled"
:replace_standard_id="formInline.replace_standard_id"
v-model="formInline[item.db_field_name]"/>
</a-form-model-item>
</div>
@@ -475,7 +477,10 @@
},
add() {
this.formInline = {}
}
},
StandardselectionChange(id){
this.formInline.replace_standard_id = id
},
}
}
</script>
-1
View File
@@ -105,7 +105,6 @@
getAction(this.url.seachList, params).then((res) => {
if (res.success) {
this.searchList = res.result
console.log(this.searchList)
}
})
},