update 0710反馈

This commit is contained in:
lb 2023-07-14 15:25:17 +08:00
parent 5b9e03a5a7
commit 7ce44fadd9
8 changed files with 117 additions and 55 deletions

View File

@ -271,7 +271,8 @@ img {
&:focus, &:focus,
&:hover { &:hover {
color: #fff; color: #fff;
background-color: mix(#fff, $--color-primary, 15%); // background-color: mix(#fff, $--color-primary, 15%);
background-color: rgb(210, 210, 210);
} }
} }
> .el-menu-item.is-active, > .el-menu-item.is-active,
@ -280,6 +281,7 @@ img {
&:focus, &:focus,
&:hover { &:hover {
color: #fff; color: #fff;
background-color: rgb(210, 210, 210);
} }
} }
.el-menu-item i, .el-menu-item i,

View File

@ -154,7 +154,7 @@
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handlePageChange" @current-change="handlePageChange"
:current-page.sync="attrPage" :current-page.sync="attrPage"
:page-sizes="[5, 10, 20]" :page-sizes="[10, 20, 50]"
:page-size="attrSize" :page-size="attrSize"
:total="attrTotal" :total="attrTotal"
layout="total, sizes, prev, next"></el-pagination> layout="total, sizes, prev, next"></el-pagination>
@ -411,7 +411,7 @@ export default {
scrollingContainer: null, scrollingContainer: null,
}, },
attrPage: 1, attrPage: 1,
attrSize: 10, attrSize: 20,
attrTotal: 0, attrTotal: 0,
fileList: [], fileList: [],
imgPreviewDialogVisible: false, imgPreviewDialogVisible: false,
@ -463,7 +463,7 @@ export default {
dialogVisible: function (val) { dialogVisible: function (val) {
if (!!val) { if (!!val) {
this.attrPage = 1; this.attrPage = 1;
this.attrSize = 10; this.attrSize = 20;
} }
}, },
}, },

View File

@ -10,26 +10,35 @@
:width="'30%'" :width="'30%'"
:modal="false" :modal="false"
:fullscreen="false" :fullscreen="false"
:top="'10vh'" :top="'10vh'">
>
<!-- :append-to-body="appendToBody"> --> <!-- :append-to-body="appendToBody"> -->
<div> <div v-loading="loading">
<el-form ref="dataForm" :model="dataForm"> <el-form ref="dataForm" :model="dataForm">
<el-row v-for="(row, rowIndex) in configs.rows" :key="'row_' + rowIndex" :gutter="20"> <el-row v-for="(row, rowIndex) in configs.rows" :key="'row_' + rowIndex" :gutter="20">
<el-col v-for="(col, colIndex) in row" :key="colIndex" :span="col.span ?? 24 / row.length"> <el-col v-for="(col, colIndex) in row" :key="colIndex" :span="col.span ?? 24 / row.length">
<el-form-item :prop="col.prop" :rules="col.rules || null" :label="col.label"> <el-form-item :prop="col.prop" :rules="col.rules || null" :label="col.label">
<el-input v-if="col.input" v-model="dataForm[col.prop]" clearable :disabled="detailMode" v-bind="col.elparams" /> <el-input
v-if="col.input"
v-model="dataForm[col.prop]"
clearable
:disabled="detailMode"
v-bind="col.elparams" />
<el-select <el-select
v-if="col.select" v-if="col.select"
v-model="dataForm[col.prop]" v-model="dataForm[col.prop]"
clearable clearable
:disabled="detailMode" :disabled="detailMode"
v-bind="col.elparams" v-bind="col.elparams"
@change="handleSelectChange(col, $event)" @change="handleSelectChange(col, $event)">
> <el-option
<el-option v-for="(opt, optIdx) in col.options" :key="'option_' + optIdx" :label="opt.label" :value="opt.value"> v-for="(opt, optIdx) in col.options"
:key="'option_' + optIdx"
:label="opt.label"
:value="opt.value">
<span>{{ opt.label }}</span> <span>{{ opt.label }}</span>
<span v-if="col.customLabel" style="display: inline-clock; margin-left: 12px; font-size: .9em;">{{ opt[col.customLabel] || '-' }}</span> <span v-if="col.customLabel" style="display: inline-clock; margin-left: 12px; font-size: 0.9em">
{{ opt[col.customLabel] || "-" }}
</span>
</el-option> </el-option>
</el-select> </el-select>
<el-switch <el-switch
@ -38,9 +47,13 @@
:active-value="1" :active-value="1"
:inactive-value="0" :inactive-value="0"
@change="handleSwitchChange" @change="handleSwitchChange"
:disabled="detailMode" />
<el-input
v-if="col.textarea"
type="textarea"
v-model="dataForm[col.prop]"
:disabled="detailMode" :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" />
<!-- add more... --> <!-- add more... -->
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -56,9 +69,9 @@
:key="'operation_' + index" :key="'operation_' + index"
:type="operate.type" :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>
@ -99,10 +112,20 @@ export default {
col, col,
"options", "options",
!col.customLabel !col.customLabel
? res.data.list.map((item) => ({ label: item.name, value: item.id })) ? res.data.list.map((item) => ({ label: item[col.optionLabel ?? "name"], value: item.id }))
: res.data.list.map((item) => ({ label: item.name, value: item.id, [col.customLabel]: item[col.customLabel] })) : res.data.list.map((item) => ({
label: item[col.optionLabel ?? "name"],
value: item.id,
[col.customLabel]: item[col.customLabel],
}))
);
console.log(
res.data.list.map((item) => ({
label: item.name,
value: item.id,
[col.customLabel]: item[col.customLabel],
}))
); );
console.log(res.data.list.map((item) => ({ label: item.name, value: item.id, [col.customLabel]: item[col.customLabel] })))
} else { } else {
this.$set(col, "options", []); this.$set(col, "options", []);
} }
@ -111,6 +134,7 @@ export default {
}); });
return { return {
loading: false,
btnLoading: false, btnLoading: false,
visible: false, visible: false,
detailMode: false, detailMode: false,
@ -132,7 +156,7 @@ export default {
resetForm(excludeId = false) { resetForm(excludeId = false) {
setTimeout(() => { setTimeout(() => {
Object.keys(this.dataForm).forEach((key) => { Object.keys(this.dataForm).forEach((key) => {
console.log(">>> clearing key: ", key); // console.log(">>> clearing key: ", key);
if (excludeId && key === "id") return; if (excludeId && key === "id") return;
this.dataForm[key] = null; this.dataForm[key] = null;
}); });
@ -141,7 +165,8 @@ export default {
}, },
init(id, isdetail = false) { init(id, isdetail = false) {
console.log("[small dialog] init", id, isdetail); // console.log("[small dialog] init", id, isdetail);
this.visible = true;
this.detailMode = isdetail; this.detailMode = isdetail;
if (this.$refs.dataForm) this.$refs.dataForm.clearValidate(); if (this.$refs.dataForm) this.$refs.dataForm.clearValidate();
@ -152,16 +177,22 @@ export default {
if (this.dataForm.id) { if (this.dataForm.id) {
// //
this.$http.get(this.urls.subase + `/${this.dataForm.id}`).then(({ data: res }) => { this.loading = true;
if (res && res.code === 0) { this.$http
const dataFormKeys = Object.keys(this.dataForm); .get(this.urls.subase + `/${this.dataForm.id}`)
this.dataForm = __pick(res.data, dataFormKeys); .then(({ data: res }) => {
} if (res && res.code === 0) {
this.visible = true; const dataFormKeys = Object.keys(this.dataForm);
}); this.dataForm = __pick(res.data, dataFormKeys);
} else { } else {
// throw new Error(res.msg);
this.visible = true; }
this.loading = false;
})
.catch((err) => {
this.loading = false;
this.$message.error(err.message);
});
} }
}); });
}, },

View File

@ -139,11 +139,12 @@ export default function () {
props: [ props: [
{ type: "index", label: "序号" }, { type: "index", label: "序号" },
{ prop: "material", label: "原料", isEditField: true }, { prop: "material", label: "原料", isEditField: true },
{ prop: "materialDesc", label: "原料描述", isEditField: true },
{ prop: "materialName", 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",
@ -169,11 +170,12 @@ export default function () {
[ [
{ {
select: true, select: true,
label: "料", label: "料",
prop: "materialId", prop: "materialId",
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请选择料", filterable: true }, elparams: { placeholder: "请选择料", filterable: true },
options: [], options: [],
optionLabel: 'code',
customLabel: 'description', customLabel: 'description',
fetchData: () => this.$http.get("/pms/material/page", { params: { limit: 999, page: 1 } }), fetchData: () => this.$http.get("/pms/material/page", { params: { limit: 999, page: 1 } }),
}, },
@ -181,10 +183,10 @@ export default function () {
[ [
{ {
input: true, input: true,
label: "料重量[kg]", label: "料重量[kg]",
prop: "qty", prop: "qty",
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入料重量" }, elparams: { placeholder: "请输入料重量" },
}, },
], ],
[ [

View File

@ -112,7 +112,7 @@ export default {
topBtnConfig: null, topBtnConfig: null,
totalPage: 100, totalPage: 100,
page: 1, page: 1,
size: 20, // 20 size: 100, // 20
dataList: [], dataList: [],
tableLoading: false, tableLoading: false,
subdialogVisible: false, subdialogVisible: false,

View File

@ -34,6 +34,7 @@ export default function () {
], ],
}, },
]; ];
tableProps.defaultPageSize = 100;
const headFormFields = [ const headFormFields = [
{ {
@ -108,6 +109,7 @@ export default function () {
prop: "materialId", prop: "materialId",
fetchData: () => this.$http.get("/pms/material/page", { params: { key: '', limit: 999, page: 1 } }), fetchData: () => this.$http.get("/pms/material/page", { params: { key: '', limit: 999, page: 1 } }),
options: [], options: [],
optionLabel: 'code',
customLabel: 'description', customLabel: 'description',
rules: { required: true, message: "必填项不能为空", trigger: "change" }, rules: { required: true, message: "必填项不能为空", trigger: "change" },
elparams: { filterable: true, placeholder: "请选择原料" }, elparams: { filterable: true, placeholder: "请选择原料" },

View File

@ -3,6 +3,17 @@
<section class="container-title" style="margin-top: 10px; display: flex; align-items: center"> <section class="container-title" style="margin-top: 10px; display: flex; align-items: center">
<div class="brand-color-line"></div> <div class="brand-color-line"></div>
<span style="line-height: 20px">料仓料位</span> <span style="line-height: 20px">料仓料位</span>
<!-- 导航器 -->
<div class="float-right__pagination" style="flex: 1 auto; display:flex; align-items:center; justify-content: flex-end;">
<el-pagination
@size-change="handleSizeChange"
@current-change="handlePageChange"
:current-page.sync="page"
:page-size.sync="limit"
:page-sizes="[20, 50, 100, 200, 1000]"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
</div>
</section> </section>
<section class="container-content"> <section class="container-content">
<div class="dialy-storage" v-if="dailyStorage.length"> <div class="dialy-storage" v-if="dailyStorage.length">
@ -17,8 +28,7 @@
padding-left: 16px; padding-left: 16px;
top: 10px; top: 10px;
left: -16px; left: -16px;
" ">
>
日料仓 日料仓
</h3> </h3>
<div class="storage-list" style="padding: 12px 0; display: flex; flex-wrap: wrap"> <div class="storage-list" style="padding: 12px 0; display: flex; flex-wrap: wrap">
@ -31,8 +41,7 @@
:material="st.material ?? '默认物料'" :material="st.material ?? '默认物料'"
:total="2" :total="2"
:unit-value="st.unitDictValue" :unit-value="st.unitDictValue"
:ratio="st.ratio" :ratio="st.ratio" />
/>
</div> </div>
</div> </div>
<div class="middle-storage" v-if="middleStorage.length"> <div class="middle-storage" v-if="middleStorage.length">
@ -47,8 +56,7 @@
padding-left: 16px; padding-left: 16px;
top: 10px; top: 10px;
left: -16px; left: -16px;
" ">
>
中间仓 中间仓
</h3> </h3>
<div class="middle-list" style="padding: 12px 0; display: flex; flex-wrap: wrap"> <div class="middle-list" style="padding: 12px 0; display: flex; flex-wrap: wrap">
@ -61,8 +69,7 @@
:material="st.material ?? '默认物料'" :material="st.material ?? '默认物料'"
:total="2" :total="2"
:unit-value="st.unitDictValue" :unit-value="st.unitDictValue"
:ratio="st.ratio" :ratio="st.ratio" />
/>
</div> </div>
</div> </div>
<div class="unknown-storage" v-if="unknownStorage.length"> <div class="unknown-storage" v-if="unknownStorage.length">
@ -77,8 +84,7 @@
padding-left: 16px; padding-left: 16px;
top: 10px; top: 10px;
left: -16px; left: -16px;
" ">
>
未知仓 未知仓
</h3> </h3>
<div class="unknown-list" style="padding: 12px 0; display: flex; flex-wrap: wrap"> <div class="unknown-list" style="padding: 12px 0; display: flex; flex-wrap: wrap">
@ -91,8 +97,7 @@
:material="st.material ?? '默认物料'" :material="st.material ?? '默认物料'"
:total="2" :total="2"
:unit-value="st.unitDictValue" :unit-value="st.unitDictValue"
:ratio="st.ratio" :ratio="st.ratio" />
/>
</div> </div>
</div> </div>
</section> </section>
@ -108,6 +113,9 @@ export default {
props: {}, props: {},
data() { data() {
return { return {
limit: 100,
page: 1,
totalPage: 0,
middleStorage: [], middleStorage: [],
dailyStorage: [], dailyStorage: [],
unknownStorage: [], unknownStorage: [],
@ -123,12 +131,25 @@ export default {
this.unknownStorage.splice(0); this.unknownStorage.splice(0);
}, },
handleSizeChange(val) {
this.page = 1;
this.limit = val;
this.getList();
},
handlePageChange(val) {
this.getList();
},
getList(storageType) { getList(storageType) {
this.resetAllStorages(); this.resetAllStorages();
const params = storageType ? { limit: this.limit, page: this.page, typeDictValue: storageType } : { limit: this.limit, page: this.page }; const params = storageType
? { limit: this.limit, page: this.page, typeDictValue: storageType }
: { limit: this.limit, page: this.page };
this.$http.get("/pms/materialStorageDynamic/page", { params }).then(({ data: res }) => { this.$http.get("/pms/materialStorageDynamic/page", { params }).then(({ data: res }) => {
if (res.code === 0) { if (res.code === 0) {
if ("list" in res.data) { if ("list" in res.data) {
this.totalPage = res.data.total;
res.data.list.forEach((item) => { res.data.list.forEach((item) => {
if (item.typeDictValue === "1") { if (item.typeDictValue === "1") {
this.dailyStorage.push(item); this.dailyStorage.push(item);
@ -169,4 +190,8 @@ export default {
background: #0b58ff; background: #0b58ff;
/* position: absolute; */ /* position: absolute; */
} }
.float-right__pagination >>> .el-pagination {
margin: 0;
}
</style> </style>

View File

@ -105,7 +105,7 @@ export default function () {
label: "工艺编码", label: "工艺编码",
prop: "code", prop: "code",
rules: { required: true, message: "必填项不能为空", trigger: "blur" }, rules: { required: true, message: "必填项不能为空", trigger: "blur" },
elparams: { placeholder: "请输入混料程序编码" }, // disabled: true }, elparams: { placeholder: "请输入混料工艺编码" }, // disabled: true },
}, },
], ],
// [ // [
@ -138,7 +138,7 @@ export default function () {
// { type: 'index', label: '序号' }, // { type: 'index', label: '序号' },
// { prop: "createTime", label: "添加时间", filter: timeFilter }, // { prop: "createTime", label: "添加时间", filter: timeFilter },
{ prop: "name", label: "参数名称", isEditField: true }, { prop: "name", label: "参数名称", isEditField: true },
{ prop: "code", label: "参数编码", isEditField: true }, // { prop: "code", label: "参数编码", isEditField: true },
// { prop: "specifications", label: "规格", isEditField: true }, // { prop: "specifications", label: "规格", isEditField: true },
{ width: 80, prop: "value", label: "参数值", isEditField: true }, { width: 80, prop: "value", label: "参数值", isEditField: true },
// { prop: "valueFloor", label: "参数值下限", isEditField: true }, // { prop: "valueFloor", label: "参数值下限", isEditField: true },