Răsfoiți Sursa

合同材料

ZaiZai 10 luni în urmă
părinte
comite
0c0d6c7ac3

+ 15 - 29
src/views/debit-pay/material/components/material/dataModal.vue

@@ -263,7 +263,16 @@ const getMaterialName = async () => {
 const materialNameChange = () => {
     const { contractMaterialId } = formModel.value
     const info = materialName.value.find((item) => item.id === contractMaterialId)
+    isAdjusts.value = 0
+    formModel.value.currentPriceId = null
+    formModel.value.currentPrice = ''
+    formModel.value.adjustMonth = null
     formModel.value.materialPrice = info.price ?? ''
+    formModel.value.rangePriceRatio = ''
+    formModel.value.adjustCalculation = ''
+    formModel.value.materialValidityId = null
+    tableData1.value = []
+    tableLoading1.value = false
 }
 
 //材料实时发布价格表格
@@ -426,46 +435,23 @@ const attachmentSave = async () => {
 //关闭上传附件
 const attachmentClose = () => {
     isAttachment.value = false
+    formUploadFile.value = []
 }
 
-//保存数据
-const saveLoaing = ref(false)
-const submitData = async () => {
-    //saveLoaing.value = true
-    if (dataId.value) {
-        return true
-    } else {
-        return true
-    }
-}
 
 //保存
-const isSubmit = ref(false)
+const saveLoaing = ref(false)
 const modalSave = async () => {
-    const isValidate = await submitData()
-    if (isValidate) {
-        isSubmit.value = true
-        saveLoaing.value = false
-    }
-}
-
-//保存并关闭
-const modalSaveClose = async () => {
-    const isValidate = await submitData()
-    if (isValidate) {
-        saveLoaing.value = false
-        modalClose()
-        emit('finish')
-    }
+    const isForm = await formValidate(formRef.value)
+    if (!isForm) return
+    modalClose()
+    emit('finish')
 }
 
 //关闭弹窗
 const modalClose = () => {
     isShow.value = false
     emit('close')
-    if (isSubmit.value) {
-        emit('finish')
-    }
 }
 </script>