|
@@ -61,12 +61,13 @@
|
|
|
</a-select>
|
|
|
</a-form-model-item>
|
|
|
</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-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>
|
|
|
- <input type="file" id="filed" accept="image/jpeg,image/png" hidden="" @change="filePreview">
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col flex="200px">
|
|
@@ -549,16 +550,22 @@ 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
|
|
|
+ this.disabled = true
|
|
|
vinCodeParse(formData).then(res => {
|
|
|
if (res.type == 'application/json') {
|
|
|
var reader = new FileReader()
|
|
@@ -575,13 +582,15 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
_this.vinLoading = false
|
|
|
- document.getElementById('filed').value = ''
|
|
|
+ _this.disabled = false
|
|
|
})
|
|
|
reader.readAsText(res)
|
|
|
} else {
|
|
|
_this.vinLoading = false
|
|
|
+ _this.disabled = false
|
|
|
}
|
|
|
})
|
|
|
+ return false
|
|
|
},
|
|
|
// 仓库
|
|
|
getWarehouse () {
|