Browse Source

解决添加明细,SearchTable回调问题

master_hella_20240701
yufei0306 6 months ago
parent
commit
9327c1e5ba
  1. 3
      src/views/wms/deliversettlementManage/deliver/deliverRequestMain/index.vue
  2. 2
      src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/index.vue
  3. 2
      src/views/wms/deliversettlementManage/stockup/stockupMainRequest/index.vue
  4. 4
      src/views/wms/productionManage/productputaway/productputawayRequestMain/index.vue
  5. 10
      src/views/wms/productionManage/productputaway/productputawayRequestMain/productputawayRequestMain.data.ts
  6. 2
      src/views/wms/productionManage/productredress/productredressRequestMain/index.vue
  7. 47
      src/views/wms/productionManage/productredress/productredressRequestMain/productredressRequestMain.data.ts
  8. 40
      src/views/wms/purchasereceiptManage/sparereceipt/sparereceiptRequestMain/index.vue
  9. 9
      src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue
  10. 1
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverBasicForm.vue
  11. 2
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts
  12. 1
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue

3
src/views/wms/deliversettlementManage/deliver/deliverRequestMain/index.vue

@ -123,9 +123,8 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
DeliverRequestDetail.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
console.log('tableData.value',tableData.value)
val.forEach(item=>{
if(tableData.value.find(item1=>item1['id'] == item['id'])) return
if(tableData.value.find(item1=>item1['itemCode'] == item['itemCode'])) return
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item}))
newRow['uom'] = item['customerUom']
tableData.value.push(newRow)

2
src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/index.vue

@ -127,7 +127,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
if (type == 'tableForm') {
if(formField == 'itemCode') {
val.forEach(item=>{
if(tableData.value.find(item1=>item1['id'] == item['id'])) return
if(tableData.value.find(item1=>item1['itemCode'] == item['itemCode'])) return
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item}))
newRow['uom'] = item['customerUom']
tableData.value.push(newRow)

2
src/views/wms/deliversettlementManage/stockup/stockupMainRequest/index.vue

@ -127,7 +127,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
// }
if(formField == 'itemCode') {
val.forEach(item=>{
if(tableData.value.find(item1=>item1['id'] == item['id'])) return
if(tableData.value.find(item1=>item1['itemCode'] == item['code'])) return
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item}))
newRow['uom'] = item['uom']
newRow['itemCode'] = item['code']

4
src/views/wms/productionManage/productputaway/productputawayRequestMain/index.vue

@ -108,11 +108,11 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
nextTick(() => {
if (type == 'tableForm') {
//
if(tableData.value.find(item1=>item1['id'] == item['id'])) return
val.forEach(item=>{
if(tableData.value.find(item1=>item1['itemCode'] == item['itemCode']&&item1['batch'] == item['batch']&&item1['packingNumber'] == item['packingNumber']&&item1['fromLocationCode'] == item['locationCode']&&item1['inventoryStatus'] == item['inventoryStatus'])) return
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item}))
newRow[formField] = item[searchField]
newRow['poLine'] = item['itemCode']
newRow['itemCode'] = item['itemCode']
newRow['packingNumber'] = item['packingNumber']
newRow['containerNumber'] = item['containerNumber']
newRow['batch'] = item['batch']

10
src/views/wms/productionManage/productputaway/productputawayRequestMain/productputawayRequestMain.data.ts

@ -462,7 +462,7 @@ export const ProductputawayRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '库存余额信息', // 查询弹窗标题
searchAllSchemas: Balance.allSchemas, // 查询弹窗所需类
searchPage: BalanceApi.getBalancePageByBusinessType, // 查询弹窗所需分页方法
searchPage: BalanceApi.getBalancePageByBusinessTypeByItemType, // 查询弹窗所需分页方法
searchCondition: [{
key: 'businessType',
value: businessTypeData.code,
@ -476,7 +476,7 @@ export const ProductputawayRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '库存余额信息', // 查询弹窗标题
searchAllSchemas: Balance.allSchemas, // 查询弹窗所需类
searchPage: BalanceApi.getBalancePageByBusinessType, // 查询弹窗所需分页方法
searchPage: BalanceApi.getBalancePageByBusinessTypeByItemType, // 查询弹窗所需分页方法
searchCondition: [{
key: 'businessType',
value: businessTypeData.code,
@ -533,6 +533,9 @@ export const ProductputawayRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
table: {
width: 150
},
tableForm: {
disabled: true
}
},
{
label: '包装数量',
@ -541,6 +544,9 @@ export const ProductputawayRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
table: {
width: 150
},
tableForm: {
disabled: true
}
},
{
label: '计量单位',

2
src/views/wms/productionManage/productredress/productredressRequestMain/index.vue

@ -128,8 +128,8 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
//
row[formField] = val[0][searchField]
if (formField == 'itemCode') {
if(tableData.value.find(item1=>item1['id'] == item['id'])) return
val.forEach(item=>{
if(tableData.value.find(item1=>item1['itemCode'] == item['itemCode']&&item1['batch'] == item['batch']&&item1['packingNumber'] == item['packingNumber']&&item1['toLocationCode'] == item['locationCode']&&item1['inventoryStatus'] == item['inventoryStatus'])) return
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item}))
newRow['itemCode'] = item['itemCode']
newRow['qty'] = item['qty']

47
src/views/wms/productionManage/productredress/productredressRequestMain/productredressRequestMain.data.ts

@ -309,7 +309,7 @@ export const ProductredressRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
// },
{
label: '物料代码',
label: '物料代码1',
field: 'itemCode',
sort: 'custom',
table: {
@ -317,31 +317,32 @@ export const ProductredressRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '库存余额信息', // 查询弹窗标题
searchAllSchemas: Balance.allSchemas, // 查询弹窗所需类
searchPage: BalanceApi.getBalancePageByBusinessTypeByItemType, // 查询弹窗所需分页方法
searchCondition: [{
key: 'businessType',
value: businessTypeData.code,
action: '==', // 查询拼接条件
isSearch: true, // 使用自定义拼接条件
isMainValue: false // 拼接条件必须要 false 同时不能与 isMainValue: true 同用
},{
key: 'packingNumber', // 查询列表中字段
value: '', // 指查询具体值
action: 'isNotStr', // 查询拼接条件
isSearch: true, // 使用自定义拼接条件
isMainValue: false // 拼接条件必须要 false 同时不能与 isMainValue: true 同用
}]
}
// componentProps: {
// isSearchList: true, // 开启查询弹窗
// searchListPlaceholder: '请选择物料代码', // 输入框占位文本
// searchField: 'itemCode', // 查询弹窗赋值字段
// searchTitle: '库存余额信息', // 查询弹窗标题
// searchAllSchemas: Balance.allSchemas, // 查询弹窗所需类
// searchPage: BalanceApi.getBalancePageByBusinessTypeByItemType, // 查询弹窗所需分页方法
// searchCondition: [{
// key: 'businessType',
// value: businessTypeData.code,
// action: '==', // 查询拼接条件
// isSearch: true, // 使用自定义拼接条件
// isMainValue: false // 拼接条件必须要 false 同时不能与 isMainValue: true 同用
// },{
// key: 'packingNumber', // 查询列表中字段
// value: '', // 指查询具体值
// action: 'isNotStr', // 查询拼接条件
// isSearch: true, // 使用自定义拼接条件
// isMainValue: false // 拼接条件必须要 false 同时不能与 isMainValue: true 同用
// }]
// }
},
tableForm:{
disabled: true,
multiple:true,
isInpuFocusShow: true,
// isInpuFocusShow: true,
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '库存余额信息', // 查询弹窗标题

40
src/views/wms/purchasereceiptManage/sparereceipt/sparereceiptRequestMain/index.vue

@ -112,6 +112,7 @@
<script setup lang="ts">
import dayjs from 'dayjs'
import { addDay } from '@/utils/formatTime'
import download from '@/utils/download'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import {
@ -131,7 +132,7 @@ import * as PurchaseDetailApi from '@/api/wms/purchaseDetail'
import { PurchaseDetail } from '../../supplierdeliver/purchaseMain/purchaseMain.data'
import * as ItembasicApi from '@/api/wms/itembasic'
//
//
defineOptions({ name: 'PurchasereceiptRequestMain' })
const message = useMessage() //
@ -154,7 +155,7 @@ const updataTableColumns = (val) => {
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
//console.log("formRef",formRef)
//console.log("supplierCode",formRef.value.formRef.formModel.supplierCode)
console.log("searchTableSuccess",formField, searchField, val, formRef, type, row)
nextTick(() => {
if (type == 'tableForm') {
//
@ -162,7 +163,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
if(formField == 'itemCode') {
row['itemCode'] = val[0]['code']
} else if(formField == 'poNumber') {
row['poNumber'] = val[0]['number']
updateTableData(val)
} else if(formField == 'poLine'){
//--
val.forEach(item=>{
@ -213,6 +214,25 @@ const onEnter = async (field,value)=>{
console.log(field,value)
getSearchTableData(value,true)
}
const updateTableData = (tableList)=>{
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['supplierCode'] =row['supplierCode']
//
newRow['produceDate'] = dayjs().valueOf()
newRow['arriveDate'] = dayjs().valueOf()
//
newRow['batch'] = formatDate(newRow['produceDate'],'YYYYMMDD');
newRow['defaultToLocationCode'] =row['defaultLocation']
if(!tableData.value.find((item:object)=>item.poNumber == newRow.poNumber&&item.itemCode == newRow.itemCode&&item.poLine == newRow.poLine&&item.batch == newRow.batch)){
tableData.value.push(newRow)
}
})
}
const getSearchTableData = async (number,isEnter=false)=>{
const {tableObject ,tableMethods} = useTable({
defaultParams:{number},
@ -226,22 +246,10 @@ const getSearchTableData = async (number,isEnter=false)=>{
item.width = item.table?.width || 150
})
tableData.value = []
updateTableData(tableObject.tableList)
const itemCodes = []
tableObject.tableList.forEach(row=>{
itemCodes.push(row['itemCode'])
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['supplierCode'] =row['supplierCode']
//
newRow['produceDate'] = dayjs().valueOf()
newRow['arriveDate'] = dayjs().valueOf()
//
newRow['batch'] = formatDate(newRow['produceDate'],'YYYYMMDD');
newRow['defaultToLocationCode'] =row['defaultLocation']
tableData.value.push(newRow)
if(isEnter){
//--
const setV = {}

9
src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue

@ -117,8 +117,15 @@
newRow['orderQty'] = item['orderQty']
newRow['planQty'] = item['orderQty']-item['plannedQty']
newRow['available'] = item['available']
console.log('tableData.value',tableData.value)
console.log('item',item)
if(!tableData.value.find(tableItem=>tableItem['itemCode']==item['itemCode']&&tableItem['poNumber']==item['number']&&tableItem['poLine']==item['lineNumber'])){
tableData.value.push(newRow)
}
}else{
tableData.value.push(newRow)
}
tableData.value.push(newRow)
})
} else {
const setV = {}

1
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverBasicForm.vue

@ -173,7 +173,6 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
//--
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']

2
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts

@ -298,7 +298,7 @@ export const SupplierdeliverRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
label: '申请时间',
field: 'requestTime',
formatter: dateFormatter,
detaul: {
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',

1
src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue

@ -204,6 +204,7 @@
if (type == 'tableForm') {
//
val.forEach(item=>{
if(tableData.value.find(item1=>item1['poNumber'] == item['poNumber']&&item1['poLine'] == item['poLine'])) return
const newRow = {...row}
newRow[formField] = item[searchField]
if (formField == 'poLine') {

Loading…
Cancel
Save