lilei 3 meses atrás
pai
commit
894af771af

+ 1 - 1
public/version.json

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

+ 15 - 8
src/views/salesManagement/salesQueryNew/chooseProductModal.vue

@@ -64,9 +64,10 @@
             <a-col flex="2" v-if="$hasPermissions('B_salerVinFindProduct')">
               <a-form-model-item label="车架号(VIN)" prop="vinCode">
                 <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="拖动图片到这里直接上传" />
+                  </a-upload>
                 </a-input>
-                <input type="file" id="filed" accept="image/jpeg,image/png" hidden="" @change="filePreview">
               </a-form-model-item>
             </a-col>
             <a-col flex="200px">
@@ -549,15 +550,20 @@ export default {
     handleDetail (row) {
       this.$emit('viewRecord', row)
     },
-    uploadFun () {
-      document.getElementById('filed').click()
-    },
-    filePreview (e) {
+    beforeUpload (file) {
       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()
       formData.append('savePathType', 'local')
-      formData.append('file', files)
+      formData.append('file', file)
+      // 解析图片
       this.vinLoading = true
       vinCodeParse(formData).then(res => {
         if (res.type == 'application/json') {
@@ -582,6 +588,7 @@ export default {
           _this.vinLoading = false
         }
       })
+      return false
     },
     // 仓库
     getWarehouse () {