perFormListBox.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <template>
  2. <el-dialog :title="title" :visible.sync="open" width="90%" class="text-dia-log-class" append-to-body center
  3. :close-on-click-modal="false" @close="cancel">
  4. <div class="dialog">
  5. <div style="padding-bottom: 10px;">
  6. <el-button type="primary" v-hasPermi="['ticketMr:schedulingConfiguration:add']" @click="handleAdd('ADD')">新增</el-button>
  7. </div>
  8. <el-table ref="tables" v-loading="loading" :data="timeList" border>
  9. <el-table-column label="序号" align="center" type="index" />
  10. <el-table-column label="编号ID" align="center" prop="planNo" />
  11. <el-table-column label="日期范围" align="center" prop="dateStart">
  12. <template slot-scope="scope">
  13. {{ moment(scope.row.dateStart).format('YYYY年MM月DD日') }} - {{ moment(scope.row.dateEnd).format('YYYY年MM月DD日') }}
  14. </template>
  15. </el-table-column>
  16. <el-table-column label="星期" align="center" prop="weekDay">
  17. <template slot-scope="scope">
  18. <div v-if="scope.row.weekDay">
  19. <span :key="item" v-for="(item,index) in scope.row.weekDay.split(',')">{{ weekList[item] }}{{ index == scope.row.weekDay.split(',').length-1?'':', '}}</span>
  20. </div>
  21. </template>
  22. </el-table-column>
  23. <el-table-column label="票务" align="center" prop="goodsNames" />
  24. <el-table-column label="场次信息" align="center" prop="planSessionList">
  25. <template slot-scope="scope">
  26. <div v-if="scope.row.planSessionList">
  27. <span
  28. v-for="(item,index) in scope.row.planSessionList"
  29. :key="index"
  30. style="margin-right: 10px;"
  31. >{{ item.startInterval }} - {{ item.endInterval }}</span>
  32. </div>
  33. </template>
  34. </el-table-column>
  35. <el-table-column label="最后修改时间" align="center" prop="updateTime" />
  36. <el-table-column label="最后修改人" align="center" prop="updateBy" />
  37. <el-table-column label="操作" align="center" prop="name">
  38. <template slot-scope="scope">
  39. <el-button
  40. size="mini"
  41. type="text"
  42. @click="copyAdd(scope.row)"
  43. v-hasPermi="['ticketMr:schedulingConfiguration:add']"
  44. >复制</el-button>
  45. <el-button
  46. size="mini"
  47. type="text"
  48. style="margin-left: 10px;"
  49. @click="deleteFun(scope.row)"
  50. v-hasPermi="['ticketMr:schedulingConfiguration:delect']"
  51. >删除</el-button>
  52. </template>
  53. </el-table-column>
  54. </el-table>
  55. </div>
  56. <span slot="footer" class="dialog-footer">
  57. <pagination
  58. v-show="total>0"
  59. :total="total"
  60. :page.sync="queryParams.pageNum"
  61. :limit.sync="queryParams.pageSize"
  62. @pagination="getPerformTimeByIdFun"
  63. />
  64. </span>
  65. <!-- 新增/编辑弹框 -->
  66. <add-and-edit
  67. ref="addAndEdit"
  68. @getList="getPerformTimeByIdFun"
  69. />
  70. </el-dialog>
  71. </template>
  72. <script>
  73. import { deleteById,pageList, getPerformTimeById } from "@/api/ticketMr/schedulingConfiguration";
  74. import addAndEdit from "./addAndEdit";
  75. import moment from "moment"
  76. export default {
  77. name: "PerFormListBox",
  78. components: { addAndEdit },
  79. data() {
  80. return {
  81. title: "编辑",
  82. model: "EDIT",
  83. open: false,
  84. loading: false,
  85. timeList: [],
  86. weekList: ["","星期一","星期二","星期三","星期四","星期五","星期六","星期天"],
  87. form: {
  88. id: undefined,
  89. timeList: [],
  90. insertType: '1',
  91. useStock: 0
  92. },
  93. radio1: 1,
  94. total: 0,
  95. queryParams: {
  96. pageNum: 1,
  97. pageSize: 10,
  98. },
  99. };
  100. },
  101. methods: {
  102. moment,
  103. /**
  104. * 打开弹框
  105. * @date 2023-11-22
  106. * @param {any} obj
  107. * @returns {any}
  108. */
  109. async openDialog(title, obj, type) {
  110. this.open = true;
  111. this.title = title
  112. this.form = {}
  113. this.queryParams.pageNum = 1
  114. this.getPerformTimeByIdFun()
  115. },
  116. /** 票务信息 */
  117. async getPerformTimeByIdFun() {
  118. try {
  119. this.loading = true
  120. let res = await pageList({
  121. ...this.queryParams
  122. })
  123. if (res.code == 200) {
  124. this.timeList = res.data.rows
  125. this.total = res.data.total
  126. }
  127. this.loading = false
  128. } catch (error) {
  129. this.loading = false
  130. console.error("error====", error)
  131. }
  132. },
  133. /** 新增按钮操作 */
  134. handleAdd(type) {
  135. this.$refs["addAndEdit"].openDialog("新增数据", null, type);
  136. },
  137. /** 复刻 */
  138. copyAdd(row) {
  139. this.$refs["addAndEdit"].openDialog("新增数据", row, "ADD");
  140. },
  141. /**
  142. * 保存
  143. * @date 2023-11-22
  144. * @returns {any}
  145. */
  146. async submitForm() {
  147. try {
  148. this.loading = true
  149. let res = await releaseById({
  150. id: this.form.id,
  151. status: this.form.status == 1 ? 2 : 1
  152. })
  153. if (res.code == 200) {
  154. this.$message.success("操作成功!");
  155. this.$emit("getList")
  156. this.cancel()
  157. }
  158. this.loading = false
  159. } catch (error) {
  160. console.error("error===", error)
  161. this.loading = false
  162. }
  163. },
  164. /**
  165. * 关闭弹框
  166. * @date 2023-11-22
  167. * @returns {any}
  168. */
  169. cancel() {
  170. this.$emit("getList")
  171. this.open = false;
  172. },
  173. deleteFun(row){
  174. this.$modal.confirm(`您确定要删除此次排期计划吗?`).then(()=> {
  175. this.handleDelete(row)
  176. }).catch(() => {});
  177. },
  178. /** 删除 */
  179. async handleDelete(row) {
  180. try {
  181. this.loading = true
  182. let res = await deleteById({
  183. id: row.id
  184. })
  185. if (res.code == 200) {
  186. this.$message.success("删除成功");
  187. this.getPerformTimeByIdFun()
  188. }
  189. this.loading = false
  190. } catch (error) {
  191. this.loading = false
  192. console.error("error====", error)
  193. }
  194. },
  195. openDetails() {
  196. }
  197. },
  198. };
  199. </script>
  200. <style lang="scss" scoped>
  201. .dialog {
  202. height: 65vh;
  203. overflow-y: auto;
  204. .upload-btn {
  205. width: 100px;
  206. height: 100px;
  207. background-color: #fbfdff;
  208. border: dashed 1px #c0ccda;
  209. border-radius: 5px;
  210. i {
  211. font-size: 30px;
  212. margin-top: 20px;
  213. }
  214. &-text {
  215. margin-top: -10px;
  216. }
  217. }
  218. .avatar {
  219. cursor: pointer;
  220. }
  221. }
  222. </style>