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

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