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'" :tooltip-effect="head.tooltipEffect || 'light'"
filter-placement="top" filter-placement="top"
:align="head.align || null" :align="head.align || null"
:class-name="head.className ?? 'initial-column-class'"
v-bind="head.more" v-bind="head.more"
:show-overflow-tooltip="head.showOverflowTooltip || !(head.prop === 'operations')" :show-overflow-tooltip="head.showOverflowTooltip || !(head.prop === 'operations')"
> >
@ -133,4 +134,17 @@ export default {
}; };
</script> </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> <template>
<el-dialog <el-dialog
class="dialog-just-form" class="dialog-with-menu"
style="padding: 40px" style="padding: 40px"
:fullscreen="fullscreen" :fullscreen="fullscreen"
:visible="visible" :visible="visible"
@ -113,7 +113,7 @@ export default {
</script> </script>
<style scoped> <style scoped>
.dialog-just-form >>> .el-dialog__body { .dialog-with-menu >>> .el-dialog__body {
padding-top: 40px !important; padding-top: 40px !important;
padding-bottom: 40px !important; padding-bottom: 40px !important;
/* padding-top: 0 !important; /* padding-top: 0 !important;
@ -130,20 +130,21 @@ export default {
width: 100% !important; width: 100% !important;
} }
.dialog-just-form >>> .el-dialog__header { .dialog-with-menu >>> .el-dialog__header {
padding: 0; padding: 0;
/* background: linear-gradient(to bottom, rgba(0, 0, 0, 0.25), white); */ /* 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); height: calc(100% - 72px);
} }
.dialog-just-form >>> .el-tabs__content { .dialog-with-menu >>> .el-tabs__content {
height: calc(100% - 32px); height: calc(100% - 32px);
overflow-y: auto; overflow-y: auto;
padding-right: 12px;
} }
.dialog-just-form >>> .el-tabs { .dialog-with-menu >>> .el-tabs {
height: 100%; height: 100%;
} }

View File

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

View File

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

View File

@ -127,7 +127,7 @@ export default {
const unwatch = this.$watch( const unwatch = this.$watch(
() => this.dataForm[col.prop], () => this.dataForm[col.prop],
(newVal) => { (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) { if (chosenObject) {
this.$set(this.dataForm, item[0], chosenObject[item[1]]); this.$set(this.dataForm, item[0], chosenObject[item[1]]);
} }

View File

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

View File

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