移动端
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

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