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

962 行
36 KiB

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