This commit is contained in:
lb 2023-09-15 16:56:51 +08:00
parent 61ca7b82cd
commit 3c44fbc636
10 changed files with 160 additions and 85 deletions

View File

@ -34,6 +34,32 @@
</span> </span>
</el-option> </el-option>
</el-select> </el-select>
<el-select
v-if="opt.complexSelect"
v-model="dataForm[opt.prop]"
v-bind="opt.bind"
clearable
size="small"
@keydown.enter.native.prevent="handleBtnClick('查询')">
<el-option
v-for="item in opt.complexSelect"
:key="item.value + Math.random().toString()"
:label="item.label"
:value="item.value">
<span>{{ item.label }}</span>
<span v-if="opt.customLabel" style="display: inline-clock; margin-left: 12px; font-size: 0.9em">
{{ item[opt.customLabel] || "无描述" }}
</span>
<template v-if="opt.customLabels">
<span
v-for="(label, idx) in opt.customLabels"
:key="Math.random()"
style="display: inline-clock; margin-left: 12px; font-size: 0.9em">
{{ item[label] || " - " }}
</span>
</template>
</el-option>
</el-select>
<el-date-picker <el-date-picker
v-if="opt.timerange" v-if="opt.timerange"
v-model="dataForm[opt.prop]" v-model="dataForm[opt.prop]"
@ -103,20 +129,33 @@ export default {
if (res.code === 0 && res.data) { if (res.code === 0 && res.data) {
// TODO: // TODO:
if ("list" in res.data) { if ("list" in res.data) {
this.$set( const optionProp = "complexSelect" in field ? "complexSelect" : "select";
field, let options = [];
"select", if (field.customLabel) {
"customLabel" in field options = res.data.list.map((item) => ({
? res.data.list.map((item) => ({
label: optionLabel ? item[optionLabel] : item.name, label: optionLabel ? item[optionLabel] : item.name,
value: optionValue ? item[optionValue] : item.id, value: optionValue ? item[optionValue] : item.id,
[field.customLabel]: item[field.customLabel], [field.customLabel]: item[field.customLabel],
})) }));
: res.data.list.map((item) => ({ } else if (field.customLabels) {
options = res.data.list.map((item) => {
let extraOptions = {};
field.customLabels.forEach((label) => {
extraOptions[label] = item[label];
});
return {
label: optionLabel ? item[optionLabel] : item.name, label: optionLabel ? item[optionLabel] : item.name,
value: optionValue ? item[optionValue] : item.id, value: optionValue ? item[optionValue] : item.id,
})) ...extraOptions,
); };
});
} else {
options = res.data.list.map((item) => ({
label: optionLabel ? item[optionLabel] : item.name,
value: optionValue ? item[optionValue] : item.id,
}));
}
this.$set(field, optionProp, options);
} }
} else { } else {
this.$message({ this.$message({

View File

@ -9,7 +9,7 @@ export default function () {
// { prop: "kilnCode", label: "窑炉" }, // { prop: "kilnCode", label: "窑炉" },
{ width: 128, prop: "orderCode", label: "主订单号" }, { width: 128, prop: "orderCode", label: "主订单号" },
{ width: 60, prop: "orderCate", label: "子号" }, { width: 60, prop: "orderCate", label: "子号" },
{ width: 128, prop: "code", label: "混料订单号" }, // { width: 128, prop: "code", label: "混料订单号" },
{ {
width: 80, width: 80,
prop: "percent", prop: "percent",
@ -25,7 +25,7 @@ export default function () {
// { prop: "startTime", label: "开始时间" }, // { prop: "startTime", label: "开始时间" },
// { prop: "shapeCode", label: "砖型" }, // { prop: "shapeCode", label: "砖型" },
{ prop: "bomCode", label: "配方" }, { prop: "bomCode", label: "配方" },
{ prop: "bomName", label: "牌号" }, { width: 180, prop: "bomName", label: "牌号" },
{ width: 60, prop: "ai", label: "版本" }, { width: 60, prop: "ai", label: "版本" },
{ width: 120, prop: "qty", label: "混料总量 [kg]" }, { width: 120, prop: "qty", label: "混料总量 [kg]" },
{ width: 120, prop: "comqty", label: "已完成量 [kg]" }, { width: 120, prop: "comqty", label: "已完成量 [kg]" },
@ -40,7 +40,7 @@ export default function () {
prop: "operations", prop: "operations",
name: "操作", name: "操作",
fixed: "right", fixed: "right",
width: 190, width: 210,
subcomponent: TableOperaionComponent, subcomponent: TableOperaionComponent,
options: [ options: [
{ {

View File

@ -7,21 +7,21 @@ export default function () {
const tableProps = [ const tableProps = [
{ type: "index", label: "序号" }, { type: "index", label: "序号" },
// { prop: "updateTime", label: "上料时间", filter: timeFilter }, // { prop: "updateTime", label: "上料时间", filter: timeFilter },
{ prop: "materialName", label: "原料" }, { width: 100, prop: "materialName", label: "原料" },
// { prop: "material", label: "原料编码" }, // { prop: "material", label: "原料编码" },
{ prop: "qty", label: "上料量" }, { width: 90, prop: "qty", label: "上料量[kg]", filter: val => (val != null) ? (+val).toFixed(0) : '-' },
{ prop: "siloName1", label: "上料料仓1" }, { width: 100, prop: "siloName1", label: "上料料仓1" },
{ prop: "siloName2", label: "上料料仓2" }, { width: 100, prop: "siloName2", label: "上料料仓2" },
{ prop: "siloName3", label: "上料料仓3" }, { width: 100, prop: "siloName3", label: "上料料仓3" },
{ prop: "startTime", label: "开始上料时间", filter: timeFilter }, { width: 256, prop: "startTime", label: "开始上料时间", filter: timeFilter },
{ prop: "endTime", label: "结束上料时间", filter: timeFilter }, { width: 256, prop: "endTime", label: "结束上料时间", filter: timeFilter },
{ prop: "silo1Change", label: "料仓1变化" }, { width: 128, prop: "silo1Change", label: "料仓1变化[kg]", filter: val => (val != null) ? (+val).toFixed(0) : '-' },
{ prop: "silo2Change", label: "料仓2变化" }, { width: 128, prop: "silo2Change", label: "料仓2变化[kg]", filter: val => (val != null) ? (+val).toFixed(0) : '-' },
{ prop: "silo3Change", label: "料仓3变化" }, { width: 128, prop: "silo3Change", label: "料仓3变化[kg]", filter: val => (val != null) ? (+val).toFixed(0) : '-' },
{ prop: "statusDictValue", label: "破碎作业", filter: (val) => ["正常停止", "废除"][val] ?? "-" }, // { width: 128, prop: "statusDictValue", label: "破碎作业", filter: (val) => ["正常停止", "废除"][val] ?? "-" },
// { prop: "description", label: "描述" }, // { prop: "description", label: "描述" },
{ prop: "remark", label: "备注" }, { width: 128, prop: "remark", label: "备注" },
{ prop: "createTime", label: "添加时间", filter: timeFilter }, // { width: 256, prop: "createTime", label: "添加时间", filter: timeFilter },
{ {
prop: "operations", prop: "operations",
name: "操作", name: "操作",

View File

@ -9,19 +9,19 @@ export default function () {
// { prop: "updateTime", label: "上料时间", filter: timeFilter }, // { prop: "updateTime", label: "上料时间", filter: timeFilter },
{ prop: "materialName", label: "原料" }, { prop: "materialName", label: "原料" },
// { prop: "material", label: "原料编码" }, // { prop: "material", label: "原料编码" },
{ prop: "qty", label: "计划上料量" }, { prop: "qty", label: "计划上料量[kg]", filter: val => (val != null) ? (+val).toFixed(0) : '-' },
{ prop: "siloName1", label: "上料料仓" }, { prop: "siloName1", label: "上料料仓" },
// { prop: "siloName2", label: "上料料仓2" }, // { prop: "siloName2", label: "上料料仓2" },
// { prop: "siloName3", label: "上料料仓3" }, // { prop: "siloName3", label: "上料料仓3" },
{ prop: "startTime", label: "开始上料时间", filter: timeFilter }, { prop: "startTime", label: "开始上料时间", filter: timeFilter },
{ prop: "endTime", label: "结束上料时间", filter: timeFilter }, { prop: "endTime", label: "结束上料时间", filter: timeFilter },
{ prop: "silo1Change", label: "料仓变化" }, { prop: "silo1Change", label: "料仓变化[kg]", filter: val => (val != null) ? (+val).toFixed(0) : '-' },
// { prop: "silo2Change", label: "料仓2变化" }, // { prop: "silo2Change", label: "料仓2变化" },
// { prop: "silo3Change", label: "料仓3变化" }, // { prop: "silo3Change", label: "料仓3变化" },
{ prop: "statusDictValue", label: "破碎作业", filter: (val) => ["正常停止", "废除"][val] ?? "-" }, // { prop: "statusDictValue", label: "破碎作业", filter: (val) => ["正常停止", "废除"][val] ?? "-" },
// { prop: "description", label: "描述" }, // { prop: "description", label: "描述" },
{ prop: "remark", label: "备注" }, { prop: "remark", label: "备注" },
{ prop: "createTime", label: "添加时间", filter: timeFilter }, // { prop: "createTime", label: "添加时间", filter: timeFilter },
{ {
prop: "operations", prop: "operations",
name: "操作", name: "操作",
@ -68,9 +68,11 @@ export default function () {
prop: "material", prop: "material",
label: "按原料搜索", label: "按原料搜索",
// input: true, // input: true,
select: [], complexSelect: [],
fieldOptionValue: "name", // 把料仓筛选条件的label改为展示code而不是展示name fieldOptionLabel: 'code',
fieldOptionValue: "code", // 把料仓筛选条件的label改为展示code而不是展示name
default: { value: "" }, default: { value: "" },
customLabels: ["description", "name"],
fn: () => this.$http.get("/pms/material/page", { params: { page: 1, limit: 999 } }), fn: () => this.$http.get("/pms/material/page", { params: { page: 1, limit: 999 } }),
bind: { bind: {
placeholder: "请输入原料名", placeholder: "请输入原料名",

View File

@ -110,7 +110,7 @@ export default function () {
extraParams: ["techId", "key"], extraParams: ["techId", "key"],
props: [ props: [
{ prop: "name", label: "参数名称", isEditField: true }, { prop: "name", label: "参数名称", isEditField: true },
{ prop: "code", label: "参数编码", isEditField: true }, // { prop: "code", label: "参数编码", isEditField: true },
{ width: 80, prop: "value", label: "参数值", isEditField: true }, { width: 80, prop: "value", label: "参数值", isEditField: true },
{ prop: "description", label: "描述", isEditField: true }, { prop: "description", label: "描述", isEditField: true },
{ {
@ -141,20 +141,24 @@ export default function () {
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入参数名称" }, elparams: { placeholder: "请输入参数名称" },
}, },
{ // {
input: true, // input: true,
label: "参数编码", // label: "参数编码",
prop: "code", // prop: "code",
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, // rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入参数编码" }, // elparams: { placeholder: "请输入参数编码" },
}, // },
],
[
{ input: true, label: "参数值上限", prop: "valueTop", elparams: { placeholder: "请输入参数值上限" } }
], ],
[ [
{ input: true, label: "参数值上限", prop: "valueTop", elparams: { placeholder: "请输入参数值上限" } },
{ input: true, label: "参数值下限", prop: "valueFloor", elparams: { placeholder: "请输入参数值下限" } }, { input: true, label: "参数值下限", prop: "valueFloor", elparams: { placeholder: "请输入参数值下限" } },
], ],
[ [
{ input: true, label: "参数值", prop: "value", elparams: { placeholder: "请输入参数值" } }, { input: true, label: "参数值", prop: "value", elparams: { placeholder: "请输入参数值" } }
],
[
{ {
input: true, input: true,
label: "描述", label: "描述",

View File

@ -6,20 +6,21 @@ import { timeFilter } from "@/utils/filters";
export default function () { export default function () {
const tableProps = [ const tableProps = [
{ type: "index", label: "序号" }, { type: "index", label: "序号" },
{ prop: "kilnCode", label: "窑炉" },
{ width: 160, prop: "orderCode", label: "主订单号" }, { width: 160, prop: "orderCode", label: "主订单号" },
{ width: 60, prop: "orderCate", label: "子号" }, { width: 60, prop: "orderCate", label: "子号" },
{ width: 160, prop: "code", label: "烧成订单号" }, { prop: "kilnCode", label: "窑炉" },
{ width: 60, prop: "percent", label: "进度", filter: (val) => (val !== null && val !== undefined ? val + " %" : "-") }, { width: 60, prop: "percent", label: "进度", filter: (val) => (val !== null && val !== undefined ? val + " %" : "-") },
// { width: 160, prop: "code", label: "烧成订单号" },
// { prop: "statusDictValue", label: "订单状态", filter: (val) => (val !== null && val !== undefined ? ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝"][val] : "-"), }, // { prop: "statusDictValue", label: "订单状态", filter: (val) => (val !== null && val !== undefined ? ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝"][val] : "-"), },
// { prop: "startTime", label: "开始时间" }, // { prop: "startTime", label: "开始时间" },
{ prop: "bomCode", label: "配方" }, { width: 180, prop: "bomName", label: "牌号" },
{ prop: 'sapParam6', label: '烧成温度' },
{ prop: 'sapParam7', label: '保温时间' },
{ width: 80, prop: "ai", label: "版本号" }, { width: 80, prop: "ai", label: "版本号" },
{ width: 80, prop: "qty", label: "生产量" }, { width: 80, prop: "qty", label: "生产量" },
{ prop: "qtyComplete", label: "完成量" }, { prop: "qtyComplete", label: "完成量" },
{ width: 160, prop: "createTime", label: "添加时间", filter: timeFilter }, { width: 160, prop: "createTime", label: "添加时间", filter: timeFilter },
// { prop: "remark", label: "备注" }, // { prop: "remark", label: "备注" },
// { prop: 'version', label: '配方号' },
// { prop: 'status', label: '状态', subcomponent: StatusComponent }, // subcomponent // { prop: 'status', label: '状态', subcomponent: StatusComponent }, // subcomponent
// { prop: "description", label: "详情", subcomponent: TableTextComponent }, // { prop: "description", label: "详情", subcomponent: TableTextComponent },
// { // {

View File

@ -2,28 +2,52 @@
<div class="storage-box" :style="{ outlineColor: color }"> <div class="storage-box" :style="{ outlineColor: color }">
<div <div
class="storage-title" class="storage-title"
style="margin-bottom: 10px; padding-bottom: 12px; text-align: center; font-weight: bold; font-size: 1.125em; border-bottom: 1px solid #ccc3" style="
> margin-bottom: 10px;
<span style="display: inline-block; color: white; padding: 6px 12px; border-radius: 6px 20px" :style="{ background: color }"> padding-bottom: 12px;
text-align: center;
font-weight: bold;
font-size: 1.125em;
border-bottom: 1px solid #ccc3;
">
<span
style="display: inline-block; color: white; padding: 6px 12px; border-radius: 6px 20px"
:style="{ background: color }">
{{ storage }} {{ storage }}
</span> </span>
</div> </div>
<div class="storage-body" style="height: 120px; display: flex"> <div class="storage-body" style="height: 120px; display: flex">
<div class="storage-box__bg" style="height: 100%; width: 48px; margin-right: 12px; border-radius: 4px; overflow: hidden"> <div
class="storage-box__bg"
style="height: 100%; width: 48px; margin-right: 12px; border-radius: 4px; overflow: hidden">
<div <div
class="storage-box__inner" class="storage-box__inner"
style="position: absolute; bottom: 0; left: 0; height: 0; width: 100%; font-size: 1.125rem; text-align: center;" style="
:style="{ background: color, height: computedRatio + '%', color: computedRatio > 20 ? 'white' : '#ccc' }" position: absolute;
> bottom: 0;
<span style="height: 100%; display: flex; flex-direction: column; justify-content: flex-end;">{{ computedRatio + '%' }}</span> left: 0;
height: 0;
width: 100%;
font-size: 1.125rem;
text-align: center;
"
:style="{
background: color,
height: computedRatio + '%',
color: computedRatio > 20 ? 'white' : '#ccc',
}">
<span style="height: 100%; display: flex; flex-direction: column; justify-content: flex-end">
{{ computedRatio + "%" }}
</span>
</div> </div>
</div> </div>
<div style="display: flex; flex-direction: column; min-width: 128px; justify-content: space-between"> <div style="display: flex; flex-direction: column; min-width: 128px; justify-content: space-between">
<div style="font-size: 1.125em; line-height: 2.5; text-align: right">{{ material }}</div> <div style="font-size: 1.125em; line-height: 2.5; text-align: right">{{ material }}</div>
<div style="font-size: 1.5em; line-height: 1.25; text-align: right; font-weight: bold"> <div style="font-size: 1.5em; line-height: 1.25; text-align: right; font-weight: bold">
{{ qty }} <span style="color: #777; font-weight: normal; font-size: 1rem">{{ computedUnit }}</span> {{ qty }}
<span style="color: #777; font-weight: normal; font-size: 1rem">{{ computedUnit }}</span>
</div> </div>
<!-- <div class="btn-group" style="text-align: right"> <!-- <div class="btn-group" style="text-align: right">
@ -76,12 +100,12 @@ export default {
}, },
computed: { computed: {
computedUnit() { computedUnit() {
if (!this.unitValue) return "存量"; if (!this.unitValue) return "存量[kg]";
return this.unitList(this.unitValue) + " 存量"; return this.unitList(this.unitValue) + " 存量[kg]";
}, },
computedRatio() { computedRatio() {
return this.ratio ? this.ratio.toFixed(2) * 100 : 0 return this.ratio ? this.ratio.toFixed(2) * 100 : 0;
} },
}, },
created() {}, created() {},
mounted() {}, mounted() {},

View File

@ -9,7 +9,7 @@ export default function () {
// { prop: "kilnCode", label: "窑炉" }, // { prop: "kilnCode", label: "窑炉" },
{ width: 160, prop: "orderCode", label: "主订单号" }, { width: 160, prop: "orderCode", label: "主订单号" },
{ width: 60, prop: "orderCate", label: "子号" }, { width: 60, prop: "orderCate", label: "子号" },
{ width: 160, prop: "code", label: "压制订单号" }, // { width: 160, prop: "code", label: "压制订单号" },
{ {
width: 90, width: 90,
prop: "percent", prop: "percent",
@ -26,6 +26,7 @@ export default function () {
}, },
{ width: 160, prop: "startTime", label: "开始时间", filter: timeFilter }, { width: 160, prop: "startTime", label: "开始时间", filter: timeFilter },
{ width: 100, prop: "shapeCode", label: "砖型" }, { width: 100, prop: "shapeCode", label: "砖型" },
{ width: 180, prop: "bomName", label: "牌号" },
{ prop: "pressCode", label: "压机" }, { prop: "pressCode", label: "压机" },
{ width: 80, prop: "qty", label: "生产量" }, { width: 80, prop: "qty", label: "生产量" },
{ prop: "qtyComplete", label: "完成量" }, { prop: "qtyComplete", label: "完成量" },

View File

@ -7,9 +7,9 @@ export default function () {
const tableProps = [ const tableProps = [
{ type: "index", label: "序号" }, { type: "index", label: "序号" },
// { prop: "kilnCode", label: "窑炉" }, // { prop: "kilnCode", label: "窑炉" },
{ width: 120, prop: "orderCode", label: "主订单号" }, { prop: "orderCode", label: "主订单号" },
{ width: 60, prop: "orderCate", label: "子号" }, { prop: "orderCate", label: "子号" },
{ /** width: 210, **/ prop: "code", label: "检测包装订单号" }, // { /** width: 210, **/ prop: "code", label: "检测包装订单号" },
{ {
width: 90, width: 90,
prop: "percent1", prop: "percent1",
@ -22,8 +22,8 @@ export default function () {
// filter: (val) => (val !== null && val !== undefined ? ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝", "已下发"][val] : "-"), // filter: (val) => (val !== null && val !== undefined ? ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝", "已下发"][val] : "-"),
// }, // },
// { width: 120, prop: "startTime", label: "开始时间" }, // { width: 120, prop: "startTime", label: "开始时间" },
{ width: 120, prop: "shapeCode", label: "砖型" }, { prop: "shapeCode", label: "砖型" },
{ width: 90, prop: "packTech", label: "版本号" }, // { width: 90, prop: "packTech", label: "版本号" },
{ width: 90, prop: "qty1", label: "检测量" }, { width: 90, prop: "qty1", label: "检测量" },
{ width: 120, prop: "qty1Complete", label: "完成量" }, { width: 120, prop: "qty1Complete", label: "完成量" },
{ width: 120, prop: "goodqty1", label: "检测合格量" }, { width: 120, prop: "goodqty1", label: "检测合格量" },

View File

@ -142,7 +142,7 @@ export default function () {
// { type: 'index', label: '序号' }, // { type: 'index', label: '序号' },
// { prop: "createTime", label: "添加时间", filter: timeFilter }, // { prop: "createTime", label: "添加时间", filter: timeFilter },
{ prop: "name", label: "参数名称", isEditField: true }, { prop: "name", label: "参数名称", isEditField: true },
{ prop: "code", label: "参数编码", isEditField: true }, // { prop: "code", label: "参数编码", isEditField: true },
// { prop: "specifications", label: "规格", isEditField: true }, // { prop: "specifications", label: "规格", isEditField: true },
{ width: 80, prop: "value", label: "参数值", isEditField: true }, { width: 80, prop: "value", label: "参数值", isEditField: true },
// { prop: "valueFloor", label: "参数值下限", isEditField: true }, // { prop: "valueFloor", label: "参数值下限", isEditField: true },
@ -176,20 +176,24 @@ export default function () {
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入参数名称" }, elparams: { placeholder: "请输入参数名称" },
}, },
{ // {
input: true, // input: true,
label: "参数编码", // label: "参数编码",
prop: "code", // prop: "code",
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, // rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入参数编码" }, // elparams: { placeholder: "请输入参数编码" },
}, // },
], ],
[ [
{ input: true, label: "参数值上限", prop: "valueTop", elparams: { placeholder: "请输入参数值上限" } }, { input: true, label: "参数值上限", prop: "valueTop", elparams: { placeholder: "请输入参数值上限" } },
],
[
{ input: true, label: "参数值下限", prop: "valueFloor", elparams: { placeholder: "请输入参数值下限" } }, { input: true, label: "参数值下限", prop: "valueFloor", elparams: { placeholder: "请输入参数值下限" } },
], ],
[ [
{ input: true, label: "参数值", prop: "value", elparams: { placeholder: "请输入参数值" } }, { input: true, label: "参数值", prop: "value", elparams: { placeholder: "请输入参数值" } },
],
[
{ {
input: true, input: true,
label: "描述", label: "描述",