移动端
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.

approvalAdd4.vue 29 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796
  1. <template>
  2. <div class="app-container">
  3. <van-nav-bar
  4. left-arrow
  5. fixed
  6. placeholder
  7. @click-left="$router.back(-1)"
  8. >
  9. <template #title>
  10. <p style="font-weight: bold;">添加虚拟转账申请</p>
  11. </template>
  12. </van-nav-bar>
  13. <van-form @submit="getChange" @failed="getError" :show-error-message="false" scroll-to-error validate-first>
  14. <p class="main_title">基础信息</p>
  15. <div class="main_box">
  16. <van-field
  17. readonly
  18. clickable
  19. required
  20. :rules="[{ required: true , message:'请选择申请时间' }]"
  21. v-model="form.applyDate"
  22. label="申请时间"
  23. placeholder="请选择申请时间"
  24. @click="showlasj = true"
  25. input-align="right"
  26. right-icon="arrow-down"
  27. />
  28. <van-popup v-model="showlasj" position="bottom">
  29. <van-datetime-picker
  30. v-model="currentDate"
  31. type="date"
  32. title="选择年月日"
  33. :min-date="minDate"
  34. :max-date="maxDate"
  35. @confirm="onConfirmLasj"
  36. />
  37. </van-popup>
  38. <van-field
  39. readonly
  40. clickable
  41. required
  42. :rules="[{ required: true , message:'请选择资金支出类别' }]"
  43. label="资金支出类别"
  44. placeholder="请选择"
  45. v-model="capitalExpenditureType"
  46. @click="showcapital = true"
  47. input-align="right"
  48. right-icon="arrow-down"
  49. label-width="auto"
  50. />
  51. <van-popup v-model="showcapital" position="bottom">
  52. <van-picker
  53. show-toolbar
  54. :columns="capitalExpenditureTypeOptions"
  55. @confirm="onConfirmCapital"
  56. @cancel="showcapital = false"
  57. />
  58. </van-popup>
  59. <van-field
  60. readonly
  61. required
  62. label="支出总金额"
  63. v-model="form.expenditureAmount"
  64. placeholder="根据下方收款金额自动核算"
  65. input-align="right"
  66. label-width="auto"
  67. />
  68. </div>
  69. <div class="main_box" style="margin-top: 10px;">
  70. <van-field
  71. label="付款事由"
  72. v-model="form.remark"
  73. type="textarea"
  74. placeholder="请输入付款事由"
  75. input-align="right"
  76. rows="3"
  77. label-width="auto"
  78. required
  79. :rules="[{ required: true , message:'请输入付款事由' }]"
  80. />
  81. </div>
  82. <div class="main_box" style="margin-top: 10px;">
  83. <van-field label="说明情况" v-model="form.explainSituation" type="textarea" placeholder="请输入说明情况" input-align="right" rows="3" label-width="auto"/>
  84. </div>
  85. <p class="main_title" v-if="capitalExpenditureOpen">关联项目</p>
  86. <div class="main_box" v-if="capitalExpenditureOpen" style="margin-bottom: 10px;margin-top: 10px;position:relative;">
  87. <van-field
  88. readonly
  89. clickable
  90. label="项目名称"
  91. placeholder="请选择"
  92. v-model="projectForm.projectName"
  93. @click="showproject = true"
  94. input-align="right"
  95. right-icon="arrow-down"
  96. required
  97. :rules="[{ required: true , message:'请选择项目名称' }]"
  98. />
  99. <van-popup v-model="showproject" position="bottom">
  100. <van-picker
  101. show-toolbar
  102. :columns="projectListShow"
  103. @confirm="onConfirmProject"
  104. @cancel="showproject = false"
  105. />
  106. </van-popup>
  107. <van-field required :rules="[{ required: true , message:'请输入承建单位' }]" v-model="projectForm.projectContractor" label="承建单位" placeholder="请输入承建单位" input-align="right" label-width="auto"/>
  108. <van-field required :rules="[{ required: true , message:'请输入合同价款' }]" v-model="projectForm.projectAmount" label="合同价款(元)" placeholder="请输入合同价款(元)" input-align="right" label-width="auto"/>
  109. <van-field
  110. readonly
  111. clickable
  112. label="工程款类型"
  113. placeholder="请选择"
  114. v-model="projectFundType"
  115. @click="showFundType = true"
  116. input-align="right"
  117. right-icon="arrow-down"
  118. required
  119. :rules="[{ required: true , message:'请选择工程款类型' }]"
  120. />
  121. <van-popup v-model="showFundType" position="bottom">
  122. <van-picker
  123. show-toolbar
  124. :columns="projectFundTypeOptions"
  125. @confirm="onConfirmFundType"
  126. @cancel="showFundType = false"
  127. />
  128. </van-popup>
  129. <van-field required :rules="[{ required: true , message:'请输入工程发票号' }]" v-model="projectForm.projectBillNum" label="工程发票号" placeholder="请输入工程发票号" input-align="right" label-width="auto"/>
  130. </div>
  131. <p class="main_title">付款方信息</p>
  132. <div class="main_box">
  133. <!-- <van-field label="付款方" v-model="form.payer" placeholder="请输入付款方" input-align="right" label-width="auto"/>-->
  134. <van-field
  135. readonly
  136. clickable
  137. label="付款方"
  138. placeholder="请选择付款方"
  139. v-model="form.payer"
  140. @click="showpayer = true"
  141. input-align="right"
  142. right-icon="arrow-down"
  143. label-width="auto"
  144. required
  145. :rules="[{ required: true , message:'请选择付款方' }]"
  146. />
  147. <van-popup v-model="showpayer" position="bottom">
  148. <van-picker
  149. show-toolbar
  150. :columns="payerOptions"
  151. @confirm="onConfirmPayer($event)"
  152. @cancel="showpayer = false"
  153. />
  154. </van-popup>
  155. <van-field :rules="[{ required: true , message:'请输入付款方账户' }]" required label="付款方账户" v-model="form.payerAccount" placeholder="请输入账户" input-align="right" label-width="auto"/>
  156. </div>
  157. <p class="main_title">收款方信息<van-button icon="plus" @click="addChargeItme(chargeItme.length)" size="mini" type="info" native-type="button" class="addFamily"/></p>
  158. <div class="main_box" style="margin-bottom: 15px;">
  159. <van-cell title="收款账户类型">
  160. <template #right-icon>
  161. <van-radio-group direction="horizontal" v-model="form.accountType" @change="accountTypeChange">
  162. <van-radio name="1">公户</van-radio>
  163. <van-radio name="2">私户</van-radio>
  164. </van-radio-group>
  165. </template>
  166. </van-cell>
  167. </div>
  168. <div :style="{position:'relative',padding: index == 0 ? '':'10px 0 0 0'}" v-for="(item, index) in chargeItme" :key="index">
  169. <van-button icon="minus" size="mini" type="danger" class="deleteFamily" native-type="button" v-if="index!=0" @click="deleteChargeItme(index)" />
  170. <div class="main_box" style="margin-bottom: 10px;position:relative;">
  171. <van-field
  172. readonly
  173. clickable
  174. label="收款方"
  175. placeholder="请选择"
  176. v-model="item.payee"
  177. @click="item.showPayee = true"
  178. input-align="right"
  179. right-icon="arrow-down"
  180. required
  181. :rules="[{ required: true , message:'请选择收款方' }]"
  182. />
  183. <van-popup v-model="item.showPayee" position="bottom">
  184. <van-picker
  185. show-toolbar
  186. :columns="payeeList"
  187. @confirm="onConfirmPayee($event,index)"
  188. @cancel="item.showPayee = false"
  189. />
  190. </van-popup>
  191. <van-field required :rules="[{ required: true , message:'请输入账户' }]" v-model="item.payeeAccount" label="收款账户" placeholder="请输入账户" input-align="right" label-width="auto"/>
  192. <van-field required :rules="[{ required: true , message:'请输入银行' }]" v-model="item.bankDeposit" label="开户银行" placeholder="请输入银行" input-align="right" label-width="auto"/>
  193. <van-field required :rules="[{ required: true , message:'请输入金额' }]" v-model="item.incomeAmount" type="number" label="收入金额" placeholder="请输入金额" input-align="right" label-width="auto" @change="moneyChange"/>
  194. <van-field
  195. readonly
  196. clickable
  197. label="所属银行"
  198. placeholder="请选择"
  199. v-model="item.bankTypeText"
  200. @click="item.showbankType = true"
  201. input-align="right"
  202. right-icon="arrow-down"
  203. required
  204. :rules="[{ required: true , message:'请选择所属银行' }]"
  205. />
  206. </div>
  207. </div>
  208. <p class="main_title">上传附件</p>
  209. <div class="main_box" style="padding: 5px 0 0 8px;">
  210. <van-uploader v-model="fileList" :after-read="beforeRead" ></van-uploader>
  211. </div>
  212. <div style="padding: 16px 0;">
  213. <van-row>
  214. <van-col span="12" align="center">
  215. <!-- @click="goUpdate"-->
  216. <van-button type="info" native-type="submit" @click="buttonType='update'" class="submitButton">保<i style="margin-right: 1em;"></i>存</van-button>
  217. </van-col>
  218. <van-col span="12" align="center">
  219. <!-- @click="goAdd"-->
  220. <van-button type="info" native-type="submit" @click="buttonType='add'" class="submitButton">保存并提交</van-button>
  221. </van-col>
  222. </van-row>
  223. <div class="clear"></div>
  224. </div>
  225. </van-form>
  226. </div>
  227. </template>
  228. <script>
  229. import { addTransfer , listPayee , updateTransfer , getProjectto , listProject , addProjectto , customSubmit , getAccount ,getQmyeFlow} from "@/api/onlineHome/bankAgriculture/paymentApproval";
  230. import {attachmentList, commonAttach, listVaccount} from "../../../../api/onlineHome/bankAgriculture/paymentApproval";
  231. import request from '@/utils/request'
  232. export default {
  233. name: "approvalAdd4",
  234. data() {
  235. return {
  236. showcapital:false,
  237. showpayee:false,
  238. showlasj:false,
  239. showbankType:false,
  240. showproject:false,
  241. showFundType:false,
  242. showpayer:false,
  243. buttonType:'a',
  244. minDate: new Date(),
  245. maxDate: new Date(2050, 10, 1),
  246. currentDate: new Date(),
  247. form:{},
  248. fileList:[],
  249. capitalExpenditureType:'',
  250. payee:'',
  251. bankType:'',
  252. wfydlxDictionaries:[],
  253. jglxDictionaries:[],
  254. sysDictionaries:[],
  255. capitalExpenditureTypeOptions:[],
  256. bankTypeDictionaries:[],
  257. projectList:[],
  258. projectFundTypeOptions:[],
  259. projectFundTypeDictionaries:[],
  260. projectListShow:[],
  261. payerOptions:[],
  262. chargeItme:[],
  263. chargeItmeShow:[],
  264. payeeList:[],
  265. // 查询参数
  266. queryParams: {
  267. transferType:"",
  268. orderByColumn: "id",
  269. isAsc: "desc",
  270. },
  271. capitalExpenditureOpen:false,
  272. projectForm:{
  273. projectId:null,
  274. projectName:null,
  275. projectContractor:null,
  276. projectAmount:null,
  277. projectBillNum:null,
  278. projectFundType:'1',
  279. outId:null,
  280. ynType:'1'
  281. },
  282. projectFundType:''
  283. };
  284. },
  285. created() {
  286. this.reset();
  287. let queryParams={
  288. pageNum: 1,
  289. pageSize: 100,
  290. }
  291. listProject(queryParams).then(response => {
  292. this.projectList = response.rows;
  293. for (var i = 0; i < response.rows.length; i++) {
  294. this.projectListShow.push({text: response.rows[i].projectName, value: response.rows[i].id});
  295. }
  296. });
  297. this.getDicts("project_fund_type").then((response) => {
  298. for (var i = 0; i < response.data.length; i++) {
  299. this.projectFundTypeOptions.push({text: response.data[i].dictLabel, value: response.data[i].dictValue});
  300. }
  301. this.projectFundTypeDictionaries = response.data;
  302. });
  303. let params1={
  304. villageAccountType:'1'
  305. }
  306. listVaccount(params1).then((response) => {
  307. this.payerOptions = response.rows;
  308. response.rows.map((res,index) => {
  309. res['payerFrom'] = '1'
  310. console.log(res)
  311. this.payerOptions[index].text = res.payee;
  312. this.payerOptions[index].value = res.id;
  313. })
  314. });
  315. this.getDictionaries();
  316. this.getFileList();
  317. },
  318. methods: {
  319. // 表单重置
  320. reset() {
  321. this.form = {
  322. id: null,
  323. upId: null,
  324. downId: null,
  325. orderId: null,
  326. cashierId: null,
  327. transferType: '4',
  328. accountType: '2',
  329. explainSituation: null,
  330. succeedAmount: null,
  331. payer: null,
  332. payerAccount: null,
  333. operatorCode: null,
  334. enterpriseCode: null,
  335. expenditureAmount: null,
  336. capitalExpenditureType: '1',
  337. remark: null,
  338. transferStatus: "0",
  339. auditStatus: "0",
  340. paymentState: "1",
  341. bankPriority: "0",
  342. clientPriority: "0"
  343. };
  344. this.processList = {}
  345. this.projectForm={
  346. projectId:null,
  347. projectName:null,
  348. projectContractor:null,
  349. projectAmount:null,
  350. projectBillNum:null,
  351. projectFundType:'1',
  352. outId:null,
  353. ynType:'1'
  354. }
  355. },
  356. getChange(){
  357. console.log(this.buttonType)
  358. if(this.buttonType == 'update'){
  359. console.log('update')
  360. this.goUpdate();
  361. }else if(this.buttonType == 'add'){
  362. console.log('add')
  363. this.goAdd();
  364. }
  365. },
  366. getDictionaries(){
  367. this.getDicts("capital_expenditure_type").then((res) => {
  368. for (var i = 0; i < res.data.length; i++) {
  369. this.capitalExpenditureTypeOptions.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  370. }
  371. });
  372. this.getDicts("bank_type").then(res => {
  373. for (var i = 0; i < res.data.length; i++) {
  374. this.bankTypeDictionaries.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  375. }
  376. });
  377. this.getPayeeList();
  378. },
  379. getError(e){
  380. console.log(e)
  381. this.$notify({ type: 'danger', message: e.errors[0].message });
  382. },
  383. addChargeItme(index){
  384. if(this.chargeItme.length>0&&this.chargeItme[this.chargeItme.length-1].payee == ''){
  385. this.$notify({ type: 'danger', message: '请勿添加多个空列表信息' });
  386. return;
  387. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].incomeAmount == ''){
  388. this.$notify({ type: 'danger', message: '请输入收入金额!' });
  389. return;
  390. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].payeeAccount == ''){
  391. this.$notify({ type: 'danger', message: '请输入收款账户!' });
  392. return;
  393. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankDeposit == ''){
  394. this.$notify({ type: 'danger', message: '请输入开户银行!' });
  395. return;
  396. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankType == ''){
  397. this.$notify({ type: 'danger', message: '请选择所属银行!' });
  398. return;
  399. }
  400. this.getDicts("bank_type").then(res => {
  401. this.chargeItme.splice(index + 1, 0, {
  402. payeeId: "", //收款方ID
  403. payee: "", //收款方
  404. payeeAccount: "", //收款账户
  405. bankDeposit: "", //开户银行
  406. incomeAmount: "", //收入金额
  407. bankType: "", //所属银行
  408. bankTypeText:'', //所属银行
  409. showPayee:false,
  410. showbankType:false
  411. });
  412. });
  413. },
  414. getPayeeList() {
  415. //普通转账
  416. this.queryParams.accountType = this.form.accountType
  417. this.queryParams.status = "0"
  418. listPayee(this.queryParams).then((response) => {
  419. this.payeeList = response.rows;
  420. response.rows.map((res,index) => {
  421. this.payeeList[index].text = res.payee;
  422. this.payeeList[index].value = res.id;
  423. })
  424. });
  425. },
  426. payeeDictLabel(datas, value) {
  427. var actions = [];
  428. Object.keys(datas).some((key) => {
  429. if (datas[key].payeeId == ('' + value)) {
  430. actions.push(datas[key].payee);
  431. return true;
  432. }
  433. })
  434. return actions.join('');
  435. },
  436. onConfirmCapital(data){
  437. if (data.value != 2){
  438. this.capitalExpenditureOpen = false;
  439. this.projectForm = [];
  440. }else{
  441. this.capitalExpenditureOpen = true;
  442. }
  443. this.capitalExpenditureType = data.text;
  444. this.form.capitalExpenditureType = data.value;
  445. this.showcapital = false;
  446. },
  447. onConfirmFundType(data){
  448. console.log(data)
  449. this.projectForm.projectFundType = data.value;
  450. this.projectFundType = data.text;
  451. this.showFundType = false;
  452. },
  453. onConfirmProject(data){
  454. this.projectList.map(res => {
  455. if(res.projectName==data.text){
  456. this.projectForm.projectId = res.id
  457. this.projectForm.projectName = res.projectName
  458. this.projectForm.projectContractor = res.projectContractor
  459. this.projectForm.projectAmount = res.projectAmount
  460. }
  461. })
  462. this.showproject = false;
  463. },
  464. onConfirmPayee(data,index){
  465. for (let i = 0 ; i < this.chargeItme.length ; i++){
  466. this.chargeItme[i].showPayee = false;
  467. }
  468. this.chargeItme[index].payee = data.text;
  469. this.chargeItme[index].payeeId = data.value;
  470. this.chargeItme[index].showpayee = false;
  471. this.payeeSelectChange(data.value , index)
  472. this.onConfirmBankType(data,index)
  473. },
  474. onConfirmBankType(data,index){
  475. console.log(this.bankTypeDictionaries)
  476. this.bankTypeDictionaries.map(res => {
  477. if(res.value==data.bankType){
  478. this.chargeItme[index].bankTypeText = res.text;
  479. this.chargeItme[index].bankType = res.value;
  480. }
  481. })
  482. },
  483. onConfirmPayer(data){
  484. this.form.payer = data.text;
  485. this.form.cashierId = data.value;
  486. this.showpayer = false;
  487. this.selectChange(data.value)
  488. },
  489. onConfirmLasj(data){
  490. this.form.applyDate = this.getNowFormatDate(data).substr(0,10);
  491. this.showlasj = false;
  492. },
  493. accountTypeChange(e){
  494. this.payeeList = [];
  495. this.queryParams.accountType = this.form.accountType
  496. this.queryParams.status = "0"
  497. listPayee(this.queryParams).then((response) => {
  498. this.payeeList = response.rows;
  499. response.rows.map((res,index) => {
  500. this.payeeList[index].text = res.payee;
  501. this.payeeList[index].value = res.id;
  502. })
  503. });
  504. },
  505. // 钱计算
  506. moneyChange(input) {
  507. console.log(input)
  508. let obj = {};
  509. obj = this.chargeItme.find((account) => {
  510. //model就是上面的数据源
  511. return parseFloat(account.incomeAmount).toFixed(2) === input; //筛选出匹配数据
  512. });
  513. let total = 0;
  514. this.chargeItme.forEach((money) => {
  515. total = (parseFloat(total) + parseFloat(money.incomeAmount)).toFixed(2)
  516. });
  517. this.$set(this.form, "expenditureAmount", total);
  518. },
  519. goAdd(){
  520. if(this.chargeItme.length<1){
  521. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  522. return;
  523. }
  524. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  525. this.$notify({ type: 'danger', message: '付款事由禁止包含!' });
  526. return;
  527. }
  528. if(this.form.capitalExpenditureType==2){
  529. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  530. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  531. return;
  532. }
  533. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  534. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  535. return;
  536. }
  537. }
  538. this.$set(this.form, "payeeList", this.chargeItme);
  539. this.$set(this.form, "bankTypeList", this.chargeItme);
  540. this.$set(this.form, "accountTypeList", this.chargeItme);
  541. this.$set(this.form, "transferStatusList", this.chargeItme);
  542. addTransfer(this.form).then(response => {
  543. this.projectForm.outId = response.data.id
  544. this.$set(this.projectForm, "ynType", '1');
  545. if(this.form.capitalExpenditureType==2){
  546. addProjectto(this.projectForm).then(res => {
  547. customSubmit(response.data.id).then(res => {
  548. this.$toast.success('提交成功');
  549. setTimeout(function(){
  550. history.go(-1)
  551. },2000)
  552. })
  553. })
  554. }else{
  555. customSubmit(response.data.id).then(res => {
  556. this.$toast.success('提交成功');
  557. setTimeout(function(){
  558. history.go(-1)
  559. },2000)
  560. })
  561. }
  562. });
  563. },
  564. goUpdate(){
  565. if(this.chargeItme.length<1){
  566. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  567. return;
  568. }
  569. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  570. this.$notify({ type: 'danger', message: '付款事由禁止包含!' });
  571. return;
  572. }
  573. if(this.form.capitalExpenditureType==2){
  574. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  575. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  576. return;
  577. }
  578. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  579. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  580. return;
  581. }
  582. }
  583. this.$set(this.form, "payeeList", this.chargeItme);
  584. this.$set(this.form, "bankTypeList", this.chargeItme);
  585. this.$set(this.form, "accountTypeList", this.chargeItme);
  586. this.$set(this.form, "transferStatusList", this.chargeItme);
  587. this.projectForm.outId = this.form.id
  588. addTransfer(this.form).then((response) => {
  589. this.projectForm.outId = response.data.id
  590. this.$set(this.projectForm, "ynType", '1');
  591. if(this.form.capitalExpenditureType==2){
  592. addProjectto(this.projectForm).then(res => {
  593. this.$toast.success('保存成功');
  594. setTimeout(function(){
  595. history.go(-1)
  596. },2000)
  597. })
  598. }else{
  599. this.$toast.success('保存成功');
  600. setTimeout(function(){
  601. history.go(-1)
  602. },2000)
  603. }
  604. });
  605. },
  606. payeeSelectChange(select, i) {
  607. let obj = {};
  608. let fuzhitype = 0;
  609. obj = this.payeeList.find((account) => {
  610. //model就是上面的数据源
  611. return account.id === select ; //筛选出匹配数据
  612. });
  613. if(this.chargeItme != [] && this.chargeItme.length>1){
  614. this.chargeItme.some((value, index) => {
  615. if(value.payeeAccount != undefined &&value.payeeAccount != '' && obj.payeeAccount == value.payeeAccount&&index!=i){
  616. fuzhitype = 2;
  617. return true;
  618. }
  619. if(value.accountType != undefined &&value.accountType != '' && obj.accountType != value.accountType&&index!=i){
  620. fuzhitype = 1;
  621. return true;
  622. }
  623. });
  624. }
  625. if(fuzhitype == 0){
  626. this.$set(this.chargeItme[i], "payee",obj.payee)
  627. this.$set(this.chargeItme[i], "bankType", obj.bankType)
  628. this.$set(this.chargeItme[i], "payeeId", obj.id);
  629. this.$set(this.chargeItme[i], "payeeAccount", obj.payeeAccount);
  630. this.$set(this.chargeItme[i], "bankDeposit", obj.bankDeposit);
  631. this.$set(this.chargeItme[i], "accountType", obj.accountType);
  632. }else if(fuzhitype == 1){
  633. this.$set(this.chargeItme[i], "payee",'')
  634. this.$set(this.chargeItme[i], "bankType",'')
  635. this.$set(this.chargeItme[i], "payeeId", '');
  636. this.$set(this.chargeItme[i], "payeeAccount", '');
  637. this.$set(this.chargeItme[i], "bankDeposit", '');
  638. this.$set(this.chargeItme[i], "accountType", '');
  639. this.$notify({ type: 'danger', message: '请选择账户类型相同的收款方!' });
  640. }else if(fuzhitype == 2){
  641. this.$set(this.chargeItme[i], "payee",'')
  642. this.$set(this.chargeItme[i], "bankType",'')
  643. this.$set(this.chargeItme[i], "payeeId", '');
  644. this.$set(this.chargeItme[i], "payeeAccount", '');
  645. this.$set(this.chargeItme[i], "bankDeposit", '');
  646. this.$set(this.chargeItme[i], "accountType", '');
  647. this.$notify({ type: 'danger', message: '收款方已存在!' });
  648. }
  649. },
  650. selectChange(select) {
  651. let obj = {};
  652. obj = this.payerOptions.find((account) => {
  653. //model就是上面的数据源
  654. return account.id === select; //筛选出匹配数据
  655. });
  656. console.log(obj)
  657. if(obj.payerFrom==1&&obj.operatorCode != null && obj.operatorCode != "" &&
  658. obj.enterpriseCode != null && obj.enterpriseCode != "" &&
  659. obj.accountPassword != null && obj.accountPassword != ""){
  660. this.$set(this.form, "bookId", obj.bookId);
  661. this.$set(this.form, "deptId", obj.deptId);
  662. this.$set(this.form, "cashierId", obj.id);
  663. this.$set(this.form, "payer", obj.accountName);
  664. this.$set(this.form, "payerAccount", obj.bankAccountNumber);
  665. this.$set(this.form, "operatorCode", obj.operatorCode);
  666. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  667. this.$set(this.form, "payerFrom", '1');
  668. }else{
  669. if(obj.payerFrom==1){
  670. this.diglogStatus = false;
  671. this.$notify({ type: 'danger', message: "请完善付款方“支付口令”等信息!" });
  672. this.$set(this.form,"payer","")
  673. this.$set(this.form,"payerAccount","")
  674. }else{
  675. this.$set(this.form, "payerFrom", obj.parerFrom);
  676. if(obj.operatorCode!=null&&obj.operatorCode!=''){
  677. this.$set(this.form, "operatorCode", obj.operatorCode);
  678. }else{
  679. this.$set(this.form, "operatorCode", '');
  680. }
  681. if(obj.enterpriseCode!=null&&obj.enterpriseCode!=''){
  682. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  683. }else{
  684. this.$set(this.form, "enterpriseCode", '');
  685. }
  686. if(obj.accountPassword!=null&&obj.accountPassword!=''){
  687. this.$set(this.form, "accountPassword", obj.accountPassword);
  688. }else{
  689. this.$set(this.form, "accountPassword", '');
  690. }
  691. this.$set(this.form, "bookId",'');
  692. this.$set(this.form, "deptId", '');
  693. this.$set(this.form, "cashierId", obj.id);
  694. this.$set(this.form, "payer", obj.accountName);
  695. if(obj.payerFrom==6){
  696. getQmyeFlow(obj.bankAccountNumber).then((response) => {
  697. this.$set(this.form, "payerAccount", response.data);
  698. });
  699. }else {
  700. this.$set(this.form, "payerAccount", obj.bankAccountNumber);
  701. }
  702. }
  703. }
  704. },
  705. beforeRead(file) {
  706. console.log(file)
  707. console.log(this.fileList)
  708. const params = new FormData();
  709. params.append("tableId", this.$route.query.id);
  710. params.append("tableName", "t_yinnong_transfer");
  711. params.append("bizPath", "upload");
  712. params.append("fileType", "0");
  713. params.append("file", file.file);
  714. commonAttach(params).then((response) => {
  715. console.log(response)
  716. })
  717. },
  718. getFileList(){
  719. let oData= {
  720. tableId: this.$route.query.id,
  721. tableName: "t_yinnong_transfer",
  722. bizPath: "upload",
  723. fileType: "0",
  724. }
  725. attachmentList(oData).then(res => {
  726. console.log(res)
  727. console.log(location.protocol+"//"+location.host+request.defaults.baseURL)
  728. res.rows.map(r => {
  729. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  730. this.fileList.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{})})
  731. console.log(r)
  732. })
  733. })
  734. },
  735. goBack(){
  736. window.history.go(-1)
  737. },
  738. //删除家庭成员
  739. deleteChargeItme(index){
  740. this.chargeItme.splice(index,1)
  741. },
  742. },
  743. }
  744. </script>
  745. <style scoped lang="scss">
  746. .app-container {
  747. padding: 2% 0;
  748. }
  749. .main_title{
  750. font-size: 0.4rem;
  751. color: #1D6FE9;
  752. margin: 0.2rem 6%;
  753. position: relative;
  754. }
  755. .main_box{
  756. width: 96%;
  757. margin: 0 auto;
  758. border-radius: 6px;
  759. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  760. overflow: hidden;
  761. background-color: #FFF;
  762. }
  763. .submitButton{
  764. width: 80%;
  765. margin: 0 auto;
  766. background-color: #1D6FE9;
  767. }
  768. .addFamily{
  769. position: absolute;
  770. top: -2px;
  771. right: 0;
  772. border-radius: 50%;
  773. }
  774. .deleteFamily{
  775. position: absolute;
  776. top: 0rem;
  777. right: 6%;
  778. z-index: 9;
  779. border-radius: 50%;
  780. }
  781. </style>