Rap 原分销系统代码Web
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

1533 строки
51KB

  1. <template>
  2. <div class="app-container">
  3. <div style="margin-bottom:10px">
  4. <el-button type="success" @click="addBtn">新增</el-button>
  5. <el-button type="success" @click="importBtn">导入</el-button>
  6. <el-button type="success" @click="exportTempBtn">模版下载</el-button>
  7. </div>
  8. <!--搜索-->
  9. <el-form class="mt_15" ref="form" inline size="small">
  10. <el-form-item label="账号">
  11. <el-input v-model.trim="searchParm.account" clearable placeholder="账号"></el-input>
  12. </el-form-item>
  13. <el-form-item label="昵称">
  14. <el-input v-model.trim="searchParm.nickName" clearable></el-input>
  15. </el-form-item>
  16. <el-form-item label="密码">
  17. <el-input v-model.trim="searchParm.pwd" clearable></el-input>
  18. </el-form-item>
  19. <el-form-item label="公司">
  20. <el-select v-model.trim="searchParm.companyId" placeholder="请选择">
  21. <el-option v-for="item in companys" :key="item.name" :label="item.name" :value="item.id"></el-option>
  22. </el-select>
  23. </el-form-item>
  24. <el-form-item label="平台">
  25. <el-select v-model.trim="searchParm.platformId" placeholder="请选择">
  26. <el-option
  27. v-for="item in platformList"
  28. :key="item.id"
  29. :label="item.name"
  30. :value="item.id"
  31. ></el-option>
  32. </el-select>
  33. </el-form-item>
  34. <el-form-item>
  35. <el-button type="primary" @click="goSearch">搜索</el-button>
  36. <el-button type="warning" @click="resetForm">重置</el-button>
  37. </el-form-item>
  38. </el-form>
  39. <!--表格渲染-->
  40. <el-table
  41. ref="table"
  42. border
  43. size="small"
  44. :data="list"
  45. :header-cell-style="{textAlign:'center'}"
  46. :cell-style="{textAlign:'center'}"
  47. >
  48. <el-table-column label="序号" type="index" width="50" />
  49. <el-table-column label="账号" prop="account" />
  50. <el-table-column label="昵称" prop="nickName" />
  51. <el-table-column label="密码" prop="pwd" />
  52. <el-table-column label="公司" prop="companyName" />
  53. <el-table-column label="平台" prop="platformName" />
  54. <el-table-column label="VPNIP" prop="ipAddress" />
  55. <el-table-column label="信用卡卡号" prop="number" />
  56. <el-table-column label="州" prop="state" />
  57. <el-table-column label="国家" prop="contntryShort" />
  58. <el-table-column label="地址1" prop="addressline1" />
  59. <el-table-column label="状态" prop="status">
  60. <template slot-scope="scope">{{ scope.row.status | getStatus}}</template>
  61. </el-table-column>
  62. <el-table-column label="创建时间" prop="createdAt" />
  63. <el-table-column label="修改时间" prop="updatedAt" />
  64. <el-table-column label="操作" width="220">
  65. <template slot-scope="scope">
  66. <el-button type="info" @click="getBtnById(scope.row.id)">查看</el-button>
  67. <el-button type="warning" @click="editById(scope.row)">修改</el-button>
  68. <span v-if="scope.row.status != 7" slot="footer">
  69. <el-button type="danger" @click="delById(scope.row.id)" style="margin-left: 10px">删除</el-button>
  70. </span>
  71. </template>
  72. </el-table-column>
  73. </el-table>
  74. <!--分页-->
  75. <div class="mt_15">
  76. <el-pagination
  77. @size-change="handleSizeChange"
  78. @current-change="handleCurrentChange"
  79. :current-page="searchParm.page"
  80. :page-sizes="[10, 20, 30, 40, 50]"
  81. :page-size="searchParm.pageSize"
  82. layout="total, sizes, prev, pager, next, jumper"
  83. :total="total"
  84. ></el-pagination>
  85. </div>
  86. <!--新增弹窗-->
  87. <el-dialog :visible.sync="dialogAddVisible" :title="dialogAddTitle" center width="45%">
  88. <div class="dialog-content">
  89. <el-form ref="addParm" size="small" :model="addParm" :rules="rules" label-width="100px">
  90. <el-form-item label="账号" prop="account">
  91. <el-input v-model.trim="addParm.account" clearable></el-input>
  92. </el-form-item>
  93. <el-form-item label="昵称" prop="nickName">
  94. <el-input v-model.trim="addParm.nickName" clearable></el-input>
  95. </el-form-item>
  96. <el-form-item label="密码" prop="pwd">
  97. <el-input v-model.trim="addParm.pwd" clearable></el-input>
  98. </el-form-item>
  99. <el-form-item label="公司" prop="companyId">
  100. <el-select v-model.trim="addParm.companyId" placeholder="请选择">
  101. <el-option
  102. v-for="item in companys"
  103. :key="item.name"
  104. :label="item.name"
  105. :value="item.id"
  106. ></el-option>
  107. </el-select>
  108. </el-form-item>
  109. <el-form-item label="平台" prop="platformId">
  110. <el-select v-model.trim="addParm.platformId" placeholder="请选择">
  111. <el-option
  112. v-for="item in platformList"
  113. :key="item.name"
  114. :label="item.name"
  115. :value="item.id"
  116. ></el-option>
  117. </el-select>
  118. </el-form-item>
  119. <!--国家-->
  120. <el-form-item label="所属国家" prop="contntryShort">
  121. <el-input v-model.trim="addParm.contntryShort" clearable></el-input>
  122. </el-form-item>
  123. <!--VPN vpnId -->
  124. <el-input v-model.trim="addParm.vpnId" type="hidden" clearable></el-input>
  125. <el-form-item label="VPN地址" prop="vpnIp">
  126. <el-input v-model.trim="addParm.vpnIp" style="width:230px"></el-input>
  127. <el-button
  128. type="primary"
  129. icon="el-icon-search"
  130. @click="goSearchVpn"
  131. style="width:130px"
  132. >请选择VPN</el-button>
  133. </el-form-item>
  134. <!--信用卡ID cardId -->
  135. <el-input v-model.trim="addParm.cardId" type="hidden" clearable></el-input>
  136. <el-form-item label="信用卡号" prop="cardNumber">
  137. <el-input v-model.trim="addParm.cardNumber" style="width:230px"></el-input>
  138. <el-button
  139. type="primary"
  140. icon="el-icon-search"
  141. @click="goSearchCard"
  142. style="width:130px"
  143. >请选择信用卡</el-button>
  144. </el-form-item>
  145. <!--用户等级 level -->
  146. <el-form-item label="用户等级" prop="level">
  147. <el-select v-model.trim="addParm.level" placeholder="请选择">
  148. <el-option
  149. v-for="item in levelList"
  150. :key="item.name"
  151. :label="item.name"
  152. :value="item.id"
  153. ></el-option>
  154. </el-select>
  155. </el-form-item>
  156. <!--占用状态 occupyStatus -->
  157. <el-form-item label="占用状态" prop="occupyStatus">
  158. <el-select v-model.trim="addParm.occupyStatus" placeholder="请选择">
  159. <el-option
  160. v-for="item in occupyStatusList"
  161. :key="item.name"
  162. :label="item.name"
  163. :value="item.id"
  164. ></el-option>
  165. </el-select>
  166. </el-form-item>
  167. <!--状态 status -->
  168. <el-form-item label="状态" prop="status">
  169. <el-select v-model.trim="addParm.status" placeholder="请选择">
  170. <el-option
  171. v-for="item in statusList"
  172. :key="item.name"
  173. :label="item.name"
  174. :value="item.id"
  175. ></el-option>
  176. </el-select>
  177. </el-form-item>
  178. <!-- ********地址相关信息******** -->
  179. <!--firstname-->
  180. <el-form-item label="firstname" prop="firstname">
  181. <el-input v-model.trim="addParm.firstname" clearable></el-input>
  182. </el-form-item>
  183. <!--lastname-->
  184. <el-form-item label="lastname" prop="lastname">
  185. <el-input v-model.trim="addParm.lastname" clearable></el-input>
  186. </el-form-item>
  187. <!--电话-->
  188. <el-form-item label="电话" prop="tel">
  189. <el-input v-model.trim="addParm.tel" clearable></el-input>
  190. </el-form-item>
  191. <!--国家-->
  192. <el-form-item label="国家" prop="country">
  193. <el-input v-model.trim="addParm.country" clearable></el-input>
  194. </el-form-item>
  195. <!--州-->
  196. <el-form-item label="州" prop="state">
  197. <el-input v-model.trim="addParm.state" clearable></el-input>
  198. </el-form-item>
  199. <!--城市-->
  200. <el-form-item label="城市" prop="city">
  201. <el-input v-model.trim="addParm.city" clearable></el-input>
  202. </el-form-item>
  203. <!--地址1-->
  204. <el-form-item label="地址1" prop="addressline1">
  205. <el-input v-model.trim="addParm.addressline1" clearable></el-input>
  206. </el-form-item>
  207. <!--地址2-->
  208. <el-form-item label="地址2" prop="addressline2">
  209. <el-input v-model.trim="addParm.addressline2" clearable></el-input>
  210. </el-form-item>
  211. <!--税号-->
  212. <el-form-item label="税号" prop="vatNumber">
  213. <el-input v-model.trim="addParm.vatNumber" clearable></el-input>
  214. </el-form-item>
  215. <!--邮政编码-->
  216. <el-form-item label="邮政编码" prop="postalcode">
  217. <el-input v-model.trim="addParm.postalcode" clearable></el-input>
  218. </el-form-item>
  219. </el-form>
  220. </div>
  221. <span slot="footer">
  222. <el-button type="info" @click="sureAddCancle('addParm')">取消</el-button>
  223. <el-button type="primary" @click="sureAdd('addParm')">确认</el-button>
  224. </span>
  225. </el-dialog>
  226. <!--VPN选择弹窗-->
  227. <el-dialog
  228. width="75%"
  229. :visible.sync="dialogVpnVisible"
  230. :title="dialogVpnTittle"
  231. center
  232. append-to-body
  233. >
  234. <!-- 搜索VPN -->
  235. <el-form class="mt_15" ref="form" inline size="small">
  236. <el-form-item label="所属国家简称">
  237. <el-input v-model.trim="searchVpnParm.contntryShort" clearable placeholder="所属国家简称"></el-input>
  238. </el-form-item>
  239. <el-form-item label="IP地址">
  240. <el-input v-model.trim="searchVpnParm.ipAddress" clearable placeholder="IP地址"></el-input>
  241. </el-form-item>
  242. <el-form-item label="父ip地址">
  243. <el-input v-model.trim="searchVpnParm.parentIpAddress" clearable placeholder="父ip地址"></el-input>
  244. </el-form-item>
  245. <el-form-item label="端口">
  246. <el-input v-model.trim="searchVpnParm.port" clearable placeholder="端口"></el-input>
  247. </el-form-item>
  248. <el-form-item label="名称">
  249. <el-input v-model.trim="searchVpnParm.name" clearable placeholder="名称"></el-input>
  250. </el-form-item>
  251. <el-form-item label="密码">
  252. <el-input v-model.trim="searchVpnParm.pwd" clearable placeholder="密码"></el-input>
  253. </el-form-item>
  254. <el-form-item label="mac地址">
  255. <el-input v-model.trim="searchVpnParm.mac" clearable placeholder="mac地址"></el-input>
  256. </el-form-item>
  257. <el-form-item label="VPS类型">
  258. <el-select v-model.trim="searchVpnParm.vpsType" placeholder="请选择">
  259. <el-option
  260. v-for="item in searchVpsTypeList"
  261. :key="item.value"
  262. :label="item.label"
  263. :value="item.value"
  264. ></el-option>
  265. </el-select>
  266. </el-form-item>
  267. <el-form-item label="经销商">
  268. <el-select v-model.trim="searchVpnParm.dealer" placeholder="请选择">
  269. <el-option
  270. v-for="item in searchDealerList"
  271. :key="item.value"
  272. :label="item.label"
  273. :value="item.value"
  274. ></el-option>
  275. </el-select>
  276. </el-form-item>
  277. <el-form-item label="状态">
  278. <el-select v-model.trim="searchVpnParm.status" placeholder="请选择">
  279. <el-option
  280. v-for="item in searchStatusList"
  281. :key="item.value"
  282. :label="item.label"
  283. :value="item.value"
  284. ></el-option>
  285. </el-select>
  286. </el-form-item>
  287. <el-form-item>
  288. <el-button type="primary" @click="goSearchVpn">搜索</el-button>
  289. <el-button type="warning" @click="resetVpnForm">重置</el-button>
  290. </el-form-item>
  291. </el-form>
  292. <!--表格渲染-->
  293. <el-table
  294. ref="table"
  295. border
  296. size="small"
  297. :data="vpnList"
  298. :header-cell-style="{textAlign:'center'}"
  299. :cell-style="{textAlign:'center'}"
  300. >
  301. <el-table-column label="序号" type="index" width="50" />
  302. <el-table-column label="所属国家简称" prop="contntryShort" />
  303. <el-table-column label="IP地址" prop="ipAddress" />
  304. <el-table-column label="父ip地址" prop="parentIpAddress" />
  305. <el-table-column label="端口" prop="port" />
  306. <el-table-column label="名称" prop="name" />
  307. <el-table-column label="密码" prop="pwd" />
  308. <el-table-column label="VPS类型" prop="vpsType">
  309. <template slot-scope="scope">{{ scope.row.vpsType | getVpnVpsType}}</template>
  310. </el-table-column>
  311. <el-table-column label="经销商" prop="dealer">
  312. <template slot-scope="scope">{{ scope.row.dealer | getVpnDealer}}</template>
  313. </el-table-column>
  314. <el-table-column label="mac地址" prop="mac" />
  315. <el-table-column label="状态" prop="status">
  316. <template slot-scope="scope">{{ scope.row.status | getVpnStatus}}</template>
  317. </el-table-column>
  318. <el-table-column label="创建时间" prop="createdAt" />
  319. <el-table-column label="修改时间" prop="updatedAt" />
  320. <el-table-column label="操作">
  321. <template slot-scope="scope">
  322. <el-button type="success" @click="getVpnIpById(scope.row)">选中</el-button>
  323. </template>
  324. </el-table-column>
  325. </el-table>
  326. <!--分页-->
  327. <div class="mt_15">
  328. <el-pagination
  329. @size-change="handleSizeChange"
  330. @current-change="handleCurrentChange"
  331. :current-page="searchVpnParm.page"
  332. :page-sizes="[10, 20, 30, 40, 50]"
  333. :page-size="searchVpnParm.pageSize"
  334. layout="total, sizes, prev, pager, next, jumper"
  335. :total="vpnTotal"
  336. ></el-pagination>
  337. </div>
  338. </el-dialog>
  339. <!--信用卡选择弹窗-->
  340. <el-dialog
  341. width="75%"
  342. :visible.sync="dialogCardVisible"
  343. :title="dialogCardTittle"
  344. center
  345. append-to-body
  346. >
  347. <!--搜索信用卡-->
  348. <el-form class="mt_15" ref="form" inline size="small">
  349. <el-form-item label="卡号">
  350. <el-input v-model.trim="searchCardParm.number" clearable placeholder="账号"></el-input>
  351. </el-form-item>
  352. <el-form-item label="PIN">
  353. <el-input v-model.trim="searchCardParm.pinNumber" clearable></el-input>
  354. </el-form-item>
  355. <el-form-item label="持卡人名称">
  356. <el-input v-model.trim="searchCardParm.holderName" clearable></el-input>
  357. </el-form-item>
  358. <el-form-item label="类型">
  359. <el-select v-model.trim="searchCardParm.type" placeholder="请选择">
  360. <el-option
  361. v-for="item in typeCardList"
  362. :key="item.name"
  363. :label="item.name"
  364. :value="item.id"
  365. ></el-option>
  366. </el-select>
  367. </el-form-item>
  368. <el-form-item label="卡商">
  369. <el-select v-model.trim="searchCardParm.cardDealer" placeholder="请选择">
  370. <el-option
  371. v-for="item in dealerCardList"
  372. :key="item.name"
  373. :label="item.name"
  374. :value="item.id"
  375. ></el-option>
  376. </el-select>
  377. </el-form-item>
  378. <el-form-item label="状态">
  379. <el-select v-model.trim="searchCardParm.status" placeholder="请选择">
  380. <el-option
  381. v-for="item in statusCardList"
  382. :key="item.name"
  383. :label="item.name"
  384. :value="item.id"
  385. ></el-option>
  386. </el-select>
  387. </el-form-item>
  388. <el-form-item>
  389. <el-button type="primary" @click="goSearchCard">搜索</el-button>
  390. <el-button type="warning" @click="resetCardForm">重置</el-button>
  391. </el-form-item>
  392. </el-form>
  393. <!--表格渲染-->
  394. <el-table
  395. ref="table"
  396. border
  397. size="small"
  398. :data="cardList"
  399. :header-cell-style="{textAlign:'center'}"
  400. >
  401. <el-table-column label="序号" type="index" width="50" align="center" />
  402. <el-table-column label="卡号" prop="number" align="center" />
  403. <el-table-column label="PIN码" prop="pinNumber" align="center" />
  404. <el-table-column label="持卡人姓氏" prop="holderSurname" align="center" />
  405. <el-table-column label="持卡人名称" prop="holderName" align="center" />
  406. <el-table-column label="所属厂商" prop="cardDealer" align="center">
  407. <template slot-scope="scope">{{ scope.row.cardDealer | getCardDealer}}</template>
  408. </el-table-column>
  409. <el-table-column label="类型" prop="type" align="center">
  410. <template slot-scope="scope">{{ scope.row.type | getCardType}}</template>
  411. </el-table-column>
  412. <el-table-column label="状态" prop="status" align="center">
  413. <template slot-scope="scope">{{ scope.row.status | getCardStatus}}</template>
  414. </el-table-column>
  415. <el-table-column label="创建时间" prop="createdAt" align="center" />
  416. <el-table-column label="修改时间" prop="updatedAt" align="center" />
  417. <el-table-column label="操作" align="center">
  418. <template slot-scope="scope">
  419. <el-button type="success" @click="getCardById(scope.row)" align="center">选中</el-button>
  420. </template>
  421. </el-table-column>
  422. </el-table>
  423. <!--分页-->
  424. <div class="mt_15">
  425. <el-pagination
  426. @size-change="handleSizeChange"
  427. @current-change="handleCurrentChange"
  428. :current-page="searchCardParm.page"
  429. :page-sizes="[10, 20, 30, 40, 50]"
  430. :page-size="searchCardParm.pageSize"
  431. layout="total, sizes, prev, pager, next, jumper"
  432. :total="cardTotal"
  433. ></el-pagination>
  434. </div>
  435. </el-dialog>
  436. <!--修改弹窗-->
  437. <el-dialog :visible.sync="dialogEditVisible" :title="dialogEditTitle" center width="45%">
  438. <div class="dialog-content">
  439. <el-form ref="editParm" size="small" :model="editParm" :rules="rules" label-width="100px">
  440. <el-form-item label="账号" prop="account">
  441. <el-input v-model.trim="editParm.account" clearable></el-input>
  442. </el-form-item>
  443. <el-form-item label="昵称" prop="nickName">
  444. <el-input v-model.trim="editParm.nickName" clearable></el-input>
  445. </el-form-item>
  446. <el-form-item label="密码" prop="pwd">
  447. <el-input v-model.trim="editParm.pwd" clearable></el-input>
  448. </el-form-item>
  449. <el-form-item label="公司" prop="companyId">
  450. <el-select v-model.trim="editParm.companyId" placeholder="请选择">
  451. <el-option
  452. v-for="item in companys"
  453. :key="item.name"
  454. :label="item.name"
  455. :value="item.id"
  456. ></el-option>
  457. </el-select>
  458. </el-form-item>
  459. <el-form-item label="平台" prop="platformId">
  460. <el-select v-model.trim="editParm.platformId" placeholder="请选择">
  461. <el-option
  462. v-for="item in platformList"
  463. :key="item.name"
  464. :label="item.name"
  465. :value="item.id"
  466. ></el-option>
  467. </el-select>
  468. </el-form-item>
  469. <!--国家-->
  470. <el-form-item label="所属国家" prop="contntryShort">
  471. <el-input v-model.trim="editParm.contntryShort" clearable></el-input>
  472. </el-form-item>
  473. <!--VPN vpnId -->
  474. <el-input v-model.trim="editParm.vpnId" type="hidden" clearable></el-input>
  475. <el-form-item label="VPN地址" prop="vpnIp">
  476. <el-input v-model.trim="editParm.vpnIp" disabled style="width:230px"></el-input>
  477. <el-button
  478. type="primary"
  479. icon="el-icon-search"
  480. @click="goSearchVpn"
  481. style="width:130px"
  482. >请选择VPN</el-button>
  483. </el-form-item>
  484. <!--信用卡ID cardId -->
  485. <el-input v-model.trim="editParm.cardId" type="hidden" clearable></el-input>
  486. <el-form-item label="信用卡号" prop="cardNumber">
  487. <el-input v-model.trim="editParm.cardNumber" disabled style="width:230px"></el-input>
  488. <el-button
  489. type="primary"
  490. icon="el-icon-search"
  491. @click="goSearchCard"
  492. style="width:130px"
  493. >请选择信用卡</el-button>
  494. </el-form-item>
  495. <!--用户等级 level -->
  496. <el-form-item label="用户等级" prop="level">
  497. <el-select v-model.trim="editParm.level" placeholder="请选择">
  498. <el-option
  499. v-for="item in levelList"
  500. :key="item.name"
  501. :label="item.name"
  502. :value="item.id"
  503. ></el-option>
  504. </el-select>
  505. </el-form-item>
  506. <!--占用状态 occupyStatus -->
  507. <el-form-item label="占用状态" prop="occupyStatus">
  508. <el-select v-model.trim="editParm.occupyStatus" placeholder="请选择">
  509. <el-option
  510. v-for="item in occupyStatusList"
  511. :key="item.name"
  512. :label="item.name"
  513. :value="item.id"
  514. ></el-option>
  515. </el-select>
  516. </el-form-item>
  517. <!--状态 status -->
  518. <el-form-item label="状态" prop="status">
  519. <el-select v-model.trim="editParm.status" placeholder="请选择">
  520. <el-option
  521. v-for="item in statusList"
  522. :key="item.name"
  523. :label="item.name"
  524. :value="item.id"
  525. ></el-option>
  526. </el-select>
  527. </el-form-item>
  528. <!-- ********地址相关信息******** -->
  529. <!--firstname-->
  530. <el-form-item label="firstname" prop="firstname">
  531. <el-input v-model.trim="editParm.firstname" clearable></el-input>
  532. </el-form-item>
  533. <!--lastname-->
  534. <el-form-item label="lastname" prop="lastname">
  535. <el-input v-model.trim="editParm.lastname" clearable></el-input>
  536. </el-form-item>
  537. <!--电话-->
  538. <el-form-item label="电话" prop="tel">
  539. <el-input v-model.trim="editParm.tel" clearable></el-input>
  540. </el-form-item>
  541. <!--国家-->
  542. <el-form-item label="国家" prop="country">
  543. <el-input v-model.trim="editParm.country" clearable></el-input>
  544. </el-form-item>
  545. <!--州-->
  546. <el-form-item label="州" prop="state">
  547. <el-input v-model.trim="editParm.state" clearable></el-input>
  548. </el-form-item>
  549. <!--城市-->
  550. <el-form-item label="城市" prop="city">
  551. <el-input v-model.trim="editParm.city" clearable></el-input>
  552. </el-form-item>
  553. <!--地址1-->
  554. <el-form-item label="地址1" prop="addressline1">
  555. <el-input v-model.trim="editParm.addressline1" clearable></el-input>
  556. </el-form-item>
  557. <!--地址2-->
  558. <el-form-item label="地址2" prop="addressline2">
  559. <el-input v-model.trim="editParm.addressline2" clearable></el-input>
  560. </el-form-item>
  561. <!--税号-->
  562. <el-form-item label="税号" prop="vatNumber">
  563. <el-input v-model.trim="editParm.vatNumber" clearable></el-input>
  564. </el-form-item>
  565. <!--邮政编码-->
  566. <el-form-item label="邮政编码" prop="postalcode">
  567. <el-input v-model.trim="editParm.postalcode" clearable></el-input>
  568. </el-form-item>
  569. </el-form>
  570. </div>
  571. <span slot="footer">
  572. <el-button type="info" @click="sureEditCancle('editParm')">取消</el-button>
  573. <el-button type="primary" @click="sureEdit('editParm')">确认</el-button>
  574. </span>
  575. </el-dialog>
  576. <!--详情弹窗-->
  577. <el-dialog :visible.sync="dialogDetailVisible" :title="dialogDetailTitle" center width="45%">
  578. <div class="dialog-content">
  579. <el-form ref="form" size="small" label-width="120px">
  580. <el-form-item label="账号" prop="account">
  581. <el-input v-model.trim="detailParm.account" :disabled="true"></el-input>
  582. </el-form-item>
  583. <el-form-item label="昵称" prop="nickName">
  584. <el-input v-model.trim="detailParm.nickName" :disabled="true"></el-input>
  585. </el-form-item>
  586. <el-form-item label="密码" prop="pwd">
  587. <el-input v-model.trim="detailParm.pwd" :disabled="true"></el-input>
  588. </el-form-item>
  589. <el-form-item label="公司" prop="companyId">
  590. <el-select v-model.trim="detailParm.companyId" disabled placeholder="请选择">
  591. <el-option
  592. v-for="item in companys"
  593. :key="item.name"
  594. :label="item.name"
  595. :value="item.id"
  596. ></el-option>
  597. </el-select>
  598. </el-form-item>
  599. <el-form-item label="平台" prop="platformId">
  600. <el-select v-model.trim="detailParm.platformId" disabled placeholder="请选择">
  601. <el-option
  602. v-for="item in platformList"
  603. :key="item.name"
  604. :label="item.name"
  605. :value="item.id"
  606. ></el-option>
  607. </el-select>
  608. </el-form-item>
  609. <!--国家-->
  610. <el-form-item label="国家" prop="contntryShort">
  611. <el-input v-model.trim="detailParm.contntryShort" disabled clearable></el-input>
  612. </el-form-item>
  613. <!--VPN vpnId -->
  614. <el-form-item label="VPNIP" prop="vpnIp">
  615. <el-input v-model.trim="detailParm.vpnIp" disabled clearable></el-input>
  616. </el-form-item>
  617. <!--信用卡ID cardId -->
  618. <el-form-item label="信用卡卡号" prop="cardNumber">
  619. <el-input v-model.trim="detailParm.cardNumber" disabled clearable></el-input>
  620. </el-form-item>
  621. <!--用户等级 level -->
  622. <el-form-item label="用户等级" prop="level">
  623. <el-select v-model.trim="detailParm.level" disabled placeholder="请选择">
  624. <el-option
  625. v-for="item in levelList"
  626. :key="item.name"
  627. :label="item.name"
  628. :value="item.id"
  629. ></el-option>
  630. </el-select>
  631. </el-form-item>
  632. <!--占用状态 occupyStatus -->
  633. <el-form-item label="占用状态" prop="occupyStatus">
  634. <el-select v-model.trim="detailParm.occupyStatus" disabled placeholder="请选择">
  635. <el-option
  636. v-for="item in occupyStatusList"
  637. :key="item.name"
  638. :label="item.name"
  639. :value="item.id"
  640. ></el-option>
  641. </el-select>
  642. </el-form-item>
  643. <!--状态 status -->
  644. <el-form-item label="状态" prop="status">
  645. <el-select v-model.trim="detailParm.status" disabled placeholder="请选择">
  646. <el-option
  647. v-for="item in statusList"
  648. :key="item.name"
  649. :label="item.name"
  650. :value="item.id"
  651. ></el-option>
  652. </el-select>
  653. </el-form-item>
  654. <!--占用账户-->
  655. <el-form-item label="占用账户" prop="occupyAccount">
  656. <el-input v-model.trim="detailParm.occupyAccount" :disabled="true" clearable></el-input>
  657. </el-form-item>
  658. <!--账户余额-->
  659. <el-form-item label="账户余额" prop="balance">
  660. <el-input v-model.trim="detailParm.balance" :disabled="true" clearable></el-input>
  661. </el-form-item>
  662. <!--购买总金额-->
  663. <el-form-item label="账户购买总金额" prop="buyTotalMoney">
  664. <el-input v-model.trim="detailParm.buyTotalMoney" :disabled="true" clearable></el-input>
  665. </el-form-item>
  666. <!--地址1-->
  667. <el-form-item label="地址1" prop="addressline1">
  668. <el-input v-model.trim="detailParm.addressline1" :disabled="true" clearable></el-input>
  669. </el-form-item>
  670. <!--国家-->
  671. <el-form-item label="国家" prop="country">
  672. <el-input v-model.trim="detailParm.country" :disabled="true" clearable></el-input>
  673. </el-form-item>
  674. <!--州-->
  675. <el-form-item label="州" prop="state">
  676. <el-input v-model.trim="detailParm.state" :disabled="true" clearable></el-input>
  677. </el-form-item>
  678. <!--电话-->
  679. <el-form-item label="电话" prop="tel">
  680. <el-input v-model.trim="detailParm.tel" :disabled="true" clearable></el-input>
  681. </el-form-item>
  682. <!--lastname-->
  683. <el-form-item label="lastname" prop="lastname">
  684. <el-input v-model.trim="detailParm.lastname" :disabled="true" clearable></el-input>
  685. </el-form-item>
  686. <!--税号-->
  687. <el-form-item label="税号" prop="vatNumber">
  688. <el-input v-model.trim="detailParm.vatNumber" :disabled="true" clearable></el-input>
  689. </el-form-item>
  690. <!--城市-->
  691. <el-form-item label="城市" prop="city">
  692. <el-input v-model.trim="detailParm.city" :disabled="true" clearable></el-input>
  693. </el-form-item>
  694. <!--地址2-->
  695. <el-form-item label="地址2" prop="addressline2">
  696. <el-input v-model.trim="detailParm.addressline2" :disabled="true" clearable></el-input>
  697. </el-form-item>
  698. <!--firstname-->
  699. <el-form-item label="firstname" prop="firstname">
  700. <el-input v-model.trim="detailParm.firstname" :disabled="true" clearable></el-input>
  701. </el-form-item>
  702. <!--邮政编码-->
  703. <el-form-item label="邮政编码" prop="postalcode">
  704. <el-input v-model.trim="detailParm.postalcode" :disabled="true" clearable></el-input>
  705. </el-form-item>
  706. </el-form>
  707. </div>
  708. </el-dialog>
  709. <!--买家导入 importBtn-->
  710. <el-dialog :visible.sync="dialogImportVisible" :title="dialogImportTitle" center width="23%">
  711. <div class="dialog-content">
  712. <el-upload
  713. class="upload-demo"
  714. drag
  715. ref="upload"
  716. :headers="uploadHeaders"
  717. :action="uploadFileUrl"
  718. :show-file-list="false"
  719. :on-success="uploadSuccess"
  720. :before-upload="beforeAvatarUpload"
  721. multiple
  722. >
  723. <i class="el-icon-upload"></i>
  724. <div class="el-upload__text">
  725. 将文件拖到此处,或
  726. <em>点击上传</em>
  727. </div>
  728. <div class="el-upload__tip" slot="tip">只能上传xlsl文件,且不超过10M</div>
  729. </el-upload>
  730. </div>
  731. </el-dialog>
  732. </div>
  733. </template>
  734. <script>
  735. import {
  736. add,
  737. editById,
  738. delById,
  739. getList,
  740. getById,
  741. getVpnList,
  742. getCardList
  743. } from "@/api/group/buyer";
  744. import { getAll } from "@/api/group/company";
  745. export default {
  746. filters: {
  747. getStatus: function(value) {
  748. if (value == 1) {
  749. return "待注册";
  750. } else if (value == 2) {
  751. return "待验证";
  752. } else if (value == 3) {
  753. return "待完善";
  754. } else if (value == 4) {
  755. return "正常";
  756. } else if (value == 5) {
  757. return "异常";
  758. } else if (value == 6) {
  759. return "可用但已用";
  760. } else {
  761. return "删除";
  762. }
  763. },
  764. getVpnVpsType: function(value) {
  765. if (value == 1) {
  766. return "传统";
  767. }
  768. },
  769. getVpnDealer: function(value) {
  770. if (value == 1) {
  771. return "V2";
  772. }
  773. },
  774. getVpnStatus: function(value) {
  775. if (value == 1) {
  776. return "可用";
  777. } else if (value == 2) {
  778. return "禁用";
  779. }
  780. },
  781. getCardStatus: function(value) {
  782. if (value == 1) {
  783. return "正常";
  784. } else if (value == 2) {
  785. return "异常";
  786. } else {
  787. return "删除";
  788. }
  789. },
  790. getCardType: function(value) {
  791. if (value == 1) {
  792. return "Payoneer";
  793. } else if (value == 2) {
  794. return "万事达虚拟卡";
  795. } else {
  796. return "Visa信用卡";
  797. }
  798. },
  799. getCardDealer: function(value) {
  800. if (value == 1) {
  801. return "AmzKeys";
  802. } else {
  803. return "Airwallex";
  804. }
  805. }
  806. },
  807. // 数据
  808. data() {
  809. return {
  810. searchParm: {
  811. page: 1,
  812. pageSize: 10,
  813. account: null,
  814. sort: "created_at",
  815. order: "desc",
  816. nickName: null,
  817. pwd: null,
  818. companyId: null,
  819. platformId: null
  820. },
  821. searchVpnParm: {
  822. page: 1,
  823. pageSize: 10,
  824. sort: "created_at",
  825. order: "desc",
  826. contntryShort: null,
  827. ipAddress: null,
  828. parentIpAddress: null,
  829. port: null,
  830. name: null,
  831. pwd: null,
  832. vpsType: null,
  833. dealer: null,
  834. mac: null,
  835. status: null
  836. },
  837. searchCardParm: {
  838. page: 1,
  839. pageSize: 10,
  840. sort: "created_at",
  841. order: "desc",
  842. cardDealer: "",
  843. type: "",
  844. status: "",
  845. holderName: null,
  846. number: null,
  847. pinNumber: null
  848. },
  849. total: 0,
  850. vpnTotal: 0,
  851. cardTotal: 0,
  852. list: [],
  853. vpnList: [],
  854. cardList: [],
  855. dialogAddVisible: false,
  856. dialogAddTitle: "新增",
  857. dialogDetailVisible: false,
  858. dialogDetailTitle: "详情",
  859. dialogEditVisible: false,
  860. dialogEditTitle: "修改",
  861. dialogImportVisible: false,
  862. dialogImportTitle: "导入",
  863. dialogVpnTittle: "VPN列表",
  864. dialogVpnVisible: false,
  865. dialogCardTittle: "信用卡列表",
  866. dialogCardVisible: false,
  867. uploadHeaders:{ Authorization: this.$store.getters.token },
  868. uploadFileUrl: process.env.VUE_APP_BASE_API + "/api/ctBuyer/import",
  869. tempUrl: process.env.VUE_APP_BASE_API + "/api/ctBuyer/exportTemp",
  870. companys: [],
  871. addDialog: true,
  872. //买家表格:0 ;VPN表格:1 ;Card表格:2
  873. handleType: 0,
  874. platformList: [
  875. {
  876. id: 1,
  877. name: "敦煌"
  878. },
  879. {
  880. id: 2,
  881. name: "速卖通"
  882. },
  883. {
  884. id: 3,
  885. name: "马帮"
  886. }
  887. ],
  888. statusList: [
  889. {
  890. id: 1,
  891. name: "待注册"
  892. },
  893. {
  894. id: 2,
  895. name: "待验证"
  896. },
  897. {
  898. id: 3,
  899. name: "待完善"
  900. },
  901. {
  902. id: 4,
  903. name: "正常"
  904. },
  905. {
  906. id: 5,
  907. name: "异常"
  908. },
  909. {
  910. id: 6,
  911. name: "可用但已用"
  912. },
  913. {
  914. id: 7,
  915. name: "删除"
  916. }
  917. ],
  918. occupyStatusList: [
  919. {
  920. id: 1,
  921. name: "已占用"
  922. },
  923. {
  924. id: 2,
  925. name: "未占用"
  926. }
  927. ],
  928. levelList: [
  929. {
  930. id: 1,
  931. name: "普通"
  932. },
  933. {
  934. id: 2,
  935. name: "精品"
  936. },
  937. {
  938. id: 3,
  939. name: "压力"
  940. },
  941. {
  942. id: 4,
  943. name: "内部账号"
  944. }
  945. ],
  946. searchVpsTypeList: [
  947. {
  948. value: null,
  949. label: "全部"
  950. },
  951. {
  952. value: 1,
  953. label: "传统"
  954. }
  955. ],
  956. searchDealerList: [
  957. {
  958. value: null,
  959. label: "全部"
  960. },
  961. {
  962. value: 1,
  963. label: "V2"
  964. }
  965. ],
  966. searchStatusList: [
  967. {
  968. value: null,
  969. label: "全部"
  970. },
  971. {
  972. value: 1,
  973. label: "可用"
  974. },
  975. {
  976. value: 2,
  977. label: "禁用"
  978. }
  979. ],
  980. typeCardList: [
  981. {
  982. id: null,
  983. name: "全部"
  984. },
  985. {
  986. id: 1,
  987. name: "Payoneer"
  988. },
  989. {
  990. id: 2,
  991. name: "万事达虚拟卡"
  992. },
  993. {
  994. id: 3,
  995. name: "Visa信用卡"
  996. }
  997. ],
  998. dealerCardList: [
  999. {
  1000. id: null,
  1001. name: "全部"
  1002. },
  1003. {
  1004. id: 1,
  1005. name: "AmzKeys"
  1006. },
  1007. {
  1008. id: 2,
  1009. name: "Airwallex"
  1010. }
  1011. ],
  1012. statusCardList: [
  1013. {
  1014. id: null,
  1015. name: "全部"
  1016. },
  1017. {
  1018. id: 1,
  1019. name: "正常"
  1020. },
  1021. {
  1022. id: 2,
  1023. name: "异常"
  1024. },
  1025. {
  1026. id: 3,
  1027. name: "删除"
  1028. }
  1029. ],
  1030. addParm: {
  1031. id: null,
  1032. nickName: "",
  1033. pwd: "",
  1034. account: "",
  1035. companyId: null,
  1036. platformId: null,
  1037. vpnId: null,
  1038. vpnIp: "",
  1039. cardId: null,
  1040. cardNumber: "",
  1041. level: null,
  1042. occupyStatus: null,
  1043. addressline1: "",
  1044. country: "",
  1045. tel: "",
  1046. lastname: "",
  1047. vatNumber: "",
  1048. city: "",
  1049. addressline2: "",
  1050. firstname: "",
  1051. postalcode: "",
  1052. status: null
  1053. },
  1054. detailParm: {
  1055. id: null,
  1056. nickName: "",
  1057. pwd: "",
  1058. account: "",
  1059. companyId: null,
  1060. platformId: null,
  1061. contntryShort: "",
  1062. vpnId: null,
  1063. vpnIp: "",
  1064. cardId: null,
  1065. cardNumber: "",
  1066. level: null,
  1067. occupyStatus: null,
  1068. addressline1: "",
  1069. country: "",
  1070. state: "",
  1071. tel: "",
  1072. lastname: "",
  1073. vatNumber: "",
  1074. city: "",
  1075. addressline2: "",
  1076. firstname: "",
  1077. postalcode: "",
  1078. status: null
  1079. },
  1080. editParm: {
  1081. id: null,
  1082. nickName: "",
  1083. pwd: "",
  1084. account: "",
  1085. companyId: null,
  1086. platformId: null,
  1087. contntryShort: "",
  1088. vpnId: null,
  1089. vpnIp: "",
  1090. cardId: null,
  1091. cardNumber: "",
  1092. level: null,
  1093. occupyStatus: null,
  1094. addressline1: "",
  1095. country: "",
  1096. state: "",
  1097. tel: "",
  1098. lastname: "",
  1099. vatNumber: "",
  1100. city: "",
  1101. addressline2: "",
  1102. firstname: "",
  1103. postalcode: "",
  1104. status: null
  1105. },
  1106. rules: {
  1107. pwd: [{ required: true, message: "请输入密码", trigger: "blur" }],
  1108. nickName: [{ required: true, message: "请输入昵称", trigger: "blur" }],
  1109. account: [{ required: true, message: "请输入账号", trigger: "blur" }],
  1110. companyId: [{ required: true, message: "请选择公司", trigger: "blur" }],
  1111. platformId: [
  1112. { required: true, message: "请选择平台", trigger: "blur" }
  1113. ],
  1114. contntryShort: [
  1115. { required: true, message: "请输入所属国家", trigger: "blur" }
  1116. ],
  1117. vpnIp: [{ required: true, message: "请选择VPN地址", trigger: "blur" }],
  1118. // cardNumber: [
  1119. // { required: true, message: "请选择信用卡号", trigger: "blur" }
  1120. // ],
  1121. level: [{ required: true, message: "请选择用户等级", trigger: "blur" }],
  1122. occupyStatus: [
  1123. { required: true, message: "请选择占用状态", trigger: "blur" }
  1124. ],
  1125. status: [{ required: true, message: "请选择状态", trigger: "blur" }],
  1126. addressline1: [
  1127. { required: true, message: "请输入地址1", trigger: "blur" }
  1128. ],
  1129. country: [{ required: true, message: "请输入国家", trigger: "blur" }],
  1130. state: [{ required: true, message: "请输入州", trigger: "blur" }],
  1131. tel: [{ required: true, message: "请输入电话", trigger: "blur" }],
  1132. lastname: [
  1133. { required: true, message: "请输入lastname", trigger: "blur" }
  1134. ],
  1135. city: [{ required: true, message: "请输入城市", trigger: "blur" }],
  1136. firstname: [
  1137. { required: true, message: "请输入firstname", trigger: "blur" }
  1138. ],
  1139. postalcode: [
  1140. { required: true, message: "请输入邮政编码", trigger: "blur" }
  1141. ]
  1142. }
  1143. };
  1144. },
  1145. // 调用
  1146. created() {
  1147. this.goSearch();
  1148. },
  1149. //方法
  1150. methods: {
  1151. resetForm() {
  1152. this.searchParm.account = null;
  1153. this.searchParm.pwd = null;
  1154. this.searchParm.nickName = null;
  1155. this.searchParm.companyId = null;
  1156. this.searchParm.platformId = null;
  1157. this.goSearch();
  1158. },
  1159. //重置vpn列表
  1160. resetVpnForm() {
  1161. this.searchVpnParm.contntryShort = null;
  1162. this.searchVpnParm.ipAddress = null;
  1163. this.searchVpnParm.parentIpAddress = null;
  1164. this.searchVpnParm.port = null;
  1165. this.searchVpnParm.name = null;
  1166. this.searchVpnParm.pwd = null;
  1167. this.searchVpnParm.vpsType = null;
  1168. this.searchVpnParm.dealer = null;
  1169. this.searchVpnParm.mac = null;
  1170. this.searchVpnParm.status = null;
  1171. this.goSearchVpn();
  1172. },
  1173. //重置
  1174. resetCardForm() {
  1175. this.searchCardParm.cardDealer = null;
  1176. this.searchCardParm.cardDealer = "";
  1177. this.searchCardParm.type = "";
  1178. this.searchCardParm.status = "";
  1179. this.searchCardParm.holderName = null;
  1180. this.searchCardParm.number = null;
  1181. this.searchCardParm.pinNumber = null;
  1182. this.goSearchCard();
  1183. },
  1184. // 查询
  1185. goSearch() {
  1186. this.searchParm.page = 1;
  1187. this.getCompanyAll();
  1188. this.getDataList();
  1189. },
  1190. goSearchVpn() {
  1191. this.dialogVpnVisible = true;
  1192. this.searchVpnParm.page = 1;
  1193. this.handleType = 1;
  1194. this.getVpnDataList();
  1195. },
  1196. goSearchCard() {
  1197. this.dialogCardVisible = true;
  1198. this.searchCardParm.page = 1;
  1199. this.handleType = 2;
  1200. this.getCardDataList();
  1201. },
  1202. // 获取所有公司信息
  1203. getCompanyAll() {
  1204. getAll()
  1205. .then(res => {
  1206. this.companys = res.data;
  1207. if (res.code == 200) {
  1208. console.log(this.companys);
  1209. }
  1210. })
  1211. .catch(() => {});
  1212. },
  1213. // 导入
  1214. importBtn() {
  1215. this.dialogImportVisible = true;
  1216. },
  1217. //导入成功
  1218. uploadSuccess(res, file) {
  1219. this.dialogImportVisible = false;
  1220. if (res.code == 200) {
  1221. console.log("SHDJSHDJSHDJSHDJSH" + res.data);
  1222. if (res.data == true) {
  1223. this.$message.success("导入成功!");
  1224. } else {
  1225. window.location.href = res.data;
  1226. this.$message.error("导入失败!");
  1227. }
  1228. }
  1229. this.goSearch();
  1230. },
  1231. //excel模板导出
  1232. exportTempBtn() {
  1233. console.log(this.tempUrl);
  1234. window.location.href = this.tempUrl;
  1235. },
  1236. beforeAvatarUpload(file) {
  1237. console.log("uploadFileUrl=" + this.uploadFileUrl);
  1238. console.log(file);
  1239. const isLt10M = file.size / 1024 / 1024 < 10;
  1240. if (!isLt10M) {
  1241. this.$message.error("上传Excel文件大小不能超过 10MB!");
  1242. }
  1243. return isLt10M;
  1244. },
  1245. // 新增
  1246. addBtn() {
  1247. this.addParm = {
  1248. id: null,
  1249. nickName: "",
  1250. pwd: "",
  1251. account: "",
  1252. companyId: null,
  1253. platformId: null,
  1254. platformName: "",
  1255. vpnId: null,
  1256. cardId: null,
  1257. level: null,
  1258. occupyStatus: null,
  1259. addressline1: "",
  1260. country: "",
  1261. tel: "",
  1262. lastname: "",
  1263. vatNumber: "",
  1264. city: "",
  1265. addressline2: "",
  1266. firstname: "",
  1267. postalcode: "",
  1268. status: null
  1269. };
  1270. this.addDialog = true;
  1271. this.dialogAddTitle = "新增";
  1272. this.dialogAddVisible = true;
  1273. // this.$refs.addParm.clearValidate();
  1274. },
  1275. // 根据id删除
  1276. delById(id) {
  1277. this.$confirm("确认删除?", "提示", {
  1278. confirmButtonText: "确定",
  1279. cancelButtonText: "取消",
  1280. type: "warning"
  1281. })
  1282. .then(() => {
  1283. delById({ id })
  1284. .then(res => {
  1285. if (res.code == 200) {
  1286. this.$message.success("删除成功!");
  1287. this.getDataList();
  1288. }
  1289. })
  1290. .catch(err => {
  1291. console.log(err);
  1292. });
  1293. })
  1294. .catch(() => {
  1295. this.$message.info("取消删除");
  1296. });
  1297. },
  1298. // 修改
  1299. editById(data) {
  1300. getById({ id: data.id })
  1301. .then(res => {
  1302. if (res.code == 200) {
  1303. this.editParm.id = res.data.id;
  1304. this.editParm.nickName = res.data.nickName;
  1305. this.editParm.pwd = res.data.pwd;
  1306. this.editParm.account = res.data.account;
  1307. this.editParm.companyId = res.data.companyId;
  1308. this.editParm.platformId = res.data.platformId;
  1309. this.editParm.contntryShort = res.data.contntryShort;
  1310. this.editParm.vpnId = res.data.vpnId;
  1311. this.editParm.vpnIp = res.data.ipAddress;
  1312. this.editParm.cardId = res.data.cardId;
  1313. this.editParm.cardNumber = data.number;
  1314. this.editParm.level = res.data.level;
  1315. this.editParm.occupyStatus = res.data.occupyStatus;
  1316. this.editParm.addressline1 = res.data.addressline1;
  1317. this.editParm.country = res.data.country;
  1318. this.editParm.state = res.data.state;
  1319. this.editParm.tel = res.data.tel;
  1320. this.editParm.lastname = res.data.lastname;
  1321. this.editParm.vatNumber = res.data.vatNumber;
  1322. this.editParm.city = res.data.city;
  1323. this.editParm.addressline2 = res.data.addressline2;
  1324. this.editParm.firstname = res.data.firstname;
  1325. this.editParm.postalcode = res.data.postalcode;
  1326. this.editParm.status = res.data.status;
  1327. this.addDialog = false;
  1328. this.dialogEditVisible = true;
  1329. this.$refs.editParm.clearValidate();
  1330. }
  1331. })
  1332. .catch(err => {
  1333. console.log(err);
  1334. });
  1335. },
  1336. // 确认修改
  1337. sureEdit(editParm) {
  1338. this.$refs[editParm].validate((valid) => {
  1339. if (valid) {
  1340. this.$refs.editParm.clearValidate();
  1341. editById(this.editParm)
  1342. .then(res => {
  1343. if (res.code == 200) {
  1344. this.dialogEditVisible = false;
  1345. this.$message.success("修改成功!");
  1346. this.getDataList();
  1347. }
  1348. })
  1349. .catch(err => {
  1350. console.log(err);
  1351. });
  1352. } else {
  1353. console.log('error submit!!');
  1354. return false;
  1355. }
  1356. });
  1357. },
  1358. sureEditCancle(editParm) {
  1359. this.dialogEditVisible=flase
  1360. this.$refs.editParm.clearValidate();
  1361. },
  1362. // 确认新增
  1363. sureAdd(addParm) {
  1364. this.$refs[addParm].validate((valid) => {
  1365. if (valid) {
  1366. this.$refs.addParm.clearValidate();
  1367. add(this.addParm)
  1368. .then(res => {
  1369. if (res.code == 200) {
  1370. console.log(this.addParm);
  1371. this.dialogAddVisible = false;
  1372. this.$message.success("新增成功!");
  1373. this.getDataList();
  1374. }
  1375. })
  1376. .catch(err => {
  1377. console.log(err);
  1378. });
  1379. } else {
  1380. console.log('error submit!!');
  1381. return false;
  1382. }
  1383. });
  1384. },
  1385. sureAddCancle(addParm) {
  1386. this.dialogAddVisible=flase
  1387. this.$refs.addParm.clearValidate();
  1388. },
  1389. // 查看根据id
  1390. getBtnById(id) {
  1391. getById({ id })
  1392. .then(res => {
  1393. if (res.code == 200) {
  1394. this.detailParm.id = res.data.id;
  1395. this.detailParm.nickName = res.data.nickName;
  1396. this.detailParm.pwd = res.data.pwd;
  1397. this.detailParm.account = res.data.account;
  1398. this.detailParm.companyId = res.data.companyId;
  1399. this.detailParm.platformId = res.data.platformId;
  1400. this.detailParm.contntryShort = res.data.contntryShort;
  1401. this.detailParm.vpnId = res.data.vpnId;
  1402. this.detailParm.vpnIp = res.data.ipAddress;
  1403. this.detailParm.cardNumber = res.data.number;
  1404. this.detailParm.cardId = res.data.cardId;
  1405. this.detailParm.level = res.data.level;
  1406. this.detailParm.occupyStatus = res.data.occupyStatus;
  1407. this.detailParm.occupyAccount = res.data.occupyAccount;
  1408. this.detailParm.balance = res.data.balance;
  1409. this.detailParm.buyTotalMoney = res.data.buyTotalMoney;
  1410. this.detailParm.addressline1 = res.data.addressline1;
  1411. this.detailParm.country = res.data.country;
  1412. this.detailParm.state = res.data.state;
  1413. this.detailParm.tel = res.data.tel;
  1414. this.detailParm.lastname = res.data.lastname;
  1415. this.detailParm.vatNumber = res.data.vatNumber;
  1416. this.detailParm.city = res.data.city;
  1417. this.detailParm.addressline2 = res.data.addressline2;
  1418. this.detailParm.firstname = res.data.firstname;
  1419. this.detailParm.postalcode = res.data.postalcode;
  1420. this.detailParm.status = res.data.status;
  1421. this.dialogDetailVisible = true;
  1422. }
  1423. })
  1424. .catch(err => {
  1425. console.log(err);
  1426. });
  1427. },
  1428. getVpnIpById(data) {
  1429. if (this.addDialog == true) {
  1430. this.addParm.vpnIp = data.ipAddress;
  1431. this.addParm.vpnId = data.id;
  1432. } else {
  1433. this.editParm.vpnIp = data.ipAddress;
  1434. this.editParm.vpnId = data.id;
  1435. }
  1436. console.log(this.addParm.vpnId);
  1437. this.dialogVpnVisible = false;
  1438. this.$message.success("选择成功");
  1439. },
  1440. getCardById(data) {
  1441. if (this.addDialog == true) {
  1442. this.addParm.cardNumber = data.number;
  1443. this.addParm.cardId = data.id;
  1444. } else {
  1445. this.editParm.cardNumber = data.number;
  1446. this.editParm.cardId = data.id;
  1447. }
  1448. this.dialogCardVisible = false;
  1449. this.$message.success("选择成功");
  1450. },
  1451. // 分页获取表格数据
  1452. getDataList() {
  1453. getList(this.searchParm)
  1454. .then(res => {
  1455. if (res.code == 200) {
  1456. this.list = res.data.list;
  1457. this.total = res.data.total;
  1458. }
  1459. })
  1460. .catch(err => {
  1461. console.log(err);
  1462. });
  1463. },
  1464. //获取vpn信息
  1465. getVpnDataList() {
  1466. getVpnList(this.searchVpnParm)
  1467. .then(res => {
  1468. if (res.code == 200) {
  1469. this.vpnList = res.data.list;
  1470. this.vpnTotal = res.data.total;
  1471. }
  1472. })
  1473. .catch(err => {
  1474. console.log(err);
  1475. });
  1476. },
  1477. //获取信用卡信息
  1478. getCardDataList() {
  1479. getCardList(this.searchCardParm)
  1480. .then(res => {
  1481. if (res.code == 200) {
  1482. this.cardList = res.data.list;
  1483. this.cardTotal = res.data.total;
  1484. }
  1485. })
  1486. .catch(err => {
  1487. console.log(err);
  1488. });
  1489. },
  1490. // 分页
  1491. handleSizeChange(val) {
  1492. console.log(`每页 ${val} 条`);
  1493. if (this.handleType == 0) {
  1494. this.searchParm.pageSize = val;
  1495. this.getDataList();
  1496. } else if (this.handleType == 1) {
  1497. this.searchVpnParm.pageSize = val;
  1498. this.getVpnDataList();
  1499. } else if (this.handleType == 2) {
  1500. this.searchCardParm.pageSize = val;
  1501. this.getCardDataList();
  1502. }
  1503. },
  1504. handleCurrentChange(val) {
  1505. console.log(`当前页: ${val}`);
  1506. if (this.handleType == 0) {
  1507. this.searchParm.page = val;
  1508. this.getDataList();
  1509. } else if (this.handleType == 1) {
  1510. this.searchVpnParm.page = val;
  1511. this.getVpnDataList();
  1512. } else if (this.handleType == 2) {
  1513. this.searchCardParm.page = val;
  1514. this.getCardDataList();
  1515. }
  1516. }
  1517. }
  1518. };
  1519. </script>
  1520. <style rel="stylesheet/scss" lang="scss" scoped>
  1521. </style>