update 装载详情

This commit is contained in:
lb 2023-03-23 11:16:19 +08:00
parent 1df948e577
commit 85b9736f09
3 changed files with 63 additions and 80 deletions

View File

@ -1,6 +1,7 @@
<template> <template>
<el-dialog <el-dialog
class="dialog-car-payload" class="dialog-car-payload"
title="装载详情"
:visible="dialogVisible" :visible="dialogVisible"
@close="handleClose" @close="handleClose"
:destroy-on-close="false" :destroy-on-close="false"
@ -19,6 +20,7 @@
<!-- @operate-event="handleOperate" --> <!-- @operate-event="handleOperate" -->
<el-pagination <el-pagination
v-if="showPaination"
class="mt-5 flex justify-end" class="mt-5 flex justify-end"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handlePageChange" @current-change="handlePageChange"
@ -64,6 +66,8 @@ export default {
dataList: [], dataList: [],
tableLoading: false, tableLoading: false,
refreshLayoutKey: null, refreshLayoutKey: null,
id: null,
showPaination: false,
}; };
}, },
created() {}, created() {},
@ -83,7 +87,8 @@ export default {
console.log("[*] 传入car payload对话框的id是", id); console.log("[*] 传入car payload对话框的id是", id);
return; return;
} }
this.showPaination = false;
this.id = id;
this.tableLoading = true; this.tableLoading = true;
this.getList(); this.getList();
}, },
@ -99,36 +104,23 @@ export default {
limit: this.size, limit: this.size,
}; };
if (!queryParams && this.listQueryExtra && this.listQueryExtra.length) { this.$http
this.listQueryExtra.map((nameOrObj) => { .get(this.urls.base + `/${this.id}`, {
if (typeof nameOrObj === "string") params[nameOrObj] = ""; params,
else if (typeof nameOrObj === "object") { })
Object.keys(nameOrObj).forEach((key) => {
params[key] = nameOrObj[key];
});
}
});
}
this.$http[this.urls.pageIsPostApi ? "post" : "get"](
this.urls.page,
this.urls.pageIsPostApi
? {
...params,
}
: {
params,
}
)
.then(({ data: res }) => { .then(({ data: res }) => {
console.log("[http response] res is: ", res); console.log("[car payload dialog] [http response] res is: ", res);
if (res.code === 0) { if (res.code === 0) {
// page : // page :
if ("list" in res.data) { if ("list" in res.data) {
this.dataList = res.data.list; this.dataList = res.data.list;
this.totalPage = res.data.total; this.totalPage = res.data.total;
this.showPaination = true;
}
if (Array.isArray(res.data)) {
this.dataList = res.data;
this.totalPage = 0;
} else { } else {
this.dataList.splice(0); this.dataList.splice(0);
this.totalPage = 0; this.totalPage = 0;
@ -193,4 +185,9 @@ export default {
}; };
</script> </script>
<style scoped></style> <style scoped>
.dialog-car-payload >>> .el-dialog__body {
padding: 5px 20px 20px;
}
</style>

View File

@ -65,40 +65,27 @@ export default function () {
]; ];
const dialogJustFormConfigs = { const dialogJustFormConfigs = {
carPayloadDialog: true,
clickModalToClose: true, clickModalToClose: true,
form: { tableConfig: {
rows: [ table: null,
[ column: [
{ // 窑车的 装载详情
input: true, // tableProps
label: "窑车号", { type: "index", label: "序号" },
prop: "code", { prop: "orderCode", label: "订单号" },
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, { prop: "bomCode", label: "配方号" },
elparams: { placeholder: "请输入窑车号" }, { prop: "shapeCode", label: "砖型编码" },
}, { width: 160, prop: "qty", label: "订单对应数量" },
// { { prop: "goodqty", label: "合格数量" },
// input: true, { prop: "badqty", label: "废砖数量" },
// label: "编码", { prop: "startTime", label: "开始时间" },
// prop: "code", { prop: "endTime", label: "结束时间" },
// rules: { required: true, message: "必填项不能为空", trigger: "blur" }, // { prop: "remark", label: "备注" },
// elparams: { placeholder: "请输入料仓编码" },
// },
],
// [{ component: QuillRichInput, label: "描述信息", prop: "description" }],
[{
richInput: true, label: "描述信息", prop: "description"
}],
[{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }],
],
operations: [
{ name: "add", label: "保存", type: "primary", permission: "pms:car:save", showOnEdit: false },
{ name: "update", label: "更新", type: "primary", permission: "pms:car:update", showOnEdit: true },
{ name: "reset", label: "重置", type: "warning", showAlways: true },
// { name: 'cancel', label: '取消', showAlways: true },
], ],
}, },
}; };
// 备注:弹窗弹出的时间和网速有关......
return { return {
dialogConfigs: dialogJustFormConfigs, dialogConfigs: dialogJustFormConfigs,
@ -111,7 +98,7 @@ export default function () {
fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的 fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的
}, },
urls: { urls: {
// base: "/pms/car", base: "/pms/carHandle",
page: "/pms/carHandle/pageHis", page: "/pms/carHandle/pageHis",
pageIsPostApi: true pageIsPostApi: true
// subase: '/pms/blenderStepParam', // subase: '/pms/blenderStepParam',

View File

@ -1,13 +1,13 @@
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent"; import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
import request from "@/utils/request"; import request from "@/utils/request";
import { timeFilter } from '@/utils/filters' import { timeFilter } from "@/utils/filters";
export default function () { export default function () {
const tableProps = [ const tableProps = [
{ type: 'index', label: '序号' }, { type: "index", label: "序号" },
{ prop: "createTime", label: "添加时间", filter: timeFilter }, { prop: "createTime", label: "添加时间", filter: timeFilter },
{ prop: "code", label: "窑车号" }, { prop: "code", label: "窑车号" },
{ prop: "stateDictValue", label: "状态", filter: v => (v !== null && v !== undefined) ? ['没有数据', '正常', '判废', '过渡'][v] : '-' }, // subcomponent { prop: "stateDictValue", label: "状态", filter: (v) => (v !== null && v !== undefined ? ["没有数据", "正常", "判废", "过渡"][v] : "-") }, // subcomponent
{ prop: "orderCode", label: "订单号" }, { prop: "orderCode", label: "订单号" },
{ prop: "posCode", label: "位置" }, { prop: "posCode", label: "位置" },
{ prop: "startTime", label: "开始时间", filter: timeFilter }, { prop: "startTime", label: "开始时间", filter: timeFilter },
@ -19,8 +19,8 @@ export default function () {
width: 90, width: 90,
subcomponent: TableOperaionComponent, subcomponent: TableOperaionComponent,
options: [ options: [
{ name: "to-car-payload", label: "装载详情", icon: 'document' }, { name: "to-car-payload", label: "装载详情", icon: "document" },
{ name: "to-car-history", label: "查看历史", emitFull: true, icon: 'time' } { name: "to-car-history", label: "查看历史", emitFull: true, icon: "time" },
// { name: "edit", label: "编辑", icon: "edit-outline" }, // { name: "edit", label: "编辑", icon: "edit-outline" },
// { name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:car:delete" } // { name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:car:delete" }
], ],
@ -29,14 +29,14 @@ export default function () {
const headFormFields = [ const headFormFields = [
{ {
prop: 'code', prop: "code",
label: "窑车号", label: "窑车号",
input: true, input: true,
default: { value: "" }, default: { value: "" },
bind: { bind: {
// placeholder: '请输入产线名称或编码' // placeholder: '请输入产线名称或编码'
placeholder: '请输入窑车号' placeholder: "请输入窑车号",
} },
}, },
{ {
button: { button: {
@ -56,28 +56,27 @@ export default function () {
// }, // },
]; ];
/**
* dialog config 有两个版本一个适用于 DialogWithMenu 组件另一个适用于 DialogJustForm 组件
* 适用于 DialogWithMenu 组件的配置示例详见 blenderStep/config.js
* 此为后者的配置:
*/
const dialogJustFormConfigs = { const dialogJustFormConfigs = {
carPayloadDialog: true, carPayloadDialog: true,
clickModalToClose: true, clickModalToClose: true,
tableConfig: { tableConfig: {
table: null, table: null,
column: [ column: [
// 窑车的 装载详情
// tableProps // tableProps
{ prop: "name", label: "名称" }, { type: "index", label: "序号" },
{ prop: "code", label: "编码" }, { prop: "orderCode", label: "订单号" },
{ prop: "sumqty", label: " 配方总重量" }, { prop: "bomCode", label: "配方号" },
{ prop: "shortDesc", label: "物料销售文本短描述" }, { prop: "shapeCode", label: "砖型编码" },
{ prop: "description", label: "物料销售文本描述" }, { width: 160, prop: "qty", label: "订单对应数量" },
{ prop: "remark", label: "备注" }, { prop: "goodqty", label: "合格数量" },
] { prop: "badqty", label: "废砖数量" },
} { prop: "startTime", label: "开始时间" },
{ prop: "endTime", label: "结束时间" },
// { prop: "remark", label: "备注" },
],
},
}; };
// 备注:弹窗弹出的时间和网速有关......
return { return {
dialogConfigs: dialogJustFormConfigs, dialogConfigs: dialogJustFormConfigs,
@ -90,9 +89,9 @@ export default function () {
fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的 fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的
}, },
urls: { urls: {
// base: "/pms/carHandle/pageView", base: "/pms/carHandle",
page: "/pms/carHandle/pageView", page: "/pms/carHandle/pageView",
pageIsPostApi: true pageIsPostApi: true,
// subase: '/pms/blenderStepParam', // subase: '/pms/blenderStepParam',
// subpage: '/pms/blenderStepParam/page', // subpage: '/pms/blenderStepParam/page',
// more... // more...