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