Ver código fonte

fix: 审核调整

zh 2 anos atrás
pai
commit
39e14e683e

+ 52 - 4
src/views/commercialEngineering/components/examine.vue

@@ -31,7 +31,13 @@
             </el-col>
             <el-col :span="7" class="flex-box">
               <div class="flex-box-title">经销商编号</div>
-              <el-input v-model="formData.customerNumber2" class="my-input" placeholder="请填写" size="mini" clearable />
+              <el-input
+                v-model="formData.customerNumber2"
+                class="my-input"
+                placeholder="请填写"
+                size="mini"
+                clearable
+              />
             </el-col>
             <el-col :span="7" class="flex-box">
               <div class="flex-box-title">经销商名称</div>
@@ -61,7 +67,7 @@
             <el-input
               v-model="formData.note"
               placeholder="请填写"
-              :disabled="formData.examineNote !== 'NOTE_3' "
+              :disabled="formData.examineNote !== 'NOTE_3'"
               size="mini"
               clearable
             />
@@ -92,7 +98,14 @@
                   class="elImageClose"
                 />
                 <div
-                  style="display: flex; width: 120px; height: 120px; align-items: center; justify-content: center;cursor: pointer;"
+                  style="
+                    display: flex;
+                    width: 120px;
+                    height: 120px;
+                    align-items: center;
+                    justify-content: center;
+                    cursor: pointer;
+                  "
                   @click="openPdf(item)"
                 >
                   <img v-if="checkFileType(item.fileUrl) == 'word'" class="file" src="@/assets/common/word.png">
@@ -127,6 +140,9 @@
 </template>
 
 <script>
+import { getLoginHomeDecorationList } from '@/api/homeDecoration'
+import { getLoginCrossDistrictList } from '@/api/crossDistrict'
+import { getLoginFrockList } from '@/api/frock'
 import ImageUpload from '@/components/Common/image-upload.vue'
 import LoginSuccess from './loginSuccess.vue'
 export default {
@@ -168,7 +184,12 @@ export default {
       showDialog: false
     }
   },
-  created() {
+  watch: {
+    async 'formData.id'(newValue, oldValue) {
+      if (newValue) {
+        this.getData()
+      }
+    }
   },
   methods: {
     handleSuccess(val) {
@@ -216,6 +237,33 @@ export default {
       document.body.appendChild(link)
       link.click()
       document.body.removeChild(link)
+    },
+    getData() {
+      if (!this.formData.successLoginProject) return
+      const params = {
+        pageNum: 1,
+        pageSize: -1,
+        params: [
+          {
+            param: 'a.project_no',
+            compare: 'like',
+            value: this.formData.successLoginProject
+          }
+        ]
+      }
+      const objFn = {
+        home: getLoginHomeDecorationList,
+        cross: getLoginCrossDistrictList,
+        frock: getLoginFrockList
+      }
+      objFn[this.pageType](params).then(res => {
+        if (res.data.records && res.data.records.length) {
+          this.formData.customerNumber2 = res.data.records[0].customerNumber
+          this.formData.customerName2 = res.data.records[0].customerName
+          this.formData.serviceName2 = res.data.records[0].serviceName
+          this.formData.serviceNumber2 = res.data.records[0].serviceNumber
+        }
+      })
     }
   }
 }

+ 1 - 29
src/views/commercialEngineering/mixin/index.js

@@ -3,9 +3,6 @@ import { getDictList, getSalesmanList } from '@/api/common'
 import { getDealerListV2 } from '@/api/basic_data/dealer'
 import { getFirstPartyCustomerManagementList } from '@/api/basic_data/partya'
 import { mapGetters } from 'vuex'
-import { getLoginHomeDecorationList } from '@/api/homeDecoration'
-import { getLoginCrossDistrictList } from '@/api/crossDistrict'
-import { getLoginFrockList } from '@/api/frock'
 export default {
   props: {
     detailId: {
@@ -215,7 +212,6 @@ export default {
             }
           ]
         }
-        this.getData()
       })
     },
     getPositionProject() {
@@ -228,31 +224,7 @@ export default {
         ...this.resetData,
         id: this.detailId
       }
-    },
-    getData() {
-      if (!this.formData.successLoginProject) return
-      const params = {
-        pageNum: 1,
-        pageSize: 15,
-        param: [
-          {
-            'param': 'a.project_no',
-            'compare': 'like',
-            'value': this.formData.successLoginProject
-          }
-        ]
-      }
-      const objFn = {
-        'home': getLoginHomeDecorationList(params),
-        'cross': getLoginCrossDistrictList(params),
-        'frock': getLoginFrockList(params)
-      }
-      objFn[this.pageType].then(res => {
-        this.formData.customerNumber2 = res.data.customerNumber
-        this.formData.customerName2 = res.data.customerName
-        this.formData.serviceName2 = res.data.serviceName
-        this.formData.serviceNumber2 = res.data.serviceNumber
-      })
     }
+
   }
 }