移动端
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

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