From 1a73c77e1d14205014f6a77a8954de480d436c0e Mon Sep 17 00:00:00 2001 From: 张诺 <zhang_12370@163.com> Date: 星期四, 05 六月 2025 16:05:31 +0800 Subject: [PATCH] 联调基础模块信息-》供应商-》客户信息-》煤种信息 采购信息 联调 --- src/views/procureMent/components/ProductionDialog.vue | 118 +++-------------------------------------------------------- 1 files changed, 6 insertions(+), 112 deletions(-) diff --git a/src/views/procureMent/components/ProductionDialog.vue b/src/views/procureMent/components/ProductionDialog.vue index 3da88f5..547129c 100644 --- a/src/views/procureMent/components/ProductionDialog.vue +++ b/src/views/procureMent/components/ProductionDialog.vue @@ -1,7 +1,7 @@ <template> <div> <el-dialog - v-model="dialogVisible" + v-model="dialogFormVisible" :title="title" width="600" :close-on-click-modal="false" @@ -81,8 +81,8 @@ default: "", }, }); -const emit = defineEmits(["update:visible", "success"]); -const dialogVisible = defineModel("dialogFormVisible", { +const emit = defineEmits(["update:dialogFormVisible", "success"]); +const dialogFormVisible = defineModel("dialogFormVisible", { required: true, type: Boolean, }); @@ -109,11 +109,8 @@ }; // 鍏抽棴寮圭獥 const handleClose = () => { - dialogVisible.value = false; + dialogFormVisible.value = false; console.log(form.value); - // formRef.value?.resetFields() - // Object.assign(form, { - // }) }; const handleReset = () => { if (!formRef.value) return; @@ -146,108 +143,5 @@ }; </script> -<style lang="less" scoped> -</style> - -<!-- <template> - <el-dialog - v-model="dialogFormVisible" - title="閲囪喘鐧昏鏂板" - width="500px" - :close-on-click-modal="false" - @close="handleClose" - > - - </el-dialog> -</template> - -<script setup> -import { ref, reactive, defineProps, defineEmits } from 'vue' -import { ElMessage } from 'element-plus' - -const props = defineProps({ - visible: { - type: Boolean, - default: false - } -}) - -const emit = defineEmits(['update:visible', 'success']) - -const dialogFormVisible = ref(false) -const formRef = ref(null) - -// 琛ㄥ崟鏁版嵁 -const form = reactive({ - supplierName: '', - category: '', - unit: '', - purchaseAmount: '', - priceBeforeTax: '', - totalBeforeTax: '', - calorificValue: '', - registrant: '', - registrationDate: '' -}) - -// 琛ㄥ崟楠岃瘉瑙勫垯 - - -// 鐩戝惉visible鍙樺寲 -watch(() => props.visible, (val) => { - dialogFormVisible.value = val -}) - -// 鐩戝惉dialogFormVisible鍙樺寲 -watch(() => dialogFormVisible.value, (val) => { - emit('update:visible', val) -}) - -// 鎻愪氦琛ㄥ崟 -const handleSubmit = async () => { - if (!formRef.value) return - - await formRef.value.validate((valid) => { - if (valid) { - try { - emit('success', { ...form }) - handleClose() - ElMessage.success('淇濆瓨鎴愬姛') - } catch (error) { - console.error('淇濆瓨澶辫触:', error) - ElMessage.error('淇濆瓨澶辫触') - } - } - }) -} - -// 鍙栨秷 -const handleCancel = () => { - handleClose() -} -</script> - -<style scoped> -.production-form { - padding: 20px; -} - -.dialog-footer { - display: flex; - justify-content: center; - gap: 20px; -} - -:deep(.el-form-item__label) { - font-weight: normal; -} - -:deep(.el-input), -:deep(.el-date-picker) { - width: 100%; -} - -:deep(.el-dialog__body) { - padding-top: 10px; -} -</style> --> \ No newline at end of file +<style lang="sass" scoped> +</style> \ No newline at end of file -- Gitblit v1.9.3