Commit a717d4a1 by zhangquan

bug修复

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