index.vue 56 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046
  1. <template>
  2. <div class="app-container">
  3. <el-row :gutter="20">
  4. <el-col :span="12">
  5. <el-card class="box-card custom-card">
  6. <div slot="header" class="clearfix">
  7. <span>选择客户</span>
  8. <el-button type="primary" style="float: right" plain icon="el-icon-plus" @click="handleAdd" v-if="userInfoVO.userType == '02'">新建客户 </el-button>
  9. </div>
  10. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px" @submit.native.prevent>
  11. <el-form-item label="手机号" prop="phoneNumber">
  12. <el-input v-model="queryParams.phoneNumber" placeholder="请输入手机号" clearable maxlength="11" @change="searchUser" @keyup.enter.native="searchUser" />
  13. </el-form-item>
  14. <el-form-item>
  15. <!-- <el-button type="primary" icon="el-icon-full-screen" @click="qrcodeSearchUser">扫码</el-button>-->
  16. <el-button type="primary" icon="el-icon-search" @click="searchUser">查询</el-button>
  17. </el-form-item>
  18. </el-form>
  19. <el-descriptions title="用户信息" v-if="appUserInfo" :column="2">
  20. <el-descriptions-item label="用户名" span="2">{{ appUserInfo.realName }}</el-descriptions-item>
  21. <el-descriptions-item label="手机号" span="2">{{ appUserInfo.phoneNumber }} </el-descriptions-item>
  22. <el-descriptions-item label="现金余额">
  23. {{ (appUserInfo.rechargeBalance * 100) / 100 }}
  24. </el-descriptions-item>
  25. <el-descriptions-item label="赠送余额">
  26. {{ (appUserInfo.giveBalance * 100) / 100 }}
  27. </el-descriptions-item>
  28. <el-descriptions-item label="福利金">
  29. {{ (appUserInfo.welfareBalance * 100) / 100 }}
  30. </el-descriptions-item>
  31. <el-descriptions-item label="积分">
  32. {{ appUserInfo.pointBalance }}
  33. </el-descriptions-item>
  34. <el-descriptions-item label="等级">{{ appUserInfo.level }}</el-descriptions-item>
  35. </el-descriptions>
  36. <Page uri="/mapi/recharge/card/list" :request-params="cardParams" ref="pagination" v-if="appUserInfo" :page-size="5">
  37. <el-table-column label="卡号" align="center" prop="cardNo" width="100" />
  38. <el-table-column label="储值门店" align="center" prop="rechargeStoreName" width="100">
  39. <template slot-scope="scope">
  40. {{ scope.row.useBindStoreName == null ? '--' : scope.row.useBindStoreName }}
  41. </template>
  42. </el-table-column>
  43. <el-table-column label="充值金额(元)" align="center" prop="rechargeAmount" width="120" />
  44. <el-table-column label="卡内余额(元)" align="center" prop="rechargeAmount" width="120">
  45. <template slot-scope="scope">
  46. <span style="display: block; text-align: left">现金金额: {{ scope.row.rechargeBalance }}</span>
  47. <span style="display: block; text-align: left">赠送金额: {{ scope.row.giveBalance }}</span>
  48. <span style="display: block; text-align: left">福利金额: {{ scope.row.welfareBalance }}</span>
  49. </template>
  50. </el-table-column>
  51. <el-table-column label="充值时间" align="center" prop="rechargeTime" width="100">
  52. <template slot-scope="scope">
  53. {{ scope.row.rechargeTime == null ? '--' : scope.row.rechargeTime }}
  54. </template>
  55. </el-table-column>
  56. <el-table-column label="状态" align="center" prop="rechargeStatus">
  57. <template slot-scope="scope">
  58. <dict-tag :options="dict.type.recharge_use_status" :value="scope.row.rechargeStatus" />
  59. </template>
  60. </el-table-column>
  61. </Page>
  62. </el-card>
  63. </el-col>
  64. <!-- 充值类型 -->
  65. <el-col :span="12">
  66. <el-card class="box-card">
  67. <div slot="header" class="clearfix">
  68. <span>充值信息</span>
  69. </div>
  70. <el-form ref="rechargeFrom" :model="rechargeFrom" :rules="rules" label-width="160px" @submit.native.prevent>
  71. <el-col :span="24">
  72. <el-form-item label="请选择充值类型" label-width="120px" prop="rechargeType">
  73. <el-col :span="18">
  74. <el-radio-group v-model="rechargeFrom.rechargeType" style="width: 500px" @input="clearData">
  75. <el-radio-button label="3">自定义充值</el-radio-button>
  76. <el-radio-button label="0">套餐充值</el-radio-button>
  77. <el-radio-button label="1">福利金额充值</el-radio-button>
  78. <!-- <el-radio-button label="2">卡密充值</el-radio-button>-->
  79. </el-radio-group>
  80. </el-col>
  81. </el-form-item>
  82. <el-form-item label="请选择充值套餐" label-width="120px" prop="rechargeMealId" v-if="rechargeFrom.rechargeType == 0">
  83. <el-col :span="18">
  84. <el-select v-model="rechargeFrom.rechargeMealId" placeholder="请选择充值套餐" style="width: 300px" clearable @input="getActivityInfo(rechargeFrom.rechargeMealId)">
  85. <el-option v-for="recharge in rechargeList" :key="recharge.id" :label="recharge.title" :value="recharge.id" />
  86. </el-select>
  87. </el-col>
  88. </el-form-item>
  89. <el-form-item label="自定义金额" label-width="120px" prop="customAmount" v-if="rechargeFrom.rechargeType == 3">
  90. <el-col :span="18">
  91. <el-input-number v-model="rechargeFrom.customAmount" :controls="false" :min="0" :max="10000" style="width: 300px"></el-input-number>
  92. </el-col>
  93. </el-form-item>
  94. <el-form-item label="福利金额(元)" label-width="120px" prop="welfareAmount" v-if="rechargeFrom.rechargeType == 1">
  95. <el-col :span="18">
  96. <el-input-number v-model="rechargeFrom.welfareAmount" :controls="false" :min="0" :max="999999" style="width: 300px"></el-input-number>
  97. </el-col>
  98. </el-form-item>
  99. <el-form-item label="卡号" label-width="120px" v-if="rechargeFrom.rechargeType == 2" required>
  100. <el-col :span="18">
  101. <el-input v-model="rechargeFrom.rechargeCardNo" style="width: 300px"></el-input>
  102. </el-col>
  103. </el-form-item>
  104. <el-form-item label="密码" label-width="120px" v-if="rechargeFrom.rechargeType == 2" required>
  105. <el-col :span="18">
  106. <el-input v-model="rechargeFrom.rechargeCardPassword" style="width: 300px"></el-input>
  107. </el-col>
  108. </el-form-item>
  109. <el-form-item label="充值备注" label-width="120px" prop="remark">
  110. <el-col :span="18">
  111. <el-input type="textarea" placeholder="请输入充值备注" v-model="rechargeFrom.remark" style="width: 300px"></el-input>
  112. </el-col>
  113. </el-form-item>
  114. </el-col>
  115. <el-col :span="24">
  116. <el-card style="width: 430px" v-if="rechargeFrom.rechargeType == 0">
  117. <el-descriptions title="充值活动信息" :column="1" :label-style="{ 'text-align': 'center' }" :contentStyle="{ 'text-align': 'center' }">
  118. <el-descriptions-item label="本次充值金额" style="width: 100px" v-if="activityAmount != null && activityAmount != ''">
  119. {{ getRechargeTypeInfo == '' ? '--' : getRechargeTypeInfo.rechargeAmount }}
  120. </el-descriptions-item>
  121. <el-descriptions-item label="原赠送金额" v-if="activityAmount != null && activityAmount != ''">
  122. {{ getRechargeTypeInfo == '' ? '--' : getRechargeTypeInfo.giveAmount }}
  123. </el-descriptions-item>
  124. <el-descriptions-item label="活动赠送金额" v-if="activityAmount != null && activityAmount != ''">
  125. {{ activityAmount }}
  126. </el-descriptions-item>
  127. <el-descriptions-item label="参与活动" v-if="activityAmount == null || activityAmount == ''"> 此套餐暂未参与活动 </el-descriptions-item>
  128. </el-descriptions>
  129. </el-card>
  130. </el-col>
  131. <!-- <el-col :span="24">-->
  132. <!-- <el-card class="box-card" shadow="hover" style="width: 150px" @click.native="clickRecharge">-->
  133. <!-- <div slot="header" class="clearfix">-->
  134. <!-- <span></span>-->
  135. <!-- <span style="float: right">赠送500元</span>-->
  136. <!-- </div>-->
  137. <!-- <div class="text item">-->
  138. <!-- <span>{{'充值金额 ' + "1" }}</span>-->
  139. <!-- <span>{{'充值金额 ' + "1" }}</span>-->
  140. <!-- </div>-->
  141. <!-- </el-card>-->
  142. <!-- </el-col>-->
  143. </el-form>
  144. <div>
  145. <el-button type="primary" @click="submitCash" style="margin-left: 3%; margin-top: 20px">收银 </el-button>
  146. </div>
  147. </el-card>
  148. </el-col>
  149. </el-row>
  150. <el-dialog title="确认充值" :visible.sync="openWelfareRecharge" width="400px">
  151. <el-form ref="payFrom" :model="rechargeInfo" label-width="100px" style="margin-top: 20px" @submit.native.prevent>
  152. <el-form-item label="充值金额:">
  153. <span style="font-size: 16px; font-weight: bold">¥{{ rechargeInfo.welfareAmount }}</span>
  154. </el-form-item>
  155. <el-form-item label="备注:">
  156. <span style="font-size: 16px; font-weight: bold">{{ rechargeInfo.remark }}</span>
  157. </el-form-item>
  158. </el-form>
  159. <el-button type="primary" @click="submitSettlement" style="margin: 20px 80px 0; width: 200px; height: 40px">确认</el-button>
  160. </el-dialog>
  161. <!-- 支付方式 -->
  162. <el-dialog :title="rechargeTitle" :visible.sync="openRecharge" width="75%" :before-close="checkClosePay">
  163. <el-descriptions title="核对信息" v-if="rechargeInfo && appUserInfo" :column="4" border :contentStyle="{ 'text-align': 'center' }">
  164. <el-descriptions-item label="本次充值金额" :labelStyle="{ width: '14%' }">{{ rechargeInfo.rechargeAmount }} </el-descriptions-item>
  165. <el-descriptions-item label="本次赠送金额" :labelStyle="{ width: '14%' }">
  166. {{ activityAmount != null && activityAmount != '' ? activityAmount : rechargeInfo.giveAmount }}
  167. </el-descriptions-item>
  168. <el-descriptions-item label="本次赠送积分" :labelStyle="{ width: '14%' }">
  169. {{ rechargeInfo.givePointAmount }}
  170. </el-descriptions-item>
  171. <el-descriptions-item label="本次福利金额" :labelStyle="{ width: '14%' }">{{ rechargeInfo.welfareAmount }} </el-descriptions-item>
  172. <el-descriptions-item label="充值余额">{{ appUserInfo.rechargeBalance }}</el-descriptions-item>
  173. <el-descriptions-item label="赠送余额">{{ appUserInfo.giveBalance }}</el-descriptions-item>
  174. <el-descriptions-item label="现有积分">{{ appUserInfo.pointBalance }}</el-descriptions-item>
  175. <el-descriptions-item label="福利余额">{{ appUserInfo.welfareBalance }}</el-descriptions-item>
  176. <el-descriptions-item label="充值后余额">
  177. {{ (rechargeInfo.rechargeAmount * 100 + appUserInfo.rechargeBalance * 100) / 100 }}
  178. </el-descriptions-item>
  179. <el-descriptions-item label="充值后赠送余额">
  180. {{ activityAmount != null && activityAmount != '' ? (activityAmount * 100 + appUserInfo.giveBalance * 100) / 100 : (rechargeInfo.giveAmount * 100 + appUserInfo.giveBalance * 100) / 100 }}
  181. </el-descriptions-item>
  182. <el-descriptions-item label="充值后积分">
  183. {{ (rechargeInfo.givePointAmount * 100 + appUserInfo.pointBalance * 100) / 100 }}
  184. </el-descriptions-item>
  185. <el-descriptions-item label="充值后福利余额">
  186. {{ (rechargeInfo.welfareAmount * 100 + appUserInfo.welfareBalance * 100) / 100 }}
  187. </el-descriptions-item>
  188. </el-descriptions>
  189. <template v-if="rechargeInfo">
  190. <el-form ref="payFrom" :model="payFrom" label-width="80px" style="margin-top: 20px" @submit.native.prevent>
  191. <el-card>
  192. <!-- <el-row :gutter="10" style="margin-top: 10px">-->
  193. <!-- <el-col :span="24">-->
  194. <!-- <el-checkbox v-model="payFrom.isUsedCoupon">是否使用优惠券</el-checkbox>-->
  195. <!-- <el-button style="margin-left: 10px" v-if="payFrom.isUsedCoupon" type="primary" @click="openCouponList">选择优惠券列表</el-button>-->
  196. <!-- </el-col>-->
  197. <!-- </el-row>-->
  198. <el-row :gutter="10" style="margin-top: 10px">
  199. <el-col :span="12" style="margin-top: 10px">
  200. <el-form-item label="支付方式" label-width="150px" prop="payType">
  201. <el-radio-group v-model="payFrom.payType" @input="changePayType">
  202. <el-radio-button label="2">现金</el-radio-button>
  203. <el-radio-button label="0">微信/支付宝</el-radio-button>
  204. <!-- <el-radio-button label="1">支付宝</el-radio-button>-->
  205. <el-radio-button label="9">组合支付</el-radio-button>
  206. </el-radio-group>
  207. </el-form-item>
  208. </el-col>
  209. <!-- <el-col :span="12">-->
  210. <!-- <el-form-item label="是否分段支付" label-width="150px" prop="isInstalment">-->
  211. <!-- <el-radio-group v-model="payFrom.isInstalment" :disabled="alreadyPayTotal > 0">-->
  212. <!-- <el-radio-button label="Y">是</el-radio-button>-->
  213. <!-- <el-radio-button label="N">否</el-radio-button>-->
  214. <!-- </el-radio-group>-->
  215. <!-- </el-form-item>-->
  216. <!-- </el-col>-->
  217. </el-row>
  218. <el-row style="margin-top: 10px; margin-left: 20px">
  219. <div class="clearfix">
  220. <!-- <span>已优惠<span style="color: #ff4949; font-size: 18px; font-weight: bold; margin: 0 4px">{{ getCouponAmount }}</span>元</span>-->
  221. <span style="margin-left: 20px"
  222. >需支付<span style="color: #ff4949; font-size: 18px; font-weight: bold; margin: 0 4px">{{ (getOrderNeedAmount * 100 - parseFloat(alreadyPayTotal * 100)) / 100 }}</span
  223. >元</span
  224. >
  225. </div>
  226. </el-row>
  227. <el-row :gutter="10" style="margin-top: 10px">
  228. <!-- <el-col :span="8">-->
  229. <!-- <el-form-item label="已经支付:" label-width="90px" v-if="payFrom.isInstalment == 'Y'">-->
  230. <!-- <span>{{ alreadyPayTotal }} 元</span>-->
  231. <!-- </el-form-item>-->
  232. <!-- </el-col>-->
  233. <el-col :span="8">
  234. <el-form-item label="本次收取金额(元)" label-width="150px" prop="thisPayMoney" v-if="payFrom.isInstalment == 'Y'">
  235. <el-input style="width: 250px" v-model="payFrom.thisPayMoney"></el-input>
  236. </el-form-item>
  237. </el-col>
  238. <el-col :span="8">
  239. <el-button type="primary" @click="submitConfirm" v-if="(payFrom.payType == '0' || payFrom.payType == '1') && payFrom.isInstalment == 'Y' && payConfirm == false"> 确认 </el-button>
  240. </el-col>
  241. </el-row>
  242. <el-row :gutter="10" style="margin-top: 10px">
  243. <el-col :span="8">
  244. <el-form-item label="付款条形码" label-width="150px" prop="wxBarcode" v-if="payFrom.payType == '0'">
  245. <el-input style="width: 250px" v-model="payFrom.wxBarcode" clearable placeholder="请输入付款码"></el-input>
  246. </el-form-item>
  247. </el-col>
  248. <!-- <el-col :span="8">-->
  249. <!-- <el-form-item label="实收现金(元)" label-width="150px" prop="thisPayMoney" v-if="payFrom.payType == '2'">-->
  250. <!-- <el-input-number style="width: 250px" :controls="false" v-model="payFrom.thisPayMoney"></el-input-number>-->
  251. <!-- </el-form-item>-->
  252. <!-- </el-col>-->
  253. <el-col :span="8">
  254. <el-form-item label="实收现金(元)" label-width="150px" prop="cashPayAmount" v-if="payFrom.payType == '9'">
  255. <el-input style="width: 250px" :controls="false" v-model="payFrom.cashPayAmount" @input="changeCashPayAmount"></el-input>
  256. </el-form-item>
  257. <el-form-item label="微信/支付宝(元)" label-width="150px" prop="otherPayAmount" v-if="payFrom.payType == '9'">
  258. <!-- <el-input-number style="width: 250px" :controls="false" disabled v-model="payFrom.otherPayAmount"></el-input-number>-->
  259. <span style="font-size: 16px; font-weight: bold">¥{{ payFrom.otherPayAmount || 0 }}</span>
  260. </el-form-item>
  261. </el-col>
  262. <el-col :span="8">
  263. <el-form-item label="" label-width="150px" prop="wxBarcode" v-if="payFrom.payType == '9'">
  264. <el-input-number style="width: 250px; opacity: 0" :controls="false" disabled v-model="payFrom.otherPayAmount"></el-input-number>
  265. </el-form-item>
  266. <el-form-item label="付款条形码" label-width="150px" prop="wxBarcode" v-if="payFrom.payType == '9'">
  267. <el-input style="width: 250px" v-model="payFrom.wxBarcode" clearable placeholder="请输入付款码"></el-input>
  268. </el-form-item>
  269. </el-col>
  270. <el-col :span="8"> </el-col>
  271. </el-row>
  272. <!-- <el-row :gutter="10" style="margin-top: 10px">-->
  273. <!-- <el-card>-->
  274. <!-- <el-table :data="alreadySelectCouponList">-->
  275. <!-- &lt;!&ndash; <el-table-column label="编号" align="center" prop="id" />&ndash;&gt;-->
  276. <!-- <el-table-column label="优惠券" align="center" prop="couponTypeTitle" />-->
  277. <!-- <el-table-column label="优惠内容" align="center" prop="clothItemTypeName">-->
  278. <!-- <template slot-scope="scope">-->
  279. <!-- <span>抵扣充值金额:{{ scope.row.deductRechargeAmount }}元</span>-->
  280. <!-- </template>-->
  281. <!-- </el-table-column>-->
  282. <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
  283. <!-- <template slot-scope="scope">-->
  284. <!-- <el-button type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>-->
  285. <!-- </template>-->
  286. <!-- </el-table-column>-->
  287. <!-- </el-table>-->
  288. <!-- </el-card>-->
  289. <!-- </el-row>-->
  290. </el-card>
  291. <el-row :gutter="10">
  292. <div>
  293. <el-button type="primary" @click="submitSettlement" style="margin-left: 5px; margin-top: 20px">结算 </el-button>
  294. </div>
  295. </el-row>
  296. </el-form>
  297. </template>
  298. </el-dialog>
  299. <el-dialog title="选择优惠券" :visible.sync="openCoupon" width="60%">
  300. <template>
  301. <el-table :data="couponList" style="width: 100%" @selection-change="handleSelectionChange">
  302. <el-table-column type="selection" width="55" align="center" fixed="left" />
  303. <el-table-column label="优惠券" align="center" prop="couponTypeTitle" />
  304. <el-table-column label="优惠内容" align="center">
  305. <template slot-scope="scope">
  306. <span>抵扣充值金额:{{ scope.row.deductRechargeAmount }}元</span>
  307. </template>
  308. </el-table-column>
  309. </el-table>
  310. <el-row>
  311. <div style="margin-top: 30px">
  312. <el-button @click="submitAlreadySelectCouponList" size="small" type="primary" style="float: right"> 确定 </el-button>
  313. </div>
  314. </el-row>
  315. </template>
  316. </el-dialog>
  317. <!-- 添加用户对话框 -->
  318. <el-dialog :title="title" :visible.sync="open" size="30%" append-to-body :before-close="checkCloseUserPage">
  319. <el-row :gutter="15">
  320. <el-form ref="form" :model="form" :rules="rules" label-width="100px">
  321. <el-col :span="24">
  322. <el-form-item label="昵称" prop="nickName">
  323. <el-input v-model="form.nickName" placeholder="请输入昵称" maxlength="50" show-word-limit clearable />
  324. </el-form-item>
  325. <el-form-item label="真实姓名" prop="realName">
  326. <el-input v-model="form.realName" placeholder="请输入真实姓名" maxlength="5" show-word-limit clearable />
  327. </el-form-item>
  328. <el-form-item label="手机号" prop="phoneNumber">
  329. <el-input v-model="form.phoneNumber" placeholder="请输入手机号" maxlength="11" show-word-limit clearable />
  330. </el-form-item>
  331. <el-form-item label="性别" prop="sex">
  332. <el-select v-model="form.sex" placeholder="请选择性别" clearable>
  333. <el-option v-for="dict in dict.type.sys_user_sex" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
  334. </el-select>
  335. </el-form-item>
  336. <el-form-item label="生日" prop="birthday" clearable>
  337. <el-date-picker clearable v-model="form.birthday" type="date" value-format="yyyy-MM-dd" placeholder="请选择生日"></el-date-picker>
  338. </el-form-item>
  339. <el-form-item label="头像地址" prop="avatarUrl">
  340. <image-upload v-model="form.avatarUrl" :limit="1" />
  341. </el-form-item>
  342. <el-form-item label="客户等级" prop="level">
  343. <el-input-number v-model="form.level" :min="1" :max="50" label="请输入客户等级"></el-input-number>
  344. </el-form-item>
  345. <el-form-item label="备注" prop="remark">
  346. <el-input v-model="form.remark" placeholder="请输入备注" maxlength="50" show-word-limit />
  347. </el-form-item>
  348. </el-col>
  349. </el-form>
  350. </el-row>
  351. <div slot="footer" class="dialog-footer">
  352. <el-button type="primary" @click="submitForm" style="margin-left: 5%">提交</el-button>
  353. <el-button @click="cancel">取 消</el-button>
  354. </div>
  355. </el-dialog>
  356. <pay-status-popup ref="payStatusPopup" hidePointer hideUser @paySuccess="checkIsAllPay"></pay-status-popup>
  357. </div>
  358. </template>
  359. <script>
  360. import { listType } from '@/api/recharge/type'
  361. import { addUser, findUserByPhoneNumber, getMemberCouponInfoByRecharge, updateUser } from '@/api/app/user'
  362. import { addOrder, getOrderIsAllPayByOrderNo, getOrderStatusByOrderNo, morePay } from '@/api/recharge/order'
  363. import { getRechargeTypeRelationActivityInfo } from '@/api/activity/rechargeItem'
  364. import payStatusPopup from '@/components/payStatusPopup'
  365. export default {
  366. name: 'workRecharge',
  367. dicts: ['recharge_use_status', 'sys_user_sex'],
  368. components: { payStatusPopup },
  369. data() {
  370. return {
  371. alreadyPayTotal: 0,
  372. orderNeedPayAmount: 0,
  373. couponAmount: 0,
  374. alreadyPayInfo: {},
  375. payConfirm: false,
  376. payFrom: {},
  377. userInfoVO: null,
  378. orderNo: null,
  379. // 优惠卷
  380. // couponInfo:null,
  381. couponList: [],
  382. // 客户信息
  383. appUserInfo: null,
  384. rechargeList: null,
  385. rechargeInfo: {},
  386. // 充值类型参数
  387. rechargeFrom: {
  388. rechargeType: '3',
  389. // 充值套餐id
  390. rechargeMealId: null,
  391. // 自定义金额
  392. customAmount: null,
  393. remark: '',
  394. // 福利金额
  395. welfareAmount: null,
  396. // 卡号
  397. rechargeCardNo: null,
  398. // 密码
  399. rechargeCardPassword: null
  400. },
  401. // 遮罩层
  402. loading: true,
  403. // 选中数组
  404. ids: [],
  405. // 非单个禁用
  406. single: true,
  407. // 非多个禁用
  408. multiple: true,
  409. // 显示搜索条件
  410. showSearch: true,
  411. // 总条数
  412. total: 0,
  413. // 表格数据
  414. // 弹出层标题
  415. title: '',
  416. rechargeTitle: '',
  417. // 是否显示弹出层
  418. open: false,
  419. openRecharge: false,
  420. openWelfareRecharge: false,
  421. openCoupon: false,
  422. // 查询参数
  423. queryParams: {
  424. pageNum: 1,
  425. pageSize: 10
  426. },
  427. cardParams: {
  428. rechargeUserId: 0
  429. },
  430. couponParams: {
  431. pageNum: 1,
  432. pageSize: 999,
  433. appUserId: null
  434. },
  435. // 表单参数
  436. form: {},
  437. // 表单校验
  438. rules: {
  439. rechargeCardNo: [
  440. {
  441. pattern: /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/,
  442. required: true,
  443. message: '请输入正整数类型',
  444. trigger: 'blur'
  445. }
  446. ],
  447. rechargeCardPassword: [
  448. {
  449. pattern: /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/,
  450. required: true,
  451. message: '请输入正整数类型',
  452. trigger: 'blur'
  453. }
  454. ],
  455. nickName: [
  456. {
  457. required: true,
  458. message: '昵称不能为空',
  459. trigger: 'blur'
  460. }
  461. ],
  462. realName: [
  463. {
  464. required: true,
  465. message: '真实姓名不能为空',
  466. trigger: 'blur'
  467. }
  468. ],
  469. phoneNumber: [
  470. {
  471. required: true,
  472. message: '手机号不能为空',
  473. trigger: 'blur'
  474. },
  475. {
  476. pattern: /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/,
  477. required: true,
  478. message: '请输入数量,且为正整数类型',
  479. trigger: 'blur'
  480. },
  481. { min: 11, max: 11, message: '手机号至少11位', trigger: 'blur' }
  482. ],
  483. sex: [
  484. {
  485. required: true,
  486. message: '性别不能为空',
  487. trigger: 'blur'
  488. }
  489. ],
  490. birthday: [
  491. {
  492. required: true,
  493. message: '生日不能为空',
  494. trigger: 'blur'
  495. }
  496. ]
  497. },
  498. authCode: null,
  499. activityAmount: null,
  500. alreadySelectCouponList: [],
  501. //支付检测
  502. isPaying: false
  503. }
  504. },
  505. created() {
  506. this.handleUser()
  507. this.getRechargeList()
  508. },
  509. computed: {
  510. getRechargeTypeInfo() {
  511. if (this.rechargeFrom.rechargeMealId != null) {
  512. return this.rechargeList.find((item) => item.id == this.rechargeFrom.rechargeMealId)
  513. } else {
  514. return ''
  515. }
  516. },
  517. getCouponAmount() {
  518. this.couponAmount = 0
  519. if (this.alreadySelectCouponList.length == 0) {
  520. return this.couponAmount
  521. }
  522. if (this.alreadySelectCouponList.length > 0) {
  523. this.alreadySelectCouponList.forEach((coupon) => {
  524. this.couponAmount = this.couponAmount + parseFloat(coupon.deductRechargeAmount)
  525. })
  526. }
  527. return this.couponAmount
  528. },
  529. getOrderNeedAmount() {
  530. this.orderNeedPayAmount = parseFloat(this.rechargeInfo.rechargeAmount) - parseFloat(this.couponAmount) > 0 ? parseFloat(this.rechargeInfo.rechargeAmount) - parseFloat(this.couponAmount) : 0
  531. return this.orderNeedPayAmount
  532. }
  533. },
  534. methods: {
  535. changeCashPayAmount(value) {
  536. this.payFrom.cashPayAmount = value.replace(/[^\d]/g, '')
  537. this.payFrom.otherPayAmount = Math.round((Number(this.orderNeedPayAmount) - Number(this.payFrom.cashPayAmount)) * 100) / 100
  538. },
  539. clickRecharge(done) {
  540. this.$confirm('是否关闭表单,关闭后数据将丢失?')
  541. .then(function () {
  542. done()
  543. })
  544. .then(() => {})
  545. .catch(() => {})
  546. },
  547. getActivityInfo(rechargeTypeId) {
  548. if (rechargeTypeId != null && rechargeTypeId != '') {
  549. getRechargeTypeRelationActivityInfo(rechargeTypeId, this.userInfoVO.storeId).then((response) => {
  550. this.activityAmount = response.data
  551. })
  552. } else {
  553. this.activityAmount = null
  554. }
  555. },
  556. clearData() {
  557. this.rechargeFrom.rechargeMealId = null
  558. this.rechargeFrom.customAmount = null
  559. this.rechargeFrom.welfareAmount = null
  560. this.rechargeFrom.rechargeCardNo = null
  561. this.rechargeFrom.rechargeCardPassword = null
  562. this.activityAmount = null
  563. },
  564. openCouponList() {
  565. this.getCouponList()
  566. this.openCoupon = true
  567. },
  568. // 获取优惠券集合
  569. getCouponList() {
  570. if (this.appUserInfo == null) {
  571. this.couponList = []
  572. return
  573. }
  574. this.couponParams.appUserId = this.appUserInfo.id
  575. getMemberCouponInfoByRecharge(this.couponParams).then((response) => {
  576. this.couponList = response.data.records
  577. })
  578. },
  579. // 获取登录人信息
  580. handleUser() {
  581. this.userInfoVO = this.getUserInfo()
  582. },
  583. //搜索用户
  584. searchUser() {
  585. this.$refs['queryForm'].validate((valid) => {
  586. if (valid) {
  587. findUserByPhoneNumber(this.queryParams).then((res) => {
  588. this.appUserInfo = res.data
  589. if (this.appUserInfo) {
  590. this.cardParams.rechargeUserId = this.appUserInfo.id
  591. this.$nextTick(() => {
  592. this.$refs.pagination.handleSearch(true)
  593. })
  594. }
  595. })
  596. }
  597. })
  598. },
  599. //条码搜索用户
  600. qrcodeSearchUser() {},
  601. // 获取 充值套餐集合
  602. getRechargeList() {
  603. listType().then((response) => {
  604. this.rechargeList = response.rows
  605. })
  606. },
  607. // 关闭用户新建页面 二次确认
  608. checkCloseUserPage(done) {
  609. this.$confirm('是否关闭表单,关闭后数据将丢失?')
  610. .then(function () {
  611. done()
  612. })
  613. .then(() => {})
  614. .catch(() => {})
  615. },
  616. // 关闭支付页面 二次确认
  617. checkClosePay(done) {
  618. this.$confirm('退单金额如下:现金:' + this.alreadyPayInfo.alreadyPayCash + ',微信:' + this.alreadyPayInfo.alreadyPayWX + ',支付宝:' + this.alreadyPayInfo.alreadyPayAli + ' 是否暂停支付?')
  619. .then(function () {
  620. done()
  621. })
  622. .then(() => {})
  623. .catch(() => {})
  624. },
  625. // 创建用户
  626. submitForm() {
  627. this.$refs['form'].validate((valid) => {
  628. if (valid) {
  629. if (this.form.id != null) {
  630. updateUser(this.form).then((response) => {
  631. this.$modal.msgSuccess('修改成功')
  632. this.open = false
  633. })
  634. } else {
  635. addUser(this.form).then((response) => {
  636. this.$modal.msgSuccess('新增成功')
  637. this.open = false
  638. })
  639. }
  640. }
  641. })
  642. },
  643. // 收银
  644. submitCash() {
  645. if (this.appUserInfo == null) {
  646. this.$message.error('请选择客户')
  647. return
  648. }
  649. // 重置
  650. this.resetPayInfo()
  651. this.rechargeInfo.remark = this.rechargeFrom.remark
  652. // 自定义充值
  653. if (this.rechargeFrom.rechargeType == '3') {
  654. if (this.rechargeFrom.customAmount == '0') {
  655. this.$message.error('充值金额不能为0元')
  656. return
  657. }
  658. this.rechargeInfo.rechargeAmount = this.rechargeFrom.customAmount
  659. this.rechargeInfo.giveAmount = 0
  660. this.rechargeInfo.givePointAmount = 0
  661. this.rechargeInfo.welfareAmount = 0
  662. this.rechargeInfo.rechargeType = this.rechargeFrom.rechargeType
  663. this.rechargeInfo.rechargeTypeId = null
  664. }
  665. // 套餐充值
  666. if (!this.rechargeFrom.rechargeType || this.rechargeFrom.rechargeType == '0') {
  667. if (this.rechargeFrom.rechargeMealId == null) {
  668. this.$message.error('充值套餐不能为空')
  669. return
  670. }
  671. let recharge
  672. recharge = this.rechargeList.find((item) => item.id == this.rechargeFrom.rechargeMealId)
  673. this.rechargeInfo.rechargeAmount = recharge.rechargeAmount
  674. this.rechargeInfo.giveAmount = recharge.giveAmount
  675. this.rechargeInfo.givePointAmount = recharge.givePointAmount
  676. this.rechargeInfo.welfareAmount = 0
  677. this.rechargeInfo.rechargeType = this.rechargeFrom.rechargeType
  678. this.rechargeInfo.rechargeTypeId = recharge.id
  679. }
  680. // 福利金额充值
  681. if (this.rechargeFrom.rechargeType == '1') {
  682. if (!this.rechargeFrom.rechargeType || this.rechargeFrom.welfareAmount == '0') {
  683. this.$message.error('充值金额不能为0元')
  684. return
  685. }
  686. if (!this.rechargeFrom.remark) {
  687. this.$message.error('请输入备注')
  688. return
  689. }
  690. this.rechargeInfo.rechargeAmount = 0
  691. this.rechargeInfo.giveAmount = 0
  692. this.rechargeInfo.givePointAmount = 0
  693. this.rechargeInfo.welfareAmount = this.rechargeFrom.welfareAmount
  694. this.rechargeInfo.rechargeType = this.rechargeFrom.rechargeType
  695. this.rechargeInfo.rechargeTypeId = null
  696. this.rechargeInfo.remark = this.rechargeFrom.remark
  697. this.openWelfareRecharge = true
  698. this.orderNo = null
  699. return
  700. }
  701. // 卡密充值
  702. if (this.rechargeFrom.rechargeType == '2') {
  703. if (this.rechargeFrom.rechargeCardNo == null || this.rechargeFrom.rechargeCardPassword == null) {
  704. this.$message.error('卡号/密码,不能为空')
  705. return
  706. }
  707. const orderRechargePayDTO = {
  708. appUserId: this.appUserInfo.id,
  709. rechargeType: this.rechargeFrom.rechargeType,
  710. cardNo: this.rechargeFrom.rechargeCardNo,
  711. password: this.rechargeFrom.rechargeCardPassword,
  712. remark: this.rechargeFrom.remark
  713. }
  714. addOrder(orderRechargePayDTO).then((response) => {
  715. if (response.data.isAllPayEnd == true) {
  716. this.$modal.msgSuccess('充值成功')
  717. this.searchUser()
  718. this.clearData()
  719. }
  720. })
  721. return
  722. }
  723. this.rechargeTitle = '支付方式选择'
  724. this.openRecharge = true
  725. this.orderNo = null
  726. },
  727. // 结算
  728. submitSettlement() {
  729. // if (this.payFrom.payType == '2' && this.payFrom.isInstalment == 'N' && this.payFrom.thisPayMoney < this.orderNeedPayAmount) {
  730. // this.$message.error('支付金额小于需支付金额')
  731. // return
  732. // }
  733. // if (this.payFrom.payType == '2' && this.payFrom.isInstalment == 'N' && this.payFrom.thisPayMoney > this.orderNeedPayAmount) {
  734. // this.$message.error('支付金额大于需支付金额')
  735. // return
  736. // }
  737. const orderRechargePayDTO = {
  738. orderNo: this.orderNo,
  739. appUserId: this.appUserInfo.id,
  740. payType: this.payFrom.payType,
  741. isInstalment: this.payFrom.isInstalment,
  742. couponIds: [],
  743. remark: this.rechargeInfo.remark,
  744. rechargeAmount: this.rechargeInfo.rechargeAmount,
  745. giveAmount: this.rechargeInfo.giveAmount,
  746. givePointAmount: this.rechargeInfo.givePointAmount,
  747. rechargeTypeId: this.rechargeInfo.rechargeTypeId,
  748. welfareAmount: this.rechargeInfo.welfareAmount,
  749. rechargeType: this.rechargeInfo.rechargeType,
  750. payAmount: this.orderNeedPayAmount
  751. }
  752. if (this.alreadySelectCouponList.length > 0) {
  753. this.alreadySelectCouponList.forEach((vo) => {
  754. orderRechargePayDTO.couponIds.push(vo.id)
  755. })
  756. } else {
  757. orderRechargePayDTO.couponIds = []
  758. }
  759. if (this.payFrom.isInstalment == 'N') {
  760. orderRechargePayDTO.thisPayAmount = this.orderNeedPayAmount
  761. }
  762. if (this.payFrom.isInstalment == 'Y') {
  763. orderRechargePayDTO.thisPayAmount = this.payFrom.thisPayMoney
  764. }
  765. // 现金支付
  766. if (this.payFrom.payType == 2) {
  767. orderRechargePayDTO.thisPayAmount = this.orderNeedPayAmount
  768. }
  769. // 微信支付
  770. if (this.payFrom.payType == 0) {
  771. orderRechargePayDTO.authCode = this.payFrom.wxBarcode
  772. }
  773. // 支付宝支付
  774. if (this.payFrom.payType == 1) {
  775. orderRechargePayDTO.authCode = this.payFrom.aliPayBarcode
  776. }
  777. if (this.payFrom.payType == 9) {
  778. if (!this.payFrom.cashPayAmount) {
  779. this.$message.error('请输入现金支付金额')
  780. return
  781. }
  782. if (Number(this.payFrom.cashPayAmount) >= Number(this.orderNeedPayAmount)) {
  783. this.$message.error('现金支付金额必须小于还需支付金额')
  784. return
  785. }
  786. orderRechargePayDTO.cashPayAmount = this.payFrom.cashPayAmount || 0
  787. orderRechargePayDTO.otherPayAmount = this.payFrom.otherPayAmount || 0
  788. orderRechargePayDTO.authCode = this.payFrom.wxBarcode
  789. }
  790. this.$confirm('确定进行支付结算吗?')
  791. .then(() => {
  792. const loading = this.$loading({
  793. lock: true,
  794. text: 'Loading',
  795. spinner: 'el-icon-loading',
  796. background: 'rgba(0, 0, 0, 0.7)'
  797. })
  798. // if (this.orderNo == null) {
  799. // // 首次支付
  800. addOrder(orderRechargePayDTO).then(
  801. (response) => {
  802. loading.close()
  803. this.orderNo = response.data.orderNo
  804. if (response.data.payResult == 100) {
  805. this.$refs.payStatusPopup.open(5, response.data)
  806. var intervalId = setInterval(() => {
  807. this.intervalCheckOrderStatus(intervalId, this.orderNo)
  808. }, 4000)
  809. }
  810. if (response.data.payResult == 200) {
  811. // this.$refs.payStatusPopup.open(5, response.data)
  812. // var intervalId = setInterval(() => {
  813. // this.intervalCheckOrderStatus(intervalId, this.orderNo)
  814. // }, 4000)
  815. this.$refs.payStatusPopup.open(1, response.data)
  816. this.checkIsAllPay(this.orderNo)
  817. }
  818. if (response.data.payResult == 101 || response.data.payResult == 0) {
  819. this.$refs.payStatusPopup.open(4, response.data)
  820. }
  821. // // 第三方支付
  822. // if (this.payFrom.payType == '0' || this.payFrom.payType == '1' || (this.payFrom.payType == '9' && this.payFrom.otherPayAmount)) {
  823. // this.isPaying = true
  824. // var intervalId = setInterval(() => {
  825. // this.intervalCheckOrderStatus(intervalId, this.orderNo)
  826. // }, 4000)
  827. // } else {
  828. // this.checkIsAllPay(this.orderNo)
  829. // }
  830. // if (orderRechargePayDTO.isInstalment == 'Y') {
  831. // this.$confirm('本次支付完成,是否继续支付')
  832. // .then(() => {
  833. // this.alreadyPayTotal = this.alreadyPayTotal + parseFloat(this.payFrom.thisPayMoney)
  834. // this.saveAlreadyPayAmount()
  835. // })
  836. // .catch(() => {
  837. // this.openRecharge = false
  838. // this.orderNo = null
  839. // this.$modal.msgWarning('确定关闭本次充值吗?关闭后如需完成支付请前往订单管理继续支付')
  840. // })
  841. // }
  842. },
  843. (err) => {
  844. loading.close()
  845. }
  846. )
  847. // } else {
  848. // // 多次支付
  849. // morePay(orderRechargePayDTO).then((response) => {
  850. // loading.close()
  851. // if (response.data.payResult != 200) {
  852. // this.$message.error(response.data.payMsg)
  853. // return
  854. // }
  855. // if (this.payFrom.payType == '0' || this.payFrom.payType == '1') {
  856. // //第三方支付
  857. // console.log('第三方支付')
  858. // this.isPaying = true
  859. // var intervalId = setInterval(() => {
  860. // this.intervalCheckOrderStatus(intervalId, response.data.orderNo)
  861. // }, 4000)
  862. // } else {
  863. // this.checkIsAllPay(this.orderNo)
  864. // }
  865. // if (orderRechargePayDTO.isInstalment == 'Y') {
  866. // this.$confirm('本次支付完成,是否继续支付')
  867. // .then(() => {
  868. // this.alreadyPayTotal = this.alreadyPayTotal + parseFloat(this.payFrom.thisPayMoney)
  869. // this.saveAlreadyPayAmount()
  870. // })
  871. // .catch(() => {
  872. // this.openRecharge = false
  873. // this.orderNo = null
  874. // this.$modal.msgWarning('确定关闭本次充值吗?关闭后如需完成支付请前往订单管理继续支付')
  875. // })
  876. // }
  877. // })
  878. // }
  879. })
  880. .catch(() => {})
  881. },
  882. intervalCheckOrderStatus(intervalId, orderNo) {
  883. getOrderStatusByOrderNo({ orderNo: orderNo })
  884. .then((response) => {
  885. if (response.data.payResult == '100') {
  886. return
  887. }
  888. // this.isPaying = false
  889. if (response.data.payResult == 101 || response.data.payResult == 0) {
  890. //已取消
  891. // this.$notify.error({
  892. // title: '支付失败',
  893. // message: '支付超时或客户已取消支付'
  894. // })
  895. this.$refs.payStatusPopup.open(4, response.data)
  896. clearInterval(intervalId)
  897. return
  898. }
  899. // if (response.data.payResult == 200) {
  900. this.$refs.payStatusPopup.open(1, response.data)
  901. this.checkIsAllPay(this.orderNo)
  902. // clearInterval(intervalId)
  903. // return
  904. // }
  905. // if (response.data.payResult == 101 || res.data.payResult == 0) {
  906. // this.$refs.payStatusPopup.open(4, response.data)
  907. // }
  908. // this.$notify({
  909. // title: '支付成功',
  910. // message: '客户已成功支付订单',
  911. // type: 'success'
  912. // })
  913. // this.openRecharge = false
  914. // this.searchUser()
  915. clearInterval(intervalId)
  916. })
  917. .catch((e) => {
  918. this.$refs.payStatusPopup.open(4, e.data)
  919. })
  920. },
  921. checkIsAllPay(orderNo) {
  922. // getOrderIsAllPayByOrderNo({ orderNo: orderNo }).then((response) => {
  923. // if (response.data == true) {
  924. // this.$modal.msgSuccess('支付成功')
  925. this.openRecharge = false
  926. this.openWelfareRecharge = false
  927. this.searchUser()
  928. // }
  929. // })
  930. },
  931. // 保存临时的 支付金额 用于取消支付提示信息
  932. saveAlreadyPayAmount() {
  933. // 微信
  934. if (this.payFrom.payType == '0') {
  935. this.alreadyPayInfo.alreadyPayWX = this.alreadyPayInfo.alreadyPayWX + parseFloat(this.payFrom.thisPayMoney)
  936. }
  937. // 支付宝
  938. if (this.payFrom.payType == '1') {
  939. this.alreadyPayInfo.alreadyPayAli = this.alreadyPayInfo.alreadyPayAli + parseFloat(this.payFrom.thisPayMoney)
  940. }
  941. // 现金
  942. if (this.payFrom.payType == '2') {
  943. this.alreadyPayInfo.alreadyPayCash = this.alreadyPayInfo.alreadyPayCash + parseFloat(this.payFrom.thisPayMoney)
  944. }
  945. },
  946. // 支付页面 确认按钮
  947. submitConfirm() {
  948. this.payConfirm = true
  949. },
  950. // 切换支付方式
  951. changePayType() {
  952. this.payConfirm = false
  953. this.payFrom.thisPayMoney = null
  954. this.payFrom.aliPayBarcode = null
  955. this.payFrom.wxBarcode = null
  956. },
  957. // 取消按钮
  958. cancel() {
  959. this.open = false
  960. this.reset()
  961. },
  962. // 表单重置
  963. reset() {
  964. this.form = {
  965. id: null,
  966. phoneNumber: null,
  967. nickName: null,
  968. realName: null,
  969. sex: null,
  970. birthday: null,
  971. avatarUrl: null,
  972. unionId: null,
  973. createTime: null,
  974. payPassword: null,
  975. isUsePayPassword: null,
  976. status: '0',
  977. level: null
  978. }
  979. this.resetForm('form')
  980. },
  981. resetPayInfo() {
  982. this.alreadyPayTotal = 0
  983. this.couponAmount = 0
  984. this.payConfirm = false
  985. this.rechargeInfo = {}
  986. this.alreadySelectCouponList = []
  987. this.payFrom = {
  988. payType: '2',
  989. isInstalment: 'N',
  990. wxBarcode: null,
  991. aliPayBarcode: null,
  992. thisPayMoney: 0,
  993. isUsedCoupon: false
  994. }
  995. this.alreadyPayInfo = {
  996. alreadyPayWX: 0,
  997. alreadyPayCash: 0,
  998. alreadyPayAli: 0
  999. }
  1000. },
  1001. /** 新增按钮操作 */
  1002. handleAdd() {
  1003. this.reset()
  1004. this.open = true
  1005. this.title = '添加用户'
  1006. },
  1007. // 多选框选中数据
  1008. handleSelectionChange(selection) {
  1009. this.ids = selection.map((item) => item.id)
  1010. this.single = selection.length !== 1
  1011. this.multiple = !selection.length
  1012. },
  1013. submitAlreadySelectCouponList() {
  1014. this.alreadySelectCouponList = []
  1015. this.ids.forEach((id) => {
  1016. const vo = this.couponList.find((item) => item.id == id)
  1017. this.alreadySelectCouponList.push(vo)
  1018. })
  1019. this.openCoupon = false
  1020. },
  1021. handleDelete(row) {
  1022. this.alreadySelectCouponList = this.alreadySelectCouponList.filter((item) => item.id != row.id)
  1023. this.$forceUpdate()
  1024. }
  1025. }
  1026. }
  1027. </script>
  1028. <style></style>