移动端
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

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