Commit a717d4a1 by zhangquan

bug修复

1 parent 0e7e4f48
......@@ -12,13 +12,13 @@
<el-form :model="storeSearchForm" ref="relate" :inline="true">
<el-form-item label="品牌名称:">
<el-input
v-model.trim="storeSearchForm.label"
v-model.trim="storeSearchForm.brandName"
placeholder="品牌名称"
@keydown.native="handleStoreInput"
clearable
/>
</el-form-item>
<el-button type="primary" @click="handleSearchStore">搜索</el-button>
<el-button type="primary" @click="getSelectingList">搜索</el-button>
</el-form>
<el-row class="tableCon">
<div class="tableBox">
......
......@@ -65,6 +65,7 @@
<div
class="upload-img"
:style="{ width: picOptions.width, height: picOptions.height }"
@click="selectFile()"
>
<i class="el-icon-plus avatar-uploader-desc-icon"></i>
<div class="avatar-uploader-desc-word">
......@@ -72,10 +73,10 @@
</div>
<input
type="file"
ref="uploadImg"
ref="uploadImgRef"
class="upload-img"
:style="{ width: picOptions.width, height: picOptions.height }"
style="opacity: 0"
style="opacity: 0; z-index: -1"
:accept="picOptions.type == 'video' ? '.mp4' : '.jpg, .jpeg, .png,'"
@change="(e) => handleImgChange(e)"
/>
......@@ -126,6 +127,7 @@ export default {
},
data() {
return {
uploading: false,
dialogVisibleImg: false,
dialogSrc: "",
dialogType: ""
......@@ -139,6 +141,12 @@ export default {
this.$set(this.imageUrlArr, e.oldIndex, url)
}
},
selectFile() {
if (this.uploading) {
return this.$message.error(`文件上传中,请耐心等待文件上传完成`)
}
this.$refs.uploadImgRef.click()
},
// 上传图片
handleImgChange(e) {
var file = e.srcElement.files[0]
......@@ -175,6 +183,7 @@ export default {
}上传中,请稍后`
})
this.$emit("beforeUpload")
this.uploading = true
reader.readAsDataURL(file)
reader.onload = (e) => {
const imgFile = e.target.result
......@@ -204,7 +213,8 @@ export default {
}
})
.finally((end) => {
this.$refs.uploadImg && (this.$refs.uploadImg.value = "")
this.uploading = false
this.$refs.uploadImgRef && (this.$refs.uploadImgRef.value = "")
e.target.value = ""
this.$emit("afterUpload", end)
})
......
......@@ -146,12 +146,17 @@ export default {
e.target.value = ""
})
.finally((end) => {
this.$refs.uploadImg.value = ""
this.$refs.uploadImg && (this.$refs.uploadImg.value = "")
this.$emit("afterUpload", end)
})
}
},
toOpenPDF(url) {
if (!url)
return this.$message({
type: "warning",
message: "文件正在上传,请稍后预览"
})
window.open(url)
},
// 删除图片/视频
......
......@@ -113,7 +113,7 @@
:style="{ 'margin-bottom': '22px' }"
>
<el-select
@change="clearTableFn()"
@change="clearTableFn(1)"
:style="{ width: '432px' }"
v-model="formData.scene"
placeholder="请选择"
......@@ -144,7 +144,7 @@
<div>
<el-radio-group
v-model="formData.showMerchant"
@change="clearTableFn()"
@change="clearTableFn(2)"
>
<el-radio :label="0">全部门店</el-radio>
<el-radio :label="2">指定门店</el-radio>
......@@ -178,6 +178,7 @@
"
:tableData="tableData"
:hasPage="false"
:height="tableData.length > 10 ? 350 : ''"
>
<div slot="auth-button" slot-scope="scope">
<el-button
......@@ -232,6 +233,7 @@
v-model.trim="storeSearchForm.merchantName"
placeholder="门店名称"
@keydown.native="handleStoreInput"
maxLength="50"
clearable
/>
</el-form-item>
......@@ -239,6 +241,10 @@
<el-input
v-model.trim="storeSearchForm.merchantId"
placeholder="门店商户号"
@input="
(value) =>
(storeSearchForm.merchantId = value.replace(/[^\d]/g, ''))
"
@keydown.native="handleStoreInput"
clearable
/>
......@@ -247,6 +253,7 @@
<el-input
v-model.trim="storeSearchForm.yqMerchantName"
placeholder="服务对接"
maxLength="50"
@keydown.native="handleStoreInput"
clearable
/>
......@@ -255,6 +262,10 @@
<el-input
v-model.trim="storeSearchForm.yqMerchantId"
placeholder="服务对接商户号"
@input="
(value) =>
(storeSearchForm.yqMerchantId = value.replace(/[^\d]/g, ''))
"
@keydown.native="handleStoreInput"
clearable
/>
......@@ -485,8 +496,11 @@ export default {
}
})
},
clearTableFn() {
this.tableData = []
clearTableFn(type) {
if ((type == 1 && this.formData.showMerchant == 2) || type == 2) {
this.storeSelected = []
this.tableData = []
}
},
getParams(type) {
const params = deepClone(this.formData)
......@@ -555,14 +569,15 @@ export default {
})
},
openMerchantDialog() {
if (!this.formData.scene && this.formData.scene !== 0)
return this.$message.error("请先选择业务场景")
if (this.formData.showMerchant == 1) {
this.brandVisible = true
} else {
this.storeSelected = deepClone(this.tableData)
if (!this.formData.scene && this.formData.scene !== 0) {
return this.$message.error("请先选择业务场景")
}
this.relateStoreVisible = true
}
this.storeSelected = deepClone(this.tableData)
},
handleRelateStoreConfirm(selectedData) {
if (!selectedData.length) {
......@@ -570,6 +585,17 @@ export default {
`请选择${this.formData.showMerchant == 1 ? "品牌" : "门店"}`
)
}
const maxMerNum = 200,
maxBrandNum = 10
if (
this.formData.showMerchant == 1 &&
selectedData?.length > maxBrandNum
) {
return this.$message.error(`品牌最多只能选择${maxBrandNum}个`)
}
if (this.formData.showMerchant == 2 && selectedData?.length > maxMerNum) {
return this.$message.error(`门店最多只能选择${maxMerNum}个`)
}
this.$refs.channelForm.clearValidate("showMerchant")
this.tableData = selectedData
this.handleRelateStoreClose()
......@@ -591,7 +617,6 @@ export default {
this.showImageView = false
},
showEffect() {
console.log(111)
this.showImageView = true
}
}
......
......@@ -172,7 +172,7 @@ export default {
name: "merchantId",
type: "select",
optionList: [],
optionId: "merchantNo",
optionId: "merchantId",
optionLabel: "merchantName"
},
{
......@@ -289,7 +289,7 @@ export default {
this.showFormData.forEach((item, index) => {
if (item.type === "select" && item.name === "merchantId") {
res.unshift({
merchantNo: "",
merchantId: "",
merchantName: "全部"
})
this.$set(this.showFormData[index], "optionList", res)
......@@ -443,7 +443,7 @@ export default {
vertical-align: middle;
}
.merchant-wrap {
max-height: 400px;
overflow-y: auto;
// max-height: 400px;
// overflow-y: auto;
}
</style>
......@@ -64,7 +64,7 @@ export default {
name: "merchantId",
type: "select",
optionList: [],
optionId: "merchantNo",
optionId: "merchantId",
optionLabel: "merchantName"
}
],
......@@ -137,7 +137,7 @@ export default {
// }
if (item.type === "select" && item.name === "merchantId") {
res.unshift({
merchantNo: "",
merchantId: "",
merchantName: "全部"
})
this.$set(this.showFormData[index], "optionList", res)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!