移动端
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.

1563 righe
61 KiB

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