|
|
@ -55,12 +55,12 @@ |
|
|
|
<div v-if="!stepOne" class="step-style"> |
|
|
|
<div class="mobile-check-upload"> |
|
|
|
<div class="upload-input"> |
|
|
|
<!-- multiple --> |
|
|
|
<input |
|
|
|
ref="imgFile" |
|
|
|
accept="image/*" |
|
|
|
capture="camera" |
|
|
|
type="file" |
|
|
|
multiple |
|
|
|
:disabled="stepOne" |
|
|
|
@change="previewFiles" |
|
|
|
> |
|
|
@ -70,7 +70,7 @@ |
|
|
|
<div v-for="(imgSrc, index) in imageSources" :key="index" style="display: inline-block; margin: 10px;"> |
|
|
|
<img |
|
|
|
:src="imgSrc" |
|
|
|
style="display: inline-block; max-width: 100px; max-height: 100px;" |
|
|
|
style="display: inline-block; max-width: 400px; max-height: 150px;" |
|
|
|
@click="showCoverPreview(imgSrc)" |
|
|
|
> |
|
|
|
<i class="iconfont icon-shanchu1" @click="deleteImage(index)" /> |
|
|
@ -88,7 +88,7 @@ |
|
|
|
</el-form> --> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<el-button type="primary" @click="returnStepOne">上一步</el-button> |
|
|
|
<el-button type="primary" :disabled="stepTwo" @click="returnStepOne">上一步</el-button> |
|
|
|
<el-button class="check-btn" :loading="submitLoading" type="primary" @click="saveData">下一步</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -96,16 +96,19 @@ |
|
|
|
<div :class="!isMobile ? 'mobile-step' : 'mobile-step isMobile-step'"> |
|
|
|
<!-- <span>开始盘点</span> --> |
|
|
|
<el-divider content-position="left"><img src="@/assets/images/collect/three2.png"><span>开始盘点</span></el-divider> |
|
|
|
<div v-if="stepThree" class="step-style step-three-text"> |
|
|
|
<p v-if="mobileResult"> |
|
|
|
移动盘点已创建成功,单号【{{ mobileResult.stockBill }}】,查看详情请转到: |
|
|
|
<router-link :to="{ path: '/check/check/checkLog'}"> |
|
|
|
盘点日志 |
|
|
|
</router-link> |
|
|
|
</p> |
|
|
|
<p v-else> |
|
|
|
移动盘点创建失败 |
|
|
|
</p> |
|
|
|
<div v-if="stepTwo" class="step-style step-three-text"> |
|
|
|
<div v-if="mobileResult"> |
|
|
|
<i class="iconfont icon-shangchuanchenggong" /> |
|
|
|
<p>移动盘点已创建成功,盘点单号【{{ mobileResult.stockBill || mobileResult.inventoryId }}】,查看详情请转到: |
|
|
|
<router-link :to="{ path: '/check/check/checkLog'}"> |
|
|
|
盘点日志 |
|
|
|
</router-link> |
|
|
|
</p> |
|
|
|
</div> |
|
|
|
<div v-else> |
|
|
|
<i class="iconfont icon-shangchuanshibai" /> |
|
|
|
<p>移动盘点创建失败</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -133,7 +136,7 @@ |
|
|
|
:modal-append-to-body="false" |
|
|
|
append-to-body |
|
|
|
:visible.sync="cropperModel" |
|
|
|
width="950px" |
|
|
|
width="1250px" |
|
|
|
center |
|
|
|
> |
|
|
|
<cropper-image |
|
|
@ -200,7 +203,6 @@ export default { |
|
|
|
}, |
|
|
|
stepOne: true, |
|
|
|
stepTwo: false, |
|
|
|
stepThree: false, |
|
|
|
// 裁切图片参数 |
|
|
|
formValidate: { |
|
|
|
mainImage: '' |
|
|
@ -309,38 +311,64 @@ export default { |
|
|
|
}, |
|
|
|
previewFiles() { |
|
|
|
const files = this.$refs.imgFile.files |
|
|
|
const maxImages = 3 |
|
|
|
const remainingSlots = maxImages - this.imageSources.length |
|
|
|
|
|
|
|
if (remainingSlots === 0) { |
|
|
|
this.$message({ message: '已有 3 张图片,不能再上传', type: 'error', offset: 8 }) |
|
|
|
if (files.length === 0) { |
|
|
|
this.$message({ message: '请选择一张图片', type: 'error', offset: 8 }) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
const validFiles = [] |
|
|
|
for (let i = 0; i < files.length; i++) { |
|
|
|
const file = files[i] |
|
|
|
if (file.type === 'image/jpeg') { |
|
|
|
validFiles.push(file) |
|
|
|
} else { |
|
|
|
this.$message({ message: `文件 ${file.name} 不是 JPG 格式,将忽略该文件`, type: 'error', offset: 8 }) |
|
|
|
} |
|
|
|
const file = files[0] |
|
|
|
if (file.type !== 'image/jpeg') { |
|
|
|
this.$message({ message: `文件 ${file.name} 不是 JPG 格式,请重新选择`, type: 'error', offset: 8 }) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (validFiles.length > remainingSlots) { |
|
|
|
this.$message({ message: `最多只能再上传 ${remainingSlots} 张图片,将只处理部分选择的图片`, type: 'error', offset: 8 }) |
|
|
|
} |
|
|
|
|
|
|
|
const numFilesToProcess = Math.min(validFiles.length, remainingSlots) |
|
|
|
for (let i = 0; i < numFilesToProcess; i++) { |
|
|
|
const file = validFiles[i] |
|
|
|
const reader = new FileReader() |
|
|
|
reader.onload = (e) => { |
|
|
|
this.imageSources.push(e.target.result) |
|
|
|
} |
|
|
|
reader.readAsDataURL(file) |
|
|
|
this.selectedFiles.push(file) |
|
|
|
// if (this.imageSources.length > 0) { |
|
|
|
// this.$message({ message: '已有一张图片,不能再上传', type: 'error', offset: 8 }) |
|
|
|
// return |
|
|
|
// } |
|
|
|
this.imageSources = [] |
|
|
|
this.selectedFiles = [] |
|
|
|
const reader = new FileReader() |
|
|
|
reader.onload = (e) => { |
|
|
|
this.imageSources.push(e.target.result) |
|
|
|
} |
|
|
|
reader.readAsDataURL(file) |
|
|
|
this.selectedFiles.push(file) |
|
|
|
}, |
|
|
|
// previewFiles() { |
|
|
|
// const files = this.$refs.imgFile.files |
|
|
|
// const maxImages = 3 |
|
|
|
// const remainingSlots = maxImages - this.imageSources.length |
|
|
|
|
|
|
|
// if (remainingSlots === 0) { |
|
|
|
// this.$message({ message: '已有 3 张图片,不能再上传', type: 'error', offset: 8 }) |
|
|
|
// } |
|
|
|
|
|
|
|
// const validFiles = [] |
|
|
|
// for (let i = 0; i < files.length; i++) { |
|
|
|
// const file = files[i] |
|
|
|
// if (file.type === 'image/jpeg') { |
|
|
|
// validFiles.push(file) |
|
|
|
// } else { |
|
|
|
// this.$message({ message: `文件 ${file.name} 不是 JPG 格式,将忽略该文件`, type: 'error', offset: 8 }) |
|
|
|
// } |
|
|
|
// } |
|
|
|
|
|
|
|
// if (validFiles.length > remainingSlots) { |
|
|
|
// this.$message({ message: `最多只能再上传 ${remainingSlots} 张图片,将只处理部分选择的图片`, type: 'error', offset: 8 }) |
|
|
|
// } |
|
|
|
|
|
|
|
// const numFilesToProcess = Math.min(validFiles.length, remainingSlots) |
|
|
|
// for (let i = 0; i < numFilesToProcess; i++) { |
|
|
|
// const file = validFiles[i] |
|
|
|
// const reader = new FileReader() |
|
|
|
// reader.onload = (e) => { |
|
|
|
// this.imageSources.push(e.target.result) |
|
|
|
// } |
|
|
|
// reader.readAsDataURL(file) |
|
|
|
// this.selectedFiles.push(file) |
|
|
|
// } |
|
|
|
// }, |
|
|
|
submitStepOne() { |
|
|
|
this.$refs.form.validate((valid) => { |
|
|
|
if (valid) { |
|
|
@ -373,12 +401,12 @@ export default { |
|
|
|
if (res.data.code === 200) { |
|
|
|
this.mobileResult = res.data.data |
|
|
|
this.stepOne = false |
|
|
|
this.stepTwo = true |
|
|
|
} else { |
|
|
|
this.$message({ message: res.data.message, type: 'error', offset: 8 }) |
|
|
|
this.mobileResult = null |
|
|
|
} |
|
|
|
this.submitLoading = false |
|
|
|
this.stepTwo = true |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
@ -492,9 +520,23 @@ export default { |
|
|
|
} |
|
|
|
.step-three-text { |
|
|
|
justify-content: flex-start; |
|
|
|
a{ |
|
|
|
font-weight: bold; |
|
|
|
color: #1f55eb; |
|
|
|
div{ |
|
|
|
display: flex; |
|
|
|
justify-content: flex-start; |
|
|
|
align-items: center; |
|
|
|
a{ |
|
|
|
font-weight: bold; |
|
|
|
color: #1f55eb; |
|
|
|
} |
|
|
|
i{ |
|
|
|
font-size: 26px; |
|
|
|
&.icon-shangchuanchenggong{ |
|
|
|
color: #2ECAAC; |
|
|
|
} |
|
|
|
&.icon-shangchuanshibai{ |
|
|
|
color: #ED4A41; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|