<template>
|
<div class="order-number-management-action-page">
|
<search-bar @search="onSearch" @reset="onReset">
|
<el-form :inline="true" class="search-form">
|
<el-form-item label="订货号">
|
<el-input placeholder="请输入..." clearable class="default-form-width" v-model.trim="query.orderNo"></el-input>
|
</el-form-item>
|
</el-form>
|
</search-bar>
|
|
<el-table :data="list" border stripe>
|
<el-table-column width="50" label="序号" fixed>
|
<template #default="scope">{{(queried.page-1)*queried.pageSize+(scope.$index+1)}}</template>
|
</el-table-column>
|
<el-table-column prop="OrderNo" label="订货号" />
|
<el-table-column prop="CreateTime" label="创建时间" width="160" />
|
<el-table-column prop="ModifyTime" label="修改时间" width="160" />
|
<el-table-column prop="CreateBy" label="创建人" width="100" />
|
<el-table-column prop="ModifyBy" label="修改人" width="100" />
|
<el-table-column label="操作" width="240" fixed="right" align="center">
|
<template #default="scope">
|
<el-button type="primary" size="small" @click="onShowHistoryModal(scope.row)">修改历史</el-button>
|
<el-button type="primary" size="small" @click="onOpenModifyModal(scope.row)"><el-icon class="btn-left-icon"><e-icon-edit /></el-icon>修改订货号</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
|
<div class="pagination-row">
|
<el-pagination :pager-count="5" layout="total, prev, pager, next, jumper" :total="total" @current-change="onPageList" />
|
</div>
|
|
<form-modal v-model:visible="formVisible" :row="actionRow" @submitCallback="onFormSubmitCallback" />
|
<history-modal v-model:visible="historyVisible" :row="actionRow" />
|
</div>
|
</template>
|
|
<script>
|
import SearchBar from '@/components/SearchBar.vue'
|
import FormModal from './FormModal.vue'
|
import HistoryModal from './HistoryModal.vue'
|
import {Edit} from '@element-plus/icons'
|
const defaultQuery = {
|
orderNo:'',
|
orderNo_FilterMode:'1'
|
}
|
export default {
|
name:'orderNumberManagementActionPage',
|
components:{SearchBar,FormModal,HistoryModal,'e-icon-edit':Edit},
|
data(){
|
return {
|
list:[],
|
total:100,
|
query:{...defaultQuery},
|
queried:{...this.$config.pagination},
|
actionRow:{},
|
actionUser:{},
|
formVisible:false,
|
historyVisible:false,
|
formType:'',
|
resetPwdText:''
|
}
|
},
|
mounted() {
|
this.init()
|
},
|
methods:{
|
/* 页面初始化 */
|
init(){
|
this.newList()
|
},
|
/* 搜索按钮 */
|
onSearch(){
|
this.newList()
|
},
|
/* 重置按钮 */
|
onReset(){
|
this.query = {...defaultQuery}
|
this.newList()
|
},
|
/* 翻页功能 */
|
onPageList(page){
|
this.queried.page = page;
|
this.getList();
|
},
|
/* 表格刷新至首页 */
|
newList(needLoading=true){
|
this.queried = {...this.query,...this.$config.pagination}
|
this.getList(()=>{},needLoading)
|
},
|
/* 更新数据表 */
|
getList(callback,needLoading=true){
|
if (needLoading) {
|
this.$loading();
|
}
|
this.$api.post('GetCurrentOrderNoList',this.queried,{block:'orderNo'}).then((d)=>{
|
this.total = d.total;
|
this.list = d.list.map((currentItem)=>{
|
currentItem.CreateTime = this.$utils.project.parseTimeStr(currentItem.CreateTime)
|
currentItem.ModifyTime = this.$utils.project.parseTimeStr(currentItem.ModifyTime)
|
return currentItem
|
})
|
if (needLoading) {
|
this.$loading().close();
|
}
|
callback && callback(true)
|
}).catch((err)=>{
|
if (needLoading) {
|
this.$loading().close();
|
}
|
callback && callback(false)
|
})
|
},
|
onNew(){
|
this.formType = 'add';
|
this.formVisible = true;
|
},
|
onOpenModifyModal(obj){
|
this.actionRow = obj;
|
this.formVisible = true;
|
},
|
/* 打开历史记录弹窗 */
|
onShowHistoryModal(obj){
|
this.actionRow = obj;
|
this.historyVisible = true;
|
},
|
/* 新增/编辑成功提交后的回调 */
|
onFormSubmitCallback() {
|
this.getList()
|
}
|
}
|
}
|
</script>
|
|
<style scoped lang="scss">
|
</style>
|