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

approvalModify10.vue 27 KiB

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