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.
Files changed (502) hide show
  1. package/.env +2 -2
  2. package/.env.development +70 -70
  3. package/.env.pre +60 -60
  4. package/.env.production +48 -48
  5. package/.env.test +48 -48
  6. package/.eslintignore +4 -4
  7. package/.eslintrc.js +302 -302
  8. package/README.md +66 -66
  9. package/babel.config.js +5 -5
  10. package/commitlint.config.js +30 -30
  11. package/config/dev.env.js +7 -7
  12. package/config/index.js +82 -82
  13. package/config/prod.env.js +4 -4
  14. package/debug.log +4 -4
  15. package/index.js +6 -6
  16. package/jsconfig.json +9 -9
  17. package/lib/qgb-process.common.js +7666 -5069
  18. package/lib/qgb-process.umd.js +7666 -5069
  19. package/lib/qgb-process.umd.min.js +108 -108
  20. package/package.json +148 -148
  21. package/packages/index.js +26 -26
  22. package/public/index.html +47 -47
  23. package/public/js/qykf.js +21 -21
  24. package/src/App.vue +37 -37
  25. package/src/api/ApiExAndapp.js +24 -24
  26. package/src/api/EnterpriseAssociation.js +8 -8
  27. package/src/api/Notice.js +31 -31
  28. package/src/api/apiAcceptance/apiAcceptance.js +37 -37
  29. package/src/api/apiAddress.js +9 -9
  30. package/src/api/apiApprovalConfig.js +13 -13
  31. package/src/api/apiApprove.js +18 -18
  32. package/src/api/apiArrears/apiArrears.js +41 -41
  33. package/src/api/apiArrears/apiProjectArrears.js +16 -16
  34. package/src/api/apiArrears/index.js +15 -15
  35. package/src/api/apiAssets.js +19 -19
  36. package/src/api/apiAssociate.js +42 -42
  37. package/src/api/apiAudit/apiAudit.js +32 -32
  38. package/src/api/apiAuth.js +25 -25
  39. package/src/api/apiAuthentication.js +35 -35
  40. package/src/api/apiBankAccount/index.js +12 -12
  41. package/src/api/apiBudget/apiBudget.js +30 -30
  42. package/src/api/apiBudget/apiBudgets.js +105 -105
  43. package/src/api/apiCarRecord.js +48 -48
  44. package/src/api/apiCart.js +202 -202
  45. package/src/api/apiChangeTel.js +13 -13
  46. package/src/api/apiCheckingIn.js +95 -95
  47. package/src/api/apiCollection/index.js +13 -13
  48. package/src/api/apiContract/apiContract.js +21 -21
  49. package/src/api/apiContract/index.js +3 -3
  50. package/src/api/apiContract/quill-config.js +122 -122
  51. package/src/api/apiContractManage/apiContractManage.js +57 -57
  52. package/src/api/apiContractManage/index.js +2 -2
  53. package/src/api/apiContractManage/quill-config.js +121 -121
  54. package/src/api/apiCoping.js +22 -22
  55. package/src/api/apiCost/index.js +31 -31
  56. package/src/api/apiCreditManagement.js +16 -16
  57. package/src/api/apiCustomer/apiCustomer.js +12 -12
  58. package/src/api/apiDivisional.js +9 -9
  59. package/src/api/apiDivisionalManagementList.js +17 -17
  60. package/src/api/apiEmployeeRegularization.js +73 -73
  61. package/src/api/apiEquipmentRental.js +50 -50
  62. package/src/api/apiFormBuilder/menu.js +65 -65
  63. package/src/api/apiFormBuilder/reissueRule.js +15 -15
  64. package/src/api/apiFund/index.js +16 -16
  65. package/src/api/apiHelp.js +43 -43
  66. package/src/api/apiHome.js +24 -24
  67. package/src/api/apiIminfo.js +39 -39
  68. package/src/api/apiInventory.js +52 -52
  69. package/src/api/apiInventorySetting.js +9 -9
  70. package/src/api/apiInvoice.js +29 -29
  71. package/src/api/apiJobManage.js +15 -15
  72. package/src/api/apiLease/apiLease.js +12 -12
  73. package/src/api/apiLogisticsTransportation/apiLogisticsTransportation.js +34 -34
  74. package/src/api/apiLostPassword.js +9 -9
  75. package/src/api/apiMachine/api.js +3 -3
  76. package/src/api/apiMachine/apiCategory.js +18 -18
  77. package/src/api/apiMachine/apiHire.js +19 -19
  78. package/src/api/apiMachine/apiLease.js +27 -27
  79. package/src/api/apiMachine/apiLocation.js +4 -4
  80. package/src/api/apiMachine/apiRentInfo.js +107 -107
  81. package/src/api/apiMachine/apiRentPublish.js +14 -14
  82. package/src/api/apiMachine/apiStore.js +15 -15
  83. package/src/api/apiMachine/index.js +3 -3
  84. package/src/api/apiManagementStore/api.js +3 -3
  85. package/src/api/apiManagementStore/apiManagementStore.js +25 -25
  86. package/src/api/apiMaterCheckAndAccept/apiMaterCheckAndAccept.js +47 -47
  87. package/src/api/apiMaterCheckAndAccept/apiMechanicalSourcing.js +16 -16
  88. package/src/api/apiMaterCheckAndAccept/index.js +3 -3
  89. package/src/api/apiMaterials/aaaaaaaaaaaaaa.js +9 -9
  90. package/src/api/apiMaterials/api.js +3 -3
  91. package/src/api/apiMaterials/apiAddress.js +116 -116
  92. package/src/api/apiMaterials/apiBalanceData.js +188 -188
  93. package/src/api/apiMaterials/apiCommercialConcrete.js +36 -36
  94. package/src/api/apiMaterials/apiCommodity.js +70 -70
  95. package/src/api/apiMaterials/apiDownload.js +26 -26
  96. package/src/api/apiMaterials/apiHome.js +44 -44
  97. package/src/api/apiMaterials/apiItemBrand.js +9 -9
  98. package/src/api/apiMaterials/apiLogistics.js +72 -72
  99. package/src/api/apiMaterials/apiLogisticsReceipt.js +94 -94
  100. package/src/api/apiMaterials/apiMaterials.js +8 -8
  101. package/src/api/apiMaterials/apiMySalesOrder.js +21 -21
  102. package/src/api/apiMaterials/apiOfflineOrder.js +18 -18
  103. package/src/api/apiMaterials/apiOrder.js +183 -183
  104. package/src/api/apiMaterials/apiReceipt.js +45 -45
  105. package/src/api/apiMaterials/quill-config.js +122 -122
  106. package/src/api/apiMemberSelection.js +39 -39
  107. package/src/api/apiMessage.js +10 -10
  108. package/src/api/apiMock/mockOrder.js +98 -98
  109. package/src/api/apiMonthPlan/apiMonthPlan.js +47 -47
  110. package/src/api/apiMyBidding.js +8 -8
  111. package/src/api/apiMyMember/apiComInfo.js +17 -17
  112. package/src/api/apiMyMember/apiInviteJoin.js +24 -24
  113. package/src/api/apiMyMember/apiMember.js +24 -24
  114. package/src/api/apiMyMember/apiMemberApply.js +36 -36
  115. package/src/api/apiMyMember/apiMemberChance.js +40 -40
  116. package/src/api/apiOffer.js +40 -40
  117. package/src/api/apiOffice.js +19 -19
  118. package/src/api/apiPact.js +26 -26
  119. package/src/api/apiPassword.js +7 -7
  120. package/src/api/apiPay/apiPay.js +25 -25
  121. package/src/api/apiPaying.js +21 -21
  122. package/src/api/apiPayment/apiPayment.js +13 -13
  123. package/src/api/apiPayment/apiProjectPayment.js +13 -13
  124. package/src/api/apiPrint.js +23 -0
  125. package/src/api/apiProcess.js +65 -65
  126. package/src/api/apiProject/apiBaseList.js +29 -29
  127. package/src/api/apiProject/apiGoodsOffer.js +11 -11
  128. package/src/api/apiProject/apiInventory.js +116 -116
  129. package/src/api/apiProject/apiOfferOrder.js +12 -12
  130. package/src/api/apiProject/apiOfferQuery.js +18 -18
  131. package/src/api/apiProject/apiPlan.js +21 -21
  132. package/src/api/apiProject/apiProject.js +158 -158
  133. package/src/api/apiProjectProcurement/apiProjectProcurement.js +88 -88
  134. package/src/api/apiPurchase/apiPurchase.js +67 -67
  135. package/src/api/apiPurchaseApply.js +15 -15
  136. package/src/api/apiPurchasePay.js +16 -16
  137. package/src/api/apiRankManagement.js +24 -24
  138. package/src/api/apiRecruit.js +37 -37
  139. package/src/api/apiReimbursement/apiReimbursement.js +15 -15
  140. package/src/api/apiRisk/index.js +11 -11
  141. package/src/api/apiRoleManagement.js +15 -15
  142. package/src/api/apiRules/apiRules.js +11 -11
  143. package/src/api/apiSchedule/apiSchedule.js +17 -17
  144. package/src/api/apiSealRecord.js +52 -52
  145. package/src/api/apiSign.js +8 -8
  146. package/src/api/apiSolution/apiSolution.js +9 -9
  147. package/src/api/apiSubcontract.js +35 -35
  148. package/src/api/apiSystem/index.js +40 -40
  149. package/src/api/apiTask.js +76 -76
  150. package/src/api/apiTeam/api.js +3 -3
  151. package/src/api/apiTeam/apiUtils.js +11 -11
  152. package/src/api/apiTender.js +127 -127
  153. package/src/api/apiUser.js +24 -24
  154. package/src/api/apiUserEnterprise/api.js +3 -3
  155. package/src/api/apiUserEnterprise/apiUserEn.js +15 -15
  156. package/src/api/apiVolunteerTeam.js +11 -11
  157. package/src/api/apiWorkarea.js +33 -33
  158. package/src/api/apiXzqh.js +8 -8
  159. package/src/api/common/api.js +3 -3
  160. package/src/api/common/apiUtils.js +9 -9
  161. package/src/api/customer.js +21 -21
  162. package/src/api/evection.js +19 -19
  163. package/src/api/guide.js +9 -9
  164. package/src/api/sociaManageApi.js +30 -30
  165. package/src/assets/Area.json +1773 -1773
  166. package/src/assets/css/quill.bubble.css +952 -952
  167. package/src/assets/css/quill.core.css +397 -397
  168. package/src/assets/css/quill.snow.css +945 -945
  169. package/src/assets/data.js +284 -284
  170. package/src/assets/fonts/Read Me.txt +7 -7
  171. package/src/assets/fonts/demo-files/demo.css +155 -155
  172. package/src/assets/fonts/demo-files/demo.js +30 -30
  173. package/src/assets/fonts/demo.html +951 -951
  174. package/src/assets/fonts/fonts/icomoon.svg +130 -130
  175. package/src/assets/fonts/style.css +563 -563
  176. package/src/assets/icons/checkbox.svg +12 -12
  177. package/src/assets/icons/columns-3.svg +12 -12
  178. package/src/assets/icons/columns.svg +12 -12
  179. package/src/assets/icons/custom-table.svg +12 -12
  180. package/src/assets/icons/date.svg +19 -19
  181. package/src/assets/icons/daterange.svg +12 -12
  182. package/src/assets/icons/fuzhi.svg +11 -11
  183. package/src/assets/icons/fuzhi_03.svg +5 -5
  184. package/src/assets/icons/gaojizujian.svg +12 -12
  185. package/src/assets/icons/groupSummary.svg +12 -12
  186. package/src/assets/icons/groupTitle.svg +12 -12
  187. package/src/assets/icons/image-uploader.svg +12 -12
  188. package/src/assets/icons/input-number.svg +12 -12
  189. package/src/assets/icons/input.svg +12 -12
  190. package/src/assets/icons/quill-editor.svg +12 -12
  191. package/src/assets/icons/radio.svg +12 -12
  192. package/src/assets/icons/select.svg +12 -12
  193. package/src/assets/icons/switch.svg +12 -12
  194. package/src/assets/icons/textarea.svg +12 -12
  195. package/src/assets/icons/upload-file.svg +12 -12
  196. package/src/assets/marketplace.js +289 -289
  197. package/src/components/ComAduitNew.vue +477 -477
  198. package/src/components/CommonAduit.vue +512 -512
  199. package/src/components/CommonAduitNew.vue +906 -906
  200. package/src/components/CommonAduitNews.vue +753 -753
  201. package/src/components/CommonUEditer.vue +63 -63
  202. package/src/components/PersonCenter/Mess.vue +59 -59
  203. package/src/components/PersonCenter/Title.vue +80 -80
  204. package/src/components/SvgIcon.vue +57 -57
  205. package/src/components/XmCommonAduit.vue +761 -761
  206. package/src/components/feiyCommon.vue +713 -713
  207. package/src/components/form/card.js +5 -5
  208. package/src/components/form/chinese.js +6 -6
  209. package/src/components/form/chinessstring.js +5 -5
  210. package/src/components/form/hunhe.js +8 -8
  211. package/src/components/form/hunhecq.js +8 -8
  212. package/src/components/form/hunheh.js +8 -8
  213. package/src/components/form/num.js +12 -12
  214. package/src/components/form/numstring.js +5 -5
  215. package/src/components/form/user.js +7 -7
  216. package/src/components/form/validate.js +42 -42
  217. package/src/components/form/validcredit.js +5 -5
  218. package/src/components/fundCommonAduit.vue +661 -661
  219. package/src/components/public/BaseCustomTable.vue +71 -71
  220. package/src/components/public/BaseDialog.vue +144 -144
  221. package/src/components/public/BaseEmptyData.vue +73 -73
  222. package/src/components/public/BaseFormTitle.vue +39 -39
  223. package/src/components/public/BasePagination.vue +55 -55
  224. package/src/components/public/BaseRouter.vue +14 -14
  225. package/src/components/public/BaseUpload.vue +185 -185
  226. package/src/components/public/Bottom.vue +62 -62
  227. package/src/components/public/Footer.vue +412 -412
  228. package/src/components/public/Header.vue +30 -30
  229. package/src/components/public/LeftMenu.vue +170 -170
  230. package/src/components/public/MemberSelection coby.vue +444 -444
  231. package/src/components/public/MemberSelection.vue +487 -487
  232. package/src/components/public/NewLeftMenu.vue +418 -418
  233. package/src/components/public/PicturesPreview.vue +62 -62
  234. package/src/components/public/Popout.vue +147 -147
  235. package/src/components/public/TagLine.vue +353 -353
  236. package/src/components/public/components/BaseImageUploadDrag.vue +320 -320
  237. package/src/components/public/components/HeadBar.vue +315 -315
  238. package/src/components/public/components/MenuList.vue +110 -110
  239. package/src/components/public/components/NewHeadBar.vue +936 -936
  240. package/src/components/public/components/QuickGoods.vue +273 -273
  241. package/src/components/public/components/Search.vue +164 -164
  242. package/src/components/public/components/Userinfo.vue +383 -383
  243. package/src/components/utils/pdf.js +254 -254
  244. package/src/components/xmfyCommonAduit.vue +752 -752
  245. package/src/filters/index.js +619 -619
  246. package/src/fnc/arr.js +102 -102
  247. package/src/fnc/quill-config.js +121 -121
  248. package/src/fnc/unit.js +102 -102
  249. package/src/fnc/verify.js +187 -187
  250. package/src/fnc/verifyStatus.js +24 -24
  251. package/src/formBuilder/apiBusiness.js +67 -67
  252. package/src/formBuilder/business.js +1039 -1039
  253. package/src/formBuilder/component/components/data.js +719 -719
  254. package/src/formBuilder/component/components/purchaseIndex.vue +1109 -1109
  255. package/src/formBuilder/component/purchase.vue +35 -35
  256. package/src/formBuilder/components/app-main/components/components/GroupSummary.vue +33 -33
  257. package/src/formBuilder/components/app-main/components/components/GroupTitle.vue +33 -33
  258. package/src/formBuilder/components/app-main/components/components/bank.vue +226 -226
  259. package/src/formBuilder/components/app-main/components/components/bankFormHeard.vue +298 -298
  260. package/src/formBuilder/components/app-main/components/components/builder.vue +718 -718
  261. package/src/formBuilder/components/app-main/components/components/columns.vue +393 -393
  262. package/src/formBuilder/components/app-main/components/components/customTable.vue +1758 -1758
  263. package/src/formBuilder/components/app-main/components/components/formDep.vue +105 -105
  264. package/src/formBuilder/components/app-main/components/components/handleCode.vue +39 -39
  265. package/src/formBuilder/components/app-main/components/components/itemOption.vue +116 -116
  266. package/src/formBuilder/components/app-main/components/components/linkForm.vue +116 -116
  267. package/src/formBuilder/components/app-main/components/components/listDesign.vue +772 -772
  268. package/src/formBuilder/components/app-main/components/components/optionSolt.js +78 -78
  269. package/src/formBuilder/components/app-main/components/components/person.vue +104 -104
  270. package/src/formBuilder/components/app-main/components/components/postman.vue +40 -40
  271. package/src/formBuilder/components/app-main/components/components/previewDialog.vue +391 -391
  272. package/src/formBuilder/components/app-main/components/components/tableIndex.vue +51 -51
  273. package/src/formBuilder/components/app-main/components/components/tableList.vue +561 -561
  274. package/src/formBuilder/components/app-main/components/components/twoColumns.vue +52 -52
  275. package/src/formBuilder/components/app-main/components/main-center.vue +187 -187
  276. package/src/formBuilder/components/app-main/components/main-header.vue +351 -351
  277. package/src/formBuilder/components/app-main/components/main-left.vue +179 -179
  278. package/src/formBuilder/components/app-main/components/main-right/components/components/calculateDialog.vue +914 -914
  279. package/src/formBuilder/components/app-main/components/main-right/components/components/curTextArea.vue +338 -338
  280. package/src/formBuilder/components/app-main/components/main-right/components/components/form-item-rules.vue +190 -190
  281. package/src/formBuilder/components/app-main/components/main-right/components/components/linkageDialog.vue +25 -25
  282. package/src/formBuilder/components/app-main/components/main-right/components/components/searchMixin.js +26 -26
  283. package/src/formBuilder/components/app-main/components/main-right/components/form-config.vue +284 -284
  284. package/src/formBuilder/components/app-main/components/main-right/components/form-item-attrs.vue +407 -407
  285. package/src/formBuilder/components/app-main/components/main-right/components/form-item-config.vue +478 -478
  286. package/src/formBuilder/components/app-main/components/main-right/index.vue +203 -203
  287. package/src/formBuilder/components/app-main/index.vue +329 -329
  288. package/src/formBuilder/comps.js +283 -283
  289. package/src/formBuilder/config/button.js +63 -63
  290. package/src/formBuilder/config/cascader-panel.js +224 -224
  291. package/src/formBuilder/config/cascader.js +306 -306
  292. package/src/formBuilder/config/checkbox.js +67 -67
  293. package/src/formBuilder/config/color.js +42 -42
  294. package/src/formBuilder/config/columns.js +30 -30
  295. package/src/formBuilder/config/custom-table.js +49 -49
  296. package/src/formBuilder/config/date.js +107 -107
  297. package/src/formBuilder/config/daterange.js +47 -47
  298. package/src/formBuilder/config/datetime.js +78 -78
  299. package/src/formBuilder/config/datetimerange.js +111 -111
  300. package/src/formBuilder/config/formDep.js +37 -37
  301. package/src/formBuilder/config/groupSummary.js +23 -23
  302. package/src/formBuilder/config/groupTitle.js +23 -23
  303. package/src/formBuilder/config/handleCode.js +23 -23
  304. package/src/formBuilder/config/image-uploader.js +113 -113
  305. package/src/formBuilder/config/input.js +162 -162
  306. package/src/formBuilder/config/json-editor.js +31 -31
  307. package/src/formBuilder/config/linkForm.js +69 -69
  308. package/src/formBuilder/config/number.js +49 -49
  309. package/src/formBuilder/config/password.js +82 -82
  310. package/src/formBuilder/config/person.js +37 -37
  311. package/src/formBuilder/config/postman.js +23 -23
  312. package/src/formBuilder/config/purchase.js +19 -19
  313. package/src/formBuilder/config/quill-editor.js +66 -66
  314. package/src/formBuilder/config/radio-button.js +44 -44
  315. package/src/formBuilder/config/radio.js +69 -69
  316. package/src/formBuilder/config/rate.js +93 -93
  317. package/src/formBuilder/config/select.js +105 -105
  318. package/src/formBuilder/config/slider.js +92 -92
  319. package/src/formBuilder/config/switch.js +35 -35
  320. package/src/formBuilder/config/tag.js +79 -79
  321. package/src/formBuilder/config/text.js +18 -18
  322. package/src/formBuilder/config/textarea.js +129 -129
  323. package/src/formBuilder/config/time.js +60 -60
  324. package/src/formBuilder/config/timerange.js +94 -94
  325. package/src/formBuilder/config/tree-select.js +100 -100
  326. package/src/formBuilder/config/upload-file.js +100 -100
  327. package/src/formBuilder/config/yesno.js +39 -39
  328. package/src/formBuilder/config.js +16 -16
  329. package/src/formBuilder/extend/index.js +20 -20
  330. package/src/formBuilder/index.js +39 -39
  331. package/src/formBuilder/menuConfig.js +36 -36
  332. package/src/formBuilder/mixins/index.js +215 -215
  333. package/src/formBuilder/tool.js +101 -101
  334. package/src/function/base.js +13 -13
  335. package/src/function/findCompanyTree.js +94 -94
  336. package/src/function/formulaAnalysis.js +44 -44
  337. package/src/function/verify.js +23 -23
  338. package/src/http/index.js +219 -219
  339. package/src/http/type.js +82 -82
  340. package/src/library/AddType/Index.js +17 -17
  341. package/src/library/AddType/Index.vue +201 -201
  342. package/src/library/AreaChange/regionCascader/regionCascader.vue +155 -155
  343. package/src/library/BigImg/BigImage1/Index.js +17 -17
  344. package/src/library/BigImg/BigImage1/Index.vue +125 -125
  345. package/src/library/Button/Button1/Index.js +17 -17
  346. package/src/library/Button/Button1/Index.vue +60 -60
  347. package/src/library/Button/Button2/Index.js +17 -17
  348. package/src/library/Button/Button2/Index.vue +52 -52
  349. package/src/library/Button/Button3/Index.js +17 -17
  350. package/src/library/Button/Button3/Index.vue +56 -56
  351. package/src/library/Button/Button4/Index.js +17 -17
  352. package/src/library/Button/Button4/Index.vue +56 -56
  353. package/src/library/Button/Button5/Index.js +17 -17
  354. package/src/library/Button/Button5/Index.vue +55 -55
  355. package/src/library/Button/Button6/Index.js +17 -17
  356. package/src/library/Button/Button6/Index.vue +74 -74
  357. package/src/library/Button/Button7/Index.js +17 -17
  358. package/src/library/Button/Button7/Index.vue +56 -56
  359. package/src/library/ConfirmPlaugin/ConfirmPlaugin1/Index.js +17 -17
  360. package/src/library/ConfirmPlaugin/ConfirmPlaugin1/Index.vue +147 -147
  361. package/src/library/ConfirmPlaugin/ConfirmPlaugin2/Index.js +17 -17
  362. package/src/library/ConfirmPlaugin/ConfirmPlaugin2/Index.vue +137 -137
  363. package/src/library/ConfirmPlaugin/ConfirmPlaugin3/Index.vue +142 -142
  364. package/src/library/ConfirmPlaugin/ConfirmPlaugin4/Index.vue +141 -141
  365. package/src/library/ConfirmPlaugin/ConfirmPlaugin5/Index.vue +121 -121
  366. package/src/library/ConfirmPlaugin/ConfirmPlaugin6/Index.vue +142 -142
  367. package/src/library/Input/Input1/Index.js +17 -17
  368. package/src/library/Input/Input1/Index.vue +66 -66
  369. package/src/library/NoMessage/NoMessage0/Index.js +17 -17
  370. package/src/library/NoMessage/NoMessage0/Index.vue +60 -60
  371. package/src/library/NoMessage/NoMessage1/Index.js +17 -17
  372. package/src/library/NoMessage/NoMessage1/Index.vue +66 -66
  373. package/src/library/NoMessage/NoMessage2/Index.js +17 -17
  374. package/src/library/NoMessage/NoMessage2/Index.vue +66 -66
  375. package/src/library/Tab/Tab1/TabBox1/Index.vue +36 -36
  376. package/src/library/Tab/Tab1/TabInner1/Index.vue +70 -70
  377. package/src/library/Tab/Tab2/TabBox2/Index.vue +36 -36
  378. package/src/library/Tab/Tab2/TabInner2/Index.vue +66 -66
  379. package/src/library/Table/Table1/Td1/Index.js +17 -17
  380. package/src/library/Table/Table1/Td1/Index.vue +110 -110
  381. package/src/library/Table/Table1/Tr1/Index.js +17 -17
  382. package/src/library/Table/Table1/Tr1/Index.vue +53 -53
  383. package/src/library/Table/Table2/Td2/Index.js +17 -17
  384. package/src/library/Table/Table2/Td2/Index.vue +90 -90
  385. package/src/library/Table/Table2/Tr2/Index.js +17 -17
  386. package/src/library/Table/Table2/Tr2/Index.vue +66 -66
  387. package/src/library/Table/Table3/Td3/Index.js +17 -17
  388. package/src/library/Table/Table3/Td3/Index.vue +109 -109
  389. package/src/library/Table/Table3/Tr3/Index.js +17 -17
  390. package/src/library/Table/Table3/Tr3/Index.vue +128 -128
  391. package/src/library/Table/Table4/Td4/Index.js +17 -17
  392. package/src/library/Table/Table4/Td4/Index.vue +114 -114
  393. package/src/library/Table/Table4/Tr4/Index.js +17 -17
  394. package/src/library/Table/Table4/Tr4/Index.vue +53 -53
  395. package/src/library/Title/Title1/Index.js +17 -17
  396. package/src/library/Title/Title1/Index.vue +80 -80
  397. package/src/library/toast/Index.js +17 -17
  398. package/src/library/toast/Index.vue +86 -86
  399. package/src/main.js +161 -161
  400. package/src/mixins/Export2Excel.js +207 -207
  401. package/src/mixins/chartOption.js +110 -110
  402. package/src/mixins/companyMixins.js +84 -84
  403. package/src/mixins/quillOptions.js +15 -15
  404. package/src/mixins/validate/deviceManage.js +211 -211
  405. package/src/mixins/validate/systemConfig.js +117 -117
  406. package/src/mixins/validate/validate.js +25 -25
  407. package/src/public/apiUser/apiUser.js +10 -10
  408. package/src/public/areaFunction.js +26 -26
  409. package/src/public/link.js +91 -91
  410. package/src/public/stageData.js +495 -495
  411. package/src/public/topmenu.js +68 -68
  412. package/src/router/index.js +225 -225
  413. package/src/router/setting/BaseRoutes.js +1639 -1639
  414. package/src/router/setting/MenuDevMock.js +1570 -1570
  415. package/src/router/setting/modules/login.js +45 -45
  416. package/src/router/setting/noAuthRouter.js +109 -109
  417. package/src/router/setting/routes.js +55 -55
  418. package/src/static/css/flex.css +75 -75
  419. package/src/static/css/switch.scss +31 -31
  420. package/src/storage/cookies.js +37 -37
  421. package/src/storage/localStorage.js +36 -36
  422. package/src/storage/sessionStorage.js +25 -25
  423. package/src/store/formBuilder/formAttrDefault.js +28 -28
  424. package/src/store/formBuilder/index.js +40 -40
  425. package/src/store/index.js +553 -553
  426. package/src/styles/color.scss +24 -24
  427. package/src/styles/offer.scss +39 -39
  428. package/src/styles/s-reset.scss +52 -52
  429. package/src/styles/static-style.scss +797 -797
  430. package/src/styles/talent.scss +26 -26
  431. package/src/styles/variable.scss +69 -69
  432. package/src/styles/workflow/workflow.css +1308 -1308
  433. package/src/utils/TableFormTypeList.js +26 -26
  434. package/src/utils/allRouter.js +5579 -5579
  435. package/src/utils/auditUtil.js +535 -535
  436. package/src/utils/commonComponents.js +34 -34
  437. package/src/utils/commonFunc.js +213 -213
  438. package/src/utils/deepCopyArray.js +9 -9
  439. package/src/utils/dict.js +49 -49
  440. package/src/utils/directive.js +26 -26
  441. package/src/utils/emoji.js +16 -16
  442. package/src/utils/flator.js +18 -18
  443. package/src/utils/imMeeting.js +1180 -1180
  444. package/src/utils/index.js +105 -105
  445. package/src/utils/initRouter.js +94 -94
  446. package/src/utils/map.js +23 -23
  447. package/src/utils/passwordStrength.js +177 -177
  448. package/src/utils/style.js +30 -30
  449. package/src/utils/validate.js +30 -30
  450. package/src/views/404.vue +53 -53
  451. package/src/views/Login/Login.vue +50 -50
  452. package/src/views/Login/Passfind.vue +347 -347
  453. package/src/views/Login/Passfindnext.vue +146 -146
  454. package/src/views/Login/Sign.vue +55 -55
  455. package/src/views/Login/SignSuccessfully.vue +132 -132
  456. package/src/views/Login/appDownload.vue +224 -224
  457. package/src/views/Login/clientDownload.vue +201 -201
  458. package/src/views/Login/components/Background.vue +153 -153
  459. package/src/views/Login/components/FormLogin.vue +1001 -1001
  460. package/src/views/Login/components/FormPassFind.vue +395 -395
  461. package/src/views/Login/components/FormSign.vue +493 -493
  462. package/src/views/Login/components/Title.vue +301 -301
  463. package/src/views/Login/components/agreeMent.vue +111 -111
  464. package/src/views/Login/components/companysign.vue +1296 -1296
  465. package/src/views/Login/components/guideLogin.vue +984 -984
  466. package/src/views/formBuilder/components/addNode.vue +119 -119
  467. package/src/views/formBuilder/components/approverSelector.vue +493 -493
  468. package/src/views/formBuilder/components/baseRoute.vue +315 -315
  469. package/src/views/formBuilder/components/builderHeader.vue +106 -106
  470. package/src/views/formBuilder/components/conditionConfig.js +588 -588
  471. package/src/views/formBuilder/components/conditionNode.vue +191 -191
  472. package/src/views/formBuilder/components/dataDefault.js +147 -147
  473. package/src/views/formBuilder/components/depFormNode.vue +583 -583
  474. package/src/views/formBuilder/components/linkForm.vue +566 -566
  475. package/src/views/formBuilder/components/linkFormList.vue +821 -821
  476. package/src/views/formBuilder/components/menuConfig.vue +1752 -1752
  477. package/src/views/formBuilder/components/newNodeForm.vue +426 -426
  478. package/src/views/formBuilder/components/newsection.vue +424 -424
  479. package/src/views/formBuilder/components/nodeConditionConfig cody.vue +376 -376
  480. package/src/views/formBuilder/components/nodeConditionConfig.vue +603 -603
  481. package/src/views/formBuilder/components/nodeForm.vue +355 -355
  482. package/src/views/formBuilder/components/nodeMenu.vue +147 -147
  483. package/src/views/formBuilder/components/personNode.vue +566 -566
  484. package/src/views/formBuilder/components/planNode.vue +269 -269
  485. package/src/views/formBuilder/designListPage.vue +457 -457
  486. package/src/views/formBuilder/formDataDetail.vue +565 -565
  487. package/src/views/formBuilder/formGeneration.vue +904 -904
  488. package/src/views/formBuilder/index.vue +242 -242
  489. package/src/views/formBuilder/process-1.vue +976 -976
  490. package/src/views/formBuilder/process-2.vue +1323 -1323
  491. package/src/views/formBuilder/process.vue +662 -431
  492. package/src/views/formBuilder/processList.vue +877 -877
  493. package/src/views/formBuilder/service/ProcessBuilder.js +136 -136
  494. package/src/views/formBuilder/service/RsxzFieldCollection.js +199 -0
  495. package/src/views/formBuilder/workflow/addNode.vue +95 -95
  496. package/src/views/formBuilder/workflow/initData.js +205 -205
  497. package/src/views/formBuilder/workflow/nodeWrap.vue +731 -731
  498. package/src/views/guide.vue +227 -227
  499. package/src/views/guideIndex.vue +284 -284
  500. package/tests/unit/.eslintrc.js +5 -5
  501. package/tests/unit/example.spec.js +13 -13
  502. package/vue.config.js +287 -287
@@ -1,1758 +1,1758 @@
1
- <template>
2
- <div class="wrapper">
3
- <div class="opt">
4
- <!-- <span>字表</span> -->
5
- <el-button
6
- v-if="!edit"
7
- @click="addValue"
8
- >添加</el-button>
9
- </div>
10
- <div class="tables">
11
- <el-tooltip
12
- content="从左侧拖拽来添加字段"
13
- placement="top"
14
- :disabled="!edit"
15
- >
16
- <div
17
- class="tables-sub"
18
- v-if="columns.length > 0"
19
- >
20
- <draggable
21
- v-if="!tableChange "
22
- :animation="200"
23
- :disabled="!edit"
24
- :list="columns1"
25
- @add="handleAdd"
26
- @end="handleMoveEnd"
27
- @start="handleMoveStart"
28
- :group="{ name: 'form', pull: false, put: true}"
29
- style="display: flex; border-top: 1px solid #ebeef5;
30
- border-bottom: 1px solid #ebeef5;"
31
- filter='.nodraggable'
32
- >
33
- <!-- <draggable
34
- v-if="( (desc.type =='custom-table' &&!desc.types) || $route.name=='index') || (flag !=='dialog' && desc.types !='goods') "
35
- :animation="200"
36
- :disabled="!edit"
37
- :list="columns"
38
- @add="handleAdd"
39
- @end="handleMoveEnd"
40
- @start="handleMoveStart"
41
- :group="{ name: 'form', pull: false, put: true}"
42
- style="display: flex; border-top: 1px solid #ebeef5;
43
- border-bottom: 1px solid #ebeef5;"
44
- filter='.nodraggable'
45
- > -->
46
- <div
47
- class="parts"
48
- :class="{'nodraggable' : item.type == 'index', 'form-item-active': (selSubIndex == index && edit && list[activeFormName][selectIndex].field == desc.field),'disoption': edit}"
49
- :style="{width: item.type == 'index' ? '50px' : '300px'}"
50
- v-for="(item,index) in columns1"
51
- :key="index+1"
52
- @click.stop="handleFormItemClick(item,index)"
53
- >
54
-
55
- <div>
56
- <div class="heard isSummary">{{item.content ? item.content.label : item.label}}
57
- <el-tooltip
58
- v-if='item.content?item.content.attrs.summary:false'
59
- class="item isSummary"
60
- effect="dark"
61
- :content="item.content.attrs.summary "
62
- placement="top"
63
- >
64
- <i class="el-icon-warning-outline isSummary"></i>
65
- </el-tooltip>
66
- </div>
67
- <div
68
- class="botom handle"
69
- v-for="(val,indexs) in computedValue"
70
- @click.stop="handleFormCusClick(val,indexs)"
71
- :key="indexs"
72
- >
73
- <template v-if="item.content">
74
- <el-form-item :required="item.content._attrs.required ? true : false">
75
- <component
76
- v-if="item.content.type =='ele-form-textarea'"
77
- :desc="item.content"
78
- :is="item.content.type"
79
- v-bind="getAttrs(item.content)"
80
- v-model="val[item.prop]"
81
- v-on="item.content.on"
82
- :autosize="{ minRows: 1, maxRows: 1}"
83
- :rows='1'
84
- :class="'eleFormTextarea'"
85
- :ref="item.prop+indexs"
86
- >
87
-
88
- </component>
89
- <component
90
- v-else-if="item.content.type !='ele-form-select' "
91
- :desc="item.content"
92
- :is="item.content.type"
93
- :options="setItemOption(item,index,indexs)"
94
- v-bind="getAttrs(item.content)"
95
- v-model="val[item.prop]"
96
- v-on="item.content.on"
97
- @click="setIndex(index)"
98
- :class="'indexs_' + indexs+'_' + item.prop"
99
- :ref="item.prop+indexs"
100
- >
101
- </component>
102
- <component
103
- v-else-if="item.content.type =='ele-form-select' && desc.types "
104
- :desc="item.content"
105
- :is="item.content.type"
106
- :options="setItemOption(item,index,indexs)"
107
- v-bind="getAttrs(item.content)"
108
- v-model="val[item.prop]"
109
- v-on="item.content.on"
110
- @click="setIndex(index)"
111
- :class="'indexs_' + indexs+'_' + item.prop"
112
- :ref="item.prop+indexs"
113
- >
114
- </component>
115
- <el-select
116
- v-model="val[item.prop]"
117
- :placeholder="'请选择'+item.content.label"
118
- @click="setIndex(index)"
119
- :multiple="item.content.attrs.multiple"
120
- :ref="item.prop+indexs"
121
- v-else-if="!desc.types"
122
- >
123
- <el-option
124
- v-for="item2 in item.content.options"
125
- :key="item2.value"
126
- :label="item2.text"
127
- :value="item2.value"
128
- >
129
- </el-option>
130
- </el-select>
131
- </el-form-item>
132
- </template>
133
- <template v-else-if="!item.content&&item._attrs">
134
- <el-form-item :required="item._attrs.required ? true : false">
135
- <component
136
- v-if="item.type =='ele-form-textarea'"
137
- :desc="item"
138
- :is="item.type"
139
- v-bind="getAttrs(item)"
140
- v-model="val[item.field]"
141
- v-on="item.on"
142
- :autosize="{ minRows: 1, maxRows: 1}"
143
- :rows='1'
144
- :class="'eleFormTextarea'"
145
- :ref="item.field+indexs"
146
- >
147
-
148
- </component>
149
- <component
150
- v-else-if="item.type !='ele-form-select' "
151
- :desc="item"
152
- :is="item.type"
153
- :options="setItemOption(item,index,indexs)"
154
- v-bind="getAttrs(item)"
155
- v-model="val[item.field]"
156
- v-on="item.on"
157
- @click="setIndex(index)"
158
- :class="'indexs_' + indexs+'_' + item.field"
159
- :ref="item.field+indexs"
160
- >
161
- </component>
162
- <!-- <component
163
- v-else-if="item.type =='ele-form-select' && desc.types "
164
- :desc="item"
165
- :is="item.type"
166
- :options="setItemOption(item,index,indexs)"
167
- v-bind="getAttrs(item)"
168
- v-model="val[item.prop]"
169
- v-on="item.on"
170
- @click="setIndex(index)"
171
- :class="'indexs_' + indexs+'_' + item.prop"
172
- :ref="item.prop+indexs"
173
- >
174
- </component> -->
175
- <el-select
176
- v-model="val[item.field]"
177
- :placeholder="'请选择'+item.label"
178
- @click="setIndex(index)"
179
- :multiple="item.attrs.multiple"
180
- :ref="item.field+indexs"
181
- v-else-if="item.type =='ele-form-select' && !desc.types"
182
- >
183
- <el-option
184
- v-for="item2 in item.options"
185
- :key="item2.value"
186
- :label="item2.text"
187
- :value="item2.value"
188
- >
189
- </el-option>
190
- </el-select>
191
- </el-form-item>
192
- </template>
193
- <template v-else>
194
- <span>{{setValue(item.prop,indexs)}}</span>
195
- </template>
196
- </div>
197
- </div>
198
-
199
- <!-- 复制按钮 -->
200
- <el-button
201
- @click.stop="handleCopy(index)"
202
- class="form-item-copy-btn"
203
- icon="el-icon-document-copy"
204
- size="mini"
205
- style="border-radius: 0"
206
- type="primary"
207
- v-if="selSubIndex === index && edit && list[activeFormName][selectIndex].field == desc.field && !list[activeFormName][selectIndex].attrs.columns[selSubIndex].isFixed"
208
- ></el-button>
209
- <!-- 删除按钮 -->
210
- <el-button
211
- @click.stop="handleDelete(index)"
212
- class="form-item-delete-btn"
213
- icon="el-icon-delete"
214
- size="mini"
215
- style="border-radius: 0"
216
- type="primary"
217
- v-if="selSubIndex === index && edit && list[activeFormName][selectIndex].field == desc.field && !list[activeFormName][selectIndex].attrs.columns[selSubIndex].isFixed"
218
- ></el-button>
219
- </div>
220
- <!-- TODO: 多选后如果有自定义选项 则渲染在选择项后方 -->
221
- <template v-for="(item,indexs) in columnsValue">
222
- <div
223
- class="parts"
224
- v-if="propertyList[indexs] && propertyList[indexs].length "
225
- @click.stop="handleFormItemClick(item,j)"
226
- :key="'pro'+indexs"
227
- >
228
- <div class="heard isSummary">
229
- 规格属性
230
- <!-- {{pro.name ? pro.name : pro.name}} -->
231
- </div>
232
-
233
- <div
234
- v-for="(pro,j) in propertyList[indexs]"
235
- :key='j'
236
- >
237
- <div
238
- class="botom handle"
239
- @click.stop="handleFormCusClick(item,indexs)"
240
- :key="indexs"
241
- >
242
- <component
243
- :desc="{label: pro.name,on: {'change': (val)=>{setProStr(item,pro,indexs,val)}}}"
244
- :is="pro.key == 0 ? 'ele-form-input' : 'ele-form-select'"
245
- :options="propertyList[indexs][j].data"
246
- v-model="item['pro-'+pro.propertyId]"
247
- >
248
- </component>
249
- </div>
250
- </div>
251
- <!-- <span
252
- style="padding-left: 4px; word-break: keep-all;"
253
- v-if="pro.unit"
254
- >{{pro.unit}}</span> -->
255
-
256
- </div>
257
- </template>
258
- <div
259
- v-if="!edit"
260
- class="parts"
261
- >
262
- <div class="heard">操作</div>
263
- <div
264
- class="botom handle"
265
- v-for="(item,index) in computedValue"
266
- :key="index"
267
- >
268
- <el-button
269
- type="text"
270
- @click="deteleVal(index)"
271
- >删除</el-button>
272
- </div>
273
- </div>
274
- </draggable>
275
-
276
- <el-table
277
- v-if="tableChange"
278
- class="cusTable"
279
- max-height="500"
280
- :data="computedValue"
281
- border
282
- >
283
- <!-- <el-table
284
- v-if="(flag=='dialog'&&desc.types == 'goods') || ($route.name=='formGeneration'&&desc.types == 'goods')"
285
- class="cusTable"
286
- max-height="500"
287
- :data="computedValue"
288
- border
289
- > -->
290
-
291
- <template slot="empty">
292
- <base-empty-data />
293
- </template>
294
-
295
- <el-table-column
296
- align="center"
297
- v-for="(item, index) in columns1"
298
- :key="index"
299
- :prop="item.prop"
300
- :width="item.type=='index'?50: item.label!='规格属性'?'200%':'250%'"
301
- :label="item.content?item.content.label:item.label"
302
- >
303
- <template slot-scope="scope">
304
- <template v-if="item.type == 'conunt'">
305
- <div v-if="propertyList[scope.$index] && propertyList[scope.$index].length>0">
306
- <el-form-item
307
- v-for="(pro,j) in propertyList[scope.$index]"
308
- :label="pro.name"
309
- :key='j'
310
- >
311
- <component
312
- :desc="{label: pro.name,on: {'change': (val)=>{setProStr(item,pro,scope.$index,val)}}}"
313
- :is="pro.key == 0 ? 'ele-form-input' : 'ele-form-select'"
314
- :options="propertyList[scope.$index][j].data"
315
- v-model="scope.row['pro-'+pro.propertyId]"
316
- >
317
- </component>
318
- </el-form-item>
319
- </div>
320
-
321
- <div v-else>无</div>
322
- </template>
323
- <template v-else-if="item.content">
324
- <el-form-item>
325
- <component
326
- v-if="item.content.type =='ele-form-textarea'"
327
- :desc="item.content"
328
- :is="item.content.type"
329
- v-bind="getAttrs(item.content)"
330
- v-model="scope.row[item.prop]"
331
- v-on="item.content.on"
332
- :autosize="{ minRows: 1, maxRows: 1}"
333
- :rows='1'
334
- :class="'eleFormTextarea'"
335
- :ref="item.prop+scope.$index"
336
- >
337
-
338
- </component>
339
- <component
340
- v-else-if="item.content.type !='ele-form-select' "
341
- :desc="item.content"
342
- :is="item.content.type"
343
- :options="setItemOption(item,index,scope.$index)"
344
- v-bind="getAttrs(item.content)"
345
- v-model="scope.row[item.prop]"
346
- v-on="item.content.on"
347
- @click="setIndex(index)"
348
- :class="'indexs_' + scope.$index+'_' + item.prop"
349
- :ref="item.prop+scope.$index"
350
- >
351
- </component>
352
- <component
353
- v-else-if="item.content.type =='ele-form-select' && desc.types "
354
- :desc="item.content"
355
- :is="item.content.type"
356
- :options="setItemOption(item,index,scope.$index)"
357
- v-bind="getAttrs(item.content)"
358
- v-model="scope.row[item.prop]"
359
- v-on="item.content.on"
360
- @click="setIndex(index)"
361
- :class="'indexs_' + scope.$index+'_' + item.prop"
362
- :ref="item.prop+scope.$index"
363
- >
364
- </component>
365
- <el-select
366
- v-model="scope.row[item.prop]"
367
- :placeholder="'请选择'+item.content.label"
368
- @click="setIndex(index)"
369
- :multiple="item.content.attrs.multiple"
370
- :ref="item.prop+scope.$index"
371
- v-else-if="!desc.types"
372
- >
373
- <el-option
374
- v-for="item2 in item.content.options"
375
- :key="item2.value"
376
- :label="item2.text"
377
- :value="item2.value"
378
- >
379
- </el-option>
380
- </el-select>
381
- </el-form-item>
382
- </template>
383
- <template v-else-if="!item.content&&item._attrs">
384
- <el-form-item>
385
- <component
386
- v-if="item.type =='ele-form-textarea'"
387
- :desc="item"
388
- :is="item.type"
389
- v-model="val[item.field]"
390
- v-on="item.on"
391
- v-bind="getAttrs(item.content)"
392
- :autosize="{ minRows: 1, maxRows: 1}"
393
- :rows='1'
394
- :class="'eleFormTextarea'"
395
- :ref="item.field+indexs"
396
- >
397
-
398
- </component>
399
- <component
400
- v-else-if="item.type !='ele-form-select' "
401
- :desc="item"
402
- :is="item.type"
403
- :options="setItemOption(item,index,scope.$index)"
404
- v-model="val[item.field]"
405
- v-bind="getAttrs(item.content)"
406
- v-on="item.on"
407
- @click="setIndex(index)"
408
- :class="'indexs_' + scope.$index+'_' + item.field"
409
- :ref="item.field+scope.$index"
410
- >
411
- </component>
412
- <!-- <component
413
- v-else-if="item.type =='ele-form-select' && desc.types "
414
- :desc="item"
415
- :is="item.type"
416
- v-bind="getAttrs(item)"
417
- v-model="val[item.prop]"
418
- v-on="item.on"
419
- @click="setIndex(index)"
420
- :class="'indexs_' + scope.$index+'_' + item.prop"
421
- :ref="item.prop+scope.$index"
422
- >
423
- </component> -->
424
- <el-select
425
- v-model="val[item.field]"
426
- :placeholder="'请选择'+item.label"
427
- @click="setIndex(index)"
428
- :multiple="item.attrs.multiple"
429
- :ref="item.field+scope.$index"
430
- v-else-if="item.type =='ele-form-select'&&!desc.types"
431
- >
432
- <el-option
433
- v-for="item2 in item.options"
434
- :key="item2.value"
435
- :label="item2.text"
436
- :value="item2.value"
437
- >
438
- </el-option>
439
- </el-select>
440
- </el-form-item>
441
- </template>
442
- <template v-else>
443
- <span>{{setValue(item.prop,scope.$index)}}</span>
444
- </template>
445
- </template>
446
-
447
- </el-table-column>
448
- <el-table-column
449
- v-if="computedValue.length>1"
450
- header-align="center"
451
- align="center"
452
- prop="prop"
453
- label="操作"
454
- >
455
- <template slot-scope="scope">
456
- <el-button
457
- type="text"
458
- @click="deteleVal(scope.$index)"
459
- >删除</el-button>
460
- </template>
461
-
462
- </el-table-column>
463
-
464
- </el-table>
465
-
466
- <!-- <div
467
- class="msg nodraggable"
468
- v-if="edit"
469
- >从左侧拖拽来添加字段</div> -->
470
- </div>
471
- </el-tooltip>
472
- </div>
473
- </div>
474
- </template>
475
-
476
- <script>
477
- import request from "@/http";
478
- import * as _ from "lodash";
479
- import OptionSlot from "./optionSolt";
480
- import postman from "../components/postman";
481
- import handleCode from "../components/handleCode";
482
- import linkForm from "../components/linkForm";
483
- // import draggable from "vuedraggable";
484
- import { mapGetters, mapMutations, mapState } from "vuex";
485
- import {
486
- getGooodsType,
487
- getGooodsBrand,
488
- getMachineryList,
489
- getMachineryType,
490
- getEquipmentList,
491
- getUnitListData,
492
- getGooodsProperty,
493
- concreteStrongAll,
494
- concreteAdmixtureAll,
495
- getMechanicsAttr,
496
- getEquipProp,
497
- modelSelect,
498
- brandSelect,
499
- getSeriesSelect,
500
- getSeatSelect,
501
- gearboxSelect,
502
- gethouseType,
503
- getTeamCategory,
504
- getTeamEngineeringMajor,
505
- getTeamLocation
506
- } from "@/formBuilder/apiBusiness.js";
507
- import {
508
- carSeating,
509
- driveModel,
510
- carYear
511
- } from "@/formBuilder/component/components/data.js";
512
- const draggable = () => ({
513
- // 需要加载的组件 (应该是一个 `Promise` 对象)
514
- component: import("vuedraggable"),
515
- // 异步组件加载时使用的组件
516
- loading: "",
517
- // 加载失败时使用的组件
518
- error: "",
519
- // 展示加载时组件的延时时间。默认值是 200 (毫秒)
520
- delay: 200,
521
- // 如果提供了超时时间且组件加载也超时了,
522
- // 则使用加载失败时使用的组件。默认值是:`Infinity`
523
- timeout: 3000
524
- });
525
- export default {
526
- name: "CustomTable",
527
- extends: {},
528
- components: {
529
- OptionSlot,
530
- draggable,
531
- postman,
532
- handleCode,
533
- linkForm
534
- },
535
- props: {
536
- value: {
537
- type: Array,
538
- default: () => []
539
- },
540
- flag: {
541
- type: String,
542
- default: ""
543
- },
544
- columns: {
545
- type: Array,
546
- default: () => []
547
- },
548
- desc: {
549
- type: Object,
550
- default: () => {
551
- return {};
552
- }
553
- },
554
- edit: {
555
- type: Boolean,
556
- default: () => false
557
- }
558
- },
559
- data() {
560
- return {
561
- tableCustomArr: [],
562
- optionTypes: {
563
- "ele-form-select": {
564
- type: "el-option",
565
- text: "label",
566
- value: "value"
567
- },
568
- "ele-form-checkbox": {
569
- type: "el-checkbox",
570
- text: "content",
571
- value: "label"
572
- },
573
- "ele-form-radio": {
574
- type: "el-radio",
575
- text: "content",
576
- value: "label"
577
- }
578
- },
579
- goodsOption: [],
580
- Mechanics: [],
581
- equipment: [],
582
- team: [],
583
- EngineeringMajorOption: [],
584
- addressOption: [],
585
- bidding: [],
586
- biddingType: [
587
- { text: "商品/材料", value: "3" },
588
- { text: "工程分包", value: "4" },
589
- { text: "机械设备租赁", value: "1" },
590
- { text: "劳务", value: "2" }
591
- ],
592
- // 自定义属性
593
- muster: {
594
- brand: []
595
- },
596
- unitList: [],
597
- propertyList: [],
598
- strength: [],
599
- admixture: [],
600
- // 车辆信息
601
- carModel: [],
602
- carBrand: [],
603
- carGearbox: [],
604
- carSeries: [],
605
- carSeating: carSeating,
606
- driveModel: driveModel,
607
- carYear: carYear(),
608
- houseType: [],
609
- houseType2: [],
610
- category: []
611
- // columnsValue: _.cloneDeep(this.columns)
612
- // columns1: _.cloneDeep(this.columns)
613
- };
614
- },
615
- computed: {
616
- ...mapState(["selSubIndex", "activeFormName", "list", "selectIndex"]),
617
- ...mapGetters(["currentFormItem"]),
618
- computedValue: function() {
619
- if (this.value.length > 0) {
620
- return this.value;
621
- } else {
622
- const type = [
623
- "checkbox",
624
- "datetimerange",
625
- "cascader",
626
- "postman",
627
- "handleCode"
628
- ];
629
- const arr = {};
630
- const arr1 = _.cloneDeep(this.columns1);
631
- arr1.forEach(item => {
632
- if (item.type != "index") {
633
- if (item.prop && item.prop != "key_conunt") {
634
- const typeStr = item.content.type.replace("ele-form-", "");
635
- arr[item.prop] = type.indexOf(typeStr) > -1 ? [] : "";
636
- }
637
- }
638
- });
639
- return [arr];
640
- }
641
- },
642
- tableChange: function() {
643
- if (this.desc.types == "goods" && this.$route.name == "formGeneration") {
644
- return true;
645
- } else if (this.desc.types == "goods" && this.flag == "dialog") {
646
- return true;
647
- } else {
648
- return false;
649
- }
650
- },
651
- columns1: {
652
- set: function(newV) {},
653
- get: function() {
654
- const res = _.cloneDeep(this.columns);
655
- res.forEach((e, i) => {
656
- if (e.type != "index" && e.content) {
657
- e.content._attrs = e.content.attrs;
658
- } else if (e.attrs) {
659
- e._attrs = e.attrs;
660
- }
661
- });
662
- if (
663
- (this.flag == "dialog" && this.desc.types == "goods") ||
664
- (this.$route.name == "formGeneration" && this.desc.types == "goods")
665
- ) {
666
- res.splice(2, 0, {
667
- label: "规格属性",
668
- prop: "key_conunt",
669
- type: "conunt",
670
- width: "200%"
671
- });
672
- }
673
- return res;
674
- }
675
- },
676
- columnsValue() {
677
- return _.cloneDeep(this.columns);
678
- }
679
- },
680
- methods: {
681
- ...mapMutations([
682
- "updateSelSubIndex",
683
- "updateSelectIndex",
684
- "updateList",
685
- "updateCusIndex"
686
- ]),
687
- handleFormCusClick(v, i) {
688
- // this.$store.state.curCusTableIndex = i
689
- this.updateCusIndex(i);
690
- },
691
- setProStr(val, pro, j, valNum) {
692
- if (!val) return;
693
- const name =
694
- pro.key == 1 && pro.data.length > 0
695
- ? pro.data.filter(item => item.value == valNum)[0].text
696
- : val;
697
- this.value[j]["pro-" + pro.propertyId + "-Str"] = {
698
- value: name,
699
- property: pro.name,
700
- unit: pro.unit
701
- };
702
- this.$emit("input", this.value);
703
- },
704
- setIndex(index) {
705
- this.$store.state.curCusTableIndex = index - 1;
706
- },
707
- setValue(prop, index) {
708
- if (prop) {
709
- const val = this.value.filter(item => item[prop]);
710
- return val[0][prop];
711
- } else {
712
- return index + 1;
713
- }
714
- },
715
- getAttrs(item) {
716
- return Object.assign({}, item.attrs);
717
- },
718
- // option设置
719
- setItemOption(item, index, indexs) {
720
- const arr = [];
721
- const vm = this;
722
-
723
- if (!item.content.options) return [];
724
- if (item.content.field == "leaseType") {
725
- item.content["on"] = {
726
- change: newVal => {
727
- vm.leaseTypeChange(newVal, item, indexs);
728
- }
729
- };
730
- }
731
-
732
- if (
733
- item.content.field == "carSeries" ||
734
- item.content.field == "carSeating"
735
- ) {
736
- item.content["on"] = {
737
- change: newVal => {
738
- vm.handleCustomChangeOption(newVal, item, indexs);
739
- }
740
- };
741
- return vm[item.content.options][indexs];
742
- }
743
- if (
744
- item.content.field == "unit" ||
745
- item.content.field == "carGearbox" ||
746
- item.content.field == "carSeating" ||
747
- item.content.field == "driveModel" ||
748
- item.content.field == "carYear"
749
- ) {
750
- item.content["on"] = {
751
- change: newVal => {
752
- vm.handleCustomChangeOption(newVal, item, indexs);
753
- }
754
- };
755
- return vm[item.content.options];
756
- }
757
-
758
- if (item.content.options && typeof item.content.options != "string") {
759
- return item.content.options;
760
- } else {
761
- if (item.content.types) {
762
- // vm.$nextTick(function() {
763
- item.content["on"] = {
764
- change: async newVal => {
765
- await vm.handleChange(newVal, item, indexs);
766
- }
767
- };
768
- item["on"] = {
769
- change: async newVal => {
770
- await vm.handleChange(newVal, item, indexs);
771
- }
772
- };
773
- // });
774
- return vm[item.content.options];
775
- } else if (!item.content.types) {
776
- item.content["on"] = {
777
- change: newVal => {
778
- vm.handleChangeOption(newVal, item, indexs);
779
- }
780
- };
781
- const key = item.content.options;
782
- !this.muster[key] && this.$set(this.muster, key, []);
783
- !this.muster[key][indexs] && this.$set(this.muster[key], indexs, []);
784
- return this.muster[key][indexs];
785
- }
786
- }
787
- },
788
- // 加载车辆选择框信息
789
- async initCarInfo() {
790
- const vm = this;
791
- if (this.carModel.length == 0) {
792
- const res = await modelSelect();
793
- this.carModel =
794
- res.data.code == 200
795
- ? res.data.data.map((item, index) => ({
796
- text: item.name,
797
- value: item.key
798
- }))
799
- : [];
800
- }
801
- if (this.carBrand.length == 0) {
802
- const res = await brandSelect();
803
- this.carBrand =
804
- res.data.code == 200
805
- ? res.data.data.map((item, index) => ({
806
- text: item.name,
807
- value: item.key
808
- }))
809
- : [];
810
- }
811
- if (vm.carGearbox.length == 0) {
812
- const res = await gearboxSelect();
813
- vm.carGearbox =
814
- res.data.code == 200
815
- ? res.data.data.map((item, index) => ({
816
- text: item.value.toString(),
817
- value: item.key.toString()
818
- }))
819
- : [];
820
- }
821
- },
822
- leaseTypeChange(newVal, item, indexs) {
823
- if (newVal == 1) {
824
- this.getMachineryList();
825
- } else if (newVal == 2) {
826
- this.getEquipmentList();
827
- } else if (newVal == 3) {
828
- this.initCarInfo();
829
- } else if (newVal == 4) {
830
- this.getHouse();
831
- }
832
- Object.keys(this.value[indexs]).forEach(k => {
833
- if (k.indexOf("pro-") > -1) {
834
- delete this.value[indexs][k];
835
- } else if (k != "leaseType") {
836
- const type = Array.isArray(this.value[indexs][k]);
837
- this.value[indexs][k] = type ? [] : "";
838
- }
839
- });
840
- this.$emit("input", this.value);
841
- },
842
- // 父级元素数据发生变化
843
- async handleChange(val, item, indexs) {
844
- if (item.content.types == "goods") {
845
- const str = this.goodsOption.filter(k => val[0] && k.id == val[0]);
846
- if (str[0] && str[0].name == "商砼") {
847
- this.getConcrete(val, item, indexs);
848
- } else {
849
- this.getGooodsBrand(val, item, indexs);
850
- this.getGooodsProperty(val, item, indexs);
851
- }
852
- } else if (item.content.types == "Mechanics") {
853
- this.getMachineryType(val, item, indexs);
854
- } else if (item.content.types == "equipment") {
855
- this.getEquipmentType(val, item, indexs);
856
- } else if (item.content.types == "team") {
857
- this.setTeamStr(val, item, indexs);
858
- } else if (item.content.types == "bidding") {
859
- this.setBiddingStr(val, item, indexs);
860
- } else if (item.content.types == "houses") {
861
- this.setHouseStr(val, item, indexs);
862
- this.getHouseType2(val, item, indexs);
863
- } else if (item.content.types == "carBrand") {
864
- this.setcarBrandStr(val, item, indexs);
865
- this.getSeriesSelect(val, item, indexs);
866
- } else if (item.content.types == "cars") {
867
- this.setcarsStr(val, item, indexs);
868
- this.getSeatSelect(val, item, indexs);
869
- }
870
- },
871
- setcarBrandStr(val, item, indexs) {
872
- const name = this.carBrand.filter(i => i.value == val);
873
- this.value[indexs][item.content.field + "Str"] = name[0]
874
- ? name[0].text
875
- : "";
876
- this.value[indexs]["carSeries" + "Str"] = "";
877
- this.value[indexs]["carSeries"] = "";
878
- this.$emit("input", this.value);
879
- },
880
- setcarsStr(val, item, indexs) {
881
- const name = this.carModel.filter(i => i.value == val);
882
- this.value[indexs][item.content.field + "Str"] = name[0]
883
- ? name[0].text
884
- : "";
885
- this.value[indexs]["carSeating" + "Str"] = "";
886
- this.value[indexs]["carSeating"] = "";
887
- this.$emit("input", this.value);
888
- },
889
- setHouseStr(val, item, indexs) {
890
- const name = this.houseType.filter(i => i.value == val);
891
- this.value[indexs][item.content.field + "Str"] = name[0]
892
- ? name[0].text
893
- : "";
894
- // 清空子集
895
- if (item.content.link) {
896
- this.value[indexs][item.content.link + "Str"] = "";
897
- this.value[indexs][item.content.link] = "";
898
- }
899
- this.$emit("input", this.value);
900
- },
901
- // 扁平化树形数据
902
- flatTreeData(tree) {
903
- const res = [];
904
- function toflat(tree) {
905
- tree.forEach(el => {
906
- res.push(el);
907
- el.children && el.children.length > 0 ? toflat(el.children) : "";
908
- });
909
- }
910
- toflat(tree);
911
- return res;
912
- },
913
- setTeamStr(val, item, indexs) {
914
- if (item.content.field == "EngineeringMajor") {
915
- const name = this.EngineeringMajorOption.filter(i => i.value == val);
916
- this.value[indexs][item.content.field + "Str"] = name[0]
917
- ? name[0].text
918
- : "";
919
- this.$emit("input", this.value);
920
- }
921
- if (item.content.field == "address") {
922
- const arr = this.flatTreeData(this.addressOption);
923
- let title = "";
924
- arr.map(item => {
925
- val.map(one => {
926
- if (item.no == one) {
927
- title += item.name + "/";
928
- }
929
- });
930
- });
931
- title = title.substring(0, title.length - 1);
932
- this.value[indexs][item.content.field + "Str"] = title || "";
933
- this.$emit("input", this.value);
934
- }
935
- },
936
- setBiddingStr(val, item, indexs) {
937
- const name = this.biddingType.filter(i => i.value == val);
938
- this.value[indexs][item.content.field + "Str"] = name[0]
939
- ? name[0].text
940
- : "";
941
- this.$emit("input", this.value);
942
- },
943
- // 子级元素发生变化
944
- handleChangeOption(newVal, item, indexs) {
945
- console.log(newVal, item, indexs);
946
- const name = this.muster[item.content.options][indexs].filter(
947
- i => i.value == newVal
948
- );
949
- const nameStr = name[0].text;
950
- const key = item.content.field + "Str";
951
- this.value[indexs][key] = nameStr;
952
- this.$emit("input", this.value);
953
- },
954
- handleCustomChangeOption(newVal, item, indexs) {
955
- let name = "";
956
- const vm = this;
957
- if (item.content.field == "unit") {
958
- name = vm.unitList.filter(i => i.value == newVal);
959
- } else if (item.content.field == "carSeries") {
960
- name = vm.carSeries[indexs].filter(i => i.value == newVal);
961
- } else if (item.content.field == "carGearbox") {
962
- name = vm.carGearbox.filter(i => i.value == newVal);
963
- } else if (item.content.field == "carSeating") {
964
- name = vm.carSeating[indexs].filter(i => i.value == newVal);
965
- } else if (item.content.field == "driveModel") {
966
- name = vm.driveModel.filter(i => i.value == newVal);
967
- } else if (item.content.field == "carYear") {
968
- name = vm.carYear.filter(i => i.value == newVal);
969
- }
970
-
971
- const nameStr = name[0].text || name[0].label;
972
- const key = item.content.field + "Str";
973
- vm.value[indexs][key] = nameStr;
974
- vm.$emit("input", vm.value);
975
- },
976
-
977
- // 点击选中
978
- handleFormItemClick(item, index) {
979
- if (!this.edit) return;
980
- if (item.type != "index") {
981
- this.list[this.activeFormName].forEach((i, v) => {
982
- if (i.field == this.desc.field) {
983
- this.updateSelectIndex(v);
984
- }
985
- });
986
- this.updateSelSubIndex(index);
987
- }
988
- },
989
- // 复制
990
- handleCopy(index) {
991
- const obj = _.cloneDeep(this.columns1[index]);
992
- obj.field = `key_${Date.now()}`;
993
- this.columns1.splice(index + 1, 0, obj);
994
- this.setListColumns(this.columns1);
995
- this.updateSelSubIndex(index + 1);
996
- },
997
- // 删除
998
- handleDelete(index) {
999
- this.columns1.splice(index, 1);
1000
- this.setListColumns(this.columns1);
1001
- // 如果删除的最后一个, 则重新选择最后一个
1002
- if (index >= this.columns1.length) {
1003
- this.updateSelSubIndex(this.columns1.length - 1);
1004
- } else if (index - 1 < 1 && this.columns1 > 1) {
1005
- this.updateSelSubIndex(1);
1006
- } else {
1007
- this.updateSelSubIndex(null);
1008
- }
1009
- },
1010
- // 新增
1011
- handleAdd(res) {
1012
- const vm = this;
1013
- const type = [
1014
- "linkForm",
1015
- "ele-form-select",
1016
- "checkbox",
1017
- "datetimerange",
1018
- "cascader",
1019
- "postman",
1020
- "handleCode"
1021
- ];
1022
- if (
1023
- this.columns1[res.newIndex].type.indexOf("custom-table") > -1 ||
1024
- this.columns1[res.newIndex].type.indexOf("columns") > -1 ||
1025
- this.columns1[res.newIndex].type.indexOf("quill-editor") > -1 ||
1026
- this.columns1[res.newIndex].type.indexOf("linkForm") > -1
1027
- ) {
1028
- this.$message.error("不支持添加此类型控件,请添加其他类型控件");
1029
- this.columns1.splice(res.newIndex, 1);
1030
- return;
1031
- }
1032
- const obj = this.columns1[res.newIndex];
1033
- let content = {};
1034
- // 如果是单选框 多选框 进入表格 则添加下拉框
1035
- if (obj.type && (obj.type === "radio" || obj.type === "checkbox")) {
1036
- if (obj.type === "checkbox") {
1037
- obj.attrs["multiple"] = true;
1038
- }
1039
- obj.type = "ele-form-select";
1040
- content = obj;
1041
- vm.columns[res.newIndex] = {
1042
- prop: obj.field,
1043
- label: obj.label,
1044
- isFlex: true,
1045
- content: content
1046
- };
1047
- }
1048
-
1049
- vm.columns1.map((e, i) => {
1050
- if (e.field) {
1051
- e.type = type.indexOf(e.type) > -1 ? e.type : "ele-form-" + e.type;
1052
- vm.columns1[i] = {
1053
- prop: e.field,
1054
- label: e.label,
1055
- isFlex: true,
1056
- content: e
1057
- };
1058
- }
1059
- if (e.type === "ele-form-radio" || e.type === "ele-form-checkbox") {
1060
- if (e.type === "ele-form-checkbox") {
1061
- e.attrs["multiple"] = true;
1062
- }
1063
- e.type = "ele-form-select";
1064
- }
1065
- });
1066
- this.setListColumns(this.columns1);
1067
- this.list[this.activeFormName].forEach((i, v) => {
1068
- if (i.field == this.desc.field) {
1069
- this.updateSelectIndex(v);
1070
- }
1071
- });
1072
- this.updateSelSubIndex(res.newIndex);
1073
- },
1074
- // 移动开始
1075
- handleMoveStart(res) {
1076
- this.updateSelSubIndex(res.oldIndex);
1077
- },
1078
- // 移动结束
1079
- handleMoveEnd(res) {
1080
- this.setListColumns(this.columns1);
1081
- this.updateSelSubIndex(res.newIndex);
1082
- },
1083
- setListColumns(columns) {
1084
- const list = _.cloneDeep(this.list);
1085
- list[this.activeFormName].forEach(item => {
1086
- if (item.field == this.desc.field) {
1087
- item.attrs.columns = columns;
1088
- }
1089
- });
1090
- this.updateList({
1091
- name: this.activeFormName,
1092
- newList: list[this.activeFormName]
1093
- });
1094
- },
1095
- addValue() {
1096
- const type = [
1097
- "checkbox",
1098
- "datetimerange",
1099
- "cascader",
1100
- "postman",
1101
- "handleCode"
1102
- ];
1103
- const obj = {};
1104
- this.columns1.forEach(item => {
1105
- if (item.prop && item.prop != "key_conunt") {
1106
- const typeStr = item.content.type.replace("ele-form-", "");
1107
- obj[item.prop] = type.indexOf(typeStr) > -1 ? [] : "";
1108
- }
1109
- });
1110
- this.value.push(obj);
1111
- this.$emit("input", this.value);
1112
- },
1113
- deteleVal(index) {
1114
- this.value.splice(index, 1);
1115
- const type = {
1116
- goods: "brand",
1117
- Mechanics: "classify",
1118
- equipment: "equipClassify",
1119
- houses: "houseType2"
1120
- };
1121
- const key = type[this.desc.types];
1122
- this.muster[key].splice(index, 1);
1123
- this.$emit("input", this.value);
1124
- },
1125
- // 获取团队主营业务
1126
- async getTeamBusiness() {
1127
- const res = await getTeamCategory();
1128
- this.category = res.data && res.data.code == 200 ? res.data.data : [];
1129
- },
1130
- // 获取工队工程专业
1131
- async getTeamEngineeringMajor() {
1132
- const res = await getTeamEngineeringMajor();
1133
- if (res.data.code == 200) {
1134
- res.data.data.map(item => {
1135
- item["text"] = item.name;
1136
- item["value"] = item.no;
1137
- });
1138
- this.EngineeringMajorOption = res.data.data;
1139
- }
1140
- },
1141
- // 获取工队所在地区
1142
- async getTeamLocation() {
1143
- const res = await getTeamLocation();
1144
- this.addressOption =
1145
- res.data && res.data.code == 200 ? res.data.data.data : [];
1146
- console.log("res: ", res.data.data.data);
1147
- },
1148
- // 获取机械自定义属性
1149
- async getClassifyPro(newVal, item, indexs) {
1150
- Object.keys(this.value[indexs]).forEach(k => {
1151
- if (k.indexOf("pro-") > -1) {
1152
- delete this.value[indexs][k];
1153
- }
1154
- });
1155
- const params = {
1156
- categoryNo:
1157
- item.prop == "classify"
1158
- ? this.value[indexs].Mechanics
1159
- : this.value[indexs].equipment,
1160
- typeNo: newVal
1161
- };
1162
- const res =
1163
- item.prop == "classify"
1164
- ? await getMechanicsAttr(params)
1165
- : await getEquipProp(params);
1166
- if (res.data.code == 200) {
1167
- let propertyList = [];
1168
- if (item.prop == "classify") {
1169
- propertyList = res.data.data.map((item, index) => {
1170
- item.data = item.valList.map(i => ({
1171
- text: i.startVal,
1172
- value: i.startVal
1173
- }));
1174
- item.propertyId = index;
1175
- return item;
1176
- });
1177
- } else {
1178
- res.data.data.forEach((item, index) => {
1179
- item.data = item.valList.map(i => ({ text: i.val, value: i.val }));
1180
- item.propertyId = index;
1181
- propertyList.push({
1182
- name: item.name,
1183
- propertyId: index,
1184
- data: item.data,
1185
- unit: item.unit,
1186
- key: item.attrKey
1187
- });
1188
- });
1189
- }
1190
- this.$set(this.propertyList, indexs, propertyList);
1191
- }
1192
- },
1193
- // 房产分类
1194
- async getHouse() {
1195
- if (this.houseType.length == 0) {
1196
- const res = await gethouseType({ type: 0 });
1197
- if (res.data.code == 200) {
1198
- res.data.data.map(item => {
1199
- item["text"] = item.categoryName;
1200
- item["value"] = item.id;
1201
- });
1202
- this.houseType = res.data.data;
1203
- }
1204
- }
1205
- },
1206
- getHouseType2(val, item, indexs) {
1207
- const key = item.content.link || item.content.options;
1208
- var Arr = this.houseType.filter(item => item.id == val);
1209
- if (Arr.length != 0) {
1210
- this.houseType2 = Arr[0].children.map(item => ({
1211
- text: item.categoryName,
1212
- value: item.id
1213
- }));
1214
- }
1215
- this.$set(this.muster[key], indexs, this.houseType2);
1216
- },
1217
- async getSeriesSelect(a, b, c) {
1218
- const vm = this;
1219
- console.log(a, b, c, vm.value[c].carBrand);
1220
-
1221
- const res = await getSeriesSelect({
1222
- brandNo: a
1223
- });
1224
-
1225
- if (res.data.code == 200) {
1226
- const res1 = res.data.data.map((e, i) => {
1227
- return {
1228
- text: e.name,
1229
- value: e.id
1230
- };
1231
- });
1232
- // vm.carSeries.push(res1);
1233
- this.$set(vm.carSeries, c, res1);
1234
- }
1235
- },
1236
- async getSeatSelect(a, b, c) {
1237
- const vm = this;
1238
-
1239
- const res = await getSeatSelect({
1240
- modelNo: vm.value[c].carModel
1241
- });
1242
- if (res.data.code == 200) {
1243
- var res1 = res.data.data.map((e, i) => {
1244
- return {
1245
- text: e.name,
1246
- value: e.key
1247
- };
1248
- });
1249
- }
1250
- this.$set(vm.carSeating, c, res1);
1251
- },
1252
- // 商品分类
1253
- async getGooodsType() {
1254
- const res = await getGooodsType({ type: "purchase" });
1255
- if (res.status == 200) {
1256
- this.goodsOption = this.formatChildData(res.data.data);
1257
- }
1258
- },
1259
- // 商品品牌
1260
- async getGooodsBrand(val, item, indexs, flg) {
1261
- let value = [];
1262
- const vm = this;
1263
- const key = item.content.link;
1264
- if (!flg) {
1265
- vm.value[indexs].brand = "";
1266
- vm.value[indexs].brandStr = "";
1267
- setTimeout(() => {
1268
- const text =
1269
- vm.$refs[item.content.field + indexs][0].$refs.cascader
1270
- ?.presentText ||
1271
- vm.$refs[item.content.field + indexs][0].$refs.input.$props.value;
1272
- vm.value[indexs][item.content.field + "Str"] = text || "";
1273
- vm.$emit("input", vm.value);
1274
- }, 100);
1275
- }
1276
-
1277
- const data = val[val.length - 1];
1278
- if (!data) return;
1279
- const res = await getGooodsBrand(data, indexs);
1280
- if (res.data.code == 0) {
1281
- value = res.data.data.reduce(
1282
- (total, currentValue) => total.concat(currentValue.options),
1283
- []
1284
- );
1285
- value = value.map(i => ({ text: i.brandName, value: i.id }));
1286
- }
1287
- vm.$set(vm.muster[key], indexs, value);
1288
- },
1289
- // 商品属性
1290
- async getGooodsProperty(val, item, indexs, flg) {
1291
- const vm = this;
1292
- const id = val[val.length - 1];
1293
- if (!id) return;
1294
- if (!flg) {
1295
- Object.keys(this.value[indexs]).forEach(k => {
1296
- if (k.indexOf("pro-") > -1) {
1297
- delete this.value[indexs][k];
1298
- }
1299
- });
1300
- this.$emit("input", this.value);
1301
- }
1302
- const res = await getGooodsProperty(id, indexs);
1303
- if (res.data.code == 0) {
1304
- const list = res.data.data;
1305
- const propertyList = []; // 商品属性列表
1306
- for (let i = 0; i < list.length; i++) {
1307
- if (list[i].itemparamname === "仓储") {
1308
- continue;
1309
- }
1310
- let flag = true;
1311
- for (let j = 0; j < propertyList.length; j++) {
1312
- // 去重 合并属性名相同的项
1313
- if (propertyList[j].name === list[i].itemparamname) {
1314
- propertyList[j].data.push({
1315
- text: list[i].valdata,
1316
- value: list[i].id
1317
- });
1318
- flag = false;
1319
- break;
1320
- }
1321
- }
1322
- if (flag) {
1323
- // 非重复 添加商品属性和id
1324
- const obj = {
1325
- name: list[i].itemparamname,
1326
- data: [],
1327
- key: 1
1328
- };
1329
- obj.data.push({ text: list[i].valdata, value: list[i].id });
1330
- obj.propertyId = list[i].itemparamid;
1331
- propertyList.push(obj);
1332
- }
1333
- }
1334
- vm.$set(vm.propertyList, indexs, propertyList);
1335
- } else {
1336
- vm.$set(vm.propertyList, indexs, []);
1337
- }
1338
- },
1339
- // 商砼属性
1340
- async getConcrete(val, item, indexs, flg) {
1341
- const vm = this;
1342
- setTimeout(() => {
1343
- const text = vm.$refs[item.content.field + indexs][0].$refs.input.value;
1344
- vm.value[indexs][item.content.field + "Str"] = text || "";
1345
- vm.$emit("input", vm.value);
1346
- }, 100);
1347
- if (vm.strength.length == 0) {
1348
- const business = await concreteStrongAll();
1349
- vm.strength = business.data.result.map
1350
- ? business.data.result.map(i => ({
1351
- text: i.strongLevel,
1352
- value: i.sort
1353
- }))
1354
- : [];
1355
- }
1356
- if (vm.admixture.length == 0) {
1357
- const res = await concreteAdmixtureAll();
1358
- vm.admixture = vm.formatData(res.data.result);
1359
- }
1360
- if (!flg) {
1361
- Object.keys(vm.value[indexs]).forEach(k => {
1362
- if (k.indexOf("pro-") > -1) {
1363
- delete vm.value[indexs][k];
1364
- }
1365
- });
1366
- vm.$emit("input", vm.value);
1367
- }
1368
- const propertyList = [];
1369
- propertyList.push({
1370
- name: "强度等级",
1371
- data: vm.strength,
1372
- propertyId: "1",
1373
- key: 1
1374
- });
1375
- propertyList.push({
1376
- name: "外加剂",
1377
- data: vm.admixture,
1378
- propertyId: "2",
1379
- key: 1
1380
- });
1381
- vm.$set(vm.propertyList, indexs, propertyList);
1382
- },
1383
- // 机械分类
1384
- async getMachineryList() {
1385
- const res = await getMachineryList();
1386
- if (res.data.code == 200) {
1387
- this.Mechanics = res.data.data.map(item => ({
1388
- text: item.name,
1389
- value: item.no
1390
- }));
1391
- }
1392
- },
1393
- // 机械类型
1394
- async getMachineryType(val, item, indexs, flg) {
1395
- let value = [];
1396
- const key = item.content.link;
1397
- if (!flg) {
1398
- const name = this.Mechanics.filter(i => i.value == val);
1399
- this.value[indexs][item.content.field + "Str"] = name[0]
1400
- ? name[0].text
1401
- : "";
1402
- this.value[indexs].classify = "";
1403
- this.value[indexs].classifyStr = "";
1404
- this.$emit("input", this.value);
1405
- }
1406
- const res = await getMachineryType({ categoryNo: val }, indexs);
1407
- if (res.data.code == 200) {
1408
- value = res.data.data.map(item => ({
1409
- text: item.name,
1410
- value: item.no
1411
- }));
1412
- }
1413
- this.$set(this.muster[key], indexs, value);
1414
- },
1415
- async getTeamSize() {
1416
- const res = await getTeamSize();
1417
- if (res.data.code == 200) {
1418
- this.team = res.data.data.map(item => ({
1419
- text: item.name,
1420
- value: item.no
1421
- }));
1422
- }
1423
- },
1424
- async getBiddingProject() {
1425
- const data = this.$store.state.user.no;
1426
- const res = await getBiddingProject(data);
1427
- if (res.data.code == 0) {
1428
- this.bidding = res.data.result.map(item => ({
1429
- text: item.name,
1430
- value: item.no
1431
- }));
1432
- }
1433
- },
1434
- formatChildData(data) {
1435
- data.forEach((item, index) => {
1436
- if (item.children && item.children.length > 0) {
1437
- return this.formatChildData(item.children);
1438
- } else {
1439
- delete item.children;
1440
- }
1441
- });
1442
- return data;
1443
- },
1444
-
1445
- // 设备分类
1446
- async getEquipmentList(val, item, indexs) {
1447
- const res = await getEquipmentList({});
1448
- if (res.data.code == 200) {
1449
- this.equipment = res.data.data.map(item => ({
1450
- text: item.name,
1451
- value: item.no
1452
- }));
1453
- }
1454
- },
1455
- // 设备类型
1456
- async getEquipmentType(val, item, indexs, flg) {
1457
- let value = [];
1458
- const key = item.content.link;
1459
- if (!flg) {
1460
- const name = this.equipment.filter(i => i.value == val);
1461
- this.value[indexs][item.content.field + "Str"] = name[0]
1462
- ? name[0].text
1463
- : "";
1464
- this.value[indexs].equipClassify = "";
1465
- this.value[indexs].equipClassifyStr = "";
1466
- this.$emit("input", this.value);
1467
- }
1468
- const res = await getEquipmentList({ categoryNo: val }, indexs);
1469
- if (res.data.code == 200) {
1470
- value = res.data.data.map(item => ({
1471
- text: item.name,
1472
- value: item.no
1473
- }));
1474
- }
1475
- this.$set(this.muster[key], indexs, value);
1476
- },
1477
- // 获取单位
1478
- async getUnitList() {
1479
- const res = await getUnitListData();
1480
- if (res.data.code == 0) {
1481
- res.data.data = res.data.data.map(item => ({
1482
- text: item.name,
1483
- value: item.id
1484
- }));
1485
- this.unitList = res.data.data;
1486
- }
1487
- },
1488
-
1489
- init() {
1490
- if (this.desc.types == "goods") {
1491
- this.getGooodsType();
1492
- this.getUnitList();
1493
- } else if (this.desc.types == "Mechanics") {
1494
- this.getMachineryList();
1495
- } else if (this.desc.types == "team") {
1496
- this.getTeamEngineeringMajor();
1497
- this.getTeamLocation();
1498
- } else if (this.desc.types == "bidding") {
1499
- this.getBiddingProject();
1500
- } else if (this.desc.types == "equipment") {
1501
- this.getEquipmentList();
1502
- } else if (this.desc.types == "houses") {
1503
- this.getHouse();
1504
- } else if (this.desc.types == "cars") {
1505
- this.initCarInfo();
1506
- }
1507
- }
1508
- },
1509
- created() {
1510
- const vm = this;
1511
- !vm.edit && vm.init();
1512
-
1513
- setTimeout(() => {
1514
- if (vm.value.length == 0) {
1515
- vm.addValue();
1516
- } else {
1517
- vm.value.forEach((item, index) => {
1518
- if (vm.desc.types == "goods") {
1519
- const content = vm.columns.filter(item => item.prop == "goodType");
1520
- const content2 = vm.columns.filter(item => item.prop == "goodType");
1521
- content.length > 0 &&
1522
- vm.getGooodsBrand(item.goodType, content[0], index, true);
1523
- vm.propertyList.length >= 0 &&
1524
- item.goodType.length > 0 &&
1525
- vm.getGooodsProperty(item.goodType, content[0], index, true);
1526
- } else if (vm.desc.types == "Mechanics") {
1527
- const content = vm.columns.filter(item => item.prop == "Mechanics");
1528
- content.length > 0 &&
1529
- vm.getMachineryType(item.Mechanics, content[0], index, true);
1530
- } else if (vm.desc.types == "equipment") {
1531
- const content = vm.columns.filter(item => item.prop == "equipment");
1532
- content.length > 0 &&
1533
- vm.getEquipmentType(item.equipment, content[0], index, true);
1534
- } else if (vm.desc.types == "houses") {
1535
- const content = vm.columns.filter(
1536
- item => item.prop == "houseType2"
1537
- );
1538
- content.length > 0 &&
1539
- vm.getHouseType2(item.houseType, content[0], index);
1540
- } else if (vm.desc.types == "cars") {
1541
- item.carBrand.length > 0 &&
1542
- vm.getSeriesSelect(item.carBrand, null, index);
1543
- item.carSeating.length > 0 &&
1544
- vm.getSeatSelect(item.carBrand, null, index);
1545
- }
1546
- });
1547
- }
1548
- }, 1000);
1549
- },
1550
- mounted() {},
1551
- watch: {
1552
- value: {
1553
- handler(nv, ov) {
1554
- const vm = this;
1555
- if (vm.desc.types == "goods") {
1556
- nv.map((e, i) => {
1557
- // return {
1558
- // Price: e.Price,
1559
- // amount: e.amount,
1560
- // brand: e.brand,
1561
- // goodType: e.goodType,
1562
- // total: e.Price * e.amount,
1563
- // unit: e.unit,
1564
- // unitStr: e.unitStr
1565
- // }
1566
- if (!vm.edit && e.Price * e.amount != 0) {
1567
- vm.$set(vm.value[i], "total", e.Price * e.amount);
1568
- }
1569
- vm.$set(vm.value[i], "scck", "市场参考:");
1570
- });
1571
- }
1572
- },
1573
- deep: true
1574
- },
1575
- propertyList: {
1576
- handler(nv, ov) {
1577
- const _this = this;
1578
-
1579
- _.find(_this.computedValue, function(o, i) {
1580
- const obj = {};
1581
- for (const key in o) {
1582
- // if (o.hasOwnProperty.call(o, key)) {
1583
-
1584
- if (_this.propertyList.length > 0 && _this.flag == "dialog") {
1585
- obj[key] = o[key];
1586
- if (
1587
- !_.find(_this.columnsValue, function(o) {
1588
- return o.type == "conunt";
1589
- })
1590
- ) {
1591
- // _this.$nextTick(function() {
1592
- // console.log(vm.$el.textContent); // 可以得到'changed'
1593
- // });
1594
- // _this.tableConfig.push({
1595
- // label: "规格属性",
1596
- // prop: "key_conunt",
1597
- // type: "conunt"
1598
- // });
1599
- }
1600
- }
1601
- // }
1602
- }
1603
- _this.$set(_this.tableCustomArr, i, obj);
1604
- });
1605
- },
1606
- deep: true
1607
- }
1608
- // columns1: {
1609
- // handler(nv, ov) {
1610
- // const _this = this;
1611
- // const obj = {};
1612
- // const newNv = _.cloneDeep(nv);
1613
-
1614
- // // _this.$set(this, "columns1", newNv)
1615
- // },
1616
- // immediate: true,
1617
- // deep: true
1618
- // }
1619
- }
1620
- };
1621
- </script>
1622
- <style lang="scss" scoped>
1623
- .handle {
1624
- display: flex;
1625
- justify-content: center;
1626
- align-items: center;
1627
- }
1628
- /deep/ .eleFormTextarea textarea {
1629
- height: 40px !important;
1630
- min-height: 40px !important;
1631
- }
1632
- /deep/ .el-textarea {
1633
- // padding-top: 30px;
1634
- }
1635
- .isSummary {
1636
- z-index: 2004;
1637
- cursor: pointer;
1638
-
1639
- // position: absolute;
1640
- // left: -12px;
1641
- // top: 50%;
1642
- // transform: translateY(-50%);
1643
- }
1644
- .wrapper {
1645
- overflow-x: auto;
1646
- .tables {
1647
- margin-top: 20px;
1648
- border-left: 1px solid #ebeef5;
1649
- }
1650
- .tables-sub {
1651
- display: flex;
1652
- // border-top: 1px solid #ebeef5;
1653
- // border-bottom: 1px solid #ebeef5;
1654
-
1655
- .disoption {
1656
- &:after {
1657
- content: " ";
1658
- display: block;
1659
- left: 0;
1660
- top: 0;
1661
- right: 0;
1662
- bottom: 0;
1663
- position: absolute;
1664
- z-index: 2;
1665
- cursor: move;
1666
- }
1667
- }
1668
- .el-icon-remove-outline {
1669
- font-size: 26px;
1670
- }
1671
- .parts {
1672
- position: relative;
1673
- border-right: 1px solid #ebeef5;
1674
- text-align: center;
1675
- &:nth-child(1) {
1676
- min-width: 50px;
1677
- }
1678
- .heard {
1679
- border-bottom: 1px solid #ebeef5;
1680
- font-weight: 500;
1681
- height: 40px;
1682
- overflow: hidden;
1683
- /*文本不会换行*/
1684
- white-space: nowrap;
1685
- /*当文本溢出包含元素时,以省略号表示超出的文本*/
1686
- text-overflow: ellipsis;
1687
- }
1688
- .botom {
1689
- box-sizing: border-box;
1690
- padding: 10px 10px 10px 20px;
1691
- min-height: 50px;
1692
- position: relative;
1693
- // top: 50%;
1694
- // transform: translateY(-79%);
1695
- }
1696
- }
1697
- }
1698
- .msg {
1699
- min-width: 200px;
1700
- display: flex;
1701
- align-items: center;
1702
- justify-content: center;
1703
- border: 1px solid #ebeef5;
1704
- border-top: 0;
1705
- border-bottom: 0;
1706
- }
1707
- .form-item-active {
1708
- border: 1px dashed #409eff !important;
1709
- background-color: rgba(2, 134, 223, 0.06) !important;
1710
- position: relative;
1711
- }
1712
- /deep/ .el-icon-delete {
1713
- font-size: 17px !important;
1714
- }
1715
- /deep/ .el-icon-document-copy {
1716
- font-size: 17px !important;
1717
- }
1718
- .form-item-delete-btn {
1719
- background-color: #ff0000;
1720
- border-color: #ff0000;
1721
- height: 30px;
1722
- width: 30px;
1723
- border-radius: 100% !important;
1724
- position: absolute;
1725
- right: 10px;
1726
- top: -15px;
1727
- z-index: 3;
1728
- padding: 4px 6px;
1729
- }
1730
- .form-item-copy-btn {
1731
- position: absolute;
1732
- height: 30px;
1733
- width: 30px;
1734
- border-radius: 100% !important;
1735
- right: 37px;
1736
- top: -15px;
1737
- z-index: 3;
1738
- margin-right: 10px;
1739
- padding: 4px 6px;
1740
- }
1741
- /deep/ .el-form-item {
1742
- // margin: 20px !important;
1743
- }
1744
-
1745
- /deep/ .botom .el-form-item__content > div {
1746
- display: flex;
1747
- .el-radio {
1748
- margin-right: 30px !important;
1749
- }
1750
- .el-checkbox {
1751
- margin-right: 30px !important;
1752
- }
1753
- }
1754
- /deep/ .botom .el-form-item__content {
1755
- min-width: 150px;
1756
- }
1757
- }
1758
- </style>
1
+ <template>
2
+ <div class="wrapper">
3
+ <div class="opt">
4
+ <!-- <span>字表</span> -->
5
+ <el-button
6
+ v-if="!edit"
7
+ @click="addValue"
8
+ >添加</el-button>
9
+ </div>
10
+ <div class="tables">
11
+ <el-tooltip
12
+ content="从左侧拖拽来添加字段"
13
+ placement="top"
14
+ :disabled="!edit"
15
+ >
16
+ <div
17
+ class="tables-sub"
18
+ v-if="columns.length > 0"
19
+ >
20
+ <draggable
21
+ v-if="!tableChange "
22
+ :animation="200"
23
+ :disabled="!edit"
24
+ :list="columns1"
25
+ @add="handleAdd"
26
+ @end="handleMoveEnd"
27
+ @start="handleMoveStart"
28
+ :group="{ name: 'form', pull: false, put: true}"
29
+ style="display: flex; border-top: 1px solid #ebeef5;
30
+ border-bottom: 1px solid #ebeef5;"
31
+ filter='.nodraggable'
32
+ >
33
+ <!-- <draggable
34
+ v-if="( (desc.type =='custom-table' &&!desc.types) || $route.name=='index') || (flag !=='dialog' && desc.types !='goods') "
35
+ :animation="200"
36
+ :disabled="!edit"
37
+ :list="columns"
38
+ @add="handleAdd"
39
+ @end="handleMoveEnd"
40
+ @start="handleMoveStart"
41
+ :group="{ name: 'form', pull: false, put: true}"
42
+ style="display: flex; border-top: 1px solid #ebeef5;
43
+ border-bottom: 1px solid #ebeef5;"
44
+ filter='.nodraggable'
45
+ > -->
46
+ <div
47
+ class="parts"
48
+ :class="{'nodraggable' : item.type == 'index', 'form-item-active': (selSubIndex == index && edit && list[activeFormName][selectIndex].field == desc.field),'disoption': edit}"
49
+ :style="{width: item.type == 'index' ? '50px' : '300px'}"
50
+ v-for="(item,index) in columns1"
51
+ :key="index+1"
52
+ @click.stop="handleFormItemClick(item,index)"
53
+ >
54
+
55
+ <div>
56
+ <div class="heard isSummary">{{item.content ? item.content.label : item.label}}
57
+ <el-tooltip
58
+ v-if='item.content?item.content.attrs.summary:false'
59
+ class="item isSummary"
60
+ effect="dark"
61
+ :content="item.content.attrs.summary "
62
+ placement="top"
63
+ >
64
+ <i class="el-icon-warning-outline isSummary"></i>
65
+ </el-tooltip>
66
+ </div>
67
+ <div
68
+ class="botom handle"
69
+ v-for="(val,indexs) in computedValue"
70
+ @click.stop="handleFormCusClick(val,indexs)"
71
+ :key="indexs"
72
+ >
73
+ <template v-if="item.content">
74
+ <el-form-item :required="item.content._attrs.required ? true : false">
75
+ <component
76
+ v-if="item.content.type =='ele-form-textarea'"
77
+ :desc="item.content"
78
+ :is="item.content.type"
79
+ v-bind="getAttrs(item.content)"
80
+ v-model="val[item.prop]"
81
+ v-on="item.content.on"
82
+ :autosize="{ minRows: 1, maxRows: 1}"
83
+ :rows='1'
84
+ :class="'eleFormTextarea'"
85
+ :ref="item.prop+indexs"
86
+ >
87
+
88
+ </component>
89
+ <component
90
+ v-else-if="item.content.type !='ele-form-select' "
91
+ :desc="item.content"
92
+ :is="item.content.type"
93
+ :options="setItemOption(item,index,indexs)"
94
+ v-bind="getAttrs(item.content)"
95
+ v-model="val[item.prop]"
96
+ v-on="item.content.on"
97
+ @click="setIndex(index)"
98
+ :class="'indexs_' + indexs+'_' + item.prop"
99
+ :ref="item.prop+indexs"
100
+ >
101
+ </component>
102
+ <component
103
+ v-else-if="item.content.type =='ele-form-select' && desc.types "
104
+ :desc="item.content"
105
+ :is="item.content.type"
106
+ :options="setItemOption(item,index,indexs)"
107
+ v-bind="getAttrs(item.content)"
108
+ v-model="val[item.prop]"
109
+ v-on="item.content.on"
110
+ @click="setIndex(index)"
111
+ :class="'indexs_' + indexs+'_' + item.prop"
112
+ :ref="item.prop+indexs"
113
+ >
114
+ </component>
115
+ <el-select
116
+ v-model="val[item.prop]"
117
+ :placeholder="'请选择'+item.content.label"
118
+ @click="setIndex(index)"
119
+ :multiple="item.content.attrs.multiple"
120
+ :ref="item.prop+indexs"
121
+ v-else-if="!desc.types"
122
+ >
123
+ <el-option
124
+ v-for="item2 in item.content.options"
125
+ :key="item2.value"
126
+ :label="item2.text"
127
+ :value="item2.value"
128
+ >
129
+ </el-option>
130
+ </el-select>
131
+ </el-form-item>
132
+ </template>
133
+ <template v-else-if="!item.content&&item._attrs">
134
+ <el-form-item :required="item._attrs.required ? true : false">
135
+ <component
136
+ v-if="item.type =='ele-form-textarea'"
137
+ :desc="item"
138
+ :is="item.type"
139
+ v-bind="getAttrs(item)"
140
+ v-model="val[item.field]"
141
+ v-on="item.on"
142
+ :autosize="{ minRows: 1, maxRows: 1}"
143
+ :rows='1'
144
+ :class="'eleFormTextarea'"
145
+ :ref="item.field+indexs"
146
+ >
147
+
148
+ </component>
149
+ <component
150
+ v-else-if="item.type !='ele-form-select' "
151
+ :desc="item"
152
+ :is="item.type"
153
+ :options="setItemOption(item,index,indexs)"
154
+ v-bind="getAttrs(item)"
155
+ v-model="val[item.field]"
156
+ v-on="item.on"
157
+ @click="setIndex(index)"
158
+ :class="'indexs_' + indexs+'_' + item.field"
159
+ :ref="item.field+indexs"
160
+ >
161
+ </component>
162
+ <!-- <component
163
+ v-else-if="item.type =='ele-form-select' && desc.types "
164
+ :desc="item"
165
+ :is="item.type"
166
+ :options="setItemOption(item,index,indexs)"
167
+ v-bind="getAttrs(item)"
168
+ v-model="val[item.prop]"
169
+ v-on="item.on"
170
+ @click="setIndex(index)"
171
+ :class="'indexs_' + indexs+'_' + item.prop"
172
+ :ref="item.prop+indexs"
173
+ >
174
+ </component> -->
175
+ <el-select
176
+ v-model="val[item.field]"
177
+ :placeholder="'请选择'+item.label"
178
+ @click="setIndex(index)"
179
+ :multiple="item.attrs.multiple"
180
+ :ref="item.field+indexs"
181
+ v-else-if="item.type =='ele-form-select' && !desc.types"
182
+ >
183
+ <el-option
184
+ v-for="item2 in item.options"
185
+ :key="item2.value"
186
+ :label="item2.text"
187
+ :value="item2.value"
188
+ >
189
+ </el-option>
190
+ </el-select>
191
+ </el-form-item>
192
+ </template>
193
+ <template v-else>
194
+ <span>{{setValue(item.prop,indexs)}}</span>
195
+ </template>
196
+ </div>
197
+ </div>
198
+
199
+ <!-- 复制按钮 -->
200
+ <el-button
201
+ @click.stop="handleCopy(index)"
202
+ class="form-item-copy-btn"
203
+ icon="el-icon-document-copy"
204
+ size="mini"
205
+ style="border-radius: 0"
206
+ type="primary"
207
+ v-if="selSubIndex === index && edit && list[activeFormName][selectIndex].field == desc.field && !list[activeFormName][selectIndex].attrs.columns[selSubIndex].isFixed"
208
+ ></el-button>
209
+ <!-- 删除按钮 -->
210
+ <el-button
211
+ @click.stop="handleDelete(index)"
212
+ class="form-item-delete-btn"
213
+ icon="el-icon-delete"
214
+ size="mini"
215
+ style="border-radius: 0"
216
+ type="primary"
217
+ v-if="selSubIndex === index && edit && list[activeFormName][selectIndex].field == desc.field && !list[activeFormName][selectIndex].attrs.columns[selSubIndex].isFixed"
218
+ ></el-button>
219
+ </div>
220
+ <!-- TODO: 多选后如果有自定义选项 则渲染在选择项后方 -->
221
+ <template v-for="(item,indexs) in columnsValue">
222
+ <div
223
+ class="parts"
224
+ v-if="propertyList[indexs] && propertyList[indexs].length "
225
+ @click.stop="handleFormItemClick(item,j)"
226
+ :key="'pro'+indexs"
227
+ >
228
+ <div class="heard isSummary">
229
+ 规格属性
230
+ <!-- {{pro.name ? pro.name : pro.name}} -->
231
+ </div>
232
+
233
+ <div
234
+ v-for="(pro,j) in propertyList[indexs]"
235
+ :key='j'
236
+ >
237
+ <div
238
+ class="botom handle"
239
+ @click.stop="handleFormCusClick(item,indexs)"
240
+ :key="indexs"
241
+ >
242
+ <component
243
+ :desc="{label: pro.name,on: {'change': (val)=>{setProStr(item,pro,indexs,val)}}}"
244
+ :is="pro.key == 0 ? 'ele-form-input' : 'ele-form-select'"
245
+ :options="propertyList[indexs][j].data"
246
+ v-model="item['pro-'+pro.propertyId]"
247
+ >
248
+ </component>
249
+ </div>
250
+ </div>
251
+ <!-- <span
252
+ style="padding-left: 4px; word-break: keep-all;"
253
+ v-if="pro.unit"
254
+ >{{pro.unit}}</span> -->
255
+
256
+ </div>
257
+ </template>
258
+ <div
259
+ v-if="!edit"
260
+ class="parts"
261
+ >
262
+ <div class="heard">操作</div>
263
+ <div
264
+ class="botom handle"
265
+ v-for="(item,index) in computedValue"
266
+ :key="index"
267
+ >
268
+ <el-button
269
+ type="text"
270
+ @click="deteleVal(index)"
271
+ >删除</el-button>
272
+ </div>
273
+ </div>
274
+ </draggable>
275
+
276
+ <el-table
277
+ v-if="tableChange"
278
+ class="cusTable"
279
+ max-height="500"
280
+ :data="computedValue"
281
+ border
282
+ >
283
+ <!-- <el-table
284
+ v-if="(flag=='dialog'&&desc.types == 'goods') || ($route.name=='formGeneration'&&desc.types == 'goods')"
285
+ class="cusTable"
286
+ max-height="500"
287
+ :data="computedValue"
288
+ border
289
+ > -->
290
+
291
+ <template slot="empty">
292
+ <base-empty-data />
293
+ </template>
294
+
295
+ <el-table-column
296
+ align="center"
297
+ v-for="(item, index) in columns1"
298
+ :key="index"
299
+ :prop="item.prop"
300
+ :width="item.type=='index'?50: item.label!='规格属性'?'200%':'250%'"
301
+ :label="item.content?item.content.label:item.label"
302
+ >
303
+ <template slot-scope="scope">
304
+ <template v-if="item.type == 'conunt'">
305
+ <div v-if="propertyList[scope.$index] && propertyList[scope.$index].length>0">
306
+ <el-form-item
307
+ v-for="(pro,j) in propertyList[scope.$index]"
308
+ :label="pro.name"
309
+ :key='j'
310
+ >
311
+ <component
312
+ :desc="{label: pro.name,on: {'change': (val)=>{setProStr(item,pro,scope.$index,val)}}}"
313
+ :is="pro.key == 0 ? 'ele-form-input' : 'ele-form-select'"
314
+ :options="propertyList[scope.$index][j].data"
315
+ v-model="scope.row['pro-'+pro.propertyId]"
316
+ >
317
+ </component>
318
+ </el-form-item>
319
+ </div>
320
+
321
+ <div v-else>无</div>
322
+ </template>
323
+ <template v-else-if="item.content">
324
+ <el-form-item>
325
+ <component
326
+ v-if="item.content.type =='ele-form-textarea'"
327
+ :desc="item.content"
328
+ :is="item.content.type"
329
+ v-bind="getAttrs(item.content)"
330
+ v-model="scope.row[item.prop]"
331
+ v-on="item.content.on"
332
+ :autosize="{ minRows: 1, maxRows: 1}"
333
+ :rows='1'
334
+ :class="'eleFormTextarea'"
335
+ :ref="item.prop+scope.$index"
336
+ >
337
+
338
+ </component>
339
+ <component
340
+ v-else-if="item.content.type !='ele-form-select' "
341
+ :desc="item.content"
342
+ :is="item.content.type"
343
+ :options="setItemOption(item,index,scope.$index)"
344
+ v-bind="getAttrs(item.content)"
345
+ v-model="scope.row[item.prop]"
346
+ v-on="item.content.on"
347
+ @click="setIndex(index)"
348
+ :class="'indexs_' + scope.$index+'_' + item.prop"
349
+ :ref="item.prop+scope.$index"
350
+ >
351
+ </component>
352
+ <component
353
+ v-else-if="item.content.type =='ele-form-select' && desc.types "
354
+ :desc="item.content"
355
+ :is="item.content.type"
356
+ :options="setItemOption(item,index,scope.$index)"
357
+ v-bind="getAttrs(item.content)"
358
+ v-model="scope.row[item.prop]"
359
+ v-on="item.content.on"
360
+ @click="setIndex(index)"
361
+ :class="'indexs_' + scope.$index+'_' + item.prop"
362
+ :ref="item.prop+scope.$index"
363
+ >
364
+ </component>
365
+ <el-select
366
+ v-model="scope.row[item.prop]"
367
+ :placeholder="'请选择'+item.content.label"
368
+ @click="setIndex(index)"
369
+ :multiple="item.content.attrs.multiple"
370
+ :ref="item.prop+scope.$index"
371
+ v-else-if="!desc.types"
372
+ >
373
+ <el-option
374
+ v-for="item2 in item.content.options"
375
+ :key="item2.value"
376
+ :label="item2.text"
377
+ :value="item2.value"
378
+ >
379
+ </el-option>
380
+ </el-select>
381
+ </el-form-item>
382
+ </template>
383
+ <template v-else-if="!item.content&&item._attrs">
384
+ <el-form-item>
385
+ <component
386
+ v-if="item.type =='ele-form-textarea'"
387
+ :desc="item"
388
+ :is="item.type"
389
+ v-model="val[item.field]"
390
+ v-on="item.on"
391
+ v-bind="getAttrs(item.content)"
392
+ :autosize="{ minRows: 1, maxRows: 1}"
393
+ :rows='1'
394
+ :class="'eleFormTextarea'"
395
+ :ref="item.field+indexs"
396
+ >
397
+
398
+ </component>
399
+ <component
400
+ v-else-if="item.type !='ele-form-select' "
401
+ :desc="item"
402
+ :is="item.type"
403
+ :options="setItemOption(item,index,scope.$index)"
404
+ v-model="val[item.field]"
405
+ v-bind="getAttrs(item.content)"
406
+ v-on="item.on"
407
+ @click="setIndex(index)"
408
+ :class="'indexs_' + scope.$index+'_' + item.field"
409
+ :ref="item.field+scope.$index"
410
+ >
411
+ </component>
412
+ <!-- <component
413
+ v-else-if="item.type =='ele-form-select' && desc.types "
414
+ :desc="item"
415
+ :is="item.type"
416
+ v-bind="getAttrs(item)"
417
+ v-model="val[item.prop]"
418
+ v-on="item.on"
419
+ @click="setIndex(index)"
420
+ :class="'indexs_' + scope.$index+'_' + item.prop"
421
+ :ref="item.prop+scope.$index"
422
+ >
423
+ </component> -->
424
+ <el-select
425
+ v-model="val[item.field]"
426
+ :placeholder="'请选择'+item.label"
427
+ @click="setIndex(index)"
428
+ :multiple="item.attrs.multiple"
429
+ :ref="item.field+scope.$index"
430
+ v-else-if="item.type =='ele-form-select'&&!desc.types"
431
+ >
432
+ <el-option
433
+ v-for="item2 in item.options"
434
+ :key="item2.value"
435
+ :label="item2.text"
436
+ :value="item2.value"
437
+ >
438
+ </el-option>
439
+ </el-select>
440
+ </el-form-item>
441
+ </template>
442
+ <template v-else>
443
+ <span>{{setValue(item.prop,scope.$index)}}</span>
444
+ </template>
445
+ </template>
446
+
447
+ </el-table-column>
448
+ <el-table-column
449
+ v-if="computedValue.length>1"
450
+ header-align="center"
451
+ align="center"
452
+ prop="prop"
453
+ label="操作"
454
+ >
455
+ <template slot-scope="scope">
456
+ <el-button
457
+ type="text"
458
+ @click="deteleVal(scope.$index)"
459
+ >删除</el-button>
460
+ </template>
461
+
462
+ </el-table-column>
463
+
464
+ </el-table>
465
+
466
+ <!-- <div
467
+ class="msg nodraggable"
468
+ v-if="edit"
469
+ >从左侧拖拽来添加字段</div> -->
470
+ </div>
471
+ </el-tooltip>
472
+ </div>
473
+ </div>
474
+ </template>
475
+
476
+ <script>
477
+ import request from "@/http";
478
+ import * as _ from "lodash";
479
+ import OptionSlot from "./optionSolt";
480
+ import postman from "../components/postman";
481
+ import handleCode from "../components/handleCode";
482
+ import linkForm from "../components/linkForm";
483
+ // import draggable from "vuedraggable";
484
+ import { mapGetters, mapMutations, mapState } from "vuex";
485
+ import {
486
+ getGooodsType,
487
+ getGooodsBrand,
488
+ getMachineryList,
489
+ getMachineryType,
490
+ getEquipmentList,
491
+ getUnitListData,
492
+ getGooodsProperty,
493
+ concreteStrongAll,
494
+ concreteAdmixtureAll,
495
+ getMechanicsAttr,
496
+ getEquipProp,
497
+ modelSelect,
498
+ brandSelect,
499
+ getSeriesSelect,
500
+ getSeatSelect,
501
+ gearboxSelect,
502
+ gethouseType,
503
+ getTeamCategory,
504
+ getTeamEngineeringMajor,
505
+ getTeamLocation
506
+ } from "@/formBuilder/apiBusiness.js";
507
+ import {
508
+ carSeating,
509
+ driveModel,
510
+ carYear
511
+ } from "@/formBuilder/component/components/data.js";
512
+ const draggable = () => ({
513
+ // 需要加载的组件 (应该是一个 `Promise` 对象)
514
+ component: import("vuedraggable"),
515
+ // 异步组件加载时使用的组件
516
+ loading: "",
517
+ // 加载失败时使用的组件
518
+ error: "",
519
+ // 展示加载时组件的延时时间。默认值是 200 (毫秒)
520
+ delay: 200,
521
+ // 如果提供了超时时间且组件加载也超时了,
522
+ // 则使用加载失败时使用的组件。默认值是:`Infinity`
523
+ timeout: 3000
524
+ });
525
+ export default {
526
+ name: "CustomTable",
527
+ extends: {},
528
+ components: {
529
+ OptionSlot,
530
+ draggable,
531
+ postman,
532
+ handleCode,
533
+ linkForm
534
+ },
535
+ props: {
536
+ value: {
537
+ type: Array,
538
+ default: () => []
539
+ },
540
+ flag: {
541
+ type: String,
542
+ default: ""
543
+ },
544
+ columns: {
545
+ type: Array,
546
+ default: () => []
547
+ },
548
+ desc: {
549
+ type: Object,
550
+ default: () => {
551
+ return {};
552
+ }
553
+ },
554
+ edit: {
555
+ type: Boolean,
556
+ default: () => false
557
+ }
558
+ },
559
+ data() {
560
+ return {
561
+ tableCustomArr: [],
562
+ optionTypes: {
563
+ "ele-form-select": {
564
+ type: "el-option",
565
+ text: "label",
566
+ value: "value"
567
+ },
568
+ "ele-form-checkbox": {
569
+ type: "el-checkbox",
570
+ text: "content",
571
+ value: "label"
572
+ },
573
+ "ele-form-radio": {
574
+ type: "el-radio",
575
+ text: "content",
576
+ value: "label"
577
+ }
578
+ },
579
+ goodsOption: [],
580
+ Mechanics: [],
581
+ equipment: [],
582
+ team: [],
583
+ EngineeringMajorOption: [],
584
+ addressOption: [],
585
+ bidding: [],
586
+ biddingType: [
587
+ { text: "商品/材料", value: "3" },
588
+ { text: "工程分包", value: "4" },
589
+ { text: "机械设备租赁", value: "1" },
590
+ { text: "劳务", value: "2" }
591
+ ],
592
+ // 自定义属性
593
+ muster: {
594
+ brand: []
595
+ },
596
+ unitList: [],
597
+ propertyList: [],
598
+ strength: [],
599
+ admixture: [],
600
+ // 车辆信息
601
+ carModel: [],
602
+ carBrand: [],
603
+ carGearbox: [],
604
+ carSeries: [],
605
+ carSeating: carSeating,
606
+ driveModel: driveModel,
607
+ carYear: carYear(),
608
+ houseType: [],
609
+ houseType2: [],
610
+ category: []
611
+ // columnsValue: _.cloneDeep(this.columns)
612
+ // columns1: _.cloneDeep(this.columns)
613
+ };
614
+ },
615
+ computed: {
616
+ ...mapState(["selSubIndex", "activeFormName", "list", "selectIndex"]),
617
+ ...mapGetters(["currentFormItem"]),
618
+ computedValue: function() {
619
+ if (this.value.length > 0) {
620
+ return this.value;
621
+ } else {
622
+ const type = [
623
+ "checkbox",
624
+ "datetimerange",
625
+ "cascader",
626
+ "postman",
627
+ "handleCode"
628
+ ];
629
+ const arr = {};
630
+ const arr1 = _.cloneDeep(this.columns1);
631
+ arr1.forEach(item => {
632
+ if (item.type != "index") {
633
+ if (item.prop && item.prop != "key_conunt") {
634
+ const typeStr = item.content.type.replace("ele-form-", "");
635
+ arr[item.prop] = type.indexOf(typeStr) > -1 ? [] : "";
636
+ }
637
+ }
638
+ });
639
+ return [arr];
640
+ }
641
+ },
642
+ tableChange: function() {
643
+ if (this.desc.types == "goods" && this.$route.name == "formGeneration") {
644
+ return true;
645
+ } else if (this.desc.types == "goods" && this.flag == "dialog") {
646
+ return true;
647
+ } else {
648
+ return false;
649
+ }
650
+ },
651
+ columns1: {
652
+ set: function(newV) {},
653
+ get: function() {
654
+ const res = _.cloneDeep(this.columns);
655
+ res.forEach((e, i) => {
656
+ if (e.type != "index" && e.content) {
657
+ e.content._attrs = e.content.attrs;
658
+ } else if (e.attrs) {
659
+ e._attrs = e.attrs;
660
+ }
661
+ });
662
+ if (
663
+ (this.flag == "dialog" && this.desc.types == "goods") ||
664
+ (this.$route.name == "formGeneration" && this.desc.types == "goods")
665
+ ) {
666
+ res.splice(2, 0, {
667
+ label: "规格属性",
668
+ prop: "key_conunt",
669
+ type: "conunt",
670
+ width: "200%"
671
+ });
672
+ }
673
+ return res;
674
+ }
675
+ },
676
+ columnsValue() {
677
+ return _.cloneDeep(this.columns);
678
+ }
679
+ },
680
+ methods: {
681
+ ...mapMutations([
682
+ "updateSelSubIndex",
683
+ "updateSelectIndex",
684
+ "updateList",
685
+ "updateCusIndex"
686
+ ]),
687
+ handleFormCusClick(v, i) {
688
+ // this.$store.state.curCusTableIndex = i
689
+ this.updateCusIndex(i);
690
+ },
691
+ setProStr(val, pro, j, valNum) {
692
+ if (!val) return;
693
+ const name =
694
+ pro.key == 1 && pro.data.length > 0
695
+ ? pro.data.filter(item => item.value == valNum)[0].text
696
+ : val;
697
+ this.value[j]["pro-" + pro.propertyId + "-Str"] = {
698
+ value: name,
699
+ property: pro.name,
700
+ unit: pro.unit
701
+ };
702
+ this.$emit("input", this.value);
703
+ },
704
+ setIndex(index) {
705
+ this.$store.state.curCusTableIndex = index - 1;
706
+ },
707
+ setValue(prop, index) {
708
+ if (prop) {
709
+ const val = this.value.filter(item => item[prop]);
710
+ return val[0][prop];
711
+ } else {
712
+ return index + 1;
713
+ }
714
+ },
715
+ getAttrs(item) {
716
+ return Object.assign({}, item.attrs);
717
+ },
718
+ // option设置
719
+ setItemOption(item, index, indexs) {
720
+ const arr = [];
721
+ const vm = this;
722
+
723
+ if (!item.content.options) return [];
724
+ if (item.content.field == "leaseType") {
725
+ item.content["on"] = {
726
+ change: newVal => {
727
+ vm.leaseTypeChange(newVal, item, indexs);
728
+ }
729
+ };
730
+ }
731
+
732
+ if (
733
+ item.content.field == "carSeries" ||
734
+ item.content.field == "carSeating"
735
+ ) {
736
+ item.content["on"] = {
737
+ change: newVal => {
738
+ vm.handleCustomChangeOption(newVal, item, indexs);
739
+ }
740
+ };
741
+ return vm[item.content.options][indexs];
742
+ }
743
+ if (
744
+ item.content.field == "unit" ||
745
+ item.content.field == "carGearbox" ||
746
+ item.content.field == "carSeating" ||
747
+ item.content.field == "driveModel" ||
748
+ item.content.field == "carYear"
749
+ ) {
750
+ item.content["on"] = {
751
+ change: newVal => {
752
+ vm.handleCustomChangeOption(newVal, item, indexs);
753
+ }
754
+ };
755
+ return vm[item.content.options];
756
+ }
757
+
758
+ if (item.content.options && typeof item.content.options != "string") {
759
+ return item.content.options;
760
+ } else {
761
+ if (item.content.types) {
762
+ // vm.$nextTick(function() {
763
+ item.content["on"] = {
764
+ change: async newVal => {
765
+ await vm.handleChange(newVal, item, indexs);
766
+ }
767
+ };
768
+ item["on"] = {
769
+ change: async newVal => {
770
+ await vm.handleChange(newVal, item, indexs);
771
+ }
772
+ };
773
+ // });
774
+ return vm[item.content.options];
775
+ } else if (!item.content.types) {
776
+ item.content["on"] = {
777
+ change: newVal => {
778
+ vm.handleChangeOption(newVal, item, indexs);
779
+ }
780
+ };
781
+ const key = item.content.options;
782
+ !this.muster[key] && this.$set(this.muster, key, []);
783
+ !this.muster[key][indexs] && this.$set(this.muster[key], indexs, []);
784
+ return this.muster[key][indexs];
785
+ }
786
+ }
787
+ },
788
+ // 加载车辆选择框信息
789
+ async initCarInfo() {
790
+ const vm = this;
791
+ if (this.carModel.length == 0) {
792
+ const res = await modelSelect();
793
+ this.carModel =
794
+ res.data.code == 200
795
+ ? res.data.data.map((item, index) => ({
796
+ text: item.name,
797
+ value: item.key
798
+ }))
799
+ : [];
800
+ }
801
+ if (this.carBrand.length == 0) {
802
+ const res = await brandSelect();
803
+ this.carBrand =
804
+ res.data.code == 200
805
+ ? res.data.data.map((item, index) => ({
806
+ text: item.name,
807
+ value: item.key
808
+ }))
809
+ : [];
810
+ }
811
+ if (vm.carGearbox.length == 0) {
812
+ const res = await gearboxSelect();
813
+ vm.carGearbox =
814
+ res.data.code == 200
815
+ ? res.data.data.map((item, index) => ({
816
+ text: item.value.toString(),
817
+ value: item.key.toString()
818
+ }))
819
+ : [];
820
+ }
821
+ },
822
+ leaseTypeChange(newVal, item, indexs) {
823
+ if (newVal == 1) {
824
+ this.getMachineryList();
825
+ } else if (newVal == 2) {
826
+ this.getEquipmentList();
827
+ } else if (newVal == 3) {
828
+ this.initCarInfo();
829
+ } else if (newVal == 4) {
830
+ this.getHouse();
831
+ }
832
+ Object.keys(this.value[indexs]).forEach(k => {
833
+ if (k.indexOf("pro-") > -1) {
834
+ delete this.value[indexs][k];
835
+ } else if (k != "leaseType") {
836
+ const type = Array.isArray(this.value[indexs][k]);
837
+ this.value[indexs][k] = type ? [] : "";
838
+ }
839
+ });
840
+ this.$emit("input", this.value);
841
+ },
842
+ // 父级元素数据发生变化
843
+ async handleChange(val, item, indexs) {
844
+ if (item.content.types == "goods") {
845
+ const str = this.goodsOption.filter(k => val[0] && k.id == val[0]);
846
+ if (str[0] && str[0].name == "商砼") {
847
+ this.getConcrete(val, item, indexs);
848
+ } else {
849
+ this.getGooodsBrand(val, item, indexs);
850
+ this.getGooodsProperty(val, item, indexs);
851
+ }
852
+ } else if (item.content.types == "Mechanics") {
853
+ this.getMachineryType(val, item, indexs);
854
+ } else if (item.content.types == "equipment") {
855
+ this.getEquipmentType(val, item, indexs);
856
+ } else if (item.content.types == "team") {
857
+ this.setTeamStr(val, item, indexs);
858
+ } else if (item.content.types == "bidding") {
859
+ this.setBiddingStr(val, item, indexs);
860
+ } else if (item.content.types == "houses") {
861
+ this.setHouseStr(val, item, indexs);
862
+ this.getHouseType2(val, item, indexs);
863
+ } else if (item.content.types == "carBrand") {
864
+ this.setcarBrandStr(val, item, indexs);
865
+ this.getSeriesSelect(val, item, indexs);
866
+ } else if (item.content.types == "cars") {
867
+ this.setcarsStr(val, item, indexs);
868
+ this.getSeatSelect(val, item, indexs);
869
+ }
870
+ },
871
+ setcarBrandStr(val, item, indexs) {
872
+ const name = this.carBrand.filter(i => i.value == val);
873
+ this.value[indexs][item.content.field + "Str"] = name[0]
874
+ ? name[0].text
875
+ : "";
876
+ this.value[indexs]["carSeries" + "Str"] = "";
877
+ this.value[indexs]["carSeries"] = "";
878
+ this.$emit("input", this.value);
879
+ },
880
+ setcarsStr(val, item, indexs) {
881
+ const name = this.carModel.filter(i => i.value == val);
882
+ this.value[indexs][item.content.field + "Str"] = name[0]
883
+ ? name[0].text
884
+ : "";
885
+ this.value[indexs]["carSeating" + "Str"] = "";
886
+ this.value[indexs]["carSeating"] = "";
887
+ this.$emit("input", this.value);
888
+ },
889
+ setHouseStr(val, item, indexs) {
890
+ const name = this.houseType.filter(i => i.value == val);
891
+ this.value[indexs][item.content.field + "Str"] = name[0]
892
+ ? name[0].text
893
+ : "";
894
+ // 清空子集
895
+ if (item.content.link) {
896
+ this.value[indexs][item.content.link + "Str"] = "";
897
+ this.value[indexs][item.content.link] = "";
898
+ }
899
+ this.$emit("input", this.value);
900
+ },
901
+ // 扁平化树形数据
902
+ flatTreeData(tree) {
903
+ const res = [];
904
+ function toflat(tree) {
905
+ tree.forEach(el => {
906
+ res.push(el);
907
+ el.children && el.children.length > 0 ? toflat(el.children) : "";
908
+ });
909
+ }
910
+ toflat(tree);
911
+ return res;
912
+ },
913
+ setTeamStr(val, item, indexs) {
914
+ if (item.content.field == "EngineeringMajor") {
915
+ const name = this.EngineeringMajorOption.filter(i => i.value == val);
916
+ this.value[indexs][item.content.field + "Str"] = name[0]
917
+ ? name[0].text
918
+ : "";
919
+ this.$emit("input", this.value);
920
+ }
921
+ if (item.content.field == "address") {
922
+ const arr = this.flatTreeData(this.addressOption);
923
+ let title = "";
924
+ arr.map(item => {
925
+ val.map(one => {
926
+ if (item.no == one) {
927
+ title += item.name + "/";
928
+ }
929
+ });
930
+ });
931
+ title = title.substring(0, title.length - 1);
932
+ this.value[indexs][item.content.field + "Str"] = title || "";
933
+ this.$emit("input", this.value);
934
+ }
935
+ },
936
+ setBiddingStr(val, item, indexs) {
937
+ const name = this.biddingType.filter(i => i.value == val);
938
+ this.value[indexs][item.content.field + "Str"] = name[0]
939
+ ? name[0].text
940
+ : "";
941
+ this.$emit("input", this.value);
942
+ },
943
+ // 子级元素发生变化
944
+ handleChangeOption(newVal, item, indexs) {
945
+ console.log(newVal, item, indexs);
946
+ const name = this.muster[item.content.options][indexs].filter(
947
+ i => i.value == newVal
948
+ );
949
+ const nameStr = name[0].text;
950
+ const key = item.content.field + "Str";
951
+ this.value[indexs][key] = nameStr;
952
+ this.$emit("input", this.value);
953
+ },
954
+ handleCustomChangeOption(newVal, item, indexs) {
955
+ let name = "";
956
+ const vm = this;
957
+ if (item.content.field == "unit") {
958
+ name = vm.unitList.filter(i => i.value == newVal);
959
+ } else if (item.content.field == "carSeries") {
960
+ name = vm.carSeries[indexs].filter(i => i.value == newVal);
961
+ } else if (item.content.field == "carGearbox") {
962
+ name = vm.carGearbox.filter(i => i.value == newVal);
963
+ } else if (item.content.field == "carSeating") {
964
+ name = vm.carSeating[indexs].filter(i => i.value == newVal);
965
+ } else if (item.content.field == "driveModel") {
966
+ name = vm.driveModel.filter(i => i.value == newVal);
967
+ } else if (item.content.field == "carYear") {
968
+ name = vm.carYear.filter(i => i.value == newVal);
969
+ }
970
+
971
+ const nameStr = name[0].text || name[0].label;
972
+ const key = item.content.field + "Str";
973
+ vm.value[indexs][key] = nameStr;
974
+ vm.$emit("input", vm.value);
975
+ },
976
+
977
+ // 点击选中
978
+ handleFormItemClick(item, index) {
979
+ if (!this.edit) return;
980
+ if (item.type != "index") {
981
+ this.list[this.activeFormName].forEach((i, v) => {
982
+ if (i.field == this.desc.field) {
983
+ this.updateSelectIndex(v);
984
+ }
985
+ });
986
+ this.updateSelSubIndex(index);
987
+ }
988
+ },
989
+ // 复制
990
+ handleCopy(index) {
991
+ const obj = _.cloneDeep(this.columns1[index]);
992
+ obj.field = `key_${Date.now()}`;
993
+ this.columns1.splice(index + 1, 0, obj);
994
+ this.setListColumns(this.columns1);
995
+ this.updateSelSubIndex(index + 1);
996
+ },
997
+ // 删除
998
+ handleDelete(index) {
999
+ this.columns1.splice(index, 1);
1000
+ this.setListColumns(this.columns1);
1001
+ // 如果删除的最后一个, 则重新选择最后一个
1002
+ if (index >= this.columns1.length) {
1003
+ this.updateSelSubIndex(this.columns1.length - 1);
1004
+ } else if (index - 1 < 1 && this.columns1 > 1) {
1005
+ this.updateSelSubIndex(1);
1006
+ } else {
1007
+ this.updateSelSubIndex(null);
1008
+ }
1009
+ },
1010
+ // 新增
1011
+ handleAdd(res) {
1012
+ const vm = this;
1013
+ const type = [
1014
+ "linkForm",
1015
+ "ele-form-select",
1016
+ "checkbox",
1017
+ "datetimerange",
1018
+ "cascader",
1019
+ "postman",
1020
+ "handleCode"
1021
+ ];
1022
+ if (
1023
+ this.columns1[res.newIndex].type.indexOf("custom-table") > -1 ||
1024
+ this.columns1[res.newIndex].type.indexOf("columns") > -1 ||
1025
+ this.columns1[res.newIndex].type.indexOf("quill-editor") > -1 ||
1026
+ this.columns1[res.newIndex].type.indexOf("linkForm") > -1
1027
+ ) {
1028
+ this.$message.error("不支持添加此类型控件,请添加其他类型控件");
1029
+ this.columns1.splice(res.newIndex, 1);
1030
+ return;
1031
+ }
1032
+ const obj = this.columns1[res.newIndex];
1033
+ let content = {};
1034
+ // 如果是单选框 多选框 进入表格 则添加下拉框
1035
+ if (obj.type && (obj.type === "radio" || obj.type === "checkbox")) {
1036
+ if (obj.type === "checkbox") {
1037
+ obj.attrs["multiple"] = true;
1038
+ }
1039
+ obj.type = "ele-form-select";
1040
+ content = obj;
1041
+ vm.columns[res.newIndex] = {
1042
+ prop: obj.field,
1043
+ label: obj.label,
1044
+ isFlex: true,
1045
+ content: content
1046
+ };
1047
+ }
1048
+
1049
+ vm.columns1.map((e, i) => {
1050
+ if (e.field) {
1051
+ e.type = type.indexOf(e.type) > -1 ? e.type : "ele-form-" + e.type;
1052
+ vm.columns1[i] = {
1053
+ prop: e.field,
1054
+ label: e.label,
1055
+ isFlex: true,
1056
+ content: e
1057
+ };
1058
+ }
1059
+ if (e.type === "ele-form-radio" || e.type === "ele-form-checkbox") {
1060
+ if (e.type === "ele-form-checkbox") {
1061
+ e.attrs["multiple"] = true;
1062
+ }
1063
+ e.type = "ele-form-select";
1064
+ }
1065
+ });
1066
+ this.setListColumns(this.columns1);
1067
+ this.list[this.activeFormName].forEach((i, v) => {
1068
+ if (i.field == this.desc.field) {
1069
+ this.updateSelectIndex(v);
1070
+ }
1071
+ });
1072
+ this.updateSelSubIndex(res.newIndex);
1073
+ },
1074
+ // 移动开始
1075
+ handleMoveStart(res) {
1076
+ this.updateSelSubIndex(res.oldIndex);
1077
+ },
1078
+ // 移动结束
1079
+ handleMoveEnd(res) {
1080
+ this.setListColumns(this.columns1);
1081
+ this.updateSelSubIndex(res.newIndex);
1082
+ },
1083
+ setListColumns(columns) {
1084
+ const list = _.cloneDeep(this.list);
1085
+ list[this.activeFormName].forEach(item => {
1086
+ if (item.field == this.desc.field) {
1087
+ item.attrs.columns = columns;
1088
+ }
1089
+ });
1090
+ this.updateList({
1091
+ name: this.activeFormName,
1092
+ newList: list[this.activeFormName]
1093
+ });
1094
+ },
1095
+ addValue() {
1096
+ const type = [
1097
+ "checkbox",
1098
+ "datetimerange",
1099
+ "cascader",
1100
+ "postman",
1101
+ "handleCode"
1102
+ ];
1103
+ const obj = {};
1104
+ this.columns1.forEach(item => {
1105
+ if (item.prop && item.prop != "key_conunt") {
1106
+ const typeStr = item.content.type.replace("ele-form-", "");
1107
+ obj[item.prop] = type.indexOf(typeStr) > -1 ? [] : "";
1108
+ }
1109
+ });
1110
+ this.value.push(obj);
1111
+ this.$emit("input", this.value);
1112
+ },
1113
+ deteleVal(index) {
1114
+ this.value.splice(index, 1);
1115
+ const type = {
1116
+ goods: "brand",
1117
+ Mechanics: "classify",
1118
+ equipment: "equipClassify",
1119
+ houses: "houseType2"
1120
+ };
1121
+ const key = type[this.desc.types];
1122
+ this.muster[key].splice(index, 1);
1123
+ this.$emit("input", this.value);
1124
+ },
1125
+ // 获取团队主营业务
1126
+ async getTeamBusiness() {
1127
+ const res = await getTeamCategory();
1128
+ this.category = res.data && res.data.code == 200 ? res.data.data : [];
1129
+ },
1130
+ // 获取工队工程专业
1131
+ async getTeamEngineeringMajor() {
1132
+ const res = await getTeamEngineeringMajor();
1133
+ if (res.data.code == 200) {
1134
+ res.data.data.map(item => {
1135
+ item["text"] = item.name;
1136
+ item["value"] = item.no;
1137
+ });
1138
+ this.EngineeringMajorOption = res.data.data;
1139
+ }
1140
+ },
1141
+ // 获取工队所在地区
1142
+ async getTeamLocation() {
1143
+ const res = await getTeamLocation();
1144
+ this.addressOption =
1145
+ res.data && res.data.code == 200 ? res.data.data.data : [];
1146
+ console.log("res: ", res.data.data.data);
1147
+ },
1148
+ // 获取机械自定义属性
1149
+ async getClassifyPro(newVal, item, indexs) {
1150
+ Object.keys(this.value[indexs]).forEach(k => {
1151
+ if (k.indexOf("pro-") > -1) {
1152
+ delete this.value[indexs][k];
1153
+ }
1154
+ });
1155
+ const params = {
1156
+ categoryNo:
1157
+ item.prop == "classify"
1158
+ ? this.value[indexs].Mechanics
1159
+ : this.value[indexs].equipment,
1160
+ typeNo: newVal
1161
+ };
1162
+ const res =
1163
+ item.prop == "classify"
1164
+ ? await getMechanicsAttr(params)
1165
+ : await getEquipProp(params);
1166
+ if (res.data.code == 200) {
1167
+ let propertyList = [];
1168
+ if (item.prop == "classify") {
1169
+ propertyList = res.data.data.map((item, index) => {
1170
+ item.data = item.valList.map(i => ({
1171
+ text: i.startVal,
1172
+ value: i.startVal
1173
+ }));
1174
+ item.propertyId = index;
1175
+ return item;
1176
+ });
1177
+ } else {
1178
+ res.data.data.forEach((item, index) => {
1179
+ item.data = item.valList.map(i => ({ text: i.val, value: i.val }));
1180
+ item.propertyId = index;
1181
+ propertyList.push({
1182
+ name: item.name,
1183
+ propertyId: index,
1184
+ data: item.data,
1185
+ unit: item.unit,
1186
+ key: item.attrKey
1187
+ });
1188
+ });
1189
+ }
1190
+ this.$set(this.propertyList, indexs, propertyList);
1191
+ }
1192
+ },
1193
+ // 房产分类
1194
+ async getHouse() {
1195
+ if (this.houseType.length == 0) {
1196
+ const res = await gethouseType({ type: 0 });
1197
+ if (res.data.code == 200) {
1198
+ res.data.data.map(item => {
1199
+ item["text"] = item.categoryName;
1200
+ item["value"] = item.id;
1201
+ });
1202
+ this.houseType = res.data.data;
1203
+ }
1204
+ }
1205
+ },
1206
+ getHouseType2(val, item, indexs) {
1207
+ const key = item.content.link || item.content.options;
1208
+ var Arr = this.houseType.filter(item => item.id == val);
1209
+ if (Arr.length != 0) {
1210
+ this.houseType2 = Arr[0].children.map(item => ({
1211
+ text: item.categoryName,
1212
+ value: item.id
1213
+ }));
1214
+ }
1215
+ this.$set(this.muster[key], indexs, this.houseType2);
1216
+ },
1217
+ async getSeriesSelect(a, b, c) {
1218
+ const vm = this;
1219
+ console.log(a, b, c, vm.value[c].carBrand);
1220
+
1221
+ const res = await getSeriesSelect({
1222
+ brandNo: a
1223
+ });
1224
+
1225
+ if (res.data.code == 200) {
1226
+ const res1 = res.data.data.map((e, i) => {
1227
+ return {
1228
+ text: e.name,
1229
+ value: e.id
1230
+ };
1231
+ });
1232
+ // vm.carSeries.push(res1);
1233
+ this.$set(vm.carSeries, c, res1);
1234
+ }
1235
+ },
1236
+ async getSeatSelect(a, b, c) {
1237
+ const vm = this;
1238
+
1239
+ const res = await getSeatSelect({
1240
+ modelNo: vm.value[c].carModel
1241
+ });
1242
+ if (res.data.code == 200) {
1243
+ var res1 = res.data.data.map((e, i) => {
1244
+ return {
1245
+ text: e.name,
1246
+ value: e.key
1247
+ };
1248
+ });
1249
+ }
1250
+ this.$set(vm.carSeating, c, res1);
1251
+ },
1252
+ // 商品分类
1253
+ async getGooodsType() {
1254
+ const res = await getGooodsType({ type: "purchase" });
1255
+ if (res.status == 200) {
1256
+ this.goodsOption = this.formatChildData(res.data.data);
1257
+ }
1258
+ },
1259
+ // 商品品牌
1260
+ async getGooodsBrand(val, item, indexs, flg) {
1261
+ let value = [];
1262
+ const vm = this;
1263
+ const key = item.content.link;
1264
+ if (!flg) {
1265
+ vm.value[indexs].brand = "";
1266
+ vm.value[indexs].brandStr = "";
1267
+ setTimeout(() => {
1268
+ const text =
1269
+ vm.$refs[item.content.field + indexs][0].$refs.cascader
1270
+ ?.presentText ||
1271
+ vm.$refs[item.content.field + indexs][0].$refs.input.$props.value;
1272
+ vm.value[indexs][item.content.field + "Str"] = text || "";
1273
+ vm.$emit("input", vm.value);
1274
+ }, 100);
1275
+ }
1276
+
1277
+ const data = val[val.length - 1];
1278
+ if (!data) return;
1279
+ const res = await getGooodsBrand(data, indexs);
1280
+ if (res.data.code == 0) {
1281
+ value = res.data.data.reduce(
1282
+ (total, currentValue) => total.concat(currentValue.options),
1283
+ []
1284
+ );
1285
+ value = value.map(i => ({ text: i.brandName, value: i.id }));
1286
+ }
1287
+ vm.$set(vm.muster[key], indexs, value);
1288
+ },
1289
+ // 商品属性
1290
+ async getGooodsProperty(val, item, indexs, flg) {
1291
+ const vm = this;
1292
+ const id = val[val.length - 1];
1293
+ if (!id) return;
1294
+ if (!flg) {
1295
+ Object.keys(this.value[indexs]).forEach(k => {
1296
+ if (k.indexOf("pro-") > -1) {
1297
+ delete this.value[indexs][k];
1298
+ }
1299
+ });
1300
+ this.$emit("input", this.value);
1301
+ }
1302
+ const res = await getGooodsProperty(id, indexs);
1303
+ if (res.data.code == 0) {
1304
+ const list = res.data.data;
1305
+ const propertyList = []; // 商品属性列表
1306
+ for (let i = 0; i < list.length; i++) {
1307
+ if (list[i].itemparamname === "仓储") {
1308
+ continue;
1309
+ }
1310
+ let flag = true;
1311
+ for (let j = 0; j < propertyList.length; j++) {
1312
+ // 去重 合并属性名相同的项
1313
+ if (propertyList[j].name === list[i].itemparamname) {
1314
+ propertyList[j].data.push({
1315
+ text: list[i].valdata,
1316
+ value: list[i].id
1317
+ });
1318
+ flag = false;
1319
+ break;
1320
+ }
1321
+ }
1322
+ if (flag) {
1323
+ // 非重复 添加商品属性和id
1324
+ const obj = {
1325
+ name: list[i].itemparamname,
1326
+ data: [],
1327
+ key: 1
1328
+ };
1329
+ obj.data.push({ text: list[i].valdata, value: list[i].id });
1330
+ obj.propertyId = list[i].itemparamid;
1331
+ propertyList.push(obj);
1332
+ }
1333
+ }
1334
+ vm.$set(vm.propertyList, indexs, propertyList);
1335
+ } else {
1336
+ vm.$set(vm.propertyList, indexs, []);
1337
+ }
1338
+ },
1339
+ // 商砼属性
1340
+ async getConcrete(val, item, indexs, flg) {
1341
+ const vm = this;
1342
+ setTimeout(() => {
1343
+ const text = vm.$refs[item.content.field + indexs][0].$refs.input.value;
1344
+ vm.value[indexs][item.content.field + "Str"] = text || "";
1345
+ vm.$emit("input", vm.value);
1346
+ }, 100);
1347
+ if (vm.strength.length == 0) {
1348
+ const business = await concreteStrongAll();
1349
+ vm.strength = business.data.result.map
1350
+ ? business.data.result.map(i => ({
1351
+ text: i.strongLevel,
1352
+ value: i.sort
1353
+ }))
1354
+ : [];
1355
+ }
1356
+ if (vm.admixture.length == 0) {
1357
+ const res = await concreteAdmixtureAll();
1358
+ vm.admixture = vm.formatData(res.data.result);
1359
+ }
1360
+ if (!flg) {
1361
+ Object.keys(vm.value[indexs]).forEach(k => {
1362
+ if (k.indexOf("pro-") > -1) {
1363
+ delete vm.value[indexs][k];
1364
+ }
1365
+ });
1366
+ vm.$emit("input", vm.value);
1367
+ }
1368
+ const propertyList = [];
1369
+ propertyList.push({
1370
+ name: "强度等级",
1371
+ data: vm.strength,
1372
+ propertyId: "1",
1373
+ key: 1
1374
+ });
1375
+ propertyList.push({
1376
+ name: "外加剂",
1377
+ data: vm.admixture,
1378
+ propertyId: "2",
1379
+ key: 1
1380
+ });
1381
+ vm.$set(vm.propertyList, indexs, propertyList);
1382
+ },
1383
+ // 机械分类
1384
+ async getMachineryList() {
1385
+ const res = await getMachineryList();
1386
+ if (res.data.code == 200) {
1387
+ this.Mechanics = res.data.data.map(item => ({
1388
+ text: item.name,
1389
+ value: item.no
1390
+ }));
1391
+ }
1392
+ },
1393
+ // 机械类型
1394
+ async getMachineryType(val, item, indexs, flg) {
1395
+ let value = [];
1396
+ const key = item.content.link;
1397
+ if (!flg) {
1398
+ const name = this.Mechanics.filter(i => i.value == val);
1399
+ this.value[indexs][item.content.field + "Str"] = name[0]
1400
+ ? name[0].text
1401
+ : "";
1402
+ this.value[indexs].classify = "";
1403
+ this.value[indexs].classifyStr = "";
1404
+ this.$emit("input", this.value);
1405
+ }
1406
+ const res = await getMachineryType({ categoryNo: val }, indexs);
1407
+ if (res.data.code == 200) {
1408
+ value = res.data.data.map(item => ({
1409
+ text: item.name,
1410
+ value: item.no
1411
+ }));
1412
+ }
1413
+ this.$set(this.muster[key], indexs, value);
1414
+ },
1415
+ async getTeamSize() {
1416
+ const res = await getTeamSize();
1417
+ if (res.data.code == 200) {
1418
+ this.team = res.data.data.map(item => ({
1419
+ text: item.name,
1420
+ value: item.no
1421
+ }));
1422
+ }
1423
+ },
1424
+ async getBiddingProject() {
1425
+ const data = this.$store.state.user.no;
1426
+ const res = await getBiddingProject(data);
1427
+ if (res.data.code == 0) {
1428
+ this.bidding = res.data.result.map(item => ({
1429
+ text: item.name,
1430
+ value: item.no
1431
+ }));
1432
+ }
1433
+ },
1434
+ formatChildData(data) {
1435
+ data.forEach((item, index) => {
1436
+ if (item.children && item.children.length > 0) {
1437
+ return this.formatChildData(item.children);
1438
+ } else {
1439
+ delete item.children;
1440
+ }
1441
+ });
1442
+ return data;
1443
+ },
1444
+
1445
+ // 设备分类
1446
+ async getEquipmentList(val, item, indexs) {
1447
+ const res = await getEquipmentList({});
1448
+ if (res.data.code == 200) {
1449
+ this.equipment = res.data.data.map(item => ({
1450
+ text: item.name,
1451
+ value: item.no
1452
+ }));
1453
+ }
1454
+ },
1455
+ // 设备类型
1456
+ async getEquipmentType(val, item, indexs, flg) {
1457
+ let value = [];
1458
+ const key = item.content.link;
1459
+ if (!flg) {
1460
+ const name = this.equipment.filter(i => i.value == val);
1461
+ this.value[indexs][item.content.field + "Str"] = name[0]
1462
+ ? name[0].text
1463
+ : "";
1464
+ this.value[indexs].equipClassify = "";
1465
+ this.value[indexs].equipClassifyStr = "";
1466
+ this.$emit("input", this.value);
1467
+ }
1468
+ const res = await getEquipmentList({ categoryNo: val }, indexs);
1469
+ if (res.data.code == 200) {
1470
+ value = res.data.data.map(item => ({
1471
+ text: item.name,
1472
+ value: item.no
1473
+ }));
1474
+ }
1475
+ this.$set(this.muster[key], indexs, value);
1476
+ },
1477
+ // 获取单位
1478
+ async getUnitList() {
1479
+ const res = await getUnitListData();
1480
+ if (res.data.code == 0) {
1481
+ res.data.data = res.data.data.map(item => ({
1482
+ text: item.name,
1483
+ value: item.id
1484
+ }));
1485
+ this.unitList = res.data.data;
1486
+ }
1487
+ },
1488
+
1489
+ init() {
1490
+ if (this.desc.types == "goods") {
1491
+ this.getGooodsType();
1492
+ this.getUnitList();
1493
+ } else if (this.desc.types == "Mechanics") {
1494
+ this.getMachineryList();
1495
+ } else if (this.desc.types == "team") {
1496
+ this.getTeamEngineeringMajor();
1497
+ this.getTeamLocation();
1498
+ } else if (this.desc.types == "bidding") {
1499
+ this.getBiddingProject();
1500
+ } else if (this.desc.types == "equipment") {
1501
+ this.getEquipmentList();
1502
+ } else if (this.desc.types == "houses") {
1503
+ this.getHouse();
1504
+ } else if (this.desc.types == "cars") {
1505
+ this.initCarInfo();
1506
+ }
1507
+ }
1508
+ },
1509
+ created() {
1510
+ const vm = this;
1511
+ !vm.edit && vm.init();
1512
+
1513
+ setTimeout(() => {
1514
+ if (vm.value.length == 0) {
1515
+ vm.addValue();
1516
+ } else {
1517
+ vm.value.forEach((item, index) => {
1518
+ if (vm.desc.types == "goods") {
1519
+ const content = vm.columns.filter(item => item.prop == "goodType");
1520
+ const content2 = vm.columns.filter(item => item.prop == "goodType");
1521
+ content.length > 0 &&
1522
+ vm.getGooodsBrand(item.goodType, content[0], index, true);
1523
+ vm.propertyList.length >= 0 &&
1524
+ item.goodType.length > 0 &&
1525
+ vm.getGooodsProperty(item.goodType, content[0], index, true);
1526
+ } else if (vm.desc.types == "Mechanics") {
1527
+ const content = vm.columns.filter(item => item.prop == "Mechanics");
1528
+ content.length > 0 &&
1529
+ vm.getMachineryType(item.Mechanics, content[0], index, true);
1530
+ } else if (vm.desc.types == "equipment") {
1531
+ const content = vm.columns.filter(item => item.prop == "equipment");
1532
+ content.length > 0 &&
1533
+ vm.getEquipmentType(item.equipment, content[0], index, true);
1534
+ } else if (vm.desc.types == "houses") {
1535
+ const content = vm.columns.filter(
1536
+ item => item.prop == "houseType2"
1537
+ );
1538
+ content.length > 0 &&
1539
+ vm.getHouseType2(item.houseType, content[0], index);
1540
+ } else if (vm.desc.types == "cars") {
1541
+ item.carBrand.length > 0 &&
1542
+ vm.getSeriesSelect(item.carBrand, null, index);
1543
+ item.carSeating.length > 0 &&
1544
+ vm.getSeatSelect(item.carBrand, null, index);
1545
+ }
1546
+ });
1547
+ }
1548
+ }, 1000);
1549
+ },
1550
+ mounted() {},
1551
+ watch: {
1552
+ value: {
1553
+ handler(nv, ov) {
1554
+ const vm = this;
1555
+ if (vm.desc.types == "goods") {
1556
+ nv.map((e, i) => {
1557
+ // return {
1558
+ // Price: e.Price,
1559
+ // amount: e.amount,
1560
+ // brand: e.brand,
1561
+ // goodType: e.goodType,
1562
+ // total: e.Price * e.amount,
1563
+ // unit: e.unit,
1564
+ // unitStr: e.unitStr
1565
+ // }
1566
+ if (!vm.edit && e.Price * e.amount != 0) {
1567
+ vm.$set(vm.value[i], "total", e.Price * e.amount);
1568
+ }
1569
+ vm.$set(vm.value[i], "scck", "市场参考:");
1570
+ });
1571
+ }
1572
+ },
1573
+ deep: true
1574
+ },
1575
+ propertyList: {
1576
+ handler(nv, ov) {
1577
+ const _this = this;
1578
+
1579
+ _.find(_this.computedValue, function(o, i) {
1580
+ const obj = {};
1581
+ for (const key in o) {
1582
+ // if (o.hasOwnProperty.call(o, key)) {
1583
+
1584
+ if (_this.propertyList.length > 0 && _this.flag == "dialog") {
1585
+ obj[key] = o[key];
1586
+ if (
1587
+ !_.find(_this.columnsValue, function(o) {
1588
+ return o.type == "conunt";
1589
+ })
1590
+ ) {
1591
+ // _this.$nextTick(function() {
1592
+ // console.log(vm.$el.textContent); // 可以得到'changed'
1593
+ // });
1594
+ // _this.tableConfig.push({
1595
+ // label: "规格属性",
1596
+ // prop: "key_conunt",
1597
+ // type: "conunt"
1598
+ // });
1599
+ }
1600
+ }
1601
+ // }
1602
+ }
1603
+ _this.$set(_this.tableCustomArr, i, obj);
1604
+ });
1605
+ },
1606
+ deep: true
1607
+ }
1608
+ // columns1: {
1609
+ // handler(nv, ov) {
1610
+ // const _this = this;
1611
+ // const obj = {};
1612
+ // const newNv = _.cloneDeep(nv);
1613
+
1614
+ // // _this.$set(this, "columns1", newNv)
1615
+ // },
1616
+ // immediate: true,
1617
+ // deep: true
1618
+ // }
1619
+ }
1620
+ };
1621
+ </script>
1622
+ <style lang="scss" scoped>
1623
+ .handle {
1624
+ display: flex;
1625
+ justify-content: center;
1626
+ align-items: center;
1627
+ }
1628
+ /deep/ .eleFormTextarea textarea {
1629
+ height: 40px !important;
1630
+ min-height: 40px !important;
1631
+ }
1632
+ /deep/ .el-textarea {
1633
+ // padding-top: 30px;
1634
+ }
1635
+ .isSummary {
1636
+ z-index: 2004;
1637
+ cursor: pointer;
1638
+
1639
+ // position: absolute;
1640
+ // left: -12px;
1641
+ // top: 50%;
1642
+ // transform: translateY(-50%);
1643
+ }
1644
+ .wrapper {
1645
+ overflow-x: auto;
1646
+ .tables {
1647
+ margin-top: 20px;
1648
+ border-left: 1px solid #ebeef5;
1649
+ }
1650
+ .tables-sub {
1651
+ display: flex;
1652
+ // border-top: 1px solid #ebeef5;
1653
+ // border-bottom: 1px solid #ebeef5;
1654
+
1655
+ .disoption {
1656
+ &:after {
1657
+ content: " ";
1658
+ display: block;
1659
+ left: 0;
1660
+ top: 0;
1661
+ right: 0;
1662
+ bottom: 0;
1663
+ position: absolute;
1664
+ z-index: 2;
1665
+ cursor: move;
1666
+ }
1667
+ }
1668
+ .el-icon-remove-outline {
1669
+ font-size: 26px;
1670
+ }
1671
+ .parts {
1672
+ position: relative;
1673
+ border-right: 1px solid #ebeef5;
1674
+ text-align: center;
1675
+ &:nth-child(1) {
1676
+ min-width: 50px;
1677
+ }
1678
+ .heard {
1679
+ border-bottom: 1px solid #ebeef5;
1680
+ font-weight: 500;
1681
+ height: 40px;
1682
+ overflow: hidden;
1683
+ /*文本不会换行*/
1684
+ white-space: nowrap;
1685
+ /*当文本溢出包含元素时,以省略号表示超出的文本*/
1686
+ text-overflow: ellipsis;
1687
+ }
1688
+ .botom {
1689
+ box-sizing: border-box;
1690
+ padding: 10px 10px 10px 20px;
1691
+ min-height: 50px;
1692
+ position: relative;
1693
+ // top: 50%;
1694
+ // transform: translateY(-79%);
1695
+ }
1696
+ }
1697
+ }
1698
+ .msg {
1699
+ min-width: 200px;
1700
+ display: flex;
1701
+ align-items: center;
1702
+ justify-content: center;
1703
+ border: 1px solid #ebeef5;
1704
+ border-top: 0;
1705
+ border-bottom: 0;
1706
+ }
1707
+ .form-item-active {
1708
+ border: 1px dashed #409eff !important;
1709
+ background-color: rgba(2, 134, 223, 0.06) !important;
1710
+ position: relative;
1711
+ }
1712
+ /deep/ .el-icon-delete {
1713
+ font-size: 17px !important;
1714
+ }
1715
+ /deep/ .el-icon-document-copy {
1716
+ font-size: 17px !important;
1717
+ }
1718
+ .form-item-delete-btn {
1719
+ background-color: #ff0000;
1720
+ border-color: #ff0000;
1721
+ height: 30px;
1722
+ width: 30px;
1723
+ border-radius: 100% !important;
1724
+ position: absolute;
1725
+ right: 10px;
1726
+ top: -15px;
1727
+ z-index: 3;
1728
+ padding: 4px 6px;
1729
+ }
1730
+ .form-item-copy-btn {
1731
+ position: absolute;
1732
+ height: 30px;
1733
+ width: 30px;
1734
+ border-radius: 100% !important;
1735
+ right: 37px;
1736
+ top: -15px;
1737
+ z-index: 3;
1738
+ margin-right: 10px;
1739
+ padding: 4px 6px;
1740
+ }
1741
+ /deep/ .el-form-item {
1742
+ // margin: 20px !important;
1743
+ }
1744
+
1745
+ /deep/ .botom .el-form-item__content > div {
1746
+ display: flex;
1747
+ .el-radio {
1748
+ margin-right: 30px !important;
1749
+ }
1750
+ .el-checkbox {
1751
+ margin-right: 30px !important;
1752
+ }
1753
+ }
1754
+ /deep/ .botom .el-form-item__content {
1755
+ min-width: 150px;
1756
+ }
1757
+ }
1758
+ </style>