cloud-web-corejs 1.0.54-dev.33 → 1.0.54-dev.330

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