소스 검색

项目商机、转化项目调整

qymljy 6 달 전
부모
커밋
dca8033f73

+ 15 - 9
src/Form/projectChange/add.vue

@@ -946,16 +946,22 @@ export default {
       if (this.form.projectname !== "") {
         this.param.content.sa_projectid = 0;
         this.param.content.where.condition = this.form.projectname;
+        this.repeats = []
+        this.total = 0
         const res = await this.$api.requested(this.param);
-        this.repeats = res.data;
-        this.total = res.total;
-        this.$refs.form.validateField("projectname");
-        if (this.repeats.length > 0) {
-          this.siteid == "HY"
-            ? (this.dialogTableVisible = false)
-            : (this.dialogTableVisible = true);
-        } else {
-          this.dialogTableVisible = false;
+        if (res.code == 0){
+          this.tool.showMessage(res)
+        }else {
+          this.repeats = res.data;
+          this.total = res.total;
+          this.$refs.form.validateField("projectname");
+          if (this.repeats.length > 0) {
+            this.siteid == "HY"
+                ? (this.dialogTableVisible = true)
+                : (this.dialogTableVisible = true);
+          } else {
+            this.dialogTableVisible = false;
+          }
         }
       }
     },

+ 15 - 9
src/Form/projectChange/edit.vue

@@ -946,16 +946,22 @@ export default {
       if (this.form.projectname !== "") {
         this.param.content.sa_projectid = this.$route.query.id;
         this.param.content.where.condition = this.form.projectname;
+        this.repeats = []
+        this.total = 0
         const res = await this.$api.requested(this.param);
-        this.repeats = res.data;
-        this.total = res.total;
-        this.$refs.form.validateField("projectname");
-        if (this.repeats.length > 0) {
-          this.siteid == "HY"
-            ? (this.dialogTableVisible = false)
-            : (this.dialogTableVisible = true);
-        } else {
-          this.dialogTableVisible = false;
+        if (res.code == 0){
+          this.tool.showMessage(res)
+        }else {
+          this.repeats = res.data;
+          this.total = res.total;
+          this.$refs.form.validateField("projectname");
+          if (this.repeats.length > 0) {
+            this.siteid == "HY"
+                ? (this.dialogTableVisible = true)
+                : (this.dialogTableVisible = true);
+          } else {
+            this.dialogTableVisible = false;
+          }
         }
       }
     },

+ 12 - 7
src/SManagement/orderclue_detail/components/changeProject.vue

@@ -702,18 +702,23 @@ export default {
     },
     /*查询项目名称是否重复*/
     async nameChange(){
-      console.log('查重')
       if (this.form.projectname !== ''){
         this.param.content.sa_projectid = 0
         this.param.content.where.condition = this.form.projectname
+        this.repeats = []
+        this.total = 0
         const res = await this.$api.requested(this.param)
-        this.repeats = res.data
-        this.total = res.total
-        this.$refs.form.validateField('projectname')
-        if (this.repeats.length > 0){
-          this.siteid == 'HY'?this.dialogTableVisible = true:this.dialogTableVisible = true
+        if (res.code == 0){
+          this.tool.showMessage(res)
         }else {
-          this.dialogTableVisible = false
+          this.repeats = res.data
+          this.total = res.total
+          this.$refs.form.validateField('projectname')
+          if (this.repeats.length > 0){
+            this.siteid == 'HY'?this.dialogTableVisible = true:this.dialogTableVisible = true
+          }else {
+            this.dialogTableVisible = false
+          }
         }
       }
 

+ 0 - 8
src/SManagement/orderclue_detail/components/projectAudit.vue

@@ -659,11 +659,8 @@ export default {
       });
     },
     onSubmit() {
-      console.log(this.form);
       if (this.form.signdate_due !== "") {
         const data = new Date(this.form.signdate_due);
-        console.log(data.getFullYear());
-        console.log(data.getMonth() + 1);
         if (data.getMonth() + 1 < 10) {
           this.form.signdate_due =
             data.getFullYear() + "-0" + (data.getMonth() + 1);
@@ -676,8 +673,6 @@ export default {
       }
       if (this.form.begdate_due !== "") {
         const data = new Date(this.form.begdate_due);
-        console.log(data.getFullYear());
-        console.log(data.getMonth() + 1);
         if (data.getMonth() + 1 < 10) {
           this.form.begdate_due =
             data.getFullYear() + "-0" + (data.getMonth() + 1);
@@ -690,8 +685,6 @@ export default {
       }
       if (this.form.enddate_due !== "") {
         const data = new Date(this.form.enddate_due);
-        console.log(data.getFullYear());
-        console.log(data.getMonth() + 1);
         if (data.getMonth() + 1 < 10) {
           this.form.enddate_due =
             data.getFullYear() + "-0" + (data.getMonth() + 1);
@@ -703,7 +696,6 @@ export default {
         this.form.enddate_due = "";
       }
       this.form.sat_orderclueid = this.$route.query.id;
-      console.log(this.form);
       this.$refs["form"].validate(async (valid) => {
         if (!valid) return false;
         const res = await this.$api.requested({