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

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