ocpview-plus 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +0 -0
- package/README.md +0 -0
- package/dist/efviewplus.min.esm.js +99954 -0
- package/dist/efviewplus.min.js +142 -0
- package/dist/locale/lang.js +1 -0
- package/dist/locale/zh-CN.js +1 -0
- package/dist/locale/zh-TW.js +1 -0
- package/dist/locale/zh-UG.js +1 -0
- package/dist/style.css +9 -0
- package/dist/styles/efviewplus.css +1 -0
- package/package.json +144 -0
- package/src/components/base/controlbase.vue +191 -0
- package/src/components/base/controlbox.vue +102 -0
- package/src/components/base/index.js +3 -0
- package/src/components/base/load.js +20 -0
- package/src/components/base/probase.js +220 -0
- package/src/components/base/size.js +78 -0
- package/src/components/billbox/billbox.vue +68 -0
- package/src/components/billbox/index.js +2 -0
- package/src/components/cascaderbox/cascaderbox.vue +184 -0
- package/src/components/cascaderbox/index.js +2 -0
- package/src/components/checkbox/checkbox.vue +76 -0
- package/src/components/checkbox/checkgroupbox.vue +104 -0
- package/src/components/checkbox/index.js +3 -0
- package/src/components/colorbox/colorbox.vue +44 -0
- package/src/components/colorbox/index.js +2 -0
- package/src/components/combobox/combobox.vue +220 -0
- package/src/components/combobox/index.js +2 -0
- package/src/components/conditionbox/conditionbase.vue +195 -0
- package/src/components/conditionbox/conditionbox.vue +63 -0
- package/src/components/conditionbox/conditionfilterbox.vue +477 -0
- package/src/components/conditionbox/conditionselectorbox.vue +237 -0
- package/src/components/conditionbox/index.js +5 -0
- package/src/components/conditionbox/queryconditionbox.vue +26 -0
- package/src/components/conditionbox/queryconditionboxbase.vue +124 -0
- package/src/components/conditionbox/searchconditionbox.vue +114 -0
- package/src/components/conditionbox/searchgrid.vue +391 -0
- package/src/components/datebox/datebox.vue +129 -0
- package/src/components/datebox/daterangebox.vue +155 -0
- package/src/components/datebox/index.js +3 -0
- package/src/components/form/baseform.vue +677 -0
- package/src/components/form/detailsbox.vue +487 -0
- package/src/components/form/formbox.vue +29 -0
- package/src/components/form/formcardbox.vue +268 -0
- package/src/components/form/formcardgroupbox.vue +252 -0
- package/src/components/form/formcompro.js +19 -0
- package/src/components/form/formdetail.vue +129 -0
- package/src/components/form/formdetailtwo.vue +302 -0
- package/src/components/form/index.js +8 -0
- package/src/components/form/toolanchor.js +46 -0
- package/src/components/form/workform.vue +168 -0
- package/src/components/grid/basegrid.vue +1061 -0
- package/src/components/grid/editgrid.vue +51 -0
- package/src/components/grid/editgridbase.vue +947 -0
- package/src/components/grid/editgridcard.vue +193 -0
- package/src/components/grid/expandrow.vue +137 -0
- package/src/components/grid/index.js +6 -0
- package/src/components/grid/viewgrid.vue +122 -0
- package/src/components/grid/viewgridbase.vue +1284 -0
- package/src/components/icon/common-icon.vue +53 -0
- package/src/components/icon/eicon.vue +29 -0
- package/src/components/icon/icons.vue +42 -0
- package/src/components/icon/index.js +2 -0
- package/src/components/label/index.js +3 -0
- package/src/components/label/showtext.vue +95 -0
- package/src/components/load/loadcartoon.vue +228 -0
- package/src/components/map/index.js +2 -0
- package/src/components/map/mapbox.vue +348 -0
- package/src/components/masterplate/appendix.vue +586 -0
- package/src/components/masterplate/approval.vue +803 -0
- package/src/components/masterplate/base.vue +985 -0
- package/src/components/masterplate/billasyncimport.vue +614 -0
- package/src/components/masterplate/billconditionbox.vue +224 -0
- package/src/components/masterplate/billconditionsbox.vue +427 -0
- package/src/components/masterplate/billdetailform.vue +990 -0
- package/src/components/masterplate/billimport.vue +263 -0
- package/src/components/masterplate/billquerygrid.vue +316 -0
- package/src/components/masterplate/billsinglegrid.vue +234 -0
- package/src/components/masterplate/birtreport.vue +185 -0
- package/src/components/masterplate/detailbtntoolbar.vue +311 -0
- package/src/components/masterplate/detailsbox.vue +386 -0
- package/src/components/masterplate/editgridcard.vue +222 -0
- package/src/components/masterplate/editgridcard2.vue +109 -0
- package/src/components/masterplate/formcard.vue +106 -0
- package/src/components/masterplate/formcardgroupbox.vue +168 -0
- package/src/components/masterplate/formdetailtwo.vue +356 -0
- package/src/components/masterplate/gridcolset.vue +227 -0
- package/src/components/masterplate/index.js +23 -0
- package/src/components/masterplate/layouttemplate.vue +33 -0
- package/src/components/masterplate/leftlistrightdetails.vue +474 -0
- package/src/components/masterplate/leftlistrightlist.vue +465 -0
- package/src/components/masterplate/lefttreerightdetails.vue +619 -0
- package/src/components/masterplate/levelreport.vue +510 -0
- package/src/components/masterplate/listbtntoolbar.vue +257 -0
- package/src/components/masterplate/listdetails.vue +769 -0
- package/src/components/masterplate/operlog.vue +272 -0
- package/src/components/masterplate/options.vue +110 -0
- package/src/components/masterplate/page.vue +102 -0
- package/src/components/masterplate/promptmessage.vue +74 -0
- package/src/components/masterplate/querybar.vue +490 -0
- package/src/components/masterplate/report.vue +357 -0
- package/src/components/masterplate/rowbtntoolbar.vue +126 -0
- package/src/components/masterplate/simpletree.vue +129 -0
- package/src/components/masterplate/simpleviewgrid.vue +144 -0
- package/src/components/mychart/bar/bar.vue +202 -0
- package/src/components/mychart/basechart.vue +190 -0
- package/src/components/mychart/complexmychart/barline.vue +154 -0
- package/src/components/mychart/gauge/gauge.vue +83 -0
- package/src/components/mychart/index.js +9 -0
- package/src/components/mychart/line/line.vue +202 -0
- package/src/components/mychart/liquidfill/liquidfill.vue +109 -0
- package/src/components/mychart/pie/pie.vue +96 -0
- package/src/components/mychart/radar/radar.vue +122 -0
- package/src/components/mychart/scatter/scatter.vue +76 -0
- package/src/components/numberbox/append.js +11 -0
- package/src/components/numberbox/index.js +3 -0
- package/src/components/numberbox/numberbox.vue +303 -0
- package/src/components/numberbox/numberrangebox.vue +423 -0
- package/src/components/picturebox/filebox.vue +365 -0
- package/src/components/picturebox/index.js +3 -0
- package/src/components/picturebox/picturebox.vue +541 -0
- package/src/components/picturebox/uploadbox.vue +164 -0
- package/src/components/poptagbox/index.js +2 -0
- package/src/components/poptagbox/poptagbox.vue +389 -0
- package/src/components/poptextbox/index.js +2 -0
- package/src/components/poptextbox/poptextbox.vue +601 -0
- package/src/components/radiobox/index.js +2 -0
- package/src/components/radiobox/radiogroupbox.vue +76 -0
- package/src/components/richtextbox/editor.vue +150 -0
- package/src/components/richtextbox/index.js +2 -0
- package/src/components/richtextbox/richtextbox.vue +448 -0
- package/src/components/textbox/index.js +2 -0
- package/src/components/textbox/textbox.vue +98 -0
- package/src/components/timebox/index.js +2 -0
- package/src/components/timebox/timebox.vue +76 -0
- package/src/components/toolbar/ebutton.vue +169 -0
- package/src/components/toolbar/index.js +3 -0
- package/src/components/toolbar/toolbar.vue +446 -0
- package/src/components/tree/basetree.vue +725 -0
- package/src/components/tree/index.js +3 -0
- package/src/components/tree/treedata.vue +51 -0
- package/src/components/tree/treedatabase.vue +189 -0
- package/src/components/upload/billimport.vue +233 -0
- package/src/components/upload/index.js +2 -0
- package/src/components/videobox/index.js +2 -0
- package/src/components/videobox/uploadbox.vue +148 -0
- package/src/components/videobox/videobox.vue +503 -0
- package/src/components/wrichtextbox/editor.vue +219 -0
- package/src/components/wrichtextbox/index.js +2 -0
- package/src/components/wrichtextbox/wrichtextbox.vue +63 -0
- package/src/index.js +215 -0
- package/src/locale/format.js +51 -0
- package/src/locale/index.js +63 -0
- package/src/locale/lang/zh-CN.js +123 -0
- package/src/locale/lang/zh-TW.js +114 -0
- package/src/locale/lang/zh-UG.js +115 -0
- package/src/locale/lang.js +15 -0
- package/src/method/case/case.js +1180 -0
- package/src/method/config/queryconfig.js +24 -0
- package/src/method/const/const.js +815 -0
- package/src/method/index.js +8 -0
- package/src/static/excel/exportexcel.js +627 -0
- package/src/static/iview/coustom.js +463 -0
- package/src/store/index.js +19 -0
- package/src/store/modules/app.js +53 -0
- package/src/styles/README.md +3 -0
- package/src/styles/common.less +75 -0
- package/src/styles/components/anchor.less +74 -0
- package/src/styles/components/approval.less +136 -0
- package/src/styles/components/button.less +208 -0
- package/src/styles/components/card.less +51 -0
- package/src/styles/components/content.less +38 -0
- package/src/styles/components/font.less +314 -0
- package/src/styles/components/form.less +72 -0
- package/src/styles/components/iconfont/fonts/iconfont.less +1376 -0
- package/src/styles/components/iconfont/fonts/iconfont.svg +699 -0
- package/src/styles/components/iconfont/fonts/iconfont.ttf +0 -0
- package/src/styles/components/iconfont/fonts/iconfont.woff +0 -0
- package/src/styles/components/iconfont/fonts/iconfont.woff2 +0 -0
- package/src/styles/components/index.less +16 -0
- package/src/styles/components/input.less +290 -0
- package/src/styles/components/modal.less +203 -0
- package/src/styles/components/page.less +340 -0
- package/src/styles/components/select.less +361 -0
- package/src/styles/components/steps.less +367 -0
- package/src/styles/components/table.less +544 -0
- package/src/styles/components/tabs.less +249 -0
- package/src/styles/components/upload.less +83 -0
- package/src/styles/custom.less +67 -0
- package/src/styles/index.less +6 -0
- package/src/styles/pack.less +6 -0
- package/src/utils/EfuMessenger.js +155 -0
- package/src/utils/assist.js +353 -0
- package/src/utils/index.js +1 -0
- package/src/utils/random_str.js +10 -0
|
@@ -0,0 +1,990 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div style="background:#fff;">
|
|
3
|
+
<div ref="headarea">
|
|
4
|
+
<Affix>
|
|
5
|
+
<slot name="toolbar"></slot>
|
|
6
|
+
<Anchor v-if="showAnchorLink" ref="anchorobject" style="position:absolute;z-index:99;right:0px;top:64px;width:200px" :affix="false" :show-ink="false" @on-select="anchorChange" @on-change="anchorChange" offset-top="5" :container="'div#' + headid" :bounds="2" >
|
|
7
|
+
<AnchorLink v-for="temp in curlAnchorData" :key="'anchor_' + temp.id" :href="temp.id" :class="anchorid == temp.id?'ivu-anchor-link-active':''" v-show="temp.visible" :title="temp.name" style="margin-bottom:5px;margin-top:5px"/>
|
|
8
|
+
</Anchor>
|
|
9
|
+
</Affix>
|
|
10
|
+
</div>
|
|
11
|
+
<Card :padding="0" :bordered="false" style="padding-top:0px;padding-left:16px;padding-right:16px;padding-bottom:14px;" dis-hover>
|
|
12
|
+
<div :id="headid" :style="style2" @scroll="handleScroll">
|
|
13
|
+
<div v-for="(item,index) in myConfig.formsConfig.items" :id="item.divId" :key="item.divId" v-show="headVisible[index].visible">
|
|
14
|
+
<Formcard :ref="item.name" :config="item" :dictData="dictData" @doAction="doAction" >
|
|
15
|
+
</Formcard>
|
|
16
|
+
</div>
|
|
17
|
+
<div v-for="(temp2,index) in detailConfig.items" :key="temp2.divId" :id="temp2.divId" v-show="detailVisible[index].visible" >
|
|
18
|
+
<EditGridCardS v-if="temp2.type === 'EditGridCard'" :ref="temp2.name" :config="temp2" :dictData="dictData" @doAction="doAction"/>
|
|
19
|
+
<DetailsBoxs v-if="temp2.type === 'DetailsBox'" :ref="temp2.name" :config="temp2" :dictData="dictData" @doAction="doAction"/>
|
|
20
|
+
<FormCardBox v-if="temp2.type === 'FormCardBox'" :ref="temp2.name" :config="temp2" :dictData="dictData"/>
|
|
21
|
+
<AppendixBoxs v-if="temp2.type === 'AppendixBox'" :ref="temp2.name" :config="temp2" :modulecode="modulecode" @doAction="doAction"/>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</Card>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
<script>
|
|
28
|
+
import elementResizeDetectorMaker from 'element-resize-detector'
|
|
29
|
+
import EditGridCardS from './editgridcard.vue';
|
|
30
|
+
import DetailsBoxs from './detailsbox.vue';
|
|
31
|
+
import AppendixBoxs from './appendix.vue';
|
|
32
|
+
import random from '../../utils/random_str';
|
|
33
|
+
import Formcard from './formcard.vue';
|
|
34
|
+
export default {
|
|
35
|
+
name:'mbilldetailform',
|
|
36
|
+
components:{Formcard,EditGridCardS,DetailsBoxs,AppendixBoxs},
|
|
37
|
+
data () {
|
|
38
|
+
return {
|
|
39
|
+
curlEditObject:'',
|
|
40
|
+
title:'单据详情',
|
|
41
|
+
singleForm:{},
|
|
42
|
+
readOnly:false,
|
|
43
|
+
showAnchorLink:false,
|
|
44
|
+
operVisible:true,
|
|
45
|
+
approvalVisible:true,
|
|
46
|
+
rowBtnVisible:false,
|
|
47
|
+
showBtnToolbar:true,
|
|
48
|
+
anchorData:[],
|
|
49
|
+
curlAnchorData:[],
|
|
50
|
+
myConfig:{
|
|
51
|
+
saveModel:'whole', // whole整体保存,part局部
|
|
52
|
+
adjustHeight:0,
|
|
53
|
+
showApprovalLog:false,
|
|
54
|
+
approvalConfig:{}
|
|
55
|
+
},
|
|
56
|
+
detailVisible:[],
|
|
57
|
+
headVisible:[],
|
|
58
|
+
menuToolbar:{
|
|
59
|
+
|
|
60
|
+
},
|
|
61
|
+
logName:[],
|
|
62
|
+
anchorid:'',
|
|
63
|
+
detailConfig:{},
|
|
64
|
+
offsetTop: 64,
|
|
65
|
+
editFlag:false,
|
|
66
|
+
extraHeight:0,
|
|
67
|
+
outsideHeight:0,
|
|
68
|
+
modulecode:'',
|
|
69
|
+
billAppendixConfig:{
|
|
70
|
+
showAppendix:false,
|
|
71
|
+
appendixKey:'billno'
|
|
72
|
+
},
|
|
73
|
+
billapprovalUrl:'',
|
|
74
|
+
showAffix:true,
|
|
75
|
+
headid:'mainbody'
|
|
76
|
+
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
created () {
|
|
80
|
+
this.myConfig = Object.assign({}, this.myConfig, this.config);
|
|
81
|
+
if (this.myConfig.showBtnToolbar !== undefined) {
|
|
82
|
+
this.showBtnToolbar = this.myConfig.showBtnToolbar;
|
|
83
|
+
}
|
|
84
|
+
let modetype = '1';
|
|
85
|
+
if (this.myConfig.modetype !== undefined) {
|
|
86
|
+
modetype = this.myConfig.modetype;
|
|
87
|
+
}
|
|
88
|
+
this.headid = this.headid + this.getRandom(6);
|
|
89
|
+
if (this.myConfig.formsConfig.items.length > 0){
|
|
90
|
+
this.headVisible = [];
|
|
91
|
+
if (!this.myConfig.formsConfig.lineNum) {
|
|
92
|
+
this.myConfig.formsConfig.lineNum = 3;
|
|
93
|
+
}
|
|
94
|
+
this.myConfig.formsConfig.items.forEach((el, index) => {
|
|
95
|
+
if (el.name === undefined) {
|
|
96
|
+
el.name = 'headForm_' + index;
|
|
97
|
+
}
|
|
98
|
+
if (el.showEffectValue === undefined) {
|
|
99
|
+
if (this.myConfig.showEffectValue) {
|
|
100
|
+
el.showEffectValue = this.myConfig.showEffectValue;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (el.lineNum === undefined) {
|
|
104
|
+
el.lineNum = this.myConfig.formsConfig.lineNum;
|
|
105
|
+
}
|
|
106
|
+
if (el.labelWidth === undefined) {
|
|
107
|
+
if (el.lineNum === 3) {
|
|
108
|
+
el.labelWidth = 120;
|
|
109
|
+
}
|
|
110
|
+
if (el.lineNum === 4) {
|
|
111
|
+
el.labelWidth = 100;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (!el.title && index === 0) {
|
|
115
|
+
el.title = this.title;
|
|
116
|
+
}
|
|
117
|
+
el.type = 'FormCardBox';
|
|
118
|
+
el.modetype = modetype;
|
|
119
|
+
el.divId = 'headForm_' + this.getRandom() + '_' + index;
|
|
120
|
+
this.headVisible.push({refname:el.name,visible:true});
|
|
121
|
+
this.anchorData.push({id:'#'+el.divId ,name:el.title,visible:true,refname:el.name,isHead:true});
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (this.myConfig.billDetailConfig !== undefined) {
|
|
126
|
+
this.detailConfig = Object.assign({}, this.detailConfig, this.myConfig.billDetailConfig);
|
|
127
|
+
this.detailVisible = [];
|
|
128
|
+
if (this.detailConfig.items) {
|
|
129
|
+
this.detailConfig.items.forEach((el, index) => {
|
|
130
|
+
if (el.type === 'EditGridCard') {
|
|
131
|
+
el.generalOrientation = true;
|
|
132
|
+
if (el.dynamicHeight === undefined) {
|
|
133
|
+
el.dynamicHeight = true;
|
|
134
|
+
}
|
|
135
|
+
if (el.height === undefined) {
|
|
136
|
+
if (el.dynamicHeight !== false) {
|
|
137
|
+
el.height = 260;
|
|
138
|
+
} else {
|
|
139
|
+
el.height = 260;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
el.showBorder = true;
|
|
143
|
+
if (el.editItemMaxNum === undefined){
|
|
144
|
+
el.editItemMaxNum = 20;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
el.modetype = modetype;
|
|
148
|
+
if (el.showEffectValue === undefined) {
|
|
149
|
+
if (this.myConfig.showEffectValue) {
|
|
150
|
+
el.showEffectValue = this.myConfig.showEffectValue;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
if (el.showEffectValue) {
|
|
154
|
+
if (el.effectKey === undefined) {
|
|
155
|
+
if (this.myConfig.effectKey) {
|
|
156
|
+
el.effectKey = this.myConfig.effectKey;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
el.divId = 'detail_'+ this.getRandom() + '_'+ index;
|
|
161
|
+
this.detailVisible.push({refname:el.name,visible:true});
|
|
162
|
+
this.anchorData.push({id:'#'+ el.divId, name:el.title,refname:el.name,visible:true,isHead:false});
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
if (this.myConfig.billAppendixConfig) {
|
|
167
|
+
this.billAppendixConfig = Object.assign({}, this.billAppendixConfig, this.myConfig.billAppendixConfig);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
if (this.myConfig.modulecode !== undefined) {
|
|
171
|
+
this.modulecode = this.myConfig.modulecode;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
if (this.billAppendixConfig.showAppendix) {
|
|
175
|
+
let tmp = Object.assign({}, {}, this.billAppendixConfig);
|
|
176
|
+
tmp.type = 'AppendixBox';
|
|
177
|
+
tmp.name = 'detail_appenndix';
|
|
178
|
+
tmp.title = '附件';
|
|
179
|
+
tmp.beforeUpload = this.beforeUpload;
|
|
180
|
+
tmp.divId = 'detail_'+ this.getRandom() + '_'+ this.detailConfig.items.length;
|
|
181
|
+
this.detailConfig.items.push(tmp);
|
|
182
|
+
this.detailVisible.push({refname:tmp.name,visible:true});
|
|
183
|
+
this.anchorData.push({id:'#'+ tmp.divId, name:tmp.title,refname:tmp.name,visible:true});
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
if (this.myConfig.showAnchorLink !== undefined) {
|
|
187
|
+
this.showAnchorLink = this.myConfig.showAnchorLink;
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
computed:{
|
|
191
|
+
style2 () {
|
|
192
|
+
let height = this.$Store.state.app.clientHeight;
|
|
193
|
+
if (this.extraHeight) {
|
|
194
|
+
height = height - Number(this.extraHeight);
|
|
195
|
+
}
|
|
196
|
+
if (this.outsideHeight) {
|
|
197
|
+
height = height - Number(this.outsideHeight);
|
|
198
|
+
}
|
|
199
|
+
height = height - 40;
|
|
200
|
+
if (this.showAnchorLink) {
|
|
201
|
+
return 'overflow-y: auto;height:' + height + 'px;overflow-x: hidden;padding-right:200px;';
|
|
202
|
+
} else {
|
|
203
|
+
return 'overflow-y: auto;height:' + height + 'px;overflow-x: hidden;';
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
|
|
208
|
+
methods:{
|
|
209
|
+
getCurlAnchorData() {
|
|
210
|
+
let tmp = [];
|
|
211
|
+
this.anchorData.forEach(el => {
|
|
212
|
+
if (el.visible) {
|
|
213
|
+
tmp.push(el);
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
return tmp;
|
|
217
|
+
},
|
|
218
|
+
getRandom() {
|
|
219
|
+
return random(8);
|
|
220
|
+
},
|
|
221
|
+
beforeUpload() {
|
|
222
|
+
if (this.billAppendixConfig.showAppendix) {
|
|
223
|
+
if (this.$refs.detail_appenndix && this.$refs.detail_appenndix[0]) {
|
|
224
|
+
let data = this.getData();
|
|
225
|
+
let billno = data[this.billAppendixConfig.appendixKey];
|
|
226
|
+
let billmoduleid = data.billmoduleid;
|
|
227
|
+
this.$refs.detail_appenndix[0].setData(billno,billmoduleid);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
doAction (obj) {
|
|
232
|
+
if (obj.name === 'editGrid' || obj.name === 'cancelGrid') {
|
|
233
|
+
this[obj.name](obj);
|
|
234
|
+
} else {
|
|
235
|
+
if (obj.name === 'addData') {
|
|
236
|
+
this.curlEditObject = '';
|
|
237
|
+
}
|
|
238
|
+
this.$emit('doAction' , obj);
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
doRowBtn () {
|
|
242
|
+
if (this.myConfig.rowBtnMethod) {
|
|
243
|
+
let obj = {};
|
|
244
|
+
obj.name = this.myConfig.rowBtnMethod;
|
|
245
|
+
this.$emit('doAction' , obj);
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
anchorClick(id) {
|
|
249
|
+
let temp = this.anchorData.find(el => el.id === id);
|
|
250
|
+
if (temp && temp.refname) {
|
|
251
|
+
if (this.$refs[temp.refname]) {
|
|
252
|
+
if (this.$refs[temp.refname] instanceof Array) {
|
|
253
|
+
if (this.$refs[temp.refname][0]) {
|
|
254
|
+
if (this.$refs[temp.refname][0].setShowGrid) {
|
|
255
|
+
this.$refs[temp.refname][0].setShowGrid(true);
|
|
256
|
+
} else {
|
|
257
|
+
this.setShowForm(true,temp.refname);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
} else {
|
|
261
|
+
if (this.$refs[temp.refname].setShowGrid) {
|
|
262
|
+
this.$refs[temp.refname].setShowGrid(true);
|
|
263
|
+
} else {
|
|
264
|
+
this.setShowForm(true);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
} else {
|
|
268
|
+
this.setShowForm(true,temp.refname);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
setShowForm(value, name) {
|
|
273
|
+
if (this.$refs[name] && this.$refs[name][0]) {
|
|
274
|
+
this.$refs[name][0].setShowForm(value)
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
handleScroll(e) {
|
|
278
|
+
if (this.readOnly) {
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
this.anchorData.forEach(el => {
|
|
282
|
+
if (!el.isHead) {
|
|
283
|
+
if (this.$refs[el.refname] && this.$refs[el.refname][0] && this.$refs[el.refname][0].cancelCellEditing) {
|
|
284
|
+
this.$refs[el.refname][0].cancelCellEditing();
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
},
|
|
289
|
+
anchorChange(id) {
|
|
290
|
+
this.$nextTick(() => {
|
|
291
|
+
if (id !== '#') {
|
|
292
|
+
let index = this.anchorData.findIndex(el => el.id === id);
|
|
293
|
+
if (index === -1) {
|
|
294
|
+
this.anchorid = this.anchorData[0].id;
|
|
295
|
+
document.getElementById(this.headid).scrollTop = 5;
|
|
296
|
+
this.anchorClick(this.anchorid);
|
|
297
|
+
} else {
|
|
298
|
+
this.anchorid = id;
|
|
299
|
+
this.anchorClick(this.anchorid);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
} else {
|
|
303
|
+
this.anchorid = this.anchorData[0].id;
|
|
304
|
+
document.getElementById(this.headid).scrollTop = 5;
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
},
|
|
308
|
+
setVisibleCommon(name , value) {
|
|
309
|
+
let index = this.anchorData.findIndex(el2 => el2.refname === name);
|
|
310
|
+
if (index > -1) {
|
|
311
|
+
let temp = Object.assign({}, this.anchorData[index], {visible:value});
|
|
312
|
+
this.anchorData.splice(index ,1, temp);
|
|
313
|
+
if (!this.anchorData[index].isHead) {
|
|
314
|
+
if (this.detailVisible && this.detailVisible.length > 0) {
|
|
315
|
+
let indexConfig = this.detailVisible.findIndex(el3 => el3.refname === name);
|
|
316
|
+
if (indexConfig > -1) {
|
|
317
|
+
let config = Object.assign({}, this.detailVisible[indexConfig], {visible:value});
|
|
318
|
+
this.detailVisible.splice(indexConfig ,1, config);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
} else {
|
|
322
|
+
if (this.headVisible && this.headVisible.length > 0) {
|
|
323
|
+
let indexConfig = this.headVisible.findIndex(el3 => el3.refname === name);
|
|
324
|
+
if (indexConfig > -1) {
|
|
325
|
+
let config = Object.assign({}, this.headVisible[indexConfig], {visible:value});
|
|
326
|
+
this.headVisible.splice(indexConfig ,1, config);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
this.resetAnchor();
|
|
332
|
+
},
|
|
333
|
+
setRowBtnVisible(value) {
|
|
334
|
+
this.rowBtnVisible = value;
|
|
335
|
+
},
|
|
336
|
+
setEffectData(data) {
|
|
337
|
+
this.myConfig.formsConfig.items.forEach(el => {
|
|
338
|
+
if (this.$refs[el.name] && this.$refs[el.name][0]) {
|
|
339
|
+
this.$refs[el.name][0].setEffectData(data);
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
if (this.detailConfig.items) {
|
|
343
|
+
this.detailConfig.items.forEach(el => {
|
|
344
|
+
if (data[el.name]) {
|
|
345
|
+
if (this.$refs[el.name] && this.$refs[el.name][0]) {
|
|
346
|
+
if (el.type === 'DetailsBox') {
|
|
347
|
+
let tempDetailData = this.setDetailsBox(el, data);
|
|
348
|
+
this.$refs[el.name][0].setEffectData(tempDetailData);
|
|
349
|
+
} else {
|
|
350
|
+
if (el.type === 'FormCardBox') {
|
|
351
|
+
if (data[el.name].length > 0) {
|
|
352
|
+
this.$refs[el.name][0].setEffectData(data[el.name][0]);
|
|
353
|
+
} else {
|
|
354
|
+
this.$refs[el.name][0].clearData();
|
|
355
|
+
}
|
|
356
|
+
} else {
|
|
357
|
+
this.$refs[el.name][0].setEffectData(data[el.name]);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
} else {
|
|
362
|
+
if (this.config.response === el.name) {
|
|
363
|
+
if (el.type === 'FormCardBox') {
|
|
364
|
+
let temp = {};
|
|
365
|
+
if (el.items) {
|
|
366
|
+
el.items.forEach(el2 => {
|
|
367
|
+
if (el2.name) {
|
|
368
|
+
temp[el2.name] = data[el2.name];
|
|
369
|
+
}
|
|
370
|
+
if (el2.sname) {
|
|
371
|
+
temp[el2.sname] = data[el2.sname];
|
|
372
|
+
}
|
|
373
|
+
if (el2.ename) {
|
|
374
|
+
temp[el2.ename] = data[el2.ename];
|
|
375
|
+
}
|
|
376
|
+
if (el2.textName) {
|
|
377
|
+
temp[el2.textName] = data[el2.textName];
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
this.$refs[el.name][0].setEffectData(temp);
|
|
382
|
+
}
|
|
383
|
+
} else {
|
|
384
|
+
if (el.type !== 'AppendixBox') {
|
|
385
|
+
if (this.$refs[el.name] && this.$refs[el.name][0]) {
|
|
386
|
+
this.$refs[el.name][0].setEffectData([]);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
setData(data) {
|
|
395
|
+
this.myConfig.formsConfig.items.forEach(el => {
|
|
396
|
+
if (this.$refs[el.name] && this.$refs[el.name][0]) {
|
|
397
|
+
this.$refs[el.name][0].setData(data);
|
|
398
|
+
}
|
|
399
|
+
});
|
|
400
|
+
if (this.detailConfig.items) {
|
|
401
|
+
this.detailConfig.items.forEach(el => {
|
|
402
|
+
if (data[el.name]) {
|
|
403
|
+
if (this.$refs[el.name] && this.$refs[el.name][0]) {
|
|
404
|
+
if (el.type === 'DetailsBox') {
|
|
405
|
+
let tempDetailData = this.setDetailsBox(el, data);
|
|
406
|
+
this.$refs[el.name][0].setData(tempDetailData);
|
|
407
|
+
} else {
|
|
408
|
+
if (el.type === 'FormCardBox') {
|
|
409
|
+
if (data[el.name].length > 0) {
|
|
410
|
+
this.$refs[el.name][0].setData(data[el.name][0]);
|
|
411
|
+
} else {
|
|
412
|
+
this.$refs[el.name][0].clearData();
|
|
413
|
+
}
|
|
414
|
+
} else {
|
|
415
|
+
this.$refs[el.name][0].setData(data[el.name]);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
} else {
|
|
420
|
+
if (this.config.response === el.name) {
|
|
421
|
+
if (el.type === 'FormCardBox') {
|
|
422
|
+
let temp = {};
|
|
423
|
+
if (el.items) {
|
|
424
|
+
el.items.forEach(el2 => {
|
|
425
|
+
if (el2.name) {
|
|
426
|
+
temp[el2.name] = data[el2.name];
|
|
427
|
+
}
|
|
428
|
+
if (el2.sname) {
|
|
429
|
+
temp[el2.sname] = data[el2.sname];
|
|
430
|
+
}
|
|
431
|
+
if (el2.ename) {
|
|
432
|
+
temp[el2.ename] = data[el2.ename];
|
|
433
|
+
}
|
|
434
|
+
if (el2.textName) {
|
|
435
|
+
temp[el2.textName] = data[el2.textName];
|
|
436
|
+
}
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
this.$refs[el.name][0].setData(temp);
|
|
440
|
+
}
|
|
441
|
+
} else {
|
|
442
|
+
if (el.type !== 'AppendixBox') {
|
|
443
|
+
if (this.$refs[el.name] && this.$refs[el.name][0]) {
|
|
444
|
+
this.$refs[el.name][0].setData([]);
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
if (this.billAppendixConfig.showAppendix) {
|
|
452
|
+
if (this.$refs.detail_appenndix && this.$refs.detail_appenndix[0]) {
|
|
453
|
+
let billno = data[this.billAppendixConfig.appendixKey];
|
|
454
|
+
let billmoduleid = data.billmoduleid
|
|
455
|
+
this.$refs.detail_appenndix[0].setData(billno,billmoduleid);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
this.$nextTick(() => {
|
|
459
|
+
this.resetAnchor();
|
|
460
|
+
this.curlEditObject = '';
|
|
461
|
+
});
|
|
462
|
+
},
|
|
463
|
+
setDetailsBox(el, data) {
|
|
464
|
+
let form = data[el.name];
|
|
465
|
+
if (el.gridConfig.items && el.gridConfig.items.length > 0 && el.gridName) {
|
|
466
|
+
let gridData = data[el.gridName];
|
|
467
|
+
if (form && form.length > 0) {
|
|
468
|
+
form.forEach(el2 => {
|
|
469
|
+
el2[el.gridName] = [];
|
|
470
|
+
if (gridData) {
|
|
471
|
+
gridData.forEach(el3 => {
|
|
472
|
+
if (el2[el.uniqueKeys] === el3[el.uniqueKeys]) {
|
|
473
|
+
el2[el.gridName].push(el3);
|
|
474
|
+
}
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
return form;
|
|
481
|
+
},
|
|
482
|
+
getChangeData (detialsname) {
|
|
483
|
+
let data = this.getHeadData();
|
|
484
|
+
for (let pro in data) {
|
|
485
|
+
if (data[pro] instanceof Array) {
|
|
486
|
+
if (data[pro].length === 0) {
|
|
487
|
+
delete data[pro];
|
|
488
|
+
} else {
|
|
489
|
+
let temp = [];
|
|
490
|
+
data[pro].forEach(el => {
|
|
491
|
+
if (el.flag !== undefined) {
|
|
492
|
+
temp.push(el);
|
|
493
|
+
}
|
|
494
|
+
});
|
|
495
|
+
if (temp.length > 0) {
|
|
496
|
+
data[pro] = temp;
|
|
497
|
+
} else {
|
|
498
|
+
delete data[pro];
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
if (!data[this.myConfig.billKey]) {
|
|
504
|
+
data.flag = 'I';
|
|
505
|
+
} else {
|
|
506
|
+
data.flag = 'U';
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
if (this.detailConfig.items) {
|
|
510
|
+
if (detialsname) {
|
|
511
|
+
let name = [];
|
|
512
|
+
if (detialsname instanceof Array) {
|
|
513
|
+
name = detialsname;
|
|
514
|
+
} else {
|
|
515
|
+
name.push(detialsname);
|
|
516
|
+
}
|
|
517
|
+
name.forEach(el => {
|
|
518
|
+
let config = this.detailConfig.items.find(el2 => el2.name === el);
|
|
519
|
+
if (config) {
|
|
520
|
+
this.getCommonChangeData(data, config);
|
|
521
|
+
}
|
|
522
|
+
});
|
|
523
|
+
this.detailConfig.items.forEach(el => {
|
|
524
|
+
let index = name.findIndex(el2 => el.name === el2);
|
|
525
|
+
if (index === -1) {
|
|
526
|
+
if (el.gridName) {
|
|
527
|
+
delete data[el.gridName];
|
|
528
|
+
}
|
|
529
|
+
delete data[el.name];
|
|
530
|
+
}
|
|
531
|
+
});
|
|
532
|
+
} else {
|
|
533
|
+
this.detailConfig.items.forEach(el => {
|
|
534
|
+
this.getCommonChangeData(data, el);
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
return data;
|
|
539
|
+
},
|
|
540
|
+
getCommonChangeData(data, el) {
|
|
541
|
+
if (el.name === 'detail_appenndix') {
|
|
542
|
+
return;
|
|
543
|
+
}
|
|
544
|
+
if (this.$refs[el.name] && this.$refs[el.name][0]) {
|
|
545
|
+
if (el.type === 'DetailsBox') {
|
|
546
|
+
Object.assign(data, this.getDetailsBox(el));
|
|
547
|
+
} else if (el.type === 'FormCardBox') {
|
|
548
|
+
if (this.config.response === el.name) {
|
|
549
|
+
Object.assign(data, this.getFormCardBox(el));
|
|
550
|
+
} else {
|
|
551
|
+
let temp = this.getFormCardBox(el,true);
|
|
552
|
+
if (!temp[this.myConfig.billKey]) {
|
|
553
|
+
temp.flag = 'I';
|
|
554
|
+
} else {
|
|
555
|
+
temp.flag = 'U';
|
|
556
|
+
}
|
|
557
|
+
data[el.name] = [temp];
|
|
558
|
+
}
|
|
559
|
+
} else {
|
|
560
|
+
data[el.name] = this.$refs[el.name][0].getChangeData();
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
},
|
|
564
|
+
getFormCardBox (el, flag) {
|
|
565
|
+
let data = this.$refs[el.name][0].getData();
|
|
566
|
+
if (flag) {
|
|
567
|
+
return data;
|
|
568
|
+
}
|
|
569
|
+
let obj = {};
|
|
570
|
+
if (el.items) {
|
|
571
|
+
el.items.forEach(el2 => {
|
|
572
|
+
if (el2.name) {
|
|
573
|
+
obj[el2.name] = data[el2.name];
|
|
574
|
+
}
|
|
575
|
+
if (el2.sname) {
|
|
576
|
+
obj[el2.sname] = data[el2.sname];
|
|
577
|
+
}
|
|
578
|
+
if (el2.ename) {
|
|
579
|
+
obj[el2.ename] = data[el2.ename];
|
|
580
|
+
}
|
|
581
|
+
if (el2.textName) {
|
|
582
|
+
obj[el2.textName] = data[el2.textName];
|
|
583
|
+
}
|
|
584
|
+
});
|
|
585
|
+
}
|
|
586
|
+
return obj;
|
|
587
|
+
},
|
|
588
|
+
getDetailsBox(el) {
|
|
589
|
+
let name = el.name;
|
|
590
|
+
let form = this.$refs[name][0].getChangeData();
|
|
591
|
+
let obj = {};
|
|
592
|
+
if (el.gridConfig.items && el.gridConfig.items.length > 0 && el.gridName) {
|
|
593
|
+
let gridData = [];
|
|
594
|
+
if (form && form.length > 0) {
|
|
595
|
+
form.forEach(el2 => {
|
|
596
|
+
if (el2[el.gridName] && el2[el.gridName].length > 0) {
|
|
597
|
+
if (el2.flag !== 'D') {
|
|
598
|
+
el2[el.gridName].forEach(el3 => {
|
|
599
|
+
if (el3.flag !== undefined) {
|
|
600
|
+
gridData.push(el3);
|
|
601
|
+
}
|
|
602
|
+
});
|
|
603
|
+
} else {
|
|
604
|
+
el2[el.gridName].forEach(el3 => {
|
|
605
|
+
if (el3['ph_key'] !== undefined && el3['ph_key']) {
|
|
606
|
+
el3.flag = 'D';
|
|
607
|
+
gridData.push(el3);
|
|
608
|
+
} else {
|
|
609
|
+
if (el3[this.myConfig.billKey] !== undefined && el3[this.myConfig.billKey]) {
|
|
610
|
+
el3.flag = 'D';
|
|
611
|
+
gridData.push(el3);
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
});
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
delete el2[el.gridName];
|
|
618
|
+
});
|
|
619
|
+
}
|
|
620
|
+
if (gridData.length > 0) {
|
|
621
|
+
obj[el.gridName] = gridData;
|
|
622
|
+
} else {
|
|
623
|
+
obj[el.gridName] = [];
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
if (form.index) {
|
|
627
|
+
delete form.index;
|
|
628
|
+
}
|
|
629
|
+
obj[el.name] = form;
|
|
630
|
+
return obj;
|
|
631
|
+
},
|
|
632
|
+
getData() {
|
|
633
|
+
let data = this.getHeadData();
|
|
634
|
+
if (this.detailConfig.items) {
|
|
635
|
+
this.detailConfig.items.forEach(el => {
|
|
636
|
+
if (this.$refs[el.name] && this.$refs[el.name][0]) {
|
|
637
|
+
if (this.config.response === el.name) {
|
|
638
|
+
let tempData = this.$refs[el.name][0].getData();
|
|
639
|
+
let temp = {};
|
|
640
|
+
if (el.items) {
|
|
641
|
+
el.items.forEach(el2 => {
|
|
642
|
+
if (el2.name) {
|
|
643
|
+
temp[el2.name] = tempData[el2.name];
|
|
644
|
+
}
|
|
645
|
+
if (el2.sname) {
|
|
646
|
+
temp[el2.sname] = tempData[el2.sname];
|
|
647
|
+
}
|
|
648
|
+
if (el2.ename) {
|
|
649
|
+
temp[el2.ename] = tempData[el2.ename];
|
|
650
|
+
}
|
|
651
|
+
if (el2.textName) {
|
|
652
|
+
temp[el2.textName] = tempData[el2.textName];
|
|
653
|
+
}
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
Object.assign(data,temp);
|
|
657
|
+
} else {
|
|
658
|
+
data[el.name] = this.$refs[el.name][0].getData();
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
}
|
|
662
|
+
});
|
|
663
|
+
}
|
|
664
|
+
return data;
|
|
665
|
+
},
|
|
666
|
+
getDetailData(name) {
|
|
667
|
+
let data = [];
|
|
668
|
+
if (this.$refs[name] && this.$refs[name][0]) {
|
|
669
|
+
data = this.$refs[name][0].getData();
|
|
670
|
+
}
|
|
671
|
+
return data;
|
|
672
|
+
},
|
|
673
|
+
setReadOnly(value) {
|
|
674
|
+
this.readOnly = value;
|
|
675
|
+
this.myConfig.formsConfig.items.forEach(el => {
|
|
676
|
+
if (this.$refs[el.name] && this.$refs[el.name][0]) {
|
|
677
|
+
this.$refs[el.name][0].setFormReadOnly(value);
|
|
678
|
+
}
|
|
679
|
+
});
|
|
680
|
+
if (this.detailConfig.items) {
|
|
681
|
+
this.detailConfig.items.forEach(el => {
|
|
682
|
+
if (this.$refs[el.name] && this.$refs[el.name][0]) {
|
|
683
|
+
if (el.type === 'FormCardBox') {
|
|
684
|
+
this.$refs[el.name][0].setFormReadOnly(value);
|
|
685
|
+
} else {
|
|
686
|
+
this.$refs[el.name][0].setReadOnly(value);
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
}
|
|
690
|
+
});
|
|
691
|
+
}
|
|
692
|
+
},
|
|
693
|
+
isChange (){
|
|
694
|
+
if (this.readOnly) {
|
|
695
|
+
return false;
|
|
696
|
+
}
|
|
697
|
+
let flag = false;
|
|
698
|
+
this.myConfig.formsConfig.items.forEach(el => {
|
|
699
|
+
if (this.$refs[el.name] && this.$refs[el.name][0]) {
|
|
700
|
+
if (!flag) {
|
|
701
|
+
flag = this.$refs[el.name][0].isChange();
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
});
|
|
705
|
+
if (!flag) {
|
|
706
|
+
if (this.detailConfig.items) {
|
|
707
|
+
this.detailConfig.items.forEach(el => {
|
|
708
|
+
if (!flag) {
|
|
709
|
+
if (el.name !== 'detail_appenndix') {
|
|
710
|
+
if (this.$refs[el.name] && this.$refs[el.name][0]) {
|
|
711
|
+
flag = this.$refs[el.name][0].isChange();
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
});
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
return flag;
|
|
719
|
+
},
|
|
720
|
+
isEdit () {
|
|
721
|
+
let flag = false;
|
|
722
|
+
if (this.detailConfig.items) {
|
|
723
|
+
this.detailConfig.items.some(el => {
|
|
724
|
+
if (el.type === 'DetailsBox') {
|
|
725
|
+
if (this.$refs[el.name] && this.$refs[el.name][0]) {
|
|
726
|
+
if (this.myConfig.modeType === 'part') {
|
|
727
|
+
if (el.name !== this.curlEditObject) {
|
|
728
|
+
flag = this.$refs[el.name][0].isEdit();
|
|
729
|
+
}
|
|
730
|
+
} else {
|
|
731
|
+
flag = this.$refs[el.name][0].isEdit();
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
if (flag) {
|
|
736
|
+
return true;
|
|
737
|
+
}
|
|
738
|
+
});
|
|
739
|
+
}
|
|
740
|
+
return flag;
|
|
741
|
+
},
|
|
742
|
+
clearData() {
|
|
743
|
+
this.billno = '';
|
|
744
|
+
this.billstatus = '';
|
|
745
|
+
//this.$refs.form.clearData();
|
|
746
|
+
this.myConfig.formsConfig.items.forEach(el => {
|
|
747
|
+
if (this.$refs[el.name] && this.$refs[el.name][0]) {
|
|
748
|
+
this.$refs[el.name][0].clearData();
|
|
749
|
+
}
|
|
750
|
+
});
|
|
751
|
+
if (this.detailConfig.items) {
|
|
752
|
+
this.detailConfig.items.forEach(el => {
|
|
753
|
+
if (this.$refs[el.name] && this.$refs[el.name][0]) {
|
|
754
|
+
this.$refs[el.name][0].clearData();
|
|
755
|
+
}
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
this.resetAnchor();
|
|
759
|
+
},
|
|
760
|
+
checkValidate () {
|
|
761
|
+
let flag = false;
|
|
762
|
+
this.myConfig.formsConfig.items.some((el,index) => {
|
|
763
|
+
if (this.headVisible[index].visible) {
|
|
764
|
+
flag = this.checkCommonValidate(el)
|
|
765
|
+
}
|
|
766
|
+
if (flag) {
|
|
767
|
+
return true;
|
|
768
|
+
}
|
|
769
|
+
});
|
|
770
|
+
if (!flag) {
|
|
771
|
+
if (this.detailConfig.items) {
|
|
772
|
+
this.detailConfig.items.some((el,index) => {
|
|
773
|
+
if (!flag) {
|
|
774
|
+
if (this.detailVisible[index].visible) {
|
|
775
|
+
flag = this.checkCommonValidate(el);
|
|
776
|
+
}
|
|
777
|
+
if (flag) {
|
|
778
|
+
return true;
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
});
|
|
782
|
+
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
return flag;
|
|
786
|
+
},
|
|
787
|
+
checkCommonValidate(el) {
|
|
788
|
+
let flag = false;
|
|
789
|
+
if (this.$refs[el.name] && this.$refs[el.name][0] && this.$refs[el.name][0].checkValidate) {
|
|
790
|
+
if (el.type === 'FormCardBox') {
|
|
791
|
+
this.$refs[el.name][0].checkValidate();
|
|
792
|
+
flag = this.$refs[el.name][0].isError();
|
|
793
|
+
} else {
|
|
794
|
+
flag = this.$refs[el.name][0].checkValidate();
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
return flag;
|
|
798
|
+
|
|
799
|
+
},
|
|
800
|
+
getForm (name) {
|
|
801
|
+
if (this.$refs[name] && this.$refs[name][0]) {
|
|
802
|
+
return this.$refs[name][0];
|
|
803
|
+
} else {
|
|
804
|
+
return null;
|
|
805
|
+
}
|
|
806
|
+
},
|
|
807
|
+
getDetail(name) {
|
|
808
|
+
if (this.$refs[name] && this.$refs[name][0]) {
|
|
809
|
+
return this.$refs[name][0];
|
|
810
|
+
} else {
|
|
811
|
+
return null;
|
|
812
|
+
}
|
|
813
|
+
},
|
|
814
|
+
getDetailTitle(name) {
|
|
815
|
+
let index = this.anchorData.findIndex(el => el.refname === name);
|
|
816
|
+
if (index > -1) {
|
|
817
|
+
return this.anchorData[index].name;
|
|
818
|
+
}
|
|
819
|
+
return '';
|
|
820
|
+
},
|
|
821
|
+
editObjectBefore(name) {
|
|
822
|
+
if (this.curlEditObject) {
|
|
823
|
+
if (name && name === this.curlEditObject) {
|
|
824
|
+
return true;
|
|
825
|
+
} else {
|
|
826
|
+
this.alert('存在数据未保存');
|
|
827
|
+
return false;
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
return true;
|
|
831
|
+
},
|
|
832
|
+
editForm(obj) {
|
|
833
|
+
this.curlEditObject = obj.formname;
|
|
834
|
+
},
|
|
835
|
+
cancelForm() {
|
|
836
|
+
this.curlEditObject = '';
|
|
837
|
+
},
|
|
838
|
+
editGrid(obj) {
|
|
839
|
+
this.curlEditObject = obj.gridname;
|
|
840
|
+
},
|
|
841
|
+
cancelGrid() {
|
|
842
|
+
this.curlEditObject = '';
|
|
843
|
+
},
|
|
844
|
+
setAllBtnReadOnly(value) {
|
|
845
|
+
this.myConfig.formsConfig.items.forEach(el => {
|
|
846
|
+
this.getForm(el.name).setBtnReadOnly(value);
|
|
847
|
+
});
|
|
848
|
+
if (this.detailConfig.items) {
|
|
849
|
+
this.detailConfig.items.forEach(el => {
|
|
850
|
+
if (this.$refs[el.name] && this.$refs[el.name][0]) {
|
|
851
|
+
if (this.config.response !== el.name) {
|
|
852
|
+
this.$refs[el.name][0].setBtnReadOnly(value);
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
});
|
|
856
|
+
}
|
|
857
|
+
},
|
|
858
|
+
setBtnReadOnly(name, value) {
|
|
859
|
+
this.myConfig.formsConfig.items.forEach(el => {
|
|
860
|
+
if (el.name === name) {
|
|
861
|
+
this.getForm(el.name).setBtnReadOnly(value);
|
|
862
|
+
}
|
|
863
|
+
});
|
|
864
|
+
if (this.detailConfig.items) {
|
|
865
|
+
this.detailConfig.items.forEach(el => {
|
|
866
|
+
if (this.$refs[el.name] && this.$refs[el.name][0]) {
|
|
867
|
+
if (this.config.response !== el.name && el.name === name) {
|
|
868
|
+
this.$refs[el.name][0].setBtnReadOnly(value);
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
});
|
|
872
|
+
}
|
|
873
|
+
},
|
|
874
|
+
setVisible (name,value) {
|
|
875
|
+
this.setVisibleCommon(name, value);
|
|
876
|
+
},
|
|
877
|
+
setExtraHeight () {
|
|
878
|
+
let height = 0;
|
|
879
|
+
if (this.$refs.headarea) {
|
|
880
|
+
height = this.$refs.headarea.offsetHeight;
|
|
881
|
+
}
|
|
882
|
+
this.extraHeight = height;
|
|
883
|
+
},
|
|
884
|
+
setOutsideHeight(value) {
|
|
885
|
+
this.outsideHeight = value;
|
|
886
|
+
},
|
|
887
|
+
delAppenndix() {
|
|
888
|
+
if (this.billAppendixConfig.showAppendix) {
|
|
889
|
+
this.$refs.detail_appenndix[0].dellAllfile();
|
|
890
|
+
}
|
|
891
|
+
},
|
|
892
|
+
updateAllfile() {
|
|
893
|
+
if (this.billAppendixConfig.showAppendix) {
|
|
894
|
+
if (this.billAppendixConfig.notdelfile) {
|
|
895
|
+
this.$refs.detail_appenndix[0].updateAllfile();
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
},
|
|
899
|
+
getHeadData() {
|
|
900
|
+
let obj = {};
|
|
901
|
+
this.myConfig.formsConfig.items.forEach((el,index) => {
|
|
902
|
+
if (this.$refs[el.name] && this.$refs[el.name][0]) {
|
|
903
|
+
if (index === 0) {
|
|
904
|
+
Object.assign(obj, this.$refs[el.name][0].getData());
|
|
905
|
+
} else {
|
|
906
|
+
let data = this.$refs[el.name][0].getData();
|
|
907
|
+
if (el.items) {
|
|
908
|
+
el.items.forEach(el2 => {
|
|
909
|
+
if (el2.name) {
|
|
910
|
+
obj[el2.name] = data[el2.name];
|
|
911
|
+
}
|
|
912
|
+
if (el2.sname) {
|
|
913
|
+
obj[el2.sname] = data[el2.sname];
|
|
914
|
+
}
|
|
915
|
+
if (el2.ename) {
|
|
916
|
+
obj[el2.ename] = data[el2.ename];
|
|
917
|
+
}
|
|
918
|
+
if (el2.textName) {
|
|
919
|
+
obj[el2.textName] = data[el2.textName];
|
|
920
|
+
}
|
|
921
|
+
});
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
});
|
|
926
|
+
return obj;
|
|
927
|
+
},
|
|
928
|
+
getApprovalData() {
|
|
929
|
+
let data = this.getHeadData();
|
|
930
|
+
let obj = {};
|
|
931
|
+
obj.billno = data.billno;
|
|
932
|
+
obj.billmoduleid = data.billmoduleid;
|
|
933
|
+
obj.billstatus = data.billstatus;
|
|
934
|
+
obj.statusName = obj.billstatus;
|
|
935
|
+
if (this.dictData.BILLSTATUS) {
|
|
936
|
+
let tmp = this.dictData.BILLSTATUS.find(el => el.code === obj.billstatus);
|
|
937
|
+
if (tmp) {
|
|
938
|
+
obj.statusName = tmp.name;
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
return obj;
|
|
942
|
+
},
|
|
943
|
+
resetAnchor() {
|
|
944
|
+
if (this.showAnchorLink) {
|
|
945
|
+
this.showAnchorLink = false;
|
|
946
|
+
let self = this;
|
|
947
|
+
this.$nextTick(() => {
|
|
948
|
+
self.curlAnchorData = self.getCurlAnchorData();
|
|
949
|
+
self.showAnchorLink = true;
|
|
950
|
+
self.$nextTick(() => {
|
|
951
|
+
if (!self.anchorid) {
|
|
952
|
+
self.anchorid = self.anchorData[0].id;
|
|
953
|
+
}
|
|
954
|
+
self.anchorChange(self.anchorid)
|
|
955
|
+
});
|
|
956
|
+
});
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
},
|
|
960
|
+
props:{
|
|
961
|
+
config: {
|
|
962
|
+
type:Object,
|
|
963
|
+
default:null
|
|
964
|
+
},
|
|
965
|
+
dictData: {
|
|
966
|
+
type: Object,
|
|
967
|
+
default: () => {
|
|
968
|
+
return {};
|
|
969
|
+
}
|
|
970
|
+
},
|
|
971
|
+
moduleMethod:{
|
|
972
|
+
type:Array,
|
|
973
|
+
default: () => {
|
|
974
|
+
return [];
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
},
|
|
978
|
+
mounted () {
|
|
979
|
+
this.observer = elementResizeDetectorMaker();
|
|
980
|
+
if (this.$refs.headarea) {
|
|
981
|
+
this.observer.listenTo(this.$refs.headarea, this.setExtraHeight);
|
|
982
|
+
}
|
|
983
|
+
},
|
|
984
|
+
beforeUnmount() {
|
|
985
|
+
if (this.$refs.headarea) {
|
|
986
|
+
this.observer.removeListener(this.$refs.headarea, this.setExtraHeight);
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
};
|
|
990
|
+
</script>
|