bufix 0705 zentao

This commit is contained in:
lb 2023-07-05 14:52:04 +08:00
parent f076e23a67
commit b8765af77f
23 changed files with 287 additions and 236 deletions

View File

@ -75,6 +75,7 @@ export default {
inject: ["urls"],
data() {
return {
// dialogVisible: false,
loadingStatus: false,
page: 1,
size: 20,
@ -203,6 +204,11 @@ export default {
},
handleClose() {
// clear list
setTimeout(() => {
this.dataList.splice(0);
this.totalPage = 0;
}, 300);
this.$emit("update:dialogVisible", false);
},
},

View File

@ -481,7 +481,7 @@ export default {
IsNotAvaliable(col) {
return this.detailMode || (col.disableOnEdit && this.editMode);
},
handleFilelistUpdate(newFilelist) {
handleFilelistUpdate(newFilelist, isDelete=false) {
// TODO: 访 .files
this.dataForm.files = newFilelist.map((file) => ({
id: file.id,
@ -490,9 +490,9 @@ export default {
typeCode: file.typeCode,
}));
//
if ("id" in this.dataForm && this.dataForm.id !== null && this.dataForm.id !== undefined) this.addOrUpdate("PUT");
else
this.$notify({
// if ("id" in this.dataForm && this.dataForm.id != null) this.addOrUpdate("PUT");
// else
!isDelete && this.$notify({
title: "等待保存",
message: "已添加文件,请手动点击保存!",
type: "warning",

View File

@ -90,7 +90,7 @@ export default {
})
.then(() => {
this.uploadedFileList = this.uploadedFileList.filter((file) => file.id.toString() !== fileId.toString());
this.$emit("update-file-list", this.uploadedFileList);
this.$emit("update-file-list", this.uploadedFileList, true); // is delete, set to true
this.$message({
type: "success",
message: "删除成功!",

View File

@ -2,9 +2,25 @@
<template>
<div class="list-view">
<el-row>
<a style="margin: 0 0 16px 0; color: #0b58ff; display: flex; align-items: center; text-decoration: none; cursor: pointer" title="返回上一页" @click.prevent="$router.go(-1)">
<a
style="
margin: 0 0 16px 0;
color: #0b58ff;
display: flex;
align-items: center;
text-decoration: none;
cursor: pointer;
"
title="返回上一页"
@click.prevent="$router.go(-1)">
<span style="margin-right: 6px">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M9 15L3 9m0 0l6-6M3 9h12a6 6 0 010 12h-3" />
</svg>
</span>
@ -20,8 +36,7 @@
@operate-event="handleOperate"
:current-page="page"
:current-size="size"
:refresh-layout-key="refreshLayoutKey"
/>
:refresh-layout-key="refreshLayoutKey" />
<el-pagination
class="mt-5 flex justify-end"
@ -31,8 +46,7 @@
:page-sizes="[10, 20, 50, 100]"
:page-size="size"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
<!-- :current-page.sync="currentPage"
:page-size.sync="pageSize" -->
@ -41,15 +55,13 @@
v-if="!!dialogConfigs && dialogType === DIALOG_WITH_MENU"
:dialog-visible.sync="dialogVisible"
:configs="dialogConfigs"
@refreshDataList="getList"
/>
@refreshDataList="getList" />
<DialogJustForm
ref="edit-dialog"
v-if="!!dialogConfigs && dialogType === DIALOG_JUST_FORM"
:dialog-visible.sync="dialogVisible"
:configs="dialogConfigs"
@refreshDataList="getList"
/>
@refreshDataList="getList" />
</div>
</template>
@ -221,6 +233,7 @@ export default {
// payload: { type: string, data: string | number | object }
switch (type) {
case "delete": {
let currenPageListLength = this.dataList.length
//
return this.$confirm(`确定要删除记录 "${data.name ?? data.id}" 吗?`, "提示", {
confirmButtonText: "确认",
@ -237,8 +250,9 @@ export default {
if (res.code === 0) {
this.$message.success("删除成功!");
this.page = 1;
this.size = 10;
// this.page = 1;
// this.size = 10;
if (currenPageListLength == 1) this.page = this.page > 1 ? this.page - 1 : 1;
this.getList();
} else {
this.$message({
@ -302,10 +316,10 @@ export default {
// console.log('to-bom-detail', data.name)
//
return this.$router.push({
name: 'pms-bomDetails',
name: "pms-bomDetails",
query: {
name: data.name
}
name: data.name,
},
});
}
case "copy": {

View File

@ -19,8 +19,8 @@
@size-change="handleSizeChange"
@current-change="handlePageChange"
:current-page.sync="page"
:page-size.sync="size"
:page-sizes="[10, 20, 50, 100]"
:page-size="size"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
@ -126,6 +126,12 @@ export default {
this.refreshLayoutKey = this.layoutTable();
},
watch: {
page: val => {
console.log('page changed:', val)
},
size: val => {
console.log('size changed:', val)
},
triggerUpdate(val, oldVal) {
if (val && val !== oldVal) {
// get list
@ -171,7 +177,7 @@ export default {
? { ...queryParams, page: this.page, limit: this.size }
: {
page: this.page,
limit: this.size,
limit: this.size
};
if (!queryParams && this.listQueryExtra && this.listQueryExtra.length) {
@ -183,6 +189,7 @@ export default {
});
}
});
this.cachedSearchCondition = Object.assign({}, params)
}
this.$http[this.urls.pageIsPostApi ? "post" : "get"](
@ -201,6 +208,14 @@ export default {
if (res.code === 0) {
// page :
if ("list" in res.data) {
// if (res.data.list.length == 0 && res.data.total != 0) {
// // refresh list
// if (this.page > 1) {
// this.page -= 1
// this.getList()
// return
// } else return
// }
/** 破碎记录的特殊需求:数据要结合单位 material + materialUnitDictValue */
if ("attachDictValue" in this.tableConfig.column) {
this.dataList = res.data.list.map((row) => {
@ -257,6 +272,8 @@ export default {
if (deleteConfig && "promptField" in deleteConfig) {
promptName = data[deleteConfig.promptField];
}
let currenPageListLength = this.dataList.length
//
return this.$confirm(`确定要删除记录 "${promptName}" 吗?`, "提示", {
confirmButtonText: "确认",
@ -276,9 +293,11 @@ export default {
}).then(({ data: res }) => {
if (res.code === 0) {
this.$message.success("删除成功!");
this.page = 1;
this.size =
"defaultPageSize" in this.tableConfig.column ? this.tableConfig.column.defaultPageSize : 20;
// this.page = 1;
// this.size =
// "defaultPageSize" in this.tableConfig.column ? this.tableConfig.column.defaultPageSize : 20;
if (currenPageListLength == 1) this.page = this.page > 1 ? this.page - 1 : 1
this.getList();
} else {
this.$message({

View File

@ -85,7 +85,7 @@ export default {
refreshLayoutKey: null,
dialogBomCode: "",
overlayVisible: false,
cachedSearchCondition: {}
cachedSearchCondition: {},
};
},
inject: ["urls"],
@ -175,6 +175,7 @@ export default {
// payload: { type: string, data: string | number | object }
switch (type) {
case "delete": {
let currenPageListLength = this.dataList.length;
//
return this.$confirm(`确定要删除记录 "${data.name ?? data.id}" 吗?`, "提示", {
confirmButtonText: "确认",
@ -191,8 +192,9 @@ export default {
if (res.code === 0) {
this.$message.success("删除成功!");
this.page = 1;
this.size = 10;
// this.page = 1;
// this.size = 10;
if (currenPageListLength == 1) this.page = this.page > 1 ? this.page - 1 : 1;
this.getList();
} else {
this.$message({

View File

@ -23,7 +23,7 @@ export default function () {
{ width: 120, prop: "comqty", label: "已完成量 [kg]" },
{ width: 60, prop: "ai", label: "版本" },
{ prop: "blenderCode", label: "混料机" },
{ width: 160, prop: "", label: "添加时间", filter: timeFilter },
{ width: 160, prop: "createTime", label: "添加时间", filter: timeFilter },
// { width: 120, prop: "badqty", label: "不合格数量" },
// { prop: "remark", label: "备注" },
// { prop: 'version', label: '配方号' },

View File

@ -213,15 +213,11 @@ export default {
switch (type) {
case "detach": {
//
this.$confirm(
`确定下发订单吗?`,
"提示",
{
confirmButtonText: "确认",
cancelButtonText: "我再想想",
type: "warning",
}
).then(() => {
this.$confirm(`确定下发订单吗?`, "提示", {
confirmButtonText: "确认",
cancelButtonText: "我再想想",
type: "warning",
}).then(() => {
this.overlayVisible = true;
return this.$http
.post(this.urls.pressDetach, data /* { id: data } */, { headers: { "Content-Type": "application/json" } })
@ -232,7 +228,7 @@ export default {
type: "success",
duration: 1500,
onClose: () => {
this.getList(this.cachedSearchCondition, 'press');
this.getList(this.cachedSearchCondition, "press");
},
});
} else {
@ -256,6 +252,8 @@ export default {
// payload: { type: string, data: string | number | object }
switch (type) {
case "delete": {
let currenPageListLength = this.dataList.length;
//
return this.$confirm(`确定要删除记录 "${data.name ?? data.id}" 吗?`, "提示", {
confirmButtonText: "确认",
@ -272,8 +270,9 @@ export default {
if (res.code === 0) {
this.$message.success("删除成功!");
this.page = 1;
this.size = 10;
// this.page = 1;
// this.size = 10;
if (currenPageListLength == 1) this.page = this.page > 1 ? this.page - 1 : 1;
this.getList();
} else {
this.$message({
@ -390,7 +389,7 @@ export default {
});
console.log("查询", this.cachedSearchCondition);
this.getList(this.cachedSearchCondition);
this.getList(this.cachedSearchCondition, 'press');
this.getList(this.cachedSearchCondition, "press");
break;
}
}

View File

@ -19,7 +19,7 @@
@size-change="handleSizeChange"
@current-change="handlePageChange"
:current-page.sync="page"
:page-sizes="[20, 50, 100]"
:page-sizes="[10, 20, 50, 100]"
:page-size="size"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
@ -242,6 +242,8 @@ export default {
if (deleteConfig && "promptField" in deleteConfig) {
promptName = data[deleteConfig.promptField];
}
let currenPageListLength = this.dataList.length;
//
return this.$confirm(`确定要删除记录 "${promptName}" 吗?`, "提示", {
confirmButtonText: "确认",
@ -262,8 +264,9 @@ export default {
if (res.code === 0) {
this.$message.success("删除成功!");
this.page = 1;
this.size = 100;
// this.page = 1;
// this.size = 100;
if (currenPageListLength == 1) this.page = this.page > 1 ? this.page - 1 : 1;
this.getList();
} else {
this.$message({

View File

@ -25,7 +25,7 @@
@size-change="handleSizeChange"
@current-change="handlePageChange"
:current-page.sync="page"
:page-sizes="[20, 50, 100]"
:page-sizes="[10, 20, 50, 100]"
:page-size="size"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
@ -93,11 +93,14 @@ export default {
if (res.code === 0) {
if ("list" in res.data) {
this.dataList = res.data.list;
this.totalPage = res.data.total
} else if (Array.isArray(res.data)) {
this.dataList = res.data;
this.totalPage = res.data.length
} // else ...
} else {
this.dataList.splice(0);
this.totalPage = 0
}
// this.dataList = [
// { id: 1, code: 1, press1: 1, press2: 1, createTime: "2023-4-21 01:00:00", temp1: 1000 },

View File

@ -12,8 +12,7 @@
@operate-event="handleOperate"
:current-page="page"
:current-size="size"
:refresh-layout-key="refreshLayoutKey"
/>
:refresh-layout-key="refreshLayoutKey" />
<el-pagination
class="mt-5 flex justify-end"
@ -23,8 +22,7 @@
:page-sizes="[10, 20, 50, 100]"
:page-size="size"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
<DialogJustForm
ref="edit-dialog"
@ -32,16 +30,14 @@
v-if="!!dialogConfigs"
:dialog-visible.sync="dialogVisible"
:configs="dialogConfigs"
@refreshDataList="getList"
/>
@refreshDataList="getList" />
<DialogJustForm
ref="car-payload-add-dialog"
key="car-payload-add-dialog"
v-if="!!carPayloadAddConfigs"
:dialog-visible.sync="carPayloadAddVisible"
:configs="carPayloadAddConfigs"
@refreshDataList="updateCarPayloadKey = Math.random()"
/>
@refreshDataList="updateCarPayloadKey = Math.random()" />
<DialogCarPayload
ref="car-payload-dialog"
key="car-payload-dialog"
@ -50,8 +46,7 @@
:configs="carPayloadDialogConfigs"
@refreshDataList="getList"
:update-key="updateCarPayloadKey"
@add-record="openCarPayloadAddDialog($event)"
/>
@add-record="openCarPayloadAddDialog($event)" />
</div>
</template>
@ -146,7 +141,7 @@ export default {
tableLoading: false,
refreshLayoutKey: null,
updateCarPayloadKey: 1,
cachedSearchCondition: {}
cachedSearchCondition: {},
};
},
inject: ["urls"],
@ -237,6 +232,8 @@ export default {
if (deleteConfig && "promptField" in deleteConfig) {
promptName = data[deleteConfig.promptField];
}
let currenPageListLength = this.dataList.length;
//
return this.$confirm(`确定要删除记录 "${promptName}" 吗?`, "提示", {
confirmButtonText: "确认",
@ -250,13 +247,14 @@ export default {
method: "DELETE",
data: data.id,
headers: {
"Content-Type": "application/json"
}
"Content-Type": "application/json",
},
}).then(({ data: res }) => {
if (res.code === 0) {
this.$message.success("删除成功!");
this.page = 1;
this.size = 10;
// this.page = 1;
// this.size = 10;
if (currenPageListLength == 1) this.page = this.page > 1 ? this.page - 1 : 1;
this.getList();
} else {
this.$message({

View File

@ -213,6 +213,7 @@ export default {
if (deleteConfig && "promptField" in deleteConfig) {
promptName = data[deleteConfig.promptField];
}
let currenPageListLength = this.dataList.length;
//
return this.$confirm(`确定要删除记录 "${promptName}" 吗?`, "提示", {
confirmButtonText: "确认",
@ -227,8 +228,9 @@ export default {
}).then(({ data: res }) => {
if (res.code === 0) {
this.$message.success("删除成功!");
this.page = 1;
this.size = 10;
// this.page = 1;
// this.size = 10;
if (currenPageListLength == 1) this.page = this.page > 1 ? this.page - 1 : 1;
this.getList();
} else {
this.$message({

View File

@ -30,7 +30,6 @@
v-if="!!temperatureDialogVisible"
:dialog-visible.sync="temperatureDialogVisible"
@refreshDataList="getAList" />
</div>
</template>
@ -75,7 +74,7 @@ export default {
width: 90,
subcomponent: TableOperaionComponent,
options: [
{ name: "temperature", label: "烧制温度", icon: "odometer", color: '#ff4d00' },
{ name: "temperature", label: "烧制温度", icon: "odometer", color: "#ff4d00" },
{ name: "to-car-payload", label: "装载详情", icon: "shopping-cart-full" }, // or el-icon-box
// { name: "delete", label: "", icon: "delete", emitFull: true, promptField: "code" },
],
@ -143,6 +142,7 @@ export default {
if (deleteConfig && "promptField" in deleteConfig) {
promptName = data[deleteConfig.promptField];
}
let currenPageListLength = this.dataList.length;
//
return this.$confirm(`确定要删除记录 "${promptName}" 吗?`, "提示", {
confirmButtonText: "确认",
@ -163,8 +163,9 @@ export default {
if (res.code === 0) {
this.$message.success("删除成功!");
this.page = 1;
this.size = 10;
// this.page = 1;
// this.size = 10;let currenPageListLength = this.dataList.length;
if (currenPageListLength == 1) this.page = this.page > 1 ? this.page - 1 : 1;
this.getList();
} else {
this.$message({

View File

@ -19,21 +19,21 @@ export default function () {
{ width: 100, prop: "shapeCode", label: "砖型" },
{ width: 120, prop: "brand", label: "牌号" },
{ width: 60, prop: "ai", label: "版本" },
{ width: 65, prop: "addon", label: "addon" },
{ width: 65, prop: "sapParam1", label: "addon" },
{ width: 200, prop: "shortDesc", label: "物料号销售文本" },
{ width: 100, prop: "bomCode", label: "配方编码" },
{ width: 80, prop: "pressCode", label: "压机号" },
{ width: 80, prop: "blenderCode", label: "混料机号" },
{ width: 80, prop: "kilnCode", label: "隧道窑号" },
{ width: 120, prop: "ktmp", label: "烧成温度" },
{ width: 120, prop: "tt", label: "烧成时间" },
{ width: 120, prop: "sapParam6", label: "烧成温度" },
{ width: 120, prop: "sapParam7", label: "烧成时间(h)" },
{ width: 120, prop: "yieldqty", label: "已生产数量" },
{ width: 120, prop: "soqty", label: "销售订单数" },
{ width: 200, prop: "saleNo", label: "销售订单号" },
{ width: 200, prop: "saleOrderItem", label: "销售订单item号" },
{ width: 200, prop: "packTechCode", label: "包装工艺代码" },
{ width: 120, prop: "specifications", label: "生产订单类型" },
{ width: 120, prop: "deliveryTime", label: "销售时间" },
{ width: 120, prop: "deliveryTime", label: "销售时间", filter: timeFilter },
{ width: 120, prop: "customerCode", label: "客户" },
{ width: 120, prop: "pcsKilnCar", label: "托盘码放砖数" },
{ width: 120, prop: "remark", label: "备注" },

View File

@ -12,8 +12,7 @@
@operate-event="handleOperate"
:current-page="page"
:current-size="size"
:refresh-layout-key="refreshLayoutKey"
/>
:refresh-layout-key="refreshLayoutKey" />
<el-pagination
class="mt-5 flex justify-end"
@ -23,8 +22,7 @@
:page-sizes="[10, 20, 50, 100]"
:page-size="size"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
<DialogJustForm
ref="edit-dialog"
@ -32,24 +30,21 @@
v-if="!!dialogConfigs"
:dialog-visible.sync="dialogVisible"
:configs="dialogConfigs"
@refreshDataList="getList"
/>
@refreshDataList="getList" />
<DialogJustForm
ref="car-payload-add-dialog"
key="car-payload-add-dialog"
v-if="!!carPayloadAddConfigs"
:dialog-visible.sync="carPayloadAddVisible"
:configs="carPayloadAddConfigs"
@refreshDataList="getList"
/>
@refreshDataList="getList" />
<DialogCarPayload
ref="car-payload-dialog"
key="car-payload-dialog"
v-if="!!carPayloadDialogConfigs"
:dialog-visible.sync="carPayloadDialogVisible"
:configs="carPayloadDialogConfigs"
@refreshDataList="getList"
/>
@refreshDataList="getList" />
</div>
</template>
@ -143,7 +138,7 @@ export default {
dataList: [],
tableLoading: false,
refreshLayoutKey: null,
cachedSearchCondition: {}
cachedSearchCondition: {},
};
},
inject: ["urls"],
@ -234,6 +229,7 @@ export default {
if (deleteConfig && "promptField" in deleteConfig) {
promptName = data[deleteConfig.promptField];
}
let currenPageListLength = this.dataList.length;
//
return this.$confirm(`确定要删除记录 "${promptName}" 吗?`, "提示", {
confirmButtonText: "确认",
@ -252,8 +248,9 @@ export default {
}).then(({ data: res }) => {
if (res.code === 0) {
this.$message.success("删除成功!");
this.page = 1;
this.size = 10;
// this.page = 1;
// this.size = 10;let currenPageListLength = this.dataList.length;
if (currenPageListLength == 1) this.page = this.page > 1 ? this.page - 1 : 1;
this.getList();
} else {
this.$message({

View File

@ -12,8 +12,7 @@
row-key="id"
:lazy="true"
:load="loadSubClassFn"
border
>
border>
<!-- @cell-mouse-enter="(row, col, cell, event) => $emit('cell-mouse-enter', row, col, cell, event)"> -->
<!-- @cell-mouse-leave="(row, col, cell, event) => $emit('cell-mouse-leave', row, col, cell, event)"> -->
<!-- 表格头定义 -->
@ -34,8 +33,7 @@
}
: null
"
v-bind="head.more"
></el-table-column>
v-bind="head.more"></el-table-column>
<!-- 普通的表头 -->
<el-table-column
v-else
@ -49,8 +47,7 @@
filter-placement="top"
:align="head.align || null"
v-bind="head.more"
:show-overflow-tooltip="head.showOverflowTooltip || !(head.prop === 'operations')"
>
:show-overflow-tooltip="head.showOverflowTooltip || !(head.prop === 'operations')">
<!-- :show-overflow-tooltip="head.showOverflowTooltip || true" -->
<!-- 子组件 -->
<template v-if="head.prop" slot-scope="scope">
@ -59,15 +56,17 @@
:is="head.subcomponent"
:key="idx + 'sub'"
:inject-data="{ ...scope.row, head }"
@emit-data="handleSubEmitData"
/>
@emit-data="handleSubEmitData" />
<!-- 直接展示数据或应用过滤器 -->
<span v-else>{{ scope.row[head.prop] | commonFilter(head.filter) }}</span>
</template>
<!-- 多级表头 -->
<template v-if="!head.prop && head.children">
<TableHead v-for="(subhead, subindex) in head.children" :key="'subhead-' + idx + '-subindex-' + subindex" :opt="subhead" />
<TableHead
v-for="(subhead, subindex) in head.children"
:key="'subhead-' + idx + '-subindex-' + subindex"
:opt="subhead" />
</template>
</el-table-column>
</template>
@ -106,12 +105,18 @@ export default {
type: Number,
default: 0,
},
page: {
type: Number,
default: 1,
},
size: {
type: Number,
default: 20,
},
},
inject: ["urls"],
data() {
return {
page: 1,
size: 20, // 20
dataList: [],
};
},

View File

@ -16,6 +16,8 @@
:table-data="dataList"
@operate-event="handleOperate"
@load-sub="handleLoadSub"
:page="page"
:size="size"
:refresh-layout-key="refreshLayoutKey" />
<el-pagination
@ -270,6 +272,7 @@ export default {
// payload: { type: string, data: string | number | object }
switch (type) {
case "delete": {
let currenPageListLength = this.dataList.length;
//
return this.$confirm(`确定要删除 "${data.name}" 吗?`, "提示", {
confirmButtonText: "确认",
@ -285,7 +288,7 @@ export default {
}).then(({ data: res }) => {
if (res.code === 0) {
this.$message.success("删除成功!");
if (currenPageListLength == 1) this.page = this.page > 1 ? this.page - 1 : 1;
this.getList(this.cachedSearchCondition);
}
});

View File

@ -12,8 +12,7 @@
row-key="id"
:lazy="true"
:load="loadSubClassFn"
border
>
border>
<!-- @cell-mouse-enter="(row, col, cell, event) => $emit('cell-mouse-enter', row, col, cell, event)"> -->
<!-- @cell-mouse-leave="(row, col, cell, event) => $emit('cell-mouse-leave', row, col, cell, event)"> -->
<!-- 表格头定义 -->
@ -33,10 +32,9 @@
return val + 1 + (page - 1) * size;
}
: null
"
"
:fixed="head.fixed || null"
v-bind="head.more"
></el-table-column>
v-bind="head.more"></el-table-column>
<!-- 普通的表头 -->
<el-table-column
v-else
@ -51,8 +49,7 @@
:align="head.align || null"
:class-name="head.className ?? 'initial-column-class'"
v-bind="head.more"
:show-overflow-tooltip="head.showOverflowTooltip || !(head.prop === 'operations')"
>
:show-overflow-tooltip="head.showOverflowTooltip || !(head.prop === 'operations')">
<!-- :show-overflow-tooltip="head.showOverflowTooltip || true" -->
<!-- 子组件 -->
<template v-if="head.prop" slot-scope="scope">
@ -61,15 +58,17 @@
:is="head.subcomponent"
:key="idx + 'sub'"
:inject-data="{ ...scope.row, head }"
@emit-data="handleSubEmitData"
/>
@emit-data="handleSubEmitData" />
<!-- 直接展示数据或应用过滤器 -->
<span v-else>{{ scope.row[head.prop] | commonFilter(head.filter) }}</span>
</template>
<!-- 多级表头 -->
<template v-if="!head.prop && head.children">
<TableHead v-for="(subhead, subindex) in head.children" :key="'subhead-' + idx + '-subindex-' + subindex" :opt="subhead" />
<TableHead
v-for="(subhead, subindex) in head.children"
:key="'subhead-' + idx + '-subindex-' + subindex"
:opt="subhead" />
</template>
</el-table-column>
</template>
@ -108,12 +107,18 @@ export default {
type: Number,
default: 0,
},
page: {
type: Number,
default: 1,
},
size: {
type: Number,
default: 20,
},
},
inject: ["urls"],
data() {
return {
page: 1,
size: 20, // 20
dataList: [],
};
},
@ -143,7 +148,7 @@ export default {
text-shadow: unset;
}
.base-list-table >>> .no-padding-class:not(th) .cell {
.base-list-table >>> .no-padding-class:not(th) .cell {
line-height: 1.75;
padding: 0;
}

View File

@ -17,6 +17,8 @@
:table-config="tableConfig.table"
:column-config="tableConfig.column"
:table-data="dataList"
:page="listQuery.page"
:size="listQuery.limit"
@operate-event="handleOperate"
:refresh-layout-key="refreshLayoutKey" />
@ -311,6 +313,7 @@ export default {
});
}
case "delete": {
let currenPageListLength = this.dataList.length;
//
return this.$confirm(`确定要删除 "${data.code ?? data.id}" 吗?`, "提示", {
confirmButtonText: "确认",
@ -327,6 +330,7 @@ export default {
if (res.code === 0) {
this.$message.success("删除成功!");
//
if (currenPageListLength == 1) this.listQuery.page = this.listQuery.page > 1 ? this.listQuery.page - 1 : 1;
this.getAList(Object.assign({}, this.listQuery, this.extraSearchConditions, this.params));
}
});

View File

@ -10,8 +10,7 @@
<BaseSearchForm
head-title="进行中的订单"
:head-config="{ fields: headConfigs.ongoingTableSearch }"
@btn-click="handleBtnClick('ongoing', $event)"
/>
@btn-click="handleBtnClick('ongoing', $event)" />
<BaseListTable
key="confirmed"
v-loading="tableLoadings.ongoing"
@ -19,8 +18,7 @@
:column-config="tableConfigs.ongoingTable"
:table-data="dataLists.ongoing"
@operate-event="handleOperate('ongoing', $event)"
:refresh-layout-key="refreshLayoutKey"
/>
:refresh-layout-key="refreshLayoutKey" />
<el-pagination
class="mt-5 flex justify-end"
@ -30,16 +28,14 @@
:page-sizes="[1, 5, 10, 20]"
:page-size="conditions.ongoing.limit"
:total="totalPage.ongoing"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
</section>
<section class="pending-order" id="pending">
<BaseSearchForm
head-title="等待中的订单"
:head-config="{ fields: headConfigs.pendingTableSearch }"
@btn-click="handleBtnClick('pending', $event)"
/>
@btn-click="handleBtnClick('pending', $event)" />
<BaseListTable
key="unconfirmed"
v-loading="tableLoadings.pending"
@ -47,8 +43,7 @@
:column-config="tableConfigs.pendingTable"
:table-data="dataLists.pending"
@operate-event="handleOperate(type, $event)"
:refresh-layout-key="refreshLayoutKey"
/>
:refresh-layout-key="refreshLayoutKey" />
<el-pagination
class="mt-5 flex justify-end"
@size-change="handleSizeChange('pending', $event)"
@ -57,16 +52,14 @@
:page-sizes="[1, 5, 10, 20]"
:page-size="conditions.pending.limit"
:total="totalPage.pending"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
</section>
<section class="finished-order" id="finished">
<BaseSearchForm
head-title="已完成订单"
:head-config="{ fields: headConfigs.finishedTableSearch }"
@btn-click="handleBtnClick('finished', $event)"
/>
@btn-click="handleBtnClick('finished', $event)" />
<BaseListTable
key="ended"
v-loading="tableLoadings.finished"
@ -74,8 +67,7 @@
:column-config="tableConfigs.finishedTable"
:table-data="dataLists.finished"
@operate-event="handleOperate(type, $event)"
:refresh-layout-key="refreshLayoutKey"
/>
:refresh-layout-key="refreshLayoutKey" />
<el-pagination
class="mt-5 flex justify-end"
@ -85,8 +77,7 @@
:page-sizes="[1, 5, 10, 20]"
:page-size="conditions.finished.limit"
:total="totalPage.finished"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
</section>
<!-- <DialogWithMenu
@ -374,6 +365,7 @@ export default {
// payload: { type: string, data: string | number | object }
switch (type) {
case "delete": {
let currenPageListLength = this.dataList.length;
//
return this.$confirm(`确定要删除 "${data.name}" 吗?`, "提示", {
confirmButtonText: "确认",
@ -390,8 +382,10 @@ export default {
if (res.code === 0) {
this.$message.success("删除成功!");
this.page = 1;
this.size = 10;
// this.page = 1;
// this.size = 10;let currenPageListLength = this.dataList.length;
if (currenPageListLength == 1) this.page = this.page > 1 ? this.page - 1 : 1;
this.getList();
}
});
@ -500,8 +494,6 @@ export default {
</script>
<style scoped>
section {
padding: 16px;
padding-bottom: 3.125rem;

View File

@ -30,7 +30,6 @@
v-if="!!temperatureDialogVisible"
:dialog-visible.sync="temperatureDialogVisible"
@refreshDataList="getAList" />
</div>
</template>
@ -75,7 +74,7 @@ export default {
width: 90,
subcomponent: TableOperaionComponent,
options: [
{ name: "temperature", label: "烧制温度", icon: "odometer", color: '#ff4d00' },
{ name: "temperature", label: "烧制温度", icon: "odometer", color: "#ff4d00" },
{ name: "to-car-payload", label: "装载详情", icon: "shopping-cart-full" }, // or el-icon-box
// { name: "delete", label: "", icon: "delete", emitFull: true, promptField: "code" },
],
@ -143,6 +142,7 @@ export default {
if (deleteConfig && "promptField" in deleteConfig) {
promptName = data[deleteConfig.promptField];
}
let currenPageListLength = this.dataList.length;
//
return this.$confirm(`确定要删除记录 "${promptName}" 吗?`, "提示", {
confirmButtonText: "确认",
@ -163,8 +163,9 @@ export default {
if (res.code === 0) {
this.$message.success("删除成功!");
this.page = 1;
this.size = 10;
// this.page = 1;
// this.size = 10;let currenPageListLength = this.dataList.length;
if (currenPageListLength == 1) this.page = this.page > 1 ? this.page - 1 : 1;
this.getList();
} else {
this.$message({

View File

@ -50,15 +50,15 @@ export default function () {
};
const startTimeProp = (type) =>
({
ongoing: [
{ width: 120, prop: "startTime", label: "开始时间", filter: timeFilter }, // "订单砖数" },
],
pending: [],
finished: [
{ width: 120, prop: "startTime", label: "开始时间", filter: timeFilter }, // "订单砖数" },
],
}[type]);
({
ongoing: [
{ width: 120, prop: "startTime", label: "开始时间", filter: timeFilter }, // "订单砖数" },
],
pending: [],
finished: [
{ width: 120, prop: "startTime", label: "开始时间", filter: timeFilter }, // "订单砖数" },
],
}[type]);
const genTableProps = (type /** ongoing, pending, finished */) => [
{ width: 60, type: "index", label: "序号", fixed: true },
@ -72,21 +72,21 @@ export default function () {
{ width: 100, prop: "shapeCode", label: "砖型" }, // "砖型编号" }, // select, filterable
{ width: 120, prop: "brand", label: "牌号" }, // select, filterable
{ width: 60, prop: "ai", label: "版本" }, // "版本号" }, // auto display according to the 配方
{ width: 65, prop: "addon", label: "addon" },
{ width: 65, prop: "sapParam1", label: "addon" },
{ width: 200, prop: "shortDesc", label: "物料号销售文本" },
{ width: 100, prop: "bomCode", label: "配方编码" },
{ width: 80, prop: "pressCode", label: "压机号" }, // select, filterable
{ width: 80, prop: "blenderCode", label: "混料机号" }, // select, filterable
{ width: 80, prop: "kilnCode", label: "隧道窑号" }, // select, filterable
{ width: 120, prop: "ktmp", label: "烧成温度" },
{ width: 120, prop: "tt", label: "烧成时间" },
{ width: 120, prop: "sapParam6", label: "烧成温度" },
{ width: 120, prop: "sapParam7", label: "烧成时间(h)" },
{ width: 120, prop: "yieldqty", label: "已生产数量" }, // uneditable
{ width: 120, prop: "soqty", label: "销售订单数" },
{ width: 200, prop: "saleNo", label: "销售订单号" },
{ width: 200, prop: "saleOrderItem", label: "销售订单item号" },
{ width: 200, prop: "packTechCode", label: "包装工艺代码" }, // select, filterable
{ width: 120, prop: "specifications", label: "生产订单类型" },
{ width: 120, prop: "deliveryTime", label: "销售时间" },
{ width: 120, prop: "deliveryTime", label: "销售时间", filter: timeFilter },
{ width: 120, prop: "customerCode", label: "客户" },
{ width: 120, prop: "pcsKilnCar", label: "托盘码放砖数" },
// { prop: "description", label: "详情", subcomponent: TableTextComponent },
@ -114,87 +114,87 @@ export default function () {
];
const genHeadFormFields = (type) =>
({
ongoing: [
{
label: "订单号",
prop: "code",
input: true,
default: { value: "" },
bind: { placeholder: "输入订单号" },
({
ongoing: [
{
label: "订单号",
prop: "code",
input: true,
default: { value: "" },
bind: { placeholder: "输入订单号" },
},
{
// 时间段
timerange: true,
prop: "timerange",
label: "时间段",
bind: {
placeholder: "选择日期时间",
type: "datetimerange",
"start-placeholder": "开始时间",
"end-placeholder": "结束时间",
},
{
// 时间段
timerange: true,
prop: "timerange",
label: "时间段",
bind: {
placeholder: "选择日期时间",
type: "datetimerange",
"start-placeholder": "开始时间",
"end-placeholder": "结束时间",
},
},
{
// 查询
button: {
type: "primary",
name: "查询",
},
{
// 查询
button: {
type: "primary",
name: "查询",
},
},
],
pending: [
{
label: "订单号",
prop: "code",
input: true,
bind: { placeholder: "输入订单号" },
},
{
// 查询
button: {
type: "primary",
name: "查询",
},
],
pending: [
{
label: "订单号",
prop: "code",
input: true,
bind: { placeholder: "输入订单号" },
},
{
// 新增订单
button: {
type: "primary",
name: "新增",
permission: "",
},
{
// 查询
button: {
type: "primary",
name: "查询",
},
bind: {
plain: true,
},
{
// 新增订单
button: {
type: "primary",
name: "新增",
permission: "",
},
bind: {
plain: true,
},
},
{
// 导入订单 - TODO: 需完善具体接口和功能
button: {
type: "success",
name: "导入订单",
},
{
// 导入订单 - TODO: 需完善具体接口和功能
button: {
type: "success",
name: "导入订单",
},
bind: {
plain: true,
},
bind: {
plain: true,
},
],
finished: [
{
label: "订单号",
prop: "code",
input: true,
bind: { placeholder: "输入订单号" },
},
],
finished: [
{
label: "订单号",
prop: "code",
input: true,
bind: { placeholder: "输入订单号" },
},
{
// 查询
button: {
type: "primary",
name: "查询",
},
{
// 查询
button: {
type: "primary",
name: "查询",
},
},
],
}[type]);
},
],
}[type]);
const textOnlyComponent = {
props: {
@ -219,8 +219,8 @@ export default function () {
this.useBuiltin
? this.orderStatusMap[this.modelValue] ?? "-"
: this.modelValue.toString().trim() === ""
? "-"
: this.modelValue.toString()
? "-"
: this.modelValue.toString()
);
},
};

View File

@ -12,8 +12,7 @@
@operate-event="handleOperate"
:current-page="page"
:current-size="size"
:refresh-layout-key="refreshLayoutKey"
/>
:refresh-layout-key="refreshLayoutKey" />
<el-pagination
class="mt-5 flex justify-end"
@ -23,8 +22,7 @@
:page-sizes="[20, 50, 100]"
:page-size="size"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
<DialogJustForm
ref="edit-dialog"
@ -32,16 +30,14 @@
v-if="!!dialogConfigs"
:dialog-visible.sync="dialogVisible"
:configs="dialogConfigs"
@refreshDataList="getList"
/>
@refreshDataList="getList" />
<DialogJustForm
ref="car-payload-add-dialog"
key="car-payload-add-dialog"
v-if="!!carPayloadAddConfigs"
:dialog-visible.sync="carPayloadAddVisible"
:configs="carPayloadAddConfigs"
@refreshDataList="updateCarPayloadKey = Math.random()"
/>
@refreshDataList="updateCarPayloadKey = Math.random()" />
<DialogCarPayload
ref="car-payload-dialog"
key="car-payload-dialog"
@ -50,8 +46,7 @@
:configs="carPayloadDialogConfigs"
@refreshDataList="getList"
:update-key="updateCarPayloadKey"
@add-record="openCarPayloadAddDialog($event)"
/>
@add-record="openCarPayloadAddDialog($event)" />
</div>
</template>
@ -146,7 +141,7 @@ export default {
tableLoading: false,
refreshLayoutKey: null,
updateCarPayloadKey: 1,
cachedSearchCondition: {}
cachedSearchCondition: {},
};
},
inject: ["urls"],
@ -237,6 +232,7 @@ export default {
if (deleteConfig && "promptField" in deleteConfig) {
promptName = data[deleteConfig.promptField];
}
let currenPageListLength = this.dataList.length;
//
return this.$confirm(`确定要删除记录 "${promptName}" 吗?`, "提示", {
confirmButtonText: "确认",
@ -255,8 +251,9 @@ export default {
}).then(({ data: res }) => {
if (res.code === 0) {
this.$message.success("删除成功!");
this.page = 1;
this.size = 100;
// this.page = 1;
// this.size = 100;let currenPageListLength = this.dataList.length;
if (currenPageListLength == 1) this.page = this.page > 1 ? this.page - 1 : 1;
this.getList();
} else {
this.$message({