Rap 原分销系统代码Web
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

4e9268a21122b778486fb806adb1524876a49152.svn-base 27KB

5 ay önce
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841
  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.buyerName" clearable placeholder="账号"></el-input>
  12. </el-form-item>
  13. <el-form-item label="订单号">
  14. <el-input v-model.trim="searchParm.orderId" clearable></el-input>
  15. </el-form-item>
  16. <el-form-item label="状态">
  17. <el-select v-model.trim="searchParm.status" placeholder="请选择">
  18. <el-option
  19. v-for="item in statusList"
  20. :key="item.name"
  21. :label="item.name"
  22. :value="item.id"
  23. ></el-option>
  24. </el-select>
  25. </el-form-item>
  26. <el-form-item>
  27. <el-button type="primary" @click="goSearch">搜索</el-button>
  28. <el-button type="warning" @click="resetForm">重置</el-button>
  29. </el-form-item>
  30. </el-form>
  31. <!--表格渲染-->
  32. <el-table
  33. ref="table"
  34. border
  35. size="small"
  36. :data="list"
  37. :header-cell-style="{textAlign:'center'}"
  38. >
  39. <el-table-column label="序号" type="index" width="50" align="center" />
  40. <el-table-column label="买家账号" prop="buyerName" align="center" />
  41. <el-table-column label="订单ID" prop="orderId" align="center" />
  42. <el-table-column label="状态" prop="status" align="center">
  43. <template slot-scope="scope">{{ scope.row.status | getStatus}}</template>
  44. </el-table-column>
  45. <el-table-column label="创建时间" prop="createdAt" align="center" />
  46. <el-table-column label="修改时间" prop="updatedAt" align="center" />
  47. <el-table-column label="操作" width="270" align="left">
  48. <template slot-scope="scope">
  49. <el-button type="info" @click="getBtnById(scope.row.id)">查看</el-button>
  50. <el-button type="danger" @click="delById(scope.row.id)">删除</el-button>
  51. </template>
  52. </el-table-column>
  53. </el-table>
  54. <!--分页-->
  55. <div class="mt_15">
  56. <el-pagination
  57. @size-change="handleSizeChange"
  58. @current-change="handleCurrentChange"
  59. :current-page="searchParm.page"
  60. :page-sizes="[10, 20, 30, 40, 50]"
  61. :page-size="searchParm.pageSize"
  62. layout="total, sizes, prev, pager, next, jumper"
  63. :total="total"
  64. ></el-pagination>
  65. </div>
  66. <!--新增弹窗-->
  67. <el-dialog :visible.sync="dialogAddVisible" :title="dialogAddTitle" center width="45%">
  68. <div class="dialog-content">
  69. <el-form ref="addParm" size="small" :model="addParm" :rules="rules" label-width="100px">
  70. <el-form-item label="买家账号" prop="buyerName">
  71. <el-input v-model.trim="addParm.buyerName" disabled="true" clearable style="width:270px"></el-input>
  72. <el-button
  73. type="primary"
  74. icon="el-icon-search"
  75. @click="goSearchBuyer"
  76. style="width:130px"
  77. >请选择买家</el-button>
  78. </el-form-item>
  79. <el-form-item label="订单ID" prop="buyerId" hiddle>
  80. <el-input v-model.trim="addParm.buyerId" clearable></el-input>
  81. </el-form-item>
  82. </el-form>
  83. </div>
  84. <span slot="footer">
  85. <el-button type="info" @click="sureAddCancle('addParm')">取消</el-button>
  86. <el-button type="primary" @click="sureAdd('addParm')">确认</el-button>
  87. </span>
  88. </el-dialog>
  89. <!--导入 importBtn-->
  90. <el-dialog :visible.sync="dialogImportVisible" :title="dialogImportTitle" center width="22%">
  91. <div class="dialog-content">
  92. <el-upload
  93. class="upload-demo"
  94. drag
  95. ref="upload"
  96. :action="uploadFileUrl"
  97. :headers="uploadHeaders"
  98. :show-file-list="false"
  99. :on-success="uploadSuccess"
  100. :before-upload="beforeAvatarUpload"
  101. multiple
  102. >
  103. <i class="el-icon-upload"></i>
  104. <div class="el-upload__text">
  105. 将文件拖到此处,或
  106. <em>点击上传</em>
  107. </div>
  108. <div class="el-upload__tip" slot="tip">只能上传xlsl文件,且不超过10M</div>
  109. </el-upload>
  110. </div>
  111. </el-dialog>
  112. <!--详情弹窗-->
  113. <el-dialog :visible.sync="dialogDetailVisible" :title="dialogDetailTitle" center width="45%">
  114. <div class="dialog-content">
  115. <el-form ref="form" size="small" label-width="100px">
  116. <el-form-item label="买家账号" prop="buyerName">
  117. <el-input v-model.trim="detailParm.buyerName" :disabled="true"></el-input>
  118. </el-form-item>
  119. <el-form-item label="订单ID" prop="orderId">
  120. <el-input v-model.trim="detailParm.orderId" :disabled="true"></el-input>
  121. </el-form-item>
  122. <el-form-item label="状态" disabled prop="status">
  123. <el-select v-model.trim="detailParm.status" disabled placeholder="请选择">
  124. <el-option
  125. v-for="item in addStatusList"
  126. :key="item.name"
  127. :label="item.name"
  128. :value="item.id"
  129. ></el-option>
  130. </el-select>
  131. </el-form-item>
  132. </el-form>
  133. </div>
  134. </el-dialog>
  135. <!-- 买家弹窗 -->
  136. <el-dialog :visible.sync="dialogBuyerVisible" :title="dialogBuyerTitle" center width="75%">
  137. <div class="dialog-content">
  138. <!--搜索-->
  139. <el-form class="mt_15" ref="form" inline size="small">
  140. <el-form-item label="账号">
  141. <el-input v-model.trim="searchBuyerParm.account" clearable placeholder="账号"></el-input>
  142. </el-form-item>
  143. <el-form-item label="昵称">
  144. <el-input v-model.trim="searchBuyerParm.nickName" clearable></el-input>
  145. </el-form-item>
  146. <el-form-item label="密码">
  147. <el-input v-model.trim="searchBuyerParm.pwd" clearable></el-input>
  148. </el-form-item>
  149. <el-form-item label="公司">
  150. <el-select v-model.trim="searchBuyerParm.companyId" placeholder="请选择">
  151. <el-option
  152. v-for="item in companys"
  153. :key="item.name"
  154. :label="item.name"
  155. :value="item.id"
  156. ></el-option>
  157. </el-select>
  158. </el-form-item>
  159. <el-form-item label="平台">
  160. <el-select v-model.trim="searchBuyerParm.platformId" placeholder="请选择">
  161. <el-option
  162. v-for="item in platformList"
  163. :key="item.id"
  164. :label="item.name"
  165. :value="item.id"
  166. ></el-option>
  167. </el-select>
  168. </el-form-item>
  169. <el-form-item>
  170. <el-button type="primary" @click="goSearchBuyer">搜索</el-button>
  171. <el-button type="warning" @click="resetBuyerForm">重置</el-button>
  172. </el-form-item>
  173. </el-form>
  174. <!--表格渲染-->
  175. <el-table
  176. ref="table"
  177. border
  178. size="small"
  179. :data="buyerList"
  180. :header-cell-style="{textAlign:'center'}"
  181. :cell-style="{textAlign:'center'}"
  182. >
  183. <el-table-column label="序号" type="index" width="50" />
  184. <el-table-column label="账号" prop="account" />
  185. <el-table-column label="昵称" prop="nickName" />
  186. <el-table-column label="密码" prop="pwd" />
  187. <el-table-column label="公司" prop="companyName" />
  188. <el-table-column label="平台" prop="platformName" />
  189. <el-table-column label="VPNIP" prop="ipAddress" />
  190. <el-table-column label="信用卡卡号" prop="number" />
  191. <el-table-column label="州" prop="state" />
  192. <el-table-column label="国家" prop="country" />
  193. <el-table-column label="地址1" prop="addressline1" />
  194. <el-table-column label="状态" prop="status">
  195. <template slot-scope="scope">{{ scope.row.status | getStatus}}</template>
  196. </el-table-column>
  197. <el-table-column label="创建时间" prop="createdAt" />
  198. <el-table-column label="修改时间" prop="updatedAt" />
  199. <el-table-column label="操作" width="220">
  200. <template slot-scope="scope">
  201. <el-button type="info" @click="getBuyerBtnById(scope.row.id)">查看</el-button>
  202. <el-button type="success" @click="getBuyerById(scope.row)">选中</el-button>
  203. </template>
  204. </el-table-column>
  205. </el-table>
  206. <!--分页-->
  207. <div class="mt_15">
  208. <el-pagination
  209. @size-change="handleSizeChange"
  210. @current-change="handleCurrentChange"
  211. :current-page="searchBuyerParm.page"
  212. :page-sizes="[10, 20, 30, 40, 50]"
  213. :page-size="searchBuyerParm.pageSize"
  214. layout="total, sizes, prev, pager, next, jumper"
  215. :total="searchTotal"
  216. ></el-pagination>
  217. </div>
  218. </div>
  219. </el-dialog>
  220. <!--详情弹窗-->
  221. <el-dialog :visible.sync="dialogBuyerDetailVisible" :title="dialogBuyerDetailTitle" center width="45%">
  222. <div class="dialog-content">
  223. <el-form ref="form" size="small" label-width="120px">
  224. <el-form-item label="账号" prop="account">
  225. <el-input v-model.trim="detailBuyerParm.account" :disabled="true"></el-input>
  226. </el-form-item>
  227. <el-form-item label="昵称" prop="nickName">
  228. <el-input v-model.trim="detailBuyerParm.nickName" :disabled="true"></el-input>
  229. </el-form-item>
  230. <el-form-item label="密码" prop="pwd">
  231. <el-input v-model.trim="detailBuyerParm.pwd" :disabled="true"></el-input>
  232. </el-form-item>
  233. <el-form-item label="公司" prop="companyId">
  234. <el-select v-model.trim="detailBuyerParm.companyId" disabled placeholder="请选择">
  235. <el-option
  236. v-for="item in companys"
  237. :key="item.name"
  238. :label="item.name"
  239. :value="item.id"
  240. ></el-option>
  241. </el-select>
  242. </el-form-item>
  243. <el-form-item label="平台" prop="platformId">
  244. <el-select v-model.trim="detailBuyerParm.platformId" disabled placeholder="请选择">
  245. <el-option
  246. v-for="item in platformList"
  247. :key="item.name"
  248. :label="item.name"
  249. :value="item.id"
  250. ></el-option>
  251. </el-select>
  252. </el-form-item>
  253. <!--国家-->
  254. <el-form-item label="国家" prop="contntryShort">
  255. <el-input v-model.trim="detailBuyerParm.contntryShort" disabled clearable></el-input>
  256. </el-form-item>
  257. <!--VPN vpnId -->
  258. <el-form-item label="VPNIP" prop="vpnIp">
  259. <el-input v-model.trim="detailBuyerParm.vpnIp" disabled clearable></el-input>
  260. </el-form-item>
  261. <!--信用卡ID cardId -->
  262. <el-form-item label="信用卡卡号" prop="cardNumber">
  263. <el-input v-model.trim="detailBuyerParm.cardNumber" disabled clearable></el-input>
  264. </el-form-item>
  265. <!--用户等级 level -->
  266. <el-form-item label="用户等级" prop="level">
  267. <el-select v-model.trim="detailBuyerParm.level" disabled placeholder="请选择">
  268. <el-option
  269. v-for="item in levelList"
  270. :key="item.name"
  271. :label="item.name"
  272. :value="item.id"
  273. ></el-option>
  274. </el-select>
  275. </el-form-item>
  276. <!--占用状态 occupyStatus -->
  277. <el-form-item label="占用状态" prop="occupyStatus">
  278. <el-select v-model.trim="detailBuyerParm.occupyStatus" disabled placeholder="请选择">
  279. <el-option
  280. v-for="item in occupyStatusList"
  281. :key="item.name"
  282. :label="item.name"
  283. :value="item.id"
  284. ></el-option>
  285. </el-select>
  286. </el-form-item>
  287. <!--状态 status -->
  288. <el-form-item label="状态" prop="status">
  289. <el-select v-model.trim="detailBuyerParm.status" disabled placeholder="请选择">
  290. <el-option
  291. v-for="item in statusList"
  292. :key="item.name"
  293. :label="item.name"
  294. :value="item.id"
  295. ></el-option>
  296. </el-select>
  297. </el-form-item>
  298. <!--占用账户-->
  299. <el-form-item label="占用账户" prop="occupyAccount">
  300. <el-input v-model.trim="detailBuyerParm.occupyAccount" :disabled="true" clearable></el-input>
  301. </el-form-item>
  302. <!--账户余额-->
  303. <el-form-item label="账户余额" prop="balance">
  304. <el-input v-model.trim="detailBuyerParm.balance" :disabled="true" clearable></el-input>
  305. </el-form-item>
  306. <!--购买总金额-->
  307. <el-form-item label="账户购买总金额" prop="buyTotalMoney">
  308. <el-input v-model.trim="detailBuyerParm.buyTotalMoney" :disabled="true" clearable></el-input>
  309. </el-form-item>
  310. <!--地址1-->
  311. <el-form-item label="地址1" prop="addressline1">
  312. <el-input v-model.trim="detailBuyerParm.addressline1" :disabled="true" clearable></el-input>
  313. </el-form-item>
  314. <!--国家-->
  315. <el-form-item label="国家" prop="country">
  316. <el-input v-model.trim="detailBuyerParm.country" :disabled="true" clearable></el-input>
  317. </el-form-item>
  318. <!--州-->
  319. <el-form-item label="州" prop="state">
  320. <el-input v-model.trim="detailBuyerParm.state" :disabled="true" clearable></el-input>
  321. </el-form-item>
  322. <!--电话-->
  323. <el-form-item label="电话" prop="tel">
  324. <el-input v-model.trim="detailBuyerParm.tel" :disabled="true" clearable></el-input>
  325. </el-form-item>
  326. <!--lastname-->
  327. <el-form-item label="lastname" prop="lastname">
  328. <el-input v-model.trim="detailBuyerParm.lastname" :disabled="true" clearable></el-input>
  329. </el-form-item>
  330. <!--税号-->
  331. <el-form-item label="税号" prop="vatNumber">
  332. <el-input v-model.trim="detailBuyerParm.vatNumber" :disabled="true" clearable></el-input>
  333. </el-form-item>
  334. <!--城市-->
  335. <el-form-item label="城市" prop="city">
  336. <el-input v-model.trim="detailBuyerParm.city" :disabled="true" clearable></el-input>
  337. </el-form-item>
  338. <!--地址2-->
  339. <el-form-item label="地址2" prop="addressline2">
  340. <el-input v-model.trim="detailBuyerParm.addressline2" :disabled="true" clearable></el-input>
  341. </el-form-item>
  342. <!--firstname-->
  343. <el-form-item label="firstname" prop="firstname">
  344. <el-input v-model.trim="detailBuyerParm.firstname" :disabled="true" clearable></el-input>
  345. </el-form-item>
  346. <!--邮政编码-->
  347. <el-form-item label="邮政编码" prop="postalcode">
  348. <el-input v-model.trim="detailBuyerParm.postalcode" :disabled="true" clearable></el-input>
  349. </el-form-item>
  350. </el-form>
  351. </div>
  352. </el-dialog>
  353. </div>
  354. </template>
  355. <script>
  356. import {
  357. add,
  358. editById,
  359. delById,
  360. abMormal,
  361. getList,
  362. getBuyerList,
  363. getById,
  364. getBuyerById,
  365. downLoadFile
  366. } from "@/api/group/dhPay";
  367. import { getAll } from "@/api/group/company";
  368. export default {
  369. filters: {
  370. getStatus: function(value) {
  371. if (value == 0) {
  372. return "待支付";
  373. } else if (value == 1) {
  374. return "支付成功";
  375. } else if (value == 2) {
  376. return "支付失败";
  377. } else {
  378. return "删除";
  379. }
  380. }
  381. },
  382. // 数据
  383. data() {
  384. return {
  385. platformList: [
  386. {
  387. id: 1,
  388. name: "敦煌"
  389. }
  390. ],
  391. searchParm: {
  392. page: 1,
  393. pageSize: 10,
  394. sort: "created_at",
  395. order: "desc",
  396. cardDealer: "",
  397. type: "",
  398. status: "",
  399. holderName: null,
  400. number: null,
  401. pinNumber: null
  402. },
  403. searchBuyerParm: {
  404. page: 1,
  405. pageSize: 10,
  406. account: null,
  407. sort: "created_at",
  408. order: "desc",
  409. nickName: null,
  410. pwd: null,
  411. companyId: null,
  412. platformId: null
  413. },
  414. total: 0,
  415. searchTotal: 0,
  416. list: [],
  417. buyerList: [],
  418. companys: [],
  419. uploadHeaders:{ Authorization: this.$store.getters.token },
  420. dialogAddVisible: false,
  421. dialogAddTitle: "新增",
  422. dialogDetailVisible: false,
  423. dialogDetailTitle: "详情",
  424. dialogEditVisible: false,
  425. dialogEditTitle: "修改",
  426. dialogImportVisible: false,
  427. dialogImportTitle: "导入",
  428. dialogBuyerVisible: false,
  429. dialogBuyerTitle: "买家列表",
  430. dialogBuyerDetailVisible: false,
  431. dialogBuyerDetailTitle: "买家详情",
  432. uploadFileUrl: process.env.VUE_APP_BASE_API + "/api/dhPay/import",
  433. updateBoolean: false,
  434. tempUrl: process.env.VUE_APP_BASE_API + "/api/dhPay/exportTemp",
  435. addStatusList: [
  436. {
  437. id: 0,
  438. name: "待处理"
  439. },
  440. {
  441. id: 1,
  442. name: "支付成功"
  443. },
  444. {
  445. id: 2,
  446. name: "支付失败"
  447. },
  448. {
  449. id: 3,
  450. name: "删除"
  451. }
  452. ],
  453. statusList: [
  454. {
  455. id: null,
  456. name: "全部"
  457. },
  458. {
  459. id: 0,
  460. name: "待处理"
  461. },
  462. {
  463. id: 1,
  464. name: "支付成功"
  465. },
  466. {
  467. id: 2,
  468. name: "支付失败"
  469. },
  470. {
  471. id: 3,
  472. name: "删除"
  473. }
  474. ],
  475. statusList: [
  476. {
  477. id: 1,
  478. name: "待注册"
  479. },
  480. {
  481. id: 2,
  482. name: "待验证"
  483. },
  484. {
  485. id: 3,
  486. name: "待完善"
  487. },
  488. {
  489. id: 4,
  490. name: "正常"
  491. },
  492. {
  493. id: 5,
  494. name: "异常"
  495. },
  496. {
  497. id: 6,
  498. name: "可用但已用"
  499. },
  500. {
  501. id: 7,
  502. name: "删除"
  503. }
  504. ],
  505. occupyStatusList: [
  506. {
  507. id: 1,
  508. name: "已占用"
  509. },
  510. {
  511. id: 2,
  512. name: "未占用"
  513. }
  514. ],
  515. levelList: [
  516. {
  517. id: 1,
  518. name: "普通"
  519. },
  520. {
  521. id: 2,
  522. name: "精品"
  523. },
  524. {
  525. id: 3,
  526. name: "压力"
  527. },
  528. {
  529. id: 4,
  530. name: "内部账号"
  531. }
  532. ],
  533. addParm: {
  534. id: null,
  535. number: "",
  536. pinNumber: "",
  537. holderSurname: "",
  538. holderName: "",
  539. contntryShort: "",
  540. remarks: "",
  541. type: null,
  542. cardDealer: null
  543. },
  544. detailParm: {
  545. id: null,
  546. buyerName: "",
  547. orderId: "",
  548. status: null
  549. },
  550. detailBuyerParm: {
  551. id: null,
  552. nickName:'',
  553. pwd:'',
  554. account: '',
  555. companyId:null,
  556. platformId:null,
  557. contntryShort:'',
  558. vpnId:null,
  559. vpnIp:'',
  560. cardId:null,
  561. cardNumber:'',
  562. level:null,
  563. occupyStatus:null,
  564. addressline1:'',
  565. country:'',
  566. state:'',
  567. tel:'',
  568. lastname:'',
  569. vatNumber:'',
  570. city:'',
  571. addressline2:'',
  572. firstname:'',
  573. postalcode:'',
  574. status:null
  575. },
  576. rules: {
  577. buyerName: [
  578. { required: true, message: "请输入买家账号", trigger: "blur" }
  579. ],
  580. orderId: [
  581. { required: true, message: "请输入支付订单ID", trigger: "blur" }
  582. ]
  583. }
  584. };
  585. },
  586. // 调用
  587. created() {
  588. this.goSearch();
  589. this.getCompanyAll();
  590. },
  591. //方法
  592. methods: {
  593. //重置
  594. resetForm() {
  595. this.searchParm.orderId = "";
  596. this.searchParm.buyerName = "";
  597. this.searchParm.status = "";
  598. this.goSearch();
  599. },
  600. resetBuyerForm() {
  601. this.searchBuyerParm.account = null;
  602. this.searchBuyerParm.pwd = null;
  603. this.searchBuyerParm.nickName = null;
  604. this.searchBuyerParm.companyId = null;
  605. this.searchBuyerParm.platformId = null;
  606. this.goSearchBuyer();
  607. },
  608. //查询
  609. goSearch() {
  610. this.searchParm.page = 1;
  611. this.getDataList();
  612. },
  613. goSearchBuyer() {
  614. this.dialogBuyerVisible = true;
  615. this.searchBuyerParm.page = 1;
  616. this.getBuyerDataList();
  617. },
  618. beforeAvatarUpload(file) {
  619. console.log(file);
  620. // const isXlsl = file.type === 'xlsl';
  621. const isLt10M = file.size / 1024 / 1024 < 10;
  622. // if (!isXlsl) {
  623. // this.$message.error('上传头像图片只能是 xlsl 格式!');
  624. // }
  625. if (!isLt10M) {
  626. this.$message.error("上传头像图片大小不能超过 10MB!");
  627. }
  628. // return isXlsl && isLt10M;
  629. return isLt10M;
  630. },
  631. //导入成功
  632. uploadSuccess(res, file) {
  633. this.dialogImportVisible = false;
  634. console.log(res)
  635. if (res.code == 200) {
  636. if(res.data == null){
  637. console.log(res.data);
  638. this.$message.success("导入成功!");
  639. }else{
  640. this.$message.error("导入失败")
  641. console.log(res.message);
  642. //window.location.href = res.message;
  643. }
  644. }
  645. this.getDataList();
  646. },
  647. // 新增
  648. addBtn() {
  649. this.addParm = {
  650. id: null,
  651. orderId: "",
  652. buyerName: ""
  653. };
  654. this.dialogAddVisible = true;
  655. this.$refs.addParm.clearValidate();
  656. },
  657. // 导入
  658. importBtn() {
  659. this.dialogImportVisible = true;
  660. },
  661. exportTempBtn() {
  662. console.log(this.tempUrl);
  663. window.location.href = this.tempUrl;
  664. },
  665. // 根据id删除
  666. delById(id) {
  667. this.$confirm("确认删除?", "提示", {
  668. confirmButtonText: "确定",
  669. cancelButtonText: "取消",
  670. type: "warning"
  671. })
  672. .then(() => {
  673. delById({ id })
  674. .then(res => {
  675. if (res.code == 200) {
  676. this.$message.success("删除成功!");
  677. this.getDataList();
  678. }
  679. })
  680. .catch(err => {
  681. console.log(err);
  682. });
  683. })
  684. .catch(() => {
  685. this.$message.info("取消删除");
  686. });
  687. },
  688. // 确认新增
  689. sureAdd(addParm) {
  690. this.$refs[addParm].validate((valid) => {
  691. if (valid) {
  692. this.$refs.addParm.clearValidate();
  693. add(this.addParm)
  694. .then(res => {
  695. if (res.code == 200) {
  696. this.dialogAddVisible = false;
  697. this.$message.success("新增成功!");
  698. this.getDataList();
  699. }
  700. }).catch(err => {
  701. console.log(err);
  702. })
  703. } else {
  704. console.log('error submit!!');
  705. return false;
  706. }
  707. });
  708. },
  709. sureAddCancle(addParm) {
  710. this.dialogAddVisible=false
  711. this.$refs.addParm.clearValidate();
  712. },
  713. // 查看根据id
  714. getBtnById(id) {
  715. getById({ id })
  716. .then(res => {
  717. if (res.code == 200) {
  718. this.detailParm.id = res.data.id;
  719. this.detailParm.orderId = res.data.orderId;
  720. this.detailParm.buyerName = res.data.buyerName;
  721. this.detailParm.number = res.data.number;
  722. this.detailParm.pinNumber = res.data.pinNumber;
  723. this.detailParm.type = res.data.type;
  724. this.detailParm.contntryShort = res.data.contntryShort;
  725. this.detailParm.status = res.data.status;
  726. this.detailParm.cardDealer = res.data.cardDealer;
  727. this.dialogDetailVisible = true;
  728. this.$refs.ruleForm.clearValidate();
  729. }
  730. })
  731. .catch(err => {
  732. console.log(err);
  733. });
  734. },
  735. // 查看买家信息根据id
  736. getBuyerBtnById(id) {
  737. getBuyerById({ id })
  738. .then(res => {
  739. if (res.code == 200) {
  740. this.detailBuyerParm.id = res.data.id;
  741. this.detailBuyerParm.nickName = res.data.nickName;
  742. this.detailBuyerParm.pwd = res.data.pwd;
  743. this.detailBuyerParm.account = res.data.account;
  744. this.detailBuyerParm.companyId = res.data.companyId;
  745. this.detailBuyerParm.platformId = res.data.platformId;
  746. this.detailBuyerParm.contntryShort = res.data.contntryShort;
  747. this.detailBuyerParm.vpnId = res.data.vpnId;
  748. this.detailBuyerParm.vpnIp = res.data.ipAddress;
  749. this.detailBuyerParm.cardNumber = res.data.number;
  750. this.detailBuyerParm.cardId = res.data.cardId;
  751. this.detailBuyerParm.level = res.data.level;
  752. this.detailBuyerParm.occupyStatus = res.data.occupyStatus;
  753. this.detailBuyerParm.occupyAccount = res.data.occupyAccount;
  754. this.detailBuyerParm.balance = res.data.balance;
  755. this.detailBuyerParm.buyTotalMoney = res.data.buyTotalMoney;
  756. this.detailBuyerParm.addressline1 = res.data.addressline1;
  757. this.detailBuyerParm.country = res.data.country;
  758. this.detailBuyerParm.state = res.data.state;
  759. this.detailBuyerParm.tel = res.data.tel;
  760. this.detailBuyerParm.lastname = res.data.lastname;
  761. this.detailBuyerParm.vatNumber = res.data.vatNumber;
  762. this.detailBuyerParm.city = res.data.city;
  763. this.detailBuyerParm.addressline2 = res.data.addressline2;
  764. this.detailBuyerParm.firstname = res.data.firstname;
  765. this.detailBuyerParm.postalcode = res.data.postalcode;
  766. this.detailBuyerParm.status = res.data.status;
  767. this.dialogBuyerDetailVisible = true;
  768. this.$refs.ruleForm.clearValidate();
  769. }
  770. })
  771. .catch(err => {
  772. console.log(err);
  773. });
  774. },
  775. // 分页获取表格数据
  776. getDataList() {
  777. getList(this.searchParm)
  778. .then(res => {
  779. if (res.code == 200) {
  780. this.list = res.data.list;
  781. this.total = res.data.total;
  782. }
  783. })
  784. .catch(err => {
  785. console.log(err);
  786. });
  787. },
  788. getBuyerDataList() {
  789. getBuyerList(this.searchBuyerParm)
  790. .then(res => {
  791. console.log(res);
  792. if (res.code == 200) {
  793. this.buyerList = res.data.list;
  794. this.buyerTotal = res.data.total;
  795. }
  796. })
  797. .catch(err => {
  798. console.log(err);
  799. });
  800. },
  801. getCompanyAll() {
  802. getAll()
  803. .then(res => {
  804. if (res.code == 200) {
  805. this.companys = res.data;
  806. console.log(this.companys);
  807. }
  808. })
  809. .catch(() => {});
  810. },
  811. getBuyerById(data){
  812. this.addParm.buyerName = data.account;
  813. this.dialogBuyerVisible = false;
  814. console.log(data);
  815. this.$message.success("选择成功");
  816. },
  817. // 分页
  818. handleSizeChange(val) {
  819. console.log(`每页 ${val} 条`);
  820. this.searchParm.pageSize = val;
  821. this.getDataList();
  822. },
  823. handleCurrentChange(val) {
  824. console.log(`当前页: ${val}`);
  825. this.searchParm.page = val;
  826. this.getDataList();
  827. }
  828. }
  829. };
  830. </script>
  831. <style rel="stylesheet/scss" lang="scss" scoped>
  832. </style>