移动端
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

1065 行
40 KiB

  1. <template>
  2. <div class="app-container">
  3. <van-nav-bar
  4. left-arrow
  5. fixed
  6. placeholder
  7. @click-left="$router.back(-1)"
  8. >
  9. <template #title>
  10. <p style="font-weight: bold;">添加现金提现申请</p>
  11. </template>
  12. <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. <van-field name="radio" label="审批模式" input-align="right" autocomplete="off" required
  73. :rules="[{ required: true , message:'请选择审批模式' }]">
  74. <template #input>
  75. <van-radio-group v-model="form.approvalMode" direction="horizontal">
  76. <van-radio name="1">线上审批</van-radio>
  77. <van-radio name="2">线下审批</van-radio>
  78. </van-radio-group>
  79. </template>
  80. </van-field>
  81. </div>
  82. <div class="main_box" style="margin-top: 10px;">
  83. <van-field
  84. label="转账附言"
  85. v-model="form.remark"
  86. type="textarea"
  87. placeholder="请输入转账附言"
  88. input-align="right"
  89. rows="3"
  90. label-width="auto"
  91. required
  92. :rules="[{ required: true , message:'请输入转账附言' }]"
  93. />
  94. </div>
  95. <div class="main_box" style="margin-top: 10px;">
  96. <van-field label="说明情况" v-model="form.explainSituation" type="textarea" placeholder="请输入说明情况" input-align="right" rows="3" label-width="auto"/>
  97. </div>
  98. <p class="main_title" v-if="capitalExpenditureOpen">关联项目</p>
  99. <div class="main_box" v-if="capitalExpenditureOpen" style="margin-bottom: 10px;margin-top: 10px;position:relative;">
  100. <van-field
  101. readonly
  102. clickable
  103. label="项目名称"
  104. placeholder="请选择"
  105. v-model="projectForm.projectName"
  106. @click="showproject = true"
  107. input-align="right"
  108. right-icon="arrow-down"
  109. required
  110. :rules="[{ required: true , message:'请选择项目名称' }]"
  111. />
  112. <van-popup v-model="showproject" position="bottom">
  113. <van-picker
  114. show-toolbar
  115. :columns="projectList"
  116. @confirm="onConfirmProject"
  117. @cancel="showproject = false"
  118. />
  119. </van-popup>
  120. <van-field required :rules="[{ required: true , message:'请输入承建单位' }]" v-model="projectForm.projectContractor" label="承建单位" placeholder="请输入承建单位" input-align="right" label-width="auto"/>
  121. <van-field required :rules="[{ required: true , message:'请输入合同价款' }]" v-model="projectForm.projectAmount" label="合同价款(元)" placeholder="请输入合同价款(元)" input-align="right" label-width="auto"/>
  122. <van-field
  123. readonly
  124. clickable
  125. label="工程款类型"
  126. placeholder="请选择"
  127. v-model="projectFundType"
  128. @click="showFundType = true"
  129. input-align="right"
  130. right-icon="arrow-down"
  131. required
  132. :rules="[{ required: true , message:'请选择工程款类型' }]"
  133. />
  134. <van-popup v-model="showFundType" position="bottom">
  135. <van-picker
  136. show-toolbar
  137. :columns="projectFundTypeOptions"
  138. @confirm="onConfirmFundType"
  139. @cancel="showFundType = false"
  140. />
  141. </van-popup>
  142. <van-field required :rules="[{ required: true , message:'请输入工程发票号' }]" v-model="projectForm.projectBillNum" label="工程发票号" placeholder="请输入工程发票号" input-align="right" label-width="auto"/>
  143. </div>
  144. <p class="main_title" v-if="contractOpen">关联合同</p>
  145. <div class="main_box" v-if="contractOpen" style="margin-bottom: 10px;margin-top: 10px;position:relative;">
  146. <van-field
  147. readonly
  148. clickable
  149. label="合同"
  150. placeholder="请选择"
  151. v-model="infoForm.name"
  152. @click="showcontract = true"
  153. input-align="right"
  154. right-icon="arrow-down"
  155. required
  156. :rules="[{ required: true , message:'请选择项目名称' }]"
  157. />
  158. <van-popup v-model="showcontract" position="bottom">
  159. <van-picker
  160. show-toolbar
  161. :columns="infoList"
  162. @confirm="onConfirmContract"
  163. @cancel="showcontract = false"
  164. />
  165. </van-popup>
  166. <van-field required :rules="[{ required: true , message:'请输入合同编码' }]" v-model="infoForm.code" label="合同编码" placeholder="请输入合同编码" input-align="right" label-width="auto"/>
  167. <van-field required :rules="[{ required: true , message:'请输入合同价款' }]" v-model="infoForm.totalAmount" label="合同价款(元)" placeholder="请输入合同价款(元)" input-align="right" label-width="auto"/>
  168. </div>
  169. <p class="main_title">付款方信息</p>
  170. <div class="main_box">
  171. <!-- <van-field label="付款方" v-model="form.payer" placeholder="请输入付款方" input-align="right" label-width="auto"/>-->
  172. <van-field
  173. readonly
  174. clickable
  175. label="付款方"
  176. placeholder="请选择付款方"
  177. v-model="form.payer"
  178. @click="showpayer = true"
  179. input-align="right"
  180. right-icon="arrow-down"
  181. label-width="auto"
  182. required
  183. :rules="[{ required: true , message:'请选择付款方' }]"
  184. />
  185. <van-popup v-model="showpayer" position="bottom">
  186. <van-picker
  187. show-toolbar
  188. :columns="payerOptions"
  189. @confirm="onConfirmPayer($event)"
  190. @cancel="showpayer = false"
  191. />
  192. </van-popup>
  193. <van-field :rules="[{ required: true , message:'请输入付款方账户' }]" required label="付款方账户" v-model="form.payerAccount" placeholder="请输入账户" input-align="right" label-width="auto"/>
  194. </div>
  195. <p class="main_title">收款方信息<van-button icon="plus" @click="addChargeItme(chargeItme.length)" size="mini" type="info" native-type="button" class="addFamily"/></p>
  196. <div :style="{position:'relative',padding: index == 0 ? '':'10px 0 0 0'}" v-for="(item, index) in chargeItme" :key="index">
  197. <van-button icon="minus" size="mini" type="danger" class="deleteFamily" native-type="button" v-if="index!=0" @click="deleteChargeItme(index)" />
  198. <div class="main_box" style="margin-bottom: 10px;position:relative;">
  199. <van-field required :rules="[{ required: true , message:'请输入收款方全称' }]" v-model="item.payee" label="收款方" placeholder="请输入收款方全称" input-align="right" label-width="auto"/>
  200. <van-field required :rules="[{ required: true , message:'请输入提款人' }]" v-model="item.drawer" label="提款人" placeholder="请输入提款人" input-align="right" label-width="auto"/>
  201. <van-field required :rules="[{ required: true , message:'请输入提款金额' }]" v-model="item.incomeAmount" type="number" label="提款金额(元)" placeholder="请输入提款金额" input-align="right" label-width="auto" @change="moneyChange"/>
  202. <van-field required :rules="[{ required: true , message:'请输入资金用途' }]" v-model="item.remark" label="资金用途" placeholder="请输入资金用途" input-align="right" label-width="auto" />
  203. </div>
  204. </div>
  205. <p class="main_title">上传附件</p>
  206. <div class="main_box" style="padding: 5px 0 0 0;">
  207. <van-cell value="收据" />
  208. <van-uploader v-model="fileList1" :after-read="beforeRead1" @delete="deleteFile1" style="margin-left:8px;"></van-uploader>
  209. <van-cell title="发票" />
  210. <van-uploader v-model="fileList2" :after-read="beforeRead2" @delete="deleteFile2" style="margin-left:8px;"></van-uploader>
  211. <van-cell title="其他" />
  212. <van-uploader v-model="fileList3" :after-read="beforeRead3" @delete="deleteFile3" style="margin-left:8px;"></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 , cashSubmit , getAccount ,getQmyeFlow,listInfo ,getInfoto ,addInfoto} from "@/api/onlineHome/bankAgriculture/paymentApproval";
  232. import request from '@/utils/request'
  233. import {
  234. addCash,
  235. addCashdetail, attachmentList,
  236. commonAttach,
  237. updateCash
  238. } from "../../../../api/onlineHome/bankAgriculture/paymentApproval";
  239. import Dialog from "vant/lib/dialog";
  240. import moment from "moment";
  241. export default {
  242. name: "approvalAdd10",
  243. data() {
  244. return {
  245. showcontract:false,
  246. showcapital:false,
  247. showpayee:false,
  248. showlasj:false,
  249. showbankType:false,
  250. showproject:false,
  251. showFundType:false,
  252. showpayer:false,
  253. buttonType:'a',
  254. minDate: new Date(2000, 1, 1),
  255. maxDate: new Date(2050, 12, 31),
  256. currentDate: new Date(),
  257. form:{},
  258. fileList1:[],
  259. fileList2:[],
  260. fileList3:[],
  261. capitalExpenditureType:'',
  262. payee:'',
  263. bankType:'',
  264. wfydlxDictionaries:[],
  265. jglxDictionaries:[],
  266. sysDictionaries:[],
  267. capitalExpenditureTypeOptions:[],
  268. bankTypeDictionaries:[],
  269. projectList:[],
  270. infoList:[],
  271. projectFundTypeOptions:[],
  272. projectFundTypeDictionaries:[],
  273. payerOptions:[],
  274. chargeItme:[],
  275. chargeItmeShow:[],
  276. payeeList:[],
  277. // 查询参数
  278. queryParams: {
  279. transferType:10,
  280. orderByColumn: "id",
  281. isAsc: "desc",
  282. },
  283. capitalExpenditureOpen:false,
  284. contractOpen:false,
  285. projectForm:{
  286. projectId:null,
  287. projectName:null,
  288. projectContractor:null,
  289. projectAmount:null,
  290. projectBillNum:null,
  291. projectFundType:'1',
  292. outId:null,
  293. ynType:'2'
  294. },
  295. infoForm:{
  296. infoId:null,
  297. name:null,
  298. code:null,
  299. totalAmount:null,
  300. contractionId:null,
  301. transferId:null
  302. },
  303. // 合同信息查询参数
  304. queryContractionParams: {
  305. pageNum: 1,
  306. pageSize: 100,
  307. contractionStatus: '1',
  308. orderByColumn: "endTime",
  309. isAsc: "desc",
  310. },
  311. projectFundType:'',
  312. uploadFiles1:[],
  313. uploadFiles2:[],
  314. uploadFiles3:[],
  315. nowDate:""
  316. };
  317. },
  318. created() {
  319. this.getNowDate();
  320. this.reset();
  321. this.initProjectInfo();
  322. this.getDicts("project_fund_type").then((response) => {
  323. for (var i = 0; i < response.data.length; i++) {
  324. this.projectFundTypeOptions.push({text: response.data[i].dictLabel, value: response.data[i].dictValue});
  325. }
  326. this.projectFundTypeDictionaries = response.data;
  327. });
  328. let params1={
  329. accountType: "102",
  330. status: "N",
  331. }
  332. getAccount(params1).then((response) => {
  333. this.payerOptions = response.rows;
  334. response.rows.map((res,index) => {
  335. res['payerFrom'] = '1'
  336. console.log(res)
  337. this.payerOptions[index].text = res.accountName;
  338. this.payerOptions[index].value = res.id;
  339. })
  340. });
  341. this.getDictionaries();
  342. this.addChargeItme();
  343. },
  344. methods: {
  345. goFlow(){
  346. if(this.form.approvalMode == '1' && this.form.approvalTemplateId != undefined && this.form.approvalTemplateId != "undefined"){
  347. window.location='approvalProcess3?approvalTemplateId='+this.form.approvalTemplateId+'&approvalMode='+this.form.approvalMode;
  348. }else{
  349. this.$notify({ type: 'danger', message: '无审批流程!' });
  350. }
  351. },
  352. getNowDate(){
  353. var _this = this;
  354. let yy = new Date().getFullYear();
  355. let mm = new Date().getMonth()+1;
  356. let dd = new Date().getDate();
  357. _this.nowDate = moment(new Date()).format("YYYY-MM-DD");
  358. },
  359. initProjectInfo(){
  360. let _this = this
  361. let queryParams={
  362. pageNum: 1,
  363. pageSize: 100,
  364. }
  365. listProject(queryParams).then(response => {
  366. _this.projectList = response.rows;
  367. console.log(response)
  368. for (let i = 0; i < response.rows.length; i++) {
  369. //_this.projectList[i].set({text: response.rows[i].projectName, value: response.rows[i].id});
  370. _this.$set(_this.projectList[i],"text",response.rows[i].projectName)
  371. _this.$set(_this.projectList[i],"value",response.rows[i].id)
  372. }
  373. });
  374. listInfo(this.queryContractionParams).then(response => {
  375. console.log(response)
  376. _this.infoList = response.rows;
  377. for (let i = 0; i < response.rows.length; i++) {
  378. //_this.infoList[i].push({text: response.rows[i].name, value: response.rows[i].code});
  379. _this.$set(_this.infoList[i],"text",response.rows[i].name)
  380. _this.$set(_this.infoList[i],"value",response.rows[i].code)
  381. }
  382. });
  383. },
  384. // 表单重置
  385. reset() {
  386. this.form = {
  387. id: null,
  388. applyDate:this.nowDate,
  389. approvalMode:'1',
  390. upId: null,
  391. downId: null,
  392. orderId: null,
  393. cashierId: null,
  394. cashType: '10',
  395. accountType: '2',
  396. explainSituation: null,
  397. succeedAmount: null,
  398. payer: null,
  399. payerAccount: null,
  400. operatorCode: null,
  401. enterpriseCode: null,
  402. expenditureAmount: null,
  403. capitalExpenditureType: '1',
  404. remark: null,
  405. transferStatus: "0",
  406. auditStatus: "0",
  407. paymentState: "1",
  408. bankPriority: "0",
  409. clientPriority: "0"
  410. };
  411. this.processList = {}
  412. this.projectForm={
  413. projectId:null,
  414. projectName:null,
  415. projectContractor:null,
  416. projectAmount:null,
  417. projectBillNum:null,
  418. projectFundType:'1',
  419. outId:null,
  420. ynType:'1'
  421. }
  422. },
  423. getChange(){
  424. if(this.buttonType == 'update'){
  425. this.goUpdate();
  426. }else if(this.buttonType == 'add'){
  427. this.goAdd();
  428. }
  429. },
  430. getDictionaries(){
  431. this.getDicts("capital_expenditure_type").then((res) => {
  432. for (let i = 0; i < res.data.length; i++) {
  433. this.capitalExpenditureTypeOptions.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  434. }
  435. });
  436. this.getPayeeList();
  437. },
  438. getError(e){
  439. this.$notify({ type: 'danger', message: e.errors[0].message });
  440. },
  441. addChargeItme(index){
  442. if(this.chargeItme.length>0&&this.chargeItme[this.chargeItme.length-1].payee == ''){
  443. this.$notify({ type: 'danger', message: '请勿添加多个空列表信息' });
  444. return;
  445. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].incomeAmount == ''){
  446. this.$notify({ type: 'danger', message: '请输入提款金额!' });
  447. return;
  448. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].drawer == ''){
  449. this.$notify({ type: 'danger', message: '请输入提款人!' });
  450. return;
  451. }else if(this.chargeItme.length>0&&this.chargeItme[index-1].remark == ''){
  452. this.$notify({ type: 'danger', message: '请输入资金用途!' });
  453. return;
  454. }
  455. this.chargeItme.splice(index + 1, 0, {
  456. payeeId: "", //收款方ID
  457. payee: "", //收款方全称
  458. payeeAccount: "", //收款账户
  459. drawer: "", //提款人
  460. incomeAmount: "", //提款金额
  461. bankType: "", //资金用途
  462. showPayee:false,
  463. showbankType:false
  464. });
  465. },
  466. getPayeeList() {
  467. //普通转账
  468. this.queryParams.accountType = this.form.accountType
  469. this.queryParams.status = "0"
  470. listPayee(this.queryParams).then((response) => {
  471. this.payeeList = response.rows;
  472. response.rows.map((res,index) => {
  473. this.payeeList[index].text = res.payee;
  474. this.payeeList[index].value = res.id;
  475. })
  476. });
  477. },
  478. payeeDictLabel(datas, value) {
  479. let actions = [];
  480. Object.keys(datas).some((key) => {
  481. if (datas[key].payeeId == ('' + value)) {
  482. actions.push(datas[key].payee);
  483. return true;
  484. }
  485. })
  486. return actions.join('');
  487. },
  488. onConfirmCapital(data){
  489. if (data.value == 2){
  490. this.capitalExpenditureOpen = true;
  491. this.contractOpen = false
  492. this.infoForm = {};
  493. }else if(data.value == 4){
  494. this.capitalExpenditureOpen = false;
  495. this.contractOpen = true
  496. this.projectForm = {};
  497. }else{
  498. this.capitalExpenditureOpen = false;
  499. this.contractOpen = false
  500. this.projectForm = {};
  501. this.infoForm = {};
  502. }
  503. this.capitalExpenditureType = data.text;
  504. this.form.capitalExpenditureType = data.value;
  505. this.showcapital = false;
  506. },
  507. onConfirmFundType(data){
  508. this.projectForm.projectFundType = data.value;
  509. this.projectFundType = data.text;
  510. this.showFundType = false;
  511. },
  512. onConfirmProject(data){
  513. this.projectList.map(res => {
  514. if(res.projectName==data.text){
  515. this.projectForm.projectId = res.id
  516. this.projectForm.projectName = res.projectName
  517. this.projectForm.projectContractor = res.projectContractor
  518. this.projectForm.projectAmount = res.projectAmount
  519. }
  520. })
  521. this.showproject = false;
  522. },
  523. onConfirmContract(data){
  524. this.infoList.map(res => {
  525. if(res.name==data.text){
  526. this.infoForm.contractionId = res.id;
  527. this.infoForm.name = res.name;
  528. this.infoForm.code = res.code;
  529. this.infoForm.totalAmount = res.totalAmount;
  530. }
  531. })
  532. this.showcontract = false;
  533. },
  534. onConfirmPayee(data,index){
  535. for (var i = 0 ; i < this.chargeItme.length ; i++){
  536. this.chargeItme[i].showPayee = false;
  537. }
  538. this.chargeItme[index].payee = data.text;
  539. this.chargeItme[index].payeeId = data.value;
  540. this.chargeItme[index].showpayee = false;
  541. this.payeeSelectChange(data.value , index)
  542. },
  543. onConfirmBankType(data,index){
  544. for (var i = 0 ; i < this.chargeItme.length ; i++){
  545. this.chargeItme[i].showbankType = false;
  546. }
  547. this.chargeItme[index].bankTypeText = data.text;
  548. this.chargeItme[index].bankType = data.value;
  549. this.chargeItme[index].showbankType = false;
  550. },
  551. onConfirmPayer(data){
  552. this.form.payer = data.text;
  553. this.form.cashierId = data.value;
  554. this.showpayer = false;
  555. this.selectChange(data.value)
  556. },
  557. onConfirmLasj(data){
  558. this.form.applyDate = this.getNowFormatDate(data).substr(0,10);
  559. this.showlasj = false;
  560. },
  561. accountTypeChange(e){
  562. this.payeeList = [];
  563. this.queryParams.accountType = this.form.accountType
  564. this.queryParams.status = "0"
  565. listPayee(this.queryParams).then((response) => {
  566. this.payeeList = response.rows;
  567. response.rows.map((res,index) => {
  568. this.payeeList[index].text = res.payee;
  569. this.payeeList[index].value = res.id;
  570. })
  571. });
  572. },
  573. // 钱计算
  574. moneyChange(input) {
  575. console.log(input)
  576. let obj = {};
  577. obj = this.chargeItme.find((account) => {
  578. //model就是上面的数据源
  579. return parseFloat(account.incomeAmount).toFixed(2) === input; //筛选出匹配数据
  580. });
  581. let total = 0;
  582. this.chargeItme.forEach((money) => {
  583. total = (parseFloat(total) + parseFloat(money.incomeAmount)).toFixed(2)
  584. });
  585. this.$set(this.form, "expenditureAmount", total);
  586. },
  587. goAdd(){
  588. if(this.chargeItme.length<1){
  589. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  590. return;
  591. }
  592. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  593. this.$notify({ type: 'danger', message: '转账附言禁止包含!' });
  594. return;
  595. }
  596. if(this.form.capitalExpenditureType==2){
  597. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  598. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  599. return;
  600. }
  601. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  602. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  603. return;
  604. }
  605. }
  606. if(this.form.capitalExpenditureType==4){
  607. if(this.infoForm.name==""||this.infoForm.name==null){
  608. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  609. return;
  610. }
  611. if(this.infoForm.code==""||this.infoForm.code==null){
  612. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  613. return;
  614. }
  615. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  616. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  617. return;
  618. }
  619. }
  620. if((this.uploadFiles1==null||this.uploadFiles1.length==0)&&(this.uploadFiles2==null||this.uploadFiles2.length==0)&&(this.uploadFiles3==null||this.uploadFiles3.length==0)){
  621. Dialog.confirm({
  622. title: '提示',
  623. message: '此申请单中未上传任何附件,是否确认提交?',
  624. })
  625. .then(() => {
  626. console.log(this.form)
  627. addCash(this.form).then((response) => {
  628. this.chargeItme.map(res => {
  629. res.cashId = response.data.id
  630. addCashdetail(res).then(r => {})
  631. })
  632. if(this.form.capitalExpenditureType==2){
  633. this.projectForm.outId = response.data.id
  634. this.$set(this.projectForm, "ynType", '2');
  635. addProjectto(this.projectForm).then(res => {
  636. cashSubmit(response.data.id).then(res => {
  637. this.$toast.success('提交成功');
  638. setTimeout(function(){
  639. history.go(-1)
  640. },2000)
  641. })
  642. })
  643. }else if(this.form.capitalExpenditureType==4){
  644. this.infoForm.transferId = response.data.id
  645. addInfoto(this.infoForm).then(res => {
  646. cashSubmit(response.data.id).then(res => {
  647. this.$toast.success('提交成功');
  648. setTimeout(function(){
  649. history.go(-1)
  650. },2000)
  651. })
  652. })
  653. }else{
  654. cashSubmit(response.data.id).then(res => {
  655. this.$toast.success('提交成功');
  656. setTimeout(function(){
  657. history.go(-1)
  658. },2000)
  659. })
  660. }
  661. });
  662. })
  663. }else{
  664. addCash(this.form).then((response) => {
  665. this.uploadFiles1.map(rr => {
  666. const params = new FormData();
  667. params.append("tableId", response.data.id);
  668. params.append("tableName", "t_yinnong_transfer");
  669. params.append("bizPath", "yinnong");
  670. params.append("fileType", "1");
  671. params.append("file", rr);
  672. commonAttach(params).then((r) => {
  673. })
  674. })
  675. this.uploadFiles2.map(rr => {
  676. const params = new FormData();
  677. params.append("tableId", response.data.id);
  678. params.append("tableName", "t_yinnong_transfer");
  679. params.append("bizPath", "yinnong");
  680. params.append("fileType", "2");
  681. params.append("file", rr);
  682. commonAttach(params).then((r) => {
  683. })
  684. })
  685. this.uploadFiles3.map(rr => {
  686. const params = new FormData();
  687. params.append("tableId", response.data.id);
  688. params.append("tableName", "t_yinnong_transfer");
  689. params.append("bizPath", "yinnong");
  690. params.append("fileType", "3");
  691. params.append("file", rr);
  692. commonAttach(params).then((r) => {
  693. })
  694. })
  695. this.chargeItme.map(res => {
  696. res.cashId = response.data.id
  697. addCashdetail(res).then(r => {})
  698. })
  699. if(this.form.capitalExpenditureType==2){
  700. this.projectForm.outId = response.data.id
  701. this.$set(this.projectForm, "ynType", '2');
  702. addProjectto(this.projectForm).then(res => {
  703. cashSubmit(response.data.id).then(res => {
  704. this.$toast.success('提交成功');
  705. setTimeout(function(){
  706. history.go(-1)
  707. },2000)
  708. })
  709. })
  710. }else if(this.form.capitalExpenditureType==4){
  711. this.infoForm.transferId = response.data.id
  712. addInfoto(this.infoForm).then(res => {
  713. cashSubmit(response.data.id).then(res => {
  714. this.$toast.success('提交成功');
  715. setTimeout(function(){
  716. history.go(-1)
  717. },2000)
  718. })
  719. })
  720. }else{
  721. cashSubmit(response.data.id).then(res => {
  722. this.$toast.success('提交成功');
  723. setTimeout(function(){
  724. history.go(-1)
  725. },2000)
  726. })
  727. }
  728. });
  729. }
  730. },
  731. goUpdate(){
  732. if(this.chargeItme.length<1){
  733. this.$notify({ type: 'danger', message: '请添加收款方信息' });
  734. return;
  735. }
  736. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  737. this.$notify({ type: 'danger', message: '转账附言禁止包含!' });
  738. return;
  739. }
  740. if(this.form.capitalExpenditureType==2){
  741. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  742. this.$notify({ type: 'danger', message: '请选择项目名称!' });
  743. return;
  744. }
  745. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  746. this.$notify({ type: 'danger', message: '请输入工程发票号!' });
  747. return;
  748. }
  749. }
  750. if(this.form.capitalExpenditureType==4){
  751. if(this.infoForm.name==""||this.infoForm.name==null){
  752. this.$notify({ type: 'danger', message: '请选择合同名称!' });
  753. return;
  754. }
  755. if(this.infoForm.code==""||this.infoForm.code==null){
  756. this.$notify({ type: 'danger', message: '请输入合同编码!' });
  757. return;
  758. }
  759. if(this.infoForm.totalAmount==""||this.infoForm.totalAmount==null){
  760. this.$notify({ type: 'danger', message: '请输入合同价款!' });
  761. return;
  762. }
  763. }
  764. addCash(this.form).then((response) => {
  765. this.uploadFiles1.map(rr => {
  766. const params = new FormData();
  767. params.append("tableId", response.data.id);
  768. params.append("tableName", "t_yinnong_transfer");
  769. params.append("bizPath", "yinnong");
  770. params.append("fileType", "1");
  771. params.append("file", rr);
  772. commonAttach(params).then((r) => {
  773. })
  774. })
  775. this.uploadFiles2.map(rr => {
  776. const params = new FormData();
  777. params.append("tableId", response.data.id);
  778. params.append("tableName", "t_yinnong_transfer");
  779. params.append("bizPath", "yinnong");
  780. params.append("fileType", "2");
  781. params.append("file", rr);
  782. commonAttach(params).then((r) => {
  783. })
  784. })
  785. this.uploadFiles3.map(rr => {
  786. const params = new FormData();
  787. params.append("tableId", response.data.id);
  788. params.append("tableName", "t_yinnong_transfer");
  789. params.append("bizPath", "yinnong");
  790. params.append("fileType", "3");
  791. params.append("file", rr);
  792. commonAttach(params).then((r) => {
  793. })
  794. })
  795. this.chargeItme.map(res => {
  796. res.cashId = response.data.id
  797. addCashdetail(res).then(r => {})
  798. })
  799. if(this.form.capitalExpenditureType==2){
  800. this.projectForm.outId = response.data.id
  801. this.$set(this.projectForm, "ynType", '2');
  802. addProjectto(this.projectForm).then(res => {
  803. this.$toast.success('保存成功');
  804. setTimeout(function(){
  805. history.go(-1)
  806. },2000)
  807. })
  808. }else if(this.form.capitalExpenditureType==4){
  809. this.infoForm.transferId = response.data.id
  810. addInfoto(this.infoForm).then(res => {
  811. this.$toast.success('保存成功');
  812. setTimeout(function(){
  813. history.go(-1)
  814. },2000)
  815. })
  816. }else{
  817. this.$toast.success('保存成功');
  818. setTimeout(function(){
  819. history.go(-1)
  820. },2000)
  821. }
  822. });
  823. },
  824. payeeSelectChange(select, i) {
  825. let obj = {};
  826. let fuzhitype = 0;
  827. obj = this.payeeList.find((account) => {
  828. //model就是上面的数据源
  829. return account.id === select ; //筛选出匹配数据
  830. });
  831. if(this.chargeItme != [] && this.chargeItme.length>1){
  832. this.chargeItme.some((value, index) => {
  833. if(value.payeeAccount != undefined &&value.payeeAccount != '' && obj.payeeAccount == value.payeeAccount&&index!=i){
  834. fuzhitype = 2;
  835. return true;
  836. }
  837. if(value.accountType != undefined &&value.accountType != '' && obj.accountType != value.accountType&&index!=i){
  838. fuzhitype = 1;
  839. return true;
  840. }
  841. });
  842. }
  843. if(fuzhitype == 0){
  844. this.$set(this.chargeItme[i], "payee",obj.payee)
  845. this.$set(this.chargeItme[i], "bankType", obj.bankType)
  846. this.$set(this.chargeItme[i], "payeeId", obj.id);
  847. this.$set(this.chargeItme[i], "payeeAccount", obj.payeeAccount);
  848. this.$set(this.chargeItme[i], "bankDeposit", obj.bankDeposit);
  849. this.$set(this.chargeItme[i], "accountType", obj.accountType);
  850. }else if(fuzhitype == 1){
  851. this.$set(this.chargeItme[i], "payee",'')
  852. this.$set(this.chargeItme[i], "bankType",'')
  853. this.$set(this.chargeItme[i], "payeeId", '');
  854. this.$set(this.chargeItme[i], "payeeAccount", '');
  855. this.$set(this.chargeItme[i], "bankDeposit", '');
  856. this.$set(this.chargeItme[i], "accountType", '');
  857. this.$notify({ type: 'danger', message: '请选择账户类型相同的收款方!' });
  858. }else if(fuzhitype == 2){
  859. this.$set(this.chargeItme[i], "payee",'')
  860. this.$set(this.chargeItme[i], "bankType",'')
  861. this.$set(this.chargeItme[i], "payeeId", '');
  862. this.$set(this.chargeItme[i], "payeeAccount", '');
  863. this.$set(this.chargeItme[i], "bankDeposit", '');
  864. this.$set(this.chargeItme[i], "accountType", '');
  865. this.$notify({ type: 'danger', message: '收款方已存在!' });
  866. }
  867. },
  868. selectChange(select) {
  869. let obj = {};
  870. obj = this.payerOptions.find((account) => {
  871. //model就是上面的数据源
  872. return account.id === select; //筛选出匹配数据
  873. });
  874. if(obj.accountPassword != null && obj.accountPassword != "" &&
  875. obj.bankType != null && obj.bankType != ""){
  876. this.$set(this.form, "bookId", obj.bookId);
  877. this.$set(this.form, "deptId", obj.deptId);
  878. this.$set(this.form, "cashierId", obj.id);
  879. this.$set(this.form, "payer", obj.accountName);
  880. this.$set(this.form, "payerAccount", obj.bankAccountNumber);
  881. this.$set(this.form, "operatorCode", obj.operatorCode);
  882. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  883. this.$set(this.form, "bankType", obj.bankType);
  884. this.$set(this.form, "bankAccountType", obj.bankAccountType);
  885. this.$set(this.form, "villageAccountType", obj.villageAccountType);
  886. this.$set(this.form, "taccountId", obj.taccountId);
  887. this.$set(this.form, "accountNo", obj.accountNo);
  888. this.$set(this.form, "cifNo", obj.cifNo);
  889. this.$set(this.form, "payerFrom", '1');
  890. if(obj.bankType==1){
  891. this.form.accountType = "1"
  892. this.form.isPeers = null
  893. this.accountTypeChange();
  894. }else if(obj.bankType==2||obj.bankType==3){
  895. this.form.accountType = null
  896. this.form.isPeers = "Y"
  897. this.accountTypeChange1();
  898. }
  899. }else{
  900. if(obj.payerFrom==1){
  901. this.diglogStatus = false;
  902. this.$notify({ type: 'danger', message: "请完善付款方“操作员代码”、“企业编码”、“支付口令”等信息!" });
  903. this.$set(this.form,"payer","")
  904. this.$set(this.form,"payerAccount","")
  905. }else{
  906. this.$set(this.form, "payerFrom", obj.parerFrom);
  907. if(obj.operatorCode!=null&&obj.operatorCode!=''){
  908. this.$set(this.form, "operatorCode", obj.operatorCode);
  909. }else{
  910. this.$set(this.form, "operatorCode", '');
  911. }
  912. if(obj.enterpriseCode!=null&&obj.enterpriseCode!=''){
  913. this.$set(this.form, "enterpriseCode", obj.enterpriseCode);
  914. }else{
  915. this.$set(this.form, "enterpriseCode", '');
  916. }
  917. if(obj.accountPassword!=null&&obj.accountPassword!=''){
  918. this.$set(this.form, "accountPassword", obj.accountPassword);
  919. }else{
  920. this.$set(this.form, "accountPassword", '');
  921. }
  922. this.$set(this.form, "bookId",'');
  923. this.$set(this.form, "deptId", '');
  924. this.$set(this.form, "cashierId", obj.id);
  925. this.$set(this.form, "payer", obj.accountName);
  926. this.$set(this.form, "bankType", obj.bankType);
  927. if(obj.payerFrom==6){
  928. getQmyeFlow(obj.bankAccountNumber).then((response) => {
  929. this.$set(this.form, "payerAccount", response.data);
  930. });
  931. }else {
  932. this.$set(this.form, "payerAccount", obj.bankAccountNumber);
  933. }
  934. }
  935. }
  936. },
  937. beforeRead1(file) {
  938. this.uploadFiles1.push(file.file);
  939. },
  940. deleteFile1(file){
  941. this.uploadFiles1.map((response,index) => {
  942. if(file.file == response){
  943. this.uploadFiles1.splice(index,1)
  944. }
  945. })
  946. },
  947. beforeRead2(file) {
  948. this.uploadFiles2.push(file.file);
  949. },
  950. deleteFile2(file){
  951. this.uploadFiles2.map((response,index) => {
  952. if(file.file == response){
  953. this.uploadFiles2.splice(index,1)
  954. }
  955. })
  956. },
  957. beforeRead3(file) {
  958. this.uploadFiles3.push(file.file);
  959. },
  960. deleteFile3(file){
  961. this.uploadFiles3.map((response,index) => {
  962. if(file.file == response){
  963. this.uploadFiles3.splice(index,1)
  964. }
  965. })
  966. },
  967. getFileList(){
  968. let oData1= {
  969. tableId: this.$route.query.id,
  970. tableName: "t_yinnong_transfer",
  971. bizPath: "yinnong",
  972. fileType: "1",
  973. }
  974. attachmentList(oData1).then(res => {
  975. res.rows.map(r => {
  976. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  977. this.fileList1.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{})})
  978. })
  979. })
  980. let oData2= {
  981. tableId: this.$route.query.id,
  982. tableName: "t_yinnong_transfer",
  983. bizPath: "yinnong",
  984. fileType: "2",
  985. }
  986. attachmentList(oData2).then(res => {
  987. res.rows.map(r => {
  988. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  989. this.fileList2.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{})})
  990. })
  991. })
  992. let oData3= {
  993. tableId: this.$route.query.id,
  994. tableName: "t_yinnong_transfer",
  995. bizPath: "yinnong",
  996. fileType: "3",
  997. }
  998. attachmentList(oData3).then(res => {
  999. res.rows.map(r => {
  1000. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  1001. this.fileList3.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{})})
  1002. })
  1003. })
  1004. },
  1005. goBack(){
  1006. window.history.go(-1)
  1007. },
  1008. //删除家庭成员
  1009. deleteChargeItme(index){
  1010. this.chargeItme.splice(index,1)
  1011. },
  1012. },
  1013. }
  1014. </script>
  1015. <style scoped lang="scss">
  1016. .app-container {
  1017. padding: 2% 0;
  1018. }
  1019. .main_title{
  1020. font-size: 0.4rem;
  1021. color: #1D6FE9;
  1022. margin: 0.2rem 6%;
  1023. position: relative;
  1024. }
  1025. .main_box{
  1026. width: 96%;
  1027. margin: 0 auto;
  1028. border-radius: 6px;
  1029. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  1030. overflow: hidden;
  1031. background-color: #FFF;
  1032. }
  1033. .submitButton{
  1034. width: 80%;
  1035. margin: 0 auto;
  1036. background-color: #1D6FE9;
  1037. }
  1038. .addFamily{
  1039. position: absolute;
  1040. top: -2px;
  1041. right: 0;
  1042. border-radius: 50%;
  1043. }
  1044. .deleteFamily{
  1045. position: absolute;
  1046. top: 0rem;
  1047. right: 6%;
  1048. z-index: 9;
  1049. border-radius: 50%;
  1050. }
  1051. </style>