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,1109 +1,1109 @@
1
- <template>
2
- <div class="wrapper">
3
- <div class="opt">
4
- <el-button
5
- v-if="!edit"
6
- @click="addValue"
7
- >添加</el-button>
8
- </div>
9
- <div class="tables">
10
- <el-tooltip
11
- content="从左侧拖拽来添加字段"
12
- placement="top"
13
- :disabled="!edit"
14
- >
15
- <div class="tables-sub">
16
- <div
17
- class="parts"
18
- v-for="(val,indexs) in computedValue"
19
- :key="indexs"
20
- >
21
- <!-- <div class="msg " v-if="edit">从左侧拖拽来添加字段</div> -->
22
- <draggable
23
- :animation="200"
24
- :disabled="!edit"
25
- :list="columns"
26
- ghost-class="ghost"
27
- @add="handleAdd"
28
- @end="handleMoveEnd"
29
- @start="handleMoveStart"
30
- :group="{ name: 'form', pull: false, put: true}"
31
- style="display: flex;"
32
- filter='.nodraggable'
33
- >
34
-
35
- <template v-for="(item,index) in columnsValue">
36
- <div
37
- class="botom"
38
- :class="{'form-item-active': (selSubIndex != null && selSubIndex == index && edit && list[activeFormName][selectIndex].field == desc.field),'disoption': edit,'nodraggable': !item.isFlex}"
39
- :key="index+1"
40
- v-show="isShowTag(val,item)"
41
- @click.stop="handleFormItemClick(item,index)"
42
- >
43
- <template v-if="item.content">
44
- <el-form-item>
45
- <component
46
- v-if="item.content.type "
47
- :desc="item.content"
48
- :is="item.content.type"
49
- :options="setItemOption(item,index,indexs)"
50
- v-bind="getAttrs(item.content)"
51
- v-model="val[item.prop]"
52
- v-on="item.content.on"
53
- :class="{'over-height': item.prop == 'category'}"
54
- :ref="item.prop+indexs"
55
- >
56
- </component>
57
- <!-- <el-select
58
- v-model="value"
59
- v-else-if="item.content.field == 'brand'"
60
- :placeholder="'请选择'+item.content.label"
61
- >
62
- <el-option-group
63
- v-for="group in item.content.options"
64
- :key="group.value"
65
- :label="group.text"
66
- >
67
- <el-option
68
- v-for="item in group.options"
69
- :key="item.value"
70
- :label="item.label"
71
- :value="item.value"
72
- >
73
- </el-option>
74
- </el-option-group>
75
- </el-select> -->
76
- <!-- <el-select
77
- v-model="val[item.prop]"
78
- :placeholder="'请选择'+item.content.label"
79
- :multiple="item.content.attrs.multiple"
80
- v-else
81
- >
82
- <el-option
83
- v-for="item2 in item.content.options"
84
- :key="item2.value"
85
- :label="item2.text"
86
- :value="item2.value"
87
- >
88
- </el-option>
89
- </el-select> -->
90
- </el-form-item>
91
- </template>
92
- <!-- 复制按钮 -->
93
- <template v-if="item.isFlex">
94
- <!-- <el-button
95
- @click.stop="handleCopy(index)"
96
- class="form-item-copy-btn"
97
- icon="el-icon-document-copy"
98
- size="mini"
99
- style="border-radius: 0"
100
- type="primary"
101
- v-if="selSubIndex != null && selSubIndex === index && edit && list[activeFormName][selectIndex].field == desc.field"
102
- >
103
- </el-button> -->
104
- <!-- 删除按钮 -->
105
- <el-button
106
- @click.stop="handleDelete(index)"
107
- class="form-item-delete-btn"
108
- icon="el-icon-delete"
109
- size="mini"
110
- style="border-radius: 0"
111
- type="primary"
112
- v-if="selSubIndex != null && selSubIndex === index && edit && list[activeFormName][selectIndex].field == desc.field"
113
- >
114
- </el-button>
115
- </template>
116
- </div>
117
- <!-- TODO: 多选后如果有自定义选项 则渲染在选择项后方 -->
118
- <template v-if="propertyList[indexs] && propertyList[indexs].length && item.prop =='goodType'">
119
- <div
120
- class="botom"
121
- v-for="(pro,j) in propertyList[indexs]"
122
- :key="'pro'+j"
123
- >
124
- <el-form-item>
125
-
126
- <component
127
- :desc="{label: pro.name,on: {'change': (val)=>{setProStr(val,pro,indexs)}}}"
128
- :is="pro.key == 0 ? 'ele-form-input' : 'ele-form-select'"
129
- :options="propertyList[indexs][j].data"
130
- v-model="val['pro-'+pro.propertyId]"
131
- >
132
- </component>
133
- </el-form-item>
134
- <span
135
- style="padding-left: 4px; word-break: keep-all;"
136
- v-if="pro.unit"
137
- >{{pro.unit}}</span>
138
-
139
- </div>
140
- </template>
141
- </template>
142
-
143
- <!-- TODO: 这里暂放市场参考字段 -->
144
- <!-- <div class="msg nodraggable">市场参考:</div> -->
145
- <div
146
- class="msg nodraggable"
147
- v-if="columnsValue.length === 0"
148
- >暂未添加字段</div>
149
- <div
150
- class="msg nodraggable"
151
- v-if="columnsValue.length > 0 && edit"
152
- > </div>
153
- <div
154
- class="botom"
155
- v-if="!edit"
156
- >
157
- <el-button
158
- type="text"
159
- @click="deteleVal(indexs)"
160
- >删除</el-button>
161
- </div>
162
- </draggable>
163
- </div>
164
- </div>
165
- </el-tooltip>
166
- </div>
167
-
168
- </div>
169
- </template>
170
-
171
- <script>
172
- import * as _ from "lodash";
173
- // import draggable from "vuedraggable";
174
-
175
- const draggable = () => ({
176
- // 需要加载的组件 (应该是一个 `Promise` 对象)
177
- component: import("vuedraggable"),
178
- // 异步组件加载时使用的组件
179
- loading: "",
180
- // 加载失败时使用的组件
181
- error: "",
182
- // 展示加载时组件的延时时间。默认值是 200 (毫秒)
183
- delay: 200,
184
- // 如果提供了超时时间且组件加载也超时了,
185
- // 则使用加载失败时使用的组件。默认值是:`Infinity`
186
- timeout: 3000
187
- });
188
- import { mapGetters, mapMutations, mapState } from "vuex";
189
- import {
190
- getGooodsType,
191
- getGooodsBrand,
192
- getMachineryList,
193
- getMachineryType,
194
- getEquipmentList,
195
- getUnitListData,
196
- getGooodsProperty,
197
- concreteStrongAll,
198
- concreteAdmixtureAll,
199
- getMechanicsAttr,
200
- getEquipProp,
201
- modelSelect,
202
- brandSelect,
203
- gearboxSelect,
204
- gethouseType,
205
- getTeamCategory
206
- } from "@/formBuilder/apiBusiness.js";
207
- import columnsVue from "../../components/app-main/components/components/columns.vue";
208
- // import { requesTypeOptions } from "../../../views/CustomerManagement/MemberChance/mock";
209
- import itemOptionVue from "../../components/app-main/components/components/itemOption.vue";
210
- import { isArraysEqual } from "@fullcalendar/core";
211
- import { carSeating, driveModel, carYear } from "./data";
212
- export default {
213
- name: "Purchase",
214
- extends: {},
215
- components: {
216
- draggable
217
- },
218
- props: {
219
- value: {
220
- type: Array,
221
- default: () => []
222
- },
223
- columns: {
224
- type: Array,
225
- default: () => []
226
- },
227
- desc: {
228
- type: Object,
229
- default: () => {
230
- return {};
231
- }
232
- },
233
- edit: {
234
- type: Boolean,
235
- default: () => false
236
- }
237
- },
238
- data() {
239
- return {
240
- // 商品分类
241
- goodsOption: [],
242
- Mechanics: [],
243
- equipment: [],
244
- team: [],
245
- bidding: [],
246
- biddingType: [
247
- { text: "商品/材料", value: "3" },
248
- { text: "工程分包", value: "4" },
249
- { text: "机械设备租赁", value: "1" },
250
- { text: "劳务", value: "2" }
251
- ],
252
- // 自定义属性
253
- muster: {
254
- brand: []
255
- },
256
- unitList: [],
257
- propertyList: [],
258
- strength: [],
259
- admixture: [],
260
- // 车辆信息
261
- carModel: [],
262
- carBrand: [],
263
- carGearbox: [],
264
- carSeating: carSeating,
265
- driveModel: driveModel,
266
- carYear: carYear(),
267
- houseType: [],
268
- category: []
269
- };
270
- },
271
- computed: {
272
- ...mapState(["selSubIndex", "activeFormName", "list", "selectIndex"]),
273
- ...mapGetters(["currentFormItem"]),
274
- computedValue: function() {
275
- if (this.value.length > 0) {
276
- return this.value;
277
- } else {
278
- const type = ["checkbox", "datetimerange", "cascader"];
279
- const arr = {};
280
- this.columns.forEach(item => {
281
- if (item.prop) {
282
- const typeStr = item.content.type.replace("ele-form-", "");
283
- arr[item.prop] = type.indexOf(typeStr) > -1 ? [] : "";
284
- }
285
- });
286
- return [arr];
287
- }
288
- },
289
- draggableColumns() {
290
- return this.columns;
291
- },
292
- columnsValue() {
293
- return _.cloneDeep(this.columns);
294
- }
295
- },
296
- methods: {
297
- ...mapMutations(["updateSelSubIndex", "updateSelectIndex", "updateList"]),
298
- isShowTag(val, item) {
299
- if (item.content && item.content.vif && Array.isArray(item.content.vif)) {
300
- const node = item.isLink ? item.isLink : "leaseType";
301
- return item.content.vif.indexOf(val[node]) > -1;
302
- } else {
303
- return true;
304
- }
305
- },
306
- setProStr(val, pro, j) {
307
- if (!val) return;
308
- const name =
309
- pro.key == 1 && pro.data.length > 0
310
- ? pro.data.filter(item => item.value == val)[0].text
311
- : val;
312
- this.value[j]["pro-" + pro.propertyId + "-Str"] = {
313
- value: name,
314
- property: pro.name,
315
- unit: pro.unit
316
- };
317
- this.$emit("input", this.value);
318
- },
319
- setValue(prop, index) {
320
- if (prop) {
321
- const val = this.value.filter(item => item[prop]);
322
- return val[0][prop];
323
- } else {
324
- return index + 1;
325
- }
326
- },
327
- getAttrs(item) {
328
- return Object.assign({}, item.attrs);
329
- },
330
- // option设置
331
- setItemOption(item, index, indexs) {
332
- const arr = [];
333
- const vm = this;
334
-
335
- if (!item.content.options) return [];
336
- if (item.content.field == "leaseType") {
337
- item.content["on"] = {
338
- change: newVal => {
339
- vm.leaseTypeChange(newVal, item, indexs);
340
- }
341
- };
342
- }
343
- if (item.content.options && typeof item.content.options != "string") {
344
- return item.content.options;
345
- } else {
346
- if (item.content.types) {
347
- // vm.$nextTick(function() {
348
- item.content["on"] = {
349
- change: async newVal => {
350
- await vm.handleChange(newVal, item, indexs);
351
- }
352
- };
353
- item["on"] = {
354
- change: async newVal => {
355
- await vm.handleChange(newVal, item, indexs);
356
- }
357
- };
358
- // });
359
- return vm[item.content.options];
360
- } else if (!item.content.types) {
361
- item.content["on"] = {
362
- change: newVal => {
363
- vm.handleChangeOption(newVal, item, indexs);
364
- }
365
- };
366
- const key = item.content.options;
367
- !this.muster[key] && this.$set(this.muster, key, []);
368
- !this.muster[key][indexs] && this.$set(this.muster[key], indexs, []);
369
- return this.muster[key][indexs];
370
- }
371
- }
372
- },
373
- // 租赁类型变化
374
- leaseTypeChange(newVal, item, indexs) {
375
- if (newVal == 1) {
376
- this.getMachineryList();
377
- } else if (newVal == 2) {
378
- this.getEquipmentList();
379
- } else if (newVal == 3) {
380
- this.initCarInfo();
381
- } else if (newVal == 4) {
382
- this.getHouse();
383
- }
384
- Object.keys(this.value[indexs]).forEach(k => {
385
- if (k.indexOf("pro-") > -1) {
386
- delete this.value[indexs][k];
387
- } else if (k != "leaseType") {
388
- const type = Array.isArray(this.value[indexs][k]);
389
- this.value[indexs][k] = type ? [] : "";
390
- }
391
- });
392
- this.$emit("input", this.value);
393
- },
394
- // 加载车辆选择框信息
395
- async initCarInfo() {
396
- if (this.carModel.length == 0) {
397
- const res = await modelSelect();
398
- this.carModel =
399
- res.data.code == 200
400
- ? res.data.data.map((item, index) => ({
401
- text: item.name,
402
- value: item.key
403
- }))
404
- : [];
405
- }
406
- if (this.carBrand.length == 0) {
407
- const res = await brandSelect();
408
- this.carBrand =
409
- res.data.code == 200
410
- ? res.data.data.map((item, index) => ({
411
- text: item.name,
412
- value: item.key
413
- }))
414
- : [];
415
- }
416
- if (this.carGearbox.length == 0) {
417
- const res = await gearboxSelect();
418
- this.carGearbox =
419
- res.data.code == 200
420
- ? res.data.data.map((item, index) => ({
421
- text: item.value,
422
- value: item.key
423
- }))
424
- : [];
425
- }
426
- },
427
- // 父级元素数据发生变化
428
- handleChange(val, item, indexs) {
429
- // TODO: 在这里进行了点击事件的获取值
430
- const vm = this;
431
- if (item.content.types == "goods") {
432
- const str = this.goodsOption.filter(k => val[0] && k.id == val[0]);
433
- if (str[0] && str[0].name == "商砼") {
434
- this.getConcrete(val, item, indexs);
435
- } else {
436
- this.getGooodsBrand(val, item, indexs);
437
- this.getGooodsProperty(val, item, indexs);
438
- }
439
- } else if (item.content.types == "Mechanics") {
440
- this.getMachineryType(val, item, indexs);
441
- } else if (item.content.types == "equipment") {
442
- this.getEquipmentType(val, item, indexs);
443
- } else if (item.content.types == "team") {
444
- this.setTeamStr(val, item, indexs, "team");
445
- } else if (item.content.types == "car") {
446
- this.setTeamStr(val, item, indexs, item.prop);
447
- } else if (item.content.types == "houseType") {
448
- setTimeout(() => {
449
- const text = vm.$refs[item.content.field + indexs][0].presentText;
450
- vm.value[indexs][item.content.field + "Str"] = text || "";
451
- vm.$emit("input", vm.value);
452
- }, 200);
453
- } else if (item.content.types == "category") {
454
- setTimeout(() => {
455
- const tags = vm.$refs[item.content.field + indexs][0].presentTags;
456
- const text = tags.map ? tags.map((item, index) => item.text) : [];
457
- vm.value[indexs][item.content.field + "Str"] = text.join(",");
458
- vm.$emit("input", vm.value);
459
- }, 200);
460
- } else if (item.content.types == "unitList") {
461
- vm.setTeamStr(val, item, indexs, "unitList");
462
- }
463
- },
464
- setTeamStr(val, item, indexs, types) {
465
- const name = this[types].filter(i => i.value == val);
466
- this.value[indexs][item.content.field + "Str"] = name[0]
467
- ? name[0].text
468
- : "";
469
- this.$emit("input", this.value);
470
- },
471
- // 子级元素发生变化
472
- handleChangeOption(newVal, item, indexs) {
473
- console.log(newVal, item, indexs);
474
- const name = this.muster[item.content.options][indexs].filter(
475
- i => i.value == newVal
476
- );
477
- const nameStr = name[0].text;
478
- const key = item.content.field + "Str";
479
- this.value[indexs][key] = nameStr;
480
- this.$emit("input", this.value);
481
- if (item.prop == "classify" || item.prop == "equipClassify") {
482
- this.getClassifyPro(newVal, item, indexs);
483
- }
484
- },
485
- // 获取机械自定义属性
486
- async getClassifyPro(newVal, item, indexs) {
487
- Object.keys(this.value[indexs]).forEach(k => {
488
- if (k.indexOf("pro-") > -1) {
489
- delete this.value[indexs][k];
490
- }
491
- });
492
- const params = {
493
- categoryNo:
494
- item.prop == "classify"
495
- ? this.value[indexs].Mechanics
496
- : this.value[indexs].equipment,
497
- typeNo: newVal
498
- };
499
- const res =
500
- item.prop == "classify"
501
- ? await getMechanicsAttr(params)
502
- : await getEquipProp(params);
503
- if (res.data.code == 200) {
504
- let propertyList = [];
505
- if (item.prop == "classify") {
506
- propertyList = res.data.data.map((item, index) => {
507
- item.data = item.valList.map(i => ({
508
- text: i.startVal,
509
- value: i.startVal
510
- }));
511
- item.propertyId = index;
512
- return item;
513
- });
514
- } else {
515
- res.data.data.forEach((item, index) => {
516
- item.data = item.valList.map(i => ({ text: i.val, value: i.val }));
517
- item.propertyId = index;
518
- propertyList.push({
519
- name: item.name,
520
- propertyId: index,
521
- data: item.data,
522
- unit: item.unit,
523
- key: item.attrKey
524
- });
525
- });
526
- }
527
- this.$set(this.propertyList, indexs, propertyList);
528
- }
529
- },
530
- // 点击选中
531
- handleFormItemClick(item, index) {
532
- if (!this.edit) return;
533
- if (item.type != "index") {
534
- this.list[this.activeFormName].forEach((i, v) => {
535
- if (i.field == this.desc.field) {
536
- this.updateSelectIndex(v);
537
- }
538
- });
539
- this.updateSelSubIndex(index);
540
- }
541
- },
542
- // 复制
543
- handleCopy(index) {
544
- const obj = _.cloneDeep(this.columns[index]);
545
- obj.field = `key_${Date.now()}`;
546
- this.columns.splice(index + 1, 0, obj);
547
- this.setListColumns(this.columns);
548
- this.updateSelSubIndex(index + 1);
549
- },
550
- // 删除
551
- handleDelete(index) {
552
- this.columns.splice(index, 1);
553
- this.setListColumns(this.columns);
554
- // 如果删除的最后一个, 则重新选择最后一个
555
- if (index >= this.columns.length) {
556
- this.updateSelSubIndex(this.columns.length - 1);
557
- } else if (index - 1 < 1 && this.columns > 1) {
558
- this.updateSelSubIndex(1);
559
- } else {
560
- this.updateSelSubIndex(null);
561
- }
562
- },
563
- // 新增
564
-
565
- handleAdd(res) {
566
- const vm = this;
567
- if (!this.columns[res.newIndex]) {
568
- res.newIndex = this.columns.length - 1;
569
- }
570
- // if (!this.columns[res.newIndex].type) {
571
- // this.$message.error("业务组件字段请添加至最右侧");
572
- // return;
573
- // }
574
- if (
575
- this.columns[res.newIndex].type &&
576
- (this.columns[res.newIndex].type.indexOf("custom-table") > -1 ||
577
- this.columns[res.newIndex].type.indexOf("columns") > -1 ||
578
- this.columns[res.newIndex].type.indexOf("quill-editor") > -1)
579
- ) {
580
- this.$message.error("不支持添加此类型控件,请添加其他类型控件");
581
- this.columns.splice(res.newIndex, 1);
582
- return;
583
- }
584
- // let obj = this.columns[res.newIndex].type?this.columns[res.newIndex]:this.columns[res.newIndex+1] ;
585
- const obj = this.columns[res.newIndex];
586
- let content = {};
587
- // 如果是单选框 多选框 进入表格 则添加下拉框
588
- if (obj.type && (obj.type === "radio" || obj.type === "checkbox")) {
589
- if (obj.type === "checkbox") {
590
- obj.attrs["multiple"] = true;
591
- }
592
- obj.type = "ele-form-select";
593
- content = obj;
594
- this.columns[res.newIndex] = {
595
- prop: obj.field,
596
- label: obj.label,
597
- isFlex: true,
598
- content: content
599
- };
600
- }
601
- // if (!obj.type) {
602
- vm.columns.map((e, i) => {
603
- if (e.field) {
604
- e.type = "ele-form-" + e.type;
605
- this.columns[i] = {
606
- prop: e.field,
607
- label: e.label,
608
- isFlex: true,
609
- content: e
610
- };
611
- }
612
- if (e.type === "ele-form-radio" || e.type === "ele-form-checkbox") {
613
- if (e.type === "ele-form-checkbox") {
614
- e.attrs["multiple"] = true;
615
- }
616
- e.type = "ele-form-select";
617
- }
618
- });
619
- // }
620
- this.setListColumns(this.columns);
621
- this.list[this.activeFormName].forEach((i, v) => {
622
- if (i.field == vm.desc.field) {
623
- this.updateSelectIndex(v);
624
- }
625
- });
626
- this.updateSelSubIndex(res.newIndex);
627
- },
628
-
629
- // 移动开始
630
- handleMoveStart(res) {
631
- this.updateSelSubIndex(res.oldIndex);
632
- },
633
- // 移动结束
634
- handleMoveEnd(res) {
635
- const columns = this.columns.filter(item => !item.isFlex);
636
- if (res.newIndex < columns.length) {
637
- return false;
638
- }
639
- this.setListColumns(this.columns);
640
- this.updateSelSubIndex(res.newIndex);
641
- },
642
- setListColumns(columns) {
643
- const vm = this;
644
- const list = _.cloneDeep(this.list);
645
- list[vm.activeFormName].forEach(item => {
646
- if (item.field == vm.desc.field) {
647
- item.attrs.columns = columns;
648
- }
649
- });
650
- vm.updateList({
651
- name: vm.activeFormName,
652
- newList: list[vm.activeFormName]
653
- });
654
- },
655
- addValue() {
656
- const type = ["checkbox", "datetimerange", "cascader"];
657
-
658
- const obj = {};
659
- this.columns.forEach(item => {
660
- if (item.prop) {
661
- const typeStr = item.content.type.replace("ele-form-", "");
662
- obj[item.prop] = type.indexOf(typeStr) > -1 ? [] : "";
663
- }
664
- });
665
- this.value.push(obj);
666
- this.$emit("input", this.value);
667
- },
668
- deteleVal(index) {
669
- if (this.value.length < 2) {
670
- this.$message.error("至少保留一条数据");
671
- return;
672
- }
673
- Object.keys(this.muster).forEach(item => {
674
- this.muster[item].splice(index, 1);
675
- });
676
- this.propertyList.splice(index, 1);
677
- this.value.splice(index, 1);
678
- this.$emit("input", this.value);
679
- },
680
- // 房产分类
681
- async getHouse() {
682
- if (this.houseType.length == 0) {
683
- const res = await gethouseType({ type: 0 });
684
- this.houseType = res.data.code == 200 ? res.data.data : [];
685
- }
686
- },
687
- // 商品分类
688
- async getGooodsType() {
689
- const res = await getGooodsType({ type: "purchase" });
690
- if (res.status == 200) {
691
- this.goodsOption = this.formatChildData(res.data);
692
- }
693
- },
694
- formatChildData(data) {
695
- data.forEach((item, index) => {
696
- if (item.children && item.children.length > 0) {
697
- return this.formatChildData(item.children);
698
- } else {
699
- delete item.children;
700
- }
701
- });
702
- return data;
703
- },
704
- // 商品品牌
705
- async getGooodsBrand(val, item, indexs, flg) {
706
- let value = [];
707
- const vm = this;
708
- const key = item.content.link;
709
- if (!flg) {
710
- vm.value[indexs].brand = "";
711
- vm.value[indexs].brandStr = "";
712
- setTimeout(() => {
713
- const text =
714
- vm.$refs[item.content.field + indexs][0].$refs.input.value;
715
- vm.value[indexs][item.content.field + "Str"] = text || "";
716
- vm.$emit("input", vm.value);
717
- }, 100);
718
- }
719
- const data = val[val.length - 1];
720
- if (!data) return;
721
- const res = await getGooodsBrand(data, indexs);
722
- if (res.data.code == 0) {
723
- value = res.data.data.reduce(
724
- (total, currentValue) => total.concat(currentValue.options),
725
- []
726
- );
727
- value = value.map(i => ({ text: i.brandName, value: i.id }));
728
- }
729
-
730
- vm.$set(vm.muster[key], indexs, value);
731
- },
732
- // 商品属性
733
- async getGooodsProperty(val, item, indexs, flg) {
734
- const id = val[val.length - 1];
735
- if (!id) return;
736
- if (!flg) {
737
- Object.keys(this.value[indexs]).forEach(k => {
738
- if (k.indexOf("pro-") > -1) {
739
- delete this.value[indexs][k];
740
- }
741
- });
742
- this.$emit("input", this.value);
743
- }
744
- const res = await getGooodsProperty(id, indexs);
745
- if (res.data.code == 0) {
746
- const list = res.data.data;
747
- const propertyList = []; // 商品属性列表
748
- for (let i = 0; i < list.length; i++) {
749
- if (list[i].itemparamname === "仓储") {
750
- continue;
751
- }
752
- let flag = true;
753
- for (let j = 0; j < propertyList.length; j++) {
754
- // 去重 合并属性名相同的项
755
- if (propertyList[j].name === list[i].itemparamname) {
756
- propertyList[j].data.push({
757
- text: list[i].valdata,
758
- value: list[i].id
759
- });
760
- flag = false;
761
- break;
762
- }
763
- }
764
- if (flag) {
765
- // 非重复 添加商品属性和id
766
- const obj = {
767
- name: list[i].itemparamname,
768
- data: [],
769
- key: 1
770
- };
771
- obj.data.push({ text: list[i].valdata, value: list[i].id });
772
- obj.propertyId = list[i].itemparamid;
773
- propertyList.push(obj);
774
- }
775
- }
776
- this.$set(this.propertyList, indexs, propertyList);
777
- } else {
778
- this.$set(this.propertyList, indexs, []);
779
- }
780
- },
781
- // 商砼属性
782
- async getConcrete(val, item, indexs, flg) {
783
- const vm = this;
784
- setTimeout(() => {
785
- const text = vm.$refs[item.content.field + indexs][0].$refs.input.value;
786
- vm.value[indexs][item.content.field + "Str"] = text || "";
787
- vm.$emit("input", vm.value);
788
- }, 100);
789
- if (this.strength.length == 0) {
790
- const business = await concreteStrongAll();
791
- this.strength = business.data.result.map
792
- ? business.data.result.map(i => ({
793
- text: i.strongLevel,
794
- value: i.sort
795
- }))
796
- : [];
797
- }
798
- if (this.admixture.length == 0) {
799
- const res = await concreteAdmixtureAll();
800
- this.admixture = this.formatData(res.data.result);
801
- }
802
- if (!flg) {
803
- Object.keys(this.value[indexs]).forEach(k => {
804
- if (k.indexOf("pro-") > -1) {
805
- delete this.value[indexs][k];
806
- }
807
- });
808
- this.$emit("input", this.value);
809
- }
810
- const propertyList = [];
811
- propertyList.push({
812
- name: "强度等级",
813
- data: this.strength,
814
- propertyId: "1",
815
- key: 1
816
- });
817
- propertyList.push({
818
- name: "外加剂",
819
- data: this.admixture,
820
- propertyId: "2",
821
- key: 1
822
- });
823
- this.$set(this.propertyList, indexs, propertyList);
824
- },
825
- // 数据分组
826
- setGroup(arr) {
827
- const dataInfo = {};
828
- arr.forEach((item, index) => {
829
- const { admixtureName, spec } = item;
830
- if (!dataInfo[admixtureName]) {
831
- dataInfo[admixtureName] = {
832
- admixtureName: item.admixtureName,
833
- spec: item.admixtureName,
834
- children: []
835
- };
836
- }
837
- if (item.spec && item.admixtureName) {
838
- dataInfo[admixtureName].children.push({
839
- admixtureName: item.admixtureName + "-" + item.spec,
840
- spec: item.admixtureName + "-" + item.spec
841
- });
842
- } else {
843
- dataInfo[admixtureName].children = null;
844
- }
845
- });
846
- const list = Object.values(dataInfo);
847
- return list;
848
- },
849
- // 外加剂
850
- formatData(data) {
851
- return data.map((item, index) => {
852
- const name = item.admixtureName + item.spec;
853
- return { text: name, value: name };
854
- });
855
- },
856
- // 机械分类
857
- async getMachineryList() {
858
- const res = await getMachineryList();
859
- if (res.data.code == 200) {
860
- this.Mechanics = res.data.data.map(item => ({
861
- text: item.name,
862
- value: item.no
863
- }));
864
- }
865
- },
866
- // 机械类型
867
- async getMachineryType(val, item, indexs, flg) {
868
- let value = [];
869
- const key = item.content.link;
870
- if (!flg) {
871
- const name = this.Mechanics.filter(i => i.value == val);
872
- this.value[indexs][item.content.field + "Str"] = name[0]
873
- ? name[0].text
874
- : "";
875
- this.value[indexs].classify = "";
876
- this.value[indexs].classifyStr = "";
877
- this.$emit("input", this.value);
878
- }
879
- const res = await getMachineryType({ categoryNo: val }, indexs);
880
- if (res.data.code == 200) {
881
- value = res.data.data.map(item => ({
882
- text: item.name,
883
- value: item.no
884
- }));
885
- }
886
- this.$set(this.muster[key], indexs, value);
887
- },
888
- // 设备分类
889
- async getEquipmentList(val, item, indexs) {
890
- const res = await getEquipmentList({});
891
- if (res.data.code == 200) {
892
- this.equipment = res.data.data.map(item => ({
893
- text: item.name,
894
- value: item.no
895
- }));
896
- }
897
- },
898
- // 设备类型
899
- async getEquipmentType(val, item, indexs, flg) {
900
- let value = [];
901
- const key = item.content.link;
902
- if (!flg) {
903
- const name = this.equipment.filter(i => i.value == val);
904
- this.value[indexs][item.content.field + "Str"] = name[0]
905
- ? name[0].text
906
- : "";
907
- this.value[indexs].equipClassify = "";
908
- this.value[indexs].equipClassifyStr = "";
909
- this.$emit("input", this.value);
910
- }
911
- const res = await getEquipmentList({ categoryNo: val }, indexs);
912
- if (res.data.code == 200) {
913
- value = res.data.data.map(item => ({
914
- text: item.name,
915
- value: item.no
916
- }));
917
- }
918
- this.$set(this.muster[key], indexs, value);
919
- },
920
- // 获取单位
921
- async getUnitList() {
922
- const res = await getUnitListData();
923
- if (res.data.code == 0) {
924
- res.data.data = res.data.data.map(item => ({
925
- text: item.name,
926
- value: item.id
927
- }));
928
- this.unitList = res.data.data;
929
- }
930
- },
931
- // 获取团队主营业务
932
- async getTeamBusiness() {
933
- const res = await getTeamCategory();
934
- this.category = res.data && res.data.code == 200 ? res.data.data : [];
935
- },
936
- init() {
937
- if (this.desc.business == "1") {
938
- this.getGooodsType();
939
- this.getUnitList();
940
- } else if (this.desc.business == "2") {
941
- this.getMachineryList();
942
- } else if (this.desc.business == "4") {
943
- this.getTeamBusiness();
944
- }
945
- }
946
- },
947
- created() {
948
- !this.edit && this.init();
949
- setTimeout(() => {
950
- if (this.value.length == 0) {
951
- this.addValue();
952
- }
953
- }, 1000);
954
- this.getHouse();
955
- },
956
- mounted() {},
957
- watch: {
958
- value: {
959
- handler(nv, ov) {
960
- const vm = this;
961
- nv.map((e, i) => {
962
- // return {
963
- // Price: e.Price,
964
- // amount: e.amount,
965
- // brand: e.brand,
966
- // goodType: e.goodType,
967
- // total: e.Price * e.amount,
968
- // unit: e.unit,
969
- // unitStr: e.unitStr
970
- // }
971
- if (!vm.edit && e.Price * e.amount != 0) {
972
- vm.$set(vm.value[i], "total", e.Price * e.amount);
973
- }
974
- vm.$set(vm.value[i], "scck", "市场参考:");
975
- });
976
- },
977
- deep: true
978
- }
979
- }
980
- };
981
- </script>
982
- <style lang="scss" scoped>
983
- ::-webkit-scrollbar {
984
- // width:16px;
985
- height: 4px;
986
- background-color: #f5f5f5;
987
- }
988
- ::-webkit-scrollbar-thumb {
989
- height: 4px;
990
- background: #e4e7ed;
991
- border-radius: 2px;
992
- }
993
- .wrapper {
994
- .tables {
995
- margin-top: 20px;
996
- // border-left: 1px solid #ebeef5;
997
- }
998
- .tables-sub {
999
- border: 1px solid #ebeef5;
1000
- // border-right: 1px solid #ebeef5;
1001
- // border-bottom: 1px solid #ebeef5;
1002
- min-height: 80px;
1003
- // width: 100%;
1004
- overflow: auto;
1005
- // max-width: 980px;
1006
- .disoption {
1007
- &:after {
1008
- content: " ";
1009
- display: block;
1010
- left: 0;
1011
- top: 0;
1012
- right: 0;
1013
- bottom: 0;
1014
- position: absolute;
1015
- z-index: 2;
1016
- cursor: move;
1017
- }
1018
- }
1019
- .el-icon-remove-outline {
1020
- font-size: 26px;
1021
- }
1022
- .parts {
1023
- position: relative;
1024
- text-align: center;
1025
- .heard {
1026
- font-weight: 500;
1027
- height: 40px;
1028
- }
1029
- .botom {
1030
- box-sizing: border-box;
1031
- // border-bottom: 1px solid #ebeef5;
1032
- padding: 10px 10px 10px 20px;
1033
- height: 70px;
1034
- position: relative;
1035
- display: flex;
1036
- }
1037
- }
1038
- }
1039
- .msg {
1040
- min-width: 200px;
1041
- display: flex;
1042
- align-items: center;
1043
- justify-content: center;
1044
- color: #ccc;
1045
- text-align: center;
1046
- width: 100%;
1047
- // border-left: 1px solid #ebeef5;
1048
- height: 70px;
1049
- }
1050
- .form-item-active {
1051
- border: 1px dashed #409eff !important;
1052
- background-color: rgba(2, 134, 223, 0.06) !important;
1053
- position: relative;
1054
- }
1055
- /deep/ .el-icon-delete {
1056
- font-size: 17px !important;
1057
- }
1058
- /deep/ .el-icon-document-copy {
1059
- font-size: 17px !important;
1060
- }
1061
- .form-item-delete-btn {
1062
- background-color: #ff0000;
1063
- border-color: #ff0000;
1064
- height: 30px;
1065
- width: 30px;
1066
- border-radius: 100% !important;
1067
- position: absolute;
1068
- right: 10px;
1069
- top: -15px;
1070
- z-index: 3;
1071
- padding: 4px 6px;
1072
- }
1073
- .form-item-copy-btn {
1074
- position: absolute;
1075
- height: 30px;
1076
- width: 30px;
1077
- border-radius: 100% !important;
1078
- right: 37px;
1079
- top: -15px;
1080
- z-index: 3;
1081
- margin-right: 10px;
1082
- padding: 4px 6px;
1083
- }
1084
- /deep/ .botom .el-form-item__content > div {
1085
- display: flex;
1086
- .el-radio {
1087
- margin-right: 30px !important;
1088
- }
1089
- .el-checkbox {
1090
- margin-right: 30px !important;
1091
- }
1092
- }
1093
- /deep/ .botom .el-form-item__content {
1094
- min-width: 150px;
1095
- }
1096
- /deep/ .over-height {
1097
- height: 40px !important;
1098
- overflow: auto;
1099
- }
1100
- /deep/ .over-height .el-cascader__tags {
1101
- top: 5px;
1102
- transform: translateY(0);
1103
- }
1104
- .ghost {
1105
- opacity: 0.5;
1106
- background: rgb(106, 188, 232);
1107
- }
1108
- }
1109
- </style>
1
+ <template>
2
+ <div class="wrapper">
3
+ <div class="opt">
4
+ <el-button
5
+ v-if="!edit"
6
+ @click="addValue"
7
+ >添加</el-button>
8
+ </div>
9
+ <div class="tables">
10
+ <el-tooltip
11
+ content="从左侧拖拽来添加字段"
12
+ placement="top"
13
+ :disabled="!edit"
14
+ >
15
+ <div class="tables-sub">
16
+ <div
17
+ class="parts"
18
+ v-for="(val,indexs) in computedValue"
19
+ :key="indexs"
20
+ >
21
+ <!-- <div class="msg " v-if="edit">从左侧拖拽来添加字段</div> -->
22
+ <draggable
23
+ :animation="200"
24
+ :disabled="!edit"
25
+ :list="columns"
26
+ ghost-class="ghost"
27
+ @add="handleAdd"
28
+ @end="handleMoveEnd"
29
+ @start="handleMoveStart"
30
+ :group="{ name: 'form', pull: false, put: true}"
31
+ style="display: flex;"
32
+ filter='.nodraggable'
33
+ >
34
+
35
+ <template v-for="(item,index) in columnsValue">
36
+ <div
37
+ class="botom"
38
+ :class="{'form-item-active': (selSubIndex != null && selSubIndex == index && edit && list[activeFormName][selectIndex].field == desc.field),'disoption': edit,'nodraggable': !item.isFlex}"
39
+ :key="index+1"
40
+ v-show="isShowTag(val,item)"
41
+ @click.stop="handleFormItemClick(item,index)"
42
+ >
43
+ <template v-if="item.content">
44
+ <el-form-item>
45
+ <component
46
+ v-if="item.content.type "
47
+ :desc="item.content"
48
+ :is="item.content.type"
49
+ :options="setItemOption(item,index,indexs)"
50
+ v-bind="getAttrs(item.content)"
51
+ v-model="val[item.prop]"
52
+ v-on="item.content.on"
53
+ :class="{'over-height': item.prop == 'category'}"
54
+ :ref="item.prop+indexs"
55
+ >
56
+ </component>
57
+ <!-- <el-select
58
+ v-model="value"
59
+ v-else-if="item.content.field == 'brand'"
60
+ :placeholder="'请选择'+item.content.label"
61
+ >
62
+ <el-option-group
63
+ v-for="group in item.content.options"
64
+ :key="group.value"
65
+ :label="group.text"
66
+ >
67
+ <el-option
68
+ v-for="item in group.options"
69
+ :key="item.value"
70
+ :label="item.label"
71
+ :value="item.value"
72
+ >
73
+ </el-option>
74
+ </el-option-group>
75
+ </el-select> -->
76
+ <!-- <el-select
77
+ v-model="val[item.prop]"
78
+ :placeholder="'请选择'+item.content.label"
79
+ :multiple="item.content.attrs.multiple"
80
+ v-else
81
+ >
82
+ <el-option
83
+ v-for="item2 in item.content.options"
84
+ :key="item2.value"
85
+ :label="item2.text"
86
+ :value="item2.value"
87
+ >
88
+ </el-option>
89
+ </el-select> -->
90
+ </el-form-item>
91
+ </template>
92
+ <!-- 复制按钮 -->
93
+ <template v-if="item.isFlex">
94
+ <!-- <el-button
95
+ @click.stop="handleCopy(index)"
96
+ class="form-item-copy-btn"
97
+ icon="el-icon-document-copy"
98
+ size="mini"
99
+ style="border-radius: 0"
100
+ type="primary"
101
+ v-if="selSubIndex != null && selSubIndex === index && edit && list[activeFormName][selectIndex].field == desc.field"
102
+ >
103
+ </el-button> -->
104
+ <!-- 删除按钮 -->
105
+ <el-button
106
+ @click.stop="handleDelete(index)"
107
+ class="form-item-delete-btn"
108
+ icon="el-icon-delete"
109
+ size="mini"
110
+ style="border-radius: 0"
111
+ type="primary"
112
+ v-if="selSubIndex != null && selSubIndex === index && edit && list[activeFormName][selectIndex].field == desc.field"
113
+ >
114
+ </el-button>
115
+ </template>
116
+ </div>
117
+ <!-- TODO: 多选后如果有自定义选项 则渲染在选择项后方 -->
118
+ <template v-if="propertyList[indexs] && propertyList[indexs].length && item.prop =='goodType'">
119
+ <div
120
+ class="botom"
121
+ v-for="(pro,j) in propertyList[indexs]"
122
+ :key="'pro'+j"
123
+ >
124
+ <el-form-item>
125
+
126
+ <component
127
+ :desc="{label: pro.name,on: {'change': (val)=>{setProStr(val,pro,indexs)}}}"
128
+ :is="pro.key == 0 ? 'ele-form-input' : 'ele-form-select'"
129
+ :options="propertyList[indexs][j].data"
130
+ v-model="val['pro-'+pro.propertyId]"
131
+ >
132
+ </component>
133
+ </el-form-item>
134
+ <span
135
+ style="padding-left: 4px; word-break: keep-all;"
136
+ v-if="pro.unit"
137
+ >{{pro.unit}}</span>
138
+
139
+ </div>
140
+ </template>
141
+ </template>
142
+
143
+ <!-- TODO: 这里暂放市场参考字段 -->
144
+ <!-- <div class="msg nodraggable">市场参考:</div> -->
145
+ <div
146
+ class="msg nodraggable"
147
+ v-if="columnsValue.length === 0"
148
+ >暂未添加字段</div>
149
+ <div
150
+ class="msg nodraggable"
151
+ v-if="columnsValue.length > 0 && edit"
152
+ > </div>
153
+ <div
154
+ class="botom"
155
+ v-if="!edit"
156
+ >
157
+ <el-button
158
+ type="text"
159
+ @click="deteleVal(indexs)"
160
+ >删除</el-button>
161
+ </div>
162
+ </draggable>
163
+ </div>
164
+ </div>
165
+ </el-tooltip>
166
+ </div>
167
+
168
+ </div>
169
+ </template>
170
+
171
+ <script>
172
+ import * as _ from "lodash";
173
+ // import draggable from "vuedraggable";
174
+
175
+ const draggable = () => ({
176
+ // 需要加载的组件 (应该是一个 `Promise` 对象)
177
+ component: import("vuedraggable"),
178
+ // 异步组件加载时使用的组件
179
+ loading: "",
180
+ // 加载失败时使用的组件
181
+ error: "",
182
+ // 展示加载时组件的延时时间。默认值是 200 (毫秒)
183
+ delay: 200,
184
+ // 如果提供了超时时间且组件加载也超时了,
185
+ // 则使用加载失败时使用的组件。默认值是:`Infinity`
186
+ timeout: 3000
187
+ });
188
+ import { mapGetters, mapMutations, mapState } from "vuex";
189
+ import {
190
+ getGooodsType,
191
+ getGooodsBrand,
192
+ getMachineryList,
193
+ getMachineryType,
194
+ getEquipmentList,
195
+ getUnitListData,
196
+ getGooodsProperty,
197
+ concreteStrongAll,
198
+ concreteAdmixtureAll,
199
+ getMechanicsAttr,
200
+ getEquipProp,
201
+ modelSelect,
202
+ brandSelect,
203
+ gearboxSelect,
204
+ gethouseType,
205
+ getTeamCategory
206
+ } from "@/formBuilder/apiBusiness.js";
207
+ import columnsVue from "../../components/app-main/components/components/columns.vue";
208
+ // import { requesTypeOptions } from "../../../views/CustomerManagement/MemberChance/mock";
209
+ import itemOptionVue from "../../components/app-main/components/components/itemOption.vue";
210
+ import { isArraysEqual } from "@fullcalendar/core";
211
+ import { carSeating, driveModel, carYear } from "./data";
212
+ export default {
213
+ name: "Purchase",
214
+ extends: {},
215
+ components: {
216
+ draggable
217
+ },
218
+ props: {
219
+ value: {
220
+ type: Array,
221
+ default: () => []
222
+ },
223
+ columns: {
224
+ type: Array,
225
+ default: () => []
226
+ },
227
+ desc: {
228
+ type: Object,
229
+ default: () => {
230
+ return {};
231
+ }
232
+ },
233
+ edit: {
234
+ type: Boolean,
235
+ default: () => false
236
+ }
237
+ },
238
+ data() {
239
+ return {
240
+ // 商品分类
241
+ goodsOption: [],
242
+ Mechanics: [],
243
+ equipment: [],
244
+ team: [],
245
+ bidding: [],
246
+ biddingType: [
247
+ { text: "商品/材料", value: "3" },
248
+ { text: "工程分包", value: "4" },
249
+ { text: "机械设备租赁", value: "1" },
250
+ { text: "劳务", value: "2" }
251
+ ],
252
+ // 自定义属性
253
+ muster: {
254
+ brand: []
255
+ },
256
+ unitList: [],
257
+ propertyList: [],
258
+ strength: [],
259
+ admixture: [],
260
+ // 车辆信息
261
+ carModel: [],
262
+ carBrand: [],
263
+ carGearbox: [],
264
+ carSeating: carSeating,
265
+ driveModel: driveModel,
266
+ carYear: carYear(),
267
+ houseType: [],
268
+ category: []
269
+ };
270
+ },
271
+ computed: {
272
+ ...mapState(["selSubIndex", "activeFormName", "list", "selectIndex"]),
273
+ ...mapGetters(["currentFormItem"]),
274
+ computedValue: function() {
275
+ if (this.value.length > 0) {
276
+ return this.value;
277
+ } else {
278
+ const type = ["checkbox", "datetimerange", "cascader"];
279
+ const arr = {};
280
+ this.columns.forEach(item => {
281
+ if (item.prop) {
282
+ const typeStr = item.content.type.replace("ele-form-", "");
283
+ arr[item.prop] = type.indexOf(typeStr) > -1 ? [] : "";
284
+ }
285
+ });
286
+ return [arr];
287
+ }
288
+ },
289
+ draggableColumns() {
290
+ return this.columns;
291
+ },
292
+ columnsValue() {
293
+ return _.cloneDeep(this.columns);
294
+ }
295
+ },
296
+ methods: {
297
+ ...mapMutations(["updateSelSubIndex", "updateSelectIndex", "updateList"]),
298
+ isShowTag(val, item) {
299
+ if (item.content && item.content.vif && Array.isArray(item.content.vif)) {
300
+ const node = item.isLink ? item.isLink : "leaseType";
301
+ return item.content.vif.indexOf(val[node]) > -1;
302
+ } else {
303
+ return true;
304
+ }
305
+ },
306
+ setProStr(val, pro, j) {
307
+ if (!val) return;
308
+ const name =
309
+ pro.key == 1 && pro.data.length > 0
310
+ ? pro.data.filter(item => item.value == val)[0].text
311
+ : val;
312
+ this.value[j]["pro-" + pro.propertyId + "-Str"] = {
313
+ value: name,
314
+ property: pro.name,
315
+ unit: pro.unit
316
+ };
317
+ this.$emit("input", this.value);
318
+ },
319
+ setValue(prop, index) {
320
+ if (prop) {
321
+ const val = this.value.filter(item => item[prop]);
322
+ return val[0][prop];
323
+ } else {
324
+ return index + 1;
325
+ }
326
+ },
327
+ getAttrs(item) {
328
+ return Object.assign({}, item.attrs);
329
+ },
330
+ // option设置
331
+ setItemOption(item, index, indexs) {
332
+ const arr = [];
333
+ const vm = this;
334
+
335
+ if (!item.content.options) return [];
336
+ if (item.content.field == "leaseType") {
337
+ item.content["on"] = {
338
+ change: newVal => {
339
+ vm.leaseTypeChange(newVal, item, indexs);
340
+ }
341
+ };
342
+ }
343
+ if (item.content.options && typeof item.content.options != "string") {
344
+ return item.content.options;
345
+ } else {
346
+ if (item.content.types) {
347
+ // vm.$nextTick(function() {
348
+ item.content["on"] = {
349
+ change: async newVal => {
350
+ await vm.handleChange(newVal, item, indexs);
351
+ }
352
+ };
353
+ item["on"] = {
354
+ change: async newVal => {
355
+ await vm.handleChange(newVal, item, indexs);
356
+ }
357
+ };
358
+ // });
359
+ return vm[item.content.options];
360
+ } else if (!item.content.types) {
361
+ item.content["on"] = {
362
+ change: newVal => {
363
+ vm.handleChangeOption(newVal, item, indexs);
364
+ }
365
+ };
366
+ const key = item.content.options;
367
+ !this.muster[key] && this.$set(this.muster, key, []);
368
+ !this.muster[key][indexs] && this.$set(this.muster[key], indexs, []);
369
+ return this.muster[key][indexs];
370
+ }
371
+ }
372
+ },
373
+ // 租赁类型变化
374
+ leaseTypeChange(newVal, item, indexs) {
375
+ if (newVal == 1) {
376
+ this.getMachineryList();
377
+ } else if (newVal == 2) {
378
+ this.getEquipmentList();
379
+ } else if (newVal == 3) {
380
+ this.initCarInfo();
381
+ } else if (newVal == 4) {
382
+ this.getHouse();
383
+ }
384
+ Object.keys(this.value[indexs]).forEach(k => {
385
+ if (k.indexOf("pro-") > -1) {
386
+ delete this.value[indexs][k];
387
+ } else if (k != "leaseType") {
388
+ const type = Array.isArray(this.value[indexs][k]);
389
+ this.value[indexs][k] = type ? [] : "";
390
+ }
391
+ });
392
+ this.$emit("input", this.value);
393
+ },
394
+ // 加载车辆选择框信息
395
+ async initCarInfo() {
396
+ if (this.carModel.length == 0) {
397
+ const res = await modelSelect();
398
+ this.carModel =
399
+ res.data.code == 200
400
+ ? res.data.data.map((item, index) => ({
401
+ text: item.name,
402
+ value: item.key
403
+ }))
404
+ : [];
405
+ }
406
+ if (this.carBrand.length == 0) {
407
+ const res = await brandSelect();
408
+ this.carBrand =
409
+ res.data.code == 200
410
+ ? res.data.data.map((item, index) => ({
411
+ text: item.name,
412
+ value: item.key
413
+ }))
414
+ : [];
415
+ }
416
+ if (this.carGearbox.length == 0) {
417
+ const res = await gearboxSelect();
418
+ this.carGearbox =
419
+ res.data.code == 200
420
+ ? res.data.data.map((item, index) => ({
421
+ text: item.value,
422
+ value: item.key
423
+ }))
424
+ : [];
425
+ }
426
+ },
427
+ // 父级元素数据发生变化
428
+ handleChange(val, item, indexs) {
429
+ // TODO: 在这里进行了点击事件的获取值
430
+ const vm = this;
431
+ if (item.content.types == "goods") {
432
+ const str = this.goodsOption.filter(k => val[0] && k.id == val[0]);
433
+ if (str[0] && str[0].name == "商砼") {
434
+ this.getConcrete(val, item, indexs);
435
+ } else {
436
+ this.getGooodsBrand(val, item, indexs);
437
+ this.getGooodsProperty(val, item, indexs);
438
+ }
439
+ } else if (item.content.types == "Mechanics") {
440
+ this.getMachineryType(val, item, indexs);
441
+ } else if (item.content.types == "equipment") {
442
+ this.getEquipmentType(val, item, indexs);
443
+ } else if (item.content.types == "team") {
444
+ this.setTeamStr(val, item, indexs, "team");
445
+ } else if (item.content.types == "car") {
446
+ this.setTeamStr(val, item, indexs, item.prop);
447
+ } else if (item.content.types == "houseType") {
448
+ setTimeout(() => {
449
+ const text = vm.$refs[item.content.field + indexs][0].presentText;
450
+ vm.value[indexs][item.content.field + "Str"] = text || "";
451
+ vm.$emit("input", vm.value);
452
+ }, 200);
453
+ } else if (item.content.types == "category") {
454
+ setTimeout(() => {
455
+ const tags = vm.$refs[item.content.field + indexs][0].presentTags;
456
+ const text = tags.map ? tags.map((item, index) => item.text) : [];
457
+ vm.value[indexs][item.content.field + "Str"] = text.join(",");
458
+ vm.$emit("input", vm.value);
459
+ }, 200);
460
+ } else if (item.content.types == "unitList") {
461
+ vm.setTeamStr(val, item, indexs, "unitList");
462
+ }
463
+ },
464
+ setTeamStr(val, item, indexs, types) {
465
+ const name = this[types].filter(i => i.value == val);
466
+ this.value[indexs][item.content.field + "Str"] = name[0]
467
+ ? name[0].text
468
+ : "";
469
+ this.$emit("input", this.value);
470
+ },
471
+ // 子级元素发生变化
472
+ handleChangeOption(newVal, item, indexs) {
473
+ console.log(newVal, item, indexs);
474
+ const name = this.muster[item.content.options][indexs].filter(
475
+ i => i.value == newVal
476
+ );
477
+ const nameStr = name[0].text;
478
+ const key = item.content.field + "Str";
479
+ this.value[indexs][key] = nameStr;
480
+ this.$emit("input", this.value);
481
+ if (item.prop == "classify" || item.prop == "equipClassify") {
482
+ this.getClassifyPro(newVal, item, indexs);
483
+ }
484
+ },
485
+ // 获取机械自定义属性
486
+ async getClassifyPro(newVal, item, indexs) {
487
+ Object.keys(this.value[indexs]).forEach(k => {
488
+ if (k.indexOf("pro-") > -1) {
489
+ delete this.value[indexs][k];
490
+ }
491
+ });
492
+ const params = {
493
+ categoryNo:
494
+ item.prop == "classify"
495
+ ? this.value[indexs].Mechanics
496
+ : this.value[indexs].equipment,
497
+ typeNo: newVal
498
+ };
499
+ const res =
500
+ item.prop == "classify"
501
+ ? await getMechanicsAttr(params)
502
+ : await getEquipProp(params);
503
+ if (res.data.code == 200) {
504
+ let propertyList = [];
505
+ if (item.prop == "classify") {
506
+ propertyList = res.data.data.map((item, index) => {
507
+ item.data = item.valList.map(i => ({
508
+ text: i.startVal,
509
+ value: i.startVal
510
+ }));
511
+ item.propertyId = index;
512
+ return item;
513
+ });
514
+ } else {
515
+ res.data.data.forEach((item, index) => {
516
+ item.data = item.valList.map(i => ({ text: i.val, value: i.val }));
517
+ item.propertyId = index;
518
+ propertyList.push({
519
+ name: item.name,
520
+ propertyId: index,
521
+ data: item.data,
522
+ unit: item.unit,
523
+ key: item.attrKey
524
+ });
525
+ });
526
+ }
527
+ this.$set(this.propertyList, indexs, propertyList);
528
+ }
529
+ },
530
+ // 点击选中
531
+ handleFormItemClick(item, index) {
532
+ if (!this.edit) return;
533
+ if (item.type != "index") {
534
+ this.list[this.activeFormName].forEach((i, v) => {
535
+ if (i.field == this.desc.field) {
536
+ this.updateSelectIndex(v);
537
+ }
538
+ });
539
+ this.updateSelSubIndex(index);
540
+ }
541
+ },
542
+ // 复制
543
+ handleCopy(index) {
544
+ const obj = _.cloneDeep(this.columns[index]);
545
+ obj.field = `key_${Date.now()}`;
546
+ this.columns.splice(index + 1, 0, obj);
547
+ this.setListColumns(this.columns);
548
+ this.updateSelSubIndex(index + 1);
549
+ },
550
+ // 删除
551
+ handleDelete(index) {
552
+ this.columns.splice(index, 1);
553
+ this.setListColumns(this.columns);
554
+ // 如果删除的最后一个, 则重新选择最后一个
555
+ if (index >= this.columns.length) {
556
+ this.updateSelSubIndex(this.columns.length - 1);
557
+ } else if (index - 1 < 1 && this.columns > 1) {
558
+ this.updateSelSubIndex(1);
559
+ } else {
560
+ this.updateSelSubIndex(null);
561
+ }
562
+ },
563
+ // 新增
564
+
565
+ handleAdd(res) {
566
+ const vm = this;
567
+ if (!this.columns[res.newIndex]) {
568
+ res.newIndex = this.columns.length - 1;
569
+ }
570
+ // if (!this.columns[res.newIndex].type) {
571
+ // this.$message.error("业务组件字段请添加至最右侧");
572
+ // return;
573
+ // }
574
+ if (
575
+ this.columns[res.newIndex].type &&
576
+ (this.columns[res.newIndex].type.indexOf("custom-table") > -1 ||
577
+ this.columns[res.newIndex].type.indexOf("columns") > -1 ||
578
+ this.columns[res.newIndex].type.indexOf("quill-editor") > -1)
579
+ ) {
580
+ this.$message.error("不支持添加此类型控件,请添加其他类型控件");
581
+ this.columns.splice(res.newIndex, 1);
582
+ return;
583
+ }
584
+ // let obj = this.columns[res.newIndex].type?this.columns[res.newIndex]:this.columns[res.newIndex+1] ;
585
+ const obj = this.columns[res.newIndex];
586
+ let content = {};
587
+ // 如果是单选框 多选框 进入表格 则添加下拉框
588
+ if (obj.type && (obj.type === "radio" || obj.type === "checkbox")) {
589
+ if (obj.type === "checkbox") {
590
+ obj.attrs["multiple"] = true;
591
+ }
592
+ obj.type = "ele-form-select";
593
+ content = obj;
594
+ this.columns[res.newIndex] = {
595
+ prop: obj.field,
596
+ label: obj.label,
597
+ isFlex: true,
598
+ content: content
599
+ };
600
+ }
601
+ // if (!obj.type) {
602
+ vm.columns.map((e, i) => {
603
+ if (e.field) {
604
+ e.type = "ele-form-" + e.type;
605
+ this.columns[i] = {
606
+ prop: e.field,
607
+ label: e.label,
608
+ isFlex: true,
609
+ content: e
610
+ };
611
+ }
612
+ if (e.type === "ele-form-radio" || e.type === "ele-form-checkbox") {
613
+ if (e.type === "ele-form-checkbox") {
614
+ e.attrs["multiple"] = true;
615
+ }
616
+ e.type = "ele-form-select";
617
+ }
618
+ });
619
+ // }
620
+ this.setListColumns(this.columns);
621
+ this.list[this.activeFormName].forEach((i, v) => {
622
+ if (i.field == vm.desc.field) {
623
+ this.updateSelectIndex(v);
624
+ }
625
+ });
626
+ this.updateSelSubIndex(res.newIndex);
627
+ },
628
+
629
+ // 移动开始
630
+ handleMoveStart(res) {
631
+ this.updateSelSubIndex(res.oldIndex);
632
+ },
633
+ // 移动结束
634
+ handleMoveEnd(res) {
635
+ const columns = this.columns.filter(item => !item.isFlex);
636
+ if (res.newIndex < columns.length) {
637
+ return false;
638
+ }
639
+ this.setListColumns(this.columns);
640
+ this.updateSelSubIndex(res.newIndex);
641
+ },
642
+ setListColumns(columns) {
643
+ const vm = this;
644
+ const list = _.cloneDeep(this.list);
645
+ list[vm.activeFormName].forEach(item => {
646
+ if (item.field == vm.desc.field) {
647
+ item.attrs.columns = columns;
648
+ }
649
+ });
650
+ vm.updateList({
651
+ name: vm.activeFormName,
652
+ newList: list[vm.activeFormName]
653
+ });
654
+ },
655
+ addValue() {
656
+ const type = ["checkbox", "datetimerange", "cascader"];
657
+
658
+ const obj = {};
659
+ this.columns.forEach(item => {
660
+ if (item.prop) {
661
+ const typeStr = item.content.type.replace("ele-form-", "");
662
+ obj[item.prop] = type.indexOf(typeStr) > -1 ? [] : "";
663
+ }
664
+ });
665
+ this.value.push(obj);
666
+ this.$emit("input", this.value);
667
+ },
668
+ deteleVal(index) {
669
+ if (this.value.length < 2) {
670
+ this.$message.error("至少保留一条数据");
671
+ return;
672
+ }
673
+ Object.keys(this.muster).forEach(item => {
674
+ this.muster[item].splice(index, 1);
675
+ });
676
+ this.propertyList.splice(index, 1);
677
+ this.value.splice(index, 1);
678
+ this.$emit("input", this.value);
679
+ },
680
+ // 房产分类
681
+ async getHouse() {
682
+ if (this.houseType.length == 0) {
683
+ const res = await gethouseType({ type: 0 });
684
+ this.houseType = res.data.code == 200 ? res.data.data : [];
685
+ }
686
+ },
687
+ // 商品分类
688
+ async getGooodsType() {
689
+ const res = await getGooodsType({ type: "purchase" });
690
+ if (res.status == 200) {
691
+ this.goodsOption = this.formatChildData(res.data);
692
+ }
693
+ },
694
+ formatChildData(data) {
695
+ data.forEach((item, index) => {
696
+ if (item.children && item.children.length > 0) {
697
+ return this.formatChildData(item.children);
698
+ } else {
699
+ delete item.children;
700
+ }
701
+ });
702
+ return data;
703
+ },
704
+ // 商品品牌
705
+ async getGooodsBrand(val, item, indexs, flg) {
706
+ let value = [];
707
+ const vm = this;
708
+ const key = item.content.link;
709
+ if (!flg) {
710
+ vm.value[indexs].brand = "";
711
+ vm.value[indexs].brandStr = "";
712
+ setTimeout(() => {
713
+ const text =
714
+ vm.$refs[item.content.field + indexs][0].$refs.input.value;
715
+ vm.value[indexs][item.content.field + "Str"] = text || "";
716
+ vm.$emit("input", vm.value);
717
+ }, 100);
718
+ }
719
+ const data = val[val.length - 1];
720
+ if (!data) return;
721
+ const res = await getGooodsBrand(data, indexs);
722
+ if (res.data.code == 0) {
723
+ value = res.data.data.reduce(
724
+ (total, currentValue) => total.concat(currentValue.options),
725
+ []
726
+ );
727
+ value = value.map(i => ({ text: i.brandName, value: i.id }));
728
+ }
729
+
730
+ vm.$set(vm.muster[key], indexs, value);
731
+ },
732
+ // 商品属性
733
+ async getGooodsProperty(val, item, indexs, flg) {
734
+ const id = val[val.length - 1];
735
+ if (!id) return;
736
+ if (!flg) {
737
+ Object.keys(this.value[indexs]).forEach(k => {
738
+ if (k.indexOf("pro-") > -1) {
739
+ delete this.value[indexs][k];
740
+ }
741
+ });
742
+ this.$emit("input", this.value);
743
+ }
744
+ const res = await getGooodsProperty(id, indexs);
745
+ if (res.data.code == 0) {
746
+ const list = res.data.data;
747
+ const propertyList = []; // 商品属性列表
748
+ for (let i = 0; i < list.length; i++) {
749
+ if (list[i].itemparamname === "仓储") {
750
+ continue;
751
+ }
752
+ let flag = true;
753
+ for (let j = 0; j < propertyList.length; j++) {
754
+ // 去重 合并属性名相同的项
755
+ if (propertyList[j].name === list[i].itemparamname) {
756
+ propertyList[j].data.push({
757
+ text: list[i].valdata,
758
+ value: list[i].id
759
+ });
760
+ flag = false;
761
+ break;
762
+ }
763
+ }
764
+ if (flag) {
765
+ // 非重复 添加商品属性和id
766
+ const obj = {
767
+ name: list[i].itemparamname,
768
+ data: [],
769
+ key: 1
770
+ };
771
+ obj.data.push({ text: list[i].valdata, value: list[i].id });
772
+ obj.propertyId = list[i].itemparamid;
773
+ propertyList.push(obj);
774
+ }
775
+ }
776
+ this.$set(this.propertyList, indexs, propertyList);
777
+ } else {
778
+ this.$set(this.propertyList, indexs, []);
779
+ }
780
+ },
781
+ // 商砼属性
782
+ async getConcrete(val, item, indexs, flg) {
783
+ const vm = this;
784
+ setTimeout(() => {
785
+ const text = vm.$refs[item.content.field + indexs][0].$refs.input.value;
786
+ vm.value[indexs][item.content.field + "Str"] = text || "";
787
+ vm.$emit("input", vm.value);
788
+ }, 100);
789
+ if (this.strength.length == 0) {
790
+ const business = await concreteStrongAll();
791
+ this.strength = business.data.result.map
792
+ ? business.data.result.map(i => ({
793
+ text: i.strongLevel,
794
+ value: i.sort
795
+ }))
796
+ : [];
797
+ }
798
+ if (this.admixture.length == 0) {
799
+ const res = await concreteAdmixtureAll();
800
+ this.admixture = this.formatData(res.data.result);
801
+ }
802
+ if (!flg) {
803
+ Object.keys(this.value[indexs]).forEach(k => {
804
+ if (k.indexOf("pro-") > -1) {
805
+ delete this.value[indexs][k];
806
+ }
807
+ });
808
+ this.$emit("input", this.value);
809
+ }
810
+ const propertyList = [];
811
+ propertyList.push({
812
+ name: "强度等级",
813
+ data: this.strength,
814
+ propertyId: "1",
815
+ key: 1
816
+ });
817
+ propertyList.push({
818
+ name: "外加剂",
819
+ data: this.admixture,
820
+ propertyId: "2",
821
+ key: 1
822
+ });
823
+ this.$set(this.propertyList, indexs, propertyList);
824
+ },
825
+ // 数据分组
826
+ setGroup(arr) {
827
+ const dataInfo = {};
828
+ arr.forEach((item, index) => {
829
+ const { admixtureName, spec } = item;
830
+ if (!dataInfo[admixtureName]) {
831
+ dataInfo[admixtureName] = {
832
+ admixtureName: item.admixtureName,
833
+ spec: item.admixtureName,
834
+ children: []
835
+ };
836
+ }
837
+ if (item.spec && item.admixtureName) {
838
+ dataInfo[admixtureName].children.push({
839
+ admixtureName: item.admixtureName + "-" + item.spec,
840
+ spec: item.admixtureName + "-" + item.spec
841
+ });
842
+ } else {
843
+ dataInfo[admixtureName].children = null;
844
+ }
845
+ });
846
+ const list = Object.values(dataInfo);
847
+ return list;
848
+ },
849
+ // 外加剂
850
+ formatData(data) {
851
+ return data.map((item, index) => {
852
+ const name = item.admixtureName + item.spec;
853
+ return { text: name, value: name };
854
+ });
855
+ },
856
+ // 机械分类
857
+ async getMachineryList() {
858
+ const res = await getMachineryList();
859
+ if (res.data.code == 200) {
860
+ this.Mechanics = res.data.data.map(item => ({
861
+ text: item.name,
862
+ value: item.no
863
+ }));
864
+ }
865
+ },
866
+ // 机械类型
867
+ async getMachineryType(val, item, indexs, flg) {
868
+ let value = [];
869
+ const key = item.content.link;
870
+ if (!flg) {
871
+ const name = this.Mechanics.filter(i => i.value == val);
872
+ this.value[indexs][item.content.field + "Str"] = name[0]
873
+ ? name[0].text
874
+ : "";
875
+ this.value[indexs].classify = "";
876
+ this.value[indexs].classifyStr = "";
877
+ this.$emit("input", this.value);
878
+ }
879
+ const res = await getMachineryType({ categoryNo: val }, indexs);
880
+ if (res.data.code == 200) {
881
+ value = res.data.data.map(item => ({
882
+ text: item.name,
883
+ value: item.no
884
+ }));
885
+ }
886
+ this.$set(this.muster[key], indexs, value);
887
+ },
888
+ // 设备分类
889
+ async getEquipmentList(val, item, indexs) {
890
+ const res = await getEquipmentList({});
891
+ if (res.data.code == 200) {
892
+ this.equipment = res.data.data.map(item => ({
893
+ text: item.name,
894
+ value: item.no
895
+ }));
896
+ }
897
+ },
898
+ // 设备类型
899
+ async getEquipmentType(val, item, indexs, flg) {
900
+ let value = [];
901
+ const key = item.content.link;
902
+ if (!flg) {
903
+ const name = this.equipment.filter(i => i.value == val);
904
+ this.value[indexs][item.content.field + "Str"] = name[0]
905
+ ? name[0].text
906
+ : "";
907
+ this.value[indexs].equipClassify = "";
908
+ this.value[indexs].equipClassifyStr = "";
909
+ this.$emit("input", this.value);
910
+ }
911
+ const res = await getEquipmentList({ categoryNo: val }, indexs);
912
+ if (res.data.code == 200) {
913
+ value = res.data.data.map(item => ({
914
+ text: item.name,
915
+ value: item.no
916
+ }));
917
+ }
918
+ this.$set(this.muster[key], indexs, value);
919
+ },
920
+ // 获取单位
921
+ async getUnitList() {
922
+ const res = await getUnitListData();
923
+ if (res.data.code == 0) {
924
+ res.data.data = res.data.data.map(item => ({
925
+ text: item.name,
926
+ value: item.id
927
+ }));
928
+ this.unitList = res.data.data;
929
+ }
930
+ },
931
+ // 获取团队主营业务
932
+ async getTeamBusiness() {
933
+ const res = await getTeamCategory();
934
+ this.category = res.data && res.data.code == 200 ? res.data.data : [];
935
+ },
936
+ init() {
937
+ if (this.desc.business == "1") {
938
+ this.getGooodsType();
939
+ this.getUnitList();
940
+ } else if (this.desc.business == "2") {
941
+ this.getMachineryList();
942
+ } else if (this.desc.business == "4") {
943
+ this.getTeamBusiness();
944
+ }
945
+ }
946
+ },
947
+ created() {
948
+ !this.edit && this.init();
949
+ setTimeout(() => {
950
+ if (this.value.length == 0) {
951
+ this.addValue();
952
+ }
953
+ }, 1000);
954
+ this.getHouse();
955
+ },
956
+ mounted() {},
957
+ watch: {
958
+ value: {
959
+ handler(nv, ov) {
960
+ const vm = this;
961
+ nv.map((e, i) => {
962
+ // return {
963
+ // Price: e.Price,
964
+ // amount: e.amount,
965
+ // brand: e.brand,
966
+ // goodType: e.goodType,
967
+ // total: e.Price * e.amount,
968
+ // unit: e.unit,
969
+ // unitStr: e.unitStr
970
+ // }
971
+ if (!vm.edit && e.Price * e.amount != 0) {
972
+ vm.$set(vm.value[i], "total", e.Price * e.amount);
973
+ }
974
+ vm.$set(vm.value[i], "scck", "市场参考:");
975
+ });
976
+ },
977
+ deep: true
978
+ }
979
+ }
980
+ };
981
+ </script>
982
+ <style lang="scss" scoped>
983
+ ::-webkit-scrollbar {
984
+ // width:16px;
985
+ height: 4px;
986
+ background-color: #f5f5f5;
987
+ }
988
+ ::-webkit-scrollbar-thumb {
989
+ height: 4px;
990
+ background: #e4e7ed;
991
+ border-radius: 2px;
992
+ }
993
+ .wrapper {
994
+ .tables {
995
+ margin-top: 20px;
996
+ // border-left: 1px solid #ebeef5;
997
+ }
998
+ .tables-sub {
999
+ border: 1px solid #ebeef5;
1000
+ // border-right: 1px solid #ebeef5;
1001
+ // border-bottom: 1px solid #ebeef5;
1002
+ min-height: 80px;
1003
+ // width: 100%;
1004
+ overflow: auto;
1005
+ // max-width: 980px;
1006
+ .disoption {
1007
+ &:after {
1008
+ content: " ";
1009
+ display: block;
1010
+ left: 0;
1011
+ top: 0;
1012
+ right: 0;
1013
+ bottom: 0;
1014
+ position: absolute;
1015
+ z-index: 2;
1016
+ cursor: move;
1017
+ }
1018
+ }
1019
+ .el-icon-remove-outline {
1020
+ font-size: 26px;
1021
+ }
1022
+ .parts {
1023
+ position: relative;
1024
+ text-align: center;
1025
+ .heard {
1026
+ font-weight: 500;
1027
+ height: 40px;
1028
+ }
1029
+ .botom {
1030
+ box-sizing: border-box;
1031
+ // border-bottom: 1px solid #ebeef5;
1032
+ padding: 10px 10px 10px 20px;
1033
+ height: 70px;
1034
+ position: relative;
1035
+ display: flex;
1036
+ }
1037
+ }
1038
+ }
1039
+ .msg {
1040
+ min-width: 200px;
1041
+ display: flex;
1042
+ align-items: center;
1043
+ justify-content: center;
1044
+ color: #ccc;
1045
+ text-align: center;
1046
+ width: 100%;
1047
+ // border-left: 1px solid #ebeef5;
1048
+ height: 70px;
1049
+ }
1050
+ .form-item-active {
1051
+ border: 1px dashed #409eff !important;
1052
+ background-color: rgba(2, 134, 223, 0.06) !important;
1053
+ position: relative;
1054
+ }
1055
+ /deep/ .el-icon-delete {
1056
+ font-size: 17px !important;
1057
+ }
1058
+ /deep/ .el-icon-document-copy {
1059
+ font-size: 17px !important;
1060
+ }
1061
+ .form-item-delete-btn {
1062
+ background-color: #ff0000;
1063
+ border-color: #ff0000;
1064
+ height: 30px;
1065
+ width: 30px;
1066
+ border-radius: 100% !important;
1067
+ position: absolute;
1068
+ right: 10px;
1069
+ top: -15px;
1070
+ z-index: 3;
1071
+ padding: 4px 6px;
1072
+ }
1073
+ .form-item-copy-btn {
1074
+ position: absolute;
1075
+ height: 30px;
1076
+ width: 30px;
1077
+ border-radius: 100% !important;
1078
+ right: 37px;
1079
+ top: -15px;
1080
+ z-index: 3;
1081
+ margin-right: 10px;
1082
+ padding: 4px 6px;
1083
+ }
1084
+ /deep/ .botom .el-form-item__content > div {
1085
+ display: flex;
1086
+ .el-radio {
1087
+ margin-right: 30px !important;
1088
+ }
1089
+ .el-checkbox {
1090
+ margin-right: 30px !important;
1091
+ }
1092
+ }
1093
+ /deep/ .botom .el-form-item__content {
1094
+ min-width: 150px;
1095
+ }
1096
+ /deep/ .over-height {
1097
+ height: 40px !important;
1098
+ overflow: auto;
1099
+ }
1100
+ /deep/ .over-height .el-cascader__tags {
1101
+ top: 5px;
1102
+ transform: translateY(0);
1103
+ }
1104
+ .ghost {
1105
+ opacity: 0.5;
1106
+ background: rgb(106, 188, 232);
1107
+ }
1108
+ }
1109
+ </style>