add 上料信息“

This commit is contained in:
lb 2023-02-27 11:07:05 +08:00
parent 55fc9bac3e
commit d906ac949a
4 changed files with 233 additions and 10 deletions

View File

@ -38,8 +38,8 @@
<% if (process.env.VUE_APP_NODE_ENV === 'dev') { %>
<script>
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.103:8080/pms-am';
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.49:8080/pms-am'; // tengyun
window.SITE_CONFIG['apiURL'] = 'http://192.168.1.62:8080/pms-am'; // tao
window.SITE_CONFIG['apiURL'] = 'http://192.168.1.49:8080/pms-am'; // tengyun
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.62:8080/pms-am'; // tao
// window.SITE_CONFIG['apiURL'] = 'http://192.168.1.21:8080/pms-am'; // xv
</script>
<% } %>

View File

@ -86,14 +86,20 @@ export default {
field.fn().then(({ data: res }) => {
if (res.code === 0 && res.data) {
// TODO:
field.select = res.map((_) => {
//
if (_.default) {
this.searchForm[index] = _.value;
}
return _;
});
console.log("[update] 更新选项列表", res, field.select);
if ("list" in res.data) {
this.$set(
field,
"select",
res.data.list.map((item) => ({ label: item.name, value: item.id }))
);
console.log("[update] 更新选项列表", res, field.select);
}
} else {
this.$message({
message: `${field.label} 数据获取出错: ${res.code} - ${res.msg}`,
type: 'error',
duration: 1500
})
}
});
}

View File

@ -0,0 +1,185 @@
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: 'index', label: '序号' },
{ prop: "createTime", label: "添加时间", filter: timeFilter },
{ prop: "startTime", label: "上料时间", filter: timeFilter },
{ prop: "endTime", label: "结束上料时间", filter: timeFilter },
{ prop: "material", label: "物料" },
{ prop: "qty", label: "上料数量" },
{ prop: "storeCOde", label: "料仓" },
{ prop: "upPos", label: "上料位点" },
// { prop: "typeDictValue", label: "过渡车", filter: val => ['否', '是'][val] },
// { prop: "enabled", label: "状态", subcomponent: switchBtn }, // subcomponent
// { prop: "currentQty", label: "载量" },
// { prop: "currentPos", label: "当前位置" },
{ prop: "description", label: "描述" },
{ prop: "remark", label: "备注" },
{
prop: "operations",
name: "操作",
fixed: "right",
width: 120,
subcomponent: TableOperaionComponent,
options: ["edit", { name: "delete", emitFull: true, permission: "pms:materialUpload:delete" }],
},
];
const headFormFields = [
{
prop: 'materialID',
label: "物料",
// default: { value: "" },
select: [],
// 绑定数据获取函数
fn: () => this.$http.get('/pms/material/page', { params: { page: 1, limit: 999 } }),
bind: {
placeholder: '请选择物料',
filterable: true
}
},
{
prop: 'storeId',
label: "日料仓",
select: [],
// default: { value: "" },
fn: () => this.$http.get('/pms/materialStorage/page', { params: { page: 1, limit: 999, typeDictValue: '1' } }),
bind: {
placeholder: '请选择日料仓',
filterable: true
}
},
{
timerange: true,
prop: 'timerange', // 应该是个数组,在提交数据时需单独处理
label: '时间段',
bind: {
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 = {
clickModalToClose: true,
form: {
rows: [
[
{
input: true,
label: "上料时间",
prop: "name",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入上料时间" },
},
{
input: true,
label: "结束上料时间",
prop: "name",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入结束上料时间" },
}
],
[
{
select: true,
label: "物料",
prop: "materialId",
options: [],
fetchData: () => this.$http('/pms/material/page', { params: { page: 1, size: 999 } }),
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请选择物料", filterable: true },
},
{
input: true,
label: "上料数量",
prop: "qty",
// options: [],
// fetchData: () => this.$http('/pms/material/page', { params: { page: 1, size: 999 } }),
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入上料数量" },
},
],
// [{ component: QuillRichInput, label: "描述信息", prop: "description" }],
[
{
select: true,
label: "料仓",
prop: "storeId",
options: [],
fetchData: () => this.$http('/pms/materialStorage/page', { params: { page: 1, size: 999 } }),
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请选择料仓", filterable: true },
},
{
input: true,
label: "上料位点",
prop: "upPos",
// options: [],
// fetchData: () => this.$http('/pms/material/page', { params: { page: 1, size: 999 } }),
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入上料位点" },
},
],
// [{ component: QuillRichInput, label: "描述信息", prop: "description" }],
// [{
// richInput: true, label: "描述信息", prop: "description"
// }],
[{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }],
],
operations: [
{ name: "add", label: "保存", type: "primary", permission: "pms:materialUpload:save", showOnEdit: false },
{ name: "update", label: "更新", type: "primary", permission: "pms:materialUpload: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/materialUpload",
page: "/pms/materialUpload/page",
// subase: '/pms/blenderStepParam',
// subpage: '/pms/blenderStepParam/page',
// more...
},
};
}

View File

@ -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: 'CarView',
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>