Browse Source

要货计划新增

master_hella_20240701
yufei0306 8 months ago
parent
commit
fee645244e
  1. 2
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue
  2. 72
      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) => { tableColumns.forEach((item) => {
item.width = item.table?.width || 150 item.width = item.table?.width || 150
}) })
tableData.value = []
tableObject.tableList.forEach(row=>{ tableObject.tableList.forEach(row=>{
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...row})) const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...row}))
newRow['poLine'] = row['lineNumber'] newRow['poLine'] = row['lineNumber']

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

@ -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 () => {

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

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

Loading…
Cancel
Save