5 changed files with 641 additions and 81 deletions
@ -0,0 +1,548 @@ |
|||||
|
<template> |
||||
|
<div class="page-box" v-loading="Loading.appMainLoading"> |
||||
|
<tablePagination |
||||
|
ref="FISDeliverRequestTable_unfoldRef" |
||||
|
: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="(options)=>{overallSearchFormClick(options,overallSearchFormCallback)}" |
||||
|
:httpOverallSearchData="httpOverallSearchData" |
||||
|
:tableSelection="true" |
||||
|
:selectionIsFixed="false" |
||||
|
:showPager="false" |
||||
|
:setUTableHeight="120" |
||||
|
> |
||||
|
<template v-slot:beforeTableColumn> |
||||
|
<u-table-column type="expand"> |
||||
|
<template slot-scope="props"> |
||||
|
<u-table |
||||
|
max-height="280" |
||||
|
:data="props.row.requestDetailDtos" |
||||
|
:border="true" |
||||
|
row-key="id" |
||||
|
> |
||||
|
<u-table-column |
||||
|
v-for="(item, index) in detailTableColumns" |
||||
|
:prop="item.prop" |
||||
|
:label="item.label"> |
||||
|
</u-table-column> |
||||
|
</u-table> |
||||
|
</template> |
||||
|
</u-table-column> |
||||
|
</template> |
||||
|
</tablePagination> |
||||
|
<!--抽屉--> |
||||
|
<curren-Drawer |
||||
|
:title="tableColumns" |
||||
|
:DrawerLoading="Loading.DrawerLoading" |
||||
|
:drawer="displayDialog.detailsDialog" |
||||
|
:propsData="propsData" |
||||
|
:tabsDesTions="tabsDesTions" |
||||
|
:Butttondata="DrawerButtonData" |
||||
|
@drawerShut="(val) => (displayDialog.detailsDialog = val)" |
||||
|
@drawerbutton="drawerbuttonHandle" |
||||
|
@handleCommand="drawerHandle" |
||||
|
@close-value="closeValue" |
||||
|
:tableColumns="detailsTableColumns" |
||||
|
:totalCount="totalCountDetails" |
||||
|
:MaxResultCount="MaxResultCountDetails" |
||||
|
@alterResultCountDetails="alterResultCountDetails" |
||||
|
@alertoldSkipCountDetails="alertoldSkipCountDetails" |
||||
|
></curren-Drawer> |
||||
|
<!-- 新导入 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('wms/store/deliver-request')" |
||||
|
></importFile> |
||||
|
<!-- 批量生成发货单弹窗 --> |
||||
|
<el-dialog |
||||
|
title="批量生成发货单" |
||||
|
:visible="creatDeliverShow" |
||||
|
:append-to-body="true" |
||||
|
> |
||||
|
<el-form :model="creatDeliverForm" :rules="creatDeliverRules" ref="creatDeliverRef"> |
||||
|
<el-form-item label="车牌号" prop="truckNumber"> |
||||
|
<el-input v-model="creatDeliverForm.truckNumber"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<div slot="footer"> |
||||
|
<el-button @click="creatDeliverClose()">取 消</el-button> |
||||
|
<el-button type="primary" @click="creatDeliverSure()">确 定</el-button> |
||||
|
</div> |
||||
|
</el-dialog> |
||||
|
<!-- 批量生成发货单提示-弹窗 --> |
||||
|
<el-dialog |
||||
|
:visible="creatDeliverTipShow" |
||||
|
:append-to-body="true" |
||||
|
> |
||||
|
<div v-html="creatDeliverTipper"></div> |
||||
|
<div slot="footer"> |
||||
|
<el-button type="primary" @click="creatDeliverTipSure()">继 续</el-button> |
||||
|
</div> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
<script> |
||||
|
import { |
||||
|
processRequest, |
||||
|
getDetailed, |
||||
|
getPageListWip, |
||||
|
deliverRequestHandleList, |
||||
|
deliverRequestHandleTip, |
||||
|
deliverRequestDelete, |
||||
|
getDeliverRequestFisByContainer |
||||
|
} 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 { mixins } from "@/mixins/mixins" |
||||
|
import { requestData } from "@/utils/processButtonData" |
||||
|
import { initPrintAllData } from '@/mixins/printMixin' |
||||
|
export default { |
||||
|
name: "FISDeliverRequest_unfold", |
||||
|
mixins: [ |
||||
|
tableMixins, |
||||
|
LoadingMixins, |
||||
|
drawerMixins, |
||||
|
TableHeaderMixins, |
||||
|
mixins, |
||||
|
], |
||||
|
computed: { |
||||
|
// 头部按钮显隐控制(普通发货) |
||||
|
hideButton_normalSta: function () { |
||||
|
return function (val) { |
||||
|
return this.showFilterSta_normal == val |
||||
|
} |
||||
|
}, |
||||
|
// 头部按钮显隐控制(FIS发货) |
||||
|
hideButton_FISSta: function () { |
||||
|
return function (val) { |
||||
|
return this.showFilterSta_fis == val |
||||
|
} |
||||
|
}, |
||||
|
// 按钮显示 |
||||
|
hideDelButton: function () { |
||||
|
return function () { |
||||
|
return this.propsData.deliverRequestType != 1 |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
data () { |
||||
|
return { |
||||
|
URL: 'wms/store/deliver-request-fis/get-list-by-container', |
||||
|
pagingShowDetail:true, |
||||
|
importUploadURL:'wms/store/deliver-request/import', |
||||
|
//常用按钮数据 |
||||
|
currenButtonData: [ |
||||
|
{ |
||||
|
label: "返回普通模式", |
||||
|
name: "toNormal", |
||||
|
size: "mini", |
||||
|
}, |
||||
|
// this.defaultImportBtn(),//导入 |
||||
|
{ |
||||
|
type: "success", |
||||
|
icon: "el-icon-d-arrow-right", |
||||
|
label: "批量生成发货单", |
||||
|
name: "creatDeliver", |
||||
|
size: "mini", |
||||
|
}, |
||||
|
{ |
||||
|
label: "全部折叠", |
||||
|
name: "toggleAllExpansion", |
||||
|
size: "mini", |
||||
|
type: "primary", |
||||
|
}, |
||||
|
// { |
||||
|
// type: "primary", |
||||
|
// label: "筛选[普通发货]", |
||||
|
// name: "normalSta", |
||||
|
// size: "mini", |
||||
|
// hide: () => { return this.hideButton_normalSta(true) }, |
||||
|
// }, |
||||
|
// { |
||||
|
// type: "danger", |
||||
|
// label: "重置[普通发货]", |
||||
|
// name: "normalSta-reset", |
||||
|
// size: "mini", |
||||
|
// hide: () => { return this.hideButton_normalSta(false) }, |
||||
|
// }, |
||||
|
// { |
||||
|
// type: "warning", |
||||
|
// label: "筛选[FIS发货]", |
||||
|
// name: "FISSta", |
||||
|
// size: "mini", |
||||
|
// hide: () => { return this.hideButton_FISSta(true) }, |
||||
|
// }, |
||||
|
// { |
||||
|
// type: "danger", |
||||
|
// label: "重置[FIS发货]", |
||||
|
// name: "normalSta-reset", |
||||
|
// size: "mini", |
||||
|
// hide: () => { return this.hideButton_FISSta(false) }, |
||||
|
// }, |
||||
|
this.defaultFieldSettingBtn(),//字段设置 |
||||
|
this.defaultFreshBtn(),//刷新 |
||||
|
// this.defaultFilterBtn(),//筛选 |
||||
|
], |
||||
|
tableColumns:[ |
||||
|
{ label: "器具编号", prop: 'mesDeliveryContainer'}, |
||||
|
{ label: "最大时间", prop: "maxDateTime", type: "dateTime" }, |
||||
|
{ label: "最小时间", prop: 'minDateTime', type: "dateTime"}, |
||||
|
{ label: "客户代码", prop: 'customerCode'}, |
||||
|
{ label: "客户名称", prop: 'customerName'}, |
||||
|
{ label: "客户简称", prop: 'customerShortName'}, |
||||
|
{ label: "客户地址", prop: 'customerAddress'}, |
||||
|
{ label: "创建时间", prop: "creationTime",type: "dateTime"}, |
||||
|
], |
||||
|
// 子表表头 |
||||
|
detailTableColumns:[ |
||||
|
{ label: "ERP料号", prop: 'itemCode' }, |
||||
|
{ label: "料号描述", prop: 'itemDesc1' }, |
||||
|
{ label: "底盘号", prop: 'identityNo' }, |
||||
|
{ label: "Mes发货计划号", prop: 'mesDeliveryPlan' }, |
||||
|
{ label: "Mes器具号", prop: 'mesDeliveryContainer' }, |
||||
|
{ label: "数量", prop: 'qty' }, |
||||
|
{ label: "单位", prop: 'uom' }, |
||||
|
{ label: "标包数量", prop: 'stdPackQty' }, |
||||
|
], |
||||
|
DrawerButtonData: [ |
||||
|
{ |
||||
|
type: "danger", |
||||
|
label: "删除", |
||||
|
name: "delete", |
||||
|
size: "mini", |
||||
|
hide: () => { return this.hideDelButton() }, |
||||
|
}, |
||||
|
// ...requestData(this) |
||||
|
], |
||||
|
showFilterSta_normal:false,//查看普通发货 |
||||
|
showFilterSta_fis:false,//查看fis发货 |
||||
|
// 批量生成发货单弹窗 |
||||
|
creatDeliverShow:false, |
||||
|
creatDeliverTipShow:false, |
||||
|
creatDeliverTipper:"", |
||||
|
creatDeliverForm:{ |
||||
|
truckNumber:"" |
||||
|
}, |
||||
|
creatDeliverRules:{ |
||||
|
truckNumber: [{ required: true, trigger: "blur", message: "不可为空" }] |
||||
|
}, |
||||
|
// 已选去重masterID后明细 |
||||
|
selectedDetailsArr:[] |
||||
|
}; |
||||
|
}, |
||||
|
mounted () { |
||||
|
this.paging(()=>{ |
||||
|
this.$nextTick(()=>{ |
||||
|
this.$refs.FISDeliverRequestTable_unfoldRef.clearSelection() |
||||
|
}) |
||||
|
}); |
||||
|
}, |
||||
|
methods:{ |
||||
|
paging(callback) { |
||||
|
this.initPagingHeaderBtn() |
||||
|
this.Loading.tableLoading = true; |
||||
|
getDeliverRequestFisByContainer().then(res => { |
||||
|
res.forEach((item,key)=>{ item.id = key + 1 }) |
||||
|
this.tableData = res |
||||
|
this.totalCount = res.length |
||||
|
this.pagingCallback(callback) |
||||
|
}).catch(err => { |
||||
|
this.Loading.tableLoading = false |
||||
|
}) |
||||
|
// this.PageListParams.SkipCount = (this.oldSkipCount - 1) * this.PageListParams.MaxResultCount, |
||||
|
// getPageList(this.PageListParams, this.URL,this.pagingShowDetail,this.listURL).then(res => { |
||||
|
// this.tableData = res.items |
||||
|
// this.totalCount = res.totalCount |
||||
|
// this.pagingCallback(callback) |
||||
|
// }).catch(err => { |
||||
|
// this.Loading.tableLoading = false |
||||
|
// }) |
||||
|
}, |
||||
|
overallSearchFormCallback(){ |
||||
|
this.showFilterSta_normal = false |
||||
|
this.showFilterSta_fis = false |
||||
|
}, |
||||
|
// 查看普通发货、fis发货 |
||||
|
fasterSearchHandle(type){ |
||||
|
this.PageListParams.condition.filters = [{ |
||||
|
logic: "And", |
||||
|
column: "deliverRequestType", |
||||
|
action: "==", |
||||
|
value: String(type) |
||||
|
}] |
||||
|
this.paging() |
||||
|
this.httpOverallSearchData = null |
||||
|
}, |
||||
|
// 重置普通发货、fis发货 |
||||
|
resetSearchHandle(){ |
||||
|
this.showFilterSta_normal = false |
||||
|
this.showFilterSta_fis = false |
||||
|
this.PageListParams.condition.filters = [] |
||||
|
this.paging() |
||||
|
this.httpOverallSearchData = null |
||||
|
}, |
||||
|
topbuttonHandle(val,item){ |
||||
|
// 批量生成发货单 |
||||
|
if(val == "creatDeliver"){ |
||||
|
if(!this.multipleSelection || this.multipleSelection.length <= 0){ |
||||
|
this.$warningMsg("至少选择一条数据") |
||||
|
return |
||||
|
} |
||||
|
let _hasNoSame = 0 |
||||
|
for(let i = 0;i<this.multipleSelection.length;i++){ |
||||
|
if(this.multipleSelection[i].customerCode != this.multipleSelection[0].customerCode){ |
||||
|
_hasNoSame ++ |
||||
|
} |
||||
|
} |
||||
|
if(_hasNoSame != 0){ |
||||
|
this.$errorMsg("所选数据的客户代码必须一致!") |
||||
|
return |
||||
|
} |
||||
|
this.creatDeliverShow = true |
||||
|
} |
||||
|
// 查看普通发货 |
||||
|
else if(val == 'normalSta'){ |
||||
|
this.showFilterSta_normal = true |
||||
|
this.showFilterSta_fis = false |
||||
|
this.fasterSearchHandle('1') |
||||
|
} |
||||
|
// 查看fis发货 |
||||
|
else if(val == 'FISSta'){ |
||||
|
this.showFilterSta_fis = true |
||||
|
this.showFilterSta_normal = false |
||||
|
this.fasterSearchHandle('2') |
||||
|
} |
||||
|
// 重置状态 |
||||
|
else if(val == 'normalSta-reset' || val == 'FISSta-reset'){ |
||||
|
this.resetSearchHandle() |
||||
|
} |
||||
|
// 切换模式 |
||||
|
else if(val == 'toNormal'){ |
||||
|
if(this.multipleSelection && this.multipleSelection.length > 0){ |
||||
|
this.$confirm('切换模式后,已选数据将清空,是否继续?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
this.$refs.FISDeliverRequestTable_unfoldRef.clearSelection() |
||||
|
this.$emit("closeUnfoldMode") |
||||
|
}).catch(() => { |
||||
|
|
||||
|
}); |
||||
|
}else{ |
||||
|
this.$refs.FISDeliverRequestTable_unfoldRef.clearSelection() |
||||
|
this.$emit("closeUnfoldMode") |
||||
|
} |
||||
|
} |
||||
|
// 全部折叠 |
||||
|
else if(val == 'toggleAllExpansion'){ |
||||
|
this.toggleAllExpansion() |
||||
|
} |
||||
|
else{ |
||||
|
this.topbutton(val,item) |
||||
|
} |
||||
|
}, |
||||
|
printHandle(){ |
||||
|
this.Loading.appMainLoading = true |
||||
|
let param = { |
||||
|
maxResultCount: 1000, |
||||
|
condition: { |
||||
|
filters: [{ |
||||
|
logic: "And", |
||||
|
column: "deliverRequestNumber", |
||||
|
action: "==", |
||||
|
value: this.propsData.number |
||||
|
}] |
||||
|
}, |
||||
|
sorting: "", |
||||
|
skipCount: 0 |
||||
|
} |
||||
|
// 获取记录 |
||||
|
this.Loading.appMainLoading = true |
||||
|
getPageListWip(param, 'wms/store/deliver-note/list-for-fis',true) |
||||
|
.then(async res => { |
||||
|
let _option = { |
||||
|
details:{ |
||||
|
packingCode:"toPackingCode", |
||||
|
} |
||||
|
} |
||||
|
let data = await initPrintAllData(res.items[0],'chdmxb.rdlx',false,_option); |
||||
|
this.Print(data) |
||||
|
this.Loading.appMainLoading = false |
||||
|
}) |
||||
|
.catch(err=>{ |
||||
|
console.log(err) |
||||
|
}) |
||||
|
}, |
||||
|
drawerbuttonHandle(val){ |
||||
|
// 审批 |
||||
|
// if (val == 'agreeRequest') { |
||||
|
// this.Loading.appMainLoading = true |
||||
|
// processRequest(this.propsData.id, this.URL + '/agree/').then(res => { |
||||
|
// getDetailed(this.propsData.id, this.URL).then(res => { |
||||
|
// this.propsData = res |
||||
|
// }) |
||||
|
// this.paging() |
||||
|
// this.$confirm('审批成功,是否需要打印发货单', '提示', { |
||||
|
// confirmButtonText: '确定', |
||||
|
// cancelButtonText: '取消', |
||||
|
// type: 'warning' |
||||
|
// }).then(() => { |
||||
|
// // 打印发货单 |
||||
|
// this.printHandle() |
||||
|
// }).catch(() => { |
||||
|
|
||||
|
// }); |
||||
|
// this.Loading.appMainLoading = false |
||||
|
// }).catch(err => { |
||||
|
// this.Loading.appMainLoading = false |
||||
|
// }) |
||||
|
// } |
||||
|
if(val == 'delete'){ |
||||
|
this.$confirm('您确定删除吗, 是否继续?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
this.Loading.appMainLoading = true; |
||||
|
deliverRequestDelete(this.propsData.id) |
||||
|
.then(res=>{ |
||||
|
this.$successMsg("删除成功!") |
||||
|
this.paging() |
||||
|
this.displayDialog.detailsDialog = false |
||||
|
this.Loading.appMainLoading = false; |
||||
|
}).catch(() => { |
||||
|
this.Loading.appMainLoading = false; |
||||
|
}); |
||||
|
}).catch(() => { |
||||
|
|
||||
|
}); |
||||
|
} |
||||
|
else{ |
||||
|
this.drawerbutton(val) |
||||
|
} |
||||
|
}, |
||||
|
// 批量操作弹窗-关闭 |
||||
|
creatDeliverClose(){ |
||||
|
this.creatDeliverForm.truckNumber = "" |
||||
|
this.creatDeliverShow = false |
||||
|
}, |
||||
|
// 批量操作弹窗-确定 |
||||
|
creatDeliverSure(){ |
||||
|
this.$refs.creatDeliverRef.validate((valid) => { |
||||
|
if (valid) { |
||||
|
this.Loading.appMainLoading = true |
||||
|
// 子表汇总 |
||||
|
let _allDetails = [] |
||||
|
this.multipleSelection.forEach(item=>{ |
||||
|
item.requestDetailDtos.forEach(dItem=>{ |
||||
|
dItem.customerCode = item.customerCode |
||||
|
}) |
||||
|
_allDetails=[...item.requestDetailDtos,..._allDetails] |
||||
|
}) |
||||
|
// 去重masterID |
||||
|
let _masters = [] |
||||
|
this.selectedDetailsArr = [] |
||||
|
_allDetails.forEach(item=>{ |
||||
|
if(!(_masters.includes(item.masterID))){ |
||||
|
_masters.push(item.masterID) |
||||
|
this.selectedDetailsArr.push(item) |
||||
|
} |
||||
|
}) |
||||
|
// 格式化数据 |
||||
|
let _details = {} |
||||
|
this.selectedDetailsArr.forEach(deItem=>{ |
||||
|
let _name = deItem.customerCode + '_' + deItem.itemCode |
||||
|
if(!_details[_name])_details[_name] = deItem |
||||
|
}) |
||||
|
// 重组传参 |
||||
|
let _dtos = [] |
||||
|
for(let i in _details){ |
||||
|
let _item = { |
||||
|
customerCode:_details[i].customerCode, |
||||
|
itemCode:_details[i].itemCode |
||||
|
} |
||||
|
_dtos.push(_item) |
||||
|
} |
||||
|
deliverRequestHandleTip(_dtos) |
||||
|
.then(res => { |
||||
|
this.Loading.appMainLoading = false |
||||
|
// 如果有字符串,弹出提示 |
||||
|
if(res && res.length > 0){ |
||||
|
this.creatDeliverTipper = res |
||||
|
this.creatDeliverTipShow = true |
||||
|
} |
||||
|
// 如果没有字符串,直接走提交流程 |
||||
|
else{ |
||||
|
this.creatDeliverTipSure() |
||||
|
} |
||||
|
}).catch(err => { |
||||
|
this.Loading.appMainLoading = false |
||||
|
}) |
||||
|
} else { |
||||
|
console.log('error submit!!'); |
||||
|
return false; |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
creatDeliverTipSure(){ |
||||
|
this.Loading.appMainLoading = true |
||||
|
let _params = {truckNumber:String(this.creatDeliverForm.truckNumber)} |
||||
|
let _ids = [] |
||||
|
this.selectedDetailsArr.forEach(select=>{ _ids.push(select.masterID) }) |
||||
|
this.creatDeliverClose() |
||||
|
this.creatDeliverTipShow = false |
||||
|
deliverRequestHandleList(_ids,_params) |
||||
|
.then(res => { |
||||
|
this.Loading.appMainLoading = false |
||||
|
this.$refs.FISDeliverRequestTable_unfoldRef.clearSelection() |
||||
|
this.paging() |
||||
|
this.$successMsg('操作成功!') |
||||
|
}).catch(err => { |
||||
|
this.Loading.appMainLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
// 全部折叠 |
||||
|
toggleAllExpansion() { |
||||
|
this.tableData.forEach(row => { |
||||
|
this.$refs.FISDeliverRequestTable_unfoldRef.getUMyTable().toggleRowExpansion(row, false); |
||||
|
}); |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style lang="scss" scoped> |
||||
|
@import "../../../styles/mainbasicData.scss"; |
||||
|
::v-deep .el-table__expanded-cell{ |
||||
|
padding:20px 20px 20px 120px !important |
||||
|
} |
||||
|
// ::v-deep .el-table__fixed{ |
||||
|
// height:100% !important |
||||
|
// } |
||||
|
</style> |
Loading…
Reference in new issue