You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

206 lines
6.7 KiB

2 years ago
<template>
<div class="page-box" v-loading="Loading.appMainLoading">
<tablePagination
:currenButtonData="currenButtonData"
:tableData="tableData"
:tableLoading="Loading.tableLoading"
:tableColumns="tableColumns"
@rowDrop="rowDrop"
:totalCount="totalCount"
:multipleSelection="multipleSelection"
:MaxResultCount="PageListParams.MaxResultCount"
@topbutton="topbutton"
@inlineDialog="inlineDialog"
@sortChange="sortChange"
@alertoldSkipCount="alertoldSkipCount"
@alterResultCount="alterResultCount"
@handleSelectionChange="handleSelectionChange"
:currentPageProps="oldSkipCount"
:quicklySearchOption="quicklySearchOption"
@quicklySearchClick="quicklySearchClick"
@quicklySearchClear="quicklySearchClear"
:primarySearchOption="primarySearchOption"
@overallSearchFormClick="overallSearchFormClick"
:httpOverallSearchData="httpOverallSearchData"
>
</tablePagination>
<!-- 新导入 disabledMethod 导入方式禁用 disabledIsAllowPartImport 是否局部导入禁用-->
<!-- methodValue 导入方式默认选项 是否局部导入 默认选项 -->
<importFile
:loading="Loading.importLoading"
:show="displayDialog.importDialog"
:URL="URL"
:disabledMethod="{ method1: false, method2: false, method3: false }"
:disabledIsAllowPartImport="{
isAllowPartImport1: false,
isAllowPartImport2: false,
}"
methodValue="0"
isAllowPartImportValue="1"
@importClick="postImportMergeClick(arguments)"
@postImportDown="importDown"
></importFile>
<curren-Drawer
:title="tableColumns"
:DrawerLoading="Loading.DrawerLoading"
:drawer="displayDialog.detailsDialog"
:propsData="propsData"
:tabsDesTions="tabsDesTions"
:Butttondata="DrawerButtonData"
@drawerShut="(val) => (displayDialog.detailsDialog = val)"
@drawerbutton="drawerbutton"
@close-value="closeValue"
:currenButtonData="currenButtonData"
:tableColumns="detailsTableColumns"
:totalCount="totalCountDetails"
:MaxResultCount="MaxResultCountDetails"
@alterResultCountDetails="alterResultCountDetails"
@alertoldSkipCountDetails="alertoldSkipCountDetails"
></curren-Drawer>
</div>
</template>
<script>
import { materialRequestByType,processRequest } from "@/api/wms-api"
2 years ago
import { tableMixins } from "@/mixins/TableMixins"
import { LoadingMixins } from "@/mixins/LoadingMixins"
import { drawerMixins } from "@/mixins/drawerMixins"
import { TableHeaderMixins } from "@/mixins/TableHeaderMixins"
import { mixins } from "@/mixins/mixins"
import { requestData } from "@/utils/processButtonData"
export default {
name: "IssueRequest",
mixins: [
tableMixins,
LoadingMixins,
drawerMixins,
TableHeaderMixins,
mixins,
],
computed: {
editDialog: {
get: function () {
return this.displayDialog.newDialog || this.displayDialog.editDialog;
},
},
},
data () {
let _this = this;
2 years ago
return {
URL: 'wms/store/material-request',
tableLoading: false,
handleMultipleSelection: [],
//常用按钮数据
currenButtonData: [
this.defaultImportBtn(),//导入
this.defaultFieldSettingBtn(),//字段设置
this.defaultFreshBtn(),//刷新
this.defaultFilterBtn(),//筛选
],
DrawerButtonData: [
...requestData(this),
{
type: 'primary',
icon: 'el-icon-circle-check',
label: '完成',
hide: () => { return this.completeRequestInit([2,6])},
name: "completeRequest",
size: 'mini'
},
// {
// type: 'primary',
// icon: 'el-icon-circle-check',
// label: '执行',
// name: "IssueRequest-zx",
// hide: () => { return this.againHandleRequestInit([9])},
// size: 'mini'
// },
// ...requestData(this,false,
// false,
// {
// againHandleRequest:() => {return this.againHandleRequestInit([9])},
// // abortRequest:() => {return this.abortRequestRequestInit([2,6])},
// },
// ['againHandleRequest']
// ),
//使用 initHide 函数处理是否隐藏
// ...requestData(this,false,{
// againHandleRequest:() => {return this.againHandleRequestInit([9])}
// }),
//使用 noShow 隐藏按钮
// ...requestData(this,false,false,['againHandleRequest']),
// {
// type: 'primary',
// icon: 'el-icon-circle-check',
// label: '完成',
// name: "completeRequest",
// size: 'mini'
// },
],
2 years ago
};
},
mounted () {
this.paging()
},
methods: {
//渲染数据
paging() {
this.Loading.tableLoading = true;
this.PageListParams.SkipCount = (this.oldSkipCount - 1) * this.PageListParams.MaxResultCount
// 叫料请求类型: 人工拉动:Issue_Manual; 线边拉动:Issue_WIP; 直接发料:Direct_Issue
let params = {
type: 'Issue_Manual'
}
materialRequestByType(this.PageListParams, this.URL + '/by-type', params).then(res => {
this.tableData = res.items
this.totalCount = res.totalCount
this.pagingCallback()
2 years ago
}).catch(err => {
this.Loading.tableLoading = false
})
},
// 重新定义【中止按钮】显示判断 除了2(待审批) 和 6(完成状态)都显示(abortRequestRequestInit)
completeRequestInit(val){
let data = false
val.forEach(key => {
if (this.propsData.requestStatus == key) {
data = true
}
})
return data
},
// 重新定义【执行按钮】显示判断 ==9时候显示
againHandleRequestInit(val){
let data = true
val.forEach(key => {
if (this.propsData.requestStatus == key) {
data = false
}
})
return data
},
//抽屉常用按钮
// drawerbutton (val) {
// // 执行(todo:后期本页特殊)
// if(val == 'IssueRequest-zx'){
// this.Loading.appMainLoading = true
// processRequest(this.propsData.id, this.URL + '/handle/').then(res => {
// this.$successMsg('处理完成')
// getDetailed(this.propsData.id, this.URL).then(res => {
// this.propsData = res
// })
// this.paging()
// this.Loading.appMainLoading = false
// }).catch(err => {
// console.log(err)
// this.Loading.appMainLoading = false
// })
// } else {
// drawerMixins.methods.drawerbutton(val, this)
// }
// },
2 years ago
}
};
</script>
<style lang="scss" scoped>
@import "../../../styles/mainbasicData.scss";
</style>