列表页面在展示的时候,需要查询一个商品的信息,然后如果有关联,则删除和修改置灰/禁用
parent
f5fa296f79
commit
4aa9d95877
|
@ -50,3 +50,10 @@ export function changeStatus(data) {
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function have(id){
|
||||||
|
return request({
|
||||||
|
url:"/product/rule/have?id="+id,
|
||||||
|
method:"get"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -90,7 +90,7 @@
|
||||||
|
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope" >
|
<template slot-scope="scope" >
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
|
@ -175,7 +175,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listRule, getRule, delRule, addRule, updateRule } from "@/api/product/rule";
|
import {listRule, getRule, delRule, addRule, updateRule, have} from "@/api/product/rule";
|
||||||
import {changeStatus} from "@/api/product/rule";
|
import {changeStatus} from "@/api/product/rule";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -346,14 +346,23 @@ export default {
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.reset();
|
have(row.id).then(
|
||||||
const id = row.id || this.ids
|
res=>{
|
||||||
getRule(id).then(response => {
|
if (res.data.code==400){
|
||||||
this.form = response.data;
|
this.$modal.msgError(res.data.msg)
|
||||||
this.form.ruleAttrList = response.data.ruleAttrList
|
}else {
|
||||||
this.open = true;
|
this.reset();
|
||||||
this.title = "修改商品规格";
|
const id = row.id || this.ids
|
||||||
});
|
getRule(id).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.form.ruleAttrList = response.data.ruleAttrList
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改商品规格";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 修改状态
|
* 修改状态
|
||||||
|
@ -385,14 +394,23 @@ export default {
|
||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const ids = row.id || this.ids;
|
have(row.id).then(
|
||||||
this.$modal.confirm('是否确认删除商品规格编号为"' + ids + '"的数据项?').then(function () {
|
res=>{
|
||||||
return delRule(ids);
|
if (res.data.code==400){
|
||||||
}).then(() => {
|
this.$modal.msgError(res.data.msg)
|
||||||
this.getList();
|
}else {
|
||||||
this.$modal.msgSuccess("删除成功");
|
const ids = row.id || this.ids;
|
||||||
}).catch(() => {
|
this.$modal.confirm('是否确认删除商品规格编号为"' + ids + '"的数据项?').then(function () {
|
||||||
});
|
return delRule(ids);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
|
|
Loading…
Reference in New Issue