Overspend.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  1. <template>
  2. <div>
  3. <div class="overspend-all">
  4. <div class="overspend-head">
  5. <div class="head-ipt">
  6. <div class="name-ipt">
  7. <label>团组名称:</label>
  8. <el-select @change="changegroup" style="width:250px" v-model="diId" filterable
  9. placeholder="请选择">
  10. <el-option v-for="item in options" :key="item.id" :label="item.teamName" :value="item.id">
  11. </el-option>
  12. </el-select>
  13. </div>
  14. <div class="preserve-btn">
  15. <el-button class="preserve" @click="ExportOverspendExcel" type="primary">超支明细表</el-button>
  16. <!-- <el-button class="preserve" @click="PostGroupExtraCost_OutputExcel" type="primary">导出超支明细</el-button> -->
  17. <el-button class="preserve" @click="addlist()" type="primary">新增数据</el-button>
  18. </div>
  19. </div>
  20. <div class="overspend-info">
  21. <div class="overspend-info-li">
  22. <label>团 号:</label>
  23. <span>{{ headtitle.tourCode }}</span>
  24. </div>
  25. <div class="overspend-info-li">
  26. <label>客 户:</label>
  27. <span>{{ headtitle.clientName }}</span>
  28. </div>
  29. <div class="overspend-info-li">
  30. <label>出访国家:</label>
  31. <span>{{ headtitle.visitCountry }}</span>
  32. </div>
  33. <div class="overspend-info-li">
  34. <label>起止日期:</label>
  35. <span>{{ headtitle.visitStartDate }} ~ {{ headtitle.visitStartDate }}</span>
  36. </div>
  37. <div class="overspend-info-li">
  38. <label>天数/人数:</label>
  39. <span>{{ headtitle.visitDays }}天/{{ headtitle.visitPNumber }}人</span>
  40. </div>
  41. </div>
  42. </div>
  43. <div>
  44. <el-table :data="tableData" border style="width: 100%">
  45. <el-table-column prop="rowNumber" label="序号" width="60">
  46. </el-table-column>
  47. <el-table-column prop="priceName" label="费用名称" width="180">
  48. </el-table-column>
  49. <el-table-column prop="priceTypeStr" label="费用类型">
  50. </el-table-column>
  51. <el-table-column prop="priceSumStr" label="费用" width="120">
  52. </el-table-column>
  53. <el-table-column prop="priceStr" label="单价" width="120">
  54. </el-table-column>
  55. <el-table-column prop="priceCount" label="数量" width="80">
  56. </el-table-column>
  57. <!-- <el-table-column prop="filePath" label="附件" width="180">
  58. </el-table-column> -->
  59. <el-table-column prop="createUserIdStr" label="操作人" width="90">
  60. </el-table-column>
  61. <el-table-column prop="priceDt" label="产生日期" width="100">
  62. </el-table-column>
  63. <el-table-column prop="supervisorConfirmStr" label="OP主管退费确认" width="100">
  64. <template slot-scope="scope">
  65. <span v-if="scope.row.supervisorConfirmStr != '已确认'">
  66. -
  67. </span>
  68. <span style="color: green;font-size:20px;" v-else>
  69. </span>
  70. </template>
  71. </el-table-column>
  72. <el-table-column prop="sYsupervisorConfirmStr" label="商邀主管退费确认" width="100">
  73. <template slot-scope="scope">
  74. <span v-if="scope.row.sYsupervisorConfirmStr != '已确认'">
  75. -
  76. </span>
  77. <span style="color: green;font-size:20px;" v-else>
  78. </span>
  79. </template>
  80. </el-table-column>
  81. <el-table-column prop="managerConfirmStr" label="经理退费确认" width="100">
  82. <template slot-scope="scope">
  83. <span v-if="scope.row.managerConfirmStr != '已确认'">
  84. -
  85. </span>
  86. <span style="color: green;font-size:20px;" v-else>
  87. </span>
  88. </template>
  89. </el-table-column>
  90. <el-table-column prop="isAuditGMStr" label="是否审核" width="100">
  91. <template slot-scope="scope">
  92. <span v-if="scope.row.isAuditGMStr != '已通过'">
  93. -
  94. </span>
  95. <span style="color: green;font-size:20px;" v-else>
  96. </span>
  97. </template>
  98. </el-table-column>
  99. <el-table-column prop="remark" label="备注" width="100">
  100. <template slot-scope="scope">
  101. <el-popover v-if="scope.row.remark != ''" placement="top" width="500" trigger="hover">
  102. {{ scope.row.remark.split('[TuT]')[0] }}
  103. <span style="color: red"> {{ scope.row.remark.split('[TuT]')[0].length > 1 ?
  104. scope.row.remark.split('[TuT]')[1] : ''
  105. }} </span>
  106. <span
  107. style="display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;cursor: pointer;color: #48a2ff;"
  108. slot="reference">查看</span>
  109. </el-popover>
  110. <span v-else>{{ scope.row.remark | filter_emptyAcquiesce }}</span>
  111. </template>
  112. </el-table-column>
  113. <el-table-column prop="address" label="操作">
  114. <template slot-scope="scope">
  115. <el-button @click.native.prevent="revisionbtn(scope.$index, scope.row, tableData)"
  116. type="primary" size="small">
  117. 编 辑
  118. </el-button>
  119. <el-button type="danger"
  120. @click.native.prevent="deleteRow(scope.$index, scope.row, tableData)" size="small">
  121. 删 除
  122. </el-button>
  123. <div v-if="priceNameExists.some(element => scope.row.priceName.includes(element))">
  124. <br />
  125. <el-button v-show="existsUser() == 2"
  126. @click.native.prevent="changeStatus(2, scope.row.id)" type="primary" size="small">
  127. OP主管退费确认
  128. </el-button>
  129. <el-button v-show="existsUser() == 3"
  130. @click.native.prevent="changeStatus(3, scope.row.id)" type="primary" size="small">
  131. 商邀主管退费确认
  132. </el-button>
  133. <el-button v-show="existsUser() == 1"
  134. @click.native.prevent="changeStatus(1, scope.row.id)" type="primary" size="small">
  135. 经理退费确认
  136. </el-button>
  137. </div>
  138. </template>
  139. </el-table-column>
  140. </el-table>
  141. <div v-if="dataCount >= 10" class="block" style="margin-top: 15px;">
  142. <el-pagination align='center' @size-change="handleSizeChange" @current-change="handleCurrentChange"
  143. :current-page="pageIndex" :page-sizes="[10, 12, 15, 20]" :page-size="pageSize"
  144. layout="total, sizes, prev, pager, next, jumper" :total="dataCount">
  145. </el-pagination>
  146. </div>
  147. </div>
  148. </div>
  149. </div>
  150. </template>
  151. <script>
  152. export default {
  153. data() {
  154. return {
  155. pageId: '',
  156. token: '',
  157. userId: '',
  158. pageIndex: 1,
  159. pageSize: 10,
  160. dataCount: 0,
  161. gname: '',
  162. cTable: '',
  163. DiId: 0,
  164. diId: 0,
  165. tableData: [],
  166. options: [],
  167. headtitle: {},
  168. priceNameExists: [
  169. '退餐费(地接导入)',
  170. '车超时费用(地接导入)',
  171. '酒店超支费用-酒店导入'
  172. ]
  173. }
  174. },
  175. methods: {
  176. //每页条数改变时触发 选择一页显示多少行
  177. handleSizeChange(val) {
  178. this.pageIndex = 1;
  179. this.pageSize = val;
  180. this.PostGroupExtraCost_Search()
  181. },
  182. //当前页改变时触发 跳转其他页
  183. handleCurrentChange(val) {
  184. this.pageIndex = val;
  185. this.PostGroupExtraCost_Search()
  186. },
  187. //获取CTable
  188. PostPageLinkCTable() {
  189. var url = "/api/Business/PostPageLinkCTable"
  190. var that = this
  191. this.$axios({
  192. method: 'post',
  193. url: url,
  194. headers: {
  195. Authorization: 'Bearer ' + that.userId
  196. },
  197. data: {
  198. pageId: that.pageId,
  199. }
  200. }).then(function (res) {
  201. if (res.data.code == 200) {
  202. that.cTable = res.data.data.cTable;
  203. //调用可操作的团
  204. that.PostGroupListByCTableAndUserId();
  205. } else {
  206. that.$message({
  207. message: res.data.msg,
  208. type: 'warning',
  209. });
  210. }
  211. })
  212. },
  213. //获取头部描述
  214. getheadtitle() {
  215. for (let i = 0; i < this.options.length; i++) {
  216. if (this.diId == this.options[i].id) {
  217. this.headtitle = this.options[i]
  218. }
  219. }
  220. },
  221. //切换数组
  222. changegroup() {
  223. //调用getheadtitle
  224. this.getheadtitle();
  225. //调用获取超支列表
  226. this.PostGroupExtraCost_Search();
  227. },
  228. //获取可操作的团
  229. PostGroupListByCTableAndUserId() {
  230. var url = "/api/Business/PostGroupListByCTableAndUserId"
  231. var that = this
  232. this.$axios({
  233. method: 'post',
  234. url: url,
  235. headers: {
  236. Authorization: 'Bearer ' + that.userId
  237. },
  238. data: {
  239. portType: 1,
  240. pageIndex: 1,
  241. pageSize: 100000,
  242. cTable: that.cTable,
  243. userId: that.userId
  244. }
  245. }).then(function (res) {
  246. if (res.data.code == 200) {
  247. that.options = res.data.data;
  248. if (that.diId == 0) {
  249. if (that.DiId != that.DiId) {
  250. that.diId = that.options[0].id;
  251. } else {
  252. that.diId = that.DiId;
  253. }
  254. }
  255. //调用getheadtitle
  256. that.getheadtitle();
  257. //调用获取超支列表
  258. that.PostGroupExtraCost_Search();
  259. } else {
  260. that.$message({
  261. message: res.data.msg,
  262. type: 'warning',
  263. });
  264. }
  265. })
  266. },
  267. //获取超支列表
  268. PostGroupExtraCost_Search() {
  269. var url = "/api/Financial/PostGroupExtraCost_Search"
  270. var that = this
  271. this.$axios({
  272. method: 'post',
  273. url: url,
  274. headers: {
  275. Authorization: 'Bearer ' + that.userId
  276. },
  277. data: {
  278. portType: 1,
  279. pageIndex: that.pageIndex,
  280. pageSize: that.pageSize,
  281. diId: that.diId,
  282. }
  283. }).then(function (res) {
  284. if (res.data.code == 200) {
  285. that.dataCount = res.data.data.dataCount
  286. that.tableData = res.data.data.dataList;
  287. } else {
  288. that.$message({
  289. message: res.data.msg,
  290. type: 'warning',
  291. });
  292. }
  293. })
  294. },
  295. //新增
  296. addlist() {
  297. this.$router.push({
  298. path: "/home/Overspendedit",
  299. query: {
  300. DiId: this.diId,
  301. }
  302. })
  303. },
  304. //删除
  305. deleteRow(index, row, rows) {
  306. this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
  307. confirmButtonText: '确定',
  308. cancelButtonText: '取消',
  309. type: 'warning'
  310. }).then(() => {
  311. this.PostGroupExtraCost_Operator(row.id);
  312. }).catch(() => {
  313. this.$message({
  314. type: 'info',
  315. message: '已取消删除'
  316. });
  317. });
  318. // rows.splice(index, 1);
  319. },
  320. //生成
  321. PostGroupExtraCost_OutputExcel() {
  322. var url = "/api/Financial/PostGroupExtraCost_OutputExcel"
  323. var that = this
  324. this.$axios({
  325. method: 'post',
  326. url: url,
  327. headers: {
  328. Authorization: 'Bearer ' + that.token
  329. },
  330. data: {
  331. portType: 1,
  332. diId: that.diId
  333. }
  334. }).then(function (res) {
  335. console.log(res)
  336. if (res.data.code == 200) {
  337. window.open(res.data.data.url)
  338. } else {
  339. that.$message({
  340. message: res.data.msg,
  341. type: 'warning',
  342. });
  343. }
  344. })
  345. },
  346. //生成2
  347. ExportOverspendExcel() {
  348. var url = "/api/Financial/ExportOverspendExcel"
  349. var that = this
  350. this.$axios({
  351. method: 'post',
  352. url: url,
  353. headers: {
  354. Authorization: 'Bearer ' + that.token
  355. },
  356. data: {
  357. portType: 1,
  358. diId: that.diId
  359. }
  360. }).then(function (res) {
  361. console.log(res)
  362. if (res.data.code == 200) {
  363. window.open(res.data.data.url)
  364. } else {
  365. that.$message({
  366. message: res.data.msg,
  367. type: 'warning',
  368. });
  369. }
  370. })
  371. },
  372. //超支费用api
  373. PostGroupExtraCost_Operator(id) {
  374. var url = "/api/Financial/PostGroupExtraCost_Operator"
  375. var that = this
  376. this.$axios({
  377. method: 'post',
  378. url: url,
  379. headers: {
  380. Authorization: 'Bearer ' + that.userId
  381. },
  382. data: {
  383. portType: 1,
  384. editType: 3,
  385. id: id,
  386. diId: that.diId,
  387. priceName: '',
  388. price: 0,
  389. priceType: 0,
  390. priceDetailType: 0,
  391. coefficient: 0,
  392. currency: 0,
  393. payee: '',
  394. costSign: 0,
  395. payType: 0,
  396. payCardId: 0,
  397. filePath: '',
  398. remark: '',
  399. createUser: that.userId,
  400. priceDt: '',
  401. priceCount: 0
  402. }
  403. }).then(function (res) {
  404. if (res.data.code == 200) {
  405. that.$message({
  406. message: res.data.msg,
  407. type: 'success'
  408. });
  409. that.PostGroupExtraCost_Search()
  410. } else {
  411. that.$message({
  412. message: res.data.msg,
  413. type: 'warning',
  414. });
  415. }
  416. })
  417. },
  418. //编辑
  419. revisionbtn(index, row, rows) {
  420. this.$router.push({
  421. path: "/home/Overspendedit",
  422. query: {
  423. DiId: this.diId,
  424. Id: row.id
  425. }
  426. })
  427. },
  428. existsUser() {
  429. var userid = this.userId;
  430. // 王鸽商邀主管 朱琳OP主管 刘淇经理
  431. var jinli = [330];
  432. var zhuguan = [334];
  433. var syzhuguan = [149];
  434. jinli.push(235);
  435. var biaoshi = -1;
  436. if (userid) {
  437. if (jinli.indexOf(userid) != -1) {
  438. biaoshi = 1;
  439. } else if (zhuguan.indexOf(userid) != -1) {
  440. biaoshi = 2;
  441. } else if (syzhuguan.indexOf(userid) != -1) {
  442. biaoshi = 3;
  443. }
  444. }
  445. return biaoshi;
  446. },
  447. changeStatus(status, id) {
  448. var url = "/api/Financial/ReturnPremiumConfirm"
  449. var that = this
  450. this.$axios({
  451. method: 'post',
  452. url: url,
  453. headers: {
  454. Authorization: 'Bearer ' + that.token
  455. },
  456. data: {
  457. DataId: id,
  458. ConfirmId: status,
  459. status: 1
  460. }
  461. }).then(function (res) {
  462. if (res.data.code == 200) {
  463. that.$message.success("操作成功!");
  464. //调用获取CTable
  465. that.PostPageLinkCTable();
  466. //调用获取超支列表
  467. that.PostGroupExtraCost_Search();
  468. } else {
  469. that.$message({
  470. message: res.data.msg,
  471. type: 'warning',
  472. });
  473. }
  474. })
  475. }
  476. },
  477. mounted() {
  478. this.DiId = Number(this.$route.query.DiId);
  479. this.pageId = localStorage.getItem('indexs').split('-')[1];
  480. this.token = JSON.parse(localStorage.getItem('userinif')).token;
  481. this.userId = JSON.parse(localStorage.getItem('userinif')).userInfo.userId;
  482. //调用获取CTable
  483. this.PostPageLinkCTable();
  484. //调用获取超支列表
  485. this.PostGroupExtraCost_Search();
  486. },
  487. filters: {
  488. //空默认值
  489. filter_emptyAcquiesce(value) {
  490. let fhz = value == "" ? "-" : value
  491. return fhz
  492. },
  493. },
  494. }
  495. </script>
  496. <style>
  497. .overspend-all {
  498. background-color: #fff;
  499. padding: 10px;
  500. box-shadow: 0 0 5px #0005;
  501. border-radius: 10px;
  502. height: 100%;
  503. min-height: 830px;
  504. }
  505. .overspend-info {
  506. display: flex;
  507. }
  508. .overspend-info-li {
  509. margin-right: 30px;
  510. }
  511. .overspend-info-li label {
  512. color: #606266;
  513. font-size: 15px;
  514. font-weight: 600;
  515. }
  516. .overspend-info-li span {
  517. color: #606266;
  518. font-size: 14px;
  519. }
  520. .name-ipt label {
  521. color: #606266;
  522. font-size: 15px;
  523. font-weight: 600;
  524. }
  525. .head-ipt {
  526. display: flex;
  527. justify-content: space-between;
  528. margin-bottom: 10px;
  529. }
  530. .overspend-head {
  531. margin-bottom: 10px;
  532. }
  533. </style>