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

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