属性组和商品规格的状态的修改
parent
642c12457c
commit
b09cb3270e
|
@ -43,3 +43,13 @@ export function delAttributeGroup(id) {
|
|||
})
|
||||
}
|
||||
|
||||
//修改状态
|
||||
|
||||
export function changeStatus(data) {
|
||||
return request({
|
||||
url: '/product/attributeGroup/'+data.id,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -42,3 +42,11 @@ export function delRule(id) {
|
|||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function changeStatus(data) {
|
||||
return request({
|
||||
url: '/product/rule/'+data.id,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
|
|
@ -34,7 +34,8 @@
|
|||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['product:attributeGroup:add']"
|
||||
>新增</el-button>
|
||||
>新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
|
@ -45,7 +46,8 @@
|
|||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['product:attributeGroup:edit']"
|
||||
>修改</el-button>
|
||||
>修改
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
|
@ -56,7 +58,8 @@
|
|||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['product:attributeGroup:remove']"
|
||||
>删除</el-button>
|
||||
>删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
|
@ -66,7 +69,8 @@
|
|||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['product:attributeGroup:export']"
|
||||
>导出</el-button>
|
||||
>导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
@ -81,10 +85,36 @@
|
|||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="状态" align="center" prop="states">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.states"/>
|
||||
<!-- <el-switch-->
|
||||
<!-- v-model="scope.row.states"-->
|
||||
<!-- style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"-->
|
||||
<!-- active-value="100"-->
|
||||
<!-- inactive-value="0"-->
|
||||
<!-- active-text="是"-->
|
||||
<!-- inactive-text="否"-->
|
||||
<!-- />-->
|
||||
|
||||
<el-switch @change="handleStateChange(scope.row)"
|
||||
v-model="scope.row.states"
|
||||
style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
|
||||
active-value="Y"
|
||||
inactive-value="N"
|
||||
active-text="是"
|
||||
inactive-text="否"
|
||||
/>
|
||||
|
||||
</template>
|
||||
<!-- <el-switch-->
|
||||
<!-- v-model="value"-->
|
||||
<!-- active-color="#13ce66"-->
|
||||
<!-- inactive-color="#ff4949"-->
|
||||
<!-- active-text="是"-->
|
||||
<!-- inactive-text="否">-->
|
||||
<!-- </el-switch>-->
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
|
@ -95,14 +125,16 @@
|
|||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['product:attributeGroup:edit']"
|
||||
>修改</el-button>
|
||||
>修改
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['product:attributeGroup:remove']"
|
||||
>删除</el-button>
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -131,7 +163,8 @@
|
|||
v-for="dict in dict.type.sys_yes_no"
|
||||
:key="dict.value"
|
||||
:label="dict.value"
|
||||
>{{dict.label}}</el-radio>
|
||||
>{{ dict.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
@ -152,13 +185,21 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { listAttributeGroup, getAttributeGroup, delAttributeGroup, addAttributeGroup, updateAttributeGroup } from "@/api/product/attributeGroup";
|
||||
import {
|
||||
listAttributeGroup,
|
||||
getAttributeGroup,
|
||||
delAttributeGroup,
|
||||
addAttributeGroup,
|
||||
updateAttributeGroup,
|
||||
changeStatus
|
||||
} from "@/api/product/attributeGroup";
|
||||
|
||||
export default {
|
||||
name: "AttributeGroup",
|
||||
dicts: ['sys_yes_no'],
|
||||
data() {
|
||||
return {
|
||||
value: true,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
|
@ -260,6 +301,14 @@ export default {
|
|||
this.title = "修改属性组";
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 修改状态
|
||||
*/
|
||||
handleStateChange(row) {
|
||||
changeStatus(row).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
|
@ -288,14 +337,17 @@ export default {
|
|||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('product/attributeGroup/export', {
|
||||
...this.queryParams
|
||||
}, `attributeGroup_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
|
|
|
@ -71,13 +71,23 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规格属性值" align="center" prop="name" >
|
||||
|
||||
<template slot-scope="scope">
|
||||
<el-row v-for="ruleAttr in scope.row.ruleAttrList"><span>{{ruleAttr.valueList.toString()}}</span></el-row>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规格状态" align="center" prop="status" />
|
||||
<el-table-column label="规格状态" align="center" prop="status" >
|
||||
<template slot-scope="scope">
|
||||
<el-switch @change="handleStateChange(scope.row)"
|
||||
v-model="scope.row.states"
|
||||
style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
|
||||
active-value="Y"
|
||||
inactive-value="N"
|
||||
active-text="是"
|
||||
inactive-text="否"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope" >
|
||||
|
@ -166,11 +176,13 @@
|
|||
|
||||
<script>
|
||||
import { listRule, getRule, delRule, addRule, updateRule } from "@/api/product/rule";
|
||||
import {changeStatus} from "@/api/product/rule";
|
||||
|
||||
export default {
|
||||
name: "Rule",
|
||||
data() {
|
||||
return {
|
||||
value: true,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
|
@ -342,6 +354,14 @@ export default {
|
|||
this.title = "修改商品规格";
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 修改状态
|
||||
*/
|
||||
handleStateChange(row) {
|
||||
changeStatus(row).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
|
|
Loading…
Reference in New Issue