finish 完成上料信息“

This commit is contained in:
lb
2023-02-27 17:00:23 +08:00
parent c012bf7675
commit 31f1f8f3c1
3 changed files with 55 additions and 39 deletions

View File

@@ -82,6 +82,7 @@ export default {
// 更新选项列表
if (!field.watch && field.fn && typeof field.fn === "function") {
const optionLabel = field.fieldOptionLabel;
// 设置自身的选项列表
field.fn().then(({ data: res }) => {
if (res.code === 0 && res.data) {
@@ -90,15 +91,15 @@ export default {
this.$set(
field,
"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 {
this.$message({
message: `${field.label} 数据获取出错: ${res.code} - ${res.msg}`,
type: 'error',
duration: 1500
})
type: "error",
duration: 1500,
});
}
});
}

View File

@@ -46,7 +46,7 @@
:disabled="detailMode"
/>
<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
v-if="col.upload"
:key="'upload_' + rowIndex + colIndex"
@@ -98,6 +98,7 @@
import { pick as __pick } from "@/utils/filters";
import Cookies from "js-cookie";
import uploadBtn from "@/components/uploadBtn";
import moment from "moment";
import "quill/dist/quill.core.css";
import "quill/dist/quill.snow.css";
@@ -321,6 +322,17 @@ export default {
} else {
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({
url: this.urls.base,
@@ -394,7 +406,8 @@ export default {
}
.el-select,
.el-cascader {
.el-cascader,
.el-date-editor {
width: 100% !important;
}