|
|
@ -73,17 +73,26 @@ |
|
|
|
@onChange="onChangeForm" |
|
|
|
> |
|
|
|
<template #hahaha> |
|
|
|
<div> |
|
|
|
<el-button style="margin-left:90px" type="primary">选择收货单明细</el-button> |
|
|
|
</div> |
|
|
|
<el-button style="margin-left:90px;width:100%" type="primary" @click="chooseReceiptList">选择收货单明细</el-button> |
|
|
|
|
|
|
|
</template> |
|
|
|
<template #hehehe> |
|
|
|
<div></div> |
|
|
|
</template> |
|
|
|
</BasicForm> |
|
|
|
<!-- 添加明细:采购收货记录单号 --> |
|
|
|
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess1" /> |
|
|
|
|
|
|
|
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess1" > |
|
|
|
<template #searchQueryhahaha> |
|
|
|
<el-form :inline="true"> |
|
|
|
<el-form-item label="供应商"> |
|
|
|
<el-input v-model="formRef.formRef.formModel.supplierName" placeholder="请输入供应商" disabled></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="物料号"> |
|
|
|
<el-input v-model="formRef.formRef.formModel.itemCode" placeholder="请输入物料号" disabled></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</template> |
|
|
|
</SearchTable> |
|
|
|
<!-- 详情 --> |
|
|
|
<Detail |
|
|
|
ref="detailRef" |
|
|
@ -115,7 +124,7 @@ |
|
|
|
@searchTableSuccess="searchTableSuccessLabel" |
|
|
|
/> |
|
|
|
<!-- 标签打印 --> |
|
|
|
<SearchTable style="width: 905px" ref="showLabelRef" @searchTableSuccess="showLabelSuccess" /> |
|
|
|
<SearchTable style="width: 905px" ref="showLabelRef" @searchTableSuccess="showLabelSuccess"/> |
|
|
|
<!-- 导入 --> |
|
|
|
<ImportForm |
|
|
|
ref="importFormRef" |
|
|
@ -150,6 +159,8 @@ import * as BalanceApi from '@/api/wms/balance' |
|
|
|
import { async } from '@antv/x6/lib/registry/marker/async' |
|
|
|
import { getJmreportBaseUrl } from '@/utils/systemParam' |
|
|
|
import { formatDate } from '@/utils/formatTime' |
|
|
|
import * as ItembasicApi from '@/api/wms/itembasic' |
|
|
|
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data' |
|
|
|
// 采购退货申请 |
|
|
|
defineOptions({ name: 'PurchasereturnRequestMainNew' }) |
|
|
|
|
|
|
@ -170,12 +181,15 @@ const isShowButton = ref(true) |
|
|
|
const updataTableColumns = (val) => { |
|
|
|
tableColumns.value = val |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const onChangeForm = (field, cur, formRef)=>{ |
|
|
|
console.log('onChangeForm',field, cur, formRef) |
|
|
|
console.log('1111') |
|
|
|
console.log(PurchasereturnRequestMain.allSchemas) |
|
|
|
PurchasereturnRequestMain.allSchemas.formSchema.forEach(item=>{ |
|
|
|
if(item.field == field){ |
|
|
|
// 物料名称赋值 |
|
|
|
let setV = {} |
|
|
|
setV['supplierName'] = item.componentProps.options?.find(el=>el.id==cur)['nickname'] |
|
|
|
formRef.value.setValues(setV) |
|
|
@ -185,25 +199,7 @@ const onChangeForm = (field, cur, formRef)=>{ |
|
|
|
} |
|
|
|
const onEnter = async (field, value) => { |
|
|
|
console.log(field, value) |
|
|
|
if ('supplierCode' == field) { |
|
|
|
//供应商代码 |
|
|
|
formRef.value.opensearchTable( |
|
|
|
'purchaseReceiptRecordNumber', |
|
|
|
'number', |
|
|
|
'采购收货记录', |
|
|
|
PurchasereceiptRecordMain1.allSchemas, |
|
|
|
PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageReturn, |
|
|
|
[ |
|
|
|
{ |
|
|
|
key: 'supplierCode', |
|
|
|
value: 'supplierCode', |
|
|
|
isMainValue: true |
|
|
|
} |
|
|
|
] |
|
|
|
) |
|
|
|
} else if ('purchaseReceiptRecordNumber' == field) { |
|
|
|
//采购收货记录 |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 生成标签 |
|
|
@ -256,87 +252,12 @@ const searchTableSuccess = async (formField, searchField, val, formRef, type, ro |
|
|
|
nextTick(async () => { |
|
|
|
if (type == 'tableForm') { |
|
|
|
// 明细查询页赋值 |
|
|
|
|
|
|
|
if (formField == 'asnNumber') { |
|
|
|
row[formField] = val[0][searchField] |
|
|
|
//搜索记录单号--回显数据 |
|
|
|
row['purchaseReceiptRecordNumber'] = val[0]['number'] |
|
|
|
row['asnNumber'] = val[0]['asnNumber'] |
|
|
|
row['supplierCode'] = val[0]['supplierCode'] |
|
|
|
row['poNumber'] = val[0]['poNumber'] |
|
|
|
row['poLine'] = val[0]['poLine'] |
|
|
|
row['itemCode'] = val[0]['itemCode'] |
|
|
|
row['itemName'] = val[0]['itemName'] |
|
|
|
row['itemDesc1'] = val[0]['itemDesc1'] |
|
|
|
row['itemDesc2'] = val[0]['itemDesc2'] |
|
|
|
row['batch'] = val[0]['batch'] |
|
|
|
row['altBatch'] = val[0]['altBatch'] |
|
|
|
row['containerNumber'] = val[0]['containerNumber'] |
|
|
|
row['qty'] = val[0]['qty'] |
|
|
|
row['uom'] = val[0]['uom'] |
|
|
|
row['supplierQty'] = val[0]['supplierQty'] |
|
|
|
row['supplierUom'] = val[0]['supplierUom'] |
|
|
|
row['inventoryStatus'] = val[0]['inventoryStatus'] |
|
|
|
// row['fromLocationCode'] = val[0]['toLocationCode'] |
|
|
|
row['toLocationCode'] = val[0]['toLocationCode'] |
|
|
|
row['fromLocationGroupCode'] = val[0]['locationGroupCode'] |
|
|
|
row['toLocationGroupCode'] = null |
|
|
|
row['toWarehouseCode'] = null |
|
|
|
row['toAreaTypes'] = null |
|
|
|
row['fromAreaCode'] = val[0]['areaCode'] |
|
|
|
row['toAreaCode'] = val[0]['toAreaCode'] |
|
|
|
row['fromQwnerCode'] = val[0]['fromQwnerCode'] |
|
|
|
row['toOwnerCode'] = val[0]['toOwnerCode'] |
|
|
|
row['arriveDate'] = val[0]['arriveDate'] |
|
|
|
row['produceDate'] = val[0]['produceDate'] |
|
|
|
row['expireDate'] = val[0]['expireDate'] |
|
|
|
row['convertRate'] = val[0]['convertRate'] |
|
|
|
row['visualInspectResult'] = val[0]['visualInspectResult'] |
|
|
|
row['visualInspectPhotos'] = val[0]['visualInspectPhotos'] |
|
|
|
row['failedReason'] = val[0]['failedReason'] |
|
|
|
row['singlePrice'] = val[0]['singlePrice'] |
|
|
|
row['amount'] = val[0]['amount'] |
|
|
|
row['projectCode'] = val[0]['projectCode'] |
|
|
|
} else if (formField == 'itemCode') { |
|
|
|
row[formField] = val[0][searchField] |
|
|
|
row['batch'] = val[0]['toBatch'] |
|
|
|
row['containerNumber'] = val[0]['toContainerNumber'] |
|
|
|
row['containerNumber'] = val[0]['containerNumber'] |
|
|
|
row['containerNumber'] = val[0]['containerNumber'] |
|
|
|
// row['fromLocationCode'] = val[0]['fromLocationCode'] |
|
|
|
row['toLocationCode'] = val[0]['toLocationCode'] |
|
|
|
} else if (formField == 'fromLocationCode') { |
|
|
|
row[formField] = val[0][searchField] |
|
|
|
// let params = { |
|
|
|
// itemCode: row.itemCode, |
|
|
|
// batch: row.batch, |
|
|
|
// locationCode:val[0]['code'] |
|
|
|
// } |
|
|
|
// let aa = await BalanceApi.getSumByConditions(params); |
|
|
|
// console.log('23423423',aa); |
|
|
|
// row['inventoryBalance'] = aa//库存余额 |
|
|
|
} else if (formField == 'packingNumber') { |
|
|
|
// row[formField] = val[0][searchField] |
|
|
|
val.forEach((item,index)=>{ |
|
|
|
if(index==0){ |
|
|
|
row[formField] = item[searchField] |
|
|
|
row['inventoryBalance'] = item['qty'] //库存余额 |
|
|
|
}else{ |
|
|
|
let newRow = {...row} |
|
|
|
newRow[formField] = item[searchField] |
|
|
|
row['inventoryBalance'] = item['qty'] //库存余额 |
|
|
|
tableData.value.push(newRow) |
|
|
|
} |
|
|
|
}) |
|
|
|
row['fromLocationCode'] = val[0]['locationCode'] |
|
|
|
row['batch'] = val[0]['batch'] |
|
|
|
// row['inventoryBalance'] = val[0]['qty'] //库存余额 |
|
|
|
}else{ |
|
|
|
row[formField] = val[0][searchField] |
|
|
|
} |
|
|
|
row[formField] = val[0][searchField] |
|
|
|
} else { |
|
|
|
const setV = {} |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
if(formField=='itemCode'){ |
|
|
|
// 更换查询 供应商下拉框数据 |
|
|
|
PurchasereturnRequestMain.allSchemas.formSchema.forEach(item=>{ |
|
|
|
if(item.field == 'supplierCode1'){ |
|
|
|
item.componentProps.options = [ |
|
|
@ -357,63 +278,8 @@ const searchTableSuccess = async (formField, searchField, val, formRef, type, ro |
|
|
|
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|
|
|
nextTick(() => { |
|
|
|
const setV = {} |
|
|
|
if (formField == 'poLine' || formField == 'itemCode') { |
|
|
|
console.log(val) |
|
|
|
setV['poLine'] = val[0]['poLine'] |
|
|
|
setV['poNumber'] = val[0]['poNumber'] |
|
|
|
setV['itemCode'] = val[0]['itemCode'] |
|
|
|
setV['itemName'] = val[0]['itemName'] |
|
|
|
setV['itemDesc1'] = val[0]['itemDesc1'] |
|
|
|
setV['itemDesc2'] = val[0]['itemDesc2'] |
|
|
|
setV['batch'] = val[0]['toBatch'] |
|
|
|
setV['altBatch'] = val[0]['altBatch'] |
|
|
|
setV['containerNumber'] = val[0]['toContainerNumber'] |
|
|
|
setV['receiptQty'] = val[0]['qty'] |
|
|
|
setV['qty'] = val[0]['qty'] |
|
|
|
setV['uom'] = val[0]['uom'] |
|
|
|
setV['supplierQty'] = val[0]['supplierQty'] |
|
|
|
setV['supplierUom'] = val[0]['supplierUom'] |
|
|
|
setV['inventoryStatus'] = val[0]['inventoryStatus'] |
|
|
|
// setV['fromLocationCode'] = val[0]['toLocationCode'] |
|
|
|
// setV['toLocationCode'] = val[0]['toLocationCode'] |
|
|
|
setV['fromLocationGroupCode'] = val[0]['locationGroupCode'] |
|
|
|
setV['toLocationGroupCode'] = null |
|
|
|
setV['toWarehouseCode'] = null |
|
|
|
setV['toAreaTypes'] = null |
|
|
|
setV['fromAreaCode'] = val[0]['areaCode'] |
|
|
|
setV['toAreaCode'] = val[0]['toAreaCode'] |
|
|
|
setV['fromQwnerCode'] = val[0]['fromQwnerCode'] |
|
|
|
setV['toOwnerCode'] = val[0]['toOwnerCode'] |
|
|
|
setV['arriveDate'] = val[0]['arriveDate'] |
|
|
|
setV['produceDate'] = val[0]['produceDate'] |
|
|
|
setV['expireDate'] = val[0]['expireDate'] |
|
|
|
setV['convertRate'] = val[0]['convertRate'] |
|
|
|
setV['visualInspectResult'] = val[0]['visualInspectResult'] |
|
|
|
setV['visualInspectPhotos'] = val[0]['visualInspectPhotos'] |
|
|
|
setV['failedReason'] = val[0]['failedReason'] |
|
|
|
setV['singlePrice'] = val[0]['singlePrice'] |
|
|
|
setV['amount'] = val[0]['amount'] |
|
|
|
setV['projectCode'] = val[0]['projectCode'] |
|
|
|
// setV['packingNumber'] = val[0]['packingNumber'] |
|
|
|
// setV['inventoryBalance'] = val[0]['qty'] |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
|
|
|
|
if (formField == 'itemCode') { |
|
|
|
setV['batch'] = val[0]['toBatch'] |
|
|
|
setV['containerNumber'] = val[0]['toContainerNumber'] |
|
|
|
setV['containerNumber'] = val[0]['containerNumber'] |
|
|
|
setV['containerNumber'] = val[0]['containerNumber'] |
|
|
|
// setV['fromLocationCode'] = val[0]['fromLocationCode'] |
|
|
|
// setV['toLocationCode'] = val[0]['toLocationCode'] |
|
|
|
} |
|
|
|
} else if (formField == 'packingNumber'){ |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
setV['inventoryBalance'] = val[0]['qty'] |
|
|
|
setV['batch'] = val[0]['batch'] |
|
|
|
setV['fromLocationCode'] = val[0]['locationCode'] |
|
|
|
} |
|
|
|
else { |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
} |
|
|
|
formRef.setValues(setV) |
|
|
|
}) |
|
|
|
} |
|
|
@ -573,30 +439,7 @@ const openForm = async (type: string, row?: number) => { |
|
|
|
originTableData.value = [] // 重置明细数据 |
|
|
|
tableData.value = [] // 重置明细数据 |
|
|
|
isShowButton.value = true |
|
|
|
if (type == 'create') { |
|
|
|
PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => { |
|
|
|
// if (item.field == 'supplierCode') { |
|
|
|
// item.componentProps.disabled = true |
|
|
|
// item.componentProps.isSearchList = true |
|
|
|
// } |
|
|
|
if (item.field == 'asnNumber') { |
|
|
|
item.componentProps.disabled = true |
|
|
|
item.componentProps.isSearchList = true |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
if (type == 'update') { |
|
|
|
PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => { |
|
|
|
// if (item.field == 'supplierCode') { |
|
|
|
// item.componentProps.disabled = true |
|
|
|
// item.componentProps.isSearchList = false |
|
|
|
// } |
|
|
|
if (item.field == 'asnNumber') { |
|
|
|
item.componentProps.disabled = true |
|
|
|
item.componentProps.isSearchList = false |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
formRef.value.open(type, row) |
|
|
|
} |
|
|
|
|
|
|
@ -734,104 +577,46 @@ const originTableData = ref([]) |
|
|
|
const searchTableRef = ref() |
|
|
|
// 添加明细 |
|
|
|
const handleAddTable = () => { |
|
|
|
const subTableDFata = originTableData.value.filter( |
|
|
|
(item) => !tableData.value.find((item1) => item1.id == item.id) |
|
|
|
) |
|
|
|
if (subTableDFata.length == 0) { |
|
|
|
message.warning('暂无可选择数据!') |
|
|
|
|
|
|
|
} |
|
|
|
// 选择收货单明细 |
|
|
|
const chooseReceiptList = ()=>{ |
|
|
|
if(!formRef.value.formRef.formModel.itemCode){ |
|
|
|
message.error('请选择物料代码') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
const tableObject = { |
|
|
|
// 当前页 |
|
|
|
currentPage: 1, |
|
|
|
// 导出加载中 |
|
|
|
exportLoading: false, |
|
|
|
// 加载中 |
|
|
|
loading: false, |
|
|
|
// 页数 |
|
|
|
pageSize: subTableDFata.length, |
|
|
|
params: null, |
|
|
|
// 排序 |
|
|
|
sort: { |
|
|
|
order: '', // 排序规则 |
|
|
|
prop: '' // 排序字段 |
|
|
|
}, |
|
|
|
// 总条数 |
|
|
|
total: subTableDFata.length, |
|
|
|
// 表格数据 |
|
|
|
tableList: subTableDFata, |
|
|
|
currentRow: null |
|
|
|
if(!formRef.value.formRef.formModel.supplierName){ |
|
|
|
message.error('请选择供应商') |
|
|
|
return |
|
|
|
} |
|
|
|
searchTableRef.value.open( |
|
|
|
"收货单明细", |
|
|
|
Itembasic.allSchemas, |
|
|
|
ItembasicApi.getItembasicPage, |
|
|
|
"hahaha", |
|
|
|
"hahaha", |
|
|
|
false, |
|
|
|
'tableForm', |
|
|
|
null, |
|
|
|
[{ |
|
|
|
key: 'available', |
|
|
|
value: 'TRUE', |
|
|
|
action: '==', |
|
|
|
isSearch: true, |
|
|
|
isMainValue: false |
|
|
|
}], |
|
|
|
undefined, |
|
|
|
false, |
|
|
|
null |
|
|
|
) |
|
|
|
|
|
|
|
const tableColumns = PurchasereturnRequestDetail.allSchemas.tableFormColumns |
|
|
|
tableColumns.forEach((item) => { |
|
|
|
item.width = item.table?.width || 150 |
|
|
|
}) |
|
|
|
|
|
|
|
searchTableRef.value.openData('采购收货记录单号', tableObject, { tableColumns }, true) |
|
|
|
// searchTableRef.value.open( |
|
|
|
// ('供应商信息', |
|
|
|
// // _searchTableAllSchemas, |
|
|
|
// // _searchTablePage, // 接口 |
|
|
|
// // formField, |
|
|
|
// // searchField, |
|
|
|
// true,//是否多选 |
|
|
|
// // type, |
|
|
|
// // row, |
|
|
|
// _searchCondition |
|
|
|
// ) |
|
|
|
// ) |
|
|
|
|
|
|
|
// console.log(subTableDFata) |
|
|
|
// const {tableObject, tableMethods } = useTable({ |
|
|
|
// getListApi: getPage.value // 分页接口 |
|
|
|
// }) |
|
|
|
// searchTableRef.value.open( |
|
|
|
// ('供应商信息', |
|
|
|
// // _searchTableAllSchemas, |
|
|
|
// // _searchTablePage, // 接口 |
|
|
|
// // formField, |
|
|
|
// // searchField, |
|
|
|
// true,//是否多选 |
|
|
|
// // type, |
|
|
|
// // row, |
|
|
|
// _searchCondition |
|
|
|
// ) |
|
|
|
// ) |
|
|
|
// tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys))) |
|
|
|
// let purchaseReceiptRecordNumber = formRef.value.formRef.formModel.purchaseReceiptRecordNumber |
|
|
|
// PurchasereturnRequestDetail.allSchemas.tableFormColumns.map((item) => { |
|
|
|
// item.tableForm.disabled = true |
|
|
|
// if (item.field == 'remark') { |
|
|
|
// item.tableForm.disabled = false |
|
|
|
// } |
|
|
|
// if (item.field == 'reason') { |
|
|
|
// item.tableForm.disabled = false |
|
|
|
// } |
|
|
|
// if (item.field == 'qty') { |
|
|
|
// item.tableForm.disabled = false |
|
|
|
// } |
|
|
|
// if(purchaseReceiptRecordNumber == ''){ |
|
|
|
// if (item.field == 'itemCode') { |
|
|
|
// item.tableForm.isInpuFocusShow = true |
|
|
|
// } |
|
|
|
// if(item.field == 'poLine'){ |
|
|
|
// item.tableForm.isInpuFocusShow = false |
|
|
|
// } |
|
|
|
// }else{ |
|
|
|
// if (item.field == 'itemCode') { |
|
|
|
// item.tableForm.isInpuFocusShow = false |
|
|
|
// } |
|
|
|
// if(item.field == 'poLine'){ |
|
|
|
// item.tableForm.isInpuFocusShow = true |
|
|
|
// } |
|
|
|
// } |
|
|
|
// }) |
|
|
|
} |
|
|
|
const searchTableSuccess1 = (formField, searchField, val, formRef, type, row) => { |
|
|
|
console.log(val) |
|
|
|
tableData.value = [...tableData.value, ...val] |
|
|
|
// 选择收货单明细 |
|
|
|
const searchTableSuccess1 = (formField, searchField, selections, type, row) => { |
|
|
|
console.log('searchTableSuccess1',formField, searchField, selections, type, row) |
|
|
|
formRef.value.formRef.setValues({ |
|
|
|
poNumber:111 |
|
|
|
}) |
|
|
|
} |
|
|
|
// 删除明细 |
|
|
|
const handleDeleteTable = (item, index, formRef) => { |
|
|
|