finish 完成上料信息“
This commit is contained in:
parent
c012bf7675
commit
31f1f8f3c1
@ -82,6 +82,7 @@ export default {
|
|||||||
|
|
||||||
// 更新选项列表
|
// 更新选项列表
|
||||||
if (!field.watch && field.fn && typeof field.fn === "function") {
|
if (!field.watch && field.fn && typeof field.fn === "function") {
|
||||||
|
const optionLabel = field.fieldOptionLabel;
|
||||||
// 设置自身的选项列表
|
// 设置自身的选项列表
|
||||||
field.fn().then(({ data: res }) => {
|
field.fn().then(({ data: res }) => {
|
||||||
if (res.code === 0 && res.data) {
|
if (res.code === 0 && res.data) {
|
||||||
@ -90,15 +91,15 @@ export default {
|
|||||||
this.$set(
|
this.$set(
|
||||||
field,
|
field,
|
||||||
"select",
|
"select",
|
||||||
res.data.list.map((item) => ({ label: item.name, value: item.id }))
|
res.data.list.map((item) => ({ label: optionLabel ? item[optionLabel] : item.name, value: item.id }))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: `${field.label} 数据获取出错: ${res.code} - ${res.msg}`,
|
message: `${field.label} 数据获取出错: ${res.code} - ${res.msg}`,
|
||||||
type: 'error',
|
type: "error",
|
||||||
duration: 1500
|
duration: 1500,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
:disabled="detailMode"
|
:disabled="detailMode"
|
||||||
/>
|
/>
|
||||||
<el-input v-if="col.textarea" type="textarea" v-model="dataForm[col.prop]" :disabled="detailMode" v-bind="col.elparams" />
|
<el-input v-if="col.textarea" type="textarea" v-model="dataForm[col.prop]" :disabled="detailMode" v-bind="col.elparams" />
|
||||||
|
<el-date-picker v-if="col.datetime" v-model="dataForm[col.prop]" :disabled="detailMode" v-bind="col.elparams" />
|
||||||
<uploadBtn
|
<uploadBtn
|
||||||
v-if="col.upload"
|
v-if="col.upload"
|
||||||
:key="'upload_' + rowIndex + colIndex"
|
:key="'upload_' + rowIndex + colIndex"
|
||||||
@ -98,6 +98,7 @@
|
|||||||
import { pick as __pick } from "@/utils/filters";
|
import { pick as __pick } from "@/utils/filters";
|
||||||
import Cookies from "js-cookie";
|
import Cookies from "js-cookie";
|
||||||
import uploadBtn from "@/components/uploadBtn";
|
import uploadBtn from "@/components/uploadBtn";
|
||||||
|
import moment from "moment";
|
||||||
|
|
||||||
import "quill/dist/quill.core.css";
|
import "quill/dist/quill.core.css";
|
||||||
import "quill/dist/quill.snow.css";
|
import "quill/dist/quill.snow.css";
|
||||||
@ -321,6 +322,17 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
httpPayload = this.dataForm;
|
httpPayload = this.dataForm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 针对时间段设置 payload */
|
||||||
|
if ("startTime" in this.dataForm && "endTime" in this.dataForm) {
|
||||||
|
const {startTime, endTime} = this.dataForm;
|
||||||
|
httpPayload = {
|
||||||
|
...httpPayload,
|
||||||
|
startTime: startTime ? moment(startTime).format("YYYY-MM-DDTHH:mm:ss") : moment().format("YYYY-MM-DDTHH:mm:ss"),
|
||||||
|
endTime: endTime ? moment(endTime).format("YYYY-MM-DDTHH:mm:ss") : moment().format("YYYY-MM-DDTHH:mm:ss")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** 发送 */
|
/** 发送 */
|
||||||
return this.$http({
|
return this.$http({
|
||||||
url: this.urls.base,
|
url: this.urls.base,
|
||||||
@ -394,7 +406,8 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.el-select,
|
.el-select,
|
||||||
.el-cascader {
|
.el-cascader,
|
||||||
|
.el-date-editor {
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,23 +2,23 @@ import TableOperaionComponent from "@/components/noTemplateComponents/operationC
|
|||||||
import switchBtn from "@/components/noTemplateComponents/switchBtn";
|
import switchBtn from "@/components/noTemplateComponents/switchBtn";
|
||||||
import QuillRichInput from "@/components/noTemplateComponents/richInput";
|
import QuillRichInput from "@/components/noTemplateComponents/richInput";
|
||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
import { timeFilter } from '@/utils/filters'
|
import { timeFilter } from "@/utils/filters";
|
||||||
|
|
||||||
export default function () {
|
export default function () {
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
{ type: 'index', label: '序号' },
|
{ type: "index", label: "序号" },
|
||||||
{ prop: "createTime", label: "添加时间", filter: timeFilter },
|
{ prop: "createTime", label: "添加时间", filter: timeFilter },
|
||||||
{ prop: "startTime", label: "上料时间", filter: timeFilter },
|
{ prop: "startTime", label: "上料时间", filter: timeFilter },
|
||||||
{ prop: "endTime", label: "结束上料时间", filter: timeFilter },
|
{ prop: "endTime", label: "结束上料时间", filter: timeFilter },
|
||||||
{ prop: "material", label: "物料" },
|
{ prop: "material", label: "物料" },
|
||||||
{ prop: "qty", label: "上料数量" },
|
{ prop: "qty", label: "上料数量" },
|
||||||
{ prop: "storeCOde", label: "料仓" },
|
{ prop: "storeCode", label: "料仓" },
|
||||||
{ prop: "upPos", label: "上料位点" },
|
{ prop: "upPos", label: "上料位点" },
|
||||||
// { prop: "typeDictValue", label: "过渡车", filter: val => ['否', '是'][val] },
|
// { prop: "typeDictValue", label: "过渡车", filter: val => ['否', '是'][val] },
|
||||||
// { prop: "enabled", label: "状态", subcomponent: switchBtn }, // subcomponent
|
// { prop: "enabled", label: "状态", subcomponent: switchBtn }, // subcomponent
|
||||||
// { prop: "currentQty", label: "载量" },
|
// { prop: "currentQty", label: "载量" },
|
||||||
// { prop: "currentPos", label: "当前位置" },
|
// { prop: "currentPos", label: "当前位置" },
|
||||||
{ prop: "description", label: "描述" },
|
// { prop: "description", label: "描述" },
|
||||||
{ prop: "remark", label: "备注" },
|
{ prop: "remark", label: "备注" },
|
||||||
{
|
{
|
||||||
prop: "operations",
|
prop: "operations",
|
||||||
@ -32,38 +32,39 @@ export default function () {
|
|||||||
|
|
||||||
const headFormFields = [
|
const headFormFields = [
|
||||||
{
|
{
|
||||||
prop: 'materialId',
|
prop: "materialId",
|
||||||
label: "物料",
|
label: "物料",
|
||||||
// default: { value: "" },
|
// default: { value: "" },
|
||||||
select: [],
|
select: [],
|
||||||
// 绑定数据获取函数
|
// 绑定数据获取函数
|
||||||
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: "请选择物料",
|
||||||
filterable: true
|
filterable: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'storeId',
|
prop: "storeId",
|
||||||
label: "日料仓",
|
label: "日料仓",
|
||||||
|
fieldOptionLabel: 'code', // 把料仓筛选条件的label改为展示code,而不是展示name
|
||||||
select: [],
|
select: [],
|
||||||
// default: { value: "" },
|
// default: { value: "" },
|
||||||
fn: () => this.$http.get('/pms/materialStorage/page', { params: { page: 1, limit: 999, typeDictValue: '1' } }),
|
fn: () => this.$http.get("/pms/materialStorage/page", { params: { page: 1, limit: 999, typeDictValue: "1" } }),
|
||||||
bind: {
|
bind: {
|
||||||
placeholder: '请选择日料仓',
|
placeholder: "请选择日料仓",
|
||||||
filterable: true
|
filterable: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
timerange: true,
|
timerange: true,
|
||||||
prop: 'timerange', // 应该是个数组,在提交数据时需单独处理
|
prop: "timerange", // 应该是个数组,在提交数据时需单独处理
|
||||||
label: '时间段',
|
label: "时间段",
|
||||||
bind: {
|
bind: {
|
||||||
placeholder: '选择日期时间',
|
placeholder: "选择日期时间",
|
||||||
type: 'datetimerange',
|
type: "datetimerange",
|
||||||
"start-placeholder": "开始时间",
|
"start-placeholder": "开始时间",
|
||||||
"end-placeholder": "结束时间",
|
"end-placeholder": "结束时间",
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
button: {
|
button: {
|
||||||
@ -75,11 +76,11 @@ export default function () {
|
|||||||
button: {
|
button: {
|
||||||
type: "primary",
|
type: "primary",
|
||||||
name: "新增",
|
name: "新增",
|
||||||
permission: "pms:materialStorage:save"
|
permission: "pms:materialStorage:save",
|
||||||
},
|
},
|
||||||
bind: {
|
bind: {
|
||||||
plain: true,
|
plain: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -94,20 +95,19 @@ export default function () {
|
|||||||
rows: [
|
rows: [
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
input: true,
|
datetime: true,
|
||||||
label: "上料时间",
|
label: "上料时间",
|
||||||
prop: "name",
|
prop: "startTime",
|
||||||
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
|
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
|
||||||
elparams: { placeholder: "请输入上料时间" },
|
elparams: { placeholder: "请选择上料时间", type: "datetime" },
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
input: true,
|
datetime: true,
|
||||||
label: "结束上料时间",
|
label: "结束上料时间",
|
||||||
prop: "name",
|
prop: "endTime",
|
||||||
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
|
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
|
||||||
elparams: { placeholder: "请输入结束上料时间" },
|
elparams: { placeholder: "请选择结束上料时间", type: "datetime" },
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@ -115,7 +115,7 @@ export default function () {
|
|||||||
label: "物料",
|
label: "物料",
|
||||||
prop: "materialId",
|
prop: "materialId",
|
||||||
options: [],
|
options: [],
|
||||||
fetchData: () => this.$http('/pms/material/page', { params: { page: 1, size: 999 } }),
|
fetchData: () => this.$http("/pms/material/page", { params: { page: 1, size: 999 } }),
|
||||||
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
|
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
|
||||||
elparams: { placeholder: "请选择物料", filterable: true },
|
elparams: { placeholder: "请选择物料", filterable: true },
|
||||||
},
|
},
|
||||||
@ -125,7 +125,10 @@ export default function () {
|
|||||||
prop: "qty",
|
prop: "qty",
|
||||||
// options: [],
|
// options: [],
|
||||||
// fetchData: () => this.$http('/pms/material/page', { params: { page: 1, size: 999 } }),
|
// fetchData: () => this.$http('/pms/material/page', { params: { page: 1, size: 999 } }),
|
||||||
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
|
rules: [
|
||||||
|
{ required: true, message: "必填项不能为空", trigger: "blur" },
|
||||||
|
{ type: "number", message: "请输入正确的数字", trigger: "blur", transform: (val) => Number(val) },
|
||||||
|
],
|
||||||
elparams: { placeholder: "请输入上料数量" },
|
elparams: { placeholder: "请输入上料数量" },
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@ -136,7 +139,7 @@ export default function () {
|
|||||||
label: "料仓",
|
label: "料仓",
|
||||||
prop: "storeId",
|
prop: "storeId",
|
||||||
options: [],
|
options: [],
|
||||||
fetchData: () => this.$http('/pms/materialStorage/page', { params: { page: 1, size: 999 } }),
|
fetchData: () => this.$http("/pms/materialStorage/page", { params: { page: 1, size: 999, typeDictValue: '1' } }),
|
||||||
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
|
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
|
||||||
elparams: { placeholder: "请选择料仓", filterable: true },
|
elparams: { placeholder: "请选择料仓", filterable: true },
|
||||||
},
|
},
|
||||||
@ -185,4 +188,3 @@ export default function () {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user