Browse Source

Merge branch 'develop_yh56_1' of http://git.chelingzhu.com/jianguan-web/qpls-md-html into develop_yh56_1

chenrui 3 months ago
parent
commit
89f4ddf564
2 changed files with 20 additions and 11 deletions
  1. 1 1
      public/version.json
  2. 19 10
      src/views/salesManagement/salesQueryNew/chooseProductModal.vue

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
 {
   "message": "发现有新版本发布,确定更新系统?",
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
   "vendorJsVersion": "",
-  "version": 1742269032448
+  "version": 1742282984949
 }
 }

+ 19 - 10
src/views/salesManagement/salesQueryNew/chooseProductModal.vue

@@ -61,12 +61,13 @@
                 </a-select>
                 </a-select>
               </a-form-model-item>
               </a-form-model-item>
             </a-col>
             </a-col>
-            <a-col flex="2" v-if="$hasPermissions('B_salerVinFindProduct')">
+            <a-col flex="2" v-if="$hasPermissions('B_salerVinFindProduct')&&sourceType !== 'TRANSFER_ORDER'">
               <a-form-model-item label="车架号(VIN)" prop="vinCode">
               <a-form-model-item label="车架号(VIN)" prop="vinCode">
                 <a-input id="productInfoList-vinCode" v-model.trim="queryParam.vinCode" allowClear placeholder="请输入车架号(VIN)">
                 <a-input id="productInfoList-vinCode" v-model.trim="queryParam.vinCode" allowClear placeholder="请输入车架号(VIN)">
-                  <a-icon @click="uploadFun" :type="vinLoading?'loading':'camera'" slot="addonAfter" :style="{ fontSize: '18px', verticalAlign: 'bottom' }" />
+                  <a-upload slot="addonAfter" :before-upload="beforeUpload" listType="picture" accept="image/*" :showUploadList="false">
+                    <a-icon :type="vinLoading?'loading':'camera'" :style="{ fontSize: '18px', verticalAlign: 'bottom',cursor:'pointer' }" title="拖动图片到这里识别VIN" />
+                  </a-upload>
                 </a-input>
                 </a-input>
-                <input type="file" id="filed" accept="image/jpeg,image/png" hidden="" @change="filePreview">
               </a-form-model-item>
               </a-form-model-item>
             </a-col>
             </a-col>
             <a-col flex="200px">
             <a-col flex="200px">
@@ -549,16 +550,22 @@ export default {
     handleDetail (row) {
     handleDetail (row) {
       this.$emit('viewRecord', row)
       this.$emit('viewRecord', row)
     },
     },
-    uploadFun () {
-      document.getElementById('filed').click()
-    },
-    filePreview (e) {
+    beforeUpload (file) {
       const _this = this
       const _this = this
-      var files = e.target.files[0]
+      console.log(file)
+      if (file.size > 10240 * 1024 * 5) {
+        _this.$notification.error({
+          message: '提示',
+          description: '文件大小不能超过50M'
+        })
+        return false
+      }
       const formData = new FormData()
       const formData = new FormData()
       formData.append('savePathType', 'local')
       formData.append('savePathType', 'local')
-      formData.append('file', files)
+      formData.append('file', file)
+      // 解析图片
       this.vinLoading = true
       this.vinLoading = true
+      this.disabled = true
       vinCodeParse(formData).then(res => {
       vinCodeParse(formData).then(res => {
         if (res.type == 'application/json') {
         if (res.type == 'application/json') {
           var reader = new FileReader()
           var reader = new FileReader()
@@ -575,13 +582,15 @@ export default {
               })
               })
             }
             }
             _this.vinLoading = false
             _this.vinLoading = false
-            document.getElementById('filed').value = ''
+            _this.disabled = false
           })
           })
           reader.readAsText(res)
           reader.readAsText(res)
         } else {
         } else {
           _this.vinLoading = false
           _this.vinLoading = false
+          _this.disabled = false
         }
         }
       })
       })
+      return false
     },
     },
     // 仓库
     // 仓库
     getWarehouse () {
     getWarehouse () {