移动端
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 

1142 rindas
43 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/icon/icon_flow.png" size="20" @click="goFlow"/>
  14. </template>
  15. </van-nav-bar>
  16. <van-form @submit="getChange" @failed="getError" :show-error-message="false" scroll-to-error validate-first>
  17. <p class="main_title">基础信息</p>
  18. <div class="main_box">
  19. <van-field
  20. readonly
  21. clickable
  22. required
  23. :rules="[{ required: true , message:'请选择申请时间' }]"
  24. v-model="form.applyDate"
  25. label="申请时间"
  26. placeholder="请选择申请时间"
  27. @click="showlasj = true"
  28. input-align="right"
  29. right-icon="arrow-down"
  30. />
  31. <van-popup v-model="showlasj" position="bottom">
  32. <van-datetime-picker
  33. v-model="currentDate"
  34. type="date"
  35. title="选择年月日"
  36. :min-date="minDate"
  37. :max-date="maxDate"
  38. @confirm="onConfirmLasj"
  39. @cancel="showlasj = false"
  40. />
  41. </van-popup>
  42. <van-field
  43. readonly
  44. clickable
  45. required
  46. :rules="[{ required: true , message:'请选择资金支出类别' }]"
  47. label="资金支出类别"
  48. placeholder="请选择"
  49. v-model="capitalExpenditureType"
  50. @click="showcapital = true"
  51. input-align="right"
  52. right-icon="arrow-down"
  53. label-width="auto"
  54. />
  55. <van-popup v-model="showcapital" position="bottom">
  56. <van-picker
  57. show-toolbar
  58. :columns="capitalExpenditureTypeOptions"
  59. @confirm="onConfirmCapital"
  60. @cancel="showcapital = false"
  61. />
  62. </van-popup>
  63. <van-field
  64. readonly
  65. required
  66. label="支出总金额"
  67. v-model="form.expenditureAmount"
  68. placeholder="根据下方收款金额自动核算"
  69. input-align="right"
  70. label-width="auto"
  71. />
  72. <van-field name="radio" label="审批模式" input-align="right" autocomplete="off" required
  73. :rules="[{ required: true , message:'请选择审批模式' }]">
  74. <template #input>
  75. <van-radio-group v-model="form.approvalMode" direction="horizontal">
  76. <van-radio name="1">线上审批</van-radio>
  77. <van-radio name="2">线下审批</van-radio>
  78. </van-radio-group>
  79. </template>
  80. </van-field>
  81. </div>
  82. <div class="main_box" style="margin-top: 10px;">
  83. <van-field
  84. label="付款事由"
  85. v-model="form.remark"
  86. type="textarea"
  87. placeholder="请输入付款事由"
  88. input-align="right"
  89. rows="3"
  90. label-width="auto"
  91. required
  92. :rules="[{ required: true , message:'请输入付款事由' }]"
  93. />
  94. </div>
  95. <div class="main_box" style="margin-top: 10px;">
  96. <van-field label="说明情况" v-model="form.explainSituation" type="textarea" placeholder="请输入说明情况" input-align="right" rows="3" label-width="auto"/>
  97. </div>
  98. <p class="main_title" v-if="capitalExpenditureOpen">关联项目</p>
  99. <div class="main_box" v-if="capitalExpenditureOpen" style="margin-bottom: 10px;margin-top: 10px;position:relative;">
  100. <van-field
  101. readonly
  102. clickable
  103. label="项目名称"
  104. placeholder="请选择"
  105. v-model="projectForm.projectName"
  106. @click="showproject = true"
  107. input-align="right"
  108. right-icon="arrow-down"
  109. required
  110. :rules="[{ required: true , message:'请选择项目名称' }]"
  111. />
  112. <van-popup v-model="showproject" position="bottom">
  113. <van-picker
  114. show-toolbar
  115. :columns="projectList"
  116. @confirm="onConfirmProject"
  117. @cancel="showproject = false"
  118. />
  119. </van-popup>
  120. <van-field required :rules="[{ required: true , message:'请输入承建单位' }]" v-model="projectForm.projectContractor" label="承建单位" placeholder="请输入承建单位" input-align="right" label-width="auto"/>
  121. <van-field required :rules="[{ required: true , message:'请输入合同价款' }]" v-model="projectForm.projectAmount" label="合同价款(元)" placeholder="请输入合同价款(元)" input-align="right" label-width="auto"/>
  122. <van-field
  123. readonly
  124. clickable
  125. label="工程款类型"
  126. placeholder="请选择"
  127. v-model="projectFundType"
  128. @click="showFundType = true"
  129. input-align="right"
  130. right-icon="arrow-down"
  131. required
  132. :rules="[{ required: true , message:'请选择工程款类型' }]"
  133. />
  134. <van-popup v-model="showFundType" position="bottom">
  135. <van-picker
  136. show-toolbar
  137. :columns="projectFundTypeOptions"
  138. @confirm="onConfirmFundType"
  139. @cancel="showFundType = false"
  140. />
  141. </van-popup>
  142. <van-field required :rules="[{ required: true , message:'请输入工程发票号' }]" v-model="projectForm.projectBillNum" label="工程发票号" placeholder="请输入工程发票号" input-align="right" label-width="auto"/>
  143. </div>
  144. <p class="main_title" v-if="contractOpen">关联合同</p>
  145. <div class="main_box" v-if="contractOpen" style="margin-bottom: 10px;margin-top: 10px;position:relative;">
  146. <van-field
  147. readonly
  148. clickable
  149. label="合同"
  150. placeholder="请选择"
  151. v-model="infoForm.name"
  152. @click="showcontract = true"
  153. input-align="right"
  154. right-icon="arrow-down"
  155. required
  156. :rules="[{ required: true , message:'请选择项目名称' }]"
  157. />
  158. <van-popup v-model="showcontract" position="bottom">
  159. <van-picker
  160. show-toolbar
  161. :columns="infoList"
  162. @confirm="onConfirmContract"
  163. @cancel="showcontract = false"
  164. />
  165. </van-popup>
  166. <van-field required :rules="[{ required: true , message:'请输入合同编码' }]" v-model="infoForm.code" label="合同编码" placeholder="请输入合同编码" input-align="right" label-width="auto"/>
  167. <van-field required :rules="[{ required: true , message:'请输入合同价款' }]" v-model="infoForm.totalAmount" label="合同价款(元)" placeholder="请输入合同价款(元)" input-align="right" label-width="auto"/>
  168. </div>
  169. <p class="main_title">付款方信息</p>
  170. <div class="main_box">
  171. <!-- <van-field label="付款方" v-model="form.payer" placeholder="请输入付款方" input-align="right" label-width="auto"/>-->
  172. <van-field
  173. readonly
  174. clickable
  175. label="付款方"
  176. placeholder="请选择付款方"
  177. v-model="form.payer"
  178. @click="showpayer = true"
  179. input-align="right"
  180. right-icon="arrow-down"
  181. label-width="auto"
  182. required
  183. :rules="[{ required: true , message:'请选择付款方' }]"
  184. />
  185. <van-popup v-model="showpayer" position="bottom">
  186. <van-picker
  187. show-toolbar
  188. :columns="payerOptions"
  189. @confirm="onConfirmPayer($event)"
  190. @cancel="showpayer = false"
  191. />
  192. </van-popup>
  193. <van-field :rules="[{ required: true , message:'请输入付款方账户' }]" required label="付款方账户" v-model="form.payerAccount" placeholder="请输入账户" input-align="right" label-width="auto"/>
  194. </div>
  195. <p class="main_title">收款方信息<van-button icon="plus" @click="addChargeItme(chargeItme.length)" size="mini" type="info" native-type="button" class="addFamily"/></p>
  196. <div class="main_box" style="margin-bottom: 15px;">
  197. <van-cell title="收款账户类型" v-if="form.bankType==1">
  198. <template #right-icon>
  199. <van-radio-group direction="horizontal" v-model="form.accountType" @change="accountTypeChange">
  200. <van-radio name="1">公户</van-radio>
  201. <van-radio name="2">私户</van-radio>
  202. </van-radio-group>
  203. </template>
  204. </van-cell>
  205. <van-cell title="是否与付款方同行" v-if="this.form.bankType == 2 || this.form.bankType == 3 || this.form.bankType == 4">
  206. <template #right-icon>
  207. <van-radio-group direction="horizontal" v-model="form.isPeers" @change="accountTypeChange1">
  208. <van-radio name="Y">是</van-radio>
  209. <van-radio name="N">否</van-radio>
  210. </van-radio-group>
  211. </template>
  212. </van-cell>
  213. </div>
  214. <div :style="{position:'relative',padding: index == 0 ? '':'10px 0 0 0'}" v-for="(item, index) in chargeItme" :key="index">
  215. <van-button icon="minus" size="mini" type="danger" class="deleteFamily" native-type="button" v-if="index!=0" @click="deleteChargeItme(index)" />
  216. <div class="main_box" style="margin-bottom: 10px;position:relative;">
  217. <van-field
  218. readonly
  219. clickable
  220. label="收款方"
  221. placeholder="请选择"
  222. v-model="item.payee"
  223. @click="item.showPayee = true"
  224. input-align="right"
  225. right-icon="arrow-down"
  226. required
  227. :rules="[{ required: true , message:'请选择收款方' }]"
  228. />
  229. <van-popup v-model="item.showPayee" position="bottom">
  230. <van-picker
  231. show-toolbar
  232. :columns="payeeList"
  233. @confirm="onConfirmPayee($event,index)"
  234. @cancel="item.showPayee = false"
  235. />
  236. </van-popup>
  237. <van-field required :rules="[{ required: true , message:'请输入账户' }]" v-model="item.payeeAccount" label="收款账户" placeholder="请输入账户" input-align="right" label-width="auto"/>
  238. <van-field required :rules="[{ required: true , message:'请输入银行' }]" v-model="item.bankDeposit" label="开户银行" placeholder="请输入银行" input-align="right" label-width="auto"/>
  239. <van-field required :rules="[{ required: true , message:'请输入金额' }]" v-model="item.incomeAmount" type="number" label="收入金额" placeholder="请输入金额" input-align="right" label-width="auto" @change="moneyChange"/>
  240. <van-field
  241. readonly
  242. clickable
  243. label="所属银行"
  244. placeholder="请选择"
  245. v-model="item.bankTypeText"
  246. input-align="right"
  247. required
  248. :rules="[{ required: true , message:'请选择所属银行' }]"
  249. />
  250. </div>
  251. </div>
  252. <p class="main_title">上传附件</p>
  253. <div class="main_box" style="padding: 5px 0 0 0;">
  254. <van-cell value="收据" />
  255. <van-uploader v-model="fileList1" :after-read="beforeRead1" @delete="deleteFile1" style="margin-left:8px;"></van-uploader>
  256. <van-cell title="发票" />
  257. <van-uploader v-model="fileList2" :after-read="beforeRead2" @delete="deleteFile2" style="margin-left:8px;"></van-uploader>
  258. <van-cell title="其他" />
  259. <van-uploader v-model="fileList3" :after-read="beforeRead3" @delete="deleteFile3" style="margin-left:8px;"></van-uploader>
  260. </div>
  261. <div style="padding: 16px 0;">
  262. <van-row>
  263. <van-col span="12" align="center">
  264. <!-- @click="goUpdate"-->
  265. <van-button type="info" native-type="submit" @click="buttonType='update'" class="submitButton">保<i style="margin-right: 1em;"></i>存</van-button>
  266. </van-col>
  267. <van-col span="12" align="center">
  268. <!-- @click="goAdd"-->
  269. <van-button type="info" native-type="submit" @click="buttonType='add'" class="submitButton">保存并提交</van-button>
  270. </van-col>
  271. </van-row>
  272. <div class="clear"></div>
  273. </div>
  274. </van-form>
  275. </div>
  276. </template>
  277. <script>
  278. import { addTransfer , listPayee , updateTransfer , getProjectto , listProject , addProjectto , customSubmit , getAccount ,getQmyeFlow, attach ,listInfo ,getInfoto ,addInfoto} from "@/api/onlineHome/bankAgriculture/paymentApproval";
  279. import {
  280. attachmentList,
  281. commonAttach, listAccount1,
  282. listVaccount,
  283. listVaccount1
  284. } from "../../../../api/onlineHome/bankAgriculture/paymentApproval";
  285. import request from '@/utils/request'
  286. import Dialog from "vant/lib/dialog";
  287. export default {
  288. name: "approvalAdd4",
  289. data() {
  290. return {
  291. showcontract:false,
  292. showcapital:false,
  293. showpayee:false,
  294. showlasj:false,
  295. showbankType:false,
  296. showproject:false,
  297. showFundType:false,
  298. showpayer:false,
  299. buttonType:'a',
  300. minDate: new Date(2000, 1, 1),
  301. maxDate: new Date(2050, 12, 31),
  302. currentDate: new Date(),
  303. form:{},
  304. fileList1:[],
  305. fileList2:[],
  306. fileList3:[],
  307. capitalExpenditureType:'',
  308. payee:'',
  309. bankType:'',
  310. wfydlxDictionaries:[],
  311. jglxDictionaries:[],
  312. sysDictionaries:[],
  313. capitalExpenditureTypeOptions:[],
  314. bankTypeDictionaries:[],
  315. projectList:[],
  316. projectFundTypeOptions:[],
  317. projectFundTypeDictionaries:[],
  318. infoList:[],
  319. payerOptions:[],
  320. chargeItme:[],
  321. chargeItmeShow:[],
  322. payeeList:[],
  323. // 查询参数
  324. queryParams: {
  325. transferType:"",
  326. orderByColumn: "id",
  327. isAsc: "desc",
  328. },
  329. capitalExpenditureOpen:false,
  330. contractOpen:false,
  331. projectForm:{
  332. projectId:null,
  333. projectName:null,
  334. projectContractor:null,
  335. projectAmount:null,
  336. projectBillNum:null,
  337. projectFundType:'1',
  338. outId:null,
  339. ynType:'1'
  340. },
  341. infoForm:{
  342. infoId:null,
  343. name:null,
  344. code:null,
  345. totalAmount:null,
  346. contractionId:null,
  347. transferId:null
  348. },
  349. // 合同信息查询参数
  350. queryContractionParams: {
  351. pageNum: 1,
  352. pageSize: 100,
  353. contractionStatus: '1',
  354. orderByColumn: "endTime",
  355. isAsc: "desc",
  356. },
  357. projectFundType:'',
  358. uploadFiles1:[],
  359. uploadFiles2:[],
  360. uploadFiles3:[],
  361. nowDate:""
  362. };
  363. },
  364. created() {
  365. this.getNowDate();
  366. this.reset();
  367. this.initProjectInfo();
  368. this.capitalExpenditureOpen = false
  369. this.getDicts("project_fund_type").then((response) => {
  370. for (var i = 0; i < response.data.length; i++) {
  371. this.projectFundTypeOptions.push({text: response.data[i].dictLabel, value: response.data[i].dictValue});
  372. }
  373. this.projectFundTypeDictionaries = response.data;
  374. });
  375. let params1={
  376. villageAccountType:'1',
  377. //"params":{townAccountType:'1'}
  378. }
  379. listAccount1(params1).then((response) => {
  380. this.payerOptions = []
  381. response.rows.map((res,index) => {
  382. res['payerFrom'] = '2'
  383. res['text']= res.accountName;
  384. res['value'] = res.id;
  385. this.payerOptions.push(res)
  386. })
  387. });
  388. this.getDictionaries();
  389. },
  390. methods: {
  391. goFlow(){
  392. if(this.form.approvalMode == '1' && this.form.approvalTemplateId != undefined && this.form.approvalTemplateId != "undefined"){
  393. window.location='approvalProcess3?approvalTemplateId='+this.form.approvalTemplateId+'&approvalMode='+this.form.approvalMode;
  394. }else{
  395. this.$notify({ type: 'danger', message: '无审批流程!' });
  396. }
  397. },
  398. getNowDate(){
  399. var _this = this;
  400. let yy = new Date().getFullYear();
  401. let mm = new Date().getMonth()+1;
  402. let dd = new Date().getDate();
  403. _this.nowDate = yy+'-'+mm+'-'+dd
  404. },
  405. initProjectInfo(){
  406. let _this = this
  407. let queryParams={
  408. pageNum: 1,
  409. pageSize: 100,
  410. }
  411. listProject(queryParams).then(response => {
  412. _this.projectList = response.rows;
  413. for (let i = 0; i < response.rows.length; i++) {
  414. //_this.projectList[i].set({text: response.rows[i].projectName, value: response.rows[i].id});
  415. _this.$set(_this.projectList[i],"text",response.rows[i].projectName)
  416. _this.$set(_this.projectList[i],"value",response.rows[i].id)
  417. }
  418. });
  419. listInfo(this.queryContractionParams).then(response => {
  420. _this.infoList = response.rows;
  421. for (let i = 0; i < response.rows.length; i++) {
  422. //_this.infoList[i].push({text: response.rows[i].name, value: response.rows[i].code});
  423. _this.$set(_this.infoList[i],"text",response.rows[i].name)
  424. _this.$set(_this.infoList[i],"value",response.rows[i].code)
  425. }
  426. });
  427. },
  428. // 表单重置
  429. reset() {
  430. this.form = {
  431. id: null,
  432. upId: null,
  433. applyDate:this.nowDate,
  434. approvalMode:'1',
  435. downId: null,
  436. orderId: null,
  437. cashierId: null,
  438. transferType: '4',
  439. accountType: null,
  440. isPeers:null,
  441. explainSituation: null,
  442. succeedAmount: null,
  443. payer: null,
  444. payerAccount: null,
  445. operatorCode: null,
  446. enterpriseCode: null,
  447. expenditureAmount: null,
  448. capitalExpenditureType: '1',
  449. remark: null,
  450. transferStatus: "0",
  451. auditStatus: "0",
  452. paymentState: "1",
  453. bankPriority: "0",
  454. clientPriority: "0"
  455. };
  456. this.processList = {}
  457. this.projectForm={
  458. projectId:null,
  459. projectName:null,
  460. projectContractor:null,
  461. projectAmount:null,
  462. projectBillNum:null,
  463. projectFundType:'1',
  464. outId:null,
  465. ynType:'1'
  466. }
  467. },
  468. getChange(){
  469. console.log(this.buttonType)
  470. if(this.buttonType == 'update'){
  471. console.log('update')
  472. this.goUpdate();
  473. }else if(this.buttonType == 'add'){
  474. console.log('add')
  475. this.goAdd();
  476. }
  477. },
  478. getDictionaries(){
  479. this.getDicts("capital_expenditure_type").then((res) => {
  480. for (var i = 0; i < res.data.length; i++) {
  481. this.capitalExpenditureTypeOptions.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  482. }
  483. });
  484. this.getDicts("bank_type_all").then(res => {
  485. for (var i = 0; i < res.data.length; i++) {
  486. this.bankTypeDictionaries.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  487. }
  488. });
  489. this.getPayeeList();
  490. },
  491. getError(e){
  492. console.log(e)
  493. this.$notify({ type: 'danger', message: e.errors[0].message });
  494. },
  495. addChargeItme(index){
  496. if(this.chargeItme.length>0&&this.chargeItme[this.chargeItme.length-1].payee == ''){
  497. this.$notify({ type: 'danger', message: '请勿添加多个空列表信息' });
  498. return;
  499. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].incomeAmount == ''){
  500. this.$notify({ type: 'danger', message: '请输入收入金额!' });
  501. return;
  502. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].payeeAccount == ''){
  503. this.$notify({ type: 'danger', message: '请输入收款账户!' });
  504. return;
  505. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankDeposit == ''){
  506. this.$notify({ type: 'danger', message: '请输入开户银行!' });
  507. return;
  508. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankType == ''){
  509. this.$notify({ type: 'danger', message: '请选择所属银行!' });
  510. return;
  511. }
  512. this.getDicts("bank_type").then(res => {
  513. this.chargeItme.splice(index + 1, 0, {
  514. payeeId: "", //收款方ID
  515. payee: "", //收款方
  516. payeeAccount: "", //收款账户
  517. bankDeposit: "", //开户银行
  518. incomeAmount: "", //收入金额
  519. bankType: "", //所属银行
  520. bankTypeText:'', //所属银行
  521. showPayee:false,
  522. showbankType:false
  523. });
  524. });
  525. },
  526. getPayeeList() {
  527. //普通转账
  528. this.queryParams.status = "0"
  529. listPayee(this.queryParams).then((response) => {
  530. response.rows.map((res,index) => {
  531. if(res.payeeType==1||res.payeeType==2){
  532. res.text = res.payee;
  533. res.value = res.id;
  534. this.payeeList.push(res)
  535. }
  536. })
  537. });
  538. },
  539. payeeDictLabel(datas, value) {
  540. var actions = [];
  541. Object.keys(datas).some((key) => {
  542. if (datas[key].payeeId == ('' + value)) {
  543. actions.push(datas[key].payee);
  544. return true;
  545. }
  546. })
  547. return actions.join('');
  548. },
  549. onConfirmCapital(data){
  550. if (data.value == 2){
  551. this.capitalExpenditureOpen = true;
  552. this.contractOpen = false
  553. this.infoForm = {};
  554. }else if(data.value == 4){
  555. this.capitalExpenditureOpen = false;
  556. this.contractOpen = true
  557. this.projectForm = {};
  558. }else{
  559. this.capitalExpenditureOpen = false;
  560. this.contractOpen = false
  561. this.projectForm = {};
  562. this.infoForm = {};
  563. }
  564. this.capitalExpenditureType = data.text;
  565. this.form.capitalExpenditureType = data.value;
  566. this.showcapital = false;
  567. },
  568. onConfirmFundType(data){
  569. console.log(data)
  570. this.projectForm.projectFundType = data.value;
  571. this.projectFundType = data.text;
  572. this.showFundType = false;
  573. },
  574. onConfirmContract(data){
  575. this.infoList.map(res => {
  576. if(res.name==data.text){
  577. this.infoForm.contractionId = res.id;
  578. this.infoForm.name = res.name;
  579. this.infoForm.code = res.code;
  580. this.infoForm.totalAmount = res.totalAmount;
  581. }
  582. })
  583. this.showcontract = false;
  584. },
  585. onConfirmProject(data){
  586. this.projectList.map(res => {
  587. if(res.projectName==data.text){
  588. this.projectForm.projectId = res.id
  589. this.projectForm.projectName = res.projectName
  590. this.projectForm.projectContractor = res.projectContractor
  591. this.projectForm.projectAmount = res.projectAmount
  592. }
  593. })
  594. this.showproject = false;
  595. },
  596. onConfirmPayee(data,index){
  597. for (let i = 0 ; i < this.chargeItme.length ; i++){
  598. this.chargeItme[i].showPayee = false;
  599. }
  600. this.chargeItme[index].payee = data.text;
  601. this.chargeItme[index].payeeId = data.value;
  602. this.chargeItme[index].showpayee = false;
  603. this.payeeSelectChange(data.value , index)
  604. this.onConfirmBankType(data,index)
  605. },
  606. onConfirmBankType(data,index){
  607. console.log(this.bankTypeDictionaries)
  608. this.bankTypeDictionaries.map(res => {
  609. if(res.value==data.bankType){
  610. this.chargeItme[index].bankTypeText = res.text;
  611. this.chargeItme[index].bankType = res.value;
  612. }
  613. })
  614. },
  615. onConfirmPayer(data){
  616. this.form.payer = data.text;
  617. this.form.cashierId = data.value;
  618. this.showpayer = false;
  619. this.selectChange(data.value)
  620. },
  621. onConfirmLasj(data){
  622. this.form.applyDate = this.getNowFormatDate(data).substr(0,10);
  623. this.showlasj = false;
  624. },
  625. accountTypeChange(e){
  626. this.payeeList = [];
  627. this.chargeItme = [];
  628. this.queryParams.isPeers = this.form.isPeers
  629. this.queryParams.accountType = this.form.accountType
  630. this.queryParams.bankType = this.form.bankType
  631. this.queryParams.status = "0"
  632. listPayee(this.queryParams).then((response) => {
  633. response.rows.map((res,index) => {
  634. if(res.payeeType==1||res.payeeType==2){
  635. response.rows[index].text = res.payee;
  636. response.rows[index].value = res.id;
  637. this.payeeList.push(res)
  638. }
  639. })
  640. });
  641. },
  642. accountTypeChange1(e){
  643. this.payeeList = [];
  644. this.chargeItme = [];
  645. this.queryParams.isPeers = this.form.isPeers
  646. this.queryParams.accountType = this.form.accountType
  647. this.queryParams.bankType = this.form.bankType
  648. this.queryParams.status = "0"
  649. listPayee(this.queryParams).then((response) => {
  650. response.rows.map((res,index) => {
  651. if(res.payeeType==1||res.payeeType==2){
  652. response.rows[index].text = res.payee;
  653. response.rows[index].value = res.id;
  654. this.payeeList.push(res)
  655. }
  656. })
  657. });
  658. },
  659. // 钱计算
  660. moneyChange(input) {
  661. console.log(input)
  662. let obj = {};
  663. obj = this.chargeItme.find((account) => {
  664. //model就是上面的数据源
  665. return parseFloat(account.incomeAmount).toFixed(2) === input; //筛选出匹配数据
  666. });
  667. let total = 0;
  668. this.chargeItme.forEach((money) => {
  669. total = (parseFloat(total) + parseFloat(money.incomeAmount)).toFixed(2)
  670. });
  671. this.$set(this.form, "expenditureAmount", total);
  672. },
  673. goAdd(){
  674. if(this.chargeItme.length<1){
  675. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  676. return;
  677. }
  678. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  679. this.$notify({ type: 'danger', message: '付款事由禁止包含!' });
  680. return;
  681. }
  682. if(this.form.capitalExpenditureType==2){
  683. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  684. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  685. return;
  686. }
  687. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  688. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  689. return;
  690. }
  691. }
  692. if(this.form.capitalExpenditureType==4){
  693. if(this.infoForm.name==""||this.infoForm.name==null){
  694. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  695. return;
  696. }
  697. if(this.infoForm.code==""||this.infoForm.code==null){
  698. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  699. return;
  700. }
  701. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  702. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  703. return;
  704. }
  705. }
  706. if((this.uploadFiles1==null||this.uploadFiles1.length==0)&&(this.uploadFiles2==null||this.uploadFiles2.length==0)&&(this.uploadFiles3==null||this.uploadFiles3.length==0)){
  707. Dialog.confirm({
  708. title: '提示',
  709. message: '此申请单中未上传任何附件,是否确认提交?',
  710. })
  711. .then(() => {
  712. this.$set(this.form, "payeeList", this.chargeItme);
  713. this.$set(this.form, "bankTypeList", this.chargeItme);
  714. this.$set(this.form, "accountTypeList", this.chargeItme);
  715. this.$set(this.form, "transferStatusList", this.chargeItme);
  716. addTransfer(this.form).then(response => {
  717. this.projectForm.outId = response.data.id
  718. this.infoForm.transferId = response.data.id
  719. this.$set(this.projectForm, "ynType", '1');
  720. if(this.form.capitalExpenditureType==2){
  721. addProjectto(this.projectForm).then(res => {
  722. customSubmit(response.data.id).then(res => {
  723. this.$toast.success('提交成功');
  724. setTimeout(function(){
  725. history.go(-1)
  726. },2000)
  727. })
  728. })
  729. }else if(this.form.capitalExpenditureType==4){
  730. addInfoto(this.infoForm).then(res => {
  731. customSubmit(response.data.id).then(res => {
  732. this.$toast.success('提交成功');
  733. setTimeout(function(){
  734. history.go(-1)
  735. },2000)
  736. })
  737. })
  738. }else{
  739. customSubmit(response.data.id).then(res => {
  740. this.$toast.success('提交成功');
  741. setTimeout(function(){
  742. history.go(-1)
  743. },2000)
  744. })
  745. }
  746. });
  747. })
  748. .catch(() => {
  749. return false;
  750. });
  751. }else{
  752. this.$set(this.form, "payeeList", this.chargeItme);
  753. this.$set(this.form, "bankTypeList", this.chargeItme);
  754. this.$set(this.form, "accountTypeList", this.chargeItme);
  755. this.$set(this.form, "transferStatusList", this.chargeItme);
  756. addTransfer(this.form).then(response => {
  757. this.projectForm.outId = response.data.id
  758. this.infoForm.transferId = response.data.id
  759. this.$set(this.projectForm, "ynType", '1');
  760. if(this.uploadFiles1!=null&&this.uploadFiles1.length>0){
  761. this.uploadFiles1.map(rr => {
  762. const params = new FormData();
  763. params.append("tableId", this.form.id);
  764. params.append("tableName", "t_yinnong_transfer");
  765. params.append("bizPath", "transfer");
  766. params.append("fileType", "1");
  767. params.append("file", rr);
  768. commonAttach(params).then((r) => {
  769. })
  770. })}
  771. if(this.uploadFiles2!=null&&this.uploadFiles2.length>0){
  772. this.uploadFiles2.map(rr => {
  773. const params = new FormData();
  774. params.append("tableId", this.form.id);
  775. params.append("tableName", "t_yinnong_transfer");
  776. params.append("bizPath", "transfer");
  777. params.append("fileType", "2");
  778. params.append("file", rr);
  779. commonAttach(params).then((r) => {
  780. })
  781. })}
  782. if(this.uploadFiles3!=null&&this.uploadFiles3.length>0){
  783. this.uploadFiles3.map(rr => {
  784. const params = new FormData();
  785. params.append("tableId", this.form.id);
  786. params.append("tableName", "t_yinnong_transfer");
  787. params.append("bizPath", "transfer");
  788. params.append("fileType", "3");
  789. params.append("file", rr);
  790. commonAttach(params).then((r) => {
  791. })
  792. })}
  793. if(this.form.capitalExpenditureType==2){
  794. addProjectto(this.projectForm).then(res => {
  795. customSubmit(response.data.id).then(res => {
  796. this.$toast.success('提交成功');
  797. setTimeout(function(){
  798. history.go(-1)
  799. },2000)
  800. })
  801. })
  802. } else if(this.form.capitalExpenditureType==4){
  803. addInfoto(this.infoForm).then(res => {
  804. customSubmit(response.data.id).then(res => {
  805. this.$toast.success('提交成功');
  806. setTimeout(function(){
  807. history.go(-1)
  808. },2000)
  809. })
  810. })
  811. }else{
  812. customSubmit(response.data.id).then(res => {
  813. this.$toast.success('提交成功');
  814. setTimeout(function(){
  815. history.go(-1)
  816. },2000)
  817. })
  818. }
  819. });
  820. }
  821. },
  822. goUpdate(){
  823. if(this.chargeItme.length<1){
  824. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  825. return;
  826. }
  827. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  828. this.$notify({ type: 'danger', message: '付款事由禁止包含!' });
  829. return;
  830. }
  831. if(this.form.capitalExpenditureType==2){
  832. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  833. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  834. return;
  835. }
  836. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  837. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  838. return;
  839. }
  840. }
  841. if(this.form.capitalExpenditureType==4){
  842. if(this.infoForm.name==""||this.infoForm.name==null){
  843. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  844. return;
  845. }
  846. if(this.infoForm.code==""||this.infoForm.code==null){
  847. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  848. return;
  849. }
  850. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  851. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  852. return;
  853. }
  854. }
  855. this.$set(this.form, "payeeList", this.chargeItme);
  856. this.$set(this.form, "bankTypeList", this.chargeItme);
  857. this.$set(this.form, "accountTypeList", this.chargeItme);
  858. this.$set(this.form, "transferStatusList", this.chargeItme);
  859. addTransfer(this.form).then((response) => {
  860. this.projectForm.outId = response.data.id
  861. this.infoForm.transferId = response.data.id
  862. this.$set(this.projectForm, "ynType", '1');
  863. if(this.uploadFiles1!=null&&this.uploadFiles1.length>0){
  864. this.uploadFiles1.map(rr => {
  865. const params = new FormData();
  866. params.append("tableId", this.form.id);
  867. params.append("tableName", "t_yinnong_transfer");
  868. params.append("bizPath", "transfer");
  869. params.append("fileType", "1");
  870. params.append("file", rr);
  871. commonAttach(params).then((r) => {
  872. })
  873. })}
  874. if(this.uploadFiles2!=null&&this.uploadFiles2.length>0){
  875. this.uploadFiles2.map(rr => {
  876. const params = new FormData();
  877. params.append("tableId", this.form.id);
  878. params.append("tableName", "t_yinnong_transfer");
  879. params.append("bizPath", "transfer");
  880. params.append("fileType", "2");
  881. params.append("file", rr);
  882. commonAttach(params).then((r) => {
  883. })
  884. })}
  885. if(this.uploadFiles3!=null&&this.uploadFiles3.length>0){
  886. this.uploadFiles3.map(rr => {
  887. const params = new FormData();
  888. params.append("tableId", this.form.id);
  889. params.append("tableName", "t_yinnong_transfer");
  890. params.append("bizPath", "transfer");
  891. params.append("fileType", "3");
  892. params.append("file", rr);
  893. commonAttach(params).then((r) => {
  894. })
  895. })}
  896. if(this.form.capitalExpenditureType==2){
  897. addProjectto(this.projectForm).then(res => {
  898. this.$toast.success('保存成功');
  899. setTimeout(function(){
  900. history.go(-1)
  901. },2000)
  902. })
  903. }else if(this.form.capitalExpenditureType==4){
  904. addInfoto(this.infoForm).then(res => {
  905. this.$toast.success('保存成功');
  906. setTimeout(function(){
  907. history.go(-1)
  908. },2000)
  909. })
  910. }else{
  911. this.$toast.success('保存成功');
  912. setTimeout(function(){
  913. history.go(-1)
  914. },2000)
  915. }
  916. });
  917. },
  918. payeeSelectChange(select, i) {
  919. let obj = {};
  920. let fuzhitype = 0;
  921. obj = this.payeeList.find((account) => {
  922. //model就是上面的数据源
  923. return account.id === select ; //筛选出匹配数据
  924. });
  925. let _this = this
  926. if(this.chargeItme != [] && this.chargeItme.length>1){
  927. this.chargeItme.some((value, index) => {
  928. if(value.payeeAccount != undefined &&value.payeeAccount != '' && obj.payeeAccount == value.payeeAccount&&index!=i){
  929. fuzhitype = 2;
  930. return true;
  931. }
  932. if(_this.form.isPeers!=undefined&&_this.form.isPeers!=null&&_this.form.isPeers=='N'){
  933. }else{
  934. if(obj.bankType==1&&value.accountType != undefined &&value.accountType != '' && obj.accountType != value.accountType&&index!=i){
  935. fuzhitype = 1;
  936. return true;
  937. }
  938. }
  939. });
  940. }
  941. if(fuzhitype == 0){
  942. this.$set(this.chargeItme[i], "payee",obj.payee)
  943. this.$set(this.chargeItme[i], "bankType", obj.bankType)
  944. this.$set(this.chargeItme[i], "payeeId", obj.id);
  945. this.$set(this.chargeItme[i], "payeeAccount", obj.payeeAccount);
  946. this.$set(this.chargeItme[i], "bankDeposit", obj.bankDeposit);
  947. this.$set(this.chargeItme[i], "accountType", obj.accountType);
  948. this.$set(this.chargeItme[i], "payeePaymentLines", obj.payeePaymentLines);
  949. _this.bankTypeDictionaries.map(rr => {
  950. if(rr.value==obj.bankType){
  951. this.$set(this.chargeItme[i], "bankTypeText", rr.text);
  952. }
  953. })
  954. }else if(fuzhitype == 1){
  955. this.$set(this.chargeItme[i], "payee",'')
  956. this.$set(this.chargeItme[i], "bankType",'')
  957. this.$set(this.chargeItme[i], "payeeId", '');
  958. this.$set(this.chargeItme[i], "payeeAccount", '');
  959. this.$set(this.chargeItme[i], "bankDeposit", '');
  960. this.$set(this.chargeItme[i], "accountType", '');
  961. this.$set(this.chargeItme[i], "payeePaymentLines", '');
  962. this.$set(this.chargeItme[i], "bankTypeText", '');
  963. this.$notify({ type: 'danger', message: '请选择账户类型相同的收款方!' });
  964. }else if(fuzhitype == 2){
  965. this.$set(this.chargeItme[i], "payee",'')
  966. this.$set(this.chargeItme[i], "bankType",'')
  967. this.$set(this.chargeItme[i], "payeeId", '');
  968. this.$set(this.chargeItme[i], "payeeAccount", '');
  969. this.$set(this.chargeItme[i], "bankDeposit", '');
  970. this.$set(this.chargeItme[i], "accountType", '');
  971. this.$set(this.chargeItme[i], "payeePaymentLines", '');
  972. this.$set(this.chargeItme[i], "bankTypeText", '');
  973. this.$notify({ type: 'danger', message: '收款方已存在!' });
  974. }
  975. },
  976. selectChange(select) {
  977. let obj = {};
  978. obj = this.payerOptions.find((account) => {
  979. //model就是上面的数据源
  980. return account.id === select; //筛选出匹配数据
  981. });
  982. console.log(obj)
  983. this.$set(this.form, "bookId", obj.bookId);
  984. this.$set(this.form, "deptId", obj.deptId);
  985. this.$set(this.form, "cashierId", obj.id);
  986. this.$set(this.form, "payer", obj.accountName);
  987. this.$set(this.form, "payerAccount", obj.bankAccountNumber);
  988. this.$set(this.form, "operatorCode", obj.operatorCode);
  989. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  990. this.$set(this.form, "bankType", obj.bankType);
  991. this.$set(this.form, "bankAccountType", obj.bankAccountType);
  992. this.$set(this.form, "villageAccountType", obj.villageAccountType);
  993. this.$set(this.form, "taccountId", obj.taccountId);
  994. this.$set(this.form, "accountNo", obj.accountNo);
  995. this.$set(this.form, "cifNo", obj.cifNo);
  996. this.$set(this.form, "payerFrom", '1');
  997. if(obj.bankType==1){
  998. this.form.accountType = "1"
  999. this.form.isPeers = null
  1000. this.accountTypeChange();
  1001. }else if(obj.bankType==2||obj.bankType==4){
  1002. this.form.accountType = null
  1003. this.form.isPeers = "Y"
  1004. this.accountTypeChange1();
  1005. }
  1006. },
  1007. beforeRead1(file) {
  1008. this.uploadFiles1.push(file.file);
  1009. },
  1010. deleteFile1(file){
  1011. this.uploadFiles1.map((response,index) => {
  1012. if(file.file == response){
  1013. this.uploadFiles1.splice(index,1)
  1014. }
  1015. })
  1016. },
  1017. beforeRead2(file) {
  1018. this.uploadFiles2.push(file.file);
  1019. },
  1020. deleteFile2(file){
  1021. this.uploadFiles2.map((response,index) => {
  1022. if(file.file == response){
  1023. this.uploadFiles2.splice(index,1)
  1024. }
  1025. })
  1026. },
  1027. beforeRead3(file) {
  1028. this.uploadFiles3.push(file.file);
  1029. },
  1030. deleteFile3(file){
  1031. this.uploadFiles3.map((response,index) => {
  1032. if(file.file == response){
  1033. this.uploadFiles3.splice(index,1)
  1034. }
  1035. })
  1036. },
  1037. getFileList(){
  1038. let oData1= {
  1039. tableId: this.$route.query.id,
  1040. tableName: "t_yinnong_transfer",
  1041. bizPath: "transfer",
  1042. fileType: "1",
  1043. }
  1044. attachmentList(oData1).then(res => {
  1045. res.rows.map(r => {
  1046. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  1047. this.fileList1.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{})})
  1048. })
  1049. })
  1050. let oData2= {
  1051. tableId: this.$route.query.id,
  1052. tableName: "t_yinnong_transfer",
  1053. bizPath: "transfer",
  1054. fileType: "2",
  1055. }
  1056. attachmentList(oData2).then(res => {
  1057. res.rows.map(r => {
  1058. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  1059. this.fileList2.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{})})
  1060. })
  1061. })
  1062. let oData3= {
  1063. tableId: this.$route.query.id,
  1064. tableName: "t_yinnong_transfer",
  1065. bizPath: "transfer",
  1066. fileType: "3",
  1067. }
  1068. attachmentList(oData3).then(res => {
  1069. res.rows.map(r => {
  1070. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  1071. this.fileList3.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{})})
  1072. })
  1073. })
  1074. },
  1075. goBack(){
  1076. window.history.go(-1)
  1077. },
  1078. //删除家庭成员
  1079. deleteChargeItme(index){
  1080. this.chargeItme.splice(index,1)
  1081. },
  1082. },
  1083. }
  1084. </script>
  1085. <style scoped lang="scss">
  1086. .app-container {
  1087. padding: 2% 0;
  1088. }
  1089. .main_title{
  1090. font-size: 0.4rem;
  1091. color: #1D6FE9;
  1092. margin: 0.2rem 6%;
  1093. position: relative;
  1094. }
  1095. .main_box{
  1096. width: 96%;
  1097. margin: 0 auto;
  1098. border-radius: 6px;
  1099. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  1100. overflow: hidden;
  1101. background-color: #FFF;
  1102. }
  1103. .submitButton{
  1104. width: 80%;
  1105. margin: 0 auto;
  1106. background-color: #1D6FE9;
  1107. }
  1108. .addFamily{
  1109. position: absolute;
  1110. top: -2px;
  1111. right: 0;
  1112. border-radius: 50%;
  1113. }
  1114. .deleteFamily{
  1115. position: absolute;
  1116. top: 0rem;
  1117. right: 6%;
  1118. z-index: 9;
  1119. border-radius: 50%;
  1120. }
  1121. </style>