Commit 5d7efccc by LJM

库存导入显示问题

parent d5b73a7f
Showing with 72 additions and 3 deletions
...@@ -12,8 +12,13 @@ ...@@ -12,8 +12,13 @@
<span v-else-if="detailInfo.status==4" class="f-red1">其他失败</span> <span v-else-if="detailInfo.status==4" class="f-red1">其他失败</span>
</div> </div>
</div> </div>
<div class="btn-nav clr">
<el-button type="primary" @click="changeStatus(1)">上架</el-button>
<el-button type="primary" @click="changeStatus(3)">下架</el-button>
</div>
<div class="data-box" v-if="tableData"> <div class="data-box" v-if="tableData">
<el-table :data="tableData" border max-height="600"> <el-table :data="tableData" border max-height="600" @selection-change="handleSelectionChange">
<el-table-column fixed type="selection" width="40"></el-table-column>
<el-table-column fixed prop="item_id" label="ID" width="75"></el-table-column> <el-table-column fixed prop="item_id" label="ID" width="75"></el-table-column>
<el-table-column prop="status" fixed label="状态" width="100" align="center"> <el-table-column prop="status" fixed label="状态" width="100" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -27,6 +32,12 @@ ...@@ -27,6 +32,12 @@
<el-table-column fixed prop="goods_sn" label="供应商内部型号编码" width="180"></el-table-column> <el-table-column fixed prop="goods_sn" label="供应商内部型号编码" width="180"></el-table-column>
<el-table-column fixed prop="goods_name" label="型号" width="180"></el-table-column> <el-table-column fixed prop="goods_name" label="型号" width="180"></el-table-column>
<el-table-column fixed prop="brand_name" label="品牌" width="180"></el-table-column> <el-table-column fixed prop="brand_name" label="品牌" width="180"></el-table-column>
<el-table-column prop="goods_status_name" label="状态" width="80">
<template slot-scope="scope">
<el-tag v-if="scope.row.goods_status_name=='上架'" type="success">{{ scope.row.goods_status_name }}</el-tag>
<el-tag v-else-if="scope.row.goods_status_name=='下架'" type="info">{{ scope.row.goods_status_name }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="stock" label="库存数量" width="150"></el-table-column> <el-table-column prop="stock" label="库存数量" width="150"></el-table-column>
<el-table-column prop="moq" label="起订量" width="150"></el-table-column> <el-table-column prop="moq" label="起订量" width="150"></el-table-column>
<el-table-column prop="mpq" label="标准包装量" width="150"></el-table-column> <el-table-column prop="mpq" label="标准包装量" width="150"></el-table-column>
...@@ -42,7 +53,7 @@ ...@@ -42,7 +53,7 @@
</template> </template>
</template> </template>
</el-table> </el-table>
<el-pagination layout="prev, pager, next,jumper" :page-size="limit" :total="total" @current-change="handleCurrentChange" :current-page="page"></el-pagination> <el-pagination layout="total, sizes, prev, pager, next, jumper" :page-sizes="[10, 20, 50, 100, 200]" :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page"></el-pagination>
</div> </div>
<Menu/> <Menu/>
</div> </div>
...@@ -64,7 +75,8 @@ export default { ...@@ -64,7 +75,8 @@ export default {
limit: 10, limit: 10,
page: 1, page: 1,
tableData: "", tableData: "",
maxPrice: [] maxPrice: [],
multipleSelection: []
}; };
}, },
watch: { watch: {
...@@ -91,6 +103,53 @@ export default { ...@@ -91,6 +103,53 @@ export default {
} }
}) })
}, },
handleSelectionChange(val) {
this.multipleSelection = val;
},
changeStatus(status) {
var self=this;
var arr = [];
if (this.multipleSelection.length == 0) {
this.$message({
message: '请至少选择一条数据',
type: 'warning'
});
return false;
}
var status_arr = this.multipleSelection.map(obj => {
return obj.status;
})
let flag = status_arr.every(ele => ele === 3)
if (!flag) {
this.$message({
message: '选择审核通过的',
type: 'warning'
});
return false;
}
arr = this.multipleSelection.map(obj => {
return obj.sku_id;
});
this.$http('POST', "/api/sku/updateSkuStatus", {
sku_ids: arr.join(","),
status: status == 1 ? 'passed' : 'offshelf'
}).then(res => {
if (res.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
onClose(){
self.getList()
}
});
} else {
this.$message({
message: res.msg,
type: 'error'
});
}
})
},
getList() { getList() {
this.$http('get', "/api/uploadSku/itemList", { this.$http('get', "/api/uploadSku/itemList", {
page: this.page, page: this.page,
...@@ -119,6 +178,10 @@ export default { ...@@ -119,6 +178,10 @@ export default {
} }
}) })
}, },
handleSizeChange(val) {
this.limit = val;
this.getList();
},
handleCurrentChange(val) { handleCurrentChange(val) {
this.page = val; this.page = val;
this.getList(); this.getList();
...@@ -131,4 +194,9 @@ export default { ...@@ -131,4 +194,9 @@ export default {
</script> </script>
<style scoped> <style scoped>
@import "../../assets/css/store/listDetail.min.css"; @import "../../assets/css/store/listDetail.min.css";
.btn-nav {
background: #FFFFFF;
padding: 0 0 20px 20px;
}
</style> </style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment