Browse Source

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

master_hella_20240701
yufei0306 8 months ago
parent
commit
d25a974a30
  1. 41
      src/components/BasicForm/src/BasicForm.vue
  2. 16
      src/components/Form/src/Form.vue
  3. 7
      src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/index.vue
  4. 1
      src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/purchaseMain.data.ts

41
src/components/BasicForm/src/BasicForm.vue

@ -17,6 +17,7 @@
@opensearchTable="opensearchTable" @opensearchTable="opensearchTable"
@onChange="onChange" @onChange="onChange"
@onBlur="onBlur" @onBlur="onBlur"
@onEnter="onEnter"
> >
<template #crontab="formSchema" v-if="fromeWhere == 'countPlan'"> <template #crontab="formSchema" v-if="fromeWhere == 'countPlan'">
<crontab v-model="formSchema.crontab" /> <crontab v-model="formSchema.crontab" />
@ -467,7 +468,19 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
} }
} }
} }
defineExpose({ open, formRef, opensearchTable, dialogVisible, formLoading }) // open //
const handleAddTable = () => {
if(props.isOpenSearchTable){
const tableFormKeys = {}
tableAllSchemas.value.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
inpuFocus(tableAllSchemas.value.tableFormColumns[props.indexTableColumn],tableFormKeys,0)
}else{
emit('handleAddTable')
}
}
/** 弹窗按钮 */ /** 弹窗按钮 */
let Butttondata:any = [] let Butttondata:any = []
@ -576,6 +589,7 @@ const emit = defineEmits([
'inputStringBlur', 'inputStringBlur',
'onChange', 'onChange',
'onBlur', 'onBlur',
'onEnter',
'inputNumberChange', 'inputNumberChange',
'formFormDateChange', 'formFormDateChange',
'footButtonClick' 'footButtonClick'
@ -622,19 +636,9 @@ const handleTableSelect = (row, column, event) => {
const handleDeleteTable = (row, index) => { const handleDeleteTable = (row, index) => {
emit('handleDeleteTable', row, index,formRef.value) emit('handleDeleteTable', row, index,formRef.value)
} }
//
const handleAddTable = () => {
if(props.isOpenSearchTable){
const tableFormKeys = {}
tableAllSchemas.value.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
inpuFocus(tableAllSchemas.value.tableFormColumns[props.indexTableColumn],tableFormKeys,0)
}else{
emit('handleAddTable')
}
}
// //
const inpuFocus = (headerItem, row, index) => { const inpuFocus = (headerItem, row, index) => {
@ -669,6 +673,14 @@ const onChange = (field, cur) => {
const onBlur = (field, e) => { const onBlur = (field, e) => {
emit('onBlur', field, e) emit('onBlur', field, e)
} }
/**
* 回车事件
* @param field 当前操作字段
* @param e
*/
const onEnter = (field, e) => {
emit('onEnter', field, e)
}
// //
const selectChange = (field, val) => { const selectChange = (field, val) => {
@ -692,6 +704,7 @@ const buttonOperationClick = (row, label, index)=> {
const inputStringBlur = (headerItem, row, index)=> { const inputStringBlur = (headerItem, row, index)=> {
emit("inputStringBlur", headerItem, row, index); emit("inputStringBlur", headerItem, row, index);
} }
defineExpose({ open, formRef, opensearchTable, dialogVisible, formLoading ,handleAddTable}) // open
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

16
src/components/Form/src/Form.vue

@ -54,7 +54,7 @@ export default defineComponent({
vLoading: propTypes.bool.def(false), vLoading: propTypes.bool.def(false),
labelPosition: propTypes.string.def('left'), labelPosition: propTypes.string.def('left'),
}, },
emits: ['register','opensearchTable', 'onChange', 'onBlur'], emits: ['register','opensearchTable', 'onChange', 'onBlur','onEnter'],
setup(props, { slots, expose, emit }) { setup(props, { slots, expose, emit }) {
// element form // element form
const elFormRef = ref<ComponentRef<typeof ElForm>>() const elFormRef = ref<ComponentRef<typeof ElForm>>()
@ -245,7 +245,12 @@ export default defineComponent({
return ( return (
<> <>
<ElTooltip placement="top" content={formModel.value[item.field]} > <ElTooltip placement="top" content={formModel.value[item.field]} >
<ElInput class={'myInput'} v-model={formModel.value[item.field]} placeholder={item?.componentProps?.searchListPlaceholder} disabled={true} v-slots={{ <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){
//
emit('onEnter',item.field,event)
}
}} v-slots={{
suffix: () => ( suffix: () => (
<ElButton type="text" icon={CircleClose} style="color:var(--el-button-text-color)" onClick={()=>{ <ElButton type="text" icon={CircleClose} style="color:var(--el-button-text-color)" onClick={()=>{
if(Array.isArray(formModel.value[item.field])){ if(Array.isArray(formModel.value[item.field])){
@ -274,7 +279,12 @@ export default defineComponent({
formItemSlotsSearchList[item.field] = () => { formItemSlotsSearchList[item.field] = () => {
return ( return (
<> <>
<ElInput class={'myInput'} v-model={formModel.value[item.field]} placeholder={item?.componentProps?.searchListPlaceholder} disabled={true} v-slots={{ <ElInput class={'myInput'} v-model={formModel.value[item.field]} placeholder={item?.componentProps?.searchListPlaceholder} onKeyup={(event)=>{
if(event.keyCode === 13){
//
emit('onEnter',item.field,event)
}
}} disabled={item?.componentProps?.enterSearch?false:true} v-slots={{
suffix: () => ( suffix: () => (
<ElButton type="text" icon={CircleClose} style="color:var(--el-button-text-color)" onClick={()=>{ <ElButton type="text" icon={CircleClose} style="color:var(--el-button-text-color)" onClick={()=>{
if(Array.isArray(formModel.value[item.field])){ if(Array.isArray(formModel.value[item.field])){

7
src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/index.vue

@ -63,7 +63,9 @@
@handleDeleteTable="handleDeleteTable" @handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
@submitForm="submitForm" @submitForm="submitForm"
@onChange="onChangeQty" /> @onChange="onChangeQty"
@onEnter="onEnter"
/>
<!-- 详情 --> <!-- 详情 -->
<Detail ref="detailRef" <Detail ref="detailRef"
@ -515,6 +517,9 @@ import TableDetail from '@/components/TableDetail/src/TableDetail.vue'
} }
const onEnter = (field)=>{
formRef.value.handleAddTable()
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()

1
src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/purchaseMain.data.ts

@ -33,6 +33,7 @@ export const PurchaseMain = useCrudSchemas(reactive<CrudSchema[]>([
form: { form: {
labelMessage: '影响明细中物料代码,需在供应商物料中维护', labelMessage: '影响明细中物料代码,需在供应商物料中维护',
componentProps: { componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗 isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择供应商代码', // 输入框占位文本 searchListPlaceholder: '请选择供应商代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段 searchField: 'code', // 查询弹窗赋值字段

Loading…
Cancel
Save