parent
bee34eae3a
commit
5f406ebdb9
@ -0,0 +1,441 @@
|
||||
<template>
|
||||
<div class="popupSelect-container">
|
||||
<div class="el-select" @click="openDialog">
|
||||
<el-input :placeholder="placeholder" v-model="innerValue" readonly :validate-event="false"
|
||||
@mouseenter.native="inputHovering = true" @mouseleave.native="inputHovering = false"
|
||||
:disabled="disabled">
|
||||
<template slot="suffix">
|
||||
<i v-show="!showClose"
|
||||
:class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up']"></i>
|
||||
<i v-if="showClose" class="el-select__caret el-input__icon el-icon-circle-close"
|
||||
@click="clear"></i>
|
||||
</template>
|
||||
</el-input>
|
||||
</div>
|
||||
<template v-if="popupType === 'dialog'">
|
||||
<el-dialog :title="popupTitle" :close-on-click-modal="false" :visible.sync="visible"
|
||||
v-if="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll append-to-body
|
||||
:width="popupWidth">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="计划所属单位名称">
|
||||
<el-input v-model="listQuery.unitName" placeholder="请输入关键词查询" clearable class="search-input" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="用途">
|
||||
<el-input v-model="listQuery.purpose" placeholder="请输入关键词查询" clearable class="search-input" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">
|
||||
{{ $t("common.search") }}
|
||||
</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">{{ $t("common.reset") }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
<div class="JNPF-common-search-box-right">
|
||||
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="initData()" />
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</el-row>
|
||||
<JNPF-table v-loading="listLoading" :data="list" :border="false" highlight-current-row
|
||||
@row-click="rowClick" :hasNO="false" @row-dblclick="dbRowClick">
|
||||
<el-table-column width="35">
|
||||
<template slot-scope="scope">
|
||||
<el-radio :label="scope.row[propsValue]" v-model="checked"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column type="index" width="50" label="序号" align="center" />
|
||||
<el-table-column :prop="item.value" :label="item.label" v-for="(item, i) in columnOptions"
|
||||
:key="i" />
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage"
|
||||
:limit.sync="listQuery.pageSize" @pagination="initData" v-if="hasPage" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false" size="small">{{
|
||||
$t("common.cancelButton")
|
||||
}}</el-button>
|
||||
<el-button type="primary" @click="select()" size="small">{{ $t("common.confirmButton") }}
|
||||
</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<template v-if="popupType === 'drawer'">
|
||||
<el-drawer :title="popupTitle" :visible.sync="visible" :wrapperClosable="false" ref="drawer"
|
||||
:size="popupWidth" append-to-body class="JNPF-common-drawer">
|
||||
<div class="JNPF-flex-main">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="计划所属单位名称">
|
||||
<el-input v-model="listQuery.unitName" placeholder="请输入关键词查询" clearable class="search-input" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="用途">
|
||||
<el-input v-model="listQuery.purpose" placeholder="请输入关键词查询" clearable class="search-input" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">
|
||||
{{ $t("common.search") }}
|
||||
</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">{{ $t("common.reset") }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
<div class="JNPF-common-search-box-right">
|
||||
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="initData()" />
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</el-row>
|
||||
<JNPF-table v-loading="listLoading" :data="list" :border="false" highlight-current-row
|
||||
@row-click="rowClick" :hasNO="false">
|
||||
<el-table-column width="35">
|
||||
<template slot-scope="scope">
|
||||
<el-radio :label="scope.row[propsValue]" v-model="checked"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column type="index" width="50" label="序号" align="center" />
|
||||
<el-table-column :prop="item.value" :label="item.label"
|
||||
v-for="(item, i) in columnOptions" :key="i" />
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage"
|
||||
:limit.sync="listQuery.pageSize" @pagination="initData" v-if="hasPage" />
|
||||
<div class="drawer-footer">
|
||||
<el-button @click="visible = false" size="small">{{ $t("common.cancelButton") }}
|
||||
</el-button>
|
||||
<el-button type="primary" @click="select()"
|
||||
size="small">{{ $t("common.confirmButton") }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getDataInterfaceDataSelect,
|
||||
getDataInterfaceDataInfoByIds
|
||||
} from "@/api/systemData/dataInterface";
|
||||
import emitter from "element-ui/src/mixins/emitter";
|
||||
let {
|
||||
methods: { dispatch }
|
||||
} = emitter;
|
||||
export default {
|
||||
name: "JnpfPopupSelectPaymentFundingPlanView",
|
||||
props: {
|
||||
value: {
|
||||
default: ""
|
||||
},
|
||||
rowIndex: {
|
||||
default: null
|
||||
},
|
||||
formData: {
|
||||
type: Object
|
||||
},
|
||||
templateJson: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
interfaceId: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
innerName: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: "请选择"
|
||||
},
|
||||
propsValue: {
|
||||
type: String,
|
||||
default: "id"
|
||||
},
|
||||
relationField: {
|
||||
type: String,
|
||||
default: "fullName"
|
||||
},
|
||||
popupType: {
|
||||
type: String,
|
||||
default: "dialog"
|
||||
},
|
||||
popupTitle: {
|
||||
type: String,
|
||||
default: "选择数据"
|
||||
},
|
||||
popupWidth: {
|
||||
type: String,
|
||||
default: "800px"
|
||||
},
|
||||
field: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
columnOptions: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
hasPage: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
pageSize: {
|
||||
type: Number,
|
||||
default: 20
|
||||
},
|
||||
multiple: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
clearable: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
model: {
|
||||
prop: "value",
|
||||
event: "input"
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
multipleSelectionItem: [],
|
||||
multipleSelection: [],
|
||||
list: [],
|
||||
innerValue: "",
|
||||
listQuery: {
|
||||
keyword: "",
|
||||
unitName: '',
|
||||
purpose: '',
|
||||
currentPage: 1,
|
||||
pageSize: 20
|
||||
},
|
||||
total: 0,
|
||||
checked: "",
|
||||
checkedTxt: "",
|
||||
checkedRow: {},
|
||||
listLoading: false,
|
||||
visible: false,
|
||||
inputHovering: false
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
value(val) {
|
||||
this.setDefault();
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
showClose() {
|
||||
let hasValue = this.multiple
|
||||
? Array.isArray(this.value) && this.value.length > 0
|
||||
: this.value !== undefined && this.value !== null && this.value !== "";
|
||||
let criteria =
|
||||
this.clearable && !this.disabled && this.inputHovering && hasValue;
|
||||
return criteria;
|
||||
},
|
||||
propsLabel() {
|
||||
return this.columnOptions[0].value;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.listQuery.pageSize = this.hasPage ? this.pageSize : 100000;
|
||||
this.setDefault();
|
||||
},
|
||||
methods: {
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelectionItem = val
|
||||
const res = val.map(item => item.id)
|
||||
this.multipleSelection = res
|
||||
},
|
||||
initData() {
|
||||
if (!this.interfaceId) return;
|
||||
this.listLoading = true;
|
||||
const paramList = this.getParamList();
|
||||
const columnOptions = this.columnOptions.map(o => o.value);
|
||||
if(this.listQuery.unitName == '' || this.listQuery.purpose == ''){
|
||||
this.list = [];
|
||||
this.total = 0;
|
||||
this.listLoading = false;
|
||||
return false;
|
||||
}else{
|
||||
paramList[0].defaultValue = this.listQuery.unitName;
|
||||
paramList[1].defaultValue = this.listQuery.purpose;
|
||||
}
|
||||
let query = {
|
||||
...this.listQuery,
|
||||
interfaceId: this.interfaceId,
|
||||
propsValue: this.propsValue,
|
||||
relationField: this.relationField,
|
||||
columnOptions: columnOptions.join(","),
|
||||
paramList
|
||||
};
|
||||
getDataInterfaceDataSelect(this.interfaceId, query)
|
||||
.then(res => {
|
||||
this.list = res.data.list;
|
||||
this.total = res.data.pagination.total;
|
||||
this.listLoading = false;
|
||||
})
|
||||
.catch(() => {
|
||||
this.listLoading = false;
|
||||
});
|
||||
},
|
||||
getParamList() {
|
||||
let templateJson = this.templateJson;
|
||||
if (!this.formData) return templateJson;
|
||||
for (let i = 0; i < templateJson.length; i++) {
|
||||
if (templateJson[i].relationField) {
|
||||
if (templateJson[i].relationField.includes("-")) {
|
||||
let tableVModel = templateJson[i].relationField.split("-")[0];
|
||||
let childVModel = templateJson[i].relationField.split("-")[1];
|
||||
templateJson[i].defaultValue =
|
||||
(this.formData[tableVModel] &&
|
||||
this.formData[tableVModel][this.rowIndex] &&
|
||||
this.formData[tableVModel][this.rowIndex][childVModel]) ||
|
||||
"";
|
||||
} else {
|
||||
templateJson[i].defaultValue =
|
||||
this.formData[templateJson[i].relationField] || "";
|
||||
}
|
||||
}
|
||||
}
|
||||
return templateJson;
|
||||
},
|
||||
interfaceDataHandler(data) {
|
||||
if (!data.dataProcessing) return data.list;
|
||||
const dataHandler = this.jnpf.getScriptFunc.call(
|
||||
this,
|
||||
data.dataProcessing
|
||||
);
|
||||
if (!dataHandler) return data.list;
|
||||
return dataHandler(data.list);
|
||||
},
|
||||
search() {
|
||||
if(this.listQuery.unitName == '' || this.listQuery.purpose == ''){
|
||||
this.$message({
|
||||
message: '请输入计划所属单位名称和用途查询',
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
})
|
||||
return false
|
||||
}
|
||||
this.initData();
|
||||
this.listQuery.currentPage = 1;
|
||||
this.listQuery.pageSize = this.hasPage ? this.pageSize : 10000;
|
||||
},
|
||||
reset() {
|
||||
this.listQuery.keyword = "";
|
||||
this.listQuery.currentPage = 1;
|
||||
this.listQuery.pageSize = this.hasPage ? this.pageSize : 10000;
|
||||
this.initData();
|
||||
},
|
||||
openDialog() {
|
||||
if (this.disabled) return;
|
||||
this.checked = this.value;
|
||||
this.visible = true;
|
||||
this.reset();
|
||||
},
|
||||
clear(event) {
|
||||
this.checked = "";
|
||||
this.innerValue = "";
|
||||
this.checkedRow = {};
|
||||
this.$emit("input", this.checked);
|
||||
this.$emit("change", this.checked, this.checkedRow, this.rowIndex);
|
||||
dispatch.call(this, "ElFormItem", "el.form.change", this.checked);
|
||||
event.stopPropagation();
|
||||
},
|
||||
select() {
|
||||
if (!this.checked) return;
|
||||
this.innerValue = this.checkedTxt;
|
||||
this.$emit("input", this.checked);
|
||||
this.$emit("change", this.checked, this.checkedRow, this.rowIndex);
|
||||
dispatch.call(this, "ElFormItem", "el.form.change", this.checked);
|
||||
this.visible = false;
|
||||
},
|
||||
rowClick(row) {
|
||||
if (this.checked == row[this.propsValue]) {
|
||||
this.select();
|
||||
} else {
|
||||
this.checked = row[this.propsValue];
|
||||
this.checkedTxt = row[this.relationField];
|
||||
this.checkedRow = row;
|
||||
}
|
||||
|
||||
},
|
||||
dbRowClick(row) {
|
||||
this.checked = row[this.propsValue];
|
||||
this.checkedTxt = row[this.relationField];
|
||||
this.checkedRow = row;
|
||||
this.select();
|
||||
},
|
||||
setDefault() {
|
||||
if (this.value) {
|
||||
if (!this.interfaceId) return;
|
||||
const paramList = this.getParamList();
|
||||
let query = {
|
||||
ids: [this.value],
|
||||
interfaceId: this.interfaceId,
|
||||
propsValue: this.propsValue,
|
||||
relationField: this.relationField,
|
||||
paramList
|
||||
};
|
||||
let that = this;
|
||||
getDataInterfaceDataInfoByIds(this.interfaceId, query).then(res => {
|
||||
const data = res.data && res.data.length ? res.data[0] : {};
|
||||
this.innerValue = data[this.relationField];
|
||||
if (!this.innerValue) {
|
||||
this.innerValue = this.innerName;
|
||||
}
|
||||
if (!this.field) return;
|
||||
let relationData = this.$store.state.generator.relationData;
|
||||
this.$set(relationData, this.field, data);
|
||||
this.$eventBus.$emit("popupAttrEventBus", relationData, this.field);
|
||||
this.$store.commit("generator/UPDATE_RELATION_DATA", relationData);
|
||||
});
|
||||
} else {
|
||||
this.innerValue = "";
|
||||
if (!this.field) return;
|
||||
let relationData = this.$store.state.generator.relationData;
|
||||
this.$set(relationData, this.field, {});
|
||||
this.$eventBus.$emit("popupAttrEventBus", relationData, this.field);
|
||||
this.$store.commit("generator/UPDATE_RELATION_DATA", relationData);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
>>> .el-dialog__body {
|
||||
height: 70vh;
|
||||
padding: 0 0 10px !important;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
|
||||
.JNPF-common-search-box {
|
||||
margin-bottom: 0;
|
||||
|
||||
.JNPF-common-search-box-right {
|
||||
padding: 10px 10px 0 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,441 @@
|
||||
<template>
|
||||
<div class="popupSelect-container">
|
||||
<div class="el-select" @click="openDialog">
|
||||
<el-input :placeholder="placeholder" v-model="innerValue" readonly :validate-event="false"
|
||||
@mouseenter.native="inputHovering = true" @mouseleave.native="inputHovering = false"
|
||||
:disabled="disabled">
|
||||
<template slot="suffix">
|
||||
<i v-show="!showClose"
|
||||
:class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up']"></i>
|
||||
<i v-if="showClose" class="el-select__caret el-input__icon el-icon-circle-close"
|
||||
@click="clear"></i>
|
||||
</template>
|
||||
</el-input>
|
||||
</div>
|
||||
<template v-if="popupType === 'dialog'">
|
||||
<el-dialog :title="popupTitle" :close-on-click-modal="false" :visible.sync="visible"
|
||||
v-if="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll append-to-body
|
||||
:width="popupWidth">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="银行">
|
||||
<el-input v-model="listQuery.bankName" placeholder="请输入关键词查询" clearable class="search-input" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="城市">
|
||||
<el-input v-model="listQuery.cityName" placeholder="请输入关键词查询" clearable class="search-input" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">
|
||||
{{ $t("common.search") }}
|
||||
</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">{{ $t("common.reset") }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
<div class="JNPF-common-search-box-right">
|
||||
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="initData()" />
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</el-row>
|
||||
<JNPF-table v-loading="listLoading" :data="list" :border="false" highlight-current-row
|
||||
@row-click="rowClick" :hasNO="false" @row-dblclick="dbRowClick">
|
||||
<el-table-column width="35">
|
||||
<template slot-scope="scope">
|
||||
<el-radio :label="scope.row[propsValue]" v-model="checked"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column type="index" width="50" label="序号" align="center" />
|
||||
<el-table-column :prop="item.value" :label="item.label" v-for="(item, i) in columnOptions"
|
||||
:key="i" />
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage"
|
||||
:limit.sync="listQuery.pageSize" @pagination="initData" v-if="hasPage" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false" size="small">{{
|
||||
$t("common.cancelButton")
|
||||
}}</el-button>
|
||||
<el-button type="primary" @click="select()" size="small">{{ $t("common.confirmButton") }}
|
||||
</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<template v-if="popupType === 'drawer'">
|
||||
<el-drawer :title="popupTitle" :visible.sync="visible" :wrapperClosable="false" ref="drawer"
|
||||
:size="popupWidth" append-to-body class="JNPF-common-drawer">
|
||||
<div class="JNPF-flex-main">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="银行">
|
||||
<el-input v-model="listQuery.bankName" placeholder="请输入关键词查询" clearable class="search-input" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="城市">
|
||||
<el-input v-model="listQuery.cityName" placeholder="请输入关键词查询" clearable class="search-input" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">
|
||||
{{ $t("common.search") }}
|
||||
</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">{{ $t("common.reset") }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
<div class="JNPF-common-search-box-right">
|
||||
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="initData()" />
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</el-row>
|
||||
<JNPF-table v-loading="listLoading" :data="list" :border="false" highlight-current-row
|
||||
@row-click="rowClick" :hasNO="false">
|
||||
<el-table-column width="35">
|
||||
<template slot-scope="scope">
|
||||
<el-radio :label="scope.row[propsValue]" v-model="checked"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column type="index" width="50" label="序号" align="center" />
|
||||
<el-table-column :prop="item.value" :label="item.label"
|
||||
v-for="(item, i) in columnOptions" :key="i" />
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage"
|
||||
:limit.sync="listQuery.pageSize" @pagination="initData" v-if="hasPage" />
|
||||
<div class="drawer-footer">
|
||||
<el-button @click="visible = false" size="small">{{ $t("common.cancelButton") }}
|
||||
</el-button>
|
||||
<el-button type="primary" @click="select()"
|
||||
size="small">{{ $t("common.confirmButton") }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getDataInterfaceDataSelect,
|
||||
getDataInterfaceDataInfoByIds
|
||||
} from "@/api/systemData/dataInterface";
|
||||
import emitter from "element-ui/src/mixins/emitter";
|
||||
let {
|
||||
methods: { dispatch }
|
||||
} = emitter;
|
||||
export default {
|
||||
name: "JnpfPopupSelectPaymentInterbankNumberView",
|
||||
props: {
|
||||
value: {
|
||||
default: ""
|
||||
},
|
||||
rowIndex: {
|
||||
default: null
|
||||
},
|
||||
formData: {
|
||||
type: Object
|
||||
},
|
||||
templateJson: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
interfaceId: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
innerName: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: "请选择"
|
||||
},
|
||||
propsValue: {
|
||||
type: String,
|
||||
default: "id"
|
||||
},
|
||||
relationField: {
|
||||
type: String,
|
||||
default: "fullName"
|
||||
},
|
||||
popupType: {
|
||||
type: String,
|
||||
default: "dialog"
|
||||
},
|
||||
popupTitle: {
|
||||
type: String,
|
||||
default: "选择数据"
|
||||
},
|
||||
popupWidth: {
|
||||
type: String,
|
||||
default: "800px"
|
||||
},
|
||||
field: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
columnOptions: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
hasPage: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
pageSize: {
|
||||
type: Number,
|
||||
default: 20
|
||||
},
|
||||
multiple: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
clearable: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
model: {
|
||||
prop: "value",
|
||||
event: "input"
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
multipleSelectionItem: [],
|
||||
multipleSelection: [],
|
||||
list: [],
|
||||
innerValue: "",
|
||||
listQuery: {
|
||||
keyword: "",
|
||||
bankName: '',
|
||||
cityName: '',
|
||||
currentPage: 1,
|
||||
pageSize: 20
|
||||
},
|
||||
total: 0,
|
||||
checked: "",
|
||||
checkedTxt: "",
|
||||
checkedRow: {},
|
||||
listLoading: false,
|
||||
visible: false,
|
||||
inputHovering: false
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
value(val) {
|
||||
this.setDefault();
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
showClose() {
|
||||
let hasValue = this.multiple
|
||||
? Array.isArray(this.value) && this.value.length > 0
|
||||
: this.value !== undefined && this.value !== null && this.value !== "";
|
||||
let criteria =
|
||||
this.clearable && !this.disabled && this.inputHovering && hasValue;
|
||||
return criteria;
|
||||
},
|
||||
propsLabel() {
|
||||
return this.columnOptions[0].value;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.listQuery.pageSize = this.hasPage ? this.pageSize : 100000;
|
||||
this.setDefault();
|
||||
},
|
||||
methods: {
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelectionItem = val
|
||||
const res = val.map(item => item.id)
|
||||
this.multipleSelection = res
|
||||
},
|
||||
initData() {
|
||||
if (!this.interfaceId) return;
|
||||
this.listLoading = true;
|
||||
const paramList = this.getParamList();
|
||||
const columnOptions = this.columnOptions.map(o => o.value);
|
||||
if(this.listQuery.bankName == '' || this.listQuery.cityName == ''){
|
||||
this.list = [];
|
||||
this.total = 0;
|
||||
this.listLoading = false;
|
||||
return false;
|
||||
}else{
|
||||
paramList[0].defaultValue = this.listQuery.bankName;
|
||||
paramList[1].defaultValue = this.listQuery.cityName;
|
||||
}
|
||||
let query = {
|
||||
...this.listQuery,
|
||||
interfaceId: this.interfaceId,
|
||||
propsValue: this.propsValue,
|
||||
relationField: this.relationField,
|
||||
columnOptions: columnOptions.join(","),
|
||||
paramList
|
||||
};
|
||||
getDataInterfaceDataSelect(this.interfaceId, query)
|
||||
.then(res => {
|
||||
this.list = res.data.list;
|
||||
this.total = res.data.pagination.total;
|
||||
this.listLoading = false;
|
||||
})
|
||||
.catch(() => {
|
||||
this.listLoading = false;
|
||||
});
|
||||
},
|
||||
getParamList() {
|
||||
let templateJson = this.templateJson;
|
||||
if (!this.formData) return templateJson;
|
||||
for (let i = 0; i < templateJson.length; i++) {
|
||||
if (templateJson[i].relationField) {
|
||||
if (templateJson[i].relationField.includes("-")) {
|
||||
let tableVModel = templateJson[i].relationField.split("-")[0];
|
||||
let childVModel = templateJson[i].relationField.split("-")[1];
|
||||
templateJson[i].defaultValue =
|
||||
(this.formData[tableVModel] &&
|
||||
this.formData[tableVModel][this.rowIndex] &&
|
||||
this.formData[tableVModel][this.rowIndex][childVModel]) ||
|
||||
"";
|
||||
} else {
|
||||
templateJson[i].defaultValue =
|
||||
this.formData[templateJson[i].relationField] || "";
|
||||
}
|
||||
}
|
||||
}
|
||||
return templateJson;
|
||||
},
|
||||
interfaceDataHandler(data) {
|
||||
if (!data.dataProcessing) return data.list;
|
||||
const dataHandler = this.jnpf.getScriptFunc.call(
|
||||
this,
|
||||
data.dataProcessing
|
||||
);
|
||||
if (!dataHandler) return data.list;
|
||||
return dataHandler(data.list);
|
||||
},
|
||||
search() {
|
||||
if(this.listQuery.bankName == '' || this.listQuery.cityName == ''){
|
||||
this.$message({
|
||||
message: '请输入银行和城市查询',
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
})
|
||||
return false
|
||||
}
|
||||
this.initData();
|
||||
this.listQuery.currentPage = 1;
|
||||
this.listQuery.pageSize = this.hasPage ? this.pageSize : 10000;
|
||||
},
|
||||
reset() {
|
||||
this.listQuery.keyword = "";
|
||||
this.listQuery.currentPage = 1;
|
||||
this.listQuery.pageSize = this.hasPage ? this.pageSize : 10000;
|
||||
this.initData();
|
||||
},
|
||||
openDialog() {
|
||||
if (this.disabled) return;
|
||||
this.checked = this.value;
|
||||
this.visible = true;
|
||||
this.reset();
|
||||
},
|
||||
clear(event) {
|
||||
this.checked = "";
|
||||
this.innerValue = "";
|
||||
this.checkedRow = {};
|
||||
this.$emit("input", this.checked);
|
||||
this.$emit("change", this.checked, this.checkedRow, this.rowIndex);
|
||||
dispatch.call(this, "ElFormItem", "el.form.change", this.checked);
|
||||
event.stopPropagation();
|
||||
},
|
||||
select() {
|
||||
if (!this.checked) return;
|
||||
this.innerValue = this.checkedTxt;
|
||||
this.$emit("input", this.checked);
|
||||
this.$emit("change", this.checked, this.checkedRow, this.rowIndex);
|
||||
dispatch.call(this, "ElFormItem", "el.form.change", this.checked);
|
||||
this.visible = false;
|
||||
},
|
||||
rowClick(row) {
|
||||
if (this.checked == row[this.propsValue]) {
|
||||
this.select();
|
||||
} else {
|
||||
this.checked = row[this.propsValue];
|
||||
this.checkedTxt = row[this.relationField];
|
||||
this.checkedRow = row;
|
||||
}
|
||||
|
||||
},
|
||||
dbRowClick(row) {
|
||||
this.checked = row[this.propsValue];
|
||||
this.checkedTxt = row[this.relationField];
|
||||
this.checkedRow = row;
|
||||
this.select();
|
||||
},
|
||||
setDefault() {
|
||||
if (this.value) {
|
||||
if (!this.interfaceId) return;
|
||||
const paramList = this.getParamList();
|
||||
let query = {
|
||||
ids: [this.value],
|
||||
interfaceId: this.interfaceId,
|
||||
propsValue: this.propsValue,
|
||||
relationField: this.relationField,
|
||||
paramList
|
||||
};
|
||||
let that = this;
|
||||
getDataInterfaceDataInfoByIds(this.interfaceId, query).then(res => {
|
||||
const data = res.data && res.data.length ? res.data[0] : {};
|
||||
this.innerValue = data[this.relationField];
|
||||
if (!this.innerValue) {
|
||||
this.innerValue = this.innerName;
|
||||
}
|
||||
if (!this.field) return;
|
||||
let relationData = this.$store.state.generator.relationData;
|
||||
this.$set(relationData, this.field, data);
|
||||
this.$eventBus.$emit("popupAttrEventBus", relationData, this.field);
|
||||
this.$store.commit("generator/UPDATE_RELATION_DATA", relationData);
|
||||
});
|
||||
} else {
|
||||
this.innerValue = "";
|
||||
if (!this.field) return;
|
||||
let relationData = this.$store.state.generator.relationData;
|
||||
this.$set(relationData, this.field, {});
|
||||
this.$eventBus.$emit("popupAttrEventBus", relationData, this.field);
|
||||
this.$store.commit("generator/UPDATE_RELATION_DATA", relationData);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
>>> .el-dialog__body {
|
||||
height: 70vh;
|
||||
padding: 0 0 10px !important;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
|
||||
.JNPF-common-search-box {
|
||||
margin-bottom: 0;
|
||||
|
||||
.JNPF-common-search-box-right {
|
||||
padding: 10px 10px 0 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,134 @@
|
||||
<template>
|
||||
<el-dialog title="选择结算单" :close-on-click-modal="false" :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center"
|
||||
lock-scroll append-to-body width="800px">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="关键字">
|
||||
<el-input v-model="keyword" placeholder="请输入关键字查询" clearable @keyup.enter.native="search()" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">{{ $t('common.search') }}
|
||||
</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="refresh()">{{ $t('common.reset') }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
<div class="JNPF-common-search-box-right">
|
||||
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false" @click="search()" />
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</el-row>
|
||||
<JNPF-table v-loading="listLoading" :data="list" hasC @selection-change="handleSelectionChange" :border="false">
|
||||
<el-table-column prop="interbankNumber" label="联行号" align="center" width="200">
|
||||
</el-table-column>
|
||||
<el-table-column prop="bankName" label="银行开户行名称" align="center" width="250">
|
||||
</el-table-column>
|
||||
<el-table-column prop="province" label="开户行所在省" align="center" width="150">
|
||||
</el-table-column>
|
||||
<el-table-column prop="city" label="开户行所在市" align="center" width="150">
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="init" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">{{ $t('common.cancelButton') }}</el-button>
|
||||
<el-button type="primary" @click="select()">{{ $t('common.confirmButton') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import {
|
||||
GoodsList
|
||||
} from '@/api/extend/order'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
listLoading: true,
|
||||
keyword: '',
|
||||
list: [],
|
||||
total: 0,
|
||||
listQuery: {
|
||||
superQueryJson: '',
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "",
|
||||
},
|
||||
checked: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.visible = true
|
||||
this.listLoading = true
|
||||
let query = {
|
||||
...this.listQuery,
|
||||
keyword: this.keyword,
|
||||
dataType: 0,
|
||||
type: 1,
|
||||
menuId: '532534180186188741',
|
||||
}
|
||||
/* GoodsList(query).then(res => {
|
||||
this.list = res.data.list
|
||||
this.listLoading = false
|
||||
}) */
|
||||
request({
|
||||
url: `/api/scm/PaymentApplication/getBankList`,
|
||||
method: 'post',
|
||||
data: query
|
||||
}).then(res => {
|
||||
this.list = res.data.list
|
||||
this.listLoading = false
|
||||
this.total = res.data.pagination.total
|
||||
})
|
||||
},
|
||||
refresh() {
|
||||
this.keyword = ''
|
||||
this.listQuery.currentPage = 1
|
||||
this.listQuery.pageSize = 20
|
||||
this.listQuery.sort = "desc"
|
||||
this.listQuery.sidx = ""
|
||||
this.init()
|
||||
},
|
||||
search() {
|
||||
this.listQuery.currentPage = 1
|
||||
this.listQuery.pageSize = 20
|
||||
this.listQuery.sort = "desc"
|
||||
this.listQuery.sidx = ""
|
||||
this.init()
|
||||
},
|
||||
select() {
|
||||
if (!this.checked.length) return
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList', this.checked)
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.checked = val
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
>>>.el-dialog__body {
|
||||
height: 70vh;
|
||||
padding: 0 0 10px !important;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
|
||||
.JNPF-common-search-box {
|
||||
margin-bottom: 0;
|
||||
|
||||
.JNPF-common-search-box-right {
|
||||
padding: 10px 10px 0 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
Loading…
Reference in new issue