8.17下午
This commit is contained in:
parent
79cfae3a26
commit
bfecf71d08
Binary file not shown.
11
resources/frontend/src/api/shop.js
vendored
11
resources/frontend/src/api/shop.js
vendored
@ -18,10 +18,17 @@ export function shopAdd(data) {
|
||||
});
|
||||
}
|
||||
// 店铺列表
|
||||
export function storeList(data) {
|
||||
export function storeList() {
|
||||
return http({
|
||||
url: "/api/shops",
|
||||
method: "get",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
// 下载商品
|
||||
export function downloadGoods(id) {
|
||||
return http({
|
||||
url: `/api/download/${id}/goods`,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
3
resources/frontend/src/util/http.js
vendored
3
resources/frontend/src/util/http.js
vendored
@ -55,12 +55,13 @@ instance.interceptors.response.use(
|
||||
}
|
||||
},
|
||||
(error) => {
|
||||
console.log(error);
|
||||
// 对响应错误做点什么
|
||||
Message({
|
||||
message: error,
|
||||
type: "error",
|
||||
});
|
||||
console.log(error, "44444"); // for debug
|
||||
// console.log(error, "44444"); // for debug
|
||||
// if (error.response.status === 401) {
|
||||
// Message({
|
||||
// message: '账户登录过期,请重新登录',
|
||||
|
||||
@ -21,17 +21,19 @@
|
||||
> 授 权 </a
|
||||
></el-button
|
||||
>
|
||||
<el-button
|
||||
type="danger"
|
||||
v-if="scope.row.status === '重新授权'"
|
||||
target="_blank"
|
||||
><a :href="scope.row.authUrl" rel="noopener noreferrer"
|
||||
>重新授权</a
|
||||
></el-button
|
||||
>
|
||||
<span v-if="scope.row.status === '无需授权'">{{
|
||||
scope.row.status
|
||||
}}</span>
|
||||
<div v-if="scope.row.status === '重新授权'">
|
||||
<el-button type="danger" target="_blank"
|
||||
><a :href="scope.row.authUrl" rel="noopener noreferrer"
|
||||
>重新授权</a
|
||||
></el-button
|
||||
>
|
||||
<el-button @click="download(scope.row)">下载商品</el-button>
|
||||
</div>
|
||||
|
||||
<div v-if="scope.row.status === '无需授权'">
|
||||
<el-button type="success">{{ scope.row.status }}</el-button>
|
||||
<el-button @click="download(scope.row)">下载商品</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -82,7 +84,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { shopListId, shopAdd, storeList } from "../../api/shop";
|
||||
import { shopListId, shopAdd, storeList, downloadGoods } from "../../api/shop";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -159,6 +161,14 @@ export default {
|
||||
this.storeId = res.data.data;
|
||||
});
|
||||
},
|
||||
|
||||
// 下载商品
|
||||
download(row) {
|
||||
// console.log(row);
|
||||
downloadGoods(row.id).then((res) => {
|
||||
console.log(res);
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@ -286,8 +286,8 @@ export default {
|
||||
title: "",
|
||||
sku_code: "",
|
||||
status: "0",
|
||||
num: "",
|
||||
cost: "",
|
||||
num: "0",
|
||||
cost: "0",
|
||||
},
|
||||
],
|
||||
|
||||
@ -388,7 +388,6 @@ export default {
|
||||
},
|
||||
...this.goodschoose,
|
||||
];
|
||||
console.log(this.goodschoose);
|
||||
});
|
||||
},
|
||||
|
||||
@ -401,7 +400,6 @@ export default {
|
||||
goods_id: this.lid,
|
||||
skus: skus,
|
||||
};
|
||||
console.log(updata);
|
||||
addGoods(updata).then((res) => {
|
||||
if (res.statusText === "OK") {
|
||||
this.$message({
|
||||
@ -410,11 +408,6 @@ export default {
|
||||
});
|
||||
this.updateForm();
|
||||
this.$router.push("/GOODS_LIST");
|
||||
} else {
|
||||
this.$message({
|
||||
message: "商品添加失败!",
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -472,16 +465,6 @@ export default {
|
||||
// 商品列表页进入带数据表单
|
||||
getgoodsidData() {
|
||||
let id = this.bigID;
|
||||
// let token = localStorage.getItem("token");
|
||||
// axios
|
||||
// .get(`/api/goods_skus/${id}`, {
|
||||
// headers: {
|
||||
// Authorization: `Bearer ${token}`,
|
||||
// },
|
||||
// })
|
||||
// .then((res) => {
|
||||
// this.goodsData = res.data.data;
|
||||
// });
|
||||
checkGoods(id).then((res) => {
|
||||
this.goodsData = res.data.data;
|
||||
});
|
||||
@ -497,7 +480,7 @@ export default {
|
||||
// console.log("goodsid", this.goodsData.goods_id);
|
||||
let goods = {
|
||||
title: this.goodsData.goods.title,
|
||||
img_url: this.from.img_url,
|
||||
img_url: this.goodsData.goods.img_url,
|
||||
type_id: this.goodsData.goods.type_id,
|
||||
brand_id: this.goodsData.goods.brand_id,
|
||||
goods_code: this.goodsData.goods.goods_code,
|
||||
@ -522,11 +505,11 @@ export default {
|
||||
sku,
|
||||
};
|
||||
updateGoods(id, updateData).then((res) => {
|
||||
this.$router.push("/GOODS_LIST");
|
||||
this.$message({
|
||||
message: "商品编辑成功!",
|
||||
type: "success",
|
||||
});
|
||||
this.$router.push("/GOODS_LIST");
|
||||
});
|
||||
},
|
||||
|
||||
@ -615,8 +598,8 @@ export default {
|
||||
text-align: center;
|
||||
}
|
||||
.avatar {
|
||||
width: 178px;
|
||||
height: 178px;
|
||||
width: 148px;
|
||||
height: 148px;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -203,15 +203,14 @@
|
||||
tooltip-effect="dark"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionChange"
|
||||
max-height="500"
|
||||
>
|
||||
<!-- 多选框 -->
|
||||
<el-table-column type="selection" width="55"></el-table-column>
|
||||
<el-table-column label="商品信息" width="250">
|
||||
<template slot-scope="scope">
|
||||
<div class="commodityimg">
|
||||
<img
|
||||
src="https://bjetxgzv.cdn.bspapp.com/VKCEYUGU-dc-site/c40319b0-6080-11eb-918d-3d24828c498c.png"
|
||||
/>
|
||||
<img :src="scope.row.goods.img_url" class="Img" />
|
||||
</div>
|
||||
<div>
|
||||
<p>{{ scope.row.goods.title }}</p>
|
||||
@ -247,16 +246,10 @@
|
||||
<el-table-column sortable label="今日到货" min-width="110">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="isShow">
|
||||
<el-input
|
||||
v-model="scope.row.daily.arrived_today_num"
|
||||
></el-input>
|
||||
<el-input v-model="scope.row.arrived_today_num11"></el-input>
|
||||
</div>
|
||||
<div v-else>
|
||||
{{
|
||||
scope.row.daily != null
|
||||
? scope.row.daily.arrived_today_num
|
||||
: 0
|
||||
}}
|
||||
{{ scope.row.daily.arrived_today_num }}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -393,10 +386,14 @@
|
||||
</div>
|
||||
|
||||
<!-- 点击库存按钮弹出框 -->
|
||||
<el-dialog title="修改" :visible.sync="ejectstock1" width="30%">
|
||||
<el-dialog
|
||||
title="库存修改"
|
||||
:visible.sync="ejectstock1"
|
||||
width="30%"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-table
|
||||
:data="ommodityInventory"
|
||||
class="table"
|
||||
tooltip-effect="dark"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionChange"
|
||||
@ -432,7 +429,7 @@
|
||||
</el-table>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="ejectstock1 = false">取 消</el-button>
|
||||
<el-button @click="cancelStock()">取 消</el-button>
|
||||
<el-button type="primary" @click="oldStock()"
|
||||
>确 定</el-button
|
||||
>
|
||||
@ -523,8 +520,6 @@ export default {
|
||||
status: "", // 商品状态
|
||||
keyword_value: "", //日期筛选
|
||||
},
|
||||
// cost_input: "", //成本输入input框变量
|
||||
// arrived_today_num: "", //今日到货input框变量
|
||||
Paginationdata: {}, //分页相关数据
|
||||
current_page: 1, //当前页
|
||||
per_page: 15, //每页显示数量
|
||||
@ -591,10 +586,17 @@ export default {
|
||||
per_page: this.per_page,
|
||||
};
|
||||
goods(page).then((res) => {
|
||||
console.log("列表数据", res);
|
||||
this.tableData = res.data.data;
|
||||
this.tableData = this.tableData.map((item) => {
|
||||
item = {
|
||||
...item,
|
||||
arrived_today_num11: 0,
|
||||
};
|
||||
return item;
|
||||
});
|
||||
this.total = res.data.meta.total;
|
||||
this.Paginationdata = res.data.meta;
|
||||
console.log(this.tableData);
|
||||
});
|
||||
},
|
||||
|
||||
@ -625,6 +627,13 @@ export default {
|
||||
}
|
||||
goods(newObj).then((res) => {
|
||||
this.tableData = res.data.data;
|
||||
this.tableData = this.tableData.map((item) => {
|
||||
item = {
|
||||
...item,
|
||||
arrived_today_num11: 0,
|
||||
};
|
||||
return item;
|
||||
});
|
||||
this.total = res.data.meta.total;
|
||||
this.Paginationdata = res.data.meta;
|
||||
});
|
||||
@ -653,10 +662,9 @@ export default {
|
||||
|
||||
// 点击上新
|
||||
update() {
|
||||
// this.dialogVisible = false;
|
||||
this.isShow = true;
|
||||
this.updateType = "newest";
|
||||
this.stock = false;
|
||||
this.updateType = "newest";
|
||||
},
|
||||
// 复选框按钮
|
||||
handleSelectionChange(val) {
|
||||
@ -685,9 +693,9 @@ export default {
|
||||
|
||||
//取消上新or库存盘点
|
||||
cancel() {
|
||||
this.handleChoose();
|
||||
this.isShow = false;
|
||||
this.stock = false;
|
||||
this.getList();
|
||||
},
|
||||
|
||||
// 点击上新or库存盘点后确认
|
||||
@ -699,7 +707,7 @@ export default {
|
||||
{
|
||||
id: item.id,
|
||||
cost: item.cost,
|
||||
arrived_today_num: item.daily.arrived_today_num,
|
||||
arrived_today_num: item.arrived_today_num11,
|
||||
},
|
||||
];
|
||||
});
|
||||
@ -707,10 +715,9 @@ export default {
|
||||
updateType: this.updateType,
|
||||
skus: skus.flat(),
|
||||
};
|
||||
console.log(patchdata);
|
||||
// 上新请求
|
||||
update(patchdata).then((res) => {
|
||||
this.getList();
|
||||
this.handleChoose();
|
||||
this.$message({
|
||||
message: "上新成功!",
|
||||
type: "success",
|
||||
@ -734,16 +741,19 @@ export default {
|
||||
};
|
||||
// 上新请求
|
||||
update(patchdata).then((res) => {
|
||||
this.getList();
|
||||
this.handleChoose();
|
||||
this.$message({
|
||||
message: "库存盘点成功!",
|
||||
type: "success",
|
||||
});
|
||||
});
|
||||
}
|
||||
this.isShow = false;
|
||||
this.stock = false;
|
||||
this.handleChoose();
|
||||
},
|
||||
|
||||
// 点击库存盘点弹出框
|
||||
// 点击库存盘点
|
||||
onCount() {
|
||||
this.dialogVisible2 = false;
|
||||
this.isShow = false;
|
||||
@ -759,6 +769,12 @@ export default {
|
||||
this.ommodityInventory.push(row);
|
||||
},
|
||||
|
||||
//库存弹出框取消
|
||||
cancelStock() {
|
||||
this.handleChoose();
|
||||
this.ejectstock1 = false;
|
||||
},
|
||||
|
||||
// 库存弹出框确认
|
||||
oldStock() {
|
||||
this.ejectstock1 = false;
|
||||
@ -780,7 +796,7 @@ export default {
|
||||
};
|
||||
// 库存请求
|
||||
update(stockpatch).then((res) => {
|
||||
this.getList();
|
||||
this.handleChoose();
|
||||
this.$message({
|
||||
message: "库存更新成功!",
|
||||
type: "success",
|
||||
@ -838,17 +854,6 @@ export default {
|
||||
exportType: this.value,
|
||||
};
|
||||
console.log(data);
|
||||
|
||||
// let token = localStorage.getItem("token");
|
||||
// axios
|
||||
// .get("/api/goods_skus/export", data, {
|
||||
// headers: {
|
||||
// Authorization: `Bearer ${token}`,
|
||||
// },
|
||||
// })
|
||||
// .then((res) => {
|
||||
// console.log(res);
|
||||
// });
|
||||
this.Tableexport = false;
|
||||
},
|
||||
|
||||
@ -946,6 +951,7 @@ export default {
|
||||
loss_num: row.daily.loss_num,
|
||||
};
|
||||
singleUpdate(id, lossData).then((res) => {
|
||||
this.getList();
|
||||
this.id2 = "";
|
||||
this.$message({
|
||||
message: "损耗添加成功!",
|
||||
@ -970,9 +976,9 @@ export default {
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.getList();
|
||||
this.getgoodsType();
|
||||
this.getbrandType();
|
||||
this.getList();
|
||||
this.id = "";
|
||||
this.id1 = "";
|
||||
this.id2 = "";
|
||||
@ -987,6 +993,7 @@ export default {
|
||||
|
||||
.table {
|
||||
margin-top: 40px;
|
||||
position: relative;
|
||||
}
|
||||
.btn {
|
||||
float: right;
|
||||
@ -1006,6 +1013,11 @@ export default {
|
||||
margin-right: 12px;
|
||||
}
|
||||
|
||||
.Img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.confirmbtn {
|
||||
width: 114px;
|
||||
height: 44px;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user