diff --git a/src/views/modules/pms/order/components/BatchDialog--edit.vue b/src/views/modules/pms/order/components/BatchDialog--edit.vue new file mode 100644 index 0000000..06173dc --- /dev/null +++ b/src/views/modules/pms/order/components/BatchDialog--edit.vue @@ -0,0 +1,108 @@ + + + + + + + diff --git a/src/views/modules/pms/order/components/BatchDialog.vue b/src/views/modules/pms/order/components/BatchDialog.vue index 267b1d0..b06b595 100644 --- a/src/views/modules/pms/order/components/BatchDialog.vue +++ b/src/views/modules/pms/order/components/BatchDialog.vue @@ -1,21 +1,48 @@ @@ -24,12 +51,12 @@ import BaseListTable from "@/components/BaseListTable.vue"; import TableTextComponent from "@/components/noTemplateComponents/detailComponent"; import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent"; import { timeFilter } from "@/utils/filters"; - +import BatchDialogEdit from "./BatchDialog--edit.vue"; // import { pick as __pick } from "@/utils/filters"; export default { name: "DialogList", - components: { BaseListTable }, + components: { BaseListTable, BatchDialogEdit }, props: { configs: { type: Object, @@ -42,8 +69,12 @@ export default { data() { return { visible: false, + editDialogVisible: false, + blenderOrderId: null, // 用来获取批次列表 loading: false, - dataForm: {}, + limit: 20, + page: 1, + total: 0, refreshLayoutKey: Math.random(), tableLoading: false, dataList: [], @@ -95,16 +126,80 @@ export default { ], }; }, + watch: { + page() { + this.getBatchList(); + }, + limit() { + this.getBatchList(); + }, + }, methods: { init(id) { this.visible = true; + console.log("[BatchDialog] init", id); + this.blenderOrderId = id; + this.getBatchList(); + }, + + /** 获取批次列表 */ + async getBatchList() { + this.tableLoading = true; + try { + const { + data: { code, data, msg }, + } = await this.$http.get("/pms/blenderBatch/pageView", { + params: { + page: this.page, + limit: this.limit, + blenderOrderId: this.blenderOrderId, + }, + }); + console.log("[BatchDialog] getBatchList", data); + if (code == 0) { + this.dataList = data.list; + this.total = data.total; + } else { + throw new Error(msg); + } + // this.dataList = data; + this.tableLoading = false; + } catch (err) { + this.$message.error("message" in err ? err.message : err); + } }, handleClose() { this.visible = false; }, - handleOperate() {}, + handleOperate({ type, data }) { + console.log("[BatchDialog] handleOperate", type, data); + switch (type) { + case "create": + this.editDialogVisible = true; + this.$nextTick(() => { + this.$refs.batchDialogEdit.init(); + }); + break; + case "查看详情": + break; + case "edit": + this.editDialogVisible = true; + this.$nextTick(() => { + this.$refs.batchDialogEdit.init(data); + }); + break; + case "delete": + break; + } + }, }, }; + + diff --git a/src/views/modules/pms/order/components/TablePagi.vue b/src/views/modules/pms/order/components/TablePagi.vue index 8c78e14..fa926cc 100644 --- a/src/views/modules/pms/order/components/TablePagi.vue +++ b/src/views/modules/pms/order/components/TablePagi.vue @@ -89,7 +89,7 @@ export default { // 查看批次 this.batchDialogVisible = true; this.$nextTick(() => { - this.$refs.batchDialog.init(); + this.$refs.batchDialog.init(id); }); break; case "detach": diff --git a/src/views/modules/pms/order/config.js b/src/views/modules/pms/order/config.js index 261e92f..86b5e7c 100644 --- a/src/views/modules/pms/order/config.js +++ b/src/views/modules/pms/order/config.js @@ -26,20 +26,20 @@ export default function () { // { name: 'confirm-order', label: '确认', icon: 'success', showText: true }, { name: "view-ongoing", label: "查看详情", icon: "view", emitFull: true }, { name: "end-order", label: "结束", icon: "finished" }, - // { name: "move-up", label: "上移", icon: "arrow-up" }, - // { name: "move-down", label: "下移", icon: "arrow-down" }, - // { name: "move-to-top", label: "至顶", icon: "upload2" }, - // { name: "move-to-bottom", label: "至底", icon: "download" }, + { name: "move-up", label: "上移", icon: "arrow-up" }, + { name: "move-down", label: "下移", icon: "arrow-down" }, + { name: "move-to-top", label: "至顶", icon: "upload2" }, + { name: "move-to-bottom", label: "至底", icon: "download" }, // { name: "destroy-order", label: "废除", icon: "close" }, ], pending: [ { name: "edit", label: "编辑", icon: "edit-outline" }, { name: "view", label: "查看详情", icon: "view" }, { name: "confirm-order", label: "确认订单", icon: "success" }, - // { name: "move-up", label: "上移", icon: "arrow-up" }, - // { name: "move-down", label: "下移", icon: "arrow-down" }, - // { name: "move-to-top", label: "至顶", icon: "upload2" }, // , showText: true }, - // { name: "move-to-bottom", label: "至底", icon: "download" }, // , showText: true }, + { name: "move-up", label: "上移", icon: "arrow-up" }, + { name: "move-down", label: "下移", icon: "arrow-down" }, + { name: "move-to-top", label: "至顶", icon: "upload2" }, // , showText: true }, + { name: "move-to-bottom", label: "至底", icon: "download" }, // , showText: true }, { name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "" }, ], finished: [