account.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812
  1. <template>
  2. <div class="app-container">
  3. <div class="filter-container" style="margin: 10px 0 10px 0">
  4. <span class="textSpan">供应商名称:</span>
  5. <el-select v-model="body.supplierName" filterable clearable placeholder="请选择">
  6. <el-option
  7. v-for="item in userList"
  8. :key="item.relationId"
  9. :label="item.supplierName"
  10. :value="item.supplierName">
  11. </el-option>
  12. </el-select>
  13. <el-button class="filter-item" icon="el-icon-search" type="primary" plain @click="Search">搜索</el-button>
  14. </div>
  15. <!-- 列表 -->
  16. <el-table v-loading="loading" :data="tableData" border style="width: 100%">
  17. <el-table-column label="序号" width="60" align="center">
  18. <template slot-scope="scope">
  19. <span>{{ scope.$index + 1 }}</span>
  20. </template>
  21. </el-table-column>
  22. <el-table-column label="供应商名称" width="100" align="center" show-overflow-tooltip>
  23. <template slot-scope="scope" @click="handleLook(scope.row)">
  24. <!-- <el-button type="text" @click="handleLook(scope.row)">{{ scope.row.supplierName }}</el-button> -->
  25. <span>{{ scope.row.supplierName }}</span>
  26. </template>
  27. </el-table-column>
  28. <el-table-column label="可用余额" width="100" align="center" show-overflow-tooltip>
  29. <template slot-scope="scope">
  30. <span>{{ scope.row.balance }}</span>
  31. </template>
  32. </el-table-column>
  33. <el-table-column label="累计充值" width="110" align="center" show-overflow-tooltip>
  34. <template slot-scope="scope">
  35. <span>{{ scope.row.rechargeAmount  }}</span>
  36. </template>
  37. </el-table-column>
  38. <el-table-column label="累计消费" width="110" align="center" show-overflow-tooltip>
  39. <template slot-scope="scope">
  40. <span>{{ scope.row.consumeAmount }}</span>
  41. </template>
  42. </el-table-column>
  43. <el-table-column label="创建时间" width="170" align="center" show-overflow-tooltip>
  44. <template slot-scope="scope">
  45. <i class="el-icon-time"></i>
  46. <span>{{ scope.row.createTime }}</span>
  47. </template>
  48. </el-table-column>
  49. <el-table-column label="是否有效" width="90" align="center" show-overflow-tooltip>
  50. <template slot-scope="scope">
  51. <el-tag v-if="scope.row.isValid==0" type="danger" size="warning">无效</el-tag>
  52. <el-tag v-if="scope.row.isValid==1" size="small">有效</el-tag>
  53. </template>
  54. </el-table-column>
  55. <el-table-column label="限速" width="100" align="center" show-overflow-tooltip>
  56. <template slot-scope="scope">
  57. <span>{{ scope.row.ratio }}</span>
  58. </template>
  59. </el-table-column>
  60. <el-table-column label="操作" fixed="right" min-width="100" align="center">
  61. <template slot-scope="scope">
  62. <el-button size="small" class="classitem" type="primary" plain icon="el-icon-plus" @click="handleritemAdd(scope.row)">明细</el-button>
  63. </template>
  64. </el-table-column>
  65. </el-table>
  66. <!-- 明细 -->
  67. <el-dialog title="供应商明细" :visible.sync="detailVisible" fullscreen center>
  68. <el-form ref="detail" :model="detail" :rules="rules2" label-width="80px" size="small" label-position="right">
  69. <el-card shadow="never" >
  70. <div slot="header" class="clearfix">
  71. <span class="topClass">账户信息</span>
  72. </div>
  73. <div>
  74. <div class="flex_supplier">
  75. <div class="flex_width">
  76. <span class="flex_Name">供应商名称:</span>
  77. <span class="flex_Number">{{detail.supplierName}}</span>
  78. </div>
  79. <div>
  80. <span class="flex_Name">可用余额:</span>
  81. <span class="flex_Number">{{detail.balance}}</span>
  82. </div>
  83. </div>
  84. <div class="flex_supplier">
  85. <div class="flex_width">
  86. <span class="flex_Name"> 累计充值:</span>
  87. <span class="flex_Number">{{detail.rechargeAmount }}</span>
  88. </div>
  89. <div>
  90. <span class="flex_Name">累计消费:</span>
  91. <span class="flex_Number">{{detail.consumeAmount}}</span>
  92. </div>
  93. </div>
  94. </div>
  95. </el-card>
  96. <el-card shadow="never" >
  97. <div slot="header" class="clearfix">
  98. <span class="topClass">账户交易记录</span>
  99. </div>
  100. <div>
  101. <div class="AddButton">
  102. <el-button type="primary" plain icon="el-icon-plus" @click="handlerAdd(detail)">加款</el-button>
  103. <!-- <el-button type="danger" plain icon="el-icon-bank-card" @click="handlerAdd">信用额度调整</el-button> -->
  104. </div>
  105. <div>
  106. <el-table :data="detailTableData" stripe style="width: 100%">
  107. <el-table-column label="序号" width="60" align="center">
  108. <template slot-scope="scope">
  109. <span>{{ scope.$index + 1 }}</span>
  110. </template>
  111. </el-table-column>
  112. <el-table-column label="供应商" width="120" align="center" show-overflow-tooltip>
  113. <template slot-scope="scope">
  114. <el-button type="text" @click="hookLook(scope.row)">{{ scope.row.supplierName }}</el-button>
  115. </template>
  116. </el-table-column>
  117. <el-table-column label="加款金额" width="110" align="center" show-overflow-tooltip>
  118. <template slot-scope="scope">
  119. <span>{{ scope.row.amount / 10000 }}</span>
  120. </template>
  121. </el-table-column>
  122. <el-table-column label="出款账户" width="110" align="center" show-overflow-tooltip>
  123. <template slot-scope="scope">
  124. <span>{{ scope.row.paymentAccount }}</span>
  125. </template>
  126. </el-table-column>
  127. <el-table-column label="开户行" width="170" align="center" show-overflow-tooltip>
  128. <template slot-scope="scope">
  129. <span>{{ scope.row.bankDeposit }}</span>
  130. </template>
  131. </el-table-column>
  132. <el-table-column label="全称" align="center" show-overflow-tooltip>
  133. <template slot-scope="scope">
  134. <span>{{ scope.row.account }}</span>
  135. </template>
  136. </el-table-column>
  137. <el-table-column label="银行卡" width="190" align="center" show-overflow-tooltip>
  138. <template slot-scope="scope">
  139. <span>{{ scope.row.cardNo }}</span>
  140. </template>
  141. </el-table-column>
  142. <el-table-column label="加款人" align="center" show-overflow-tooltip>
  143. <template slot-scope="scope">
  144. <span>{{ scope.row.payer }}</span>
  145. </template>
  146. </el-table-column>
  147. <el-table-column label="凭证" width="120" align="center">
  148. <template slot-scope="scope">
  149. <el-image
  150. style="width: 100px; height: 80px"
  151. :src="scope.row.certificate"
  152. :preview-src-list="new Array(scope.row.certificate)">
  153. </el-image>
  154. </template>
  155. </el-table-column>
  156. <el-table-column label="加款时间" width="190" align="center" show-overflow-tooltip>
  157. <template slot-scope="scope">
  158. <span>{{ scope.row.time }}</span>
  159. </template>
  160. </el-table-column>
  161. <el-table-column label="操作" fixed="right" width="200" align="center">
  162. <template slot-scope="scope">
  163. <!-- <el-button size="small" type="primary" plain icon="el-icon-plus" @click="handlerAdd(scope.row)">加款</el-button> -->
  164. <el-button size="small" icon="el-icon-edit" type="warning" plain @click="handleEdit(scope.row)">修改</el-button>
  165. <el-button size="small" icon="el-icon-edit" type="danger" v-if="scope.row.undo == 0" plain @click="handleRevocation(scope.row)">撤销</el-button>
  166. </template>
  167. </el-table-column>
  168. </el-table>
  169. <div class="pagination">
  170. <el-pagination
  171. current-page.sync="info.current"
  172. :current-page="info.current"
  173. :page-sizes="[10, 20, 30, 50]"
  174. :page-size="info.size"
  175. layout="total, sizes, prev, pager, next, jumper"
  176. background
  177. :total="detailTotal"
  178. @size-change="detailHandleSizeChange"
  179. @current-change="detailHandleCurrentChange"
  180. />
  181. </div>
  182. </div>
  183. </div>
  184. </el-card>
  185. </el-form>
  186. <div slot="footer" class="dialog-footer">
  187. <el-button @click="detailVisible = false">取 消</el-button>
  188. <el-button type="primary" @click="onVisible">确 定</el-button>
  189. </div>
  190. </el-dialog>
  191. <!-- <el-table v-loading="loading" :data="tableData" border style="width: 100%">
  192. <el-table-column label="序号" width="60" align="center">
  193. <template slot-scope="scope">
  194. <span>{{ scope.$index + 1 }}</span>
  195. </template>
  196. </el-table-column>
  197. <el-table-column label="供应商" width="120" align="center" show-overflow-tooltip>
  198. <template slot-scope="scope">
  199. <el-button type="text" @click="hookLook(scope.row)">{{ scope.row.supplierName }}</el-button>
  200. </template>
  201. </el-table-column>
  202. <el-table-column label="加款金额" width="110" align="center" show-overflow-tooltip>
  203. <template slot-scope="scope">
  204. <span>{{ scope.row.amount / 10000 }}</span>
  205. </template>
  206. </el-table-column>
  207. <el-table-column label="可用余额" width="100" align="center" show-overflow-tooltip>
  208. <template slot-scope="scope">
  209. <span>{{ scope.row.balance }}</span>
  210. </template>
  211. </el-table-column>
  212. <el-table-column label="累计充值" width="110" align="center" show-overflow-tooltip>
  213. <template slot-scope="scope">
  214. <span>{{ scope.row.rechargeAmount  }}</span>
  215. </template>
  216. </el-table-column>
  217. <el-table-column label="累计消费" width="110" align="center" show-overflow-tooltip>
  218. <template slot-scope="scope">
  219. <span>{{ scope.row.consumeAmount }}</span>
  220. </template>
  221. </el-table-column>
  222. <el-table-column label="出款账户" width="110" align="center" show-overflow-tooltip>
  223. <template slot-scope="scope">
  224. <span>{{ scope.row.paymentAccount }}</span>
  225. </template>
  226. </el-table-column>
  227. <el-table-column label="开户行" width="170" align="center" show-overflow-tooltip>
  228. <template slot-scope="scope">
  229. <span>{{ scope.row.bankDeposit }}</span>
  230. </template>
  231. </el-table-column>
  232. <el-table-column label="全称" align="center" show-overflow-tooltip>
  233. <template slot-scope="scope">
  234. <span>{{ scope.row.account }}</span>
  235. </template>
  236. </el-table-column>
  237. <el-table-column label="银行卡" width="190" align="center" show-overflow-tooltip>
  238. <template slot-scope="scope">
  239. <span>{{ scope.row.cardNo }}</span>
  240. </template>
  241. </el-table-column>
  242. <el-table-column label="加款人" align="center" show-overflow-tooltip>
  243. <template slot-scope="scope">
  244. <span>{{ scope.row.payer }}</span>
  245. </template>
  246. </el-table-column>
  247. <el-table-column label="凭证" width="120" align="center">
  248. <template slot-scope="scope">
  249. <el-image
  250. style="width: 100px; height: 80px"
  251. :src="scope.row.certificate"
  252. :preview-src-list="new Array(scope.row.certificate)">
  253. </el-image>
  254. </template>
  255. </el-table-column>
  256. <el-table-column label="加款时间" width="190" align="center" show-overflow-tooltip>
  257. <template slot-scope="scope">
  258. <span>{{ scope.row.time }}</span>
  259. </template>
  260. </el-table-column>
  261. <el-table-column label="操作" fixed="right" width="300" align="center">
  262. <template slot-scope="scope">
  263. <el-button size="small" type="primary" plain icon="el-icon-plus" @click="handlerAdd(scope.row)">加款</el-button>
  264. <el-button size="small" icon="el-icon-edit" type="warning" plain @click="handleEdit(scope.row)">修改</el-button>
  265. <el-button size="small" icon="el-icon-edit" type="danger" v-if="scope.row.undo == 0" plain @click="handleRevocation(scope.row)">撤销</el-button>
  266. </template>
  267. </el-table-column>
  268. </el-table> -->
  269. <!-- 新增加款 -->
  270. <el-dialog :title="operation?'新增加款':'编辑加款'" :visible.sync="dialogFormVisible" width="55%" center>
  271. <el-form ref="dataForm" :model="dataForm" :rules="rules2" label-width="80px" size="small" label-position="right">
  272. <el-form-item label="供应商" prop="relationId" :label-width="formLabelWidth" >
  273. <el-select v-model="dataForm.relationId" :disabled="true" filterable @change="onclick(dataForm.relationId)" clearable placeholder="请选择客户" style="width:100%">
  274. <el-option
  275. v-for="item in userList"
  276. :key="item.relationId"
  277. :label="item.supplierName"
  278. :value="item.relationId">
  279. </el-option>
  280. </el-select>
  281. </el-form-item>
  282. <el-form-item label="银行卡" prop="cardNo" :label-width="formLabelWidth" >
  283. <el-select v-model="dataForm.cardNo" filterable :disabled="!operation" clearable placeholder="请选择银行卡" value-key="id" @change="changeSel" style="width:100%">
  284. <el-option
  285. v-for="item in card"
  286. :key="item.id"
  287. :label="item.cardNo"
  288. :value="item">
  289. </el-option>
  290. </el-select>
  291. </el-form-item>
  292. <!-- <el-form-item label="开户行" prop="bankDeposit" :label-width="formLabelWidth" >
  293. <el-input v-model="dataForm.bankDeposit" placeholder="请输入供应商账户" />
  294. </el-form-item> -->
  295. <el-form-item label="加款金额" prop="amount" :label-width="formLabelWidth" >
  296. <el-input v-model="dataForm.amount" :disabled="!operation" placeholder="请输入加款金额" />
  297. </el-form-item>
  298. <el-form-item label="出款账户" :label-width="formLabelWidth" >
  299. <el-input v-model="dataForm.paymentAccount" :disabled="!operation" placeholder="请输入出款账户" />
  300. </el-form-item>
  301. <!-- <el-form-item label="凭证" :label-width="formLabelWidth" >
  302. <el-input v-model="dataForm.certificate" placeholder="请输入凭证" />
  303. </el-form-item> -->
  304. <el-form-item label="凭证" prop="imgUrl" :label-width="formLabelWidth">
  305. <el-upload
  306. ref = "upload"
  307. action="#"
  308. list-type="picture-card"
  309. :on-change="handleDownload"
  310. :file-list="fileList"
  311. :limit="1"
  312. :auto-upload="false">
  313. <i slot="default" class="el-icon-plus"></i>
  314. <div slot="file" slot-scope="{file}">
  315. <img
  316. class="el-upload-list__item-thumbnail"
  317. :src="file.url" alt=""
  318. >
  319. <!-- //图片三个按钮事件 -->
  320. <span class="el-upload-list__item-actions">
  321. <span
  322. class="el-upload-list__item-preview"
  323. @click="handlePictureCardPreview(file)"
  324. >
  325. <i class="el-icon-zoom-in"></i>
  326. </span>
  327. <span
  328. class="el-upload-list__item-delete"
  329. @click="handleRemove(file)"
  330. >
  331. <i class="el-icon-delete"></i>
  332. </span>
  333. </span>
  334. </div>
  335. </el-upload>
  336. <el-dialog :visible.sync="dialogDspaly" :modal="false">
  337. <img width="100%" :src="dialogImageUrl" >
  338. </el-dialog>
  339. </el-form-item>
  340. <!-- <el-form-item label="备注" :label-width="formLabelWidth" >
  341. <el-input v-model="dataForm.distinguish" placeholder="请输入备注" />
  342. </el-form-item> -->
  343. </el-form>
  344. <div slot="footer" class="dialog-footer">
  345. <el-button @click="dialogFormVisible = false">取 消</el-button>
  346. <el-button type="primary" @click="submitForm" :loading="buttonLoading">确 定</el-button>
  347. </div>
  348. </el-dialog>
  349. <!-- 详情 -->
  350. <el-dialog title="详情" :visible.sync="dataFormVisible" width="55%" center>
  351. <el-form ref="dataForm" :model="dataForm" :rules="rules2" label-width="80px" size="small" label-position="right">
  352. <el-form-item label="供应商" prop="cardNo" :label-width="formLabelWidth" >
  353. <el-input v-model="dataForm.supplierName" disabled></el-input>
  354. </el-form-item>
  355. <el-form-item label="全称" prop="account" :label-width="formLabelWidth" >
  356. <el-input v-model="dataForm.account" placeholder="请输入" disabled/>
  357. </el-form-item>
  358. <el-form-item label="银行卡" prop="cardNo" :label-width="formLabelWidth" >
  359. <el-input v-model="dataForm.cardNo" disabled></el-input>
  360. </el-form-item>
  361. <el-form-item label="开户行" prop="bankDeposit" :label-width="formLabelWidth" >
  362. <el-input v-model="dataForm.bankDeposit" disabled placeholder="请输入供应商账户" />
  363. </el-form-item>
  364. <el-form-item label="加款金额" prop="amount" :label-width="formLabelWidth" >
  365. <el-input v-model="dataForm.amount" disabled placeholder="请输入加款金额" />
  366. </el-form-item>
  367. <el-form-item label="出款账户" :label-width="formLabelWidth" >
  368. <el-input v-model="dataForm.paymentAccount" disabled placeholder="请输入出款账户" />
  369. </el-form-item>
  370. <el-form-item label="加款人" :label-width="formLabelWidth" >
  371. <el-input v-model="dataForm.payer" disabled placeholder="加款人" />
  372. </el-form-item>
  373. <el-form-item label="凭证" prop="imgUrl" :label-width="formLabelWidth">
  374. <el-image
  375. style="width: 200px; height: 200px"
  376. :src="dataForm.certificate"
  377. :preview-src-list="new Array(dataForm.certificate)">
  378. </el-image>
  379. </el-form-item>
  380. <!-- <el-form-item label="备注" :label-width="formLabelWidth" >
  381. <el-input v-model="dataForm.distinguish" placeholder="请输入备注" />
  382. </el-form-item> -->
  383. </el-form>
  384. <div slot="footer" class="dialog-footer">
  385. <el-button @click="dataFormVisible = false">取 消</el-button>
  386. <el-button type="primary" @click="dataFormVisible = false">确 定</el-button>
  387. </div>
  388. </el-dialog>
  389. <!-- 分页 -->
  390. <div class="pagination">
  391. <el-pagination
  392. current-page.sync="body.current"
  393. :current-page="body.current"
  394. :page-sizes="[10, 20, 30, 50]"
  395. :page-size="body.size"
  396. layout="total, sizes, prev, pager, next, jumper"
  397. background
  398. :total="total"
  399. @size-change="handleSizeChange"
  400. @current-change="handleCurrentChange"
  401. />
  402. </div>
  403. </div>
  404. </template>
  405. <script>
  406. import api from '@/api/userList'
  407. import code from '@/api/channel.js'
  408. import { supplierPaymentList,channelList,supplierPaymentAdd,supplierPaymentAnnul,supplierPaymentEdit,bankcardList } from '@/api/channelAdd'
  409. export default {
  410. data() {
  411. return {
  412. loading:false,
  413. tableData:[],
  414. body:{
  415. size:10,
  416. current:1,
  417. // relationId:""
  418. },
  419. total:0,
  420. dataForm:{
  421. distinguish:1,
  422. type:"customer"
  423. },
  424. rules2:{
  425. relationId: [{ required: true, message: '请输入供应商名称', trigger: 'blur' } ],
  426. cardNo: [{ required: true, message: '请输入银行卡', trigger: 'blur' } ],
  427. amount: [{ required: true, message: '请输入加款金额', trigger: 'blur' } ],
  428. },
  429. userList:[],
  430. operation:false,
  431. dialogFormVisible:false,
  432. formLabelWidth:"120px",
  433. dialogImageUrl:"", //图片地址
  434. dialogDspaly:false,
  435. // options1: [],
  436. // value:[],
  437. imgurl:"",
  438. // packet:[],
  439. // redenvelopesVOS:[],
  440. fileList:[],
  441. url:"",
  442. urlList:[],
  443. card:[],
  444. cardNo:"",
  445. dataFormVisible:false,
  446. detailVisible:false,
  447. detail:{},
  448. detailTableData:[],
  449. info:{
  450. size:10,
  451. current:1,
  452. relationId:""
  453. },
  454. detailTotal:0,
  455. buttonLoading:false
  456. }
  457. },
  458. created(){
  459. this.user()
  460. this.reLoad()
  461. // this.bankcardURL()
  462. },
  463. methods: {
  464. //选择供应商出发银行卡
  465. onclick(row){
  466. this.bankcardURL(row)
  467. this.dataForm.account = ""
  468. this.dataForm.bankDeposit = ""
  469. this.dataForm.cardNo = ""
  470. },
  471. //银行卡
  472. bankcardURL(row){
  473. let distinguish = {
  474. distinguish:1,
  475. relationId:row
  476. }
  477. const params = new URLSearchParams()
  478. params.append('distinguish', 1)
  479. params.append('relationId', row)
  480. bankcardList(params).then((res)=>{
  481. this.card = res.data.data
  482. console.log(this.card)
  483. })
  484. },
  485. //银行卡下拉选择
  486. changeSel(row){
  487. this.dataForm.account = row.account
  488. this.dataForm.bankDeposit = row.bankDeposit
  489. this.dataForm.cardNo = row.cardNo
  490. },
  491. //名称
  492. user(){
  493. // let user = "{customerName}"
  494. channelList().then((res) => {
  495. this.loading =false
  496. let userList = res.data.data
  497. userList.map((res)=>{
  498. // let user = {
  499. // relationId:res.customerId,
  500. // customerName:res.customerName
  501. // }
  502. res.relationId = res.supplierId.toString()
  503. // res.customerName = res.supplierName
  504. delete res.supplierId
  505. // delete res.supplierName
  506. return res
  507. })
  508. this.userList = userList
  509. })
  510. },
  511. //表格数据
  512. reLoad(){
  513. this.loading = true
  514. code.Search(this.body).then((res) => {
  515. this.loading =false
  516. this.tableData = res.data.data.records
  517. this.total = res.data.data.total
  518. })
  519. // supplierPaymentList(this.body).then((res) => {
  520. // this.loading =false
  521. // this.tableData = res.data.data.records
  522. // this.total = res.data.data.total
  523. // })
  524. },
  525. //明细刷新数据
  526. onVisible(){
  527. this.reLoad()
  528. this.detailVisible = false
  529. },
  530. //查看
  531. hookLook(row){
  532. let code = JSON.parse(JSON.stringify(row))
  533. code.amount = code.amount / 10000
  534. this.dataForm = code
  535. this.dataFormVisible = true
  536. },
  537. //明细分页
  538. handlerLook(row){
  539. let info = this.info
  540. let body={
  541. size:info.size,
  542. current:info.current,
  543. relationId:row
  544. }
  545. supplierPaymentList(body).then((res) => {
  546. this.detailTableData = res.data.data.records
  547. this.detailTotal = res.data.data.total
  548. })
  549. },
  550. //明细
  551. handleritemAdd(row){
  552. this.detailVisible = true,
  553. this.detail = JSON.parse(JSON.stringify(row))
  554. this.handlerLook(row.supplierId)
  555. console.log(row)
  556. },
  557. //新增
  558. handlerAdd(row){
  559. this.operation = true // true:新增, false:编辑
  560. this.dialogFormVisible = true // 控制弹出框
  561. let list = JSON.parse(JSON.stringify(row))
  562. this.bankcardURL(list.supplierId)
  563. console.log(list)
  564. list.relationId=list.supplierId.toString()
  565. // this.dataForm = list
  566. // this.dataForm.relationId = list.supplierId
  567. this.dataForm.amount = "" //加款钱
  568. this.dataForm.certificate = "" //凭证
  569. this.dataForm.paymentAccount = "" //出款账户
  570. this.dataForm = list
  571. // this.dataForm = {}
  572. this.imgurl = ""
  573. this.fileList=[] //图片
  574. this.card = [] //银行卡
  575. this.cardNo = ""
  576. if(this.$refs['dataForm']){
  577. this.$refs['dataForm'].resetFields();
  578. }
  579. },
  580. //编辑
  581. handleEdit(row){
  582. //图片的判断
  583. if(row.certificate){
  584. let obj=new Object()
  585. obj.url=row.certificate
  586. let list=new Array()
  587. list.push(obj)
  588. this.fileList=list
  589. }else{
  590. this.fileList=[]
  591. }
  592. let code = JSON.parse(JSON.stringify(row))
  593. code.amount = code.amount / 10000
  594. this.dataForm = code
  595. console.log(row)
  596. if(this.$refs['dataForm']){
  597. this.$refs['dataForm'].resetFields();
  598. }
  599. this.operation = false
  600. this.dialogFormVisible = true
  601. },
  602. //撤销
  603. handleRevocation(row){
  604. let code = JSON.parse(JSON.stringify(row))
  605. code.undo = 1
  606. code.type = "supplier"
  607. let that = this
  608. that.$confirm('是否撤销该数据', '提示', {
  609. confirmButtonText: '确定',
  610. cancelButtonText: '取消',
  611. type: 'warning'
  612. })
  613. .then(() => {
  614. supplierPaymentAnnul(code).then((res)=>{
  615. if (res.status === 200) {
  616. that.$message({
  617. type: 'success',
  618. message: '撤销成功'
  619. })
  620. this.handlerLook(this.detail.supplierId)
  621. } else {
  622. that.$message({
  623. type: 'error',
  624. message: res.data.message
  625. })
  626. }
  627. })
  628. })
  629. },
  630. //新增和修改API
  631. submitForm(){
  632. this.dataForm.distinguish=1
  633. this.dataForm.type="supplier"
  634. // this.dataForm.undo = 0
  635. let dataForm = this.dataForm
  636. this.$refs['dataForm'].validate((valid) => {
  637. if (valid) {
  638. if (!this.operation) {
  639. this.buttonLoading = true
  640. supplierPaymentEdit(dataForm).then(response => {
  641. if (response.status === 200) {
  642. this.$message({
  643. type: 'success',
  644. message: '操作成功'
  645. })
  646. this.dialogFormVisible = false
  647. this.handlerLook(this.detail.supplierId)
  648. } else {
  649. this.$message({
  650. type: 'error',
  651. message: response.data.msg
  652. })
  653. }
  654. })
  655. .finally(() => this.buttonLoading = false)
  656. } else {
  657. console.log(this.dataForm)
  658. // // 添加
  659. this.buttonLoading = true
  660. supplierPaymentAdd(dataForm).then(response => {
  661. if (response.status === 200) {
  662. this.$message({
  663. type: 'success',
  664. message: '操作成功'
  665. })
  666. this.dialogFormVisible = false
  667. this.handlerLook(this.detail.supplierId)
  668. } else {
  669. this.$message({
  670. type: 'error',
  671. message: response.data.msg
  672. })
  673. }
  674. })
  675. .finally(() => this.buttonLoading = false)
  676. }
  677. }
  678. })
  679. },
  680. //清除图片
  681. handleRemove(file) {
  682. this.$refs.upload.clearFiles()
  683. },
  684. handlePictureCardPreview(file) {
  685. this.dialogImageUrl = file.url;
  686. console.log(file)
  687. this.dialogDspaly = true;
  688. },
  689. handleDownload(event, file, fileList) {
  690. console.log(event)
  691. console.log(file)
  692. console.log(fileList)
  693. const params = new FormData()
  694. params.append('file', event.raw)
  695. api.account.Upload(params).then((res)=>{
  696. if(res.data.status == 200){
  697. let image=res.data.data
  698. this.dataForm.certificate=image
  699. console.log(res)
  700. }else{
  701. this.$notify.error({
  702. title: '错误',
  703. message: res.data.message
  704. });
  705. }
  706. })
  707. },
  708. //搜索
  709. Search() {
  710. this.body.current = 1
  711. this.reLoad()
  712. },
  713. //页码
  714. handleSizeChange(val) {
  715. this.body.size = val
  716. this.reLoad()
  717. },
  718. //换页
  719. handleCurrentChange(val) {
  720. this.body.current = val
  721. this.reLoad()
  722. },
  723. detailHandleSizeChange(val) {
  724. this.info.size = val
  725. this.handlerLook(this.detail.supplierId)
  726. },
  727. //换页
  728. detailHandleCurrentChange(val) {
  729. this.info.current = val
  730. this.handlerLook(this.detail.supplierId)
  731. },
  732. },
  733. }
  734. </script>
  735. <style >
  736. .el-upload-list__item {
  737. transition: none !important;
  738. }
  739. .flex_supplier{
  740. width: 90%;
  741. margin: 0px auto 30px;
  742. display: flex;
  743. flex-direction: row;
  744. /* justify-content:space-evenly; */
  745. }
  746. .flex_width{
  747. width: 50%;
  748. margin-left: 160px;
  749. }
  750. .flex_Name{
  751. font-size: 15px;
  752. font-weight: 600;
  753. color:rgb(87, 86, 86)
  754. }
  755. .flex_Number{
  756. font-weight: 600;
  757. margin-right: 20px;
  758. font-weight: 500px;
  759. font-size: 20px;
  760. color:salmon
  761. }
  762. .AddButton{
  763. display: flex;
  764. justify-content:flex-end;
  765. margin-right: 50px;
  766. margin-bottom: 20px;
  767. }
  768. .el-card {
  769. border: 0px solid #e6ebf5;
  770. margin-top: 10px;
  771. }
  772. </style>