移动端
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

approvalAdd2.vue 43 KiB

2 年前
2 年前
2 年前
2 年前
2 年前
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120
  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. @cancel="showlasj = false"
  37. />
  38. </van-popup>
  39. <van-field
  40. readonly
  41. clickable
  42. required
  43. :rules="[{ required: true , message:'请选择资金支出类别' }]"
  44. label="资金支出类别"
  45. placeholder="请选择"
  46. v-model="capitalExpenditureType"
  47. @click="showcapital = true"
  48. input-align="right"
  49. right-icon="arrow-down"
  50. label-width="auto"
  51. />
  52. <van-popup v-model="showcapital" position="bottom">
  53. <van-picker
  54. show-toolbar
  55. :columns="capitalExpenditureTypeOptions"
  56. @confirm="onConfirmCapital"
  57. @cancel="showcapital = false"
  58. />
  59. </van-popup>
  60. <van-field
  61. readonly
  62. required
  63. label="支出总金额"
  64. v-model="form.expenditureAmount"
  65. placeholder="根据下方收款金额自动核算"
  66. input-align="right"
  67. label-width="auto"
  68. />
  69. <van-field name="radio" label="审批模式" input-align="right" autocomplete="off" required
  70. :rules="[{ required: true , message:'请选择审批模式' }]">
  71. <template #input>
  72. <van-radio-group v-model="form.approvalMode" direction="horizontal">
  73. <van-radio name="1">线上审批</van-radio>
  74. <van-radio name="2">线下审批</van-radio>
  75. </van-radio-group>
  76. </template>
  77. </van-field>
  78. </div>
  79. <div class="main_box" style="margin-top: 10px;">
  80. <van-field
  81. label="转账附言"
  82. v-model="form.remark"
  83. type="textarea"
  84. placeholder="请输入转账附言"
  85. input-align="right"
  86. rows="3"
  87. label-width="auto"
  88. required
  89. :rules="[{ required: true , message:'请输入转账附言' }]"
  90. />
  91. </div>
  92. <div class="main_box" style="margin-top: 10px;">
  93. <van-field label="说明情况" v-model="form.explainSituation" type="textarea" placeholder="请输入说明情况" input-align="right" rows="3" label-width="auto"/>
  94. </div>
  95. <p class="main_title" v-if="capitalExpenditureOpen">关联项目</p>
  96. <div class="main_box" v-if="capitalExpenditureOpen" style="margin-bottom: 10px;margin-top: 10px;position:relative;">
  97. <van-field
  98. readonly
  99. clickable
  100. label="项目名称"
  101. placeholder="请选择"
  102. v-model="projectForm.projectName"
  103. @click="showproject = true"
  104. input-align="right"
  105. right-icon="arrow-down"
  106. required
  107. :rules="[{ required: true , message:'请选择项目名称' }]"
  108. />
  109. <van-popup v-model="showproject" position="bottom">
  110. <van-picker
  111. show-toolbar
  112. :columns="projectListShow"
  113. @confirm="onConfirmProject"
  114. @cancel="showproject = false"
  115. />
  116. </van-popup>
  117. <van-field required :rules="[{ required: true , message:'请输入承建单位' }]" v-model="projectForm.projectContractor" label="承建单位" placeholder="请输入承建单位" input-align="right" label-width="auto"/>
  118. <van-field required :rules="[{ required: true , message:'请输入合同价款' }]" v-model="projectForm.projectAmount" label="合同价款(元)" placeholder="请输入合同价款(元)" input-align="right" label-width="auto"/>
  119. <van-field
  120. readonly
  121. clickable
  122. label="工程款类型"
  123. placeholder="请选择"
  124. v-model="projectFundType"
  125. @click="showFundType = true"
  126. input-align="right"
  127. right-icon="arrow-down"
  128. required
  129. :rules="[{ required: true , message:'请选择工程款类型' }]"
  130. />
  131. <van-popup v-model="showFundType" position="bottom">
  132. <van-picker
  133. show-toolbar
  134. :columns="projectFundTypeOptions"
  135. @confirm="onConfirmFundType"
  136. @cancel="showFundType = false"
  137. />
  138. </van-popup>
  139. <van-field required :rules="[{ required: true , message:'请输入工程发票号' }]" v-model="projectForm.projectBillNum" label="工程发票号" placeholder="请输入工程发票号" input-align="right" label-width="auto"/>
  140. </div>
  141. <p class="main_title" v-if="contractOpen">关联合同</p>
  142. <div class="main_box" v-if="contractOpen" style="margin-bottom: 10px;margin-top: 10px;position:relative;">
  143. <van-field
  144. readonly
  145. clickable
  146. label="合同"
  147. placeholder="请选择"
  148. v-model="infoForm.name"
  149. @click="showcontract = true"
  150. input-align="right"
  151. right-icon="arrow-down"
  152. required
  153. :rules="[{ required: true , message:'请选择项目名称' }]"
  154. />
  155. <van-popup v-model="showcontract" position="bottom">
  156. <van-picker
  157. show-toolbar
  158. :columns="infoList"
  159. @confirm="onConfirmContract"
  160. @cancel="showcontract = false"
  161. />
  162. </van-popup>
  163. <van-field required :rules="[{ required: true , message:'请输入合同编码' }]" v-model="infoForm.code" label="合同编码" placeholder="请输入合同编码" input-align="right" label-width="auto"/>
  164. <van-field required :rules="[{ required: true , message:'请输入合同价款' }]" v-model="infoForm.totalAmount" label="合同价款(元)" placeholder="请输入合同价款(元)" input-align="right" label-width="auto"/>
  165. </div>
  166. <p class="main_title">付款方信息</p>
  167. <div class="main_box">
  168. <!-- <van-field label="付款方" v-model="form.payer" placeholder="请输入付款方" input-align="right" label-width="auto"/>-->
  169. <van-field
  170. readonly
  171. clickable
  172. label="付款方"
  173. placeholder="请选择付款方"
  174. v-model="form.payer"
  175. @click="showpayer = true"
  176. input-align="right"
  177. right-icon="arrow-down"
  178. label-width="auto"
  179. required
  180. :rules="[{ required: true , message:'请选择付款方' }]"
  181. />
  182. <van-popup v-model="showpayer" position="bottom">
  183. <van-picker
  184. show-toolbar
  185. :columns="payerOptions"
  186. @confirm="onConfirmPayer($event)"
  187. @cancel="showpayer = false"
  188. />
  189. </van-popup>
  190. <van-field :rules="[{ required: true , message:'请输入付款方账户' }]" required label="付款方账户" v-model="form.payerAccount" placeholder="请输入账户" input-align="right" label-width="auto"/>
  191. </div>
  192. <p class="main_title">收款方信息<van-button icon="plus" @click="addChargeItme(chargeItme.length)" size="mini" type="info" native-type="button" class="addFamily"/></p>
  193. <div class="main_box" style="margin-bottom: 15px;">
  194. <van-cell title="收款账户类型" v-if="form.bankType==1">
  195. <template #right-icon>
  196. <van-radio-group direction="horizontal" v-model="form.accountType" @change="accountTypeChange">
  197. <van-radio name="1">公户</van-radio>
  198. <van-radio name="2">私户</van-radio>
  199. </van-radio-group>
  200. </template>
  201. </van-cell>
  202. <van-cell title="行内转账" v-if="form.bankType==2||form.bankType==3" >
  203. <template #right-icon>
  204. <van-radio-group direction="horizontal" v-model="form.isPeers" @change="accountTypeChange1">
  205. <van-radio name="Y">是</van-radio>
  206. <van-radio name="N">否</van-radio>
  207. </van-radio-group>
  208. </template>
  209. </van-cell>
  210. </div>
  211. <div :style="{position:'relative',padding: index == 0 ? '':'10px 0 0 0'}" v-for="(item, index) in chargeItme" :key="index">
  212. <van-button icon="minus" size="mini" type="danger" class="deleteFamily" native-type="button" v-if="index!=0" @click="deleteChargeItme(index)" />
  213. <div class="main_box" style="margin-bottom: 10px;position:relative;">
  214. <van-field
  215. readonly
  216. clickable
  217. label="收款方"
  218. placeholder="请选择"
  219. v-model="item.payee"
  220. @click="item.showPayee = true"
  221. input-align="right"
  222. right-icon="arrow-down"
  223. required
  224. :rules="[{ required: true , message:'请选择收款方' }]"
  225. />
  226. <van-popup v-model="item.showPayee" position="bottom">
  227. <van-picker
  228. show-toolbar
  229. :columns="payeeList"
  230. @confirm="onConfirmPayee($event,index)"
  231. @cancel="item.showPayee = false"
  232. />
  233. </van-popup>
  234. <van-field required readonly :rules="[{ required: true , message:'收款账户不能为空' }]" v-model="item.payeeAccount" label="收款账户" placeholder="请选择收款方" input-align="right" label-width="auto"/>
  235. <van-field required readonly :rules="[{ required: true , message:'开户银行不能为空' }]" v-model="item.bankDeposit" label="开户银行" placeholder="请选择收款方" input-align="right" label-width="auto"/>
  236. <van-field required :rules="[{ required: true , message:'请输入金额' }]" v-model="item.incomeAmount" type="number" label="收入金额" placeholder="请输入金额" input-align="right" label-width="auto" @change="moneyChange"/>
  237. <van-field
  238. readonly
  239. clickable
  240. label="所属银行"
  241. placeholder="请选择收款方"
  242. v-model="item.bankTypeText"
  243. @click="item.showbankType = true"
  244. input-align="right"
  245. required
  246. :rules="[{ required: true , message:'所属银行不能为空' }]"
  247. />
  248. </div>
  249. </div>
  250. <p class="main_title">上传附件</p>
  251. <div class="main_box" style="padding: 5px 0 0 8px;">
  252. <van-uploader v-model="fileList" :after-read="beforeRead" @delete="deleteFile"></van-uploader>
  253. </div>
  254. <div style="padding: 16px 0;">
  255. <van-row>
  256. <van-col span="12" align="center">
  257. <!-- @click="goUpdate"-->
  258. <van-button type="info" native-type="submit" @click="buttonType='update'" class="submitButton">保<i style="margin-right: 1em;"></i>存</van-button>
  259. </van-col>
  260. <van-col span="12" align="center">
  261. <!-- @click="goAdd"-->
  262. <van-button type="info" native-type="submit" @click="buttonType='add'" class="submitButton">保存并提交</van-button>
  263. </van-col>
  264. </van-row>
  265. <div class="clear"></div>
  266. </div>
  267. </van-form>
  268. </div>
  269. </template>
  270. <script>
  271. import { addTransfer , listPayee , updateTransfer , getProjectto , listProject , addProjectto , customSubmit , getAccount ,getQmyeFlow,listInfo ,getInfoto ,addInfoto} from "@/api/onlineHome/bankAgriculture/paymentApproval";
  272. import request from '@/utils/request'
  273. import {attachmentList, commonAttach} from "../../../../api/onlineHome/bankAgriculture/paymentApproval";
  274. import Dialog from "vant/lib/dialog";
  275. export default {
  276. name: "approvalAdd2",
  277. data() {
  278. return {
  279. showcontract:false,
  280. showcapital:false,
  281. showpayee:false,
  282. showlasj:false,
  283. showbankType:false,
  284. showproject:false,
  285. showFundType:false,
  286. showpayer:false,
  287. buttonType:'a',
  288. minDate: new Date(2000, 1, 1),
  289. maxDate: new Date(2050, 12, 31),
  290. currentDate: new Date(),
  291. form:{},
  292. fileList:[],
  293. capitalExpenditureType:'',
  294. payee:'',
  295. bankType:'',
  296. wfydlxDictionaries:[],
  297. jglxDictionaries:[],
  298. sysDictionaries:[],
  299. capitalExpenditureTypeOptions:[],
  300. bankTypeDictionaries:[],
  301. projectList:[],
  302. projectFundTypeOptions:[],
  303. projectFundTypeDictionaries:[],
  304. projectListShow:[],
  305. payerOptions:[],
  306. chargeItme:[],
  307. chargeItmeShow:[],
  308. payeeList:[],
  309. // 查询参数
  310. queryParams: {
  311. transferType:"",
  312. orderByColumn: "id",
  313. isAsc: "desc",
  314. },
  315. capitalExpenditureOpen:false,
  316. contractOpen:false,
  317. projectForm:{
  318. projectId:null,
  319. projectName:null,
  320. projectContractor:null,
  321. projectAmount:null,
  322. projectBillNum:null,
  323. projectFundType:'1',
  324. outId:null,
  325. ynType:'1'
  326. },
  327. infoForm:{
  328. infoId:null,
  329. name:null,
  330. code:null,
  331. totalAmount:null,
  332. contractionId:null,
  333. transferId:null
  334. },
  335. // 合同信息查询参数
  336. queryContractionParams: {
  337. pageNum: 1,
  338. pageSize: 100,
  339. contractionStatus: '1',
  340. orderByColumn: "endTime",
  341. isAsc: "desc",
  342. },
  343. projectFundType:'',
  344. uploadFiles:[],
  345. };
  346. },
  347. created() {
  348. this.reset();
  349. this.initProjectInfo();
  350. this.getDicts("project_fund_type").then((response) => {
  351. for (var i = 0; i < response.data.length; i++) {
  352. this.projectFundTypeOptions.push({text: response.data[i].dictLabel, value: response.data[i].dictValue});
  353. }
  354. this.projectFundTypeDictionaries = response.data;
  355. });
  356. let params1={
  357. accountType: "102",
  358. status: "N",
  359. }
  360. getAccount(params1).then((response) => {
  361. this.payerOptions = response.rows;
  362. response.rows.map((res,index) => {
  363. res['payerFrom'] = '1'
  364. this.payerOptions[index].text = res.accountName;
  365. this.payerOptions[index].value = res.id;
  366. })
  367. });
  368. this.getDictionaries();
  369. },
  370. methods: {
  371. initProjectInfo(){
  372. let _this = this
  373. let queryParams={
  374. pageNum: 1,
  375. pageSize: 100,
  376. }
  377. listProject(queryParams).then(response => {
  378. _this.projectList = response.rows;
  379. console.log(response)
  380. for (let i = 0; i < response.rows.length; i++) {
  381. //_this.projectList[i].set({text: response.rows[i].projectName, value: response.rows[i].id});
  382. _this.$set(_this.projectList[i],"text",response.rows[i].projectName)
  383. _this.$set(_this.projectList[i],"value",response.rows[i].id)
  384. }
  385. });
  386. listInfo(this.queryContractionParams).then(response => {
  387. console.log(response)
  388. _this.infoList = response.rows;
  389. for (let i = 0; i < response.rows.length; i++) {
  390. //_this.infoList[i].push({text: response.rows[i].name, value: response.rows[i].code});
  391. _this.$set(_this.infoList[i],"text",response.rows[i].name)
  392. _this.$set(_this.infoList[i],"value",response.rows[i].code)
  393. }
  394. });
  395. },
  396. // 表单重置
  397. reset() {
  398. this.form = {
  399. id: null,
  400. upId: null,
  401. downId: null,
  402. orderId: null,
  403. cashierId: null,
  404. transferType: '2',
  405. accountType: '2',
  406. explainSituation: null,
  407. succeedAmount: null,
  408. payer: null,
  409. payerAccount: null,
  410. operatorCode: null,
  411. enterpriseCode: null,
  412. expenditureAmount: null,
  413. capitalExpenditureType: '1',
  414. remark: null,
  415. transferStatus: "0",
  416. auditStatus: "0",
  417. paymentState: "1",
  418. bankPriority: "0",
  419. clientPriority: "0"
  420. };
  421. this.processList = {}
  422. this.projectForm={
  423. projectId:null,
  424. projectName:null,
  425. projectContractor:null,
  426. projectAmount:null,
  427. projectBillNum:null,
  428. projectFundType:'1',
  429. outId:null,
  430. ynType:'1'
  431. }
  432. },
  433. getChange(){
  434. if(this.buttonType == 'update'){
  435. this.goUpdate();
  436. }else if(this.buttonType == 'add'){
  437. this.goAdd();
  438. }
  439. },
  440. getDictionaries(){
  441. this.getDicts("capital_expenditure_type").then((res) => {
  442. for (var i = 0; i < res.data.length; i++) {
  443. this.capitalExpenditureTypeOptions.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  444. }
  445. });
  446. this.getDicts("bank_type").then(res => {
  447. for (var i = 0; i < res.data.length; i++) {
  448. this.bankTypeDictionaries.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  449. }
  450. });
  451. this.getPayeeList();
  452. },
  453. getError(e){
  454. this.$notify({ type: 'danger', message: e.errors[0].message });
  455. },
  456. addChargeItme(index){
  457. if(this.chargeItme.length>0&&this.chargeItme[this.chargeItme.length-1].payee == ''){
  458. this.$notify({ type: 'danger', message: '请勿添加多个空列表信息' });
  459. return;
  460. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].incomeAmount == ''){
  461. this.$notify({ type: 'danger', message: '请输入收入金额!' });
  462. return;
  463. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].payeeAccount == ''){
  464. this.$notify({ type: 'danger', message: '请输入收款账户!' });
  465. return;
  466. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankDeposit == ''){
  467. this.$notify({ type: 'danger', message: '请输入开户银行!' });
  468. return;
  469. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankType == ''){
  470. this.$notify({ type: 'danger', message: '请选择所属银行!' });
  471. return;
  472. }
  473. this.getDicts("bank_type").then(res => {
  474. this.chargeItme.splice(index + 1, 0, {
  475. payeeId: "", //收款方ID
  476. payee: "", //收款方
  477. payeeAccount: "", //收款账户
  478. bankDeposit: "", //开户银行
  479. incomeAmount: "", //收入金额
  480. bankType: "", //所属银行
  481. bankTypeText:"", //所属银行
  482. showPayee:false,
  483. showbankType:false
  484. });
  485. });
  486. },
  487. getPayeeList() {
  488. //信用卡转账
  489. this.queryParams.accountType = this.form.accountType
  490. this.queryParams.status = "0"
  491. listPayee(this.queryParams).then((response) => {
  492. response.rows.map((res,index) => {
  493. if(res.payeeType==4){
  494. res.text = res.payee
  495. res.value = res.id
  496. this.payeeList.push(res)
  497. }
  498. })
  499. });
  500. },
  501. payeeDictLabel(datas, value) {
  502. let actions = [];
  503. Object.keys(datas).some((key) => {
  504. if (datas[key].payeeId == ('' + value)) {
  505. actions.push(datas[key].payee);
  506. return true;
  507. }
  508. })
  509. return actions.join('');
  510. },
  511. onConfirmCapital(data){
  512. if (data.value == 2){
  513. this.capitalExpenditureOpen = true;
  514. this.contractOpen = false
  515. this.infoForm = {};
  516. }else if(data.value == 4){
  517. this.capitalExpenditureOpen = false;
  518. this.contractOpen = true
  519. this.projectForm = {};
  520. }else{
  521. this.capitalExpenditureOpen = false;
  522. this.contractOpen = false
  523. this.projectForm = {};
  524. this.infoForm = {};
  525. }
  526. this.capitalExpenditureType = data.text;
  527. this.form.capitalExpenditureType = data.value;
  528. this.showcapital = false;
  529. },
  530. onConfirmFundType(data){
  531. this.projectForm.projectFundType = data.value;
  532. this.projectFundType = data.text;
  533. this.showFundType = false;
  534. },
  535. onConfirmContract(data){
  536. this.infoList.map(res => {
  537. if(res.name==data.text){
  538. this.infoForm.contractionId = res.id;
  539. this.infoForm.name = res.name;
  540. this.infoForm.code = res.code;
  541. this.infoForm.totalAmount = res.totalAmount;
  542. }
  543. })
  544. this.showcontract = false;
  545. },
  546. onConfirmProject(data){
  547. this.projectList.map(res => {
  548. if(res.projectName==data.text){
  549. this.projectForm.projectId = res.id
  550. this.projectForm.projectName = res.projectName
  551. this.projectForm.projectContractor = res.projectContractor
  552. this.projectForm.projectAmount = res.projectAmount
  553. }
  554. })
  555. this.showproject = false;
  556. },
  557. onConfirmPayee(data,index){
  558. for (let i = 0 ; i < this.chargeItme.length ; i++){
  559. this.chargeItme[i].showPayee = false;
  560. }
  561. this.chargeItme[index].payee = data.text;
  562. this.chargeItme[index].payeeId = data.value;
  563. this.chargeItme[index].showpayee = false;
  564. this.payeeSelectChange(data.value , index)
  565. this.onConfirmBankType(data,index)
  566. },
  567. onConfirmBankType(data,index){
  568. console.log(this.bankTypeDictionaries)
  569. this.bankTypeDictionaries.map(res => {
  570. if(res.value==data.bankType){
  571. this.chargeItme[index].bankTypeText = res.text;
  572. this.chargeItme[index].bankType = res.value;
  573. }
  574. })
  575. },
  576. onConfirmPayer(data){
  577. this.form.payer = data.text;
  578. this.form.cashierId = data.value;
  579. this.showpayer = false;
  580. this.selectChange(data.value)
  581. },
  582. onConfirmLasj(data){
  583. this.form.applyDate = this.getNowFormatDate(data).substr(0,10);
  584. this.showlasj = false;
  585. },
  586. accountTypeChange(e){
  587. this.payeeList = [];
  588. this.chargeItme = [];
  589. this.queryParams.isPeers = this.form.isPeers
  590. this.queryParams.accountType = this.form.accountType
  591. this.queryParams.bankType = this.form.bankType
  592. this.queryParams.status = "0"
  593. listPayee(this.queryParams).then((response) => {
  594. response.rows.map((res,index) => {
  595. if(res.payeeType==4){
  596. res.text = res.payee
  597. res.value = res.id
  598. this.payeeList.push(res)
  599. }
  600. })
  601. });
  602. },
  603. accountTypeChange1(e){
  604. this.payeeList = [];
  605. this.chargeItme = [];
  606. this.queryParams.isPeers = this.form.isPeers
  607. this.queryParams.accountType = this.form.accountType
  608. this.queryParams.bankType = this.form.bankType
  609. this.queryParams.status = "0"
  610. listPayee(this.queryParams).then((response) => {
  611. response.rows.map((res,index) => {
  612. if(res.payeeType==4){
  613. res.text = res.payee
  614. res.value = res.id
  615. this.payeeList.push(res)
  616. }
  617. })
  618. });
  619. },
  620. // 钱计算
  621. moneyChange(input) {
  622. let obj = {};
  623. obj = this.chargeItme.find((account) => {
  624. //model就是上面的数据源
  625. return parseFloat(account.incomeAmount).toFixed(2) === input; //筛选出匹配数据
  626. });
  627. let total = 0;
  628. this.chargeItme.forEach((money) => {
  629. total = (parseFloat(total) + parseFloat(money.incomeAmount)).toFixed(2)
  630. });
  631. this.$set(this.form, "expenditureAmount", total);
  632. },
  633. goAdd(){
  634. if(this.chargeItme.length<1){
  635. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  636. return;
  637. }
  638. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  639. this.$notify({ type: 'danger', message: '转账附言禁止包含!' });
  640. return;
  641. }
  642. if(this.form.capitalExpenditureType==2){
  643. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  644. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  645. return;
  646. }
  647. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  648. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  649. return;
  650. }
  651. }
  652. if(this.form.capitalExpenditureType==4){
  653. if(this.infoForm.name==""||this.infoForm.name==null){
  654. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  655. return;
  656. }
  657. if(this.infoForm.code==""||this.infoForm.code==null){
  658. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  659. return;
  660. }
  661. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  662. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  663. return;
  664. }
  665. }
  666. if((this.uploadFiles==null||this.uploadFiles.length==0)&&(this.fileList==null||this.fileList.length==0)){
  667. Dialog.confirm({
  668. title: '提示',
  669. message: '此申请单中未上传任何附件,是否确认提交?',
  670. })
  671. .then(() => {
  672. this.$set(this.form, "payeeList", this.chargeItme);
  673. this.$set(this.form, "bankTypeList", this.chargeItme);
  674. this.$set(this.form, "accountTypeList", this.chargeItme);
  675. this.$set(this.form, "transferStatusList", this.chargeItme);
  676. addTransfer(this.form).then(response => {
  677. this.projectForm.outId = response.data.id
  678. this.infoForm.transferId = response.data.id
  679. this.$set(this.projectForm, "ynType", '1');
  680. if(this.uploadFiles!=null&&this.uploadFiles.length>0){
  681. this.uploadFiles.map(rr => {
  682. const params = new FormData();
  683. params.append("tableId", response.data.id);
  684. params.append("tableName", "t_yinnong_transfer");
  685. params.append("bizPath", "upload");
  686. params.append("fileType", "0");
  687. params.append("file", rr);
  688. commonAttach(params).then((r) => {
  689. })
  690. })
  691. if(this.form.capitalExpenditureType==2){
  692. addProjectto(this.projectForm).then(res => {
  693. customSubmit(response.data.id).then(res => {
  694. this.$toast.success('提交成功');
  695. setTimeout(function(){
  696. history.go(-1)
  697. },2000)
  698. })
  699. })
  700. }else if(this.form.capitalExpenditureType==4){
  701. addInfoto(this.infoForm).then(res => {
  702. customSubmit(response.data.id).then(res => {
  703. this.$toast.success('提交成功');
  704. setTimeout(function(){
  705. history.go(-1)
  706. },2000)
  707. })
  708. })
  709. }else{
  710. customSubmit(response.data.id).then(res => {
  711. this.$toast.success('提交成功');
  712. setTimeout(function(){
  713. history.go(-1)
  714. },2000)
  715. })
  716. }
  717. }else{
  718. if(this.form.capitalExpenditureType==2){
  719. addProjectto(this.projectForm).then(res => {
  720. customSubmit(response.data.id).then(res => {
  721. this.$toast.success('提交成功');
  722. setTimeout(function(){
  723. history.go(-1)
  724. },2000)
  725. })
  726. })
  727. }else if(this.form.capitalExpenditureType==4){
  728. addInfoto(this.infoForm).then(res => {
  729. customSubmit(response.data.id).then(res => {
  730. this.$toast.success('提交成功');
  731. setTimeout(function(){
  732. history.go(-1)
  733. },2000)
  734. })
  735. })
  736. }else{
  737. customSubmit(response.data.id).then(res => {
  738. this.$toast.success('提交成功');
  739. setTimeout(function(){
  740. history.go(-1)
  741. },2000)
  742. })
  743. }
  744. }
  745. });
  746. })
  747. .catch(() => {
  748. return false;
  749. });
  750. }else{
  751. this.$set(this.form, "payeeList", this.chargeItme);
  752. this.$set(this.form, "bankTypeList", this.chargeItme);
  753. this.$set(this.form, "accountTypeList", this.chargeItme);
  754. this.$set(this.form, "transferStatusList", this.chargeItme);
  755. addTransfer(this.form).then(response => {
  756. this.projectForm.outId = response.data.id
  757. this.infoForm.transferId = response.data.id
  758. this.$set(this.projectForm, "ynType", '1');
  759. if(this.uploadFiles!=null&&this.uploadFiles.length>0){
  760. this.uploadFiles.map(rr => {
  761. const params = new FormData();
  762. params.append("tableId", response.data.id);
  763. params.append("tableName", "t_yinnong_transfer");
  764. params.append("bizPath", "upload");
  765. params.append("fileType", "0");
  766. params.append("file", rr);
  767. commonAttach(params).then((r) => {
  768. })
  769. })
  770. if(this.form.capitalExpenditureType==2){
  771. addProjectto(this.projectForm).then(res => {
  772. customSubmit(response.data.id).then(res => {
  773. this.$toast.success('提交成功');
  774. setTimeout(function(){
  775. history.go(-1)
  776. },2000)
  777. })
  778. })
  779. } else if(this.form.capitalExpenditureType==4){
  780. addInfoto(this.infoForm).then(res => {
  781. customSubmit(response.data.id).then(res => {
  782. this.$toast.success('提交成功');
  783. setTimeout(function(){
  784. history.go(-1)
  785. },2000)
  786. })
  787. })
  788. }else{
  789. customSubmit(response.data.id).then(res => {
  790. this.$toast.success('提交成功');
  791. setTimeout(function(){
  792. history.go(-1)
  793. },2000)
  794. })
  795. }
  796. }else{
  797. if(this.form.capitalExpenditureType==2){
  798. addProjectto(this.projectForm).then(res => {
  799. customSubmit(response.data.id).then(res => {
  800. this.$toast.success('提交成功');
  801. setTimeout(function(){
  802. history.go(-1)
  803. },2000)
  804. })
  805. })
  806. } else if(this.form.capitalExpenditureType==4){
  807. addInfoto(this.infoForm).then(res => {
  808. customSubmit(response.data.id).then(res => {
  809. this.$toast.success('提交成功');
  810. setTimeout(function(){
  811. history.go(-1)
  812. },2000)
  813. })
  814. })
  815. }else{
  816. customSubmit(response.data.id).then(res => {
  817. this.$toast.success('提交成功');
  818. setTimeout(function(){
  819. history.go(-1)
  820. },2000)
  821. })
  822. }
  823. }
  824. });
  825. }
  826. },
  827. goUpdate(){
  828. if(this.chargeItme.length<1){
  829. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  830. return;
  831. }
  832. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  833. this.$notify({ type: 'danger', message: '转账附言禁止包含!' });
  834. return;
  835. }
  836. if(this.form.capitalExpenditureType==2){
  837. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  838. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  839. return;
  840. }
  841. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  842. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  843. return;
  844. }
  845. }
  846. if(this.form.capitalExpenditureType==4){
  847. if(this.infoForm.name==""||this.infoForm.name==null){
  848. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  849. return;
  850. }
  851. if(this.infoForm.code==""||this.infoForm.code==null){
  852. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  853. return;
  854. }
  855. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  856. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  857. return;
  858. }
  859. }
  860. this.$set(this.form, "payeeList", this.chargeItme);
  861. this.$set(this.form, "bankTypeList", this.chargeItme);
  862. this.$set(this.form, "accountTypeList", this.chargeItme);
  863. this.$set(this.form, "transferStatusList", this.chargeItme);
  864. addTransfer(this.form).then((response) => {
  865. this.projectForm.outId = response.data.id
  866. this.infoForm.transferId = response.data.id
  867. this.$set(this.projectForm, "ynType", '1');
  868. if(this.uploadFiles!=null&&this.uploadFiles.length>0){
  869. this.uploadFiles.map(rr => {
  870. const params = new FormData();
  871. params.append("tableId", response.data.id);
  872. params.append("tableName", "t_yinnong_transfer");
  873. params.append("bizPath", "upload");
  874. params.append("fileType", "0");
  875. params.append("file", rr);
  876. commonAttach(params).then((r) => {
  877. })
  878. })
  879. if(this.form.capitalExpenditureType==2){
  880. addProjectto(this.projectForm).then(res => {
  881. this.$toast.success('保存成功');
  882. setTimeout(function(){
  883. history.go(-1)
  884. },2000)
  885. })
  886. }else if(this.form.capitalExpenditureType==4){
  887. addInfoto(this.infoForm).then(res => {
  888. this.$toast.success('保存成功');
  889. setTimeout(function(){
  890. history.go(-1)
  891. },2000)
  892. })
  893. }else{
  894. this.$toast.success('保存成功');
  895. setTimeout(function(){
  896. history.go(-1)
  897. },2000)
  898. }
  899. }else{
  900. if(this.form.capitalExpenditureType==2){
  901. addProjectto(this.projectForm).then(res => {
  902. this.$toast.success('保存成功');
  903. setTimeout(function(){
  904. history.go(-1)
  905. },2000)
  906. })
  907. }else if(this.form.capitalExpenditureType==4){
  908. addInfoto(this.infoForm).then(res => {
  909. this.$toast.success('保存成功');
  910. setTimeout(function(){
  911. history.go(-1)
  912. },2000)
  913. })
  914. }else{
  915. this.$toast.success('保存成功');
  916. setTimeout(function(){
  917. history.go(-1)
  918. },2000)
  919. }
  920. }
  921. });
  922. },
  923. payeeSelectChange(select, i) {
  924. let obj = {};
  925. let fuzhitype = 0;
  926. obj = this.payeeList.find((account) => {
  927. //model就是上面的数据源
  928. return account.id === select ; //筛选出匹配数据
  929. });
  930. if(this.chargeItme != [] && this.chargeItme.length>1){
  931. this.chargeItme.some((value, index) => {
  932. if(value.payeeAccount != undefined &&value.payeeAccount != '' && obj.payeeAccount == value.payeeAccount&&index!=i){
  933. fuzhitype = 2;
  934. return true;
  935. }
  936. if(value.accountType != undefined &&value.accountType != '' && obj.accountType != value.accountType&&index!=i){
  937. fuzhitype = 1;
  938. return true;
  939. }
  940. });
  941. }
  942. if(fuzhitype == 0){
  943. this.$set(this.chargeItme[i], "payee",obj.payee)
  944. this.$set(this.chargeItme[i], "bankType", obj.bankType)
  945. this.$set(this.chargeItme[i], "payeeId", obj.id);
  946. this.$set(this.chargeItme[i], "payeeAccount", obj.payeeAccount);
  947. this.$set(this.chargeItme[i], "bankDeposit", obj.bankDeposit);
  948. this.$set(this.chargeItme[i], "accountType", obj.accountType);
  949. }else if(fuzhitype == 1){
  950. this.$set(this.chargeItme[i], "payee",'')
  951. this.$set(this.chargeItme[i], "bankType",'')
  952. this.$set(this.chargeItme[i], "payeeId", '');
  953. this.$set(this.chargeItme[i], "payeeAccount", '');
  954. this.$set(this.chargeItme[i], "bankDeposit", '');
  955. this.$set(this.chargeItme[i], "accountType", '');
  956. this.$notify({ type: 'danger', message: '请选择账户类型相同的收款方!' });
  957. }else if(fuzhitype == 2){
  958. this.$set(this.chargeItme[i], "payee",'')
  959. this.$set(this.chargeItme[i], "bankType",'')
  960. this.$set(this.chargeItme[i], "payeeId", '');
  961. this.$set(this.chargeItme[i], "payeeAccount", '');
  962. this.$set(this.chargeItme[i], "bankDeposit", '');
  963. this.$set(this.chargeItme[i], "accountType", '');
  964. this.$notify({ type: 'danger', message: '收款方已存在!' });
  965. }
  966. },
  967. selectChange(select) {
  968. let obj = {};
  969. obj = this.payerOptions.find((account) => {
  970. //model就是上面的数据源
  971. return account.id === select; //筛选出匹配数据
  972. });
  973. if(obj.accountPassword != null && obj.accountPassword != "" &&
  974. obj.bankType != null && obj.bankType != ""){
  975. this.$set(this.form, "bookId", obj.bookId);
  976. this.$set(this.form, "deptId", obj.deptId);
  977. this.$set(this.form, "cashierId", obj.id);
  978. this.$set(this.form, "payer", obj.accountName);
  979. this.$set(this.form, "payerAccount", obj.bankAccountNumber);
  980. this.$set(this.form, "operatorCode", obj.operatorCode);
  981. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  982. this.$set(this.form, "bankType", obj.bankType);
  983. this.$set(this.form, "bankAccountType", obj.bankAccountType);
  984. this.$set(this.form, "villageAccountType", obj.villageAccountType);
  985. this.$set(this.form, "taccountId", obj.taccountId);
  986. this.$set(this.form, "accountNo", obj.accountNo);
  987. this.$set(this.form, "cifNo", obj.cifNo);
  988. this.$set(this.form, "payerFrom", '1');
  989. if(obj.bankType==1){
  990. this.form.accountType = "1"
  991. this.form.isPeers = null
  992. this.accountTypeChange();
  993. }else if(obj.bankType==2||obj.bankType==3){
  994. this.form.accountType = null
  995. this.form.isPeers = "Y"
  996. this.accountTypeChange1();
  997. }
  998. }else{
  999. if(obj.payerFrom==1){
  1000. this.diglogStatus = false;
  1001. this.$notify({ type: 'danger', message: "请完善付款方“操作员代码”、“企业编码”、“支付口令”等信息!" });
  1002. this.$set(this.form,"payer","")
  1003. this.$set(this.form,"payerAccount","")
  1004. }else{
  1005. this.$set(this.form, "payerFrom", obj.parerFrom);
  1006. if(obj.operatorCode!=null&&obj.operatorCode!=''){
  1007. this.$set(this.form, "operatorCode", obj.operatorCode);
  1008. }else{
  1009. this.$set(this.form, "operatorCode", '');
  1010. }
  1011. if(obj.enterpriseCode!=null&&obj.enterpriseCode!=''){
  1012. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  1013. }else{
  1014. this.$set(this.form, "enterpriseCode", '');
  1015. }
  1016. if(obj.accountPassword!=null&&obj.accountPassword!=''){
  1017. this.$set(this.form, "accountPassword", obj.accountPassword);
  1018. }else{
  1019. this.$set(this.form, "accountPassword", '');
  1020. }
  1021. this.$set(this.form, "bookId",'');
  1022. this.$set(this.form, "deptId", '');
  1023. this.$set(this.form, "cashierId", obj.id);
  1024. this.$set(this.form, "payer", obj.accountName);
  1025. this.$set(this.form, "bankType", obj.bankType);
  1026. if(obj.payerFrom==6){
  1027. getQmyeFlow(obj.bankAccountNumber).then((response) => {
  1028. this.$set(this.form, "payerAccount", response.data);
  1029. });
  1030. }else {
  1031. this.$set(this.form, "payerAccount", obj.bankAccountNumber);
  1032. }
  1033. }
  1034. }
  1035. },
  1036. beforeRead(file) {
  1037. this.uploadFiles.push(file.file);
  1038. },
  1039. deleteFile(file){
  1040. this.uploadFiles.map((response,index) => {
  1041. if(file.file == response){
  1042. this.uploadFiles.splice(index,1)
  1043. }
  1044. })
  1045. },
  1046. getFileList(){
  1047. let oData= {
  1048. tableId: this.$route.query.id,
  1049. tableName: "t_yinnong_transfer",
  1050. bizPath: "upload",
  1051. fileType: "0",
  1052. }
  1053. attachmentList(oData).then(res => {
  1054. console.log(res)
  1055. console.log(location.protocol+"//"+location.host+request.defaults.baseURL)
  1056. res.rows.map(r => {
  1057. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  1058. this.fileList.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{})})
  1059. console.log(r)
  1060. })
  1061. })
  1062. },
  1063. goBack(){
  1064. window.history.go(-1)
  1065. },
  1066. //删除家庭成员
  1067. deleteChargeItme(index){
  1068. this.chargeItme.splice(index,1)
  1069. },
  1070. },
  1071. }
  1072. </script>
  1073. <style scoped lang="scss">
  1074. .app-container {
  1075. padding: 2% 0;
  1076. }
  1077. .main_title{
  1078. font-size: 0.4rem;
  1079. color: #1D6FE9;
  1080. margin: 0.2rem 6%;
  1081. position: relative;
  1082. }
  1083. .main_box{
  1084. width: 96%;
  1085. margin: 0 auto;
  1086. border-radius: 6px;
  1087. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  1088. overflow: hidden;
  1089. background-color: #FFF;
  1090. }
  1091. .submitButton{
  1092. width: 80%;
  1093. margin: 0 auto;
  1094. background-color: #1D6FE9;
  1095. }
  1096. .addFamily{
  1097. position: absolute;
  1098. top: -2px;
  1099. right: 0;
  1100. border-radius: 50%;
  1101. }
  1102. .deleteFamily{
  1103. position: absolute;
  1104. top: 0rem;
  1105. right: 6%;
  1106. z-index: 9;
  1107. border-radius: 50%;
  1108. }
  1109. </style>