bugfix 料仓和料仓动态

Cette révision appartient à :
lb 2023-03-30 10:44:01 +08:00
Parent 6ccfef90f6
révision 4a8694ca55
5 fichiers modifiés avec 212 ajouts et 8 suppressions

Voir le fichier

@ -23,6 +23,7 @@
<el-input v-if="col.input" v-model="dataForm[col.prop]" clearable :disabled="detailMode" v-bind="col.elparams" />
<el-input v-if="col.forceDisabled && col.eraseOnSubmit" v-model="shadowDataForm[col.prop]" disabled v-bind="col.elparams" />
<el-input v-if="col.forceDisabled && !col.eraseOnSubmit" v-model="dataForm[col.prop]" disabled v-bind="col.elparams" />
<el-button type="" plain v-if="col.button" v-bind="col.elparams" style="width: 100%" @click="col.onClick(dataForm.id)">{{ col.label }}</el-button>
<el-cascader
v-if="col.cascader"
v-model="dataForm[col.prop]"
@ -320,10 +321,10 @@ export default {
if (res.data) this.dataForm = __pick(res.data, Object.keys(this.dataForm));
else {
this.$message({
message: '后端返回的数据为 null',
type: 'error',
duration: 2000
})
message: "后端返回的数据为 null",
type: "error",
duration: 2000,
});
}
/** 格式化文件上传列表 */
if (Array.isArray(this.dataForm.files)) {
@ -363,8 +364,8 @@ export default {
if ("autoUpdateProp" in col) {
//
// console.log(col.options, eventValue, this.savedDatalist);
const item = this.savedDatalist[col.prop].find(item => item.id === eventValue)
this.shadowDataForm[col.autoUpdateProp] = item.cate ?? null
const item = this.savedDatalist[col.prop].find((item) => item.id === eventValue);
this.shadowDataForm[col.autoUpdateProp] = item.cate ?? null;
}
this.$forceUpdate();
},

Voir le fichier

@ -150,8 +150,8 @@ export default function () {
fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的
},
urls: {
base: "/pms/materialStorageDynamic",
page: "/pms/materialStorageDynamic/page",
base: "/pms/materialStorage",
page: "/pms/materialStorage/page",
// subase: '/pms/blenderStepParam',
// subpage: '/pms/blenderStepParam/page',
// more...

Voir le fichier

@ -0,0 +1,160 @@
import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
// import switchBtn from "@/components/noTemplateComponents/switchBtn";
import request from "@/utils/request";
import { dictFilter } from '@/utils/filters'
import { timeFilter } from '@/utils/filters'
export default function () {
const tableProps = [
{ type: 'index', label: '序号' },
{ prop: "createTime", label: "添加时间", filter: timeFilter },
{ prop: "name", label: "料仓名称" },
{ prop: "code", label: "料仓编码" },
{ prop: "typeDictValue", label: "料仓类型", filter: dictFilter('liaocang') },
// { prop: "enabled", label: "状态", subcomponent: switchBtn }, // subcomponent
{ prop: "material", label: "物料" },
{ prop: "materialTypeDictValue", label: "物料类型", filter: dictFilter('material_category') },
{ prop: "density", label: "物料堆积密度" },
{ prop: "dosLow", label: "加料下限" },
{ prop: "dosHigh", label: "加料上限" },
{ prop: "description", label: "描述" },
{ prop: "remark", label: "备注" },
{
prop: "operations",
name: "操作",
fixed: "right",
width: 90,
subcomponent: TableOperaionComponent,
options: [{ name: "edit", label: "编辑", icon: "edit-outline" }, { name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:materialStorage:delete" }],
},
];
const headFormFields = [
{
prop: 'name',
label: "料仓名称",
input: true,
default: { value: "" },
bind: {
// placeholder: '请输入产线名称或编码'
placeholder: '请输入料仓名称'
}
},
{
button: {
type: "primary",
name: "查询",
},
},
{
button: {
type: "primary",
name: "新增",
permission: "pms:materialStorage:save"
},
bind: {
plain: true,
}
},
];
/**
* dialog config 有两个版本一个适用于 DialogWithMenu 组件另一个适用于 DialogJustForm 组件
* 适用于 DialogWithMenu 组件的配置示例详见 blenderStep/config.js
* 此为后者的配置:
*/
const dialogJustFormConfigs = {
form: {
rows: [
[
{
input: true,
label: "料仓名称",
prop: "name",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入料仓名称" },
},
{
input: true,
label: "料仓编码",
prop: "code",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入料仓编码" },
},
],
[
{
select: true,
label: "料仓类型",
prop: "typeDictValue",
// fetchData: () => this.$http.get("/pms/factory/page", { params: { limit: 999, page: 1 } }),
options: [
// TODO: 或许映射可以全权交给数据字典
{ label: '中间仓', value: '0' },
{ label: '日料仓', value: '1' },
],
rules: { required: true, message: "必填项不能为空", trigger: "change" },
elparams: { placeholder: "请选择料仓类型" },
},
{
select: true,
label: "物料",
prop: "materialId",
fetchData: () => this.$http.get("/pms/material/page", { params: { key: '', limit: 999, page: 1 } }),
options: [],
rules: { required: true, message: "必填项不能为空", trigger: "change" },
elparams: { placeholder: "请选择物料" },
},
// {
// input: true,
// label: "加料下限",
// prop: "dosLow",
// rules: [
// { required: true, message: "必填项不能为空", trigger: "blur" },
// { type: 'number', message: "请输入正确的数字类型", trigger: "blur", transform: val => Number(val) },
// ],
// elparams: { placeholder: "请输入加料下限" },
// },
// {
// input: true,
// label: "加料上限",
// prop: "dosHigh",
// rules: [
// { required: true, message: "必填项不能为空", trigger: "blur" },
// { type: 'number', message: "请输入正确的数字类型", trigger: "blur", transform: val => Number(val) },
// ],
// elparams: { placeholder: "请输入加料上限" },
// },
],
[{ textarea: true, label: "描述信息", prop: "description", elparams: { placeholder: "描述信息" } }],
[{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }],
],
operations: [
{ name: "add", label: "保存", type: "primary", permission: "pms:materialStorage:save", showOnEdit: false },
{ name: "update", label: "更新", type: "primary", permission: "pms:materialStorage:update", showOnEdit: true },
{ name: "reset", label: "重置", type: "warning", showAlways: true },
// { name: 'cancel', label: '取消', 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/materialStorageDynamic",
page: "/pms/materialStorageDynamic/page",
// subase: '/pms/blenderStepParam',
// subpage: '/pms/blenderStepParam/page',
// more...
},
};
}

Voir le fichier

@ -0,0 +1,32 @@
<template>
<ListViewWithHead :table-config="tableConfig" :head-config="headFormConfigs" :dialog-configs="dialogConfigs" :listQueryExtra="['name']" />
</template>
<script>
import initConfig from './config';
import ListViewWithHead from '@/views/atomViews/ListViewWithHead.vue';
export default {
name: 'ProductionLineView',
components: { ListViewWithHead },
provide() {
return {
urls: this.allUrls
}
},
data() {
const { tableConfig, headFormConfigs, urls, dialogConfigs } = initConfig.call(this);
return {
tableConfig,
headFormConfigs,
allUrls: urls,
dialogConfigs,
};
},
created() {},
mounted() {},
methods: {},
};
</script>
<style scoped></style>

Voir le fichier

@ -85,6 +85,8 @@ export default function () {
fliterable: true
}
},
],
[
{
// select: true,
input: true,
@ -96,6 +98,14 @@ export default function () {
// fliterable: true
// }
},
{
label: "查看载砖详情",
button: true,
onClick: (id) => {
console.log(`查看载砖详情`, id)
this.$emit({ type: 'to-car-payload', data: id })
}
},
],
],
operations: [
@ -145,6 +155,7 @@ export default function () {
},
urls: {
base: '/pms/carHistory',
payload: '/pms/carHandle', // hisId 查询 载砖详情
page: "/pms/pallet/pageView",
pageIsPostApi: true,
printLog: '/pms/pallet/print', // post