empty-list.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684
  1. <template>
  2. <div v-loading="loading">
  3. <div class="white-box">
  4. <div class="filter-box">
  5. <filter-user :filter-types="filterTypes" @select-value="handleFilterUser"></filter-user>
  6. </div>
  7. <el-table ref="wrapper" :data="tableData" stripe style="width: 100%;" @selection-change="handleSelectionChange"
  8. :height="tool.getTableHeight()">
  9. <el-table-column fixed type="selection" width="55" v-if="tableHeaders"></el-table-column>
  10. <el-table-column v-for="(tableHeader, key) in tableHeaders" :key="key" :label="tableHeader.header"
  11. :width="tableHeader.other.width ? tableHeader.other.width : ''" :fixed="tableHeader.index=='USER_NAME' || tableHeader.index=='REAL_NAME' ?true:false">
  12. <template slot-scope="scope">
  13. <template v-if="scope.row[tableHeader.index].other.tag">
  14. <el-tag
  15. :type="scope.row[tableHeader.index].other.tag.type ? scope.row[tableHeader.index].other.tag.type : null"
  16. :size="scope.row[tableHeader.index].other.tag.size ? scope.row[tableHeader.index].other.tag.size : null"
  17. :class="scope.row[tableHeader.index].other.tag.class ? scope.row[tableHeader.index].other.tag.class : null">
  18. {{scope.row[tableHeader.index].value}}
  19. </el-tag>
  20. </template>
  21. <template v-else>
  22. <!--<template v-if="tableHeader.index === 'USER_NAME'">-->
  23. <!--<el-dropdown v-if="permission.hasPermission(`user/login-to-frontend`)">-->
  24. <!--<span class="el-dropdown-link">-->
  25. <!--{{scope.row.USER_NAME.value}} <i class="el-icon-arrow-down el-icon&#45;&#45;right"></i>-->
  26. <!--</span>-->
  27. <!--<el-dropdown-menu slot="dropdown">-->
  28. <!--<el-dropdown-item command="login" v-show="scope.row.BTF_URL !== null">-->
  29. <!--<a :href="`${frontendServer}/#/login-by-backend?${scope.row.BTF_URL}`" target="_blank"-->
  30. <!--style="color:#606266;">快速登录</a>-->
  31. <!--</el-dropdown-item>-->
  32. <!--</el-dropdown-menu>-->
  33. <!--</el-dropdown>-->
  34. <!--<el-tag type="primary" size="small" class="no-border"-->
  35. <!--v-if="!permission.hasPermission(`user/login-to-frontend`)">{{scope.row.USER_NAME.value}}-->
  36. <!--</el-tag>-->
  37. <!--</template>-->
  38. <!--<template v-else>-->
  39. <div v-html="scope.row[tableHeader.index].value"></div>
  40. <!--</template>-->
  41. </template>
  42. </template>
  43. </el-table-column>
  44. <!-- <el-table-column fixed="right" label="operation" width="180">&lt;!&ndash; 操作 &ndash;&gt;-->
  45. <!-- <template slot-scope="scope">-->
  46. <!-- <el-dropdown size="small" trigger="click">-->
  47. <!-- <el-button type="primary" size="small" @click.stop="">-->
  48. <!-- Operate on this data&lt;!&ndash; 操作该数据 &ndash;&gt;<i class="el-icon-arrow-down el-icon&#45;&#45;right"></i>-->
  49. <!-- </el-button>-->
  50. <!-- <el-dropdown-menu slot="dropdown">-->
  51. <!-- <el-dropdown-item @click.native="handleModifyPassword(scope.row)"-->
  52. <!-- v-if="permission.hasPermission(`user/modify-password`)">Change Password&lt;!&ndash; 修改密码 &ndash;&gt;-->
  53. <!-- </el-dropdown-item>-->
  54. <!-- <el-dropdown-item @click.native="handleModifyProfile(scope.row)"-->
  55. <!-- v-if="permission.hasPermission(`user/modify-profile`)">Modify personal data&lt;!&ndash; 修改个人资料 &ndash;&gt;-->
  56. <!-- </el-dropdown-item>-->
  57. <!-- <el-dropdown-item @click.native="handleStatusActive(scope.row)">Status activation&lt;!&ndash; 状态激活 &ndash;&gt; </el-dropdown-item>-->
  58. <!-- <el-dropdown-item @click.native="handleStatusLock(scope.row)">Status lock&lt;!&ndash; 状态锁定 &ndash;&gt; </el-dropdown-item>-->
  59. <!-- </el-dropdown-menu>-->
  60. <!-- </el-dropdown>-->
  61. <!-- </template>-->
  62. <!-- </el-table-column>-->
  63. </el-table>
  64. <div class="white-box-footer">
  65. <!--<el-dropdown size="small" trigger="click" v-show="permission.hasPermission(`user/is-dec`)">-->
  66. <!--<el-button type="primary" size="small" @click.stop="">-->
  67. <!--报单中心管理<i class="el-icon-arrow-down el-icon&#45;&#45;right"></i>-->
  68. <!--</el-button>-->
  69. <!--<el-dropdown-menu slot="dropdown">-->
  70. <!--<el-dropdown-item command="isDec" @click.native="handleIsDecManage(true)">设为报单中心</el-dropdown-item>-->
  71. <!--<el-dropdown-item command="notDec" @click.native="handleIsDecManage(false)">取消报单中心-->
  72. <!--</el-dropdown-item>-->
  73. <!--</el-dropdown-menu>-->
  74. <!--</el-dropdown>-->
  75. <!--<el-dropdown size="small" trigger="click" v-show="permission.hasPermission(`user/is-atlas`)">-->
  76. <!--<el-button type="primary" size="small" @click.stop="">-->
  77. <!--图谱管理<i class="el-icon-arrow-down el-icon&#45;&#45;right"></i>-->
  78. <!--</el-button>-->
  79. <!--<el-dropdown-menu slot="dropdown">-->
  80. <!--<el-dropdown-item command="isAtlas" @click.native="handleIsAtlasManage(true)">显示图谱</el-dropdown-item>-->
  81. <!--<el-dropdown-item command="notAtlas" @click.native="handleIsAtlasManage(false)">隐藏图谱-->
  82. <!--</el-dropdown-item>-->
  83. <!--</el-dropdown-menu>-->
  84. <!--</el-dropdown>-->
  85. <!--<el-button type="success" size="small" @click="handleExport"-->
  86. <!--v-show="permission.hasPermission(`user/index-export`)">Export Excel-->
  87. <!--</el-button>-->
  88. <pagination :total="totalCount" :page_size="pageSize" @size-change="handleSizeChange"
  89. @current-change="handleCurrentChange"></pagination>
  90. </div>
  91. </div>
  92. <el-dialog :title="formModifyPassword.typeName" :visible.sync="dialogModifyPasswordVisible" width="50%">
  93. <el-form ref="form" :model="formModifyPassword" label-width="120px" class="form-dialog">
  94. <el-form-item label="type"><!-- 类型 -->
  95. <el-select v-model="formModifyPassword.passwordType" placeholder="Please select a type"><!-- 请选择类型 -->
  96. <el-option v-for="(item,key) in passwordType" :label="item.label" :value="item.type"
  97. :key="key"></el-option>
  98. </el-select>
  99. </el-form-item>
  100. <el-form-item label="password"><!-- 密码 -->
  101. <el-input placeholder="password" v-model="formModifyPassword.password"><!-- 密码 -->
  102. </el-input>
  103. </el-form-item>
  104. <el-form-item>
  105. <el-button type="primary" @click="handleModifyPasswordSubmit" :loading="submitPasswordButtonStat">Submit<!-- 提交 --></el-button>
  106. </el-form-item>
  107. </el-form>
  108. </el-dialog>
  109. <el-dialog :title="formModifyProfile.typeName" :visible.sync="dialogModifyProfileVisible" width="50%">
  110. <el-form ref="form" :model="formModifyProfile" label-width="120px" class="form-dialog">
  111. <el-form-item label="nation"><!-- 民族 -->
  112. <el-select v-model="formModifyProfile.nation" placeholder="Please select nationality"><!-- 请选择民族 -->
  113. <el-option v-for="(item,index) in allNation" :key="index" :label="item.name"
  114. :value="item.id"></el-option>
  115. </el-select>
  116. </el-form-item>
  117. <el-form-item label="Member name"><!-- 会员姓名 -->
  118. <el-input v-model="formModifyProfile.realName"></el-input>
  119. </el-form-item>
  120. <el-form-item label="ID"><!-- 身份证号 -->
  121. <el-input v-model="formModifyProfile.idCard"></el-input>
  122. </el-form-item>
  123. <el-form-item label="Phone Number"><!-- 手机号 -->
  124. <el-input v-model="formModifyProfile.mobile"></el-input>
  125. </el-form-item>
  126. <el-form-item label="Bank name"><!-- 银行名称 -->
  127. <el-select v-model="formModifyProfile.openBank" placeholder="Please select a bank name"><!-- 请选择银行名称 -->
  128. <el-option v-for="(item,index) in allOpenBank" :key="index" :label="item.BANK_NAME"
  129. :value="item.BANK_CODE"></el-option>
  130. </el-select>
  131. </el-form-item>
  132. <el-form-item label="Bank Address"><!-- 开户行地址 -->
  133. <el-input v-model="formModifyProfile.bankAddress"></el-input>
  134. </el-form-item>
  135. <el-form-item label="Bank account number"><!-- 银行帐号 -->
  136. <el-input v-model="formModifyProfile.bankNo"></el-input>
  137. </el-form-item>
  138. <el-form-item>
  139. <el-button type="primary" @click="handleModifyProfileSubmit" :loading="submitProfileButtonStat">Submit<!-- 提交 --></el-button>
  140. </el-form-item>
  141. </el-form>
  142. </el-dialog>
  143. </div>
  144. </template>
  145. <script>
  146. import network from './../../utils/network'
  147. import tool from './../../utils/tool'
  148. import {FRONTEND_SERVER} from '@/utils/config'
  149. import baseInfo from '@/utils/baseInfo'
  150. import FilterUser from '../../components/FilterUser'
  151. import store from './../../utils/vuexStore'
  152. import permission from '@/utils/permission'
  153. import Pagination from '@/components/Pagination'
  154. import filterHelper from '../../utils/filterHelper'
  155. export default {
  156. name: 'user_empty_list',
  157. components: {FilterUser, Pagination},
  158. mounted() {
  159. let _this = this
  160. if (permission.hasPermission(`user/close-login`) || permission.hasPermission(`user/close-area-login`) || permission.hasPermission(`user/batch-close-login`)) {
  161. network.getData('user/close-login-get').then(response => {
  162. _this.apps = response.apps
  163. _this.closeSwitch = response.closeSwitch
  164. if (permission.hasPermission(`user/close-dec`) || permission.hasPermission(`user/close-area-dec`) || permission.hasPermission(`user/batch-close-dec`)) {
  165. network.getData('user/close-dec-get').then(response => {
  166. _this.closeDecSwitch = response.closeSwitch
  167. _this.getData()
  168. }).catch(error => {
  169. })
  170. } else {
  171. _this.getData()
  172. }
  173. }).catch(error => {
  174. })
  175. } else {
  176. if (permission.hasPermission(`user/close-dec`) || permission.hasPermission(`user/close-area-dec`) || permission.hasPermission(`user/batch-close-dec`)) {
  177. network.getData('user/close-dec-get').then(response => {
  178. _this.closeDecSwitch = response.closeSwitch
  179. _this.getData()
  180. }).catch(error => {
  181. })
  182. } else {
  183. _this.getData()
  184. }
  185. }
  186. store.state.socket.onMessageCallback = this.onMessageCallback
  187. },
  188. data() {
  189. return {
  190. tableHeaders: null,
  191. tableData: null,
  192. loading: true,
  193. multipleSelection: [],
  194. currentPage: 1,
  195. totalPages: 1,
  196. totalCount: 1,
  197. pageSize: 20,
  198. frontendServer: FRONTEND_SERVER,
  199. baseDecLevels: baseInfo.decLevels(),
  200. baseEmpLevels: baseInfo.empLevels(),
  201. tool: tool,
  202. permission: permission,
  203. filterTypes: null,
  204. filterModel: {},
  205. dialogVisible: false,
  206. formCloseLogin: {
  207. userName: null,
  208. typeName: 'Login management',//登录管理
  209. type: null,
  210. isClose: 0,
  211. remark: '',
  212. areaSelected: null,
  213. },
  214. regionDataPlus: store.state.regionInfo.regionData,
  215. apps: null,
  216. closeSwitch: null,
  217. submitButtonStat: false,
  218. dialogDecVisible: false,
  219. dialogModifyPasswordVisible: false,
  220. dialogModifyProfileVisible: false,
  221. formCloseDec: {
  222. userName: null,
  223. typeName: 'Manage entry',//管理报单
  224. type: null,
  225. isClose: 0,
  226. remark: '',
  227. areaSelected: null,
  228. },
  229. formModifyPassword: {
  230. userId:'',
  231. password: '',
  232. typeName: 'Change Password',//修改密码
  233. passwordType: 'password',
  234. // remark: '',
  235. },
  236. formModifyProfile: {
  237. userId:'',
  238. typeName: 'Modify personal data',//修改个人资料
  239. nation: '',
  240. realName: '',
  241. idCard: '',
  242. mobile: '',
  243. openBank: '',
  244. bankAddress: '',
  245. bankNo: '',
  246. },
  247. passwordType: [
  248. {
  249. type:"password",
  250. label:"Login password"//登录密码
  251. },
  252. {
  253. type:"payPassword",
  254. label:"Payment password"//支付密码
  255. },
  256. ],
  257. allOpenBank:null,
  258. allNation:null,
  259. submitDecButtonStat: false,
  260. submitPasswordButtonStat: false,
  261. submitProfileButtonStat: false,
  262. transferPropForm: {
  263. userIds: [],
  264. allowTransfer: true,
  265. transferProp: 100,
  266. withdrawProp: 0,
  267. remark: '',
  268. },
  269. closeUserData: null,
  270. }
  271. },
  272. methods: {
  273. handleSelectionChange(val) {
  274. this.multipleSelection = val
  275. },
  276. handleCurrentChange(page) {
  277. this.getData(page, this.pageSize)
  278. },
  279. handleSizeChange(pageSize) {
  280. this.getData(this.currentPage, pageSize)
  281. },
  282. handleAdd() {
  283. this.$router.push('/user/user-add')
  284. },
  285. handleFilterUser(filterData) {
  286. filterHelper.handleFilterUser(this, filterData)
  287. },
  288. handleFilter() {
  289. this.getData()
  290. },
  291. getData(page, pageSize, isLoading = true) {
  292. network.getPageData(this, 'user/empty-list', page, pageSize, this.filterModel, response => {
  293. this.filterTypes = response.filterTypes
  294. }, isLoading)
  295. },
  296. handleGroupManage(isGroup) {
  297. if (this.multipleSelection.length < 1) {
  298. this.$message({
  299. message: 'Please check the member to be operated',//请勾选要操作的会员
  300. type: 'warning'
  301. })
  302. return
  303. }
  304. let groupTip = isGroup === true ? 'set as team leader ':' Cancel team leader '//'设为团队领导人' : '取消团队领导人'
  305. this.$confirm(`Are you sure you want to【${groupTip}】?`, 'Hint', {//`确定要对所选会员【${groupTip}】吗?`, '提示'
  306. confirmButtonText: 'confirm', // 确定
  307. cancelButtonText: 'cancel', // 取消
  308. type: 'warning'
  309. }).then(() => {
  310. let selectedIds = []
  311. for (let val of this.multipleSelection) {
  312. selectedIds.push(val.USER_ID)
  313. }
  314. return network.postData(`user/is-group`, {userIds: selectedIds, isGroup: isGroup})
  315. }).then(response => {
  316. this.$message({
  317. message: response,
  318. type: 'success'
  319. })
  320. this.getData(this.currentPage, this.pageSize)
  321. }).catch(response => {
  322. })
  323. },
  324. handleIsDecManage(isDec) {
  325. if (this.multipleSelection.length < 1) {
  326. this.$message({
  327. message: 'Please check the member to be operated',//请勾选要操作的会员
  328. type: 'warning'
  329. })
  330. return
  331. }
  332. let isDecTip = isDec === true ? 'set as Stockist ':' Cancel Stockist ' //'设为报单中心' : '取消报单中心'
  333. this.$confirm(`Are you sure you want to【${isDecTip}】?`, 'Hint', {//`确定要对所选会员【${isDecTip}】吗?`, '提示'
  334. confirmButtonText: 'confirm', // 确定
  335. cancelButtonText: 'cancel', // 取消
  336. type: 'warning'
  337. }).then(() => {
  338. let selectedIds = []
  339. for (let val of this.multipleSelection) {
  340. selectedIds.push(val.USER_ID)
  341. }
  342. return network.postData(`user/is-dec`, {userIds: selectedIds, isDec: isDec})
  343. }).then(response => {
  344. this.$message({
  345. message: response,
  346. type: 'success'
  347. })
  348. this.getData(this.currentPage, this.pageSize)
  349. }).catch(response => {
  350. })
  351. },
  352. handleIsAtlasManage(isAtlas) {
  353. if (this.multipleSelection.length < 1) {
  354. this.$message({
  355. message: 'Please check the member to be operated',//请勾选要操作的会员
  356. type: 'warning'
  357. })
  358. return
  359. }
  360. let isAtlasTip = isAtlas === true ? 'show chart': 'hide chart'//'显示图谱' : '隐藏图谱'
  361. this.$confirm(`Are you sure you want to【${isAtlasTip}】?`, 'Hint', {//`确定要对所选会员【${isAtlasTip}】吗?`, '提示'
  362. confirmButtonText: 'confirm', // 确定
  363. cancelButtonText: 'cancel', // 取消
  364. type: 'warning'
  365. }).then(() => {
  366. let selectedIds = []
  367. for (let val of this.multipleSelection) {
  368. selectedIds.push(val.USER_ID)
  369. }
  370. return network.postData(`user/is-atlas`, {userIds: selectedIds, isAtlas: isAtlas})
  371. }).then(response => {
  372. this.$message({
  373. message: response,
  374. type: 'success'
  375. })
  376. this.getData(this.currentPage, this.pageSize)
  377. }).catch(response => {
  378. })
  379. },
  380. getTypeName(type) {
  381. switch (type) {
  382. case 1:
  383. return 'By designated member'//按指定会员
  384. case 2:
  385. return 'Expand network by'//按开拓网络
  386. case 3:
  387. return 'By placement network'//按安置网络
  388. case 4:
  389. return 'By membership system'//按会员体系
  390. case 5:
  391. return 'By province and region'//按省份地区
  392. default:
  393. return ''
  394. }
  395. },
  396. handleLoginManage(type) {
  397. if (type === 2 || type === 3 || type === 4) {
  398. if (this.multipleSelection.length > 1) {
  399. this.$message({
  400. message: 'Multiple members are not allowed to be checked in this login management',//此登录管理不允许勾选多名会员
  401. type: 'warning'
  402. })
  403. return;
  404. } else if (this.multipleSelection.length < 1) {
  405. this.$message({
  406. message: 'Please select a member number',//请选择会员编号
  407. type: 'warning'
  408. })
  409. return;
  410. }
  411. }
  412. if (type === 1 && this.multipleSelection.length <= 0) {
  413. this.$message({
  414. message: 'Please select a member number',//请选择会员编号
  415. type: 'warning'
  416. })
  417. return;
  418. }
  419. if (type === 5 && this.multipleSelection.length > 0) {
  420. this.$message({
  421. message: 'Closing login by region without checking member',//按照地区关闭登录无需勾选会员
  422. type: 'warning'
  423. })
  424. return;
  425. }
  426. this.formCloseLogin = {
  427. userName: null,
  428. typeName: 'Login management',//登录管理
  429. type: null,
  430. isClose: 0,
  431. remark: '',
  432. areaSelected: null,
  433. },
  434. this.formCloseLogin.typeName = this.getTypeName(type) + 'Manage logins'//管理登录
  435. this.formCloseLogin.type = type
  436. this.dialogVisible = true
  437. },
  438. handleCloseLoginSubmit() {
  439. this.submitButtonStat = true
  440. // 获取所购选的会员,如果是批量关闭指定会员,则走批量关闭方法
  441. if (this.formCloseLogin.type === 1) {
  442. this.handleCloseLogin(this.formCloseLogin.isClose, this.formCloseLogin.remark)
  443. } else {
  444. for (let val of this.multipleSelection) {
  445. this.formCloseLogin.userName = val.USER_NAME.value
  446. }
  447. let path = 'user/close-login'
  448. if (this.formCloseLogin.type === 5) {
  449. path = 'user/close-area-login'
  450. }
  451. network.postData(path, this.formCloseLogin).then(response => {
  452. this.$message({
  453. message: response,
  454. type: 'success'
  455. })
  456. this.getData(this.currentPage, this.pageSize)
  457. this.submitButtonStat = false
  458. this.dialogVisible = false
  459. }).catch(response => {
  460. this.submitButtonStat = false
  461. })
  462. }
  463. },
  464. handleCloseLogin(isClose, remark = '') {
  465. let selectedIds = []
  466. for (let val of this.multipleSelection) {
  467. selectedIds.push(val.USER_ID)
  468. }
  469. console.log(selectedIds);
  470. network.postData(`user/batch-close-login`, {
  471. userIds: selectedIds,
  472. isClose: isClose,
  473. remark: remark,
  474. type: 1,
  475. }).then(response => {
  476. this.$message({
  477. message: response,
  478. type: 'success'
  479. })
  480. this.getData(this.currentPage, this.pageSize)
  481. this.submitButtonStat = false
  482. this.dialogVisible = false
  483. }).catch(response => {
  484. this.submitButtonStat = false
  485. })
  486. // let tipStr = isClose ? '禁止' : '允许'
  487. // this.$confirm(`确定要${tipStr}所选会员登录?`, 'Hint', {
  488. // confirmButtonText: 'confirm', // 确定
  489. // cancelButtonText: 'cancel', // 取消
  490. // type: 'warning'
  491. // }).then(() => {
  492. // return network.postData(`user/batch-close-login`, {userIds: selectedIds, isClose: isClose})
  493. // }).then(response => {
  494. // this.$message({
  495. // message: response,
  496. // type: 'success'
  497. // })
  498. // this.getData(this.currentPage, this.pageSize)
  499. // }).catch(response => {
  500. //
  501. // })
  502. },
  503. handleExport() {
  504. this.$confirm(`Are you sure you want to export the current data?`, 'Hint', {//`确定要导出当前数据吗?`, '提示'
  505. confirmButtonText: 'confirm',//确定
  506. cancelButtonText: 'cancel',//取消
  507. type: 'warning'
  508. }).then(() => {
  509. return network.getData(`user/index-export`, this.filterModel)
  510. }).then(response => {
  511. this.$message({
  512. message: response,
  513. type: 'success'
  514. })
  515. }).catch(response => {
  516. })
  517. },
  518. onMessageCallback(data) {
  519. //this.getData(this.currentPage, this.pageSize, false)
  520. },
  521. handleDecManage(type) {
  522. if (type === 2 || type === 3 || type === 4) {
  523. if (this.multipleSelection.length > 1) {
  524. this.$message({
  525. message: 'Multiple members are not allowed to be checked in this entry management',//此报单管理不允许勾选多名会员
  526. type: 'warning'
  527. })
  528. return;
  529. } else if (this.multipleSelection.length < 1) {
  530. this.$message({
  531. message: 'Please check the member to manage the entry',//请勾选要管理报单的会员
  532. type: 'warning'
  533. })
  534. return;
  535. }
  536. }
  537. if (type === 1 && this.multipleSelection.length <= 0) {
  538. this.$message({
  539. message: 'Please check the member to manage the entry',//请勾选要管理报单的会员
  540. type: 'warning'
  541. })
  542. return;
  543. }
  544. if (type === 5 && this.multipleSelection.length > 0) {
  545. this.$message({
  546. message: 'Closing entry by region without checking memberManage entry',//按照地区关闭报单无需勾选会员
  547. type: 'warning'
  548. })
  549. return;
  550. }
  551. this.formCloseDec = {
  552. userName: null,
  553. typeName: 'Manage entry',//管理报单
  554. type: null,
  555. isClose: 0,
  556. remark: '',
  557. areaSelected: null,
  558. },
  559. this.formCloseDec.typeName = this.getTypeName(type) + 'Manage entry'//管理报单
  560. this.formCloseDec.type = type
  561. this.dialogDecVisible = true
  562. },
  563. handleModifyPassword(row){
  564. this.formModifyPassword.userId = row.USER_ID;
  565. this.dialogModifyPasswordVisible = true
  566. },
  567. handleModifyProfile(row){
  568. this.dialogModifyProfileVisible = true
  569. let vueObj = this
  570. network.getData('user/profile-get', {id: row.USER_ID}).then(response => {
  571. vueObj.formModifyProfile = response.userInfo
  572. vueObj.allOpenBank = response.allOpenBank
  573. vueObj.allNation = response.allNation
  574. })
  575. },
  576. handleCloseDecSubmit() {
  577. this.submitDecButtonStat = true
  578. // 获取所购选的会员,如果是批量关闭指定会员,则走批量关闭方法
  579. if (this.formCloseDec.type === 1) {
  580. this.handleCloseDec(this.formCloseDec.isClose, this.formCloseDec.remark)
  581. } else {
  582. for (let val of this.multipleSelection) {
  583. this.formCloseDec.userName = val.USER_NAME.value
  584. }
  585. let path = 'user/close-dec'
  586. if (this.formCloseDec.type === 5) {
  587. path = 'user/close-area-dec'
  588. }
  589. network.postData(path, this.formCloseDec).then(response => {
  590. this.$message({
  591. message: response,
  592. type: 'success'
  593. })
  594. this.getData(this.currentPage, this.pageSize)
  595. this.submitDecButtonStat = false
  596. this.dialogDecVisible = false
  597. }).catch(response => {
  598. this.submitDecButtonStat = false
  599. })
  600. }
  601. },
  602. handleCloseDec(isClose, remark = '') {
  603. let selectedIds = []
  604. for (let val of this.multipleSelection) {
  605. selectedIds.push(val.USER_ID)
  606. }
  607. network.postData(`user/batch-close-dec`, {
  608. userIds: selectedIds,
  609. isClose: isClose,
  610. remark: remark,
  611. type: 1,
  612. }).then(response => {
  613. this.$message({
  614. message: response,
  615. type: 'success'
  616. })
  617. this.getData(this.currentPage, this.pageSize)
  618. this.submitDecButtonStat = false
  619. this.dialogDecVisible = false
  620. }).catch(response => {
  621. this.submitDecButtonStat = false
  622. })
  623. },
  624. handleStatusActive(row){
  625. network.postData('user/modify-status',{userId:row.USER_ID,status:1}).then(response=>{
  626. this.$message({
  627. message: response,
  628. type: 'success'
  629. })
  630. this.getData(this.currentPage, this.pageSize)
  631. })
  632. },
  633. handleStatusLock(row){
  634. network.postData('user/modify-status',{userId:row.USER_ID,status:0}).then(response=>{
  635. this.$message({
  636. message: response,
  637. type: 'success'
  638. })
  639. this.getData(this.currentPage, this.pageSize)
  640. })
  641. },
  642. handleModifyPasswordSubmit() {
  643. this.submitPasswordButtonStat = true
  644. let path = 'user/modify-password'
  645. network.postData(path, this.formModifyPassword).then(response => {
  646. this.$message({
  647. message: response,
  648. type: 'success'
  649. })
  650. this.getData(this.currentPage, this.pageSize)
  651. this.submitPasswordButtonStat = false
  652. this.dialogModifyPasswordVisible = false
  653. }).catch(response => {
  654. this.submitPasswordButtonStat = false
  655. })
  656. },
  657. handleModifyProfileSubmit() {
  658. this.submitProfileButtonStat = true
  659. let path = 'user/modify-profile'
  660. network.postData(path, this.formModifyProfile).then(response => {
  661. this.$message({
  662. message: response,
  663. type: 'success'
  664. })
  665. this.getData(this.currentPage, this.pageSize)
  666. this.submitProfileButtonStat = false
  667. this.dialogModifyProfileVisible = false
  668. }).catch(response => {
  669. this.submitProfileButtonStat = false
  670. })
  671. },
  672. }
  673. }
  674. </script>