index.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <template>
  2. <div class="app-container">
  3. <el-row :gutter="10" class="mb8">
  4. <right-toolbar :showSearch.sync="showSearch" :search="false" @queryTable="getList"></right-toolbar>
  5. </el-row>
  6. <el-table ref="tables" v-loading="loading" :data="dataList" border>
  7. <el-table-column label="序号" align="center" type="index" width="50"></el-table-column>
  8. <el-table-column label="演出厅" align="center" prop="performHallName" />
  9. <el-table-column label="剧目名称" align="center" prop="performName" />
  10. <el-table-column label="商品名称" align="center" prop="goodsName" />
  11. <el-table-column label="场次信息" align="center" prop="goodsName1">
  12. <template slot-scope="scope">
  13. <span>{{ scope.row.times }}</span>
  14. </template>
  15. </el-table-column>
  16. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  17. <template slot-scope="scope">
  18. <span v-hasPermi="['otaMr:ctrip:push']" style="display: inline-block;">
  19. <el-button
  20. size="mini"
  21. type="text"
  22. style="margin-right: 10px;"
  23. @click="handlePush(scope.row,scope.index)"
  24. >{{ (scope.row.status == -1 || !scope.row.status) ? '上线' : '下线' }}</el-button>
  25. </span>
  26. <span v-hasPermi="['otaMr:ctrip:time']" style="display: inline-block;margin-right: 10px;">
  27. <el-button
  28. size="mini"
  29. type="text"
  30. style="margin-left: 10px;"
  31. @click="handleUpdate(scope.row,'yesPush')"
  32. >价格日历</el-button>
  33. </span>
  34. <el-button
  35. size="mini"
  36. type="text"
  37. @click="handleUpdate(scope.row,scope.index,'noPush')"
  38. v-hasPermi="['otaMr:ctrip:scheduling']"
  39. >排期推送</el-button>
  40. </template>
  41. </el-table-column>
  42. </el-table>
  43. <pagination
  44. v-show="total>0"
  45. :total="total"
  46. :page.sync="queryParams.pageNum"
  47. :limit.sync="queryParams.pageSize"
  48. @pagination="getList"
  49. />
  50. <!-- 编辑商品弹框 -->
  51. <data-edit
  52. ref="dataEdit"
  53. @getList="getList"
  54. :dict="dict"></data-edit>
  55. </div>
  56. </template>
  57. <script>
  58. import { pageList, updateById,stockUpdateById } from '@/api/otaMr/ctrip'
  59. import dataEdit from "./dialog/dataEdit.vue";
  60. export default {
  61. name: "Ctrip",
  62. dicts: ['tiktok_process','tiktok_online','tiktok_category'],
  63. components: { dataEdit },
  64. data() {
  65. return {
  66. // 遮罩层
  67. loading: true,
  68. otaLoading: false,
  69. // 选中数组
  70. ids: [],
  71. // 非单个禁用
  72. single: true,
  73. // 非多个禁用
  74. multiple: true,
  75. // 显示搜索条件
  76. showSearch: true,
  77. // 总条数
  78. total: 0,
  79. // 用户表格数据
  80. dataList: null,
  81. // 弹出层标题
  82. title: "",
  83. otaType: '1',
  84. // 是否显示弹出层
  85. open: false,
  86. // 日期范围
  87. dateRange: [],
  88. // 查询参数
  89. queryParams: {
  90. pageNum: 1,
  91. pageSize: 10,
  92. },
  93. visibleStatus: false,
  94. newObj: {},
  95. visibleType: '',
  96. otaForm: {},
  97. otaRules: {
  98. name: [{ required: true, message: "请输入供应商id", trigger: ["change","blur"] }],
  99. otaKey: [{ required: true, message: "请输入client id", trigger: ["change","blur"] }],
  100. otaValue: [{ required: true, message: "请输入client secret", trigger: ["change","blur"] }]
  101. },
  102. };
  103. },
  104. created() {
  105. this.getList();
  106. },
  107. methods: {
  108. /** 查询列表 */
  109. getList() {
  110. this.loading = true;
  111. pageList(this.addDateRange(this.queryParams, this.dateRange))
  112. .then(response => {
  113. this.dataList = response.data.rows;
  114. this.total = response.data.total?Number(response.data.total):0;
  115. this.loading = false;
  116. }
  117. ).catch(()=>{
  118. this.dataList = []
  119. this.total = 0;
  120. this.loading = false;
  121. })
  122. },
  123. // 取消按钮
  124. cancel() {
  125. this.open = false;
  126. },
  127. /** 搜索按钮操作 */
  128. handleQuery() {
  129. this.queryParams.pageNum = 1;
  130. this.getList();
  131. },
  132. /** 重置按钮操作 */
  133. resetQuery() {
  134. this.dateRange = [];
  135. this.dataList = [];
  136. this.queryParams.pageNum = 1;
  137. this.handleQuery();
  138. },
  139. /** 修改按钮操作 */
  140. handleUpdate(row,type) {
  141. this.$refs["dataEdit"].openDialog("修改数据", row, type);
  142. },
  143. /** 删除按钮操作 */
  144. handleDelete(row) {
  145. this.$modal.confirm('是否确认删除商品名称为"' + row.goodsName + '"的数据项?').then(function() {
  146. return deleteById(row.id);
  147. }).then(() => {
  148. this.getList();
  149. this.$modal.msgSuccess("删除成功");
  150. }).catch(() => {});
  151. },
  152. /** 推送 */
  153. handlePush(row) {
  154. this.$modal.confirm(`是否确认${ row.status == 1 ? '下线': '上线'}此商品吗?`).then(function() {
  155. return updateById({
  156. id: row.id,
  157. status: row.status == 1 ? 0 : 1
  158. });
  159. }).then(() => {
  160. this.$modal.msgSuccess(`${ row.status == 1 ? '下线': '上线' }成功`);
  161. this.getList();
  162. }).catch(() => {
  163. });
  164. },
  165. }
  166. };
  167. </script>