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

1557 linhas
60 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'"
  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'"
  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 :rules="[{ required: true , message:'请输入账户' }]" readonly v-model="item.payeeAccount" label="收款账户" placeholder="请输入账户" input-align="right" label-width="auto"/>
  308. <van-field required :rules="[{ required: true , message:'请输入开户银行' }]" 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. });
  529. this.getDictionaries();
  530. this.getTemplateList();
  531. },
  532. methods: {
  533. goFlow(){
  534. if(this.form.approvalMode == '1' && this.form.approvalTemplateId != undefined && this.form.approvalTemplateId != "undefined"){
  535. window.location='approvalProcess3?approvalTemplateId='+this.form.approvalTemplateId+'&approvalMode='+this.form.approvalMode;
  536. }else{
  537. this.$notify({ type: 'danger', message: '无审批流程!' });
  538. }
  539. },
  540. getTemplateList(){
  541. let templateQueryParams = {
  542. // 分页
  543. pageNum: 1,
  544. pageSize: 999,
  545. type:'1'
  546. };
  547. listTemplate(templateQueryParams).then(response => {
  548. this.templateList = response.rows;
  549. });
  550. },
  551. onConfirmTemplate(data){
  552. selectApprovalByTemplateId(data.id).then(res => {
  553. this.showtemplate = false;
  554. if(res.approvalDetails.length>0){
  555. this.form.approvalTemplateName = data.name
  556. this.form.approvalTemplateId = data.id
  557. }else{
  558. this.form.approvalTemplateName = null
  559. this.form.approvalTemplateId = null
  560. this.$notify({ type: 'danger', message: '此流程无节点,无法选择!' });
  561. }
  562. })
  563. },
  564. getNowDate(){
  565. var _this = this;
  566. let yy = new Date().getFullYear();
  567. let mm = new Date().getMonth()+1;
  568. let dd = new Date().getDate();
  569. _this.nowDate = moment(new Date()).format("YYYY-MM-DD");
  570. },
  571. initProjectInfo(){
  572. let _this = this
  573. let queryParams={
  574. pageNum: 1,
  575. pageSize: 100,
  576. }
  577. listProject(queryParams).then(response => {
  578. _this.projectList = response.rows;
  579. console.log(response)
  580. for (let i = 0; i < response.rows.length; i++) {
  581. //_this.projectList[i].set({text: response.rows[i].projectName, value: response.rows[i].id});
  582. _this.$set(_this.projectList[i],"text",response.rows[i].projectName)
  583. _this.$set(_this.projectList[i],"value",response.rows[i].id)
  584. }
  585. });
  586. listInfo(this.queryContractionParams).then(response => {
  587. console.log(response)
  588. _this.infoList = response.rows;
  589. for (let i = 0; i < response.rows.length; i++) {
  590. //_this.infoList[i].push({text: response.rows[i].name, value: response.rows[i].code});
  591. _this.$set(_this.infoList[i],"text",response.rows[i].name)
  592. _this.$set(_this.infoList[i],"value",response.rows[i].code)
  593. }
  594. });
  595. },
  596. // 表单重置
  597. reset() {
  598. this.form = {
  599. id: null,
  600. upId: null,
  601. applyDate:this.nowDate,
  602. approvalMode:'1',
  603. downId: null,
  604. orderId: null,
  605. cashierId: null,
  606. transferType: '1',
  607. accountType: null,
  608. isPeers:null,
  609. explainSituation: null,
  610. succeedAmount: null,
  611. payer: null,
  612. payerAccount: null,
  613. operatorCode: null,
  614. enterpriseCode: null,
  615. expenditureAmount: null,
  616. capitalExpenditureType: '1',
  617. remark: null,
  618. transferStatus: "0",
  619. auditStatus: "0",
  620. paymentState: "1",
  621. bankPriority: "0",
  622. clientPriority: "0"
  623. };
  624. this.processList = {}
  625. this.projectForm={
  626. projectId:null,
  627. projectName:null,
  628. projectContractor:null,
  629. projectAmount:null,
  630. projectBillNum:null,
  631. projectFundType:'1',
  632. outId:null,
  633. ynType:'1'
  634. }
  635. },
  636. getChange(){
  637. if(this.buttonType == 'save'){
  638. //保存
  639. this.goSave();
  640. }else if(this.buttonType == 'add'){
  641. //保存并提交
  642. this.goAdd();
  643. }else if(this.buttonType == 'update'){
  644. //修改
  645. this.goUpdate();
  646. }
  647. },
  648. getDictionaries(){
  649. this.getDicts("capital_expenditure_type").then((res) => {
  650. for (var i = 0; i < res.data.length; i++) {
  651. this.capitalExpenditureTypeOptions.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  652. }
  653. });
  654. this.getDicts("bank_type_all").then(res => {
  655. for (var i = 0; i < res.data.length; i++) {
  656. this.bankTypeDictionaries.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  657. }
  658. });
  659. },
  660. getError(e){
  661. console.log(e)
  662. this.$notify({ type: 'danger', message: e.errors[0].message });
  663. },
  664. addChargeItme(index){
  665. if(this.chargeItme.length>0&&this.chargeItme[this.chargeItme.length-1].payee == ''){
  666. this.$notify({ type: 'danger', message: '请勿添加多个空列表信息' });
  667. return;
  668. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].incomeAmount == ''){
  669. this.$notify({ type: 'danger', message: '请输入收入金额!' });
  670. return;
  671. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].payeeAccount == ''){
  672. this.$notify({ type: 'danger', message: '请输入收款账户!' });
  673. return;
  674. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankDeposit == ''){
  675. this.$notify({ type: 'danger', message: '请输入开户银行!' });
  676. return;
  677. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankType == ''){
  678. this.$notify({ type: 'danger', message: '请选择所属银行!' });
  679. return;
  680. }
  681. // if(this.form.bankType == '2' && this.form.isPeers == 'N' && this.chargeItme.length>0 && this.chargeItme != []){
  682. // this.$notify({ type: 'danger', message: '目前农商行仅支持单笔跨行转账,即仅能有一个收款方!' });
  683. // }else
  684. var heilongjiang = false;
  685. this.bankTypeList.map(res => {
  686. if(res.value == 7 && res.text.includes("黑龙江")){
  687. heilongjiang = true;
  688. }
  689. });
  690. if(heilongjiang && this.form.bankType == '7' && this.chargeItme.length>0 && this.chargeItme != []){
  691. this.$notify({ type: 'danger', message: '目前黑龙江农商行仅支持单笔转账,即仅能有一个收款方!' });
  692. }else{
  693. this.getDicts("bank_type").then(res => {
  694. this.chargeItme.splice(index + 1, 0, {
  695. payeeId: "", //收款方ID
  696. payee: "", //收款方
  697. payeeAccount: "", //收款账户
  698. bankDeposit: "", //开户银行
  699. incomeAmount: "", //收入金额
  700. bankType: null, //所属银行
  701. bankTypeText:"", //所属银行
  702. showPayee:false,
  703. showbankType:false
  704. });
  705. });
  706. }
  707. if(heilongjiang && this.form.bankType == '7'){
  708. this.isCanBatch = false;
  709. }
  710. },
  711. getPayeeList() {
  712. //普通转账
  713. this.queryParams.status = "0"
  714. listPayee(this.queryParams).then((response) => {
  715. response.rows.map((res,index) => {
  716. if(res.payeeType==1||res.payeeType==2){
  717. res.text = res.payee;
  718. res.value = res.id;
  719. this.payeeList.push(res)
  720. }
  721. })
  722. });
  723. },
  724. previewPreview(file, index, len) {
  725. const baseImgUrl = this.$store.getters.baseRoutingUrl;
  726. if (file.url) {
  727. //已上传文件
  728. let fileName = file.file.name || file.url;
  729. let subIndex = fileName.lastIndexOf(".");
  730. let ext = fileName.substring(subIndex + 1, fileName.length);
  731. let imgi = file.listIndex
  732. //console.log(ext)
  733. let allUrl = file.url;
  734. if(ext !== 'jpg' && ext !== 'png' && ext !== 'gif' && ext !== 'svg' && ext !== 'ico' && ext !== 'bmp'){
  735. const link = document.createElement("a");
  736. link.style.display = "none";
  737. link.target = "_blank"
  738. link.href = allUrl;
  739. document.body.appendChild(link);
  740. link.click();
  741. document.body.removeChild(link);
  742. }
  743. } else {
  744. //新上传文件
  745. let fileName = file.file.name;
  746. // console.info(file.file.name)
  747. let subIndex = fileName.lastIndexOf(".");
  748. let ext = fileName.substring(subIndex + 1, fileName.length);
  749. if(ext !== 'jpg' && ext !== 'png' && ext !== 'gif' && ext !== 'svg' && ext !== 'ico' && ext !== 'bmp'){
  750. let type = this.getfileType(ext);
  751. // 将文件转换为base64编码
  752. this.fileToBase64(file.file, ext).then(res => {
  753. this.downloadFile(res, fileName, ext, type);
  754. })
  755. }
  756. }
  757. },
  758. downloadFile(base64, fileName, fileType, mimetype) {
  759. const typeHeader = 'data:application/' + fileType + ';base64,';
  760. const blob = this.base64ToBlob(base64, mimetype);
  761. this.downloadFileDownload(blob, fileName, fileType);
  762. },
  763. fileToBase64(file,fileType){
  764. return new Promise((resolve,reject)=>{
  765. //创建一个新的FileReader 对象
  766. const reader = new FileReader();
  767. //读取file对象
  768. reader.readAsDataURL(file);
  769. reader.onload=function () {
  770. const base64String = reader.result.split(",")[1];
  771. resolve('data:application/' + fileType + ';base64,'+base64String);
  772. }
  773. reader.onerror=function () {
  774. reject(new Error("Failed to load file") )
  775. }
  776. })
  777. },
  778. base64ToBlob(base64, mime) {
  779. //解码base64得到二进制字符串
  780. let raw = window.atob(base64.substring(base64.indexOf(',') + 1));
  781. let rawLength = raw.length
  782. //创建8位无符号整数值的类型化数组
  783. let uInt8Array = new Uint8Array(rawLength)
  784. for (let i = 0; i < rawLength; ++i) {
  785. uInt8Array[i] = raw.charCodeAt(i);
  786. }
  787. return new Blob([uInt8Array], {type: mime})
  788. },
  789. getfileType(type) {
  790. switch (type) {
  791. case 'txt':
  792. return 'text/plain';
  793. case 'doc':
  794. return 'application/msword';
  795. case 'docx':
  796. return 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
  797. case 'xls':
  798. return 'application/vnd.ms-excel';
  799. case 'xlsx':
  800. return 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
  801. case 'pdf':
  802. return 'application/pdf';
  803. case 'pptx':
  804. return 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
  805. case 'png':
  806. return 'image/png';
  807. case 'jpg':
  808. return 'image/jpeg';
  809. case 'gif':
  810. return 'image/gif';
  811. case 'svg':
  812. return 'image/svg+xml';
  813. case 'ico':
  814. return 'image/x-icon';
  815. case 'bmp':
  816. return 'image/bmp,';
  817. }
  818. },
  819. downloadFileDownload(blob, fileName, fileType) {
  820. const downloadElement = document.createElement('a');
  821. let href = blob;
  822. if (typeof blob === 'string') {
  823. downloadElement.target = '_blank'
  824. } else {
  825. href = window.URL.createObjectURL(blob)
  826. }
  827. downloadElement.href = href;
  828. downloadElement.download = fileName + '.' + fileType;//下载后文件名
  829. document.body.appendChild(downloadElement);
  830. downloadElement.click();
  831. document.body.removeChild(downloadElement)
  832. if (typeof blob !== 'string') {
  833. window.URL.revokeObjectURL(href)
  834. }
  835. },
  836. payeeDictLabel(datas, value) {
  837. var actions = [];
  838. Object.keys(datas).some((key) => {
  839. if (datas[key].payeeId == ('' + value)) {
  840. actions.push(datas[key].payee);
  841. return true;
  842. }
  843. })
  844. return actions.join('');
  845. },
  846. onConfirmCapital(data){
  847. if (data.value == 2){
  848. this.capitalExpenditureOpen = true;
  849. this.contractOpen = false
  850. this.infoForm = {};
  851. }else if(data.value == 4){
  852. this.capitalExpenditureOpen = false;
  853. this.contractOpen = true
  854. this.projectForm = {};
  855. }else{
  856. this.capitalExpenditureOpen = false;
  857. this.contractOpen = false
  858. this.projectForm = {};
  859. this.infoForm = {};
  860. }
  861. this.capitalExpenditureType = data.text;
  862. this.form.capitalExpenditureType = data.value;
  863. this.showcapital = false;
  864. },
  865. onConfirmFundType(data){
  866. console.log(data)
  867. this.projectForm.projectFundType = data.value;
  868. this.projectFundType = data.text;
  869. this.showFundType = false;
  870. },
  871. onConfirmContract(data){
  872. this.infoList.map(res => {
  873. if(res.name==data.text){
  874. this.infoForm.contractionId = res.id;
  875. this.infoForm.name = res.name;
  876. this.infoForm.code = res.code;
  877. this.infoForm.totalAmount = res.totalAmount;
  878. }
  879. })
  880. this.showcontract = false;
  881. },
  882. onConfirmProject(data){
  883. this.projectList.map(res => {
  884. if(res.projectName==data.text){
  885. this.projectForm.projectId = res.id
  886. this.projectForm.projectName = res.projectName
  887. this.projectForm.projectContractor = res.projectContractor
  888. this.projectForm.projectAmount = res.projectAmount
  889. }
  890. })
  891. this.showproject = false;
  892. },
  893. onConfirmPayee(data,index){
  894. for (var i = 0 ; i < this.chargeItme.length ; i++){
  895. this.chargeItme[i].showPayee = false;
  896. }
  897. this.chargeItme[index].payee = data.text;
  898. this.chargeItme[index].payeeId = data.value;
  899. this.chargeItme[index].showpayee = false;
  900. this.payeeSelectChange(data.value , index)
  901. console.log(data)
  902. },
  903. onConfirmBankType(data,index){
  904. for (var i = 0 ; i < this.chargeItme.length ; i++){
  905. this.chargeItme[i].showbankType = false;
  906. }
  907. this.chargeItme[index].bankTypeText = data.text;
  908. this.chargeItme[index].bankType = data.value;
  909. this.chargeItme[index].showbankType = false;
  910. },
  911. onConfirmPayer(data){
  912. this.form.payer = data.text;
  913. this.form.cashierId = data.value;
  914. this.showpayer = false;
  915. this.selectChange(data.value)
  916. },
  917. onConfirmLasj(data){
  918. this.form.applyDate = this.getNowFormatDate(data).substr(0,10);
  919. this.showlasj = false;
  920. },
  921. accountTypeChange(e){
  922. this.payeeList = [];
  923. this.chargeItme = [];
  924. this.queryParams.isPeers = this.form.isPeers
  925. this.queryParams.accountType = this.form.accountType
  926. this.queryParams.bankType = this.form.bankType
  927. this.queryParams.status = "0"
  928. listPayee(this.queryParams).then((response) => {
  929. response.rows.map((res,index) => {
  930. if(res.payeeType==1||res.payeeType==2){
  931. response.rows[index].text = res.payee;
  932. response.rows[index].value = res.id;
  933. this.payeeList.push(res)
  934. }
  935. })
  936. });
  937. },
  938. accountTypeChange1(e){
  939. this.payeeList = [];
  940. this.chargeItme = [];
  941. this.queryParams.isPeers = this.form.isPeers
  942. this.queryParams.accountType = this.form.accountType
  943. this.queryParams.bankType = this.form.bankType
  944. this.queryParams.status = "0"
  945. listPayee(this.queryParams).then((response) => {
  946. response.rows.map((res,index) => {
  947. if(res.payeeType==1||res.payeeType==2){
  948. response.rows[index].text = res.payee;
  949. response.rows[index].value = res.id;
  950. this.payeeList.push(res)
  951. }
  952. })
  953. });
  954. },
  955. // 钱计算
  956. moneyChange(input) {
  957. console.log(input)
  958. let obj = {};
  959. obj = this.chargeItme.find((account) => {
  960. //model就是上面的数据源
  961. return parseFloat(account.incomeAmount).toFixed(2) === input; //筛选出匹配数据
  962. });
  963. let total = 0;
  964. this.chargeItme.forEach((money) => {
  965. total = (parseFloat(total) + parseFloat(money.incomeAmount)).toFixed(2)
  966. });
  967. this.$set(this.form, "expenditureAmount", total);
  968. },
  969. goAdd(){
  970. if(this.chargeItme.length<1){
  971. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  972. return;
  973. }
  974. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  975. this.$notify({ type: 'danger', message: '转账附言禁止包含!' });
  976. return;
  977. }
  978. if(this.form.capitalExpenditureType==2){
  979. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  980. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  981. return;
  982. }
  983. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  984. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  985. return;
  986. }
  987. }
  988. if(this.form.capitalExpenditureType==4){
  989. if(this.infoForm.name==""||this.infoForm.name==null){
  990. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  991. return;
  992. }
  993. if(this.infoForm.code==""||this.infoForm.code==null){
  994. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  995. return;
  996. }
  997. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  998. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  999. return;
  1000. }
  1001. }
  1002. if(this.fileList1.length==0&&this.fileList2.length==0&&this.fileList3.length==0){
  1003. Dialog.confirm({
  1004. title: '提示',
  1005. message: '此申请单中未上传任何附件,是否确认提交?',
  1006. })
  1007. .then(() => {
  1008. this.saveRelease()
  1009. })
  1010. .catch(() => {
  1011. return false;
  1012. });
  1013. }else{
  1014. this.saveRelease()
  1015. }
  1016. },
  1017. saveRelease(){
  1018. let _this = this;
  1019. this.$set(this.form, "payeeList", this.chargeItme);
  1020. this.$set(this.form, "bankTypeList", this.chargeItme);
  1021. this.$set(this.form, "accountTypeList", this.chargeItme);
  1022. this.$set(this.form, "transferStatusList", this.chargeItme);
  1023. updateTransfer(this.form).then(response => {
  1024. this.$set(this.projectForm, "ynType", '1');
  1025. if(this.form.capitalExpenditureType==2){
  1026. addProjectto(this.projectForm).then(res => {
  1027. offlineCustomSubmit(this.form.id).then(res => {
  1028. _this.$toast.success('提交成功');
  1029. setTimeout(function(){
  1030. _this.$router.push('/sunVillage_info/approvalList')
  1031. },1500)
  1032. })
  1033. })
  1034. } else if(this.form.capitalExpenditureType==4){
  1035. addInfoto(this.infoForm).then(res => {
  1036. offlineCustomSubmit(this.form.id).then(res => {
  1037. _this.$toast.success('提交成功');
  1038. setTimeout(function(){
  1039. _this.$router.push('/sunVillage_info/approvalList')
  1040. },1500)
  1041. })
  1042. })
  1043. }else{
  1044. offlineCustomSubmit(this.form.id).then(res => {
  1045. _this.$toast.success('提交成功');
  1046. setTimeout(function(){
  1047. _this.$router.push('/sunVillage_info/approvalList')
  1048. },1500)
  1049. })
  1050. }
  1051. })
  1052. },
  1053. goSave(){
  1054. let _this = this
  1055. if(this.chargeItme.length<1){
  1056. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  1057. return;
  1058. }
  1059. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  1060. this.$notify({ type: 'danger', message: '转账附言禁止包含!' });
  1061. return;
  1062. }
  1063. if(this.form.capitalExpenditureType==2){
  1064. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  1065. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  1066. return;
  1067. }
  1068. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  1069. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  1070. return;
  1071. }
  1072. }
  1073. if(this.form.capitalExpenditureType==4){
  1074. if(this.infoForm.name==""||this.infoForm.name==null){
  1075. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  1076. return;
  1077. }
  1078. if(this.infoForm.code==""||this.infoForm.code==null){
  1079. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  1080. return;
  1081. }
  1082. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  1083. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  1084. return;
  1085. }
  1086. }
  1087. this.$set(this.form, "payeeList", this.chargeItme);
  1088. this.$set(this.form, "bankTypeList", this.chargeItme);
  1089. this.$set(this.form, "accountTypeList", this.chargeItme);
  1090. this.$set(this.form, "transferStatusList", this.chargeItme);
  1091. addTransfer(this.form).then(response => {
  1092. this.projectForm.outId = response.data.id
  1093. this.infoForm.transferId = response.data.id
  1094. this.$set(this.projectForm, "ynType", '1');
  1095. this.form.id = response.data.id;
  1096. this.isModifyOrder = true;
  1097. if(this.form.capitalExpenditureType==2){
  1098. addProjectto(this.projectForm).then(res => {
  1099. // this.$toast.success('保存成功');
  1100. // setTimeout(function(){
  1101. // history.go(-1)
  1102. // },2000)
  1103. })
  1104. } else if(this.form.capitalExpenditureType==4){
  1105. addInfoto(this.infoForm).then(res => {
  1106. // this.$toast.success('保存成功');
  1107. // setTimeout(function(){
  1108. // history.go(-1)
  1109. // },2000)
  1110. })
  1111. }else{
  1112. // this.$toast.success('保存成功');
  1113. // setTimeout(function(){
  1114. // history.go(-1)
  1115. // },2000)
  1116. }
  1117. })
  1118. },
  1119. goUpdate(){
  1120. let _this = this
  1121. if(this.chargeItme.length<1){
  1122. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  1123. return;
  1124. }
  1125. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  1126. this.$notify({ type: 'danger', message: '转账附言禁止包含!' });
  1127. return;
  1128. }
  1129. if(this.form.capitalExpenditureType==2){
  1130. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  1131. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  1132. return;
  1133. }
  1134. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  1135. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  1136. return;
  1137. }
  1138. }
  1139. if(this.form.capitalExpenditureType==4){
  1140. if(this.infoForm.name==""||this.infoForm.name==null){
  1141. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  1142. return;
  1143. }
  1144. if(this.infoForm.code==""||this.infoForm.code==null){
  1145. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  1146. return;
  1147. }
  1148. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  1149. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  1150. return;
  1151. }
  1152. }
  1153. this.$set(this.form, "payeeList", this.chargeItme);
  1154. this.$set(this.form, "bankTypeList", this.chargeItme);
  1155. this.$set(this.form, "accountTypeList", this.chargeItme);
  1156. this.$set(this.form, "transferStatusList", this.chargeItme);
  1157. updateTransfer(this.form).then(response => {
  1158. this.projectForm.outId = this.form.id
  1159. this.infoForm.transferId = this.form.id
  1160. this.$set(this.projectForm, "ynType", '1');
  1161. if(this.form.capitalExpenditureType==2){
  1162. addProjectto(this.projectForm).then(res => {
  1163. this.$toast.success('保存成功');
  1164. setTimeout(function(){
  1165. history.go(-1)
  1166. },2000)
  1167. })
  1168. } else if(this.form.capitalExpenditureType==4){
  1169. addInfoto(this.infoForm).then(res => {
  1170. this.$toast.success('保存成功');
  1171. setTimeout(function(){
  1172. history.go(-1)
  1173. },2000)
  1174. })
  1175. }else{
  1176. this.$toast.success('保存成功');
  1177. setTimeout(function(){
  1178. history.go(-1)
  1179. },2000)
  1180. }
  1181. })
  1182. },
  1183. payeeSelectChange(select, i) {
  1184. let obj = {};
  1185. let fuzhitype = 0;
  1186. obj = this.payeeList.find((account) => {
  1187. //model就是上面的数据源
  1188. return account.id === select ; //筛选出匹配数据
  1189. });
  1190. let _this = this
  1191. if(this.chargeItme != [] && this.chargeItme.length>1){
  1192. this.chargeItme.some((value, index) => {
  1193. if(value.payeeAccount != undefined &&value.payeeAccount != '' && obj.payeeAccount == value.payeeAccount&&index!=i&&this.form.bankType != 2){
  1194. fuzhitype = 2;
  1195. return true;
  1196. }
  1197. if(_this.form.isPeers!=undefined&&_this.form.isPeers!=null&&_this.form.isPeers=='N'){
  1198. }else{
  1199. if(obj.bankType==1&&value.accountType != undefined &&value.accountType != '' && obj.accountType != value.accountType&&index!=i){
  1200. fuzhitype = 1;
  1201. return true;
  1202. }
  1203. }
  1204. });
  1205. }
  1206. if(fuzhitype == 0){
  1207. this.$set(this.chargeItme[i], "payee",obj.payee)
  1208. this.$set(this.chargeItme[i], "bankType", obj.bankType)
  1209. this.$set(this.chargeItme[i], "payeeId", obj.id);
  1210. this.$set(this.chargeItme[i], "payeeAccount", obj.payeeAccount);
  1211. this.$set(this.chargeItme[i], "bankDeposit", obj.bankDeposit);
  1212. this.$set(this.chargeItme[i], "accountType", obj.accountType);
  1213. this.$set(this.chargeItme[i], "payeePaymentLines", obj.payeePaymentLines);
  1214. _this.bankTypeDictionaries.map(rr => {
  1215. if(rr.value==obj.bankType){
  1216. this.$set(this.chargeItme[i], "bankTypeText", rr.text);
  1217. }
  1218. })
  1219. }else if(fuzhitype == 1){
  1220. this.$set(this.chargeItme[i], "payee",'')
  1221. this.$set(this.chargeItme[i], "bankType",'')
  1222. this.$set(this.chargeItme[i], "payeeId", '');
  1223. this.$set(this.chargeItme[i], "payeeAccount", '');
  1224. this.$set(this.chargeItme[i], "bankDeposit", '');
  1225. this.$set(this.chargeItme[i], "accountType", '');
  1226. this.$set(this.chargeItme[i], "payeePaymentLines", '');
  1227. this.$set(this.chargeItme[i], "bankTypeText", '');
  1228. this.$notify({ type: 'danger', message: '请选择账户类型相同的收款方!' });
  1229. }else if(fuzhitype == 2){
  1230. this.$set(this.chargeItme[i], "payee",'')
  1231. this.$set(this.chargeItme[i], "bankType",'')
  1232. this.$set(this.chargeItme[i], "payeeId", '');
  1233. this.$set(this.chargeItme[i], "payeeAccount", '');
  1234. this.$set(this.chargeItme[i], "bankDeposit", '');
  1235. this.$set(this.chargeItme[i], "accountType", '');
  1236. this.$set(this.chargeItme[i], "payeePaymentLines", '');
  1237. this.$set(this.chargeItme[i], "bankTypeText", '');
  1238. this.$notify({ type: 'danger', message: '收款方已存在!' });
  1239. }
  1240. },
  1241. selectChange(select) {
  1242. let obj = {};
  1243. obj = this.payerOptions.find((account) => {
  1244. //model就是上面的数据源
  1245. return account.id === select; //筛选出匹配数据
  1246. });
  1247. if(obj.accountPassword != null && obj.accountPassword != "" &&
  1248. obj.bankType != null && obj.bankType != ""){
  1249. this.$set(this.form, "bookId", obj.bookId);
  1250. this.$set(this.form, "deptId", obj.deptId);
  1251. this.$set(this.form, "cashierId", obj.id);
  1252. this.$set(this.form, "payer", obj.accountName);
  1253. this.$set(this.form, "payerAccount", obj.bankAccountNumber);
  1254. this.$set(this.form, "balance", obj.balance);
  1255. this.$set(this.form, "operatorCode", obj.operatorCode);
  1256. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  1257. this.$set(this.form, "bankType", obj.bankType);
  1258. this.$set(this.form, "bankAccountType", obj.bankAccountType);
  1259. this.$set(this.form, "villageAccountType", obj.villageAccountType);
  1260. this.$set(this.form, "taccountId", obj.taccountId);
  1261. this.$set(this.form, "accountNo", obj.accountNo);
  1262. this.$set(this.form, "cifNo", obj.cifNo);
  1263. this.$set(this.form, "payerFrom", '1');
  1264. if(obj.bankType==1){
  1265. this.form.accountType = "1"
  1266. this.form.isPeers = null
  1267. this.accountTypeChange();
  1268. }else if(obj.bankType==2||obj.bankType==3){
  1269. this.form.accountType = null
  1270. this.form.isPeers = "Y"
  1271. this.accountTypeChange1();
  1272. }else{
  1273. this.payeeList = [];
  1274. this.chargeItme = [];
  1275. this.queryParams.isPeers = null
  1276. this.queryParams.accountType = ""
  1277. this.queryParams.bankType = ""
  1278. this.queryParams.status = "0"
  1279. listPayee(this.queryParams).then((response) => {
  1280. response.rows.map((res,index) => {
  1281. if(res.payeeType==1||res.payeeType==2){
  1282. response.rows[index].text = res.payee;
  1283. response.rows[index].value = res.id;
  1284. this.payeeList.push(res)
  1285. }
  1286. })
  1287. });
  1288. }
  1289. }else{
  1290. if(obj.payerFrom==1){
  1291. this.diglogStatus = false;
  1292. this.$notify({ type: 'danger', message: "请完善付款方“操作员代码”、“企业编码”、“支付口令”等信息!" });
  1293. this.$set(this.form,"payer","")
  1294. this.$set(this.form,"payerAccount","")
  1295. }else{
  1296. this.$set(this.form, "payerFrom", obj.parerFrom);
  1297. if(obj.operatorCode!=null&&obj.operatorCode!=''){
  1298. this.$set(this.form, "operatorCode", obj.operatorCode);
  1299. }else{
  1300. this.$set(this.form, "operatorCode", '');
  1301. }
  1302. if(obj.enterpriseCode!=null&&obj.enterpriseCode!=''){
  1303. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  1304. }else{
  1305. this.$set(this.form, "enterpriseCode", '');
  1306. }
  1307. if(obj.accountPassword!=null&&obj.accountPassword!=''){
  1308. this.$set(this.form, "accountPassword", obj.accountPassword);
  1309. }else{
  1310. this.$set(this.form, "accountPassword", '');
  1311. }
  1312. this.$set(this.form, "bookId",'');
  1313. this.$set(this.form, "deptId", '');
  1314. this.$set(this.form, "cashierId", obj.id);
  1315. this.$set(this.form, "payer", obj.accountName);
  1316. this.$set(this.form, "bankType", obj.bankType);
  1317. if(obj.payerFrom==6){
  1318. getQmyeFlow(obj.bankAccountNumber).then((response) => {
  1319. this.$set(this.form, "payerAccount", response.data);
  1320. });
  1321. }else {
  1322. this.$set(this.form, "payerAccount", obj.bankAccountNumber);
  1323. }
  1324. }
  1325. }
  1326. },
  1327. payeeSearch(val){
  1328. console.log(val);
  1329. this.payeeList = [];
  1330. this.queryParams.payee = this.payeeSearchValue;
  1331. listPayee(this.queryParams).then((response) => {
  1332. response.rows.map((res,index) => {
  1333. if(res.payeeType==1||res.payeeType==2){
  1334. response.rows[index].text = res.payee;
  1335. response.rows[index].value = res.id;
  1336. this.payeeList.push(res)
  1337. }
  1338. })
  1339. });
  1340. },
  1341. beforeRead(obj) {
  1342. return (file) =>{
  1343. let params1 = new FormData();
  1344. params1.append("tableId", this.form.id);
  1345. params1.append("tableName", "t_yinnong_transfer");
  1346. params1.append("bizPath", "transfer");
  1347. params1.append("fileType", obj);
  1348. params1.append("file", file.file);
  1349. commonAttach(params1).then((r1) => {
  1350. file.id=r1.id;
  1351. file.fileUrl = r1.fileUrl;
  1352. let subIndex = r1.fileUrl.lastIndexOf(".");
  1353. let ext = r1.fileUrl.substring(subIndex + 1, r1.fileUrl.length);
  1354. let baseUrl = location.protocol + "//" + location.host + request.defaults.baseURL;
  1355. let fileData = {"url": baseUrl + r1.fileUrl, "file": new File([], "name", {}), "id": r1.id,"type":ext};
  1356. if(obj === '1'){
  1357. this.fileList1.splice(-1, 1);
  1358. this.fileList1.push(fileData);
  1359. }else if(obj === '2'){
  1360. this.fileList2.splice(-1, 1);
  1361. this.fileList2.push(fileData);
  1362. }else{
  1363. this.fileList3.splice(-1, 1);
  1364. this.fileList3.push(fileData);
  1365. }
  1366. })
  1367. }
  1368. },
  1369. deleteFile(file){
  1370. systemAttachment(file.id).then((res) => {});
  1371. },
  1372. getFileList(){
  1373. let oData1= {
  1374. tableId: this.$route.query.id,
  1375. tableName: "t_yinnong_transfer",
  1376. bizPath: "transfer",
  1377. fileType: "1",
  1378. }
  1379. attachmentList(oData1).then(res => {
  1380. res.rows.map(r => {
  1381. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  1382. let subIndex = r.fileName.lastIndexOf(".");
  1383. let ext = r.fileName.substring(subIndex + 1, r.fileName.length);
  1384. this.fileList1.push({"url": baseUrl + r.fileUrl, "file": new File([], r.fileName, {}), "id": r.id,"type":ext})
  1385. })
  1386. })
  1387. let oData2= {
  1388. tableId: this.$route.query.id,
  1389. tableName: "t_yinnong_transfer",
  1390. bizPath: "transfer",
  1391. fileType: "2",
  1392. }
  1393. attachmentList(oData2).then(res => {
  1394. res.rows.map(r => {
  1395. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  1396. let subIndex = r.fileName.lastIndexOf(".");
  1397. let ext = r.fileName.substring(subIndex + 1, r.fileName.length);
  1398. this.fileList2.push({"url": baseUrl + r.fileUrl, "file": new File([], r.fileName, {}), "id": r.id,"type":ext})
  1399. })
  1400. })
  1401. let oData3= {
  1402. tableId: this.$route.query.id,
  1403. tableName: "t_yinnong_transfer",
  1404. bizPath: "transfer",
  1405. fileType: "3",
  1406. }
  1407. attachmentList(oData3).then(res => {
  1408. res.rows.map(r => {
  1409. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  1410. let subIndex = r.fileName.lastIndexOf(".");
  1411. let ext = r.fileName.substring(subIndex + 1, r.fileName.length);
  1412. this.fileList3.push({"url": baseUrl + r.fileUrl, "file": new File([], r.fileName, {}), "id": r.id,"type":ext})
  1413. })
  1414. })
  1415. },
  1416. goBack(){
  1417. this.$router.push({path:'/sunVillage_info/approvalList'})
  1418. },
  1419. deleteChargeItme(index){
  1420. this.chargeItme.splice(index,1)
  1421. },
  1422. },
  1423. watch: {
  1424. $route (to, from ) {
  1425. // 监听路由变化, 实现类似 小程序的 onShow 事件
  1426. if (to.path === '/yinnong/approvalAdd') {
  1427. // do anything you want
  1428. console.log("aaa")
  1429. if (this.$route.params.payeeForm){
  1430. this.chargeItme.push(this.$route.params.payeeForm)
  1431. console.log(this.$route.params.payeeForm)
  1432. }
  1433. }
  1434. }
  1435. },
  1436. }
  1437. </script>
  1438. <style scoped lang="scss">
  1439. /deep/ .van-nav-bar{
  1440. background: linear-gradient(to right , #9EF7FF , #2637D8);
  1441. p,i{
  1442. color: #ffffff;
  1443. }
  1444. }
  1445. .app-container {
  1446. padding-bottom: 2%;
  1447. .header_main{
  1448. height: 116px;
  1449. background: url('../../../../assets/images/sunVillage_info/list_head.png') no-repeat;
  1450. background-size: 100% 100%;
  1451. position: fixed;
  1452. top: 0;
  1453. left: 0;
  1454. width: 100%;
  1455. font-size: 36px;
  1456. line-height: 116px;
  1457. text-align: center;
  1458. color: #fff;
  1459. position: relative;
  1460. .return_btn{
  1461. width: 24px;
  1462. height: 43.2px;
  1463. background: url('../../../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
  1464. background-size: 20px 36px;
  1465. position: absolute;
  1466. left: 38px;
  1467. top: 36px;
  1468. }
  1469. .add_btn{
  1470. width: 20PX;
  1471. height: 20PX;
  1472. background: url('../../../../../static/images/icon/icon_flow.png') center center no-repeat;
  1473. background-size: 20PX 20PX;
  1474. position: absolute;
  1475. right: 38px;
  1476. top: 36px;
  1477. }
  1478. }
  1479. }
  1480. .main_title_box{
  1481. display: flex;
  1482. justify-content: space-between;
  1483. align-items: center;
  1484. }
  1485. .main_title{
  1486. font-size: 0.45rem;
  1487. color: #333333;
  1488. margin: 0.4rem 3% 0.2rem;
  1489. position: relative;
  1490. display: flex;
  1491. align-items: center;
  1492. i{
  1493. display: block;
  1494. width: 3PX;
  1495. height: 0.4rem;
  1496. background-color: #4B72E4;
  1497. margin-right: 10PX;
  1498. }
  1499. a{
  1500. background: #1989fa;
  1501. color: #ffffff;
  1502. padding: 0.05rem 0.3rem;
  1503. border-radius: 5PX;
  1504. }
  1505. }
  1506. .main_box{
  1507. width: 96%;
  1508. margin: 0 auto;
  1509. border-radius: 6px;
  1510. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  1511. overflow: hidden;
  1512. background-color: #FFF;
  1513. }
  1514. .submitButton{
  1515. width: 80%;
  1516. margin: 0 auto;
  1517. background-color: #1D6FE9;
  1518. }
  1519. .addFamily{
  1520. //position: absolute;
  1521. //top: -2px;
  1522. //right: 0;
  1523. border-radius: 50%;
  1524. margin-right: 3%;
  1525. }
  1526. .deleteFamily{
  1527. position: absolute;
  1528. top: 0rem;
  1529. right: 6%;
  1530. z-index: 9;
  1531. border-radius: 50%;
  1532. }
  1533. </style>