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

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