|
@ -28,6 +28,8 @@ |
|
|
|
|
|
|
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
<BasicForm ref="formRef" @success="getList" |
|
|
<BasicForm ref="formRef" @success="getList" |
|
|
|
|
|
:isOpenSearchTable="true" |
|
|
|
|
|
:indexTableColumn="1" |
|
|
:rules="PurchasePlanMainRules" |
|
|
:rules="PurchasePlanMainRules" |
|
|
:formAllSchemas="PurchasePlanMain.allSchemas" |
|
|
:formAllSchemas="PurchasePlanMain.allSchemas" |
|
|
:tableAllSchemas="PurchasePlanDetail.allSchemas" |
|
|
:tableAllSchemas="PurchasePlanDetail.allSchemas" |
|
@ -72,6 +74,7 @@ |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import * as PurchaseDetailApi from '@/api/wms/purchaseDetail' |
|
|
import * as PurchaseDetailApi from '@/api/wms/purchaseDetail' |
|
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' |
|
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' |
|
|
|
|
|
import { PurchaseDetail } from '../purchaseMain/purchaseMain.data' |
|
|
|
|
|
|
|
|
// 要货计划 |
|
|
// 要货计划 |
|
|
defineOptions({ name: 'PurchasePlanMain' }) |
|
|
defineOptions({ name: 'PurchasePlanMain' }) |
|
@ -91,28 +94,39 @@ |
|
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
// 查询页面返回 |
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { |
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { |
|
|
|
|
|
console.log('searchTableSuccess', formField, searchField, val, formRef, type, row) |
|
|
nextTick(async () => { |
|
|
nextTick(async () => { |
|
|
if (type == 'tableForm') { |
|
|
if (type == 'tableForm') { |
|
|
// 明细查询页赋值 |
|
|
// 明细查询页赋值 |
|
|
row[formField] = val[0][searchField] |
|
|
val.forEach(item=>{ |
|
|
row['itemCode'] = val[0]['code'] |
|
|
if(tableData.value.find(item1=>item1['id'] == item['id'])) return |
|
|
row['poNumber'] = val[0]['number'] |
|
|
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...row})) |
|
|
row['poLine'] = val[0]['lineNumber'] |
|
|
|
|
|
|
|
|
newRow[formField] = item[searchField] |
|
|
|
|
|
newRow['itemCode'] = item['code'] |
|
|
|
|
|
newRow['poNumber'] = item['number'] |
|
|
|
|
|
newRow['poLine'] = item['lineNumber'] |
|
|
if (formField == 'poLine') { |
|
|
if (formField == 'poLine') { |
|
|
row['itemCode'] = val[0]['itemCode'] |
|
|
//添加费用明细--点击确定 |
|
|
row['uom'] = val[0]['uom'] |
|
|
newRow['itemCode'] = item['itemCode'] |
|
|
row['orderQty'] = val[0]['orderQty'] |
|
|
newRow['uom'] = item['uom'] |
|
|
row['planQty'] = val[0]['orderQty']-val[0]['plannedQty'] |
|
|
newRow['orderQty'] = item['orderQty'] |
|
|
row['available'] = val[0]['available'] |
|
|
newRow['planQty'] = item['orderQty']-item['plannedQty'] |
|
|
} |
|
|
newRow['available'] = item['available'] |
|
|
|
|
|
} |
|
|
|
|
|
tableData.value.push(newRow) |
|
|
|
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
const setV = {} |
|
|
const setV = {} |
|
|
setV[formField] = val[0][searchField] |
|
|
setV[formField] = val[0][searchField] |
|
|
setV['itemCode'] = val[0]['code'] |
|
|
setV['itemCode'] = val[0]['code'] |
|
|
setV['poNumber'] = val[0]['number'] |
|
|
setV['poNumber'] = val[0]['number'] |
|
|
setV['poLine'] = val[0]['lineNumber'] |
|
|
setV['poLine'] = val[0]['lineNumber'] |
|
|
|
|
|
|
|
|
if(formField == 'supplierCode'){ |
|
|
if(formField == 'supplierCode'){ |
|
|
setV['supplierCode'] = val[0]['code'] |
|
|
setV['supplierCode'] = val[0]['code'] |
|
|
|
|
|
setV['contacts'] = val[0]['contacts'] |
|
|
|
|
|
setV['phone'] = val[0]['phone'] |
|
|
await PurchasePlanMainApi.queryPurchasePlan(val[0]['code']).then(res => { |
|
|
await PurchasePlanMainApi.queryPurchasePlan(val[0]['code']).then(res => { |
|
|
let beginTime = res.beginTime |
|
|
let beginTime = res.beginTime |
|
|
var ms = beginTime.substring(0, 2) |
|
|
var ms = beginTime.substring(0, 2) |
|
@ -123,6 +137,7 @@ |
|
|
var me = endTime.substring(3) |
|
|
var me = endTime.substring(3) |
|
|
setV['endTime'] = new Date(2024, 1, 1, Number(ms), Number(me)) |
|
|
setV['endTime'] = new Date(2024, 1, 1, Number(ms), Number(me)) |
|
|
}) |
|
|
}) |
|
|
|
|
|
tableData.value = [] |
|
|
} |
|
|
} |
|
|
if (formField == 'poLine') { |
|
|
if (formField == 'poLine') { |
|
|
setV['itemCode'] = val[0]['itemCode'] |
|
|
setV['itemCode'] = val[0]['itemCode'] |
|
@ -132,9 +147,46 @@ |
|
|
setV['available'] = val[0]['available'] |
|
|
setV['available'] = val[0]['available'] |
|
|
} |
|
|
} |
|
|
formRef.setValues(setV) |
|
|
formRef.setValues(setV) |
|
|
|
|
|
console.log('formModel',formRef.formModel) |
|
|
|
|
|
if(formField == 'poNumber') { |
|
|
|
|
|
//新增--采购订单-- |
|
|
|
|
|
// 请求明细数据 |
|
|
|
|
|
getSearchTableData(val[0]['number'],formField,searchField) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const getSearchTableData = async (number,formField,searchField)=>{ |
|
|
|
|
|
const {tableObject ,tableMethods} = useTable({ |
|
|
|
|
|
defaultParams:{number}, |
|
|
|
|
|
getListApi: PurchaseDetailApi.getPurchaseDetailPagePoNumber // 分页接口 |
|
|
|
|
|
}) |
|
|
|
|
|
// 获得表格的各种操作 |
|
|
|
|
|
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[formField] = row[searchField] |
|
|
|
|
|
newRow['itemCode'] = row['itemCode'] |
|
|
|
|
|
newRow['poNumber'] = row['number'] |
|
|
|
|
|
newRow['poLine'] = row['lineNumber'] |
|
|
|
|
|
if (formField == 'poLine') { |
|
|
|
|
|
newRow['itemCode'] = row['itemCode'] |
|
|
|
|
|
newRow['uom'] = row['uom'] |
|
|
|
|
|
newRow['orderQty'] = row['orderQty'] |
|
|
|
|
|
newRow['planQty'] = row['orderQty']-row['plannedQty'] |
|
|
|
|
|
newRow['available'] = row['available'] |
|
|
} |
|
|
} |
|
|
|
|
|
tableData.value.push(newRow) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
// 查询页面返回——详情 |
|
|
// 查询页面返回——详情 |
|
|
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|
|
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|
|
nextTick(async () => { |
|
|
nextTick(async () => { |
|
|