4 changed files with 376 additions and 41 deletions
@ -0,0 +1,290 @@ |
|||||
|
<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="topbuttonHandle" |
||||
|
@inlineDialog="inlineDialog" |
||||
|
@sortChange="sortChange" |
||||
|
@alertoldSkipCount="alertoldSkipCount" |
||||
|
@alterResultCount="alterResultCount" |
||||
|
@handleSelectionChange="handleSelectionChange" |
||||
|
:currentPageProps="oldSkipCount" |
||||
|
:quicklySearchOption="quicklySearchOption" |
||||
|
@quicklySearchClick="quicklySearchClick" |
||||
|
@quicklySearchClear="quicklySearchClear" |
||||
|
:primarySearchOption="primarySearchOption" |
||||
|
@overallSearchFormClick="overallSearchFormClick" |
||||
|
:httpOverallSearchData="httpOverallSearchData" |
||||
|
:tableSelection="true" |
||||
|
> |
||||
|
</tablePagination> |
||||
|
<!-- 新增与编辑 --> |
||||
|
<!-- <newAndEdiDialog |
||||
|
:loading="Loading.newAndEdiLoading" |
||||
|
:active="active" |
||||
|
:pageStatus="pageStatus" |
||||
|
:formReveal="formReveal" |
||||
|
:formTitle="formTitle" |
||||
|
:displayDialog="editDialog" |
||||
|
:FormData="editFormData" |
||||
|
:Form="editForm" |
||||
|
:Options="editOptions" |
||||
|
:Handle="editHandle" |
||||
|
:Rules="editRules" |
||||
|
@FormSubmit="FormClick(arguments)" |
||||
|
@close="FormClose" |
||||
|
@goBack="goBack" |
||||
|
></newAndEdiDialog> --> |
||||
|
<!-- 新导入 disabledMethod 导入方式禁用 disabledIsAllowPartImport 是否局部导入禁用--> |
||||
|
<!-- methodValue 导入方式默认选项 是否局部导入 默认选项 --> |
||||
|
<importFile |
||||
|
:loading="Loading.importLoading" |
||||
|
:show="displayDialog.importDialog" |
||||
|
:URL="URL" |
||||
|
:disabledMethod = {method1:false,method2:false,method3:false} |
||||
|
:disabledIsAllowPartImport = {isAllowPartImport1:false,isAllowPartImport2:false} |
||||
|
isAllowPartImportValue="1" |
||||
|
@importClick="postImportMergeClick(arguments)" |
||||
|
@postImportDown="importDown" |
||||
|
></importFile> |
||||
|
<curren-Drawer |
||||
|
:title="tableColumns" |
||||
|
:DrawerLoading="Loading.DrawerLoading" |
||||
|
:drawer="displayDialog.detailsDialog" |
||||
|
:Butttondata="DrawerButtonData" |
||||
|
:propsData="propsData" |
||||
|
:tabsDesTions="tabsDesTions" |
||||
|
@drawerShut="(val) => (displayDialog.detailsDialog = val)" |
||||
|
@drawerbutton="drawerbutton" |
||||
|
@handleCommand="drawerHandle" |
||||
|
@close-value="closeValue" |
||||
|
></curren-Drawer> |
||||
|
</div> |
||||
|
</template> |
||||
|
<script> |
||||
|
import { updateExpireDate, postDelete ,getDetailed,inventoryBalanceActive } from "@/api/wms-api" |
||||
|
import { tableMixins } from "@/mixins/TableMixins" |
||||
|
import { LoadingMixins } from "@/mixins/LoadingMixins" |
||||
|
import { drawerMixins } from "@/mixins/drawerMixins" |
||||
|
import { TableHeaderMixins } from "@/mixins/TableHeaderMixins" |
||||
|
import { newAndEdiDialogMixins } from "@/mixins/newAndEdiDialogMixins" |
||||
|
import { mixins } from "@/mixins/mixins" |
||||
|
export default { |
||||
|
name: "InventoryBalanceEdit", |
||||
|
mixins: [ |
||||
|
tableMixins, |
||||
|
LoadingMixins, |
||||
|
drawerMixins, |
||||
|
TableHeaderMixins, |
||||
|
mixins, |
||||
|
newAndEdiDialogMixins |
||||
|
], |
||||
|
computed: { |
||||
|
editDialog: { |
||||
|
get: function () { |
||||
|
return this.displayDialog.newDialog || this.displayDialog.editDialog; |
||||
|
}, |
||||
|
}, |
||||
|
//按钮显示 |
||||
|
hideButton: function () { |
||||
|
return function () { |
||||
|
return this.propsData.isActive |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
data () { |
||||
|
return { |
||||
|
showTableBaseFromFE:['configuration'], |
||||
|
URL: 'wms/inventory/inventory-balance', |
||||
|
//常用按钮数据 |
||||
|
currenButtonData: [ |
||||
|
this.defaultImportBtn(),//导入 |
||||
|
this.defaultExportBtn(),//导出 |
||||
|
{ |
||||
|
type: "success", |
||||
|
icon: "el-icon-check", |
||||
|
label: "批量启用", |
||||
|
name: "batch-active", |
||||
|
size: "mini", |
||||
|
background:"#31bb99" |
||||
|
}, |
||||
|
this.defaultFieldSettingBtn(),//字段设置 |
||||
|
this.defaultFreshBtn(),//刷新 |
||||
|
this.defaultFilterBtn(),//筛选 |
||||
|
], |
||||
|
DrawerButtonData: [ |
||||
|
{ |
||||
|
type: 'success', |
||||
|
icon: 'el-icon-check', |
||||
|
label: '启用', |
||||
|
hide: () => { return this.hideButton() }, |
||||
|
name: "active", |
||||
|
size: 'mini' |
||||
|
}, |
||||
|
], |
||||
|
//编辑 |
||||
|
// editFormData: { |
||||
|
// id: null, |
||||
|
// itemCode: null, |
||||
|
// itemName: null, |
||||
|
// itemDesc1: null, |
||||
|
// itemDesc2: null, |
||||
|
// produceDate: null, |
||||
|
// expireDate: null, |
||||
|
// locationCode: null, |
||||
|
// status: 1, |
||||
|
// lot: true, |
||||
|
// packingCode: true, |
||||
|
// containerCode: null, |
||||
|
// qty: null, |
||||
|
// locationArea: null, |
||||
|
// locationGroup: null, |
||||
|
// locationErpCode: null, |
||||
|
// putInTime: null, |
||||
|
// }, |
||||
|
// editOptions: {}, |
||||
|
// CreateForm: [ |
||||
|
// { type: "input", label: "箱标签", prop: 'packingCode', colSpan: 12 }, |
||||
|
// { type: "input", label: "排序依次", prop: 'sortingBase', colSpan: 12 }, |
||||
|
// { type: "input", label: "序号", prop: 'serialNumber', colSpan: 12 }, |
||||
|
// { type: "input", label: "最后盘点计划", prop: 'lastCountPlanNumber', colSpan: 12 }, |
||||
|
// { type: "input", label: "最后盘点标签", prop: 'lastCountLabel', colSpan: 12 }, |
||||
|
// { type: "input", label: "物品代码", prop: 'itemCode', colSpan: 12 }, |
||||
|
// { type: "input", label: "批次编号", prop: 'batchCode', colSpan: 12 }, |
||||
|
// { type: "input", label: "备注", prop: 'remark', colSpan: 12 }, |
||||
|
// ], |
||||
|
// editForm: [ |
||||
|
// { type: "input", label: "物品代码", prop: "itemCode", disabled:true, colSpan: 12 }, |
||||
|
// { type: "input", label: "物品名称", prop: "itemName", disabled:true, colSpan: 12 }, |
||||
|
// { type: "input", label: "库位代码", prop: "locationCode", disabled:true, colSpan: 12 }, |
||||
|
// { type: "input", label: "批次", prop: "lot", disabled:true, colSpan: 12 }, |
||||
|
// { type: "input", label: "箱标签", prop: "packingCode", disabled:true, colSpan: 12 }, |
||||
|
// { type: "input", label: "库区", prop: "locationArea", disabled:true, colSpan: 12 }, |
||||
|
// { type: "input", label: "库位组", prop: "locationGroup", disabled:true, colSpan: 12 }, |
||||
|
// { type: "dateTime", label: "入库时间", prop: "putInTime", disabled:true, colSpan: 12 }, |
||||
|
// { type: "dateTime", label: "生产日期", prop: "produceDate", disabled:true, colSpan: 12 }, |
||||
|
// { type: "dateTime", label: "过期日期", prop: "expireDate", colSpan: 12 }, |
||||
|
// ], |
||||
|
// editRules: { |
||||
|
// expireDate: [{ required: true, trigger: "blur", message: "不可为空" }], |
||||
|
// }, |
||||
|
}; |
||||
|
}, |
||||
|
mounted () { |
||||
|
this.paging(); |
||||
|
}, |
||||
|
methods: { |
||||
|
drawerbutton(val){ |
||||
|
// 启用 |
||||
|
if(val == "active"){ |
||||
|
this.$confirm('此操作将启用该数据, 是否继续?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
this.Loading.appMainLoading = true |
||||
|
inventoryBalanceActive({id: this.propsData.id}).then(res => { |
||||
|
this.$successMsg('启用成功!') |
||||
|
this.Loading.appMainLoading = false |
||||
|
this.displayDialog.detailsDialog = false |
||||
|
this.paging() |
||||
|
// getDetailed(this.propsData.id, this.URL).then(res => { |
||||
|
// this.propsData = res |
||||
|
// this.Loading.DrawerLoading = false |
||||
|
// }) |
||||
|
}).catch(err => { |
||||
|
this.Loading.appMainLoading = false |
||||
|
}) |
||||
|
}).catch((err) => { |
||||
|
console.log(err) |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
topbuttonHandle(val,item){ |
||||
|
// 批量操作 |
||||
|
if(val == 'batch-active'){ |
||||
|
if(!this.multipleSelection || this.multipleSelection.length <= 0){ |
||||
|
this.$warningMsg('请选择数据') |
||||
|
return |
||||
|
} |
||||
|
this.$confirm('此操作将启用已选 ('+this.multipleSelection.length+'条) 数据, 是否继续?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
this.Loading.tableLoading = true |
||||
|
let _ajaxs = [] |
||||
|
this.multipleSelection.forEach(item=>{ |
||||
|
_ajaxs.push(inventoryBalanceActive({id: item.id})) |
||||
|
}) |
||||
|
Promise.all(_ajaxs).then((allData) => { |
||||
|
this.$successMsg('启用成功!') |
||||
|
this.Loading.tableLoading = false |
||||
|
this.paging() |
||||
|
}).catch((err)=>{ |
||||
|
this.Loading.tableLoading = false |
||||
|
}) |
||||
|
}).catch((err) => { |
||||
|
console.log(err) |
||||
|
}); |
||||
|
}else{ |
||||
|
this.topbutton(val,item) |
||||
|
} |
||||
|
}, |
||||
|
//抽屉下拉按钮操作 库存余额删除 只能删除库存数量为0的记录 |
||||
|
// drawerHandle(val) { |
||||
|
// if (val == 'delete') { |
||||
|
// if (this.propsData.qty == '0') { |
||||
|
// this.$confirm('此操作将永久删除该消息, 是否继续?', '提示', { |
||||
|
// confirmButtonText: '确定', |
||||
|
// cancelButtonText: '取消', |
||||
|
// type: 'warning' |
||||
|
// }).then(() => { |
||||
|
// this.Loading.appMainLoading = true |
||||
|
// this.displayDialog.detailsDialog = false |
||||
|
// postDelete(this.propsData.id, this.URL).then(res => { |
||||
|
// this.$successMsg('删除成功!') |
||||
|
// this.Loading.appMainLoading = false |
||||
|
// this.paging() |
||||
|
// }).catch(err => { |
||||
|
// this.Loading.appMainLoading = false |
||||
|
// }) |
||||
|
// }).catch(() => { |
||||
|
// }); |
||||
|
// } else { |
||||
|
// this.$message({ |
||||
|
// message: "只能删除库存数量为 0 的记录!!", |
||||
|
// type: "warning", |
||||
|
// }); |
||||
|
// } |
||||
|
// } |
||||
|
// }, |
||||
|
//点击表单提交(新增或编辑) |
||||
|
// FormClick (val) { |
||||
|
// let params = { |
||||
|
// id: this.editFormData.id, |
||||
|
// expireDate: this.editFormData.expireDate |
||||
|
// } |
||||
|
// updateExpireDate(params, this.URL).then( res => { |
||||
|
// this.displayDialog.editDialog = false |
||||
|
// this.$message.success("修改成功!"); |
||||
|
// this.paging(); |
||||
|
// }).catch( err => { |
||||
|
// this.$message.success("修改失败!"); |
||||
|
// console.log(err) |
||||
|
// }) |
||||
|
// } |
||||
|
}, |
||||
|
}; |
||||
|
</script> |
||||
|
<style lang="scss" scoped> |
||||
|
@import "../../../styles/basicData.scss"; |
||||
|
</style> |
Loading…
Reference in new issue