Rap 原分销系统代码Web
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1f69b37ce32a2204a43c547099722364d32d82a0.svn-base 31KB

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