Commit 7614eb7f by zhangquan

更换门店弹窗

1 parent 4811da74
...@@ -122,7 +122,9 @@ export default { ...@@ -122,7 +122,9 @@ export default {
}, },
data() { data() {
return { return {
dialogVisibleImg: false dialogVisibleImg: false,
dialogSrc: "",
dialogType: ""
} }
}, },
methods: { methods: {
......
...@@ -42,15 +42,6 @@ ...@@ -42,15 +42,6 @@
/> />
</div> </div>
</template> </template>
<el-dialog
class="image-dialog"
:visible.sync="dialogVisibleImg"
:append-to-body="true"
width="50%"
>
<img :src="dialogSrc" width="100%" v-if="dialogType == 'img'" />
<!-- <video width="100%" autoplay controls :src="dialogSrc" v-else></video> -->
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
...@@ -160,12 +151,6 @@ export default { ...@@ -160,12 +151,6 @@ export default {
}) })
} }
}, },
// 预览图文
handleEnlarge(src, type) {
this.dialogVisibleImg = true
this.dialogSrc = src
this.dialogType = type ? type : "img"
},
// 删除图片/视频 // 删除图片/视频
delFile(index) { delFile(index) {
this.imageUrlArr.splice(index, 1) this.imageUrlArr.splice(index, 1)
......
...@@ -204,13 +204,64 @@ ...@@ -204,13 +204,64 @@
> >
</div> </div>
</div> </div>
<merchantDialog <!-- <merchantDialog
v-if="merchantVisible" v-if="merchantVisible"
:dialogVisible="merchantVisible" :dialogVisible="merchantVisible"
:config="{ scene: formData.scene, type: formData.showMerchant }" :config="{ scene: formData.scene, type: formData.showMerchant }"
@confirmDialogFn="confirmDialogFn" @confirmDialogFn="confirmDialogFn"
@closeDialogFn="closeDialogFn" @closeDialogFn="closeDialogFn"
></merchantDialog> ></merchantDialog> -->
<relate-store-dialog
v-if="relateStoreVisible"
ref="formRelateStore"
:relate-store-visible="relateStoreVisible"
:store-api="
[1, 2, 3].includes(formData.scene) ? getList : getAccountMerchantList
"
:store-search-form="storeSearchForm"
:store-selected="storeSelected"
:selected-scene="formData.scene"
@handleRelateStoreConfirm="handleRelateStoreConfirm"
@handleRelateStoreClose="handleRelateStoreClose"
>
<el-row slot>
<el-form :model="storeSearchForm" ref="relate" :inline="true">
<el-form-item label="门店名称:">
<el-input
v-model.trim="storeSearchForm.merchantName"
placeholder="门店名称"
@keydown.native="handleStoreInput"
clearable
/>
</el-form-item>
<el-form-item label="门店商户号:">
<el-input
v-model.trim="storeSearchForm.merchantId"
placeholder="门店商户号"
@keydown.native="handleStoreInput"
clearable
/>
</el-form-item>
<el-form-item label="服务对接:">
<el-input
v-model.trim="storeSearchForm.yqMerchantName"
placeholder="服务对接"
@keydown.native="handleStoreInput"
clearable
/>
</el-form-item>
<el-form-item label="服务对接商户号:">
<el-input
v-model.trim="storeSearchForm.yqMerchantId"
placeholder="服务对接商户号"
@keydown.native="handleStoreInput"
clearable
/>
</el-form-item>
<el-button type="primary" @click="handleSearchStore">搜索</el-button>
</el-form>
</el-row>
</relate-store-dialog>
<brandDialog <brandDialog
v-if="brandVisible" v-if="brandVisible"
:dialogVisible="brandVisible" :dialogVisible="brandVisible"
...@@ -229,7 +280,9 @@ import { SCENE_OPTIONS } from "./constant" ...@@ -229,7 +280,9 @@ import { SCENE_OPTIONS } from "./constant"
import preview from "./components/preview" import preview from "./components/preview"
import uploadPdf from "./components/uploadPdf" import uploadPdf from "./components/uploadPdf"
import merchantDialog from "./components/merchantDialog" import merchantDialog from "./components/merchantDialog"
import relateStoreDialog from "@/views/goods/grounding/components/relateStoreDialog.vue"
import brandDialog from "./components/brandDialog" import brandDialog from "./components/brandDialog"
import { getList, getAccountMerchantList } from "@/api/merchant"
import { import {
addContent, addContent,
updateContent, updateContent,
...@@ -241,10 +294,21 @@ export default { ...@@ -241,10 +294,21 @@ export default {
glsxPreview: preview, glsxPreview: preview,
uploadPdf, uploadPdf,
merchantDialog: merchantDialog, merchantDialog: merchantDialog,
brandDialog: brandDialog brandDialog: brandDialog,
relateStoreDialog
}, },
data() { data() {
return { return {
getList,
getAccountMerchantList,
relateStoreVisible: false,
storeSearchForm: {
merchantName: "",
merchantId: "",
yqMerchantName: "",
yqMerchantId: ""
},
storeSelected: [],
merchantVisible: false, merchantVisible: false,
brandVisible: false, brandVisible: false,
tableData: [], tableData: [],
...@@ -348,7 +412,7 @@ export default { ...@@ -348,7 +412,7 @@ export default {
}, },
{ {
label: "园区店号", label: "园区店号",
prop: "merchantNo" prop: "merchantId"
} }
] ]
}, },
...@@ -382,7 +446,7 @@ export default { ...@@ -382,7 +446,7 @@ export default {
if (res) { if (res) {
for (const key in this.formData) { for (const key in this.formData) {
if (key == "cover") { if (key == "cover") {
this.formData[key] = [res[key]] this.formData[key] = res[key] ? [res[key]] : []
} else if (key == "imageList") { } else if (key == "imageList") {
if (res.type != 2) { if (res.type != 2) {
this.formData[key] = res.detailInfos?.map((item) => item.image) this.formData[key] = res.detailInfos?.map((item) => item.image)
...@@ -393,7 +457,21 @@ export default { ...@@ -393,7 +457,21 @@ export default {
this.formData[key] = res[key] this.formData[key] = res[key]
} }
} }
this.tableData = res?.assignInfos || [] if (res.showMerchant) {
this.tableData =
res?.assignInfos.map((item) => {
const { assignId, assignName } = item
return res.showMerchant == 2
? {
merchantId: assignId,
merchantName: assignName
}
: {
id: assignId,
label: assignName
}
}) || []
}
} }
}) })
}, },
...@@ -408,7 +486,7 @@ export default { ...@@ -408,7 +486,7 @@ export default {
return { return {
assignName: assignName:
params.showMerchant == 2 ? item.merchantName : item.label, params.showMerchant == 2 ? item.merchantName : item.label,
assignId: params.showMerchant == 2 ? item.merchantNo : item.id assignId: params.showMerchant == 2 ? item.merchantId : item.id
} }
}) })
params.assignInfoList = list params.assignInfoList = list
...@@ -426,7 +504,7 @@ export default { ...@@ -426,7 +504,7 @@ export default {
return params return params
}, },
confirmAdd(type) { confirmAdd(type) {
this.$confirm("删除后内容不可恢复", "提示", { this.$confirm("是否确认保存", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning"
...@@ -446,7 +524,9 @@ export default { ...@@ -446,7 +524,9 @@ export default {
const params = this.getParams(type) const params = this.getParams(type)
addContent(params).then((res) => { addContent(params).then((res) => {
if (res) { if (res) {
this.$message.success(`${params.id ? "修改" : "新增"}成功`) this.$message.success(
`${!type ? "保存草稿" : params.id ? "修改" : "新增"}成功`
)
this.handleCancel() this.handleCancel()
} }
}) })
...@@ -462,11 +542,30 @@ export default { ...@@ -462,11 +542,30 @@ export default {
if (this.formData.showMerchant == 1) { if (this.formData.showMerchant == 1) {
this.brandVisible = true this.brandVisible = true
} else { } else {
this.merchantVisible = true this.storeSelected = deepClone(this.tableData)
this.relateStoreVisible = true
}
},
handleRelateStoreConfirm(selectedData) {
if (!selectedData.length) {
return this.$message.error("请选择门店")
} }
this.$refs.channelForm.clearValidate("showMerchant")
this.tableData = selectedData
this.relateStoreVisible = false
},
handleRelateStoreClose() {
this.relateStoreVisible = false
},
handleStoreInput(e) {
e.keyCode === 13 && this.handleSearchStore()
},
handleSearchStore() {
this.$refs.formRelateStore.handleCurrentChange(1)
}, },
confirmDialogFn(e) { confirmDialogFn(e) {
this.closeDialogFn() this.closeDialogFn()
this.$refs.channelForm.clearValidate("showMerchant")
this.$nextTick(() => { this.$nextTick(() => {
this.tableData = e || [] this.tableData = e || []
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!