expenseMobile.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  1. <template>
  2. <div class="expenseMobile-all">
  3. <el-dialog top="20vh" custom-class="selfDialog" width="95%" title="详情" :visible.sync="expenseMobileVisible">
  4. <div class="dialog-title">详情</div>
  5. <div class="dialog-info">
  6. <div class="dialog-info-ms">费用描述:{{dailydata.instructions}}</div>
  7. <div class="dialog-info-zj">费用总计:{{townum(dailydata.sumPrice)}}</div>
  8. <div class="dialog-info-sh">
  9. <div>财务审核:{{dailydata.fAuditDesc}}</div>
  10. <div>总经理审核:{{dailydata.mAuditDesc}}</div>
  11. <div>是否付款:{{ dailydata.isPay==1?'已付款':'未付款' }}</div>
  12. </div>
  13. </div>
  14. <div class="dialog-title">具体费用</div>
  15. <div class="dialog-list">
  16. <div v-for="(items,index) in dailydata.feeContents" :key="index" class="dialog-list-li">
  17. <div>费用项目:{{items.priceName}}</div>
  18. <div class="info-sl">
  19. <div>数量:{{items.quantity}}</div>
  20. <div>单价(CNY):{{townum(items.price)}}</div>
  21. <div>小计(CNY):{{townum(items.itemTotal)}}</div>
  22. </div>
  23. <div>备注:{{items.remark}}</div>
  24. </div>
  25. </div>
  26. </el-dialog>
  27. <div v-if="platejudgment==1">
  28. <div class="expenseMobile-top">
  29. <div class="expenseMobile-title">{{a}}日常付款申请{{b}}</div>
  30. <div class="expenseMobile-search">
  31. <el-input clearable placeholder="请输入费用描述" v-model="input" class="input-with-select">
  32. <el-button @click="searchbtn" slot="append" icon="el-icon-search"></el-button>
  33. </el-input>
  34. </div>
  35. </div>
  36. <div id="scroll-div" ref="element" class="daily-box">
  37. <div class="daily-card" v-for="(item,index) in tableData" :key="index">
  38. <div class="card-description">费用描述:{{item.instructions}}</div>
  39. <div class="card-date">申请时间:{{item.createTime}}</div>
  40. <div class="card-expense">
  41. <span>费用总计:{{townum(item.sumPrice)}}</span>
  42. <span>申请人:{{item.createUser}}</span>
  43. </div>
  44. <div class="card-btn">
  45. <el-button @click="infobtn(item)" size="mini">详情</el-button>
  46. <el-button size="mini" @click="PostDelDailyPaymentAudit(item.id,1)" type="primary">通过</el-button>
  47. <el-button size="mini" @click="PostDelDailyPaymentAudit(item.id,2)" type="danger">拒绝</el-button>
  48. </div>
  49. </div>
  50. </div>
  51. <div id="tshezi" style="padding-bottom: 65px;">
  52. <div v-if="zwgd" class="expenseMobile-zwgd">暂无更多</div>
  53. <div v-if="!zwgd" class="expenseMobile-zwgd">加载中!</div>
  54. </div>
  55. </div>
  56. <div v-else>
  57. <div class="expenseMobile-top">
  58. <div class="expenseMobile-title">费用审核</div>
  59. <div class="expenseMobile-search">
  60. <el-input clearable placeholder="请输入团组名称" v-model="value" class="input-with-select">
  61. <el-button @click="searchexamine" slot="append" icon="el-icon-search"></el-button>
  62. </el-input>
  63. </div>
  64. </div>
  65. <div id="examine-div" class="examine-box">
  66. <div v-for="(info,index) in groupData" :key="index" class="examine-card">
  67. <div class="examine-card-name">团组名称:{{info.teamName}}</div>
  68. <div class="examine-card-date">出访时间:{{cltade(info.visitDate)}}</div>
  69. <div class="examine-card-client">客户名称:{{info.clientName}}</div>
  70. <div class="examine-card-operator">
  71. <div>天数/人数:{{info.visitDays}}/{{info.visitPNumber}}</div>
  72. <div>接团操作人:{{info.jietuanOperator}}</div>
  73. </div>
  74. <div class="examine-card-btn">
  75. <el-button @click="CheckCost(info)" size="mini" type="primary">查看费用</el-button>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. <div class="expenseMobile-tabtn">
  81. <div class="tabtn-box">
  82. <div @click="rcbtn">
  83. <div v-if="platejudgment==1"><i style="font-size:22px;" class="el-icon-s-goods"></i></div>
  84. <div v-else><i style="font-size:20px;" class="el-icon-goods"></i></div>
  85. <div style="font-size:14px;">日常</div>
  86. </div>
  87. <div @click="tzbtn">
  88. <div v-if="platejudgment==2"><i style="font-size:22px;" class="el-icon-s-goods"></i></div>
  89. <div v-else><i style="font-size:20px;" class="el-icon-goods"></i></div>
  90. <div style="font-size:14px;">团组</div>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. </template>
  96. <script>
  97. export default {
  98. data () {
  99. return {
  100. tableData:[],
  101. input:'',
  102. expenseMobileVisible:false,
  103. dailydata:{},
  104. pageIndex:1,
  105. pageIndexExamine:1,
  106. loadflagExamine:false,
  107. loadflag:false,
  108. zwgd:false,
  109. platejudgment:2,
  110. value:'',
  111. groupData:[],
  112. a:0,
  113. b:0,
  114. }
  115. },
  116. methods:{
  117. //保留两位小数
  118. townum(val){
  119. val=Number(val);
  120. return val.toFixed(2);
  121. },
  122. //保留两位小数
  123. cltade(val){
  124. return val.split(" ")[0];
  125. },
  126. //翻页
  127. PageTurning(){
  128. this.pageIndex++;
  129. this.postPageDailyPaymentList();
  130. },
  131. //翻页Examine
  132. PageTurningExamine(){
  133. this.pageIndexExamine++;
  134. this.PostExpenseAuditGroupPageItems();
  135. },
  136. //获取列表
  137. postPageDailyPaymentList() {
  138. var url = "/api/Financial/PostPageSearchDailyPaymentList"
  139. var that = this
  140. this.$axios({
  141. method: 'post',
  142. url: url,
  143. headers: {
  144. Authorization: 'Bearer ' + this.token
  145. },
  146. data: {
  147. portType: 1,
  148. pageIndex: that.pageIndex,
  149. pageSize: 10,
  150. companyId: -1,
  151. financialAuditStatus: -1,//财务审核
  152. managerAuditStatus: -1, //总经理审核
  153. feeTypeId: -1, //费用类型
  154. feeSubTypeId: -1, //费用子类型
  155. feeDesc: that.input, //描述
  156. createUserId: -1, //申请人
  157. isPaySign:-1 //是否支付
  158. }
  159. }).then(function (res) {
  160. if (res.data.code == 200) {
  161. var magarr=res.data.data.dataList;
  162. if(magarr.length<10){
  163. that.zwgd=true;
  164. }
  165. for(let j=0;j<magarr.length;j++){
  166. that.tableData.push(magarr[j])
  167. }
  168. that.loadflag=true;
  169. // that.tableData = res.data.data.dataList;
  170. }
  171. })
  172. },
  173. //审核
  174. PostDelDailyPaymentAudit(val1,val2){
  175. var url = "/api/Financial/PostDelDailyPaymentAudit"
  176. var that = this
  177. this.$axios({
  178. method: 'post',
  179. url: url,
  180. headers: {
  181. Authorization: 'Bearer ' + that.token
  182. },
  183. data: {
  184. id: val1,
  185. auditType:2,
  186. auditStatus:val2
  187. }
  188. }).then(function (res) {
  189. if (res.data.code == 200) {
  190. that.$message({
  191. message: res.data.msg,
  192. type: 'success',
  193. offset:50
  194. });
  195. }else{
  196. that.$message.error(res.data.msg);
  197. }
  198. })
  199. },
  200. //详情按钮
  201. infobtn(val){
  202. this.expenseMobileVisible=true;
  203. this.dailydata={};
  204. this.getPostSearchDailyPaymentInfo(val.id);
  205. },
  206. //获取详情
  207. getPostSearchDailyPaymentInfo(val){
  208. var url = "/api/Financial/PostSearchDailyPaymentInfo"
  209. var that = this
  210. this.$axios({
  211. method: 'post',
  212. url: url,
  213. headers: {
  214. Authorization: 'Bearer ' + that.token
  215. },
  216. data: {
  217. PortType: 1,
  218. id:val
  219. }
  220. }).then(function (res) {
  221. if (res.data.code == 200) {
  222. that.dailydata=res.data.data;
  223. }
  224. })
  225. },
  226. //搜索
  227. searchbtn(){
  228. this.zwgd=false;
  229. this.pageIndex=1;
  230. this.tableData=[];
  231. this.postPageDailyPaymentList();
  232. },
  233. //搜索examine
  234. searchexamine(){
  235. this.pageIndexExamine=1;
  236. this.groupData=[];
  237. this.PostExpenseAuditGroupPageItems();
  238. localStorage.setItem("Examinevalue",this.value );
  239. },
  240. scrollBottomExamine(e) {
  241. let scrollTop=document.documentElement.scrollTop || document.body.scrollTop;
  242. let clientHeight=document.documentElement.clientHeight || document.body.clientHeight;
  243. let scrollHeight=document.documentElement.scrollHeight || document.body.scrollHeight;
  244. if (scrollTop + clientHeight == scrollHeight&&this.loadflagExamine) {
  245. this.PageTurningExamine()
  246. }
  247. },
  248. scrollBottom(e) {
  249. let scrollTop=document.documentElement.scrollTop || document.body.scrollTop;
  250. let clientHeight=document.documentElement.clientHeight || document.body.clientHeight;
  251. // let scrollHeight=document.documentElement.scrollHeight || document.body.scrollHeight;
  252. let scrollHeight=document.getElementById('scroll-div').offsetHeight;
  253. // console.log(document.getElementById("tshezi").getBoundingClientRect().top);
  254. // console.log(scrollTop);
  255. // console.log(clientHeight);
  256. this.a=document.getElementById("tshezi").getBoundingClientRect().top;
  257. this.b=clientHeight-84;
  258. if(document.getElementById("tshezi").getBoundingClientRect().top==clientHeight-84&&this.loadflag){
  259. this.PageTurning()
  260. }
  261. // if (scrollTop + clientHeight > scrollHeight+83&&this.loadflag) {
  262. // this.PageTurning()
  263. // }
  264. },
  265. //日常切换
  266. rcbtn(){
  267. this.loadflag=false;
  268. this.platejudgment=1;
  269. this.zwgd=false;
  270. this.pageIndex=1;
  271. this.tableData=[];
  272. window.addEventListener('scroll', this.scrollBottom, true);
  273. window.removeEventListener('scroll', this.scrollBottomExamine, true);
  274. this.postPageDailyPaymentList();
  275. },
  276. //tuanzhuqiehuan
  277. tzbtn(){
  278. this.loadflagExamine=false;
  279. this.platejudgment=2;
  280. this.pageIndexExamine=1;
  281. this.groupData=[];
  282. window.addEventListener('scroll', this.scrollBottomExamine, true);
  283. window.removeEventListener('scroll', this.scrollBottom, true);
  284. this.PostExpenseAuditGroupPageItems();
  285. },
  286. //费用审核列表
  287. PostExpenseAuditGroupPageItems(){
  288. var url = "/api/Groups/PostExpenseAuditGroupPageItems"
  289. var that = this
  290. this.$axios({
  291. method: 'post',
  292. url: url,
  293. headers: {
  294. Authorization: 'Bearer ' + this.token
  295. },
  296. data: {
  297. portType: 1,
  298. pageId:47,
  299. userId:21,
  300. pageIndex: that.pageIndexExamine,
  301. pageSize: 10,
  302. isSure: -1,
  303. searchCriteria: that.value,
  304. }
  305. }).then(function (res) {
  306. if (res.data.code == 200) {
  307. var groupDatas=res.data.data.data;
  308. for(let j=0;j<groupDatas.length;j++){
  309. that.groupData.push(groupDatas[j])
  310. }
  311. that.loadflagExamine=true;
  312. }
  313. })
  314. },
  315. //查看费用
  316. CheckCost(row){
  317. this.$router.push({path: '/expenseMobileinfo?id=' + row.id +''});
  318. }
  319. },
  320. watch:{
  321. },
  322. mounted(){
  323. // if(localStorage.getItem('Examinevalue')!=""){
  324. // this.value=localStorage.getItem('Examinevalue');
  325. // }
  326. // console.log(localStorage.getItem('Examinevalue'));
  327. // this.token=JSON.parse(localStorage.getItem('Examinevalue'));
  328. if(this.platejudgment==1){
  329. window.addEventListener('scroll', this.scrollBottom, true)
  330. window.removeEventListener('scroll', this.scrollBottomExamine, true)
  331. this.postPageDailyPaymentList();
  332. }else{
  333. window.addEventListener('scroll', this.scrollBottomExamine, true)
  334. window.removeEventListener('scroll', this.scrollBottom, true)
  335. this.PostExpenseAuditGroupPageItems();
  336. }
  337. },
  338. destroyed(){
  339. window.removeEventListener('scroll', this.scrollBottomExamine, true);
  340. window.removeEventListener('scroll', this.scrollBottom, true);
  341. }
  342. }
  343. </script>
  344. <style>
  345. *{
  346. margin: 0;
  347. padding: 0;
  348. }EntryDetails
  349. .expenseMobile-all{
  350. background-color: #fff;
  351. color: #555;
  352. }
  353. .expenseMobile-all .el-dialog__header{
  354. display: none;
  355. }
  356. .expenseMobile-all .el-dialog__body{
  357. padding: 10px;
  358. }
  359. .daily-box{
  360. padding: 8px;
  361. padding-top: 93px;
  362. }
  363. .examine-box{
  364. padding: 8px;
  365. padding-top: 93px;
  366. padding-bottom: 65px;
  367. }
  368. .card-description{
  369. font-weight: 600;
  370. }
  371. .daily-card{
  372. padding: 8px;
  373. box-shadow: 0 0 10px #0005;
  374. border-radius:5px ;
  375. font-size: 14px;
  376. margin-bottom: 10px;
  377. }
  378. .examine-card{
  379. padding: 8px;
  380. box-shadow: 0 0 10px #0005;
  381. border-radius:5px ;
  382. font-size: 14px;
  383. margin-bottom: 10px;
  384. }
  385. .card-date{
  386. margin: 5px 0;
  387. }
  388. .card-expense{
  389. display: flex;
  390. justify-content: space-between;
  391. }
  392. .card-btn{
  393. margin-top: 10px;
  394. text-align: right;
  395. }
  396. .expenseMobile-top{
  397. position: fixed;
  398. top: 0;
  399. background-color: #fff;
  400. width: 100%;
  401. text-align: center;
  402. border-bottom: 1px solid #ede8e8;
  403. }
  404. .expenseMobile-title{
  405. margin: 10px;
  406. margin-bottom:0px;
  407. font-size: 17px;
  408. font-weight:600 ;
  409. }
  410. .expenseMobile-search{
  411. padding: 8px;
  412. }
  413. .expenseMobile-tabtn{
  414. position: fixed;
  415. bottom: 0;
  416. background-color: #fff;
  417. width: 100%;
  418. padding: 8px;
  419. text-align: center;
  420. border-top: 1px solid #ede8e8;
  421. }
  422. .tabtn-box{
  423. display: flex;
  424. justify-content: space-around;
  425. }
  426. .tabtn-box div{
  427. width: 15%;
  428. }
  429. .tabtn-box div div{
  430. width: 100%;
  431. }
  432. .expenseMobile-all .dialog-title{
  433. font-weight: 600;
  434. margin-bottom: 10px;
  435. }
  436. .expenseMobile-all .dialog-info{
  437. margin-bottom: 10px;
  438. }
  439. .dialog-info-zj{
  440. margin: 5px 0;
  441. }
  442. .dialog-info-sh{
  443. display: flex;
  444. flex-wrap: wrap;
  445. justify-content:space-between;
  446. }
  447. .dialog-info-sh div{
  448. margin-bottom: 5px;
  449. }
  450. .info-sl{
  451. margin: 5px 0;
  452. display: flex;
  453. justify-content: space-between;
  454. flex-wrap:wrap ;
  455. }
  456. .dialog-list-li{
  457. padding: 5px 0;
  458. border-top: 1px dotted #afadad;
  459. }
  460. .dialog-list-li:last-child{
  461. border-bottom: 1px dotted #afadad;
  462. }
  463. .expenseMobile-all .dialog-list{
  464. max-height: 240px;
  465. overflow: auto;
  466. }
  467. .expenseMobile-zwgd{
  468. font-size: 14px;
  469. font-weight: 600;
  470. text-align: center;
  471. }
  472. .examine-card-operator{
  473. display: flex;
  474. justify-content: space-between;
  475. }
  476. .examine-card-btn{
  477. text-align: right;
  478. }
  479. .examine-card-date{
  480. margin: 5px 0;
  481. }
  482. .examine-card-operator{
  483. margin: 5px 0;
  484. }
  485. .examine-card-name{
  486. font-weight: 600;
  487. }
  488. </style>