|
|
@ -53,9 +53,12 @@ |
|
|
|
:Options="editOptions" |
|
|
|
:detailsTableColumns="AddDetailsTableColumns" |
|
|
|
:childTableData="childTableData" |
|
|
|
@close="stepsClose(arguments)" |
|
|
|
@close="stepsCloseHandle(arguments)" |
|
|
|
@detailsDataPush="detailsDataPush" |
|
|
|
@detailsClear="detailsClear" |
|
|
|
:isShowDeleteButton="false" |
|
|
|
:addClickButton="false" |
|
|
|
:successHandle="successHandle" |
|
|
|
></StepsFormNotView> |
|
|
|
</div> |
|
|
|
</template> |
|
|
@ -66,6 +69,7 @@ import { LoadingMixins } from "@/mixins/LoadingMixins" |
|
|
|
import { drawerMixins } from "@/mixins/drawerMixins" |
|
|
|
import { TableHeaderMixins } from "@/mixins/TableHeaderMixins" |
|
|
|
import { mixins } from "@/mixins/mixins" |
|
|
|
import { filterSelectMixins } from '@/mixins/filter-Select' |
|
|
|
export default { |
|
|
|
name: "customerDismantleJob", |
|
|
|
mixins: [ |
|
|
@ -74,6 +78,7 @@ export default { |
|
|
|
drawerMixins, |
|
|
|
TableHeaderMixins, |
|
|
|
mixins, |
|
|
|
filterSelectMixins, |
|
|
|
], |
|
|
|
data () { |
|
|
|
return { |
|
|
@ -81,6 +86,7 @@ export default { |
|
|
|
detailURL: 'wms/store/product-recycle-note/note-and-back-flush', |
|
|
|
//常用按钮数据 |
|
|
|
currenButtonData: [ |
|
|
|
this.defaultAddBtn(),//新增 |
|
|
|
//导出 |
|
|
|
this.defaultExportBtn({ |
|
|
|
url:"wms/store/product-recycle-note/export-note-and-back-flush" |
|
|
@ -108,7 +114,17 @@ export default { |
|
|
|
details:[] |
|
|
|
}, |
|
|
|
CreateForm: [ |
|
|
|
{ type: "inputNumber", label: "数量", prop: "qty",colSpan: 12,min:1 }, |
|
|
|
{ type: "inputNumber", label: "数量", prop: "qty",colSpan: 12,min:1, |
|
|
|
validator: (rule, value, callback) => { |
|
|
|
//todo:数量小于库存数 |
|
|
|
let _qty = Number(this.propsData.InventoryQty) |
|
|
|
if(_qty < value){ |
|
|
|
return callback(new Error(`数量不能大于库存数量${_qty}`)) |
|
|
|
}else{ |
|
|
|
callback() |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
], |
|
|
|
editRules: { |
|
|
|
cerateRule: { |
|
|
@ -117,11 +133,11 @@ export default { |
|
|
|
}, |
|
|
|
AddDetailsTableColumns: [ |
|
|
|
{ label: "物料代码", prop: "partCode",width:"auto" }, |
|
|
|
{ label: "数量", prop: 'qty',width:"auto" },//todo:可能需要计算 |
|
|
|
{ label: "数量", prop: 'qty',width:"auto" }, |
|
|
|
{ type: "filterSelect", label: "库位", prop: "locationCode", optionsLabel: "name", optionsValue: "code", |
|
|
|
focus: (type,val) => { return this.getFilterList(type, val, "basedata/Location",this.isFilter("type", "5"))}, |
|
|
|
searchButton: (val) => { this.showSerarchPage(val, 'basedata/Location', 'InventoryBalance', '库位选择', this.CreateFormData) }, |
|
|
|
width:"auto", searchButton:false |
|
|
|
// searchButton: (val) => { this.showSerarchPage(val, 'basedata/Location', 'InventoryBalance', '库位选择', this.CreateFormData) }, |
|
|
|
width:"auto", |
|
|
|
}, |
|
|
|
], |
|
|
|
childTableData:[{ |
|
|
@ -129,65 +145,93 @@ export default { |
|
|
|
qty:undefined, |
|
|
|
locationCode:undefined |
|
|
|
}], |
|
|
|
successHandle:[ |
|
|
|
{ |
|
|
|
label:"下载", |
|
|
|
click:(()=>{ |
|
|
|
this.downloadReport() |
|
|
|
}) |
|
|
|
} |
|
|
|
] |
|
|
|
}; |
|
|
|
}, |
|
|
|
mounted () { |
|
|
|
this.paging(); |
|
|
|
}, |
|
|
|
methods: {//渲染数据 |
|
|
|
paging(callback) { |
|
|
|
this.Loading.tableLoading = true; |
|
|
|
this.PageListParams.SkipCount = (this.oldSkipCount - 1) * this.PageListParams.MaxResultCount, |
|
|
|
getPageList(this.PageListParams, this.URL,true) |
|
|
|
.then(res => { |
|
|
|
this.tableData = res.items |
|
|
|
this.totalCount = res.totalCount |
|
|
|
this.tableData.forEach(item=>{ |
|
|
|
item.itemCode = item.noteAndBackFlushDetails[0].itemCode |
|
|
|
item.locationCode = item.noteAndBackFlushDetails[0].locationCode |
|
|
|
item.qty = item.noteAndBackFlushDetails[0].qty |
|
|
|
item.rawLocationCode = item.noteAndBackFlushDetails[0].rawLocationCode |
|
|
|
item.preStartTime = item.noteAndBackFlushDetails[0].preStartTime |
|
|
|
item.workHour = item.noteAndBackFlushDetails[0].workHour |
|
|
|
}) |
|
|
|
this.pagingCallback(callback) |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
this.Loading.tableLoading = false |
|
|
|
}) |
|
|
|
methods: { |
|
|
|
//过滤查询条件 |
|
|
|
isFilter (val, data) { |
|
|
|
let filter = [ |
|
|
|
{ |
|
|
|
logic: "And", |
|
|
|
column: val, |
|
|
|
action: "==", |
|
|
|
value: data |
|
|
|
} |
|
|
|
] |
|
|
|
return filter |
|
|
|
}, |
|
|
|
//点击Table行内名称 |
|
|
|
inlineDialog(val) { |
|
|
|
this.firstTabs = 'xq' |
|
|
|
//打开抽屉 |
|
|
|
this.Loading.DrawerLoading = true |
|
|
|
this.displayDialog.detailsDialog = true; |
|
|
|
getDetailed(val.id, 'wms/store/product-recycle-note/note-and-back-flush') |
|
|
|
.then(res => { |
|
|
|
if (res.details) { |
|
|
|
// 前端分页处理 |
|
|
|
this.tableDataDetails = JSON.parse(JSON.stringify(res)) |
|
|
|
let linshiTableDataDetails = JSON.parse(JSON.stringify(this.tableDataDetails)) |
|
|
|
this.totalCountDetails = res.details.length |
|
|
|
// 删除除当前页面最大数以外数据 |
|
|
|
linshiTableDataDetails.details.splice(this.MaxResultCountDetails,this.totalCountDetails); |
|
|
|
this.propsData = linshiTableDataDetails |
|
|
|
} else { |
|
|
|
this.propsData = res |
|
|
|
} |
|
|
|
if (this.propsData.noteAndBackFlushDetails.length > 0) { |
|
|
|
this.propsData.itemCode = this.propsData.noteAndBackFlushDetails[0].itemCode |
|
|
|
this.propsData.locationCode = this.propsData.noteAndBackFlushDetails[0].locationCode |
|
|
|
this.propsData.qty = this.propsData.noteAndBackFlushDetails[0].qty |
|
|
|
this.propsData.rawLocationCode = this.propsData.noteAndBackFlushDetails[0].rawLocationCode |
|
|
|
this.propsData.preStartTime = this.propsData.noteAndBackFlushDetails[0].preStartTime |
|
|
|
this.propsData.workHour = this.propsData.noteAndBackFlushDetails[0].workHour |
|
|
|
} |
|
|
|
this.inlineDialogCallback() |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
this.Loading.DrawerLoading = false |
|
|
|
}) |
|
|
|
detailsDataPush(data){ |
|
|
|
console.log(data) |
|
|
|
}, |
|
|
|
detailsClear(data){ |
|
|
|
console.log(data) |
|
|
|
}, |
|
|
|
//导出存储-新 |
|
|
|
blob(res, fileName) { |
|
|
|
let blob = new Blob([res], { |
|
|
|
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8', |
|
|
|
}) |
|
|
|
const href = URL.createObjectURL(blob) //创建新的URL表示指定的blob对象 |
|
|
|
const a = document.createElement('a') //创建a标签 |
|
|
|
a.style.display = 'none' |
|
|
|
a.href = href // 指定下载链接 |
|
|
|
a.download = fileName //指定下载文件名 |
|
|
|
a.click() //触发下载 |
|
|
|
URL.revokeObjectURL(a.href) //释放URL对象 |
|
|
|
}, |
|
|
|
// 成功后按钮操作 |
|
|
|
downloadReport(){ |
|
|
|
// 下载 |
|
|
|
// todo:下载获取接口 |
|
|
|
console.log(241) |
|
|
|
// this.blob(res, menuName + '报告') |
|
|
|
}, |
|
|
|
stepsSubmit (val) { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
resolve() |
|
|
|
// todo:提交 |
|
|
|
// postUpdate(this.CreateFormData, this.propsData.id, this.URL).then(res => { |
|
|
|
// this.propsData = res |
|
|
|
// resolve(); |
|
|
|
// }).catch(err => { |
|
|
|
// reject(); |
|
|
|
// }) |
|
|
|
}); |
|
|
|
}, |
|
|
|
stepsCloseHandle(data){ |
|
|
|
// todo:关闭详情弹窗 |
|
|
|
this.displayDialog.detailsDialog = false |
|
|
|
this.stepsClose(data) |
|
|
|
}, |
|
|
|
PalletlFunction (val) { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
if(val == 0){ |
|
|
|
console.log(this.CreateFormData.qty) |
|
|
|
// todo:1、获取接口生成bom列表 |
|
|
|
this.CreateFormData.details = [{ |
|
|
|
partCode:"CS20231220001D", |
|
|
|
qty:2, |
|
|
|
locationCode:'WZSX' |
|
|
|
}] |
|
|
|
// todo:2、details的qty是否要乘以主表的qty值 |
|
|
|
resolve(); |
|
|
|
} |
|
|
|
// 提交 |
|
|
|
if(val == 1){ |
|
|
|
resolve() |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
} |
|
|
|
}; |
|
|
|