修复关联销售合同

jg-waiwang-pro
mhsnet 6 months ago
parent 4677e8bbc9
commit 9bd0ec9a99

@ -48,7 +48,7 @@ public class ContractLEntity {
@TableField(value = "BUSINESS_ID" , updateStrategy = FieldStrategy.IGNORED) @TableField(value = "BUSINESS_ID" , updateStrategy = FieldStrategy.IGNORED)
private String businessId; private String businessId;
@TableField(value = "RELATED_CONTRACT_ID" , updateStrategy = FieldStrategy.IGNORED) @TableField(value = "RELATED_CONTRACT_ID" , updateStrategy = FieldStrategy.IGNORED)
private Long relatedContractId; private String relatedContractId;
@TableField("BUSINESS_TYPE") @TableField("BUSINESS_TYPE")
private String businessType; private String businessType;
@TableField("DECLARATION_TIME") @TableField("DECLARATION_TIME")

@ -46,7 +46,7 @@ public class ContractsEntity {
@TableField("BUSINESS_ID") @TableField("BUSINESS_ID")
private String businessId; private String businessId;
@TableField("RELATED_CONTRACT_ID") @TableField("RELATED_CONTRACT_ID")
private Long relatedContractId; private String relatedContractId;
@TableField("BUSINESS_TYPE") @TableField("BUSINESS_TYPE")
private String businessType; private String businessType;
@TableField("DECLARATION_TIME") @TableField("DECLARATION_TIME")

@ -1,114 +1,220 @@
<template> <template>
<div class="popupSelect-container"> <div class="popupSelect-container">
<div class="el-select" @click="openDialog"> <div class="el-select" @click="openDialog">
<el-input :placeholder="placeholder" v-model="innerValue" readonly :validate-event="false" <el-input
@mouseenter.native="inputHovering = true" @mouseleave.native="inputHovering = false" :placeholder="placeholder"
:disabled="disabled"> v-model="innerValue"
readonly
:validate-event="false"
@mouseenter.native="inputHovering = true"
@mouseleave.native="inputHovering = false"
:disabled="disabled"
>
<template slot="suffix"> <template slot="suffix">
<i v-show="!showClose" <i
:class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up']"></i> v-show="!showClose"
<i v-if="showClose" class="el-select__caret el-input__icon el-icon-circle-close" :class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up']"
@click="clear"></i> ></i>
<i
v-if="showClose"
class="el-select__caret el-input__icon el-icon-circle-close"
@click="clear"
></i>
</template> </template>
</el-input> </el-input>
</div> </div>
<template v-if="popupType === 'dialog'"> <template v-if="popupType === 'dialog'">
<el-dialog :title="popupTitle" :close-on-click-modal="false" :visible.sync="visible" <el-dialog
v-if="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll append-to-body :title="popupTitle"
:width='popupWidth'> :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-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent> <el-form @submit.native.prevent>
<el-col :span="10"> <el-col :span="10">
<el-form-item label="关键词"> <el-form-item label="关键词">
<el-input v-model="listQuery.keyword" placeholder="请输入关键词查询" clearable <el-input
@keyup.enter.native="search()" class="search-input" /> v-model="listQuery.keyword"
placeholder="请输入关键词查询"
clearable
@keyup.enter.native="search()"
class="search-input"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"> <el-button
{{ $t('common.search') }} type="primary"
icon="el-icon-search"
@click="search()"
>
{{ $t("common.search") }}
</el-button> </el-button>
<el-button icon="el-icon-refresh-right" @click="reset()">{{ $t('common.reset') }} <el-button icon="el-icon-refresh-right" @click="reset()"
>{{ $t("common.reset") }}
</el-button> </el-button>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
<div class="JNPF-common-search-box-right"> <div class="JNPF-common-search-box-right">
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top"> <el-tooltip
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false" effect="dark"
@click="initData()" /> :content="$t('common.refresh')"
placement="top"
>
<el-link
icon="icon-ym icon-ym-Refresh JNPF-common-head-icon"
:underline="false"
@click="initData()"
/>
</el-tooltip> </el-tooltip>
</div> </div>
</el-row> </el-row>
<JNPF-table v-loading="listLoading" :data="list" :border="false" highlight-current-row <JNPF-table
@row-click="rowClick" :hasNO="false"> v-loading="listLoading"
:data="list"
:border="false"
highlight-current-row
@row-click="rowClick"
:hasNO="false"
>
<el-table-column width="35"> <el-table-column width="35">
<template slot-scope="scope"> <template slot-scope="scope">
<el-radio :label="scope.row[propsValue]" v-model="checked">&nbsp;</el-radio> <el-radio :label="scope.row[propsValue]" v-model="checked"
>&nbsp;</el-radio
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column type="index" width="50" label="序号" align="center" /> <el-table-column
<el-table-column :prop="item.value" :label="item.label" v-for="(item, i) in columnOptions" type="index"
:key="i" /> width="50"
label="序号"
align="center"
/>
<el-table-column
:prop="item.value"
:label="item.label"
v-for="(item, i) in columnOptions"
:key="i"
/>
</JNPF-table> </JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" <pagination
:limit.sync="listQuery.pageSize" @pagination="initData" v-if="hasPage" /> :total="total"
:page.sync="listQuery.currentPage"
:limit.sync="listQuery.pageSize"
@pagination="initData"
v-if="hasPage"
/>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="visible = false" <el-button @click="visible = false" size="small">{{
size="small">{{ $t('common.cancelButton') }}</el-button> $t("common.cancelButton")
<el-button type="primary" @click="select()" size="small">{{ $t('common.confirmButton') }} }}</el-button>
<el-button type="primary" @click="select()" size="small"
>{{ $t("common.confirmButton") }}
</el-button> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</template> </template>
<template v-if="popupType === 'drawer'"> <template v-if="popupType === 'drawer'">
<el-drawer :title="popupTitle" :visible.sync="visible" :wrapperClosable="false" ref="drawer" <el-drawer
:size='popupWidth' append-to-body class="JNPF-common-drawer"> :title="popupTitle"
:visible.sync="visible"
:wrapperClosable="false"
ref="drawer"
:size="popupWidth"
append-to-body
class="JNPF-common-drawer"
>
<div class="JNPF-flex-main"> <div class="JNPF-flex-main">
<el-row class="JNPF-common-search-box" :gutter="16"> <el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent> <el-form @submit.native.prevent>
<el-col :span="10"> <el-col :span="10">
<el-form-item label="关键词"> <el-form-item label="关键词">
<el-input v-model="listQuery.keyword" placeholder="请输入关键词查询" clearable <el-input
@keyup.enter.native="search()" class="search-input" /> v-model="listQuery.keyword"
placeholder="请输入关键词查询"
clearable
@keyup.enter.native="search()"
class="search-input"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"> <el-button
{{ $t('common.search') }} type="primary"
icon="el-icon-search"
@click="search()"
>
{{ $t("common.search") }}
</el-button> </el-button>
<el-button icon="el-icon-refresh-right" @click="reset()">{{ $t('common.reset') }} <el-button icon="el-icon-refresh-right" @click="reset()"
>{{ $t("common.reset") }}
</el-button> </el-button>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
<div class="JNPF-common-search-box-right"> <div class="JNPF-common-search-box-right">
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top"> <el-tooltip
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false" effect="dark"
@click="initData()" /> :content="$t('common.refresh')"
placement="top"
>
<el-link
icon="icon-ym icon-ym-Refresh JNPF-common-head-icon"
:underline="false"
@click="initData()"
/>
</el-tooltip> </el-tooltip>
</div> </div>
</el-row> </el-row>
<JNPF-table v-loading="listLoading" :data="list" :border="false" highlight-current-row <JNPF-table
@row-click="rowClick" :hasNO="false"> v-loading="listLoading"
:data="list"
:border="false"
highlight-current-row
@row-click="rowClick"
:hasNO="false"
>
<el-table-column width="35"> <el-table-column width="35">
<template slot-scope="scope"> <template slot-scope="scope">
<el-radio :label="scope.row[propsValue]" v-model="checked">&nbsp;</el-radio> <el-radio :label="scope.row[propsValue]" v-model="checked"
>&nbsp;</el-radio
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column type="index" width="50" label="序号" align="center" /> <el-table-column
<el-table-column :prop="item.value" :label="item.label" type="index"
v-for="(item, i) in columnOptions" :key="i" /> width="50"
label="序号"
align="center"
/>
<el-table-column
:prop="item.value"
:label="item.label"
v-for="(item, i) in columnOptions"
:key="i"
/>
</JNPF-table> </JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" <pagination
:limit.sync="listQuery.pageSize" @pagination="initData" v-if="hasPage" /> :total="total"
:page.sync="listQuery.currentPage"
:limit.sync="listQuery.pageSize"
@pagination="initData"
v-if="hasPage"
/>
<div class="drawer-footer"> <div class="drawer-footer">
<el-button @click="visible = false" size="small">{{ $t('common.cancelButton') }} <el-button @click="visible = false" size="small"
>{{ $t("common.cancelButton") }}
</el-button> </el-button>
<el-button type="primary" @click="select()" <el-button type="primary" @click="select()" size="small"
size="small">{{ $t('common.confirmButton') }} >{{ $t("common.confirmButton") }}
</el-button> </el-button>
</div> </div>
</div> </div>
@ -118,14 +224,19 @@
</template> </template>
<script> <script>
import { getDataInterfaceDataSelect, getDataInterfaceDataInfoByIds } from '@/api/systemData/dataInterface' import {
import emitter from 'element-ui/src/mixins/emitter' getDataInterfaceDataSelect,
let { methods: { dispatch } } = emitter getDataInterfaceDataInfoByIds
} from "@/api/systemData/dataInterface";
import emitter from "element-ui/src/mixins/emitter";
let {
methods: { dispatch }
} = emitter;
export default { export default {
name: 'JnpfPopupSelect', name: "JnpfPopupSelect",
props: { props: {
value: { value: {
default: '' default: ""
}, },
rowIndex: { rowIndex: {
default: null default: null
@ -139,39 +250,39 @@ export default {
}, },
interfaceId: { interfaceId: {
type: String, type: String,
default: '' default: ""
}, },
innerName: { innerName: {
type: String, type: String,
default: '' default: ""
}, },
placeholder: { placeholder: {
type: String, type: String,
default: '请选择' default: "请选择"
}, },
propsValue: { propsValue: {
type: String, type: String,
default: 'id' default: "id"
}, },
relationField: { relationField: {
type: String, type: String,
default: 'fullName' default: "fullName"
}, },
popupType: { popupType: {
type: String, type: String,
default: 'dialog' default: "dialog"
}, },
popupTitle: { popupTitle: {
type: String, type: String,
default: '选择数据' default: "选择数据"
}, },
popupWidth: { popupWidth: {
type: String, type: String,
default: '800px' default: "800px"
}, },
field: { field: {
type: String, type: String,
default: '' default: ""
}, },
columnOptions: { columnOptions: {
type: Array, type: Array,
@ -199,168 +310,177 @@ export default {
} }
}, },
model: { model: {
prop: 'value', prop: "value",
event: 'input' event: "input"
}, },
data() { data() {
return { return {
list: [], list: [],
innerValue: '', innerValue: "",
listQuery: { listQuery: {
keyword: '', keyword: "",
currentPage: 1, currentPage: 1,
pageSize: 20 pageSize: 20
}, },
total: 0, total: 0,
checked: '', checked: "",
checkedTxt: '', checkedTxt: "",
checkedRow: {}, checkedRow: {},
listLoading: false, listLoading: false,
visible: false, visible: false,
inputHovering: false, inputHovering: false
} };
}, },
watch: { watch: {
value(val) { value(val) {
this.setDefault() this.setDefault();
} }
}, },
computed: { computed: {
showClose() { showClose() {
let hasValue = this.multiple let hasValue = this.multiple
? Array.isArray(this.value) && this.value.length > 0 ? Array.isArray(this.value) && this.value.length > 0
: this.value !== undefined && this.value !== null && this.value !== ''; : this.value !== undefined && this.value !== null && this.value !== "";
let criteria = this.clearable && let criteria =
!this.disabled && this.clearable && !this.disabled && this.inputHovering && hasValue;
this.inputHovering &&
hasValue;
return criteria; return criteria;
}, },
propsLabel() { propsLabel() {
return this.columnOptions[0].value return this.columnOptions[0].value;
} }
}, },
created() { created() {
this.listQuery.pageSize = this.hasPage ? this.pageSize : 100000 this.listQuery.pageSize = this.hasPage ? this.pageSize : 100000;
this.setDefault() this.setDefault();
}, },
methods: { methods: {
initData() { initData() {
if (!this.interfaceId) return if (!this.interfaceId) return;
this.listLoading = true this.listLoading = true;
const paramList = this.getParamList() const paramList = this.getParamList();
const columnOptions = this.columnOptions.map(o => o.value) const columnOptions = this.columnOptions.map(o => o.value);
let query = { let query = {
...this.listQuery, ...this.listQuery,
interfaceId: this.interfaceId, interfaceId: this.interfaceId,
propsValue: this.propsValue, propsValue: this.propsValue,
relationField: this.relationField, relationField: this.relationField,
columnOptions: columnOptions.join(','), columnOptions: columnOptions.join(","),
paramList paramList
} };
getDataInterfaceDataSelect(this.interfaceId, query).then(res => { getDataInterfaceDataSelect(this.interfaceId, query)
this.list = res.data.list .then(res => {
this.total = res.data.pagination.total this.list = res.data.list;
this.listLoading = false this.total = res.data.pagination.total;
}).catch(() => { this.listLoading = false }) this.listLoading = false;
})
.catch(() => {
this.listLoading = false;
});
}, },
getParamList() { getParamList() {
let templateJson = this.templateJson let templateJson = this.templateJson;
if (!this.formData) return templateJson if (!this.formData) return templateJson;
for (let i = 0; i < templateJson.length; i++) { for (let i = 0; i < templateJson.length; i++) {
if (templateJson[i].relationField) { if (templateJson[i].relationField) {
if (templateJson[i].relationField.includes('-')) { if (templateJson[i].relationField.includes("-")) {
let tableVModel = templateJson[i].relationField.split('-')[0] let tableVModel = templateJson[i].relationField.split("-")[0];
let childVModel = templateJson[i].relationField.split('-')[1] let childVModel = templateJson[i].relationField.split("-")[1];
templateJson[i].defaultValue = this.formData[tableVModel] && this.formData[tableVModel][this.rowIndex] && this.formData[tableVModel][this.rowIndex][childVModel] || '' templateJson[i].defaultValue =
(this.formData[tableVModel] &&
this.formData[tableVModel][this.rowIndex] &&
this.formData[tableVModel][this.rowIndex][childVModel]) ||
"";
} else { } else {
templateJson[i].defaultValue = this.formData[templateJson[i].relationField] || '' templateJson[i].defaultValue =
this.formData[templateJson[i].relationField] || "";
} }
} }
} }
return templateJson return templateJson;
}, },
interfaceDataHandler(data) { interfaceDataHandler(data) {
if (!data.dataProcessing) return data.list if (!data.dataProcessing) return data.list;
const dataHandler = this.jnpf.getScriptFunc.call(this, data.dataProcessing) const dataHandler = this.jnpf.getScriptFunc.call(
if (!dataHandler) return data.list this,
return dataHandler(data.list) data.dataProcessing
);
if (!dataHandler) return data.list;
return dataHandler(data.list);
}, },
search() { search() {
this.initData() this.initData();
this.listQuery.currentPage = 1 this.listQuery.currentPage = 1;
this.listQuery.pageSize = this.hasPage ? this.pageSize : 10000 this.listQuery.pageSize = this.hasPage ? this.pageSize : 10000;
}, },
reset() { reset() {
this.listQuery.keyword = '' this.listQuery.keyword = "";
this.listQuery.currentPage = 1 this.listQuery.currentPage = 1;
this.listQuery.pageSize = this.hasPage ? this.pageSize : 10000 this.listQuery.pageSize = this.hasPage ? this.pageSize : 10000;
this.initData() this.initData();
}, },
openDialog() { openDialog() {
if (this.disabled) return if (this.disabled) return;
this.checked = this.value this.checked = this.value;
this.visible = true this.visible = true;
this.reset() this.reset();
}, },
clear(event) { clear(event) {
this.checked = '' this.checked = "";
this.innerValue = '' this.innerValue = "";
this.checkedRow = {} this.checkedRow = {};
this.$emit('input', this.checked) this.$emit("input", this.checked);
this.$emit('change', this.checked, this.checkedRow, this.rowIndex) this.$emit("change", this.checked, this.checkedRow, this.rowIndex);
dispatch.call(this, 'ElFormItem', 'el.form.change', this.checked) dispatch.call(this, "ElFormItem", "el.form.change", this.checked);
event.stopPropagation(); event.stopPropagation();
}, },
select() { select() {
if (!this.checked) return if (!this.checked) return;
this.innerValue = this.checkedTxt this.innerValue = this.checkedTxt;
this.$emit('input', this.checked) this.$emit("input", this.checked);
this.$emit('change', this.checked, this.checkedRow, this.rowIndex) this.$emit("change", this.checked, this.checkedRow, this.rowIndex);
dispatch.call(this, 'ElFormItem', 'el.form.change', this.checked) dispatch.call(this, "ElFormItem", "el.form.change", this.checked);
this.visible = false this.visible = false;
}, },
rowClick(row) { rowClick(row) {
this.checked = row[this.propsValue] this.checked = row[this.propsValue];
this.checkedTxt = row[this.relationField] this.checkedTxt = row[this.relationField];
this.checkedRow = row this.checkedRow = row;
}, },
setDefault() { setDefault() {
if (this.value) { if (this.value) {
if (!this.interfaceId) return if (!this.interfaceId) return;
const paramList = this.getParamList() const paramList = this.getParamList();
let query = { let query = {
ids: [this.value], ids: [this.value],
interfaceId: this.interfaceId, interfaceId: this.interfaceId,
propsValue: this.propsValue, propsValue: this.propsValue,
relationField: this.relationField, relationField: this.relationField,
paramList paramList
} };
let that = this; let that = this;
getDataInterfaceDataInfoByIds(this.interfaceId, query).then(res => { getDataInterfaceDataInfoByIds(this.interfaceId, query).then(res => {
const data = res.data && res.data.length ? res.data[0] : {}; const data = res.data && res.data.length ? res.data[0] : {};
this.innerValue = data[this.relationField] this.innerValue = data[this.relationField];
debugger
if (!this.innerValue) { if (!this.innerValue) {
this.innerValue = this.innerName; this.innerValue = this.innerName;
} }
if (!this.field) return if (!this.field) return;
let relationData = this.$store.state.generator.relationData let relationData = this.$store.state.generator.relationData;
this.$set(relationData, this.field, data) this.$set(relationData, this.field, data);
this.$eventBus.$emit('popupAttrEventBus', relationData, this.field) this.$eventBus.$emit("popupAttrEventBus", relationData, this.field);
this.$store.commit('generator/UPDATE_RELATION_DATA', relationData) this.$store.commit("generator/UPDATE_RELATION_DATA", relationData);
}) });
} else { } else {
this.innerValue = '' this.innerValue = "";
if (!this.field) return if (!this.field) return;
let relationData = this.$store.state.generator.relationData let relationData = this.$store.state.generator.relationData;
this.$set(relationData, this.field, {}) this.$set(relationData, this.field, {});
this.$eventBus.$emit('popupAttrEventBus', relationData, this.field) this.$eventBus.$emit("popupAttrEventBus", relationData, this.field);
this.$store.commit('generator/UPDATE_RELATION_DATA', relationData) this.$store.commit("generator/UPDATE_RELATION_DATA", relationData);
} }
} }
} }
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
>>> .el-dialog__body { >>> .el-dialog__body {

Loading…
Cancel
Save