Merge branch 'docs_0815'
This commit is contained in:
commit
521563bd00
@ -17,6 +17,7 @@
|
||||
"babel-plugin-component": "^1.1.1",
|
||||
"code-brick-zj": "^0.0.7",
|
||||
"core-js": "^3.6.5",
|
||||
"dayjs": "^1.11.9",
|
||||
"echarts": "^5.3.3",
|
||||
"element-theme": "^2.0.1",
|
||||
"element-ui": "^2.15.7",
|
||||
|
BIN
public/importTemplates/PPVPImport.xlsx
Normal file
BIN
public/importTemplates/PPVPImport.xlsx
Normal file
Binary file not shown.
@ -538,7 +538,7 @@ img {
|
||||
.aui-content {
|
||||
position: relative;
|
||||
padding: $content--padding;
|
||||
min-height: calc(100vh - #{$navbar--height});
|
||||
min-height: calc(100vh - 30px - #{$navbar--height});
|
||||
&__wrapper {
|
||||
position: relative;
|
||||
margin-left: $sidebar--width;
|
||||
@ -673,7 +673,8 @@ img {
|
||||
z-index: 830;
|
||||
}
|
||||
> .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 {
|
||||
min-height: calc(#{$content--fill-height-tabs} - 2px);
|
||||
}
|
||||
|
@ -77,17 +77,6 @@ export default {
|
||||
dataForm: {},
|
||||
};
|
||||
},
|
||||
|
||||
// 这个 watch 出现得没啥必要......
|
||||
// watch: {
|
||||
// dataForm: {
|
||||
// handler: (val) => {
|
||||
// console.log("[BaseSearchForm::watcher::dataForm]", val);
|
||||
// },
|
||||
// deep: true,
|
||||
// },
|
||||
// },
|
||||
|
||||
created() {},
|
||||
mounted() {
|
||||
console.log("[BaseSearchForm] configs:", JSON.parse(JSON.stringify(this.headConfig)));
|
||||
|
@ -1,17 +1,14 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
class="dialog-just-form"
|
||||
custom-class="pms-dialog"
|
||||
:visible="dialogVisible"
|
||||
@close="handleClose"
|
||||
:destroy-on-close="false"
|
||||
:close-on-click-modal="configs.clickModalToClose ?? false"
|
||||
:width="configs.dialogWidth ?? '50%'">
|
||||
<!-- title -->
|
||||
<div slot="title" class="dialog-title">
|
||||
<h1 class="">
|
||||
:width="configs.width || '50%'"
|
||||
:destroy-on-close="false">
|
||||
<span slot="title" class="dialog-title">
|
||||
{{ detailMode ? "查看详情" : dataForm.id ? "编辑" : "新增" }}
|
||||
</h1>
|
||||
</div>
|
||||
</span>
|
||||
|
||||
<!-- form -->
|
||||
<el-form ref="dataForm" :model="dataForm" v-loading="loadingStatus">
|
||||
@ -75,7 +72,9 @@
|
||||
:label="opt.label"
|
||||
:value="opt.value">
|
||||
<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] || "无描述" }}
|
||||
</span>
|
||||
<template v-if="col.customLabels">
|
||||
@ -787,20 +786,19 @@ export default {
|
||||
|
||||
<style scoped>
|
||||
.dialog-just-form >>> .el-dialog__body {
|
||||
/* padding-top: 16px !important;
|
||||
padding-bottom: 16px !important; */
|
||||
padding-top: 0 !important;
|
||||
padding-bottom: 0 !important;
|
||||
}
|
||||
|
||||
.dialog-just-form >>> .el-form {
|
||||
padding: 16px;
|
||||
max-height: 56vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.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>
|
||||
|
@ -4,6 +4,7 @@
|
||||
element-loading-text="处理中,请耐心等待..."
|
||||
element-loading-background="rgba(0,0,0,0.1)"
|
||||
class="dialog-just-form"
|
||||
custom-class="pms-dialog"
|
||||
:visible="visible"
|
||||
@close="handleClose"
|
||||
width="30%"
|
||||
@ -229,7 +230,7 @@ export default {
|
||||
/* padding-top: 16px !important;
|
||||
padding-bottom: 16px !important; */
|
||||
padding-top: 0 !important;
|
||||
padding-bottom: 0 !important;
|
||||
padding-bottom: 12px !important;
|
||||
}
|
||||
|
||||
.el-select,
|
||||
@ -238,11 +239,6 @@ export default {
|
||||
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 {
|
||||
height: 0;
|
||||
width: 0;
|
||||
|
@ -12,12 +12,9 @@
|
||||
:destroy-on-close="false"
|
||||
@close="handleClose"
|
||||
:close-on-click-modal="configs.clickModalToClose ?? false">
|
||||
<!-- title -->
|
||||
<div slot="title" class="dialog-title">
|
||||
<h1 class="">
|
||||
<h1 slot="title" class="dialog-title">
|
||||
{{ detailMode ? "查看详情" : dataForm.id ? "编辑" : "新增" }}
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<div class="dialog-body__inner relative">
|
||||
<!-- v-if="dataForm.id && !detailMode && /属性|详情/.test(activeMenu) && $hasPermission()" -->
|
||||
@ -100,7 +97,9 @@
|
||||
:label="opt.label"
|
||||
:value="opt.value">
|
||||
<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] || "无描述" }}
|
||||
</span>
|
||||
</el-option>
|
||||
@ -169,7 +168,9 @@
|
||||
|
||||
<!-- 附件标签页 -->
|
||||
<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">
|
||||
<ul class="file-list">
|
||||
@ -297,7 +298,8 @@ export default {
|
||||
if (res.code === 0) {
|
||||
if (col.cacheFetchedData) {
|
||||
// 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) {
|
||||
@ -329,7 +331,9 @@ export default {
|
||||
}
|
||||
// col.options = res.data.list;
|
||||
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(
|
||||
col,
|
||||
"options",
|
||||
@ -438,11 +442,16 @@ export default {
|
||||
() => this.dataForm[col.prop],
|
||||
(val) => {
|
||||
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") {
|
||||
this.dataForm[col.changeReflects.toProp] = this.cached[col.prop].find((item) => item.id === val)?.[
|
||||
col.changeReflects.fromKey
|
||||
];
|
||||
this.dataForm[col.changeReflects.toProp] = this.cached[col.prop].find(
|
||||
(item) => item.id === val
|
||||
)?.[col.changeReflects.fromKey];
|
||||
} else if (Array.isArray(col.changeReflects.fromKey) && col.changeReflects.delimiter) {
|
||||
const foundItem = (this.dataForm[col.changeReflects.toProp] = this.cached[col.prop].find(
|
||||
(item) => item.id === val
|
||||
@ -510,7 +519,9 @@ export default {
|
||||
const addMode = !operate.showOnEdit && !this.dataForm.id;
|
||||
const permission = operate.permission ? this.$hasPermission(operate.permission) : true;
|
||||
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) {
|
||||
@ -975,7 +986,8 @@ export default {
|
||||
case "delete": {
|
||||
// 确认是否删除
|
||||
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}`, "提示", {
|
||||
confirmButtonText: "确认",
|
||||
cancelButtonText: "我再想想",
|
||||
@ -1024,10 +1036,6 @@ export default {
|
||||
/* background: #0f02 !important; */
|
||||
}
|
||||
|
||||
/* .el-menu--horizontal > .el-menu-item.is-active { */
|
||||
/* border-bottom-color: #0b58ff; */
|
||||
/* } */
|
||||
|
||||
.dialog-with-menu >>> .el-dialog__body {
|
||||
/* padding-top: 16px !important;
|
||||
padding-bottom: 16px !important; */
|
||||
@ -1035,16 +1043,15 @@ export default {
|
||||
padding-bottom: 0 !important;
|
||||
}
|
||||
|
||||
/* .dialog-with-menu >>> .dialog-body__inner {
|
||||
padding: 16px;
|
||||
} */
|
||||
|
||||
.el-select,
|
||||
.el-cascader {
|
||||
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 {
|
||||
position: relative;
|
||||
}
|
||||
|
@ -193,6 +193,7 @@ export default {
|
||||
|
||||
this.dataForm = res.data;
|
||||
await this.printByLocalData(res.data);
|
||||
await this.getPrintStatus(id);
|
||||
},
|
||||
|
||||
async printByLocalData(data) {
|
||||
@ -201,7 +202,6 @@ export default {
|
||||
// 绘制HU号
|
||||
await this.paintQrCode(data.hu || "- 无HU数据 -");
|
||||
await this.handlePrint();
|
||||
await this.getPrintStatus();
|
||||
},
|
||||
|
||||
initPrintPlugin() {
|
||||
@ -267,7 +267,7 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
getPrintStatus() {
|
||||
getPrintStatus(id) {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (!this.jobId || !this.lodop) reject(-1);
|
||||
this.lodop.SET_PRINT_MODE("CATCH_PRINT_STATUS", true);
|
||||
@ -278,7 +278,7 @@ export default {
|
||||
// 打印成功
|
||||
this.sendSuccess()
|
||||
.then(() => {
|
||||
this.$message.success("打印成功");
|
||||
this.$message.success(`打印 ${id} 成功`);
|
||||
this.$emit("refresh-list");
|
||||
resolve();
|
||||
})
|
||||
@ -287,7 +287,7 @@ export default {
|
||||
reject(err);
|
||||
});
|
||||
} else {
|
||||
this.$message.error("打印失败");
|
||||
this.$message.error(`打印 ${id} 失败`);
|
||||
}
|
||||
};
|
||||
this.lodop.GET_VALUE("PRINT_STATUS_OK", this.jobId);
|
||||
|
345
src/components/ReportDialog.vue
Normal file
345
src/components/ReportDialog.vue
Normal 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>
|
185
src/components/palletDialog.vue
Normal file
185
src/components/palletDialog.vue
Normal 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>
|
@ -23,7 +23,8 @@ import { hasPermission, getDictLabel } from '@/utils'
|
||||
import cloneDeep from 'lodash/cloneDeep'
|
||||
// main.js
|
||||
import myComponents from 'code-brick-zj'
|
||||
|
||||
// 表单验证
|
||||
import { formValidateRules } from '@/utils/validate'
|
||||
|
||||
// import mocks from './mocks'
|
||||
|
||||
@ -44,6 +45,7 @@ Vue.use(myComponents)
|
||||
Vue.prototype.$http = http
|
||||
Vue.prototype.$hasPermission = hasPermission
|
||||
Vue.prototype.$getDictLabel = getDictLabel
|
||||
Vue.prototype.$fv = formValidateRules
|
||||
|
||||
// 保存整站vuex本地储存初始状态
|
||||
window.SITE_CONFIG['storeState'] = cloneDeep(store.state)
|
||||
|
@ -2,30 +2,47 @@
|
||||
* 邮箱
|
||||
* @param {*} s
|
||||
*/
|
||||
export function isEmail (s) {
|
||||
return /^([a-zA-Z0-9._-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(s)
|
||||
export function isEmail(s) {
|
||||
return /^([a-zA-Z0-9._-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(s);
|
||||
}
|
||||
|
||||
/**
|
||||
* 手机号码
|
||||
* @param {*} s
|
||||
*/
|
||||
export function isMobile (s) {
|
||||
return /^1[0-9]{10}$/.test(s)
|
||||
export function isMobile(s) {
|
||||
return /^1[0-9]{10}$/.test(s);
|
||||
}
|
||||
|
||||
/**
|
||||
* 电话号码
|
||||
* @param {*} s
|
||||
*/
|
||||
export function isPhone (s) {
|
||||
return /^([0-9]{3,4}-)?[0-9]{7,8}$/.test(s)
|
||||
export function isPhone(s) {
|
||||
return /^([0-9]{3,4}-)?[0-9]{7,8}$/.test(s);
|
||||
}
|
||||
|
||||
/**
|
||||
* URL地址
|
||||
* @param {*} s
|
||||
*/
|
||||
export function isURL (s) {
|
||||
return /^http[s]?:\/\/.*/.test(s)
|
||||
export function isURL(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),
|
||||
},
|
||||
};
|
||||
|
@ -63,6 +63,20 @@
|
||||
<Overlay v-if="overlayVisible" />
|
||||
|
||||
<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>
|
||||
</template>
|
||||
|
||||
@ -77,6 +91,8 @@ import Overlay from "@/components/Overlay.vue";
|
||||
import moment from "moment";
|
||||
import AttachmentDialog from "@/components/attachmentDialog.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_JUST_FORM = "DialogJustForm";
|
||||
@ -94,6 +110,8 @@ export default {
|
||||
Overlay,
|
||||
AttachmentDialog,
|
||||
PrintDom,
|
||||
ReportDialog,
|
||||
PalletDialog,
|
||||
},
|
||||
props: {
|
||||
navigator: {
|
||||
@ -181,6 +199,9 @@ export default {
|
||||
needAttachmentDialog: false,
|
||||
tableSelectedIds: [],
|
||||
printDOMmount: false,
|
||||
queryParams: {},
|
||||
carReportDialogVisible: false,
|
||||
palletDialogVisible: false,
|
||||
};
|
||||
},
|
||||
inject: ["urls"],
|
||||
@ -190,6 +211,20 @@ export default {
|
||||
"defaultPageSize" in this.tableConfig.column ? this.tableConfig.column.defaultPageSize : 20;
|
||||
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();
|
||||
},
|
||||
methods: {
|
||||
@ -203,27 +238,21 @@ export default {
|
||||
page: this.page,
|
||||
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];
|
||||
});
|
||||
}
|
||||
});
|
||||
this.cachedSearchCondition = Object.assign({}, params);
|
||||
}
|
||||
|
||||
// this.dataList = [{}];
|
||||
// this.tableLoading = false;
|
||||
// return;
|
||||
this.$http[this.urls.pageIsPostApi ? "post" : "get"](
|
||||
this.urls.page,
|
||||
this.urls.pageIsPostApi
|
||||
? {
|
||||
...this.queryParams,
|
||||
...params,
|
||||
}
|
||||
: {
|
||||
params,
|
||||
params: {
|
||||
...this.queryParams,
|
||||
...params,
|
||||
},
|
||||
}
|
||||
)
|
||||
.then(({ data: res }) => {
|
||||
@ -232,14 +261,6 @@ export default {
|
||||
if (res.code === 0) {
|
||||
// page 场景:
|
||||
if ("list" in res.data) {
|
||||
// if (res.data.list.length == 0 && res.data.total != 0) {
|
||||
// // refresh list
|
||||
// if (this.page > 1) {
|
||||
// this.page -= 1
|
||||
// this.getList()
|
||||
// return
|
||||
// } else return
|
||||
// }
|
||||
/** 破碎记录的特殊需求:数据要结合单位 material + materialUnitDictValue */
|
||||
if ("attachDictValue" in this.tableConfig.column) {
|
||||
this.dataList = res.data.list.map((row) => {
|
||||
@ -248,12 +269,6 @@ export default {
|
||||
});
|
||||
} 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;
|
||||
} else if (Array.isArray(res.data)) {
|
||||
this.dataList = res.data;
|
||||
@ -621,12 +636,7 @@ export default {
|
||||
cancelButtonText: "我再想想",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.printDOMmount = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs["print"].print(data);
|
||||
});
|
||||
})
|
||||
.then(this.printOnce.bind(null, data))
|
||||
.catch((err) => {
|
||||
// console.log("cancel ", err);
|
||||
});
|
||||
@ -658,43 +668,71 @@ export default {
|
||||
case "导入":
|
||||
this.openUploadDialog();
|
||||
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 "手动添加": {
|
||||
this.openDialog();
|
||||
return;
|
||||
}
|
||||
case "查询": {
|
||||
if (typeof payload === "object") {
|
||||
// BaseSearchForm 给这个组件传递了数据
|
||||
Object.assign(this.cachedSearchCondition, payload);
|
||||
if ("timerange" in payload) {
|
||||
if (!!payload.timerange) {
|
||||
const [startTime, endTime] = payload["timerange"];
|
||||
this.cachedSearchCondition.startTime = moment(startTime).format("YYYY-MM-DDTHH:mm:ss");
|
||||
this.cachedSearchCondition.endTime = moment(endTime).format("YYYY-MM-DDTHH:mm:ss");
|
||||
const params = Object.assign({}, payload);
|
||||
|
||||
if ("timerange" in params) {
|
||||
if (!!params.timerange) {
|
||||
const [startTime, endTime] = params["timerange"];
|
||||
params.startTime = moment(startTime).format("YYYY-MM-DDTHH:mm:ss");
|
||||
params.endTime = moment(endTime).format("YYYY-MM-DDTHH:mm:ss");
|
||||
} else {
|
||||
delete this.cachedSearchCondition.startTime;
|
||||
delete this.cachedSearchCondition.endTime;
|
||||
}
|
||||
delete this.cachedSearchCondition.timerange;
|
||||
params.startTime = null;
|
||||
params.endTime = null;
|
||||
}
|
||||
delete params.timerange;
|
||||
}
|
||||
|
||||
/** 处理 listQueryExtra 里的数据 */
|
||||
this.listQueryExtra?.map((cond) => {
|
||||
if (typeof cond === "string") {
|
||||
if (!!payload[cond]) {
|
||||
this.cachedSearchCondition[cond] = payload[cond];
|
||||
} else {
|
||||
this.cachedSearchCondition[cond] = "";
|
||||
}
|
||||
} else if (typeof cond === "object") {
|
||||
Object.keys(cond).forEach((key) => {
|
||||
this.cachedSearchCondition[key] = cond[key];
|
||||
});
|
||||
}
|
||||
});
|
||||
console.log("查询", this.cachedSearchCondition);
|
||||
this.getList(this.cachedSearchCondition);
|
||||
// console.log(
|
||||
// "查询 params",
|
||||
// JSON.stringify({
|
||||
// // ...this.queryParams,
|
||||
// ...params,
|
||||
// })
|
||||
// );
|
||||
|
||||
this.queryParams = {
|
||||
...this.queryParams,
|
||||
...params,
|
||||
};
|
||||
|
||||
this.getList();
|
||||
break;
|
||||
}
|
||||
case "同步":
|
||||
@ -718,7 +756,72 @@ export default {
|
||||
});
|
||||
});
|
||||
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 是新值
|
||||
this.page = 1;
|
||||
this.size = val;
|
||||
this.getList(this.cachedSearchCondition);
|
||||
this.getList();
|
||||
},
|
||||
|
||||
handlePageChange(val) {
|
||||
// val 是新值
|
||||
this.getList(this.cachedSearchCondition);
|
||||
this.getList();
|
||||
},
|
||||
|
||||
/** 打开对话框 */
|
||||
|
@ -86,10 +86,23 @@ export default {
|
||||
dialogBomCode: "",
|
||||
overlayVisible: false,
|
||||
cachedSearchCondition: {},
|
||||
queryParams: {},
|
||||
};
|
||||
},
|
||||
inject: ["urls"],
|
||||
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();
|
||||
},
|
||||
methods: {
|
||||
@ -104,17 +117,6 @@ export default {
|
||||
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) {
|
||||
// } else {
|
||||
// 默认是 get 方式请求 page
|
||||
@ -122,10 +124,14 @@ export default {
|
||||
this.urls.page,
|
||||
this.urls.pageIsPostApi
|
||||
? {
|
||||
...this.queryParams,
|
||||
...params,
|
||||
}
|
||||
: {
|
||||
params,
|
||||
params: {
|
||||
...this.queryParams,
|
||||
...params
|
||||
},
|
||||
}
|
||||
)
|
||||
.then(({ data: res }) => {
|
||||
@ -253,7 +259,9 @@ export default {
|
||||
.then(({ data: res }) => {
|
||||
if (res.code === 0) {
|
||||
this.$message({
|
||||
message: `${type === "detach" ? "下发" : type === "pause-blender" ? "暂停" : "开始"}成功`,
|
||||
message: `${
|
||||
type === "detach" ? "下发" : type === "pause-blender" ? "暂停" : "开始"
|
||||
}成功`,
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
|
@ -33,7 +33,7 @@ export default function () {
|
||||
prop: "operations",
|
||||
name: "操作",
|
||||
fixed: "right",
|
||||
width: 188,
|
||||
width: 196,
|
||||
subcomponent: TableOperaionComponent,
|
||||
options: [
|
||||
{
|
||||
|
@ -63,10 +63,13 @@ export default function () {
|
||||
},
|
||||
{
|
||||
button: {
|
||||
type: "plain",
|
||||
type: "success",
|
||||
name: "导入",
|
||||
permission: "",
|
||||
},
|
||||
bind: {
|
||||
plain: true,
|
||||
},
|
||||
},
|
||||
// {
|
||||
// button: {
|
||||
|
244
src/views/modules/pms/carOrderReport/config.js
Normal file
244
src/views/modules/pms/carOrderReport/config.js
Normal 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,
|
||||
},
|
||||
};
|
||||
}
|
51
src/views/modules/pms/carOrderReport/index.vue
Normal file
51
src/views/modules/pms/carOrderReport/index.vue
Normal 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>
|
@ -470,15 +470,10 @@
|
||||
:disabled="mode.includes('detail')"
|
||||
v-bind="{ placeholder: '选择托盘类型' }">
|
||||
<el-option
|
||||
v-for="opt in [
|
||||
{ label: '非熏蒸', value: '0' },
|
||||
{ label: '熏蒸', value: '1' },
|
||||
]"
|
||||
:key="opt.label"
|
||||
:label="opt.label"
|
||||
:value="opt.value">
|
||||
<span>{{ opt.label }}</span>
|
||||
</el-option>
|
||||
v-for="pt in palletType"
|
||||
:key="pt.dictValue"
|
||||
:label="pt.dictLabel"
|
||||
:value="pt.dictValue"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -493,16 +488,8 @@
|
||||
clearable
|
||||
:disabled="mode.includes('detail')"
|
||||
v-bind="{ placeholder: '选择贴纸板' }">
|
||||
<el-option
|
||||
v-for="opt in [
|
||||
{ label: '不要', value: '0' },
|
||||
{ label: '要', value: '1' },
|
||||
]"
|
||||
:key="opt.label"
|
||||
:label="opt.label"
|
||||
:value="opt.value">
|
||||
<span>{{ opt.label }}</span>
|
||||
</el-option>
|
||||
<el-option label="否" value="0"></el-option>
|
||||
<el-option label="是" value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -525,6 +512,7 @@
|
||||
<script>
|
||||
import { pick as __pick } from "@/utils/filters";
|
||||
import InputsArea from "./InputsArea.vue";
|
||||
import { getDictDataList } from "@/utils";
|
||||
|
||||
export default {
|
||||
name: "OrderDetailTag",
|
||||
@ -669,6 +657,11 @@ export default {
|
||||
promiseList: [],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
palletType() {
|
||||
return getDictDataList("pallet_type");
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 打开弹窗后,准备下拉选项数据
|
||||
|
@ -100,18 +100,18 @@ export default {
|
||||
filter: (val) => (val !== null && val !== undefined ? ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝", "已下发"][val] : "-"),
|
||||
},
|
||||
{ prop: "qty", label: "混料总量 [kg]" },
|
||||
{
|
||||
prop: "operations",
|
||||
name: "操作",
|
||||
fixed: "right",
|
||||
width: 200,
|
||||
subcomponent: TableOperaionComponent,
|
||||
options: [
|
||||
{ name: "edit", label: "编辑", emitFull: true, icon: "edit-outline" },
|
||||
{ name: "view-batch", label: "查看批次", color: "#ff8000", toRouter: "pms-blenderBatch", icon: "document-copy" }, // 路由跳转至 pms-blenderBatch
|
||||
{ name: "detach", label: "下发", color: "#099", icon: "bottom-right" },
|
||||
],
|
||||
},
|
||||
// {
|
||||
// prop: "operations",
|
||||
// name: "操作",
|
||||
// fixed: "right",
|
||||
// width: 200,
|
||||
// subcomponent: TableOperaionComponent,
|
||||
// options: [
|
||||
// { name: "edit", label: "编辑", emitFull: true, icon: "edit-outline" },
|
||||
// { name: "view-batch", label: "查看批次", color: "#ff8000", toRouter: "pms-blenderBatch", icon: "document-copy" }, // 路由跳转至 pms-blenderBatch
|
||||
// { name: "detach", label: "下发", color: "#099", icon: "bottom-right" },
|
||||
// ],
|
||||
// },
|
||||
],
|
||||
refreshLayoutKey1: "",
|
||||
// 压制
|
||||
@ -127,14 +127,14 @@ export default {
|
||||
{ prop: "qtyComplete", label: "完成量" },
|
||||
{ prop: "goodqty", label: "合格数量" },
|
||||
{ prop: "badqty", label: "不合格数量" },
|
||||
{
|
||||
prop: "operations",
|
||||
name: "操作",
|
||||
fixed: "right",
|
||||
width: 200,
|
||||
subcomponent: TableOperaionComponent,
|
||||
options: [{ name: "detach", label: "下发", icon: "bottom-right" }], // , url: '/pms/trans/pressDeli' }]
|
||||
},
|
||||
// {
|
||||
// prop: "operations",
|
||||
// name: "操作",
|
||||
// fixed: "right",
|
||||
// width: 200,
|
||||
// subcomponent: TableOperaionComponent,
|
||||
// options: [{ name: "detach", label: "下发", icon: "bottom-right" }], // , url: '/pms/trans/pressDeli' }]
|
||||
// },
|
||||
],
|
||||
refreshLayoutKey2: "",
|
||||
// 窑炉
|
||||
|
@ -21,7 +21,11 @@
|
||||
<el-col :span="6">
|
||||
<el-form-item label="订单状态" prop="statusDictValue" :rules="null">
|
||||
<span style="display: block; margin-top: 32px">
|
||||
{{ ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝", "已下发"][dataForm.statusDictValue] }}
|
||||
{{
|
||||
["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝", "已下发"][
|
||||
dataForm.statusDictValue
|
||||
]
|
||||
}}
|
||||
</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -172,7 +176,9 @@
|
||||
:label="opt.label"
|
||||
:value="opt.value"
|
||||
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
|
||||
v-if="requestList[3].extraLabel"
|
||||
style="display: inline-block; margin-left: 12px; font-size: 0.9em">
|
||||
@ -388,9 +394,7 @@
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item
|
||||
label="销售订单号"
|
||||
prop="saleNo">
|
||||
<el-form-item label="销售订单号" prop="saleNo">
|
||||
<!-- :rules="{ required: true, message: '必填项不能为空', trigger: 'blur' }"> -->
|
||||
<el-input
|
||||
v-model="dataForm.saleNo"
|
||||
@ -426,9 +430,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item
|
||||
label="销售时间"
|
||||
prop="deliveryTime">
|
||||
<el-form-item label="销售时间" prop="deliveryTime">
|
||||
<!-- :rules="{ required: true, message: '必填项不能为空', trigger: 'blur' }"> -->
|
||||
<el-date-picker
|
||||
v-model="dataForm.deliveryTime"
|
||||
@ -470,9 +472,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item
|
||||
label="托盘类型"
|
||||
prop="palletType">
|
||||
<el-form-item label="托盘类型" prop="palletType">
|
||||
<!-- :rules="[{ required: true, message: '请选择托盘类型', trigger: 'blur' }]"> -->
|
||||
<el-select
|
||||
v-model="dataForm.palletType"
|
||||
@ -480,8 +480,11 @@
|
||||
clearable
|
||||
:disabled="mode.includes('detail')"
|
||||
v-bind="{ placeholder: '选择托盘类型' }">
|
||||
<el-option label="非熏蒸" value="0"></el-option>
|
||||
<el-option label="熏蒸" value="1"></el-option>
|
||||
<el-option
|
||||
v-for="pt in palletType"
|
||||
:key="pt.dictValue"
|
||||
:label="pt.dictLabel"
|
||||
:value="pt.dictValue"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -496,8 +499,8 @@
|
||||
clearable
|
||||
:disabled="mode.includes('detail')"
|
||||
v-bind="{ placeholder: '选择贴纸板' }">
|
||||
<el-option label="不要" value="0"></el-option>
|
||||
<el-option label="要" value="1"></el-option>
|
||||
<el-option label="否" value="0"></el-option>
|
||||
<el-option label="是" value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -518,10 +521,18 @@
|
||||
<!-- footer -->
|
||||
<div slot="footer">
|
||||
<!-- 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 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 v-if="mode.includes('reset')" type="warning" @click="handleReset">重置</el-button>
|
||||
@ -534,6 +545,7 @@
|
||||
import { pick as __pick } from "@/utils/filters";
|
||||
// import moment from "moment";
|
||||
import InputsArea from "./InputsArea.vue";
|
||||
import { getDictDataList } from "@/utils";
|
||||
|
||||
export default {
|
||||
name: "DialogJustForm",
|
||||
@ -684,7 +696,11 @@ export default {
|
||||
btnLoading: false,
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
palletType() {
|
||||
return getDictDataList("pallet_type");
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 打开弹窗后,准备下拉选项数据
|
||||
|
@ -474,15 +474,10 @@
|
||||
:disabled="mode.includes('detail')"
|
||||
v-bind="{ placeholder: '选择托盘类型' }">
|
||||
<el-option
|
||||
v-for="opt in [
|
||||
{ label: '非熏蒸', value: '0' },
|
||||
{ label: '熏蒸', value: '1' },
|
||||
]"
|
||||
:key="opt.label"
|
||||
:label="opt.label"
|
||||
:value="opt.value">
|
||||
<span>{{ opt.label }}</span>
|
||||
</el-option>
|
||||
v-for="pt in palletType"
|
||||
:key="pt.dictValue"
|
||||
:label="pt.dictLabel"
|
||||
:value="pt.dictValue"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -497,16 +492,8 @@
|
||||
clearable
|
||||
:disabled="mode.includes('detail')"
|
||||
v-bind="{ placeholder: '选择贴纸板' }">
|
||||
<el-option
|
||||
v-for="opt in [
|
||||
{ label: '不要', value: '0' },
|
||||
{ label: '要', value: '1' },
|
||||
]"
|
||||
:key="opt.label"
|
||||
:label="opt.label"
|
||||
:value="opt.value">
|
||||
<span>{{ opt.label }}</span>
|
||||
</el-option>
|
||||
<el-option label="否" value="0"></el-option>
|
||||
<el-option label="是" value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -529,6 +516,7 @@
|
||||
<script>
|
||||
import { pick as __pick } from "@/utils/filters";
|
||||
import InputsArea from "./InputsArea.vue";
|
||||
import { getDictDataList } from "@/utils";
|
||||
|
||||
export default {
|
||||
name: "OrderDetailTag",
|
||||
@ -673,6 +661,11 @@ export default {
|
||||
promiseList: [],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
palletType() {
|
||||
return getDictDataList("pallet_type");
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 打开弹窗后,准备下拉选项数据
|
||||
|
@ -173,6 +173,7 @@ export default function () {
|
||||
button: {
|
||||
type: "success",
|
||||
name: "导入订单",
|
||||
permission :''
|
||||
},
|
||||
bind: {
|
||||
plain: true,
|
||||
|
@ -1,20 +1,21 @@
|
||||
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
|
||||
import request from "@/utils/request";
|
||||
import { timeFilter, dictFilter } from "@/utils/filters";
|
||||
import { getDictDataList } from '@/utils';
|
||||
|
||||
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: "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 },
|
||||
{
|
||||
@ -25,7 +26,7 @@ export default function () {
|
||||
subcomponent: TableOperaionComponent,
|
||||
options: [
|
||||
{ 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 } }),
|
||||
bind: {
|
||||
placeholder: "请选择窑车号",
|
||||
filterable: true
|
||||
filterable: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: "orderId",
|
||||
label: "订单号",
|
||||
fieldOptionLabel: 'code',
|
||||
fieldOptionLabel: "code",
|
||||
// fieldOptionValue: 'id',
|
||||
select: [],
|
||||
fn: () => this.$http.post("/pms/order/pageView", { page: 1, limit: 999 }),
|
||||
bind: {
|
||||
placeholder: "请选择订单号",
|
||||
filterable: true
|
||||
filterable: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -59,6 +60,24 @@ export default function () {
|
||||
name: "查询",
|
||||
},
|
||||
},
|
||||
{
|
||||
button: {
|
||||
type: "primary",
|
||||
name: "打印",
|
||||
},
|
||||
bind: {
|
||||
plain: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
button: {
|
||||
type: "warning",
|
||||
name: "生成托盘",
|
||||
},
|
||||
bind: {
|
||||
plain: true,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
const dialogJustFormConfigs = {
|
||||
@ -74,17 +93,17 @@ export default function () {
|
||||
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 })),
|
||||
options: getDictDataList("car_state").map((i) => ({ label: i.dictLabel, value: i.dictValue })),
|
||||
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
|
||||
elparams: {
|
||||
fliterable: true
|
||||
}
|
||||
fliterable: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
[
|
||||
@ -97,16 +116,16 @@ export default function () {
|
||||
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 })
|
||||
}
|
||||
onClick: function (id) {
|
||||
// 必须用 function 形式
|
||||
console.log(`查看载砖详情`, id);
|
||||
this.$emit("emit-data", { type: "to-car-payload", data: id });
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
@ -119,7 +138,7 @@ export default function () {
|
||||
};
|
||||
|
||||
const carPayloadDialogConfigs = {
|
||||
dialogWidth: '70%',
|
||||
dialogWidth: "70%",
|
||||
carPayloadDialog: true,
|
||||
clickModalToClose: false,
|
||||
tableConfig: {
|
||||
@ -142,8 +161,6 @@ export default function () {
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
|
||||
return {
|
||||
carPayloadDialogConfigs,
|
||||
dialogConfigs: dialogJustFormConfigs,
|
||||
@ -156,11 +173,11 @@ export default function () {
|
||||
fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的
|
||||
},
|
||||
urls: {
|
||||
base: '/pms/carHistory',
|
||||
payload: '/pms/carHandle', // hisId 查询 载砖详情
|
||||
base: "/pms/carHistory",
|
||||
payload: "/pms/carHandle", // hisId 查询 载砖详情
|
||||
page: "/pms/pallet/pageView",
|
||||
pageIsPostApi: true,
|
||||
printLog: '/pms/pallet/print', // post
|
||||
printLog: "/pms/pallet/print", // post
|
||||
},
|
||||
};
|
||||
}
|
||||
|
147
src/views/modules/pms/palletPrint/config.js
Normal file
147
src/views/modules/pms/palletPrint/config.js
Normal 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
|
||||
},
|
||||
};
|
||||
}
|
47
src/views/modules/pms/palletPrint/index.vue
Normal file
47
src/views/modules/pms/palletPrint/index.vue
Normal 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>
|
394
src/views/modules/pms/stockOrder/config.js
Normal file
394
src/views/modules/pms/stockOrder/config.js
Normal 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'
|
||||
},
|
||||
};
|
||||
}
|
46
src/views/modules/pms/stockOrder/index.vue
Normal file
46
src/views/modules/pms/stockOrder/index.vue
Normal 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>
|
292
src/views/modules/pms/workReport/config.js
Normal file
292
src/views/modules/pms/workReport/config.js
Normal 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',
|
||||
},
|
||||
};
|
||||
}
|
51
src/views/modules/pms/workReport/index.vue
Normal file
51
src/views/modules/pms/workReport/index.vue
Normal 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>
|
Loading…
Reference in New Issue
Block a user