24 changed files with 624 additions and 15 deletions
@ -0,0 +1,21 @@ |
|||
// 公用API
|
|||
import request from '@/utils/request' |
|||
|
|||
// 获取分页
|
|||
export function getCommonPaged(urlName,params) { |
|||
return request({ |
|||
url: `/api/${urlName}/getpaged`, |
|||
method: 'get', |
|||
params:params |
|||
}) |
|||
} |
|||
|
|||
// 导出
|
|||
export function postCommonExport(urlName,params) { |
|||
return request({ |
|||
url: `/api/${urlName}/export`, |
|||
method: 'get', |
|||
responseType:'blob', |
|||
params:params |
|||
}) |
|||
} |
@ -0,0 +1,75 @@ |
|||
<template> |
|||
<el-pagination |
|||
:currentPage="state.currentPage" |
|||
:page-size="props.pageParams.pageSize" |
|||
:total="props.pageParams.total" |
|||
:background="props.pageBackGround" |
|||
:layout="props.pageLayout" |
|||
:hide-on-single-page="props.isHideOnlyOne" |
|||
:page-sizes="props.pageSizeList" |
|||
@size-change="pageSizeChange" |
|||
@current-change="pageCurrentChange" |
|||
/> |
|||
</template> |
|||
|
|||
<script setup> |
|||
defineOptions({ name: 'elPager' }) |
|||
import { reactive, ref, onMounted,watch } from 'vue' |
|||
import { ElMessageBox, ElMessage,ElPagination } from 'element-plus' |
|||
|
|||
const state = reactive({ |
|||
currentPage:1 |
|||
}) |
|||
|
|||
const props = defineProps({ |
|||
// table分页 |
|||
pageParams: { |
|||
type: Object, |
|||
default: {} |
|||
}, |
|||
// 分页显示内容 |
|||
pageLayout: { |
|||
type: String, |
|||
default: 'total, sizes,prev, pager, next' |
|||
}, |
|||
// 只有一页是否隐藏 |
|||
isHideOnlyOne:{ |
|||
type:Boolean, |
|||
default: false |
|||
}, |
|||
// 是否有底色 |
|||
pageBackGround:{ |
|||
type:Boolean, |
|||
default: true |
|||
}, |
|||
// 页数下拉 |
|||
pageSizeList:{ |
|||
type: Object, |
|||
default: [10, 20, 50, 100] |
|||
} |
|||
}) |
|||
|
|||
const emits = defineEmits(['pageSizeChange', 'pageCurrentChange']) |
|||
|
|||
watch(props.pageParams, (val) => { |
|||
state.currentPage = val.Page |
|||
}) |
|||
|
|||
// size-change |
|||
function pageSizeChange(page){ |
|||
state.currentPage = page |
|||
emits('pageSizeChange',page) |
|||
} |
|||
|
|||
// current-change |
|||
function pageCurrentChange(page){ |
|||
state.currentPage = page |
|||
emits('pageCurrentChange',page) |
|||
} |
|||
|
|||
onMounted(() => {}) |
|||
|
|||
</script> |
|||
|
|||
<style></style> |
|||
|
@ -0,0 +1,85 @@ |
|||
<template> |
|||
<el-table ref="tableRef" row-key="id" :data="props.tableData" :border="true"> |
|||
<el-table-column |
|||
v-for="(item, index) in props.tableColumns" |
|||
:key="index" |
|||
:label="item.title" |
|||
:prop="item.prop" |
|||
:sortable="item.sortable" |
|||
:fixed="item.fixed" |
|||
:width="item.width || props.columnWidth" |
|||
:align="item.align || props.columnAlign" |
|||
:header-align="item.headerAlign || props.columnHeaderAlign" |
|||
> |
|||
<template #default="scope"> |
|||
<!-- 时间格式 --> |
|||
<span v-if="item.type == 'datetime'"> {{ formatTableDate(scope.row[item.prop]) }} </span> |
|||
<!-- 标签格式 --> |
|||
<el-tag |
|||
v-if="item.type == 'tagFilter'" |
|||
:type="formatTableTagFilter('type',scope.row,item)" |
|||
> |
|||
{{ formatTableTagFilter('label',scope.row,item) }} |
|||
</el-tag> |
|||
<!-- 正常文本 --> |
|||
<span v-else> {{ scope.row[item.prop] }} </span> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</template> |
|||
|
|||
<script setup> |
|||
defineOptions({ name: 'elTable' }) |
|||
import { reactive, ref, onMounted } from 'vue' |
|||
import { ElMessageBox, ElMessage,ElTable, ElTableColumn } from 'element-plus' |
|||
import { formatTimeStrToStr } from "@/utils/formatTime"; |
|||
|
|||
const state = reactive({}) |
|||
|
|||
const props = defineProps({ |
|||
// table数据 |
|||
tableData: { |
|||
type: Object, |
|||
default: [] |
|||
}, |
|||
// table表头 |
|||
tableColumns: { |
|||
type: Object, |
|||
default: [] |
|||
}, |
|||
// 表头宽度 |
|||
columnWidth:{ |
|||
type: Number, |
|||
default: 100 |
|||
}, |
|||
// 表头对齐 |
|||
columnHeaderAlign:{ |
|||
type: String, |
|||
default: 'center' |
|||
}, |
|||
// 表内容对齐 |
|||
columnAlign:{ |
|||
type: String, |
|||
default: 'center' |
|||
}, |
|||
}) |
|||
|
|||
// 格式化时间 |
|||
function formatTableDate(time) { |
|||
let _time = '-' |
|||
if (time) { _time = formatTimeStrToStr(time) } |
|||
return _time |
|||
} |
|||
|
|||
// 格式化TagFilter |
|||
function formatTableTagFilter(type,row,item){ |
|||
let _op = item.options.filter(op=>op.value == row[item.prop]) |
|||
if(_op && _op.length > 0){ return _op[0][type] } |
|||
} |
|||
|
|||
onMounted(() => {}) |
|||
|
|||
</script> |
|||
|
|||
<style></style> |
|||
|
@ -0,0 +1,77 @@ |
|||
<template> |
|||
<elTable |
|||
:columnWidth="props.columnWidth" |
|||
:columnHeaderAlign="props.columnHeaderAlign" |
|||
:columnAlign="props.columnAlign" |
|||
:tableData="props.tableData" |
|||
:tableColumns="props.tableColumns" |
|||
></elTable> |
|||
|
|||
<elPager |
|||
style="margin-top: 15px;float:right" |
|||
:pageParams="props.pageParams" |
|||
@pageSizeChange="pageSizeChange" |
|||
@pageCurrentChange="pageCurrentChange" |
|||
></elPager> |
|||
</template> |
|||
|
|||
<script setup> |
|||
defineOptions({ name: 'tablePage' }) |
|||
import { reactive, ref, onMounted } from 'vue' |
|||
import { ElMessageBox, ElMessage,ElTable, ElTableColumn } from 'element-plus' |
|||
import elTable from '@/components/elTable/index.vue' |
|||
import elPager from '@/components/elPager/index.vue' |
|||
|
|||
const state = reactive({}) |
|||
|
|||
const props = defineProps({ |
|||
// table数据 |
|||
tableData: { |
|||
type: Object, |
|||
default: [] |
|||
}, |
|||
// table表头 |
|||
tableColumns: { |
|||
type: Object, |
|||
default: [] |
|||
}, |
|||
// table分页 |
|||
pageParams: { |
|||
type: Object, |
|||
default: {} |
|||
}, |
|||
// 表头宽度 |
|||
columnWidth:{ |
|||
type: Number, |
|||
default: 100 |
|||
}, |
|||
// 表头对齐 |
|||
columnHeaderAlign:{ |
|||
type: String, |
|||
default: 'center' |
|||
}, |
|||
// 表内容对齐 |
|||
columnAlign:{ |
|||
type: String, |
|||
default: 'center' |
|||
}, |
|||
}) |
|||
|
|||
const emits = defineEmits(['pageSizeChange', 'pageCurrentChange']) |
|||
|
|||
// size-change |
|||
function pageSizeChange(page){ |
|||
emits('pageSizeChange',page) |
|||
} |
|||
|
|||
// current-change |
|||
function pageCurrentChange(page){ |
|||
emits('pageCurrentChange',page) |
|||
} |
|||
|
|||
onMounted(() => {}) |
|||
|
|||
</script> |
|||
|
|||
<style></style> |
|||
|
@ -0,0 +1,8 @@ |
|||
const EnumList = { |
|||
whether:[ |
|||
{label:'是',value:1,type:'success'}, |
|||
{label:'否',value:0,type:'danger'} |
|||
] |
|||
} |
|||
|
|||
export default EnumList |
@ -0,0 +1,108 @@ |
|||
<template> |
|||
<div class="app-container" v-loading="state.loading"> |
|||
<!-- M+6月物料需求计划 --> |
|||
<el-card class="search-container"> |
|||
<el-form :inline="true"> |
|||
<el-form-item label="零件号"> |
|||
<el-input v-model="state.queryParams.materialCode" placeholder="零件号" clearable /> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button @click="handleQuery(1)" icon="Search" v-auth="state.apiName + ':page'">查询</el-button> |
|||
<el-button @click="handleExport()" icon="TopRight" v-auth="state.apiName + ':export'" type="success">导出</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-card> |
|||
<el-card class="paged-table-container"> |
|||
<tablePage |
|||
:tableData="state.tableData" |
|||
:tableColumns="state.tableColumns" |
|||
:pageParams="state.pageParams" |
|||
@pageSizeChange="handleQuery" |
|||
@pageCurrentChange="handleQuery" |
|||
></tablePage> |
|||
</el-card> |
|||
</div> |
|||
</template> |
|||
|
|||
<script setup> |
|||
defineOptions({ name: 'supplierMrpMonth' }) |
|||
import { reactive, ref, onMounted } from 'vue' |
|||
import { getCommonPaged,postCommonExport } from '@/api/common/index' |
|||
import { downloadByData } from '@/utils/download' |
|||
import { ElMessageBox, ElMessage } from 'element-plus' |
|||
import tablePage from '@/components/tablePage/index.vue' |
|||
import EnumList from '@/utils/common/enumList' |
|||
|
|||
import { useRoute } from 'vue-router' |
|||
const route = useRoute() |
|||
|
|||
const state = reactive({ |
|||
apiName:'cherysuppliermrpmonth', |
|||
loading: false, |
|||
queryParams: { |
|||
materialCode: '' |
|||
}, |
|||
pageParams: { |
|||
page: 1, |
|||
pageSize: 10, |
|||
total: 1 |
|||
}, |
|||
tableColumns: [ |
|||
{prop:'releaseEdition',title:'需求发布版次',width:120}, |
|||
{prop:'materialCode',title:'零件号'}, |
|||
{prop:'materialDescription',title:'零件名称'}, |
|||
{prop:'plantId',title:'工厂代码'}, |
|||
{prop:'plantName',title:'工厂名称'}, |
|||
{prop:'startMonth',title:'起始年月'}, |
|||
{prop:'quantityDemand1',title:'需求数量1'}, |
|||
{prop:'quantityDemand2',title:'需求数量2'}, |
|||
{prop:'quantityDemand3',title:'需求数量3'}, |
|||
{prop:'quantityDemand4',title:'需求数量4'}, |
|||
{prop:'quantityDemand5',title:'需求数量5'}, |
|||
{prop:'quantityDemand6',title:'需求数量6'}, |
|||
{prop:'quantityDemand7',title:'需求数量7'}, |
|||
{prop:'quantityDemand8',title:'需求数量8'}, |
|||
{prop:'quantityDemand9',title:'需求数量9'}, |
|||
{prop:'quantityDemand10',title:'需求数量10'}, |
|||
{prop:'quantityDemand11',title:'需求数量11'}, |
|||
{prop:'quantityDemand12',title:'需求数量12'}, |
|||
{prop:'isUpdate',title:'是否更新',type:'tagFilter',options:EnumList.whether}, |
|||
{prop:'createByUser',title:'创建人'}, |
|||
{prop:'createTime',title:'创建时间',type:'datetime',width:180}, |
|||
{prop:'updateByUser',title:'修改人'}, |
|||
{prop:'updateTime',title:'修改时间',type:'datetime',width:180}, |
|||
{prop:'isDelete',title:'是否删除',type:'tagFilter',options:EnumList.whether}, |
|||
{prop:'version',title:'版本号'}, |
|||
], |
|||
tableData: [] |
|||
}) |
|||
|
|||
onMounted(() => { |
|||
handleQuery(1) |
|||
}) |
|||
|
|||
// 查询 |
|||
function handleQuery(page) { |
|||
state.loading = true |
|||
state.pageParams.page = page |
|||
getCommonPaged(state.apiName,Object.assign({}, state.queryParams, state.pageParams)) |
|||
.then((resp) => { |
|||
state.tableData = resp.data.data |
|||
state.pageParams.total = resp.data.total |
|||
}) |
|||
.finally(() => (state.loading = false)) |
|||
} |
|||
|
|||
// 导出 |
|||
function handleExport(){ |
|||
state.loading = true |
|||
postCommonExport(state.apiName,Object.assign({}, state.queryParams, state.pageParams)) |
|||
.then((res) => { |
|||
downloadByData(res.data,route.meta.title+'.xlsx') |
|||
}) |
|||
.finally(() => (state.loading = false)) |
|||
} |
|||
|
|||
</script> |
|||
|
|||
<style></style> |
@ -0,0 +1,125 @@ |
|||
<template> |
|||
<div class="app-container" v-loading="state.loading"> |
|||
<!-- 整车月度生产计划2 --> |
|||
<el-card class="search-container"> |
|||
<el-form :inline="true"> |
|||
<el-form-item label="零件号"> |
|||
<el-input v-model="state.queryParams.materialCode" placeholder="零件号" clearable /> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button @click="handleQuery(1)" icon="Search" v-auth="state.apiName + ':page'">查询</el-button> |
|||
<el-button @click="handleExport()" icon="TopRight" v-auth="state.apiName + ':export'" type="success">导出</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-card> |
|||
<el-card class="paged-table-container"> |
|||
<tablePage |
|||
:tableData="state.tableData" |
|||
:tableColumns="state.tableColumns" |
|||
:pageParams="state.pageParams" |
|||
@pageSizeChange="handleQuery" |
|||
@pageCurrentChange="handleQuery" |
|||
></tablePage> |
|||
</el-card> |
|||
</div> |
|||
</template> |
|||
|
|||
<script setup> |
|||
defineOptions({ name: 'supplierProPlaning' }) |
|||
import { reactive, ref, onMounted } from 'vue' |
|||
import { getCommonPaged,postCommonExport } from '@/api/common/index' |
|||
import { downloadByData } from '@/utils/download' |
|||
import { ElMessageBox, ElMessage } from 'element-plus' |
|||
import tablePage from '@/components/tablePage/index.vue' |
|||
import EnumList from '@/utils/common/enumList' |
|||
|
|||
import { useRoute } from 'vue-router' |
|||
const route = useRoute() |
|||
|
|||
const state = reactive({ |
|||
apiName:'supplierproplaning', |
|||
loading: false, |
|||
queryParams: { |
|||
materialCode: '' |
|||
}, |
|||
pageParams: { |
|||
page: 1, |
|||
pageSize: 10, |
|||
total: 1 |
|||
}, |
|||
tableColumns: [ |
|||
{prop:'releaseEdition',title:'需求发布版次',width:120}, |
|||
{prop:'models',title:'车型'}, |
|||
{prop:'salseDepartment',title:'销售单位'}, |
|||
{prop:'type',title:'类型'}, |
|||
{prop:'assembly',title:'动力总成'}, |
|||
{prop:'pattern',title:'版型'}, |
|||
{prop:'omterior',title:'内饰'}, |
|||
{prop:'materialCode',title:'物料号'}, |
|||
{prop:'startMonth',title:'起始月份'}, |
|||
{prop:'quantity1',title:'数量1'}, |
|||
{prop:'quantity2',title:'数量2'}, |
|||
{prop:'quantity3',title:'数量3'}, |
|||
{prop:'quantity4',title:'数量4'}, |
|||
{prop:'quantity5',title:'数量5'}, |
|||
{prop:'quantity6',title:'数量6'}, |
|||
{prop:'plant',title:'工厂'}, |
|||
{prop:'createByUser',title:'创建人'}, |
|||
{prop:'createTime',title:'创建时间',type:'datetime',width:180}, |
|||
{prop:'updateByUser',title:'修改人'}, |
|||
{prop:'updateTime',title:'修改时间',type:'datetime',width:180}, |
|||
//是否删除(0:否,1是) |
|||
{prop:'isDelete',title:'是否删除',type:'tagFilter',options:EnumList.whether}, |
|||
{prop:'version',title:'版本号'}, |
|||
], |
|||
tableData: [] |
|||
}) |
|||
|
|||
onMounted(() => { |
|||
handleQuery(1) |
|||
}) |
|||
|
|||
// 查询 |
|||
function handleQuery(page) { |
|||
state.loading = true |
|||
state.pageParams.page = page |
|||
getCommonPaged(state.apiName,Object.assign({}, state.queryParams, state.pageParams)) |
|||
.then((resp) => { |
|||
state.tableData = resp.data.data |
|||
state.pageParams.total = resp.data.total |
|||
// state.tableData = [ |
|||
// {id:1,isDelete:1,plant:'p'+page}, |
|||
// {id:2,isDelete:0,plant:page}, |
|||
// {id:3,isDelete:1,plant:page}, |
|||
// {id:4,isDelete:1,plant:page}, |
|||
// {id:5,isDelete:1,plant:page}, |
|||
// {id:6,isDelete:1,plant:page}, |
|||
// {id:7,isDelete:1,plant:page}, |
|||
// {id:8,isDelete:1,plant:page}, |
|||
// {id:9,isDelete:1,plant:page}, |
|||
// {id:10,isDelete:1,plant:page}, |
|||
// {id:11,isDelete:1,plant:page}, |
|||
// {id:12,isDelete:1,plant:page}, |
|||
// {id:13,isDelete:1,plant:page}, |
|||
// {id:14,isDelete:1,plant:page}, |
|||
// {id:15,isDelete:1,plant:page}, |
|||
// {id:16,isDelete:1,plant:page}, |
|||
// ] |
|||
// state.pageParams.total = state.tableData.length |
|||
}) |
|||
.finally(() => (state.loading = false)) |
|||
} |
|||
|
|||
// 导出 |
|||
function handleExport(){ |
|||
state.loading = true |
|||
postCommonExport(state.apiName,Object.assign({}, state.queryParams, state.pageParams)) |
|||
.then((res) => { |
|||
downloadByData(res.data,route.meta.title+'.xlsx') |
|||
}) |
|||
.finally(() => (state.loading = false)) |
|||
} |
|||
|
|||
</script> |
|||
|
|||
<style></style> |
@ -0,0 +1,98 @@ |
|||
<template> |
|||
<div class="app-container" v-loading="state.loading"> |
|||
<!-- M+6月物料需求计划 --> |
|||
<el-card class="search-container"> |
|||
<el-form :inline="true"> |
|||
<el-form-item label="计划协议号"> |
|||
<el-input v-model="state.queryParams.scheduleAgreement" placeholder="计划协议号" clearable /> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button @click="handleQuery(1)" icon="Search" v-auth="state.apiName + ':page'">查询</el-button> |
|||
<el-button @click="handleExport()" icon="TopRight" v-auth="state.apiName + ':export'" type="success">导出</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-card> |
|||
<el-card class="paged-table-container"> |
|||
<tablePage |
|||
:columnWidth="null" |
|||
:tableData="state.tableData" |
|||
:tableColumns="state.tableColumns" |
|||
:pageParams="state.pageParams" |
|||
@pageSizeChange="handleQuery" |
|||
@pageCurrentChange="handleQuery" |
|||
></tablePage> |
|||
</el-card> |
|||
</div> |
|||
</template> |
|||
|
|||
<script setup> |
|||
defineOptions({ name: 'supplierSaWeek' }) |
|||
import { reactive, ref, onMounted } from 'vue' |
|||
import { getCommonPaged,postCommonExport } from '@/api/common/index' |
|||
import { downloadByData } from '@/utils/download' |
|||
import { ElMessageBox, ElMessage } from 'element-plus' |
|||
import tablePage from '@/components/tablePage/index.vue' |
|||
import EnumList from '@/utils/common/enumList' |
|||
|
|||
import { useRoute } from 'vue-router' |
|||
const route = useRoute() |
|||
|
|||
const state = reactive({ |
|||
apiName:'cherysuppliersaweek', |
|||
loading: false, |
|||
queryParams: { |
|||
scheduleAgreement: '' |
|||
}, |
|||
pageParams: { |
|||
page: 1, |
|||
pageSize: 10, |
|||
total: 1 |
|||
}, |
|||
tableColumns: [ |
|||
{prop:'scheduleAgreement',title:'计划协议号',width:120}, |
|||
{prop:'serialNumber',title:'行项目号'}, |
|||
{prop:'materialCode',title:'零件号'}, |
|||
{prop:'materialDescription',title:'零件名称'}, |
|||
{prop:'purchasingGroup',title:'采购组'}, |
|||
{prop:'plantId',title:'工厂代码'}, |
|||
{prop:'quantityDemand',title:'需求数量'}, |
|||
{prop:'dateReceived',title:'交货日期',type:'datetime',width:180}, |
|||
{prop:'createByUser',title:'创建人'}, |
|||
{prop:'createTime',title:'创建时间',type:'datetime',width:180}, |
|||
{prop:'updateByUser',title:'修改人'}, |
|||
{prop:'updateTime',title:'修改时间',type:'datetime',width:180}, |
|||
{prop:'isDelete',title:'是否删除',type:'tagFilter',options:EnumList.whether}, |
|||
{prop:'version',title:'版本号'}, |
|||
], |
|||
tableData: [] |
|||
}) |
|||
|
|||
onMounted(() => { |
|||
handleQuery(1) |
|||
}) |
|||
|
|||
// 查询 |
|||
function handleQuery(page) { |
|||
state.loading = true |
|||
state.pageParams.page = page |
|||
getCommonPaged(state.apiName,Object.assign({}, state.queryParams, state.pageParams)) |
|||
.then((resp) => { |
|||
state.tableData = resp.data.data |
|||
state.pageParams.total = resp.data.total |
|||
}) |
|||
.finally(() => (state.loading = false)) |
|||
} |
|||
|
|||
// 导出 |
|||
function handleExport(){ |
|||
state.loading = true |
|||
postCommonExport(state.apiName,Object.assign({}, state.queryParams, state.pageParams)) |
|||
.then((res) => { |
|||
downloadByData(res.data,route.meta.title+'.xlsx') |
|||
}) |
|||
.finally(() => (state.loading = false)) |
|||
} |
|||
|
|||
</script> |
|||
|
|||
<style></style> |
Loading…
Reference in new issue