gaoluyang
6 小时以前 3635df0bf15df4c2ed450804ac9c1b0027573b2c
src/views/procurementManagement/invoiceEntry/components/Modal.vue
@@ -123,6 +123,7 @@
            placeholder="请输入"
            :min="0"
            :step="0.1"
                  :precision="2"
            clearable
            style="width: 100%"
            @change="invoiceNumBlur(row)"
@@ -133,6 +134,7 @@
            v-model="row.ticketsAmount"
            placeholder="请输入"
            :min="0"
                  :precision="2"
            :step="0.1"
            clearable
            style="width: 100%"
@@ -142,16 +144,17 @@
      </PIMTable>
    </el-form>
    <template #footer>
         <el-button type="primary" :loading="modalLoading" @click="submitForm">
            {{ modalOptions.confirmText }}
         </el-button>
      <el-button @click="closeModal">{{ modalOptions.cancelText }}</el-button>
      <el-button type="primary" :loading="modalLoading" @click="submitForm">
        {{ modalOptions.confirmText }}
      </el-button>
    </template>
  </el-dialog>
</template>
<script setup>
import { ref, getCurrentInstance } from "vue";
import { defineEmits } from 'vue';
import { useModal } from "@/hooks/useModal";
import useFormData from "@/hooks/useFormData";
import FileUpload from "@/components/Upload/FileUpload.vue";
@@ -213,14 +216,18 @@
  title: "来票登记",
});
const emit = defineEmits(['refreshList']);
const columns = [
  {
    label: "产品大类",
    prop: "productCategory",
      width: 120,
  },
  {
    label: "规格型号",
    prop: "specificationModel",
      width: 120,
  },
  {
    label: "单位",
@@ -377,7 +384,7 @@
  let invoiceAmountTotal = 0;
  form.productData.forEach((item) => {
    if (item.ticketsAmount) {
      invoiceAmountTotal += item.ticketsAmount;
      invoiceAmountTotal += Number(item.ticketsAmount);
    }
  });
  form.invoiceAmount = invoiceAmountTotal.toFixed(2);
@@ -399,10 +406,15 @@
  form.tempFileIds = form.tempFileIds.filter((item) => item !== tempId);
};
const closeAndRefresh = () => {
  closeModal();
  emit('refreshList');
};
const submitForm = () => {
  formRef.value.validate(async (valid, fields) => {
    if (valid) {
      modalLoading.value = true;
      // modalLoading.value = true;
      const { code } = await addOrUpdateRegistration({
        purchaseLedgerId: id.value,
        purchaseContractNumber: form.purchaseLedgerNo,
@@ -422,7 +434,7 @@
      });
      modalLoading.value = false;
      if (code == 200) {
        closeModal();
        closeAndRefresh();
      }
    } else {
      modalLoading.value = false;
@@ -432,6 +444,7 @@
defineExpose({
  open,
  closeAndRefresh,
});
</script>