update 2023.4.6

This commit is contained in:
lb 2023-04-06 15:58:02 +08:00
parent 247cca284e
commit 10b50df6f6
14 changed files with 343 additions and 339 deletions

View File

@ -47,8 +47,9 @@
:tooltip-effect="head.tooltipEffect || 'light'" :tooltip-effect="head.tooltipEffect || 'light'"
filter-placement="top" filter-placement="top"
:align="head.align || null" :align="head.align || null"
:class-name="head.className ?? 'initial-column-class'"
v-bind="head.more" v-bind="head.more"
:show-overflow-tooltip="head.showOverflowTooltip || !(head.prop === 'operations')" :show-overflow-tooltip="head.showOverflowTooltip ?? !(head.prop === 'operations')"
> >
<!-- :show-overflow-tooltip="head.showOverflowTooltip || true" --> <!-- :show-overflow-tooltip="head.showOverflowTooltip || true" -->
<!-- 子组件 --> <!-- 子组件 -->
@ -132,4 +133,13 @@ export default {
.cell button { .cell button {
background: blue; background: blue;
} }
.base-list-table >>> .initial-column-class .cell {
text-shadow: unset;
}
.base-list-table >>> .no-padding-class .cell {
line-height: 1.75;
padding: 0;
}
</style> </style>

View File

@ -1,11 +1,6 @@
<template> <template>
<el-dialog <el-dialog class="dialog-with-menu" :visible="dialogVisible" :destroy-on-close="false" @close="handleClose"
class="dialog-with-menu" :close-on-click-modal="configs.clickModalToClose ?? true">
:visible="dialogVisible"
:destroy-on-close="false"
@close="handleClose"
:close-on-click-modal="configs.clickModalToClose ?? true"
>
<!-- title --> <!-- title -->
<div slot="title" class="dialog-title"> <div slot="title" class="dialog-title">
<h1 class=""> <h1 class="">
@ -15,27 +10,14 @@
<div class="dialog-body__inner relative"> <div class="dialog-body__inner relative">
<!-- v-if="dataForm.id && !detailMode && /属性|详情/.test(activeMenu) && $hasPermission()" --> <!-- v-if="dataForm.id && !detailMode && /属性|详情/.test(activeMenu) && $hasPermission()" -->
<el-button <el-button v-if="configs.allowAdd ?? (dataForm.id && !detailMode && /属性|详情|参数/.test(activeMenu))" plain type="primary" size="small"
v-if="dataForm.id && !detailMode && /属性|详情|参数/.test(activeMenu)" class="at-right-top" style="margin-bottom: 16px" @click="handleAddParam()">+ 添加</el-button>
plain
type="primary"
size="small"
class="at-right-top"
style="margin-bottom: 16px"
@click="handleAddParam()"
>+ 添加</el-button
>
<template v-if="dataForm.id && !detailMode && /附件/.test(activeMenu)"> <template v-if="dataForm.id && !detailMode && /附件/.test(activeMenu)">
<el-upload <el-upload style="position: absolute; width: 100%; height: 0" name="files" :action="uploadUrl"
style="position: absolute; width: 100%; height: 0" :show-file-list="false" :headers="uploadHeaders" :on-success="handleUploadSuccess"
name="files" :before-upload="handleUploadCheck">
:action="uploadUrl" <el-button plain type="primary" size="small" class="at-right-top" style=""> <i class="el-icon-upload"></i> 上传
:show-file-list="false" </el-button>
:headers="uploadHeaders"
:on-success="handleUploadSuccess"
:before-upload="handleUploadCheck"
>
<el-button plain type="primary" size="small" class="at-right-top" style=""> <i class="el-icon-upload"></i> 上传 </el-button>
</el-upload> </el-upload>
</template> </template>
@ -44,13 +26,11 @@
<!-- <el-tab-pane v-for="(tab, index) in configs.menu" :key="index" :label="tab.name" :name="tab.name"> --> <!-- <el-tab-pane v-for="(tab, index) in configs.menu" :key="index" :label="tab.name" :name="tab.name"> -->
<el-tab-pane v-for="(tab, index) in actualMenus" :key="index" :name="tab.name"> <el-tab-pane v-for="(tab, index) in actualMenus" :key="index" :name="tab.name">
<span class="slot" slot="label"> <span class="slot" slot="label">
<i <i :class="{
:class="{
'el-icon-edit': tab.key === 'info', 'el-icon-edit': tab.key === 'info',
'el-icon-s-data': tab.key === 'attr', 'el-icon-s-data': tab.key === 'attr',
'el-icon-folder-opened': tab.key === 'attachment', 'el-icon-folder-opened': tab.key === 'attachment',
}" }"></i>
></i>
{{ tab.name }} {{ tab.name }}
</span> </span>
@ -60,61 +40,34 @@
<el-form ref="dataForm" :model="dataForm" v-loading="loadingStatus"> <el-form ref="dataForm" :model="dataForm" v-loading="loadingStatus">
<el-row v-for="(row, rowIndex) in configs.form.rows" :key="'row_' + rowIndex" :gutter="20"> <el-row v-for="(row, rowIndex) in configs.form.rows" :key="'row_' + rowIndex" :gutter="20">
<el-col v-for="(col, colIndex) in row" :key="colIndex" :span="24 / row.length"> <el-col v-for="(col, colIndex) in row" :key="colIndex" :span="24 / row.length">
<el-form-item :label="col.label" :prop="col.prop" :rules="col.rules || null" v-show="!col.forceDisabled || (col.forceDisabled && dataForm.id)"> <el-form-item :label="col.label" :prop="col.prop" :rules="col.rules || null"
v-show="!col.forceDisabled || (col.forceDisabled && dataForm.id)">
<div v-if="col.forceDisabled && dataForm.id" class="force-disabled"> <div v-if="col.forceDisabled && dataForm.id" class="force-disabled">
<el-tag :key="col.key" :type="col.type">{{ dataForm[col.prop] || "-" }}</el-tag> <el-tag :key="col.key" :type="col.type">{{ dataForm[col.prop] || "-" }}</el-tag>
</div> </div>
<el-input v-if="col.input" v-model="dataForm[col.prop]" clearable :disabled="disableCondition(col.prop)" v-bind="col.elparams" /> <el-input v-if="col.input" v-model="dataForm[col.prop]" clearable
<el-cascader :disabled="disableCondition(col.prop)" v-bind="col.elparams" />
v-if="col.cascader" <el-cascader v-if="col.cascader" v-model="dataForm[col.prop]" :options="col.options"
v-model="dataForm[col.prop]" :disabled="detailMode" v-bind="col.elparams"></el-cascader>
:options="col.options" <el-select v-if="col.select" v-model="dataForm[col.prop]" clearable
:disabled="detailMode" :disabled="disableCondition(col.prop)" v-bind="col.elparams"
v-bind="col.elparams" @change="handleSelectChange(col, $event)">
></el-cascader> <el-option v-for="(opt, optIdx) in col.options" :key="'option_' + optIdx" :label="opt.label"
<el-select :value="opt.value" />
v-if="col.select"
v-model="dataForm[col.prop]"
clearable
:disabled="disableCondition(col.prop)"
v-bind="col.elparams"
@change="handleSelectChange(col, $event)"
>
<el-option v-for="(opt, optIdx) in col.options" :key="'option_' + optIdx" :label="opt.label" :value="opt.value" />
</el-select> </el-select>
<el-switch <el-switch v-if="col.switch" v-model="dataForm[col.prop]" :active-value="1" :inactive-value="0"
v-if="col.switch" @change="handleSwitchChange" :disabled="disableCondition(col.prop)" />
v-model="dataForm[col.prop]" <el-input v-if="col.textarea" type="textarea" v-model="dataForm[col.prop]"
:active-value="1" :disabled="disableCondition(col.prop)" v-bind="col.elparams" />
:inactive-value="0" <quillEditor v-if="col.richInput" ref="quill-editor" v-model="dataForm[col.prop]"
@change="handleSwitchChange" :options="col.quillConfig ?? defaultQuillConfig" style="margin-top: 42px"
:disabled="disableCondition(col.prop)" :disabled="disableCondition(col.prop)" />
/>
<el-input
v-if="col.textarea"
type="textarea"
v-model="dataForm[col.prop]"
:disabled="disableCondition(col.prop)"
v-bind="col.elparams"
/>
<quillEditor
v-if="col.richInput"
ref="quill-editor"
v-model="dataForm[col.prop]"
:options="col.quillConfig ?? defaultQuillConfig"
style="margin-top: 42px"
:disabled="disableCondition(col.prop)"
/>
<div class="" v-if="col.component" style="margin: 42px 0 0"> <div class="" v-if="col.component" style="margin: 42px 0 0">
<!-- 下面这个 component 几乎是为 富文本 quill 定制的了... TODO后续可能会根据业务需求创建新的版本 --> <!-- 下面这个 component 几乎是为 富文本 quill 定制的了... TODO后续可能会根据业务需求创建新的版本 -->
<component <component :is="col.component" :key="'component_' + col.prop"
:is="col.component" @update:modelValue="handleComponentModelUpdate(col.prop, $event)" :modelValue="dataForm[col.prop]"
:key="'component_' + col.prop" :mode="detailMode ? 'detail' : dataForm.id ? 'edit' : 'create'" />
@update:modelValue="handleComponentModelUpdate(col.prop, $event)"
:modelValue="dataForm[col.prop]"
:mode="detailMode ? 'detail' : dataForm.id ? 'edit' : 'create'"
/>
</div> </div>
<!-- add more... --> <!-- add more... -->
</el-form-item> </el-form-item>
@ -125,29 +78,13 @@
<!-- 表格标签页 --> <!-- 表格标签页 -->
<div v-if="dataForm.id && tab.key === 'attr'" key="attr-list"> <div v-if="dataForm.id && tab.key === 'attr'" key="attr-list">
<BaseListTable <BaseListTable :table-config="null" :column-config="filteredTableProps" :table-data="subList"
:table-config="null" @operate-event="handleTableRowOperate" :current-page="attrPage" :current-size="attrSize"
:column-config="filteredTableProps" :refresh-layout-key="Math.random()" v-loading="loadingStatus" />
:table-data="subList"
@operate-event="handleTableRowOperate"
:current-page="attrPage"
:current-size="attrSize"
:refresh-layout-key="Math.random()"
v-loading="loadingStatus"
/>
<!-- paginator --> <!-- paginator -->
<el-pagination <el-pagination class="" style="text-align: left" background @size-change="handleSizeChange"
class="" @current-change="handlePageChange" :current-page.sync="attrPage" :page-sizes="[5, 10, 20]"
style="text-align: left" :page-size="attrSize" :total="attrTotal" layout="total, sizes, prev, next"></el-pagination>
background
@size-change="handleSizeChange"
@current-change="handlePageChange"
:current-page.sync="attrPage"
:page-sizes="[5, 10, 20]"
:page-size="attrSize"
:total="attrTotal"
layout="total, sizes, prev, next"
></el-pagination>
</div> </div>
<!-- 附件标签页 --> <!-- 附件标签页 -->
@ -173,7 +110,8 @@
</ul> </ul>
</div> </div>
<!-- img preview dialog --> <!-- img preview dialog -->
<el-dialog key="image-preview-dialog" class="image-preview-dialog" :visible.sync="imgPreviewDialogVisible" :append-to-body="true"> <el-dialog key="image-preview-dialog" class="image-preview-dialog" :visible.sync="imgPreviewDialogVisible"
:append-to-body="true">
<div class="img-container"> <div class="img-container">
<img width="100%" :src="currentImgUrl" alt="" /> <img width="100%" :src="currentImgUrl" alt="" />
</div> </div>
@ -184,27 +122,15 @@
</div> </div>
<!-- sub dialog --> <!-- sub dialog -->
<small-dialog <small-dialog :append-to-body="true" v-if="showSubDialog" ref="subDialog" :url="urls.subase"
:append-to-body="true" :configs="configs.subDialog" :related-id="dataForm.id" @refreshDataList="getSubList"></small-dialog>
v-if="showSubDialog"
ref="subDialog"
:url="urls.subase"
:configs="configs.subDialog"
:related-id="dataForm.id"
@refreshDataList="getSubList"
></small-dialog>
<!-- footer --> <!-- footer -->
<div slot="footer"> <div slot="footer">
<template v-for="(operate, index) in configs.form.operations"> <template v-for="(operate, index) in configs.form.operations">
<el-button <el-button v-if="showButton(operate)" :key="'operation_' + index" :type="operate.type"
v-if="showButton(operate)"
:key="'operation_' + index"
:type="operate.type"
@click="handleBtnClick(operate)" @click="handleBtnClick(operate)"
:loading="(operate.name === 'add' || operate.name === 'update') && btnLoading" :loading="(operate.name === 'add' || operate.name === 'update') && btnLoading">{{ operate.label }}</el-button>
>{{ operate.label }}</el-button
>
</template> </template>
<el-button @click="handleBtnClick({ name: 'cancel' })">取消</el-button> <el-button @click="handleBtnClick({ name: 'cancel' })">取消</el-button>
</div> </div>
@ -276,8 +202,14 @@ export default {
col, col,
"options", "options",
"list" in res.data "list" in res.data
? res.data.list.map((i) => ({ label: i.name, value: i.id })) ? res.data.list.map((i) => ({
: res.data.map((i) => ({ label: i.name, value: i.id })) label: col.optionLabel ? i[col.optionLabel] : i.name,
value: col.optionValue ? i[col.optionValue] : i.id,
}))
: res.data.map((i) => ({
label: col.optionLabel ? i[col.optionLabel] : i.name,
value: col.optionValue ? i[col.optionValue] : i.id,
}))
); );
// col.options = res.data.list; // col.options = res.data.list;
else if (col.options.length) { else if (col.options.length) {
@ -286,8 +218,14 @@ export default {
col, col,
"options", "options",
"list" in res.data "list" in res.data
? res.data.list.map((i) => ({ label: i.name, value: i.id })) ? res.data.list.map((i) => ({
: res.data.map((i) => ({ label: i.name, value: i.id })) label: col.optionLabel ? i[col.optionLabel] : i.name,
value: col.optionValue ? i[col.optionValue] : i.id,
}))
: res.data.map((i) => ({
label: col.optionLabel ? i[col.optionLabel] : i.name,
value: col.optionValue ? i[col.optionValue] : i.id,
}))
); );
} }
} else { } else {
@ -364,7 +302,7 @@ export default {
scrollingContainer: null, scrollingContainer: null,
}, },
attrPage: 1, attrPage: 1,
attrSize: 5, attrSize: 10,
attrTotal: 0, attrTotal: 0,
fileList: [], fileList: [],
imgPreviewDialogVisible: false, imgPreviewDialogVisible: false,
@ -375,7 +313,7 @@ export default {
dialogVisible: function (val) { dialogVisible: function (val) {
if (!!val) { if (!!val) {
this.attrPage = 1 this.attrPage = 1
this.attrSize = 5 this.attrSize = 10
} }
}, },
}, },
@ -612,7 +550,7 @@ export default {
} }
}); });
}) })
.catch((err) => {}); .catch((err) => { });
} }
} }
}, },
@ -880,7 +818,7 @@ export default {
} }
}); });
}) })
.catch((err) => {}); .catch((err) => { });
} }
case "edit": { case "edit": {
this.handleAddParam(data); /** data is ==> id */ this.handleAddParam(data); /** data is ==> id */
@ -909,7 +847,7 @@ export default {
/* border-bottom-color: #0b58ff; */ /* border-bottom-color: #0b58ff; */
/* } */ /* } */
.dialog-with-menu >>> .el-dialog__body { .dialog-with-menu>>>.el-dialog__body {
/* padding-top: 16px !important; /* padding-top: 16px !important;
padding-bottom: 16px !important; */ padding-bottom: 16px !important; */
padding-top: 0 !important; padding-top: 0 !important;
@ -921,7 +859,7 @@ export default {
width: 100% !important; width: 100% !important;
} }
.dialog-with-menu >>> .el-dialog__header { .dialog-with-menu>>>.el-dialog__header {
padding: 10px 20px 10px; padding: 10px 20px 10px;
/* background: linear-gradient(to bottom, rgba(0, 0, 0, 0.25), white); */ /* background: linear-gradient(to bottom, rgba(0, 0, 0, 0.25), white); */
} }
@ -938,7 +876,7 @@ export default {
} }
ul.file-list, ul.file-list,
ul.file-list > li { ul.file-list>li {
padding: 0; padding: 0;
margin: 0; margin: 0;
list-style: none; list-style: none;
@ -953,7 +891,7 @@ ul.file-list > li {
flex-direction: column; flex-direction: column;
} }
ul.file-list > li { ul.file-list>li {
border-radius: 4px; border-radius: 4px;
background-color: #edededd2; background-color: #edededd2;
padding: 8px; padding: 8px;
@ -962,7 +900,7 @@ ul.file-list > li {
justify-content: space-between; justify-content: space-between;
} }
ul.file-list > li:hover { ul.file-list>li:hover {
background-color: #ededed; background-color: #ededed;
} }
@ -985,5 +923,4 @@ ul.file-list > li:hover {
.force-disabled { .force-disabled {
margin-top: 42px; margin-top: 42px;
} }</style>
</style>

View File

@ -4,52 +4,23 @@
<!-- <head-form :form-config="headFormConfig" @headBtnClick="btnClick" /> --> <!-- <head-form :form-config="headFormConfig" @headBtnClick="btnClick" /> -->
<BaseSearchForm :head-config="headConfig" @btn-click="handleBtnClick" /> <BaseSearchForm :head-config="headConfig" @btn-click="handleBtnClick" />
<BaseListTable <BaseListTable v-loading="tableLoading" :table-config="tableConfig.table" :column-config="tableConfig.column"
v-loading="tableLoading" :table-data="dataList" @operate-event="handleOperate" :current-page="page" :current-size="size"
:table-config="tableConfig.table" :refresh-layout-key="refreshLayoutKey" />
:column-config="tableConfig.column"
:table-data="dataList"
@operate-event="handleOperate"
:current-page="page"
:current-size="size"
:refresh-layout-key="refreshLayoutKey"
/>
<el-pagination <el-pagination class="mt-5 flex justify-end" @size-change="handleSizeChange" @current-change="handlePageChange"
class="mt-5 flex justify-end" :current-page.sync="page" :page-sizes="[1, 5, 10, 20, 50, 100]" :page-size="size" :total="totalPage"
@size-change="handleSizeChange" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
@current-change="handlePageChange"
:current-page.sync="page"
:page-sizes="[1, 5, 10, 20, 50, 100]"
:page-size="size"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
<!-- :current-page.sync="currentPage" <!-- :current-page.sync="currentPage"
:page-size.sync="pageSize" --> :page-size.sync="pageSize" -->
<DialogWithMenu <DialogWithMenu ref="edit-dialog" v-if="!!dialogConfigs && dialogType === DIALOG_WITH_MENU"
ref="edit-dialog" :dialog-visible.sync="dialogVisible" :configs="dialogConfigs" @refreshDataList="getList" />
v-if="!!dialogConfigs && dialogType === DIALOG_WITH_MENU" <DialogJustForm ref="edit-dialog" v-if="!!dialogConfigs && dialogType === DIALOG_JUST_FORM"
:dialog-visible.sync="dialogVisible" :dialog-visible.sync="dialogVisible" :configs="dialogConfigs" @refreshDataList="getList"
:configs="dialogConfigs" @emit-data="handleOperate" />
@refreshDataList="getList" <DialogCarPayload ref="car-payload-dialog" v-if="!!carPayloadDialogConfigs"
/> :dialog-visible.sync="carPayloadDialogVisible" :configs="carPayloadDialogConfigs" @refreshDataList="getList" />
<DialogJustForm
ref="edit-dialog"
v-if="!!dialogConfigs && dialogType === DIALOG_JUST_FORM"
:dialog-visible.sync="dialogVisible"
:configs="dialogConfigs"
@refreshDataList="getList"
@emit-data="handleOperate"
/>
<DialogCarPayload
ref="car-payload-dialog"
v-if="!!carPayloadDialogConfigs"
:dialog-visible.sync="carPayloadDialogVisible"
:configs="carPayloadDialogConfigs"
@refreshDataList="getList"
/>
</div> </div>
</template> </template>
@ -274,7 +245,7 @@ export default {
} }
}); });
}) })
.catch((err) => {}); .catch((err) => { });
} }
case "edit": { case "edit": {
this.openDialog(data); /** data is ==> id */ this.openDialog(data); /** data is ==> id */
@ -329,12 +300,12 @@ export default {
break; break;
} }
case "to-bom-detail": { case "to-bom-detail": {
// console.log('to-bom-detail', data.name) console.log('to-bom-detail', data)
// //
return this.$router.push({ return this.$router.push({
name: "pms-bomDetails", name: "pms-bomDetails",
query: { query: {
name: data.name, code: data.code,
}, },
}); });
} }
@ -410,7 +381,13 @@ export default {
}); });
} }
case "detach": { case "detach": {
return this.$http
return this.$confirm('是否下发?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http
.post(this.urls.detach, data /* { id: data } */, { headers: { "Content-Type": "application/json" } }) .post(this.urls.detach, data /* { id: data } */, { headers: { "Content-Type": "application/json" } })
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code === 0) { if (res.code === 0) {
@ -430,6 +407,14 @@ export default {
}); });
} }
}); });
}).catch(() => {
this.$message({
type: 'warning',
message: '已取消下发'
});
});
} }
case "to-car-history": { case "to-car-history": {
return this.$router.push({ return this.$router.push({
@ -442,6 +427,23 @@ export default {
case "to-car-payload": { case "to-car-payload": {
// open dialog instead of redirect to a new page // open dialog instead of redirect to a new page
this.openCarPayloadDialog(data); this.openCarPayloadDialog(data);
break;
}
case "sync": {
//
this.$http.post(this.urls.syncSingleUrl, data, {
headers: {
"Content-Type": "application/json"
}
}).then(({ data: res }) => {
if (res.code === 0) {
this.$message({
message: '同步成功',
type: 'success'
});
this.getList();
}
})
} }
} }
}, },
@ -464,7 +466,6 @@ export default {
this.openDialog(); this.openDialog();
return; return;
} }
case "查询": { case "查询": {
const params = {}; const params = {};
if (typeof payload === "object") { if (typeof payload === "object") {
@ -498,10 +499,12 @@ export default {
this.getList(params); this.getList(params);
break; break;
} }
case "同步": case "同步":
case "全部同步":
this.$http.post(this.urls.syncUrl).then(({ data: res }) => { this.$http.post(this.urls.syncUrl).then(({ data: res }) => {
console.log('全部同步', res)
if (res.code === 0) { if (res.code === 0) {
this.$message({ message: '同步成功', type: 'success' })
this.getList(); this.getList();
} }
}); });

View File

@ -5,7 +5,7 @@ import { timeFilter } from "@/utils/filters";
export default function () { export default function () {
const tableProps = [ const tableProps = [
{ type: "index", label: "序号createTime" }, { type: "index", label: "序号" },
// { 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: "子号" },
@ -20,6 +20,7 @@ export default function () {
// { prop: "shapeCode", label: "砖型" }, // { prop: "shapeCode", label: "砖型" },
{ prop: "bomCode", label: "配方" }, { prop: "bomCode", label: "配方" },
{ width: 120, prop: "qty", label: "混料总量 [kg]" }, { width: 120, prop: "qty", label: "混料总量 [kg]" },
{ width: 120, prop: "comqty", label: "已完成量 [kg]" },
{ width: 60, prop: "ai", label: "版本" }, { width: 60, prop: "ai", label: "版本" },
{ prop: "blenderCode", label: "混料机" }, { prop: "blenderCode", label: "混料机" },
{ width: 160, prop: "", label: "添加时间", filter: timeFilter }, { width: 160, prop: "", label: "添加时间", filter: timeFilter },

View File

@ -6,9 +6,9 @@ import { timeFilter, dictFilter } from "@/utils/filters";
export default function () { export default function () {
const tableProps = [ const tableProps = [
{ type: "index", label: "序号" }, { type: "index", label: "序号" },
{ prop: "code", label: "配方号" },
{ prop: "name", label: "牌号" }, { prop: "name", label: "牌号" },
{ prop: "createTime", label: "添加时间", filter: timeFilter }, { prop: "createTime", label: "添加时间", filter: timeFilter },
// { prop: "code", label: "配方编码" },
// { prop: "externalCode", label: "版本号" }, // { prop: "externalCode", label: "版本号" },
// { prop: "specifications", label: "程序号" }, // { prop: "specifications", label: "程序号" },
// { prop: "unitDictValue", label: "砖型", filter: dictFilter("unit") }, // { prop: "unitDictValue", label: "砖型", filter: dictFilter("unit") },

View File

@ -1,19 +1,44 @@
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent"; import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
// import switchBtn from "@/components/noTemplateComponents/switchBtn"; // import switchBtn from "@/components/noTemplateComponents/switchBtn";
import request from "@/utils/request"; import request from "@/utils/request";
import { dictFilter } from '@/utils/filters' import { dictFilter, timeFilter } from '@/utils/filters'
import { timeFilter } from '@/utils/filters'
const syncTimeComponent = {
name: 'syncTimeComponent',
props: {
injectData: {
type: Object,
default: () => ({})
}
},
data() {
return {}
},
mounted() {
console.log('syncTimeComponent mounted', this.injectData)
},
render: function (h) {
return h('div', {
style: {
background: this.injectData.syncTime ? 'none' : '#fc1010' ,
color: this.injectData.syncTime ? 'none' : 'white' ,
}
},
timeFilter(this.injectData.syncTime))
}
}
export default function () { export default function () {
const tableProps = [ const tableProps = [
{ type: 'index', label: '序号' }, { type: 'index', label: '序号' },
{ prop: "syncTime", label: "同步时间", filter: timeFilter }, // no-padding-class 是硬编码在 BaseListTable 里的
{ prop: "name", label: "名称" }, { width: 150, prop: "syncTime", label: "同步时间", className: 'no-padding-class', showOverflowTooltip: false, subcomponent: syncTimeComponent },
{ prop: "code", label: "编码" }, { prop: "code", label: "配方号" },
{ prop: "externalCode", label: "版本" }, { prop: "name", label: "牌号" },
{ prop: "sumqty", label: "配方总重量" }, { prop: "version", label: "版本" },
{ prop: "shortDesc", label: "物料销售文本短描述" }, { prop: "sumqty", label: "总重量" },
{ prop: "description", label: "物料销售文本描述" }, { prop: "description", label: "物料销售文本" },
{ width: 150, prop: "shortDesc", label: "物料销售文本短描述" },
{ prop: "remark", label: "备注" }, { prop: "remark", label: "备注" },
{ prop: "createTime", label: "添加时间", filter: timeFilter }, { prop: "createTime", label: "添加时间", filter: timeFilter },
{ {
@ -81,7 +106,7 @@ export default function () {
{ {
input: true, input: true,
label: "版本号", label: "版本号",
prop: "externalCode", prop: "version",
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入版本号" }, elparams: { placeholder: "请输入版本号" },
}, },
@ -113,11 +138,12 @@ export default function () {
extraParams: "bomId", extraParams: "bomId",
props: [ props: [
{ type: "index", label: "序号" }, { type: "index", label: "序号" },
{ prop: "material", label: "料", isEditField: true }, { prop: "material", label: "料", isEditField: true },
{ width: 130, prop: "qty", label: "配方料重量", filter: (val) => (!!val ? val + " kg" : "-"), isEditField: true }, { width: 130, prop: "qty", label: "配方料重量", filter: (val) => (!!val ? val + " kg" : "-"), isEditField: true },
{ width: 130, prop: "sumqty", label: "配方总重量", filter: (val) => (!!val ? val + " kg" : "-"), isEditField: true }, { width: 130, prop: "sumqty", label: "配方总重量", filter: (val) => (!!val ? val + " kg" : "-"), isEditField: true },
{ prop: "percent", label: "配比 [%]", filter: (val) => (!!val ? val + " %" : "-"), isEditField: true }, { prop: "percent", label: "配比 [%]", filter: (val) => (!!val ? val + " %" : "-"), isEditField: true },
{ prop: "remark", label: "备注", isEditField: true }, { prop: "remark", label: "备注", isEditField: true },
{ prop: "materialDesc", label: "原料描述", isEditField: true },
{ prop: "createTime", label: "添加时间", filter: timeFilter }, { prop: "createTime", label: "添加时间", filter: timeFilter },
{ {
prop: "operations", prop: "operations",
@ -150,6 +176,8 @@ export default function () {
options: [], options: [],
fetchData: () => this.$http.get("/pms/material/page", { params: { limit: 999, page: 1 } }), fetchData: () => this.$http.get("/pms/material/page", { params: { limit: 999, page: 1 } }),
}, },
],
[
{ {
input: true, input: true,
label: "物料重量[kg]", label: "物料重量[kg]",
@ -158,6 +186,15 @@ export default function () {
elparams: { placeholder: "请输入物料重量" }, elparams: { placeholder: "请输入物料重量" },
}, },
], ],
[
{
input: true,
label: "原料描述",
prop: "materialDesc",
// rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入原料描述" },
},
],
[{ textarea: true, label: "备注", prop: "remark", elparams: { placeholder: "添加备注" } }], [{ textarea: true, label: "备注", prop: "remark", elparams: { placeholder: "添加备注" } }],
], ],
operations: [ operations: [

View File

@ -2,7 +2,7 @@
<ListView <ListView
:table-config="tableConfig" :table-config="tableConfig"
:dialog-configs="dialogConfigs" :dialog-configs="dialogConfigs"
:listQueryExtra="[{ key: name }]" :listQueryExtra="[{ key: code }]"
attach-list-query-extra="key" attach-list-query-extra="key"
:trigger-update="triggerUpdateKey" :trigger-update="triggerUpdateKey"
/> />
@ -21,9 +21,9 @@ export default {
}; };
}, },
computed: { computed: {
// //
name() { code() {
return this.$route.query.name || ""; return this.$route.query.code || "";
}, },
}, },
data() { data() {
@ -38,9 +38,9 @@ export default {
watch: { watch: {
$route: { $route: {
handler: function (route) { handler: function (route) {
if (route.query.name) { if (route.query.code) {
this.triggerUpdateKey = Math.random().toString(); this.triggerUpdateKey = Math.random().toString();
console.log("[$oute changed] val.query.name", route.query.name, this.triggerUpdateKey); console.log("[$oute changed] val.query.name", route.query.code, this.triggerUpdateKey);
} }
}, },
immediate: true, immediate: true,

View File

@ -6,7 +6,7 @@ import { timeFilter } from "@/utils/filters";
export default function () { export default function () {
const tableProps = [ const tableProps = [
{ type: "index", label: "序号" }, { type: "index", label: "序号" },
{ prop: "name", label: "工艺名称" }, // { prop: "name", label: "工艺名称" },
{ prop: "code", label: "工艺编码" }, { prop: "code", label: "工艺编码" },
// { prop: 'version', label: '配方号' }, // { prop: 'version', label: '配方号' },
{ prop: "bomCode", label: "配方号" }, { prop: "bomCode", label: "配方号" },
@ -58,16 +58,17 @@ export default function () {
name: "查询", name: "查询",
}, },
}, },
{ // {
button: { // button: {
type: "plain", // type: "plain",
name: "新增", // name: "新增",
permission: "pms:blenderStep:save", // permission: "pms:blenderStep:save",
}, // },
}, // },
]; ];
const dialogConfigs = { const dialogConfigs = {
allowAdd: false,
extraIds: { wsId: 3 }, // 工艺管理里面的相关模块的 dialogWithMenu 需要额外的工序 id extraIds: { wsId: 3 }, // 工艺管理里面的相关模块的 dialogWithMenu 需要额外的工序 id
menu: [ menu: [
{ name: "烧制工艺", key: "info" }, { name: "烧制工艺", key: "info" },
@ -76,13 +77,13 @@ export default function () {
form: { form: {
rows: [ rows: [
[ [
{ // {
input: true, // input: true,
label: "工艺名称", // label: "工艺名称",
prop: "name", // prop: "name",
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, // rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入烧制工艺名称" }, // elparams: { placeholder: "请输入烧制工艺名称" },
}, // },
{ {
input: true, input: true,
label: "工艺编码", label: "工艺编码",
@ -137,7 +138,7 @@ export default function () {
subcomponent: TableOperaionComponent, subcomponent: TableOperaionComponent,
options: [ options: [
{ name: "edit", label: "编辑", icon: "edit-outline", permission: "pms:blenderStepParam:update" }, { name: "edit", label: "编辑", icon: "edit-outline", permission: "pms:blenderStepParam:update" },
{ name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:blenderStepParam:delete" }, // { name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:blenderStepParam:delete" },
], ],
}, },
], ],

View File

@ -135,6 +135,7 @@ export default function () {
label: "基础原料", label: "基础原料",
prop: "baseMaterialId", prop: "baseMaterialId",
options: [], options: [],
optionLabel: 'code',
fetchData: () => this.$http.get('/pms/baseMaterial/page', { params: { limit: 999, page: 1, key: '' } }), fetchData: () => this.$http.get('/pms/baseMaterial/page', { params: { limit: 999, page: 1, key: '' } }),
elparams: { placeholder: "请选择基础原料" }, elparams: { placeholder: "请选择基础原料" },
}, },

View File

@ -24,9 +24,13 @@ export default function () {
prop: "operations", prop: "operations",
name: "操作", name: "操作",
fixed: "right", fixed: "right",
width: 90, width: 120,
subcomponent: TableOperaionComponent, subcomponent: TableOperaionComponent,
options: [{ name: "edit", label: "编辑", icon: "edit-outline" }, { name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:materialStorage:delete" }], options: [
{ name: "edit", label: "编辑", icon: "edit-outline" },
{ name: "sync", label: "同步", icon: "refresh" },
{ name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:materialStorage:delete" }
],
}, },
]; ];
@ -47,16 +51,16 @@ export default function () {
name: "查询", name: "查询",
}, },
}, },
// { {
// button: { button: {
// type: "primary", type: "primary",
// name: "新增", name: "全部同步",
// permission: "pms:materialStorage:save" permission: ""
// }, },
// bind: { bind: {
// plain: true, plain: true,
// } }
// }, },
]; ];
/** /**
@ -153,6 +157,8 @@ export default function () {
urls: { urls: {
base: "/pms/materialStorageDynamic", base: "/pms/materialStorageDynamic",
page: "/pms/materialStorageDynamic/page", page: "/pms/materialStorageDynamic/page",
syncUrl: "/pms/trans/matStoreSync",
syncSingleUrl: "/pms/trans/matStoreSingleSync"
// subase: '/pms/blenderStepParam', // subase: '/pms/blenderStepParam',
// subpage: '/pms/blenderStepParam/page', // subpage: '/pms/blenderStepParam/page',
// more... // more...

View File

@ -6,10 +6,10 @@ import { timeFilter } from "@/utils/filters";
export default function () { export default function () {
const tableProps = [ const tableProps = [
{ type: "index", label: "序号" }, { type: "index", label: "序号" },
{ prop: "name", label: "工艺名称" }, // { prop: "name", label: "工艺名称" },
{ prop: "code", label: "工艺编码" }, { prop: "code", label: "工艺编码" },
// { prop: 'version', label: '配方号' }, // { prop: 'version', label: '配方号' },
{ prop: "shapeCode", label: "砖型" }, // { prop: "shapeCode", label: "砖型" },
// { prop: 'status', label: '状态', subcomponent: StatusComponent }, // subcomponent // { prop: 'status', label: '状态', subcomponent: StatusComponent }, // subcomponent
{ prop: "description", label: "详情", subcomponent: TableTextComponent }, { prop: "description", label: "详情", subcomponent: TableTextComponent },
{ prop: "remark", label: "备注" }, { prop: "remark", label: "备注" },
@ -34,15 +34,15 @@ export default function () {
placeholder: "请输入工艺名称或编码", placeholder: "请输入工艺名称或编码",
}, },
}, },
{ // {
prop: "shape", // prop: "shape",
label: "砖型", // label: "砖型",
input: true, // input: true,
default: { value: "" }, // default: { value: "" },
bind: { // bind: {
placeholder: "请输入砖型", // placeholder: "请输入砖型",
}, // },
}, // },
// { // {
// prop: 'bom', // prop: 'bom',
// label: '配方号', // label: '配方号',
@ -58,28 +58,29 @@ export default function () {
name: "查询", name: "查询",
}, },
}, },
{ // {
button: { // button: {
type: "plain", // type: "plain",
name: "新增", // name: "新增",
permission: "pms:packingStep:save", // permission: "pms:packingStep:save",
}, // },
}, // },
]; ];
const dialogConfigs = { const dialogConfigs = {
allowAdd: false,
extraIds: { wsId: 5 }, // 工艺管理里面的相关模块的 dialogWithMenu 需要额外的工序 id extraIds: { wsId: 5 }, // 工艺管理里面的相关模块的 dialogWithMenu 需要额外的工序 id
menu: [{ name: "包装工艺", key: 'info' }, { name: "工艺参数", key: 'attr', onlyEditMode: true }], menu: [{ name: "包装工艺", key: 'info' }, { name: "工艺参数", key: 'attr', onlyEditMode: true }],
form: { form: {
rows: [ rows: [
[ [
{ // {
input: true, // input: true,
label: "工艺名称", // label: "工艺名称",
prop: "name", // prop: "name",
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, // rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入工艺名称" }, // elparams: { placeholder: "请输入工艺名称" },
}, // },
{ {
input: true, input: true,
label: "工艺编码", label: "工艺编码",
@ -87,17 +88,17 @@ export default function () {
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入工艺编码" }, elparams: { placeholder: "请输入工艺编码" },
}, },
{ // {
select: true, // select: true,
label: "砖型", // label: "砖型",
prop: "shapeId", // prop: "shapeId",
options: [], // options: [],
refreshOptionsAfterConfirm: true, // refreshOptionsAfterConfirm: true,
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, // rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { clearable: true, filterable: true, placeholder: "请选择砖型" }, // elparams: { clearable: true, filterable: true, placeholder: "请选择砖型" },
// 下面参数的 techId 是为 /pms/xxx/listUnR 接口定制的,默认为 -1新增时使用编辑时传对应的 工艺id // // 下面参数的 techId 是为 /pms/xxx/listUnR 接口定制的,默认为 -1新增时使用编辑时传对应的 工艺id
fetchData: (techId = -1) => this.$http.get("/pms/shape/listUnR", { params: { wsId: 5, externalCode: '', key: '', techId } }), // fetchData: (techId = -1) => this.$http.get("/pms/shape/listUnR", { params: { wsId: 5, externalCode: '', key: '', techId } }),
}, // },
], ],
// [ // [
// { // {
@ -142,8 +143,8 @@ export default function () {
width: 120, width: 120,
subcomponent: TableOperaionComponent, subcomponent: TableOperaionComponent,
options: [ options: [
{ name: { name: "edit", label: "编辑", icon: "edit-outline" }, permission: "pms:blenderStepParam:update" }, { name: 'edit', label: "编辑", icon: "edit-outline", permission: "pms:blenderStepParam:update" },
{ name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:blenderStepParam:delete" }, // { name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:blenderStepParam:delete" },
], ],
}, },
], ],

View File

@ -9,6 +9,7 @@ import { getDictDataList } from '@/utils';
export default function () { export default function () {
const tableProps = [ const tableProps = [
{ type: "index", label: "序号" }, { type: "index", label: "序号" },
{ prop: "code", label: "流水号" },
{ prop: "carCode", label: "窑车号" }, { prop: "carCode", label: "窑车号" },
{ prop: "orderCode", label: "订单号" }, { prop: "orderCode", label: "订单号" },
{ prop: "realQty", label: "数量" }, { prop: "realQty", label: "数量" },

View File

@ -6,7 +6,7 @@ import { timeFilter } from "@/utils/filters";
export default function () { export default function () {
const tableProps = [ const tableProps = [
{ type: "index", label: "序号" }, { type: "index", label: "序号" },
{ prop: "name", label: "工艺名称" }, // { prop: "name", label: "工艺名称" },
{ prop: "code", label: "工艺编码" }, { prop: "code", label: "工艺编码" },
// { prop: 'version', label: '配方号' }, // { prop: 'version', label: '配方号' },
{ prop: "shapeCode", label: "砖型" }, { prop: "shapeCode", label: "砖型" },
@ -58,28 +58,29 @@ export default function () {
name: "查询", name: "查询",
}, },
}, },
{ // {
button: { // button: {
type: "plain", // type: "plain",
name: "新增", // name: "新增",
permission: "pms:shapeStep:save", // permission: "pms:shapeStep:save",
}, // },
}, // },
]; ];
const dialogConfigs = { const dialogConfigs = {
allowAdd: false,
extraIds: { wsId: 2 }, // 工艺管理里面的相关模块的 dialogWithMenu 需要额外的工序 id extraIds: { wsId: 2 }, // 工艺管理里面的相关模块的 dialogWithMenu 需要额外的工序 id
menu: [{ name: "压制工艺", key: 'info' }, { name: "工艺参数", key: 'attr', onlyEditMode: true }], menu: [{ name: "压制工艺", key: 'info' }, { name: "工艺参数", key: 'attr', onlyEditMode: true }],
form: { form: {
rows: [ rows: [
[ [
{ // {
input: true, // input: true,
label: "工艺名称", // label: "工艺名称",
prop: "name", // prop: "name",
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, // rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入混料程序名称" }, // elparams: { placeholder: "请输入混料程序名称" },
}, // },
{ {
input: true, input: true,
label: "工艺编码", label: "工艺编码",
@ -142,7 +143,7 @@ export default function () {
subcomponent: TableOperaionComponent, subcomponent: TableOperaionComponent,
options: [ options: [
{ name: "edit", label: "编辑", icon: "edit-outline", permission: "pms:blenderStepParam:update" }, { name: "edit", label: "编辑", icon: "edit-outline", permission: "pms:blenderStepParam:update" },
{ name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:blenderStepParam:delete" }, // { name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:blenderStepParam:delete" },
], ],
}, },
], ],

View File

@ -6,7 +6,7 @@ import { timeFilter } from "@/utils/filters";
export default function () { export default function () {
const tableProps = [ const tableProps = [
{ type: "index", label: "序号" }, { type: "index", label: "序号" },
{ prop: "name", label: "工艺名称" }, // { prop: "name", label: "工艺名称" },
{ prop: "code", label: "工艺编码" }, { prop: "code", label: "工艺编码" },
// { prop: 'version', label: '配方号' }, // { prop: 'version', label: '配方号' },
{ prop: "shapeCode", label: "砖型" }, { prop: "shapeCode", label: "砖型" },
@ -20,7 +20,11 @@ export default function () {
fixed: "right", fixed: "right",
width: 120, width: 120,
subcomponent: TableOperaionComponent, subcomponent: TableOperaionComponent,
options: [ { name: "copy", label: "复制", icon: "copy-document" }, { name: "edit", label: "编辑", icon: "edit-outline" }, { name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:testingStep:delete" }], options: [
{ name: "copy", label: "复制", icon: "copy-document" },
{ name: "edit", label: "编辑", icon: "edit-outline" },
{ name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:testingStep:delete" }
],
}, },
]; ];
@ -58,28 +62,29 @@ export default function () {
name: "查询", name: "查询",
}, },
}, },
{ // {
button: { // button: {
type: "plain", // type: "plain",
name: "新增", // name: "新增",
permission: "pms:testingStep:save", // permission: "pms:testingStep:save",
}, // },
}, // },
]; ];
const dialogConfigs = { const dialogConfigs = {
allowAdd: false,
extraIds: { wsId: 4 }, // 工艺管理里面的相关模块的 dialogWithMenu 需要额外的工序 id extraIds: { wsId: 4 }, // 工艺管理里面的相关模块的 dialogWithMenu 需要额外的工序 id
menu: [{ name: "检测工艺", key: 'info' }, { name: "工艺参数", key: 'attr', onlyEditMode: true }], menu: [{ name: "检测工艺", key: 'info' }, { name: "工艺参数", key: 'attr', onlyEditMode: true }],
form: { form: {
rows: [ rows: [
[ [
{ // {
input: true, // input: true,
label: "工艺名称", // label: "工艺名称",
prop: "name", // prop: "name",
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, // rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入混料程序名称" }, // elparams: { placeholder: "请输入混料程序名称" },
}, // },
{ {
input: true, input: true,
label: "工艺编码", label: "工艺编码",
@ -143,7 +148,7 @@ export default function () {
subcomponent: TableOperaionComponent, subcomponent: TableOperaionComponent,
options: [ options: [
{ name: "edit", label: "编辑", icon: "edit-outline", permission: "pms:blenderStepParam:update" }, { name: "edit", label: "编辑", icon: "edit-outline", permission: "pms:blenderStepParam:update" },
{ name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:blenderStepParam:delete" }, // { name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:blenderStepParam:delete" },
], ],
}, },
], ],