chenrui
3 天以前 0805c8f58834e70b2a654cfa9f54fdaeaa0ddda1
src/views/salesManagement/invoiceLedger/index.vue
@@ -90,7 +90,7 @@
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="开票人:" prop="invoicePerson">
              <el-input v-model="form.invoicePerson" placeholder="请输入" clearable/>
              <el-input v-model="form.invoicePerson" placeholder="请输入" clearable disabled/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
@@ -103,6 +103,7 @@
                  type="date"
                  placeholder="请选择"
                  clearable
                  disabled
              />
            </el-form-item>
          </el-col>
@@ -194,6 +195,7 @@
  commitFile,
  registrationProductPage
} from "../../../api/salesManagement/invoiceLedger.js";
import useUserStore from "@/store/modules/user.js";
const { proxy } = getCurrentInstance()
const tableData = ref([])
const productData = ref([])
@@ -235,6 +237,7 @@
})
const { searchForm, form, rules } = toRefs(data)
const currentId = ref('')
const userStore = useUserStore()
const upload = reactive({
  // 上传的地址
  url: import.meta.env.VITE_APP_BASE_API + "/invoiceLedger/uploadFile",
@@ -282,9 +285,17 @@
  productData.value = []
  fileList.value = []
  currentId.value = row.id;
  invoiceLedgerProductInfo({id: row.id}).then(res => {
    form.value = {...res.data}
    fileList.value = res.data.fileList;
    if(!form.value.invoicePerson){
      form.value.invoicePerson = userStore.nickName
      form.value.entryDate = getCurrentDate();
    }
    if(!form.value.invoiceDate){
      form.value.invoiceDate = getCurrentDate();
    }
  })
  dialogFormVisible.value = true
}
@@ -395,6 +406,15 @@
}
// 获取当前日期并格式化为 YYYY-MM-DD
function getCurrentDate() {
  const today = new Date();
  const year = today.getFullYear();
  const month = String(today.getMonth() + 1).padStart(2, '0'); // 月份从0开始
  const day = String(today.getDate()).padStart(2, '0');
  return `${year}-${month}-${day}`;
}
getList()
</script>