|
|
@ -46,7 +46,7 @@ |
|
|
|
<BasicForm |
|
|
|
ref="formRef" |
|
|
|
:isOpenSearchTable="true" |
|
|
|
:indexTableColumn="3" |
|
|
|
:indexTableColumn="0" |
|
|
|
@success="getList" |
|
|
|
:rules="SupplierdeliverRequestMainRules" |
|
|
|
:formAllSchemas="SupplierdeliverRequestMain.allSchemas" |
|
|
@ -61,7 +61,15 @@ |
|
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
|
@submitForm="submitForm" |
|
|
|
@formFormDateChange="formFormDateChange" |
|
|
|
/> |
|
|
|
> |
|
|
|
<template v-slot="{row}"> |
|
|
|
<el-date-picker v-bind:modelValue="row['expireTime']?addDay(row['produceDate'],row['expireTime']).format('YYYY-MM-DD'):'2099-12-31'" |
|
|
|
:clearable="true" |
|
|
|
style="width: 100%" |
|
|
|
:disabled="true" |
|
|
|
placeholder="选择日期"/> |
|
|
|
</template> |
|
|
|
</BasicForm> |
|
|
|
|
|
|
|
<!-- 详情 --> |
|
|
|
<Detail |
|
|
@ -120,6 +128,7 @@ |
|
|
|
import download from '@/utils/download' |
|
|
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' |
|
|
|
import { getAccessToken } from '@/utils/auth' |
|
|
|
import { formatDate } from '@/utils/formatTime' |
|
|
|
import { |
|
|
|
SupplierdeliverRequestMain, |
|
|
|
SupplierdeliverRequestMainRules, |
|
|
@ -131,7 +140,10 @@ import { |
|
|
|
import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain' |
|
|
|
import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverRequestDetail' |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import { formatDate } from '@/utils/formatTime' |
|
|
|
import * as PurchasePlanDetailApi from '@/api/wms/purchasePlanDetail' |
|
|
|
import * as ItembasicApi from '@/api/wms/itembasic' |
|
|
|
import { PurchasePlanDetail } from '../purchasePlanMain/purchasePlanMain.data' |
|
|
|
import { addDay } from '@/utils/formatTime' |
|
|
|
|
|
|
|
// 供应商发货申请 |
|
|
|
defineOptions({ name: 'SupplierdeliverRequestMain' }) |
|
|
@ -155,6 +167,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => |
|
|
|
nextTick(() => { |
|
|
|
console.log("type:",type) |
|
|
|
console.log("formField:",formField) |
|
|
|
console.log(formField, searchField, val, formRef, type, row) |
|
|
|
if (type == 'tableForm') { |
|
|
|
// 明细查询页赋值 |
|
|
|
// row[formField] = val[0][searchField] |
|
|
@ -165,7 +178,10 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => |
|
|
|
// row['orderQty'] = val[0]['orderQty'] |
|
|
|
// row['uom'] = val[0]['uom'] |
|
|
|
// } |
|
|
|
//添加费用明细--点击确定 |
|
|
|
const itemCodes = [] |
|
|
|
val.forEach(item=>{ |
|
|
|
if(tableData.value.find(item1=>item1['id'] == item['id'])) return |
|
|
|
const newRow = {...row} |
|
|
|
newRow[formField] = item[searchField] |
|
|
|
newRow['poNumber'] = item['poNumber'] |
|
|
@ -173,12 +189,25 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => |
|
|
|
newRow['poLine'] = item['poLine'] |
|
|
|
newRow['orderQty'] = item['orderQty'] |
|
|
|
newRow['uom'] = item['uom'] |
|
|
|
itemCodes.push(item['itemCode']) |
|
|
|
tableData.value.push(newRow) |
|
|
|
}) |
|
|
|
//有效期 |
|
|
|
ItembasicApi.getItembasicPage({ |
|
|
|
code:itemCodes.join(',') |
|
|
|
}).then((res)=>{ |
|
|
|
res.list.forEach((item,index)=>{ |
|
|
|
const findItem = tableData.value.find(item1=>item1['itemCode']==item['code']) |
|
|
|
findItem['expireTime'] = findItem['expireTime'] |
|
|
|
}) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
const setV = {} |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
if(formField == 'ppNumber'){ |
|
|
|
//新增--选择完要货计划,自动展示明细 |
|
|
|
getSearchTableData(val[0]['number'],formField,searchField) |
|
|
|
|
|
|
|
// 设置计划到货时间 |
|
|
|
let beginTime = val[0]['endTime'] |
|
|
|
let deliveryDate = formatDate(val[0]['deliveryDate'],'YYYY-MM-DD') |
|
|
@ -196,6 +225,43 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
const getSearchTableData = async (number,formField,searchField)=>{ |
|
|
|
const {tableObject ,tableMethods} = useTable({ |
|
|
|
defaultParams:{number}, |
|
|
|
getListApi: PurchasePlanDetailApi.getPurchasePlanDetailPage // 分页接口 |
|
|
|
}) |
|
|
|
// 获得表格的各种操作 |
|
|
|
const { getList:getList1 } = tableMethods |
|
|
|
await getList1() |
|
|
|
const tableColumns = PurchasePlanDetail.allSchemas.tableFormColumns |
|
|
|
tableColumns.forEach((item) => { |
|
|
|
item.width = item.table?.width || 150 |
|
|
|
}) |
|
|
|
tableData.value = [] |
|
|
|
const itemCodes = [] |
|
|
|
tableObject.tableList.forEach(row=>{ |
|
|
|
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...row})) |
|
|
|
newRow[formField] = row[searchField] |
|
|
|
newRow['poNumber'] = row['poNumber'] |
|
|
|
newRow['itemCode'] = row['itemCode'] |
|
|
|
newRow['poLine'] = row['poLine'] |
|
|
|
newRow['orderQty'] = row['orderQty'] |
|
|
|
newRow['uom'] = row['uom'] |
|
|
|
tableData.value.push(newRow) |
|
|
|
itemCodes.push(row['itemCode']) |
|
|
|
}) |
|
|
|
|
|
|
|
//有效期 |
|
|
|
ItembasicApi.getItembasicPage({ |
|
|
|
code:itemCodes.join(',') |
|
|
|
}).then((res)=>{ |
|
|
|
res.list.forEach((item,index)=>{ |
|
|
|
const findItem = tableData.value.find(item1=>item1['itemCode']==item['code']) |
|
|
|
findItem['expireTime'] = findItem['expireTime'] |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
// 查询页面返回——详情 |
|
|
|
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|
|
|
nextTick(() => { |
|
|
@ -232,6 +298,8 @@ const searchTableSuccessLabel = (formField, searchField, val, formRef, type, row |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
|
getListApi: SupplierdeliverRequestMainApi.getSupplierdeliverRequestMainPage // 分页接口 |
|
|
|
}) |
|
|
|