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

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