Przeglądaj źródła

项目商机合同新建设置签约日期默认为当前日期

qymljy 3 miesięcy temu
rodzic
commit
e6982ebb7d

+ 8 - 0
src/HDrpManagement/projectChange/modules/modules/contract/components/add.vue

@@ -524,6 +524,7 @@ export default {
     },
     addBtn (type) {
       this.form = Object.assign({},this.form,this.data)
+      this.form.signdate = this.getTodayDate()
       if (this.flagTag != 2){
         this.$message.error('当前项目报备审核未通过,不可创建合同');
       }else {
@@ -550,6 +551,13 @@ export default {
       //   })
       // }
     },
+    getTodayDate() {
+      const today = new Date();
+      const year = today.getFullYear();
+      const month = String(today.getMonth() + 1).padStart(2, '0'); // 月份从0开始,需+1
+      const day = String(today.getDate()).padStart(2, '0');
+      return `${year}-${month}-${day}`;
+    },
     async onSubmit () {
       this.$refs.form.validate(async val => {
         if (val) {