Commit d5b51f3d by 前端

提示

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