index.vue 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828
  1. <template>
  2. <div class="app-container">
  3. <!-- 搜索区域 -->
  4. <el-card class="search-card" shadow="never">
  5. <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="80px">
  6. <el-form-item label="手机号" prop="phoneNumber">
  7. <el-input v-model="queryParams.phoneNumber" placeholder="请输入手机号" clearable prefix-icon="el-icon-mobile-phone" style="width: 200px" @keyup.enter.native="handleQuery" />
  8. </el-form-item>
  9. <el-form-item label="昵称" prop="nickName">
  10. <el-input v-model="queryParams.nickName" placeholder="请输入昵称" clearable prefix-icon="el-icon-user" style="width: 200px" @keyup.enter.native="handleQuery" />
  11. </el-form-item>
  12. <el-form-item label="姓名" prop="realName">
  13. <el-input v-model="queryParams.realName" placeholder="请输入真实姓名" clearable prefix-icon="el-icon-user" style="width: 200px" @keyup.enter.native="handleQuery" />
  14. </el-form-item>
  15. <el-form-item>
  16. <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
  17. <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
  18. </el-form-item>
  19. </el-form>
  20. </el-card>
  21. <!-- 操作按钮区域 -->
  22. <el-row :gutter="10" class="mb8">
  23. <el-col :span="1.5">
  24. <el-button type="primary" plain icon="el-icon-plus" @click="handleAdd" v-hasPermi="['app:user:add']" v-if="userInfoVO.userType == '02'">新增会员</el-button>
  25. </el-col>
  26. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  27. </el-row>
  28. <!-- 会员列表 -->
  29. <Page uri="/mapi/app/user/list" :request-params="queryParams" ref="pagination">
  30. <el-table-column label="编号" align="center" prop="id" width="100" />
  31. <el-table-column label="会员信息" align="left" min-width="300">
  32. <template slot-scope="scope">
  33. <div class="user-info-cell">
  34. <el-avatar :size="60" :src="scope.row.avatarUrl" icon="el-icon-user" class="user-avatar"></el-avatar>
  35. <div class="info-content">
  36. <div class="name-row">
  37. <span class="real-name">{{ scope.row.realName }}</span>
  38. <!-- <span class="nick-name text-gray">({{ scope.row.nickName }})</span> -->
  39. </div>
  40. <div class="phone-row text-gray">
  41. <i class="el-icon-user"></i>
  42. {{ scope.row.nickName }}
  43. </div>
  44. <!-- <div class="tags-row">
  45. <el-tag size="small" type="warning">Level {{ scope.row.level }}</el-tag>
  46. </div> -->
  47. </div>
  48. </div>
  49. </template>
  50. </el-table-column>
  51. <el-table-column label="手机号" align="phoneNumber" width="150">
  52. <template slot-scope="scope">
  53. {{ scope.row.phoneNumber ? scope.row.phoneNumber : '-' }}
  54. </template>
  55. </el-table-column>
  56. <el-table-column label="性别" align="center" width="100">
  57. <template slot-scope="scope">
  58. <el-tag size="small" type="info">
  59. <dict-tag :options="dict.type.sys_user_sex" :value="scope.row.sex" />
  60. </el-tag>
  61. </template>
  62. </el-table-column>
  63. <el-table-column label="积分" align="center" width="120">
  64. <template slot-scope="scope">
  65. {{ scope.row.point ? scope.row.point : 0 }}
  66. </template>
  67. </el-table-column>
  68. <!-- <el-table-column label="账户余额" align="center" min-width="320">-->
  69. <!-- <template slot-scope="scope">-->
  70. <!-- <div class="balance-info">-->
  71. <!-- <div class="balance-item">-->
  72. <!-- <span class="label">充值余额</span>-->
  73. <!-- <span class="value">¥{{ scope.row.rechargeBalance || '0.00' }}</span>-->
  74. <!-- </div>-->
  75. <!-- <div class="balance-item">-->
  76. <!-- <span class="label">赠送余额</span>-->
  77. <!-- <span class="value">¥{{ scope.row.giveBalance || '0.00' }}</span>-->
  78. <!-- </div>-->
  79. <!-- <div class="balance-item">-->
  80. <!-- <span class="label">福利金</span>-->
  81. <!-- <span class="value">¥{{ scope.row.welfareBalance || '0.00' }}</span>-->
  82. <!-- </div>-->
  83. <!-- </div>-->
  84. <!-- </template>-->
  85. <!-- </el-table-column>-->
  86. <el-table-column label="生日" align="center" width="140">
  87. <template slot-scope="scope">
  88. <span>{{ parseTime(scope.row.birthday, '{y}-{m}-{d}') }}</span>
  89. </template>
  90. </el-table-column>
  91. <el-table-column label="注册时间" align="center" width="180">
  92. <template slot-scope="scope">
  93. <span>{{ scope.row.createTime }}</span>
  94. </template>
  95. </el-table-column>
  96. <el-table-column label="操作" align="center" width="180" fixed="right">
  97. <template slot-scope="scope">
  98. <el-button type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['app:user:edit']" v-if="userInfoVO.userType == '02'">编辑</el-button>
  99. <el-button type="text" icon="el-icon-view" @click="handleView(scope.row)">详情</el-button>
  100. </template>
  101. </el-table-column>
  102. </Page>
  103. <!-- 会员详情弹窗 -->
  104. <el-dialog title="会员详情" :visible.sync="userViewType" width="80%" class="user-detail-dialog" :before-close="usercheckClose" append-to-body>
  105. <div class="user-detail">
  106. <!-- 基本信息卡片 -->
  107. <el-card class="detail-card" shadow="never">
  108. <div slot="header">
  109. <span class="card-title">基本信息</span>
  110. </div>
  111. <div class="user-basic-info">
  112. <div class="avatar-section">
  113. <div class="level-tag">
  114. <el-tag type="warning">Level {{ userInfo.level }}</el-tag>
  115. </div>
  116. </div>
  117. <el-descriptions :column="3" border>
  118. <el-descriptions-item label="姓名">
  119. <span class="primary-text">{{ userInfo.realName }}</span>
  120. </el-descriptions-item>
  121. <el-descriptions-item label="手机号">
  122. {{ userInfo.phoneNumber }}
  123. </el-descriptions-item>
  124. <el-descriptions-item label="性别">
  125. <dict-tag :options="dict.type.sys_user_sex" :value="userInfo.sex" />
  126. </el-descriptions-item>
  127. <el-descriptions-item label="生日">
  128. {{ parseTime(userInfo.birthday, '{y}-{m}-{d}') }}
  129. </el-descriptions-item>
  130. <el-descriptions-item label="地址" :span="2">
  131. {{ getAddress(userInfo) ? getAddress(userInfo) : '暂无地址' }}
  132. </el-descriptions-item>
  133. </el-descriptions>
  134. </div>
  135. </el-card>
  136. <!-- 账户信息卡片 -->
  137. <el-card class="detail-card" shadow="never">
  138. <div slot="header">
  139. <span class="card-title">账户信息</span>
  140. </div>
  141. <div class="account-info">
  142. <div class="balance-card">
  143. <div class="balance-item">
  144. <div class="label">充值余额</div>
  145. <div class="value">¥{{ userInfo.rechargeBalance || '0.00' }}</div>
  146. </div>
  147. <div class="balance-item">
  148. <div class="label">赠送余额</div>
  149. <div class="value">¥{{ userInfo.giveBalance || '0.00' }}</div>
  150. </div>
  151. <div class="balance-item">
  152. <div class="label">福利金余额</div>
  153. <div class="value">¥{{ userInfo.welfareBalance || '0.00' }}</div>
  154. </div>
  155. </div>
  156. </div>
  157. </el-card>
  158. <!-- 详情选项卡 -->
  159. <el-card class="detail-card" shadow="never">
  160. <el-tabs v-model="activeValue" type="border-card" @tab-click="btn_chioc">
  161. <el-tab-pane name="1">
  162. <span slot="label"><i class="el-icon-s-ticket"></i> 优惠券</span>
  163. <el-table v-loading="userloading" :data="userinfoData" border stripe>
  164. <el-table-column label="优惠券信息" align="left" min-width="250">
  165. <template slot-scope="scope">
  166. <div class="coupon-info">
  167. <div class="title">{{ scope.row.couponTypeTitle }}</div>
  168. <div class="type">
  169. <dict-tag :options="dict.type.coupon_type" :value="scope.row.discountWay" />
  170. </div>
  171. <div class="value">
  172. <template v-if="scope.row.discountWay == 0"> 满{{ scope.row.minAmount }}元减{{ scope.row.deductAmount }}元 </template>
  173. <template v-if="scope.row.discountWay == 1"> 满{{ scope.row.minAmount }}件减{{ scope.row.deductAmount }}件 </template>
  174. <template v-if="scope.row.discountWay == 2"> {{ scope.row.discountRate }}%折扣 </template>
  175. </div>
  176. </div>
  177. </template>
  178. </el-table-column>
  179. <el-table-column label="有效期" align="center" width="300">
  180. <template slot-scope="scope">
  181. <div class="date-range">
  182. <div>{{ scope.row.startDate }}</div>
  183. <div class="separator">至</div>
  184. <div>{{ scope.row.endDate }}</div>
  185. </div>
  186. </template>
  187. </el-table-column>
  188. <el-table-column label="使用状态" align="center" width="120">
  189. <template slot-scope="scope">
  190. <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.isUsed" />
  191. </template>
  192. </el-table-column>
  193. <el-table-column label="核销信息" align="center" min-width="200">
  194. <template slot-scope="scope">
  195. <template v-if="scope.row.isUsed === 'Y'">
  196. <div>{{ scope.row.usedOrgName }}</div>
  197. <div class="text-gray">{{ scope.row.usedTime }}</div>
  198. </template>
  199. <span v-else>-</span>
  200. </template>
  201. </el-table-column>
  202. </el-table>
  203. <pagination v-show="usertotal > 0" :total="usertotal" :page.sync="userViewForm.pageNum" :limit.sync="userViewForm.pageSize" @pagination="getMemberCouponData" />
  204. </el-tab-pane>
  205. <el-tab-pane name="2">
  206. <span slot="label"><i class="el-icon-coin"></i> 消费明细</span>
  207. <el-table v-loading="userloading" :data="userinfoData" fit highlight-current-row border stripe>
  208. <el-table-column label="订单编号" align="center" prop="orderNo" min-width="200" />
  209. <el-table-column label="订单类型" align="center" prop="orderType" width="150">
  210. <template slot-scope="scope">
  211. <dict-tag :options="dict.type.order_type" :value="scope.row.orderType" />
  212. </template>
  213. </el-table-column>
  214. <el-table-column label="账单标题" align="center" prop="title" width="100" />
  215. <el-table-column label="支付方式" align="center" prop="payType" width="100">
  216. <template slot-scope="scope">
  217. <dict-tag :options="dict.type.recharge_pay_type" :value="scope.row.payType" />
  218. </template>
  219. </el-table-column>
  220. <el-table-column label="支付总金额" align="center" prop="payTotalAmount" width="100" />
  221. <el-table-column label="现金支付金额" align="center" prop="cashPayAmount" width="100" />
  222. <el-table-column label="充值余额支付金额" align="center" prop="rechargePayAmount" width="150" />
  223. <el-table-column label="赠送余额支付金额" align="center" prop="givePayAmount" width="150" />
  224. <el-table-column label="福利金余额支付金额" align="center" prop="welfarePayAmount" width="150" />
  225. <el-table-column label="消费积分" align="center" prop="usePoint" width="80" />
  226. <el-table-column label="获取积分" align="center" prop="receivePoint" width="80" />
  227. <el-table-column label="是否退款" align="center" prop="isRefund" width="80" />
  228. </el-table>
  229. <pagination v-show="usertotal > 0" :total="usertotal" :page.sync="userViewForm.pageNum" :limit.sync="userViewForm.pageSize" @pagination="getMemberBillMstrData" />
  230. </el-tab-pane>
  231. <el-tab-pane name="3">
  232. <span slot="label"><i class="el-icon-shopping-cart-1"></i> 商品订单</span>
  233. <el-table v-loading="userloading" :data="userinfoData" fit highlight-current-row border stripe>
  234. <el-table-column label="订单编号" align="center" prop="orderNo" width="150" />
  235. <el-table-column label="订单总价(元)" align="center" prop="totalPrice" width="150" />
  236. <el-table-column label="抵扣金额(元)" align="center" prop="deductAmount" width="150">
  237. <template slot-scope="scope">
  238. {{ scope.row.deductAmount ? scope.row.deductAmount : '0' }}
  239. </template>
  240. </el-table-column>
  241. <el-table-column label="支付金额(元)" align="center" prop="payAmount" width="150" />
  242. <el-table-column label="订单状态" align="center" prop="orderStatus" width="150">
  243. <template slot-scope="scope">
  244. <dict-tag :options="dict.type.order_goods_status" :value="scope.row.orderStatus" />
  245. </template>
  246. </el-table-column>
  247. <el-table-column label="支付方式" align="center" prop="payType">
  248. <template slot-scope="scope">
  249. <dict-tag :options="dict.type.recharge_pay_type" :value="scope.row.payType" />
  250. </template>
  251. </el-table-column>
  252. <el-table-column label="下单时间" align="center" prop="createTime" width="150" />
  253. <el-table-column label="支付时间" align="center" prop="payTime" width="150" />
  254. </el-table>
  255. <pagination v-show="usertotal > 0" :total="usertotal" :page.sync="userViewForm.pageNum" :limit.sync="userViewForm.pageSize" @pagination="getMemberOrderGoodsData" />
  256. </el-tab-pane>
  257. <el-tab-pane name="4">
  258. <span slot="label"><i class="el-icon-orange"></i> 洗衣订单</span>
  259. <el-table v-loading="userloading" :data="userinfoData" fit highlight-current-row border stripe>
  260. <el-table-column label="订单编号" align="center" prop="orderNo" min-width="150" />
  261. <el-table-column label="门店/工厂名称" align="center" prop="sysOrg.name" width="150" />
  262. <el-table-column label="数量" align="center" prop="orderClothCount" width="100" />
  263. <el-table-column label="合计" align="center" prop="clothItemName" width="150">
  264. <template slot-scope="scope">
  265. <span>合计:{{ scope.row.payAmount }}元</span>
  266. <br />
  267. <span v-if="scope.row.payType == '0'">支付方式:微信</span>
  268. <span v-if="scope.row.payType == '1'">支付方式:支付宝</span>
  269. <span v-if="scope.row.payType == '2'">支付方式:现金</span>
  270. <span v-if="scope.row.payType == '3'">支付方式:余额</span>
  271. </template>
  272. </el-table-column>
  273. <el-table-column label="订单来源" align="center" width="150">
  274. <template slot-scope="scope">
  275. <span v-if="scope.row.orderSource == 'OFFLINE'">线下</span>
  276. <span v-else>线上</span>
  277. </template>
  278. </el-table-column>
  279. <el-table-column label="订单时间" align="center" prop="createTime" min-width="150" />
  280. <el-table-column label="状态" align="center" width="150">
  281. <template slot-scope="scope">
  282. <dict-tag :options="dict.type.cloth_order_status" :value="scope.row.orderStatus" />
  283. </template>
  284. </el-table-column>
  285. </el-table>
  286. <pagination v-show="usertotal > 0" :total="usertotal" :page.sync="userViewForm.pageNum" :limit.sync="userViewForm.pageSize" @pagination="getMemberOrderClothData" />
  287. </el-tab-pane>
  288. <el-tab-pane name="5">
  289. <span slot="label"><i class="el-icon-bank-card"></i> 会员卡</span>
  290. <el-table v-loading="userloading" :data="userinfoData" fit highlight-current-row border stripe>
  291. <el-table-column label="卡号" align="center" prop="cardNo" width="150px" />
  292. <el-table-column label="充值金额(元)" align="center" prop="rechargeAmount" width="150px" />
  293. <el-table-column label="赠送金额(元)" align="center" prop="giveAmount" width="150px" />
  294. <el-table-column label="充值余额(元)" align="center" prop="rechargeBalance" width="150px" />
  295. <el-table-column label="赠送余额(元)" align="center" prop="giveBalance" width="150px" />
  296. <el-table-column label="福利金额(元)" align="center" prop="welfareAmount" width="150px" />
  297. <el-table-column label="福利金余额(元)" align="center" prop="welfareBalance" width="150px" />
  298. <el-table-column label="赠送积分" align="center" prop="givePointAmount" width="150px" />
  299. <el-table-column label="使用状态" align="center" prop="rechargeStatus" width="150px">
  300. <template slot-scope="scope">
  301. <el-tag v-if="scope.row.rechargeStatus == 1">已使用</el-tag>
  302. <el-tag type="info" v-else>未使用</el-tag>
  303. </template>
  304. </el-table-column>
  305. <el-table-column label="充值门店" align="center" prop="rechargeStoreName" width="200px" />
  306. <el-table-column label="充值时间" align="center" prop="rechargeTime" width="150px" />
  307. </el-table>
  308. <pagination v-show="usertotal > 0" :total="usertotal" :page.sync="userViewForm.pageNum" :limit.sync="userViewForm.pageSize" @pagination="getMemberCardData" />
  309. </el-tab-pane>
  310. </el-tabs>
  311. </el-card>
  312. </div>
  313. </el-dialog>
  314. <!-- 编辑用户信息 -->
  315. <el-dialog :title="title" :visible.sync="open" width="60%" :before-close="closeDialog" append-to-body>
  316. <EditUser :dataSource="form" :isDisabled="isDisabled" @onSubmit="handleSubmit" />
  317. </el-dialog>
  318. </div>
  319. </template>
  320. <script>
  321. import { listUser, getUser, delUser, addUser, updateUser, updateUserStatus, getMemberInfoById, getMemberCouponInfo, getMemberBillMstrInfo, getMemberOrderGoodsInfo, getMemberOrderClothInfo, getMemberCardInfoList } from '@/api/app/user'
  322. import EditUser from './component/editUser'
  323. export default {
  324. name: 'User',
  325. components: {
  326. EditUser
  327. },
  328. dicts: ['sys_user_sex', 'coupon_type', 'sys_yes_no', 'cloth_order_status', 'order_type', 'recharge_pay_type', 'order_goods_status'],
  329. data() {
  330. return {
  331. userInfoVO: null,
  332. // 遮罩层
  333. loading: true,
  334. // 选中数组
  335. ids: [],
  336. // 非单个禁用
  337. single: true,
  338. // 非多个禁用
  339. multiple: true,
  340. // 显示搜索条件
  341. showSearch: true,
  342. // 总条数
  343. total: 0,
  344. // 用户表格数据
  345. userList: [],
  346. // 弹出层标题
  347. title: '',
  348. // 是否显示弹出层
  349. open: false,
  350. // 查询参数
  351. queryParams: {
  352. phoneNumber: null,
  353. nickName: null,
  354. realName: null
  355. },
  356. // 表单参数
  357. form: {},
  358. // 表单校验
  359. rules: {
  360. nickName: [
  361. {
  362. required: true,
  363. message: '昵称不能为空',
  364. trigger: 'blur'
  365. }
  366. ],
  367. realName: [
  368. {
  369. required: true,
  370. message: '真实姓名不能为空',
  371. trigger: 'blur'
  372. }
  373. ],
  374. phoneNumber: [
  375. {
  376. required: true,
  377. message: '手机号不能为空',
  378. trigger: 'blur'
  379. }
  380. ],
  381. sex: [
  382. {
  383. required: true,
  384. message: '性别不能为空',
  385. trigger: 'blur'
  386. }
  387. ]
  388. },
  389. isDisabled: true,
  390. userViewType: false,
  391. userInfo: {},
  392. userViewForm: {
  393. appUserId: 0,
  394. pageNum: 1,
  395. pageSize: 10
  396. },
  397. usertotal: 0,
  398. userloading: false,
  399. userinfoData: [],
  400. activeValue: '1'
  401. }
  402. },
  403. created() {
  404. this.handleUser()
  405. this.getList()
  406. },
  407. methods: {
  408. handleUser() {
  409. this.userInfoVO = this.getUserInfo()
  410. },
  411. /** 查询用户列表 */
  412. getList() {
  413. this.$nextTick(() => {
  414. this.$refs.pagination.handleSearch(true)
  415. })
  416. },
  417. // 取消按钮
  418. cancel() {
  419. this.open = false
  420. this.reset()
  421. },
  422. // 表单重置
  423. reset() {
  424. this.form = {
  425. id: null,
  426. phoneNumber: null,
  427. nickName: null,
  428. realName: null,
  429. sex: null,
  430. birthday: null,
  431. avatarUrl: null,
  432. unionId: null,
  433. createTime: null,
  434. payPassword: null,
  435. isUsePayPassword: null,
  436. status: '0',
  437. level: null
  438. }
  439. this.resetForm('form')
  440. },
  441. // 编辑会员
  442. handleSubmit() {
  443. this.open = false
  444. this.getList()
  445. },
  446. /** 搜索按钮操作 */
  447. handleQuery() {
  448. this.getList()
  449. },
  450. /** 重置按钮操作 */
  451. resetQuery() {
  452. this.resetForm('queryForm')
  453. this.handleQuery()
  454. },
  455. // 多选框选中数据
  456. handleSelectionChange(selection) {
  457. this.ids = selection.map((item) => item.id)
  458. this.single = selection.length !== 1
  459. this.multiple = !selection.length
  460. },
  461. /** 新增按钮操作 */
  462. handleAdd() {
  463. this.reset()
  464. this.open = true
  465. this.isDisabled = false
  466. this.title = '添加用户'
  467. },
  468. /** 修改按钮操作 */
  469. handleUpdate(row) {
  470. this.reset()
  471. const id = row.id || this.ids
  472. getUser(id).then((response) => {
  473. console.log("AAAA")
  474. this.form = response.data
  475. this.open = true
  476. this.isDisabled = true
  477. this.title = '修改用户'
  478. })
  479. },
  480. /** 提交按钮 */
  481. submitForm() {
  482. // this.$refs["form"].validate(valid => {
  483. // if (valid) {
  484. // if (this.form.id != null) {
  485. // updateUser(this.form).then(response => {
  486. // this.$modal.msgSuccess("修改成功");
  487. // this.open = false;
  488. // this.getList();
  489. // });
  490. // } else {
  491. // addUser(this.form).then(response => {
  492. // this.$modal.msgSuccess("新增成功");
  493. // this.open = false;
  494. // this.getList();
  495. // });
  496. // }
  497. // }
  498. // });
  499. this.open = false
  500. this.getList()
  501. },
  502. /** 删除按钮操作 */
  503. handleDelete(row) {
  504. const ids = row.id || this.ids
  505. this.$modal
  506. .confirm('是否确认删除用户编号为"' + ids + '"的数据项?')
  507. .then(function () {
  508. return delUser(ids)
  509. })
  510. .then(() => {
  511. this.getList()
  512. this.$modal.msgSuccess('删除成功')
  513. })
  514. .catch(() => {})
  515. },
  516. /** 导出按钮操作 */
  517. handleExport() {
  518. this.download(
  519. 'mapi/app/user/export',
  520. {
  521. ...this.queryParams
  522. },
  523. `user_${new Date().getTime()}.xlsx`
  524. )
  525. },
  526. checkClose(done) {
  527. this.$confirm('是否关闭表单,关闭后数据将丢失?')
  528. .then(function () {
  529. done()
  530. })
  531. .then(() => {})
  532. .catch(() => {})
  533. },
  534. handleStatusChange(row) {
  535. let text = row.status === '0' ? '启用' : '停用'
  536. this.$confirm('确认要' + text + ' ' + row.name + ' 吗?')
  537. .then(function () {
  538. return updateUserStatus(row.id, row.status)
  539. })
  540. .then(() => {
  541. this.$modal.msgSuccess(text + '成功')
  542. })
  543. .catch(function () {
  544. row.status = row.status === '0' ? '1' : '0'
  545. })
  546. },
  547. //客户详情弹框
  548. handleView(row) {
  549. getMemberInfoById({
  550. appUserId: row.id
  551. }).then((response) => {
  552. this.userViewType = true
  553. this.userInfo = response.data
  554. this.userViewForm = {
  555. appUserId: row.id,
  556. pageNum: 1,
  557. pageSize: 15
  558. }
  559. this.activeValue = '1'
  560. this.getMemberCouponData()
  561. })
  562. },
  563. //获取会员优惠券列表
  564. getMemberCouponData() {
  565. this.userloading = true
  566. getMemberCouponInfo(this.userViewForm).then((response) => {
  567. this.userinfoData = response.rows
  568. this.usertotal = response.total
  569. this.userloading = false
  570. })
  571. },
  572. //获取会员消费明细
  573. getMemberBillMstrData() {
  574. this.userloading = true
  575. getMemberBillMstrInfo(this.userViewForm).then((response) => {
  576. this.userinfoData = response.data.records
  577. this.usertotal = response.data.total
  578. this.userloading = false
  579. })
  580. },
  581. //获取会员商品订单信息
  582. getMemberOrderGoodsData() {
  583. this.userloading = true
  584. getMemberOrderGoodsInfo(this.userViewForm).then((response) => {
  585. this.userinfoData = response.data.records
  586. this.usertotal = response.data.total
  587. this.userloading = false
  588. })
  589. },
  590. //获取会员洗衣订单信息
  591. getMemberOrderClothData() {
  592. this.userloading = true
  593. getMemberOrderClothInfo(this.userViewForm).then((response) => {
  594. this.userinfoData = response.data.records
  595. this.usertotal = response.data.total
  596. this.userloading = false
  597. })
  598. },
  599. //总部客户管理- 会员卡列表查询
  600. getMemberCardData() {
  601. this.userloading = true
  602. getMemberCardInfoList(this.userViewForm).then((response) => {
  603. this.userinfoData = response.data.records
  604. this.usertotal = response.data.total
  605. this.userloading = false
  606. })
  607. },
  608. getAddress(userInfo) {
  609. return userInfo.province + userInfo.city + userInfo.area + userInfo.address + userInfo.addressDetail
  610. },
  611. btn_chioc(tab, event) {
  612. console.log('tab.index', tab.index)
  613. this.userViewForm.pageNum = 1
  614. this.userinfoData = []
  615. if (tab.index === '0') {
  616. this.getMemberCouponData()
  617. } else if (tab.index === '1') {
  618. this.getMemberBillMstrData()
  619. } else if (tab.index === '2') {
  620. this.getMemberOrderGoodsData()
  621. } else if (tab.index === '3') {
  622. this.getMemberOrderClothData()
  623. } else {
  624. this.getMemberCardData()
  625. }
  626. },
  627. usercheckClose(done) {
  628. this.$confirm('是否关闭客户详情?')
  629. .then(function () {
  630. done()
  631. })
  632. .then(() => {})
  633. .catch(() => {})
  634. },
  635. // 取消按钮
  636. usercancel() {
  637. this.userViewType = false
  638. this.userInfo = {}
  639. },
  640. closeDialog() {
  641. this.open = false
  642. }
  643. }
  644. }
  645. </script>
  646. <style lang="scss" scoped>
  647. .app-container {
  648. .search-card {
  649. margin-bottom: 16px;
  650. }
  651. .user-info-cell {
  652. display: flex;
  653. align-items: flex-start;
  654. padding: 8px 0;
  655. .user-avatar {
  656. margin-right: 16px;
  657. flex-shrink: 0;
  658. }
  659. .info-content {
  660. flex: 1;
  661. .name-row {
  662. margin-bottom: 8px;
  663. .real-name {
  664. font-size: 15px;
  665. font-weight: 500;
  666. margin-right: 8px;
  667. }
  668. .nick-name {
  669. font-size: 13px;
  670. }
  671. }
  672. .phone-row {
  673. margin-bottom: 8px;
  674. font-size: 13px;
  675. i {
  676. margin-right: 4px;
  677. }
  678. }
  679. .tags-row {
  680. .el-tag + .el-tag {
  681. margin-left: 8px;
  682. }
  683. }
  684. }
  685. }
  686. .balance-info {
  687. display: flex;
  688. justify-content: space-around;
  689. padding: 8px 0;
  690. .balance-item {
  691. text-align: center;
  692. .label {
  693. font-size: 13px;
  694. color: #909399;
  695. margin-bottom: 4px;
  696. }
  697. .value {
  698. font-size: 15px;
  699. font-weight: 500;
  700. color: #409eff;
  701. }
  702. }
  703. }
  704. }
  705. .user-detail-dialog {
  706. .user-detail {
  707. .detail-card {
  708. margin-bottom: 16px;
  709. &:last-child {
  710. margin-bottom: 0;
  711. }
  712. .card-title {
  713. font-size: 16px;
  714. font-weight: 500;
  715. }
  716. }
  717. .user-basic-info {
  718. display: flex;
  719. margin-bottom: 24px;
  720. .avatar-section {
  721. margin-right: 24px;
  722. text-align: center;
  723. .level-tag {
  724. margin-top: 8px;
  725. }
  726. }
  727. .primary-text {
  728. font-weight: 500;
  729. color: #303133;
  730. }
  731. }
  732. .account-info {
  733. .balance-card {
  734. display: flex;
  735. justify-content: space-around;
  736. padding: 24px;
  737. background: #f5f7fa;
  738. border-radius: 4px;
  739. .balance-item {
  740. text-align: center;
  741. .label {
  742. font-size: 14px;
  743. color: #909399;
  744. margin-bottom: 8px;
  745. }
  746. .value {
  747. font-size: 24px;
  748. font-weight: 500;
  749. color: #409eff;
  750. }
  751. }
  752. }
  753. }
  754. .coupon-info {
  755. .title {
  756. font-weight: 500;
  757. margin-bottom: 8px;
  758. }
  759. .type {
  760. margin-bottom: 4px;
  761. }
  762. .value {
  763. color: #f56c6c;
  764. font-size: 13px;
  765. }
  766. }
  767. .date-range {
  768. font-size: 13px;
  769. .separator {
  770. color: #909399;
  771. margin: 4px 0;
  772. }
  773. }
  774. }
  775. }
  776. .text-gray {
  777. color: #909399;
  778. }
  779. </style>