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,311 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Row type="flex" :gutter="0" justify="start" align="middle">
|
|
3
|
+
<Col span="14">
|
|
4
|
+
<Row type="flex" :gutter="0" justify="start" align="middle">
|
|
5
|
+
<Col v-if="addDataBtnFlag">
|
|
6
|
+
<Button customIcon="iconfont icon-custom-add" type="primary" @click="addData" >新增</Button>
|
|
7
|
+
</Col>
|
|
8
|
+
<Col v-if="addDataBtnFlag ">
|
|
9
|
+
<Divider type="vertical" class="dividercommon"/>
|
|
10
|
+
</Col>
|
|
11
|
+
<Col v-for="(item,index) in btnItems" :key="'btn_' + index" v-show="!moreFlag || index < myConfig.showNum" style="margin-right:10px">
|
|
12
|
+
<Button :icon="item.icon" :custom-icon="item.customIcon" @click="action(item.name)" :disabled="!!item.readOnly">{{item.text}}</Button>
|
|
13
|
+
</Col>
|
|
14
|
+
<Col v-if="moreFlag">
|
|
15
|
+
<Dropdown>
|
|
16
|
+
<Button type="info" icon="ios-arrow-down"> </Button>
|
|
17
|
+
<template #list>
|
|
18
|
+
<DropdownMenu>
|
|
19
|
+
<DropdownItem v-for="(item,index) in btnItems" :key="'btn_' + index" v-show="index >= myConfig.showNum" :disabled="item.readOnly">
|
|
20
|
+
<Button type="text" :icon="item.icon" :custom-icon="item.customIcon" :size="item.size" @click="action(item.name)" :disabled="!!item.readOnly" >{{item.text}}</Button>
|
|
21
|
+
</DropdownItem>
|
|
22
|
+
</DropdownMenu>
|
|
23
|
+
</template>
|
|
24
|
+
</Dropdown>
|
|
25
|
+
</Col>
|
|
26
|
+
</Row>
|
|
27
|
+
</Col>
|
|
28
|
+
<Col span="10">
|
|
29
|
+
<Row type="flex" :gutter="0" justify="end" align="middle">
|
|
30
|
+
<Col v-if="billisworkflow">
|
|
31
|
+
<Button customIcon="iconfont icon-custom-flow" type="info" @click="openWorkFlow">工作流</Button>
|
|
32
|
+
</Col>
|
|
33
|
+
<Col v-if="billisworkflow">
|
|
34
|
+
<Divider type="vertical" class="dividercommon"/>
|
|
35
|
+
</Col>
|
|
36
|
+
<Col v-if="billapproval">
|
|
37
|
+
<Button customIcon="iconfont icon-custom-baopidan" @click="openBillapproval">报批单</Button>
|
|
38
|
+
</Col>
|
|
39
|
+
|
|
40
|
+
<Col v-if="billapproval">
|
|
41
|
+
<Divider type="vertical" class="dividercommon"/>
|
|
42
|
+
</Col>
|
|
43
|
+
<Col v-if="billoperlog">
|
|
44
|
+
<Button customIcon="iconfont icon-custom-baopidan" @click="openBilloperlog">操作日志</Button>
|
|
45
|
+
</Col>
|
|
46
|
+
<Col v-if="billoperlog">
|
|
47
|
+
<Divider type="vertical" class="dividercommon"/>
|
|
48
|
+
</Col>
|
|
49
|
+
<Col v-if="printmodel">
|
|
50
|
+
<Button customIcon="iconfont icon-custom-print" @click="printBillData">打印</Button>
|
|
51
|
+
</Col>
|
|
52
|
+
<Col v-if="printmodel">
|
|
53
|
+
<Divider type="vertical" class="dividercommon"/>
|
|
54
|
+
</Col>
|
|
55
|
+
<Col v-if="showPreNex" style="margin-right:10px">
|
|
56
|
+
<Button style="padding-left:0px;padding-right:0px" customIcon="iconfont icon-custom-pre" type="text" @click="preBill">上一单</Button>
|
|
57
|
+
</Col>
|
|
58
|
+
<Col v-if="showPreNex" >
|
|
59
|
+
<Button style="padding-left:0px;padding-right:0px" customIcon="iconfont icon-custom-next" type="text" @click="nextBill" >下一单</Button>
|
|
60
|
+
</Col>
|
|
61
|
+
<Col>
|
|
62
|
+
<Divider type="vertical" class="dividercommon"/>
|
|
63
|
+
</Col>
|
|
64
|
+
<Col >
|
|
65
|
+
<Button style="padding-left:0px;padding-right:0px" customIcon="iconfont icon-custom-back" type="text" @click="backData">返回</Button>
|
|
66
|
+
</Col>
|
|
67
|
+
</Row>
|
|
68
|
+
</Col>
|
|
69
|
+
</Row>
|
|
70
|
+
</template>
|
|
71
|
+
|
|
72
|
+
<script>
|
|
73
|
+
export default {
|
|
74
|
+
name:'mdetailbtntoolbar',
|
|
75
|
+
data () {
|
|
76
|
+
return {
|
|
77
|
+
myConfig:{
|
|
78
|
+
showNum:5,
|
|
79
|
+
enablePermissions:true,
|
|
80
|
+
items:[]
|
|
81
|
+
},
|
|
82
|
+
addDataBtnFlag:true,
|
|
83
|
+
moreFlag:false,
|
|
84
|
+
showPreNex:true,
|
|
85
|
+
btnItems:[],
|
|
86
|
+
apporval:[{
|
|
87
|
+
name:'submitData',
|
|
88
|
+
text:'提交'
|
|
89
|
+
},{
|
|
90
|
+
name:'revokeData',
|
|
91
|
+
text:'撤回'
|
|
92
|
+
},{
|
|
93
|
+
name:'approveData',
|
|
94
|
+
text:'审批'
|
|
95
|
+
}],
|
|
96
|
+
ignoreModule:['downTemplate'],
|
|
97
|
+
|
|
98
|
+
billisworkflow:false,
|
|
99
|
+
billapproval:false,
|
|
100
|
+
billoperlog:false,
|
|
101
|
+
printmodel:false
|
|
102
|
+
};
|
|
103
|
+
},
|
|
104
|
+
props:{
|
|
105
|
+
config: {
|
|
106
|
+
type:Object,
|
|
107
|
+
default:null
|
|
108
|
+
},
|
|
109
|
+
moduleMethod:{
|
|
110
|
+
type:Array,
|
|
111
|
+
default: () => {
|
|
112
|
+
return [];
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
created () {
|
|
117
|
+
this.init();
|
|
118
|
+
},
|
|
119
|
+
methods: {
|
|
120
|
+
init () {
|
|
121
|
+
this.myConfig = Object.assign({},this.myConfig, this.config);
|
|
122
|
+
if (this.myConfig.ignoreModule) {
|
|
123
|
+
let ignoreModule = this.$Method.copy(this.ignoreModule);
|
|
124
|
+
let flag = true;
|
|
125
|
+
this.myConfig.ignoreModule.forEach(el => {
|
|
126
|
+
flag = false;
|
|
127
|
+
this.ignoreModule.some(el2 => {
|
|
128
|
+
if (el2 == el) {
|
|
129
|
+
flag = true;
|
|
130
|
+
return true;
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
if (!flag) {
|
|
134
|
+
ignoreModule.push(el);
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
if (this.myConfig.items && this.myConfig.items.length > 0) {
|
|
139
|
+
this.myConfig.items.forEach(el => {
|
|
140
|
+
if (el.name !== 'addData') {
|
|
141
|
+
let tmp = this.$Method.copy(el);
|
|
142
|
+
if (tmp.readOnly === undefined) {
|
|
143
|
+
tmp.readOnly = false;
|
|
144
|
+
}
|
|
145
|
+
if (tmp.icon && tmp.icon.startsWith('custom')) {
|
|
146
|
+
tmp.customIcon='iconfont icon-' + tmp.icon;
|
|
147
|
+
tmp.icon = null;
|
|
148
|
+
}
|
|
149
|
+
this.btnItems.push(tmp);
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
let addIndex2 = this.myConfig.items.findIndex(el => el.name === 'addData');
|
|
154
|
+
if (addIndex2 === -1) {
|
|
155
|
+
this.addDataBtnFlag = false;
|
|
156
|
+
} else {
|
|
157
|
+
this.addDataBtnFlag = true;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if (this.myConfig.billisworkflow && this.myConfig.billisworkflow.startsWith('Y')) {
|
|
162
|
+
this.billisworkflow = true;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
if (this.myConfig.billapproval) {
|
|
166
|
+
this.billapproval = true;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
if (this.myConfig.billoperlog) {
|
|
170
|
+
this.billoperlog = true;
|
|
171
|
+
}
|
|
172
|
+
if (this.myConfig.showPreNex !== undefined) {
|
|
173
|
+
this.showPreNex = this.myConfig.showPreNex;
|
|
174
|
+
}
|
|
175
|
+
if (this.myConfig.printmodel || this.myConfig.contprintmodel) {
|
|
176
|
+
this.printmodel = true;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if (this.myConfig.enablePermissions) {
|
|
180
|
+
if (this.moduleMethod) {
|
|
181
|
+
let addIndex = this.moduleMethod.findIndex(el => el.name === 'addData');
|
|
182
|
+
if (addIndex === -1) {
|
|
183
|
+
this.addDataBtnFlag = false;
|
|
184
|
+
} else {
|
|
185
|
+
this.addDataBtnFlag = true;
|
|
186
|
+
}
|
|
187
|
+
let btnItems = [];
|
|
188
|
+
if (this.moduleMethod.length > 0) {
|
|
189
|
+
this.moduleMethod.forEach(el =>{
|
|
190
|
+
let tmp = this.btnItems.find(el2 => el.name === el2.name);
|
|
191
|
+
if (tmp) {
|
|
192
|
+
if(this.billisworkflow) {
|
|
193
|
+
if (tmp.name !== 'auditData') {
|
|
194
|
+
btnItems.push(tmp);
|
|
195
|
+
}
|
|
196
|
+
} else {
|
|
197
|
+
btnItems.push(tmp);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
this.ignoreModule.forEach(el => {
|
|
203
|
+
let culrtmp = btnItems.find(el3 => el3.name === el);
|
|
204
|
+
if (!culrtmp){
|
|
205
|
+
let tmp = this.btnItems.find(el2 => el2.name === el);
|
|
206
|
+
if (tmp) {
|
|
207
|
+
btnItems.push(tmp);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
this.btnItems = btnItems;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
if (this.btnItems.length > this.myConfig.showNum){
|
|
215
|
+
this.moreFlag = true;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
},
|
|
219
|
+
action(name) {
|
|
220
|
+
let obj = {};
|
|
221
|
+
obj.name = name;
|
|
222
|
+
this.$emit('doAction', obj);
|
|
223
|
+
},
|
|
224
|
+
|
|
225
|
+
setAllReadOnly (value) {
|
|
226
|
+
let btn = this.$Method.copy(this.btnItems);
|
|
227
|
+
btn.forEach(el => {
|
|
228
|
+
this.doCommonPro(el.name,'readOnly', value);
|
|
229
|
+
});
|
|
230
|
+
},
|
|
231
|
+
setReadOnly (obj, value) {
|
|
232
|
+
if (obj) {
|
|
233
|
+
if (obj instanceof Array) {
|
|
234
|
+
obj.forEach(el => {
|
|
235
|
+
this.doCommonPro(el,'readOnly', value);
|
|
236
|
+
});
|
|
237
|
+
} else {
|
|
238
|
+
this.doCommonPro(obj,'readOnly', value);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
doCommonPro (btnName, proName, value) {
|
|
243
|
+
let index = this.btnItems.findIndex(el => el.name === btnName);
|
|
244
|
+
if (index > -1) {
|
|
245
|
+
let index2 = this.ignoreModule.findIndex(el2 => el2 === btnName);
|
|
246
|
+
if (index2 > -1) {
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
let pro = {};
|
|
250
|
+
pro[proName] = value;
|
|
251
|
+
let temp = Object.assign({},this.btnItems[index], pro);
|
|
252
|
+
this.btnItems.splice(index,1,temp);
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
addData() {
|
|
256
|
+
this.doBtn('addData');
|
|
257
|
+
},
|
|
258
|
+
preBill() {
|
|
259
|
+
this.doBtn('preBill');
|
|
260
|
+
},
|
|
261
|
+
nextBill() {
|
|
262
|
+
this.doBtn('nextBill');
|
|
263
|
+
},
|
|
264
|
+
backData() {
|
|
265
|
+
this.doBtn('backData');
|
|
266
|
+
},
|
|
267
|
+
doBtn(name) {
|
|
268
|
+
let obj = {};
|
|
269
|
+
obj.name = name;
|
|
270
|
+
this.$emit('doAction', obj);
|
|
271
|
+
},
|
|
272
|
+
changedStatus(value) {
|
|
273
|
+
if (this.myConfig.status && this.myConfig.status[value]) {
|
|
274
|
+
let btn = this.$Method.copy(this.btnItems);
|
|
275
|
+
btn.forEach(el => {
|
|
276
|
+
let tmp = this.myConfig.status[value].find(el2 => el2 === el.name);
|
|
277
|
+
if (tmp) {
|
|
278
|
+
if (el.readOnly !== false) {
|
|
279
|
+
this.doCommonPro(el.name,'readOnly', false);
|
|
280
|
+
}
|
|
281
|
+
} else {
|
|
282
|
+
if (el.readOnly !== true) {
|
|
283
|
+
this.doCommonPro(el.name,'readOnly', true);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
openWorkFlow() {
|
|
290
|
+
this.doBtn('openWorkFlow');
|
|
291
|
+
},
|
|
292
|
+
openBillapproval() {
|
|
293
|
+
this.doBtn('openBillapproval');
|
|
294
|
+
},
|
|
295
|
+
openBilloperlog() {
|
|
296
|
+
this.doBtn('openBilloperlog');
|
|
297
|
+
},
|
|
298
|
+
printBillData() {
|
|
299
|
+
this.doBtn('printBillData');
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
};
|
|
305
|
+
</script>
|
|
306
|
+
<style lang="less" scoped>
|
|
307
|
+
.dividercommon {
|
|
308
|
+
margin:1px 12px 0 12px;
|
|
309
|
+
height:32px;
|
|
310
|
+
}
|
|
311
|
+
</style>
|
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Card :bordered="false" :padding="0" dis-hover>
|
|
3
|
+
<p @click="toggle" style="cursor:pointer;" >
|
|
4
|
+
<Row type="flex" :gutter="0" justify="start" align="middle" style="margin-bottom:14px;margin-top:14px;">
|
|
5
|
+
<Col span="18">
|
|
6
|
+
<Icon custom='iconfont icon-custom-pack' color="#f3b352" v-show="showForm" size="14" /><Icon v-show="!showForm" color="#f3b352" custom='iconfont icon-custom-spread' size="14"/>
|
|
7
|
+
<span style="margin-left:10px;font-size: 14px;font-weight:bold" v-text="myConfig.title" />
|
|
8
|
+
</Col>
|
|
9
|
+
<Col v-show="showForm" span="6">
|
|
10
|
+
<Row type="flex" justify="end" :gutter="0" align="middle">
|
|
11
|
+
<Dropdown placement="bottom-start" style="float:right">
|
|
12
|
+
<Button style="height:21px" type="info">
|
|
13
|
+
更多操作
|
|
14
|
+
<Icon type="ios-arrow-down"></Icon>
|
|
15
|
+
</Button>
|
|
16
|
+
<template #list>
|
|
17
|
+
<DropdownMenu>
|
|
18
|
+
<DropdownItem>
|
|
19
|
+
<Button @click.stop="openForm" >全部展开</Button>
|
|
20
|
+
</DropdownItem>
|
|
21
|
+
<DropdownItem >
|
|
22
|
+
<Button @click.stop="closeForm">全部收起</Button>
|
|
23
|
+
</DropdownItem>
|
|
24
|
+
</DropdownMenu>
|
|
25
|
+
</template>
|
|
26
|
+
</Dropdown>
|
|
27
|
+
</Row>
|
|
28
|
+
</Col>
|
|
29
|
+
</Row>
|
|
30
|
+
</p>
|
|
31
|
+
<Divider style="margin-left:24px;margin-bottom:10px;margin-top: 0px;"/>
|
|
32
|
+
<div style="margin-left:24px;" v-show="showForm" >
|
|
33
|
+
<Row style="margin-bottom:10px;">
|
|
34
|
+
<Button style="padding-left:0px;padding-right:0px" customIcon="iconfont icon-custom-rowadd3" type="text" :disabled="btnReadOnly" @click="add" >添加</Button>
|
|
35
|
+
</Row>
|
|
36
|
+
<FormDetail v-if="showAdd" ref="addform" :config="myConfig" :isAdd="true" @doAction="newDoAction" :dictData="dictData"/>
|
|
37
|
+
<FormDetail v-for="(temp,index) in data" :ref="temp.curlIndex" :key="temp.curlIndex" :valueData="temp" :curlIndex="temp.curlIndex" :index="index" :config="myConfig" @doAction="doAction" :dictData="dictData"/>
|
|
38
|
+
</div>
|
|
39
|
+
</Card>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<script>
|
|
43
|
+
import FormDetail from './formdetailtwo.vue';
|
|
44
|
+
import random from '../../utils/random_str';
|
|
45
|
+
export default {
|
|
46
|
+
name:'mdetail',
|
|
47
|
+
components:{
|
|
48
|
+
FormDetail
|
|
49
|
+
},
|
|
50
|
+
data () {
|
|
51
|
+
return {
|
|
52
|
+
readOnly:false,
|
|
53
|
+
showAdd:false,
|
|
54
|
+
isGrid:false,
|
|
55
|
+
myConfig:{
|
|
56
|
+
title:'',
|
|
57
|
+
titleType:1,
|
|
58
|
+
addBtnType:'1',
|
|
59
|
+
hide:true,
|
|
60
|
+
addBtnName:'新增',
|
|
61
|
+
editBtnName:'编辑'
|
|
62
|
+
},
|
|
63
|
+
showForm:true,
|
|
64
|
+
editFlag:false,
|
|
65
|
+
showBtn:true,
|
|
66
|
+
iconStyle:'',
|
|
67
|
+
pStyle:'',
|
|
68
|
+
data:[],
|
|
69
|
+
delData:[],
|
|
70
|
+
btnReadOnly:false
|
|
71
|
+
};
|
|
72
|
+
},
|
|
73
|
+
props:{
|
|
74
|
+
config:{
|
|
75
|
+
type:Object,
|
|
76
|
+
default:null
|
|
77
|
+
},
|
|
78
|
+
dictData: {
|
|
79
|
+
type: Object,
|
|
80
|
+
default:null
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
created () {
|
|
84
|
+
this.init();
|
|
85
|
+
},
|
|
86
|
+
computed: {
|
|
87
|
+
},
|
|
88
|
+
methods:{
|
|
89
|
+
init (){
|
|
90
|
+
this.myConfig = Object.assign({},this.myConfig,this.config);
|
|
91
|
+
if (this.myConfig.effectKey) {
|
|
92
|
+
if (this.myConfig.gridConfig) {
|
|
93
|
+
if (this.myConfig.gridConfig.effectKey === undefined) {
|
|
94
|
+
this.myConfig.gridConfig.effectKey = this.myConfig.effectKey;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
delete this.myConfig.formConfig.name;
|
|
99
|
+
delete this.myConfig.formConfig.title;
|
|
100
|
+
delete this.myConfig.gridConfig.name;
|
|
101
|
+
delete this.myConfig.gridConfig.title;
|
|
102
|
+
},
|
|
103
|
+
setShowGrid (value) {
|
|
104
|
+
this.showForm = value;
|
|
105
|
+
},
|
|
106
|
+
toggle () {
|
|
107
|
+
this.showForm = !this.showForm;
|
|
108
|
+
},
|
|
109
|
+
getRowObject(index) {
|
|
110
|
+
if (index < this.date.length) {
|
|
111
|
+
if (this.$refs[this.date[index].curlIndex] && this.$refs[this.date[index].curlIndex][0]) {
|
|
112
|
+
return this.$refs[this.date[index].curlIndex][0];
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return null;
|
|
116
|
+
},
|
|
117
|
+
getRandom() {
|
|
118
|
+
return random(8);
|
|
119
|
+
},
|
|
120
|
+
add (obj) {
|
|
121
|
+
let row = null;
|
|
122
|
+
if (this.myConfig.addRowBefore) {
|
|
123
|
+
row = this.myConfig.addRowBefore();
|
|
124
|
+
if (row === false) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
if (!row || row === true) {
|
|
129
|
+
row = {};
|
|
130
|
+
}
|
|
131
|
+
if (obj) {
|
|
132
|
+
row = Object.assign({},row, obj);
|
|
133
|
+
}
|
|
134
|
+
if (!this.showForm) {
|
|
135
|
+
this.showForm = true;
|
|
136
|
+
}
|
|
137
|
+
this.showAdd = false;
|
|
138
|
+
let self = this;
|
|
139
|
+
this.$nextTick(() => {
|
|
140
|
+
this.showAdd = true;
|
|
141
|
+
this.$nextTick(() => {
|
|
142
|
+
setTimeout(() => {
|
|
143
|
+
row.flag = 'I';
|
|
144
|
+
self.$refs.addform.clearData();
|
|
145
|
+
self.$refs.addform.setData(row);
|
|
146
|
+
self.$refs.addform.setFormReadOnly(false);
|
|
147
|
+
}, 200);
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
},
|
|
151
|
+
newDoAction (obj) {
|
|
152
|
+
if (this['new' + obj.name]) {
|
|
153
|
+
this['new' + obj.name](obj);
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
newsaveForm (obj) {
|
|
157
|
+
let flag = true;
|
|
158
|
+
let temp = obj.para.data;
|
|
159
|
+
temp.curlIndex = 'formdetail_' + this.getRandom();
|
|
160
|
+
temp.flag = 'I';
|
|
161
|
+
if (this.myConfig.newSaveFormBefore) {
|
|
162
|
+
flag = this.myConfig.newSaveFormBefore(temp);
|
|
163
|
+
}
|
|
164
|
+
if (flag) {
|
|
165
|
+
this.data.push(temp);
|
|
166
|
+
this.showAdd = false;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
},
|
|
170
|
+
isChange () {
|
|
171
|
+
let flag = false;
|
|
172
|
+
if (this.data && this.data.length > 0) {
|
|
173
|
+
this.data.forEach(el => {
|
|
174
|
+
if (!flag) {
|
|
175
|
+
if (this.$refs[el.curlIndex] && this.$refs[el.curlIndex][0]) {
|
|
176
|
+
flag = this.$refs[el.curlIndex][0].isChange();
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
return flag;
|
|
182
|
+
},
|
|
183
|
+
isEdit() {
|
|
184
|
+
return this.showAdd;
|
|
185
|
+
},
|
|
186
|
+
newcancelForm () {
|
|
187
|
+
this.showAdd = false;
|
|
188
|
+
},
|
|
189
|
+
doAction (obj) {
|
|
190
|
+
if (this[obj.name]) {
|
|
191
|
+
this[obj.name](obj);
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
getData (flag) {
|
|
195
|
+
let data = [];
|
|
196
|
+
this.data.forEach(el => {
|
|
197
|
+
let obj = this.$Method.copy(el);
|
|
198
|
+
if (!flag) {
|
|
199
|
+
delete obj.curlIndex;
|
|
200
|
+
}
|
|
201
|
+
data.push(obj);
|
|
202
|
+
});
|
|
203
|
+
return data;
|
|
204
|
+
},
|
|
205
|
+
setData (data) {
|
|
206
|
+
this.data = [];
|
|
207
|
+
this.delData = [];
|
|
208
|
+
data.forEach(el => {
|
|
209
|
+
el.curlIndex = 'formdetail_' + this.getRandom();
|
|
210
|
+
});
|
|
211
|
+
this.$nextTick(() => {
|
|
212
|
+
this.data =this.$Method.copy(data);
|
|
213
|
+
});
|
|
214
|
+
},
|
|
215
|
+
setEffectData(data) {
|
|
216
|
+
this.data.forEach(el => {
|
|
217
|
+
if (this.$refs[el.curlIndex] && this.$refs[el.curlIndex][0]) {
|
|
218
|
+
let tmp = [];
|
|
219
|
+
if (this.myConfig.effectKey) {
|
|
220
|
+
let tmpIdex = data.findIndex(el2 => el[this.myConfig.effectKey] === el2[this.myConfig.effectKey]);
|
|
221
|
+
if (tmpIdex > -1) {
|
|
222
|
+
tmp = this.$Method.copy(data[tmpIdex]);
|
|
223
|
+
}
|
|
224
|
+
this.$refs[el.curlIndex][0].setEffectData(tmp);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
},
|
|
229
|
+
|
|
230
|
+
saveForm (obj) {
|
|
231
|
+
let index = this.data.findIndex(el => el.curlIndex === obj.para.curlIndex);
|
|
232
|
+
if (index > -1) {
|
|
233
|
+
if (this.data[index].flag === undefined) {
|
|
234
|
+
obj.para.data.flag = 'U';
|
|
235
|
+
}
|
|
236
|
+
this.data.splice(index, 1, obj.para.data);
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
delForm (obj) {
|
|
240
|
+
this.delCommonForm(obj);
|
|
241
|
+
},
|
|
242
|
+
delCommonForm(obj) {
|
|
243
|
+
let index = this.data.findIndex(el => el.curlIndex === obj.para.curlIndex);
|
|
244
|
+
let that = this;
|
|
245
|
+
if (index > -1) {
|
|
246
|
+
let form = this.$Method.copy(this.data[index]);
|
|
247
|
+
if (this.$refs[obj.para.curlIndex] && this.$refs[obj.para.curlIndex][0]) {
|
|
248
|
+
form = this.$refs[obj.para.curlIndex][0].getData();
|
|
249
|
+
}
|
|
250
|
+
if (this.myConfig.delRowBefore) {
|
|
251
|
+
let obj = {};
|
|
252
|
+
obj.index = index;
|
|
253
|
+
obj.gridObject = that;
|
|
254
|
+
obj.form = Object.assign({}, form);
|
|
255
|
+
let flag = this.myConfig.delRowBefore(obj);
|
|
256
|
+
if (flag === false) {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
if (form.flag === undefined || form.flag === 'U') {
|
|
261
|
+
form.flag = 'D';
|
|
262
|
+
delete form.index;
|
|
263
|
+
delete form.curlIndex;
|
|
264
|
+
this.delData.push(form);
|
|
265
|
+
}
|
|
266
|
+
this.data.splice(index, 1);
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
editForm(obj) {
|
|
270
|
+
this.showAdd = false;
|
|
271
|
+
if (this.$refs.addform) {
|
|
272
|
+
this.$refs.addform.clearData(obj);
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
setReadOnly(value) {
|
|
276
|
+
this.readOnly = value;
|
|
277
|
+
this.$nextTick(() => {
|
|
278
|
+
this.data.forEach(el => {
|
|
279
|
+
if (this.$refs[el.curlIndex] && this.$refs[el.curlIndex][0]) {
|
|
280
|
+
this.$refs[el.curlIndex][0].setReadOnly(value);
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
});
|
|
284
|
+
if (this.readOnly) {
|
|
285
|
+
this.showAdd = false;
|
|
286
|
+
}
|
|
287
|
+
this.setBtnReadOnly(value);
|
|
288
|
+
},
|
|
289
|
+
clearData () {
|
|
290
|
+
this.data = [];
|
|
291
|
+
this.delData = [];
|
|
292
|
+
this.showAdd = false;
|
|
293
|
+
if (this.$refs.addform) {
|
|
294
|
+
this.$refs.addform.clearData();
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
getChangeData() {
|
|
298
|
+
return this.getCommonChangeData(this.data);
|
|
299
|
+
},
|
|
300
|
+
getCommonChangeData(data) {
|
|
301
|
+
let changeData = [];
|
|
302
|
+
if (data.length > 0) {
|
|
303
|
+
data.forEach(el => {
|
|
304
|
+
if (this.$refs[el.curlIndex] && this.$refs[el.curlIndex][0]) {
|
|
305
|
+
if (this.$refs[el.curlIndex][0].isChange()) {
|
|
306
|
+
changeData.push(this.$refs[el.curlIndex][0].getChangeData());
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
return changeData.concat(this.delData);
|
|
312
|
+
},
|
|
313
|
+
editDetails() {
|
|
314
|
+
if (this.checkIsEdit()) {
|
|
315
|
+
this.editFlag = true;
|
|
316
|
+
this.setReadOnly(false);
|
|
317
|
+
} else {
|
|
318
|
+
this.editFlag = false;
|
|
319
|
+
this.setReadOnly(true);
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
checkIsEdit() {
|
|
323
|
+
let flag = true;
|
|
324
|
+
if (this.myConfig.editObjectBefore) {
|
|
325
|
+
flag = this.myConfig.editObjectBefore(this.myConfig.name);
|
|
326
|
+
}
|
|
327
|
+
return flag;
|
|
328
|
+
},
|
|
329
|
+
save () {
|
|
330
|
+
if (this.checkValidate()){
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
let obj = {};
|
|
334
|
+
obj.name = 'saveDetails';
|
|
335
|
+
obj.detailsname = this.myConfig.name;
|
|
336
|
+
this.editFlag = false;
|
|
337
|
+
this.$emit('doAction', obj);
|
|
338
|
+
},
|
|
339
|
+
delRowData (obj) {
|
|
340
|
+
this.delForm(obj);
|
|
341
|
+
},
|
|
342
|
+
checkValidate () {
|
|
343
|
+
let flag = false;
|
|
344
|
+
this.data.some(el => {
|
|
345
|
+
if (this.$refs[el.curlIndex] && this.$refs[el.curlIndex][0]) {
|
|
346
|
+
flag = this.$refs[el.curlIndex][0].checkValidate();
|
|
347
|
+
if (flag) {
|
|
348
|
+
return true;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
if (flag) {
|
|
353
|
+
this.alert('必填项不允许为空');
|
|
354
|
+
}
|
|
355
|
+
return flag;
|
|
356
|
+
},
|
|
357
|
+
cancel() {
|
|
358
|
+
this.editFlag = false;
|
|
359
|
+
this.delData = [];
|
|
360
|
+
},
|
|
361
|
+
setShowBtn(value) {
|
|
362
|
+
this.showBtn = value;
|
|
363
|
+
},
|
|
364
|
+
setBtnReadOnly(value) {
|
|
365
|
+
this.btnReadOnly = value;
|
|
366
|
+
},
|
|
367
|
+
openForm () {
|
|
368
|
+
this.data.forEach(el => {
|
|
369
|
+
if (this.$refs[el.curlIndex] && this.$refs[el.curlIndex][0]) {
|
|
370
|
+
this.$refs[el.curlIndex][0].setShowForm(true);
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
},
|
|
374
|
+
closeForm() {
|
|
375
|
+
this.data.forEach(el => {
|
|
376
|
+
if (this.$refs[el.curlIndex] && this.$refs[el.curlIndex][0]) {
|
|
377
|
+
this.$refs[el.curlIndex][0].setShowForm(false);
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
this.showAdd = false;
|
|
381
|
+
},
|
|
382
|
+
},
|
|
383
|
+
mounted () {
|
|
384
|
+
}
|
|
385
|
+
};
|
|
386
|
+
</script>
|