移动端
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.
 
 

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