Browse Source

采购收货申请,新增时采购订单可编辑

master_hella_20240701
yufei0306 7 months ago
parent
commit
360f09a1bb
  1. 4
      src/components/BasicForm/src/BasicForm.vue
  2. 4
      src/components/Form/src/Form.vue
  3. 26
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue
  4. 1
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/purchasereceiptRequestMain.data.ts

4
src/components/BasicForm/src/BasicForm.vue

@ -678,8 +678,8 @@ const onBlur = (field, e) => {
* @param field 当前操作字段 * @param field 当前操作字段
* @param e * @param e
*/ */
const onEnter = (field, e) => { const onEnter = (field,value, e) => {
emit('onEnter', field, e) emit('onEnter', field,value, e)
} }
// //

4
src/components/Form/src/Form.vue

@ -248,7 +248,7 @@ export default defineComponent({
<ElInput class={'myInput'} v-model={formModel.value[item.field]} placeholder={item?.componentProps?.searchListPlaceholder} disabled={item?.componentProps?.enterSearch?false:true} onKeyup={(event)=>{ <ElInput class={'myInput'} v-model={formModel.value[item.field]} placeholder={item?.componentProps?.searchListPlaceholder} disabled={item?.componentProps?.enterSearch?false:true} onKeyup={(event)=>{
if(event.keyCode === 13){ if(event.keyCode === 13){
// //
emit('onEnter',item.field,event) emit('onEnter',item.field,formModel.value[item.field],event)
} }
}} v-slots={{ }} v-slots={{
suffix: () => ( suffix: () => (
@ -282,7 +282,7 @@ export default defineComponent({
<ElInput class={'myInput'} v-model={formModel.value[item.field]} placeholder={item?.componentProps?.searchListPlaceholder} onKeyup={(event)=>{ <ElInput class={'myInput'} v-model={formModel.value[item.field]} placeholder={item?.componentProps?.searchListPlaceholder} onKeyup={(event)=>{
if(event.keyCode === 13){ if(event.keyCode === 13){
// //
emit('onEnter',item.field,event) emit('onEnter',item.field,formModel.value[item.field],event)
} }
}} disabled={item?.componentProps?.enterSearch?false:true} v-slots={{ }} disabled={item?.componentProps?.enterSearch?false:true} v-slots={{
suffix: () => ( suffix: () => (

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

@ -57,6 +57,7 @@
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
@submitForm="submitForm" @submitForm="submitForm"
@formFormDateChange="formFormDateChange" @formFormDateChange="formFormDateChange"
@onEnter="onEnter"
/> />
<!-- 详情 --> <!-- 详情 -->
<Detail <Detail
@ -204,7 +205,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
const newRow = val[0] const newRow = val[0]
newRow['poNumber'] = val[0]['number'] newRow['poNumber'] = val[0]['number']
// //
getSearchTableData(val[0]['number'],val[0]['supplierCode']) getSearchTableData(val[0]['number'])
// tableData.value = [newRow] // tableData.value = [newRow]
// formRef.handleAddTable() // formRef.handleAddTable()
} }
@ -372,7 +373,7 @@ const labelPrint = async (row) => {
} }
const getSearchTableData = async (number,supplierCode)=>{ const getSearchTableData = async (number,isEnter=false)=>{
const {tableObject ,tableMethods} = useTable({ const {tableObject ,tableMethods} = useTable({
defaultParams:{number}, defaultParams:{number},
getListApi: PurchaseDetailApi.getPurchaseDetailPage // getListApi: PurchaseDetailApi.getPurchaseDetailPage //
@ -391,14 +392,16 @@ const getSearchTableData = async (number,supplierCode)=>{
newRow['itemCode'] = row['itemCode'] newRow['itemCode'] = row['itemCode']
newRow['uom'] = row['uom'] newRow['uom'] = row['uom']
newRow['poNumber'] =row['number'] newRow['poNumber'] =row['number']
let queryData = { newRow['defaultToLocationCode'] =row['defaultLocation']
supplierCode,
itemCode:row['itemCode']
}
SupplieritemApi.getDefaultLocationCode(queryData as SupplieritemApi.SupplieritemVO).then(res =>{
newRow['defaultToLocationCode'] = res
tableData.value.push(newRow) tableData.value.push(newRow)
}) if(isEnter){
//--
const setV = {}
setV['poNumber'] = number
setV['supplierCode'] = row.supplierCode
formRef.value.formRef.setValues(setV)
}
}) })
} }
/** 添加/修改操作 */ /** 添加/修改操作 */
@ -566,7 +569,10 @@ const handleAddTable = () => {
const handleDeleteTable = (item, index) => { const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1) tableData.value.splice(index, 1)
} }
const onEnter = async (field,value)=>{
console.log(field,value)
getSearchTableData(value,true)
}
// //
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {
data.subList = tableData.value // data.subList = tableData.value //

1
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/purchasereceiptRequestMain.data.ts

@ -59,6 +59,7 @@ export const PurchasereceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
form: { form: {
// labelMessage: '信息提示说明!!!', // labelMessage: '信息提示说明!!!',
componentProps: { componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗 isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择采购订单', // 输入框占位文本 searchListPlaceholder: '请选择采购订单', // 输入框占位文本
searchField: 'number', // 查询弹窗赋值字段 searchField: 'number', // 查询弹窗赋值字段

Loading…
Cancel
Save