移动端
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 

1484 satır
58 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 name="radio" label="审批模式" input-align="right" autocomplete="off" required
  64. :rules="[{ required: true , message:'请选择审批模式' }]">
  65. <template #input>
  66. <van-radio-group v-model="form.approvalMode" direction="horizontal">
  67. <van-radio name="1">线上审批</van-radio>
  68. <van-radio name="2">线下审批</van-radio>
  69. </van-radio-group>
  70. </template>
  71. </van-field>
  72. <van-field
  73. v-if="form.approvalMode==1"
  74. readonly
  75. clickable
  76. label="审批流程"
  77. placeholder="请选择"
  78. v-model="form.approvalTemplateName"
  79. @click="showtemplate = true"
  80. input-align="right"
  81. right-icon="arrow-down"
  82. required
  83. :rules="[{ required: true , message:'请选择项目流程' }]"
  84. />
  85. <van-popup v-model="showtemplate" position="bottom">
  86. <van-picker
  87. show-toolbar
  88. value-key="name"
  89. :columns="templateList"
  90. @confirm="onConfirmTemplate"
  91. @cancel="showtemplate = false"
  92. />
  93. </van-popup>
  94. <van-field
  95. readonly
  96. required
  97. label="支出总金额"
  98. v-model="form.expenditureAmount"
  99. placeholder="根据下方收款金额自动核算"
  100. input-align="right"
  101. label-width="auto"
  102. />
  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. maxlength="10"
  114. required
  115. show-word-limit
  116. v-if="form.bankType == '5'"
  117. :rules="[{ required: true , message:'请输入转账附言' }]"
  118. />
  119. <van-field
  120. label="转账附言"
  121. v-model="form.remark"
  122. type="textarea"
  123. placeholder="附言请尽量简洁并减少标点符号的使用,详情可在‘说明情况’中描述。"
  124. input-align="right"
  125. rows="3"
  126. label-width="auto"
  127. maxlength="20"
  128. required
  129. show-word-limit
  130. v-if="form.bankType == '6'"
  131. :rules="[{ required: true , message:'请输入转账附言' }]"
  132. />
  133. <van-field
  134. label="转账附言"
  135. v-model="form.remark"
  136. type="textarea"
  137. placeholder="附言请尽量简洁并减少标点符号的使用,详情可在‘说明情况’中描述。"
  138. input-align="right"
  139. rows="3"
  140. label-width="auto"
  141. maxlength="30"
  142. required
  143. show-word-limit
  144. v-if="form.bankType != '5' && form.bankType != '6'"
  145. :rules="[{ required: true , message:'请输入转账附言' }]"
  146. />
  147. </div>
  148. <div class="main_box" style="margin-top: 10px;">
  149. <van-field label="说明情况" v-model="form.explainSituation" type="textarea" placeholder="请输入说明情况" input-align="right" rows="3" label-width="auto"/>
  150. </div>
  151. <p class="main_title" v-if="capitalExpenditureOpen">关联项目</p>
  152. <div class="main_box" v-if="capitalExpenditureOpen" style="margin-bottom: 10px;margin-top: 10px;position:relative;">
  153. <van-field
  154. readonly
  155. clickable
  156. label="项目名称"
  157. placeholder="请选择"
  158. v-model="projectForm.projectName"
  159. @click="showproject = true"
  160. input-align="right"
  161. right-icon="arrow-down"
  162. required
  163. :rules="[{ required: true , message:'请选择项目名称' }]"
  164. />
  165. <van-popup v-model="showproject" position="bottom">
  166. <van-picker
  167. show-toolbar
  168. :columns="projectList"
  169. @confirm="onConfirmProject"
  170. @cancel="showproject = false"
  171. />
  172. </van-popup>
  173. <van-field required :rules="[{ required: true , message:'请输入承建单位' }]" v-model="projectForm.projectContractor" label="承建单位" placeholder="请输入承建单位" input-align="right" label-width="auto"/>
  174. <van-field required :rules="[{ required: true , message:'请输入合同价款' }]" v-model="projectForm.projectAmount" label="合同价款(元)" placeholder="请输入合同价款(元)" input-align="right" label-width="auto"/>
  175. <van-field
  176. readonly
  177. clickable
  178. label="工程款类型"
  179. placeholder="请选择"
  180. v-model="projectFundType"
  181. @click="showFundType = true"
  182. input-align="right"
  183. right-icon="arrow-down"
  184. required
  185. :rules="[{ required: true , message:'请选择工程款类型' }]"
  186. />
  187. <van-popup v-model="showFundType" position="bottom">
  188. <van-picker
  189. show-toolbar
  190. :columns="projectFundTypeOptions"
  191. @confirm="onConfirmFundType"
  192. @cancel="showFundType = false"
  193. />
  194. </van-popup>
  195. <van-field required :rules="[{ required: true , message:'请输入工程发票号' }]" v-model="projectForm.projectBillNum" label="工程发票号" placeholder="请输入工程发票号" input-align="right" label-width="auto"/>
  196. </div>
  197. <p class="main_title" v-if="contractOpen">关联合同</p>
  198. <div class="main_box" v-if="contractOpen" style="margin-bottom: 10px;margin-top: 10px;position:relative;">
  199. <van-field
  200. readonly
  201. clickable
  202. label="合同"
  203. placeholder="请选择"
  204. v-model="infoForm.name"
  205. @click="showcontract = true"
  206. input-align="right"
  207. right-icon="arrow-down"
  208. required
  209. :rules="[{ required: true , message:'请选择项目名称' }]"
  210. />
  211. <van-popup v-model="showcontract" position="bottom">
  212. <van-picker
  213. show-toolbar
  214. :columns="infoList"
  215. @confirm="onConfirmContract"
  216. @cancel="showcontract = false"
  217. />
  218. </van-popup>
  219. <van-field required :rules="[{ required: true , message:'请输入合同编码' }]" v-model="infoForm.code" label="合同编码" placeholder="请输入合同编码" input-align="right" label-width="auto"/>
  220. <van-field required :rules="[{ required: true , message:'请输入合同价款' }]" v-model="infoForm.totalAmount" label="合同价款(元)" placeholder="请输入合同价款(元)" input-align="right" label-width="auto"/>
  221. </div>
  222. <p class="main_title">付款方信息</p>
  223. <div class="main_box">
  224. <!-- <van-field label="付款方" v-model="form.payer" placeholder="请输入付款方" input-align="right" label-width="auto"/>-->
  225. <van-field
  226. readonly
  227. clickable
  228. label="付款方"
  229. placeholder="请选择付款方"
  230. v-model="form.payer"
  231. @click="showpayer = true"
  232. input-align="right"
  233. right-icon="arrow-down"
  234. label-width="auto"
  235. required
  236. :rules="[{ required: true , message:'请选择付款方' }]"
  237. />
  238. <van-popup v-model="showpayer" position="bottom">
  239. <van-picker
  240. show-toolbar
  241. :columns="payerOptions"
  242. @confirm="onConfirmPayer($event)"
  243. @cancel="showpayer = false"
  244. />
  245. </van-popup>
  246. <van-field :rules="[{ required: true , message:'请输入付款方账户' }]" required label="付款方账户" v-model="form.payerAccount" placeholder="请输入账户" input-align="right" label-width="auto"/>
  247. </div>
  248. <div class="main_title main_title_box">
  249. <p>收款方信息</p>
  250. <router-link v-if="!isModifyOrder && isCanBatch" :to="{name:'approvalCollectionAdd', params: {accountType:form.accountType,isPeers:form.isPeers,bankType:form.bankType,option:form}}">添加收款方</router-link>
  251. <van-button icon="plus" @click="addChargeItme(chargeItme.length)" size="mini" type="info" native-type="button" class="addFamily"/>
  252. </div>
  253. <div class="main_box" style="margin-bottom: 15px;" v-if="form.bankType==1||form.bankType==2||form.bankType==3">
  254. <van-cell title="收款账户类型" v-if="form.bankType==1">
  255. <template #right-icon>
  256. <van-radio-group direction="horizontal" v-model="form.accountType" @change="accountTypeChange" >
  257. <van-radio name="1">公户</van-radio>
  258. <van-radio name="2">私户</van-radio>
  259. </van-radio-group>
  260. </template>
  261. </van-cell>
  262. <van-cell title="行内转账" v-if="form.bankType==2||form.bankType==3" >
  263. <template #right-icon>
  264. <van-radio-group direction="horizontal" v-model="form.isPeers" @change="accountTypeChange1">
  265. <van-radio name="Y">是</van-radio>
  266. <van-radio name="N">否</van-radio>
  267. </van-radio-group>
  268. </template>
  269. </van-cell>
  270. </div>
  271. <div :style="{position:'relative',padding: index == 0 ? '':'10px 0 0 0'}" v-for="(item, index) in chargeItme" :key="index">
  272. <van-button icon="minus" size="mini" type="danger" class="deleteFamily" native-type="button" @click="deleteChargeItme(index)" />
  273. <div class="main_box" style="margin-bottom: 10px;position:relative;">
  274. <van-field
  275. readonly
  276. clickable
  277. label="收款方"
  278. placeholder="请选择"
  279. v-model="item.payee"
  280. @click="item.showPayee = true"
  281. input-align="right"
  282. right-icon="arrow-down"
  283. required
  284. :rules="[{ required: true , message:'请选择收款方' }]"
  285. />
  286. <van-popup v-model="item.showPayee" position="bottom" @close="payeeSearchValue = ''" @closed="payeeSearch">
  287. <van-search v-model="payeeSearchValue" show-action placeholder="请输入收款方名称搜索" >
  288. <template #action>
  289. <div @click="payeeSearch">搜索</div>
  290. </template>
  291. </van-search>
  292. <van-picker
  293. show-toolbar
  294. :columns="payeeList"
  295. @confirm="onConfirmPayee($event,index)"
  296. @cancel="item.showPayee = false"
  297. />
  298. </van-popup>
  299. <van-field readonly required v-model="item.payeeAccount" label="收款账户" placeholder="请输入账户" input-align="right" label-width="auto"/>
  300. <van-field readonly required v-model="item.bankDeposit" label="开户银行" placeholder="请输入开户银行" input-align="right" label-width="auto"/>
  301. <van-field required :rules="[{ required: true , message:'请输入金额' }]" v-model="item.incomeAmount" type="number" label="收入金额" placeholder="请输入金额" input-align="right" label-width="auto" @change="moneyChange"/>
  302. <van-field
  303. readonly
  304. label="所属银行"
  305. v-model="item.bankTypeText"
  306. input-align="right"
  307. placeholder="请输入所属银行"
  308. required
  309. :rules="[{ required: true , message:'请选择所属银行' }]"
  310. />
  311. <!--<van-popup v-model="item.showbankType" position="bottom">
  312. <van-picker
  313. show-toolbar
  314. :columns="bankTypeDictionaries"
  315. @confirm="onConfirmBankType($event,index)"
  316. @cancel="item.showbankType = false"
  317. />
  318. </van-popup>-->
  319. </div>
  320. </div>
  321. <p class="main_title" v-if="isModifyOrder" style="margin: 0.2rem 3%;">上传附件<i style="margin-right: 0.5em;"></i><span style="font-size: 12px;color: red;">(若申请单未变动可不必点击底部的修改按钮)</span></p>
  322. <div class="main_box" style="padding: 5px 0 0 0;" v-if="isModifyOrder">
  323. <van-cell value="收据" />
  324. <van-uploader v-model="fileList1" :after-read="beforeRead('1')" @click-preview="previewPreview" @delete="deleteFile" style="margin-left:8px;">
  325. <template #preview-cover="file">
  326. <div class="preview-cover">
  327. <img src="../../../../assets/images/sunVillage_info/WORD.png" width="75" v-if="file.type == 'docx' || file.type == 'doc'"/>
  328. <img src="../../../../assets/images/sunVillage_info/ECEL.png" width="75" v-if="file.type == 'xlsx' || file.type == 'xls'" />
  329. <img src="../../../../assets/images/sunVillage_info/PDF.png" width="75" v-if="file.type == 'pdf'" />
  330. <img src="../../../../assets/images/sunVillage_info/PPT.png" width="75" v-if="file.type == 'ppt'" />
  331. <img src="../../../../assets/images/sunVillage_info/RAR.png" width="75" v-if="file.type == 'zip' || file.type == 'rar'" />
  332. </div>
  333. </template>
  334. </van-uploader>
  335. <van-cell title="发票" />
  336. <van-uploader v-model="fileList2" :after-read="beforeRead('2')" @click-preview="previewPreview" @delete="deleteFile" style="margin-left:8px;">
  337. <template #preview-cover="file">
  338. <div class="preview-cover">
  339. <img src="../../../../assets/images/sunVillage_info/WORD.png" width="75" v-if="file.type == 'docx' || file.type == 'doc'"/>
  340. <img src="../../../../assets/images/sunVillage_info/ECEL.png" width="75" v-if="file.type == 'xlsx' || file.type == 'xls'" />
  341. <img src="../../../../assets/images/sunVillage_info/PDF.png" width="75" v-if="file.type == 'pdf'" />
  342. <img src="../../../../assets/images/sunVillage_info/PPT.png" width="75" v-if="file.type == 'ppt'" />
  343. <img src="../../../../assets/images/sunVillage_info/RAR.png" width="75" v-if="file.type == 'zip' || file.type == 'rar'" />
  344. </div>
  345. </template>
  346. </van-uploader>
  347. <van-cell title="其他" />
  348. <van-uploader v-model="fileList3" :after-read="beforeRead('3')" @click-preview="previewPreview" @delete="deleteFile" style="margin-left:8px;">
  349. <template #preview-cover="file">
  350. <div class="preview-cover">
  351. <img src="../../../../assets/images/sunVillage_info/WORD.png" width="75" v-if="file.type == 'docx' || file.type == 'doc'"/>
  352. <img src="../../../../assets/images/sunVillage_info/ECEL.png" width="75" v-if="file.type == 'xlsx' || file.type == 'xls'" />
  353. <img src="../../../../assets/images/sunVillage_info/PDF.png" width="75" v-if="file.type == 'pdf'" />
  354. <img src="../../../../assets/images/sunVillage_info/PPT.png" width="75" v-if="file.type == 'ppt'" />
  355. <img src="../../../../assets/images/sunVillage_info/RAR.png" width="75" v-if="file.type == 'zip' || file.type == 'rar'" />
  356. </div>
  357. </template>
  358. </van-uploader>
  359. </div>
  360. <div style="padding: 16px 0;">
  361. <van-row v-if="!isModifyOrder">
  362. <van-col span="24" align="center">
  363. <!-- @click="goUpdate"-->
  364. <van-button type="info" native-type="submit" @click="buttonType='save'" class="submitButton">保<i style="margin-right: 1em;"></i>存</van-button>
  365. </van-col>
  366. </van-row>
  367. <van-row v-else>
  368. <van-col span="12" align="center">
  369. <van-button type="info" native-type="submit" @click="buttonType='update'" class="submitButton">修<i style="margin-right: 1em;"></i>改</van-button>
  370. </van-col>
  371. <van-col span="12" align="center">
  372. <van-button type="info" native-type="submit" @click="buttonType='add'" class="submitButton">提<i style="margin-right: 1em;"></i>交</van-button>
  373. </van-col>
  374. </van-row>
  375. <div class="clear"></div>
  376. </div>
  377. </van-form>
  378. </div>
  379. </template>
  380. <script>
  381. import { addTransfer , listPayee , updateTransfer , getProjectto , listProject , addProjectto ,selectApprovalByTemplateId,
  382. customSubmit ,offlineCustomSubmit, getAccount ,getQmyeFlow , attach ,listInfo ,getInfoto ,addInfoto,listTemplate} from "@/api/onlineHome/bankAgriculture/paymentApproval";
  383. import request from '@/utils/request'
  384. import {attachmentList, commonAttach,systemAttachment} from "../../../../api/onlineHome/bankAgriculture/paymentApproval";
  385. import Dialog from "vant/lib/dialog";
  386. import moment from "moment";
  387. export default {
  388. name: "approvalAdd",
  389. data() {
  390. return {
  391. showtemplate:false,
  392. showcontract:false,
  393. showcapital:false,
  394. showpayee:false,
  395. showlasj:false,
  396. showbankType:false,
  397. showproject:false,
  398. showFundType:false,
  399. showpayer:false,
  400. buttonType:'a',
  401. approval: {
  402. taskId: null,
  403. auditbatchNo: null,
  404. type: null,
  405. id: null,
  406. comment: '',
  407. },
  408. minDate: new Date(2000, 1, 1),
  409. maxDate: new Date(2050, 12, 31),
  410. currentDate: new Date(),
  411. form:{
  412. id: null,
  413. upId: null,
  414. applyDate:this.nowDate,
  415. approvalMode:'1',
  416. downId: null,
  417. orderId: null,
  418. cashierId: null,
  419. transferType: '1',
  420. accountType: null,
  421. isPeers:null,
  422. explainSituation: null,
  423. succeedAmount: null,
  424. payer: null,
  425. payerAccount: null,
  426. operatorCode: null,
  427. enterpriseCode: null,
  428. expenditureAmount: null,
  429. capitalExpenditureType: '1',
  430. remark: null,
  431. transferStatus: "0",
  432. auditStatus: "0",
  433. paymentState: "1",
  434. bankPriority: "0",
  435. clientPriority: "0"
  436. },
  437. fileList1:[],
  438. fileList2:[],
  439. fileList3:[],
  440. capitalExpenditureType:'结算类',
  441. payee:'',
  442. bankType:'',
  443. wfydlxDictionaries:[],
  444. jglxDictionaries:[],
  445. sysDictionaries:[],
  446. capitalExpenditureTypeOptions:[],
  447. bankTypeDictionaries:[],
  448. projectList:[],
  449. projectFundTypeOptions:[],
  450. projectFundTypeDictionaries:[],
  451. infoList:[],
  452. payerOptions:[],
  453. chargeItme:[],
  454. chargeItmeShow:[],
  455. templateList:[],
  456. payeeSearchValue:'',
  457. payeeList:[],
  458. bankTypeList:[],
  459. // 查询参数
  460. queryParams: {
  461. transferType:"",
  462. orderByColumn: "id",
  463. isAsc: "desc",
  464. },
  465. capitalExpenditureOpen:false,
  466. contractOpen:false,
  467. projectForm:{
  468. projectId:null,
  469. projectName:null,
  470. projectContractor:null,
  471. projectAmount:null,
  472. projectBillNum:null,
  473. projectFundType:'1',
  474. outId:null,
  475. ynType:'1'
  476. },
  477. infoForm:{
  478. infoId:null,
  479. name:null,
  480. code:null,
  481. totalAmount:null,
  482. contractionId:null,
  483. transferId:null
  484. },
  485. // 合同信息查询参数
  486. queryContractionParams: {
  487. pageNum: 1,
  488. pageSize: 100,
  489. contractionStatus: '1',
  490. orderByColumn: "endTime",
  491. isAsc: "desc",
  492. },
  493. projectFundType:'',
  494. nowDate:"",
  495. isModifyOrder:false, //是已创建订单 false新建订单 true已创建订单
  496. isCanBatch:true, //能否批量
  497. };
  498. },
  499. created() {
  500. this.getNowDate();
  501. this.reset();
  502. this.initProjectInfo();
  503. this.capitalExpenditureOpen = false
  504. this.getDicts("project_fund_type").then((response) => {
  505. for (var i = 0; i < response.data.length; i++) {
  506. this.projectFundTypeOptions.push({text: response.data[i].dictLabel, value: response.data[i].dictValue});
  507. }
  508. this.projectFundTypeDictionaries = response.data;
  509. });
  510. this.getDicts("bank_type").then((response) => {
  511. for (var i = 0; i < response.data.length; i++) {
  512. this.bankTypeList.push({text: response.data[i].dictLabel, value: response.data[i].dictValue});
  513. }
  514. });
  515. let params1={
  516. accountType: "102",
  517. // "params":{townAccountType:'0'},
  518. status: "N",
  519. }
  520. getAccount(params1).then((response) => {
  521. this.payerOptions = response.rows;
  522. response.rows.map((res,index) => {
  523. res['payerFrom'] = '1'
  524. this.payerOptions[index].text = res.accountName;
  525. this.payerOptions[index].value = res.id;
  526. })
  527. });
  528. this.getDictionaries();
  529. this.getTemplateList();
  530. },
  531. methods: {
  532. payeeSearch(val){
  533. console.log(val);
  534. this.payeeList = [];
  535. this.queryParams.payee = this.payeeSearchValue;
  536. listPayee(this.queryParams).then((response) => {
  537. response.rows.map((res,index) => {
  538. if(res.payeeType==1||res.payeeType==2){
  539. response.rows[index].text = res.payee;
  540. response.rows[index].value = res.id;
  541. this.payeeList.push(res)
  542. }
  543. })
  544. });
  545. },
  546. goFlow(){
  547. if(this.form.approvalMode == '1' && this.form.approvalTemplateId != undefined && this.form.approvalTemplateId != "undefined"){
  548. window.location='approvalProcess3?approvalTemplateId='+this.form.approvalTemplateId+'&approvalMode='+this.form.approvalMode;
  549. }else{
  550. this.$notify({ type: 'danger', message: '无审批流程!' });
  551. }
  552. },
  553. getTemplateList(){
  554. let templateQueryParams = {
  555. // 分页
  556. pageNum: 1,
  557. pageSize: 999,
  558. type:'1'
  559. };
  560. listTemplate(templateQueryParams).then(response => {
  561. this.templateList = response.rows;
  562. });
  563. },
  564. onConfirmTemplate(data){
  565. selectApprovalByTemplateId(data.id).then(res => {
  566. this.showtemplate = false;
  567. if(res.approvalDetails.length>0){
  568. this.form.approvalTemplateName = data.name
  569. this.form.approvalTemplateId = data.id
  570. }else{
  571. this.form.approvalTemplateName = null
  572. this.form.approvalTemplateId = null
  573. this.$notify({ type: 'danger', message: '此流程无节点,无法选择!' });
  574. }
  575. })
  576. },
  577. getNowDate(){
  578. var _this = this;
  579. let yy = new Date().getFullYear();
  580. let mm = new Date().getMonth();
  581. let dd = new Date().getDate();
  582. _this.nowDate = moment(new Date()).format("YYYY-MM-DD");
  583. },
  584. previewPreview(file, index, len) {
  585. const baseImgUrl = this.$store.getters.baseRoutingUrl;
  586. if (file.url) {
  587. //已上传文件
  588. let fileName = file.file.name || file.url;
  589. let subIndex = fileName.lastIndexOf(".");
  590. let ext = fileName.substring(subIndex + 1, fileName.length);
  591. let imgi = file.listIndex
  592. //console.log(ext)
  593. let allUrl = file.url;
  594. if(ext !== 'jpg' && ext !== 'png' && ext !== 'gif' && ext !== 'svg' && ext !== 'ico' && ext !== 'bmp'){
  595. const link = document.createElement("a");
  596. link.style.display = "none";
  597. link.target = "_blank"
  598. link.href = allUrl;
  599. document.body.appendChild(link);
  600. link.click();
  601. document.body.removeChild(link);
  602. }
  603. } else {
  604. //新上传文件
  605. let fileName = file.file.name;
  606. // console.info(file.file.name)
  607. let subIndex = fileName.lastIndexOf(".");
  608. let ext = fileName.substring(subIndex + 1, fileName.length);
  609. if(ext !== 'jpg' && ext !== 'png' && ext !== 'gif' && ext !== 'svg' && ext !== 'ico' && ext !== 'bmp'){
  610. let type = this.getfileType(ext);
  611. // 将文件转换为base64编码
  612. this.fileToBase64(file.file, ext).then(res => {
  613. this.downloadFile(res, fileName, ext, type);
  614. })
  615. }
  616. }
  617. },
  618. getfileType(type) {
  619. switch (type) {
  620. case 'txt':
  621. return 'text/plain';
  622. case 'doc':
  623. return 'application/msword';
  624. case 'docx':
  625. return 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
  626. case 'xls':
  627. return 'application/vnd.ms-excel';
  628. case 'xlsx':
  629. return 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
  630. case 'pdf':
  631. return 'application/pdf';
  632. case 'pptx':
  633. return 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
  634. case 'png':
  635. return 'image/png';
  636. case 'jpg':
  637. return 'image/jpeg';
  638. case 'gif':
  639. return 'image/gif';
  640. case 'svg':
  641. return 'image/svg+xml';
  642. case 'ico':
  643. return 'image/x-icon';
  644. case 'bmp':
  645. return 'image/bmp,';
  646. }
  647. },
  648. downloadFile(base64, fileName, fileType, mimetype) {
  649. const typeHeader = 'data:application/' + fileType + ';base64,';
  650. const blob = this.base64ToBlob(base64, mimetype);
  651. this.downloadFileDownload(blob, fileName, fileType);
  652. },
  653. base64ToBlob(base64, mime) {
  654. //解码base64得到二进制字符串
  655. let raw = window.atob(base64.substring(base64.indexOf(',') + 1));
  656. let rawLength = raw.length
  657. //创建8位无符号整数值的类型化数组
  658. let uInt8Array = new Uint8Array(rawLength)
  659. for (let i = 0; i < rawLength; ++i) {
  660. uInt8Array[i] = raw.charCodeAt(i);
  661. }
  662. return new Blob([uInt8Array], {type: mime})
  663. },
  664. downloadFileDownload(blob, fileName, fileType) {
  665. const downloadElement = document.createElement('a');
  666. let href = blob;
  667. if (typeof blob === 'string') {
  668. downloadElement.target = '_blank'
  669. } else {
  670. href = window.URL.createObjectURL(blob)
  671. }
  672. downloadElement.href = href;
  673. downloadElement.download = fileName + '.' + fileType;//下载后文件名
  674. document.body.appendChild(downloadElement);
  675. downloadElement.click();
  676. document.body.removeChild(downloadElement)
  677. if (typeof blob !== 'string') {
  678. window.URL.revokeObjectURL(href)
  679. }
  680. },
  681. fileToBase64(file,fileType){
  682. return new Promise((resolve,reject)=>{
  683. //创建一个新的FileReader 对象
  684. const reader = new FileReader();
  685. //读取file对象
  686. reader.readAsDataURL(file);
  687. reader.onload=function () {
  688. const base64String = reader.result.split(",")[1];
  689. resolve('data:application/' + fileType + ';base64,'+base64String);
  690. }
  691. reader.onerror=function () {
  692. reject(new Error("Failed to load file") )
  693. }
  694. })
  695. },
  696. initProjectInfo(){
  697. let _this = this
  698. let queryParams={
  699. pageNum: 1,
  700. pageSize: 100,
  701. }
  702. listProject(queryParams).then(response => {
  703. _this.projectList = response.rows;
  704. for (let i = 0; i < response.rows.length; i++) {
  705. //_this.projectList[i].set({text: response.rows[i].projectName, value: response.rows[i].id});
  706. _this.$set(_this.projectList[i],"text",response.rows[i].projectName)
  707. _this.$set(_this.projectList[i],"value",response.rows[i].id)
  708. }
  709. });
  710. listInfo(this.queryContractionParams).then(response => {
  711. _this.infoList = response.rows;
  712. for (let i = 0; i < response.rows.length; i++) {
  713. //_this.infoList[i].push({text: response.rows[i].name, value: response.rows[i].code});
  714. _this.$set(_this.infoList[i],"text",response.rows[i].name)
  715. _this.$set(_this.infoList[i],"value",response.rows[i].code)
  716. }
  717. });
  718. },
  719. // 表单重置
  720. reset() {
  721. this.form = {
  722. id: null,
  723. upId: null,
  724. applyDate:this.nowDate,
  725. approvalMode:'1',
  726. downId: null,
  727. orderId: null,
  728. cashierId: null,
  729. transferType: '1',
  730. accountType: null,
  731. isPeers:null,
  732. explainSituation: null,
  733. succeedAmount: null,
  734. payer: null,
  735. payerAccount: null,
  736. operatorCode: null,
  737. enterpriseCode: null,
  738. expenditureAmount: null,
  739. capitalExpenditureType: '1',
  740. remark: null,
  741. transferStatus: "0",
  742. auditStatus: "0",
  743. paymentState: "1",
  744. bankPriority: "0",
  745. clientPriority: "0"
  746. };
  747. this.processList = {}
  748. this.projectForm={
  749. projectId:null,
  750. projectName:null,
  751. projectContractor:null,
  752. projectAmount:null,
  753. projectBillNum:null,
  754. projectFundType:'1',
  755. outId:null,
  756. ynType:'1'
  757. }
  758. },
  759. getChange(){
  760. if(this.buttonType == 'save'){
  761. //保存
  762. this.goSave();
  763. }else if(this.buttonType == 'add'){
  764. //保存并提交
  765. this.goAdd();
  766. }else if(this.buttonType == 'update'){
  767. //修改
  768. this.goUpdate();
  769. }
  770. },
  771. getDictionaries(){
  772. this.getDicts("capital_expenditure_type").then((res) => {
  773. for (var i = 0; i < res.data.length; i++) {
  774. this.capitalExpenditureTypeOptions.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  775. }
  776. });
  777. this.getDicts("bank_type_all").then(res => {
  778. for (var i = 0; i < res.data.length; i++) {
  779. this.bankTypeDictionaries.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  780. }
  781. });
  782. },
  783. getError(e){
  784. this.$notify({ type: 'danger', message: e.errors[0].message });
  785. },
  786. addChargeItme(index){
  787. if(this.chargeItme.length>0&&this.chargeItme[this.chargeItme.length-1].payee == ''){
  788. this.$notify({ type: 'danger', message: '请勿添加多个空列表信息' });
  789. return;
  790. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].incomeAmount == ''){
  791. this.$notify({ type: 'danger', message: '请输入收入金额!' });
  792. return;
  793. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].payeeAccount == ''){
  794. this.$notify({ type: 'danger', message: '请输入收款账户!' });
  795. return;
  796. }
  797. // else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankDeposit == ''){
  798. // this.$notify({ type: 'danger', message: '请输入开户银行!' });
  799. // return;
  800. // }else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankType == ''){
  801. // this.$notify({ type: 'danger', message: '请选择所属银行!' });
  802. // return;
  803. // }
  804. // if(this.form.bankType == '2' && this.form.isPeers == 'N' && this.chargeItme.length>0 && this.chargeItme != []){
  805. // this.$notify({ type: 'danger', message: '目前农商行仅支持单笔跨行转账,即仅能有一个收款方!' });
  806. // }else
  807. var heilongjiang = false;
  808. this.bankTypeList.map(res => {
  809. if(res.value == 7 && res.text.includes("黑龙江")){
  810. heilongjiang = true;
  811. }
  812. });
  813. if(heilongjiang && this.form.bankType == '7' && this.chargeItme.length>0 && this.chargeItme != []){
  814. this.$notify({ type: 'danger', message: '目前黑龙江农商行仅支持单笔转账,即仅能有一个收款方!' });
  815. }else{
  816. this.getDicts("bank_type").then(res => {
  817. this.chargeItme.splice(index + 1, 0, {
  818. payeeId: "", //收款方ID
  819. payee: "", //收款方
  820. payeeAccount: "", //收款账户
  821. bankDeposit: "", //开户银行
  822. incomeAmount: "", //收入金额
  823. bankType: null, //所属银行
  824. bankTypeText:"", //所属银行
  825. showPayee:false,
  826. showbankType:false
  827. });
  828. });
  829. }
  830. if(heilongjiang && this.form.bankType == '7'){
  831. this.isCanBatch = false;
  832. }
  833. },
  834. getPayeeList() {
  835. //普通转账
  836. this.queryParams.status = "0"
  837. listPayee(this.queryParams).then((response) => {
  838. response.rows.map((res,index) => {
  839. if(res.payeeType==1||res.payeeType==2){
  840. res.text = res.payee;
  841. res.value = res.id;
  842. this.payeeList.push(res)
  843. }
  844. })
  845. });
  846. },
  847. payeeDictLabel(datas, value) {
  848. var actions = [];
  849. Object.keys(datas).some((key) => {
  850. if (datas[key].payeeId == ('' + value)) {
  851. actions.push(datas[key].payee);
  852. return true;
  853. }
  854. })
  855. return actions.join('');
  856. },
  857. onConfirmCapital(data){
  858. if (data.value == 2){
  859. this.capitalExpenditureOpen = true;
  860. this.contractOpen = false
  861. this.infoForm = {};
  862. }else if(data.value == 4){
  863. this.capitalExpenditureOpen = false;
  864. this.contractOpen = true
  865. this.projectForm = {};
  866. }else{
  867. this.capitalExpenditureOpen = false;
  868. this.contractOpen = false
  869. this.projectForm = {};
  870. this.infoForm = {};
  871. }
  872. this.capitalExpenditureType = data.text;
  873. this.form.capitalExpenditureType = data.value;
  874. this.showcapital = false;
  875. },
  876. onConfirmFundType(data){
  877. this.projectForm.projectFundType = data.value;
  878. this.projectFundType = data.text;
  879. this.showFundType = false;
  880. },
  881. onConfirmContract(data){
  882. this.infoList.map(res => {
  883. if(res.name==data.text){
  884. this.infoForm.contractionId = res.id;
  885. this.infoForm.name = res.name;
  886. this.infoForm.code = res.code;
  887. this.infoForm.totalAmount = res.totalAmount;
  888. }
  889. })
  890. this.showcontract = false;
  891. },
  892. onConfirmProject(data){
  893. this.projectList.map(res => {
  894. if(res.projectName==data.text){
  895. this.projectForm.projectId = res.id
  896. this.projectForm.projectName = res.projectName
  897. this.projectForm.projectContractor = res.projectContractor
  898. this.projectForm.projectAmount = res.projectAmount
  899. }
  900. })
  901. this.showproject = false;
  902. },
  903. onConfirmPayee(data,index){
  904. for (var i = 0 ; i < this.chargeItme.length ; i++){
  905. this.chargeItme[i].showPayee = false;
  906. }
  907. this.chargeItme[index].payee = data.text;
  908. this.chargeItme[index].payeeId = data.value;
  909. this.chargeItme[index].showpayee = false;
  910. this.payeeSelectChange(data.value , index)
  911. },
  912. onConfirmBankType(data,index){
  913. for (var i = 0 ; i < this.chargeItme.length ; i++){
  914. this.chargeItme[i].showbankType = false;
  915. }
  916. this.chargeItme[index].bankTypeText = data.text;
  917. this.chargeItme[index].bankType = data.value;
  918. this.chargeItme[index].showbankType = false;
  919. },
  920. onConfirmPayer(data){
  921. this.form.payer = data.text;
  922. this.form.cashierId = data.value;
  923. this.showpayer = false;
  924. this.selectChange(data.value)
  925. },
  926. onConfirmLasj(data){
  927. this.form.applyDate = this.getNowFormatDate(data).substr(0,10);
  928. this.showlasj = false;
  929. },
  930. accountTypeChange(e){
  931. this.payeeList = [];
  932. this.chargeItme = [];
  933. this.queryParams.isPeers = this.form.isPeers
  934. this.queryParams.accountType = this.form.accountType
  935. this.queryParams.bankType = this.form.bankType
  936. this.queryParams.status = "0"
  937. listPayee(this.queryParams).then((response) => {
  938. response.rows.map((res,index) => {
  939. if(res.payeeType==1||res.payeeType==2){
  940. response.rows[index].text = res.payee;
  941. response.rows[index].value = res.id;
  942. this.payeeList.push(res)
  943. }
  944. })
  945. });
  946. },
  947. accountTypeChange1(e){
  948. this.payeeList = [];
  949. this.chargeItme = [];
  950. this.queryParams.isPeers = this.form.isPeers
  951. this.queryParams.accountType = this.form.accountType
  952. this.queryParams.bankType = this.form.bankType
  953. this.queryParams.status = "0"
  954. listPayee(this.queryParams).then((response) => {
  955. response.rows.map((res,index) => {
  956. if(res.payeeType==1||res.payeeType==2){
  957. response.rows[index].text = res.payee;
  958. response.rows[index].value = res.id;
  959. this.payeeList.push(res)
  960. }
  961. })
  962. });
  963. },
  964. // 钱计算
  965. moneyChange(input) {
  966. let obj = {};
  967. obj = this.chargeItme.find((account) => {
  968. //model就是上面的数据源
  969. return parseFloat(account.incomeAmount).toFixed(2) === input; //筛选出匹配数据
  970. });
  971. let total = 0;
  972. this.chargeItme.forEach((money) => {
  973. total = (parseFloat(total) + parseFloat(money.incomeAmount)).toFixed(2)
  974. });
  975. this.$set(this.form, "expenditureAmount", total);
  976. },
  977. goAdd(){
  978. if(this.chargeItme.length<1){
  979. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  980. return;
  981. }
  982. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  983. this.$notify({ type: 'danger', message: '转账附言禁止包含!' });
  984. return;
  985. }
  986. if(this.form.capitalExpenditureType==2){
  987. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  988. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  989. return;
  990. }
  991. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  992. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  993. return;
  994. }
  995. }
  996. if(this.form.capitalExpenditureType==4){
  997. if(this.infoForm.name==""||this.infoForm.name==null){
  998. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  999. return;
  1000. }
  1001. if(this.infoForm.code==""||this.infoForm.code==null){
  1002. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  1003. return;
  1004. }
  1005. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  1006. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  1007. return;
  1008. }
  1009. }
  1010. if(this.fileList1.length==0&&this.fileList2.length==0&&this.fileList3.length==0){
  1011. Dialog.confirm({
  1012. title: '提示',
  1013. message: '此申请单中未上传任何附件,是否确认提交?',
  1014. })
  1015. .then(() => {
  1016. this.saveRelease()
  1017. })
  1018. .catch(() => {
  1019. return false;
  1020. });
  1021. }else{
  1022. this.saveRelease()
  1023. }
  1024. },
  1025. saveRelease(){
  1026. let _this = this;
  1027. this.$set(this.form, "payeeList", this.chargeItme);
  1028. this.$set(this.form, "bankTypeList", this.chargeItme);
  1029. this.$set(this.form, "accountTypeList", this.chargeItme);
  1030. this.$set(this.form, "transferStatusList", this.chargeItme);
  1031. updateTransfer(this.form).then(response => {
  1032. this.projectForm.outId = this.form.id
  1033. this.infoForm.transferId = this.form.id
  1034. this.$set(this.projectForm, "ynType", '1');
  1035. if(this.form.capitalExpenditureType==2){
  1036. addProjectto(this.projectForm).then(res => {
  1037. offlineCustomSubmit(this.projectForm.outId).then(res => {
  1038. this.$toast.success('提交成功');
  1039. setTimeout(function(){
  1040. _this.$router.push('/yinnong/approvalList')
  1041. },1000)
  1042. })
  1043. })
  1044. }else if(this.form.capitalExpenditureType==4){
  1045. addInfoto(this.infoForm).then(res => {
  1046. offlineCustomSubmit(this.projectForm.outId).then(res => {
  1047. this.$toast.success('提交成功');
  1048. setTimeout(function(){
  1049. _this.$router.push('/yinnong/approvalList')
  1050. },1000)
  1051. })
  1052. })
  1053. }else{
  1054. offlineCustomSubmit(this.projectForm.outId).then(res => {
  1055. this.$toast.success('提交成功');
  1056. setTimeout(function(){
  1057. _this.$router.push('/yinnong/approvalList')
  1058. },2000)
  1059. })
  1060. }
  1061. })
  1062. },
  1063. goSave(){
  1064. let _this = this
  1065. if(this.chargeItme.length<1){
  1066. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  1067. return;
  1068. }
  1069. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  1070. this.$notify({ type: 'danger', message: '转账附言禁止包含!' });
  1071. return;
  1072. }
  1073. if(this.form.capitalExpenditureType==2){
  1074. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  1075. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  1076. return;
  1077. }
  1078. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  1079. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  1080. return;
  1081. }
  1082. }
  1083. if(this.form.capitalExpenditureType==4){
  1084. if(this.infoForm.name==""||this.infoForm.name==null){
  1085. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  1086. return;
  1087. }
  1088. if(this.infoForm.code==""||this.infoForm.code==null){
  1089. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  1090. return;
  1091. }
  1092. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  1093. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  1094. return;
  1095. }
  1096. }
  1097. this.$set(this.form, "payeeList", this.chargeItme);
  1098. this.$set(this.form, "bankTypeList", this.chargeItme);
  1099. this.$set(this.form, "accountTypeList", this.chargeItme);
  1100. this.$set(this.form, "transferStatusList", this.chargeItme);
  1101. addTransfer(this.form).then(response => {
  1102. this.projectForm.outId = response.data.id;
  1103. this.infoForm.transferId = response.data.id;
  1104. this.form.id = response.data.id;
  1105. this.$set(this.projectForm, "ynType", '1');
  1106. this.isModifyOrder = true;
  1107. if(this.form.capitalExpenditureType==2){
  1108. addProjectto(this.projectForm).then(res => {
  1109. // this.$toast.success('保存成功');
  1110. // setTimeout(function(){
  1111. // history.go(-1)
  1112. // },2000)
  1113. })
  1114. } else if(this.form.capitalExpenditureType==4){
  1115. addInfoto(this.infoForm).then(res => {
  1116. // this.$toast.success('保存成功');
  1117. // setTimeout(function(){
  1118. // history.go(-1)
  1119. // },2000)
  1120. })
  1121. }else{
  1122. // this.$toast.success('保存成功');
  1123. // setTimeout(function(){
  1124. // history.go(-1)
  1125. // },2000)
  1126. }
  1127. });
  1128. },
  1129. goUpdate(){
  1130. let _this = this;
  1131. if(this.chargeItme.length<1){
  1132. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  1133. return;
  1134. }
  1135. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  1136. this.$notify({ type: 'danger', message: '转账附言禁止包含!' });
  1137. return;
  1138. }
  1139. if(this.form.capitalExpenditureType==2){
  1140. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  1141. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  1142. return;
  1143. }
  1144. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  1145. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  1146. return;
  1147. }
  1148. }
  1149. if(this.form.capitalExpenditureType==4){
  1150. if(this.infoForm.name==""||this.infoForm.name==null){
  1151. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  1152. return;
  1153. }
  1154. if(this.infoForm.code==""||this.infoForm.code==null){
  1155. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  1156. return;
  1157. }
  1158. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  1159. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  1160. return;
  1161. }
  1162. }
  1163. this.$set(this.form, "payeeList", this.chargeItme);
  1164. this.$set(this.form, "bankTypeList", this.chargeItme);
  1165. this.$set(this.form, "accountTypeList", this.chargeItme);
  1166. this.$set(this.form, "transferStatusList", this.chargeItme);
  1167. updateTransfer(this.form).then(response => {
  1168. this.projectForm.outId = this.form.id
  1169. this.infoForm.transferId = this.form.id
  1170. this.$set(this.projectForm, "ynType", '1');
  1171. setTimeout(function(){
  1172. _this.$router.push('/yinnong/approvalList')
  1173. },1000)
  1174. })
  1175. },
  1176. payeeSelectChange(select, i) {
  1177. let obj = {};
  1178. let fuzhitype = 0;
  1179. obj = this.payeeList.find((account) => {
  1180. //model就是上面的数据源
  1181. return account.id === select ; //筛选出匹配数据
  1182. });
  1183. let _this = this
  1184. if(this.chargeItme != [] && this.chargeItme.length>1){
  1185. this.chargeItme.some((value, index) => {
  1186. if(value.payeeAccount != undefined &&value.payeeAccount != '' && obj.payeeAccount == value.payeeAccount&&index!=i&&this.form.bankType != 2){
  1187. fuzhitype = 2;
  1188. return true;
  1189. }
  1190. if(_this.form.isPeers!=undefined&&_this.form.isPeers!=null&&_this.form.isPeers=='N'){
  1191. }else{
  1192. if(obj.bankType==1&&value.accountType != undefined &&value.accountType != '' && obj.accountType != value.accountType&&index!=i){
  1193. fuzhitype = 1;
  1194. return true;
  1195. }
  1196. }
  1197. });
  1198. }
  1199. if(fuzhitype == 0){
  1200. this.$set(this.chargeItme[i], "payee",obj.payee)
  1201. this.$set(this.chargeItme[i], "bankType", obj.bankType)
  1202. this.$set(this.chargeItme[i], "payeeId", obj.id);
  1203. this.$set(this.chargeItme[i], "payeeAccount", obj.payeeAccount);
  1204. this.$set(this.chargeItme[i], "bankDeposit", obj.bankDeposit);
  1205. this.$set(this.chargeItme[i], "accountType", obj.accountType);
  1206. this.$set(this.chargeItme[i], "payeePaymentLines", obj.payeePaymentLines);
  1207. _this.bankTypeDictionaries.map(rr => {
  1208. if(rr.value==obj.bankType){
  1209. this.$set(this.chargeItme[i], "bankTypeText", rr.text);
  1210. }
  1211. })
  1212. }else if(fuzhitype == 1){
  1213. this.$set(this.chargeItme[i], "payee",'')
  1214. this.$set(this.chargeItme[i], "bankType",'')
  1215. this.$set(this.chargeItme[i], "payeeId", '');
  1216. this.$set(this.chargeItme[i], "payeeAccount", '');
  1217. this.$set(this.chargeItme[i], "bankDeposit", '');
  1218. this.$set(this.chargeItme[i], "accountType", '');
  1219. this.$set(this.chargeItme[i], "payeePaymentLines", '');
  1220. this.$set(this.chargeItme[i], "bankTypeText", '');
  1221. this.$notify({ type: 'danger', message: '请选择账户类型相同的收款方!' });
  1222. }else if(fuzhitype == 2){
  1223. this.$set(this.chargeItme[i], "payee",'')
  1224. this.$set(this.chargeItme[i], "bankType",'')
  1225. this.$set(this.chargeItme[i], "payeeId", '');
  1226. this.$set(this.chargeItme[i], "payeeAccount", '');
  1227. this.$set(this.chargeItme[i], "bankDeposit", '');
  1228. this.$set(this.chargeItme[i], "accountType", '');
  1229. this.$set(this.chargeItme[i], "payeePaymentLines", '');
  1230. this.$set(this.chargeItme[i], "bankTypeText", '');
  1231. this.$notify({ type: 'danger', message: '收款方已存在!' });
  1232. }
  1233. },
  1234. selectChange(select) {
  1235. let obj = {};
  1236. obj = this.payerOptions.find((account) => {
  1237. //model就是上面的数据源
  1238. return account.id === select; //筛选出匹配数据
  1239. });
  1240. if(obj.accountPassword != null && obj.accountPassword != "" &&
  1241. obj.bankType != null && obj.bankType != ""){
  1242. this.$set(this.form, "bookId", obj.bookId);
  1243. this.$set(this.form, "deptId", obj.deptId);
  1244. this.$set(this.form, "cashierId", obj.id);
  1245. this.$set(this.form, "payer", obj.accountName);
  1246. this.$set(this.form, "payerAccount", obj.bankAccountNumber);
  1247. this.$set(this.form, "operatorCode", obj.operatorCode);
  1248. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  1249. this.$set(this.form, "bankType", obj.bankType);
  1250. this.$set(this.form, "bankAccountType", obj.bankAccountType);
  1251. this.$set(this.form, "villageAccountType", obj.villageAccountType);
  1252. this.$set(this.form, "taccountId", obj.taccountId);
  1253. this.$set(this.form, "accountNo", obj.accountNo);
  1254. this.$set(this.form, "cifNo", obj.cifNo);
  1255. this.$set(this.form, "payerFrom", '1');
  1256. if(obj.bankType==1){
  1257. this.form.accountType = "1"
  1258. this.form.isPeers = null
  1259. this.accountTypeChange();
  1260. }else if(obj.bankType==2||obj.bankType==3){
  1261. this.form.accountType = null
  1262. this.form.isPeers = "Y"
  1263. this.accountTypeChange1();
  1264. }else{
  1265. this.payeeList = [];
  1266. this.chargeItme = [];
  1267. this.queryParams.isPeers = null
  1268. this.queryParams.accountType = ""
  1269. this.queryParams.bankType = ""
  1270. this.queryParams.status = "0"
  1271. listPayee(this.queryParams).then((response) => {
  1272. response.rows.map((res,index) => {
  1273. if(res.payeeType==1||res.payeeType==2){
  1274. response.rows[index].text = res.payee;
  1275. response.rows[index].value = res.id;
  1276. this.payeeList.push(res)
  1277. }
  1278. })
  1279. });
  1280. }
  1281. }else{
  1282. if(obj.payerFrom==1){
  1283. this.diglogStatus = false;
  1284. this.$notify({ type: 'danger', message: "请完善付款方“操作员代码”、“企业编码”、“支付口令”等信息!" });
  1285. this.$set(this.form,"payer","")
  1286. this.$set(this.form,"payerAccount","")
  1287. }else{
  1288. this.$set(this.form, "payerFrom", obj.parerFrom);
  1289. if(obj.operatorCode!=null&&obj.operatorCode!=''){
  1290. this.$set(this.form, "operatorCode", obj.operatorCode);
  1291. }else{
  1292. this.$set(this.form, "operatorCode", '');
  1293. }
  1294. if(obj.enterpriseCode!=null&&obj.enterpriseCode!=''){
  1295. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  1296. }else{
  1297. this.$set(this.form, "enterpriseCode", '');
  1298. }
  1299. if(obj.accountPassword!=null&&obj.accountPassword!=''){
  1300. this.$set(this.form, "accountPassword", obj.accountPassword);
  1301. }else{
  1302. this.$set(this.form, "accountPassword", '');
  1303. }
  1304. this.$set(this.form, "bookId",'');
  1305. this.$set(this.form, "deptId", '');
  1306. this.$set(this.form, "cashierId", obj.id);
  1307. this.$set(this.form, "payer", obj.accountName);
  1308. this.$set(this.form, "bankType", obj.bankType);
  1309. if(obj.payerFrom==6){
  1310. getQmyeFlow(obj.bankAccountNumber).then((response) => {
  1311. this.$set(this.form, "payerAccount", response.data);
  1312. });
  1313. }else {
  1314. this.$set(this.form, "payerAccount", obj.bankAccountNumber);
  1315. }
  1316. }
  1317. }
  1318. },
  1319. beforeRead(obj) {
  1320. return (file) =>{
  1321. let params1 = new FormData();
  1322. params1.append("tableId", this.projectForm.outId);
  1323. params1.append("tableName", "t_yinnong_transfer");
  1324. params1.append("bizPath", "transfer");
  1325. params1.append("fileType", obj);
  1326. params1.append("file", file.file);
  1327. commonAttach(params1).then((r1) => {
  1328. file.id=r1.id;
  1329. file.fileUrl = r1.fileUrl;
  1330. let subIndex = r1.fileUrl.lastIndexOf(".");
  1331. let ext = r1.fileUrl.substring(subIndex + 1, r1.fileUrl.length);
  1332. let baseUrl = location.protocol + "//" + location.host + request.defaults.baseURL;
  1333. let fileData = {"url": baseUrl + r1.fileUrl, "file": new File([], "name", {}), "id": r1.id,"type":ext};
  1334. if(obj === '1'){
  1335. this.fileList1.splice(-1, 1);
  1336. this.fileList1.push(fileData);
  1337. }else if(obj === '2'){
  1338. this.fileList2.splice(-1, 1);
  1339. this.fileList2.push(fileData);
  1340. }else{
  1341. this.fileList3.splice(-1, 1);
  1342. this.fileList3.push(fileData);
  1343. }
  1344. })
  1345. }
  1346. },
  1347. deleteFile(file){
  1348. systemAttachment(file.id).then((res) => {});
  1349. },
  1350. getFileList(){
  1351. let oData1= {
  1352. tableId: this.$route.query.id,
  1353. tableName: "t_yinnong_transfer",
  1354. bizPath: "transfer",
  1355. fileType: "1",
  1356. }
  1357. attachmentList(oData1).then(res => {
  1358. res.rows.map(r => {
  1359. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  1360. let subIndex = r.fileName.lastIndexOf(".");
  1361. let ext = r.fileName.substring(subIndex + 1, r.fileName.length);
  1362. this.fileList1.push({"url": baseUrl + r.fileUrl, "file": new File([], r.fileName, {}), "id": r.id,"type":ext})
  1363. })
  1364. })
  1365. let oData2= {
  1366. tableId: this.$route.query.id,
  1367. tableName: "t_yinnong_transfer",
  1368. bizPath: "transfer",
  1369. fileType: "2",
  1370. }
  1371. attachmentList(oData2).then(res => {
  1372. res.rows.map(r => {
  1373. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  1374. let subIndex = r.fileName.lastIndexOf(".");
  1375. let ext = r.fileName.substring(subIndex + 1, r.fileName.length);
  1376. this.fileList2.push({"url": baseUrl + r.fileUrl, "file": new File([], r.fileName, {}), "id": r.id,"type":ext})
  1377. })
  1378. })
  1379. let oData3= {
  1380. tableId: this.$route.query.id,
  1381. tableName: "t_yinnong_transfer",
  1382. bizPath: "transfer",
  1383. fileType: "3",
  1384. }
  1385. attachmentList(oData3).then(res => {
  1386. res.rows.map(r => {
  1387. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  1388. let subIndex = r.fileName.lastIndexOf(".");
  1389. let ext = r.fileName.substring(subIndex + 1, r.fileName.length);
  1390. this.fileList3.push({"url": baseUrl + r.fileUrl, "file": new File([], r.fileName, {}), "id": r.id,"type":ext})
  1391. })
  1392. })
  1393. },
  1394. goBack(){
  1395. this.$router.push({path:'/yinnong/approvalList'})
  1396. },
  1397. deleteChargeItme(index){
  1398. this.chargeItme.splice(index,1)
  1399. },
  1400. },
  1401. watch: {
  1402. $route (to, from ) {
  1403. // 监听路由变化, 实现类似 小程序的 onShow 事件
  1404. if (to.path === '/yinnong/approvalAdd') {
  1405. // do anything you want
  1406. if (this.$route.params.payeeForm){
  1407. this.chargeItme.push(this.$route.params.payeeForm)
  1408. }
  1409. }
  1410. }
  1411. },
  1412. }
  1413. </script>
  1414. <style scoped lang="scss">
  1415. .app-container {
  1416. padding: 2% 0;
  1417. }
  1418. .main_title_box{
  1419. display: flex;
  1420. justify-content: space-between;
  1421. align-items: center;
  1422. }
  1423. .main_title{
  1424. font-size: 0.4rem;
  1425. color: #1D6FE9;
  1426. margin: 0.2rem 6%;
  1427. position: relative;
  1428. a{
  1429. background: #1989fa;
  1430. color: #ffffff;
  1431. padding: 0.05rem 0.3rem;
  1432. border-radius: 5PX;
  1433. }
  1434. }
  1435. .main_box{
  1436. width: 96%;
  1437. margin: 0 auto;
  1438. border-radius: 6px;
  1439. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  1440. overflow: hidden;
  1441. background-color: #FFF;
  1442. }
  1443. .submitButton{
  1444. width: 80%;
  1445. margin: 0 auto;
  1446. background-color: #1D6FE9;
  1447. }
  1448. .addFamily{
  1449. //position: absolute;
  1450. //top: -2px;
  1451. //right: 0;
  1452. border-radius: 50%;
  1453. }
  1454. .deleteFamily{
  1455. position: absolute;
  1456. top: 0rem;
  1457. right: 6%;
  1458. z-index: 9;
  1459. border-radius: 50%;
  1460. }
  1461. </style>