update 2023.4.10

This commit is contained in:
lb 2023-04-10 10:42:28 +08:00
parent 45fe1d5d3c
commit 9773d2a9ae
7 changed files with 146 additions and 116 deletions

View File

@ -49,6 +49,7 @@
:tooltip-effect="head.tooltipEffect || 'light'"
filter-placement="top"
:align="head.align || null"
:class-name="head.className ?? 'initial-column-class'"
v-bind="head.more"
:show-overflow-tooltip="head.showOverflowTooltip || !(head.prop === 'operations')"
>
@ -133,4 +134,17 @@ export default {
};
</script>
<style scoped></style>
<style scoped>
.base-list-table >>> .initial-column-class {
padding: 0;
}
.base-list-table >>> .initial-column-class .cell {
text-shadow: unset;
}
.base-list-table >>> .no-padding-class:not(th) .cell {
line-height: 1.75;
padding: 0;
}
</style>

View File

@ -1,6 +1,6 @@
<template>
<el-dialog
class="dialog-just-form"
class="dialog-with-menu"
style="padding: 40px"
:fullscreen="fullscreen"
:visible="visible"
@ -113,7 +113,7 @@ export default {
</script>
<style scoped>
.dialog-just-form >>> .el-dialog__body {
.dialog-with-menu >>> .el-dialog__body {
padding-top: 40px !important;
padding-bottom: 40px !important;
/* padding-top: 0 !important;
@ -130,20 +130,21 @@ export default {
width: 100% !important;
}
.dialog-just-form >>> .el-dialog__header {
.dialog-with-menu >>> .el-dialog__header {
padding: 0;
/* background: linear-gradient(to bottom, rgba(0, 0, 0, 0.25), white); */
}
.dialog-just-form >>> .el-dialog__body {
.dialog-with-menu >>> .el-dialog__body {
height: calc(100% - 72px);
}
.dialog-just-form >>> .el-tabs__content {
.dialog-with-menu >>> .el-tabs__content {
height: calc(100% - 32px);
overflow-y: auto;
padding-right: 12px;
}
.dialog-just-form >>> .el-tabs {
.dialog-with-menu >>> .el-tabs {
height: 100%;
}

View File

@ -6,43 +6,20 @@
-->
<template>
<section class="list-section-with-head">
<BaseSearchForm :id="$attrs.id" :head-title="headConfig.title" :head-config="{ fields: headConfig.form }" @btn-click="handleBtnClick" />
<BaseListTable
:key="headConfig.title"
v-loading="tableLoading"
:table-config="tableConfig.table"
:column-config="tableConfig.column"
:table-data="dataList"
@operate-event="handleOperate"
:refresh-layout-key="refreshLayoutKey"
/>
<BaseSearchForm :id="$attrs.id" :head-title="headConfig.title" :head-config="{ fields: headConfig.form }"
@btn-click="handleBtnClick" />
<BaseListTable :key="headConfig.title" v-loading="tableLoading" :table-config="tableConfig.table"
:column-config="tableConfig.column" :table-data="dataList" @operate-event="handleOperate"
:refresh-layout-key="refreshLayoutKey" />
<el-pagination
@size-change="handleSizeChange"
@current-change="handlePageChange"
:current-page.sync="listQuery.page"
:page-sizes="[1, 5, 10, 20]"
:page-size="listQuery.limit"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
<el-pagination @size-change="handleSizeChange" @current-change="handlePageChange" :current-page.sync="listQuery.page"
:page-sizes="[1, 5, 10, 20]" :page-size="listQuery.limit" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
<DialogJustForm
modal-append-to-body
ref="order-dialog"
v-if="renderDialog"
fullscreen
:configs="dialogConfig"
@destroy-dialog="renderDialog = false"
/>
<DialogWithMenu
modal-append-to-body
ref="menu-dialog"
v-if="renderMenuDialog"
fullscreen
:configs="dialogConfig"
@destroy-dialog="renderMenuDialog = false"
/>
<DialogJustForm modal-append-to-body ref="order-dialog" v-if="renderDialog" fullscreen :configs="dialogConfig"
@destroy-dialog="renderDialog = false" />
<DialogWithMenu modal-append-to-body ref="menu-dialog" v-if="renderMenuDialog" fullscreen :configs="dialogConfig"
@destroy-dialog="renderMenuDialog = false" />
</section>
</template>
@ -165,11 +142,19 @@ export default {
switch (type) {
//
case "confirm-order": {
this.$http
.post("/pms/order/confirm", data, {
headers: {
"Content-Type": "application/json",
},
this.$confirm(`是否要确认订单?`, "提示", {
confirmButtonText: "是",
cancelButtonText: "否",
type: "warning",
})
.then(() => {
return this.$http
.post("/pms/order/confirm", data, {
headers: {
"Content-Type": "application/json",
},
})
})
.then(({ data: res }) => {
if (res.code === 0) {
@ -189,11 +174,11 @@ export default {
}
})
.catch((errMsg) => {
this.$message({
message: errMsg,
type: "error",
duration: 2000,
});
// this.$message({
// message: errMsg,
// type: "error",
// duration: 2000,
// });
});
break;
}
@ -201,11 +186,18 @@ export default {
case "destroy-order":
//
case "end-order": {
this.$http
.post("/pms/order/end", data, {
headers: {
"Content-Type": "application/json",
},
this.$confirm(`确定${type === 'end-order' ? '结束订单' : '废除订单'}?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
return this.$http
.post("/pms/order/end", data, {
headers: {
"Content-Type": "application/json",
},
})
})
.then(({ data: res }) => {
if (res.code === 0) {
@ -225,11 +217,11 @@ export default {
}
})
.catch((errMsg) => {
this.$message({
message: errMsg,
type: "error",
duration: 2000,
});
// this.$message({
// message: errMsg,
// type: "error",
// duration: 2000,
// });
});
break;
}
@ -288,7 +280,7 @@ export default {
}
});
})
.catch((err) => {});
.catch((err) => { });
}
case "edit": {
this.openDialog(data); /** data is ==> id */
@ -358,6 +350,7 @@ export default {
openMenuDialog(row, detail) {
this.renderMenuDialog = true;
console.log("this.renderMenuDialog = true;", row, detail)
this.$nextTick(() => {
this.$refs["menu-dialog"].init(/** some args... */ row, detail);
});

View File

@ -17,8 +17,7 @@
:page-sizes="[1, 5, 10, 20]"
:page-size="listQuery.limit"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
style="text-align: center;"
layout="total, prev, pager, next, jumper"
></el-pagination>
</div>
</template>

View File

@ -127,7 +127,7 @@ export default {
const unwatch = this.$watch(
() => this.dataForm[col.prop],
(newVal) => {
const chosenObject = this.cachedList[col.prop].find((i) => i.id === newVal);
const chosenObject = this.cachedList[col.prop]?.find((i) => i.id === newVal);
if (chosenObject) {
this.$set(this.dataForm, item[0], chosenObject[item[1]]);
}

View File

@ -1,61 +1,40 @@
<template>
<div class="suborder-detail">
<!-- 四分表格/田字格 -->
<el-row :gutter="20">
<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="{
<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="{
table: null,
column: blenderTableProps,
}"
/>
}" />
</el-col>
<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="{
<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="{
table: null,
column: pressTableProps,
}"
/>
}" />
</el-col>
</el-row>
<el-row :gutter="20">
<el-col style="margin-bottom: 12px">
<!-- 窑炉订单 -->
<TablePagi
v-if="order !== null"
:extra-query-fields="{ code: order.code, cate: order.cate }"
:urls="{ page: '/pms/kilnOrder/pageView' }"
:page-is-post="true"
:table-config="{
<TablePagi v-if="order !== null" :extra-query-fields="{ code: order.code, cate: order.cate }"
:urls="{ page: '/pms/kilnOrder/pageView' }" :page-is-post="true" :table-config="{
table: null,
column: kilnTableProps,
}"
/>
}" />
</el-col>
<el-col style="margin-bottom: 12px">
<!-- 检测包装订单 -->
<TablePagi
v-if="order !== null"
:extra-query-fields="{ code: order.code, cate: order.cate }"
:urls="{ page: '/pms/qualityPackOrder/pageView' }"
:page-is-post="true"
:table-config="{
<TablePagi v-if="order !== null" :extra-query-fields="{ code: order.code, cate: order.cate }"
:urls="{ page: '/pms/qualityPackOrder/pageView' }" :page-is-post="true" :table-config="{
table: null,
column: detectionTableProps,
}"
/>
}" />
</el-col>
</el-row>
</div>
@ -65,6 +44,39 @@
import TablePagi from "../TablePagi.vue";
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
const percentComponent = {
name: "PercentComponent",
props: {
injectData: {
type: Object,
default: () => ({})
}
},
data() {
return {
}
},
methods: {
},
render: function (h) {
const value = this.injectData[this.injectData.head.prop]
return h(
'div',
{
style: {
padding: '0 10px',
background: value > 0 && value <= 100 ? '#ffd400' : (value > 100 ? '#6797ff' : 'unset'),
color: value > 100 ? 'white' : 'unset'
}
},
value !== null && value !== undefined ? value + " %" : "-"
)
}
}
export default {
name: "SuborderDetailTag",
components: { TablePagi },
@ -79,9 +91,10 @@ export default {
return {
//
blenderTableProps: [
{ prop: "code", label: "混料订单号" },
{ prop: "percent", label: "进度", filter: (val) => (val !== null && val !== undefined ? val + " %" : "-") },
{ width: 200, prop: "code", label: "混料订单号" },
{ width: 350, prop: "percent", label: "进度", className: 'no-padding-class', subcomponent: percentComponent }, // filter: (val) => (val !== null && val !== undefined ? val + " %" : "-") },
{
width: 575,
prop: "statusDictValue",
label: "订单状态",
filter: (val) => (val !== null && val !== undefined ? ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝"][val] : "-"),
@ -91,7 +104,7 @@ export default {
prop: "operations",
name: "操作",
fixed: "right",
width: 200,
subcomponent: TableOperaionComponent,
options: [
{ name: "edit", label: "编辑", emitFull: true, icon: "edit-outline" },
@ -103,8 +116,8 @@ export default {
refreshLayoutKey1: "",
//
pressTableProps: [
{ prop: "code", label: "压制订单号" },
{ prop: "percent", label: "进度", filter: (val) => (val !== null && val !== undefined ? val + " %" : "-") },
{ width: 200, prop: "code", label: "压制订单号" },
{ width: 350, prop: "percent", label: "进度", filter: (val) => (val !== null && val !== undefined ? val + " %" : "-") },
{
prop: "statusDictValue",
label: "订单状态",
@ -118,7 +131,7 @@ export default {
prop: "operations",
name: "操作",
fixed: "right",
width: 200,
subcomponent: TableOperaionComponent,
options: [{ name: "detach", label: "下发", icon: "bottom-right" }], // , url: '/pms/trans/pressDeli' }]
},
@ -126,16 +139,16 @@ export default {
refreshLayoutKey2: "",
//
kilnTableProps: [
{ prop: "code", label: "烧成订单号" },
{ prop: "percent", label: "进度", filter: (val) => (val !== null && val !== undefined ? val + " %" : "-") },
{ width: 200, prop: "code", label: "烧成订单号" },
{ width: 350, prop: "percent", label: "进度", filter: (val) => (val !== null && val !== undefined ? val + " %" : "-") },
{ prop: "qty", label: "生产量" },
{ prop: "qtyComplete", label: "完成量" },
],
refreshLayoutKey3: "",
//
detectionTableProps: [
{ prop: "code", label: "检测包装订单号" },
{ prop: "percent", label: "进度", filter: (val) => (val !== null && val !== undefined ? val + " %" : "-") },
{ width: 200, prop: "code", label: "检测包装订单号" },
{ width: 350, prop: "percent", label: "进度", filter: (val) => (val !== null && val !== undefined ? val + " %" : "-") },
{ prop: "qty1", label: "检测量" },
{ prop: "qty1Complete", label: "完成量" },
{ prop: "goodqty1", label: "检测合格量" },
@ -144,8 +157,8 @@ export default {
refreshLayoutKey4: "",
};
},
created() {},
mounted() {},
created() { },
mounted() { },
methods: {
init(/** 参数 */) {
// Promise.all(

View File

@ -43,19 +43,29 @@ export default function () {
{ name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "" },
],
finished: [
{ name: 'view-ongoing', label: '查看详情' },
{} // 占位
{ name: 'view-ongoing', label: '查看详情', emitFull: true },
// { name: 'view', label: '查看详情' }
// { name: 'end-order', label: '结束订单', icon: 'error', showText: true },
],
};
const startTimeProp = (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 },
{ width: 120, prop: "code", label: "订单号", fixed: "left" },
{ width: 60, prop: "cate", label: "子号" },
{ width: 60, prop: "statusDictValue", label: "状态", filter: dictFilter("order_status") }, // 不可编辑
{ width: 120, prop: "startTime", label: "开始时间", filter: timeFilter }, // "订单砖数" },
{ width: 120, prop: "planStartTime", label: "计划开始时间", filter: timeFilter }, // "订单砖数" },
...startTimeProp(type),
{ width: 60, prop: "prodqty", label: "数量" }, // "订单砖数" },
{ width: 100, prop: "productCode", label: "物料" }, // "物料编号" }, // select, filterable
{ width: 100, prop: "shapeCode", label: "砖型" }, // "砖型编号" }, // select, filterable
@ -87,7 +97,7 @@ export default function () {
fixed: "right",
subcomponent: TableOperaionComponent,
options: operations[type],
width: operations[type].length * 35,
width: operations[type].length > 1 ? operations[type].length * 35 : 90,
}
// type !== "finished"