移动端
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

498 righe
17 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. <p class="main_title">基础信息</p>
  17. <div class="main_box">
  18. <van-field readonly label="申请时间" v-model="form.applyDate" input-align="right" />
  19. <van-field readonly label="资金支出类别" v-model="capitalExpenditureType" input-align="right" label-width="auto" />
  20. <van-field name="radio" label="审批模式" input-align="right" autocomplete="off" readonly>
  21. <template #input>
  22. <van-radio-group v-model="form.paymentState" direction="horizontal">
  23. <van-radio name="1">线上支付</van-radio>
  24. <van-radio name="2">线下支付</van-radio>
  25. </van-radio-group>
  26. </template>
  27. </van-field>
  28. </div>
  29. <div class="main_box" style="margin-top: 10px;">
  30. <van-field readonly label="付款事由" v-model="form.remark" type="textarea" input-align="right" rows="3" label-width="auto"/>
  31. </div>
  32. <div class="main_box" style="margin-top: 10px;">
  33. <van-field readonly label="说明情况" v-model="form.explainSituation" type="textarea" input-align="right" rows="3" label-width="auto"/>
  34. </div>
  35. <div class="main_box" v-if="capitalExpenditureOpen" style="margin-bottom: 10px;margin-top: 10px;position:relative;">
  36. <van-field readonly label="项目名称" v-model="projectForm.projectName" input-align="right" />
  37. <van-field readonly label="承建单位" v-model="projectForm.projectContractor" input-align="right" label-width="auto"/>
  38. <van-field readonly label="合同价款(元)" v-model="projectForm.projectAmount" input-align="right" label-width="auto"/>
  39. <van-field readonly label="工程款类型" v-model="projectFundType" input-align="right" />
  40. <van-field readonly label="工程发票号" v-model="projectForm.projectBillNum" input-align="right" label-width="auto"/>
  41. </div>
  42. <p class="main_title">出票方信息</p>
  43. <div class="main_box">
  44. <van-field readonly label="付款方" v-model="form.payer" input-align="right" label-width="auto"/>
  45. <van-field :rules="[{ required: true , message:'请输入汇票号码' }]" required label="汇票号码" v-model="form.payerAccount" placeholder="请输入汇票号码" input-align="right" label-width="auto"/>
  46. <van-field
  47. readonly
  48. label="出票金额(元)"
  49. v-model="form.expenditureAmount"
  50. placeholder=""
  51. input-align="right"
  52. label-width="auto"
  53. required
  54. :rules="[{ required: true , message:'出票金额不能为空!' }]"
  55. />
  56. <van-field
  57. readonly
  58. label="汇票类型"
  59. v-model="orderTypeName"
  60. placeholder=""
  61. input-align="right"
  62. label-width="auto"
  63. required
  64. :rules="[{ required: true , message:'汇票类型不能为空!' }]"
  65. />
  66. <van-field
  67. readonly
  68. label="汇票类型"
  69. v-model="form.orderType"
  70. placeholder=""
  71. input-align="right"
  72. label-width="auto"
  73. style="display: none"
  74. required
  75. :rules="[{ required: true , message:'汇票类型不能为空!' }]"
  76. />
  77. <van-field
  78. readonly
  79. label="开票日"
  80. v-model="form.startTime"
  81. placeholder=""
  82. input-align="right"
  83. label-width="auto"
  84. required
  85. :rules="[{ required: true , message:'开票日不能为空!' }]"
  86. />
  87. <van-field
  88. readonly
  89. label="到期日"
  90. v-model="form.endTime"
  91. placeholder=""
  92. input-align="right"
  93. label-width="auto"
  94. required
  95. :rules="[{ required: true , message:'到期日不能为空!' }]"
  96. />
  97. </div>
  98. <p class="main_title">收票方信息</p>
  99. <div :style="{position:'relative',padding: index == 0 ? '':'10px 0 0 0'}" v-for="(item, index) in chargeItme" :key="index">
  100. <div class="main_box" style="margin-bottom: 10px;position:relative;">
  101. <van-field readonly label="收款方" v-model="item.payee" input-align="right" />
  102. <van-field readonly label="联系方式" v-model="item.phone" input-align="right" label-width="auto"/>
  103. <van-field readonly label="所属单位" v-model="item.unit" input-align="right" label-width="auto"/>
  104. <van-field readonly label="负责人全称" v-model="item.leader" input-align="right" label-width="auto"/>
  105. <van-field readonly label="资金用途" v-model="item.remark" input-align="right" />
  106. </div>
  107. </div>
  108. <p class="main_title">上传附件</p>
  109. <div class="main_box" style="padding: 5px 0 0 8px;">
  110. <van-uploader v-model="fileList" :after-read="beforeRead" :deletable="false" disabled :upload-text="'未上传附件'"></van-uploader>
  111. </div>
  112. </div>
  113. </template>
  114. <script>
  115. import { getTransfer , queryTransferDetail , listPayee , updateTransfer , getProjectto , listProject , addProjectto , customSubmit} from "@/api/onlineHome/bankAgriculture/paymentApproval";
  116. import request from '@/utils/request'
  117. import {
  118. attachmentList,
  119. commonAttach,
  120. getCash,
  121. listCashdetailByCashId
  122. } from "../../../../api/onlineHome/bankAgriculture/paymentApproval";
  123. export default {
  124. name: "approvalDetail12",
  125. data() {
  126. return {
  127. showcapital:false,
  128. showpayee:false,
  129. showlasj:false,
  130. showbankType:false,
  131. showproject:false,
  132. showFundType:false,
  133. minDate: new Date(),
  134. maxDate: new Date(2025, 10, 1),
  135. currentDate: new Date(),
  136. form:{},
  137. fileList:[],
  138. capitalExpenditureType:'',
  139. payee:'',
  140. bankType:'',
  141. wfydlxDictionaries:[],
  142. jglxDictionaries:[],
  143. sysDictionaries:[],
  144. capitalExpenditureTypeOptions:[],
  145. bankTypeDictionaries:[],
  146. projectList:[],
  147. projectFundTypeOptions:[],
  148. projectFundTypeDictionaries:[],
  149. projectListShow:[],
  150. chargeItme:[],
  151. chargeItmeShow:[],
  152. payeeList:[],
  153. // 查询参数
  154. queryParams: {
  155. transferType:12,
  156. orderByColumn: "id",
  157. isAsc: "desc",
  158. },
  159. capitalExpenditureOpen:false,
  160. projectForm:{
  161. projectId:null,
  162. projectName:null,
  163. projectContractor:null,
  164. projectAmount:null,
  165. projectBillNum:null,
  166. projectFundType:'1',
  167. outId:null,
  168. ynType:'1'
  169. },
  170. projectFundType:'',
  171. orderTypeName:'',
  172. orderTypeOptions:[]
  173. };
  174. },
  175. created() {
  176. let queryParams={
  177. pageNum: 1,
  178. pageSize: 100,
  179. }
  180. listProject(queryParams).then(response => {
  181. console.log(response)
  182. this.projectList = response.rows;
  183. for (var i = 0; i < response.rows.length; i++) {
  184. this.projectListShow.push({text: response.rows[i].projectName, value: response.rows[i].id});
  185. }
  186. });
  187. this.getDicts("project_fund_type").then((response) => {
  188. for (var i = 0; i < response.data.length; i++) {
  189. this.projectFundTypeOptions.push({text: response.data[i].dictLabel, value: response.data[i].dictValue});
  190. }
  191. this.projectFundTypeDictionaries = response.data;
  192. });
  193. this.getDicts("order_type").then(response => {
  194. this.orderTypeOptions = response.data;
  195. });
  196. this.getDictionaries();
  197. this.getFileList();
  198. },
  199. methods: {
  200. goFlow(){
  201. window.location='approvalProcess2?id='+this.$route.query.id;
  202. },
  203. getDictionaries(){
  204. getCash(this.$route.query.id).then((response) => {
  205. this.getDicts("capital_expenditure_type").then((res) => {
  206. for (var i = 0; i < res.data.length; i++) {
  207. this.capitalExpenditureTypeOptions.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  208. }
  209. this.capitalExpenditureType = this.selectDictLabel(res.data, response.data.capitalExpenditureType);
  210. });
  211. if(response.data.capitalExpenditureType==2){
  212. this.capitalExpenditureOpen = true
  213. let param={
  214. 'outId' : response.data.id,
  215. 'ynType' : '2'
  216. }
  217. getProjectto(param).then(res => {
  218. this.projectFundType = this.selectDictLabel(this.projectFundTypeDictionaries, res.data.projectFundType);
  219. this.projectForm = res.data
  220. })
  221. }else{
  222. this.showproject = false
  223. }
  224. this.form = response.data;
  225. this.orderTypeOptions.map(res => {
  226. console.log(this.orderTypeOptions)
  227. if(res.dictValue==this.form.orderType){
  228. this.orderTypeName = res.dictLabel
  229. }
  230. })
  231. });
  232. console.log(this.$route.query.id)
  233. listCashdetailByCashId(this.$route.query.id).then((response) => {
  234. this.chargeItme = response.data;
  235. console.log(response.data)
  236. this.getPayeeList();
  237. });
  238. },
  239. addChargeItme(index){
  240. this.chargeItme.splice(index + 1, 0, {
  241. payeeId: "", //收款方ID
  242. payee: "", //收款方
  243. payeeAccount: "", //收款账户
  244. bankDeposit: "", //开户银行
  245. incomeAmount: "", //收入金额
  246. bankType: "", //所属银行
  247. });
  248. },
  249. getPayeeList() {
  250. //普通转账
  251. this.queryParams.accountType = this.form.accountType
  252. this.queryParams.status = "0"
  253. listPayee(this.queryParams).then((response) => {
  254. for (var i = 0; i < response.rows.length; i++) {
  255. this.payeeList.push({text: response.rows[i].payee, value: response.rows[i].id});
  256. }
  257. });
  258. },
  259. payeeDictLabel(datas, value) {
  260. var actions = [];
  261. Object.keys(datas).some((key) => {
  262. if (datas[key].payeeId == ('' + value)) {
  263. actions.push(datas[key].payee);
  264. return true;
  265. }
  266. })
  267. return actions.join('');
  268. },
  269. onConfirmCapital(data){
  270. console.log(data)
  271. if (data.value != 2){
  272. this.capitalExpenditureOpen = false;
  273. this.projectForm = [];
  274. }else{
  275. this.capitalExpenditureOpen = true;
  276. }
  277. this.capitalExpenditureType = data.text;
  278. this.form.capitalExpenditureType = data.value;
  279. this.showcapital = false;
  280. },
  281. onConfirmFundType(data){
  282. console.log(data)
  283. this.projectForm.projectFundType = data.value;
  284. this.projectFundType = data.text;
  285. this.showFundType = false;
  286. },
  287. onConfirmProject(data){
  288. console.log(data)
  289. this.projectList.map(res => {
  290. console.log(res)
  291. if(res.projectName==data.text){
  292. this.projectForm.projectId = res.id
  293. this.projectForm.projectName = res.projectName
  294. this.projectForm.projectContractor = res.projectContractor
  295. this.projectForm.projectAmount = res.projectAmount
  296. console.log(this.projectForm)
  297. }
  298. })
  299. this.showproject = false;
  300. },
  301. onConfirmPayee(data){
  302. // this.chargeItme[this.chargeItme.length-1].payeeText = data.text;
  303. this.chargeItme[this.chargeItme.length-1].payee = data.text;
  304. this.chargeItme[this.chargeItme.length-1].payeeId = data.value;
  305. console.log(this.chargeItme)
  306. this.showpayee = false;
  307. },
  308. onConfirmBankType(data){
  309. console.log(this.chargeItme)
  310. this.chargeItme[this.chargeItme.length-1].bankTypeText = data.text;
  311. this.chargeItme[this.chargeItme.length-1].bankType = data.value;
  312. this.showbankType = false;
  313. },
  314. onConfirmLasj(data){
  315. this.form.applyDate = this.getNowFormatDate(data).substr(0,10);
  316. this.showlasj = false;
  317. },
  318. accountTypeChange(e){
  319. console.log(e)
  320. this.payeeList = [];
  321. this.queryParams.accountType = this.form.accountType
  322. this.queryParams.status = "0"
  323. listPayee(this.queryParams).then((response) => {
  324. for (var i = 0; i < response.rows.length; i++) {
  325. this.payeeList.push({text: response.rows[i].payee, value: response.rows[i].id});
  326. }
  327. });
  328. },
  329. goAdd(){
  330. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  331. this.$toast.error("付款事由禁止包含|。");
  332. return;
  333. }
  334. if(this.form.capitalExpenditureType==2){
  335. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  336. this.$toast.error('请选择项目名称!');
  337. return;
  338. }
  339. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  340. this.$toast.error('请输入工程发票号!');
  341. return;
  342. }
  343. }
  344. this.$set(this.form, "payeeList", this.chargeItme);
  345. this.$set(this.form, "bankTypeList", this.chargeItme);
  346. this.$set(this.form, "accountTypeList", this.chargeItme);
  347. this.$set(this.form, "transferStatusList", this.chargeItme);
  348. console.log(this.form);
  349. updateTransfer(this.form).then(response => {
  350. console.log(response);
  351. this.projectForm.outId = this.form.id
  352. this.$set(this.projectForm, "ynType", '1');
  353. console.log(this.projectForm)
  354. if(this.form.capitalExpenditureType==2){
  355. addProjectto(this.projectForm).then(res => {
  356. customSubmit(this.form.id).then(res => {
  357. this.$toast.success('提交成功');
  358. setTimeout(function(){
  359. history.go(-1)
  360. },2000)
  361. })
  362. })
  363. }else{
  364. customSubmit(this.form.id).then(res => {
  365. this.$toast.success('提交成功');
  366. setTimeout(function(){
  367. history.go(-1)
  368. },2000)
  369. })
  370. }
  371. });
  372. },
  373. goUpdate(){
  374. if(this.form.remark != null && this.form.remark.indexOf("|")!=-1){
  375. this.$toast.error("付款事由禁止包含|。");
  376. return;
  377. }
  378. if(this.form.capitalExpenditureType==2){
  379. if(this.projectForm.projectName==""||this.projectForm.projectName==null){
  380. this.$toast.error('请选择项目名称!');
  381. return;
  382. }
  383. if(this.projectForm.projectBillNum==""||this.projectForm.projectBillNum==null){
  384. this.$toast.error('请输入工程发票号!');
  385. return;
  386. }
  387. }
  388. this.$set(this.form, "payeeList", this.chargeItme);
  389. this.$set(this.form, "bankTypeList", this.chargeItme);
  390. this.$set(this.form, "accountTypeList", this.chargeItme);
  391. this.$set(this.form, "transferStatusList", this.chargeItme);
  392. this.projectForm.outId = this.form.id
  393. updateTransfer(this.form).then((response) => {
  394. this.projectForm.outId = this.form.id
  395. this.$set(this.projectForm, "ynType", '1');
  396. if(this.form.capitalExpenditureType==2){
  397. addProjectto(this.projectForm).then(res => {
  398. this.$toast.success('修改成功');
  399. setTimeout(function(){
  400. history.go(-1)
  401. },2000)
  402. })
  403. }else{
  404. this.$toast.success('修改成功');
  405. setTimeout(function(){
  406. history.go(-1)
  407. },2000)
  408. }
  409. });
  410. },
  411. beforeRead(file) {
  412. this.uploadFiles.push(file.file);
  413. },
  414. deleteFile(file){
  415. this.uploadFiles.map((response,index) => {
  416. if(file.file == response){
  417. this.uploadFiles.splice(index,1)
  418. }
  419. })
  420. },
  421. getFileList(){
  422. let oData= {
  423. tableId: this.$route.query.id,
  424. tableName: "t_yinnong_cash",
  425. bizPath: "upload",
  426. fileType: "0",
  427. }
  428. attachmentList(oData).then(res => {
  429. console.log(res)
  430. console.log(location.protocol+"//"+location.host+request.defaults.baseURL)
  431. res.rows.map(r => {
  432. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  433. this.fileList.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{})})
  434. console.log(r)
  435. })
  436. })
  437. },
  438. goBack(){
  439. window.history.go(-1)
  440. },
  441. //删除家庭成员
  442. deleteChargeItme(index){
  443. this.chargeItme.splice(index,1)
  444. },
  445. },
  446. }
  447. </script>
  448. <style scoped lang="scss">
  449. .app-container {
  450. padding: 2% 0;
  451. }
  452. .main_title{
  453. font-size: 0.4rem;
  454. color: #1D6FE9;
  455. margin: 0.2rem 6%;
  456. position: relative;
  457. }
  458. .main_box{
  459. width: 96%;
  460. margin: 0 auto;
  461. border-radius: 6px;
  462. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  463. overflow: hidden;
  464. background-color: #FFF;
  465. }
  466. .submitButton{
  467. width: 80%;
  468. margin: 0 auto;
  469. background-color: #1D6FE9;
  470. }
  471. .addFamily{
  472. position: absolute;
  473. top: -2px;
  474. right: 0;
  475. border-radius: 50%;
  476. }
  477. .deleteFamily{
  478. position: absolute;
  479. top: 0rem;
  480. right: 6%;
  481. z-index: 9;
  482. border-radius: 50%;
  483. }
  484. </style>