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

approvalAdd3.vue 35 KiB

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