移动端
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

949 lines
36 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. </div>
  73. <div class="main_box" style="margin-top: 10px;">
  74. <van-field
  75. label="转账附言"
  76. v-model="form.remark"
  77. type="textarea"
  78. placeholder="请输入转账附言"
  79. input-align="right"
  80. rows="3"
  81. label-width="auto"
  82. required
  83. :rules="[{ required: true , message:'请输入转账附言' }]"
  84. />
  85. </div>
  86. <div class="main_box" style="margin-top: 10px;">
  87. <van-field label="说明情况" v-model="form.explainSituation" type="textarea" placeholder="请输入说明情况" input-align="right" rows="3" label-width="auto"/>
  88. </div>
  89. <p class="main_title" v-if="capitalExpenditureOpen">关联项目</p>
  90. <div class="main_box" v-if="capitalExpenditureOpen" style="margin-bottom: 10px;margin-top: 10px;position:relative;">
  91. <van-field
  92. readonly
  93. clickable
  94. label="项目名称"
  95. placeholder="请选择"
  96. v-model="projectForm.projectName"
  97. @click="showproject = true"
  98. input-align="right"
  99. right-icon="arrow-down"
  100. required
  101. :rules="[{ required: true , message:'请选择项目名称' }]"
  102. />
  103. <van-popup v-model="showproject" position="bottom">
  104. <van-picker
  105. show-toolbar
  106. :columns="projectListShow"
  107. @confirm="onConfirmProject"
  108. @cancel="showproject = false"
  109. />
  110. </van-popup>
  111. <van-field required :rules="[{ required: true , message:'请输入承建单位' }]" v-model="projectForm.projectContractor" label="承建单位" placeholder="请输入承建单位" input-align="right" label-width="auto"/>
  112. <van-field required :rules="[{ required: true , message:'请输入合同价款(元)' }]" v-model="projectForm.projectAmount" label="合同价款(元)" placeholder="请输入合同价款(元)" input-align="right" label-width="auto"/>
  113. <van-field
  114. readonly
  115. clickable
  116. label="工程款类型"
  117. placeholder="请选择"
  118. v-model="projectFundType"
  119. @click="showFundType = true"
  120. input-align="right"
  121. right-icon="arrow-down"
  122. required
  123. :rules="[{ required: true , message:'请选择工程款类型' }]"
  124. />
  125. <van-popup v-model="showFundType" position="bottom">
  126. <van-picker
  127. show-toolbar
  128. :columns="projectFundTypeOptions"
  129. @confirm="onConfirmFundType"
  130. @cancel="showFundType = false"
  131. />
  132. </van-popup>
  133. <van-field required :rules="[{ required: true , message:'请输入工程发票号' }]" v-model="projectForm.projectBillNum" label="工程发票号" placeholder="请输入工程发票号" input-align="right" label-width="auto"/>
  134. </div>
  135. <p class="main_title">付款方信息</p>
  136. <div class="main_box">
  137. <!-- <van-field label="付款方" v-model="form.payer" placeholder="请输入付款方" input-align="right" label-width="auto"/>-->
  138. <van-field
  139. readonly
  140. clickable
  141. label="付款方"
  142. placeholder="请选择付款方"
  143. v-model="form.payer"
  144. @click="showpayer = true"
  145. input-align="right"
  146. right-icon="arrow-down"
  147. label-width="auto"
  148. required
  149. :rules="[{ required: true , message:'请选择付款方' }]"
  150. />
  151. <van-popup v-model="showpayer" position="bottom">
  152. <van-picker
  153. show-toolbar
  154. :columns="payerOptions"
  155. @confirm="onConfirmPayer($event)"
  156. @cancel="showpayer = false"
  157. />
  158. </van-popup>
  159. <van-field :rules="[{ required: true , message:'请输入账户' }]" required label="付款方账户" v-model="form.payerAccount" placeholder="请输入账户" input-align="right" label-width="auto"/>
  160. </div>
  161. <p class="main_title">收款方信息<van-button icon="plus" @click="addChargeItme(chargeItme.length)" size="mini" type="info" native-type="button" class="addFamily"/></p>
  162. <div class="main_box" style="margin-bottom: 15px;">
  163. <van-cell title="收款账户类型">
  164. <template #right-icon>
  165. <van-radio-group direction="horizontal" v-model="form.accountType" @change="accountTypeChange">
  166. <van-radio name="1">公户</van-radio>
  167. <van-radio name="2">私户</van-radio>
  168. </van-radio-group>
  169. </template>
  170. </van-cell>
  171. <van-cell title="是否与付款方同行" v-if="form.bankType==2||form.bankType==4">
  172. <template #right-icon>
  173. <van-radio-group direction="horizontal" v-model="form.isPeers">
  174. <van-radio name="Y">是</van-radio>
  175. <van-radio name="N">否</van-radio>
  176. </van-radio-group>
  177. </template>
  178. </van-cell>
  179. </div>
  180. <div :style="{position:'relative',padding: index == 0 ? '':'10px 0 0 0'}" v-for="(item, index) in chargeItme" :key="index">
  181. <van-button icon="minus" size="mini" type="danger" class="deleteFamily" native-type="button" v-if="index!=0" @click="deleteChargeItme(index)" />
  182. <div class="main_box" style="margin-bottom: 10px;position:relative;">
  183. <van-field
  184. readonly
  185. clickable
  186. label="收款方"
  187. placeholder="请选择"
  188. v-model="item.payee"
  189. @click="item.showPayee = true"
  190. input-align="right"
  191. right-icon="arrow-down"
  192. required
  193. :rules="[{ required: true , message:'请选择收款方' }]"
  194. />
  195. <van-popup v-model="item.showPayee" position="bottom">
  196. <van-picker
  197. show-toolbar
  198. :columns="payeeList"
  199. @confirm="onConfirmPayee($event,index)"
  200. @cancel="item.showPayee = false"
  201. />
  202. </van-popup>
  203. <van-field required readonly :rules="[{ required: true , message:'请输入账户' }]" v-model="item.payeeAccount" label="收款账户" placeholder="请输入账户" input-align="right" label-width="auto"/>
  204. <van-field required readonly :rules="[{ required: true , message:'请输入银行' }]" v-model="item.bankDeposit" label="开户银行" placeholder="请输入银行" input-align="right" label-width="auto"/>
  205. <van-field required :rules="[{ required: true , message:'请输入金额' }]" v-model="item.incomeAmount" label="收入金额" placeholder="请输入金额" input-align="right" label-width="auto" @change="moneyChange"/>
  206. <van-field
  207. readonly
  208. clickable
  209. label="所属银行"
  210. placeholder="请选择"
  211. v-model="item.bankTypeText"
  212. input-align="right"
  213. required
  214. :rules="[{ required: true , message:'请选择所属银行' }]"
  215. />
  216. </div>
  217. </div>
  218. <p class="main_title">上传附件</p>
  219. <div class="main_box" style="padding: 5px 0 0 8px;">
  220. <van-uploader v-model="fileList" :after-read="beforeRead" @delete="deleteFile"></van-uploader>
  221. </div>
  222. <div style="padding: 16px 0;">
  223. <van-row>
  224. <van-col span="12" align="center">
  225. <van-button type="info" native-type="submit" @click="buttonType='update'" class="submitButton">保<i style="margin-right: 1em;"></i>存</van-button>
  226. </van-col>
  227. <van-col span="12" align="center">
  228. <van-button type="info" native-type="submit" @click="buttonType='add'" class="submitButton">保存并提交</van-button>
  229. </van-col>
  230. </van-row>
  231. <div class="clear"></div>
  232. </div>
  233. </van-form>
  234. </div>
  235. </template>
  236. <script>
  237. import { getAccount , getTransfer , queryTransferDetail , listPayee , updateTransfer , getProjectto , listProject , addProjectto , customSubmit ,getQmyeFlow} from "@/api/onlineHome/bankAgriculture/paymentApproval";
  238. import request from '@/utils/request';
  239. import {
  240. addTransfer,
  241. attachmentList,
  242. commonAttach, listTaccount,
  243. listVaccount, systemAttachment
  244. } from "../../../../api/onlineHome/bankAgriculture/paymentApproval";
  245. import Dialog from "vant/lib/dialog";
  246. export default {
  247. name: "approvalModify5",
  248. data() {
  249. return {
  250. showcapital:false,
  251. showpayee:false,
  252. showlasj:false,
  253. showbankType:false,
  254. showproject:false,
  255. showFundType:false,
  256. showpayer:false,
  257. minDate: new Date(2000, 1, 1),
  258. maxDate: new Date(2050, 12, 31),
  259. currentDate: new Date(),
  260. form:{},
  261. capitalExpenditureType:'',
  262. payee:'',
  263. bankType:'',
  264. buttonType:'a',
  265. wfydlxDictionaries:[],
  266. jglxDictionaries:[],
  267. sysDictionaries:[],
  268. capitalExpenditureTypeOptions:[],
  269. bankTypeDictionaries:[],
  270. projectList:[],
  271. projectFundTypeOptions:[],
  272. projectFundTypeDictionaries:[],
  273. projectListShow:[],
  274. payerOptions:[],
  275. chargeItme:[],
  276. chargeItmeShow:[],
  277. payeeList:[],
  278. // 查询参数
  279. queryParams: {
  280. transferType:"",
  281. orderByColumn: "id",
  282. isAsc: "desc",
  283. },
  284. capitalExpenditureOpen:false,
  285. projectForm:{
  286. projectId:null,
  287. projectName:null,
  288. projectContractor:null,
  289. projectAmount:null,
  290. projectBillNum:null,
  291. projectFundType:'1',
  292. outId:null,
  293. ynType:'1'
  294. },
  295. projectFundType:'',
  296. fileList:[],
  297. uploadFiles:[],
  298. };
  299. },
  300. created() {
  301. let queryParams={
  302. pageNum: 1,
  303. pageSize: 100,
  304. }
  305. listProject(queryParams).then(response => {
  306. this.projectList = response.rows;
  307. for (var i = 0; i < response.rows.length; i++) {
  308. this.projectListShow.push({text: response.rows[i].projectName, value: response.rows[i].id});
  309. }
  310. });
  311. this.getDicts("project_fund_type").then((response) => {
  312. for (var i = 0; i < response.data.length; i++) {
  313. this.projectFundTypeOptions.push({text: response.data[i].dictLabel, value: response.data[i].dictValue});
  314. }
  315. this.projectFundTypeDictionaries = response.data;
  316. });
  317. let params1={
  318. townAccountType:'2'
  319. }
  320. listTaccount(params1).then((response) => {
  321. response.rows.map((res,index) => {
  322. if(res.townAccountType=='2'){
  323. res['payerFrom'] = '2'
  324. this.payerOptions.push(res);
  325. this.payerOptions[index].text = res.payee;
  326. this.payerOptions[index].value = res.id;
  327. }
  328. })
  329. });
  330. this.getDictionaries();
  331. this.getFileList();
  332. },
  333. methods: {
  334. goFlow(){
  335. if(this.form.approvalMode == '1' && this.form.approvalTemplateId != undefined && this.form.approvalTemplateId != "undefined"){
  336. window.location='approvalProcess3?approvalTemplateId='+this.form.approvalTemplateId+'&approvalMode='+this.form.approvalMode;
  337. }else{
  338. this.$notify({ type: 'danger', message: '无审批流程!' });
  339. }
  340. },
  341. getDictionaries(){
  342. getTransfer(this.$route.query.id).then((response) => {
  343. this.getDicts("capital_expenditure_type").then((res) => {
  344. for (var i = 0; i < res.data.length; i++) {
  345. this.capitalExpenditureTypeOptions.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  346. }
  347. this.capitalExpenditureType = this.selectDictLabel(res.data, response.data.capitalExpenditureType);
  348. });
  349. if(response.data.capitalExpenditureType==2){
  350. this.capitalExpenditureOpen = true
  351. let param={
  352. 'outId' : response.data.id,
  353. 'ynType' : '1'
  354. }
  355. getProjectto(param).then(res => {
  356. console.log(this.selectDictLabel(this.projectFundTypeDictionaries, res.data.projectFundType))
  357. this.projectFundType = this.selectDictLabel(this.projectFundTypeDictionaries, res.data.projectFundType);
  358. this.projectForm = res.data
  359. console.log(res.data)
  360. })
  361. }else{
  362. this.showproject = false
  363. }
  364. this.form = response.data;
  365. this.getPayeeList();
  366. });
  367. queryTransferDetail(this.$route.query.id).then((response) => {
  368. this.getDicts("bank_type").then(res => {
  369. for (var i = 0; i < res.data.length; i++) {
  370. this.bankTypeDictionaries.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  371. }
  372. for (var j = 0 ; j < response.rows.length ; j++){
  373. // response.rows[j].payeeText = response.rows[j].payee;
  374. response.rows[j].bankTypeText = this.selectDictLabel(res.data, response.rows[j].bankType);
  375. response.rows[j].showPayee = false;
  376. }
  377. this.chargeItme = response.rows;
  378. });
  379. });
  380. },
  381. getChange(){
  382. if(this.buttonType == 'update'){
  383. this.goUpdate();
  384. }else if(this.buttonType == 'add'){
  385. this.goAdd();
  386. }
  387. },
  388. getError(e){
  389. this.$notify({ type: 'danger', message: e.errors[0].message });
  390. },
  391. addChargeItme(index){
  392. if(this.chargeItme.length>0&&this.chargeItme[this.chargeItme.length-1].payee == ''){
  393. this.$notify({ type: 'danger', message: '请勿添加多个空列表信息' });
  394. return;
  395. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].incomeAmount == ''){
  396. this.$notify({ type: 'danger', message: '请输入收入金额!' });
  397. return;
  398. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].payeeAccount == ''){
  399. this.$notify({ type: 'danger', message: '请输入收款账户!' });
  400. return;
  401. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankDeposit == ''){
  402. this.$notify({ type: 'danger', message: '请输入开户银行!' });
  403. return;
  404. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].bankType == ''){
  405. this.$notify({ type: 'danger', message: '请选择所属银行!' });
  406. return;
  407. }
  408. this.getDicts("bank_type").then(res => {
  409. this.chargeItme.splice(index + 1, 0, {
  410. payeeId: "", //收款方ID
  411. payee: "", //收款方
  412. payeeAccount: "", //收款账户
  413. bankDeposit: "", //开户银行
  414. incomeAmount: "", //收入金额
  415. bankType: "", //所属银行
  416. bankTypeText: "", //所属银行
  417. showPayee:false,
  418. showbankType:false
  419. });
  420. });
  421. },
  422. getPayeeList() {
  423. //普通转账
  424. this.queryParams.accountType = this.form.accountType
  425. this.queryParams.status = "0"
  426. if(this.form.cashierId==null||this.form.cashierId==""){
  427. this.$notify({ type: 'danger', message: '请先选择付款方!' });
  428. return;
  429. }else {
  430. this.queryParams.taccountId = parseInt(this.form.cashierId)
  431. listVaccount(this.queryParams).then((response) => {
  432. this.payeeList = response.rows;
  433. response.rows.map((res,index) => {
  434. this.payeeList[index].text = res.payee;
  435. this.payeeList[index].value = res.id;
  436. })
  437. });
  438. }
  439. },
  440. payeeDictLabel(datas, value) {
  441. var actions = [];
  442. Object.keys(datas).some((key) => {
  443. if (datas[key].payeeId == ('' + value)) {
  444. actions.push(datas[key].payee);
  445. return true;
  446. }
  447. })
  448. return actions.join('');
  449. },
  450. onConfirmCapital(data){
  451. if (data.value != 2){
  452. this.capitalExpenditureOpen = false;
  453. this.projectForm = [];
  454. }else{
  455. this.capitalExpenditureOpen = true;
  456. }
  457. this.capitalExpenditureType = data.text;
  458. this.form.capitalExpenditureType = data.value;
  459. this.showcapital = false;
  460. },
  461. onConfirmFundType(data){
  462. console.log(data)
  463. this.projectForm.projectFundType = data.value;
  464. this.projectFundType = data.text;
  465. this.showFundType = false;
  466. },
  467. onConfirmProject(data){
  468. this.projectList.map(res => {
  469. if(res.projectName==data.text){
  470. this.projectForm.projectId = res.id
  471. this.projectForm.projectName = res.projectName
  472. this.projectForm.projectContractor = res.projectContractor
  473. this.projectForm.projectAmount = res.projectAmount
  474. }
  475. })
  476. this.showproject = false;
  477. },
  478. onConfirmPayee(data,index){
  479. console.log(data)
  480. for (var i = 0 ; i < this.chargeItme.length ; i++){
  481. this.chargeItme[i].showPayee = false;
  482. }
  483. this.chargeItme[index].payee = data.text;
  484. this.chargeItme[index].payeeId = data.value;
  485. this.payeeSelectChange(data.value , index)
  486. this.onConfirmBankType(data,index)
  487. },
  488. onConfirmBankType(data,index){
  489. console.log(this.bankTypeDictionaries)
  490. this.bankTypeDictionaries.map(res => {
  491. if(res.value==data.bankType){
  492. this.chargeItme[index].bankTypeText = res.text;
  493. this.chargeItme[index].bankType = res.value;
  494. }
  495. })
  496. },
  497. onConfirmPayer(data){
  498. this.form.payer = data.text;
  499. this.form.cashierId = data.value;
  500. this.showpayer = false;
  501. this.selectChange(data.value)
  502. },
  503. onConfirmLasj(data){
  504. this.form.applyDate = this.getNowFormatDate(data).substr(0,10);
  505. this.showlasj = false;
  506. },
  507. accountTypeChange(e){
  508. this.payeeList = [];
  509. this.chargeItme = [];
  510. this.queryParams.accountType = this.form.accountType
  511. if(this.form.cashierId==null||this.form.cashierId==""){
  512. this.$notify({ type: 'danger', message: '请先选择付款方!' });
  513. return;
  514. }else {
  515. this.queryParams.taccountId = parseInt(this.form.cashierId)
  516. console.log(this.queryParams)
  517. listVaccount(this.queryParams).then((response) => {
  518. this.payeeList = response.rows;
  519. response.rows.map((res,index) => {
  520. this.payeeList[index].text = res.payee;
  521. this.payeeList[index].value = res.id;
  522. })
  523. });
  524. }
  525. },
  526. // 钱计算
  527. moneyChange(input) {
  528. console.log(input)
  529. let obj = {};
  530. obj = this.chargeItme.find((account) => {
  531. //model就是上面的数据源
  532. return parseFloat(account.incomeAmount).toFixed(2) === input; //筛选出匹配数据
  533. });
  534. let total = 0;
  535. this.chargeItme.forEach((money) => {
  536. total = (parseFloat(total) + parseFloat(money.incomeAmount)).toFixed(2)
  537. });
  538. this.$set(this.form, "expenditureAmount", total);
  539. },
  540. goAdd(){
  541. if(this.chargeItme.length<1){
  542. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  543. return;
  544. }
  545. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  546. this.$notify({ type: 'danger', message: '转账附言禁止包含!' });
  547. return;
  548. }
  549. if(this.form.capitalExpenditureType==2){
  550. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  551. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  552. return;
  553. }
  554. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  555. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  556. return;
  557. }
  558. }
  559. if((this.uploadFiles==null||this.uploadFiles.length==0)&&(this.fileList==null||this.fileList.length==0)){
  560. Dialog.confirm({
  561. title: '提示',
  562. message: '此申请单中未上传任何附件,是否确认提交?',
  563. })
  564. .then(() => {
  565. this.$set(this.form, "payeeList", this.chargeItme);
  566. this.$set(this.form, "bankTypeList", this.chargeItme);
  567. this.$set(this.form, "accountTypeList", this.chargeItme);
  568. this.$set(this.form, "transferStatusList", this.chargeItme);
  569. updateTransfer(this.form).then(response => {
  570. this.projectForm.outId = this.form.id
  571. this.$set(this.projectForm, "ynType", '1');
  572. if(this.uploadFiles!=null&&this.uploadFiles.length>0){
  573. this.uploadFiles.map(rr => {
  574. const params = new FormData();
  575. params.append("tableId", this.form.id);
  576. params.append("tableName", "t_yinnong_transfer");
  577. params.append("bizPath", "transfer");
  578. params.append("fileType", "1");
  579. params.append("file", rr);
  580. commonAttach(params).then((r) => {
  581. })
  582. })
  583. if(this.form.capitalExpenditureType==2){
  584. addProjectto(this.projectForm).then(res => {
  585. customSubmit(this.form.id).then(res => {
  586. this.$toast.success('提交成功');
  587. setTimeout(function(){
  588. history.go(-1)
  589. },2000)
  590. })
  591. })
  592. }else{
  593. customSubmit(this.form.id).then(res => {
  594. this.$toast.success('提交成功');
  595. setTimeout(function(){
  596. history.go(-1)
  597. },2000)
  598. })
  599. }
  600. }else{
  601. if(this.form.capitalExpenditureType==2){
  602. addProjectto(this.projectForm).then(res => {
  603. customSubmit(this.form.id).then(res => {
  604. this.$toast.success('提交成功');
  605. setTimeout(function(){
  606. history.go(-1)
  607. },2000)
  608. })
  609. })
  610. }else{
  611. customSubmit(this.form.id).then(res => {
  612. this.$toast.success('提交成功');
  613. setTimeout(function(){
  614. history.go(-1)
  615. },2000)
  616. })
  617. }
  618. }
  619. });
  620. })
  621. .catch(() => {
  622. return false;
  623. });
  624. }else{
  625. this.$set(this.form, "payeeList", this.chargeItme);
  626. this.$set(this.form, "bankTypeList", this.chargeItme);
  627. this.$set(this.form, "accountTypeList", this.chargeItme);
  628. this.$set(this.form, "transferStatusList", this.chargeItme);
  629. updateTransfer(this.form).then(response => {
  630. this.projectForm.outId = this.form.id
  631. this.$set(this.projectForm, "ynType", '1');
  632. if(this.uploadFiles!=null&&this.uploadFiles.length>0){
  633. this.uploadFiles.map(rr => {
  634. const params = new FormData();
  635. params.append("tableId", this.form.id);
  636. params.append("tableName", "t_yinnong_transfer");
  637. params.append("bizPath", "transfer");
  638. params.append("fileType", "1");
  639. params.append("file", rr);
  640. commonAttach(params).then((r) => {
  641. })
  642. })
  643. if(this.form.capitalExpenditureType==2){
  644. addProjectto(this.projectForm).then(res => {
  645. customSubmit(this.form.id).then(res => {
  646. this.$toast.success('提交成功');
  647. setTimeout(function(){
  648. history.go(-1)
  649. },2000)
  650. })
  651. })
  652. }else{
  653. customSubmit(this.form.id).then(res => {
  654. this.$toast.success('提交成功');
  655. setTimeout(function(){
  656. history.go(-1)
  657. },2000)
  658. })
  659. }
  660. }else{
  661. if(this.form.capitalExpenditureType==2){
  662. addProjectto(this.projectForm).then(res => {
  663. customSubmit(this.form.id).then(res => {
  664. this.$toast.success('提交成功');
  665. setTimeout(function(){
  666. history.go(-1)
  667. },2000)
  668. })
  669. })
  670. }else{
  671. customSubmit(this.form.id).then(res => {
  672. this.$toast.success('提交成功');
  673. setTimeout(function(){
  674. history.go(-1)
  675. },2000)
  676. })
  677. }
  678. }
  679. });
  680. }
  681. },
  682. goUpdate(){
  683. if(this.chargeItme.length<1){
  684. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  685. return;
  686. }
  687. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  688. this.$notify({ type: 'danger', message: '转账附言禁止包含!' });
  689. return;
  690. }
  691. if(this.form.capitalExpenditureType==2){
  692. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  693. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  694. return;
  695. }
  696. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  697. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  698. return;
  699. }
  700. }
  701. this.$set(this.form, "payeeList", this.chargeItme);
  702. this.$set(this.form, "bankTypeList", this.chargeItme);
  703. this.$set(this.form, "accountTypeList", this.chargeItme);
  704. this.$set(this.form, "transferStatusList", this.chargeItme);
  705. updateTransfer(this.form).then((response) => {
  706. this.projectForm.outId = this.form.id
  707. this.$set(this.projectForm, "ynType", '1');
  708. if(this.uploadFiles!=null&&this.uploadFiles.length>0){
  709. console.log(this.uploadFiles)
  710. this.uploadFiles.map(rr => {
  711. const params = new FormData();
  712. params.append("tableId", this.form.id);
  713. params.append("tableName", "t_yinnong_transfer");
  714. params.append("bizPath", "transfer");
  715. params.append("fileType", "1");
  716. params.append("file", rr);
  717. commonAttach(params).then((r) => {
  718. })
  719. })
  720. if(this.form.capitalExpenditureType==2){
  721. addProjectto(this.projectForm).then(res => {
  722. this.$toast.success('保存成功');
  723. setTimeout(function(){
  724. history.go(-1)
  725. },2000)
  726. })
  727. }else{
  728. this.$toast.success('保存成功');
  729. setTimeout(function(){
  730. history.go(-1)
  731. },2000)
  732. }
  733. }else{
  734. if(this.form.capitalExpenditureType==2){
  735. addProjectto(this.projectForm).then(res => {
  736. this.$toast.success('保存成功');
  737. setTimeout(function(){
  738. history.go(-1)
  739. },2000)
  740. })
  741. }else{
  742. this.$toast.success('保存成功');
  743. setTimeout(function(){
  744. history.go(-1)
  745. },2000)
  746. }
  747. }
  748. });
  749. },
  750. payeeSelectChange(select, i) {
  751. let obj = {};
  752. let fuzhitype = 0;
  753. obj = this.payeeList.find((account) => {
  754. //model就是上面的数据源
  755. return account.id === select ; //筛选出匹配数据
  756. });
  757. if(this.chargeItme != [] && this.chargeItme.length>1){
  758. this.chargeItme.some((value, index) => {
  759. if(value.payeeAccount != undefined &&value.payeeAccount != '' && obj.payeeAccount == value.payeeAccount&&index!=i){
  760. fuzhitype = 2;
  761. return true;
  762. }
  763. if(value.accountType != undefined &&value.accountType != '' && obj.accountType != value.accountType&&index!=i){
  764. fuzhitype = 1;
  765. return true;
  766. }
  767. });
  768. }
  769. if(fuzhitype == 0){
  770. this.$set(this.chargeItme[i], "payee",obj.payee)
  771. this.$set(this.chargeItme[i], "bankType", obj.bankType)
  772. this.$set(this.chargeItme[i], "payeeId", obj.id);
  773. this.$set(this.chargeItme[i], "payeeAccount", obj.payeeAccount);
  774. this.$set(this.chargeItme[i], "bankDeposit", obj.bankDeposit);
  775. this.$set(this.chargeItme[i], "accountType", obj.accountType);
  776. this.$set(this.chargeItme[i], "payeePaymentLines", obj.payeePaymentLines);
  777. }else if(fuzhitype == 1){
  778. this.$set(this.chargeItme[i], "payee",'')
  779. this.$set(this.chargeItme[i], "bankType",'')
  780. this.$set(this.chargeItme[i], "payeeId", '');
  781. this.$set(this.chargeItme[i], "payeeAccount", '');
  782. this.$set(this.chargeItme[i], "bankDeposit", '');
  783. this.$set(this.chargeItme[i], "accountType", '');
  784. this.$set(this.chargeItme[i], "payeePaymentLines", '');
  785. this.$notify({ type: 'danger', message: '请选择账户类型相同的收款方!' });
  786. }else if(fuzhitype == 2){
  787. this.$set(this.chargeItme[i], "payee",'')
  788. this.$set(this.chargeItme[i], "bankType",'')
  789. this.$set(this.chargeItme[i], "payeeId", '');
  790. this.$set(this.chargeItme[i], "payeeAccount", '');
  791. this.$set(this.chargeItme[i], "bankDeposit", '');
  792. this.$set(this.chargeItme[i], "accountType", '');
  793. this.$set(this.chargeItme[i], "payeePaymentLines", '');
  794. this.$notify({ type: 'danger', message: '收款方已存在!' });
  795. }
  796. },
  797. selectChange(select) {
  798. let obj = {};
  799. obj = this.payerOptions.find((account) => {
  800. //model就是上面的数据源
  801. return account.id === select; //筛选出匹配数据
  802. });
  803. if(obj.accountPassword != null && obj.accountPassword != "" &&
  804. obj.bankType != null && obj.bankType != ""){
  805. this.$set(this.form, "bookId", obj.bookId);
  806. this.$set(this.form, "deptId", obj.deptId);
  807. this.$set(this.form, "cashierId", obj.id);
  808. this.$set(this.form, "payer", obj.accountName);
  809. this.$set(this.form, "payerAccount", obj.bankAccountNumber);
  810. this.$set(this.form, "operatorCode", obj.operatorCode);
  811. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  812. this.$set(this.form, "bankType", obj.bankType);
  813. this.$set(this.form, "payerFrom", '1');
  814. }else{
  815. if(obj.payerFrom==1){
  816. this.diglogStatus = false;
  817. this.$notify({ type: 'danger', message: "请完善付款方“操作员代码”、“企业编码”、“支付口令”等信息!" });
  818. this.$set(this.form,"payer","")
  819. this.$set(this.form,"payerAccount","")
  820. }else{
  821. this.$set(this.form, "payerFrom", obj.parerFrom);
  822. if(obj.operatorCode!=null&&obj.operatorCode!=''){
  823. this.$set(this.form, "operatorCode", obj.operatorCode);
  824. }else{
  825. this.$set(this.form, "operatorCode", '');
  826. }
  827. if(obj.enterpriseCode!=null&&obj.enterpriseCode!=''){
  828. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  829. }else{
  830. this.$set(this.form, "enterpriseCode", '');
  831. }
  832. if(obj.accountPassword!=null&&obj.accountPassword!=''){
  833. this.$set(this.form, "accountPassword", obj.accountPassword);
  834. }else{
  835. this.$set(this.form, "accountPassword", '');
  836. }
  837. this.$set(this.form, "bookId",'');
  838. this.$set(this.form, "deptId", '');
  839. this.$set(this.form, "cashierId", obj.id);
  840. this.$set(this.form, "payer", obj.accountName);
  841. if(obj.payerFrom==6){
  842. getQmyeFlow(obj.bankAccountNumber).then((response) => {
  843. this.$set(this.form, "payerAccount", response.data);
  844. });
  845. }else {
  846. this.$set(this.form, "payerAccount", obj.bankAccountNumber);
  847. }
  848. }
  849. }
  850. },
  851. beforeRead(file) {
  852. this.uploadFiles.push(file.file);
  853. },
  854. deleteFile(file){
  855. console.log(file)
  856. this.uploadFiles.map((response,index) => {
  857. if(file.file == response){
  858. this.uploadFiles.splice(index,1)
  859. }
  860. })
  861. if(file.id){
  862. systemAttachment(file.id).then((res) => {
  863. });
  864. }
  865. },
  866. getFileList(){
  867. let oData= {
  868. tableId: this.$route.query.id,
  869. tableName: "t_yinnong_transfer",
  870. bizPath: "transfer",
  871. fileType: "",
  872. }
  873. attachmentList(oData).then(res => {
  874. console.log(res)
  875. console.log(location.protocol+"//"+location.host+request.defaults.baseURL)
  876. res.rows.map(r => {
  877. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  878. this.fileList.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{}),"id":r.id})
  879. console.log(r)
  880. })
  881. })
  882. },
  883. goBack(){
  884. window.history.go(-1)
  885. },
  886. //删除家庭成员
  887. deleteChargeItme(index){
  888. this.chargeItme.splice(index,1)
  889. },
  890. },
  891. }
  892. </script>
  893. <style scoped lang="scss">
  894. .app-container {
  895. padding: 2% 0;
  896. }
  897. .main_title{
  898. font-size: 0.4rem;
  899. color: #1D6FE9;
  900. margin: 0.2rem 6%;
  901. position: relative;
  902. }
  903. .main_box{
  904. width: 96%;
  905. margin: 0 auto;
  906. border-radius: 6px;
  907. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  908. overflow: hidden;
  909. background-color: #FFF;
  910. }
  911. .submitButton{
  912. width: 80%;
  913. margin: 0 auto;
  914. background-color: #1D6FE9;
  915. }
  916. .addFamily{
  917. position: absolute;
  918. top: -2px;
  919. right: 0;
  920. border-radius: 50%;
  921. }
  922. .deleteFamily{
  923. position: absolute;
  924. top: 0rem;
  925. right: 6%;
  926. z-index: 9;
  927. border-radius: 50%;
  928. }
  929. </style>