Commit d5b51f3d by 前端

提示

1 parent 3b0ec857
......@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-09-06 09:49:46
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-12-03 15:27:57
* @LastEditTime: 2024-12-04 13:42:32
* @FilePath: \dj-car-life-system\src\views\contentManager\packageConfig\components\addDialog.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
......@@ -42,13 +42,14 @@
</template>
<script>
import { recepitonUpdate } from "@api/contentManager"
import { recepitonUpdate, materialPage } from "@api/contentManager"
import { mapState, mapActions } from "vuex"
export default {
name: "addDialog",
data() {
return {
formData: { merchantId: "" },
merchantIdBrandList: [],
loading: false
}
},
......@@ -65,6 +66,12 @@ export default {
this.loading = true
await this.getMerchantIdList()
this.loading = false
console.log(this.cloneId, "cloneId")
if (this.cloneId) {
materialPage({ pageSize: 1000, currentPage: 1 }).then((res) => {
this.merchantIdBrandList = res.list.map((i) => i.merchantId)
})
}
},
methods: {
...mapActions("d2admin/merchant", ["getMerchantIdList"]),
......@@ -73,6 +80,7 @@ export default {
if (!merchantId) {
return this.$message.error("请选择门店")
}
const merchantName = this.merchantIdList.find(
(i) => i.merchantId === merchantId
).merchantName
......@@ -83,6 +91,27 @@ export default {
merchantName,
copyMerchantId: this.cloneId
}
if (this.merchantIdBrandList.includes(merchantId)) {
this.$confirm("该门店下已包含素材,是否复制替换?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
closeOnClickModal: false
})
.then(() => {
recepitonUpdate(params).then((res) => {
if (res) {
this.handleClose()
this.$message.success("操作成功")
}
})
})
.catch((err) => {
console.log(err)
})
return
}
}
recepitonUpdate(params).then((res) => {
if (res) {
......
......@@ -15,7 +15,7 @@
<el-button
size="small"
icon="el-icon-plus"
v-if="merchantId && configInfo.length != 20"
v-if="merchantId && configInfo.length != 10"
@click="bandleAddBrand"
>
新增
......@@ -961,12 +961,23 @@ export default {
this.caseVisible = false
},
removeBrandTab(name) {
const index = this.configInfo.findIndex((i) => i.carModelName == name)
this.configInfo.splice(index, 1)
if (name == this.packageName) {
const len = this.configInfo.length - 1
this.packageName = this.configInfo[len].carModelName
}
this.$confirm("该车型下包含素材,是否清空删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
closeOnClickModal: false
})
.then(() => {
const index = this.configInfo.findIndex((i) => i.carModelName == name)
this.configInfo.splice(index, 1)
if (name == this.packageName) {
const len = this.configInfo.length - 1
this.packageName = this.configInfo[len].carModelName
}
})
.catch((err) => {
console.log(err)
})
},
removeTab(targetName, tab) {
if (targetName == "窗膜") {
......
......@@ -35,7 +35,11 @@
<el-button type="text" @click="handleEdit(scope.scope)">
编辑
</el-button>
<el-button type="text" @click="handleClone(scope.scope)">
<el-button
type="text"
@click="handleClone(scope.scope)"
v-if="scope.scope.merchantId"
>
复制素材
</el-button>
</div>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!