Browse Source

要货计划新增

master_hella_20240701
yufei0306 8 months ago
parent
commit
fee645244e
  1. 2
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue
  2. 74
      src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue
  3. 264
      src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/purchasePlanMain.data.ts

2
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue

@ -384,7 +384,7 @@ const getSearchTableData = async (number,supplierCode)=>{
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']

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

@ -28,6 +28,8 @@
<!-- 表单弹窗添加/修改 -->
<BasicForm ref="formRef" @success="getList"
:isOpenSearchTable="true"
:indexTableColumn="1"
:rules="PurchasePlanMainRules"
:formAllSchemas="PurchasePlanMain.allSchemas"
:tableAllSchemas="PurchasePlanDetail.allSchemas"
@ -72,6 +74,7 @@
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as PurchaseDetailApi from '@/api/wms/purchaseDetail'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { PurchaseDetail } from '../purchaseMain/purchaseMain.data'
//
defineOptions({ name: 'PurchasePlanMain' })
@ -91,28 +94,39 @@
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
console.log('searchTableSuccess', formField, searchField, val, formRef, type, row)
nextTick(async () => {
if (type == 'tableForm') {
//
row[formField] = val[0][searchField]
row['itemCode'] = val[0]['code']
row['poNumber'] = val[0]['number']
row['poLine'] = val[0]['lineNumber']
if (formField == 'poLine') {
row['itemCode'] = val[0]['itemCode']
row['uom'] = val[0]['uom']
row['orderQty'] = val[0]['orderQty']
row['planQty'] = val[0]['orderQty']-val[0]['plannedQty']
row['available'] = val[0]['available']
}
val.forEach(item=>{
if(tableData.value.find(item1=>item1['id'] == item['id'])) return
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...row}))
newRow[formField] = item[searchField]
newRow['itemCode'] = item['code']
newRow['poNumber'] = item['number']
newRow['poLine'] = item['lineNumber']
if (formField == 'poLine') {
//--
newRow['itemCode'] = item['itemCode']
newRow['uom'] = item['uom']
newRow['orderQty'] = item['orderQty']
newRow['planQty'] = item['orderQty']-item['plannedQty']
newRow['available'] = item['available']
}
tableData.value.push(newRow)
})
} else {
const setV = {}
setV[formField] = val[0][searchField]
setV['itemCode'] = val[0]['code']
setV['poNumber'] = val[0]['number']
setV['poLine'] = val[0]['lineNumber']
if(formField == 'supplierCode'){
setV['supplierCode'] = val[0]['code']
setV['contacts'] = val[0]['contacts']
setV['phone'] = val[0]['phone']
await PurchasePlanMainApi.queryPurchasePlan(val[0]['code']).then(res => {
let beginTime = res.beginTime
var ms = beginTime.substring(0, 2)
@ -123,6 +137,7 @@
var me = endTime.substring(3)
setV['endTime'] = new Date(2024, 1, 1, Number(ms), Number(me))
})
tableData.value = []
}
if (formField == 'poLine') {
setV['itemCode'] = val[0]['itemCode']
@ -132,9 +147,46 @@
setV['available'] = val[0]['available']
}
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) => {
nextTick(async () => {

264
src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/purchasePlanMain.data.ts

@ -49,17 +49,17 @@ export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([
}
},
{
label: '订单',
label: '采购订单',
field: 'poNumber',
sort: 'custom',
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择订单',
searchListPlaceholder: '请选择采购订单',
searchField: 'number',
searchTitle: '采购订单信息',
searchAllSchemas: PurchaseMain.allSchemas,
@ -81,6 +81,30 @@ export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([
}
}
},
{
label: '收货人',
field: 'contacts',
table: {
width: 150
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '联系电话',
field: 'phone',
table: {
width: 150
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '送达日期',
field: 'deliveryDate',
@ -190,65 +214,65 @@ export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([
}
},
{
label: '自动发布',
field: 'autoPublish',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: "TRUE",
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '自动接收',
field: 'autoAccept',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: "TRUE",
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true
}
},
isSearch: true,
},
// {
// label: '自动发布',
// field: 'autoPublish',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string',
// isTable: true,
// sort: 'custom',
// table: {
// width: 150
// },
// form: {
// component: 'Switch',
// value: "TRUE",
// componentProps: {
// inactiveValue: 'FALSE',
// activeValue: 'TRUE'
// }
// }
// },
// {
// label: '自动接收',
// field: 'autoAccept',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string',
// isTable: true,
// sort: 'custom',
// table: {
// width: 150
// },
// form: {
// component: 'Switch',
// value: "TRUE",
// componentProps: {
// inactiveValue: 'FALSE',
// activeValue: 'TRUE'
// }
// }
// },
// {
// label: '是否可用',
// field: 'available',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string',
// isTable: true,
// sort: 'custom',
// table: {
// width: 150
// },
// form: {
// component: 'Switch',
// value: 'TRUE',
// componentProps: {
// inactiveValue: 'FALSE',
// activeValue: 'TRUE',
// disabled: true
// }
// },
// isSearch: true,
// },
{
label: '创建者',
field: 'creator',
@ -339,6 +363,9 @@ export const PurchasePlanMainRules = reactive({
available: [
{ required: true, message: '请选择是否可用', trigger: 'change' }
],
supplierCode: [
{ required: true, message: '请选择供应商代码', trigger: 'change' }
],
poNumber: [
{ required: true, message: '请选择采购订单号', trigger: 'change' }
],
@ -377,62 +404,62 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
}
}
},
// {
// label: '订单号',
// field: 'poNumber',
// sort: 'custom',
// table: {
// width: 180
// },
// tableForm: {
// isInpuFocusShow: true,
// searchListPlaceholder: '请选择订单号',
// searchField: 'number',
// searchTitle: '采购订单信息',
// searchAllSchemas: PurchaseMain.allSchemas,
// searchPage: PurchaseMainApi.getPurchaseMainPage,
// searchCondition: [{
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// }, {
// key: 'supplierCode',
// value: 'supplierCode',
// message: '请填写供应商代码!',
// isMainValue: true
// }, {
// key: 'status',
// value: 2,
// isMainValue: false
// }
// ]
// },
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// isSearchList: true,
// searchListPlaceholder: '请选择订单号',
// searchField: 'number',
// searchTitle: '采购订单信息',
// searchAllSchemas: PurchaseMain.allSchemas,
// searchPage: PurchaseMainApi.getPurchaseMainPage,
// searchCondition: [{
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// },{
// key: 'supplierCode',
// value: 'supplierCode',
// message: '请填写供应商代码!',
// isMainValue: true
// },{
// key: 'status',
// value: 2,
// isMainValue: false
// }]
// }
// }
// },
{
label: '订单号',
field: 'poNumber',
sort: 'custom',
table: {
width: 180
},
tableForm: {
isInpuFocusShow: true,
searchListPlaceholder: '请选择订单号',
searchField: 'number',
searchTitle: '采购订单信息',
searchAllSchemas: PurchaseMain.allSchemas,
searchPage: PurchaseMainApi.getPurchaseMainPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}, {
key: 'supplierCode',
value: 'supplierCode',
message: '请填写供应商代码!',
isMainValue: true
}, {
key: 'status',
value: 2,
isMainValue: false
}
]
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择订单号',
searchField: 'number',
searchTitle: '采购订单信息',
searchAllSchemas: PurchaseMain.allSchemas,
searchPage: PurchaseMainApi.getPurchaseMainPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'supplierCode',
value: 'supplierCode',
message: '请填写供应商代码!',
isMainValue: true
},{
key: 'status',
value: 2,
isMainValue: false
}]
}
}
},
{
label: '订单行',
field: 'poLine',
@ -462,6 +489,7 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
}
},
tableForm: {
multiple:true,
isInpuFocusShow: true,
searchListPlaceholder: '请选择订单行',
searchField: 'lineNumber',

Loading…
Cancel
Save