ソースを参照

获取选中关联项目已用数量

armg 4 日 前
コミット
f4e1a98ea5
1 ファイル変更20 行追加11 行削除
  1. 20 11
      src/views/AIDesign/result.vue

+ 20 - 11
src/views/AIDesign/result.vue

@@ -51,7 +51,7 @@
       <!-- 外墙 -->
       <div class="button-group-outside" v-if="wallType === 'outside'">
         <button class="action-button-big flex-center" @click="handleAIfun"
-          v-if="agentFrom === 'stoneLikePaint' && allRes && allRes.F_DesignStyle != 'CHANGE_COLOR'">
+          v-if="agentFrom === 'stoneLikePaint' && allRes && allRes.F_DesignStyle != 'CHANGE_COLOR' && StateCode == 2">
           <img src="@/assets/AIDesign/file-excel-line.png" class="icon" />
           <div>
             <div class="title">确认AI设计</div>
@@ -68,7 +68,7 @@
             </div>
           </button>
           <button class="action-button-middle flex-center" @click="manualDesign" :disabled="projectDisableFlag"
-            v-if="showArtificial && !projectDisableFlag"
+            v-if="showArtificial && !projectDisableFlag && StateCode == 2"
             :class="projectDisableFlag == true ? 'save-button-disabled' : ''">
             <img src="@/assets/AIDesign/bsIcon.png" class="iconbig" />
             <div>
@@ -165,9 +165,9 @@ export default class extends Vue {
     const customerCode = userInfo && userInfo.sysUserExt ? userInfo.sysUserExt.customerCode : '';
     const salesLevel = userInfo && userInfo.sysUserExt ? userInfo.sysUserExt.salesLevel : '';
     // 外墙-服务商随身邦
-    if (this.agentFrom === 'stoneLikePaint' && this.wallType === 'outside') {
-      this.showArtificial = true;
-      this.getIsNeedProjectFlag();//获取是否关联了项目
+    if (this.agentFrom === 'stoneLikePaint' && this.wallType === 'outside' && this.$route.query.projectid) {
+      this.projectId = this.$route.query.projectid;
+      this.getProjectDisableFlag();
     }
     // 和部分经销商展示转人工
     // else if(customerCode && (salesLevel === 'customer_level' || salesLevel === 'reseller_level')){
@@ -181,7 +181,7 @@ export default class extends Vue {
     this.type = window.localStorage.getItem('type');
     this.GetReadStateFn();
     this.GetEntityDataFirst()
-    
+
   }
   // 离开页面时清除定时器
   deactivated() {
@@ -213,6 +213,10 @@ export default class extends Vue {
     this.showArtificial = false;
     this.allRes = null;
   }
+  getProjectDisableFlag() {
+    this.showArtificial = true;
+    this.getIsNeedProjectFlag();//获取是否关联了项目
+  }
   // 是否关联了项目
   getIsNeedProjectFlag() {
     let that = this;
@@ -250,11 +254,7 @@ export default class extends Vue {
     let that = this;
     const formData = new FormData();
     formData.append('ServiceCode', that.serviceCodeArray.join(','));
-    const projectid = this.$route.query.projectid || this.projectId || '';
-    formData.append('projectid', projectid);
-    if (!projectid) {
-      that.projectDisableFlag = false;//有项目判断>3可点击
-    }
+    formData.append('projectid', this.projectId);
     GetProjectlist(formData).then(response => {
       if (response.StatusCode == 200 && response.Data && response.Data[0]) {
         that.outsideDesignCount = response.Data[0].DesignCount || 0;
@@ -362,6 +362,10 @@ export default class extends Vue {
           this.StateInfo = response.Data.Description;
           this.projectId = response.Data.ProjectID;
           this.F_OutsideType = response.Data.F_OutsideType;
+          // 外墙-服务商随身邦
+          if (this.agentFrom === 'stoneLikePaint' && this.wallType === 'outside') {
+            this.getProjectDisableFlag();
+          }
           if (response.Data.F_ResultFilePath || response.Data.F_ResultlargeFilePath) {
             const high_Definition_img = response.Data.F_ResultFilePath || response.Data.F_ResultlargeFilePath || response.Data.F_ResultSmallFilePath;
             that.imageUrl = response.Data.BaseUrl + high_Definition_img;
@@ -409,6 +413,11 @@ export default class extends Vue {
           this.StateCode = response.Data.StateCode;
           this.StateInfo = response.Data.Description;
           this.F_OutsideType = response.Data.F_OutsideType;
+          this.projectId = response.Data.ProjectID;
+          // 外墙-服务商随身邦
+          if (this.agentFrom === 'stoneLikePaint' && this.wallType === 'outside') {
+            this.getProjectDisableFlag();
+          }
           if (response.Data.F_ResultFilePath || response.Data.F_ResultlargeFilePath) {
             const high_Definition_img = response.Data.F_ResultFilePath || response.Data.F_ResultlargeFilePath || response.Data.F_ResultlargeFilePath;
             that.imageUrl = response.Data.BaseUrl + high_Definition_img;