index.php 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('com-user-info');
  4. ?>
  5. <com-list-page :crumbs="crumbs" id="application">
  6. <com-list-table
  7. ref="table"
  8. :api="'avoid-tax/auth/index'"
  9. @selection-change="handleSelectionChange"
  10. :search-list="searchList"
  11. >
  12. <template slot="statistics">
  13. <!-- 提示 -->
  14. <el-col :span="24">
  15. <div class="notice">
  16. <ul>
  17. <li>
  18. <i class="el-icon-info" style="color: #E6A23C"></i>
  19. 请勿随意修改用户支付宝账号, 仅用户填错时可修改, 修改前可用支付宝转账功能进行查证。支付宝账号必须用户认证本人的支付宝账号, 否则会转账失败。
  20. </li>
  21. <li>
  22. <i class="el-icon-info" style="color: #E6A23C"></i>
  23. 解绑仅系统单方面解除会员身份绑定, 如再次签约出现已绑定的情况, 请联系税务方解除绑定。
  24. </li>
  25. </ul>
  26. </div>
  27. </el-col>
  28. </template>
  29. <!-- 订单信息 -->
  30. <el-table-column type="selection"></el-table-column>
  31. <el-table-column prop="id" align="center" label="ID"></el-table-column>
  32. <el-table-column prop="user" align="center" label="用户">
  33. <template slot-scope="scope">
  34. <com-user-info :user="scope.row.user"></com-user-info>
  35. </template>
  36. </el-table-column>
  37. <el-table-column prop="name" align="center" label="真实姓名"></el-table-column>
  38. <el-table-column prop="id_card_no" align="center" label="身份证"></el-table-column>
  39. <el-table-column prop="mobile" align="center" label="支付宝账号">
  40. <template slot-scope="scope">
  41. {{ scope.row.mobile }}
  42. <template v-if="scope.row.account">
  43. <br>
  44. {{ scope.row.account }}
  45. </template>
  46. </template>
  47. </el-table-column>
  48. <el-table-column prop="default" align="center" label="是否默认">
  49. <template slot-scope="scope">
  50. <i class="el-icon-circle-check" v-if="scope.row.default == 1"></i>
  51. <i class="el-icon-circle-close" v-if="scope.row.default == 0"></i>
  52. </template>
  53. </el-table-column>
  54. <el-table-column prop="created_at" align="center" label="签约时间">
  55. <template slot-scope="scope">
  56. {{ scope.row.created_at|dateTimeFormat('Y-m-d H:i:s') }}
  57. </template>
  58. </el-table-column>
  59. <el-table-column prop="right_btn" label="操作" align="center">
  60. <template slot-scope="scope">
  61. <el-button
  62. type="text"
  63. @click="editAuth(scope.row)"
  64. >修改</el-button>
  65. <el-button
  66. type="text"
  67. @click="unbind(scope.row.id)"
  68. >解绑</el-button>
  69. </template>
  70. </el-table-column>
  71. </com-list-table>
  72. <!-- 修改 -->
  73. <el-dialog :visible.sync="authVisible" width="30%">
  74. <template slot="title">
  75. <h3 style="text-align: center;">修改</h3>
  76. </template>
  77. <el-form label-width="150px" :model="authForm" :rules="authRules" ref="authForm">
  78. <el-form-item label="真实姓名:">
  79. {{ auth.name }}
  80. </el-form-item>
  81. <el-form-item label="身份证号码:">
  82. {{ auth.id_card_no }}
  83. </el-form-item>
  84. <el-form-item label="支付宝手机号:" prop="mobile">
  85. <el-input
  86. v-model="authForm.mobile"
  87. style="width: 350px"
  88. placeholder="请输入支付宝手机号"
  89. >
  90. </el-input>
  91. </el-form-item>
  92. <el-form-item label="支付宝账号:" prop="account">
  93. <el-input
  94. v-model="authForm.account"
  95. style="width: 350px"
  96. placeholder="请输入支付宝账号"
  97. >
  98. </el-input>
  99. </el-form-item>
  100. </el-form>
  101. <span slot="footer" class="dialog-footer">
  102. <el-button type="primary" :loading="subLoad" @click="toChange">确 定</el-button>
  103. </span>
  104. </el-dialog>
  105. </com-list-page>
  106. <script>
  107. var checkPhone = (rule, value, callback) => {
  108. if (!value) {
  109. return callback(new Error('手机号不能为空'));
  110. } else {
  111. const reg = /^1[1-9]\d{9}$/
  112. if (reg.test(value)) {
  113. callback();
  114. } else {
  115. return callback(new Error('请输入正确的手机号'));
  116. }
  117. }
  118. }
  119. var checkAccount = (rule, value, callback) => {
  120. if (value) {
  121. const reg = /^1[1-9]\d{9}$|[0-9a-zA-Z_.-]+[@][0-9a-zA-Z_.-]+([.][a-zA-Z]+){1,2}/
  122. if (reg.test(value)) {
  123. callback();
  124. } else {
  125. return callback(new Error('请输入正确的手机号'));
  126. }
  127. }
  128. callback();
  129. }
  130. const application = new Vue({
  131. el: '#application',
  132. data: {
  133. crumbs: [
  134. {
  135. title: '首页',
  136. router: 'mall/overview/index',
  137. },
  138. {
  139. title: '实名认证列表',
  140. }
  141. ],
  142. searchList: [
  143. {
  144. key: 'keyword',
  145. title: '会员昵称/手机号',
  146. type: 'text',
  147. },
  148. ],
  149. authVisible: false,
  150. subLoad: false,
  151. auth: {},
  152. authForm: {
  153. mobile: undefined,
  154. account: undefined,
  155. },
  156. authRules: {
  157. mobile: [
  158. {required: true, message: '支付宝账号不能为空'},
  159. {validator: checkPhone, message: '支付宝账号有误'}
  160. ],
  161. account: [
  162. {validator: checkAccount, message: '支付宝账号有误'}
  163. ],
  164. }
  165. },
  166. methods: {
  167. handleSelectionChange(val) {
  168. this.select_order = val
  169. },
  170. // edit
  171. editAuth(auth) {
  172. this.auth = auth
  173. this.authVisible = true
  174. this.authForm.mobile = auth.mobile
  175. this.authForm.account = auth.account
  176. },
  177. toChange() {
  178. this.$refs['authForm'].validate((valid) => {
  179. if (valid) {
  180. this.subLoad = true
  181. request({
  182. params: {
  183. r: 'avoid-tax/auth/change',
  184. id: this.auth.id,
  185. },
  186. method: 'post',
  187. data: this.authForm,
  188. }).then(e => {
  189. if (e.data.code === 0) {
  190. this.$message.success(e.data.msg)
  191. setTimeout(() => {
  192. this.$refs.table.handleSearch()
  193. }, 1500)
  194. } else {
  195. this.$message.error(e.data.msg)
  196. }
  197. this.authVisible = false
  198. this.subLoad = false
  199. }).catch(e => {
  200. this.$message.error('Net Error')
  201. this.subLoad = false
  202. })
  203. }
  204. })
  205. },
  206. unbind(id) {
  207. this.$confirm('是否确定解约,确定后需要自行向第三方申请解约', '提示', {
  208. confirmButtonText: '确定',
  209. cancelButtonText: '取消',
  210. type: 'warning'
  211. }).then(() => {
  212. request({
  213. params: {
  214. r: 'avoid-tax/auth/unbind',
  215. id: id
  216. },
  217. }).then(e => {
  218. if (e.data.code === 0) {
  219. this.$message.success(e.data.msg)
  220. setTimeout(() => {
  221. this.$refs.table.handleSearch()
  222. }, 1500)
  223. } else {
  224. this.$message.error(e.data.msg)
  225. }
  226. })
  227. })
  228. },
  229. convert() {
  230. this.$confirm('确定转换吗?', '提示', {
  231. confirmButtonText: '确定',
  232. cancelButtonText: '取消',
  233. type: 'warning'
  234. }).then(() => {
  235. request({
  236. params: {
  237. r: 'avoid-tax/auth/convert',
  238. },
  239. }).then(e => {
  240. this.$message.success(e.data.msg)
  241. })
  242. })
  243. },
  244. },
  245. });
  246. </script>
  247. <style>
  248. .notice {
  249. border: 1px solid rgb(250, 236, 216);
  250. background: rgb(253, 246, 236);
  251. margin-top: 10px;
  252. padding: 10px;
  253. border-radius: 5px;
  254. }
  255. .notice li + li {
  256. margin-top: 5px;
  257. }
  258. .convert {
  259. position: absolute;
  260. right: 0;
  261. top: 0;
  262. }
  263. </style>