cloud-web-corejs 1.0.54-dev.54 → 1.0.54-dev.541

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 (427) hide show
  1. package/package.json +21 -3
  2. package/src/App.vue +30 -34
  3. package/src/api/user.js +16 -0
  4. package/src/components/Qrcode/fileParse.vue +0 -1
  5. package/src/components/Tinymce/index.vue +112 -71
  6. package/src/components/VabUpload/image-viewer.vue +2 -2
  7. package/src/components/VabUpload/index.js +2 -1
  8. package/src/components/VabUpload/mixins.js +2 -2
  9. package/src/components/VabUpload/privateProfileDialogMixins.js +1 -1063
  10. package/src/components/VabUpload/propertiesDialog.vue +1 -1
  11. package/src/components/VabUpload/view.vue +209 -120
  12. package/src/components/advancedSearchDialog/mixins.js +1 -1
  13. package/src/components/base-textarea/index.vue +104 -0
  14. package/src/components/baseAlert/mixins.js +1 -1
  15. package/src/components/baseAttachment/index.vue +49 -40
  16. package/src/components/baseAttachment/mixins.js +2 -1
  17. package/src/components/baseInputExport/index.vue +19 -12
  18. package/src/components/baseInputExport/mixins.js +1 -1
  19. package/src/components/baseTabs/mixins.js +1 -1
  20. package/src/components/code-editor/index.vue +102 -63
  21. package/src/components/confirmDialog/index.vue +24 -17
  22. package/src/components/confirmDialog/mixins.js +1 -1
  23. package/src/components/errorMsg/index.vue +42 -34
  24. package/src/components/errorMsg/mixins.js +6 -5
  25. package/src/components/excelExport/button.vue +57 -4
  26. package/src/components/excelExport/exportFieldDialog.vue +215 -81
  27. package/src/components/excelExport/index.js +6 -6
  28. package/src/components/excelExport/index.vue +56 -2
  29. package/src/components/excelExport/mixins.js +3 -2
  30. package/src/components/excelImport/mixins.js +2 -1
  31. package/src/components/fileLibrary/fileObjAuthDialog.vue +179 -89
  32. package/src/components/fileLibrary/fileObjAuthEditDialog.vue +6 -0
  33. package/src/components/fileLibrary/filterDialog.vue +454 -0
  34. package/src/components/fileLibrary/index.vue +599 -254
  35. package/src/components/fileLibrary/mixins/categoryMoveDialogMixins.js +1 -1
  36. package/src/components/fileLibrary/mixins/fileCategoryDialogMixins.js +1 -1
  37. package/src/components/fileLibrary/mixins/fileHistoryDialogMixins.js +2 -2
  38. package/src/components/fileLibrary/mixins/fileObjAuthDialogMixin.js +339 -211
  39. package/src/components/fileLibrary/mixins/fileObjAuthEditDialogMixin.js +31 -27
  40. package/src/components/fileLibrary/mixins/fileObjAuthEditMixin.js +4 -4
  41. package/src/components/fileLibrary/mixins/indexMixins.js +220 -101
  42. package/src/components/fileLibrary/mixins/propertiesDialogMixins.js +64 -4
  43. package/src/components/fileLibrary/mixins/recycleBinDialogMixins.js +3 -3
  44. package/src/components/fileLibrary/propertiesDialog.vue +113 -74
  45. package/src/components/fileLibrary/shareDialog.vue +1 -1
  46. package/src/components/formOplog/mixins.js +1 -1
  47. package/src/components/hiprint/css/bootstrap.min.css +6 -0
  48. package/src/components/hiprint/fonts/glyphicons-halflings-regular.eot +0 -0
  49. package/src/components/hiprint/fonts/glyphicons-halflings-regular.svg +288 -0
  50. package/src/components/hiprint/fonts/glyphicons-halflings-regular.ttf +0 -0
  51. package/src/components/hiprint/fonts/glyphicons-halflings-regular.woff +0 -0
  52. package/src/components/hiprint/fonts/glyphicons-halflings-regular.woff2 +0 -0
  53. package/src/components/hiprint/view/design/index.vue +1 -0
  54. package/src/components/jsonImport/index.js +1 -1
  55. package/src/components/jsonImport/mixins.js +2 -1
  56. package/src/components/langImport/mixins.js +17 -16
  57. package/src/components/obsUpload/index.js +1 -0
  58. package/src/components/obsUpload/index.vue +231 -0
  59. package/src/components/obsUpload/mixins.js +8 -0
  60. package/src/components/scriptDescription/button.vue +12 -4
  61. package/src/components/scriptTest/mixins.js +1 -1
  62. package/src/components/statusTag/mixins.js +1 -1
  63. package/src/components/table/CellSlot.vue +1 -0
  64. package/src/components/table/index.js +1055 -11
  65. package/src/components/table/plugins/extend-cell-area/vxe-table-extend-cell-area.es6.min.js +11028 -0
  66. package/src/components/table/plugins/extend-cell-area/vxe-table-extend-cell-area.min.css +200 -0
  67. package/src/components/table/tableForm.vue +99 -63
  68. package/src/components/table/tableFormMixin.js +1 -1
  69. package/src/components/table/util/index.js +335 -0
  70. package/src/components/table/vxeFilter/mixin.js +6 -6
  71. package/src/components/tempStorage/index.vue +76 -55
  72. package/src/components/tempStorage/tempStorageDialog.vue +179 -54
  73. package/src/components/univer/button.vue +57 -0
  74. package/src/components/univer/dialog.vue +129 -0
  75. package/src/components/univer/index.js +95 -0
  76. package/src/components/univer/univerSheet.vue +200 -0
  77. package/src/components/vb-tabs/x-tabs.vue +56 -30
  78. package/src/components/wf/addOpinionButton.vue +57 -0
  79. package/src/components/wf/content.vue +834 -362
  80. package/src/components/wf/mixins/addOpinionButton.js +3 -0
  81. package/src/components/wf/mixins/setCandidateButton.js +6 -0
  82. package/src/components/wf/mixins/setCandidateDialog.js +2 -1
  83. package/src/components/wf/mixins/setCandidateDialog2.js +6 -0
  84. package/src/components/wf/mixins/wfFlowEleScriptDialog.js +3 -0
  85. package/src/components/wf/mixins/wfTaskUserRangeDialog.js +3 -0
  86. package/src/components/wf/setCandidateButton.vue +40 -0
  87. package/src/components/wf/setCandidateDialog.vue +10 -0
  88. package/src/components/wf/setCandidateDialog2.vue +105 -0
  89. package/src/components/wf/wf.js +2156 -1
  90. package/src/components/wf/wfFlowEleScriptDialog.vue +89 -0
  91. package/src/components/wf/wfStartDialog.vue +66 -42
  92. package/src/components/wf/wfTaskUserRangeDialog.vue +65 -0
  93. package/src/components/wf/wfUtil.js +279 -1
  94. package/src/components/xform/form-designer/designer.js +5 -3
  95. package/src/components/xform/form-designer/form-widget/components/gantt/index.vue +434 -0
  96. package/src/components/xform/form-designer/form-widget/container-widget/containerMixin.js +3 -3
  97. package/src/components/xform/form-designer/form-widget/container-widget/data-table-mixin.js +9 -8
  98. package/src/components/xform/form-designer/form-widget/container-widget/data-table-widget.vue +4 -1
  99. package/src/components/xform/form-designer/form-widget/container-widget/detail-widget.vue +3 -3
  100. package/src/components/xform/form-designer/form-widget/dialog/baseFormulaDialog copy.vue +971 -0
  101. package/src/components/xform/form-designer/form-widget/dialog/baseFormulaDialog.vue +971 -0
  102. package/src/components/xform/form-designer/form-widget/dialog/exportDialog.vue +13 -0
  103. package/src/components/xform/form-designer/form-widget/dialog/fileReferenceDialog.vue +301 -0
  104. package/src/components/xform/form-designer/form-widget/dialog/formDialog.vue +82 -49
  105. package/src/components/xform/form-designer/form-widget/dialog/formDrawer.vue +5 -1
  106. package/src/components/xform/form-designer/form-widget/dialog/formulaDialog.vue +799 -0
  107. package/src/components/xform/form-designer/form-widget/dialog/importDialog.vue +38 -7
  108. package/src/components/xform/form-designer/form-widget/dialog/importDialogMixin - /345/211/257/346/234/254.js" +1639 -0
  109. package/src/components/xform/form-designer/form-widget/dialog/importDialogMixin.js +9 -8
  110. package/src/components/xform/form-designer/form-widget/dialog/searchFormDialog.vue +196 -73
  111. package/src/components/xform/form-designer/form-widget/dialog/univerDialog.vue +200 -0
  112. package/src/components/xform/form-designer/form-widget/field-widget/a-link-widget.vue +2 -2
  113. package/src/components/xform/form-designer/form-widget/field-widget/a-text-widget.vue +1 -1
  114. package/src/components/xform/form-designer/form-widget/field-widget/baseAttachment-widget.vue +34 -5
  115. package/src/components/xform/form-designer/form-widget/field-widget/button-widget.vue +1 -1
  116. package/src/components/xform/form-designer/form-widget/field-widget/cascader-widget.vue +19 -1
  117. package/src/components/xform/form-designer/form-widget/field-widget/census-widget.vue +40 -28
  118. package/src/components/xform/form-designer/form-widget/field-widget/checkbox-widget.vue +18 -7
  119. package/src/components/xform/form-designer/form-widget/field-widget/color-widget.vue +4 -1
  120. package/src/components/xform/form-designer/form-widget/field-widget/copy_button-widget.vue +95 -0
  121. package/src/components/xform/form-designer/form-widget/field-widget/date-range-widget.vue +14 -2
  122. package/src/components/xform/form-designer/form-widget/field-widget/date-widget.vue +30 -4
  123. package/src/components/xform/form-designer/form-widget/field-widget/download-button-widget.vue +133 -0
  124. package/src/components/xform/form-designer/form-widget/field-widget/dropdown-item-widget.vue +77 -0
  125. package/src/components/xform/form-designer/form-widget/field-widget/dropdown-menu-widget.vue +106 -0
  126. package/src/components/xform/form-designer/form-widget/field-widget/echart-bar-widget.vue +1 -1
  127. package/src/components/xform/form-designer/form-widget/field-widget/echart-category-widget.vue +1 -1
  128. package/src/components/xform/form-designer/form-widget/field-widget/echart-pie-widget.vue +1 -1
  129. package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +1654 -16
  130. package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +705 -379
  131. package/src/components/xform/form-designer/form-widget/field-widget/gantt-widget.vue +964 -0
  132. package/src/components/xform/form-designer/form-widget/field-widget/html-text-widget.vue +6 -2
  133. package/src/components/xform/form-designer/form-widget/field-widget/import-button-widget.vue +22 -11
  134. package/src/components/xform/form-designer/form-widget/field-widget/import2-button-widget.vue +90 -0
  135. package/src/components/xform/form-designer/form-widget/field-widget/input-widget.vue +7 -2
  136. package/src/components/xform/form-designer/form-widget/field-widget/mixins/echart-bar-mixin.js +49 -8
  137. package/src/components/xform/form-designer/form-widget/field-widget/mixins/echart-category-mixin.js +61 -88
  138. package/src/components/xform/form-designer/form-widget/field-widget/mixins/echart-pie-mixin.js +13 -0
  139. package/src/components/xform/form-designer/form-widget/field-widget/mixins/vabsearch-mixin.js +179 -0
  140. package/src/components/xform/form-designer/form-widget/field-widget/multiSearch-widget.vue +53 -0
  141. package/src/components/xform/form-designer/form-widget/field-widget/number-widget.vue +114 -81
  142. package/src/components/xform/form-designer/form-widget/field-widget/oplog-widget.vue +186 -0
  143. package/src/components/xform/form-designer/form-widget/field-widget/print-button-widget.vue +54 -27
  144. package/src/components/xform/form-designer/form-widget/field-widget/print-detail-button-widget.vue +120 -0
  145. package/src/components/xform/form-designer/form-widget/field-widget/project-tag-widget.vue +154 -47
  146. package/src/components/xform/form-designer/form-widget/field-widget/radio-widget.vue +26 -6
  147. package/src/components/xform/form-designer/form-widget/field-widget/search_button-widget.vue +2 -2
  148. package/src/components/xform/form-designer/form-widget/field-widget/select-export-button-widget.vue +86 -0
  149. package/src/components/xform/form-designer/form-widget/field-widget/select-export-item-button-widget.vue +92 -0
  150. package/src/components/xform/form-designer/form-widget/field-widget/select-widget.vue +24 -9
  151. package/src/components/xform/form-designer/form-widget/field-widget/singerSearch-widget.vue +53 -0
  152. package/src/components/xform/form-designer/form-widget/field-widget/singleUpload-widget.vue +145 -0
  153. package/src/components/xform/form-designer/form-widget/field-widget/static-content-wrapper.vue +12 -1
  154. package/src/components/xform/form-designer/form-widget/field-widget/static-text-widget.vue +8 -3
  155. package/src/components/xform/form-designer/form-widget/field-widget/status-widget.vue +31 -17
  156. package/src/components/xform/form-designer/form-widget/field-widget/table-export-button-widget.vue +42 -37
  157. package/src/components/xform/form-designer/form-widget/field-widget/tempStorage-widget.vue +147 -0
  158. package/src/components/xform/form-designer/form-widget/field-widget/text-widget.vue +106 -33
  159. package/src/components/xform/form-designer/form-widget/field-widget/time-range-widget.vue +2 -2
  160. package/src/components/xform/form-designer/form-widget/field-widget/vabSearch-widget.vue +3 -171
  161. package/src/components/xform/form-designer/form-widget/field-widget/vabUpload-widget.vue +260 -58
  162. package/src/components/xform/form-designer/form-widget/field-widget/vabUpload2-widget.vue +753 -0
  163. package/src/components/xform/form-designer/indexMixin.js +3 -772
  164. package/src/components/xform/form-designer/setting-panel/form-setting.vue +978 -169
  165. package/src/components/xform/form-designer/setting-panel/index.vue +4 -0
  166. package/src/components/xform/form-designer/setting-panel/indexMixin.js +1 -1
  167. package/src/components/xform/form-designer/setting-panel/option-items-setting.vue +537 -302
  168. package/src/components/xform/form-designer/setting-panel/property-editor/a-link-editor.vue +4 -4
  169. package/src/components/xform/form-designer/setting-panel/property-editor/a-text-editor.vue +3 -3
  170. package/src/components/xform/form-designer/setting-panel/property-editor/autoValueEnabled-editor.vue +38 -0
  171. package/src/components/xform/form-designer/setting-panel/property-editor/censusClass-editor.vue +6 -0
  172. package/src/components/xform/form-designer/setting-panel/property-editor/colorClass-editor.vue +28 -0
  173. package/src/components/xform/form-designer/setting-panel/property-editor/commonAttributeEnabled-editor.vue +41 -0
  174. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/columnRenderDialog.vue +125 -0
  175. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +953 -1042
  176. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/exportItemColumns-dialog.vue +432 -0
  177. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/onCheckboxChange-editor.vue +1 -1
  178. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +1127 -512
  179. package/src/components/xform/form-designer/setting-panel/property-editor/container-detail/detail-editor.vue +2 -2
  180. package/src/components/xform/form-designer/setting-panel/property-editor/container-detail-pane/detail-pane-editor.vue +3 -3
  181. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-offset-editor.vue +1 -1
  182. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-pull-editor.vue +1 -1
  183. package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-push-editor.vue +1 -1
  184. package/src/components/xform/form-designer/setting-panel/property-editor/container-list-h5/list-h5-editor.vue +0 -8
  185. package/src/components/xform/form-designer/setting-panel/property-editor/container-tree/tree-customClass-editor.vue +31 -2
  186. package/src/components/xform/form-designer/setting-panel/property-editor/copyButton-editor.vue +36 -0
  187. package/src/components/xform/form-designer/setting-panel/property-editor/downloadButtonFlag-editor.vue +32 -0
  188. package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/eventMixin.js +2 -2
  189. package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/onAfterConfirmFile-editor.vue +32 -0
  190. package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/onClick-editor.vue +14 -7
  191. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/clickBindEvent-editor.vue +35 -20
  192. package/src/components/xform/form-designer/setting-panel/property-editor/field-button/search-dialog-event-editor.vue +64 -5
  193. package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-defaultTime-editor.vue +27 -0
  194. package/src/components/xform/form-designer/setting-panel/property-editor/field-dropdown-menu/dropdown-item-editor.vue +21 -0
  195. package/src/components/xform/form-designer/setting-panel/property-editor/field-dropdown-menu/dropdown-menu-editor.vue +59 -0
  196. package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-bar-editor.vue +185 -69
  197. package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-category-editor.vue +188 -86
  198. package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-pie-editor.vue +84 -39
  199. package/src/components/xform/form-designer/setting-panel/property-editor/field-gantt/gantt-editor.vue +36 -0
  200. package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import-button-editor.vue +77 -20
  201. package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import2-button-editor.vue +96 -0
  202. package/src/components/xform/form-designer/setting-panel/property-editor/field-print-button/print-button-editor.vue +44 -15
  203. package/src/components/xform/form-designer/setting-panel/property-editor/field-print-button/print-detail-button-editor.vue +115 -0
  204. package/src/components/xform/form-designer/setting-panel/property-editor/field-rate/rate-defaultValue-editor.vue +1 -1
  205. package/src/components/xform/form-designer/setting-panel/property-editor/field-static-text/preWrap-editor.vue +23 -0
  206. package/src/components/xform/form-designer/setting-panel/property-editor/field-static-text/textContent-editor.vue +1 -1
  207. package/src/components/xform/form-designer/setting-panel/property-editor/field-status/field-status-editor.vue +67 -41
  208. package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/select-export-button-editor.vue +56 -0
  209. package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/select-export-item-button-editor.vue +71 -0
  210. package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/table-export-button-editor.vue +26 -7
  211. package/src/components/xform/form-designer/setting-panel/property-editor/field-vabSearch/vabSearchName-editor.vue +13 -1
  212. package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload/field-vabUpload-editor.vue +33 -1
  213. package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload2/field-vabUpload2-editor.vue +66 -0
  214. package/src/components/xform/form-designer/setting-panel/property-editor/formScriptEnabled-editor.vue +89 -19
  215. package/src/components/xform/form-designer/setting-panel/property-editor/formatType-editor.vue +137 -0
  216. package/src/components/xform/form-designer/setting-panel/property-editor/formula-editor.vue +721 -466
  217. package/src/components/xform/form-designer/setting-panel/property-editor/labelColor-editor.vue +20 -11
  218. package/src/components/xform/form-designer/setting-panel/property-editor/labelIconClass-editor.vue +1 -1
  219. package/src/components/xform/form-designer/setting-panel/property-editor/labelIconPosition-editor.vue +1 -1
  220. package/src/components/xform/form-designer/setting-panel/property-editor/labelTooltip-editor.vue +1 -1
  221. package/src/components/xform/form-designer/setting-panel/property-editor/limit-editor.vue +1 -1
  222. package/src/components/xform/form-designer/setting-panel/property-editor/multiple-editor.vue +19 -14
  223. package/src/components/xform/form-designer/setting-panel/property-editor/multipleLimit-editor.vue +1 -1
  224. package/src/components/xform/form-designer/setting-panel/property-editor/name-editor.vue +124 -50
  225. package/src/components/xform/form-designer/setting-panel/property-editor/oplog-editor.vue +31 -0
  226. package/src/components/xform/form-designer/setting-panel/property-editor/precision-editor.vue +1 -1
  227. package/src/components/xform/form-designer/setting-panel/property-editor/project-tag-editor.vue +349 -0
  228. package/src/components/xform/form-designer/setting-panel/property-editor/required-editor.vue +10 -6
  229. package/src/components/xform/form-designer/setting-panel/property-editor/requiredHint-editor.vue +3 -3
  230. package/src/components/xform/form-designer/setting-panel/property-editor/showRuleFlag-editor.vue +1 -1
  231. package/src/components/xform/form-designer/setting-panel/property-editor/tempStorage-editor.vue +42 -0
  232. package/src/components/xform/form-designer/setting-panel/property-editor/textFlag-editor.vue +305 -19
  233. package/src/components/xform/form-designer/setting-panel/property-editor/validation-editor.vue +2 -2
  234. package/src/components/xform/form-designer/setting-panel/property-editor/validationHint-editor.vue +2 -2
  235. package/src/components/xform/form-designer/setting-panel/property-editor/wfFlag-editor.vue +372 -50
  236. package/src/components/xform/form-designer/setting-panel/property-editor/widgetShowRuleFlag-editor.vue +263 -0
  237. package/src/components/xform/form-designer/setting-panel/propertyRegister.js +35 -11
  238. package/src/components/xform/form-designer/toolbar-panel/index.vue +12 -11
  239. package/src/components/xform/form-designer/toolbar-panel/indexMixin.js +1 -1
  240. package/src/components/xform/form-designer/widget-panel/index.vue +21 -1
  241. package/src/components/xform/form-designer/widget-panel/indexMixin.js +19 -18
  242. package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +1710 -917
  243. package/src/components/xform/form-render/container-item/containerItemMixin.js +12 -11
  244. package/src/components/xform/form-render/container-item/data-table-item.vue +202 -199
  245. package/src/components/xform/form-render/container-item/data-table-mixin.js +3048 -18
  246. package/src/components/xform/form-render/container-item/detail-pane-item.vue +17 -3
  247. package/src/components/xform/form-render/container-item/grid-col-item.vue +10 -3
  248. package/src/components/xform/form-render/container-item/grid-item.vue +1 -1
  249. package/src/components/xform/form-render/container-item/list-h5-item.vue +1 -9
  250. package/src/components/xform/form-render/container-item/list-h5-item2.vue +1 -8
  251. package/src/components/xform/form-render/container-item/tab-item.vue +62 -25
  252. package/src/components/xform/form-render/container-item/table-cell-item.vue +38 -32
  253. package/src/components/xform/form-render/container-item/table-item.vue +4 -2
  254. package/src/components/xform/form-render/container-item/table2-cell-item.vue +53 -34
  255. package/src/components/xform/form-render/container-item/table2-item.vue +141 -88
  256. package/src/components/xform/form-render/container-item/tree-item.vue +32 -11
  257. package/src/components/xform/form-render/index.vue +83 -20
  258. package/src/components/xform/form-render/indexMixin.js +3700 -12
  259. package/src/components/xform/lang/zh-CN.js +29 -4
  260. package/src/components/xform/mixins/defaultHandle.js +1 -1
  261. package/src/components/xform/mixins/scriptHttp.js +174 -1
  262. package/src/components/xform/utils/emitter.js +4 -4
  263. package/src/components/xform/utils/format.js +35 -34
  264. package/src/components/xform/utils/formula-util copy 2.js +945 -0
  265. package/src/components/xform/utils/formula-util copy.js +856 -0
  266. package/src/components/xform/utils/formula-util.js +966 -0
  267. package/src/components/xform/utils/util.js +1 -1
  268. package/src/components/xform/utils/validators.js +1 -5
  269. package/src/components/xform/utils/vue2js-generator.js +2 -2
  270. package/src/index.js +215 -190
  271. package/src/lang/index.js +56 -51
  272. package/src/lang/locale/en/login.js +20 -0
  273. package/src/lang/locale/zh/login.js +20 -0
  274. package/src/layout/components/AppMain.vue +5 -1
  275. package/src/layout/components/Sidebar/default.vue +1423 -1222
  276. package/src/layout/components/TagsView/index.vue +37 -12
  277. package/src/layout/components/createCompany/createCompanyDialog.vue +157 -0
  278. package/src/layout/components/extractedCode/createDialog.vue +92 -0
  279. package/src/layout/components/extractedCode/queryDialog.vue +96 -0
  280. package/src/layout/components/extractedCode/viewDialog.vue +193 -0
  281. package/src/layout/components/watermark/index.vue +83 -0
  282. package/src/layout/defaultLayout.vue +1 -1
  283. package/src/layout/index.vue +3 -5
  284. package/src/mixins/selectDialog/index.js +1 -1
  285. package/src/mixins/table/index.js +151 -0
  286. package/src/mixins/tableTree/index.js +1 -1
  287. package/src/permission.js +1 -18
  288. package/src/router/modules/customer.js +125 -8
  289. package/src/store/config/index.js +1 -1
  290. package/src/store/getters.js +3 -1
  291. package/src/store/modules/permission.js +1 -1
  292. package/src/store/modules/settings.js +1 -1
  293. package/src/store/modules/tagsView.js +1 -14
  294. package/src/store/modules/user.js +1 -29
  295. package/src/utils/index.js +1 -7
  296. package/src/utils/pddLog.js +103 -0
  297. package/src/utils/pdfUtil.js +71 -0
  298. package/src/utils/request.js +1 -1
  299. package/src/utils/vab.js +19 -27
  300. package/src/views/bd/setting/bd_attach_setting/edit.vue +5 -5
  301. package/src/views/bd/setting/bd_attach_setting/list.vue +28 -55
  302. package/src/views/bd/setting/bd_attach_setting/mixins/edit.js +4 -5
  303. package/src/views/bd/setting/bd_attach_setting/mixins/list.js +239 -1
  304. package/src/views/bd/setting/bd_company_env/dialog.vue +174 -0
  305. package/src/views/bd/setting/bd_company_env/edit.vue +193 -0
  306. package/src/views/bd/setting/bd_company_env/list.vue +175 -0
  307. package/src/views/bd/setting/config_manage/list.vue +83 -0
  308. package/src/views/bd/setting/form_import_log/edit.vue +127 -0
  309. package/src/views/bd/setting/form_import_log/list.vue +206 -0
  310. package/src/views/bd/setting/form_script/edit.vue +9 -0
  311. package/src/views/bd/setting/form_script/edit1.vue +36 -3
  312. package/src/views/bd/setting/form_script/form_list.vue +99 -37
  313. package/src/views/bd/setting/form_script/list1.vue +181 -118
  314. package/src/views/bd/setting/form_script/mixins/dialog.js +130 -1
  315. package/src/views/bd/setting/form_script/mixins/edit.js +201 -1
  316. package/src/views/bd/setting/form_script/mixins/edit1.js +193 -1
  317. package/src/views/bd/setting/form_script/mixins/form_list.js +1 -1
  318. package/src/views/bd/setting/form_script/mixins/list.js +236 -1
  319. package/src/views/bd/setting/form_script/mixins/list1.js +423 -14
  320. package/src/views/bd/setting/form_script/mixins/otherAuthDialog.js +194 -0
  321. package/src/views/bd/setting/form_script/otherAuthDialog.vue +83 -0
  322. package/src/views/bd/setting/form_template/batchWfObjConfigDialog.vue +2 -2
  323. package/src/views/bd/setting/form_template/edit.vue +22 -1
  324. package/src/views/bd/setting/form_template/editWfObjConfigDialog.vue +2 -2
  325. package/src/views/bd/setting/form_template/list.vue +326 -214
  326. package/src/views/bd/setting/form_template/mixins/batchWfObjConfigDialog.js +11 -9
  327. package/src/views/bd/setting/form_template/mixins/edit.js +234 -9
  328. package/src/views/bd/setting/form_template/mixins/list.js +689 -22
  329. package/src/views/bd/setting/form_template/mixins/otherAuthDialog.js +193 -0
  330. package/src/views/bd/setting/form_template/mixins/wf_list.js +1 -423
  331. package/src/views/bd/setting/form_template/otherAuthDialog.vue +83 -0
  332. package/src/views/bd/setting/form_template/wfObjConfigDialog.vue +4 -4
  333. package/src/views/bd/setting/form_template/wf_list.vue +1 -1
  334. package/src/views/bd/setting/logic_param/edit.vue +146 -0
  335. package/src/views/bd/setting/logic_param/edit1.vue +106 -0
  336. package/src/views/bd/setting/logic_param/edit2.vue +139 -0
  337. package/src/views/bd/setting/logic_param/list.vue +74 -0
  338. package/src/views/bd/setting/logic_param/list1.vue +12 -0
  339. package/src/views/bd/setting/logic_param/list2.vue +12 -0
  340. package/src/views/bd/setting/logic_param/mixins/edit.js +3 -0
  341. package/src/views/bd/setting/logic_param/mixins/list.js +9 -0
  342. package/src/views/bd/setting/menu_kind/list.vue +172 -83
  343. package/src/views/bd/setting/menu_kind/mixins/authDialog.js +300 -7
  344. package/src/views/bd/setting/menu_kind/mixins/list.js +201 -1
  345. package/src/views/bd/setting/push_data/edit.vue +139 -0
  346. package/src/views/bd/setting/push_data/list.vue +283 -0
  347. package/src/views/bd/setting/push_data_h/edit.vue +153 -0
  348. package/src/views/bd/setting/push_data_h/list.vue +293 -0
  349. package/src/views/bd/setting/request_async_setting/edit.vue +320 -0
  350. package/src/views/bd/setting/request_async_setting/list.vue +372 -0
  351. package/src/views/bd/setting/request_setting/edit.vue +300 -0
  352. package/src/views/bd/setting/request_setting/list.vue +311 -0
  353. package/src/views/bd/setting/table_model/edit.vue +875 -426
  354. package/src/views/bd/setting/table_model/list.vue +190 -128
  355. package/src/views/bd/setting/table_model/mixins/dialog.js +1 -1
  356. package/src/views/bd/setting/table_model/mixins/edit.js +1202 -13
  357. package/src/views/bd/setting/table_model/mixins/list.js +440 -14
  358. package/src/views/bd/setting/table_model/mixins/otherAuthDialog.js +201 -0
  359. package/src/views/bd/setting/table_model/otherAuthDialog.vue +83 -0
  360. package/src/views/user/access_log/list.vue +418 -349
  361. package/src/views/user/area/dialog.vue +223 -117
  362. package/src/views/user/area/list.vue +318 -0
  363. package/src/views/user/bill_setting/edit.vue +1 -1
  364. package/src/views/user/bill_setting/list.vue +1 -1
  365. package/src/views/user/common_attribute/itemEdit.vue +2 -2
  366. package/src/views/user/common_attribute/list.vue +5 -2
  367. package/src/views/user/common_script/edit.vue +1 -1
  368. package/src/views/user/common_script/list.vue +1 -1
  369. package/src/views/user/company_info/dialog.vue +195 -163
  370. package/src/views/user/company_info/edit.vue +1 -1
  371. package/src/views/user/extend_datasource/dialog.vue +4 -0
  372. package/src/views/user/extend_datasource/edit.vue +5 -1
  373. package/src/views/user/extend_datasource/list.vue +5 -1
  374. package/src/views/user/fieldTranslation/editDialog.vue +7 -7
  375. package/src/views/user/fieldTranslation/list.vue +32 -32
  376. package/src/views/user/form/vform/designer.vue +776 -749
  377. package/src/views/user/form/vform/out_render.vue +1 -1
  378. package/src/views/user/form/vform/render.vue +59 -37
  379. package/src/views/user/form/view/edit.vue +38 -37
  380. package/src/views/user/form/view/list.vue +261 -49
  381. package/src/views/user/home/bears/index.vue +1032 -0
  382. package/src/views/user/home/default.vue +1026 -979
  383. package/src/views/user/home/dev.vue +29 -0
  384. package/src/views/user/home/index.vue +16 -6
  385. package/src/views/user/home/taili/index.vue +1034 -0
  386. package/src/views/user/ledger_library/list.vue +10 -12
  387. package/src/views/user/login/default.vue +165 -36
  388. package/src/views/user/login/index.vue +4 -6
  389. package/src/views/user/login/indexMixin.js +184 -8
  390. package/src/views/user/menu/list.vue +24 -1
  391. package/src/views/user/notify_message/dialog.vue +44 -22
  392. package/src/views/user/notify_template/edit.vue +188 -187
  393. package/src/views/user/notify_template/edit2.vue +176 -0
  394. package/src/views/user/notify_template/list.vue +4 -1
  395. package/src/views/user/notify_template/list2.vue +190 -0
  396. package/src/views/user/outLink/form_view.vue +211 -184
  397. package/src/views/user/outLink/index.vue +67 -11
  398. package/src/views/user/outLink/view.vue +28 -23
  399. package/src/views/user/position/list.vue +128 -72
  400. package/src/views/user/project_tag/dialog.vue +9 -4
  401. package/src/views/user/project_tag/edit.vue +2 -2
  402. package/src/views/user/project_tag/list.vue +9 -4
  403. package/src/views/user/push_setting/list.vue +2 -2
  404. package/src/views/user/request_setting/edit.vue +258 -0
  405. package/src/views/user/request_setting/list.vue +248 -0
  406. package/src/views/user/role/authConfig.vue +89 -0
  407. package/src/views/user/role/dialog.vue +70 -48
  408. package/src/views/user/role/edit.vue +609 -429
  409. package/src/views/user/role/list.vue +4 -4
  410. package/src/views/user/sale_org/dialog.vue +1 -1
  411. package/src/views/user/sale_org/list.vue +4 -1
  412. package/src/views/user/user/dialog.vue +46 -23
  413. package/src/views/user/user/edit.vue +1290 -1021
  414. package/src/views/user/user/form_dialog.vue +158 -0
  415. package/src/views/user/user/form_info.vue +210 -0
  416. package/src/views/user/user/list.vue +652 -563
  417. package/src/views/user/user/modifyPasswordDialog.vue +64 -53
  418. package/src/views/user/wf/wfReport/index.vue +619 -0
  419. package/src/views/user/wf/wf_auto_submit_data/list.vue +2 -0
  420. package/src/views/user/wf/wf_manage/list.vue +379 -250
  421. package/src/views/user/wf/wf_manage/wfContentDialog.vue +25 -22
  422. package/src/views/user/wf/wf_obj_config/importItemDialog.vue +109 -0
  423. package/src/views/user/wf/wf_obj_config/itemEdit.vue +25 -1
  424. package/src/views/user/wf/wf_obj_config/list.vue +114 -9
  425. package/src/views/user/wf/wf_obj_config/wfBizDataSettingDialog.vue +2 -2
  426. package/src/views/user/wf/wf_transfer_setting/edit.vue +282 -0
  427. package/src/views/user/wf/wf_transfer_setting/list.vue +319 -0
@@ -1,1021 +1,1290 @@
1
- <template>
2
- <div class="detail-wrap">
3
- <el-form ref="editForm" :model="user">
4
- <div class="d-header clearfix">
5
- <div class="fl">
6
- <i class="el-icon-info"/>
7
- {{ dataId ? $t1('查看用户') : $t1('新增用户') }}
8
- </div>
9
- <div class="fr">
10
- <temp-storage-button :option="tempStorageOption" v-if="!dataId"></temp-storage-button>
11
- <base-input-export :option="exportOption" :parent-target="_self" v-if="dataId"/>
12
- <el-button type="primary" plain class="button-sty" icon="el-icon-unlock" @click="unlock" v-if="user.locked"
13
- v-hasPermi="'user:unlock'">{{ $t1('解锁') }}
14
- </el-button>
15
- <el-button type="primary" plain class="button-sty" @click="$baseReload()" icon="el-icon-refresh-right">
16
- {{ $t1('重置') }}
17
- </el-button>
18
- <el-button type="primary" class="button-sty" icon="el-icon-check" @click="saveData">{{ $t1('保存') }}
19
- </el-button>
20
- </div>
21
- </div>
22
- <baseTabs>
23
- <baseTabPane :label="$t1('基本信息')">
24
- <template #default>
25
- <table class="table-detail">
26
- <tbody>
27
- <tr>
28
- <th>
29
- <em class="f-red">*</em>
30
- {{ $t1('登录名') }}
31
- </th>
32
- <td colspan="3">
33
- <el-form-item prop="loginAccount" :rules="[{ required: true, trigger: 'blur' }]">
34
- <template v-if="dataId">
35
- <el-input size="small" v-model="user.loginAccount" maxlength="255" autocomplete="off"
36
- lay-verify="required" required="" :readonly="true"/>
37
- </template>
38
- <template v-else>
39
- <el-input size="small" v-model="user.loginAccount" maxlength="255" autocomplete="off"
40
- lay-verify="required" required="" clearable/>
41
- </template>
42
- </el-form-item>
43
- </td>
44
-
45
- <th>
46
- <em class="f-red">*</em>
47
- {{ $t1('姓名') }}
48
- </th>
49
- <td colspan="3">
50
- <el-form-item prop="nickName" :rules="[{ required: true, trigger: 'blur' }]">
51
- <el-input size="small" v-model="user.nickName" maxlength="200" lay-verify="required" required=""
52
- clearable/>
53
- </el-form-item>
54
- </td>
55
- </tr>
56
- <tr>
57
-
58
- <th>
59
- <em class="f-red" v-if="!dataId">*</em>
60
- {{ $t1('密码') }}
61
- </th>
62
- <td>
63
- <el-form-item prop="password" :rules="passRules">
64
- <el-input size="small" type="password" v-model="user.password" show-password maxlength="255"
65
- autocomplete="off" auto-complete="new-password" clearable/>
66
- </el-form-item>
67
- </td>
68
- <th>
69
- <em class="f-red" v-if="!dataId">*</em>
70
- {{ $t1('确认密码') }}
71
- </th>
72
- <td>
73
- <el-form-item prop="rePassword" :rules="pass2Rules">
74
- <el-input
75
- size="small"
76
- type="password"
77
- v-model="user.rePassword"
78
- show-password
79
- maxlength="255"
80
- autocomplete="off"
81
- auto-complete="new-password"
82
- lay-verify="confirmPass"
83
- clearable
84
- />
85
- </el-form-item>
86
- </td>
87
-
88
-
89
- <th>{{ $t1('性别') }}</th>
90
- <td>
91
- <el-radio-group v-model="user.gender">
92
- <el-radio :label="1">{{ $t1('男') }}</el-radio>
93
- <el-radio :label="2">{{ $t1('女') }}</el-radio>
94
- </el-radio-group>
95
- </td>
96
- <th>
97
- {{ $t1('员工编码') }}
98
- </th>
99
- <td>
100
- <el-form-item prop="empNo" :rules="[{ required: false, trigger: 'blur' }]">
101
- <el-input size="small" v-model="user.empNo" maxlength="200" clearable/>
102
- </el-form-item>
103
- </td>
104
- </tr>
105
-
106
- <tr>
107
- <th>{{ $t1('出生日期') }}</th>
108
- <td>
109
- <el-date-picker size="small" v-model="user.birth" type="date" :placeholder="$t1('选择日期')"
110
- value-format="yyyy-MM-dd" clearable/>
111
- </td>
112
- <th>{{ $t1('邮编') }}</th>
113
- <td>
114
- <el-input size="small" v-model="user.zipCode" maxlength="255" clearable/>
115
- </td>
116
- <th>{{ $t1('手机') }}</th>
117
- <td>
118
- <el-form-item prop="mobile" :rules="[{ required: false, trigger: 'blur' }]">
119
- <el-input size="small" v-model="user.mobile" type="text" maxlength="255" autocomplete="off"
120
- lay-verify="required|phone" clearable/>
121
- </el-form-item>
122
- </td>
123
- <th>{{ $t1('设置') }}</th>
124
- <td>
125
- <el-checkbox :label="$t1('是否启用')" v-model="user.enabled"></el-checkbox>
126
- </td>
127
-
128
- </tr>
129
-
130
- <tr>
131
- <th>
132
- {{ $t1('邮箱') }}
133
- </th>
134
- <td>
135
- <el-form-item prop="email" :rules="[{ required: false, trigger: 'blur' }]">
136
- <el-input size="small" v-model="user.email" maxlength="200" clearable/>
137
- </el-form-item>
138
- </td>
139
- <!-- <th v-if="flag!=='2'">
140
- GUID
141
- </th>
142
- <td v-if="flag!=='2'">
143
- <el-form-item prop="guid" :rules="[{ required: false, trigger: 'blur' }]">
144
- <el-input size="small" v-model="user.guid" maxlength="200" clearable/>
145
- </el-form-item>
146
- </td>-->
147
- <th>{{ $t1('地址') }}</th>
148
- <td colspan="3">
149
- <el-input size="small" v-model="user.address" class="b" maxlength="255" clearable/>
150
- </td>
151
-
152
- </tr>
153
- <tr>
154
- <th>
155
- {{ $t1('国家') }}
156
- </th>
157
- <td colspan="3">
158
- <el-form-item prop="countryName" :rules="[{ required: false, trigger: 'blur' }]">
159
- <el-input
160
- class="search-input"
161
- v-model="user.countryName"
162
- clearable
163
- @clear="
164
- user.countryName = null;
165
- user.countryCode = null;
166
- "
167
- v-el-readonly
168
- >
169
- <i slot="suffix" class="el-input__icon el-icon-search"
170
- @click="showCountryDialog=true"></i>
171
- </el-input>
172
- </el-form-item>
173
- </td>
174
- <th>
175
- {{ $t1('是否锁定') }}
176
- </th>
177
- <td>
178
- {{ user.locked ? $t1('是') : $t1('') }}
179
- </td>
180
- </tr>
181
- <tr>
182
- <th>{{ $t1('头像') }}</th>
183
- <td colspan="7">
184
- <baseUpload :limit="1" accept="image/png, image/jpeg" multi="false" :file.sync="user.headPhotoUrl"
185
- dataType="medium"></baseUpload>
186
- </td>
187
- </tr>
188
- <tr>
189
- <th>{{ $t1('创建人') }}</th>
190
- <td>{{ user.createBy }}</td>
191
- <th>{{ $t1('创建时间') }}</th>
192
- <td>{{ user.createDate }}</td>
193
- <th>{{ $t1('更新人') }}</th>
194
- <td>{{ user.modifyBy }}</td>
195
- <th>{{ $t1('更新时间') }}</th>
196
- <td>{{ user.modifyDate }}</td>
197
- </tr>
198
- </tbody>
199
- </table>
200
- </template>
201
- </baseTabPane>
202
- <baseTabPane :label="$t1('组织信息')">
203
- <template #button>
204
- <el-button class="button-sty" @click="addCurrentCompany()" icon="el-icon-search" v-if="!hasCurrentCompany">
205
- {{ $t1('新增组织权限') }}
206
- </el-button>
207
- </template>
208
- <template #default>
209
- <div class="style1">
210
- <div class="d-item" v-for="(item,index1) in user.userCompanyInfoDTOs" :key="index1">
211
- <div class="title">
212
- <b>{{ item.companyName }}</b>
213
- <el-button class="button-sty" icon="el-icon-delete" v-if="isCurrentCompany(item.companyCode)"
214
- @click="deleteCompany(item,index1)">{{ $t1('删除') }}
215
- </el-button>
216
- </div>
217
- <div class="title-form">
218
- <span>
219
- <el-form-item label="GUID" :prop="'userCompanyInfoDTOs.'+index1+'.guid'"
220
- :rules="[{ required: false, trigger: 'blur' }]">
221
- <el-input size="small" v-model="item.guid" maxlength="200" clearable/>
222
- </el-form-item>
223
- </span>
224
- </div>
225
- <div class="m-2">
226
- <div class="d-item" style="width: 65%;">
227
- <div class="title">
228
- <b>{{ $t1('机构信息') }}</b>
229
- <el-button class="button-sty" icon="el-icon-search" @click="showSaleOrgDialog = true"
230
- v-if="isCurrentCompany(item.companyCode)">{{ $t1('选择机构') }}
231
- </el-button>
232
- </div>
233
- <div class="grid-h">
234
- <vxe-grid
235
- :ref="'saleOrgGrid-'+item.companyCode"
236
- :data="gridSaleOrgDataMap[item.companyCode]"
237
- v-bind="vxeOptionMap['saleOrgGridOption-'+item.companyCode]"
238
- @resizable-change="$vxeTableUtil.onColumnWitchChange"
239
- @custom="$vxeTableUtil.customHandle">
240
- <template #position="{row,rowIndex,$table}">
241
- <el-input
242
- class="search-input"
243
- :value="getSelectPositionName(row)"
244
- clearable
245
- @clear="
246
- row.userSaleOrgPositionDTOs = [];
247
- $forceUpdate();
248
- "
249
- v-el-readonly
250
- v-if="companyInfo.companyCode == row.companyCode"
251
- >
252
- <i slot="suffix" class="el-input__icon el-icon-search"
253
- @click="openSelectPositionDialog(row, rowIndex, $table)"></i>
254
- </el-input>
255
- <template v-else>
256
- {{ getSelectPositionName(row) }}
257
- </template>
258
- </template>
259
- </vxe-grid>
260
- </div>
261
- </div>
262
- <div class="d-item" style="width: 35%;">
263
- <div class="title">
264
- <b>{{ $t1('角色信息') }}</b>
265
- <el-button class="button-sty" icon="el-icon-search" @click="showRoleDialog = true"
266
- v-if="isCurrentCompany(item.companyCode)">{{ $t1('选择角色') }}
267
- </el-button>
268
- </div>
269
- <div class="grid-h">
270
- <vxe-grid
271
- :ref="'userRoleGrid-'+item.companyCode"
272
- :data="gridRoleDataMap[item.companyCode]"
273
- v-bind="vxeOptionMap['userRoleGridOption-'+item.companyCode]"
274
- @resizable-change="$vxeTableUtil.onColumnWitchChange"
275
- @custom="$vxeTableUtil.customHandle"
276
- ></vxe-grid>
277
- </div>
278
- </div>
279
- </div>
280
- </div>
281
- </div>
282
- </template>
283
- </baseTabPane>
284
- </baseTabs>
285
- </el-form>
286
- <roleDialog v-if="showRoleDialog" :visiable.sync="showRoleDialog" @confirm="confirmRole"
287
- :param="roleDialogParam"/>
288
- <companyDialog v-if="showCompanyDialog" :visiable.sync="showCompanyDialog" @confirm="confirmInsertCompany"/>
289
- <saleOrgDialog v-if="showSaleOrgDialog" :visiable.sync="showSaleOrgDialog" @confirm="confirmInsertSaleOrg"
290
- :param="{ queryAll: true }"/>
291
- <positionDialog v-if="showPositionDialog" :visiable.sync="showPositionDialog" :rows="positionDialogDatas"
292
- @confirm="confirmInsertPosition" :param="{ queryAll: true }"/>
293
- <countryDialog v-if="showCountryDialog" :visiable.sync="showCountryDialog"
294
- @confirm="confirmCountry" multi="false"/>
295
- </div>
296
- </template>
297
-
298
- <script>
299
- import xeUtils from "xe-utils";
300
- import tempStorageButton from "@base/components/tempStorage/index.vue";
301
-
302
-
303
- export default {
304
- name: 'UserEdit',
305
- components: {
306
- roleDialog: () => import('../../../views/user/role/dialog.vue'),
307
- companyDialog: () => import('../../../views/user/company_info/dialog.vue'),
308
- saleOrgDialog: () => import('../../../views/user/sale_org/dialog.vue'),
309
- positionDialog: () => import('../../../views/user/position/dialog.vue'),
310
- countryDialog: () => import('../../../views/user/country/dialog.vue'),
311
- tempStorageButton
312
- },
313
- props: ['_dataId', 'userType', 'flag'],
314
- data() {
315
- var validatePass = (rule, value, callback) => {
316
- const isPassRequired = !this.dataId;
317
- if (isPassRequired && (value == '' || value == undefined)) {
318
- callback(new Error(this.$t1('密码不能为空')));
319
- } else {
320
- callback();
321
- }
322
- this.$refs.editForm.validateField('rePassword');
323
- };
324
- var validatePass2 = (rule, value, callback) => {
325
- const isPassRequired = !this.dataId;
326
- const rePassword = value != undefined ? value : '';
327
- const password = this.user.password != undefined ? this.user.password : '';
328
-
329
- if (isPassRequired && rePassword == '') {
330
- callback(new Error(this.$t1('确认密码不能为空')));
331
- } else if (rePassword != password) {
332
- callback(new Error(this.$t1('两次输入密码不一致!')));
333
- } else {
334
- callback();
335
- }
336
- };
337
-
338
- return {
339
- dataId: '',
340
- hBtn: true,
341
- user: {
342
- userCompanyInfoDTOs: [],
343
- userSaleOrgDTOs: [],
344
- userRoleDTOs: [],
345
- gender: null,
346
- enabled: true,
347
- userType: null,
348
- countryName: null,
349
- countryCode: null
350
- },
351
- vxeOption: {},
352
- companyInfoOption: {},
353
- userRoleOption: {},
354
- showRoleDialog: false,
355
- showCompanyDialog: false,
356
- showSaleOrgDialog: false,
357
- showPositionDialog: false,
358
- saleOrgPositionIndex: 0,
359
- passRules: [{validator: validatePass, trigger: 'blur', required: false}],
360
- pass2Rules: [{validator: validatePass2, trigger: 'blur', required: false}],
361
- activeName: 'first',
362
- userCustomerListDTO: {
363
- userCustomerDTOs: []
364
- },
365
- customerOption: {},
366
- showCustomerDialog: false,
367
- exportOption: {
368
- prefix: USER_PREFIX,
369
- title: this.$t1('用户'),
370
- codes: ["USEREXCEL", "USERPDF", "USERPRINT", "USERHIPRINT"],
371
- param: () => {
372
- return [{id: this.dataId}];
373
- }
374
- },
375
- showExtendedProperties: false,
376
- radio1: '0',
377
- companyInfo: {},
378
- vxeOptionMap: {},
379
- gridRoleDataMap: {},
380
- gridSaleOrgDataMap: {},
381
- distributorCode: 'distributor',
382
- distributorRole: null,
383
- outUserCodes: [],
384
- roleDialogParam: {queryAll: true},
385
- tempStorageOption: {
386
- storageType: "user",
387
- data: () => {
388
- this.handleData();
389
- return this.user;
390
- },
391
- chooseConfirm: (tempStorageData) => {
392
- this.user = tempStorageData;
393
- this.gridSaleOrgDataMap = xeUtils.groupBy(this.user.userSaleOrgDTOs, 'companyCode');
394
- this.gridRoleDataMap = xeUtils.groupBy(this.user.userRoleDTOs, 'companyCode');
395
- },
396
- saveConfirm: () => {
397
- }
398
- },
399
- showCountryDialog: false
400
- };
401
- },
402
- computed: {
403
- hasCurrentCompany() {
404
- return this.user.userCompanyInfoDTOs.find(item => item.companyCode == this.companyInfo.companyCode) != null;
405
- }
406
- },
407
- created() {
408
- if (this._dataId && !isNaN(this._dataId)) this.dataId = this._dataId;
409
- },
410
- async mounted() {
411
-
412
- // this.getEainsGroupDTO();
413
- await this.initOutUserRoleCode();
414
- await this.initDistributorRole();
415
- this.getData();
416
- this.getConpanyInfo()
417
- },
418
- methods: {
419
- getData() {
420
- if (this.dataId && !isNaN(this.dataId)) {
421
- this.isEdit = true;
422
- this.$commonHttp({
423
- url: USER_PREFIX + `/user/get`,
424
- method: `post`,
425
- data: {
426
- id: this.dataId
427
- },
428
- isLoading: true,
429
- modalStrictly: true,
430
- success: res => {
431
- let user = res.objx || {};
432
- user.userCompanyInfoDTOs = this.user.userCompanyInfoDTOs;
433
- user.userSaleOrgDTOs = this.user.userSaleOrgDTOs;
434
- user.userRoleDTOs = this.user.userRoleDTOs;
435
- this.user = user;
436
- this.user.password = '';
437
-
438
- this.showExtendedProperties = true;
439
- }
440
- });
441
- } else {
442
- this.user.gender = 1;
443
- this.isEdit = false;
444
- this.showExtendedProperties = true;
445
- }
446
- },
447
- saveData() {
448
- let companyCode = this.companyInfo.companyCode;
449
- this.handleData();
450
- if (this.userType == 2) {
451
- //外部用户
452
- let currentUserCompanyInfo = this.user.userCompanyInfoDTOs.find(item => item.companyCode == companyCode)
453
- if (currentUserCompanyInfo) {
454
- let rows = this.user.userRoleDTOs.filter(item => item.companyCode == companyCode);
455
- if (!rows.length) {
456
- this.$baseAlert(this.$t1('请维护角色'));
457
- return
458
- }
459
- }
460
-
461
- }
462
- this.$refs.editForm.$baseValidate(valid => {
463
- if (valid) {
464
- this.$baseConfirm(this.$t1('您确定要保存吗?')).then(() => {
465
- var url = USER_PREFIX + (this.isEdit ? '/user/update' : '/user/save');
466
- this.$http({
467
- url: url,
468
- method: `post`,
469
- data: this.user,
470
- isLoading: true,
471
- success: res => {
472
- this.$message({
473
- message: res.content,
474
- type: 'success',
475
- duration: 500,
476
- onClose: t => {
477
- if (this.isEdit) {
478
- this.$baseReload();
479
- } else {
480
- this.$baseReload({
481
- updateParam: {
482
- _dataId: res.objx
483
- }
484
- });
485
- }
486
- }
487
- });
488
- }
489
- });
490
- });
491
- }
492
- });
493
- },
494
- getSaleOrgData() {
495
- if (this.dataId) {
496
- this.$http({
497
- url: USER_PREFIX + '/user/getUserSaleOrg',
498
- method: `post`,
499
- data: {id: this.dataId},
500
- isLoading: true,
501
- modalStrictly: true,
502
- success: res => {
503
- // this.$refs.saleOrgGrid.loadData(res.objx || []);
504
- let rows = res.objx || [];
505
- if (rows.length) {
506
- // this.gridSaleOrgDataMap = xeUtils.groupBy(rows, 'companyCode');
507
- Object.assign(this.gridSaleOrgDataMap, xeUtils.groupBy(rows, 'companyCode'));
508
- }
509
- this.user.userSaleOrgDTOs = rows;
510
- }
511
- });
512
- }
513
- },
514
- getUserRoleData() {
515
- if (this.dataId) {
516
- this.$http({
517
- url: USER_PREFIX + '/user/getUserRole',
518
- method: `post`,
519
- data: {id: this.dataId},
520
- isLoading: true,
521
- modalStrictly: true,
522
- success: res => {
523
- let rows = res.objx || [];
524
- if (rows.length) {
525
- // this.gridRoleDataMap = xeUtils.groupBy(rows, 'companyCode');
526
- Object.assign(this.gridRoleDataMap, xeUtils.groupBy(rows, 'companyCode'));
527
- }
528
- this.user.userRoleDTOs = rows;
529
- }
530
- });
531
- }
532
- },
533
- deleteSaleOrgItem(row, index, $table) {
534
- $table.remove(row);
535
- this.gridSaleOrgDataMap[row.companyCode].splice(index, 1);
536
- },
537
- getCompanyInfoData(callback) {
538
- if (this.dataId) {
539
- this.$http({
540
- url: USER_PREFIX + '/user/getUserCompanyInfo',
541
- method: `post`,
542
- data: {id: this.dataId},
543
- isLoading: true,
544
- modalStrictly: true,
545
- success: res => {
546
- let rows = res.objx || [];
547
- rows.forEach(row => {
548
- this.gridRoleDataMap[row.companyCode] = [];
549
- this.gridSaleOrgDataMap[row.companyCode] = [];
550
- })
551
- this.user.userCompanyInfoDTOs = rows;
552
- callback && callback();
553
- }
554
- });
555
- }
556
- },
557
- initSaleOrg(companyCode) {
558
- if (this.vxeOptionMap['saleOrgGridOption-' + companyCode]) {
559
- return;
560
- }
561
- let tableRef = 'saleOrgGrid-' + companyCode;
562
- const tableOption = {
563
- vue: this,
564
- tableRef: tableRef,
565
- tableName: 'editUser-saleOrgGrid-' + companyCode,
566
- columns: [
567
- {type: 'checkbox', fixed: 'left', width: 48, resizable: false},
568
- {title: this.$t1('机构名称'), field: 'saleOrgName', width: 200},
569
- {title: this.$t1('机构编码'), field: 'sn', width: 200},
570
- {title: this.$t1('上级机构'), field: 'treePathName', width: 200},
571
- {
572
- title: this.$t1('岗位'),
573
- field: 'position',
574
- width: 150,
575
- slots: {
576
- default: 'position'
577
- }
578
- },
579
- {
580
- title: this.$t1('是否默认'),
581
- field: 'defaults',
582
- width: 120,
583
- slots: {
584
- default: ({row, $table, rowIndex}) => {
585
- var isDefault = row.defaults || false;
586
- let disabled = this.companyInfo.companyCode != row.companyCode;
587
- return [
588
- <el-checkbox
589
- v-model={isDefault}
590
- disabled={disabled}
591
- onchange={() => {
592
- this.gridSaleOrgDataMap[row.companyCode].forEach((item, index) => {
593
- if (index == rowIndex) {
594
- item.defaults = true;
595
- } else {
596
- item.defaults = false;
597
- }
598
- });
599
- }}
600
- />
601
- ];
602
- }
603
- }
604
- },
605
- {
606
- width: 47,
607
- fixed: 'right',
608
- title: '',
609
- sortable: false,
610
- slots: {
611
- default: ({row, rowIndex, $table}) => {
612
- if (this.companyInfo.companyCode == row.companyCode) {
613
- return [
614
- <a
615
- href="javascript:void(0);"
616
- class="a-link"
617
- onclick={() => {
618
- this.deleteSaleOrgItem(row, rowIndex, $table);
619
- }}
620
- >
621
- <el-tooltip enterable={false} effect="dark" content={this.$t1('删除')} placement="top"
622
- popper-class="tooltip-skin">
623
- <i class="el-icon-delete"/>
624
- </el-tooltip>
625
- </a>
626
- ];
627
- }
628
- }
629
- }
630
- }
631
- ]
632
- };
633
- this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
634
- // this.vxeOptionMap['saleOrgGridOption-'+companyCode] = opts;
635
- this.$set(this.vxeOptionMap, 'saleOrgGridOption-' + companyCode, opts);
636
- });
637
-
638
- },
639
- initUserRole(companyCode) {
640
- if (this.vxeOptionMap['userRoleGridOption-' + companyCode]) {
641
- return;
642
- }
643
- let userType = this.userType;
644
- const tableOption = {
645
- vue: this,
646
- tableRef: 'userRoleGrid-' + companyCode,
647
- tableName: 'editUser-userRoleGrid-' + companyCode,
648
- columns: [
649
- {type: 'checkbox', fixed: 'left', width: 48, resizable: false},
650
- {
651
- title: this.$t1('角色名称'),
652
- field: 'name',
653
- width: 200,
654
- slots: {
655
- default: ({row}) => {
656
- if (!row.isAdd) {
657
- return row.roleName;
658
- } else {
659
- return row.name;
660
- }
661
- }
662
- }
663
- },
664
- {
665
- width: 47,
666
- fixed: 'right',
667
- title: '',
668
- sortable: false,
669
- slots: {
670
- default: ({row, rowIndex, $table}) => {
671
- if (this.companyInfo.companyCode == row.companyCode) {
672
- return [
673
- <a
674
- href="javascript:void(0);"
675
- class="a-link"
676
- onclick={() => {
677
- this.deleteRoleItem(row, rowIndex, $table);
678
- }}
679
- >
680
- <el-tooltip enterable={false} effect="dark" content={this.$t1('删除')} placement="top"
681
- popper-class="tooltip-skin">
682
- <i class="el-icon-delete"/>
683
- </el-tooltip>
684
- </a>
685
- ];
686
- }
687
- }
688
- }
689
- }
690
- ]
691
- };
692
- this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
693
- // this.vxeOptionMap['userRoleGridOption-'+companyCode] = opts;
694
- this.$set(this.vxeOptionMap, 'userRoleGridOption-' + companyCode, opts);
695
- });
696
- },
697
- confirmRole(rows) {
698
- if (rows.length > 0) {
699
- let outUserCodes = this.outUserCodes;
700
- if (this.userType === 1) {
701
- //企业用户
702
- rows = rows.filter(row => !outUserCodes.includes(row.code));
703
- } else if (this.userType === 2) {
704
- //外部用户
705
- rows = rows.filter(row => outUserCodes.includes(row.code));
706
- }
707
- let companyCode = this.companyInfo.companyCode;
708
- const $grid = this.$refs['userRoleGrid-' + companyCode][0];
709
- const tableData = this.gridRoleDataMap[companyCode];
710
- const map = {};
711
- tableData.forEach(function (item) {
712
- map[item.roleId] = 1;
713
- });
714
- var items = [];
715
- rows.forEach(row => {
716
- const item = {
717
- roleId: row.id,
718
- roleName: row.name,
719
- companyCode: companyCode,
720
- companyName: row.companyName
721
- };
722
- if (!map[item.roleId]) {
723
- items.push(item);
724
- }
725
- });
726
- // $grid.insertAt(items, -1);
727
- // this.user.userRoleDTOs = this.user.userRoleDTOs.concat(items);
728
- this.gridRoleDataMap[companyCode] = tableData.concat(items)
729
- $grid.loadData(this.gridRoleDataMap[companyCode])
730
- }
731
- },
732
- deleteRole(tableRef) {
733
- this.$baseConfirm(this.$t1('您确定要删除吗?')).then(() => {
734
- /*const $grid = this.$refs.userRoleGrid;
735
- $grid.removeCheckboxRow();
736
- this.user.userRoleDTOs = $grid.getTableData().fullData;*/
737
- let companyCode = this.companyInfo.companyCode;
738
- const $grid = this.$refs[tableRef][0];
739
- $grid.removeCheckboxRow();
740
- this.gridRoleDataMap[companyCode] = $grid.getTableData().fullData;
741
-
742
- });
743
- },
744
- deleteRoleItem(row, index, $table) {
745
- $table.remove(row);
746
- this.gridRoleDataMap[row.companyCode].splice(index, 1);
747
- },
748
- confirmInsertCompany(rows, callback) {
749
- if (rows.length > 0) {
750
- const tableData = this.user.userCompanyInfoDTOs;
751
- const map = {};
752
- tableData.forEach(function (item) {
753
- map[item.companyCode] = 1;
754
- });
755
- var items = [];
756
- rows.forEach(row => {
757
- const item = {companyCode: row.companyCode, companyName: row.companyName, guid: null};
758
- if (!map[item.companyCode]) {
759
- items.push(item);
760
- }
761
- this.gridRoleDataMap[item.companyCode] = []
762
- this.gridSaleOrgDataMap[item.companyCode] = []
763
- });
764
- // $grid.insertAt(items, -1);
765
- this.user.userCompanyInfoDTOs.splice(0, 0, ...items);
766
- // this.user.userCompanyInfoDTOs = this.user.userCompanyInfoDTOs.concat(items);
767
- }
768
- callback && callback();
769
- },
770
- deleteCompany(row, index) {
771
- let companyCode = row.companyCode;
772
- this.user.userCompanyInfoDTOs.splice(index, 1);
773
- this.gridSaleOrgDataMap[row.companyCode] = [];
774
- this.gridRoleDataMap[row.companyCode] = [];
775
- this.user.userSaleOrgDTOs = this.user.userSaleOrgDTOs.filter(item => item.companyCode != companyCode);
776
- this.user.userRoleDTOs = this.user.userRoleDTOs.filter(item => item.companyCode != companyCode);
777
- },
778
- confirmInsertSaleOrg(rows) {
779
- if (rows.length > 0) {
780
- let companyCode = this.companyInfo.companyCode;
781
- const $grid = this.$refs['saleOrgGrid-' + companyCode][0];
782
- const tableData = this.gridSaleOrgDataMap[companyCode] || [];
783
- const map = {};
784
- tableData.forEach(function (item) {
785
- map[item.saleOrgId] = 1;
786
- });
787
-
788
- let roleMap = {};
789
- let newUserRoleDTOs = [];
790
- var items = [];
791
-
792
- rows.forEach((row, index) => {
793
- const item = {
794
- companyCode: companyCode,
795
- companyName: row.companyName,
796
- defaults: false,
797
- saleOrgName: row.name,
798
- treePathName: row.treePathName,
799
- userSaleOrgPositionDTOs: [],
800
- saleOrgId: row.id,
801
- sn: row.sn
802
- };
803
-
804
- if (!map[item.saleOrgId]) {
805
- items.push(item);
806
- if (row.roleId && !roleMap[row.roleId]) {
807
- const roleItem = {
808
- id: row.roleId,
809
- name: row.roleName,
810
- companyCode: companyCode,
811
- companyName: row.companyName
812
- };
813
- roleMap[row.roleId] = true;
814
- newUserRoleDTOs.push(roleItem);
815
- }
816
- }
817
- });
818
- if (items.length > 0 && tableData.length == 0) {
819
- items[0].defaults = true;
820
- }
821
- // this.user.userSaleOrgDTOs.push(...items);
822
- this.gridSaleOrgDataMap[companyCode] = tableData.concat(items)
823
- $grid.loadData(this.gridSaleOrgDataMap[companyCode])
824
- this.confirmRole(newUserRoleDTOs);
825
- }
826
- },
827
- openSelectPositionDialog(row, rowIndex, $table) {
828
- const userSaleOrgPositionDTOs = row.userSaleOrgPositionDTOs || [];
829
- const items = [];
830
- userSaleOrgPositionDTOs.forEach(userSaleOrgPositionDTO => {
831
- const item = {
832
- companyCode: userSaleOrgPositionDTO.companyCode,
833
- companyName: userSaleOrgPositionDTO.companyName,
834
- name: userSaleOrgPositionDTO.positionName,
835
- code: userSaleOrgPositionDTO.code,
836
- id: userSaleOrgPositionDTO.positionId
837
- };
838
- items.push(item);
839
- });
840
-
841
- this.positionDialogDatas = items;
842
- this.saleOrgPositionIndex = rowIndex;
843
- this.showPositionDialog = true;
844
- },
845
- confirmInsertPosition(rows) {
846
- let companyCode = this.companyInfo.companyCode;
847
- const saleOrgPositionIndex = this.saleOrgPositionIndex;
848
- const tableData = this.gridSaleOrgDataMap[companyCode];
849
- if (rows.length > 0) {
850
- const oldPositions = tableData[saleOrgPositionIndex].userSaleOrgPositionDTOs || [];
851
- const map = {};
852
- oldPositions.forEach(function (item) {
853
- map[item.positionId] = item;
854
- });
855
- var oItems = [];
856
- var items = [];
857
- rows.forEach(row => {
858
- const item = {
859
- companyCode: row.companyCode,
860
- companyName: row.companyName,
861
- positionName: row.name,
862
- code: row.code,
863
- positionId: row.id
864
- };
865
-
866
- if (!map[item.positionId]) {
867
- items.push(item);
868
- } else {
869
- oItems.push(map[item.positionId]);
870
- }
871
- });
872
- tableData[saleOrgPositionIndex].userSaleOrgPositionDTOs = oItems.concat(items);
873
- } else {
874
- tableData[saleOrgPositionIndex].userSaleOrgPositionDTOs = [];
875
- }
876
- this.$forceUpdate();
877
- },
878
- getSelectPositionName(row) {
879
- var userSaleOrgPositions = row.userSaleOrgPositionDTOs || [];
880
- var allName = '';
881
- userSaleOrgPositions.forEach(function (pItem, pIndex) {
882
- allName = allName + ',' + pItem.positionName;
883
- });
884
- if (allName) {
885
- allName = allName.substr(1);
886
- }
887
- return allName;
888
- },
889
- getConpanyInfo() {
890
- this.$http({
891
- url: USER_PREFIX + '/company_info/getCurrent',
892
- method: `post`,
893
- isLoading: true,
894
- success: res => {
895
- this.companyInfo = res.objx || {};
896
- let companyCode = this.companyInfo.companyCode;
897
- if (!this.isEdit) {
898
- this.addCurrentCompany();
899
- } else {
900
- this.getCompanyInfoData(() => {
901
- this.getUserRoleData();
902
- this.getSaleOrgData();
903
- setTimeout(() => {
904
- this.user.userCompanyInfoDTOs.forEach(userCompanyInfoDTO => {
905
- this.initSaleOrg(userCompanyInfoDTO.companyCode);
906
- this.initUserRole(userCompanyInfoDTO.companyCode);
907
- })
908
- }, 100)
909
- });
910
- }
911
- }
912
- });
913
- },
914
- isCurrentCompany(companyCode) {
915
- return this.companyInfo.companyCode == companyCode;
916
- },
917
- addCurrentCompany(callback) {
918
- this.confirmInsertCompany([this.companyInfo], callback);
919
- setTimeout(() => {
920
- this.initSaleOrg(this.companyInfo.companyCode);
921
- this.initUserRole(this.companyInfo.companyCode);
922
- setTimeout(() => {
923
- if (this.userType === 2) {
924
- //经销商
925
- if (this.distributorRole) {
926
- this.confirmRole([this.distributorRole]);
927
- }
928
- }
929
- }, 100)
930
- }, 100)
931
-
932
-
933
- },
934
- handleData() {
935
- let saleOrgs = [];
936
- Object.keys(this.gridSaleOrgDataMap).forEach(companyCode => {
937
- saleOrgs.push(...this.gridSaleOrgDataMap[companyCode])
938
- });
939
- let roles = [];
940
- Object.keys(this.gridRoleDataMap).forEach(companyCode => {
941
- roles.push(...this.gridRoleDataMap[companyCode])
942
- });
943
- this.user.userRoleDTOs = roles;
944
- this.user.userSaleOrgDTOs = saleOrgs
945
- },
946
- initDistributorRole() {
947
- if (this.outUserCodes && this.outUserCodes.length == 1) {
948
- return this.$http({
949
- url: USER_PREFIX + '/role/list',
950
- method: 'post',
951
- success: res => {
952
- let roleList = res.objx || [];
953
- let distributorCode = this.outUserCodes[0];
954
- this.distributorRole = roleList.find(item => item.code == distributorCode);
955
- }
956
- });
957
- }
958
- },
959
- async initOutUserRoleCode() {
960
- //初始化外部用户编码
961
- return this.$http({
962
- url: USER_PREFIX + '/system_parameter/getByCode',
963
- method: 'post',
964
- data: {"code": "outUserRoleCode"},
965
- success: res => {
966
- let value = (!res.objx || !res.objx.value) ? "distributor" : res.objx.value;
967
- let codes = value.split(',');
968
- this.outUserCodes = codes;//外部用户编码
969
- this.initRoleDialogParam();//初始化角色弹框的查询参数
970
- }
971
- });
972
- },
973
- initRoleDialogParam() {
974
- //初始化角色弹框的查询参数
975
- if (this.userType == 1) {
976
- //企业用户
977
- this.roleDialogParam = {
978
- queryAll: true,
979
- neCodes: [...this.outUserCodes]
980
- };
981
- } else if (this.userType == 2) {
982
- //外部用户
983
- this.roleDialogParam = {
984
- queryAll: true,
985
- eqCodes: [...this.outUserCodes]
986
- };
987
- }
988
- },
989
- unlock() {
990
- this.$baseConfirm(this.$t1('您确定要解锁吗?')).then(() => {
991
- var url = USER_PREFIX + '/user/unlockLoginAccount';
992
- this.$http({
993
- url: url,
994
- method: `post`,
995
- data: {
996
- id: this.user.id
997
- },
998
- isLoading: true,
999
- success: res => {
1000
- this.$message({
1001
- message: res.content,
1002
- type: 'success',
1003
- duration: 500,
1004
- onClose: t => {
1005
- this.$baseReload();
1006
- }
1007
- });
1008
- }
1009
- });
1010
- });
1011
- },
1012
- confirmCountry(rows) {
1013
- if (rows.length) {
1014
- let row = rows[0];
1015
- this.user.countryName = row.countryName;
1016
- this.user.countryCode = row.countryCode;
1017
- }
1018
- }
1019
- }
1020
- };
1021
- </script>
1
+ <template>
2
+ <div class="detail-wrap">
3
+ <el-form ref="editForm" :model="user">
4
+ <div class="d-header clearfix">
5
+ <div class="fl">
6
+ <i class="el-icon-info" />
7
+ {{ dataId ? $t1("查看用户") : $t1("新增用户") }}
8
+ </div>
9
+ <div class="fr">
10
+ <temp-storage-button
11
+ :option="tempStorageOption"
12
+ v-if="!dataId"
13
+ ></temp-storage-button>
14
+ <base-input-export
15
+ :option="exportOption"
16
+ :parent-target="_self"
17
+ v-if="dataId"
18
+ />
19
+ <el-button
20
+ type="primary"
21
+ plain
22
+ class="button-sty"
23
+ icon="el-icon-unlock"
24
+ @click="unlock"
25
+ v-if="user.locked"
26
+ v-hasPermi="'user:unlock'"
27
+ >{{ $t1("解锁") }}
28
+ </el-button>
29
+ <el-button
30
+ type="primary"
31
+ plain
32
+ class="button-sty"
33
+ @click="$baseReload()"
34
+ icon="el-icon-refresh-right"
35
+ >
36
+ {{ $t1("重置") }}
37
+ </el-button>
38
+ <el-button
39
+ type="primary"
40
+ class="button-sty"
41
+ icon="el-icon-check"
42
+ @click="saveData"
43
+ >{{ $t1("保存") }}
44
+ </el-button>
45
+ </div>
46
+ </div>
47
+ <baseTabs>
48
+ <baseTabPane :label="$t1('基本信息')">
49
+ <template #default>
50
+ <table class="table-detail">
51
+ <tbody>
52
+ <tr>
53
+ <th>
54
+ <em class="f-red">*</em>
55
+ {{ $t1("登录名") }}
56
+ </th>
57
+ <td colspan="3">
58
+ <el-form-item
59
+ prop="loginAccount"
60
+ :rules="[{ required: true, trigger: 'blur' }]"
61
+ >
62
+ <template v-if="dataId">
63
+ <el-input
64
+ size="small"
65
+ v-model="user.loginAccount"
66
+ maxlength="255"
67
+ autocomplete="off"
68
+ lay-verify="required"
69
+ required=""
70
+ :readonly="true"
71
+ />
72
+ </template>
73
+ <template v-else>
74
+ <el-input
75
+ size="small"
76
+ v-model="user.loginAccount"
77
+ maxlength="255"
78
+ autocomplete="off"
79
+ lay-verify="required"
80
+ required=""
81
+ clearable
82
+ />
83
+ </template>
84
+ </el-form-item>
85
+ </td>
86
+
87
+ <th>
88
+ <em class="f-red">*</em>
89
+ {{ $t1("姓名") }}
90
+ </th>
91
+ <td colspan="3">
92
+ <el-form-item
93
+ prop="nickName"
94
+ :rules="[{ required: true, trigger: 'blur' }]"
95
+ >
96
+ <el-input
97
+ size="small"
98
+ v-model="user.nickName"
99
+ maxlength="200"
100
+ lay-verify="required"
101
+ required=""
102
+ clearable
103
+ />
104
+ </el-form-item>
105
+ </td>
106
+ </tr>
107
+ <tr>
108
+ <th>
109
+ <em class="f-red" v-if="!dataId">*</em>
110
+ {{ $t1("密码") }}
111
+ </th>
112
+ <td>
113
+ <el-form-item prop="password" :rules="passRules">
114
+ <el-input
115
+ size="small"
116
+ type="password"
117
+ v-model="user.password"
118
+ show-password
119
+ maxlength="255"
120
+ autocomplete="off"
121
+ auto-complete="new-password"
122
+ clearable
123
+ />
124
+ </el-form-item>
125
+ </td>
126
+ <th>
127
+ <em class="f-red" v-if="!dataId">*</em>
128
+ {{ $t1("确认密码") }}
129
+ </th>
130
+ <td>
131
+ <el-form-item prop="rePassword" :rules="pass2Rules">
132
+ <el-input
133
+ size="small"
134
+ type="password"
135
+ v-model="user.rePassword"
136
+ show-password
137
+ maxlength="255"
138
+ autocomplete="off"
139
+ auto-complete="new-password"
140
+ lay-verify="confirmPass"
141
+ clearable
142
+ />
143
+ </el-form-item>
144
+ </td>
145
+
146
+ <th>{{ $t1("性别") }}</th>
147
+ <td>
148
+ <el-radio-group v-model="user.gender">
149
+ <el-radio :label="1">{{ $t1("") }}</el-radio>
150
+ <el-radio :label="2">{{ $t1("女") }}</el-radio>
151
+ </el-radio-group>
152
+ </td>
153
+ <th>
154
+ {{ $t1("员工编码") }}
155
+ </th>
156
+ <td>
157
+ <el-form-item
158
+ prop="empNo"
159
+ :rules="[{ required: false, trigger: 'blur' }]"
160
+ >
161
+ <el-input
162
+ size="small"
163
+ v-model="user.empNo"
164
+ maxlength="200"
165
+ clearable
166
+ />
167
+ </el-form-item>
168
+ </td>
169
+ </tr>
170
+
171
+ <tr>
172
+ <th>{{ $t1("出生日期") }}</th>
173
+ <td>
174
+ <el-date-picker
175
+ size="small"
176
+ v-model="user.birth"
177
+ type="date"
178
+ :placeholder="$t1('选择日期')"
179
+ value-format="yyyy-MM-dd"
180
+ clearable
181
+ />
182
+ </td>
183
+ <th>{{ $t1("邮编") }}</th>
184
+ <td>
185
+ <el-input
186
+ size="small"
187
+ v-model="user.zipCode"
188
+ maxlength="255"
189
+ clearable
190
+ />
191
+ </td>
192
+ <th>{{ $t1("手机") }}</th>
193
+ <td>
194
+ <el-form-item
195
+ prop="mobile"
196
+ :rules="[{ required: false, trigger: 'blur' }]"
197
+ >
198
+ <el-input
199
+ size="small"
200
+ v-model="user.mobile"
201
+ type="text"
202
+ maxlength="255"
203
+ autocomplete="off"
204
+ lay-verify="required|phone"
205
+ clearable
206
+ />
207
+ </el-form-item>
208
+ </td>
209
+ <th>{{ $t1("设置") }}</th>
210
+ <td>
211
+ <el-checkbox
212
+ :label="$t1('是否启用')"
213
+ v-model="user.enabled"
214
+ ></el-checkbox>
215
+ </td>
216
+ </tr>
217
+
218
+ <tr>
219
+ <th>
220
+ {{ $t1("邮箱") }}
221
+ </th>
222
+ <td>
223
+ <el-form-item
224
+ prop="email"
225
+ :rules="[{ required: false, trigger: 'blur' }]"
226
+ >
227
+ <el-input
228
+ size="small"
229
+ v-model="user.email"
230
+ maxlength="200"
231
+ clearable
232
+ />
233
+ </el-form-item>
234
+ </td>
235
+ <!-- <th v-if="flag!=='2'">
236
+ GUID
237
+ </th>
238
+ <td v-if="flag!=='2'">
239
+ <el-form-item prop="guid" :rules="[{ required: false, trigger: 'blur' }]">
240
+ <el-input size="small" v-model="user.guid" maxlength="200" clearable/>
241
+ </el-form-item>
242
+ </td>-->
243
+ <th>{{ $t1("地址") }}</th>
244
+ <td colspan="3">
245
+ <el-input
246
+ size="small"
247
+ v-model="user.address"
248
+ class="b"
249
+ maxlength="255"
250
+ clearable
251
+ />
252
+ </td>
253
+ </tr>
254
+ <tr>
255
+ <th>
256
+ {{ $t1("国家") }}
257
+ </th>
258
+ <td colspan="3">
259
+ <el-form-item
260
+ prop="countryName"
261
+ :rules="[{ required: false, trigger: 'blur' }]"
262
+ >
263
+ <el-input
264
+ class="search-input"
265
+ v-model="user.countryName"
266
+ clearable
267
+ @clear="
268
+ user.countryName = null;
269
+ user.countryCode = null;
270
+ "
271
+ v-el-readonly
272
+ >
273
+ <i
274
+ slot="suffix"
275
+ class="el-input__icon el-icon-search"
276
+ @click="showCountryDialog = true"
277
+ ></i>
278
+ </el-input>
279
+ </el-form-item>
280
+ </td>
281
+ <th>
282
+ {{ $t1("是否锁定") }}
283
+ </th>
284
+ <td>
285
+ {{ user.locked ? $t1("是") : $t1("否") }}
286
+ </td>
287
+ </tr>
288
+ <tr v-if="userType == 2">
289
+ <th>
290
+ {{ $t1("签约人") }}
291
+ </th>
292
+ <td>
293
+ <el-form-item
294
+ prop="signatoryName"
295
+ :rules="[{ required: false, trigger: 'blur' }]"
296
+ >
297
+ <el-input
298
+ size="small"
299
+ v-model="user.signatoryName"
300
+ maxlength="200"
301
+ clearable
302
+ />
303
+ </el-form-item>
304
+ </td>
305
+ <th>
306
+ {{ $t1("签约人电话") }}
307
+ </th>
308
+ <td>
309
+ <el-form-item
310
+ prop="signatoryMobile"
311
+ :rules="[{ required: false, trigger: 'blur' }]"
312
+ >
313
+ <el-input
314
+ size="small"
315
+ v-model="user.signatoryMobile"
316
+ maxlength="200"
317
+ clearable
318
+ />
319
+ </el-form-item>
320
+ </td>
321
+ </tr>
322
+ <tr>
323
+ <th>{{ $t1("头像") }}</th>
324
+ <td colspan="7">
325
+ <baseUpload
326
+ :limit="1"
327
+ accept="image/png, image/jpeg"
328
+ multi="false"
329
+ :file.sync="user.headPhotoUrl"
330
+ dataType="medium"
331
+ ></baseUpload>
332
+ </td>
333
+ </tr>
334
+ <tr>
335
+ <th>{{ $t1("创建人") }}</th>
336
+ <td>{{ user.createBy }}</td>
337
+ <th>{{ $t1("创建时间") }}</th>
338
+ <td>{{ user.createDate }}</td>
339
+ <th>{{ $t1("更新人") }}</th>
340
+ <td>{{ user.modifyBy }}</td>
341
+ <th>{{ $t1("更新时间") }}</th>
342
+ <td>{{ user.modifyDate }}</td>
343
+ </tr>
344
+ </tbody>
345
+ </table>
346
+ </template>
347
+ </baseTabPane>
348
+ <baseTabPane :label="$t1('组织信息')">
349
+ <template #button>
350
+ <el-button
351
+ class="button-sty"
352
+ @click="addCurrentCompany()"
353
+ icon="el-icon-search"
354
+ v-if="!hasCurrentCompany"
355
+ >
356
+ {{ $t1("新增组织权限") }}
357
+ </el-button>
358
+ </template>
359
+ <template #default>
360
+ <div class="style1">
361
+ <div
362
+ class="d-item"
363
+ v-for="(item, index1) in user.userCompanyInfoDTOs"
364
+ :key="index1"
365
+ >
366
+ <div class="title">
367
+ <b>{{ item.companyName }}</b>
368
+ <el-button
369
+ class="button-sty"
370
+ icon="el-icon-delete"
371
+ v-if="isCurrentCompany(item.companyCode)"
372
+ @click="deleteCompany(item, index1)"
373
+ >{{ $t1("删除") }}
374
+ </el-button>
375
+ </div>
376
+ <div class="title-form">
377
+ <span>
378
+ <el-form-item
379
+ label="GUID"
380
+ :prop="'userCompanyInfoDTOs.' + index1 + '.guid'"
381
+ :rules="[{ required: false, trigger: 'blur' }]"
382
+ >
383
+ <el-input
384
+ size="small"
385
+ v-model="item.guid"
386
+ maxlength="200"
387
+ clearable
388
+ />
389
+ </el-form-item>
390
+ </span>
391
+ <span>
392
+ <el-form-item
393
+ label="是否默认组织"
394
+ :prop="'userCompanyInfoDTOs.' + index1 + '.defaults'"
395
+ :rules="[{ required: false, trigger: 'blur' }]"
396
+ >
397
+ <el-checkbox
398
+ v-model="item.defaults"
399
+ @change="changeCompanyDefault(item)"
400
+ ></el-checkbox>
401
+ </el-form-item>
402
+ </span>
403
+ </div>
404
+ <div class="m-2">
405
+ <div class="d-item" style="width: 65%">
406
+ <div class="title">
407
+ <b>{{ $t1("机构信息") }}</b>
408
+ <el-button
409
+ class="button-sty"
410
+ icon="el-icon-search"
411
+ @click="showSaleOrgDialog = true"
412
+ v-if="isCurrentCompany(item.companyCode)"
413
+ >{{ $t1("选择机构") }}
414
+ </el-button>
415
+ </div>
416
+ <div class="grid-h">
417
+ <vxe-grid
418
+ :ref="'saleOrgGrid-' + item.companyCode"
419
+ :data="item.saleOrgData"
420
+ v-bind="item.saleOrgGridOption"
421
+ @resizable-change="$vxeTableUtil.onColumnWitchChange"
422
+ @custom="$vxeTableUtil.customHandle"
423
+ >
424
+ <template #position="{ row, rowIndex, $table }">
425
+ <el-input
426
+ class="search-input"
427
+ :value="getSelectPositionName(row)"
428
+ clearable
429
+ @clear="
430
+ row.userSaleOrgPositionDTOs = [];
431
+ $forceUpdate();
432
+ "
433
+ v-el-readonly
434
+ v-if="companyInfo.companyCode == row.companyCode"
435
+ >
436
+ <i
437
+ slot="suffix"
438
+ class="el-input__icon el-icon-search"
439
+ @click="openSelectPositionDialog(row, rowIndex, $table)"
440
+ ></i>
441
+ </el-input>
442
+ <template v-else>
443
+ {{ getSelectPositionName(row) }}
444
+ </template>
445
+ </template>
446
+ </vxe-grid>
447
+ </div>
448
+ </div>
449
+ <div class="d-item" style="width: 35%">
450
+ <div class="title">
451
+ <b>{{ $t1("角色信息") }}</b>
452
+ <el-button
453
+ class="button-sty"
454
+ icon="el-icon-search"
455
+ @click="showRoleDialog = true"
456
+ v-if="isCurrentCompany(item.companyCode)"
457
+ >{{ $t1("选择角色") }}
458
+ </el-button>
459
+ </div>
460
+ <div class="grid-h">
461
+ <vxe-grid
462
+ :ref="'userRoleGrid-' + item.companyCode"
463
+ :data="item.roleData"
464
+ v-bind="item.roleGridOption"
465
+ @resizable-change="$vxeTableUtil.onColumnWitchChange"
466
+ @custom="$vxeTableUtil.customHandle"
467
+ ></vxe-grid>
468
+ </div>
469
+ </div>
470
+ </div>
471
+ </div>
472
+ </div>
473
+ </template>
474
+ </baseTabPane>
475
+ </baseTabs>
476
+ </el-form>
477
+ <roleDialog
478
+ v-if="showRoleDialog"
479
+ :visiable.sync="showRoleDialog"
480
+ @confirm="confirmRole"
481
+ :param="roleDialogParam"
482
+ />
483
+ <companyDialog
484
+ v-if="showCompanyDialog"
485
+ :visiable.sync="showCompanyDialog"
486
+ @confirm="confirmInsertCompany"
487
+ />
488
+ <saleOrgDialog
489
+ v-if="showSaleOrgDialog"
490
+ :visiable.sync="showSaleOrgDialog"
491
+ @confirm="confirmInsertSaleOrg"
492
+ :param="{ queryAll: true }"
493
+ />
494
+ <positionDialog
495
+ v-if="showPositionDialog"
496
+ :visiable.sync="showPositionDialog"
497
+ :rows="positionDialogDatas"
498
+ @confirm="confirmInsertPosition"
499
+ :param="{ queryAll: true }"
500
+ />
501
+ <countryDialog
502
+ v-if="showCountryDialog"
503
+ :visiable.sync="showCountryDialog"
504
+ @confirm="confirmCountry"
505
+ multi="false"
506
+ />
507
+ </div>
508
+ </template>
509
+
510
+ <script>
511
+ import xeUtils from "xe-utils";
512
+ import tempStorageButton from "@base/components/tempStorage/index.vue";
513
+
514
+ export default {
515
+ name: "UserEdit",
516
+ components: {
517
+ roleDialog: () => import("../../../views/user/role/dialog.vue"),
518
+ companyDialog: () => import("../../../views/user/company_info/dialog.vue"),
519
+ saleOrgDialog: () => import("../../../views/user/sale_org/dialog.vue"),
520
+ positionDialog: () => import("../../../views/user/position/dialog.vue"),
521
+ countryDialog: () => import("../../../views/user/country/dialog.vue"),
522
+ tempStorageButton,
523
+ },
524
+ props: ["_dataId", "userType", "flag"],
525
+ data() {
526
+ var validatePass = (rule, value, callback) => {
527
+ const isPassRequired = !this.dataId;
528
+ if (isPassRequired && (value == "" || value == undefined)) {
529
+ callback(new Error(this.$t1("密码不能为空")));
530
+ } else {
531
+ callback();
532
+ }
533
+ this.$refs.editForm.validateField("rePassword");
534
+ };
535
+ var validatePass2 = (rule, value, callback) => {
536
+ const isPassRequired = !this.dataId;
537
+ const rePassword = value != undefined ? value : "";
538
+ const password = this.user.password != undefined ? this.user.password : "";
539
+
540
+ if (isPassRequired && rePassword == "") {
541
+ callback(new Error(this.$t1("确认密码不能为空")));
542
+ } else if (rePassword != password) {
543
+ callback(new Error(this.$t1("两次输入密码不一致!")));
544
+ } else {
545
+ callback();
546
+ }
547
+ };
548
+
549
+ return {
550
+ dataId: "",
551
+ hBtn: true,
552
+ user: {
553
+ userCompanyInfoDTOs: [],
554
+ userSaleOrgDTOs: [],
555
+ userRoleDTOs: [],
556
+ gender: null,
557
+ enabled: true,
558
+ userType: null,
559
+ countryName: null,
560
+ countryCode: null,
561
+ },
562
+ companyTableData: [],
563
+ vxeOption: {},
564
+ companyInfoOption: {},
565
+ userRoleOption: {},
566
+ showRoleDialog: false,
567
+ showCompanyDialog: false,
568
+ showSaleOrgDialog: false,
569
+ showPositionDialog: false,
570
+ saleOrgPositionIndex: 0,
571
+ passRules: [{ validator: validatePass, trigger: "blur", required: false }],
572
+ pass2Rules: [{ validator: validatePass2, trigger: "blur", required: false }],
573
+ activeName: "first",
574
+ userCustomerListDTO: {
575
+ userCustomerDTOs: [],
576
+ },
577
+ customerOption: {},
578
+ showCustomerDialog: false,
579
+ exportOption: {
580
+ prefix: USER_PREFIX,
581
+ title: this.$t1("用户"),
582
+ codes: ["USEREXCEL", "USERPDF", "USERPRINT", "USERHIPRINT"],
583
+ param: () => {
584
+ return [{ id: this.dataId }];
585
+ },
586
+ },
587
+ showExtendedProperties: false,
588
+ radio1: "0",
589
+ companyInfo: {},
590
+ distributorCode: "distributor",
591
+ distributorRole: null,
592
+ outUserCodes: [],
593
+ roleDialogParam: { queryAll: true },
594
+ tempStorageOption: {
595
+ storageType: "user",
596
+ data: () => {
597
+ this.handleData();
598
+ return this.user;
599
+ },
600
+ chooseConfirm: (tempStorageData) => {
601
+ this.user = tempStorageData;
602
+ let map = xeUtils.groupBy(this.user.userRoleDTOs, "companyCode");
603
+ Object.keys(map).forEach((key) => {
604
+ let comapnyDTO = this.getCompanyDTO(key);
605
+ comapnyDTO.roleData = map[key];
606
+ });
607
+ },
608
+ saveConfirm: () => {},
609
+ },
610
+ showCountryDialog: false,
611
+ };
612
+ },
613
+ computed: {
614
+ hasCurrentCompany() {
615
+ return (
616
+ this.user.userCompanyInfoDTOs.find(
617
+ (item) => item.companyCode == this.companyInfo.companyCode
618
+ ) != null
619
+ );
620
+ },
621
+ },
622
+ created() {
623
+ if (this._dataId && !isNaN(this._dataId)) this.dataId = this._dataId;
624
+ },
625
+ async mounted() {
626
+ // this.getEainsGroupDTO();
627
+ await this.initOutUserRoleCode();
628
+ await this.initDistributorRole();
629
+ this.getData();
630
+ this.getConpanyInfo();
631
+ },
632
+ methods: {
633
+ getData() {
634
+ if (this.dataId && !isNaN(this.dataId)) {
635
+ this.isEdit = true;
636
+ this.$commonHttp({
637
+ url: USER_PREFIX + `/user/get`,
638
+ method: `post`,
639
+ data: {
640
+ id: this.dataId,
641
+ },
642
+ isLoading: true,
643
+ modalStrictly: true,
644
+ success: (res) => {
645
+ let user = res.objx || {};
646
+ user.userCompanyInfoDTOs = this.user.userCompanyInfoDTOs;
647
+ user.userSaleOrgDTOs = this.user.userSaleOrgDTOs;
648
+ user.userRoleDTOs = this.user.userRoleDTOs;
649
+ this.user = user;
650
+ this.user.password = "";
651
+
652
+ this.showExtendedProperties = true;
653
+ },
654
+ });
655
+ } else {
656
+ this.user.gender = 1;
657
+ this.isEdit = false;
658
+ this.showExtendedProperties = true;
659
+ }
660
+ },
661
+ saveData() {
662
+ let companyCode = this.companyInfo.companyCode;
663
+ this.handleData();
664
+ if (this.userType == 2) {
665
+ //外部用户
666
+ let currentUserCompanyInfo = this.user.userCompanyInfoDTOs.find(
667
+ (item) => item.companyCode == companyCode
668
+ );
669
+ if (currentUserCompanyInfo) {
670
+ let rows = this.user.userRoleDTOs.filter(
671
+ (item) => item.companyCode == companyCode
672
+ );
673
+ if (!rows.length) {
674
+ this.$baseAlert(this.$t1("请维护角色"));
675
+ return;
676
+ }
677
+ }
678
+ }
679
+ this.$refs.editForm.$baseValidate((valid) => {
680
+ if (valid) {
681
+ this.$baseConfirm(this.$t1("您确定要保存吗?")).then(() => {
682
+ var url = USER_PREFIX + (this.isEdit ? "/user/update" : "/user/save");
683
+ let userCompanyInfoDTOs = this.user.userCompanyInfoDTOs.map((item) => {
684
+ return {
685
+ ...item,
686
+ saleOrgGridOption: null,
687
+ roleGridOption: null,
688
+ saleOrgData: null,
689
+ roleData: null,
690
+ };
691
+ });
692
+ let formData = {
693
+ ...this.user,
694
+ userCompanyInfoDTOs,
695
+ };
696
+
697
+ this.$http({
698
+ url: url,
699
+ method: `post`,
700
+ data: formData,
701
+ isLoading: true,
702
+ success: (res) => {
703
+ this.$message({
704
+ message: res.content,
705
+ type: "success",
706
+ duration: 500,
707
+ onClose: (t) => {
708
+ if (this.isEdit) {
709
+ this.$baseReload();
710
+ } else {
711
+ this.$baseReload({
712
+ updateParam: {
713
+ _dataId: res.objx,
714
+ },
715
+ });
716
+ }
717
+ },
718
+ });
719
+ },
720
+ });
721
+ });
722
+ }
723
+ });
724
+ },
725
+ getSaleOrgData() {
726
+ if (this.dataId) {
727
+ this.$http({
728
+ url: USER_PREFIX + "/user/getUserSaleOrg",
729
+ method: `post`,
730
+ data: { id: this.dataId },
731
+ isLoading: true,
732
+ modalStrictly: true,
733
+ success: (res) => {
734
+ // this.$refs.saleOrgGrid.loadData(res.objx || []);
735
+ let rows = res.objx || [];
736
+ if (rows.length) {
737
+ let map = xeUtils.groupBy(rows, "companyCode");
738
+ Object.keys(map).forEach((key) => {
739
+ let companyDTO = this.getCompanyDTO(key);
740
+ companyDTO.saleOrgData = map[key];
741
+ });
742
+ }
743
+ this.user.userSaleOrgDTOs = rows;
744
+ },
745
+ });
746
+ }
747
+ },
748
+ getUserRoleData() {
749
+ if (this.dataId) {
750
+ this.$http({
751
+ url: USER_PREFIX + "/user/getUserRole",
752
+ method: `post`,
753
+ data: { id: this.dataId },
754
+ isLoading: true,
755
+ modalStrictly: true,
756
+ success: (res) => {
757
+ let rows = res.objx || [];
758
+ if (rows.length) {
759
+ let map = xeUtils.groupBy(rows, "companyCode");
760
+ Object.keys(map).forEach((key) => {
761
+ let companyDTO = this.getCompanyDTO(key);
762
+ companyDTO.roleData = map[key];
763
+ });
764
+ }
765
+ this.user.userRoleDTOs = rows;
766
+ },
767
+ });
768
+ }
769
+ },
770
+ deleteSaleOrgItem(row, index, $table) {
771
+ this.getCompanyDTO(row.companyCode).saleOrgData.splice(index, 1);
772
+ },
773
+ getCompanyInfoData(callback) {
774
+ if (this.dataId) {
775
+ this.$http({
776
+ url: USER_PREFIX + "/user/getUserCompanyInfo",
777
+ method: `post`,
778
+ data: { id: this.dataId },
779
+ isLoading: true,
780
+ modalStrictly: true,
781
+ success: (res) => {
782
+ let rows = res.objx || [];
783
+ let companyTableData = [];
784
+ rows.forEach((row) => {
785
+ Object.assign(row, {
786
+ saleOrgGridOption: {},
787
+ roleGridOption: {},
788
+ saleOrgData: [],
789
+ roleData: [],
790
+ });
791
+ });
792
+
793
+ this.user.userCompanyInfoDTOs = rows;
794
+ callback && callback();
795
+ },
796
+ });
797
+ }
798
+ },
799
+ initSaleOrg(companyCode) {
800
+ let companyDTO = this.getCompanyDTO(companyCode);
801
+ if (Object.keys(companyDTO.saleOrgGridOption).length) {
802
+ return;
803
+ }
804
+ let tableRef = "saleOrgGrid-" + companyCode;
805
+ const tableOption = {
806
+ vue: this,
807
+ tableRef: tableRef,
808
+ tableName: "editUser-saleOrgGrid-" + companyCode,
809
+ columns: [
810
+ { type: "checkbox", fixed: "left", width: 48, resizable: false },
811
+ { title: this.$t1("机构名称"), field: "saleOrgName", width: 200 },
812
+ { title: this.$t1("机构编码"), field: "sn", width: 200 },
813
+ { title: this.$t1("上级机构"), field: "treePathName", width: 200 },
814
+ {
815
+ title: this.$t1("岗位"),
816
+ field: "position",
817
+ width: 150,
818
+ slots: {
819
+ default: "position",
820
+ },
821
+ },
822
+ {
823
+ title: this.$t1("是否默认"),
824
+ field: "defaults",
825
+ width: 120,
826
+ slots: {
827
+ default: ({ row, $table, rowIndex }) => {
828
+ var isDefault = row.defaults || false;
829
+ let disabled = this.companyInfo.companyCode != row.companyCode;
830
+ return [
831
+ <el-checkbox
832
+ v-model={isDefault}
833
+ disabled={disabled}
834
+ onchange={() => {
835
+ let companyDTO = this.getCompanyDTO(row.companyCode);
836
+ companyDTO.saleOrgData.forEach((item, index) => {
837
+ if (index !== rowIndex) {
838
+ item.defaults = false;
839
+ }
840
+ });
841
+ this.$nextTick(() => {
842
+ row.defaults = true;
843
+ });
844
+ }}
845
+ />,
846
+ ];
847
+ },
848
+ },
849
+ },
850
+ {
851
+ width: 47,
852
+ fixed: "right",
853
+ title: "",
854
+ sortable: false,
855
+ slots: {
856
+ default: ({ row, rowIndex, $table }) => {
857
+ if (this.companyInfo.companyCode == row.companyCode) {
858
+ return [
859
+ <a
860
+ href="javascript:void(0);"
861
+ class="a-link"
862
+ onclick={() => {
863
+ this.deleteSaleOrgItem(row, rowIndex, $table);
864
+ }}
865
+ >
866
+ <el-tooltip
867
+ enterable={false}
868
+ effect="dark"
869
+ content={this.$t1("删除")}
870
+ placement="top"
871
+ popper-class="tooltip-skin"
872
+ >
873
+ <i class="el-icon-delete" />
874
+ </el-tooltip>
875
+ </a>,
876
+ ];
877
+ }
878
+ },
879
+ },
880
+ },
881
+ ],
882
+ };
883
+ this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
884
+ companyDTO.saleOrgGridOption = opts;
885
+ });
886
+ },
887
+ initUserRole(companyCode) {
888
+ let companyDTO = this.getCompanyDTO(companyCode);
889
+ if (Object.keys(companyDTO.roleGridOption).length) {
890
+ return;
891
+ }
892
+ let userType = this.userType;
893
+ const tableOption = {
894
+ vue: this,
895
+ tableRef: "userRoleGrid-" + companyCode,
896
+ tableName: "editUser-userRoleGrid-" + companyCode,
897
+ columns: [
898
+ { type: "checkbox", fixed: "left", width: 48, resizable: false },
899
+ {
900
+ title: this.$t1("角色名称"),
901
+ field: "name",
902
+ width: 200,
903
+ slots: {
904
+ default: ({ row }) => {
905
+ if (!row.isAdd) {
906
+ return row.roleName;
907
+ } else {
908
+ return row.name;
909
+ }
910
+ },
911
+ },
912
+ },
913
+ {
914
+ width: 47,
915
+ fixed: "right",
916
+ title: "",
917
+ sortable: false,
918
+ slots: {
919
+ default: ({ row, rowIndex, $table }) => {
920
+ if (this.companyInfo.companyCode == row.companyCode) {
921
+ return [
922
+ <a
923
+ href="javascript:void(0);"
924
+ class="a-link"
925
+ onclick={() => {
926
+ this.deleteRoleItem(row, rowIndex, $table);
927
+ }}
928
+ >
929
+ <el-tooltip
930
+ enterable={false}
931
+ effect="dark"
932
+ content={this.$t1("删除")}
933
+ placement="top"
934
+ popper-class="tooltip-skin"
935
+ >
936
+ <i class="el-icon-delete" />
937
+ </el-tooltip>
938
+ </a>,
939
+ ];
940
+ }
941
+ },
942
+ },
943
+ },
944
+ ],
945
+ };
946
+ this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
947
+ companyDTO.roleGridOption = opts;
948
+ });
949
+ },
950
+ confirmRole(rows) {
951
+ if (rows.length > 0) {
952
+ let companyCode = this.companyInfo.companyCode;
953
+ let companyDTO = this.getCompanyDTO(companyCode);
954
+ let outUserCodes = this.outUserCodes;
955
+ if (this.userType === 1) {
956
+ //组织用户
957
+ rows = rows.filter((row) => !outUserCodes.includes(row.code));
958
+ } else if (this.userType === 2) {
959
+ //外部用户
960
+ rows = rows.filter((row) => outUserCodes.includes(row.code));
961
+ }
962
+
963
+ const $grid = this.$refs["userRoleGrid-" + companyCode][0];
964
+ const tableData = companyDTO.roleData;
965
+ const map = {};
966
+ tableData.forEach(function (item) {
967
+ map[item.roleId] = 1;
968
+ });
969
+ var items = [];
970
+ rows.forEach((row) => {
971
+ const item = {
972
+ roleId: row.id,
973
+ roleName: row.name,
974
+ companyCode: companyCode,
975
+ companyName: row.companyName,
976
+ };
977
+ if (!map[item.roleId]) {
978
+ items.push(item);
979
+ }
980
+ });
981
+
982
+ companyDTO.roleData.push(...items);
983
+ }
984
+ },
985
+ deleteRoleItem(row, index, $table) {
986
+ let companyDTO = this.getCompanyDTO(row.companyCode);
987
+ $table.remove(row);
988
+ companyDTO.roleData.splice(index, 1);
989
+ },
990
+ confirmInsertCompany(rows, callback) {
991
+ if (rows.length > 0) {
992
+ const tableData = this.user.userCompanyInfoDTOs;
993
+ const map = {};
994
+ tableData.forEach(function (item) {
995
+ map[item.companyCode] = 1;
996
+ });
997
+ var items = [];
998
+ rows.forEach((row) => {
999
+ const item = {
1000
+ companyCode: row.companyCode,
1001
+ companyName: row.companyName,
1002
+ guid: null,
1003
+ defaults: false,
1004
+ saleOrgGridOption: {},
1005
+ roleGridOption: {},
1006
+ saleOrgData: [],
1007
+ roleData: [],
1008
+ };
1009
+ if (!map[item.companyCode]) {
1010
+ items.push(item);
1011
+ }
1012
+ });
1013
+ // $grid.insertAt(items, -1);
1014
+ this.user.userCompanyInfoDTOs.splice(0, 0, ...items);
1015
+ if (this.user.userCompanyInfoDTOs.length == 1) {
1016
+ this.user.userCompanyInfoDTOs[0].defaults = true;
1017
+ }
1018
+ // this.user.userCompanyInfoDTOs = this.user.userCompanyInfoDTOs.concat(items);
1019
+ }
1020
+ callback && callback();
1021
+ },
1022
+ deleteCompany(row, index) {
1023
+ let companyCode = row.companyCode;
1024
+ let companyDTO = this.getCompanyDTO(companyCode);
1025
+ this.user.userCompanyInfoDTOs.splice(index, 1);
1026
+ companyDTO.roleData = [];
1027
+ companyDTO.saleOrgData = [];
1028
+ this.user.userSaleOrgDTOs = this.user.userSaleOrgDTOs.filter(
1029
+ (item) => item.companyCode != companyCode
1030
+ );
1031
+ this.user.userRoleDTOs = this.user.userRoleDTOs.filter(
1032
+ (item) => item.companyCode != companyCode
1033
+ );
1034
+ },
1035
+ confirmInsertSaleOrg(rows) {
1036
+ if (rows.length > 0) {
1037
+ let companyCode = this.companyInfo.companyCode;
1038
+ let companyDTO = this.getCompanyDTO(companyCode);
1039
+ const $grid = this.$refs["saleOrgGrid-" + companyCode][0];
1040
+ const tableData = companyDTO.saleOrgData || [];
1041
+ const map = {};
1042
+ tableData.forEach(function (item) {
1043
+ map[item.saleOrgId] = 1;
1044
+ });
1045
+
1046
+ let roleMap = {};
1047
+ let newUserRoleDTOs = [];
1048
+ var items = [];
1049
+
1050
+ rows.forEach((row, index) => {
1051
+ const item = {
1052
+ companyCode: companyCode,
1053
+ companyName: row.companyName,
1054
+ defaults: false,
1055
+ saleOrgName: row.name,
1056
+ treePathName: row.treePathName,
1057
+ userSaleOrgPositionDTOs: [],
1058
+ saleOrgId: row.id,
1059
+ sn: row.sn,
1060
+ };
1061
+
1062
+ if (!map[item.saleOrgId]) {
1063
+ items.push(item);
1064
+ if (row.roleId && !roleMap[row.roleId]) {
1065
+ const roleItem = {
1066
+ id: row.roleId,
1067
+ name: row.roleName,
1068
+ companyCode: companyCode,
1069
+ companyName: row.companyName,
1070
+ };
1071
+ roleMap[row.roleId] = true;
1072
+ newUserRoleDTOs.push(roleItem);
1073
+ }
1074
+ }
1075
+ });
1076
+ if (items.length > 0 && tableData.length == 0) {
1077
+ items[0].defaults = true;
1078
+ }
1079
+
1080
+ companyDTO.saleOrgData.push(...items);
1081
+ this.confirmRole(newUserRoleDTOs);
1082
+ }
1083
+ },
1084
+ openSelectPositionDialog(row, rowIndex, $table) {
1085
+ const userSaleOrgPositionDTOs = row.userSaleOrgPositionDTOs || [];
1086
+ const items = [];
1087
+ userSaleOrgPositionDTOs.forEach((userSaleOrgPositionDTO) => {
1088
+ const item = {
1089
+ companyCode: userSaleOrgPositionDTO.companyCode,
1090
+ companyName: userSaleOrgPositionDTO.companyName,
1091
+ name: userSaleOrgPositionDTO.positionName,
1092
+ code: userSaleOrgPositionDTO.code,
1093
+ id: userSaleOrgPositionDTO.positionId,
1094
+ };
1095
+ items.push(item);
1096
+ });
1097
+
1098
+ this.positionDialogDatas = items;
1099
+ this.saleOrgPositionIndex = rowIndex;
1100
+ this.showPositionDialog = true;
1101
+ },
1102
+ confirmInsertPosition(rows) {
1103
+ let companyCode = this.companyInfo.companyCode;
1104
+ const saleOrgPositionIndex = this.saleOrgPositionIndex;
1105
+ let companyDTO = this.getCompanyDTO(companyCode);
1106
+ const tableData = companyDTO.saleOrgData || [];
1107
+ if (rows.length > 0) {
1108
+ const oldPositions =
1109
+ tableData[saleOrgPositionIndex].userSaleOrgPositionDTOs || [];
1110
+ const map = {};
1111
+ oldPositions.forEach(function (item) {
1112
+ map[item.positionId] = item;
1113
+ });
1114
+ var oItems = [];
1115
+ var items = [];
1116
+ rows.forEach((row) => {
1117
+ const item = {
1118
+ companyCode: row.companyCode,
1119
+ companyName: row.companyName,
1120
+ positionName: row.name,
1121
+ code: row.code,
1122
+ positionId: row.id,
1123
+ };
1124
+
1125
+ if (!map[item.positionId]) {
1126
+ items.push(item);
1127
+ } else {
1128
+ oItems.push(map[item.positionId]);
1129
+ }
1130
+ });
1131
+ tableData[saleOrgPositionIndex].userSaleOrgPositionDTOs = oItems.concat(items);
1132
+ } else {
1133
+ tableData[saleOrgPositionIndex].userSaleOrgPositionDTOs = [];
1134
+ }
1135
+ this.$forceUpdate();
1136
+ },
1137
+ getSelectPositionName(row) {
1138
+ var userSaleOrgPositions = row.userSaleOrgPositionDTOs || [];
1139
+ var allName = "";
1140
+ userSaleOrgPositions.forEach(function (pItem, pIndex) {
1141
+ allName = allName + "," + pItem.positionName;
1142
+ });
1143
+ if (allName) {
1144
+ allName = allName.substr(1);
1145
+ }
1146
+ return allName;
1147
+ },
1148
+ getConpanyInfo() {
1149
+ this.$http({
1150
+ url: USER_PREFIX + "/company_info/getCurrent",
1151
+ method: `post`,
1152
+ isLoading: true,
1153
+ success: (res) => {
1154
+ this.companyInfo = res.objx || {};
1155
+ let companyCode = this.companyInfo.companyCode;
1156
+ if (!this.isEdit) {
1157
+ this.addCurrentCompany();
1158
+ } else {
1159
+ this.getCompanyInfoData(() => {
1160
+ this.getUserRoleData();
1161
+ this.getSaleOrgData();
1162
+ setTimeout(() => {
1163
+ this.user.userCompanyInfoDTOs.forEach((userCompanyInfoDTO) => {
1164
+ this.initSaleOrg(userCompanyInfoDTO.companyCode);
1165
+ this.initUserRole(userCompanyInfoDTO.companyCode);
1166
+ });
1167
+ }, 100);
1168
+ });
1169
+ }
1170
+ },
1171
+ });
1172
+ },
1173
+ isCurrentCompany(companyCode) {
1174
+ return this.companyInfo.companyCode == companyCode;
1175
+ },
1176
+ addCurrentCompany(callback) {
1177
+ this.confirmInsertCompany([this.companyInfo], callback);
1178
+ setTimeout(() => {
1179
+ this.initSaleOrg(this.companyInfo.companyCode);
1180
+ this.initUserRole(this.companyInfo.companyCode);
1181
+ setTimeout(() => {
1182
+ if (this.userType === 2) {
1183
+ //经销商
1184
+ if (this.distributorRole) {
1185
+ this.confirmRole([this.distributorRole]);
1186
+ }
1187
+ }
1188
+ }, 100);
1189
+ }, 100);
1190
+ },
1191
+ handleData() {
1192
+ let saleOrgs = [];
1193
+ let roles = [];
1194
+ this.user.userCompanyInfoDTOs.forEach((companyDTO) => {
1195
+ saleOrgs.push(...companyDTO.saleOrgData);
1196
+ roles.push(...companyDTO.roleData);
1197
+ });
1198
+
1199
+ this.user.userRoleDTOs = roles;
1200
+ this.user.userSaleOrgDTOs = saleOrgs;
1201
+ },
1202
+ initDistributorRole() {
1203
+ if (this.outUserCodes && this.outUserCodes.length == 1) {
1204
+ return this.$http({
1205
+ url: USER_PREFIX + "/role/list",
1206
+ method: "post",
1207
+ success: (res) => {
1208
+ let roleList = res.objx || [];
1209
+ let distributorCode = this.outUserCodes[0];
1210
+ this.distributorRole = roleList.find((item) => item.code == distributorCode);
1211
+ },
1212
+ });
1213
+ }
1214
+ },
1215
+ async initOutUserRoleCode() {
1216
+ //初始化外部用户编码
1217
+ return this.$http({
1218
+ url: USER_PREFIX + "/system_parameter/getByCode",
1219
+ method: "post",
1220
+ data: { code: "outUserRoleCode" },
1221
+ success: (res) => {
1222
+ let value = !res.objx || !res.objx.value ? "distributor" : res.objx.value;
1223
+ let codes = value.split(",");
1224
+ this.outUserCodes = codes; //外部用户编码
1225
+ this.initRoleDialogParam(); //初始化角色弹框的查询参数
1226
+ },
1227
+ });
1228
+ },
1229
+ initRoleDialogParam() {
1230
+ //初始化角色弹框的查询参数
1231
+ if (this.userType == 1) {
1232
+ //组织用户
1233
+ this.roleDialogParam = {
1234
+ queryAll: true,
1235
+ neCodes: [...this.outUserCodes],
1236
+ };
1237
+ } else if (this.userType == 2) {
1238
+ //外部用户
1239
+ this.roleDialogParam = {
1240
+ queryAll: true,
1241
+ eqCodes: [...this.outUserCodes],
1242
+ };
1243
+ }
1244
+ },
1245
+ unlock() {
1246
+ this.$baseConfirm(this.$t1("您确定要解锁吗?")).then(() => {
1247
+ var url = USER_PREFIX + "/user/unlockLoginAccount";
1248
+ this.$http({
1249
+ url: url,
1250
+ method: `post`,
1251
+ data: {
1252
+ id: this.user.id,
1253
+ },
1254
+ isLoading: true,
1255
+ success: (res) => {
1256
+ this.$message({
1257
+ message: res.content,
1258
+ type: "success",
1259
+ duration: 500,
1260
+ onClose: (t) => {
1261
+ this.$baseReload();
1262
+ },
1263
+ });
1264
+ },
1265
+ });
1266
+ });
1267
+ },
1268
+ confirmCountry(rows) {
1269
+ if (rows.length) {
1270
+ let row = rows[0];
1271
+ this.user.countryName = row.countryName;
1272
+ this.user.countryCode = row.countryCode;
1273
+ }
1274
+ },
1275
+ changeCompanyDefault(item) {
1276
+ let companyCode = item.companyCode;
1277
+ if (item.defaults) {
1278
+ this.user.userCompanyInfoDTOs.forEach((row) => {
1279
+ row.defaults = row.companyCode == companyCode;
1280
+ });
1281
+ }
1282
+ },
1283
+ getCompanyDTO(companyCode) {
1284
+ return this.user.userCompanyInfoDTOs.find(
1285
+ (item) => item.companyCode == companyCode
1286
+ );
1287
+ },
1288
+ },
1289
+ };
1290
+ </script>