移动端
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

approvalModify3.vue 36 KiB

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