移动端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

1132 line
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="form.bankType==2||form.bankType==3">
  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" 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. <van-popup v-model="item.showbankType" position="bottom">
  251. <van-picker
  252. show-toolbar
  253. :columns="bankTypeDictionaries"
  254. @confirm="onConfirmBankType($event,index)"
  255. @cancel="item.showbankType = false"
  256. />
  257. </van-popup>
  258. </div>
  259. </div>
  260. <p class="main_title">上传附件</p>
  261. <div class="main_box" style="padding: 5px 0 0 0;">
  262. <van-cell value="收据" />
  263. <van-uploader v-model="fileList1" :after-read="beforeRead1" @delete="deleteFile1" style="margin-left:8px;"></van-uploader>
  264. <van-cell title="发票" />
  265. <van-uploader v-model="fileList2" :after-read="beforeRead2" @delete="deleteFile2" style="margin-left:8px;"></van-uploader>
  266. <van-cell title="其他" />
  267. <van-uploader v-model="fileList3" :after-read="beforeRead3" @delete="deleteFile3" style="margin-left:8px;"></van-uploader>
  268. </div>
  269. <div style="padding: 16px 0;">
  270. <van-row>
  271. <van-col span="12" align="center">
  272. <van-button type="info" native-type="submit" @click="buttonType='update'" class="submitButton">保<i style="margin-right: 1em;"></i>存</van-button>
  273. </van-col>
  274. <van-col span="12" align="center">
  275. <van-button type="info" native-type="submit" @click="buttonType='add'" class="submitButton">保存并提交</van-button>
  276. </van-col>
  277. </van-row>
  278. <div class="clear"></div>
  279. </div>
  280. </van-form>
  281. </div>
  282. </template>
  283. <script>
  284. import { getAccount , getTransfer , queryTransferDetail , listPayee , updateTransfer , getProjectto , listProject , addProjectto , customSubmit ,getQmyeFlow,listInfo ,getInfoto ,addInfoto} from "@/api/onlineHome/bankAgriculture/paymentApproval";
  285. import {
  286. attachmentList,
  287. commonAttach, listVaccount, listVaccount1,
  288. systemAttachment
  289. } from "../../../../api/onlineHome/bankAgriculture/paymentApproval";
  290. import request from '@/utils/request';
  291. import Dialog from "vant/lib/dialog";
  292. export default {
  293. name: "approvalModify4",
  294. data() {
  295. return {
  296. showcontract:false,
  297. showcapital:false,
  298. showpayee:false,
  299. showlasj:false,
  300. showbankType:false,
  301. showproject:false,
  302. showFundType:false,
  303. showpayer:false,
  304. minDate: new Date(2000, 1, 1),
  305. maxDate: new Date(2050, 12, 31),
  306. currentDate: new Date(),
  307. form:{},
  308. capitalExpenditureType:'',
  309. payee:'',
  310. bankType:'',
  311. buttonType:'a',
  312. wfydlxDictionaries:[],
  313. jglxDictionaries:[],
  314. sysDictionaries:[],
  315. capitalExpenditureTypeOptions:[],
  316. bankTypeDictionaries:[],
  317. infoList:[],
  318. projectList:[],
  319. projectFundTypeOptions:[],
  320. projectFundTypeDictionaries:[],
  321. payerOptions:[],
  322. chargeItme:[],
  323. chargeItmeShow:[],
  324. payeeList:[],
  325. // 查询参数
  326. queryParams: {
  327. transferType:"",
  328. orderByColumn: "id",
  329. isAsc: "desc",
  330. },
  331. capitalExpenditureOpen:false,
  332. contractOpen:false,
  333. projectForm:{
  334. projectId:null,
  335. projectName:null,
  336. projectContractor:null,
  337. projectAmount:null,
  338. projectBillNum:null,
  339. projectFundType:'1',
  340. outId:null,
  341. ynType:'1'
  342. },
  343. infoForm:{
  344. infoId:null,
  345. name:null,
  346. code:null,
  347. totalAmount:null,
  348. contractionId:null,
  349. transferId:null
  350. },
  351. // 合同信息查询参数
  352. queryContractionParams: {
  353. pageNum: 1,
  354. pageSize: 100,
  355. contractionStatus: '1',
  356. orderByColumn: "endTime",
  357. isAsc: "desc",
  358. },
  359. projectFundType:'',
  360. fileList1:[],
  361. fileList2:[],
  362. fileList3:[],
  363. uploadFiles1:[],
  364. uploadFiles2:[],
  365. uploadFiles3:[],
  366. };
  367. },
  368. created() {
  369. let queryParams={
  370. pageNum: 1,
  371. pageSize: 100,
  372. }
  373. listProject(queryParams).then(response => {
  374. this.projectList = response.rows;
  375. for (var i = 0; i < response.rows.length; i++) {
  376. this.$set(this.projectList[i],"text",response.rows[i].projectName)
  377. this.$set(this.projectList[i],"value",response.rows[i].id)
  378. }
  379. });
  380. listInfo(this.queryContractionParams).then(response => {
  381. this.infoList = response.rows;
  382. for (let i = 0; i < response.rows.length; i++) {
  383. this.$set(this.infoList[i],"text",response.rows[i].name)
  384. this.$set(this.infoList[i],"value",response.rows[i].code)
  385. }
  386. });
  387. this.getDicts("project_fund_type").then((response) => {
  388. for (var i = 0; i < response.data.length; i++) {
  389. this.projectFundTypeOptions.push({text: response.data[i].dictLabel, value: response.data[i].dictValue});
  390. }
  391. this.projectFundTypeDictionaries = response.data;
  392. });
  393. let params1={
  394. villageAccountType:'1',
  395. "params":{townAccountType:'1'}
  396. }
  397. listVaccount1(params1).then((response) => {
  398. this.payerOptions = response.rows;
  399. response.rows.map((res,index) => {
  400. res['payerFrom'] = '1'
  401. this.payerOptions[index].text = res.payee;
  402. this.payerOptions[index].value = res.id;
  403. })
  404. });
  405. this.getDictionaries();
  406. this.getFileList();
  407. },
  408. methods: {
  409. goFlow(){
  410. if(this.form.approvalMode == '1' && this.form.approvalTemplateId != undefined && this.form.approvalTemplateId != "undefined"){
  411. window.location='approvalProcess3?approvalTemplateId='+this.form.approvalTemplateId+'&approvalMode='+this.form.approvalMode;
  412. }else{
  413. this.$notify({ type: 'danger', message: '无审批流程!' });
  414. }
  415. },
  416. getDictionaries(){
  417. getTransfer(this.$route.query.id).then((response) => {
  418. this.getDicts("capital_expenditure_type").then((res) => {
  419. for (var i = 0; i < res.data.length; i++) {
  420. this.capitalExpenditureTypeOptions.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  421. }
  422. this.capitalExpenditureType = this.selectDictLabel(res.data, response.data.capitalExpenditureType);
  423. });
  424. if(response.data.capitalExpenditureType==2){
  425. this.capitalExpenditureOpen = true
  426. let param={
  427. 'outId' : response.data.id,
  428. 'ynType' : '1'
  429. }
  430. getProjectto(param).then(res => {
  431. console.log(this.selectDictLabel(this.projectFundTypeDictionaries, res.data.projectFundType))
  432. this.projectFundType = this.selectDictLabel(this.projectFundTypeDictionaries, res.data.projectFundType);
  433. this.projectForm = res.data
  434. console.log(res.data)
  435. })
  436. }else if(response.data.capitalExpenditureType==4){
  437. this.contractOpen = true
  438. let param={
  439. 'transferId' : response.data.id
  440. }
  441. console.log(param)
  442. getInfoto(param).then(res => {
  443. this.infoForm = res.data
  444. })
  445. }else{
  446. this.showproject = false
  447. }
  448. this.form = response.data;
  449. this.getPayeeList();
  450. });
  451. queryTransferDetail(this.$route.query.id).then((response) => {
  452. this.getDicts("bank_type").then(res => {
  453. for (var i = 0; i < res.data.length; i++) {
  454. this.bankTypeDictionaries.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  455. }
  456. for (var j = 0 ; j < response.rows.length ; j++){
  457. // response.rows[j].payeeText = response.rows[j].payee;
  458. response.rows[j].bankTypeText = this.selectDictLabel(res.data, response.rows[j].bankType);
  459. response.rows[j].showPayee = false;
  460. }
  461. this.chargeItme = response.rows;
  462. console.log(this.chargeItme)
  463. });
  464. });
  465. },
  466. getChange(){
  467. console.log(this.buttonType)
  468. if(this.buttonType == 'update'){
  469. console.log('update')
  470. this.goUpdate();
  471. }else if(this.buttonType == 'add'){
  472. console.log('add')
  473. this.goAdd();
  474. }
  475. },
  476. getError(e){
  477. console.log(e)
  478. this.$notify({ type: 'danger', message: e.errors[0].message });
  479. },
  480. addChargeItme(index){
  481. if(this.chargeItme.length>0&&this.chargeItme[this.chargeItme.length-1].payee == ''){
  482. this.$notify({ type: 'danger', message: '请勿添加多个空列表信息' });
  483. return;
  484. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].incomeAmount == ''){
  485. this.$notify({ type: 'danger', message: '请输入收入金额!' });
  486. return;
  487. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].payeeAccount == ''){
  488. this.$notify({ type: 'danger', message: '请输入收款账户!' });
  489. return;
  490. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankDeposit == ''){
  491. this.$notify({ type: 'danger', message: '请输入开户银行!' });
  492. return;
  493. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankType == ''){
  494. this.$notify({ type: 'danger', message: '请选择所属银行!' });
  495. return;
  496. }
  497. this.getDicts("bank_type").then(res => {
  498. this.chargeItme.splice(index + 1, 0, {
  499. payeeId: "", //收款方ID
  500. payee: "", //收款方
  501. payeeAccount: "", //收款账户
  502. bankDeposit: "", //开户银行
  503. incomeAmount: "", //收入金额
  504. bankType:null, //所属银行
  505. bankTypeText:"", //所属银行
  506. showPayee:false,
  507. showbankType:false
  508. });
  509. });
  510. },
  511. getPayeeList() {
  512. //普通转账
  513. this.queryParams.isPeers = this.form.isPeers
  514. this.queryParams.accountType = this.form.accountType
  515. this.queryParams.status = "0"
  516. listPayee(this.queryParams).then((response) => {
  517. response.rows.map((res,index) => {
  518. if(res.payeeType==1||res.payeeType==2){
  519. res.text = res.payee;
  520. res.value = res.id;
  521. this.payeeList.push(res)
  522. }
  523. })
  524. });
  525. },
  526. payeeDictLabel(datas, value) {
  527. var actions = [];
  528. Object.keys(datas).some((key) => {
  529. if (datas[key].payeeId == ('' + value)) {
  530. actions.push(datas[key].payee);
  531. return true;
  532. }
  533. })
  534. return actions.join('');
  535. },
  536. onConfirmCapital(data){
  537. if (data.value == 2){
  538. this.capitalExpenditureOpen = true;
  539. this.contractOpen = false
  540. this.infoForm = {};
  541. }else if(data.value == 4){
  542. this.capitalExpenditureOpen = false;
  543. this.contractOpen = true
  544. this.projectForm = {};
  545. }else{
  546. this.capitalExpenditureOpen = false;
  547. this.contractOpen = false
  548. this.projectForm = {};
  549. this.infoForm = {};
  550. }
  551. this.capitalExpenditureType = data.text;
  552. this.form.capitalExpenditureType = data.value;
  553. this.showcapital = false;
  554. },
  555. onConfirmFundType(data){
  556. console.log(data)
  557. this.projectForm.projectFundType = data.value;
  558. this.projectFundType = data.text;
  559. this.showFundType = false;
  560. },
  561. onConfirmProject(data){
  562. this.projectList.map(res => {
  563. if(res.projectName==data.text){
  564. this.projectForm.projectId = res.id
  565. this.projectForm.projectName = res.projectName
  566. this.projectForm.projectContractor = res.projectContractor
  567. this.projectForm.projectAmount = res.projectAmount
  568. }
  569. })
  570. this.showproject = false;
  571. },
  572. onConfirmContract(data){
  573. this.infoList.map(res => {
  574. if(res.name==data.text){
  575. this.infoForm.contractionId = res.id;
  576. this.infoForm.name = res.name;
  577. this.infoForm.code = res.code;
  578. this.infoForm.totalAmount = res.totalAmount;
  579. }
  580. })
  581. this.showcontract = false;
  582. },
  583. onConfirmPayee(data,index){
  584. for (let i = 0 ; i < this.chargeItme.length ; i++){
  585. this.chargeItme[i].showPayee = false;
  586. }
  587. this.chargeItme[index].payee = data.text;
  588. this.chargeItme[index].payeeId = data.value;
  589. this.chargeItme[index].showpayee = false;
  590. this.payeeSelectChange(data.value , index)
  591. this.onConfirmBankType(data,index)
  592. },
  593. onConfirmBankType(data,index){
  594. console.log(this.bankTypeDictionaries)
  595. this.bankTypeDictionaries.map(res => {
  596. if(res.value==data.bankType){
  597. this.chargeItme[index].bankTypeText = res.text;
  598. this.chargeItme[index].bankType = res.value;
  599. }
  600. })
  601. },
  602. onConfirmPayer(data){
  603. this.form.payer = data.text;
  604. this.form.cashierId = data.value;
  605. this.showpayer = false;
  606. this.selectChange(data.value)
  607. },
  608. onConfirmLasj(data){
  609. this.form.applyDate = this.getNowFormatDate(data).substr(0,10);
  610. this.showlasj = false;
  611. },
  612. accountTypeChange(e){
  613. this.payeeList = [];
  614. this.chargeItme = [];
  615. this.queryParams.accountType = this.form.accountType
  616. this.queryParams.bankType = this.form.bankType
  617. this.queryParams.status = "0"
  618. listPayee(this.queryParams).then((response) => {
  619. response.rows.map((res,index) => {
  620. if(res.payeeType==1||res.payeeType==2){
  621. response.rows[index].text = res.payee;
  622. response.rows[index].value = res.id;
  623. this.payeeList.push(res)
  624. }
  625. })
  626. });
  627. },
  628. accountTypeChange1(e){
  629. this.payeeList = [];
  630. this.chargeItme = [];
  631. this.queryParams.isPeers = this.form.isPeers
  632. this.queryParams.bankType = this.form.bankType
  633. this.queryParams.status = "0"
  634. listPayee(this.queryParams).then((response) => {
  635. response.rows.map((res,index) => {
  636. if(res.payeeType==1||res.payeeType==2){
  637. response.rows[index].text = res.payee;
  638. response.rows[index].value = res.id;
  639. this.payeeList.push(res)
  640. }
  641. })
  642. });
  643. },
  644. // 钱计算
  645. moneyChange(input) {
  646. console.log(input)
  647. let obj = {};
  648. obj = this.chargeItme.find((account) => {
  649. //model就是上面的数据源
  650. return parseFloat(account.incomeAmount).toFixed(2) === input; //筛选出匹配数据
  651. });
  652. let total = 0;
  653. this.chargeItme.forEach((money) => {
  654. total = (parseFloat(total) + parseFloat(money.incomeAmount)).toFixed(2)
  655. });
  656. this.$set(this.form, "expenditureAmount", total);
  657. },
  658. goAdd(){
  659. if(this.chargeItme.length<1){
  660. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  661. return;
  662. }
  663. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  664. this.$notify({ type: 'danger', message: '转账附言禁止包含!' });
  665. return;
  666. }
  667. if(this.form.capitalExpenditureType==2){
  668. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  669. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  670. return;
  671. }
  672. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  673. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  674. return;
  675. }
  676. }
  677. if(this.form.capitalExpenditureType==4){
  678. if(this.infoForm.name==""||this.infoForm.name==null){
  679. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  680. return;
  681. }
  682. if(this.infoForm.code==""||this.infoForm.code==null){
  683. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  684. return;
  685. }
  686. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  687. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  688. return;
  689. }
  690. }
  691. if((this.uploadFiles1==null||this.uploadFiles1.length==0)&&(this.uploadFiles2==null||this.uploadFiles2.length==0)&&(this.uploadFiles3==null||this.uploadFiles3.length==0)){
  692. Dialog.confirm({
  693. title: '提示',
  694. message: '此申请单中未上传任何附件,是否确认提交?',
  695. })
  696. .then(() => {
  697. this.$set(this.form, "payeeList", this.chargeItme);
  698. this.$set(this.form, "bankTypeList", this.chargeItme);
  699. this.$set(this.form, "accountTypeList", this.chargeItme);
  700. this.$set(this.form, "transferStatusList", this.chargeItme);
  701. updateTransfer(this.form).then(response => {
  702. this.projectForm.outId = this.form.id
  703. this.infoForm.transferId = this.form.id
  704. this.$set(this.projectForm, "ynType", '1');
  705. if(this.form.capitalExpenditureType==2){
  706. addProjectto(this.projectForm).then(res => {
  707. customSubmit(this.form.id).then(res => {
  708. this.$toast.success('提交成功');
  709. setTimeout(function(){
  710. history.go(-1)
  711. },2000)
  712. })
  713. })
  714. }else if(this.form.capitalExpenditureType==4){
  715. addInfoto(this.infoForm).then(res => {
  716. customSubmit(this.form.id).then(res => {
  717. this.$toast.success('提交成功');
  718. setTimeout(function(){
  719. history.go(-1)
  720. },2000)
  721. })
  722. })
  723. }else{
  724. customSubmit(this.form.id).then(res => {
  725. this.$toast.success('提交成功');
  726. setTimeout(function(){
  727. history.go(-1)
  728. },2000)
  729. })
  730. }
  731. });
  732. })
  733. .catch(() => {
  734. return false;
  735. });
  736. }else{
  737. this.$set(this.form, "payeeList", this.chargeItme);
  738. this.$set(this.form, "bankTypeList", this.chargeItme);
  739. this.$set(this.form, "accountTypeList", this.chargeItme);
  740. this.$set(this.form, "transferStatusList", this.chargeItme);
  741. updateTransfer(this.form).then(response => {
  742. this.projectForm.outId = this.form.id
  743. this.infoForm.transferId = this.form.id
  744. this.$set(this.projectForm, "ynType", '1');
  745. if(this.uploadFiles1!=null&&this.uploadFiles1.length>0){
  746. this.uploadFiles1.map(rr => {
  747. const params = new FormData();
  748. params.append("tableId", this.form.id);
  749. params.append("tableName", "t_yinnong_transfer");
  750. params.append("bizPath", "transfer");
  751. params.append("fileType", "1");
  752. params.append("file", rr);
  753. commonAttach(params).then((r) => {
  754. })
  755. })}
  756. if(this.uploadFiles2!=null&&this.uploadFiles2.length>0){
  757. this.uploadFiles2.map(rr => {
  758. const params = new FormData();
  759. params.append("tableId", this.form.id);
  760. params.append("tableName", "t_yinnong_transfer");
  761. params.append("bizPath", "transfer");
  762. params.append("fileType", "2");
  763. params.append("file", rr);
  764. commonAttach(params).then((r) => {
  765. })
  766. })}
  767. if(this.uploadFiles3!=null&&this.uploadFiles3.length>0){
  768. this.uploadFiles3.map(rr => {
  769. const params = new FormData();
  770. params.append("tableId", this.form.id);
  771. params.append("tableName", "t_yinnong_transfer");
  772. params.append("bizPath", "transfer");
  773. params.append("fileType", "3");
  774. params.append("file", rr);
  775. commonAttach(params).then((r) => {
  776. })
  777. })}
  778. if(this.form.capitalExpenditureType==2){
  779. addProjectto(this.projectForm).then(res => {
  780. customSubmit(this.form.id).then(res => {
  781. this.$toast.success('提交成功');
  782. setTimeout(function(){
  783. history.go(-1)
  784. },2000)
  785. })
  786. })
  787. } else if(this.form.capitalExpenditureType==4){
  788. addInfoto(this.infoForm).then(res => {
  789. customSubmit(this.form.id).then(res => {
  790. this.$toast.success('提交成功');
  791. setTimeout(function(){
  792. history.go(-1)
  793. },2000)
  794. })
  795. })
  796. }else{
  797. customSubmit(this.form.id).then(res => {
  798. this.$toast.success('提交成功');
  799. setTimeout(function(){
  800. history.go(-1)
  801. },2000)
  802. })
  803. }
  804. });
  805. }
  806. },
  807. goUpdate(){
  808. if(this.chargeItme.length<1){
  809. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  810. return;
  811. }
  812. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  813. this.$notify({ type: 'danger', message: '转账附言禁止包含!' });
  814. return;
  815. }
  816. if(this.form.capitalExpenditureType==2){
  817. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  818. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  819. return;
  820. }
  821. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  822. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  823. return;
  824. }
  825. }
  826. if(this.form.capitalExpenditureType==4){
  827. if(this.infoForm.name==""||this.infoForm.name==null){
  828. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  829. return;
  830. }
  831. if(this.infoForm.code==""||this.infoForm.code==null){
  832. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  833. return;
  834. }
  835. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  836. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  837. return;
  838. }
  839. }
  840. this.$set(this.form, "payeeList", this.chargeItme);
  841. this.$set(this.form, "bankTypeList", this.chargeItme);
  842. this.$set(this.form, "accountTypeList", this.chargeItme);
  843. this.$set(this.form, "transferStatusList", this.chargeItme);
  844. updateTransfer(this.form).then((response) => {
  845. this.projectForm.outId = this.form.id
  846. this.infoForm.transferId = this.form.id
  847. this.$set(this.projectForm, "ynType", '1');
  848. if(this.uploadFiles1!=null&&this.uploadFiles1.length>0){
  849. this.uploadFiles1.map(rr => {
  850. const params = new FormData();
  851. params.append("tableId", this.form.id);
  852. params.append("tableName", "t_yinnong_transfer");
  853. params.append("bizPath", "transfer");
  854. params.append("fileType", "1");
  855. params.append("file", rr);
  856. commonAttach(params).then((r) => {
  857. })
  858. })}
  859. if(this.uploadFiles2!=null&&this.uploadFiles2.length>0){
  860. this.uploadFiles2.map(rr => {
  861. const params = new FormData();
  862. params.append("tableId", this.form.id);
  863. params.append("tableName", "t_yinnong_transfer");
  864. params.append("bizPath", "transfer");
  865. params.append("fileType", "2");
  866. params.append("file", rr);
  867. commonAttach(params).then((r) => {
  868. })
  869. })}
  870. if(this.uploadFiles3!=null&&this.uploadFiles3.length>0){
  871. this.uploadFiles3.map(rr => {
  872. const params = new FormData();
  873. params.append("tableId", this.form.id);
  874. params.append("tableName", "t_yinnong_transfer");
  875. params.append("bizPath", "transfer");
  876. params.append("fileType", "3");
  877. params.append("file", rr);
  878. commonAttach(params).then((r) => {
  879. })
  880. })}
  881. if(this.form.capitalExpenditureType==2){
  882. addProjectto(this.projectForm).then(res => {
  883. this.$toast.success('保存成功');
  884. setTimeout(function(){
  885. history.go(-1)
  886. },2000)
  887. })
  888. }else if(this.form.capitalExpenditureType==4){
  889. addInfoto(this.infoForm).then(res => {
  890. this.$toast.success('保存成功');
  891. setTimeout(function(){
  892. history.go(-1)
  893. },2000)
  894. })
  895. }else{
  896. this.$toast.success('保存成功');
  897. setTimeout(function(){
  898. history.go(-1)
  899. },2000)
  900. }
  901. });
  902. },
  903. payeeSelectChange(select, i) {
  904. let obj = {};
  905. let fuzhitype = 0;
  906. let _this = this
  907. obj = this.payeeList.find((account) => {
  908. //model就是上面的数据源
  909. return account.id === select ; //筛选出匹配数据
  910. });
  911. if(this.chargeItme != [] && this.chargeItme.length>1){
  912. this.chargeItme.some((value, index) => {
  913. if(value.payeeAccount != undefined &&value.payeeAccount != '' && obj.payeeAccount == value.payeeAccount&&index!=i){
  914. fuzhitype = 2;
  915. return true;
  916. }
  917. if(_this.form.isPeers!=undefined&&_this.form.isPeers!=null&&_this.form.isPeers=='N'){
  918. }else{
  919. if(obj.bankType==1&&value.accountType != undefined &&value.accountType != '' && obj.accountType != value.accountType&&index!=i){
  920. fuzhitype = 1;
  921. return true;
  922. }
  923. }
  924. });
  925. }
  926. if(fuzhitype == 0){
  927. this.$set(this.chargeItme[i], "payee",obj.payee)
  928. this.$set(this.chargeItme[i], "bankType", obj.bankType)
  929. this.$set(this.chargeItme[i], "payeeId", obj.id);
  930. this.$set(this.chargeItme[i], "payeeAccount", obj.payeeAccount);
  931. this.$set(this.chargeItme[i], "bankDeposit", obj.bankDeposit);
  932. this.$set(this.chargeItme[i], "accountType", obj.accountType);
  933. this.$set(this.chargeItme[i], "payeePaymentLines", obj.payeePaymentLines);
  934. _this.bankTypeDictionaries.map(rr => {
  935. if(rr.value==obj.bankType){
  936. this.$set(this.chargeItme[i], "bankTypeText", rr.text);
  937. }
  938. })
  939. }else if(fuzhitype == 1){
  940. this.$set(this.chargeItme[i], "payee",'')
  941. this.$set(this.chargeItme[i], "bankType",'')
  942. this.$set(this.chargeItme[i], "payeeId", '');
  943. this.$set(this.chargeItme[i], "payeeAccount", '');
  944. this.$set(this.chargeItme[i], "bankDeposit", '');
  945. this.$set(this.chargeItme[i], "accountType", '');
  946. this.$set(this.chargeItme[i], "payeePaymentLines", '');
  947. this.$set(this.chargeItme[i], "bankTypeText", '');
  948. this.$notify({ type: 'danger', message: '请选择账户类型相同的收款方!' });
  949. }else if(fuzhitype == 2){
  950. this.$set(this.chargeItme[i], "payee",'')
  951. this.$set(this.chargeItme[i], "bankType",'')
  952. this.$set(this.chargeItme[i], "payeeId", '');
  953. this.$set(this.chargeItme[i], "payeeAccount", '');
  954. this.$set(this.chargeItme[i], "bankDeposit", '');
  955. this.$set(this.chargeItme[i], "accountType", '');
  956. this.$set(this.chargeItme[i], "payeePaymentLines", '');
  957. this.$set(this.chargeItme[i], "bankTypeText", '');
  958. this.$notify({ type: 'danger', message: '收款方已存在!' });
  959. }
  960. },
  961. selectChange(select) {
  962. let obj = {};
  963. obj = this.payerOptions.find((account) => {
  964. //model就是上面的数据源
  965. return account.id === select; //筛选出匹配数据
  966. });
  967. this.$set(this.form, "bookId", obj.bookId);
  968. this.$set(this.form, "deptId", obj.deptId);
  969. this.$set(this.form, "cashierId", obj.id);
  970. this.$set(this.form, "payer", obj.payee);
  971. this.$set(this.form, "payerAccount", obj.payeeAccount);
  972. this.$set(this.form, "operatorCode", obj.operatorCode);
  973. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  974. this.$set(this.form, "bankType", obj.bankType);
  975. this.$set(this.form, "payerFrom", '1');
  976. if(obj.bankType==1){
  977. this.form.accountType = "1"
  978. this.form.isPeers = null
  979. this.accountTypeChange();
  980. }else if(obj.bankType==2||obj.bankType==3){
  981. this.form.accountType = null
  982. this.form.isPeers = "Y"
  983. this.accountTypeChange1();
  984. }
  985. },
  986. beforeRead1(file) {
  987. this.uploadFiles1.push(file.file);
  988. },
  989. deleteFile1(file){
  990. this.uploadFiles1.map((response,index) => {
  991. if(file.file == response){
  992. this.uploadFiles1.splice(index,1)
  993. }
  994. })
  995. if(file.id){
  996. systemAttachment(file.id).then((res) => {
  997. });
  998. }
  999. },
  1000. beforeRead2(file) {
  1001. this.uploadFiles2.push(file.file);
  1002. },
  1003. deleteFile2(file){
  1004. this.uploadFiles2.map((response,index) => {
  1005. if(file.file == response){
  1006. this.uploadFiles2.splice(index,1)
  1007. }
  1008. })
  1009. if(file.id){
  1010. systemAttachment(file.id).then((res) => {
  1011. });
  1012. }
  1013. },
  1014. beforeRead3(file) {
  1015. this.uploadFiles3.push(file.file);
  1016. },
  1017. deleteFile3(file){
  1018. this.uploadFiles3.map((response,index) => {
  1019. if(file.file == response){
  1020. this.uploadFiles3.splice(index,1)
  1021. }
  1022. })
  1023. if(file.id){
  1024. systemAttachment(file.id).then((res) => {
  1025. });
  1026. }
  1027. },
  1028. getFileList(){
  1029. let oData1= {
  1030. tableId: this.$route.query.id,
  1031. tableName: "t_yinnong_transfer",
  1032. bizPath: "transfer",
  1033. fileType: "1",
  1034. }
  1035. attachmentList(oData1).then(res => {
  1036. res.rows.map(r => {
  1037. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  1038. this.fileList1.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{}),"id":r.id})
  1039. })
  1040. })
  1041. let oData2= {
  1042. tableId: this.$route.query.id,
  1043. tableName: "t_yinnong_transfer",
  1044. bizPath: "transfer",
  1045. fileType: "2",
  1046. }
  1047. attachmentList(oData2).then(res => {
  1048. res.rows.map(r => {
  1049. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  1050. this.fileList2.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{}),"id":r.id})
  1051. })
  1052. })
  1053. let oData3= {
  1054. tableId: this.$route.query.id,
  1055. tableName: "t_yinnong_transfer",
  1056. bizPath: "transfer",
  1057. fileType: "3",
  1058. }
  1059. attachmentList(oData3).then(res => {
  1060. res.rows.map(r => {
  1061. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  1062. this.fileList3.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{}),"id":r.id})
  1063. })
  1064. })
  1065. },
  1066. goBack(){
  1067. window.history.go(-1)
  1068. },
  1069. //删除家庭成员
  1070. deleteChargeItme(index){
  1071. this.chargeItme.splice(index,1)
  1072. },
  1073. },
  1074. }
  1075. </script>
  1076. <style scoped lang="scss">
  1077. .app-container {
  1078. padding: 2% 0;
  1079. }
  1080. .main_title{
  1081. font-size: 0.4rem;
  1082. color: #1D6FE9;
  1083. margin: 0.2rem 6%;
  1084. position: relative;
  1085. }
  1086. .main_box{
  1087. width: 96%;
  1088. margin: 0 auto;
  1089. border-radius: 6px;
  1090. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  1091. overflow: hidden;
  1092. background-color: #FFF;
  1093. }
  1094. .submitButton{
  1095. width: 80%;
  1096. margin: 0 auto;
  1097. background-color: #1D6FE9;
  1098. }
  1099. .addFamily{
  1100. position: absolute;
  1101. top: -2px;
  1102. right: 0;
  1103. border-radius: 50%;
  1104. }
  1105. .deleteFamily{
  1106. position: absolute;
  1107. top: 0rem;
  1108. right: 6%;
  1109. z-index: 9;
  1110. border-radius: 50%;
  1111. }
  1112. </style>