update 更新订单

This commit is contained in:
lb 2023-07-10 16:11:23 +08:00
parent 7f3634e0c1
commit bfd5f31a24
4 changed files with 176 additions and 10 deletions

View File

@ -129,7 +129,7 @@ export default {
},
methods: {
handleSubEmitData(payload) {
console.log("[component] BaseListTable handleSubEmitData(): ", payload);
// console.log("[component] BaseListTable handleSubEmitData(): ", payload);
this.$emit("operate-event", payload);
},
loadSubClassFn(tree, treeNode, resolve) {

View File

@ -0,0 +1,107 @@
<template>
<el-dialog
class="dialog-just-form"
:fullscreen="fullscreen"
:title="查看批次"
:visible="visible"
@close="handleClose"
:destroy-on-close="false"
:close-on-click-modal="configs.clickModalToClose ?? false"></el-dialog>
</template>
<script>
import { pick as __pick } from "@/utils/filters";
export default {
name: "DialogList",
components: {},
props: {
configs: {
type: Object,
default: () => ({
clickModalToClose: false,
forms: null,
}),
},
},
data() {
return {
loadingStatus: false,
dataForm,
watchList,
cachedList,
detailMode: false,
baseDialogConfig: null,
visible: false,
};
},
methods: {
/** init **/
init(id, detailMode) {
this.visible = true;
// console.log("[DialogJustForm] init", this.dataForm, id, detailMode);
if (this.$refs.dataForm) {
// console.log("[DialogJustForm] clearing form validation...");
// dialog dataForm [0]
this.$refs.dataForm.clearValidate();
}
this.detailMode = detailMode ?? false;
this.$nextTick(() => {
this.dataForm.id = id || null;
if (this.dataForm.id) {
//
this.loadingStatus = true;
//
this.$http
.get(this.urls.base + `/${this.dataForm.id}`)
.then(({ data: res }) => {
if (res && res.code === 0) {
this.dataForm = __pick(res.data, Object.keys(this.dataForm));
/** 格式化文件上传列表 */
if (Array.isArray(this.dataForm.files)) {
this.dataForm.files = this.dataForm.files.map((file) => ({
id: file.id,
name: file.fileUrl.split("/").pop(),
typeCode: file.typeCode,
url: file.fileUrl,
}));
}
// console.log("[DialogJustForm] init():", this.dataForm);
} else {
this.$message({
message: `${res.code}: ${res.msg}`,
type: "error",
duration: 1500,
});
}
this.loadingStatus = false;
})
.catch((err) => {
this.loadingStatus = false;
this.$message({
message: `${err}`,
type: "error",
duration: 1500,
});
});
} else {
//
this.loadingStatus = false;
}
});
},
handleClose() {
this.visible = false;
setTimeout(() => {
this.$emit("destroy-dialog");
// this.resetForm();
// this.$emit("update:dialogVisible", false);
}, 200);
},
},
};
</script>

View File

@ -7,8 +7,7 @@
:column-config="tableConfig.column"
:table-data="dataList"
@operate-event="handleOperate"
:refresh-layout-key="refreshLayoutKey"
/>
:refresh-layout-key="refreshLayoutKey" />
<el-pagination
@size-change="handleSizeChange"
@ -17,17 +16,23 @@
:page-sizes="[1, 5, 10, 20]"
:page-size="listQuery.limit"
:total="totalPage"
layout="total, prev, pager, next, jumper"
></el-pagination>
layout="total, prev, pager, next, jumper"></el-pagination>
<!-- 编辑弹窗 -->
<DialogJustForm ref="vdialog" v-if="false" />
<!-- 批次弹窗 -->
<DialogList ref="dialogList" :configs="{}" />
</div>
</template>
<script>
import BaseListTable from "./BaseListTable.vue";
import DialogJustForm from "./DialogJustForm.vue";
import DialogList from "./DialogList.vue";
export default {
name: "TablePaginationComp",
components: { BaseListTable },
components: { BaseListTable, DialogJustForm, DialogList },
props: {
tableConfig: {
type: Object,
@ -65,8 +70,55 @@ export default {
this.getAList();
},
methods: {
handleOperate({ type, data }) {
console.log("payload", type, data);
handleOperate({ type, data: id }) {
console.log("payload", type, id);
switch (type) {
case "edit":
//
this.$refs.vdialog.init(id);
console.log("编辑");
break;
case "view-batch":
//
console.log("查看批次");
break;
case "detach":
//
return this.$confirm("是否下发?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
console.log("here");
this.$http
.post(this.urls.detach, id /* { id: data } */, { headers: { "Content-Type": "application/json" } })
.then(({ data: res }) => {
if (res.code === 0) {
this.$message({
message: "下发成功",
type: "success",
duration: 1500,
onClose: () => {
this.getAList();
},
});
} else {
this.$message({
message: `${res.code}: ${res.msg}`,
type: "error",
duration: 1500,
});
}
});
})
.catch(() => {
this.$message({
type: "warning",
message: "已取消下发",
});
});
}
},
handleSizeChange(newSize) {

View File

@ -4,7 +4,7 @@
<el-col style="margin-bottom: 12px">
<!-- 混料订单 -->
<TablePagi v-if="order !== null" :extra-query-fields="{ code: order.code, cate: order.cate }"
:urls="{ page: '/pms/blenderOrder/pageView' }" :page-is-post="true" :table-config="{
:urls="{ page: '/pms/blenderOrder/pageView', detach: '/pms/trans/blenderDeli' }" :page-is-post="true" :table-config="{
table: null,
column: blenderTableProps,
}" />
@ -12,7 +12,7 @@
<el-col style="margin-bottom: 12px">
<!-- 压制订单 -->
<TablePagi v-if="order !== null" :extra-query-fields="{ code: order.code, cate: order.cate }"
:urls="{ page: '/pms/pressOrder/pageView' }" :page-is-post="true" :table-config="{
:urls="{ page: '/pms/pressOrder/pageView', detach: '/pms/trans/pressDeli' }" :page-is-post="true" :table-config="{
table: null,
column: pressTableProps,
}" />
@ -113,6 +113,13 @@ export default {
],
},
],
blenderEditConfig: {
form: {
field: [
[],
]
}
},
refreshLayoutKey1: "",
//
pressTableProps: [