移动端
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

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