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

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