|
|
@ -56,6 +56,7 @@ |
|
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
|
@submitForm="submitForm" |
|
|
|
@formFormDateChange="formFormDateChange" |
|
|
|
@onEnter="onEnter" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 详情 --> |
|
|
@ -115,6 +116,8 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import { formatDate } from '@/utils/formatTime' |
|
|
|
import * as SupplieritemApi from '@/api/wms/supplieritem' |
|
|
|
import { getAccessToken } from '@/utils/auth' |
|
|
|
import * as PurchaseDetailApi from '@/api/wms/purchaseDetail' |
|
|
|
import { PurchaseDetail } from '../../supplierdeliver/purchaseMain/purchaseMain.data' |
|
|
|
|
|
|
|
// 采购收货申请 |
|
|
|
defineOptions({ name: 'PurchasereceiptRequestMain' }) |
|
|
@ -147,17 +150,23 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
|
} else if(formField == 'poNumber') { |
|
|
|
row['poNumber'] = val[0]['number'] |
|
|
|
} else if(formField == 'poLine'){ |
|
|
|
row['poLine'] = val[0]['lineNumber'] |
|
|
|
row['itemCode'] = val[0]['itemCode'] |
|
|
|
row['uom'] = val[0]['uom'] |
|
|
|
let supplierCode = formRef.formModel.supplierCode; |
|
|
|
let itemCode = val[0]['itemCode'] |
|
|
|
let queryData = { |
|
|
|
supplierCode:supplierCode, |
|
|
|
itemCode:itemCode |
|
|
|
} |
|
|
|
SupplieritemApi.getDefaultLocationCode(queryData as SupplieritemApi.SupplieritemVO).then(res =>{ |
|
|
|
row['defaultToLocationCode'] = res |
|
|
|
//添加费用明细--点击确定 |
|
|
|
val.forEach(item=>{ |
|
|
|
if(tableData.value.find(item1=>item1['id'] == item['id'])) return |
|
|
|
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...row})) |
|
|
|
newRow['poLine'] = item['lineNumber'] |
|
|
|
newRow['itemCode'] = item['itemCode'] |
|
|
|
newRow['uom'] = item['uom'] |
|
|
|
newRow['poNumber'] = item['number'] |
|
|
|
let supplierCode = formRef.formModel.supplierCode; |
|
|
|
let queryData = { |
|
|
|
supplierCode:supplierCode, |
|
|
|
itemCode: item['itemCode'] |
|
|
|
} |
|
|
|
SupplieritemApi.getDefaultLocationCode(queryData as SupplieritemApi.SupplieritemVO).then(res =>{ |
|
|
|
newRow['defaultToLocationCode'] = res |
|
|
|
tableData.value.push(newRow) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}else if (formField == 'packQty'){ |
|
|
|
row['packQty'] = val[0]['packQty'] |
|
|
@ -165,12 +174,59 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
|
} |
|
|
|
} else { |
|
|
|
const setV = {} |
|
|
|
if(formField == 'supplierCode'){ |
|
|
|
setV['supplierCode'] = val[0]['code'] |
|
|
|
}else if(formField == 'ppNumber') { |
|
|
|
//新增--采购订单-- |
|
|
|
setV['supplierCode'] = val[0]['supplierCode'] |
|
|
|
setV['poNumber'] = val[0]['number'] |
|
|
|
const newRow = val[0] |
|
|
|
newRow['poNumber'] = val[0]['number'] |
|
|
|
// 请求明细数据 |
|
|
|
getSearchTableData(val[0]['number']) |
|
|
|
// tableData.value = [newRow] |
|
|
|
// formRef.handleAddTable() |
|
|
|
} |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
setV['supplierCode'] = val[0]['code'] |
|
|
|
formRef.setValues(setV) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
const onEnter = async (field,value)=>{ |
|
|
|
console.log(field,value) |
|
|
|
getSearchTableData(value,true) |
|
|
|
} |
|
|
|
const getSearchTableData = async (number,isEnter=false)=>{ |
|
|
|
const {tableObject ,tableMethods} = useTable({ |
|
|
|
defaultParams:{number}, |
|
|
|
getListApi: PurchaseDetailApi.getPurchaseDetailPage // 分页接口 |
|
|
|
}) |
|
|
|
// 获得表格的各种操作 |
|
|
|
const { getList:getList1 } = tableMethods |
|
|
|
await getList1() |
|
|
|
const tableColumns = PurchaseDetail.allSchemas.tableFormColumns |
|
|
|
tableColumns.forEach((item) => { |
|
|
|
item.width = item.table?.width || 150 |
|
|
|
}) |
|
|
|
tableData.value = [] |
|
|
|
tableObject.tableList.forEach(row=>{ |
|
|
|
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...row})) |
|
|
|
newRow['poLine'] = row['lineNumber'] |
|
|
|
newRow['itemCode'] = row['itemCode'] |
|
|
|
newRow['uom'] = row['uom'] |
|
|
|
newRow['poNumber'] =row['number'] |
|
|
|
newRow['defaultToLocationCode'] =row['defaultLocation'] |
|
|
|
tableData.value.push(newRow) |
|
|
|
if(isEnter){ |
|
|
|
//回车--供应商代码 |
|
|
|
const setV = {} |
|
|
|
setV['poNumber'] = number |
|
|
|
setV['supplierCode'] = row.supplierCode |
|
|
|
formRef.value.formRef.setValues(setV) |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
// 查询页面返回——详情 |
|
|
|
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { |
|
|
|
nextTick(() => { |
|
|
@ -275,25 +331,25 @@ const butttondata = (row) => { |
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'mainClose') { // 关闭 |
|
|
|
handleClose(row.id) |
|
|
|
handleClose(row.masterId) |
|
|
|
} else if (val == 'mainReAdd') { // 重新添加 |
|
|
|
handleReAdd(row.id) |
|
|
|
handleReAdd(row.masterId) |
|
|
|
} else if (val == 'mainSubmit') { // 提交审批 |
|
|
|
handleSubmit(row.id) |
|
|
|
handleSubmit(row.masterId) |
|
|
|
} else if (val == 'mainTurnDown') { // 驳回 |
|
|
|
handleRefused(row.id) |
|
|
|
handleRefused(row.masterId) |
|
|
|
} else if (val == 'mainApprove') { // 审批通过 |
|
|
|
handleAgree(row.id) |
|
|
|
handleAgree(row.masterId) |
|
|
|
} else if (val == 'mainHandle') { // 处理 |
|
|
|
handleHandle(row.id) |
|
|
|
handleHandle(row.masterId) |
|
|
|
} else if (val == 'edit') { // 编辑 |
|
|
|
openForm('update', row) |
|
|
|
} else if(val == 'ssbq'){ // 生成标签 |
|
|
|
// 生成标签 |
|
|
|
detatableData.params = { |
|
|
|
masterId:row.id |
|
|
|
masterId:row.masterId |
|
|
|
} |
|
|
|
genLabelId.value = row.id |
|
|
|
genLabelId.value = row.masterId |
|
|
|
await getDetailList() |
|
|
|
formLabelRef.value.open('create', row, null,'createLabel')//创建标签页面 createLabel 标题 |
|
|
|
}else if (val == 'point') { |
|
|
|