Compare commits

..

No commits in common. "70557ee3df914be662beb2f6c2d174e3381c6a1c" and "21ca5bc98f044fe1562be9efd956464b03a9cd3f" have entirely different histories.

2 changed files with 4 additions and 33 deletions

View File

@ -1,5 +1,5 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible" @close="emits">
<Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form
width="400px"
ref="formRef"
@ -20,7 +20,7 @@
</el-form-item>
<el-form-item label="物料分类编码" prop="matTypeCode" >
<el-input v-model="formData.matTypeCode" placeholder="请输入物料分类编码" disabled show-word-limit />
<el-input v-model="formData.matTypeCode" placeholder="请输入物料分类编码" show-word-limit :disabled="formType === 'update'"/>
</el-form-item>
<el-form-item label="最大流水号" prop="curMaxSeq" >
<el-input v-model="formData.curMaxSeq" placeholder="请输入当前最大流水号" :disabled="formType === 'update'" show-word-limit/>
@ -34,7 +34,7 @@
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="emits"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
@ -112,11 +112,6 @@ const open = async (type: string, id?: number) => {
}
defineExpose({ open }) // open
const emits = async () => {
dialogVisible.value = false
emit('success')
}
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {

View File

@ -120,7 +120,6 @@
</Dialog>
</template>
<script setup lang="ts">
import { nextTick } from 'vue'
import { getIntDictOptions, getStrDictOptions, getBoolDictOptions, DICT_TYPE } from '@/utils/dict'
import * as MaterialApi from '@/api/heli/material'
import {getSupplierPage} from "@/api/heli/supplier";
@ -175,8 +174,6 @@ const formRef = ref() // 表单 Ref
const supplierList = ref<any[]>([]) //
const supplierSelectList = ref<any[]>([])
const supplierSelectLoading = ref(false);
const isInitialized = ref(false) // watch
const originalMatCate = ref() //
const remoteSupplierSearch = (query: string) => {
if (query) {
@ -199,15 +196,9 @@ const open = async (type: string, id?: number) => {
resetForm()
//
formLoading.value = true
isInitialized.value = false
try {
if (id) {
const data = await MaterialApi.getMaterial(id)
formData.value = data
//
originalMatCate.value = data.matCate
} else {
originalMatCate.value = undefined
formData.value = await MaterialApi.getMaterial(id)
}
let params = {
pageNo: 1,
@ -219,9 +210,6 @@ const open = async (type: string, id?: number) => {
supplierSelectList.value = supplierData.list;
} finally {
formLoading.value = false
nextTick(() => {
isInitialized.value = true
})
}
}
@ -292,18 +280,8 @@ const handleSelectedSupplier = (newValue: any) => {
/** 监听物料类型变化查询matcode并更新code */
watch(() => formData.value.matCate, async (newVal) => {
//
if (!isInitialized.value) {
return
}
//
if (!newVal) {
formData.value.code = undefined
originalMatCate.value = undefined
return
}
//
if (newVal === originalMatCate.value) {
return
}
try {
@ -313,8 +291,6 @@ watch(() => formData.value.matCate, async (newVal) => {
} else {
formData.value.code = null
}
//
originalMatCate.value = newVal
} catch (error) {
console.error('查询matcode失败:', error)
formData.value.code = null