Merge branch 'docs_0815'

This commit is contained in:
lb 2023-08-23 16:38:09 +08:00
commit 521563bd00
30 changed files with 2201 additions and 254 deletions

View File

@ -17,6 +17,7 @@
"babel-plugin-component": "^1.1.1", "babel-plugin-component": "^1.1.1",
"code-brick-zj": "^0.0.7", "code-brick-zj": "^0.0.7",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"dayjs": "^1.11.9",
"echarts": "^5.3.3", "echarts": "^5.3.3",
"element-theme": "^2.0.1", "element-theme": "^2.0.1",
"element-ui": "^2.15.7", "element-ui": "^2.15.7",

Binary file not shown.

View File

@ -538,7 +538,7 @@ img {
.aui-content { .aui-content {
position: relative; position: relative;
padding: $content--padding; padding: $content--padding;
min-height: calc(100vh - #{$navbar--height}); min-height: calc(100vh - 30px - #{$navbar--height});
&__wrapper { &__wrapper {
position: relative; position: relative;
margin-left: $sidebar--width; margin-left: $sidebar--width;
@ -673,7 +673,8 @@ img {
z-index: 830; z-index: 830;
} }
> .el-tab-pane { > .el-tab-pane {
min-height: calc(#{$content--fill-height-tabs}); // min-height: calc(#{$content--fill-height-tabs});
min-height: calc(100vh - 144px);
> .aui-card--fill > .el-card__body { > .aui-card--fill > .el-card__body {
min-height: calc(#{$content--fill-height-tabs} - 2px); min-height: calc(#{$content--fill-height-tabs} - 2px);
} }

View File

@ -77,17 +77,6 @@ export default {
dataForm: {}, dataForm: {},
}; };
}, },
// watch ......
// watch: {
// dataForm: {
// handler: (val) => {
// console.log("[BaseSearchForm::watcher::dataForm]", val);
// },
// deep: true,
// },
// },
created() {}, created() {},
mounted() { mounted() {
console.log("[BaseSearchForm] configs:", JSON.parse(JSON.stringify(this.headConfig))); console.log("[BaseSearchForm] configs:", JSON.parse(JSON.stringify(this.headConfig)));

View File

@ -1,17 +1,14 @@
<template> <template>
<el-dialog <el-dialog
class="dialog-just-form" class="dialog-just-form"
custom-class="pms-dialog"
:visible="dialogVisible" :visible="dialogVisible"
@close="handleClose" @close="handleClose"
:destroy-on-close="false" :width="configs.width || '50%'"
:close-on-click-modal="configs.clickModalToClose ?? false" :destroy-on-close="false">
:width="configs.dialogWidth ?? '50%'"> <span slot="title" class="dialog-title">
<!-- title -->
<div slot="title" class="dialog-title">
<h1 class="">
{{ detailMode ? "查看详情" : dataForm.id ? "编辑" : "新增" }} {{ detailMode ? "查看详情" : dataForm.id ? "编辑" : "新增" }}
</h1> </span>
</div>
<!-- form --> <!-- form -->
<el-form ref="dataForm" :model="dataForm" v-loading="loadingStatus"> <el-form ref="dataForm" :model="dataForm" v-loading="loadingStatus">
@ -75,7 +72,9 @@
:label="opt.label" :label="opt.label"
:value="opt.value"> :value="opt.value">
<span>{{ opt.label }}</span> <span>{{ opt.label }}</span>
<span v-if="col.customLabel" style="display: inline-clock; margin-left: 12px; font-size: 0.9em"> <span
v-if="col.customLabel"
style="display: inline-clock; margin-left: 12px; font-size: 0.9em">
{{ opt[col.customLabel] || "无描述" }} {{ opt[col.customLabel] || "无描述" }}
</span> </span>
<template v-if="col.customLabels"> <template v-if="col.customLabels">
@ -787,20 +786,19 @@ export default {
<style scoped> <style scoped>
.dialog-just-form >>> .el-dialog__body { .dialog-just-form >>> .el-dialog__body {
/* padding-top: 16px !important;
padding-bottom: 16px !important; */
padding-top: 0 !important; padding-top: 0 !important;
padding-bottom: 0 !important; padding-bottom: 0 !important;
} }
.dialog-just-form >>> .el-form {
padding: 16px;
max-height: 56vh;
overflow-y: auto;
}
.el-select, .el-select,
.el-cascader, .el-cascader,
.el-date-editor { .el-date-editor {
width: 100% !important; width: 100% !important;
} }
.dialog-just-form >>> .el-dialog__header {
padding: 10px 20px 10px;
/* background: linear-gradient(to bottom, rgba(0, 0, 0, 0.25), white); */
}
</style> </style>

View File

@ -4,6 +4,7 @@
element-loading-text="处理中,请耐心等待..." element-loading-text="处理中,请耐心等待..."
element-loading-background="rgba(0,0,0,0.1)" element-loading-background="rgba(0,0,0,0.1)"
class="dialog-just-form" class="dialog-just-form"
custom-class="pms-dialog"
:visible="visible" :visible="visible"
@close="handleClose" @close="handleClose"
width="30%" width="30%"
@ -229,7 +230,7 @@ export default {
/* padding-top: 16px !important; /* padding-top: 16px !important;
padding-bottom: 16px !important; */ padding-bottom: 16px !important; */
padding-top: 0 !important; padding-top: 0 !important;
padding-bottom: 0 !important; padding-bottom: 12px !important;
} }
.el-select, .el-select,
@ -238,11 +239,6 @@ export default {
width: 100% !important; width: 100% !important;
} }
.dialog-just-form >>> .el-dialog__header {
padding: 10px 20px 10px;
/* background: linear-gradient(to bottom, rgba(0, 0, 0, 0.25), white); */
}
.h0 { .h0 {
height: 0; height: 0;
width: 0; width: 0;

View File

@ -12,12 +12,9 @@
:destroy-on-close="false" :destroy-on-close="false"
@close="handleClose" @close="handleClose"
:close-on-click-modal="configs.clickModalToClose ?? false"> :close-on-click-modal="configs.clickModalToClose ?? false">
<!-- title --> <h1 slot="title" class="dialog-title">
<div slot="title" class="dialog-title">
<h1 class="">
{{ detailMode ? "查看详情" : dataForm.id ? "编辑" : "新增" }} {{ detailMode ? "查看详情" : dataForm.id ? "编辑" : "新增" }}
</h1> </h1>
</div>
<div class="dialog-body__inner relative"> <div class="dialog-body__inner relative">
<!-- v-if="dataForm.id && !detailMode && /属性|详情/.test(activeMenu) && $hasPermission()" --> <!-- v-if="dataForm.id && !detailMode && /属性|详情/.test(activeMenu) && $hasPermission()" -->
@ -100,7 +97,9 @@
:label="opt.label" :label="opt.label"
:value="opt.value"> :value="opt.value">
<span>{{ opt.label }}</span> <span>{{ opt.label }}</span>
<span v-if="col.customLabel" style="display: inline-clock; margin-left: 12px; font-size: 0.9em"> <span
v-if="col.customLabel"
style="display: inline-clock; margin-left: 12px; font-size: 0.9em">
{{ opt[col.customLabel] || "无描述" }} {{ opt[col.customLabel] || "无描述" }}
</span> </span>
</el-option> </el-option>
@ -169,7 +168,9 @@
<!-- 附件标签页 --> <!-- 附件标签页 -->
<div v-if="dataForm.id && tab.key === 'attachment'" key="attachment"> <div v-if="dataForm.id && tab.key === 'attachment'" key="attachment">
<div class="upload-tips" style="font-size: 0.8em; margin-bottom: 12px">文件大小不要超过 2MB</div> <div class="upload-tips" style="font-size: 0.8em; margin-bottom: 12px">
文件大小不要超过 2MB
</div>
<!-- 附件列表 --> <!-- 附件列表 -->
<div class="" v-loading="loadingStatus"> <div class="" v-loading="loadingStatus">
<ul class="file-list"> <ul class="file-list">
@ -297,7 +298,8 @@ export default {
if (res.code === 0) { if (res.code === 0) {
if (col.cacheFetchedData) { if (col.cacheFetchedData) {
// cache fetched data // cache fetched data
cached[col.prop] = "list" in res.data ? res.data.list : Array.isArray(res.data) ? res.data : []; cached[col.prop] =
"list" in res.data ? res.data.list : Array.isArray(res.data) ? res.data : [];
} }
if (!col.options || !col.options.length) { if (!col.options || !col.options.length) {
@ -329,7 +331,9 @@ export default {
} }
// col.options = res.data.list; // col.options = res.data.list;
else if (col.options.length) { else if (col.options.length) {
"list" in res.data ? res.data.list.unshift(...col.options) : res.data.unshift(...col.options); "list" in res.data
? res.data.list.unshift(...col.options)
: res.data.unshift(...col.options);
this.$set( this.$set(
col, col,
"options", "options",
@ -438,11 +442,16 @@ export default {
() => this.dataForm[col.prop], () => this.dataForm[col.prop],
(val) => { (val) => {
if (val && col.prop in this.cached) { if (val && col.prop in this.cached) {
console.log("here changeReflects", col.prop, col.changeReflects.toProp, this.cached[col.prop]); console.log(
"here changeReflects",
col.prop,
col.changeReflects.toProp,
this.cached[col.prop]
);
if (typeof col.changeReflects.fromKey === "string") { if (typeof col.changeReflects.fromKey === "string") {
this.dataForm[col.changeReflects.toProp] = this.cached[col.prop].find((item) => item.id === val)?.[ this.dataForm[col.changeReflects.toProp] = this.cached[col.prop].find(
col.changeReflects.fromKey (item) => item.id === val
]; )?.[col.changeReflects.fromKey];
} else if (Array.isArray(col.changeReflects.fromKey) && col.changeReflects.delimiter) { } else if (Array.isArray(col.changeReflects.fromKey) && col.changeReflects.delimiter) {
const foundItem = (this.dataForm[col.changeReflects.toProp] = this.cached[col.prop].find( const foundItem = (this.dataForm[col.changeReflects.toProp] = this.cached[col.prop].find(
(item) => item.id === val (item) => item.id === val
@ -510,7 +519,9 @@ export default {
const addMode = !operate.showOnEdit && !this.dataForm.id; const addMode = !operate.showOnEdit && !this.dataForm.id;
const permission = operate.permission ? this.$hasPermission(operate.permission) : true; const permission = operate.permission ? this.$hasPermission(operate.permission) : true;
const currentMenuKey = this.configs.menu.find((item) => item.name === this.activeMenu)?.key; const currentMenuKey = this.configs.menu.find((item) => item.name === this.activeMenu)?.key;
return notDetailMode && (showAlways || ((editMode || addMode) && permission)) && currentMenuKey === "info"; return (
notDetailMode && (showAlways || ((editMode || addMode) && permission)) && currentMenuKey === "info"
);
}, },
resetForm(excludeId = false, immediate = false) { resetForm(excludeId = false, immediate = false) {
@ -975,7 +986,8 @@ export default {
case "delete": { case "delete": {
// //
console.log("delete....", data); console.log("delete....", data);
const itemName = typeof data === "object" ? data.attrName || data.name || data.material || data.id : data; const itemName =
typeof data === "object" ? data.attrName || data.name || data.material || data.id : data;
return this.$confirm(`是否删除条目: ${itemName}`, "提示", { return this.$confirm(`是否删除条目: ${itemName}`, "提示", {
confirmButtonText: "确认", confirmButtonText: "确认",
cancelButtonText: "我再想想", cancelButtonText: "我再想想",
@ -1024,10 +1036,6 @@ export default {
/* background: #0f02 !important; */ /* background: #0f02 !important; */
} }
/* .el-menu--horizontal > .el-menu-item.is-active { */
/* border-bottom-color: #0b58ff; */
/* } */
.dialog-with-menu >>> .el-dialog__body { .dialog-with-menu >>> .el-dialog__body {
/* padding-top: 16px !important; /* padding-top: 16px !important;
padding-bottom: 16px !important; */ padding-bottom: 16px !important; */
@ -1035,16 +1043,15 @@ export default {
padding-bottom: 0 !important; padding-bottom: 0 !important;
} }
/* .dialog-with-menu >>> .dialog-body__inner {
padding: 16px;
} */
.el-select, .el-select,
.el-cascader { .el-cascader {
width: 100% !important; width: 100% !important;
} }
.dialog-with-menu >>> .el-dialog__header {
padding: 10px 20px 10px;
/* background: linear-gradient(to bottom, rgba(0, 0, 0, 0.25), white); */
}
.relative { .relative {
position: relative; position: relative;
} }

View File

@ -193,6 +193,7 @@ export default {
this.dataForm = res.data; this.dataForm = res.data;
await this.printByLocalData(res.data); await this.printByLocalData(res.data);
await this.getPrintStatus(id);
}, },
async printByLocalData(data) { async printByLocalData(data) {
@ -201,7 +202,6 @@ export default {
// HU // HU
await this.paintQrCode(data.hu || "- 无HU数据 -"); await this.paintQrCode(data.hu || "- 无HU数据 -");
await this.handlePrint(); await this.handlePrint();
await this.getPrintStatus();
}, },
initPrintPlugin() { initPrintPlugin() {
@ -267,7 +267,7 @@ export default {
}); });
}, },
getPrintStatus() { getPrintStatus(id) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (!this.jobId || !this.lodop) reject(-1); if (!this.jobId || !this.lodop) reject(-1);
this.lodop.SET_PRINT_MODE("CATCH_PRINT_STATUS", true); this.lodop.SET_PRINT_MODE("CATCH_PRINT_STATUS", true);
@ -278,7 +278,7 @@ export default {
// //
this.sendSuccess() this.sendSuccess()
.then(() => { .then(() => {
this.$message.success("打印成功"); this.$message.success(`打印 ${id} 成功`);
this.$emit("refresh-list"); this.$emit("refresh-list");
resolve(); resolve();
}) })
@ -287,7 +287,7 @@ export default {
reject(err); reject(err);
}); });
} else { } else {
this.$message.error("打印失败"); this.$message.error(`打印 ${id} 失败`);
} }
}; };
this.lodop.GET_VALUE("PRINT_STATUS_OK", this.jobId); this.lodop.GET_VALUE("PRINT_STATUS_OK", this.jobId);

View File

@ -0,0 +1,345 @@
<!--
filename: ReportDialog.vue
author: liubin
date: 2023-08-17 14:46:32
description: 报工弹窗
-->
<template>
<el-dialog
:visible.sync="visible"
width="700px"
v-bind="$attrs"
@close="close"
@closed="$emit('destroy')"
custom-class="pms-dialog">
<!-- :class="{ 'pms-dialog--rotate-down': startLeave }"> -->
<span slot="title" class="dialog-title">报工预览</span>
<!-- 面包屑导航 -->
<div style="padding: 12px; background: #f7f7f7">
<el-breadcrumb separator="/">
<el-breadcrumb-item>预报工单</el-breadcrumb-item>
<el-breadcrumb-item v-if="mode.includes('form')">编辑</el-breadcrumb-item>
</el-breadcrumb>
</div>
<transition class="l" mode="out-in">
<BaseListTable
v-if="mode.includes('table')"
v-loading="loading"
:column-config="tableProps"
:table-data="dataList"
@operate-event="handleOperate"
:current-page="page"
:current-size="size" />
<el-form
v-if="mode.includes('form')"
ref="dataForm"
:model="dataForm"
size="small"
style="padding: 16px"
v-loading="formLoading">
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="订单号" prop="orderCode" :rules="null">
<el-input v-model="dataForm.orderCode" disabled placeholder="-" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="订单子号" prop="orderCate" :rules="null">
<el-input v-model="dataForm.orderCate" disabled placeholder="-" />
</el-form-item>
</el-col>
<el-col :span="8">
<!-- 总量 - 前端计算 -->
<el-form-item label="生产总量" prop="qty" :rules="null">
<el-input v-model="dataForm.qty" disabled placeholder="-" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="合格砖数量" prop="goodqty" :rules="[$fv.isRequired, $fv.isNumber]">
<el-input v-model="dataForm.goodqty" placeholder="请输入合格砖数量" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="报废砖数量" prop="badqty" :rules="[$fv.isRequired, $fv.isNumber]">
<el-input v-model="dataForm.badqty" placeholder="请输入报废砖数量" />
</el-form-item>
</el-col>
<el-col :span="8">
<!-- 报废率 - 前端计算 -->
<el-form-item label="报废率" prop="badratio" :rules="null">
<el-input v-model="dataForm.badratio" disabled placeholder="-" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="报工班次" prop="team" :rules="null">
<el-select v-model="dataForm.team" placeholder="请选择报工班次">
<el-option label="早班" value="0" />
<el-option label="中班" value="1" />
<el-option label="晚班" value="2" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8" style="padding-top: 32px">
<el-button type="primary" size="small" @click="handleSaveEdit">预保存</el-button>
<el-button size="small" @click="mode = 'table'">取消</el-button>
</el-col>
</el-row>
</el-form>
</transition>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="close">取消</el-button>
<el-button size="small" type="primary" @click="handleConfirm">提交更改</el-button>
</div>
</el-dialog>
</template>
<script>
import BaseListTable from "@/components/BaseListTable.vue";
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
export default {
name: "ReportDialog",
components: { BaseListTable },
props: ["ids"],
data() {
return {
mode: "table",
visible: false,
loading: false,
dataList: [],
page: 1,
dataForm: {
id: null,
orderCate: null,
orderCode: null,
qty: null,
goodqty: null,
badqty: null,
badratio: null,
team: null,
},
formLoading: false,
dataFormList: [],
tableProps: [
{ prop: "orderCode", label: "订单号" },
{ prop: "orderCate", label: "订单子号" },
{ width: 90, prop: "qty", label: "生产量" },
{ width: 90, prop: "goodqty", label: "合格数量" },
{ width: 90, prop: "badqty", label: "报废数量" },
{ width: 90, prop: "badratio", label: "报废率", filter: (val) => (val ?? "-") + "%" },
{
width: 64,
prop: "team",
label: "班次",
filter: (val) => (val != null ? ["早班", "中班", "晚班"][val] : "-"),
},
{
prop: "operations",
name: "操作",
fixed: "right",
width: 90,
subcomponent: TableOperaionComponent,
options: [
{ name: "edit", label: "编辑", icon: "edit-outline", emitFull: true },
// {
// name: "delete",
// icon: "delete",
// label: "",
// emitFull: true,
// permission: "pms:carOrderReport:delete",
// },
],
},
],
currentEditing: null,
};
},
computed: {
size() {
return this.dataList.length;
},
},
watch: {
"dataForm.goodqty"(val) {
const qty = +val + +this.dataForm.badqty;
this.dataForm.qty = qty;
this.dataForm.badratio = ((+this.dataForm.badqty / qty) * 100).toFixed(2);
},
"dataForm.badqty"(val) {
const qty = +val + +this.dataForm.goodqty;
this.dataForm.qty = qty;
this.dataForm.badratio = ((+val / qty) * 100).toFixed(2);
},
},
methods: {
async init() {
this.visible = true;
this.loading = true;
const { data: res } = await this.$http.post("/pms/workReport/pressReportPre", {
datas: [],
ids: this.ids,
});
if (res.code === 0) {
this.dataList = res.data.map((item, index) => ({
...item,
qty: item.goodqty + item.badqty,
// __LOCAL_INDEX
__LOCAL_INDEX: index,
}));
}
this.loading = false;
},
close() {
this.visible = false;
},
handleOperate({ type, data }) {
console.log("payload", type, data);
switch (type) {
case "edit":
this.mode = "form";
this.currentEditing = data.__LOCAL_INDEX;
const { id, orderCate, orderCode, qty, goodqty, badqty, badratio, team } = data;
this.dataForm = {
id,
orderCate,
orderCode,
qty,
goodqty,
badqty,
badratio,
team,
};
break;
}
},
async handleConfirm() {
this.loading = true;
const { data: res } = await this.$http.post("/pms/workReport/pressReport", {
datas: this.dataList,
ids: this.ids,
});
this.loading = false;
if (res.code === 0) {
this.$message.success("提交成功");
this.$emit('refresh-list')
this.close();
}
},
//
handleSaveEdit() {
Object.keys(this.dataForm).forEach((key) => {
this.dataList[this.currentEditing][key] = this.dataForm[key];
});
this.mode = "table";
this.$nextTick(() => {
this.clearDataForm();
});
},
//
clearDataForm() {
this.currentEditing = null;
this.dataForm = {
id: null,
orderCate: null,
orderCode: null,
qty: null,
goodqty: null,
badqty: null,
badratio: null,
team: null,
};
},
},
};
</script>
<style scoped>
.dialog-just-form >>> .dialog-title {
color: #000;
}
.dialog-just-form >>> .el-dialog__body {
/* padding-top: 16px !important;
padding-bottom: 16px !important; */
padding-top: 0 !important;
padding-bottom: 0 !important;
}
.el-select,
.el-cascader,
.el-date-editor {
width: 100% !important;
}
.dialog-just-form >>> .el-dialog__header {
padding: 10px 20px 10px;
/* background: linear-gradient(to bottom, rgba(0, 0, 0, 0.25), white); */
}
</style>
<style>
.pms-dialog {
box-shadow: 0 0 24px 8px rgba(0, 0, 0, 0.125);
border-radius: 4px;
transition: transform 1.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}
.pms-dialog .el-dialog__header {
padding: 16px;
border-bottom: 1px solid #eaeaea;
}
.pms-dialog .el-dialog__header .dialog-title {
font-size: 1.2rem;
}
.pms-dialog .el-dialog__body {
padding: 0;
overflow-x: hidden;
}
.pms-dialog .el-dialog__footer {
background: #fafafa;
min-height: 3.2rem;
padding: 0;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
text-align: unset;
display: flex;
justify-content: flex-end;
padding: 8px 16px;
align-items: center;
}
.v-enter,
.v-leave-to {
opacity: 0;
/* transform: translateX(20px); */
transform: scale(0);
}
.v-enter-active,
.v-leave-active {
transition: all 0.3s;
}
.v-enter-to,
.v-leave {
/* transform: translateX(0); */
transform: scale(1);
}
</style>

View File

@ -0,0 +1,185 @@
<!--
filename: palletDialog.vue
author: liubin
date: 2023-08-22 09:15:49
description: 生成托盘弹窗
-->
<template>
<el-dialog
:visible.sync="visible"
width="500px"
v-bind="$attrs"
@close="close"
@closed="$emit('destroy')"
custom-class="pms-dialog">
<!-- :class="{ 'pms-dialog--rotate-down': startLeave }"> -->
<span slot="title" class="dialog-title">生成托盘</span>
<el-form ref="dataForm" :model="dataForm" size="small" style="padding: 16px" v-loading="formLoading">
<el-row :gutter="20">
<el-col>
<el-form-item label="订单号" prop="orderId" :rules="null">
<el-select v-model="dataForm.orderId" filterable clearable placeholder="请选择订单号">
<el-option v-for="o in orderList" :key="o.id" :label="o.code" :value="o.id">
<div class="option-label">
<span>{{ o.code }}</span>
<span>{{ o.cate }}</span>
</div>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row v-if="ids.length > 0" :gutter="20">
<el-col>
<el-form-item label="尾托" prop="ids" :rules="null">
<el-input disabled v-model="ids[0].orderCode" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="close">取消</el-button>
<el-button size="small" type="primary" @click="handleConfirm">生成</el-button>
</div>
</el-dialog>
</template>
<script>
export default {
name: "PalletDialog",
components: {},
props: ["ids"],
data() {
return {
visible: false,
loading: false,
orderList: [],
dataForm: {
orderId: null,
ids: [],
},
formLoading: false,
};
},
methods: {
async init() {
this.visible = true;
this.loading = true;
//
const { data: res } = await this.$http.post("/pms/order/listWithStock");
if (res.code === 0) {
this.orderList = res.data.map((item, index) => ({
code: item.code, //
cate: item.cate, //
id: item.id, // id
}));
}
this.loading = false;
},
close() {
this.visible = false;
},
async handleConfirm() {
this.loading = true;
const { data: res } = await this.$http.post("/pms/pallet/newPallet", this.dataForm);
this.loading = false;
if (res.code === 0) {
this.$message.success("提交成功");
this.$emit("refresh-list");
this.close();
}
},
//
clearDataForm() {
this.dataForm = {
orderId: null,
ids: [],
};
},
},
};
</script>
<style scoped>
.dialog-just-form >>> .dialog-title {
color: #000;
}
.dialog-just-form >>> .el-dialog__body {
/* padding-top: 16px !important;
padding-bottom: 16px !important; */
padding-top: 0 !important;
padding-bottom: 0 !important;
}
.el-select,
.el-cascader,
.el-date-editor {
width: 100% !important;
}
.dialog-just-form >>> .el-dialog__header {
padding: 10px 20px 10px;
/* background: linear-gradient(to bottom, rgba(0, 0, 0, 0.25), white); */
}
</style>
<style>
.pms-dialog {
box-shadow: 0 0 24px 8px rgba(0, 0, 0, 0.125);
border-radius: 4px;
transition: transform 1.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}
.pms-dialog .el-dialog__header {
padding: 16px;
border-bottom: 1px solid #eaeaea;
}
.pms-dialog .el-dialog__header .dialog-title {
font-size: 1.2rem;
}
.pms-dialog .el-dialog__body {
padding: 0;
overflow-x: hidden;
}
.pms-dialog .el-dialog__footer {
background: #fafafa;
min-height: 3.2rem;
padding: 0;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
text-align: unset;
display: flex;
justify-content: flex-end;
padding: 8px 16px;
align-items: center;
}
.option-label {
display: flex;
align-items: center;
}
.option-label > span {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.option-label > span:first-child {
width: 128px;
margin-right: 8px;
}
/* .option-label > span:last-child {
} */
</style>

View File

@ -23,7 +23,8 @@ import { hasPermission, getDictLabel } from '@/utils'
import cloneDeep from 'lodash/cloneDeep' import cloneDeep from 'lodash/cloneDeep'
// main.js // main.js
import myComponents from 'code-brick-zj' import myComponents from 'code-brick-zj'
// 表单验证
import { formValidateRules } from '@/utils/validate'
// import mocks from './mocks' // import mocks from './mocks'
@ -44,6 +45,7 @@ Vue.use(myComponents)
Vue.prototype.$http = http Vue.prototype.$http = http
Vue.prototype.$hasPermission = hasPermission Vue.prototype.$hasPermission = hasPermission
Vue.prototype.$getDictLabel = getDictLabel Vue.prototype.$getDictLabel = getDictLabel
Vue.prototype.$fv = formValidateRules
// 保存整站vuex本地储存初始状态 // 保存整站vuex本地储存初始状态
window.SITE_CONFIG['storeState'] = cloneDeep(store.state) window.SITE_CONFIG['storeState'] = cloneDeep(store.state)

View File

@ -2,30 +2,47 @@
* 邮箱 * 邮箱
* @param {*} s * @param {*} s
*/ */
export function isEmail (s) { export function isEmail(s) {
return /^([a-zA-Z0-9._-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(s) return /^([a-zA-Z0-9._-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(s);
} }
/** /**
* 手机号码 * 手机号码
* @param {*} s * @param {*} s
*/ */
export function isMobile (s) { export function isMobile(s) {
return /^1[0-9]{10}$/.test(s) return /^1[0-9]{10}$/.test(s);
} }
/** /**
* 电话号码 * 电话号码
* @param {*} s * @param {*} s
*/ */
export function isPhone (s) { export function isPhone(s) {
return /^([0-9]{3,4}-)?[0-9]{7,8}$/.test(s) return /^([0-9]{3,4}-)?[0-9]{7,8}$/.test(s);
} }
/** /**
* URL地址 * URL地址
* @param {*} s * @param {*} s
*/ */
export function isURL (s) { export function isURL(s) {
return /^http[s]?:\/\/.*/.test(s) return /^http[s]?:\/\/.*/.test(s);
} }
/**
* 表单验证
*/
export const formValidateRules = {
isRequired: {
required: true,
message: "必填项",
trigger: "blur",
},
isNumber: {
type: "number",
message: "请输入正确的数字类型",
trigger: "blur",
transform: (val) => Number(val),
},
};

View File

@ -63,6 +63,20 @@
<Overlay v-if="overlayVisible" /> <Overlay v-if="overlayVisible" />
<PrintDom ref="print" v-if="printDOMmount" @destroy="printDOMmount = false" @refresh-list="getList" /> <PrintDom ref="print" v-if="printDOMmount" @destroy="printDOMmount = false" @refresh-list="getList" />
<ReportDialog
ref="car-report-dialog"
v-if="carReportDialogVisible"
@destroy="carReportDialogVisible = false"
@refresh-list="getList"
:ids="tableSelectedIds" />
<PalletDialog
ref="pallet-dialog"
v-if="palletDialogVisible"
@destroy="palletDialogVisible = false"
@refresh-list="getList"
:ids="tableSelectedIds" />
</div> </div>
</template> </template>
@ -77,6 +91,8 @@ import Overlay from "@/components/Overlay.vue";
import moment from "moment"; import moment from "moment";
import AttachmentDialog from "@/components/attachmentDialog.vue"; import AttachmentDialog from "@/components/attachmentDialog.vue";
import PrintDom from "../../components/PrintDom.vue"; import PrintDom from "../../components/PrintDom.vue";
import ReportDialog from "../../components/ReportDialog.vue";
import PalletDialog from "../../components/palletDialog.vue";
const DIALOG_WITH_MENU = "DialogWithMenu"; const DIALOG_WITH_MENU = "DialogWithMenu";
const DIALOG_JUST_FORM = "DialogJustForm"; const DIALOG_JUST_FORM = "DialogJustForm";
@ -94,6 +110,8 @@ export default {
Overlay, Overlay,
AttachmentDialog, AttachmentDialog,
PrintDom, PrintDom,
ReportDialog,
PalletDialog,
}, },
props: { props: {
navigator: { navigator: {
@ -181,6 +199,9 @@ export default {
needAttachmentDialog: false, needAttachmentDialog: false,
tableSelectedIds: [], tableSelectedIds: [],
printDOMmount: false, printDOMmount: false,
queryParams: {},
carReportDialogVisible: false,
palletDialogVisible: false,
}; };
}, },
inject: ["urls"], inject: ["urls"],
@ -190,6 +211,20 @@ export default {
"defaultPageSize" in this.tableConfig.column ? this.tableConfig.column.defaultPageSize : 20; "defaultPageSize" in this.tableConfig.column ? this.tableConfig.column.defaultPageSize : 20;
this.size = size; this.size = size;
// listQueryExtra queryParams
if (this.listQueryExtra && Array.isArray(this.listQueryExtra)) {
this.listQueryExtra.map((item) => {
if (typeof item === "string") this.$set(this.queryParams, item, "");
else if (typeof item === "object") {
Object.keys(item).forEach((key) => {
this.$set(this.queryParams, key, item[key]);
});
}
});
}
console.log("this.queryParams is: ", JSON.stringify(this.queryParams));
this.initDataWhenLoad && this.getList(); this.initDataWhenLoad && this.getList();
}, },
methods: { methods: {
@ -203,27 +238,21 @@ export default {
page: this.page, page: this.page,
limit: this.size, limit: this.size,
}; };
// this.dataList = [{}];
if (!queryParams && this.listQueryExtra && this.listQueryExtra.length) { // this.tableLoading = false;
this.listQueryExtra.map((nameOrObj) => { // return;
if (typeof nameOrObj === "string") params[nameOrObj] = "";
else if (typeof nameOrObj === "object") {
Object.keys(nameOrObj).forEach((key) => {
params[key] = nameOrObj[key];
});
}
});
this.cachedSearchCondition = Object.assign({}, params);
}
this.$http[this.urls.pageIsPostApi ? "post" : "get"]( this.$http[this.urls.pageIsPostApi ? "post" : "get"](
this.urls.page, this.urls.page,
this.urls.pageIsPostApi this.urls.pageIsPostApi
? { ? {
...this.queryParams,
...params, ...params,
} }
: { : {
params, params: {
...this.queryParams,
...params,
},
} }
) )
.then(({ data: res }) => { .then(({ data: res }) => {
@ -232,14 +261,6 @@ export default {
if (res.code === 0) { if (res.code === 0) {
// page : // page :
if ("list" in res.data) { 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 */ /** 破碎记录的特殊需求:数据要结合单位 material + materialUnitDictValue */
if ("attachDictValue" in this.tableConfig.column) { if ("attachDictValue" in this.tableConfig.column) {
this.dataList = res.data.list.map((row) => { this.dataList = res.data.list.map((row) => {
@ -248,12 +269,6 @@ export default {
}); });
} else this.dataList = res.data.list; } else this.dataList = res.data.list;
this.totalPage = res.data.total;
} else if ("records" in res.data) {
this.dataList = res.data.records.map((item) => ({
...item,
id: item._id ?? item.id,
}));
this.totalPage = res.data.total; this.totalPage = res.data.total;
} else if (Array.isArray(res.data)) { } else if (Array.isArray(res.data)) {
this.dataList = res.data; this.dataList = res.data;
@ -621,12 +636,7 @@ export default {
cancelButtonText: "我再想想", cancelButtonText: "我再想想",
type: "warning", type: "warning",
}) })
.then(() => { .then(this.printOnce.bind(null, data))
this.printDOMmount = true;
this.$nextTick(() => {
this.$refs["print"].print(data);
});
})
.catch((err) => { .catch((err) => {
// console.log("cancel ", err); // console.log("cancel ", err);
}); });
@ -658,43 +668,71 @@ export default {
case "导入": case "导入":
this.openUploadDialog(); this.openUploadDialog();
break; break;
case "导出":
this.$http({
method: "post",
url: this.urls.export,
data: { page: this.page },
responseType: "blob",
}).then((res) => {
// console.log("", res);
const filename = res.headers['content-disposition'].split('filename=')[1];
const blob = new Blob([res.data]);
/** 通知 */
this.$notify({
title: "成功",
message: "开始下载",
type: "success",
duration: 1200,
});
if ("download" in document.createElement("a")) {
const alink = document.createElement("a");
alink.download = filename;
alink.style.display = "none";
alink.target = "_blank";
alink.href = URL.createObjectURL(blob);
document.body.appendChild(alink);
alink.click();
URL.revokeObjectURL(alink.href);
document.body.removeChild(alink);
} else {
navigator.msSaveBlob(blob, filename);
}
});
break;
case "手动添加": { case "手动添加": {
this.openDialog(); this.openDialog();
return; return;
} }
case "查询": { case "查询": {
if (typeof payload === "object") { const params = Object.assign({}, payload);
// BaseSearchForm
Object.assign(this.cachedSearchCondition, payload); if ("timerange" in params) {
if ("timerange" in payload) { if (!!params.timerange) {
if (!!payload.timerange) { const [startTime, endTime] = params["timerange"];
const [startTime, endTime] = payload["timerange"]; params.startTime = moment(startTime).format("YYYY-MM-DDTHH:mm:ss");
this.cachedSearchCondition.startTime = moment(startTime).format("YYYY-MM-DDTHH:mm:ss"); params.endTime = moment(endTime).format("YYYY-MM-DDTHH:mm:ss");
this.cachedSearchCondition.endTime = moment(endTime).format("YYYY-MM-DDTHH:mm:ss");
} else { } else {
delete this.cachedSearchCondition.startTime; params.startTime = null;
delete this.cachedSearchCondition.endTime; params.endTime = null;
}
delete this.cachedSearchCondition.timerange;
} }
delete params.timerange;
} }
/** 处理 listQueryExtra 里的数据 */ // console.log(
this.listQueryExtra?.map((cond) => { // " params",
if (typeof cond === "string") { // JSON.stringify({
if (!!payload[cond]) { // // ...this.queryParams,
this.cachedSearchCondition[cond] = payload[cond]; // ...params,
} else { // })
this.cachedSearchCondition[cond] = ""; // );
}
} else if (typeof cond === "object") { this.queryParams = {
Object.keys(cond).forEach((key) => { ...this.queryParams,
this.cachedSearchCondition[key] = cond[key]; ...params,
}); };
}
}); this.getList();
console.log("查询", this.cachedSearchCondition);
this.getList(this.cachedSearchCondition);
break; break;
} }
case "同步": case "同步":
@ -718,7 +756,72 @@ export default {
}); });
}); });
break; break;
case "打印":
if (this.tableSelectedIds.length === 0) {
return this.$message({
message: "请先选择要打印的项",
type: "warning",
duration: 1500,
});
} }
return this.$confirm("开始打印么", "提示", {
confirmButtonText: "确认",
cancelButtonText: "我再想想",
type: "warning",
})
.then(() => {
console.log("打印如下这些 ids:", this.tableSelectedIds);
// this.tableSelectedIds.reduce(async (id, _) => {
// await this.printOnce(id);
// })
this.tableSelectedIds.forEach(async (id) => {
await this.printOnce(id);
});
})
.catch((err) => {
this.$message.error(`批量打印出错: ${err}`);
});
case "报工":
console.log("报工ids:", this.tableSelectedIds);
this.carReportDialogVisible = true;
this.$nextTick(() => {
this.$refs["car-report-dialog"].init();
});
break;
case "生成托盘":
if (this.tableSelectedIds.length > 1) {
return this.$message({
message: "只能选择一项",
type: "warning",
duration: 1500,
});
}
// // -
// if (this.tableSelectedIds.length == 1 && this.tableSelectedIds[0].typeDictValue != "2") {
// return this.$message({
// message: "",
// type: "warning",
// duration: 1500,
// });
// }
this.palletDialogVisible = true;
this.$nextTick(() => {
this.$refs["pallet-dialog"].init();
});
break;
}
},
/** 打印一次 */
printOnce(id) {
return new Promise((resolve) => {
this.printDOMmount = true;
this.$nextTick(async () => {
console.log("[Print] 打印项:", id);
await this.$refs["print"].print(id);
resolve();
});
});
}, },
/** 导航器的操作 */ /** 导航器的操作 */
@ -726,12 +829,12 @@ export default {
// val // val
this.page = 1; this.page = 1;
this.size = val; this.size = val;
this.getList(this.cachedSearchCondition); this.getList();
}, },
handlePageChange(val) { handlePageChange(val) {
// val // val
this.getList(this.cachedSearchCondition); this.getList();
}, },
/** 打开对话框 */ /** 打开对话框 */

View File

@ -86,10 +86,23 @@ export default {
dialogBomCode: "", dialogBomCode: "",
overlayVisible: false, overlayVisible: false,
cachedSearchCondition: {}, cachedSearchCondition: {},
queryParams: {},
}; };
}, },
inject: ["urls"], inject: ["urls"],
mounted() { mounted() {
// listQueryExtra queryParams
if (this.listQueryExtra && Array.isArray(this.listQueryExtra)) {
this.listQueryExtra.map((item) => {
if (typeof item === "string") this.$set(this.queryParams, item, "");
else if (typeof item === "object") {
Object.keys(item).forEach((key) => {
this.$set(this.queryParams, key, item[key]);
});
}
});
}
this.initDataWhenLoad && this.getList(); this.initDataWhenLoad && this.getList();
}, },
methods: { methods: {
@ -104,17 +117,6 @@ export default {
limit: this.size, limit: this.size,
}; };
if (!queryParams && this.listQueryExtra && this.listQueryExtra.length) {
this.listQueryExtra.map((nameOrObj) => {
if (typeof nameOrObj === "string") params[nameOrObj] = "";
else if (typeof nameOrObj === "object") {
Object.keys(nameOrObj).forEach((key) => {
params[key] = nameOrObj[key];
});
}
});
}
// if (this.urls.pageIsPostApi) { // if (this.urls.pageIsPostApi) {
// } else { // } else {
// get page // get page
@ -122,10 +124,14 @@ export default {
this.urls.page, this.urls.page,
this.urls.pageIsPostApi this.urls.pageIsPostApi
? { ? {
...this.queryParams,
...params, ...params,
} }
: { : {
params, params: {
...this.queryParams,
...params
},
} }
) )
.then(({ data: res }) => { .then(({ data: res }) => {
@ -253,7 +259,9 @@ export default {
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code === 0) { if (res.code === 0) {
this.$message({ this.$message({
message: `${type === "detach" ? "下发" : type === "pause-blender" ? "暂停" : "开始"}成功`, message: `${
type === "detach" ? "下发" : type === "pause-blender" ? "暂停" : "开始"
}成功`,
type: "success", type: "success",
duration: 1500, duration: 1500,
onClose: () => { onClose: () => {

View File

@ -33,7 +33,7 @@ export default function () {
prop: "operations", prop: "operations",
name: "操作", name: "操作",
fixed: "right", fixed: "right",
width: 188, width: 196,
subcomponent: TableOperaionComponent, subcomponent: TableOperaionComponent,
options: [ options: [
{ {

View File

@ -63,10 +63,13 @@ export default function () {
}, },
{ {
button: { button: {
type: "plain", type: "success",
name: "导入", name: "导入",
permission: "", permission: "",
}, },
bind: {
plain: true,
},
}, },
// { // {
// button: { // button: {

View File

@ -0,0 +1,244 @@
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
// import switchBtn from "@/components/noTemplateComponents/switchBtn";
import QuillRichInput from "@/components/noTemplateComponents/richInput";
import request from "@/utils/request";
import { timeFilter } from "@/utils/filters";
export default function () {
const tableProps = [
// 多选框
{ type: "selection", width: 60, align: "center" },
{ width: 128, prop: "createTime", label: "添加时间", filter: timeFilter },
{ width: 128, prop: "updaterName", label: "更改人" },
{ width: 128, prop: "code", label: "窑车号" },
{ width: 128, prop: "orderCode", label: "订单号" },
{ width: 128, prop: "orderCate", label: "订单子号" },
{ width: 128, prop: "shapeCode", label: "砖型" },
{ width: 128, prop: "brand", label: "配方" },
{ width: 128, prop: "goodqty", label: "合格数量" },
{ width: 128, prop: "badqty", label: "报废数量" },
// { prop: "typeDictValue", label: "过渡车", filter: val => ['否', '是'][val] },
// { prop: "enabled", label: "状态", subcomponent: switchBtn }, // subcomponent
{
width: 128,
prop: "team",
label: "班次",
filter: (val) => (val != null ? ["早班", "中班", "晚班"][val] : "-"),
},
{
width: 128,
prop: "report",
label: "报工",
filter: (val) => (val != null ? ["未报工", "已报工"][val] : "-"),
},
{ width: 128, prop: "rtime", label: "报工时间", filter: timeFilter },
{
prop: "operations",
name: "操作",
fixed: "right",
width: 90,
subcomponent: TableOperaionComponent,
options: [
{ name: "edit", label: "编辑", icon: "edit-outline", enable: row => row.report == 0 },
// {
// name: "delete",
// icon: "delete",
// label: "删除",
// emitFull: true,
// permission: "pms:carOrderReport:delete",
// },
],
},
];
const now = new Date().getTime();
const headFormFields = [
{
prop: "orderCode",
label: "订单号",
input: true,
default: { value: "" },
bind: {
placeholder: "请输入订单号",
},
},
{
prop: "carCode",
label: "窑车号",
input: true,
default: { value: "" },
bind: {
placeholder: "请输入窑车号",
},
},
{
prop: "team",
label: "班次",
select: [
{ label: "早班", value: "0" },
{ label: "中班", value: "1" },
{ label: "晚班", value: "2" },
],
default: { value: "" },
bind: {
placeholder: "请输入班次",
},
},
{
prop: "report",
label: "报工",
select: [
{ label: "未报工", value: "0" },
{ label: "已报工", value: "1" },
],
default: { value: "0" },
bind: {
placeholder: "请输入班次",
},
},
{
timerange: true,
prop: "timerange",
label: "时间段",
default: { value: [now - 3600 * 24 * 7 * 1000, now] },
bind: {
placeholder: "请选择时间段",
type: "datetimerange",
"start-placeholder": "开始时间",
"end-placeholder": "结束时间",
},
},
{
button: {
type: "primary",
name: "查询",
},
},
{
button: {
type: "primary",
name: "报工",
permission: "pms:carOrderReport:report",
},
bind: {
plain: true,
},
},
];
/**
* dialog config 有两个版本一个适用于 DialogWithMenu 组件另一个适用于 DialogJustForm 组件
* 适用于 DialogWithMenu 组件的配置示例详见 blenderStep/config.js
* 此为后者的配置:
*/
const dialogJustFormConfigs = {
clickModalToClose: false,
form: {
rows: [
[
{
forceDisabled: true,
label: "窑车号",
prop: "code",
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入窑车号" },
},
],
[
{
forceDisabled: true,
label: "订单号",
prop: "orderCode",
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入订单号" },
},
],
[
{
forceDisabled: true,
label: "订单子号",
prop: "orderCate",
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入订单子号" },
},
],
[
{
input: true,
label: "合格数量",
prop: "goodqty",
rules: [
{ required: true, message: "必填项不能为空", trigger: "blur" },
{
type: "number",
message: "请输入正确的数字类型",
trigger: "blur",
transform: (val) => Number(val),
},
],
elparams: { placeholder: "请输入合格数量" },
},
],
[
{
input: true,
label: "报废数量",
prop: "badqty",
rules: [
{ required: true, message: "必填项不能为空", trigger: "blur" },
{
type: "number",
message: "请输入正确的数字类型",
trigger: "blur",
transform: (val) => Number(val),
},
],
elparams: { placeholder: "请输入报废数量" },
},
],
// [
// {
// richInput: true,
// label: "描述信息",
// prop: "description",
// },
// ],
// [{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }],
],
operations: [
{
name: "add",
label: "保存",
type: "primary",
permission: "pms:carOrderReport:save",
showOnEdit: false,
},
{
name: "update",
label: "更新",
type: "primary",
permission: "pms:carOrderReport:update",
showOnEdit: true,
},
{ name: "reset", label: "重置", type: "warning", showAlways: true },
],
},
};
return {
dialogConfigs: dialogJustFormConfigs,
tableConfig: {
table: null, // 此处可省略el-table 上的配置项
column: tableProps, // el-column-item 上的配置项
},
headFormConfigs: {
rules: null, // 名称是由 BaseSearchForm.vue 组件固定的
fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的
},
urls: {
base: "/pms/carOrderReport",
page: "/pms/carOrderReport/pageView",
pageIsPostApi: true,
},
};
}

View File

@ -0,0 +1,51 @@
<template>
<ListViewWithHead
:table-config="tableConfig"
:head-config="headFormConfigs"
:dialog-configs="dialogConfigs"
:listQueryExtra="['carCode', 'orderCode', 'team', { report: 0, startTime: now[0], endTime: now[1] }]" />
</template>
<script>
import initConfig from "./config";
import ListViewWithHead from "@/views/atomViews/ListViewWithHead.vue";
import moment from "moment";
export default {
name: "CarView",
components: { ListViewWithHead },
provide() {
return {
urls: this.allUrls,
};
},
data() {
const { tableConfig, headFormConfigs, urls, dialogConfigs } = initConfig.call(this);
return {
tableConfig,
headFormConfigs,
allUrls: urls,
dialogConfigs,
};
},
computed: {
now() {
const curr = this.headFormConfigs.fields.find((item) => item.prop == "timerange").default.value;
return [
moment(curr[0]).format("YYYY-MM-DDTHH:mm:ss"),
moment(curr[1]).format("YYYY-MM-DDTHH:mm:ss"),
]
// const start = new Date(curr[0]);
// const end = new Date(curr[1]);
// return [
// start.toLocaleString().replace(' ', 'T').replace(/\//g, '-'),
// end.toLocaleString().replace(' ', 'T').replace(/\//g, '-'),
// ]
},
},
methods: {},
};
</script>
<style scoped></style>

View File

@ -470,15 +470,10 @@
:disabled="mode.includes('detail')" :disabled="mode.includes('detail')"
v-bind="{ placeholder: '选择托盘类型' }"> v-bind="{ placeholder: '选择托盘类型' }">
<el-option <el-option
v-for="opt in [ v-for="pt in palletType"
{ label: '非熏蒸', value: '0' }, :key="pt.dictValue"
{ label: '熏蒸', value: '1' }, :label="pt.dictLabel"
]" :value="pt.dictValue"></el-option>
:key="opt.label"
:label="opt.label"
:value="opt.value">
<span>{{ opt.label }}</span>
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -493,16 +488,8 @@
clearable clearable
:disabled="mode.includes('detail')" :disabled="mode.includes('detail')"
v-bind="{ placeholder: '选择贴纸板' }"> v-bind="{ placeholder: '选择贴纸板' }">
<el-option <el-option label="否" value="0"></el-option>
v-for="opt in [ <el-option label="是" value="1"></el-option>
{ label: '不要', value: '0' },
{ label: '要', value: '1' },
]"
:key="opt.label"
:label="opt.label"
:value="opt.value">
<span>{{ opt.label }}</span>
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -525,6 +512,7 @@
<script> <script>
import { pick as __pick } from "@/utils/filters"; import { pick as __pick } from "@/utils/filters";
import InputsArea from "./InputsArea.vue"; import InputsArea from "./InputsArea.vue";
import { getDictDataList } from "@/utils";
export default { export default {
name: "OrderDetailTag", name: "OrderDetailTag",
@ -669,6 +657,11 @@ export default {
promiseList: [], promiseList: [],
}; };
}, },
computed: {
palletType() {
return getDictDataList("pallet_type");
},
},
methods: { methods: {
/** /**
* 打开弹窗后准备下拉选项数据 * 打开弹窗后准备下拉选项数据

View File

@ -100,18 +100,18 @@ export default {
filter: (val) => (val !== null && val !== undefined ? ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝", "已下发"][val] : "-"), filter: (val) => (val !== null && val !== undefined ? ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝", "已下发"][val] : "-"),
}, },
{ prop: "qty", label: "混料总量 [kg]" }, { prop: "qty", label: "混料总量 [kg]" },
{ // {
prop: "operations", // prop: "operations",
name: "操作", // name: "",
fixed: "right", // fixed: "right",
width: 200, // width: 200,
subcomponent: TableOperaionComponent, // subcomponent: TableOperaionComponent,
options: [ // options: [
{ name: "edit", label: "编辑", emitFull: true, icon: "edit-outline" }, // { name: "edit", label: "", emitFull: true, icon: "edit-outline" },
{ name: "view-batch", label: "查看批次", color: "#ff8000", toRouter: "pms-blenderBatch", icon: "document-copy" }, // pms-blenderBatch // { name: "view-batch", label: "", color: "#ff8000", toRouter: "pms-blenderBatch", icon: "document-copy" }, // pms-blenderBatch
{ name: "detach", label: "下发", color: "#099", icon: "bottom-right" }, // { name: "detach", label: "", color: "#099", icon: "bottom-right" },
], // ],
}, // },
], ],
refreshLayoutKey1: "", refreshLayoutKey1: "",
// //
@ -127,14 +127,14 @@ export default {
{ prop: "qtyComplete", label: "完成量" }, { prop: "qtyComplete", label: "完成量" },
{ prop: "goodqty", label: "合格数量" }, { prop: "goodqty", label: "合格数量" },
{ prop: "badqty", label: "不合格数量" }, { prop: "badqty", label: "不合格数量" },
{ // {
prop: "operations", // prop: "operations",
name: "操作", // name: "",
fixed: "right", // fixed: "right",
width: 200, // 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' }]
}, // },
], ],
refreshLayoutKey2: "", refreshLayoutKey2: "",
// //

View File

@ -21,7 +21,11 @@
<el-col :span="6"> <el-col :span="6">
<el-form-item label="订单状态" prop="statusDictValue" :rules="null"> <el-form-item label="订单状态" prop="statusDictValue" :rules="null">
<span style="display: block; margin-top: 32px"> <span style="display: block; margin-top: 32px">
{{ ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝", "已下发"][dataForm.statusDictValue] }} {{
["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝", "已下发"][
dataForm.statusDictValue
]
}}
</span> </span>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -172,7 +176,9 @@
:label="opt.label" :label="opt.label"
:value="opt.value" :value="opt.value"
style="display: flex; align-items: center"> style="display: flex; align-items: center">
<span style="display: inline-block; width: 128px; text-overflow: ellipsis">{{ opt.label }}</span> <span style="display: inline-block; width: 128px; text-overflow: ellipsis">
{{ opt.label }}
</span>
<span <span
v-if="requestList[3].extraLabel" v-if="requestList[3].extraLabel"
style="display: inline-block; margin-left: 12px; font-size: 0.9em"> style="display: inline-block; margin-left: 12px; font-size: 0.9em">
@ -388,9 +394,7 @@
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="6"> <el-col :span="6">
<el-form-item <el-form-item label="销售订单号" prop="saleNo">
label="销售订单号"
prop="saleNo">
<!-- :rules="{ required: true, message: '必填项不能为空', trigger: 'blur' }"> --> <!-- :rules="{ required: true, message: '必填项不能为空', trigger: 'blur' }"> -->
<el-input <el-input
v-model="dataForm.saleNo" v-model="dataForm.saleNo"
@ -426,9 +430,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item <el-form-item label="销售时间" prop="deliveryTime">
label="销售时间"
prop="deliveryTime">
<!-- :rules="{ required: true, message: '必填项不能为空', trigger: 'blur' }"> --> <!-- :rules="{ required: true, message: '必填项不能为空', trigger: 'blur' }"> -->
<el-date-picker <el-date-picker
v-model="dataForm.deliveryTime" v-model="dataForm.deliveryTime"
@ -470,9 +472,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item <el-form-item label="托盘类型" prop="palletType">
label="托盘类型"
prop="palletType">
<!-- :rules="[{ required: true, message: '请选择托盘类型', trigger: 'blur' }]"> --> <!-- :rules="[{ required: true, message: '请选择托盘类型', trigger: 'blur' }]"> -->
<el-select <el-select
v-model="dataForm.palletType" v-model="dataForm.palletType"
@ -480,8 +480,11 @@
clearable clearable
:disabled="mode.includes('detail')" :disabled="mode.includes('detail')"
v-bind="{ placeholder: '选择托盘类型' }"> v-bind="{ placeholder: '选择托盘类型' }">
<el-option label="非熏蒸" value="0"></el-option> <el-option
<el-option label="熏蒸" value="1"></el-option> v-for="pt in palletType"
:key="pt.dictValue"
:label="pt.dictLabel"
:value="pt.dictValue"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -496,8 +499,8 @@
clearable clearable
:disabled="mode.includes('detail')" :disabled="mode.includes('detail')"
v-bind="{ placeholder: '选择贴纸板' }"> v-bind="{ placeholder: '选择贴纸板' }">
<el-option label="不要" value="0"></el-option> <el-option label="" value="0"></el-option>
<el-option label="" value="1"></el-option> <el-option label="" value="1"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -518,10 +521,18 @@
<!-- footer --> <!-- footer -->
<div slot="footer"> <div slot="footer">
<!-- TODO: permission 相关内容 未添加 --> <!-- TODO: permission 相关内容 未添加 -->
<el-button v-if="mode.includes('create')" type="primary" @click="handleSave('POST')" :loading="btnLoading"> <el-button
v-if="mode.includes('create')"
type="primary"
@click="handleSave('POST')"
:loading="btnLoading">
保存 保存
</el-button> </el-button>
<el-button v-if="mode.includes('edit')" type="primary" @click="handleSave('PUT')" :loading="btnLoading"> <el-button
v-if="mode.includes('edit')"
type="primary"
@click="handleSave('PUT')"
:loading="btnLoading">
更新 更新
</el-button> </el-button>
<el-button v-if="mode.includes('reset')" type="warning" @click="handleReset">重置</el-button> <el-button v-if="mode.includes('reset')" type="warning" @click="handleReset">重置</el-button>
@ -534,6 +545,7 @@
import { pick as __pick } from "@/utils/filters"; import { pick as __pick } from "@/utils/filters";
// import moment from "moment"; // import moment from "moment";
import InputsArea from "./InputsArea.vue"; import InputsArea from "./InputsArea.vue";
import { getDictDataList } from "@/utils";
export default { export default {
name: "DialogJustForm", name: "DialogJustForm",
@ -684,7 +696,11 @@ export default {
btnLoading: false, btnLoading: false,
}; };
}, },
computed: {
palletType() {
return getDictDataList("pallet_type");
},
},
methods: { methods: {
/** /**
* 打开弹窗后准备下拉选项数据 * 打开弹窗后准备下拉选项数据

View File

@ -474,15 +474,10 @@
:disabled="mode.includes('detail')" :disabled="mode.includes('detail')"
v-bind="{ placeholder: '选择托盘类型' }"> v-bind="{ placeholder: '选择托盘类型' }">
<el-option <el-option
v-for="opt in [ v-for="pt in palletType"
{ label: '非熏蒸', value: '0' }, :key="pt.dictValue"
{ label: '熏蒸', value: '1' }, :label="pt.dictLabel"
]" :value="pt.dictValue"></el-option>
:key="opt.label"
:label="opt.label"
:value="opt.value">
<span>{{ opt.label }}</span>
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -497,16 +492,8 @@
clearable clearable
:disabled="mode.includes('detail')" :disabled="mode.includes('detail')"
v-bind="{ placeholder: '选择贴纸板' }"> v-bind="{ placeholder: '选择贴纸板' }">
<el-option <el-option label="否" value="0"></el-option>
v-for="opt in [ <el-option label="是" value="1"></el-option>
{ label: '不要', value: '0' },
{ label: '要', value: '1' },
]"
:key="opt.label"
:label="opt.label"
:value="opt.value">
<span>{{ opt.label }}</span>
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -529,6 +516,7 @@
<script> <script>
import { pick as __pick } from "@/utils/filters"; import { pick as __pick } from "@/utils/filters";
import InputsArea from "./InputsArea.vue"; import InputsArea from "./InputsArea.vue";
import { getDictDataList } from "@/utils";
export default { export default {
name: "OrderDetailTag", name: "OrderDetailTag",
@ -673,6 +661,11 @@ export default {
promiseList: [], promiseList: [],
}; };
}, },
computed: {
palletType() {
return getDictDataList("pallet_type");
},
},
methods: { methods: {
/** /**
* 打开弹窗后准备下拉选项数据 * 打开弹窗后准备下拉选项数据

View File

@ -173,6 +173,7 @@ export default function () {
button: { button: {
type: "success", type: "success",
name: "导入订单", name: "导入订单",
permission :''
}, },
bind: { bind: {
plain: true, plain: true,

View File

@ -1,20 +1,21 @@
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent"; import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
import request from "@/utils/request"; import request from "@/utils/request";
import { timeFilter, dictFilter } from "@/utils/filters"; import { timeFilter, dictFilter } from "@/utils/filters";
import { getDictDataList } from '@/utils'; import { getDictDataList } from "@/utils";
// import StateSelect from '@/components/StateSelect.vue'; // import StateSelect from '@/components/StateSelect.vue';
export default function () { export default function () {
const tableProps = [ const tableProps = [
{ type: "index", label: "序号" }, { type: "index", label: "序号" },
{ type: "selection" },
{ prop: "code", label: "流水号" }, { prop: "code", label: "流水号" },
{ prop: "carCode", label: "窑车号" }, { prop: "carCode", label: "窑车号" },
{ prop: "orderCode", label: "订单号" }, { prop: "orderCode", label: "订单号" },
{ prop: "realQty", label: "数量" }, { prop: "realQty", label: "数量" },
{ prop: "typeDictValue", label: "类型", filter: dictFilter('pallet_type') }, { prop: "typeDictValue", label: "类型", filter: dictFilter("pallet_type") },
{ prop: "stifling", label: "熏蒸", filter: val => val != null ? ['非熏蒸', '熏蒸'][val] : '-' }, { prop: "stifling", label: "熏蒸", filter: (val) => (val != null ? ["非熏蒸", "熏蒸"][val] : "-") },
{ prop: "externalCode", label: "提库单" },
{ prop: "printTime", label: "打印时间", filter: timeFilter }, { prop: "printTime", label: "打印时间", filter: timeFilter },
{ prop: "createTime", label: "添加时间", filter: timeFilter }, { prop: "createTime", label: "添加时间", filter: timeFilter },
{ {
@ -25,7 +26,7 @@ export default function () {
subcomponent: TableOperaionComponent, subcomponent: TableOperaionComponent,
options: [ options: [
{ name: "print", label: "打印", icon: "printer" }, { name: "print", label: "打印", icon: "printer" },
{ name: "view-car-record", label: "窑车记录", emitField: 'hisId', icon: "shopping-cart-1" }, { name: "view-car-record", label: "窑车记录", emitField: "hisId", icon: "shopping-cart-1" },
], ],
}, },
]; ];
@ -38,19 +39,19 @@ export default function () {
fn: () => this.$http.get("/pms/car/page", { params: { page: 1, limit: 999 } }), fn: () => this.$http.get("/pms/car/page", { params: { page: 1, limit: 999 } }),
bind: { bind: {
placeholder: "请选择窑车号", placeholder: "请选择窑车号",
filterable: true filterable: true,
}, },
}, },
{ {
prop: "orderId", prop: "orderId",
label: "订单号", label: "订单号",
fieldOptionLabel: 'code', fieldOptionLabel: "code",
// fieldOptionValue: 'id', // fieldOptionValue: 'id',
select: [], select: [],
fn: () => this.$http.post("/pms/order/pageView", { page: 1, limit: 999 }), fn: () => this.$http.post("/pms/order/pageView", { page: 1, limit: 999 }),
bind: { bind: {
placeholder: "请选择订单号", placeholder: "请选择订单号",
filterable: true filterable: true,
}, },
}, },
{ {
@ -59,6 +60,24 @@ export default function () {
name: "查询", name: "查询",
}, },
}, },
{
button: {
type: "primary",
name: "打印",
},
bind: {
plain: true,
},
},
{
button: {
type: "warning",
name: "生成托盘",
},
bind: {
plain: true,
},
},
]; ];
const dialogJustFormConfigs = { const dialogJustFormConfigs = {
@ -74,17 +93,17 @@ export default function () {
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { elparams: {
disabled: true, disabled: true,
} },
}, },
{ {
select: true, select: true,
label: "状态", label: "状态",
prop: "stateDictValue", prop: "stateDictValue",
options: getDictDataList('car_state').map(i => ({ label: i.dictLabel, value: i.dictValue })), options: getDictDataList("car_state").map((i) => ({ label: i.dictLabel, value: i.dictValue })),
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { elparams: {
fliterable: true fliterable: true,
} },
}, },
], ],
[ [
@ -97,16 +116,16 @@ export default function () {
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { elparams: {
// fliterable: true // fliterable: true
},
}
}, },
{ {
label: "查看载砖详情", label: "查看载砖详情",
button: true, button: true,
onClick: function (id) { // 必须用 function 形式 onClick: function (id) {
console.log(`查看载砖详情`, id) // 必须用 function 形式
this.$emit('emit-data', { type: 'to-car-payload', data: id }) console.log(`查看载砖详情`, id);
} this.$emit("emit-data", { type: "to-car-payload", data: id });
},
}, },
], ],
], ],
@ -119,7 +138,7 @@ export default function () {
}; };
const carPayloadDialogConfigs = { const carPayloadDialogConfigs = {
dialogWidth: '70%', dialogWidth: "70%",
carPayloadDialog: true, carPayloadDialog: true,
clickModalToClose: false, clickModalToClose: false,
tableConfig: { tableConfig: {
@ -142,8 +161,6 @@ export default function () {
}, },
}; };
return { return {
carPayloadDialogConfigs, carPayloadDialogConfigs,
dialogConfigs: dialogJustFormConfigs, dialogConfigs: dialogJustFormConfigs,
@ -156,11 +173,11 @@ export default function () {
fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的 fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的
}, },
urls: { urls: {
base: '/pms/carHistory', base: "/pms/carHistory",
payload: '/pms/carHandle', // hisId 查询 载砖详情 payload: "/pms/carHandle", // hisId 查询 载砖详情
page: "/pms/pallet/pageView", page: "/pms/pallet/pageView",
pageIsPostApi: true, pageIsPostApi: true,
printLog: '/pms/pallet/print', // post printLog: "/pms/pallet/print", // post
}, },
}; };
} }

View File

@ -0,0 +1,147 @@
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
import request from "@/utils/request";
import { timeFilter, dictFilter } from "@/utils/filters";
import { getDictDataList } from "@/utils";
// import StateSelect from '@/components/StateSelect.vue';
export default function () {
const tableProps = [
{ type: "index", label: "序号" },
{ type: "selection" },
{ prop: "code", label: "流水号" },
{ prop: "carCode", label: "窑车号" },
{ prop: "orderCode", label: "订单号" },
{ prop: "realQty", label: "数量" },
{ prop: "typeDictValue", label: "类型", filter: dictFilter("pallet_type") },
{ prop: "stifling", label: "熏蒸", filter: (val) => (val != null ? ["非熏蒸", "熏蒸"][val] : "-") },
{ prop: "externalCode", label: "提库单" },
{ prop: "printTime", label: "打印时间", filter: timeFilter },
{ prop: "createTime", label: "添加时间", filter: timeFilter },
{
prop: "operations",
name: "操作",
fixed: "right",
width: 90,
subcomponent: TableOperaionComponent,
options: [
{ name: "print", label: "打印", icon: "printer" },
{ name: "view-car-record", label: "窑车记录", emitField: "hisId", icon: "shopping-cart-1" },
],
},
];
tableProps.defaultPageSize = 999;
const headFormFields = [
{
button: {
type: "primary",
name: "打印",
},
bind: {
plain: true,
},
},
];
const dialogJustFormConfigs = {
form: {
rows: [
[
{
select: true,
label: "窑车号",
prop: "carId",
options: [],
fetchData: () => this.$http.get("/pms/car/page", { params: { page: 1, limit: 999 } }),
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: {
disabled: true,
},
},
{
select: true,
label: "状态",
prop: "stateDictValue",
options: getDictDataList("car_state").map((i) => ({ label: i.dictLabel, value: i.dictValue })),
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: {
fliterable: true,
},
},
],
[
{
// select: true,
input: true,
label: "位置",
prop: "pos",
// options: getDictDataList(),
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: {
// fliterable: true
},
},
{
label: "查看载砖详情",
button: true,
onClick: function (id) {
// 必须用 function 形式
console.log(`查看载砖详情`, id);
this.$emit("emit-data", { type: "to-car-payload", data: id });
},
},
],
],
operations: [
// { name: "add", label: "保存", type: "primary", permission: "", showOnEdit: false },
// { name: "update", label: "更新", type: "primary", permission: "", showOnEdit: true },
// { name: "reset", label: "重置", type: "warning", showAlways: true },
],
},
};
const carPayloadDialogConfigs = {
dialogWidth: "70%",
carPayloadDialog: true,
clickModalToClose: false,
tableConfig: {
table: null,
column: [
// 窑车的 装载详情
// tableProps
{ width: 56, type: "index", label: "序号" },
{ prop: "orderCode", label: "订单号" },
{ width: 80, prop: "orderCate", label: "订单子号" },
{ prop: "bomCode", label: "配方" },
{ prop: "shapeCode", label: "砖型" },
{ width: 80, prop: "qty", label: "订单数量" },
{ width: 72, prop: "goodqty", label: "合格数" },
{ width: 72, prop: "badqty", label: "废砖数" },
// { prop: "startTime", label: "开始时间" },
// { prop: "endTime", label: "结束时间" },
// { prop: "remark", label: "备注" },
],
},
};
return {
carPayloadDialogConfigs,
dialogConfigs: dialogJustFormConfigs,
tableConfig: {
table: null, // 此处可省略el-table 上的配置项
column: tableProps, // el-column-item 上的配置项
},
headFormConfigs: {
rules: null, // 名称是由 BaseSearchForm.vue 组件固定的
fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的
},
urls: {
base: "/pms/carHistory",
payload: "/pms/carHandle", // hisId 查询 载砖详情
page: "/pms/pallet/listForPrint",
pageIsPostApi: true,
printLog: "/pms/pallet/print", // post
},
};
}

View File

@ -0,0 +1,47 @@
<template>
<ListViewWithHead
:table-config="tableConfig"
:head-config="headFormConfigs"
:dialog-configs="dialogConfigs"
:car-payload-dialog-configs="carPayloadDialogConfigs"
:list-query-extra="[
/** { pos: [] } **/
]"
:trigger-update="triggerUpdateKey"
/>
<!-- :car-payload-dialog-configs="carPayloadDialogConfigs" -->
</template>
<script>
import initConfig from "./config";
import ListViewWithHead from "@/views/atomViews/ListViewWithHead.vue";
export default {
name: "currentCarLocationView",
components: { ListViewWithHead },
provide() {
return {
urls: this.allUrls,
};
},
data() {
const { tableConfig, headFormConfigs, urls, carPayloadDialogConfigs, dialogConfigs } = initConfig.call(this);
return {
tableConfig,
carPayloadDialogConfigs,
headFormConfigs,
allUrls: urls,
dialogConfigs,
triggerUpdateKey: "",
};
},
created() {},
mounted() {},
methods: {},
activated() {
this.triggerUpdateKey = Math.random().toString();
},
};
</script>
<style scoped></style>

View File

@ -0,0 +1,394 @@
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
import request from "@/utils/request";
import { timeFilter, dictFilter } from "@/utils/filters";
import { getDictDataList } from "@/utils";
// import StateSelect from '@/components/StateSelect.vue';
export default function () {
const tableProps = [
{ width: 60, type: "index", label: "序号", fixed: true },
{ width: 120, prop: "code", label: "订单号", fixed: "left" },
{ width: 100, prop: "productCode", label: "物料" },
{ width: 100, prop: "shapeCode", label: "砖型" },
{ width: 160, prop: "brand", label: "牌号" },
{ width: 100, prop: "bomCode", label: "配方编码" },
{ width: 60, prop: "prodqty", label: "数量" },
{ width: 120, prop: "planStartTime", label: "计划开始时间", filter: timeFilter },
{ width: 200, prop: "packTechCode", label: "包装工艺代码" },
{ width: 120, prop: "pcsKilnCar", label: "托盘码放砖数" },
{ width: 120, prop: "customerCode", label: "客户" },
{ width: 120, prop: "specifications", label: "生产订单类型" },
{ width: 60, prop: "statusDictValue", label: "状态", filter: dictFilter("order_status") },
{ width: 200, prop: "saleNo", label: "销售订单号" },
{ width: 200, prop: "saleOrderItem", label: "销售订单item号" },
{ width: 120, prop: "soqty", label: "销售订单数" },
{ width: 120, prop: "deliveryTime", label: "销售时间", filter: timeFilter },
{ width: 65, prop: "sapParam1", label: "addon" },
{ width: 200, prop: "shortDesc", label: "喷码描述" },
{ width: 120, prop: "yieldqty", label: "已生产数量" },
// { prop: "description", label: "详情", subcomponent: TableTextComponent },
{ width: 120, prop: "remark", label: "备注" },
{ width: 120, prop: "createTime", label: "添加时间", filter: timeFilter },
{
prop: "operations",
name: "操作",
fixed: "right",
width: 90,
subcomponent: TableOperaionComponent,
options: [{ name: "view", label: "查看详情", icon: "view" }],
},
];
const headFormFields = [
{
prop: "code",
label: "订单号",
input: true,
bind: {
placeholder: "请输入订单号",
},
},
{
prop: "types",
label: "状态",
select: [
{ label: "生产", value: "2" },
{ label: "结束", value: "4" },
],
bind: {
placeholder: "请选择状态",
multiple: true,
filterable: true,
},
},
{
button: {
type: "primary",
name: "查询",
},
},
{
button: {
type: "success",
name: "导入",
permission: "",
},
bind: {
plain: true,
},
},
];
const textOnlyComponent = {
props: {
modelValue: {
type: String | Number,
required: true,
},
useBuiltin: {
type: Boolean,
default: true,
},
},
data() {
return {
orderStatusMap: ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝", "已下发"],
};
},
render: function (h) {
return h(
"span",
{ style: { display: "block", marginTop: "0" } },
this.useBuiltin
? this.orderStatusMap[this.modelValue] ?? "-"
: this.modelValue.toString().trim() === ""
? "-"
: this.modelValue.toString()
);
},
};
const dialogJustFormConfigs = {
width: "80%",
form: {
rows: [
[
{
label: "订单状态",
prop: "statusDictValue",
component: textOnlyComponent,
},
{
input: true,
label: "订单号",
prop: "code",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "输入订单号" },
},
{
datetime: true,
label: "计划开始时间",
prop: "planStartTime",
elparams: {
placeholder: "选择计划开始时间",
type: "datetime",
"value-format": "yyyy-MM-ddTHH:mm:ss",
},
},
{
input: true,
label: "Add on",
prop: "sapParam1",
elparams: { placeholder: "输入addon" },
},
],
[
{
select: true,
label: "牌号",
prop: "bomId",
options: [],
fetchData: () =>
this.$http.get("/pms/bom/page", {
params: { limit: 999, page: 1, key: "", externalCode: "" },
}),
elparams: { placeholder: "选择牌号", filterable: true },
injectTo: [
["bomCode", "code"],
["ai", "externalCode"],
],
},
{
label: "配方号",
prop: "bomCode",
component: textOnlyComponent,
bind: {
useBuiltin: false,
},
},
{
select: true,
label: "包装代码",
prop: "packTech",
options: [],
optionLabel: "code",
fetchData: () =>
this.$http.post("/pms/equipmentTech/pageView", {
limit: 999,
page: 1,
key: "",
shape: "",
wsId: 5,
}),
elparams: { placeholder: "选择包装代码", filterable: true },
},
{
select: true,
label: "物料",
prop: "productId",
options: [],
optionLabel: "code",
fetchData: () =>
this.$http.get("/pms/product/page", { params: { limit: 999, page: 1, key: "" } }),
elparams: { placeholder: "选择物料", filterable: true },
},
],
[
{
select: true,
label: "砖型",
prop: "shape",
optionLabel: "code",
options: [],
fetchData: () =>
this.$http.get("/pms/shape/page", { params: { limit: 999, page: 1, key: "" } }),
elparams: { placeholder: "选择砖型", filterable: true },
},
{
input: true,
label: "烧成温度",
prop: "sapParam6",
rules: [
{ required: true, message: "必填项不能为空", trigger: "blur" },
{
type: "number",
message: "输入正确的数字类型",
trigger: "blur",
transform: (val) => Number(val),
},
],
elparams: { placeholder: "输入烧成温度" },
},
{
input: true,
label: "烧成时间(min)",
prop: "sapParam7",
rules: [
{ required: true, message: "必填项不能为空", trigger: "blur" },
{
type: "number",
message: "输入正确的数字类型",
trigger: "blur",
transform: (val) => Number(val),
},
],
elparams: { placeholder: "输入烧成时间" },
},
{
input: true,
label: "生产订单类型",
prop: "specifications",
elparams: { placeholder: "输入生产订单类型" },
},
],
[
{
input: true,
label: "生产订单砖数",
prop: "prodqty",
rules: [
{ required: true, message: "必填项不能为空", trigger: "blur" },
{
type: "number",
message: "输入正确的数字类型",
trigger: "blur",
transform: (val) => Number(val),
},
],
elparams: { placeholder: "输入要求生产的数量" },
},
{
input: true,
label: "已生产数",
prop: "yieldqty",
rules: [
{
type: "number",
message: "输入正确的数字类型",
trigger: "blur",
transform: (val) => Number(val),
},
],
elparams: { placeholder: "输入已经生产的数量" },
},
{
input: true,
label: "托盘码放砖数",
prop: "pcsKilnCar",
rules: [
{ required: true, message: "必填项不能为空", trigger: "blur" },
{
type: "number",
message: "输入正确的数字类型",
trigger: "blur",
transform: (val) => Number(val),
},
],
elparams: { placeholder: "输入托盘码放砖数" },
},
{
input: true,
label: "销售订单号",
prop: "saleNo",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "输入销售订单号" },
},
],
[
{
input: true,
label: "销售订单item号",
prop: "saleOrderItem",
elparams: { placeholder: "输入销售订单item号" },
},
{
input: true,
label: "销售订单砖数",
prop: "soqty",
rules: [
{ required: true, message: "必填项不能为空", trigger: "blur" },
{
type: "number",
message: "输入正确的数字类型",
trigger: "blur",
transform: (val) => Number(val),
},
],
elparams: { placeholder: "输入销售订单砖数" },
},
{
datetime: true,
label: "销售时间",
prop: "deliveryTime",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "选择销售时间" },
},
{
label: "物料号销售文本",
prop: "shortDesc",
component: textOnlyComponent,
bind: {
useBuiltin: false,
},
},
],
[
{
select: true,
label: "客户",
prop: "customerId",
options: [],
optionLabel: "name",
fetchData: () =>
this.$http.get("/pms/customer/page", { params: { limit: 999, page: 1, name: "" } }),
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "选择客户" },
},
{
label: "托板类型",
prop: "palletType",
select: true,
options: getDictDataList("pallet_type").map((item) => ({
label: item.dictLabel,
value: item.dictValue,
})),
},
{
label: "贴纸板",
prop: "paperboard",
select: true,
options: [
{ label: "否", value: "0" },
{ label: "是", value: "1" },
],
},
{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } },
],
],
operations: [
// { name: "add", label: "保存", type: "primary", permission: "", showOnEdit: false },
// { name: "update", label: "更新", type: "primary", permission: "", showOnEdit: true },
// { name: "reset", label: "重置", type: "warning", showAlways: true },
],
},
};
return {
dialogConfigs: dialogJustFormConfigs,
tableConfig: {
table: null, // 此处可省略el-table 上的配置项
column: tableProps, // el-column-item 上的配置项
},
headFormConfigs: {
rules: null, // 名称是由 BaseSearchForm.vue 组件固定的
fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的
},
urls: {
base: "/pms/stockOrder",
page: "/pms/stockOrder/pageView",
pageIsPostApi: true,
templateUrl: '/importTemplates/PPVPImport.xlsx'
},
};
}

View File

@ -0,0 +1,46 @@
<template>
<ListViewWithHead
:table-config="tableConfig"
:head-config="headFormConfigs"
:dialog-configs="dialogConfigs"
:car-payload-dialog-configs="carPayloadDialogConfigs"
:list-query-extra="[
/** { pos: [] } **/
]"
:trigger-update="triggerUpdateKey"
/>
<!-- :car-payload-dialog-configs="carPayloadDialogConfigs" -->
</template>
<script>
import initConfig from "./config";
import ListViewWithHead from "@/views/atomViews/ListViewWithHead.vue";
export default {
name: "currentCarLocationView",
components: { ListViewWithHead },
provide() {
return {
urls: this.allUrls,
};
},
data() {
const { tableConfig, headFormConfigs, urls, dialogConfigs } = initConfig.call(this);
return {
tableConfig,
headFormConfigs,
allUrls: urls,
dialogConfigs,
triggerUpdateKey: "",
};
},
created() {},
mounted() {},
methods: {},
activated() {
this.triggerUpdateKey = Math.random().toString();
},
};
</script>
<style scoped></style>

View File

@ -0,0 +1,292 @@
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
// import switchBtn from "@/components/noTemplateComponents/switchBtn";
// import QuillRichInput from "@/components/noTemplateComponents/richInput";
// import request from "@/utils/request";
import { timeFilter, dictFilter } from "@/utils/filters";
export default function () {
const tableProps = [
{ width: 120, prop: "orderCode", label: "订单号", fixed: "left" },
{ width: 60, prop: "orderCate", label: "子号" },
{ width: 60, prop: "qty", label: "生产数量" },
{ width: 128, prop: "goodqty", label: "合格数量" },
{ width: 128, prop: "badqty", label: "报废数量" },
{ width: 128, prop: "badratio", label: "报废率" },
{ width: 100, prop: "productCode", label: "物料" },
{ width: 100, prop: "shapeCode", label: "砖型" },
{ width: 160, prop: "brand", label: "牌号" },
{ width: 100, prop: "bomCode", label: "配方编码" },
// { width: 60, prop: "ai", label: "版本" },
{ width: 80, prop: "blenderCode", label: "混料机号" },
{ width: 80, prop: "pressCode", label: "压机号" },
{ width: 80, prop: "kilnCode", label: "隧道窑号" },
{ width: 120, prop: "planStartTime", label: "计划开始时间", filter: timeFilter },
{ width: 120, prop: "sapParam6", label: "烧成温度" },
{ width: 120, prop: "sapParam7", label: "烧成时间(min)" },
// { width: 200, prop: "packTechCode", label: "包装工艺代码" },
{ width: 120, prop: "pcsKilnCar", label: "托盘码放砖数" },
{ width: 120, prop: "customerCode", label: "客户" },
{ width: 120, prop: "specifications", label: "生产订单类型" },
// { width: 60, prop: "statusDictValue", label: "状态", filter: dictFilter("order_status") },
{ width: 200, prop: "saleNo", label: "销售订单号" },
{ width: 200, prop: "saleOrderItem", label: "销售订单item号" },
{ width: 120, prop: "soqty", label: "销售订单数" },
{ width: 120, prop: "deliveryTime", label: "销售时间", filter: timeFilter },
{ width: 65, prop: "sapParam1", label: "addon" },
{ width: 200, prop: "shapeShortDesc", label: "喷码描述" },
{ width: 120, prop: "prodqty", label: "要求生产数量" },
{ width: 128, prop: "paperboard", label: "是否贴纸板", filter: (val) => ["否", "是"][val] },
{ width: 128, prop: "palletType", label: "托盘类型", filter: dictFilter("pallet_type") },
{ width: 120, prop: "remark", label: "备注" },
{ width: 120, prop: "createTime", label: "报工时间", filter: timeFilter },
{ width: 120, prop: "creatorName", label: "报工人" },
{
width: 128,
prop: "team",
label: "班次",
filter: (val) => (val != null ? ["早班", "中班", "晚班"][val] : "-"),
},
{
width: 120,
prop: "externalCode",
label: "工序",
filter: (val) => (val != null ? ["压机", "检测线", "包装"][val] : "-"),
},
{
prop: "operations",
name: "操作",
fixed: "right",
width: 90,
subcomponent: TableOperaionComponent,
options: [
{ name: "edit", label: "编辑", icon: "edit-outline" }, // enable: (row) => row.report == 0 },
// {
// name: "delete",
// icon: "delete",
// label: "删除",
// emitFull: true,
// permission: "pms:workReport:delete",
// },
],
},
];
const now = new Date();
const [y, m, d] = [now.getFullYear(), now.getMonth(), now.getDate()];
const today = new Date(y, m, d, 0, 0, 0, 0).getTime();
const headFormFields = [
{
prop: "team",
label: "班次",
select: [
{ label: "早班", value: "0" },
{ label: "中班", value: "1" },
{ label: "晚班", value: "2" },
],
default: { value: "" },
bind: {
placeholder: "请选择班次",
},
},
{
prop: "externalCode",
label: "工序",
select: [
{ label: "压机", value: "0" },
{ label: "检测线", value: "1" },
{ label: "包装", value: "2" },
],
default: { value: "" },
bind: {
placeholder: "请选择工序",
},
},
{
prop: "orderCode",
label: "订单号",
input: true,
default: { value: "" },
bind: {
placeholder: "请输入订单号",
},
},
{
timerange: true,
prop: "timerange",
label: "时间段",
default: { value: [today - 3600 * 24 * 6 * 1000, today + 3600 * 24 * 1000] },
bind: {
placeholder: "请选择时间段",
type: "datetimerange",
"start-placeholder": "开始时间",
"end-placeholder": "结束时间",
},
},
{
button: {
type: "primary",
name: "查询",
},
},
{
button: {
type: "primary",
name: "新增",
permission: "pms:workReport:save",
},
bind: {
plain: true,
},
},
{
button: {
type: "warning",
name: "导出",
permission: "pms:workReport:export",
},
bind: {
plain: true,
},
},
];
/**
* dialog config 有两个版本一个适用于 DialogWithMenu 组件另一个适用于 DialogJustForm 组件
* 适用于 DialogWithMenu 组件的配置示例详见 blenderStep/config.js
* 此为后者的配置:
*/
const dialogJustFormConfigs = {
clickModalToClose: false,
form: {
rows: [
[
{
select: true,
label: "订单",
prop: "orderId",
options: [],
optionLabel: "code",
customLabel: "cate",
fetchData: () => this.$http.post("/pms/order/listForReport"),
elparams: { placeholder: "请选择订单" },
rules: [{ required: true, message: "必填项不能为空", trigger: "blur" }],
},
{
select: true,
label: "工序",
prop: "externalCode",
options: [
{ label: "压机", value: "0" },
{ label: "检测线", value: "1" },
{ label: "包装", value: "2" },
],
elparams: { placeholder: "请选择工序" },
},
],
[
{
select: true,
label: "班次",
prop: "team",
options: [
{ label: "早班", value: "0" },
{ label: "中班", value: "1" },
{ label: "晚班", value: "2" },
],
elparams: { placeholder: "请选择班次" },
},
{
input: true,
label: "数量",
prop: "qty",
rules: [
{ required: true, message: "必填项不能为空", trigger: "blur" },
{
type: "number",
message: "请输入正确的数字类型",
trigger: "blur",
transform: (val) => Number(val),
},
],
elparams: { placeholder: "请输入数量" },
},
],
[
{
input: true,
label: "合格数量",
prop: "goodqty",
rules: [
{ required: true, message: "必填项不能为空", trigger: "blur" },
{
type: "number",
message: "请输入正确的数字类型",
trigger: "blur",
transform: (val) => Number(val),
},
],
elparams: { placeholder: "请输入合格数量" },
},
{
input: true,
label: "报废数量",
prop: "badqty",
rules: [
{ required: true, message: "必填项不能为空", trigger: "blur" },
{
type: "number",
message: "请输入正确的数字类型",
trigger: "blur",
transform: (val) => Number(val),
},
],
elparams: { placeholder: "请输入报废数量" },
},
],
// [
// {
// richInput: true,
// label: "描述信息",
// prop: "description",
// },
// ],
// [{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }],
],
operations: [
{
name: "add",
label: "保存",
type: "primary",
permission: "pms:workReport:save",
showOnEdit: false,
},
{
name: "update",
label: "更新",
type: "primary",
permission: "pms:workReport:update",
showOnEdit: true,
},
{ name: "reset", label: "重置", type: "warning", showAlways: true },
],
},
};
return {
dialogConfigs: dialogJustFormConfigs,
tableConfig: {
table: null, // 此处可省略el-table 上的配置项
column: tableProps, // el-column-item 上的配置项
},
headFormConfigs: {
rules: null, // 名称是由 BaseSearchForm.vue 组件固定的
fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的
},
urls: {
base: "/pms/workReport",
page: "/pms/workReport/pageView",
pageIsPostApi: true,
export: '/pms/workReport/export',
},
};
}

View File

@ -0,0 +1,51 @@
<template>
<ListViewWithHead
:table-config="tableConfig"
:head-config="headFormConfigs"
:dialog-configs="dialogConfigs"
:listQueryExtra="['externalCode', 'orderCode', 'team', { report: 0, startTime: now[0], endTime: now[1] }]" />
</template>
<script>
import initConfig from "./config";
import ListViewWithHead from "@/views/atomViews/ListViewWithHead.vue";
import moment from "moment";
export default {
name: "WorkReportView",
components: { ListViewWithHead },
provide() {
return {
urls: this.allUrls,
};
},
data() {
const { tableConfig, headFormConfigs, urls, dialogConfigs } = initConfig.call(this);
return {
tableConfig,
headFormConfigs,
allUrls: urls,
dialogConfigs,
};
},
computed: {
now() {
const curr = this.headFormConfigs.fields.find((item) => item.prop == "timerange").default.value;
return [
moment(curr[0]).format("YYYY-MM-DDTHH:mm:ss"),
moment(curr[1]).format("YYYY-MM-DDTHH:mm:ss"),
]
// const start = new Date(curr[0]);
// const end = new Date(curr[1]);
// return [
// start.toLocaleString().replace(' ', 'T').replace(/\//g, '-'),
// end.toLocaleString().replace(' ', 'T').replace(/\//g, '-'),
// ]
},
},
methods: {},
};
</script>
<style scoped></style>