update 2023.4.23

This commit is contained in:
lb 2023-04-23 14:15:20 +08:00
parent aaa571d77b
commit dfbc7e08f9
10 changed files with 68 additions and 66 deletions

View File

@ -4,52 +4,22 @@
<!-- <head-form :form-config="headFormConfig" @headBtnClick="btnClick" /> --> <!-- <head-form :form-config="headFormConfig" @headBtnClick="btnClick" /> -->
<BaseSearchForm :head-config="headConfig" @btn-click="handleBtnClick" /> <BaseSearchForm :head-config="headConfig" @btn-click="handleBtnClick" />
<BaseListTable <BaseListTable v-loading="tableLoading" :table-config="tableConfig.table" :column-config="tableConfig.column"
v-loading="tableLoading" :table-data="dataList" @operate-event="handleOperate" :current-page="page" :current-size="size"
:table-config="tableConfig.table"
:column-config="tableConfig.column"
:table-data="dataList"
@operate-event="handleOperate"
:current-page="page"
:current-size="size"
:refresh-layout-key="refreshLayoutKey" /> :refresh-layout-key="refreshLayoutKey" />
<el-pagination <el-pagination class="mt-5 flex justify-end" @size-change="handleSizeChange" @current-change="handlePageChange"
class="mt-5 flex justify-end" :current-page.sync="page" :page-sizes="[10, 20, 50, 100]" :page-size="size" :total="totalPage"
@size-change="handleSizeChange"
@current-change="handlePageChange"
:current-page.sync="page"
:page-sizes="[1, 5, 10, 20, 50, 100]"
:page-size="size"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"></el-pagination> layout="total, sizes, prev, pager, next, jumper"></el-pagination>
<!-- :current-page.sync="currentPage"
:page-size.sync="pageSize" -->
<DialogWithMenu <DialogWithMenu ref="edit-dialog" v-if="!!dialogConfigs && dialogType === DIALOG_WITH_MENU"
ref="edit-dialog" :dialog-visible.sync="dialogVisible" :configs="dialogConfigs" @refreshDataList="getList" />
v-if="!!dialogConfigs && dialogType === DIALOG_WITH_MENU" <DialogJustForm ref="edit-dialog" v-if="!!dialogConfigs && dialogType === DIALOG_JUST_FORM"
:dialog-visible.sync="dialogVisible" :dialog-visible.sync="dialogVisible" :configs="dialogConfigs" @refreshDataList="getList"
:configs="dialogConfigs"
@refreshDataList="getList" />
<DialogJustForm
ref="edit-dialog"
v-if="!!dialogConfigs && dialogType === DIALOG_JUST_FORM"
:dialog-visible.sync="dialogVisible"
:configs="dialogConfigs"
@refreshDataList="getList"
@emit-data="handleOperate" /> @emit-data="handleOperate" />
<DialogCarPayload <DialogCarPayload ref="car-payload-dialog" v-if="!!carPayloadDialogConfigs"
ref="car-payload-dialog" :dialog-visible.sync="carPayloadDialogVisible" :configs="carPayloadDialogConfigs" @refreshDataList="getList" />
v-if="!!carPayloadDialogConfigs" <DialogUpload ref="upload-dialog" v-if="uploadDialogVisible" title="导入配方" filename="bomTemplate.xlsx"
:dialog-visible.sync="carPayloadDialogVisible"
:configs="carPayloadDialogConfigs"
@refreshDataList="getList" />
<DialogUpload
ref="upload-dialog"
v-if="uploadDialogVisible"
title="导入配方"
filename="bomTemplate.xlsx"
@refresh-list="getList" /> @refresh-list="getList" />
</div> </div>
</template> </template>
@ -113,7 +83,6 @@ export default {
}, },
}, },
activated() { activated() {
console.log("list view with ehad activated..........", this.triggerUpdate);
this.refreshLayoutKey = this.layoutTable(); this.refreshLayoutKey = this.layoutTable();
}, },
watch: { watch: {
@ -121,7 +90,7 @@ export default {
if (val && val !== oldVal) { if (val && val !== oldVal) {
// get list // get list
this.page = 1; this.page = 1;
this.size = 20; this.size = 'defaultPageSize' in this.tableConfig.column ? this.tableConfig.column.defaultPageSize : 20;
this.getList(); this.getList();
} }
}, },
@ -145,6 +114,10 @@ export default {
}, },
inject: ["urls"], inject: ["urls"],
mounted() { mounted() {
// size
const size = 'defaultPageSize' in this.tableConfig.column ? this.tableConfig.column.defaultPageSize : 20;
this.size = size;
this.initDataWhenLoad && this.getList(); this.initDataWhenLoad && this.getList();
}, },
methods: { methods: {
@ -155,9 +128,9 @@ export default {
const params = queryParams const params = queryParams
? { ...queryParams, page: this.page, limit: this.size } ? { ...queryParams, page: this.page, limit: this.size }
: { : {
page: this.page, page: this.page,
limit: this.size, limit: this.size,
}; };
if (!queryParams && this.listQueryExtra && this.listQueryExtra.length) { if (!queryParams && this.listQueryExtra && this.listQueryExtra.length) {
this.listQueryExtra.map((nameOrObj) => { this.listQueryExtra.map((nameOrObj) => {
@ -174,11 +147,11 @@ export default {
this.urls.page, this.urls.page,
this.urls.pageIsPostApi this.urls.pageIsPostApi
? { ? {
...params, ...params,
} }
: { : {
params, params,
} }
) )
.then(({ data: res }) => { .then(({ data: res }) => {
console.log("[http response] res is: ", res); console.log("[http response] res is: ", res);
@ -263,7 +236,7 @@ export default {
this.$message.success("删除成功!"); this.$message.success("删除成功!");
this.page = 1; this.page = 1;
this.size = 10; this.size = 'defaultPageSize' in this.tableConfig.column ? this.tableConfig.column.defaultPageSize : 20;
this.getList(); this.getList();
} else { } else {
this.$message({ this.$message({
@ -274,7 +247,7 @@ export default {
} }
}); });
}) })
.catch((err) => {}); .catch((err) => { });
} }
case "edit": { case "edit": {
this.openDialog(data); /** data is ==> id */ this.openDialog(data); /** data is ==> id */

View File

@ -6,7 +6,7 @@ import { timeFilter } from '@/utils/filters'
export default function () { export default function () {
const tableProps = [ const tableProps = [
{ type: 'index', label: '序号' }, // { type: 'index', label: '序号' },
{ prop: "code", label: "窑车号" }, { prop: "code", label: "窑车号" },
{ prop: "createTime", label: "添加时间", filter: timeFilter }, { prop: "createTime", label: "添加时间", filter: timeFilter },
// { prop: "code", label: "编码" }, // { prop: "code", label: "编码" },

View File

@ -20,7 +20,7 @@
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handlePageChange" @current-change="handlePageChange"
:current-page.sync="page" :current-page.sync="page"
:page-sizes="[1, 5, 10, 20, 50, 100]" :page-sizes="[20, 50, 100]"
:page-size="size" :page-size="size"
:total="totalPage" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
@ -118,7 +118,7 @@ export default {
if (val && val !== oldVal) { if (val && val !== oldVal) {
// get list // get list
this.page = 1; this.page = 1;
this.size = 20; this.size = 100;
this.getList(); this.getList();
} }
}, },
@ -133,7 +133,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,
refreshLayoutKey: null, refreshLayoutKey: null,
@ -262,7 +262,7 @@ export default {
this.$message.success("删除成功!"); this.$message.success("删除成功!");
this.page = 1; this.page = 1;
this.size = 10; this.size = 100;
this.getList(); this.getList();
} else { } else {
this.$message({ this.$message({

View File

@ -5,7 +5,7 @@ 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: "code", label: "窑车号" }, { prop: "code", label: "窑车号" },
{ prop: "stateDictValue", label: "状态", subcomponent: StateSelect }, { prop: "stateDictValue", label: "状态", subcomponent: StateSelect },

View File

@ -6,7 +6,7 @@ import StateSelect from '@/components/StateSelect.vue';
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: "code", label: "窑车号" }, { prop: "code", label: "窑车号" },
{ prop: "stateDictValue", label: "状态", subcomponent: StateSelect }, { prop: "stateDictValue", label: "状态", subcomponent: StateSelect },
@ -29,6 +29,8 @@ export default function () {
], ],
}, },
]; ];
// 设置页面默认的 page size 为 100 条数据
tableProps.defaultPageSize = 100;
const headFormFields = [ const headFormFields = [
{ {

View File

@ -5,7 +5,7 @@
**/ **/
--> -->
<template> <template>
<div class="list-view-with-head"> <div class="list-view-with-head" ref="cursor-loading-ref">
<!-- <head-form :form-config="headFormConfig" @headBtnClick="btnClick" /> --> <!-- <head-form :form-config="headFormConfig" @headBtnClick="btnClick" /> -->
<BaseSearchForm :head-config="headConfig" @btn-click="handleBtnClick" /> <BaseSearchForm :head-config="headConfig" @btn-click="handleBtnClick" />
@ -326,6 +326,25 @@ export default {
case "导入": case "导入":
this.openUploadDialog(); this.openUploadDialog();
break; break;
case "同步":
this.$message({
message: '正在同步...',
type: 'success',
duration: 1000
})
this.$refs['cursor-loading-ref'].style.cursor = 'wait'
return this.$http.post(this.urls.syncUrl).then(({ data: res }) => {
this.$message({
message: res.msg,
type: res.code === 0 ? 'succes' : 'error',
duration: 1500
, onClose: () => {
this.getList()
this.$refs['cursor-loading-ref'].style.cursor = 'unset'
}
})
})
} }
}, },

View File

@ -69,6 +69,13 @@ export default function () {
plain: true, plain: true,
}, },
}, },
{
button: {
type: "plain",
name: "同步",
permission: "",
}
},
]; ];
/** /**
@ -272,6 +279,7 @@ export default function () {
subpage: "/pms/materialArrt/page", subpage: "/pms/materialArrt/page",
importUrl: "/pms/material/importExcel", importUrl: "/pms/material/importExcel",
templateUrl: "/importTemplates/materialImport.xlsx", templateUrl: "/importTemplates/materialImport.xlsx",
syncUrl: "/pms/trans/matSync",
// more... // more...
}, },
}; };

View File

@ -20,7 +20,7 @@
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handlePageChange" @current-change="handlePageChange"
:current-page.sync="page" :current-page.sync="page"
:page-sizes="[1, 5, 10, 20, 50, 100]" :page-sizes="[20, 50, 100]"
:page-size="size" :page-size="size"
:total="totalPage" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
@ -125,7 +125,7 @@ export default {
if (val && val !== oldVal) { if (val && val !== oldVal) {
// get list // get list
this.page = 1; this.page = 1;
this.size = 20; this.size = 100;
this.getList(); this.getList();
} }
}, },
@ -141,7 +141,7 @@ export default {
topBtnConfig: null, topBtnConfig: null,
totalPage: 100, totalPage: 100,
page: 1, page: 1,
size: 20, // 20 size: 100, // 100
dataList: [], dataList: [],
tableLoading: false, tableLoading: false,
refreshLayoutKey: null, refreshLayoutKey: null,
@ -255,7 +255,7 @@ export default {
if (res.code === 0) { if (res.code === 0) {
this.$message.success("删除成功!"); this.$message.success("删除成功!");
this.page = 1; this.page = 1;
this.size = 10; this.size = 100;
this.getList(); this.getList();
} else { } else {
this.$message({ this.$message({

View File

@ -6,7 +6,7 @@ import { getDictDataList } from '@/utils'
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: "code", label: "窑车号" }, { prop: "code", label: "窑车号" },
{ prop: "stateDictValue", label: "状态", subcomponent: StateSelect }, { prop: "stateDictValue", label: "状态", subcomponent: StateSelect },

View File

@ -12,7 +12,7 @@ export default function () {
{ prop: "specifications", label: "规格" }, { prop: "specifications", label: "规格" },
{ prop: "unitDictValue", label: "单位", filter: dictFilter("unit") }, { prop: "unitDictValue", label: "单位", filter: dictFilter("unit") },
{ prop: "weight", label: "重量", filter: (val) => (val ? val + " kg" : "-") }, { prop: "weight", label: "重量", filter: (val) => (val ? val + " kg" : "-") },
{ prop: "processTime", label: "产线完成单位产品用时", width: 200, filter: (val) => val + " s" }, { prop: "processTime", label: "产线完成单位产品用时", width: 200, filter: (val) => val + " (分钟)" },
{ prop: "remark", label: "备注" }, { prop: "remark", label: "备注" },
{ {
prop: "description", prop: "description",