InvitationOfficialActivities.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  1. <template>
  2. <div>
  3. <div class="communal-list">
  4. <div>
  5. <div class="communal-title">
  6. <div>邀请公务费用</div>
  7. </div>
  8. <div style="display: flex;justify-content: space-between;">
  9. <div style="width: 70%;display: flex;">
  10. <el-select style="width:300px;margin-right:10px" v-model="DiId" placeholder="团组选择" clearable filterable
  11. @change="AirTicketResSelectChange">
  12. <el-option v-for="item in AirTicketResSelectData" :key="item.id" :label="item.teamName"
  13. :value="item.id">
  14. </el-option>
  15. </el-select>
  16. <el-input style="width:400px;margin-right:10px" v-model="inviter" placeholder="请输入邀请方名称" clearable></el-input>
  17. <el-date-picker style="width:400px;margin-right:10px" v-model="InviteTime" type="daterange" align="right"
  18. unlink-panels format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至"
  19. start-placeholder="邀请开始日期" end-placeholder="邀请结束日期" :picker-options="pickerOptions">
  20. </el-date-picker>
  21. <el-button type="primary" @click="ConditionsQuery">查询</el-button>
  22. </div>
  23. <div style="width: 30%;text-align: right;">
  24. <el-button type="primary" style="margin-left: 10px;" @click="addIf">新增</el-button>
  25. </div>
  26. </div>
  27. <div style="margin:10px 0;color:#606266;">
  28. <span style="font-weight: bold;font-size:16px;">团队名称:</span>
  29. <span style="color:#606266;">{{ delegationInfo.teamName }}&nbsp;&nbsp;&nbsp;</span>
  30. <span style="font-weight: bold;font-size:16px;">客户:</span>
  31. <span style="color:#606266;">{{ delegationInfo.clientName }}&nbsp;&nbsp;&nbsp; {{
  32. }}&nbsp;&nbsp;&nbsp;</span>
  33. <span style="font-weight: bold;font-size:16px;">出访国家:</span>
  34. <span style="color:#606266;">{{ delegationInfo.visitCountry }}&nbsp;&nbsp;&nbsp;</span>
  35. <span style="font-weight: bold;font-size:16px;">起止日期:</span>
  36. <span style="color:#606266;">{{ delegationInfo.visitStartDate }}—{{ delegationInfo.visitEndDate
  37. }}&nbsp;&nbsp;&nbsp;</span>
  38. <span style="font-weight: bold;font-size:16px;">天数/人数:</span>
  39. <span style="color:#606266;">{{ delegationInfo.visitDays }}天/{{ delegationInfo.visitPNumber }}人</span>
  40. </div>
  41. </div>
  42. <template>
  43. <el-table :data="tableDatas.slice((currentPage - 1) * pageSize, currentPage * pageSize)" border
  44. style="width: 100%" v-loading="loading" element-loading-text="拼命加载中...">
  45. <el-table-column prop="num" label="序 号" width="55">
  46. <template slot-scope="scope">
  47. {{ (currentPage - 1) * pageSize + scope.$index + 1 }}
  48. </template>
  49. </el-table-column>
  50. <el-table-column prop="inviterArea" label="邀请方地区" width="120">
  51. </el-table-column>
  52. <el-table-column prop="inviter" label="邀请方" width="200">
  53. </el-table-column>
  54. <el-table-column prop="inviteTime" label="邀请时间" width="160">
  55. </el-table-column>
  56. <el-table-column prop="inviteCost,currency" label="邀请费用" width="120" sortable>
  57. <template slot-scope="scope">
  58. {{ scope.row.inviteCost|numFilter}} {{ scope.row.inviteCurrency }}
  59. </template>
  60. </el-table-column>
  61. <el-table-column prop="inviteCost,currency" label="快递费用" width="120" sortable>
  62. <template slot-scope="scope">
  63. {{ scope.row.sendCost|numFilter}} {{ scope.row.sendCurrency }}
  64. </template>
  65. </el-table-column>
  66. <el-table-column prop="inviteCost,currency" label="翻译费用" width="120" sortable>
  67. <template slot-scope="scope">
  68. {{ scope.row.translateCost|numFilter }} {{ scope.row.translateCurrency }}
  69. </template>
  70. </el-table-column>
  71. <el-table-column prop="inviteCost,currency" label="活动费" width="120" sortable>
  72. <template slot-scope="scope">
  73. {{ scope.row.eventsCost|numFilter }} {{ scope.row.eventsCurrency }}
  74. </template>
  75. </el-table-column>
  76. <el-table-column prop="inviteCost,currency" label="支付费用" width="120" sortable>
  77. <template slot-scope="scope">
  78. {{ scope.row.payMoney|numFilter }} {{ scope.row.paymentCurrency }}
  79. </template>
  80. </el-table-column>
  81. <el-table-column prop="isGoOfficaiaBussiness" label="是否到场" width="78">
  82. <template slot-scope="isGoOfficaiaBussiness">
  83. <span v-if="isGoOfficaiaBussiness.row.isGoOfficaiaBussiness == 1">是</span>
  84. <span v-else>否</span>
  85. </template>
  86. </el-table-column>
  87. <el-table-column prop="isAudit" label="是否审核" width="78">
  88. <template slot-scope="isAudit">
  89. <span v-if="isAudit.row.isAudit == 1">已通过</span>
  90. <span v-else-if="isAudit.row.isAudit == 0">未审核</span>
  91. <span v-else-if="isAudit.row.isAudit == 2">未通过</span>
  92. <span v-else>自动审核通过</span>
  93. </template>
  94. </el-table-column>
  95. <el-table-column prop="attachment" label="附件" width="200">
  96. </el-table-column>
  97. <el-table-column label="操作">
  98. <template slot-scope="scope">
  99. <el-button size="mini" @click="download(scope.$index, scope.row)"
  100. v-show="scope.row.attachment">下载附件</el-button>
  101. <el-button size="mini" @click="upDate(scope.$index, scope.row)">编辑</el-button>
  102. <el-button size="mini" type="danger" @click="del(scope.$index, scope.row)">删除</el-button>
  103. </template>
  104. </el-table-column>
  105. </el-table>
  106. </template>
  107. <div class="block" style="margin-top:15px;">
  108. <el-pagination align='center' @size-change="handleSizeChange" @current-change="handleCurrentChange"
  109. :current-page="currentPage" :page-sizes="[10, 12, 15, 20]" :page-size="pageSize"
  110. layout="total, sizes, prev, pager, next" :total="tableDatas.length">
  111. </el-pagination>
  112. </div>
  113. </div>
  114. </div>
  115. </template>
  116. <script>
  117. export default {
  118. beforeRouteLeave(to, from, next) {
  119. console.log(to)
  120. console.log(from)
  121. if(to.name!='OpInvitationOfficialActivities'){
  122. from.meta.keepAlive = false;
  123. }
  124. next()
  125. },
  126. data() {
  127. return {
  128. loading: false,
  129. tableDatas: [],
  130. tableData: [],
  131. currentPage: 1, // 当前页码
  132. pageSize: 12,// 每页的数据条数
  133. input: '',
  134. token: '',
  135. userId: 0,
  136. DiId: '',
  137. inviter: "",
  138. pickerOptions: {
  139. shortcuts: [{
  140. text: '最近一周',
  141. onClick(picker) {
  142. const end = new Date();
  143. const start = new Date();
  144. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  145. picker.$emit('pick', [start, end]);
  146. }
  147. }, {
  148. text: '最近一个月',
  149. onClick(picker) {
  150. const end = new Date();
  151. const start = new Date();
  152. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  153. picker.$emit('pick', [start, end]);
  154. }
  155. }, {
  156. text: '最近三个月',
  157. onClick(picker) {
  158. const end = new Date();
  159. const start = new Date();
  160. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  161. picker.$emit('pick', [start, end]);
  162. }
  163. }]
  164. },
  165. InviteTime: '',
  166. startInviteTime: "",
  167. endInviteTime: "",
  168. AirTicketResSelectData: [],
  169. delegationInfo: {},
  170. }
  171. },
  172. methods: {
  173. //每页条数改变时触发 选择一页显示多少行
  174. handleSizeChange(val) {
  175. this.currentPage = 1;
  176. this.pageSize = val;
  177. },
  178. //当前页改变时触发 跳转其他页
  179. handleCurrentChange(val) {
  180. this.currentPage = val;
  181. },
  182. //团组下拉框
  183. AirTicketResSelect() {
  184. var url = "/api/Groups/DecreasePaymentsSelect"
  185. var that = this
  186. this.$axios({
  187. method: 'post',
  188. url: url,
  189. headers: {
  190. Authorization: 'Bearer ' + this.token
  191. },
  192. data: {
  193. userId: that.userId,
  194. ctId: 81
  195. }
  196. }).then(function (res) {
  197. if (res.data.code == 200) {
  198. that.AirTicketResSelectData = res.data.data.groupName;
  199. that.DiId = parseInt(that.AirTicketResSelectData[0].id);
  200. that.delegationInfo = that.AirTicketResSelectData[0];
  201. that.InvitationOfficialActivities()
  202. }
  203. }).catch(function (error) {
  204. that.$message.error("网络错误,请稍后重试");
  205. });
  206. },
  207. ConditionsQuery() {
  208. if (this.InviteTime != "" && this.InviteTime != undefined && this.InviteTime != null) {
  209. this.startInviteTime = this.InviteTime[0]
  210. this.endInviteTime = this.InviteTime[1]
  211. } else {
  212. this.startInviteTime = ""
  213. this.endInviteTime = ""
  214. }
  215. this.InvitationOfficialActivities();
  216. },
  217. AirTicketResSelectChange() {
  218. if (this.DiId != 0 && this.DiId != null) {
  219. this.InvitationOfficialActivities();
  220. for (let index = 0; index < this.AirTicketResSelectData.length; index++) {
  221. if (this.AirTicketResSelectData[index].id == parseInt(this.DiId)) {
  222. this.delegationInfo = this.AirTicketResSelectData[index];
  223. break;
  224. }
  225. }
  226. }
  227. },
  228. //商邀费用信息绑定
  229. InvitationOfficialActivities() {
  230. var url = "/api/Groups/InvitationOfficialActivitiesList"
  231. var that = this
  232. this.$axios({
  233. method: 'post',
  234. url: url,
  235. headers: {
  236. Authorization: 'Bearer ' + this.token
  237. },
  238. data: {
  239. diId: that.DiId,
  240. inviter: that.inviter,
  241. startInviteTime: that.startInviteTime,
  242. endInviteTime: that.endInviteTime,
  243. pageIndex: 0,
  244. pageSize: 0
  245. }
  246. }).then(function (res) {
  247. if (res.data.code == 200) {
  248. that.tableDatas = res.data.data;
  249. that.tableData = that.tableDatas
  250. if (that.tableDatas.length != 0) {
  251. if (that.tableDatas.slice((that.currentPage - 1) * that.pageSize, that.currentPage * that.pageSize).length == 0) {
  252. if (that.currentPage > 1) {
  253. that.currentPage = that.currentPage - 1;
  254. }
  255. }
  256. }
  257. }
  258. }).catch(function (error) {
  259. that.$message.error("网络错误,请稍后重试");
  260. });
  261. },
  262. upDate(index, row) {
  263. this.$router.push({
  264. path: "/home/OpInvitationOfficialActivities",
  265. query: {
  266. DiId: this.DiId,
  267. id: row.id
  268. }
  269. })
  270. },
  271. addIf() {
  272. if (this.DiId != 0 && this.DiId != '' && this.DiId != undefined) {
  273. this.$router.push({
  274. path: "/home/OpInvitationOfficialActivities",
  275. query: {
  276. DiId: this.DiId,
  277. }
  278. })
  279. } else {
  280. this.$message('请选择团组在进行添加');
  281. }
  282. },
  283. del(index, row) {
  284. this.$confirm('此操作将删除该数据, 是否继续?', '提示', {
  285. confirmButtonText: '确定',
  286. cancelButtonText: '取消',
  287. type: 'warning'
  288. }).then(() => {
  289. var that = this
  290. this.$axios({
  291. method: 'post',
  292. url: "/api/Groups/DelInvitationOfficialActivities",
  293. headers: {
  294. Authorization: 'Bearer ' + this.token
  295. },
  296. data: {
  297. Id: row.id,
  298. DeleteUserId: this.userId
  299. }
  300. }).then(function (res) {
  301. console.log(res)
  302. if (res.data.code == 200) {
  303. that.$message({
  304. message: '删除成功',
  305. type: 'success'
  306. });
  307. that.AirTicketResSelect();
  308. } else {
  309. that.$message.error('删除失败!');
  310. }
  311. that.loading = false
  312. }).catch(function (error) {
  313. that.loading = false
  314. that.$message.error("网络错误,请稍后重试");
  315. });
  316. }).catch(() => {
  317. this.$message({
  318. type: 'info',
  319. message: '操作已取消!'
  320. });
  321. });
  322. },
  323. download(index, row) {
  324. if (row.filePath != "") {
  325. window.location.href = "http://132.232.92.186:24/Office/GrpFile/商邀相关文件/" + row.attachment
  326. } else {
  327. this.$message.error("暂未上传附件");
  328. }
  329. }
  330. },
  331. filters: {
  332. numFilter(value) {
  333. let realVal = "";
  334. if (!isNaN(value) && value !== "") {
  335. // 截取当前数据到小数点后两位,改变toFixed的值即可截取你想要的数值
  336. realVal = parseFloat(value).toFixed(2);
  337. } else {
  338. realVal = "--";
  339. }
  340. return realVal;
  341. },
  342. dataFilter(value){
  343. return value.spilt(' ')[0]
  344. }
  345. },
  346. mounted() {
  347. this.token = JSON.parse(localStorage.getItem('userinif')).token;
  348. this.userId = JSON.parse(localStorage.getItem('userinif')).userInfo.userId
  349. this.AirTicketResSelect();
  350. //this.AirTicketResList()
  351. }
  352. }
  353. </script>
  354. <style>
  355. .communal-list {
  356. background-color: #fff;
  357. padding: 10px;
  358. box-shadow: 0 0 5px #0005;
  359. border-radius: 10px;
  360. min-height: 830px;
  361. }
  362. .communal-title {
  363. display: flex;
  364. font-size: 17px;
  365. font-weight: 600;
  366. color: #555;
  367. margin-top: 8px;
  368. margin-bottom: 10px;
  369. justify-content: space-between;
  370. align-items: center;
  371. }
  372. .communal-box {
  373. display: flex;
  374. }
  375. .communal-box>button {
  376. margin-left: 10px;
  377. padding: 8px 20px;
  378. }
  379. </style>