This commit is contained in:
lb 2023-04-23 14:15:20 +08:00
parent aaa571d77b
commit dfbc7e08f9
10 ha cambiato i file con 68 aggiunte e 66 eliminazioni

Vedi File

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

Vedi File

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

Vedi File

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

Vedi File

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

Vedi File

@ -6,7 +6,7 @@ import StateSelect from '@/components/StateSelect.vue';
export default function () {
const tableProps = [
{ type: "index", label: "序号" },
// { type: "index", label: "序号" },
// { prop: "createTime", label: "添加时间", filter: timeFilter },
{ prop: "code", label: "窑车号" },
{ prop: "stateDictValue", label: "状态", subcomponent: StateSelect },
@ -29,6 +29,8 @@ export default function () {
],
},
];
// 设置页面默认的 page size 为 100 条数据
tableProps.defaultPageSize = 100;
const headFormFields = [
{

Vedi File

@ -5,7 +5,7 @@
**/
-->
<template>
<div class="list-view-with-head">
<div class="list-view-with-head" ref="cursor-loading-ref">
<!-- <head-form :form-config="headFormConfig" @headBtnClick="btnClick" /> -->
<BaseSearchForm :head-config="headConfig" @btn-click="handleBtnClick" />
@ -326,6 +326,25 @@ export default {
case "导入":
this.openUploadDialog();
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'
}
})
})
}
},

Vedi File

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

Vedi File

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

Vedi File

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

Vedi File

@ -12,7 +12,7 @@ export default function () {
{ prop: "specifications", label: "规格" },
{ prop: "unitDictValue", label: "单位", filter: dictFilter("unit") },
{ 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: "description",