|
@@ -21,19 +21,19 @@
|
|
|
<div style="margin-top: 15px">
|
|
|
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
|
|
|
<el-form-item label="输入搜索:">
|
|
|
- <el-input style="width: 203px" v-model="listQuery.keyword" placeholder="产品名称"></el-input>
|
|
|
+ <el-input style="width: 203px" v-model="listQuery.name" placeholder="产品名称"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="产品分类:">
|
|
|
<el-cascader
|
|
|
clearable
|
|
|
:props="categoryProp()"
|
|
|
- v-model="selectProductCateValue"
|
|
|
+ v-model="listQuery.productCategoryIds "
|
|
|
:options="productCateOptions">
|
|
|
</el-cascader>
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="上架状态:">
|
|
|
- <el-select v-model="listQuery.publishStatus" placeholder="全部" clearable>
|
|
|
+ <el-select v-model="listQuery.ifShow" placeholder="全部" clearable>
|
|
|
<el-option
|
|
|
v-for="item in publishStatusOptions"
|
|
|
:key="item.value"
|
|
@@ -89,8 +89,8 @@
|
|
|
<p>上架:
|
|
|
<el-switch
|
|
|
@change="handlePublishStatusChange(scope.$index, scope.row)"
|
|
|
- :active-value="1"
|
|
|
- :inactive-value="0"
|
|
|
+ :active-value="true"
|
|
|
+ :inactive-value="false"
|
|
|
v-model="scope.row.publishStatus">
|
|
|
</el-switch>
|
|
|
</p>
|
|
@@ -102,14 +102,14 @@
|
|
|
v-model="scope.row.newStatus">
|
|
|
</el-switch>
|
|
|
</p> -->
|
|
|
- <p>推荐:
|
|
|
+ <!-- <p>推荐:
|
|
|
<el-switch
|
|
|
@change="handleRecommendStatusChange(scope.$index, scope.row)"
|
|
|
:active-value="1"
|
|
|
:inactive-value="0"
|
|
|
v-model="scope.row.recommandStatus">
|
|
|
</el-switch>
|
|
|
- </p>
|
|
|
+ </p> -->
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="排序" width="100" align="center">
|
|
@@ -181,14 +181,13 @@
|
|
|
<script>
|
|
|
|
|
|
const defaultListQuery = {
|
|
|
- keyword: null,
|
|
|
+ name: null,
|
|
|
current: 1,
|
|
|
size: 10,
|
|
|
- publishStatus: null,
|
|
|
- verifyStatus: null,
|
|
|
- productSn: null,
|
|
|
- productCategoryId: null,
|
|
|
- brandId: null
|
|
|
+ ifShow: null,
|
|
|
+ sourceFrom: null,
|
|
|
+ productCategoryIds : null,
|
|
|
+ bestSellingBrand : null
|
|
|
};
|
|
|
export default {
|
|
|
name: "productList",
|
|
@@ -205,29 +204,9 @@
|
|
|
value: "publishOff"
|
|
|
},
|
|
|
{
|
|
|
- label: "设为推荐",
|
|
|
- value: "recommendOn"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "取消推荐",
|
|
|
- value: "recommendOff"
|
|
|
- },
|
|
|
- // {
|
|
|
- // label: "设为新品",
|
|
|
- // value: "newOn"
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: "取消新品",
|
|
|
- // value: "newOff"
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: "转移到分类",
|
|
|
- // value: "transferCategory"
|
|
|
- // },
|
|
|
- // {
|
|
|
- // label: "移入回收站",
|
|
|
- // value: "recycle"
|
|
|
- // }
|
|
|
+ label: "删除",
|
|
|
+ value: "delete"
|
|
|
+ }
|
|
|
],
|
|
|
operateType: null,
|
|
|
listQuery: Object.assign({}, defaultListQuery),
|
|
@@ -238,10 +217,10 @@
|
|
|
multipleSelection: [],
|
|
|
productCateOptions: [],
|
|
|
publishStatusOptions: [{
|
|
|
- value: 1,
|
|
|
+ value: true,
|
|
|
label: '上架'
|
|
|
}, {
|
|
|
- value: 0,
|
|
|
+ value: false,
|
|
|
label: '下架'
|
|
|
}],
|
|
|
|
|
@@ -252,14 +231,14 @@
|
|
|
// this.getProductCateList();
|
|
|
},
|
|
|
watch: {
|
|
|
- selectProductCateValue: function (newValue) {
|
|
|
- if (newValue != null && newValue.length == 2) {
|
|
|
- this.listQuery.productCategoryId = newValue[1];
|
|
|
- } else {
|
|
|
- this.listQuery.productCategoryId = null;
|
|
|
- }
|
|
|
+ // selectProductCateValue: function (newValue) {
|
|
|
+ // if (newValue != null && newValue.length == 2) {
|
|
|
+ // this.listQuery.productCategoryId = newValue[1];
|
|
|
+ // } else {
|
|
|
+ // this.listQuery.productCategoryId = null;
|
|
|
+ // }
|
|
|
|
|
|
- }
|
|
|
+ // }
|
|
|
},
|
|
|
filters: {
|
|
|
|
|
@@ -345,34 +324,21 @@
|
|
|
for(let i=0;i<this.multipleSelection.length;i++){
|
|
|
ids.push(this.multipleSelection[i].id);
|
|
|
}
|
|
|
+
|
|
|
switch (this.operateType) {
|
|
|
- case this.operates[0].value:
|
|
|
- this.updatePublishStatus(1,ids);
|
|
|
+ case 'publishOn'://产品上架
|
|
|
+ this.updatePublishStatus(true,ids);
|
|
|
break;
|
|
|
- case this.operates[1].value:
|
|
|
- this.updatePublishStatus(0,ids);
|
|
|
+ case 'publishOff'://产品下架
|
|
|
+ this.updatePublishStatus(false,ids);
|
|
|
break;
|
|
|
- case this.operates[2].value:
|
|
|
- this.updateRecommendStatus(1,ids);
|
|
|
- break;
|
|
|
- case this.operates[3].value:
|
|
|
- this.updateRecommendStatus(0,ids);
|
|
|
- break;
|
|
|
- case this.operates[4].value:
|
|
|
- this.updateNewStatus(1,ids);
|
|
|
- break;
|
|
|
- case this.operates[5].value:
|
|
|
- this.updateNewStatus(0,ids);
|
|
|
- break;
|
|
|
- case this.operates[6].value:
|
|
|
- break;
|
|
|
- case this.operates[7].value:
|
|
|
- this.updateDeleteStatus(1,ids);
|
|
|
+ case 'delete'://删除
|
|
|
+ this.updateDeleteStatus(ids);
|
|
|
break;
|
|
|
+
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
- this.getList();
|
|
|
});
|
|
|
},
|
|
|
//改变页大小
|
|
@@ -390,21 +356,26 @@
|
|
|
handleSelectionChange(val) {
|
|
|
this.multipleSelection = val;
|
|
|
},
|
|
|
- //修改产品状态
|
|
|
+ //修改产品状态(上架/下架)
|
|
|
handlePublishStatusChange(index, row) {
|
|
|
let ids = [];
|
|
|
ids.push(row.id);
|
|
|
this.updatePublishStatus(row.publishStatus, ids);
|
|
|
},
|
|
|
- handleNewStatusChange(index, row) {
|
|
|
- let ids = [];
|
|
|
- ids.push(row.id);
|
|
|
- this.updateNewStatus(row.newStatus, ids);
|
|
|
- },
|
|
|
- handleRecommendStatusChange(index, row) {
|
|
|
- let ids = [];
|
|
|
- ids.push(row.id);
|
|
|
- this.updateRecommendStatus(row.recommandStatus, ids);
|
|
|
+ //修改产品状态
|
|
|
+ updatePublishStatus(publishStatus, ids) {
|
|
|
+ var params = {
|
|
|
+ ids:ids,
|
|
|
+ ifShow:publishStatus
|
|
|
+ }
|
|
|
+ updatePublishStatus(params).then(response => {
|
|
|
+ this.$message({
|
|
|
+ message: '修改成功',
|
|
|
+ type: 'success',
|
|
|
+ duration: 1000
|
|
|
+ });
|
|
|
+ this.getList()
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
//重置查询条件
|
|
@@ -421,59 +392,14 @@
|
|
|
}).then(() => {
|
|
|
let ids = [];
|
|
|
ids.push(row.id);
|
|
|
- this.updateDeleteStatus(1,ids);
|
|
|
- });
|
|
|
- },
|
|
|
- //更新产品
|
|
|
- handleUpdateProduct(index,row){
|
|
|
- this.$router.push({path:'/pms/updateProduct',query:{id:row.id}});
|
|
|
- },
|
|
|
- //查看产品
|
|
|
- handleShowProduct(index,row){
|
|
|
- console.log("handleShowProduct",row);
|
|
|
- },
|
|
|
- //修改产品状态
|
|
|
- updatePublishStatus(publishStatus, ids) {
|
|
|
- let params = new URLSearchParams();
|
|
|
- params.append('ids', ids);
|
|
|
- params.append('publishStatus', publishStatus);
|
|
|
- updatePublishStatus(params).then(response => {
|
|
|
- this.$message({
|
|
|
- message: '修改成功',
|
|
|
- type: 'success',
|
|
|
- duration: 1000
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
- updateNewStatus(newStatus, ids) {
|
|
|
- let params = new URLSearchParams();
|
|
|
- params.append('ids', ids);
|
|
|
- params.append('newStatus', newStatus);
|
|
|
- updateNewStatus(params).then(response => {
|
|
|
- this.$message({
|
|
|
- message: '修改成功',
|
|
|
- type: 'success',
|
|
|
- duration: 1000
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
- updateRecommendStatus(recommendStatus, ids) {
|
|
|
- let params = new URLSearchParams();
|
|
|
- params.append('ids', ids);
|
|
|
- params.append('recommendStatus', recommendStatus);
|
|
|
- updateRecommendStatus(params).then(response => {
|
|
|
- this.$message({
|
|
|
- message: '修改成功',
|
|
|
- type: 'success',
|
|
|
- duration: 1000
|
|
|
- });
|
|
|
+ this.updateDeleteStatus(ids);
|
|
|
});
|
|
|
},
|
|
|
//删除产品
|
|
|
- updateDeleteStatus(deleteStatus, ids) {
|
|
|
- let params = new URLSearchParams();
|
|
|
- params.append('ids', ids);
|
|
|
- params.append('deleteStatus', deleteStatus);
|
|
|
+ updateDeleteStatus( ids) {
|
|
|
+ var params = {
|
|
|
+ ids:ids
|
|
|
+ }
|
|
|
updateDeleteStatus(params).then(response => {
|
|
|
this.$message({
|
|
|
message: '删除成功',
|
|
@@ -482,7 +408,21 @@
|
|
|
});
|
|
|
});
|
|
|
this.getList();
|
|
|
- }
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ //更新产品
|
|
|
+ handleUpdateProduct(index,row){
|
|
|
+ this.$router.push({path:'/pms/updateProduct',query:{id:row.id}});
|
|
|
+ },
|
|
|
+ //查看产品
|
|
|
+ handleShowProduct(index,row){
|
|
|
+ console.log("handleShowProduct",row);
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
</script>
|