qgb-process 0.2.3 → 0.2.7
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/.env +2 -2
- package/.env.development +70 -70
- package/.env.pre +60 -60
- package/.env.production +48 -48
- package/.env.test +48 -48
- package/.eslintignore +4 -4
- package/.eslintrc.js +302 -302
- package/README.md +66 -66
- package/babel.config.js +5 -5
- package/commitlint.config.js +30 -30
- package/config/dev.env.js +7 -7
- package/config/index.js +82 -82
- package/config/prod.env.js +4 -4
- package/debug.log +4 -4
- package/index.js +6 -6
- package/jsconfig.json +9 -9
- package/lib/qgb-process.common.js +7666 -5069
- package/lib/qgb-process.umd.js +7666 -5069
- package/lib/qgb-process.umd.min.js +108 -108
- package/package.json +148 -148
- package/packages/index.js +26 -26
- package/public/index.html +47 -47
- package/public/js/qykf.js +21 -21
- package/src/App.vue +37 -37
- package/src/api/ApiExAndapp.js +24 -24
- package/src/api/EnterpriseAssociation.js +8 -8
- package/src/api/Notice.js +31 -31
- package/src/api/apiAcceptance/apiAcceptance.js +37 -37
- package/src/api/apiAddress.js +9 -9
- package/src/api/apiApprovalConfig.js +13 -13
- package/src/api/apiApprove.js +18 -18
- package/src/api/apiArrears/apiArrears.js +41 -41
- package/src/api/apiArrears/apiProjectArrears.js +16 -16
- package/src/api/apiArrears/index.js +15 -15
- package/src/api/apiAssets.js +19 -19
- package/src/api/apiAssociate.js +42 -42
- package/src/api/apiAudit/apiAudit.js +32 -32
- package/src/api/apiAuth.js +25 -25
- package/src/api/apiAuthentication.js +35 -35
- package/src/api/apiBankAccount/index.js +12 -12
- package/src/api/apiBudget/apiBudget.js +30 -30
- package/src/api/apiBudget/apiBudgets.js +105 -105
- package/src/api/apiCarRecord.js +48 -48
- package/src/api/apiCart.js +202 -202
- package/src/api/apiChangeTel.js +13 -13
- package/src/api/apiCheckingIn.js +95 -95
- package/src/api/apiCollection/index.js +13 -13
- package/src/api/apiContract/apiContract.js +21 -21
- package/src/api/apiContract/index.js +3 -3
- package/src/api/apiContract/quill-config.js +122 -122
- package/src/api/apiContractManage/apiContractManage.js +57 -57
- package/src/api/apiContractManage/index.js +2 -2
- package/src/api/apiContractManage/quill-config.js +121 -121
- package/src/api/apiCoping.js +22 -22
- package/src/api/apiCost/index.js +31 -31
- package/src/api/apiCreditManagement.js +16 -16
- package/src/api/apiCustomer/apiCustomer.js +12 -12
- package/src/api/apiDivisional.js +9 -9
- package/src/api/apiDivisionalManagementList.js +17 -17
- package/src/api/apiEmployeeRegularization.js +73 -73
- package/src/api/apiEquipmentRental.js +50 -50
- package/src/api/apiFormBuilder/menu.js +65 -65
- package/src/api/apiFormBuilder/reissueRule.js +15 -15
- package/src/api/apiFund/index.js +16 -16
- package/src/api/apiHelp.js +43 -43
- package/src/api/apiHome.js +24 -24
- package/src/api/apiIminfo.js +39 -39
- package/src/api/apiInventory.js +52 -52
- package/src/api/apiInventorySetting.js +9 -9
- package/src/api/apiInvoice.js +29 -29
- package/src/api/apiJobManage.js +15 -15
- package/src/api/apiLease/apiLease.js +12 -12
- package/src/api/apiLogisticsTransportation/apiLogisticsTransportation.js +34 -34
- package/src/api/apiLostPassword.js +9 -9
- package/src/api/apiMachine/api.js +3 -3
- package/src/api/apiMachine/apiCategory.js +18 -18
- package/src/api/apiMachine/apiHire.js +19 -19
- package/src/api/apiMachine/apiLease.js +27 -27
- package/src/api/apiMachine/apiLocation.js +4 -4
- package/src/api/apiMachine/apiRentInfo.js +107 -107
- package/src/api/apiMachine/apiRentPublish.js +14 -14
- package/src/api/apiMachine/apiStore.js +15 -15
- package/src/api/apiMachine/index.js +3 -3
- package/src/api/apiManagementStore/api.js +3 -3
- package/src/api/apiManagementStore/apiManagementStore.js +25 -25
- package/src/api/apiMaterCheckAndAccept/apiMaterCheckAndAccept.js +47 -47
- package/src/api/apiMaterCheckAndAccept/apiMechanicalSourcing.js +16 -16
- package/src/api/apiMaterCheckAndAccept/index.js +3 -3
- package/src/api/apiMaterials/aaaaaaaaaaaaaa.js +9 -9
- package/src/api/apiMaterials/api.js +3 -3
- package/src/api/apiMaterials/apiAddress.js +116 -116
- package/src/api/apiMaterials/apiBalanceData.js +188 -188
- package/src/api/apiMaterials/apiCommercialConcrete.js +36 -36
- package/src/api/apiMaterials/apiCommodity.js +70 -70
- package/src/api/apiMaterials/apiDownload.js +26 -26
- package/src/api/apiMaterials/apiHome.js +44 -44
- package/src/api/apiMaterials/apiItemBrand.js +9 -9
- package/src/api/apiMaterials/apiLogistics.js +72 -72
- package/src/api/apiMaterials/apiLogisticsReceipt.js +94 -94
- package/src/api/apiMaterials/apiMaterials.js +8 -8
- package/src/api/apiMaterials/apiMySalesOrder.js +21 -21
- package/src/api/apiMaterials/apiOfflineOrder.js +18 -18
- package/src/api/apiMaterials/apiOrder.js +183 -183
- package/src/api/apiMaterials/apiReceipt.js +45 -45
- package/src/api/apiMaterials/quill-config.js +122 -122
- package/src/api/apiMemberSelection.js +39 -39
- package/src/api/apiMessage.js +10 -10
- package/src/api/apiMock/mockOrder.js +98 -98
- package/src/api/apiMonthPlan/apiMonthPlan.js +47 -47
- package/src/api/apiMyBidding.js +8 -8
- package/src/api/apiMyMember/apiComInfo.js +17 -17
- package/src/api/apiMyMember/apiInviteJoin.js +24 -24
- package/src/api/apiMyMember/apiMember.js +24 -24
- package/src/api/apiMyMember/apiMemberApply.js +36 -36
- package/src/api/apiMyMember/apiMemberChance.js +40 -40
- package/src/api/apiOffer.js +40 -40
- package/src/api/apiOffice.js +19 -19
- package/src/api/apiPact.js +26 -26
- package/src/api/apiPassword.js +7 -7
- package/src/api/apiPay/apiPay.js +25 -25
- package/src/api/apiPaying.js +21 -21
- package/src/api/apiPayment/apiPayment.js +13 -13
- package/src/api/apiPayment/apiProjectPayment.js +13 -13
- package/src/api/apiPrint.js +23 -0
- package/src/api/apiProcess.js +65 -65
- package/src/api/apiProject/apiBaseList.js +29 -29
- package/src/api/apiProject/apiGoodsOffer.js +11 -11
- package/src/api/apiProject/apiInventory.js +116 -116
- package/src/api/apiProject/apiOfferOrder.js +12 -12
- package/src/api/apiProject/apiOfferQuery.js +18 -18
- package/src/api/apiProject/apiPlan.js +21 -21
- package/src/api/apiProject/apiProject.js +158 -158
- package/src/api/apiProjectProcurement/apiProjectProcurement.js +88 -88
- package/src/api/apiPurchase/apiPurchase.js +67 -67
- package/src/api/apiPurchaseApply.js +15 -15
- package/src/api/apiPurchasePay.js +16 -16
- package/src/api/apiRankManagement.js +24 -24
- package/src/api/apiRecruit.js +37 -37
- package/src/api/apiReimbursement/apiReimbursement.js +15 -15
- package/src/api/apiRisk/index.js +11 -11
- package/src/api/apiRoleManagement.js +15 -15
- package/src/api/apiRules/apiRules.js +11 -11
- package/src/api/apiSchedule/apiSchedule.js +17 -17
- package/src/api/apiSealRecord.js +52 -52
- package/src/api/apiSign.js +8 -8
- package/src/api/apiSolution/apiSolution.js +9 -9
- package/src/api/apiSubcontract.js +35 -35
- package/src/api/apiSystem/index.js +40 -40
- package/src/api/apiTask.js +76 -76
- package/src/api/apiTeam/api.js +3 -3
- package/src/api/apiTeam/apiUtils.js +11 -11
- package/src/api/apiTender.js +127 -127
- package/src/api/apiUser.js +24 -24
- package/src/api/apiUserEnterprise/api.js +3 -3
- package/src/api/apiUserEnterprise/apiUserEn.js +15 -15
- package/src/api/apiVolunteerTeam.js +11 -11
- package/src/api/apiWorkarea.js +33 -33
- package/src/api/apiXzqh.js +8 -8
- package/src/api/common/api.js +3 -3
- package/src/api/common/apiUtils.js +9 -9
- package/src/api/customer.js +21 -21
- package/src/api/evection.js +19 -19
- package/src/api/guide.js +9 -9
- package/src/api/sociaManageApi.js +30 -30
- package/src/assets/Area.json +1773 -1773
- package/src/assets/css/quill.bubble.css +952 -952
- package/src/assets/css/quill.core.css +397 -397
- package/src/assets/css/quill.snow.css +945 -945
- package/src/assets/data.js +284 -284
- package/src/assets/fonts/Read Me.txt +7 -7
- package/src/assets/fonts/demo-files/demo.css +155 -155
- package/src/assets/fonts/demo-files/demo.js +30 -30
- package/src/assets/fonts/demo.html +951 -951
- package/src/assets/fonts/fonts/icomoon.svg +130 -130
- package/src/assets/fonts/style.css +563 -563
- package/src/assets/icons/checkbox.svg +12 -12
- package/src/assets/icons/columns-3.svg +12 -12
- package/src/assets/icons/columns.svg +12 -12
- package/src/assets/icons/custom-table.svg +12 -12
- package/src/assets/icons/date.svg +19 -19
- package/src/assets/icons/daterange.svg +12 -12
- package/src/assets/icons/fuzhi.svg +11 -11
- package/src/assets/icons/fuzhi_03.svg +5 -5
- package/src/assets/icons/gaojizujian.svg +12 -12
- package/src/assets/icons/groupSummary.svg +12 -12
- package/src/assets/icons/groupTitle.svg +12 -12
- package/src/assets/icons/image-uploader.svg +12 -12
- package/src/assets/icons/input-number.svg +12 -12
- package/src/assets/icons/input.svg +12 -12
- package/src/assets/icons/quill-editor.svg +12 -12
- package/src/assets/icons/radio.svg +12 -12
- package/src/assets/icons/select.svg +12 -12
- package/src/assets/icons/switch.svg +12 -12
- package/src/assets/icons/textarea.svg +12 -12
- package/src/assets/icons/upload-file.svg +12 -12
- package/src/assets/marketplace.js +289 -289
- package/src/components/ComAduitNew.vue +477 -477
- package/src/components/CommonAduit.vue +512 -512
- package/src/components/CommonAduitNew.vue +906 -906
- package/src/components/CommonAduitNews.vue +753 -753
- package/src/components/CommonUEditer.vue +63 -63
- package/src/components/PersonCenter/Mess.vue +59 -59
- package/src/components/PersonCenter/Title.vue +80 -80
- package/src/components/SvgIcon.vue +57 -57
- package/src/components/XmCommonAduit.vue +761 -761
- package/src/components/feiyCommon.vue +713 -713
- package/src/components/form/card.js +5 -5
- package/src/components/form/chinese.js +6 -6
- package/src/components/form/chinessstring.js +5 -5
- package/src/components/form/hunhe.js +8 -8
- package/src/components/form/hunhecq.js +8 -8
- package/src/components/form/hunheh.js +8 -8
- package/src/components/form/num.js +12 -12
- package/src/components/form/numstring.js +5 -5
- package/src/components/form/user.js +7 -7
- package/src/components/form/validate.js +42 -42
- package/src/components/form/validcredit.js +5 -5
- package/src/components/fundCommonAduit.vue +661 -661
- package/src/components/public/BaseCustomTable.vue +71 -71
- package/src/components/public/BaseDialog.vue +144 -144
- package/src/components/public/BaseEmptyData.vue +73 -73
- package/src/components/public/BaseFormTitle.vue +39 -39
- package/src/components/public/BasePagination.vue +55 -55
- package/src/components/public/BaseRouter.vue +14 -14
- package/src/components/public/BaseUpload.vue +185 -185
- package/src/components/public/Bottom.vue +62 -62
- package/src/components/public/Footer.vue +412 -412
- package/src/components/public/Header.vue +30 -30
- package/src/components/public/LeftMenu.vue +170 -170
- package/src/components/public/MemberSelection coby.vue +444 -444
- package/src/components/public/MemberSelection.vue +487 -487
- package/src/components/public/NewLeftMenu.vue +418 -418
- package/src/components/public/PicturesPreview.vue +62 -62
- package/src/components/public/Popout.vue +147 -147
- package/src/components/public/TagLine.vue +353 -353
- package/src/components/public/components/BaseImageUploadDrag.vue +320 -320
- package/src/components/public/components/HeadBar.vue +315 -315
- package/src/components/public/components/MenuList.vue +110 -110
- package/src/components/public/components/NewHeadBar.vue +936 -936
- package/src/components/public/components/QuickGoods.vue +273 -273
- package/src/components/public/components/Search.vue +164 -164
- package/src/components/public/components/Userinfo.vue +383 -383
- package/src/components/utils/pdf.js +254 -254
- package/src/components/xmfyCommonAduit.vue +752 -752
- package/src/filters/index.js +619 -619
- package/src/fnc/arr.js +102 -102
- package/src/fnc/quill-config.js +121 -121
- package/src/fnc/unit.js +102 -102
- package/src/fnc/verify.js +187 -187
- package/src/fnc/verifyStatus.js +24 -24
- package/src/formBuilder/apiBusiness.js +67 -67
- package/src/formBuilder/business.js +1039 -1039
- package/src/formBuilder/component/components/data.js +719 -719
- package/src/formBuilder/component/components/purchaseIndex.vue +1109 -1109
- package/src/formBuilder/component/purchase.vue +35 -35
- package/src/formBuilder/components/app-main/components/components/GroupSummary.vue +33 -33
- package/src/formBuilder/components/app-main/components/components/GroupTitle.vue +33 -33
- package/src/formBuilder/components/app-main/components/components/bank.vue +226 -226
- package/src/formBuilder/components/app-main/components/components/bankFormHeard.vue +298 -298
- package/src/formBuilder/components/app-main/components/components/builder.vue +718 -718
- package/src/formBuilder/components/app-main/components/components/columns.vue +393 -393
- package/src/formBuilder/components/app-main/components/components/customTable.vue +1758 -1758
- package/src/formBuilder/components/app-main/components/components/formDep.vue +105 -105
- package/src/formBuilder/components/app-main/components/components/handleCode.vue +39 -39
- package/src/formBuilder/components/app-main/components/components/itemOption.vue +116 -116
- package/src/formBuilder/components/app-main/components/components/linkForm.vue +116 -116
- package/src/formBuilder/components/app-main/components/components/listDesign.vue +772 -772
- package/src/formBuilder/components/app-main/components/components/optionSolt.js +78 -78
- package/src/formBuilder/components/app-main/components/components/person.vue +104 -104
- package/src/formBuilder/components/app-main/components/components/postman.vue +40 -40
- package/src/formBuilder/components/app-main/components/components/previewDialog.vue +391 -391
- package/src/formBuilder/components/app-main/components/components/tableIndex.vue +51 -51
- package/src/formBuilder/components/app-main/components/components/tableList.vue +561 -561
- package/src/formBuilder/components/app-main/components/components/twoColumns.vue +52 -52
- package/src/formBuilder/components/app-main/components/main-center.vue +187 -187
- package/src/formBuilder/components/app-main/components/main-header.vue +351 -351
- package/src/formBuilder/components/app-main/components/main-left.vue +179 -179
- package/src/formBuilder/components/app-main/components/main-right/components/components/calculateDialog.vue +914 -914
- package/src/formBuilder/components/app-main/components/main-right/components/components/curTextArea.vue +338 -338
- package/src/formBuilder/components/app-main/components/main-right/components/components/form-item-rules.vue +190 -190
- package/src/formBuilder/components/app-main/components/main-right/components/components/linkageDialog.vue +25 -25
- package/src/formBuilder/components/app-main/components/main-right/components/components/searchMixin.js +26 -26
- package/src/formBuilder/components/app-main/components/main-right/components/form-config.vue +284 -284
- package/src/formBuilder/components/app-main/components/main-right/components/form-item-attrs.vue +407 -407
- package/src/formBuilder/components/app-main/components/main-right/components/form-item-config.vue +478 -478
- package/src/formBuilder/components/app-main/components/main-right/index.vue +203 -203
- package/src/formBuilder/components/app-main/index.vue +329 -329
- package/src/formBuilder/comps.js +283 -283
- package/src/formBuilder/config/button.js +63 -63
- package/src/formBuilder/config/cascader-panel.js +224 -224
- package/src/formBuilder/config/cascader.js +306 -306
- package/src/formBuilder/config/checkbox.js +67 -67
- package/src/formBuilder/config/color.js +42 -42
- package/src/formBuilder/config/columns.js +30 -30
- package/src/formBuilder/config/custom-table.js +49 -49
- package/src/formBuilder/config/date.js +107 -107
- package/src/formBuilder/config/daterange.js +47 -47
- package/src/formBuilder/config/datetime.js +78 -78
- package/src/formBuilder/config/datetimerange.js +111 -111
- package/src/formBuilder/config/formDep.js +37 -37
- package/src/formBuilder/config/groupSummary.js +23 -23
- package/src/formBuilder/config/groupTitle.js +23 -23
- package/src/formBuilder/config/handleCode.js +23 -23
- package/src/formBuilder/config/image-uploader.js +113 -113
- package/src/formBuilder/config/input.js +162 -162
- package/src/formBuilder/config/json-editor.js +31 -31
- package/src/formBuilder/config/linkForm.js +69 -69
- package/src/formBuilder/config/number.js +49 -49
- package/src/formBuilder/config/password.js +82 -82
- package/src/formBuilder/config/person.js +37 -37
- package/src/formBuilder/config/postman.js +23 -23
- package/src/formBuilder/config/purchase.js +19 -19
- package/src/formBuilder/config/quill-editor.js +66 -66
- package/src/formBuilder/config/radio-button.js +44 -44
- package/src/formBuilder/config/radio.js +69 -69
- package/src/formBuilder/config/rate.js +93 -93
- package/src/formBuilder/config/select.js +105 -105
- package/src/formBuilder/config/slider.js +92 -92
- package/src/formBuilder/config/switch.js +35 -35
- package/src/formBuilder/config/tag.js +79 -79
- package/src/formBuilder/config/text.js +18 -18
- package/src/formBuilder/config/textarea.js +129 -129
- package/src/formBuilder/config/time.js +60 -60
- package/src/formBuilder/config/timerange.js +94 -94
- package/src/formBuilder/config/tree-select.js +100 -100
- package/src/formBuilder/config/upload-file.js +100 -100
- package/src/formBuilder/config/yesno.js +39 -39
- package/src/formBuilder/config.js +16 -16
- package/src/formBuilder/extend/index.js +20 -20
- package/src/formBuilder/index.js +39 -39
- package/src/formBuilder/menuConfig.js +36 -36
- package/src/formBuilder/mixins/index.js +215 -215
- package/src/formBuilder/tool.js +101 -101
- package/src/function/base.js +13 -13
- package/src/function/findCompanyTree.js +94 -94
- package/src/function/formulaAnalysis.js +44 -44
- package/src/function/verify.js +23 -23
- package/src/http/index.js +219 -219
- package/src/http/type.js +82 -82
- package/src/library/AddType/Index.js +17 -17
- package/src/library/AddType/Index.vue +201 -201
- package/src/library/AreaChange/regionCascader/regionCascader.vue +155 -155
- package/src/library/BigImg/BigImage1/Index.js +17 -17
- package/src/library/BigImg/BigImage1/Index.vue +125 -125
- package/src/library/Button/Button1/Index.js +17 -17
- package/src/library/Button/Button1/Index.vue +60 -60
- package/src/library/Button/Button2/Index.js +17 -17
- package/src/library/Button/Button2/Index.vue +52 -52
- package/src/library/Button/Button3/Index.js +17 -17
- package/src/library/Button/Button3/Index.vue +56 -56
- package/src/library/Button/Button4/Index.js +17 -17
- package/src/library/Button/Button4/Index.vue +56 -56
- package/src/library/Button/Button5/Index.js +17 -17
- package/src/library/Button/Button5/Index.vue +55 -55
- package/src/library/Button/Button6/Index.js +17 -17
- package/src/library/Button/Button6/Index.vue +74 -74
- package/src/library/Button/Button7/Index.js +17 -17
- package/src/library/Button/Button7/Index.vue +56 -56
- package/src/library/ConfirmPlaugin/ConfirmPlaugin1/Index.js +17 -17
- package/src/library/ConfirmPlaugin/ConfirmPlaugin1/Index.vue +147 -147
- package/src/library/ConfirmPlaugin/ConfirmPlaugin2/Index.js +17 -17
- package/src/library/ConfirmPlaugin/ConfirmPlaugin2/Index.vue +137 -137
- package/src/library/ConfirmPlaugin/ConfirmPlaugin3/Index.vue +142 -142
- package/src/library/ConfirmPlaugin/ConfirmPlaugin4/Index.vue +141 -141
- package/src/library/ConfirmPlaugin/ConfirmPlaugin5/Index.vue +121 -121
- package/src/library/ConfirmPlaugin/ConfirmPlaugin6/Index.vue +142 -142
- package/src/library/Input/Input1/Index.js +17 -17
- package/src/library/Input/Input1/Index.vue +66 -66
- package/src/library/NoMessage/NoMessage0/Index.js +17 -17
- package/src/library/NoMessage/NoMessage0/Index.vue +60 -60
- package/src/library/NoMessage/NoMessage1/Index.js +17 -17
- package/src/library/NoMessage/NoMessage1/Index.vue +66 -66
- package/src/library/NoMessage/NoMessage2/Index.js +17 -17
- package/src/library/NoMessage/NoMessage2/Index.vue +66 -66
- package/src/library/Tab/Tab1/TabBox1/Index.vue +36 -36
- package/src/library/Tab/Tab1/TabInner1/Index.vue +70 -70
- package/src/library/Tab/Tab2/TabBox2/Index.vue +36 -36
- package/src/library/Tab/Tab2/TabInner2/Index.vue +66 -66
- package/src/library/Table/Table1/Td1/Index.js +17 -17
- package/src/library/Table/Table1/Td1/Index.vue +110 -110
- package/src/library/Table/Table1/Tr1/Index.js +17 -17
- package/src/library/Table/Table1/Tr1/Index.vue +53 -53
- package/src/library/Table/Table2/Td2/Index.js +17 -17
- package/src/library/Table/Table2/Td2/Index.vue +90 -90
- package/src/library/Table/Table2/Tr2/Index.js +17 -17
- package/src/library/Table/Table2/Tr2/Index.vue +66 -66
- package/src/library/Table/Table3/Td3/Index.js +17 -17
- package/src/library/Table/Table3/Td3/Index.vue +109 -109
- package/src/library/Table/Table3/Tr3/Index.js +17 -17
- package/src/library/Table/Table3/Tr3/Index.vue +128 -128
- package/src/library/Table/Table4/Td4/Index.js +17 -17
- package/src/library/Table/Table4/Td4/Index.vue +114 -114
- package/src/library/Table/Table4/Tr4/Index.js +17 -17
- package/src/library/Table/Table4/Tr4/Index.vue +53 -53
- package/src/library/Title/Title1/Index.js +17 -17
- package/src/library/Title/Title1/Index.vue +80 -80
- package/src/library/toast/Index.js +17 -17
- package/src/library/toast/Index.vue +86 -86
- package/src/main.js +161 -161
- package/src/mixins/Export2Excel.js +207 -207
- package/src/mixins/chartOption.js +110 -110
- package/src/mixins/companyMixins.js +84 -84
- package/src/mixins/quillOptions.js +15 -15
- package/src/mixins/validate/deviceManage.js +211 -211
- package/src/mixins/validate/systemConfig.js +117 -117
- package/src/mixins/validate/validate.js +25 -25
- package/src/public/apiUser/apiUser.js +10 -10
- package/src/public/areaFunction.js +26 -26
- package/src/public/link.js +91 -91
- package/src/public/stageData.js +495 -495
- package/src/public/topmenu.js +68 -68
- package/src/router/index.js +225 -225
- package/src/router/setting/BaseRoutes.js +1639 -1639
- package/src/router/setting/MenuDevMock.js +1570 -1570
- package/src/router/setting/modules/login.js +45 -45
- package/src/router/setting/noAuthRouter.js +109 -109
- package/src/router/setting/routes.js +55 -55
- package/src/static/css/flex.css +75 -75
- package/src/static/css/switch.scss +31 -31
- package/src/storage/cookies.js +37 -37
- package/src/storage/localStorage.js +36 -36
- package/src/storage/sessionStorage.js +25 -25
- package/src/store/formBuilder/formAttrDefault.js +28 -28
- package/src/store/formBuilder/index.js +40 -40
- package/src/store/index.js +553 -553
- package/src/styles/color.scss +24 -24
- package/src/styles/offer.scss +39 -39
- package/src/styles/s-reset.scss +52 -52
- package/src/styles/static-style.scss +797 -797
- package/src/styles/talent.scss +26 -26
- package/src/styles/variable.scss +69 -69
- package/src/styles/workflow/workflow.css +1308 -1308
- package/src/utils/TableFormTypeList.js +26 -26
- package/src/utils/allRouter.js +5579 -5579
- package/src/utils/auditUtil.js +535 -535
- package/src/utils/commonComponents.js +34 -34
- package/src/utils/commonFunc.js +213 -213
- package/src/utils/deepCopyArray.js +9 -9
- package/src/utils/dict.js +49 -49
- package/src/utils/directive.js +26 -26
- package/src/utils/emoji.js +16 -16
- package/src/utils/flator.js +18 -18
- package/src/utils/imMeeting.js +1180 -1180
- package/src/utils/index.js +105 -105
- package/src/utils/initRouter.js +94 -94
- package/src/utils/map.js +23 -23
- package/src/utils/passwordStrength.js +177 -177
- package/src/utils/style.js +30 -30
- package/src/utils/validate.js +30 -30
- package/src/views/404.vue +53 -53
- package/src/views/Login/Login.vue +50 -50
- package/src/views/Login/Passfind.vue +347 -347
- package/src/views/Login/Passfindnext.vue +146 -146
- package/src/views/Login/Sign.vue +55 -55
- package/src/views/Login/SignSuccessfully.vue +132 -132
- package/src/views/Login/appDownload.vue +224 -224
- package/src/views/Login/clientDownload.vue +201 -201
- package/src/views/Login/components/Background.vue +153 -153
- package/src/views/Login/components/FormLogin.vue +1001 -1001
- package/src/views/Login/components/FormPassFind.vue +395 -395
- package/src/views/Login/components/FormSign.vue +493 -493
- package/src/views/Login/components/Title.vue +301 -301
- package/src/views/Login/components/agreeMent.vue +111 -111
- package/src/views/Login/components/companysign.vue +1296 -1296
- package/src/views/Login/components/guideLogin.vue +984 -984
- package/src/views/formBuilder/components/addNode.vue +119 -119
- package/src/views/formBuilder/components/approverSelector.vue +493 -493
- package/src/views/formBuilder/components/baseRoute.vue +315 -315
- package/src/views/formBuilder/components/builderHeader.vue +106 -106
- package/src/views/formBuilder/components/conditionConfig.js +588 -588
- package/src/views/formBuilder/components/conditionNode.vue +191 -191
- package/src/views/formBuilder/components/dataDefault.js +147 -147
- package/src/views/formBuilder/components/depFormNode.vue +583 -583
- package/src/views/formBuilder/components/linkForm.vue +566 -566
- package/src/views/formBuilder/components/linkFormList.vue +821 -821
- package/src/views/formBuilder/components/menuConfig.vue +1752 -1752
- package/src/views/formBuilder/components/newNodeForm.vue +426 -426
- package/src/views/formBuilder/components/newsection.vue +424 -424
- package/src/views/formBuilder/components/nodeConditionConfig cody.vue +376 -376
- package/src/views/formBuilder/components/nodeConditionConfig.vue +603 -603
- package/src/views/formBuilder/components/nodeForm.vue +355 -355
- package/src/views/formBuilder/components/nodeMenu.vue +147 -147
- package/src/views/formBuilder/components/personNode.vue +566 -566
- package/src/views/formBuilder/components/planNode.vue +269 -269
- package/src/views/formBuilder/designListPage.vue +457 -457
- package/src/views/formBuilder/formDataDetail.vue +565 -565
- package/src/views/formBuilder/formGeneration.vue +904 -904
- package/src/views/formBuilder/index.vue +242 -242
- package/src/views/formBuilder/process-1.vue +976 -976
- package/src/views/formBuilder/process-2.vue +1323 -1323
- package/src/views/formBuilder/process.vue +662 -431
- package/src/views/formBuilder/processList.vue +877 -877
- package/src/views/formBuilder/service/ProcessBuilder.js +136 -136
- package/src/views/formBuilder/service/RsxzFieldCollection.js +199 -0
- package/src/views/formBuilder/workflow/addNode.vue +95 -95
- package/src/views/formBuilder/workflow/initData.js +205 -205
- package/src/views/formBuilder/workflow/nodeWrap.vue +731 -731
- package/src/views/guide.vue +227 -227
- package/src/views/guideIndex.vue +284 -284
- package/tests/unit/.eslintrc.js +5 -5
- package/tests/unit/example.spec.js +13 -13
- package/vue.config.js +287 -287
|
@@ -1,904 +1,904 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
class="form-generation"
|
|
4
|
-
v-loading="isLoading"
|
|
5
|
-
>
|
|
6
|
-
<!-- <h4>{{title}}</h4> -->
|
|
7
|
-
<el-row
|
|
8
|
-
type="flex"
|
|
9
|
-
justify="center"
|
|
10
|
-
>
|
|
11
|
-
<el-col :span="21">
|
|
12
|
-
<bank-form-heard
|
|
13
|
-
ref="bank"
|
|
14
|
-
:data="infoData"
|
|
15
|
-
:id="id"
|
|
16
|
-
></bank-form-heard>
|
|
17
|
-
</el-col>
|
|
18
|
-
</el-row>
|
|
19
|
-
<ele-form
|
|
20
|
-
:formDesc="formDesc"
|
|
21
|
-
v-model="formData"
|
|
22
|
-
:isLoading="isLoading"
|
|
23
|
-
:formError="formError"
|
|
24
|
-
:span="21"
|
|
25
|
-
@request="handleRequest"
|
|
26
|
-
@back="goBack"
|
|
27
|
-
v-bind="formAttr"
|
|
28
|
-
title=''
|
|
29
|
-
>
|
|
30
|
-
|
|
31
|
-
<template v-slot:form-content="{formData, formDesc, formErrorObj }">
|
|
32
|
-
<template v-for="(formItem, field, index) of formDesc">
|
|
33
|
-
<component
|
|
34
|
-
:key='index'
|
|
35
|
-
v-if="formItem.type == 'groupSummary'"
|
|
36
|
-
:is="formItem._type"
|
|
37
|
-
:titleStr="formItem.label"
|
|
38
|
-
/>
|
|
39
|
-
<el-form-item
|
|
40
|
-
:key='index'
|
|
41
|
-
v-else-if="formItem.type !== 'groupTitle'&& formItem.type !== 'groupSummary'"
|
|
42
|
-
:error="formErrorObj ? formErrorObj[field] : null"
|
|
43
|
-
:label="
|
|
44
|
-
(formAttr.isShowLabel === false || formItem.isShowLabel === false) ? null : formItem.label
|
|
45
|
-
"
|
|
46
|
-
:prop="field"
|
|
47
|
-
:label-width="formItem._type.indexOf('columns') == -1 ? formAttr.labelWidth+'px' : '0px'"
|
|
48
|
-
>
|
|
49
|
-
<el-tooltip
|
|
50
|
-
v-if='formItem.attrs && formItem.attrs.summary'
|
|
51
|
-
class="item"
|
|
52
|
-
effect="dark"
|
|
53
|
-
:content="formItem.attrs && formItem.attrs.summary"
|
|
54
|
-
placement="top"
|
|
55
|
-
>
|
|
56
|
-
<i class="el-icon-warning-outline isSummary"></i>
|
|
57
|
-
</el-tooltip>
|
|
58
|
-
|
|
59
|
-
<component
|
|
60
|
-
v-if="formItem.business !== '888'&& formItem._type !=='custom-table' && formItem.type !== 'groupSummary'
|
|
61
|
-
|
|
62
|
-
&& formItem._type !=='columns' && formItem.type !=='formDep' && formItem.type !=='person' && formItem.type !=='linkForm'
|
|
63
|
-
&&(formItem._type =='ele-form-input' && formItem.attrs && formItem.attrs.type !=='number')"
|
|
64
|
-
:disabled="formAttr.disabled || formItem._disabled"
|
|
65
|
-
:desc="formItem"
|
|
66
|
-
:is="formItem._type"
|
|
67
|
-
:options="formItem._options"
|
|
68
|
-
:ref="field"
|
|
69
|
-
:field="field"
|
|
70
|
-
@onChange='onChange'
|
|
71
|
-
v-model="formData[field]"
|
|
72
|
-
/>
|
|
73
|
-
<component
|
|
74
|
-
v-else-if=" formItem.type =='upload-file' || formItem.type =='image-uploader'|| formItem.type =='quill-editor'|| formItem.type =='switch'"
|
|
75
|
-
:disabled="formAttr.disabled || formItem._disabled"
|
|
76
|
-
:desc="formItem"
|
|
77
|
-
:is="formItem._type"
|
|
78
|
-
:options="formItem._options"
|
|
79
|
-
:ref="field"
|
|
80
|
-
:field="field"
|
|
81
|
-
@onChange='onChange'
|
|
82
|
-
v-model="formData[field]"
|
|
83
|
-
/>
|
|
84
|
-
<!-- ele-form-radio
|
|
85
|
-
ele-form-checkbox
|
|
86
|
-
ele-form-datetime
|
|
87
|
-
ele-form-datetimerange -->
|
|
88
|
-
<component
|
|
89
|
-
v-if="formItem.type=='radio'||formItem.type=='checkbox'||formItem.type=='datetime'||formItem.type=='datetimerange'"
|
|
90
|
-
:disabled="formAttr.disabled || formItem._disabled"
|
|
91
|
-
:desc="formItem"
|
|
92
|
-
:is="formItem._type"
|
|
93
|
-
:options="formItem._options"
|
|
94
|
-
:ref="field"
|
|
95
|
-
:field="field"
|
|
96
|
-
@onChange='onChange'
|
|
97
|
-
v-model="formData[field]"
|
|
98
|
-
/>
|
|
99
|
-
<component
|
|
100
|
-
v-if="formItem.attrs&& formItem.attrs.type =='number'"
|
|
101
|
-
:disabled="formAttr.disabled || formItem._disabled"
|
|
102
|
-
:desc="formItem"
|
|
103
|
-
:is="formItem._type"
|
|
104
|
-
:options="formItem._options"
|
|
105
|
-
:ref="field"
|
|
106
|
-
:field="field"
|
|
107
|
-
@input="(res)=>{formatNumbers(res,formItem.attrs.numbers,formItem,field)}"
|
|
108
|
-
v-model="formData[field]"
|
|
109
|
-
/>
|
|
110
|
-
<component
|
|
111
|
-
v-if="formItem._type =='custom-table'"
|
|
112
|
-
:disabled="formAttr.disabled || formItem._disabled"
|
|
113
|
-
:desc="formItem"
|
|
114
|
-
:is="formItem._type"
|
|
115
|
-
:options="formItem._options"
|
|
116
|
-
:ref="field"
|
|
117
|
-
:field="field"
|
|
118
|
-
@input="(res)=>{inputChange(res,formItem.attrs.numbers,formItem,field)}"
|
|
119
|
-
v-model="formData[field]"
|
|
120
|
-
/>
|
|
121
|
-
<component
|
|
122
|
-
v-if="formItem._type =='columns'"
|
|
123
|
-
:disabled="formAttr.disabled || formItem._disabled"
|
|
124
|
-
:desc="formItem"
|
|
125
|
-
:is="formItem._type"
|
|
126
|
-
:options="formItem._options"
|
|
127
|
-
:ref="field"
|
|
128
|
-
:field="field"
|
|
129
|
-
@input="(res)=>{inputChange(res,formItem.attrs.numbers,formItem,field)}"
|
|
130
|
-
v-model="formData[field]"
|
|
131
|
-
/>
|
|
132
|
-
<component
|
|
133
|
-
v-if="formItem.type =='formDep'"
|
|
134
|
-
:disabled="formAttr.disabled || formItem._disabled"
|
|
135
|
-
:desc="formItem"
|
|
136
|
-
:is="formItem._type"
|
|
137
|
-
:options="formItem._options"
|
|
138
|
-
:ref="field"
|
|
139
|
-
:field="field"
|
|
140
|
-
:defaultArr="formData[field]"
|
|
141
|
-
:isMultiple='formItem.attrs?formItem.attrs.multiple:false'
|
|
142
|
-
@input="(res)=>{inputChange(res,formItem.attrs,formItem,field)}"
|
|
143
|
-
@dep="(res)=>{dep(res,formItem.attrs,formItem,field)}"
|
|
144
|
-
v-model="formData[field+'Str']"
|
|
145
|
-
/>
|
|
146
|
-
<component
|
|
147
|
-
v-if="formItem.type =='person'"
|
|
148
|
-
:disabled="formAttr.disabled || formItem._disabled"
|
|
149
|
-
:desc="formItem"
|
|
150
|
-
:is="formItem._type"
|
|
151
|
-
:options="formItem._options"
|
|
152
|
-
:ref="field"
|
|
153
|
-
:field="field"
|
|
154
|
-
:isMultiple='formItem.attrs?formItem.attrs.multiple:false'
|
|
155
|
-
:defaultArr="formData[field]"
|
|
156
|
-
@input="(res)=>{inputChange(res,formItem.attrs,formItem,field)}"
|
|
157
|
-
@dep="(res)=>{dep(res,formItem.attrs,formItem,field)}"
|
|
158
|
-
v-model="formData[field+'Str']"
|
|
159
|
-
/>
|
|
160
|
-
<component
|
|
161
|
-
v-if="formItem.type =='linkForm'"
|
|
162
|
-
:disabled="formAttr.disabled || formItem._disabled"
|
|
163
|
-
:desc="formItem"
|
|
164
|
-
:is="formItem._type"
|
|
165
|
-
:options="formItem._options"
|
|
166
|
-
:ref="field"
|
|
167
|
-
:field="field"
|
|
168
|
-
:defaultArr1="formData[field]"
|
|
169
|
-
:menuId='formItem.attrs?formItem.attrs.formLink:""'
|
|
170
|
-
:isMultiple='formItem.attrs?formItem.attrs.multiple:false'
|
|
171
|
-
@input="(res)=>{inputChange(res,formItem.attrs,formItem,field)}"
|
|
172
|
-
@dep="(res)=>{dep(res,formItem.attrs,formItem,field)}"
|
|
173
|
-
@getcurrentTitle="(res)=>{formCurrentTitle(res,formItem.attrs,formItem,field)}"
|
|
174
|
-
v-model="formData[field+'Str']"
|
|
175
|
-
/>
|
|
176
|
-
<span
|
|
177
|
-
:key='index'
|
|
178
|
-
v-else-if="$route.name!='formGeneration' && (formItem.type == 'postman'|| formItem.type == 'handleCode')"
|
|
179
|
-
:ref="field"
|
|
180
|
-
>系统自动生成</span>
|
|
181
|
-
|
|
182
|
-
<div
|
|
183
|
-
class="ele-form-tip"
|
|
184
|
-
v-if="formItem.tip"
|
|
185
|
-
v-html="formItem.tip"
|
|
186
|
-
>
|
|
187
|
-
</div>
|
|
188
|
-
</el-form-item>
|
|
189
|
-
<component
|
|
190
|
-
:key='index'
|
|
191
|
-
v-else-if="formItem.type == 'groupTitle'"
|
|
192
|
-
:is="formItem._type"
|
|
193
|
-
:ref="field"
|
|
194
|
-
:titleStr="formItem.label"
|
|
195
|
-
/>
|
|
196
|
-
|
|
197
|
-
</template>
|
|
198
|
-
|
|
199
|
-
</template>
|
|
200
|
-
|
|
201
|
-
<!-- <template v-slot:form-content="{ formData, formDesc, formErrorObj }">
|
|
202
|
-
|
|
203
|
-
<template v-for="(formItem, field, index) of formDesc">
|
|
204
|
-
|
|
205
|
-
<el-form-item :key='index' :error="formErrorObj ? formErrorObj[field] : null" :label="
|
|
206
|
-
(formAttr.isShowLabel === false || formItem.isShowLabel === false) ? null : formItem.label
|
|
207
|
-
" :prop="field"
|
|
208
|
-
:label-width="formItem._type.indexOf('columns') == -1 ? formAttr.labelWidth+'px' : '0px'">
|
|
209
|
-
<component v-if="formItem.business !== '888'"
|
|
210
|
-
:disabled="formAttr.disabled || formItem._disabled" :desc="formItem"
|
|
211
|
-
:is="formItem._type" :options="formItem._options" :ref="field" :field="field"
|
|
212
|
-
v-model="formItem.default" />
|
|
213
|
-
|
|
214
|
-
<div class="ele-form-tip" v-if="formItem.tip" v-html="formItem.tip">
|
|
215
|
-
|
|
216
|
-
</div>
|
|
217
|
-
|
|
218
|
-
</el-form-item>
|
|
219
|
-
<div id="components" :key='index' class="component-container" v-if="formItem.business == '888'">
|
|
220
|
-
<bank-form-heard ref="bank" :data="infoData" :id="id" ></bank-form-heard>
|
|
221
|
-
</div>
|
|
222
|
-
</template>
|
|
223
|
-
</template> -->
|
|
224
|
-
|
|
225
|
-
</ele-form>
|
|
226
|
-
</div>
|
|
227
|
-
</template>
|
|
228
|
-
|
|
229
|
-
<script>
|
|
230
|
-
import _ from "lodash-es";
|
|
231
|
-
import { mapState } from "vuex";
|
|
232
|
-
import * as api from "@/api/apiFormBuilder/menu";
|
|
233
|
-
import formAttrDefault from "@/store/formBuilder/formAttrDefault";
|
|
234
|
-
import bankFormHeard from "@/formBuilder/components/app-main/components/components/bankFormHeard";
|
|
235
|
-
import { queryProcessByType, applyProcessCustomForm } from "@/api/apiProcess";
|
|
236
|
-
import GroupTitle from "@/formBuilder/components/app-main/components/components/GroupTitle.vue";
|
|
237
|
-
import GroupSummary from "@/formBuilder/components/app-main/components/components/GroupSummary.vue";
|
|
238
|
-
import { StrHandle } from "@/fnc/arr";
|
|
239
|
-
import handleCode from "@/formBuilder/components/app-main/components/components/handleCode";
|
|
240
|
-
import postman from "@/formBuilder/components/app-main/components/components/postman";
|
|
241
|
-
import formDep from "@/formBuilder/components/app-main/components/components/formDep";
|
|
242
|
-
import person from "@/formBuilder/components/app-main/components/components/person";
|
|
243
|
-
import linkForm from "@/formBuilder/components/app-main/components/components/linkForm";
|
|
244
|
-
|
|
245
|
-
export default {
|
|
246
|
-
name: "FormGeneration",
|
|
247
|
-
components: {
|
|
248
|
-
bankFormHeard,
|
|
249
|
-
GroupTitle,
|
|
250
|
-
GroupSummary,
|
|
251
|
-
postman,
|
|
252
|
-
handleCode,
|
|
253
|
-
formDep,
|
|
254
|
-
person,
|
|
255
|
-
linkForm
|
|
256
|
-
},
|
|
257
|
-
data() {
|
|
258
|
-
return {
|
|
259
|
-
apps: "bankFormHeard",
|
|
260
|
-
formData: {},
|
|
261
|
-
curIndex: null,
|
|
262
|
-
curFIndex: null,
|
|
263
|
-
formDesc: {},
|
|
264
|
-
formAttr: {},
|
|
265
|
-
isLoading: false,
|
|
266
|
-
formError: {},
|
|
267
|
-
formId: "",
|
|
268
|
-
id: "",
|
|
269
|
-
menuId: "",
|
|
270
|
-
infoData: {
|
|
271
|
-
departmentCompanyNo: "",
|
|
272
|
-
departmentNo: "",
|
|
273
|
-
staffNo: "",
|
|
274
|
-
charger: ""
|
|
275
|
-
},
|
|
276
|
-
processId: "",
|
|
277
|
-
processName: ""
|
|
278
|
-
};
|
|
279
|
-
},
|
|
280
|
-
computed: {
|
|
281
|
-
...mapState(["user"]),
|
|
282
|
-
// title() {
|
|
283
|
-
// return this.$store.state.formBuilder.name;
|
|
284
|
-
// },
|
|
285
|
-
getStrArr() {
|
|
286
|
-
return function(formData, field) {
|
|
287
|
-
return this.arr[index].username.match(this.name) !== null;
|
|
288
|
-
};
|
|
289
|
-
}
|
|
290
|
-
},
|
|
291
|
-
watch: {
|
|
292
|
-
$route(to, from) {
|
|
293
|
-
this.getFormDes();
|
|
294
|
-
this.getFormDataById();
|
|
295
|
-
},
|
|
296
|
-
list: {
|
|
297
|
-
deep: true,
|
|
298
|
-
handler: function(newVal, oldVal) {
|
|
299
|
-
const _this = this;
|
|
300
|
-
if (newVal && _this.isLink) {
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
},
|
|
304
|
-
formDesc: {
|
|
305
|
-
deep: true,
|
|
306
|
-
handler: function(newVal, oldVal) {
|
|
307
|
-
const _this = this;
|
|
308
|
-
_this.$delete(_this.formDesc, "business");
|
|
309
|
-
}
|
|
310
|
-
},
|
|
311
|
-
formData: {
|
|
312
|
-
deep: true,
|
|
313
|
-
immediate: true,
|
|
314
|
-
handler: function(newVal, oldVal) {
|
|
315
|
-
const _this = this;
|
|
316
|
-
if (newVal) {
|
|
317
|
-
for (const name in _this.formDesc) {
|
|
318
|
-
if (
|
|
319
|
-
_this.formDesc[name].attrs &&
|
|
320
|
-
_this.formDesc[name].attrs.columns
|
|
321
|
-
) {
|
|
322
|
-
_this.formDesc[name].attrs.columns.forEach(e => {
|
|
323
|
-
if (
|
|
324
|
-
_this.formDesc[name].type == "custom-table" &&
|
|
325
|
-
e.type != "index"
|
|
326
|
-
) {
|
|
327
|
-
if (e.content.customMode == 1 && e.content.customValue) {
|
|
328
|
-
const func = this.formatFunc(
|
|
329
|
-
e.content.customValue,
|
|
330
|
-
newVal,
|
|
331
|
-
_this.formDesc,
|
|
332
|
-
name
|
|
333
|
-
);
|
|
334
|
-
var exp = null;
|
|
335
|
-
if (exp == _this.$store.state.curCusTableIndex) {
|
|
336
|
-
} else {
|
|
337
|
-
if (_this.formData[name].length == 0) {
|
|
338
|
-
_this.formData[name].push({
|
|
339
|
-
[e.prop]: func
|
|
340
|
-
});
|
|
341
|
-
}
|
|
342
|
-
_this.$set(
|
|
343
|
-
_this.formData[name][
|
|
344
|
-
_this.$store.state.curCusTableIndex
|
|
345
|
-
],
|
|
346
|
-
e.prop,
|
|
347
|
-
func
|
|
348
|
-
);
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
// if (!strReg.test(_this.formDesc[name].customValue)) {
|
|
352
|
-
// _this.formData[name] = _this.formDesc[name].customValue;
|
|
353
|
-
// }
|
|
354
|
-
}
|
|
355
|
-
} else if (e.customMode == 1 && e.customValue) {
|
|
356
|
-
const func = this.formatFunc(
|
|
357
|
-
e.customValue,
|
|
358
|
-
newVal,
|
|
359
|
-
_this.formDesc
|
|
360
|
-
);
|
|
361
|
-
// _this.formData[name][e.field] = func;
|
|
362
|
-
|
|
363
|
-
_this.$set(_this.formData[name], e.field, func);
|
|
364
|
-
// if (!strReg.test(_this.formDesc[name].customValue)) {
|
|
365
|
-
// _this.formData[name] = _this.formDesc[name].customValue;
|
|
366
|
-
// }
|
|
367
|
-
}
|
|
368
|
-
});
|
|
369
|
-
}
|
|
370
|
-
if (
|
|
371
|
-
_this.formDesc[name].customMode == 1 &&
|
|
372
|
-
_this.formDesc[name].customValue
|
|
373
|
-
) {
|
|
374
|
-
const func = this.formatFunc(
|
|
375
|
-
_this.formDesc[name].customValue,
|
|
376
|
-
newVal,
|
|
377
|
-
_this.formDesc
|
|
378
|
-
);
|
|
379
|
-
// _this.formData[name] = func;
|
|
380
|
-
_this.$set(_this.formData, name, func);
|
|
381
|
-
// if (!strReg.test(_this.formDesc[name].customValue)) {
|
|
382
|
-
// _this.formData[name] = _this.formDesc[name].customValue;
|
|
383
|
-
// }
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
_this.$delete(_this.formData, "business");
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
},
|
|
391
|
-
methods: {
|
|
392
|
-
formCurrentTitle(res, attrs, formItem, field) {
|
|
393
|
-
const vm = this;
|
|
394
|
-
vm.$set(vm.formData, [field], res.title);
|
|
395
|
-
vm.$set(vm.formData, [field + "Arr"], attrs.dataRules);
|
|
396
|
-
vm.getcurrentRule(res, attrs, formItem, field);
|
|
397
|
-
},
|
|
398
|
-
getcurrentRule(res, attrs, formItem, field) {
|
|
399
|
-
const vm = this;
|
|
400
|
-
// 对端表单数据
|
|
401
|
-
const remoteData = res.data[res.index].content;
|
|
402
|
-
|
|
403
|
-
const newObj = {};
|
|
404
|
-
attrs.dataRules.forEach((e, i) => {
|
|
405
|
-
if (_.has(remoteData, e.itemRemote)) {
|
|
406
|
-
vm.$set(vm.formData, [e.itemSource], remoteData[e.itemRemote]);
|
|
407
|
-
}
|
|
408
|
-
});
|
|
409
|
-
},
|
|
410
|
-
onChange(res) {
|
|
411
|
-
console.log(res);
|
|
412
|
-
},
|
|
413
|
-
inputChange(res, numbers, formItem, field) {
|
|
414
|
-
const vm = this;
|
|
415
|
-
vm.$set(vm.formData, field, res);
|
|
416
|
-
},
|
|
417
|
-
dep(res, numbers, formItem, field) {
|
|
418
|
-
const vm = this;
|
|
419
|
-
|
|
420
|
-
vm.$set(vm.formData, [field + "Str"], res);
|
|
421
|
-
},
|
|
422
|
-
formatNumbers(res, numbers, formItem, field) {
|
|
423
|
-
const vm = this
|
|
424
|
-
// 控制小数位
|
|
425
|
-
this.$nextTick(() => {
|
|
426
|
-
formItem.default = Number(res).toFixed(Number(numbers));
|
|
427
|
-
var s = 1 / Math.pow(10, Number(numbers));
|
|
428
|
-
this.$refs[field][0].attrs.step = s;
|
|
429
|
-
});
|
|
430
|
-
vm.$set(vm.formData, field, res);
|
|
431
|
-
},
|
|
432
|
-
getFormDataRes() {
|
|
433
|
-
const vm = this;
|
|
434
|
-
for (const key in vm.formDesc) {
|
|
435
|
-
if (key !== "bank-form-heard") {
|
|
436
|
-
// vm.formData[key] = vm.formDesc[key].default;
|
|
437
|
-
vm.$set(vm.formData, key, vm.formDesc[key].default);
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
return vm.formData;
|
|
441
|
-
},
|
|
442
|
-
// 获取表单配置信息
|
|
443
|
-
async getFormDes() {
|
|
444
|
-
const id = this.$route.params.id;
|
|
445
|
-
if (!id) {
|
|
446
|
-
return;
|
|
447
|
-
}
|
|
448
|
-
this.menuId = id;
|
|
449
|
-
const { data } = await api.queryFormByMenu({
|
|
450
|
-
menuId: id,
|
|
451
|
-
companyNo: this.user.cno
|
|
452
|
-
});
|
|
453
|
-
if (data.state == "ok" && JSON.stringify(data.data) == "{}") {
|
|
454
|
-
this.formId = data.data.id;
|
|
455
|
-
} else if (data.state == "ok" && data.data) {
|
|
456
|
-
this.formId = data.data.id;
|
|
457
|
-
const formDesc = Object.entries(data.data.content.formDesc).map(
|
|
458
|
-
([key, val]) => {
|
|
459
|
-
if (val.type == "image-uploader" || val.type == "quill-editor") {
|
|
460
|
-
val.attrs.responseFn = function(response, file) {
|
|
461
|
-
return response.data;
|
|
462
|
-
};
|
|
463
|
-
}
|
|
464
|
-
if (val.type == "upload-file") {
|
|
465
|
-
val.attrs.responseFn = function(response, file) {
|
|
466
|
-
return { name: file.name, url: response.data };
|
|
467
|
-
};
|
|
468
|
-
}
|
|
469
|
-
if (val.type == "columns") {
|
|
470
|
-
val.attrs.columns.forEach((i, index) => {
|
|
471
|
-
if (i.type == "image-uploader" || i.type == "quill-editor") {
|
|
472
|
-
i.attrs.responseFn = function(response, file) {
|
|
473
|
-
return response.data;
|
|
474
|
-
};
|
|
475
|
-
}
|
|
476
|
-
if (i.type == "upload-file") {
|
|
477
|
-
i.attrs.responseFn = function(response, file) {
|
|
478
|
-
return { name: file.name, url: response.data };
|
|
479
|
-
};
|
|
480
|
-
}
|
|
481
|
-
});
|
|
482
|
-
}
|
|
483
|
-
if (val.attrs && val.attrs.type && val.attrs.type == "number") {
|
|
484
|
-
// if (val.attrs.numbers) {
|
|
485
|
-
|
|
486
|
-
// }
|
|
487
|
-
val.attrs.min = 0;
|
|
488
|
-
val.attrs.max = 99999999999999999;
|
|
489
|
-
// val.attrs.step = "0.0001";
|
|
490
|
-
}
|
|
491
|
-
// 处理正则pattern
|
|
492
|
-
if (val.rules) {
|
|
493
|
-
val.rules.map(one => {
|
|
494
|
-
one.pattern = eval(one.pattern);
|
|
495
|
-
});
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
);
|
|
499
|
-
this.formDesc = data.data.content.formDesc;
|
|
500
|
-
data.data.content.formAttr.isShowBackBtn = true;
|
|
501
|
-
data.data.content.formAttr.isShowSubmitBtn = true;
|
|
502
|
-
this.formAttr = Object.assign(
|
|
503
|
-
_.cloneDeep(formAttrDefault),
|
|
504
|
-
data.data.content.formAttr
|
|
505
|
-
);
|
|
506
|
-
} else {
|
|
507
|
-
this.$message.error(data.msg ? data.msg : "获取信息失败");
|
|
508
|
-
}
|
|
509
|
-
this.formId && this.queryProcessByType();
|
|
510
|
-
},
|
|
511
|
-
async handleRequest(data) {
|
|
512
|
-
// 修复取值问题bug
|
|
513
|
-
// if (!this.formData.business) {
|
|
514
|
-
|
|
515
|
-
// }
|
|
516
|
-
// data = data.business ? data : this.getFormDataRes();
|
|
517
|
-
data = data || this.getFormDataRes();
|
|
518
|
-
const _this = this;
|
|
519
|
-
if (this.isLoading) return;
|
|
520
|
-
this.isLoading = true; // 更改状态
|
|
521
|
-
|
|
522
|
-
const infoData = this.$refs.bank.getFormData();
|
|
523
|
-
if (!infoData) {
|
|
524
|
-
this.isLoading = false;
|
|
525
|
-
return;
|
|
526
|
-
}
|
|
527
|
-
try {
|
|
528
|
-
this.isLoading = true; // 更改状态
|
|
529
|
-
// 布局组件处理
|
|
530
|
-
const fields = Object.keys(this.formDesc).filter(
|
|
531
|
-
key => this.formDesc[key].type.indexOf("columns") > -1
|
|
532
|
-
);
|
|
533
|
-
|
|
534
|
-
if (fields.length > 0) {
|
|
535
|
-
fields.forEach(item => {
|
|
536
|
-
data = Object.assign(data, data[item]);
|
|
537
|
-
});
|
|
538
|
-
}
|
|
539
|
-
const parse = Object.assign({}, data, {
|
|
540
|
-
companyNo: infoData.departmentCompanyNo,
|
|
541
|
-
departmentNo: infoData.departmentNo,
|
|
542
|
-
staffNo: infoData.staffNo,
|
|
543
|
-
operator: infoData.charger,
|
|
544
|
-
companyStr: infoData.companyStr,
|
|
545
|
-
departmentStr: infoData.departmentStr,
|
|
546
|
-
staffStr: infoData.staffStr,
|
|
547
|
-
menuId: this.menuId
|
|
548
|
-
});
|
|
549
|
-
this.toApply(parse);
|
|
550
|
-
} catch (error) {
|
|
551
|
-
this.formError = { message: "保存失败" };
|
|
552
|
-
this.isLoading = false;
|
|
553
|
-
} finally {
|
|
554
|
-
// this.isLoading = false
|
|
555
|
-
}
|
|
556
|
-
},
|
|
557
|
-
async saveData(parse, auditId) {
|
|
558
|
-
const par = Object.assign(parse, { auditId: auditId });
|
|
559
|
-
const content = JSON.stringify(par);
|
|
560
|
-
const params = {
|
|
561
|
-
formId: this.formId,
|
|
562
|
-
companyNo: this.user.cno,
|
|
563
|
-
userNo: this.user.no,
|
|
564
|
-
content: content
|
|
565
|
-
};
|
|
566
|
-
let response;
|
|
567
|
-
if (this.id) {
|
|
568
|
-
params.id = this.id;
|
|
569
|
-
response = await api.updateFormData(params); // 发送请求
|
|
570
|
-
} else {
|
|
571
|
-
response = await api.saveFormData(params); // 发送请求
|
|
572
|
-
}
|
|
573
|
-
// 成功处理 this.toApply(parse, response.data.data)
|
|
574
|
-
|
|
575
|
-
if (response.data.state == "ok") {
|
|
576
|
-
this.$message.success("添加成功");
|
|
577
|
-
this.formData = {};
|
|
578
|
-
this.$removeTag("/designListPage/" + this.menuId);
|
|
579
|
-
} else {
|
|
580
|
-
this.$message.error(response.data.msg);
|
|
581
|
-
this.isLoading = false;
|
|
582
|
-
}
|
|
583
|
-
},
|
|
584
|
-
goBack() {
|
|
585
|
-
// this.$router.push({
|
|
586
|
-
// name: "formDataDetail",
|
|
587
|
-
// params: { id: this.menuId }
|
|
588
|
-
// });
|
|
589
|
-
// this.$removeTag("/designListPage/" + this.menuId);
|
|
590
|
-
},
|
|
591
|
-
async getFormDataById() {
|
|
592
|
-
const objId = this.$route.query.dataId;
|
|
593
|
-
if (!objId) {
|
|
594
|
-
return;
|
|
595
|
-
}
|
|
596
|
-
const res = await api.queryFormData({ id: objId });
|
|
597
|
-
|
|
598
|
-
if (res.data.state == "ok") {
|
|
599
|
-
this.formData = Object.assign({}, this.formData, res.data.data.content);
|
|
600
|
-
|
|
601
|
-
this.id = res.data.data._id;
|
|
602
|
-
this.infoData.departmentCompanyNo = res.data.data.content.companyNo;
|
|
603
|
-
this.infoData.departmentNo = res.data.data.content.departmentNo;
|
|
604
|
-
this.infoData.staffNo = res.data.data.content.staffNo;
|
|
605
|
-
this.infoData.charger = res.data.data.content.operator;
|
|
606
|
-
}
|
|
607
|
-
},
|
|
608
|
-
// 判断是不是有关联值
|
|
609
|
-
isLink() {
|
|
610
|
-
let flg = false;
|
|
611
|
-
const _this = this;
|
|
612
|
-
if (this.formDesc) {
|
|
613
|
-
for (const name in _this.formDesc) {
|
|
614
|
-
if (
|
|
615
|
-
_this.formDesc[name].customMode == 1 &&
|
|
616
|
-
_this.formDesc[name].customValue
|
|
617
|
-
) {
|
|
618
|
-
flg = true;
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
return flg;
|
|
623
|
-
},
|
|
624
|
-
// 根据value转化成function
|
|
625
|
-
formatFunc(customValue, newVal, formDesc, parentFiled) {
|
|
626
|
-
const vm = this;
|
|
627
|
-
const strReg = new RegExp(/\{key_[0-9]+\}/g);
|
|
628
|
-
|
|
629
|
-
const mackReg = new RegExp(
|
|
630
|
-
/[\+\-\*\/]|[<=]+|[>=]+|[!=]+|[==]+|AND|OR|NOT|\(|\)|TRUE|FALSE/g
|
|
631
|
-
);
|
|
632
|
-
const logicReg = new RegExp(/(AND|OR|NOT)*/g);
|
|
633
|
-
const logicReg2 = new RegExp(/(\&\&+|\|\|+|[!=]+|[==]+)/g);
|
|
634
|
-
const flagReg = new RegExp(/[\{\}]/g);
|
|
635
|
-
const brackets = new RegExp(/[\(|\)]/g);
|
|
636
|
-
const arr = [];
|
|
637
|
-
var currentFiled = "";
|
|
638
|
-
// const str2 = customValue.replace(/\{key_[0-9]+\}/g, "")
|
|
639
|
-
// console.log(str2, "@@@");
|
|
640
|
-
let str = customValue.replace(/\{key_[0-9]+\}/g, function(match) {
|
|
641
|
-
const filed = (currentFiled = match.substring(1, match.length - 1));
|
|
642
|
-
if (parentFiled) {
|
|
643
|
-
var ss;
|
|
644
|
-
var curkey = "";
|
|
645
|
-
if (!newVal[parentFiled]) {
|
|
646
|
-
newVal[parentFiled] = [];
|
|
647
|
-
}
|
|
648
|
-
var curIndex = _.findIndex(newVal[parentFiled], function(o) {
|
|
649
|
-
for (var key in o) {
|
|
650
|
-
if (Object.hasOwnProperty.call(o, key)) {
|
|
651
|
-
const element = o[key];
|
|
652
|
-
if (o.type != "index") {
|
|
653
|
-
if (key == filed) {
|
|
654
|
-
curkey = key;
|
|
655
|
-
return o[key] == element;
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
|
-
}
|
|
659
|
-
}
|
|
660
|
-
});
|
|
661
|
-
|
|
662
|
-
vm.curIndex = curIndex;
|
|
663
|
-
var curFIndex = _.findIndex(
|
|
664
|
-
formDesc[parentFiled]?.attrs?.columns,
|
|
665
|
-
function(o) {
|
|
666
|
-
if (o.type != "index") {
|
|
667
|
-
return customValue.indexOf(o.prop) > -1;
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
);
|
|
671
|
-
vm.curFIndex = curFIndex;
|
|
672
|
-
|
|
673
|
-
var cv =
|
|
674
|
-
!newVal[parentFiled][vm.$store.state.curCusTableIndex] &&
|
|
675
|
-
newVal[parentFiled]?.length == 0
|
|
676
|
-
? ""
|
|
677
|
-
: vm.$store.state.curCusTableIndex == null
|
|
678
|
-
? newVal[parentFiled][newVal[parentFiled]?.length - 1][filed]
|
|
679
|
-
: newVal[parentFiled][vm.$store.state.curCusTableIndex][filed];
|
|
680
|
-
var curCustomV = _.find(
|
|
681
|
-
formDesc[parentFiled]?.attrs?.columns,
|
|
682
|
-
function(o) {
|
|
683
|
-
if (o.type != "index") {
|
|
684
|
-
return o.content.customValue == customValue;
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
).content.customValue;
|
|
688
|
-
ss = cv || "";
|
|
689
|
-
// ss = cv || curCustomV || "";
|
|
690
|
-
} else {
|
|
691
|
-
var ss = newVal[filed]
|
|
692
|
-
? newVal[filed]
|
|
693
|
-
: formDesc[filed].customValue
|
|
694
|
-
? formDesc[filed].customValue
|
|
695
|
-
: "";
|
|
696
|
-
}
|
|
697
|
-
if (typeof newVal[filed] === "boolean" || typeof cv === "boolean") {
|
|
698
|
-
ss = newVal[filed].toString();
|
|
699
|
-
}
|
|
700
|
-
if (
|
|
701
|
-
formDesc[currentFiled]._type == "ele-form-checkbox" ||
|
|
702
|
-
formDesc[parentFiled]?.attrs?.columns[curFIndex]?.content?.type ==
|
|
703
|
-
"ele-form-checkbox"
|
|
704
|
-
) {
|
|
705
|
-
if (Array.isArray(ss)) {
|
|
706
|
-
ss.forEach((e, i) => {
|
|
707
|
-
const ss2 = _.find(formDesc[currentFiled].options, function(o) {
|
|
708
|
-
return o.value == e;
|
|
709
|
-
});
|
|
710
|
-
arr.push(ss2.text);
|
|
711
|
-
});
|
|
712
|
-
}
|
|
713
|
-
return arr;
|
|
714
|
-
}
|
|
715
|
-
if (
|
|
716
|
-
formDesc[currentFiled]._type == "ele-form-radio" ||
|
|
717
|
-
formDesc[parentFiled]?.attrs?.columns[curFIndex]?.content?.type ==
|
|
718
|
-
"ele-form-radio"
|
|
719
|
-
) {
|
|
720
|
-
const ss2 = _.find(formDesc[currentFiled].options, function(o) {
|
|
721
|
-
return o.value == ss;
|
|
722
|
-
});
|
|
723
|
-
return ss2 ? ss2.text : "";
|
|
724
|
-
}
|
|
725
|
-
// arr.push(ss2);
|
|
726
|
-
return ss;
|
|
727
|
-
});
|
|
728
|
-
|
|
729
|
-
// const resArr = str.match(logicReg);
|
|
730
|
-
str = str.replace(logicReg, function(match) {
|
|
731
|
-
if (match == "AND") {
|
|
732
|
-
return "&&";
|
|
733
|
-
} else if (match == "OR") {
|
|
734
|
-
return "||";
|
|
735
|
-
} else if (match == "NOT") {
|
|
736
|
-
return "!==";
|
|
737
|
-
} else {
|
|
738
|
-
return "";
|
|
739
|
-
}
|
|
740
|
-
});
|
|
741
|
-
// str = str.replace(mackReg, function(match) {
|
|
742
|
-
// return " " + match.substring(1, match.length - 1) + " ";
|
|
743
|
-
// });
|
|
744
|
-
// 判断计算相关节点是不是都是''
|
|
745
|
-
|
|
746
|
-
const flg = arr.filter((item, index) => {
|
|
747
|
-
return !!item;
|
|
748
|
-
});
|
|
749
|
-
// 取type
|
|
750
|
-
var flag2 = _.get(
|
|
751
|
-
formDesc[currentFiled] ||
|
|
752
|
-
formDesc[parentFiled]?.attrs?.columns[vm.curFIndex]?.content,
|
|
753
|
-
"_type",
|
|
754
|
-
false
|
|
755
|
-
);
|
|
756
|
-
// 是否纯文字
|
|
757
|
-
if (flg.length > 0 && flag2 !== "ele-form-checkbox") {
|
|
758
|
-
if (typeof new Function("return " + "" + str + "")() === "boolean") {
|
|
759
|
-
// 判断是否布尔值 是布尔值则做转换
|
|
760
|
-
return new Function("return " + "" + str + "")().toString();
|
|
761
|
-
// return "aaa"
|
|
762
|
-
} else {
|
|
763
|
-
// return eval(`(${str})`)
|
|
764
|
-
if (mackReg.test(str) && !str.includes(/[a-zA-Z]/)) {
|
|
765
|
-
str = StrHandle(str, mackReg);
|
|
766
|
-
str.includes("NaN") ? (str = "") : null;
|
|
767
|
-
}
|
|
768
|
-
return new Function("return " + "" + str + "")();
|
|
769
|
-
// return "aaa";
|
|
770
|
-
}
|
|
771
|
-
} else if (flag2 == "ele-form-checkbox") {
|
|
772
|
-
return str.toString();
|
|
773
|
-
} else if (!strReg.test(str)) {
|
|
774
|
-
const eXstr = "";
|
|
775
|
-
if (/'(.*)'/.test(str)) {
|
|
776
|
-
str = str.replace(/'/g, "");
|
|
777
|
-
return str;
|
|
778
|
-
}
|
|
779
|
-
if (mackReg.test(str) && !/[a-zA-Z]/.test(str)) {
|
|
780
|
-
if (brackets.test(str)) {
|
|
781
|
-
// 如果包含括号
|
|
782
|
-
if (
|
|
783
|
-
typeof new Function("return " + "" + str + "")() === "boolean"
|
|
784
|
-
) {
|
|
785
|
-
// 判断是否布尔值 是布尔值则做转换
|
|
786
|
-
return new Function("return " + "" + str + "")().toString();
|
|
787
|
-
// return "aaa"
|
|
788
|
-
} else {
|
|
789
|
-
return new Function("return " + "" + str + "")();
|
|
790
|
-
}
|
|
791
|
-
} else {
|
|
792
|
-
// 如果不包含括号
|
|
793
|
-
str = StrHandle(str, mackReg);
|
|
794
|
-
str.includes("NaN") ? (str = "") : null;
|
|
795
|
-
if (
|
|
796
|
-
typeof new Function("return " + "" + str + "")() === "boolean"
|
|
797
|
-
) {
|
|
798
|
-
// 判断是否布尔值 是布尔值则做转换
|
|
799
|
-
return new Function("return " + "" + str + "")().toString();
|
|
800
|
-
// return "aaa"
|
|
801
|
-
} else {
|
|
802
|
-
return new Function("return " + "" + str + "")();
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
if (logicReg2.test(str)) {
|
|
807
|
-
return new Function("return " + "" + str + "")().toString();
|
|
808
|
-
}
|
|
809
|
-
return str;
|
|
810
|
-
// return "aaa";
|
|
811
|
-
} else {
|
|
812
|
-
return "";
|
|
813
|
-
}
|
|
814
|
-
},
|
|
815
|
-
// 审批
|
|
816
|
-
async toApply(content) {
|
|
817
|
-
const type = "customForm_" + this.formId;
|
|
818
|
-
const applierName = this.$store.state.user.realName
|
|
819
|
-
? this.$store.state.user.realName
|
|
820
|
-
: this.$store.state.user.accountName;
|
|
821
|
-
const businessName = applierName + "的" + this.processName;
|
|
822
|
-
const param = {
|
|
823
|
-
...content,
|
|
824
|
-
id: this.processId,
|
|
825
|
-
objId: "1",
|
|
826
|
-
companyId: this.user.cno,
|
|
827
|
-
userId: this.user.no,
|
|
828
|
-
applyType: type,
|
|
829
|
-
businessName: businessName,
|
|
830
|
-
applierName: applierName
|
|
831
|
-
};
|
|
832
|
-
const data = { content: JSON.stringify(param) };
|
|
833
|
-
const res = await applyProcessCustomForm(data);
|
|
834
|
-
// if (res.data.state === "ok") {
|
|
835
|
-
|
|
836
|
-
if (res.data.state === "ok") {
|
|
837
|
-
this.saveData(content, res.data.data);
|
|
838
|
-
} else {
|
|
839
|
-
this.$message.error(res.data.msg);
|
|
840
|
-
this.isLoading = false;
|
|
841
|
-
}
|
|
842
|
-
},
|
|
843
|
-
// 查询表单审批流程
|
|
844
|
-
async queryProcessByType() {
|
|
845
|
-
const type = "customForm_" + this.formId;
|
|
846
|
-
const res = await queryProcessByType({
|
|
847
|
-
companyId: this.$store.state.user.cno,
|
|
848
|
-
type: type
|
|
849
|
-
});
|
|
850
|
-
if (res.data.state == "ok" && res.data.data) {
|
|
851
|
-
this.processId = res.data.data ? res.data.data._id : "";
|
|
852
|
-
const content =
|
|
853
|
-
res.data.data && res.data.data.content
|
|
854
|
-
? JSON.parse(res.data.data.content)
|
|
855
|
-
: {};
|
|
856
|
-
this.processName = content.name.substring(0, content.name.length - 2);
|
|
857
|
-
}
|
|
858
|
-
}
|
|
859
|
-
},
|
|
860
|
-
created() {
|
|
861
|
-
this.getFormDes();
|
|
862
|
-
this.getFormDataById();
|
|
863
|
-
},
|
|
864
|
-
mounted() {}
|
|
865
|
-
};
|
|
866
|
-
</script>
|
|
867
|
-
<style lang="scss" scoped>
|
|
868
|
-
h4 {
|
|
869
|
-
margin-top: 0;
|
|
870
|
-
padding: 15px 10px 10px 15px;
|
|
871
|
-
display: block;
|
|
872
|
-
border-bottom: 1px solid #ccc;
|
|
873
|
-
}
|
|
874
|
-
/deep/ .ele-form-btns {
|
|
875
|
-
/deep/ .el-button--default {
|
|
876
|
-
color: #409eff;
|
|
877
|
-
border-color: #c6e2ff;
|
|
878
|
-
// background-color: #ecf5ff;
|
|
879
|
-
}
|
|
880
|
-
}
|
|
881
|
-
.quill-editor /deep/ .ql-editor {
|
|
882
|
-
height: 200px;
|
|
883
|
-
}
|
|
884
|
-
.isSummary {
|
|
885
|
-
z-index: 2004;
|
|
886
|
-
cursor: pointer;
|
|
887
|
-
position: absolute;
|
|
888
|
-
left: -17px;
|
|
889
|
-
top: 14px;
|
|
890
|
-
// transform: translateY(-50%);
|
|
891
|
-
}
|
|
892
|
-
.form-generation {
|
|
893
|
-
padding: 30px 0 0;
|
|
894
|
-
}
|
|
895
|
-
/deep/ .ele-form-upload-file .el-link--inner img {
|
|
896
|
-
visibility: hidden;
|
|
897
|
-
}
|
|
898
|
-
/deep/ .ele-form .el-form-item .el-form-item__label {
|
|
899
|
-
padding: 0 20px 0 0;
|
|
900
|
-
}
|
|
901
|
-
/deep/ .ele-form-btns {
|
|
902
|
-
text-align: center;
|
|
903
|
-
}
|
|
904
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="form-generation"
|
|
4
|
+
v-loading="isLoading"
|
|
5
|
+
>
|
|
6
|
+
<!-- <h4>{{title}}</h4> -->
|
|
7
|
+
<el-row
|
|
8
|
+
type="flex"
|
|
9
|
+
justify="center"
|
|
10
|
+
>
|
|
11
|
+
<el-col :span="21">
|
|
12
|
+
<bank-form-heard
|
|
13
|
+
ref="bank"
|
|
14
|
+
:data="infoData"
|
|
15
|
+
:id="id"
|
|
16
|
+
></bank-form-heard>
|
|
17
|
+
</el-col>
|
|
18
|
+
</el-row>
|
|
19
|
+
<ele-form
|
|
20
|
+
:formDesc="formDesc"
|
|
21
|
+
v-model="formData"
|
|
22
|
+
:isLoading="isLoading"
|
|
23
|
+
:formError="formError"
|
|
24
|
+
:span="21"
|
|
25
|
+
@request="handleRequest"
|
|
26
|
+
@back="goBack"
|
|
27
|
+
v-bind="formAttr"
|
|
28
|
+
title=''
|
|
29
|
+
>
|
|
30
|
+
|
|
31
|
+
<template v-slot:form-content="{formData, formDesc, formErrorObj }">
|
|
32
|
+
<template v-for="(formItem, field, index) of formDesc">
|
|
33
|
+
<component
|
|
34
|
+
:key='index'
|
|
35
|
+
v-if="formItem.type == 'groupSummary'"
|
|
36
|
+
:is="formItem._type"
|
|
37
|
+
:titleStr="formItem.label"
|
|
38
|
+
/>
|
|
39
|
+
<el-form-item
|
|
40
|
+
:key='index'
|
|
41
|
+
v-else-if="formItem.type !== 'groupTitle'&& formItem.type !== 'groupSummary'"
|
|
42
|
+
:error="formErrorObj ? formErrorObj[field] : null"
|
|
43
|
+
:label="
|
|
44
|
+
(formAttr.isShowLabel === false || formItem.isShowLabel === false) ? null : formItem.label
|
|
45
|
+
"
|
|
46
|
+
:prop="field"
|
|
47
|
+
:label-width="formItem._type.indexOf('columns') == -1 ? formAttr.labelWidth+'px' : '0px'"
|
|
48
|
+
>
|
|
49
|
+
<el-tooltip
|
|
50
|
+
v-if='formItem.attrs && formItem.attrs.summary'
|
|
51
|
+
class="item"
|
|
52
|
+
effect="dark"
|
|
53
|
+
:content="formItem.attrs && formItem.attrs.summary"
|
|
54
|
+
placement="top"
|
|
55
|
+
>
|
|
56
|
+
<i class="el-icon-warning-outline isSummary"></i>
|
|
57
|
+
</el-tooltip>
|
|
58
|
+
|
|
59
|
+
<component
|
|
60
|
+
v-if="formItem.business !== '888'&& formItem._type !=='custom-table' && formItem.type !== 'groupSummary'
|
|
61
|
+
|
|
62
|
+
&& formItem._type !=='columns' && formItem.type !=='formDep' && formItem.type !=='person' && formItem.type !=='linkForm'
|
|
63
|
+
&&(formItem._type =='ele-form-input' && formItem.attrs && formItem.attrs.type !=='number')"
|
|
64
|
+
:disabled="formAttr.disabled || formItem._disabled"
|
|
65
|
+
:desc="formItem"
|
|
66
|
+
:is="formItem._type"
|
|
67
|
+
:options="formItem._options"
|
|
68
|
+
:ref="field"
|
|
69
|
+
:field="field"
|
|
70
|
+
@onChange='onChange'
|
|
71
|
+
v-model="formData[field]"
|
|
72
|
+
/>
|
|
73
|
+
<component
|
|
74
|
+
v-else-if=" formItem.type =='upload-file' || formItem.type =='image-uploader'|| formItem.type =='quill-editor'|| formItem.type =='switch'"
|
|
75
|
+
:disabled="formAttr.disabled || formItem._disabled"
|
|
76
|
+
:desc="formItem"
|
|
77
|
+
:is="formItem._type"
|
|
78
|
+
:options="formItem._options"
|
|
79
|
+
:ref="field"
|
|
80
|
+
:field="field"
|
|
81
|
+
@onChange='onChange'
|
|
82
|
+
v-model="formData[field]"
|
|
83
|
+
/>
|
|
84
|
+
<!-- ele-form-radio
|
|
85
|
+
ele-form-checkbox
|
|
86
|
+
ele-form-datetime
|
|
87
|
+
ele-form-datetimerange -->
|
|
88
|
+
<component
|
|
89
|
+
v-if="formItem.type=='radio'||formItem.type=='checkbox'||formItem.type=='datetime'||formItem.type=='datetimerange'"
|
|
90
|
+
:disabled="formAttr.disabled || formItem._disabled"
|
|
91
|
+
:desc="formItem"
|
|
92
|
+
:is="formItem._type"
|
|
93
|
+
:options="formItem._options"
|
|
94
|
+
:ref="field"
|
|
95
|
+
:field="field"
|
|
96
|
+
@onChange='onChange'
|
|
97
|
+
v-model="formData[field]"
|
|
98
|
+
/>
|
|
99
|
+
<component
|
|
100
|
+
v-if="formItem.attrs&& formItem.attrs.type =='number'"
|
|
101
|
+
:disabled="formAttr.disabled || formItem._disabled"
|
|
102
|
+
:desc="formItem"
|
|
103
|
+
:is="formItem._type"
|
|
104
|
+
:options="formItem._options"
|
|
105
|
+
:ref="field"
|
|
106
|
+
:field="field"
|
|
107
|
+
@input="(res)=>{formatNumbers(res,formItem.attrs.numbers,formItem,field)}"
|
|
108
|
+
v-model="formData[field]"
|
|
109
|
+
/>
|
|
110
|
+
<component
|
|
111
|
+
v-if="formItem._type =='custom-table'"
|
|
112
|
+
:disabled="formAttr.disabled || formItem._disabled"
|
|
113
|
+
:desc="formItem"
|
|
114
|
+
:is="formItem._type"
|
|
115
|
+
:options="formItem._options"
|
|
116
|
+
:ref="field"
|
|
117
|
+
:field="field"
|
|
118
|
+
@input="(res)=>{inputChange(res,formItem.attrs.numbers,formItem,field)}"
|
|
119
|
+
v-model="formData[field]"
|
|
120
|
+
/>
|
|
121
|
+
<component
|
|
122
|
+
v-if="formItem._type =='columns'"
|
|
123
|
+
:disabled="formAttr.disabled || formItem._disabled"
|
|
124
|
+
:desc="formItem"
|
|
125
|
+
:is="formItem._type"
|
|
126
|
+
:options="formItem._options"
|
|
127
|
+
:ref="field"
|
|
128
|
+
:field="field"
|
|
129
|
+
@input="(res)=>{inputChange(res,formItem.attrs.numbers,formItem,field)}"
|
|
130
|
+
v-model="formData[field]"
|
|
131
|
+
/>
|
|
132
|
+
<component
|
|
133
|
+
v-if="formItem.type =='formDep'"
|
|
134
|
+
:disabled="formAttr.disabled || formItem._disabled"
|
|
135
|
+
:desc="formItem"
|
|
136
|
+
:is="formItem._type"
|
|
137
|
+
:options="formItem._options"
|
|
138
|
+
:ref="field"
|
|
139
|
+
:field="field"
|
|
140
|
+
:defaultArr="formData[field]"
|
|
141
|
+
:isMultiple='formItem.attrs?formItem.attrs.multiple:false'
|
|
142
|
+
@input="(res)=>{inputChange(res,formItem.attrs,formItem,field)}"
|
|
143
|
+
@dep="(res)=>{dep(res,formItem.attrs,formItem,field)}"
|
|
144
|
+
v-model="formData[field+'Str']"
|
|
145
|
+
/>
|
|
146
|
+
<component
|
|
147
|
+
v-if="formItem.type =='person'"
|
|
148
|
+
:disabled="formAttr.disabled || formItem._disabled"
|
|
149
|
+
:desc="formItem"
|
|
150
|
+
:is="formItem._type"
|
|
151
|
+
:options="formItem._options"
|
|
152
|
+
:ref="field"
|
|
153
|
+
:field="field"
|
|
154
|
+
:isMultiple='formItem.attrs?formItem.attrs.multiple:false'
|
|
155
|
+
:defaultArr="formData[field]"
|
|
156
|
+
@input="(res)=>{inputChange(res,formItem.attrs,formItem,field)}"
|
|
157
|
+
@dep="(res)=>{dep(res,formItem.attrs,formItem,field)}"
|
|
158
|
+
v-model="formData[field+'Str']"
|
|
159
|
+
/>
|
|
160
|
+
<component
|
|
161
|
+
v-if="formItem.type =='linkForm'"
|
|
162
|
+
:disabled="formAttr.disabled || formItem._disabled"
|
|
163
|
+
:desc="formItem"
|
|
164
|
+
:is="formItem._type"
|
|
165
|
+
:options="formItem._options"
|
|
166
|
+
:ref="field"
|
|
167
|
+
:field="field"
|
|
168
|
+
:defaultArr1="formData[field]"
|
|
169
|
+
:menuId='formItem.attrs?formItem.attrs.formLink:""'
|
|
170
|
+
:isMultiple='formItem.attrs?formItem.attrs.multiple:false'
|
|
171
|
+
@input="(res)=>{inputChange(res,formItem.attrs,formItem,field)}"
|
|
172
|
+
@dep="(res)=>{dep(res,formItem.attrs,formItem,field)}"
|
|
173
|
+
@getcurrentTitle="(res)=>{formCurrentTitle(res,formItem.attrs,formItem,field)}"
|
|
174
|
+
v-model="formData[field+'Str']"
|
|
175
|
+
/>
|
|
176
|
+
<span
|
|
177
|
+
:key='index'
|
|
178
|
+
v-else-if="$route.name!='formGeneration' && (formItem.type == 'postman'|| formItem.type == 'handleCode')"
|
|
179
|
+
:ref="field"
|
|
180
|
+
>系统自动生成</span>
|
|
181
|
+
|
|
182
|
+
<div
|
|
183
|
+
class="ele-form-tip"
|
|
184
|
+
v-if="formItem.tip"
|
|
185
|
+
v-html="formItem.tip"
|
|
186
|
+
>
|
|
187
|
+
</div>
|
|
188
|
+
</el-form-item>
|
|
189
|
+
<component
|
|
190
|
+
:key='index'
|
|
191
|
+
v-else-if="formItem.type == 'groupTitle'"
|
|
192
|
+
:is="formItem._type"
|
|
193
|
+
:ref="field"
|
|
194
|
+
:titleStr="formItem.label"
|
|
195
|
+
/>
|
|
196
|
+
|
|
197
|
+
</template>
|
|
198
|
+
|
|
199
|
+
</template>
|
|
200
|
+
|
|
201
|
+
<!-- <template v-slot:form-content="{ formData, formDesc, formErrorObj }">
|
|
202
|
+
|
|
203
|
+
<template v-for="(formItem, field, index) of formDesc">
|
|
204
|
+
|
|
205
|
+
<el-form-item :key='index' :error="formErrorObj ? formErrorObj[field] : null" :label="
|
|
206
|
+
(formAttr.isShowLabel === false || formItem.isShowLabel === false) ? null : formItem.label
|
|
207
|
+
" :prop="field"
|
|
208
|
+
:label-width="formItem._type.indexOf('columns') == -1 ? formAttr.labelWidth+'px' : '0px'">
|
|
209
|
+
<component v-if="formItem.business !== '888'"
|
|
210
|
+
:disabled="formAttr.disabled || formItem._disabled" :desc="formItem"
|
|
211
|
+
:is="formItem._type" :options="formItem._options" :ref="field" :field="field"
|
|
212
|
+
v-model="formItem.default" />
|
|
213
|
+
|
|
214
|
+
<div class="ele-form-tip" v-if="formItem.tip" v-html="formItem.tip">
|
|
215
|
+
|
|
216
|
+
</div>
|
|
217
|
+
|
|
218
|
+
</el-form-item>
|
|
219
|
+
<div id="components" :key='index' class="component-container" v-if="formItem.business == '888'">
|
|
220
|
+
<bank-form-heard ref="bank" :data="infoData" :id="id" ></bank-form-heard>
|
|
221
|
+
</div>
|
|
222
|
+
</template>
|
|
223
|
+
</template> -->
|
|
224
|
+
|
|
225
|
+
</ele-form>
|
|
226
|
+
</div>
|
|
227
|
+
</template>
|
|
228
|
+
|
|
229
|
+
<script>
|
|
230
|
+
import _ from "lodash-es";
|
|
231
|
+
import { mapState } from "vuex";
|
|
232
|
+
import * as api from "@/api/apiFormBuilder/menu";
|
|
233
|
+
import formAttrDefault from "@/store/formBuilder/formAttrDefault";
|
|
234
|
+
import bankFormHeard from "@/formBuilder/components/app-main/components/components/bankFormHeard";
|
|
235
|
+
import { queryProcessByType, applyProcessCustomForm } from "@/api/apiProcess";
|
|
236
|
+
import GroupTitle from "@/formBuilder/components/app-main/components/components/GroupTitle.vue";
|
|
237
|
+
import GroupSummary from "@/formBuilder/components/app-main/components/components/GroupSummary.vue";
|
|
238
|
+
import { StrHandle } from "@/fnc/arr";
|
|
239
|
+
import handleCode from "@/formBuilder/components/app-main/components/components/handleCode";
|
|
240
|
+
import postman from "@/formBuilder/components/app-main/components/components/postman";
|
|
241
|
+
import formDep from "@/formBuilder/components/app-main/components/components/formDep";
|
|
242
|
+
import person from "@/formBuilder/components/app-main/components/components/person";
|
|
243
|
+
import linkForm from "@/formBuilder/components/app-main/components/components/linkForm";
|
|
244
|
+
|
|
245
|
+
export default {
|
|
246
|
+
name: "FormGeneration",
|
|
247
|
+
components: {
|
|
248
|
+
bankFormHeard,
|
|
249
|
+
GroupTitle,
|
|
250
|
+
GroupSummary,
|
|
251
|
+
postman,
|
|
252
|
+
handleCode,
|
|
253
|
+
formDep,
|
|
254
|
+
person,
|
|
255
|
+
linkForm
|
|
256
|
+
},
|
|
257
|
+
data() {
|
|
258
|
+
return {
|
|
259
|
+
apps: "bankFormHeard",
|
|
260
|
+
formData: {},
|
|
261
|
+
curIndex: null,
|
|
262
|
+
curFIndex: null,
|
|
263
|
+
formDesc: {},
|
|
264
|
+
formAttr: {},
|
|
265
|
+
isLoading: false,
|
|
266
|
+
formError: {},
|
|
267
|
+
formId: "",
|
|
268
|
+
id: "",
|
|
269
|
+
menuId: "",
|
|
270
|
+
infoData: {
|
|
271
|
+
departmentCompanyNo: "",
|
|
272
|
+
departmentNo: "",
|
|
273
|
+
staffNo: "",
|
|
274
|
+
charger: ""
|
|
275
|
+
},
|
|
276
|
+
processId: "",
|
|
277
|
+
processName: ""
|
|
278
|
+
};
|
|
279
|
+
},
|
|
280
|
+
computed: {
|
|
281
|
+
...mapState(["user"]),
|
|
282
|
+
// title() {
|
|
283
|
+
// return this.$store.state.formBuilder.name;
|
|
284
|
+
// },
|
|
285
|
+
getStrArr() {
|
|
286
|
+
return function(formData, field) {
|
|
287
|
+
return this.arr[index].username.match(this.name) !== null;
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
watch: {
|
|
292
|
+
$route(to, from) {
|
|
293
|
+
this.getFormDes();
|
|
294
|
+
this.getFormDataById();
|
|
295
|
+
},
|
|
296
|
+
list: {
|
|
297
|
+
deep: true,
|
|
298
|
+
handler: function(newVal, oldVal) {
|
|
299
|
+
const _this = this;
|
|
300
|
+
if (newVal && _this.isLink) {
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
formDesc: {
|
|
305
|
+
deep: true,
|
|
306
|
+
handler: function(newVal, oldVal) {
|
|
307
|
+
const _this = this;
|
|
308
|
+
_this.$delete(_this.formDesc, "business");
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
formData: {
|
|
312
|
+
deep: true,
|
|
313
|
+
immediate: true,
|
|
314
|
+
handler: function(newVal, oldVal) {
|
|
315
|
+
const _this = this;
|
|
316
|
+
if (newVal) {
|
|
317
|
+
for (const name in _this.formDesc) {
|
|
318
|
+
if (
|
|
319
|
+
_this.formDesc[name].attrs &&
|
|
320
|
+
_this.formDesc[name].attrs.columns
|
|
321
|
+
) {
|
|
322
|
+
_this.formDesc[name].attrs.columns.forEach(e => {
|
|
323
|
+
if (
|
|
324
|
+
_this.formDesc[name].type == "custom-table" &&
|
|
325
|
+
e.type != "index"
|
|
326
|
+
) {
|
|
327
|
+
if (e.content.customMode == 1 && e.content.customValue) {
|
|
328
|
+
const func = this.formatFunc(
|
|
329
|
+
e.content.customValue,
|
|
330
|
+
newVal,
|
|
331
|
+
_this.formDesc,
|
|
332
|
+
name
|
|
333
|
+
);
|
|
334
|
+
var exp = null;
|
|
335
|
+
if (exp == _this.$store.state.curCusTableIndex) {
|
|
336
|
+
} else {
|
|
337
|
+
if (_this.formData[name].length == 0) {
|
|
338
|
+
_this.formData[name].push({
|
|
339
|
+
[e.prop]: func
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
_this.$set(
|
|
343
|
+
_this.formData[name][
|
|
344
|
+
_this.$store.state.curCusTableIndex
|
|
345
|
+
],
|
|
346
|
+
e.prop,
|
|
347
|
+
func
|
|
348
|
+
);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
// if (!strReg.test(_this.formDesc[name].customValue)) {
|
|
352
|
+
// _this.formData[name] = _this.formDesc[name].customValue;
|
|
353
|
+
// }
|
|
354
|
+
}
|
|
355
|
+
} else if (e.customMode == 1 && e.customValue) {
|
|
356
|
+
const func = this.formatFunc(
|
|
357
|
+
e.customValue,
|
|
358
|
+
newVal,
|
|
359
|
+
_this.formDesc
|
|
360
|
+
);
|
|
361
|
+
// _this.formData[name][e.field] = func;
|
|
362
|
+
|
|
363
|
+
_this.$set(_this.formData[name], e.field, func);
|
|
364
|
+
// if (!strReg.test(_this.formDesc[name].customValue)) {
|
|
365
|
+
// _this.formData[name] = _this.formDesc[name].customValue;
|
|
366
|
+
// }
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
if (
|
|
371
|
+
_this.formDesc[name].customMode == 1 &&
|
|
372
|
+
_this.formDesc[name].customValue
|
|
373
|
+
) {
|
|
374
|
+
const func = this.formatFunc(
|
|
375
|
+
_this.formDesc[name].customValue,
|
|
376
|
+
newVal,
|
|
377
|
+
_this.formDesc
|
|
378
|
+
);
|
|
379
|
+
// _this.formData[name] = func;
|
|
380
|
+
_this.$set(_this.formData, name, func);
|
|
381
|
+
// if (!strReg.test(_this.formDesc[name].customValue)) {
|
|
382
|
+
// _this.formData[name] = _this.formDesc[name].customValue;
|
|
383
|
+
// }
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
_this.$delete(_this.formData, "business");
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
},
|
|
391
|
+
methods: {
|
|
392
|
+
formCurrentTitle(res, attrs, formItem, field) {
|
|
393
|
+
const vm = this;
|
|
394
|
+
vm.$set(vm.formData, [field], res.title);
|
|
395
|
+
vm.$set(vm.formData, [field + "Arr"], attrs.dataRules);
|
|
396
|
+
vm.getcurrentRule(res, attrs, formItem, field);
|
|
397
|
+
},
|
|
398
|
+
getcurrentRule(res, attrs, formItem, field) {
|
|
399
|
+
const vm = this;
|
|
400
|
+
// 对端表单数据
|
|
401
|
+
const remoteData = res.data[res.index].content;
|
|
402
|
+
|
|
403
|
+
const newObj = {};
|
|
404
|
+
attrs.dataRules.forEach((e, i) => {
|
|
405
|
+
if (_.has(remoteData, e.itemRemote)) {
|
|
406
|
+
vm.$set(vm.formData, [e.itemSource], remoteData[e.itemRemote]);
|
|
407
|
+
}
|
|
408
|
+
});
|
|
409
|
+
},
|
|
410
|
+
onChange(res) {
|
|
411
|
+
console.log(res);
|
|
412
|
+
},
|
|
413
|
+
inputChange(res, numbers, formItem, field) {
|
|
414
|
+
const vm = this;
|
|
415
|
+
vm.$set(vm.formData, field, res);
|
|
416
|
+
},
|
|
417
|
+
dep(res, numbers, formItem, field) {
|
|
418
|
+
const vm = this;
|
|
419
|
+
|
|
420
|
+
vm.$set(vm.formData, [field + "Str"], res);
|
|
421
|
+
},
|
|
422
|
+
formatNumbers(res, numbers, formItem, field) {
|
|
423
|
+
const vm = this
|
|
424
|
+
// 控制小数位
|
|
425
|
+
this.$nextTick(() => {
|
|
426
|
+
formItem.default = Number(res).toFixed(Number(numbers));
|
|
427
|
+
var s = 1 / Math.pow(10, Number(numbers));
|
|
428
|
+
this.$refs[field][0].attrs.step = s;
|
|
429
|
+
});
|
|
430
|
+
vm.$set(vm.formData, field, res);
|
|
431
|
+
},
|
|
432
|
+
getFormDataRes() {
|
|
433
|
+
const vm = this;
|
|
434
|
+
for (const key in vm.formDesc) {
|
|
435
|
+
if (key !== "bank-form-heard") {
|
|
436
|
+
// vm.formData[key] = vm.formDesc[key].default;
|
|
437
|
+
vm.$set(vm.formData, key, vm.formDesc[key].default);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
return vm.formData;
|
|
441
|
+
},
|
|
442
|
+
// 获取表单配置信息
|
|
443
|
+
async getFormDes() {
|
|
444
|
+
const id = this.$route.params.id;
|
|
445
|
+
if (!id) {
|
|
446
|
+
return;
|
|
447
|
+
}
|
|
448
|
+
this.menuId = id;
|
|
449
|
+
const { data } = await api.queryFormByMenu({
|
|
450
|
+
menuId: id,
|
|
451
|
+
companyNo: this.user.cno
|
|
452
|
+
});
|
|
453
|
+
if (data.state == "ok" && JSON.stringify(data.data) == "{}") {
|
|
454
|
+
this.formId = data.data.id;
|
|
455
|
+
} else if (data.state == "ok" && data.data) {
|
|
456
|
+
this.formId = data.data.id;
|
|
457
|
+
const formDesc = Object.entries(data.data.content.formDesc).map(
|
|
458
|
+
([key, val]) => {
|
|
459
|
+
if (val.type == "image-uploader" || val.type == "quill-editor") {
|
|
460
|
+
val.attrs.responseFn = function(response, file) {
|
|
461
|
+
return response.data;
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
if (val.type == "upload-file") {
|
|
465
|
+
val.attrs.responseFn = function(response, file) {
|
|
466
|
+
return { name: file.name, url: response.data };
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
if (val.type == "columns") {
|
|
470
|
+
val.attrs.columns.forEach((i, index) => {
|
|
471
|
+
if (i.type == "image-uploader" || i.type == "quill-editor") {
|
|
472
|
+
i.attrs.responseFn = function(response, file) {
|
|
473
|
+
return response.data;
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
if (i.type == "upload-file") {
|
|
477
|
+
i.attrs.responseFn = function(response, file) {
|
|
478
|
+
return { name: file.name, url: response.data };
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
});
|
|
482
|
+
}
|
|
483
|
+
if (val.attrs && val.attrs.type && val.attrs.type == "number") {
|
|
484
|
+
// if (val.attrs.numbers) {
|
|
485
|
+
|
|
486
|
+
// }
|
|
487
|
+
val.attrs.min = 0;
|
|
488
|
+
val.attrs.max = 99999999999999999;
|
|
489
|
+
// val.attrs.step = "0.0001";
|
|
490
|
+
}
|
|
491
|
+
// 处理正则pattern
|
|
492
|
+
if (val.rules) {
|
|
493
|
+
val.rules.map(one => {
|
|
494
|
+
one.pattern = eval(one.pattern);
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
);
|
|
499
|
+
this.formDesc = data.data.content.formDesc;
|
|
500
|
+
data.data.content.formAttr.isShowBackBtn = true;
|
|
501
|
+
data.data.content.formAttr.isShowSubmitBtn = true;
|
|
502
|
+
this.formAttr = Object.assign(
|
|
503
|
+
_.cloneDeep(formAttrDefault),
|
|
504
|
+
data.data.content.formAttr
|
|
505
|
+
);
|
|
506
|
+
} else {
|
|
507
|
+
this.$message.error(data.msg ? data.msg : "获取信息失败");
|
|
508
|
+
}
|
|
509
|
+
this.formId && this.queryProcessByType();
|
|
510
|
+
},
|
|
511
|
+
async handleRequest(data) {
|
|
512
|
+
// 修复取值问题bug
|
|
513
|
+
// if (!this.formData.business) {
|
|
514
|
+
|
|
515
|
+
// }
|
|
516
|
+
// data = data.business ? data : this.getFormDataRes();
|
|
517
|
+
data = data || this.getFormDataRes();
|
|
518
|
+
const _this = this;
|
|
519
|
+
if (this.isLoading) return;
|
|
520
|
+
this.isLoading = true; // 更改状态
|
|
521
|
+
|
|
522
|
+
const infoData = this.$refs.bank.getFormData();
|
|
523
|
+
if (!infoData) {
|
|
524
|
+
this.isLoading = false;
|
|
525
|
+
return;
|
|
526
|
+
}
|
|
527
|
+
try {
|
|
528
|
+
this.isLoading = true; // 更改状态
|
|
529
|
+
// 布局组件处理
|
|
530
|
+
const fields = Object.keys(this.formDesc).filter(
|
|
531
|
+
key => this.formDesc[key].type.indexOf("columns") > -1
|
|
532
|
+
);
|
|
533
|
+
|
|
534
|
+
if (fields.length > 0) {
|
|
535
|
+
fields.forEach(item => {
|
|
536
|
+
data = Object.assign(data, data[item]);
|
|
537
|
+
});
|
|
538
|
+
}
|
|
539
|
+
const parse = Object.assign({}, data, {
|
|
540
|
+
companyNo: infoData.departmentCompanyNo,
|
|
541
|
+
departmentNo: infoData.departmentNo,
|
|
542
|
+
staffNo: infoData.staffNo,
|
|
543
|
+
operator: infoData.charger,
|
|
544
|
+
companyStr: infoData.companyStr,
|
|
545
|
+
departmentStr: infoData.departmentStr,
|
|
546
|
+
staffStr: infoData.staffStr,
|
|
547
|
+
menuId: this.menuId
|
|
548
|
+
});
|
|
549
|
+
this.toApply(parse);
|
|
550
|
+
} catch (error) {
|
|
551
|
+
this.formError = { message: "保存失败" };
|
|
552
|
+
this.isLoading = false;
|
|
553
|
+
} finally {
|
|
554
|
+
// this.isLoading = false
|
|
555
|
+
}
|
|
556
|
+
},
|
|
557
|
+
async saveData(parse, auditId) {
|
|
558
|
+
const par = Object.assign(parse, { auditId: auditId });
|
|
559
|
+
const content = JSON.stringify(par);
|
|
560
|
+
const params = {
|
|
561
|
+
formId: this.formId,
|
|
562
|
+
companyNo: this.user.cno,
|
|
563
|
+
userNo: this.user.no,
|
|
564
|
+
content: content
|
|
565
|
+
};
|
|
566
|
+
let response;
|
|
567
|
+
if (this.id) {
|
|
568
|
+
params.id = this.id;
|
|
569
|
+
response = await api.updateFormData(params); // 发送请求
|
|
570
|
+
} else {
|
|
571
|
+
response = await api.saveFormData(params); // 发送请求
|
|
572
|
+
}
|
|
573
|
+
// 成功处理 this.toApply(parse, response.data.data)
|
|
574
|
+
|
|
575
|
+
if (response.data.state == "ok") {
|
|
576
|
+
this.$message.success("添加成功");
|
|
577
|
+
this.formData = {};
|
|
578
|
+
this.$removeTag("/designListPage/" + this.menuId);
|
|
579
|
+
} else {
|
|
580
|
+
this.$message.error(response.data.msg);
|
|
581
|
+
this.isLoading = false;
|
|
582
|
+
}
|
|
583
|
+
},
|
|
584
|
+
goBack() {
|
|
585
|
+
// this.$router.push({
|
|
586
|
+
// name: "formDataDetail",
|
|
587
|
+
// params: { id: this.menuId }
|
|
588
|
+
// });
|
|
589
|
+
// this.$removeTag("/designListPage/" + this.menuId);
|
|
590
|
+
},
|
|
591
|
+
async getFormDataById() {
|
|
592
|
+
const objId = this.$route.query.dataId;
|
|
593
|
+
if (!objId) {
|
|
594
|
+
return;
|
|
595
|
+
}
|
|
596
|
+
const res = await api.queryFormData({ id: objId });
|
|
597
|
+
|
|
598
|
+
if (res.data.state == "ok") {
|
|
599
|
+
this.formData = Object.assign({}, this.formData, res.data.data.content);
|
|
600
|
+
|
|
601
|
+
this.id = res.data.data._id;
|
|
602
|
+
this.infoData.departmentCompanyNo = res.data.data.content.companyNo;
|
|
603
|
+
this.infoData.departmentNo = res.data.data.content.departmentNo;
|
|
604
|
+
this.infoData.staffNo = res.data.data.content.staffNo;
|
|
605
|
+
this.infoData.charger = res.data.data.content.operator;
|
|
606
|
+
}
|
|
607
|
+
},
|
|
608
|
+
// 判断是不是有关联值
|
|
609
|
+
isLink() {
|
|
610
|
+
let flg = false;
|
|
611
|
+
const _this = this;
|
|
612
|
+
if (this.formDesc) {
|
|
613
|
+
for (const name in _this.formDesc) {
|
|
614
|
+
if (
|
|
615
|
+
_this.formDesc[name].customMode == 1 &&
|
|
616
|
+
_this.formDesc[name].customValue
|
|
617
|
+
) {
|
|
618
|
+
flg = true;
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
return flg;
|
|
623
|
+
},
|
|
624
|
+
// 根据value转化成function
|
|
625
|
+
formatFunc(customValue, newVal, formDesc, parentFiled) {
|
|
626
|
+
const vm = this;
|
|
627
|
+
const strReg = new RegExp(/\{key_[0-9]+\}/g);
|
|
628
|
+
|
|
629
|
+
const mackReg = new RegExp(
|
|
630
|
+
/[\+\-\*\/]|[<=]+|[>=]+|[!=]+|[==]+|AND|OR|NOT|\(|\)|TRUE|FALSE/g
|
|
631
|
+
);
|
|
632
|
+
const logicReg = new RegExp(/(AND|OR|NOT)*/g);
|
|
633
|
+
const logicReg2 = new RegExp(/(\&\&+|\|\|+|[!=]+|[==]+)/g);
|
|
634
|
+
const flagReg = new RegExp(/[\{\}]/g);
|
|
635
|
+
const brackets = new RegExp(/[\(|\)]/g);
|
|
636
|
+
const arr = [];
|
|
637
|
+
var currentFiled = "";
|
|
638
|
+
// const str2 = customValue.replace(/\{key_[0-9]+\}/g, "")
|
|
639
|
+
// console.log(str2, "@@@");
|
|
640
|
+
let str = customValue.replace(/\{key_[0-9]+\}/g, function(match) {
|
|
641
|
+
const filed = (currentFiled = match.substring(1, match.length - 1));
|
|
642
|
+
if (parentFiled) {
|
|
643
|
+
var ss;
|
|
644
|
+
var curkey = "";
|
|
645
|
+
if (!newVal[parentFiled]) {
|
|
646
|
+
newVal[parentFiled] = [];
|
|
647
|
+
}
|
|
648
|
+
var curIndex = _.findIndex(newVal[parentFiled], function(o) {
|
|
649
|
+
for (var key in o) {
|
|
650
|
+
if (Object.hasOwnProperty.call(o, key)) {
|
|
651
|
+
const element = o[key];
|
|
652
|
+
if (o.type != "index") {
|
|
653
|
+
if (key == filed) {
|
|
654
|
+
curkey = key;
|
|
655
|
+
return o[key] == element;
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
});
|
|
661
|
+
|
|
662
|
+
vm.curIndex = curIndex;
|
|
663
|
+
var curFIndex = _.findIndex(
|
|
664
|
+
formDesc[parentFiled]?.attrs?.columns,
|
|
665
|
+
function(o) {
|
|
666
|
+
if (o.type != "index") {
|
|
667
|
+
return customValue.indexOf(o.prop) > -1;
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
);
|
|
671
|
+
vm.curFIndex = curFIndex;
|
|
672
|
+
|
|
673
|
+
var cv =
|
|
674
|
+
!newVal[parentFiled][vm.$store.state.curCusTableIndex] &&
|
|
675
|
+
newVal[parentFiled]?.length == 0
|
|
676
|
+
? ""
|
|
677
|
+
: vm.$store.state.curCusTableIndex == null
|
|
678
|
+
? newVal[parentFiled][newVal[parentFiled]?.length - 1][filed]
|
|
679
|
+
: newVal[parentFiled][vm.$store.state.curCusTableIndex][filed];
|
|
680
|
+
var curCustomV = _.find(
|
|
681
|
+
formDesc[parentFiled]?.attrs?.columns,
|
|
682
|
+
function(o) {
|
|
683
|
+
if (o.type != "index") {
|
|
684
|
+
return o.content.customValue == customValue;
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
).content.customValue;
|
|
688
|
+
ss = cv || "";
|
|
689
|
+
// ss = cv || curCustomV || "";
|
|
690
|
+
} else {
|
|
691
|
+
var ss = newVal[filed]
|
|
692
|
+
? newVal[filed]
|
|
693
|
+
: formDesc[filed].customValue
|
|
694
|
+
? formDesc[filed].customValue
|
|
695
|
+
: "";
|
|
696
|
+
}
|
|
697
|
+
if (typeof newVal[filed] === "boolean" || typeof cv === "boolean") {
|
|
698
|
+
ss = newVal[filed].toString();
|
|
699
|
+
}
|
|
700
|
+
if (
|
|
701
|
+
formDesc[currentFiled]._type == "ele-form-checkbox" ||
|
|
702
|
+
formDesc[parentFiled]?.attrs?.columns[curFIndex]?.content?.type ==
|
|
703
|
+
"ele-form-checkbox"
|
|
704
|
+
) {
|
|
705
|
+
if (Array.isArray(ss)) {
|
|
706
|
+
ss.forEach((e, i) => {
|
|
707
|
+
const ss2 = _.find(formDesc[currentFiled].options, function(o) {
|
|
708
|
+
return o.value == e;
|
|
709
|
+
});
|
|
710
|
+
arr.push(ss2.text);
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
return arr;
|
|
714
|
+
}
|
|
715
|
+
if (
|
|
716
|
+
formDesc[currentFiled]._type == "ele-form-radio" ||
|
|
717
|
+
formDesc[parentFiled]?.attrs?.columns[curFIndex]?.content?.type ==
|
|
718
|
+
"ele-form-radio"
|
|
719
|
+
) {
|
|
720
|
+
const ss2 = _.find(formDesc[currentFiled].options, function(o) {
|
|
721
|
+
return o.value == ss;
|
|
722
|
+
});
|
|
723
|
+
return ss2 ? ss2.text : "";
|
|
724
|
+
}
|
|
725
|
+
// arr.push(ss2);
|
|
726
|
+
return ss;
|
|
727
|
+
});
|
|
728
|
+
|
|
729
|
+
// const resArr = str.match(logicReg);
|
|
730
|
+
str = str.replace(logicReg, function(match) {
|
|
731
|
+
if (match == "AND") {
|
|
732
|
+
return "&&";
|
|
733
|
+
} else if (match == "OR") {
|
|
734
|
+
return "||";
|
|
735
|
+
} else if (match == "NOT") {
|
|
736
|
+
return "!==";
|
|
737
|
+
} else {
|
|
738
|
+
return "";
|
|
739
|
+
}
|
|
740
|
+
});
|
|
741
|
+
// str = str.replace(mackReg, function(match) {
|
|
742
|
+
// return " " + match.substring(1, match.length - 1) + " ";
|
|
743
|
+
// });
|
|
744
|
+
// 判断计算相关节点是不是都是''
|
|
745
|
+
|
|
746
|
+
const flg = arr.filter((item, index) => {
|
|
747
|
+
return !!item;
|
|
748
|
+
});
|
|
749
|
+
// 取type
|
|
750
|
+
var flag2 = _.get(
|
|
751
|
+
formDesc[currentFiled] ||
|
|
752
|
+
formDesc[parentFiled]?.attrs?.columns[vm.curFIndex]?.content,
|
|
753
|
+
"_type",
|
|
754
|
+
false
|
|
755
|
+
);
|
|
756
|
+
// 是否纯文字
|
|
757
|
+
if (flg.length > 0 && flag2 !== "ele-form-checkbox") {
|
|
758
|
+
if (typeof new Function("return " + "" + str + "")() === "boolean") {
|
|
759
|
+
// 判断是否布尔值 是布尔值则做转换
|
|
760
|
+
return new Function("return " + "" + str + "")().toString();
|
|
761
|
+
// return "aaa"
|
|
762
|
+
} else {
|
|
763
|
+
// return eval(`(${str})`)
|
|
764
|
+
if (mackReg.test(str) && !str.includes(/[a-zA-Z]/)) {
|
|
765
|
+
str = StrHandle(str, mackReg);
|
|
766
|
+
str.includes("NaN") ? (str = "") : null;
|
|
767
|
+
}
|
|
768
|
+
return new Function("return " + "" + str + "")();
|
|
769
|
+
// return "aaa";
|
|
770
|
+
}
|
|
771
|
+
} else if (flag2 == "ele-form-checkbox") {
|
|
772
|
+
return str.toString();
|
|
773
|
+
} else if (!strReg.test(str)) {
|
|
774
|
+
const eXstr = "";
|
|
775
|
+
if (/'(.*)'/.test(str)) {
|
|
776
|
+
str = str.replace(/'/g, "");
|
|
777
|
+
return str;
|
|
778
|
+
}
|
|
779
|
+
if (mackReg.test(str) && !/[a-zA-Z]/.test(str)) {
|
|
780
|
+
if (brackets.test(str)) {
|
|
781
|
+
// 如果包含括号
|
|
782
|
+
if (
|
|
783
|
+
typeof new Function("return " + "" + str + "")() === "boolean"
|
|
784
|
+
) {
|
|
785
|
+
// 判断是否布尔值 是布尔值则做转换
|
|
786
|
+
return new Function("return " + "" + str + "")().toString();
|
|
787
|
+
// return "aaa"
|
|
788
|
+
} else {
|
|
789
|
+
return new Function("return " + "" + str + "")();
|
|
790
|
+
}
|
|
791
|
+
} else {
|
|
792
|
+
// 如果不包含括号
|
|
793
|
+
str = StrHandle(str, mackReg);
|
|
794
|
+
str.includes("NaN") ? (str = "") : null;
|
|
795
|
+
if (
|
|
796
|
+
typeof new Function("return " + "" + str + "")() === "boolean"
|
|
797
|
+
) {
|
|
798
|
+
// 判断是否布尔值 是布尔值则做转换
|
|
799
|
+
return new Function("return " + "" + str + "")().toString();
|
|
800
|
+
// return "aaa"
|
|
801
|
+
} else {
|
|
802
|
+
return new Function("return " + "" + str + "")();
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
if (logicReg2.test(str)) {
|
|
807
|
+
return new Function("return " + "" + str + "")().toString();
|
|
808
|
+
}
|
|
809
|
+
return str;
|
|
810
|
+
// return "aaa";
|
|
811
|
+
} else {
|
|
812
|
+
return "";
|
|
813
|
+
}
|
|
814
|
+
},
|
|
815
|
+
// 审批
|
|
816
|
+
async toApply(content) {
|
|
817
|
+
const type = "customForm_" + this.formId;
|
|
818
|
+
const applierName = this.$store.state.user.realName
|
|
819
|
+
? this.$store.state.user.realName
|
|
820
|
+
: this.$store.state.user.accountName;
|
|
821
|
+
const businessName = applierName + "的" + this.processName;
|
|
822
|
+
const param = {
|
|
823
|
+
...content,
|
|
824
|
+
id: this.processId,
|
|
825
|
+
objId: "1",
|
|
826
|
+
companyId: this.user.cno,
|
|
827
|
+
userId: this.user.no,
|
|
828
|
+
applyType: type,
|
|
829
|
+
businessName: businessName,
|
|
830
|
+
applierName: applierName
|
|
831
|
+
};
|
|
832
|
+
const data = { content: JSON.stringify(param) };
|
|
833
|
+
const res = await applyProcessCustomForm(data);
|
|
834
|
+
// if (res.data.state === "ok") {
|
|
835
|
+
|
|
836
|
+
if (res.data.state === "ok") {
|
|
837
|
+
this.saveData(content, res.data.data);
|
|
838
|
+
} else {
|
|
839
|
+
this.$message.error(res.data.msg);
|
|
840
|
+
this.isLoading = false;
|
|
841
|
+
}
|
|
842
|
+
},
|
|
843
|
+
// 查询表单审批流程
|
|
844
|
+
async queryProcessByType() {
|
|
845
|
+
const type = "customForm_" + this.formId;
|
|
846
|
+
const res = await queryProcessByType({
|
|
847
|
+
companyId: this.$store.state.user.cno,
|
|
848
|
+
type: type
|
|
849
|
+
});
|
|
850
|
+
if (res.data.state == "ok" && res.data.data) {
|
|
851
|
+
this.processId = res.data.data ? res.data.data._id : "";
|
|
852
|
+
const content =
|
|
853
|
+
res.data.data && res.data.data.content
|
|
854
|
+
? JSON.parse(res.data.data.content)
|
|
855
|
+
: {};
|
|
856
|
+
this.processName = content.name.substring(0, content.name.length - 2);
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
},
|
|
860
|
+
created() {
|
|
861
|
+
this.getFormDes();
|
|
862
|
+
this.getFormDataById();
|
|
863
|
+
},
|
|
864
|
+
mounted() {}
|
|
865
|
+
};
|
|
866
|
+
</script>
|
|
867
|
+
<style lang="scss" scoped>
|
|
868
|
+
h4 {
|
|
869
|
+
margin-top: 0;
|
|
870
|
+
padding: 15px 10px 10px 15px;
|
|
871
|
+
display: block;
|
|
872
|
+
border-bottom: 1px solid #ccc;
|
|
873
|
+
}
|
|
874
|
+
/deep/ .ele-form-btns {
|
|
875
|
+
/deep/ .el-button--default {
|
|
876
|
+
color: #409eff;
|
|
877
|
+
border-color: #c6e2ff;
|
|
878
|
+
// background-color: #ecf5ff;
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
.quill-editor /deep/ .ql-editor {
|
|
882
|
+
height: 200px;
|
|
883
|
+
}
|
|
884
|
+
.isSummary {
|
|
885
|
+
z-index: 2004;
|
|
886
|
+
cursor: pointer;
|
|
887
|
+
position: absolute;
|
|
888
|
+
left: -17px;
|
|
889
|
+
top: 14px;
|
|
890
|
+
// transform: translateY(-50%);
|
|
891
|
+
}
|
|
892
|
+
.form-generation {
|
|
893
|
+
padding: 30px 0 0;
|
|
894
|
+
}
|
|
895
|
+
/deep/ .ele-form-upload-file .el-link--inner img {
|
|
896
|
+
visibility: hidden;
|
|
897
|
+
}
|
|
898
|
+
/deep/ .ele-form .el-form-item .el-form-item__label {
|
|
899
|
+
padding: 0 20px 0 0;
|
|
900
|
+
}
|
|
901
|
+
/deep/ .ele-form-btns {
|
|
902
|
+
text-align: center;
|
|
903
|
+
}
|
|
904
|
+
</style>
|