移动端
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

1922 lignes
81 KiB

  1. <template>
  2. <div class="app-container">
  3. <van-nav-bar
  4. left-arrow
  5. fixed
  6. placeholder
  7. @click-left="goBack"
  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. <van-field
  79. v-if="form.approvalMode==1"
  80. readonly
  81. clickable
  82. label="审批流程"
  83. placeholder="请选择"
  84. v-model="form.approvalTemplateName"
  85. @click="showtemplate = true"
  86. input-align="right"
  87. right-icon="arrow-down"
  88. required
  89. :rules="[{ required: true , message:'请选择项目流程' }]"
  90. />
  91. <van-popup v-model="showtemplate" position="bottom">
  92. <van-picker
  93. show-toolbar
  94. value-key="name"
  95. :columns="templateList"
  96. @confirm="onConfirmTemplate"
  97. @cancel="showtemplate = false"
  98. />
  99. </van-popup>
  100. </div>
  101. <div class="main_box" style="margin-top: 10px;">
  102. <van-field
  103. label="付款事由"
  104. v-model="form.remark"
  105. type="textarea"
  106. placeholder="请输入付款事由"
  107. input-align="right"
  108. rows="3"
  109. label-width="auto"
  110. required
  111. :rules="[{ required: true , message:'请输入付款事由' }]"
  112. />
  113. </div>
  114. <div class="main_box" style="margin-top: 10px;">
  115. <van-field label="说明情况" v-model="form.explainSituation" type="textarea" placeholder="请输入说明情况" input-align="right" rows="3" label-width="auto"/>
  116. </div>
  117. <p class="main_title" v-if="capitalExpenditureOpen">关联项目</p>
  118. <div class="main_box" v-if="capitalExpenditureOpen" style="margin-bottom: 10px;margin-top: 10px;position:relative;">
  119. <van-field
  120. readonly
  121. clickable
  122. label="项目名称"
  123. placeholder="请选择"
  124. v-model="projectForm.projectName"
  125. @click="showproject = true"
  126. input-align="right"
  127. right-icon="arrow-down"
  128. required
  129. :rules="[{ required: true , message:'请选择项目名称' }]"
  130. />
  131. <van-popup v-model="showproject" position="bottom">
  132. <van-picker
  133. show-toolbar
  134. :columns="projectList"
  135. @confirm="onConfirmProject"
  136. @cancel="showproject = false"
  137. />
  138. </van-popup>
  139. <van-field required :rules="[{ required: true , message:'请输入承建单位' }]" v-model="projectForm.projectContractor" label="承建单位" placeholder="请输入承建单位" input-align="right" label-width="auto"/>
  140. <van-field required :rules="[{ required: true , message:'请输入合同价款' }]" v-model="projectForm.projectAmount" label="合同价款(元)" placeholder="请输入合同价款(元)" input-align="right" label-width="auto"/>
  141. <van-field
  142. readonly
  143. clickable
  144. label="工程款类型"
  145. placeholder="请选择"
  146. v-model="projectFundType"
  147. @click="showFundType = true"
  148. input-align="right"
  149. right-icon="arrow-down"
  150. required
  151. :rules="[{ required: true , message:'请选择工程款类型' }]"
  152. />
  153. <van-popup v-model="showFundType" position="bottom">
  154. <van-picker
  155. show-toolbar
  156. :columns="projectFundTypeOptions"
  157. @confirm="onConfirmFundType"
  158. @cancel="showFundType = false"
  159. />
  160. </van-popup>
  161. <van-field required :rules="[{ required: true , message:'请输入工程发票号' }]" v-model="projectForm.projectBillNum" label="工程发票号" placeholder="请输入工程发票号" input-align="right" label-width="auto"/>
  162. </div>
  163. <p class="main_title" v-if="contractOpen">关联合同</p>
  164. <div class="main_box" v-if="contractOpen" style="margin-bottom: 10px;margin-top: 10px;position:relative;">
  165. <van-field
  166. readonly
  167. clickable
  168. label="合同"
  169. placeholder="请选择"
  170. v-model="infoForm.name"
  171. @click="showcontract = true"
  172. input-align="right"
  173. right-icon="arrow-down"
  174. required
  175. :rules="[{ required: true , message:'请选择项目名称' }]"
  176. />
  177. <van-popup v-model="showcontract" position="bottom">
  178. <van-picker
  179. show-toolbar
  180. :columns="infoList"
  181. @confirm="onConfirmContract"
  182. @cancel="showcontract = false"
  183. />
  184. </van-popup>
  185. <van-field required :rules="[{ required: true , message:'请输入合同编码' }]" v-model="infoForm.code" label="合同编码" placeholder="请输入合同编码" input-align="right" label-width="auto"/>
  186. <van-field required :rules="[{ required: true , message:'请输入合同价款' }]" v-model="infoForm.totalAmount" label="合同价款(元)" placeholder="请输入合同价款(元)" input-align="right" label-width="auto"/>
  187. </div>
  188. <p class="main_title">付款方信息</p>
  189. <div class="main_box">
  190. <!-- <van-field label="付款方" v-model="form.payer" placeholder="请输入付款方" input-align="right" label-width="auto"/>-->
  191. <van-field
  192. readonly
  193. clickable
  194. label="付款方"
  195. placeholder="请选择付款方"
  196. v-model="form.payer"
  197. @click="showpayer = true"
  198. input-align="right"
  199. right-icon="arrow-down"
  200. label-width="auto"
  201. required
  202. :rules="[{ required: true , message:'请选择付款方' }]"
  203. />
  204. <van-popup v-model="showpayer" position="bottom">
  205. <van-picker
  206. show-toolbar
  207. :columns="payerOptions"
  208. @confirm="onConfirmPayer($event)"
  209. @cancel="showpayer = false"
  210. />
  211. </van-popup>
  212. <van-field :rules="[{ required: true , message:'请输入付款方账户' }]" required label="付款方账户" v-model="form.payerAccount" placeholder="请输入账户" input-align="right" label-width="auto"/>
  213. </div>
  214. <div class="main_title main_title_box">
  215. <p>收款方信息</p>
  216. <router-link :to="{name:'approvalCollectionAdd2', params: {accountType:form.accountType,isPeers:form.isPeers,bankType:form.bankType,option:form}}">添加收款方</router-link>
  217. <van-button icon="plus" @click="addChargeItme(chargeItme.length)" size="mini" type="info" native-type="button" class="addFamily"/>
  218. </div>
  219. <div class="main_box" style="margin-bottom: 15px;">
  220. <van-cell title="收款账户类型" v-if="form.bankType==1">
  221. <template #right-icon>
  222. <van-radio-group direction="horizontal" v-model="form.accountType" @change="accountTypeChange">
  223. <van-radio name="1">公户</van-radio>
  224. <van-radio name="2">私户</van-radio>
  225. </van-radio-group>
  226. </template>
  227. </van-cell>
  228. <van-cell title="是否与付款方同行" v-if="form.bankType==2||form.bankType==3||form.bankType==4" >
  229. <template #right-icon>
  230. <van-radio-group direction="horizontal" v-model="form.isPeers" @change="accountTypeChange1">
  231. <van-radio name="Y">是</van-radio>
  232. <van-radio name="N">否</van-radio>
  233. </van-radio-group>
  234. </template>
  235. </van-cell>
  236. </div>
  237. <div :style="{position:'relative',padding: index == 0 ? '':'10px 0 0 0'}" v-for="(item, index) in chargeItme" :key="index">
  238. <van-button icon="minus" size="mini" type="danger" class="deleteFamily" native-type="button" v-if="index!=0" @click="deleteChargeItme(index)" />
  239. <div class="main_box" style="margin-bottom: 10px;position:relative;">
  240. <van-field
  241. readonly
  242. clickable
  243. label="收款方"
  244. placeholder="请选择"
  245. v-model="item.payee"
  246. @click="item.showPayee = true"
  247. input-align="right"
  248. right-icon="arrow-down"
  249. required
  250. :rules="[{ required: true , message:'请选择收款方' }]"
  251. />
  252. <van-popup v-model="item.showPayee" position="bottom">
  253. <van-picker
  254. show-toolbar
  255. :columns="payeeList"
  256. @confirm="onConfirmPayee($event,index)"
  257. @cancel="item.showPayee = false"
  258. />
  259. </van-popup>
  260. <van-field required readonly :rules="[{ required: true , message:'收款账户不能为空' }]" v-model="item.payeeAccount" label="收款账户" placeholder="请选择收款方" input-align="right" label-width="auto"/>
  261. <van-field required readonly :rules="[{ required: true , message:'开户银行不能为空' }]" v-model="item.bankDeposit" label="开户银行" placeholder="请选择收款方" input-align="right" label-width="auto"/>
  262. <van-field required :rules="[{ required: true , message:'请输入金额' }]" v-model="item.incomeAmount" type="number" label="收入金额" placeholder="请输入金额" input-align="right" label-width="auto" @change="moneyChange"/>
  263. <van-field
  264. readonly
  265. clickable
  266. label="所属银行"
  267. placeholder="请选择收款方"
  268. v-model="item.bankTypeText"
  269. @click="item.showbankType = true"
  270. input-align="right"
  271. required
  272. :rules="[{ required: true , message:'所属银行不能为空' }]"
  273. />
  274. </div>
  275. </div>
  276. <p class="main_title">上传附件</p>
  277. <div class="main_box" style="padding: 5px 0 0 0;">
  278. <van-cell value="收据" />
  279. <van-uploader v-model="fileList1" :after-read="beforeRead1" @delete="deleteFile1" style="margin-left:8px;"></van-uploader>
  280. <van-cell title="发票" />
  281. <van-uploader v-model="fileList2" :after-read="beforeRead2" @delete="deleteFile2" style="margin-left:8px;"></van-uploader>
  282. <van-cell title="其他" />
  283. <van-uploader v-model="fileList3" :after-read="beforeRead3" @delete="deleteFile3" style="margin-left:8px;"></van-uploader>
  284. </div>
  285. <div style="padding: 16px 0;">
  286. <van-row>
  287. <van-col span="12" align="center">
  288. <!-- @click="goUpdate"-->
  289. <van-button type="info" native-type="submit" @click="buttonType='update'" class="submitButton">保<i style="margin-right: 1em;"></i>存</van-button>
  290. </van-col>
  291. <van-col span="12" align="center">
  292. <!-- @click="goAdd"-->
  293. <van-button type="info" native-type="submit" @click="buttonType='add'" class="submitButton">保存并提交</van-button>
  294. </van-col>
  295. </van-row>
  296. <div class="clear"></div>
  297. </div>
  298. </van-form>
  299. </div>
  300. </template>
  301. <script>
  302. import { addTransfer , listPayee , updateTransfer ,selectApprovalByTemplateId,
  303. getProjectto , listProject , addProjectto , customSubmit ,offlineCustomSubmit,
  304. getAccount ,getQmyeFlow,listInfo ,getInfoto ,addInfoto,listTemplate} from "@/api/onlineHome/bankAgriculture/paymentApproval";
  305. import request from '@/utils/request'
  306. import {attachmentList, commonAttach} from "../../../../api/onlineHome/bankAgriculture/paymentApproval";
  307. import Dialog from "vant/lib/dialog";
  308. export default {
  309. name: "approvalAdd2",
  310. data() {
  311. return {
  312. showtemplate:false,
  313. showcontract:false,
  314. showcapital:false,
  315. showpayee:false,
  316. showlasj:false,
  317. showbankType:false,
  318. showproject:false,
  319. showFundType:false,
  320. showpayer:false,
  321. buttonType:'a',
  322. minDate: new Date(2000, 1, 1),
  323. maxDate: new Date(2050, 12, 31),
  324. currentDate: new Date(),
  325. form:{
  326. },
  327. fileList1:[],
  328. fileList2:[],
  329. fileList3:[],
  330. capitalExpenditureType:'',
  331. payee:'',
  332. bankType:'',
  333. wfydlxDictionaries:[],
  334. jglxDictionaries:[],
  335. sysDictionaries:[],
  336. capitalExpenditureTypeOptions:[],
  337. bankTypeDictionaries:[],
  338. projectList:[],
  339. projectFundTypeOptions:[],
  340. projectFundTypeDictionaries:[],
  341. infoList:[],
  342. payerOptions:[],
  343. chargeItme:[],
  344. chargeItmeShow:[],
  345. payeeList:[],
  346. // 查询参数
  347. queryParams: {
  348. transferType:"",
  349. orderByColumn: "id",
  350. isAsc: "desc",
  351. isPeers : null,
  352. accountType : null,
  353. bankType : null,
  354. status : "0"
  355. },
  356. capitalExpenditureOpen:false,
  357. contractOpen:false,
  358. 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. infoForm:{
  369. infoId:null,
  370. name:null,
  371. code:null,
  372. totalAmount:null,
  373. contractionId:null,
  374. transferId:null
  375. },
  376. // 合同信息查询参数
  377. queryContractionParams: {
  378. pageNum: 1,
  379. pageSize: 100,
  380. contractionStatus: '1',
  381. orderByColumn: "endTime",
  382. isAsc: "desc",
  383. },
  384. projectFundType:'',
  385. uploadFiles1:[],
  386. uploadFiles2:[],
  387. uploadFiles3:[],
  388. nowDate:"",
  389. templateList:[],
  390. };
  391. },
  392. created() {
  393. this.getNowDate();
  394. this.reset();
  395. this.initProjectInfo();
  396. this.getDicts("project_fund_type").then((response) => {
  397. for (var i = 0; i < response.data.length; i++) {
  398. this.projectFundTypeOptions.push({text: response.data[i].dictLabel, value: response.data[i].dictValue});
  399. }
  400. this.projectFundTypeDictionaries = response.data;
  401. });
  402. let params1={
  403. accountType: "102",
  404. status: "N",
  405. }
  406. getAccount(params1).then((response) => {
  407. this.payerOptions = response.rows;
  408. response.rows.map((res,index) => {
  409. res['payerFrom'] = '1'
  410. this.payerOptions[index].text = res.accountName;
  411. this.payerOptions[index].value = res.id;
  412. })
  413. });
  414. this.getDictionaries();
  415. this.getTemplateList();
  416. },
  417. methods: {
  418. getTemplateList(){
  419. let templateQueryParams = {
  420. // 分页
  421. pageNum: 1,
  422. pageSize: 999,
  423. type:'2'
  424. };
  425. listTemplate(templateQueryParams).then(response => {
  426. this.templateList = response.rows;
  427. });
  428. },
  429. onConfirmTemplate(data){
  430. selectApprovalByTemplateId(data.id).then(res => {
  431. this.showtemplate = false;
  432. if(res.approvalDetails.length>0){
  433. this.form.approvalTemplateName = data.name
  434. this.form.approvalTemplateId = data.id
  435. }else{
  436. this.form.approvalTemplateName = null
  437. this.form.approvalTemplateId = null
  438. this.$notify({ type: 'danger', message: '此流程无节点,无法选择!' });
  439. }
  440. })
  441. },
  442. getNowDate(){
  443. var _this = this;
  444. let yy = new Date().getFullYear();
  445. let mm = new Date().getMonth()+1;
  446. let dd = new Date().getDate();
  447. _this.nowDate = yy+'-'+mm+'-'+dd
  448. },
  449. initProjectInfo(){
  450. let _this = this
  451. let queryParams={
  452. pageNum: 1,
  453. pageSize: 100,
  454. }
  455. listProject(queryParams).then(response => {
  456. _this.projectList = response.rows;
  457. console.log(response)
  458. for (let i = 0; i < response.rows.length; i++) {
  459. //_this.projectList[i].set({text: response.rows[i].projectName, value: response.rows[i].id});
  460. _this.$set(_this.projectList[i],"text",response.rows[i].projectName)
  461. _this.$set(_this.projectList[i],"value",response.rows[i].id)
  462. }
  463. });
  464. listInfo(this.queryContractionParams).then(response => {
  465. _this.infoList = response.rows;
  466. for (let i = 0; i < response.rows.length; i++) {
  467. //_this.infoList[i].push({text: response.rows[i].name, value: response.rows[i].code});
  468. _this.$set(_this.infoList[i],"text",response.rows[i].name)
  469. _this.$set(_this.infoList[i],"value",response.rows[i].code)
  470. }
  471. });
  472. },
  473. // 表单重置
  474. reset() {
  475. this.form = {
  476. id: null,
  477. applyDate:this.nowDate,
  478. approvalMode:'1',
  479. upId: null,
  480. downId: null,
  481. orderId: null,
  482. cashierId: null,
  483. transferType: '2',
  484. accountType: '2',
  485. explainSituation: null,
  486. succeedAmount: null,
  487. payer: null,
  488. payerAccount: null,
  489. operatorCode: null,
  490. enterpriseCode: null,
  491. expenditureAmount: null,
  492. capitalExpenditureType: '1',
  493. remark: null,
  494. transferStatus: "0",
  495. auditStatus: "0",
  496. paymentState: "1",
  497. bankPriority: "0",
  498. clientPriority: "0",
  499. isPeers:"N"
  500. };
  501. this.processList = {}
  502. this.projectForm={
  503. projectId:null,
  504. projectName:null,
  505. projectContractor:null,
  506. projectAmount:null,
  507. projectBillNum:null,
  508. projectFundType:'1',
  509. outId:null,
  510. ynType:'1'
  511. }
  512. },
  513. getChange(){
  514. if(this.buttonType == 'update'){
  515. this.goUpdate();
  516. }else if(this.buttonType == 'add'){
  517. this.goAdd();
  518. }
  519. },
  520. getDictionaries(){
  521. this.getDicts("capital_expenditure_type").then((res) => {
  522. for (var i = 0; i < res.data.length; i++) {
  523. this.capitalExpenditureTypeOptions.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  524. }
  525. });
  526. this.getDicts("bank_type").then(res => {
  527. for (var i = 0; i < res.data.length; i++) {
  528. this.bankTypeDictionaries.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  529. }
  530. });
  531. this.getPayeeList();
  532. },
  533. getError(e){
  534. this.$notify({ type: 'danger', message: e.errors[0].message });
  535. },
  536. addChargeItme(index){
  537. if(this.chargeItme.length>0&&this.chargeItme[this.chargeItme.length-1].payee == ''){
  538. this.$notify({ type: 'danger', message: '请勿添加多个空列表信息' });
  539. return;
  540. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].incomeAmount == ''){
  541. this.$notify({ type: 'danger', message: '请输入收入金额!' });
  542. return;
  543. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].payeeAccount == ''){
  544. this.$notify({ type: 'danger', message: '请输入收款账户!' });
  545. return;
  546. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankDeposit == ''){
  547. this.$notify({ type: 'danger', message: '请输入开户银行!' });
  548. return;
  549. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankType == ''){
  550. this.$notify({ type: 'danger', message: '请选择所属银行!' });
  551. return;
  552. }
  553. this.getDicts("bank_type").then(res => {
  554. this.chargeItme.splice(index + 1, 0, {
  555. payeeId: "", //收款方ID
  556. payee: "", //收款方
  557. payeeAccount: "", //收款账户
  558. bankDeposit: "", //开户银行
  559. incomeAmount: "", //收入金额
  560. bankType: "", //所属银行
  561. bankTypeText:"", //所属银行
  562. showPayee:false,
  563. showbankType:false
  564. });
  565. });
  566. },
  567. getPayeeList() {
  568. //信用卡转账
  569. this.queryParams.isPeers = this.form.isPeers?this.form.isPeers:null
  570. this.queryParams.accountType = this.form.accountType?this.form.accountType:null
  571. this.queryParams.bankType = this.form.bankType
  572. this.queryParams.status = "0"
  573. listPayee(this.queryParams).then((response) => {
  574. response.rows.map((res,index) => {
  575. if(res.payeeType==4||res.payeeType==3){
  576. res.text = res.payee
  577. res.value = res.id
  578. this.payeeList.push(res)
  579. }
  580. })
  581. });
  582. },
  583. payeeDictLabel(datas, value) {
  584. let actions = [];
  585. Object.keys(datas).some((key) => {
  586. if (datas[key].payeeId == ('' + value)) {
  587. actions.push(datas[key].payee);
  588. return true;
  589. }
  590. })
  591. return actions.join('');
  592. },
  593. onConfirmCapital(data){
  594. if (data.value == 2){
  595. this.capitalExpenditureOpen = true;
  596. this.contractOpen = false
  597. this.infoForm = {};
  598. }else if(data.value == 4){
  599. this.capitalExpenditureOpen = false;
  600. this.contractOpen = true
  601. this.projectForm = {};
  602. }else{
  603. this.capitalExpenditureOpen = false;
  604. this.contractOpen = false
  605. this.projectForm = {};
  606. this.infoForm = {};
  607. }
  608. this.capitalExpenditureType = data.text;
  609. this.form.capitalExpenditureType = data.value;
  610. this.showcapital = false;
  611. },
  612. onConfirmFundType(data){
  613. this.projectForm.projectFundType = data.value;
  614. this.projectFundType = data.text;
  615. this.showFundType = false;
  616. },
  617. onConfirmContract(data){
  618. this.infoList.map(res => {
  619. if(res.name==data.text){
  620. this.infoForm.contractionId = res.id;
  621. this.infoForm.name = res.name;
  622. this.infoForm.code = res.code;
  623. this.infoForm.totalAmount = res.totalAmount;
  624. }
  625. })
  626. this.showcontract = false;
  627. },
  628. onConfirmProject(data){
  629. this.projectList.map(res => {
  630. if(res.projectName==data.text){
  631. this.projectForm.projectId = res.id
  632. this.projectForm.projectName = res.projectName
  633. this.projectForm.projectContractor = res.projectContractor
  634. this.projectForm.projectAmount = res.projectAmount
  635. }
  636. })
  637. this.showproject = false;
  638. },
  639. onConfirmPayee(data,index){
  640. for (let i = 0 ; i < this.chargeItme.length ; i++){
  641. this.chargeItme[i].showPayee = false;
  642. }
  643. this.chargeItme[index].payee = data.text;
  644. this.chargeItme[index].payeeId = data.value;
  645. this.chargeItme[index].showpayee = false;
  646. this.payeeSelectChange(data.value , index)
  647. this.onConfirmBankType(data,index)
  648. },
  649. onConfirmBankType(data,index){
  650. console.log(this.bankTypeDictionaries)
  651. this.bankTypeDictionaries.map(res => {
  652. if(res.value==data.bankType){
  653. this.chargeItme[index].bankTypeText = res.text;
  654. this.chargeItme[index].bankType = res.value;
  655. }
  656. })
  657. },
  658. onConfirmPayer(data){
  659. this.form.payer = data.text;
  660. this.form.cashierId = data.value;
  661. this.showpayer = false;
  662. this.selectChange(data.value)
  663. },
  664. onConfirmLasj(data){
  665. this.form.applyDate = this.getNowFormatDate(data).substr(0,10);
  666. this.showlasj = false;
  667. },
  668. accountTypeChange(e){
  669. this.payeeList = [];
  670. this.chargeItme = [];
  671. this.queryParams.accountType = this.form.accountType?this.form.accountType:null
  672. this.queryParams.bankType = this.form.bankType
  673. this.queryParams.status = "0"
  674. listPayee(this.queryParams).then((response) => {
  675. response.rows.map((res,index) => {
  676. if(res.payeeType==4||res.payeeType==3){
  677. res.text = res.payee
  678. res.value = res.id
  679. this.payeeList.push(res)
  680. }
  681. })
  682. });
  683. },
  684. accountTypeChange1(e){
  685. this.payeeList = [];
  686. this.chargeItme = [];
  687. this.queryParams.isPeers = this.form.isPeers?this.form.isPeers:null
  688. this.queryParams.bankType = this.form.bankType?this.form.bankType:null
  689. this.queryParams.status = "0"
  690. listPayee(this.queryParams).then((response) => {
  691. response.rows.map((res,index) => {
  692. if(res.payeeType==4||res.payeeType==3){
  693. res.text = res.payee
  694. res.value = res.id
  695. this.payeeList.push(res)
  696. }
  697. })
  698. });
  699. },
  700. // 钱计算
  701. moneyChange(input) {
  702. let obj = {};
  703. obj = this.chargeItme.find((account) => {
  704. //model就是上面的数据源
  705. return parseFloat(account.incomeAmount).toFixed(2) === input; //筛选出匹配数据
  706. });
  707. let total = 0;
  708. this.chargeItme.forEach((money) => {
  709. total = (parseFloat(total) + parseFloat(money.incomeAmount)).toFixed(2)
  710. });
  711. this.$set(this.form, "expenditureAmount", total);
  712. },
  713. goAdd(){
  714. let _this = this
  715. if(this.chargeItme.length<1){
  716. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  717. return;
  718. }
  719. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  720. this.$notify({ type: 'danger', message: '付款事由禁止包含!' });
  721. return;
  722. }
  723. if(this.form.capitalExpenditureType==2){
  724. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  725. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  726. return;
  727. }
  728. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  729. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  730. return;
  731. }
  732. }
  733. if(this.form.capitalExpenditureType==4){
  734. if(this.infoForm.name==""||this.infoForm.name==null){
  735. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  736. return;
  737. }
  738. if(this.infoForm.code==""||this.infoForm.code==null){
  739. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  740. return;
  741. }
  742. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  743. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  744. return;
  745. }
  746. }
  747. if((this.uploadFiles1==null||this.uploadFiles1.length==0)&&(this.uploadFiles2==null||this.uploadFiles2.length==0)&&(this.uploadFiles3==null||this.uploadFiles3.length==0)){
  748. Dialog.confirm({
  749. title: '提示',
  750. message: '此申请单中未上传任何附件,是否确认提交?',
  751. })
  752. .then(() => {
  753. this.$set(this.form, "payeeList", this.chargeItme);
  754. this.$set(this.form, "bankTypeList", this.chargeItme);
  755. this.$set(this.form, "accountTypeList", this.chargeItme);
  756. this.$set(this.form, "transferStatusList", this.chargeItme);
  757. addTransfer(this.form).then(response => {
  758. this.projectForm.outId = response.data.id
  759. this.infoForm.transferId = response.data.id
  760. this.$set(this.projectForm, "ynType", '1');
  761. if(this.form.capitalExpenditureType==2){
  762. addProjectto(this.projectForm).then(res => {
  763. if(this.form.approvalMode === '1'){
  764. customSubmit(response.data.id).then(res => {
  765. this.$toast.success('提交成功');
  766. setTimeout(function(){
  767. history.go(-1)
  768. },2000)
  769. })
  770. }else{
  771. offlineCustomSubmit(response.data.id).then(res => {
  772. this.$toast.success('提交成功');
  773. setTimeout(function(){
  774. history.go(-1)
  775. },2000)
  776. })
  777. }
  778. })
  779. }else if(this.form.capitalExpenditureType==4){
  780. addInfoto(this.infoForm).then(res => {
  781. if(this.form.approvalMode === '1'){
  782. customSubmit(response.data.id).then(res => {
  783. this.$toast.success('提交成功');
  784. setTimeout(function(){
  785. history.go(-1)
  786. },2000)
  787. })
  788. }else{
  789. offlineCustomSubmit(response.data.id).then(res => {
  790. this.$toast.success('提交成功');
  791. setTimeout(function(){
  792. history.go(-1)
  793. },2000)
  794. })
  795. }
  796. })
  797. }else{
  798. if(this.form.approvalMode === '1'){
  799. customSubmit(response.data.id).then(res => {
  800. this.$toast.success('提交成功');
  801. setTimeout(function(){
  802. history.go(-1)
  803. },2000)
  804. })
  805. }else{
  806. offlineCustomSubmit(response.data.id).then(res => {
  807. this.$toast.success('提交成功');
  808. setTimeout(function(){
  809. history.go(-1)
  810. },2000)
  811. })
  812. }
  813. }
  814. });
  815. })
  816. .catch(() => {
  817. return false;
  818. });
  819. }else{
  820. this.$set(this.form, "payeeList", this.chargeItme);
  821. this.$set(this.form, "bankTypeList", this.chargeItme);
  822. this.$set(this.form, "accountTypeList", this.chargeItme);
  823. this.$set(this.form, "transferStatusList", this.chargeItme);
  824. addTransfer(this.form).then(response => {
  825. this.projectForm.outId = response.data.id
  826. this.infoForm.transferId = response.data.id
  827. this.$set(this.projectForm, "ynType", '1');
  828. if(this.uploadFiles1!=null&&this.uploadFiles1.length>0){
  829. this.uploadFiles1.map((rr1,idx1) => {
  830. let params1 = new FormData();
  831. params1.append("tableId", response.data.id);
  832. params1.append("tableName", "t_yinnong_transfer");
  833. params1.append("bizPath", "transfer");
  834. params1.append("fileType", "1");
  835. params1.append("file", rr1);
  836. commonAttach(params1).then((r1) => {
  837. if(idx1 == (_this.uploadFiles1.length-1)){
  838. if(_this.uploadFiles2!=null&&_this.uploadFiles2.length>0){
  839. _this.uploadFiles2.map((rr2,idx2) => {
  840. let params2 = new FormData();
  841. params2.append("tableId", response.data.id);
  842. params2.append("tableName", "t_yinnong_transfer");
  843. params2.append("bizPath", "transfer");
  844. params2.append("fileType", "2");
  845. params2.append("file", rr2);
  846. commonAttach(params2).then((r2) => {
  847. if(idx2 == (_this.uploadFiles2.length-1)){
  848. if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){
  849. _this.uploadFiles3.map((rr3,idx3) => {
  850. let params3 = new FormData();
  851. params3.append("tableId", response.data.id);
  852. params3.append("tableName", "t_yinnong_transfer");
  853. params3.append("bizPath", "transfer");
  854. params3.append("fileType", "3");
  855. params3.append("file", rr3);
  856. commonAttach(params3).then((r3) => {
  857. if(idx3 == (_this.uploadFiles3.length-1)){
  858. if(_this.form.capitalExpenditureType==2){
  859. addProjectto(_this.projectForm).then(res => {
  860. if(_this.form.approvalMode === '1'){
  861. customSubmit(response.data.id).then(res => {
  862. _this.$toast.success('提交成功');
  863. setTimeout(function(){
  864. history.go(-1)
  865. },2000)
  866. })
  867. }else{
  868. offlineCustomSubmit(response.data.id).then(res => {
  869. _this.$toast.success('提交成功');
  870. setTimeout(function(){
  871. history.go(-1)
  872. },2000)
  873. })
  874. }
  875. })
  876. } else if(_this.form.capitalExpenditureType==4){
  877. addInfoto(_this.infoForm).then(res => {
  878. if(_this.form.approvalMode === '1'){
  879. customSubmit(response.data.id).then(res => {
  880. _this.$toast.success('提交成功');
  881. setTimeout(function(){
  882. history.go(-1)
  883. },2000)
  884. })
  885. }else{
  886. offlineCustomSubmit(response.data.id).then(res => {
  887. _this.$toast.success('提交成功');
  888. setTimeout(function(){
  889. history.go(-1)
  890. },2000)
  891. })
  892. }
  893. })
  894. }else{
  895. if(_this.form.approvalMode === '1'){
  896. customSubmit(response.data.id).then(res => {
  897. _this.$toast.success('提交成功');
  898. setTimeout(function(){
  899. history.go(-1)
  900. },2000)
  901. })
  902. }else{
  903. offlineCustomSubmit(response.data.id).then(res => {
  904. _this.$toast.success('提交成功');
  905. setTimeout(function(){
  906. history.go(-1)
  907. },2000)
  908. })
  909. }
  910. }
  911. }
  912. })
  913. })
  914. }else{
  915. if(_this.form.capitalExpenditureType==2){
  916. addProjectto(_this.projectForm).then(res => {
  917. if(_this.form.approvalMode === '1'){
  918. customSubmit(response.data.id).then(res => {
  919. _this.$toast.success('提交成功');
  920. setTimeout(function(){
  921. history.go(-1)
  922. },2000)
  923. })
  924. }else{
  925. offlineCustomSubmit(response.data.id).then(res => {
  926. _this.$toast.success('提交成功');
  927. setTimeout(function(){
  928. history.go(-1)
  929. },2000)
  930. })
  931. }
  932. })
  933. } else if(_this.form.capitalExpenditureType==4){
  934. addInfoto(_this.infoForm).then(res => {
  935. if(_this.form.approvalMode === '1'){
  936. customSubmit(response.data.id).then(res => {
  937. _this.$toast.success('提交成功');
  938. setTimeout(function(){
  939. history.go(-1)
  940. },2000)
  941. })
  942. }else{
  943. offlineCustomSubmit(response.data.id).then(res => {
  944. _this.$toast.success('提交成功');
  945. setTimeout(function(){
  946. history.go(-1)
  947. },2000)
  948. })
  949. }
  950. })
  951. }else{
  952. if(_this.form.approvalMode === '1'){
  953. customSubmit(response.data.id).then(res => {
  954. _this.$toast.success('提交成功');
  955. setTimeout(function(){
  956. history.go(-1)
  957. },2000)
  958. })
  959. }else{
  960. offlineCustomSubmit(response.data.id).then(res => {
  961. _this.$toast.success('提交成功');
  962. setTimeout(function(){
  963. history.go(-1)
  964. },2000)
  965. })
  966. }
  967. }
  968. }
  969. }
  970. })
  971. })
  972. }else if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){
  973. _this.uploadFiles3.map((rr3,idx3) => {
  974. let params3 = new FormData();
  975. params3.append("tableId", response.data.id);
  976. params3.append("tableName", "t_yinnong_transfer");
  977. params3.append("bizPath", "transfer");
  978. params3.append("fileType", "3");
  979. params3.append("file", rr3);
  980. commonAttach(params3).then((r3) => {
  981. if(idx3 ==(_this.uploadFiles3.length-1)){
  982. if(_this.form.capitalExpenditureType==2){
  983. addProjectto(_this.projectForm).then(res => {
  984. if(_this.form.approvalMode === '1'){
  985. customSubmit(response.data.id).then(res => {
  986. _this.$toast.success('提交成功');
  987. setTimeout(function(){
  988. history.go(-1)
  989. },2000)
  990. })
  991. }else{
  992. offlineCustomSubmit(response.data.id).then(res => {
  993. _this.$toast.success('提交成功');
  994. setTimeout(function(){
  995. history.go(-1)
  996. },2000)
  997. })
  998. }
  999. })
  1000. } else if(_this.form.capitalExpenditureType==4){
  1001. addInfoto(_this.infoForm).then(res => {
  1002. if(_this.form.approvalMode === '1'){
  1003. customSubmit(response.data.id).then(res => {
  1004. _this.$toast.success('提交成功');
  1005. setTimeout(function(){
  1006. history.go(-1)
  1007. },2000)
  1008. })
  1009. }else{
  1010. offlineCustomSubmit(response.data.id).then(res => {
  1011. _this.$toast.success('提交成功');
  1012. setTimeout(function(){
  1013. history.go(-1)
  1014. },2000)
  1015. })
  1016. }
  1017. })
  1018. }else{
  1019. if(_this.form.approvalMode === '1'){
  1020. customSubmit(response.data.id).then(res => {
  1021. _this.$toast.success('提交成功');
  1022. setTimeout(function(){
  1023. history.go(-1)
  1024. },2000)
  1025. })
  1026. }else{
  1027. offlineCustomSubmit(response.data.id).then(res => {
  1028. _this.$toast.success('提交成功');
  1029. setTimeout(function(){
  1030. history.go(-1)
  1031. },2000)
  1032. })
  1033. }
  1034. }
  1035. }
  1036. })
  1037. })
  1038. }else{
  1039. if(_this.form.capitalExpenditureType==2){
  1040. addProjectto(_this.projectForm).then(res => {
  1041. if(_this.form.approvalMode === '1'){
  1042. customSubmit(response.data.id).then(res => {
  1043. _this.$toast.success('提交成功');
  1044. setTimeout(function(){
  1045. history.go(-1)
  1046. },2000)
  1047. })
  1048. }else{
  1049. offlineCustomSubmit(response.data.id).then(res => {
  1050. _this.$toast.success('提交成功');
  1051. setTimeout(function(){
  1052. history.go(-1)
  1053. },2000)
  1054. })
  1055. }
  1056. })
  1057. } else if(_this.form.capitalExpenditureType==4){
  1058. addInfoto(_this.infoForm).then(res => {
  1059. if(_this.form.approvalMode === '1'){
  1060. customSubmit(response.data.id).then(res => {
  1061. _this.$toast.success('提交成功');
  1062. setTimeout(function(){
  1063. history.go(-1)
  1064. },2000)
  1065. })
  1066. }else{
  1067. offlineCustomSubmit(response.data.id).then(res => {
  1068. _this.$toast.success('提交成功');
  1069. setTimeout(function(){
  1070. history.go(-1)
  1071. },2000)
  1072. })
  1073. }
  1074. })
  1075. }else{
  1076. if(_this.form.approvalMode === '1'){
  1077. customSubmit(response.data.id).then(res => {
  1078. _this.$toast.success('提交成功');
  1079. setTimeout(function(){
  1080. history.go(-1)
  1081. },2000)
  1082. })
  1083. }else{
  1084. offlineCustomSubmit(response.data.id).then(res => {
  1085. _this.$toast.success('提交成功');
  1086. setTimeout(function(){
  1087. history.go(-1)
  1088. },2000)
  1089. })
  1090. }
  1091. }
  1092. }
  1093. }
  1094. })
  1095. })
  1096. }else if(this.uploadFiles2!=null&&this.uploadFiles2.length>0){
  1097. this.uploadFiles2.map((rr2,idx2) => {
  1098. let params = new FormData();
  1099. params.append("tableId", response.data.id);
  1100. params.append("tableName", "t_yinnong_transfer");
  1101. params.append("bizPath", "transfer");
  1102. params.append("fileType", "2");
  1103. params.append("file", rr2);
  1104. commonAttach(params).then((r2) => {
  1105. if(idx2 == (_this.uploadFiles2.length-1)){
  1106. if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){
  1107. _this.uploadFiles3.map((rr3,idx3) => {
  1108. let params3 = new FormData();
  1109. params3.append("tableId", response.data.id);
  1110. params3.append("tableName", "t_yinnong_transfer");
  1111. params3.append("bizPath", "transfer");
  1112. params3.append("fileType", "3");
  1113. params3.append("file", rr3);
  1114. commonAttach(params).then((r3) => {
  1115. if(idx3 == (_this.uploadFiles3.length-1)){
  1116. if(_this.form.capitalExpenditureType==2){
  1117. addProjectto(_this.projectForm).then(res => {
  1118. if(_this.form.approvalMode === '1'){
  1119. customSubmit(response.data.id).then(res => {
  1120. _this.$toast.success('提交成功');
  1121. setTimeout(function(){
  1122. history.go(-1)
  1123. },2000)
  1124. })
  1125. }else{
  1126. offlineCustomSubmit(response.data.id).then(res => {
  1127. _this.$toast.success('提交成功');
  1128. setTimeout(function(){
  1129. history.go(-1)
  1130. },2000)
  1131. })
  1132. }
  1133. })
  1134. } else if(_this.form.capitalExpenditureType==4){
  1135. addInfoto(_this.infoForm).then(res => {
  1136. if(_this.form.approvalMode === '1'){
  1137. customSubmit(response.data.id).then(res => {
  1138. _this.$toast.success('提交成功');
  1139. setTimeout(function(){
  1140. history.go(-1)
  1141. },2000)
  1142. })
  1143. }else{
  1144. offlineCustomSubmit(response.data.id).then(res => {
  1145. _this.$toast.success('提交成功');
  1146. setTimeout(function(){
  1147. history.go(-1)
  1148. },2000)
  1149. })
  1150. }
  1151. })
  1152. }else{
  1153. if(_this.form.approvalMode === '1'){
  1154. customSubmit(response.data.id).then(res => {
  1155. _this.$toast.success('提交成功');
  1156. setTimeout(function(){
  1157. history.go(-1)
  1158. },2000)
  1159. })
  1160. }else{
  1161. offlineCustomSubmit(response.data.id).then(res => {
  1162. _this.$toast.success('提交成功');
  1163. setTimeout(function(){
  1164. history.go(-1)
  1165. },2000)
  1166. })
  1167. }
  1168. }
  1169. }
  1170. })
  1171. })
  1172. }else{
  1173. if(_this.form.capitalExpenditureType==2){
  1174. addProjectto(_this.projectForm).then(res => {
  1175. if(_this.form.approvalMode === '1'){
  1176. customSubmit(response.data.id).then(res => {
  1177. _this.$toast.success('提交成功');
  1178. setTimeout(function(){
  1179. history.go(-1)
  1180. },2000)
  1181. })
  1182. }else{
  1183. offlineCustomSubmit(response.data.id).then(res => {
  1184. _this.$toast.success('提交成功');
  1185. setTimeout(function(){
  1186. history.go(-1)
  1187. },2000)
  1188. })
  1189. }
  1190. })
  1191. } else if(_this.form.capitalExpenditureType==4){
  1192. addInfoto(_this.infoForm).then(res => {
  1193. if(_this.form.approvalMode === '1'){
  1194. customSubmit(response.data.id).then(res => {
  1195. _this.$toast.success('提交成功');
  1196. setTimeout(function(){
  1197. history.go(-1)
  1198. },2000)
  1199. })
  1200. }else{
  1201. offlineCustomSubmit(response.data.id).then(res => {
  1202. _this.$toast.success('提交成功');
  1203. setTimeout(function(){
  1204. history.go(-1)
  1205. },2000)
  1206. })
  1207. }
  1208. })
  1209. }else{
  1210. if(_this.form.approvalMode === '1'){
  1211. customSubmit(response.data.id).then(res => {
  1212. _this.$toast.success('提交成功');
  1213. setTimeout(function(){
  1214. history.go(-1)
  1215. },2000)
  1216. })
  1217. }else{
  1218. offlineCustomSubmit(response.data.id).then(res => {
  1219. _this.$toast.success('提交成功');
  1220. setTimeout(function(){
  1221. history.go(-1)
  1222. },2000)
  1223. })
  1224. }
  1225. }
  1226. }
  1227. }
  1228. })
  1229. })
  1230. }else if(this.uploadFiles3!=null&&this.uploadFiles3.length>0){
  1231. this.uploadFiles3.map((rr3,idx3) => {
  1232. let params = new FormData();
  1233. params.append("tableId", response.data.id);
  1234. params.append("tableName", "t_yinnong_transfer");
  1235. params.append("bizPath", "transfer");
  1236. params.append("fileType", "3");
  1237. params.append("file", rr3);
  1238. commonAttach(params).then((r) => {
  1239. if(idx3 == (_this.uploadFiles3.length-1)){
  1240. if(_this.form.capitalExpenditureType==2){
  1241. addProjectto(_this.projectForm).then(res => {
  1242. if(_this.form.approvalMode === '1'){
  1243. customSubmit(response.data.id).then(res => {
  1244. _this.$toast.success('提交成功');
  1245. setTimeout(function(){
  1246. history.go(-1)
  1247. },2000)
  1248. })
  1249. }else{
  1250. offlineCustomSubmit(response.data.id).then(res => {
  1251. _this.$toast.success('提交成功');
  1252. setTimeout(function(){
  1253. history.go(-1)
  1254. },2000)
  1255. })
  1256. }
  1257. })
  1258. } else if(_this.form.capitalExpenditureType==4){
  1259. addInfoto(_this.infoForm).then(res => {
  1260. if(_this.form.approvalMode === '1'){
  1261. customSubmit(response.data.id).then(res => {
  1262. _this.$toast.success('提交成功');
  1263. setTimeout(function(){
  1264. history.go(-1)
  1265. },2000)
  1266. })
  1267. }else{
  1268. offlineCustomSubmit(response.data.id).then(res => {
  1269. _this.$toast.success('提交成功');
  1270. setTimeout(function(){
  1271. history.go(-1)
  1272. },2000)
  1273. })
  1274. }
  1275. })
  1276. }else{
  1277. if(_this.form.approvalMode === '1'){
  1278. customSubmit(response.data.id).then(res => {
  1279. _this.$toast.success('提交成功');
  1280. setTimeout(function(){
  1281. history.go(-1)
  1282. },2000)
  1283. })
  1284. }else{
  1285. offlineCustomSubmit(response.data.id).then(res => {
  1286. _this.$toast.success('提交成功');
  1287. setTimeout(function(){
  1288. history.go(-1)
  1289. },2000)
  1290. })
  1291. }
  1292. }
  1293. }
  1294. })
  1295. })
  1296. }else{
  1297. if(this.form.capitalExpenditureType==2){
  1298. addProjectto(this.projectForm).then(res => {
  1299. if(_this.form.approvalMode === '1'){
  1300. customSubmit(response.data.id).then(res => {
  1301. _this.$toast.success('提交成功');
  1302. setTimeout(function(){
  1303. history.go(-1)
  1304. },2000)
  1305. })
  1306. }else{
  1307. offlineCustomSubmit(response.data.id).then(res => {
  1308. _this.$toast.success('提交成功');
  1309. setTimeout(function(){
  1310. history.go(-1)
  1311. },2000)
  1312. })
  1313. }
  1314. })
  1315. } else if(this.form.capitalExpenditureType==4){
  1316. addInfoto(this.infoForm).then(res => {
  1317. if(_this.form.approvalMode === '1'){
  1318. customSubmit(response.data.id).then(res => {
  1319. _this.$toast.success('提交成功');
  1320. setTimeout(function(){
  1321. history.go(-1)
  1322. },2000)
  1323. })
  1324. }else{
  1325. offlineCustomSubmit(response.data.id).then(res => {
  1326. _this.$toast.success('提交成功');
  1327. setTimeout(function(){
  1328. history.go(-1)
  1329. },2000)
  1330. })
  1331. }
  1332. })
  1333. }else{
  1334. if(_this.form.approvalMode === '1'){
  1335. customSubmit(response.data.id).then(res => {
  1336. _this.$toast.success('提交成功');
  1337. setTimeout(function(){
  1338. history.go(-1)
  1339. },2000)
  1340. })
  1341. }else{
  1342. offlineCustomSubmit(response.data.id).then(res => {
  1343. _this.$toast.success('提交成功');
  1344. setTimeout(function(){
  1345. history.go(-1)
  1346. },2000)
  1347. })
  1348. }
  1349. }
  1350. }
  1351. });
  1352. }
  1353. },
  1354. goUpdate(){
  1355. let _this = this
  1356. if(this.chargeItme.length<1){
  1357. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  1358. return;
  1359. }
  1360. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  1361. this.$notify({ type: 'danger', message: '付款事由禁止包含!' });
  1362. return;
  1363. }
  1364. if(this.form.capitalExpenditureType==2){
  1365. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  1366. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  1367. return;
  1368. }
  1369. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  1370. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  1371. return;
  1372. }
  1373. }
  1374. if(this.form.capitalExpenditureType==4){
  1375. if(this.infoForm.name==""||this.infoForm.name==null){
  1376. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  1377. return;
  1378. }
  1379. if(this.infoForm.code==""||this.infoForm.code==null){
  1380. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  1381. return;
  1382. }
  1383. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  1384. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  1385. return;
  1386. }
  1387. }
  1388. this.$set(this.form, "payeeList", this.chargeItme);
  1389. this.$set(this.form, "bankTypeList", this.chargeItme);
  1390. this.$set(this.form, "accountTypeList", this.chargeItme);
  1391. this.$set(this.form, "transferStatusList", this.chargeItme);
  1392. addTransfer(this.form).then(response => {
  1393. this.projectForm.outId = response.data.id
  1394. this.infoForm.transferId = response.data.id
  1395. this.$set(this.projectForm, "ynType", '1');
  1396. if(this.uploadFiles1!=null&&this.uploadFiles1.length>0){
  1397. this.uploadFiles1.map((rr1,idx1) => {
  1398. let params1 = new FormData();
  1399. params1.append("tableId", response.data.id);
  1400. params1.append("tableName", "t_yinnong_transfer");
  1401. params1.append("bizPath", "transfer");
  1402. params1.append("fileType", "1");
  1403. params1.append("file", rr1);
  1404. commonAttach(params1).then((r1) => {
  1405. if(idx1 == (_this.uploadFiles1.length-1)){
  1406. if(_this.uploadFiles2!=null&&_this.uploadFiles2.length>0){
  1407. _this.uploadFiles2.map((rr2,idx2) => {
  1408. let params2 = new FormData();
  1409. params2.append("tableId", response.data.id);
  1410. params2.append("tableName", "t_yinnong_transfer");
  1411. params2.append("bizPath", "transfer");
  1412. params2.append("fileType", "2");
  1413. params2.append("file", rr2);
  1414. commonAttach(params2).then((r2) => {
  1415. if(idx2 == (_this.uploadFiles2.length-1)){
  1416. if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){
  1417. _this.uploadFiles3.map((rr3,idx3) => {
  1418. let params3 = new FormData();
  1419. params3.append("tableId", response.data.id);
  1420. params3.append("tableName", "t_yinnong_transfer");
  1421. params3.append("bizPath", "transfer");
  1422. params3.append("fileType", "3");
  1423. params3.append("file", rr3);
  1424. commonAttach(params3).then((r3) => {
  1425. if(idx3 == (_this.uploadFiles3.length-1)){
  1426. if(_this.form.capitalExpenditureType==2){
  1427. addProjectto(_this.projectForm).then(res => {
  1428. _this.$toast.success('保存成功');
  1429. setTimeout(function(){
  1430. history.go(-1)
  1431. },2000)
  1432. })
  1433. } else if(_this.form.capitalExpenditureType==4){
  1434. addInfoto(_this.infoForm).then(res => {
  1435. _this.$toast.success('保存成功');
  1436. setTimeout(function(){
  1437. history.go(-1)
  1438. },2000)
  1439. })
  1440. }else{
  1441. _this.$toast.success('保存成功');
  1442. setTimeout(function(){
  1443. history.go(-1)
  1444. },2000)
  1445. }
  1446. }
  1447. })
  1448. })
  1449. }else{
  1450. if(_this.form.capitalExpenditureType==2){
  1451. addProjectto(_this.projectForm).then(res => {
  1452. _this.$toast.success('保存成功');
  1453. setTimeout(function(){
  1454. history.go(-1)
  1455. },2000)
  1456. })
  1457. } else if(_this.form.capitalExpenditureType==4){
  1458. addInfoto(_this.infoForm).then(res => {
  1459. _this.$toast.success('保存成功');
  1460. setTimeout(function(){
  1461. history.go(-1)
  1462. },2000)
  1463. })
  1464. }else{
  1465. _this.$toast.success('保存成功');
  1466. setTimeout(function(){
  1467. history.go(-1)
  1468. },2000)
  1469. }
  1470. }
  1471. }
  1472. })
  1473. })
  1474. }else if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){
  1475. _this.uploadFiles3.map((rr3,idx3) => {
  1476. let params3 = new FormData();
  1477. params3.append("tableId", response.data.id);
  1478. params3.append("tableName", "t_yinnong_transfer");
  1479. params3.append("bizPath", "transfer");
  1480. params3.append("fileType", "3");
  1481. params3.append("file", rr3);
  1482. commonAttach(params3).then((r3) => {
  1483. if(idx3 ==(_this.uploadFiles3.length-1)){
  1484. if(_this.form.capitalExpenditureType==2){
  1485. addProjectto(_this.projectForm).then(res => {
  1486. _this.$toast.success('保存成功');
  1487. setTimeout(function(){
  1488. history.go(-1)
  1489. },2000)
  1490. })
  1491. } else if(_this.form.capitalExpenditureType==4){
  1492. addInfoto(_this.infoForm).then(res => {
  1493. _this.$toast.success('保存成功');
  1494. setTimeout(function(){
  1495. history.go(-1)
  1496. },2000)
  1497. })
  1498. }else{
  1499. _this.$toast.success('保存成功');
  1500. setTimeout(function(){
  1501. history.go(-1)
  1502. },2000)
  1503. }
  1504. }
  1505. })
  1506. })
  1507. }else{
  1508. if(_this.form.capitalExpenditureType==2){
  1509. addProjectto(_this.projectForm).then(res => {
  1510. _this.$toast.success('保存成功');
  1511. setTimeout(function(){
  1512. history.go(-1)
  1513. },2000)
  1514. })
  1515. } else if(_this.form.capitalExpenditureType==4){
  1516. addInfoto(_this.infoForm).then(res => {
  1517. _this.$toast.success('保存成功');
  1518. setTimeout(function(){
  1519. history.go(-1)
  1520. },2000)
  1521. })
  1522. }else{
  1523. _this.$toast.success('保存成功');
  1524. setTimeout(function(){
  1525. history.go(-1)
  1526. },2000)
  1527. }
  1528. }
  1529. }
  1530. })
  1531. })
  1532. }else if(this.uploadFiles2!=null&&this.uploadFiles2.length>0){
  1533. this.uploadFiles2.map((rr2,idx2) => {
  1534. let params = new FormData();
  1535. params.append("tableId", response.data.id);
  1536. params.append("tableName", "t_yinnong_transfer");
  1537. params.append("bizPath", "transfer");
  1538. params.append("fileType", "2");
  1539. params.append("file", rr2);
  1540. commonAttach(params).then((r2) => {
  1541. if(idx2 == (_this.uploadFiles2.length-1)){
  1542. if(_this.uploadFiles3!=null&&_this.uploadFiles3.length>0){
  1543. _this.uploadFiles3.map((rr3,idx3) => {
  1544. let params3 = new FormData();
  1545. params3.append("tableId", response.data.id);
  1546. params3.append("tableName", "t_yinnong_transfer");
  1547. params3.append("bizPath", "transfer");
  1548. params3.append("fileType", "3");
  1549. params3.append("file", rr3);
  1550. commonAttach(params).then((r3) => {
  1551. if(idx3 == (_this.uploadFiles3.length-1)){
  1552. if(_this.form.capitalExpenditureType==2){
  1553. addProjectto(_this.projectForm).then(res => {
  1554. _this.$toast.success('保存成功');
  1555. setTimeout(function(){
  1556. history.go(-1)
  1557. },2000)
  1558. })
  1559. } else if(_this.form.capitalExpenditureType==4){
  1560. addInfoto(_this.infoForm).then(res => {
  1561. _this.$toast.success('保存成功');
  1562. setTimeout(function(){
  1563. history.go(-1)
  1564. },2000)
  1565. })
  1566. }else{
  1567. _this.$toast.success('保存成功');
  1568. setTimeout(function(){
  1569. history.go(-1)
  1570. },2000)
  1571. }
  1572. }
  1573. })
  1574. })
  1575. }else{
  1576. if(_this.form.capitalExpenditureType==2){
  1577. addProjectto(_this.projectForm).then(res => {
  1578. _this.$toast.success('保存成功');
  1579. setTimeout(function(){
  1580. history.go(-1)
  1581. },2000)
  1582. })
  1583. } else if(_this.form.capitalExpenditureType==4){
  1584. addInfoto(_this.infoForm).then(res => {
  1585. _this.$toast.success('保存成功');
  1586. setTimeout(function(){
  1587. history.go(-1)
  1588. },2000)
  1589. })
  1590. }else{
  1591. _this.$toast.success('保存成功');
  1592. setTimeout(function(){
  1593. history.go(-1)
  1594. },2000)
  1595. }
  1596. }
  1597. }
  1598. })
  1599. })
  1600. }else if(this.uploadFiles3!=null&&this.uploadFiles3.length>0){
  1601. this.uploadFiles3.map((rr3,idx3) => {
  1602. let params = new FormData();
  1603. params.append("tableId", response.data.id);
  1604. params.append("tableName", "t_yinnong_transfer");
  1605. params.append("bizPath", "transfer");
  1606. params.append("fileType", "3");
  1607. params.append("file", rr3);
  1608. commonAttach(params).then((r) => {
  1609. if(idx3 == (_this.uploadFiles3.length-1)){
  1610. if(_this.form.capitalExpenditureType==2){
  1611. addProjectto(_this.projectForm).then(res => {
  1612. _this.$toast.success('保存成功');
  1613. setTimeout(function(){
  1614. history.go(-1)
  1615. },2000)
  1616. })
  1617. } else if(_this.form.capitalExpenditureType==4){
  1618. addInfoto(_this.infoForm).then(res => {
  1619. _this.$toast.success('保存成功');
  1620. setTimeout(function(){
  1621. history.go(-1)
  1622. },2000)
  1623. })
  1624. }else{
  1625. _this.$toast.success('保存成功');
  1626. setTimeout(function(){
  1627. history.go(-1)
  1628. },2000)
  1629. }
  1630. }
  1631. })
  1632. })
  1633. }else{
  1634. if(this.form.capitalExpenditureType==2){
  1635. addProjectto(this.projectForm).then(res => {
  1636. this.$toast.success('保存成功');
  1637. setTimeout(function(){
  1638. history.go(-1)
  1639. },2000)
  1640. })
  1641. } else if(this.form.capitalExpenditureType==4){
  1642. addInfoto(this.infoForm).then(res => {
  1643. this.$toast.success('保存成功');
  1644. setTimeout(function(){
  1645. history.go(-1)
  1646. },2000)
  1647. })
  1648. }else{
  1649. this.$toast.success('保存成功');
  1650. setTimeout(function(){
  1651. history.go(-1)
  1652. },2000)
  1653. }
  1654. }
  1655. });
  1656. },
  1657. payeeSelectChange(select, i) {
  1658. let obj = {};
  1659. let fuzhitype = 0;
  1660. obj = this.payeeList.find((account) => {
  1661. //model就是上面的数据源
  1662. return account.id === select ; //筛选出匹配数据
  1663. });
  1664. if(this.chargeItme != [] && this.chargeItme.length>1){
  1665. this.chargeItme.some((value, index) => {
  1666. if(value.payeeAccount != undefined &&value.payeeAccount != '' && obj.payeeAccount == value.payeeAccount&&index!=i){
  1667. fuzhitype = 2;
  1668. return true;
  1669. }
  1670. if(value.accountType != undefined &&value.accountType != '' && obj.accountType != value.accountType&&index!=i){
  1671. fuzhitype = 1;
  1672. return true;
  1673. }
  1674. });
  1675. }
  1676. if(fuzhitype == 0){
  1677. this.$set(this.chargeItme[i], "payee",obj.payee)
  1678. this.$set(this.chargeItme[i], "bankType", obj.bankType)
  1679. this.$set(this.chargeItme[i], "payeeId", obj.id);
  1680. this.$set(this.chargeItme[i], "payeeAccount", obj.payeeAccount);
  1681. this.$set(this.chargeItme[i], "bankDeposit", obj.bankDeposit);
  1682. this.$set(this.chargeItme[i], "accountType", obj.accountType);
  1683. }else if(fuzhitype == 1){
  1684. this.$set(this.chargeItme[i], "payee",'')
  1685. this.$set(this.chargeItme[i], "bankType",'')
  1686. this.$set(this.chargeItme[i], "payeeId", '');
  1687. this.$set(this.chargeItme[i], "payeeAccount", '');
  1688. this.$set(this.chargeItme[i], "bankDeposit", '');
  1689. this.$set(this.chargeItme[i], "accountType", '');
  1690. this.$notify({ type: 'danger', message: '请选择账户类型相同的收款方!' });
  1691. }else if(fuzhitype == 2){
  1692. this.$set(this.chargeItme[i], "payee",'')
  1693. this.$set(this.chargeItme[i], "bankType",'')
  1694. this.$set(this.chargeItme[i], "payeeId", '');
  1695. this.$set(this.chargeItme[i], "payeeAccount", '');
  1696. this.$set(this.chargeItme[i], "bankDeposit", '');
  1697. this.$set(this.chargeItme[i], "accountType", '');
  1698. this.$notify({ type: 'danger', message: '收款方已存在!' });
  1699. }
  1700. },
  1701. selectChange(select) {
  1702. let obj = {};
  1703. obj = this.payerOptions.find((account) => {
  1704. //model就是上面的数据源
  1705. return account.id === select; //筛选出匹配数据
  1706. });
  1707. if(obj.accountPassword != null && obj.accountPassword != "" &&
  1708. obj.bankType != null && obj.bankType != ""){
  1709. this.$set(this.form, "bookId", obj.bookId);
  1710. this.$set(this.form, "deptId", obj.deptId);
  1711. this.$set(this.form, "cashierId", obj.id);
  1712. this.$set(this.form, "payer", obj.accountName);
  1713. this.$set(this.form, "payerAccount", obj.bankAccountNumber);
  1714. this.$set(this.form, "operatorCode", obj.operatorCode);
  1715. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  1716. this.$set(this.form, "bankType", obj.bankType);
  1717. this.$set(this.form, "bankAccountType", obj.bankAccountType);
  1718. this.$set(this.form, "villageAccountType", obj.villageAccountType);
  1719. this.$set(this.form, "taccountId", obj.taccountId);
  1720. this.$set(this.form, "accountNo", obj.accountNo);
  1721. this.$set(this.form, "cifNo", obj.cifNo);
  1722. this.$set(this.form, "payerFrom", '1');
  1723. if(obj.bankType==1){
  1724. this.form.accountType = "1"
  1725. this.form.isPeers = null
  1726. this.accountTypeChange();
  1727. }else if(obj.bankType==2||obj.bankType==3||obj.bankType==4){
  1728. console.log(obj.bankType)
  1729. this.form.accountType = null
  1730. this.form.isPeers = "Y"
  1731. this.accountTypeChange1();
  1732. }
  1733. }else{
  1734. if(obj.payerFrom==1){
  1735. this.diglogStatus = false;
  1736. this.$notify({ type: 'danger', message: "请完善付款方“操作员代码”、“企业编码”、“支付口令”等信息!" });
  1737. this.$set(this.form,"payer","")
  1738. this.$set(this.form,"payerAccount","")
  1739. }else{
  1740. this.$set(this.form, "payerFrom", obj.parerFrom);
  1741. if(obj.operatorCode!=null&&obj.operatorCode!=''){
  1742. this.$set(this.form, "operatorCode", obj.operatorCode);
  1743. }else{
  1744. this.$set(this.form, "operatorCode", '');
  1745. }
  1746. if(obj.enterpriseCode!=null&&obj.enterpriseCode!=''){
  1747. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  1748. }else{
  1749. this.$set(this.form, "enterpriseCode", '');
  1750. }
  1751. if(obj.accountPassword!=null&&obj.accountPassword!=''){
  1752. this.$set(this.form, "accountPassword", obj.accountPassword);
  1753. }else{
  1754. this.$set(this.form, "accountPassword", '');
  1755. }
  1756. this.$set(this.form, "bookId",'');
  1757. this.$set(this.form, "deptId", '');
  1758. this.$set(this.form, "cashierId", obj.id);
  1759. this.$set(this.form, "payer", obj.accountName);
  1760. this.$set(this.form, "bankType", obj.bankType);
  1761. if(obj.payerFrom==6){
  1762. getQmyeFlow(obj.bankAccountNumber).then((response) => {
  1763. this.$set(this.form, "payerAccount", response.data);
  1764. });
  1765. }else {
  1766. this.$set(this.form, "payerAccount", obj.bankAccountNumber);
  1767. }
  1768. }
  1769. }
  1770. },
  1771. beforeRead1(file) {
  1772. this.uploadFiles1.push(file.file);
  1773. },
  1774. deleteFile1(file){
  1775. this.uploadFiles1.map((response,index) => {
  1776. if(file.file == response){
  1777. this.uploadFiles1.splice(index,1)
  1778. }
  1779. })
  1780. },
  1781. beforeRead2(file) {
  1782. this.uploadFiles2.push(file.file);
  1783. },
  1784. deleteFile2(file){
  1785. this.uploadFiles2.map((response,index) => {
  1786. if(file.file == response){
  1787. this.uploadFiles2.splice(index,1)
  1788. }
  1789. })
  1790. },
  1791. beforeRead3(file) {
  1792. this.uploadFiles3.push(file.file);
  1793. },
  1794. deleteFile3(file){
  1795. this.uploadFiles3.map((response,index) => {
  1796. if(file.file == response){
  1797. this.uploadFiles3.splice(index,1)
  1798. }
  1799. })
  1800. },
  1801. getFileList(){
  1802. let oData1= {
  1803. tableId: this.$route.query.id,
  1804. tableName: "t_yinnong_transfer",
  1805. bizPath: "transfer",
  1806. fileType: "1",
  1807. }
  1808. attachmentList(oData1).then(res => {
  1809. res.rows.map(r => {
  1810. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  1811. this.fileList1.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{})})
  1812. })
  1813. })
  1814. let oData2= {
  1815. tableId: this.$route.query.id,
  1816. tableName: "t_yinnong_transfer",
  1817. bizPath: "transfer",
  1818. fileType: "2",
  1819. }
  1820. attachmentList(oData2).then(res => {
  1821. res.rows.map(r => {
  1822. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  1823. this.fileList2.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{})})
  1824. })
  1825. })
  1826. let oData3= {
  1827. tableId: this.$route.query.id,
  1828. tableName: "t_yinnong_transfer",
  1829. bizPath: "transfer",
  1830. fileType: "3",
  1831. }
  1832. attachmentList(oData3).then(res => {
  1833. res.rows.map(r => {
  1834. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  1835. this.fileList3.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{})})
  1836. })
  1837. })
  1838. },
  1839. goBack(){
  1840. this.$router.push({path:'/yinnong/approvalList2'})
  1841. },
  1842. //删除家庭成员
  1843. deleteChargeItme(index){
  1844. this.chargeItme.splice(index,1)
  1845. },
  1846. },
  1847. watch: {
  1848. $route (to, from ) {
  1849. // 监听路由变化, 实现类似 小程序的 onShow 事件
  1850. if (to.path === '/yinnong/approvalAdd2') {
  1851. // do anything you want
  1852. console.log("aaa")
  1853. if (this.$route.params.payeeForm){
  1854. this.chargeItme.push(this.$route.params.payeeForm)
  1855. console.log(this.$route.params.payeeForm)
  1856. }
  1857. }
  1858. }
  1859. },
  1860. }
  1861. </script>
  1862. <style scoped lang="scss">
  1863. .app-container {
  1864. padding: 2% 0;
  1865. }
  1866. .main_title_box{
  1867. display: flex;
  1868. justify-content: space-between;
  1869. align-items: center;
  1870. }
  1871. .main_title{
  1872. font-size: 0.4rem;
  1873. color: #1D6FE9;
  1874. margin: 0.2rem 6%;
  1875. position: relative;
  1876. a{
  1877. background: #1989fa;
  1878. color: #ffffff;
  1879. padding: 0.05rem 0.3rem;
  1880. border-radius: 5PX;
  1881. }
  1882. }
  1883. .main_box{
  1884. width: 96%;
  1885. margin: 0 auto;
  1886. border-radius: 6px;
  1887. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  1888. overflow: hidden;
  1889. background-color: #FFF;
  1890. }
  1891. .submitButton{
  1892. width: 80%;
  1893. margin: 0 auto;
  1894. background-color: #1D6FE9;
  1895. }
  1896. .addFamily{
  1897. //position: absolute;
  1898. //top: -2px;
  1899. //right: 0;
  1900. border-radius: 50%;
  1901. }
  1902. .deleteFamily{
  1903. position: absolute;
  1904. top: 0rem;
  1905. right: 6%;
  1906. z-index: 9;
  1907. border-radius: 50%;
  1908. }
  1909. </style>