移动端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

956 line
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-picker
  189. show-toolbar
  190. :columns="payeeList"
  191. @confirm="onConfirmPayee($event,index)"
  192. @cancel="item.showPayee = false"
  193. />
  194. </van-popup>
  195. <van-field required :rules="[{ required: true , message:'收款账户不能为空' }]" v-model="item.payeeAccount" label="收款账户" placeholder="请选择收款方" input-align="right" label-width="auto"/>
  196. <van-field required :rules="[{ required: true , message:'开户银行不能为空' }]" v-model="item.bankDeposit" label="开户银行" placeholder="请选择收款方" input-align="right" label-width="auto"/>
  197. <van-field required :rules="[{ required: true , message:'请输入金额' }]" v-model="item.incomeAmount" type="number" label="收入金额" placeholder="请输入金额" input-align="right" label-width="auto" @change="moneyChange"/>
  198. <van-field
  199. readonly
  200. clickable
  201. label="所属银行"
  202. placeholder="请选择收款方"
  203. v-model="item.bankTypeText"
  204. @click="item.showbankType = true"
  205. input-align="right"
  206. required
  207. :rules="[{ required: true , message:'所属银行不能为空 ' }]"
  208. />
  209. </div>
  210. </div>
  211. <p class="main_title">上传附件</p>
  212. <div class="main_box" style="padding: 5px 0 0 8px;">
  213. <van-uploader v-model="fileList" :after-read="beforeRead" @delete="deleteFile"></van-uploader>
  214. </div>
  215. <div style="padding: 16px 0;">
  216. <van-row>
  217. <van-col span="12" align="center">
  218. <!-- @click="goUpdate"-->
  219. <van-button type="info" native-type="submit" @click="buttonType='update'" class="submitButton">保<i style="margin-right: 1em;"></i>存</van-button>
  220. </van-col>
  221. <van-col span="12" align="center">
  222. <!-- @click="goAdd"-->
  223. <van-button type="info" native-type="submit" @click="buttonType='add'" class="submitButton">保存并提交</van-button>
  224. </van-col>
  225. </van-row>
  226. <div class="clear"></div>
  227. </div>
  228. </van-form>
  229. </div>
  230. </template>
  231. <script>
  232. import { addTransfer , listPayee , updateTransfer , getProjectto , listProject , addProjectto , customSubmit , getAccount ,getQmyeFlow} from "@/api/onlineHome/bankAgriculture/paymentApproval";
  233. import {
  234. attachmentList,
  235. commonAttach,
  236. listTaccount,
  237. listVaccount
  238. } from "../../../../api/onlineHome/bankAgriculture/paymentApproval";
  239. import request from '@/utils/request'
  240. import Dialog from "vant/lib/dialog";
  241. import moment from "moment";
  242. export default {
  243. name: "approvalAdd5",
  244. data() {
  245. return {
  246. showcapital:false,
  247. showpayee:false,
  248. showlasj:false,
  249. showbankType:false,
  250. showproject:false,
  251. showFundType:false,
  252. showpayer:false,
  253. buttonType:'a',
  254. minDate: new Date(2000, 1, 1),
  255. maxDate: new Date(2050, 12, 31),
  256. currentDate: new Date(),
  257. form:{},
  258. fileList:[],
  259. capitalExpenditureType:'',
  260. payee:'',
  261. bankType:'',
  262. wfydlxDictionaries:[],
  263. jglxDictionaries:[],
  264. sysDictionaries:[],
  265. capitalExpenditureTypeOptions:[],
  266. bankTypeDictionaries:[],
  267. projectList:[],
  268. projectFundTypeOptions:[],
  269. projectFundTypeDictionaries:[],
  270. projectListShow:[],
  271. payerOptions:[],
  272. chargeItme:[],
  273. chargeItmeShow:[],
  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. // 表单重置
  333. reset() {
  334. this.form = {
  335. id: null,
  336. upId: null,
  337. downId: null,
  338. orderId: null,
  339. cashierId: null,
  340. transferType: '5',
  341. accountType: '2',
  342. explainSituation: null,
  343. succeedAmount: null,
  344. payer: null,
  345. payerAccount: null,
  346. operatorCode: null,
  347. enterpriseCode: null,
  348. expenditureAmount: null,
  349. capitalExpenditureType: '1',
  350. remark: null,
  351. transferStatus: "0",
  352. auditStatus: "0",
  353. paymentState: "1",
  354. bankPriority: "0",
  355. clientPriority: "0"
  356. };
  357. this.processList = {}
  358. this.projectForm={
  359. projectId:null,
  360. projectName:null,
  361. projectContractor:null,
  362. projectAmount:null,
  363. projectBillNum:null,
  364. projectFundType:'1',
  365. outId:null,
  366. ynType:'1'
  367. }
  368. },
  369. goFlow(){
  370. if(this.form.approvalMode == '1' && this.form.approvalTemplateId != undefined && this.form.approvalTemplateId != "undefined"){
  371. window.location='approvalProcess3?approvalTemplateId='+this.form.approvalTemplateId+'&approvalMode='+this.form.approvalMode;
  372. }else{
  373. this.$notify({ type: 'danger', message: '无审批流程!' });
  374. }
  375. },
  376. getChange(){
  377. console.log(this.buttonType)
  378. if(this.buttonType == 'update'){
  379. console.log('update')
  380. this.goUpdate();
  381. }else if(this.buttonType == 'add'){
  382. console.log('add')
  383. this.goAdd();
  384. }
  385. },
  386. getDictionaries(){
  387. this.getDicts("capital_expenditure_type").then((res) => {
  388. for (var i = 0; i < res.data.length; i++) {
  389. this.capitalExpenditureTypeOptions.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  390. }
  391. });
  392. this.getDicts("bank_type").then(res => {
  393. for (var i = 0; i < res.data.length; i++) {
  394. this.bankTypeDictionaries.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  395. }
  396. });
  397. },
  398. getError(e){
  399. console.log(e)
  400. this.$notify({ type: 'danger', message: e.errors[0].message });
  401. },
  402. addChargeItme(index){
  403. if(this.chargeItme.length>0&&this.chargeItme[this.chargeItme.length-1].payee == ''){
  404. this.$notify({ type: 'danger', message: '请勿添加多个空列表信息' });
  405. return;
  406. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].incomeAmount == ''){
  407. this.$notify({ type: 'danger', message: '请输入收入金额!' });
  408. return;
  409. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].payeeAccount == ''){
  410. this.$notify({ type: 'danger', message: '请输入收款账户!' });
  411. return;
  412. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankDeposit == ''){
  413. this.$notify({ type: 'danger', message: '请输入开户银行!' });
  414. return;
  415. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankType == ''){
  416. this.$notify({ type: 'danger', message: '请选择所属银行!' });
  417. return;
  418. }
  419. this.getDicts("bank_type").then(res => {
  420. this.chargeItme.splice(index + 1, 0, {
  421. payeeId: "", //收款方ID
  422. payee: "", //收款方
  423. payeeAccount: "", //收款账户
  424. bankDeposit: "", //开户银行
  425. incomeAmount: "", //收入金额
  426. bankType: "", //所属银行
  427. bankTypeText:"", //所属银行
  428. showPayee:false,
  429. showbankType:false
  430. });
  431. });
  432. this.getPayeeList();
  433. },
  434. getPayeeList() {
  435. //普通转账
  436. this.queryParams.accountType = this.form.accountType
  437. this.queryParams.status = "0"
  438. if(this.form.cashierId==null||this.form.cashierId==""){
  439. this.$notify({ type: 'danger', message: '请先选择付款方!' });
  440. return;
  441. }else {
  442. this.queryParams.taccountId = parseInt(this.form.cashierId)
  443. listVaccount(this.queryParams).then((response) => {
  444. this.payeeList = response.rows;
  445. response.rows.map((res,index) => {
  446. this.payeeList[index].text = res.payee;
  447. this.payeeList[index].value = res.id;
  448. })
  449. });
  450. }
  451. },
  452. payeeDictLabel(datas, value) {
  453. let actions = [];
  454. Object.keys(datas).some((key) => {
  455. if (datas[key].payeeId == ('' + value)) {
  456. actions.push(datas[key].payee);
  457. return true;
  458. }
  459. })
  460. return actions.join('');
  461. },
  462. onConfirmCapital(data){
  463. if (data.value != 2){
  464. this.capitalExpenditureOpen = false;
  465. this.projectForm = [];
  466. }else{
  467. this.capitalExpenditureOpen = true;
  468. }
  469. this.capitalExpenditureType = data.text;
  470. this.form.capitalExpenditureType = data.value;
  471. this.showcapital = false;
  472. },
  473. onConfirmFundType(data){
  474. console.log(data)
  475. this.projectForm.projectFundType = data.value;
  476. this.projectFundType = data.text;
  477. this.showFundType = false;
  478. },
  479. onConfirmProject(data){
  480. this.projectList.map(res => {
  481. if(res.projectName==data.text){
  482. this.projectForm.projectId = res.id
  483. this.projectForm.projectName = res.projectName
  484. this.projectForm.projectContractor = res.projectContractor
  485. this.projectForm.projectAmount = res.projectAmount
  486. }
  487. })
  488. this.showproject = false;
  489. },
  490. onConfirmPayee(data,index){
  491. for (let i = 0 ; i < this.chargeItme.length ; i++){
  492. this.chargeItme[i].showPayee = false;
  493. }
  494. this.chargeItme[index].payee = data.text;
  495. this.chargeItme[index].payeeId = data.value;
  496. this.chargeItme[index].showpayee = false;
  497. this.payeeSelectChange(data.value , index)
  498. this.onConfirmBankType(data,index);
  499. },
  500. onConfirmBankType(data,index){
  501. console.log(this.bankTypeDictionaries)
  502. this.bankTypeDictionaries.map(res => {
  503. if(res.value==data.bankType){
  504. this.chargeItme[index].bankTypeText = res.text;
  505. this.chargeItme[index].bankType = res.value;
  506. }
  507. })
  508. },
  509. onConfirmPayer(data){
  510. console.log(data)
  511. this.form.payer = data.text;
  512. this.form.cashierId = data.value;
  513. this.form.payerAccount = data.payeeAccount;
  514. this.showpayer = false;
  515. // this.selectChange(data.value)
  516. this.accountTypeChange();
  517. },
  518. onConfirmLasj(data){
  519. this.form.applyDate = this.getNowFormatDate(data).substr(0,10);
  520. this.showlasj = false;
  521. },
  522. accountTypeChange(e){
  523. this.payeeList = [];
  524. this.chargeItme = [];
  525. this.queryParams.accountType = this.form.accountType
  526. if(this.form.cashierId==null||this.form.cashierId==""){
  527. this.$notify({ type: 'danger', message: '请先选择付款方!' });
  528. return;
  529. }else {
  530. this.queryParams.taccountId = parseInt(this.form.cashierId)
  531. console.log(this.queryParams)
  532. listVaccount(this.queryParams).then((response) => {
  533. this.payeeList = response.rows;
  534. response.rows.map((res,index) => {
  535. this.payeeList[index].text = res.payee;
  536. this.payeeList[index].value = res.id;
  537. })
  538. });
  539. }
  540. },
  541. // 钱计算
  542. moneyChange(input) {
  543. console.log(input)
  544. let obj = {};
  545. obj = this.chargeItme.find((account) => {
  546. //model就是上面的数据源
  547. return parseFloat(account.incomeAmount).toFixed(2) === input; //筛选出匹配数据
  548. });
  549. let total = 0;
  550. this.chargeItme.forEach((money) => {
  551. total = (parseFloat(total) + parseFloat(money.incomeAmount)).toFixed(2)
  552. });
  553. this.$set(this.form, "expenditureAmount", total);
  554. },
  555. goAdd(){
  556. if(this.chargeItme.length<1){
  557. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  558. return;
  559. }
  560. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  561. this.$notify({ type: 'danger', message: '转账附言禁止包含!' });
  562. return;
  563. }
  564. if(this.form.capitalExpenditureType==2){
  565. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  566. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  567. return;
  568. }
  569. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  570. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  571. return;
  572. }
  573. }
  574. if((this.uploadFiles==null||this.uploadFiles.length==0)&&(this.fileList==null||this.fileList.length==0)){
  575. Dialog.confirm({
  576. title: '提示',
  577. message: '此申请单中未上传任何附件,是否确认提交?',
  578. })
  579. .then(() => {
  580. this.$set(this.form, "payeeList", this.chargeItme);
  581. this.$set(this.form, "bankTypeList", this.chargeItme);
  582. this.$set(this.form, "accountTypeList", this.chargeItme);
  583. this.$set(this.form, "transferStatusList", this.chargeItme);
  584. addTransfer(this.form).then(response => {
  585. this.projectForm.outId = response.data.id
  586. this.$set(this.projectForm, "ynType", '1');
  587. if(this.uploadFiles!=null&&this.uploadFiles.length>0){
  588. this.uploadFiles.map(rr => {
  589. const params = new FormData();
  590. params.append("tableId", response.data.id);
  591. params.append("tableName", "t_yinnong_transfer");
  592. params.append("bizPath", "upload");
  593. params.append("fileType", "0");
  594. params.append("file", rr);
  595. commonAttach(params).then((r) => {
  596. })
  597. })
  598. if(this.form.capitalExpenditureType==2){
  599. addProjectto(this.projectForm).then(res => {
  600. customSubmit(response.data.id).then(res => {
  601. this.$toast.success('提交成功');
  602. setTimeout(function(){
  603. history.go(-1)
  604. },2000)
  605. })
  606. })
  607. }else{
  608. customSubmit(response.data.id).then(res => {
  609. this.$toast.success('提交成功');
  610. setTimeout(function(){
  611. history.go(-1)
  612. },2000)
  613. })
  614. }
  615. }else{
  616. if(this.form.capitalExpenditureType==2){
  617. addProjectto(this.projectForm).then(res => {
  618. customSubmit(response.data.id).then(res => {
  619. this.$toast.success('提交成功');
  620. setTimeout(function(){
  621. history.go(-1)
  622. },2000)
  623. })
  624. })
  625. }else{
  626. customSubmit(response.data.id).then(res => {
  627. this.$toast.success('提交成功');
  628. setTimeout(function(){
  629. history.go(-1)
  630. },2000)
  631. })
  632. }
  633. }
  634. });
  635. })
  636. .catch(() => {
  637. return false;
  638. });
  639. }else{
  640. this.$set(this.form, "payeeList", this.chargeItme);
  641. this.$set(this.form, "bankTypeList", this.chargeItme);
  642. this.$set(this.form, "accountTypeList", this.chargeItme);
  643. this.$set(this.form, "transferStatusList", this.chargeItme);
  644. addTransfer(this.form).then(response => {
  645. this.projectForm.outId = response.data.id
  646. this.$set(this.projectForm, "ynType", '1');
  647. if(this.uploadFiles!=null&&this.uploadFiles.length>0){
  648. this.uploadFiles.map(rr => {
  649. const params = new FormData();
  650. params.append("tableId", response.data.id);
  651. params.append("tableName", "t_yinnong_transfer");
  652. params.append("bizPath", "upload");
  653. params.append("fileType", "0");
  654. params.append("file", rr);
  655. commonAttach(params).then((r) => {
  656. })
  657. })
  658. if(this.form.capitalExpenditureType==2){
  659. addProjectto(this.projectForm).then(res => {
  660. customSubmit(response.data.id).then(res => {
  661. this.$toast.success('提交成功');
  662. setTimeout(function(){
  663. history.go(-1)
  664. },2000)
  665. })
  666. })
  667. }else{
  668. customSubmit(response.data.id).then(res => {
  669. this.$toast.success('提交成功');
  670. setTimeout(function(){
  671. history.go(-1)
  672. },2000)
  673. })
  674. }
  675. }else{
  676. if(this.form.capitalExpenditureType==2){
  677. addProjectto(this.projectForm).then(res => {
  678. customSubmit(response.data.id).then(res => {
  679. this.$toast.success('提交成功');
  680. setTimeout(function(){
  681. history.go(-1)
  682. },2000)
  683. })
  684. })
  685. }else{
  686. customSubmit(response.data.id).then(res => {
  687. this.$toast.success('提交成功');
  688. setTimeout(function(){
  689. history.go(-1)
  690. },2000)
  691. })
  692. }
  693. }
  694. });
  695. }
  696. },
  697. goUpdate(){
  698. if(this.chargeItme.length<1){
  699. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  700. return;
  701. }
  702. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  703. this.$notify({ type: 'danger', message: '转账附言禁止包含!' });
  704. return;
  705. }
  706. if(this.form.capitalExpenditureType==2){
  707. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  708. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  709. return;
  710. }
  711. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  712. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  713. return;
  714. }
  715. }
  716. this.$set(this.form, "payeeList", this.chargeItme);
  717. this.$set(this.form, "bankTypeList", this.chargeItme);
  718. this.$set(this.form, "accountTypeList", this.chargeItme);
  719. this.$set(this.form, "transferStatusList", this.chargeItme);
  720. console.log(this.form)
  721. addTransfer(this.form).then((response) => {
  722. this.projectForm.outId = response.data.id
  723. this.$set(this.projectForm, "ynType", '1');
  724. if(this.uploadFiles!=null&&this.uploadFiles.length>0){
  725. console.log(this.uploadFiles)
  726. this.uploadFiles.map(rr => {
  727. const params = new FormData();
  728. params.append("tableId", response.data.id);
  729. params.append("tableName", "t_yinnong_transfer");
  730. params.append("bizPath", "upload");
  731. params.append("fileType", "0");
  732. params.append("file", rr);
  733. commonAttach(params).then((r) => {
  734. })
  735. })
  736. if(this.form.capitalExpenditureType==2){
  737. addProjectto(this.projectForm).then(res => {
  738. this.$toast.success('保存成功');
  739. setTimeout(function(){
  740. history.go(-1)
  741. },2000)
  742. })
  743. }else{
  744. this.$toast.success('保存成功');
  745. setTimeout(function(){
  746. history.go(-1)
  747. },2000)
  748. }
  749. }else{
  750. if(this.form.capitalExpenditureType==2){
  751. addProjectto(this.projectForm).then(res => {
  752. this.$toast.success('保存成功');
  753. setTimeout(function(){
  754. history.go(-1)
  755. },2000)
  756. })
  757. }else{
  758. this.$toast.success('保存成功');
  759. setTimeout(function(){
  760. history.go(-1)
  761. },2000)
  762. }
  763. }
  764. });
  765. },
  766. payeeSelectChange(select, i) {
  767. let obj = {};
  768. let fuzhitype = 0;
  769. obj = this.payeeList.find((account) => {
  770. //model就是上面的数据源
  771. return account.id === select ; //筛选出匹配数据
  772. });
  773. if(this.chargeItme != [] && this.chargeItme.length>1){
  774. this.chargeItme.some((value, index) => {
  775. if(value.payeeAccount != undefined &&value.payeeAccount != '' && obj.payeeAccount == value.payeeAccount&&index!=i){
  776. fuzhitype = 2;
  777. return true;
  778. }
  779. if(value.accountType != undefined &&value.accountType != '' && obj.accountType != value.accountType&&index!=i){
  780. fuzhitype = 1;
  781. return true;
  782. }
  783. });
  784. }
  785. if(fuzhitype == 0){
  786. this.$set(this.chargeItme[i], "payee",obj.payee)
  787. this.$set(this.chargeItme[i], "bankType", obj.bankType)
  788. this.$set(this.chargeItme[i], "payeeId", obj.id);
  789. this.$set(this.chargeItme[i], "payeeAccount", obj.payeeAccount);
  790. this.$set(this.chargeItme[i], "bankDeposit", obj.bankDeposit);
  791. this.$set(this.chargeItme[i], "accountType", obj.accountType);
  792. }else if(fuzhitype == 1){
  793. this.$set(this.chargeItme[i], "payee",'')
  794. this.$set(this.chargeItme[i], "bankType",'')
  795. this.$set(this.chargeItme[i], "payeeId", '');
  796. this.$set(this.chargeItme[i], "payeeAccount", '');
  797. this.$set(this.chargeItme[i], "bankDeposit", '');
  798. this.$set(this.chargeItme[i], "accountType", '');
  799. this.$notify({ type: 'danger', message: '请选择账户类型相同的收款方!' });
  800. }else if(fuzhitype == 2){
  801. this.$set(this.chargeItme[i], "payee",'')
  802. this.$set(this.chargeItme[i], "bankType",'')
  803. this.$set(this.chargeItme[i], "payeeId", '');
  804. this.$set(this.chargeItme[i], "payeeAccount", '');
  805. this.$set(this.chargeItme[i], "bankDeposit", '');
  806. this.$set(this.chargeItme[i], "accountType", '');
  807. this.$notify({ type: 'danger', message: '收款方已存在!' });
  808. }
  809. },
  810. selectChange(select) {
  811. let obj = {};
  812. obj = this.payerOptions.find((account) => {
  813. //model就是上面的数据源
  814. return account.id === select; //筛选出匹配数据
  815. });
  816. if(obj.payerFrom==1&&obj.operatorCode != null && obj.operatorCode != "" &&
  817. obj.enterpriseCode != null && obj.enterpriseCode != "" &&
  818. obj.accountPassword != null && obj.accountPassword != ""){
  819. this.$set(this.form, "bookId", obj.bookId);
  820. this.$set(this.form, "deptId", obj.deptId);
  821. this.$set(this.form, "cashierId", obj.id);
  822. this.$set(this.form, "payer", obj.accountName);
  823. this.$set(this.form, "payerAccount", obj.bankAccountNumber);
  824. this.$set(this.form, "operatorCode", obj.operatorCode);
  825. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  826. this.$set(this.form, "payerFrom", '1');
  827. }else{
  828. if(obj.payerFrom==1){
  829. this.diglogStatus = false;
  830. this.$notify({ type: 'danger', message: "请完善付款方“操作员代码”、“企业编码”、“支付口令”等信息!" });
  831. this.$set(this.form,"payer","")
  832. this.$set(this.form,"payerAccount","")
  833. }else{
  834. this.$set(this.form, "payerFrom", obj.parerFrom);
  835. if(obj.operatorCode!=null&&obj.operatorCode!=''){
  836. this.$set(this.form, "operatorCode", obj.operatorCode);
  837. }else{
  838. this.$set(this.form, "operatorCode", '');
  839. }
  840. if(obj.enterpriseCode!=null&&obj.enterpriseCode!=''){
  841. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  842. }else{
  843. this.$set(this.form, "enterpriseCode", '');
  844. }
  845. if(obj.accountPassword!=null&&obj.accountPassword!=''){
  846. this.$set(this.form, "accountPassword", obj.accountPassword);
  847. }else{
  848. this.$set(this.form, "accountPassword", '');
  849. }
  850. this.$set(this.form, "bookId",'');
  851. this.$set(this.form, "deptId", '');
  852. this.$set(this.form, "cashierId", obj.id);
  853. this.$set(this.form, "payer", obj.accountName);
  854. if(obj.payerFrom==6){
  855. getQmyeFlow(obj.bankAccountNumber).then((response) => {
  856. this.$set(this.form, "payerAccount", response.data);
  857. });
  858. }else {
  859. this.$set(this.form, "payerAccount", obj.bankAccountNumber);
  860. }
  861. }
  862. }
  863. },
  864. beforeRead(file) {
  865. this.uploadFiles.push(file.file);
  866. },
  867. deleteFile(file){
  868. this.uploadFiles.map((response,index) => {
  869. if(file.file == response){
  870. this.uploadFiles.splice(index,1)
  871. }
  872. })
  873. },
  874. getFileList(){
  875. let oData= {
  876. tableId: this.$route.query.id,
  877. tableName: "t_yinnong_transfer",
  878. bizPath: "upload",
  879. fileType: "0",
  880. }
  881. attachmentList(oData).then(res => {
  882. console.log(res)
  883. console.log(location.protocol+"//"+location.host+request.defaults.baseURL)
  884. res.rows.map(r => {
  885. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  886. this.fileList.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{})})
  887. console.log(r)
  888. })
  889. })
  890. },
  891. goBack(){
  892. window.history.go(-1)
  893. },
  894. //删除家庭成员
  895. deleteChargeItme(index){
  896. this.chargeItme.splice(index,1)
  897. },
  898. },
  899. }
  900. </script>
  901. <style scoped lang="scss">
  902. .app-container {
  903. padding: 2% 0;
  904. }
  905. .main_title{
  906. font-size: 0.4rem;
  907. color: #1D6FE9;
  908. margin: 0.2rem 6%;
  909. position: relative;
  910. }
  911. .main_box{
  912. width: 96%;
  913. margin: 0 auto;
  914. border-radius: 6px;
  915. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  916. overflow: hidden;
  917. background-color: #FFF;
  918. }
  919. .submitButton{
  920. width: 80%;
  921. margin: 0 auto;
  922. background-color: #1D6FE9;
  923. }
  924. .addFamily{
  925. position: absolute;
  926. top: -2px;
  927. right: 0;
  928. border-radius: 50%;
  929. }
  930. .deleteFamily{
  931. position: absolute;
  932. top: 0rem;
  933. right: 6%;
  934. z-index: 9;
  935. border-radius: 50%;
  936. }
  937. </style>