|
@ -46,7 +46,7 @@ |
|
|
<BasicForm |
|
|
<BasicForm |
|
|
ref="formRef" |
|
|
ref="formRef" |
|
|
:isOpenSearchTable="true" |
|
|
:isOpenSearchTable="true" |
|
|
:indexTableColumn="3" |
|
|
:indexTableColumn="0" |
|
|
@success="getList" |
|
|
@success="getList" |
|
|
:rules="SupplierdeliverRequestMainRules" |
|
|
:rules="SupplierdeliverRequestMainRules" |
|
|
:formAllSchemas="SupplierdeliverRequestMain.allSchemas" |
|
|
:formAllSchemas="SupplierdeliverRequestMain.allSchemas" |
|
@ -61,7 +61,15 @@ |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
@submitForm="submitForm" |
|
|
@submitForm="submitForm" |
|
|
@formFormDateChange="formFormDateChange" |
|
|
@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 |
|
|
<Detail |
|
@ -120,6 +128,7 @@ |
|
|
import download from '@/utils/download' |
|
|
import download from '@/utils/download' |
|
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' |
|
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' |
|
|
import { getAccessToken } from '@/utils/auth' |
|
|
import { getAccessToken } from '@/utils/auth' |
|
|
|
|
|
import { formatDate } from '@/utils/formatTime' |
|
|
import { |
|
|
import { |
|
|
SupplierdeliverRequestMain, |
|
|
SupplierdeliverRequestMain, |
|
|
SupplierdeliverRequestMainRules, |
|
|
SupplierdeliverRequestMainRules, |
|
@ -131,7 +140,10 @@ import { |
|
|
import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain' |
|
|
import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain' |
|
|
import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverRequestDetail' |
|
|
import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverRequestDetail' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
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' }) |
|
|
defineOptions({ name: 'SupplierdeliverRequestMain' }) |
|
@ -155,6 +167,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => |
|
|
nextTick(() => { |
|
|
nextTick(() => { |
|
|
console.log("type:",type) |
|
|
console.log("type:",type) |
|
|
console.log("formField:",formField) |
|
|
console.log("formField:",formField) |
|
|
|
|
|
console.log(formField, searchField, val, formRef, type, row) |
|
|
if (type == 'tableForm') { |
|
|
if (type == 'tableForm') { |
|
|
// 明细查询页赋值 |
|
|
// 明细查询页赋值 |
|
|
// row[formField] = val[0][searchField] |
|
|
// row[formField] = val[0][searchField] |
|
@ -165,7 +178,10 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => |
|
|
// row['orderQty'] = val[0]['orderQty'] |
|
|
// row['orderQty'] = val[0]['orderQty'] |
|
|
// row['uom'] = val[0]['uom'] |
|
|
// row['uom'] = val[0]['uom'] |
|
|
// } |
|
|
// } |
|
|
|
|
|
//添加费用明细--点击确定 |
|
|
|
|
|
const itemCodes = [] |
|
|
val.forEach(item=>{ |
|
|
val.forEach(item=>{ |
|
|
|
|
|
if(tableData.value.find(item1=>item1['id'] == item['id'])) return |
|
|
const newRow = {...row} |
|
|
const newRow = {...row} |
|
|
newRow[formField] = item[searchField] |
|
|
newRow[formField] = item[searchField] |
|
|
newRow['poNumber'] = item['poNumber'] |
|
|
newRow['poNumber'] = item['poNumber'] |
|
@ -173,12 +189,29 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => |
|
|
newRow['poLine'] = item['poLine'] |
|
|
newRow['poLine'] = item['poLine'] |
|
|
newRow['orderQty'] = item['orderQty'] |
|
|
newRow['orderQty'] = item['orderQty'] |
|
|
newRow['uom'] = item['uom'] |
|
|
newRow['uom'] = item['uom'] |
|
|
|
|
|
itemCodes.push(item['itemCode']) |
|
|
tableData.value.push(newRow) |
|
|
tableData.value.push(newRow) |
|
|
}) |
|
|
}) |
|
|
|
|
|
//有效期 |
|
|
|
|
|
ItembasicApi.getItembasicPage({ |
|
|
|
|
|
code:itemCodes.join(',') |
|
|
|
|
|
}).then((res)=>{ |
|
|
|
|
|
console.log('有效期',res) |
|
|
|
|
|
tableData.value.forEach((item,index)=>{ |
|
|
|
|
|
tableData.value[index]['expireTime'] = index==0?1:2 |
|
|
|
|
|
}) |
|
|
|
|
|
// res.list.forEach((item,index)=>{ |
|
|
|
|
|
// const findItem = tableData.value.find(item1=>item1['itemCode']==item['code']) |
|
|
|
|
|
// findItem['expireTime'] = findItem['expireTime'] |
|
|
|
|
|
// }) |
|
|
|
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
const setV = {} |
|
|
const setV = {} |
|
|
setV[formField] = val[0][searchField] |
|
|
setV[formField] = val[0][searchField] |
|
|
if(formField == 'ppNumber'){ |
|
|
if(formField == 'ppNumber'){ |
|
|
|
|
|
//新增--选择完要货计划,自动展示明细 |
|
|
|
|
|
getSearchTableData(val[0]['number'],formField,searchField) |
|
|
|
|
|
|
|
|
// 设置计划到货时间 |
|
|
// 设置计划到货时间 |
|
|
let beginTime = val[0]['endTime'] |
|
|
let beginTime = val[0]['endTime'] |
|
|
let deliveryDate = formatDate(val[0]['deliveryDate'],'YYYY-MM-DD') |
|
|
let deliveryDate = formatDate(val[0]['deliveryDate'],'YYYY-MM-DD') |
|
@ -196,6 +229,46 @@ 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)=>{ |
|
|
|
|
|
console.log('有效期',res) |
|
|
|
|
|
tableData.value.forEach((item,index)=>{ |
|
|
|
|
|
tableData.value[index]['expireTime'] = index==0?1:2 |
|
|
|
|
|
}) |
|
|
|
|
|
// 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) => { |
|
|
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|
|
nextTick(() => { |
|
|
nextTick(() => { |
|
@ -232,6 +305,8 @@ const searchTableSuccessLabel = (formField, searchField, val, formRef, type, row |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
getListApi: SupplierdeliverRequestMainApi.getSupplierdeliverRequestMainPage // 分页接口 |
|
|
getListApi: SupplierdeliverRequestMainApi.getSupplierdeliverRequestMainPage // 分页接口 |
|
|
}) |
|
|
}) |
|
|