2022.8.16

This commit is contained in:
yezhenman 2022-08-16 19:57:31 +08:00
parent f63d72a59a
commit 79cfae3a26
10 changed files with 135 additions and 76 deletions

BIN
resources/frontend/dist.zip Normal file

Binary file not shown.

View File

@ -57,3 +57,13 @@ export function singleUpdate(id, data) {
data, data,
}); });
} }
// 图片上传
export function imgUpload(data, item) {
return http({
url: "/api/upload",
Headers: item,
method: "post",
data,
});
}

View File

@ -1,6 +1,6 @@
import Vue from "vue"; import Vue from "vue";
import VueRouter from "vue-router"; import VueRouter from "vue-router";
import axios from "axios"; // import axios from "axios";
Vue.use(VueRouter); Vue.use(VueRouter);

View File

@ -57,7 +57,7 @@ const list = [
component: () => import("../views/shuju/record.vue"), component: () => import("../views/shuju/record.vue"),
}, },
{ {
path: "/index/yingyeting/addgoods", path: "ADDGOODS",
name: "新建商品", name: "新建商品",
component: () => import("../views/yingyeting/addgoods/addgoods.vue"), component: () => import("../views/yingyeting/addgoods/addgoods.vue"),
}, },
@ -67,10 +67,10 @@ const list = [
}, },
], ],
}, },
{ // {
path: "/", // path: "/",
redirect: "/index", // redirect: "/index",
}, // },
]; ];
export default list; export default list;

View File

@ -50,7 +50,7 @@
</li> </li>
</ul> </ul>
</div> </div>
<div class="table" v-if="levelData.length"> <!-- <div class="table" v-if="levelData.length">
<ul> <ul>
<li><i class="el-icon-arrow-left" @click="hanlebottom"></i></li> <li><i class="el-icon-arrow-left" @click="hanlebottom"></i></li>
<li> <li>
@ -79,7 +79,7 @@
</li> </li>
<li><i class="el-icon-arrow-right" @click="hanletop"></i></li> <li><i class="el-icon-arrow-right" @click="hanletop"></i></li>
</ul> </ul>
</div> </div> -->
<div class="box-card"> <div class="box-card">
<router-view></router-view> <router-view></router-view>
</div> </div>
@ -112,7 +112,7 @@ export default {
// table // table
$route: { $route: {
handler: function (val) { handler: function (val) {
console.log("0.0", val); // console.log("0.0", val);
this.titie = val.matched; this.titie = val.matched;
this.head = val.name; this.head = val.name;
this.levelData.push({ name: val.name, path: val.path }); this.levelData.push({ name: val.name, path: val.path });
@ -126,7 +126,7 @@ export default {
} }
this.levelData = newArr; this.levelData = newArr;
console.log("table构造", this.levelData); // console.log("table", this.levelData);
}, },
deep: true, deep: true,
immediate: true, immediate: true,

View File

@ -14,9 +14,24 @@
<el-table-column label="操作"> <el-table-column label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="danger" v-if="scope.row.status === '未授权'" <el-button type="danger" v-if="scope.row.status === '未授权'"
>授权</el-button ><a
:href="scope.row.authUrl"
target="_blank"
rel="noopener noreferrer"
>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a
></el-button
> >
<span v-else>{{ scope.row.status }}</span> <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>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -120,6 +135,7 @@ export default {
storeList(page).then((res) => { storeList(page).then((res) => {
this.tableData = res.data.data; this.tableData = res.data.data;
this.Paginationdata = res.data.meta; this.Paginationdata = res.data.meta;
console.log(111111, this.tableData);
}); });
}, },
@ -148,6 +164,11 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
a {
text-decoration: none;
color: white;
}
.conent { .conent {
width: 100%; width: 100%;
min-height: calc(100vh - 200px); min-height: calc(100vh - 200px);

View File

@ -20,25 +20,19 @@
</div> </div>
<span style="font-size: 14px" <span style="font-size: 14px"
>商品图片 >商品图片
<UploadTem /> <el-upload
class="avatar-uploader"
action="#"
:limit="1"
:auto-upload="false"
:show-file-list="true"
list-type="picture-card"
:on-change="handleAvatarSuccess"
>
<img v-if="imageUrl" :src="imageUrl" class="avatar" />
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</span> </span>
<!-- <UploadTem @urlimg='hanleurlimg'
:number="2"
:file='file' /> -->
<!-- <el-upload class="upload"
action="https://ct-upimg.yx090.com/api/upload"
list-type="picture-card"
:on-success="successUpload"
:on-error="errorUpload"
:on-remove="removeUpload"
:headers="headers"
:limit="1">
<img v-if="imageUrl"
:src="imageUrl"
class="avatar">
<i v-else
class="el-icon-plus avatar-uploader-icon"></i>
</el-upload> -->
</div> </div>
<!-- 编辑按钮进入显示 --> <!-- 编辑按钮进入显示 -->
@ -261,21 +255,22 @@
</template> </template>
<script> <script>
import UploadTem from "../../../components/upload/index.vue"; // import UploadTem from "../../../components/upload/index.vue";
import { import {
addGoods, addGoods,
checkGoods, checkGoods,
goodsList, goodsList,
updateGoods, updateGoods,
imgUpload,
} from "../../../api/goods.js"; } from "../../../api/goods.js";
import { goods_types, Brand_goods_types } from "../../../api/rankingData.js"; import { goods_types, Brand_goods_types } from "../../../api/rankingData.js";
export default { export default {
components: { // components: {
UploadTem, // UploadTem,
}, // },
data() { data() {
return { return {
imgs: [],
gallery: "", gallery: "",
imageUrl: "", imageUrl: "",
lid: "", // id lid: "", // id
@ -300,8 +295,7 @@ export default {
form: { form: {
goods_id: "", goods_id: "",
title: "", title: "",
img_url: img_url: "",
"https://bjetxgzv.cdn.bspapp.com/VKCEYUGU-dc-site/c40319b0-6080-11eb-918d-3d24828c498c.png",
type_id: "", type_id: "",
brand_id: "", brand_id: "",
goods_code: "", goods_code: "",
@ -323,6 +317,7 @@ export default {
], ],
file: [], file: [],
isShow: false, isShow: false,
URL: "",
}; };
}, },
@ -343,6 +338,25 @@ export default {
}, },
methods: { methods: {
//
handleAvatarSuccess(res, files) {
let formData = new FormData();
files.forEach((file) => {
formData.append("uploadFile", file.raw); //
});
let requestConfig = {
headers: {
"Content-Type": "multipart/form-data",
},
};
imgUpload(formData, requestConfig).then((res) => {
console.log(res);
this.form.img_url = res.data.resource;
console.log(this.form.img_url);
});
},
// //
handleUpdate() { handleUpdate() {
this.gid = this.$route.query; this.gid = this.$route.query;
@ -387,6 +401,7 @@ export default {
goods_id: this.lid, goods_id: this.lid,
skus: skus, skus: skus,
}; };
console.log(updata);
addGoods(updata).then((res) => { addGoods(updata).then((res) => {
if (res.statusText === "OK") { if (res.statusText === "OK") {
this.$message({ this.$message({
@ -429,7 +444,7 @@ export default {
this.skus.push({ this.skus.push({
title: "", title: "",
sku_code: "", sku_code: "",
status: "", status: "0",
num: "", num: "",
cost: "", cost: "",
}); });
@ -482,7 +497,7 @@ export default {
// console.log("goodsid", this.goodsData.goods_id); // console.log("goodsid", this.goodsData.goods_id);
let goods = { let goods = {
title: this.goodsData.goods.title, title: this.goodsData.goods.title,
img_url: this.goodsData.goods.img_url, img_url: this.from.img_url,
type_id: this.goodsData.goods.type_id, type_id: this.goodsData.goods.type_id,
brand_id: this.goodsData.goods.brand_id, brand_id: this.goodsData.goods.brand_id,
goods_code: this.goodsData.goods.goods_code, goods_code: this.goodsData.goods.goods_code,
@ -531,11 +546,13 @@ export default {
} }
}, },
}, },
created() { created() {
this.goodsID = sessionStorage.getItem("商品ID"); this.goodsID = sessionStorage.getItem("商品ID");
this.bigID = sessionStorage.getItem("ID"); this.bigID = sessionStorage.getItem("ID");
this.getgoodsidData(); this.getgoodsidData();
}, },
mounted() { mounted() {
this.gid = this.$route.query; this.gid = this.$route.query;
// //
@ -549,6 +566,7 @@ export default {
this.handleList(); this.handleList();
this.handleUpdate(); this.handleUpdate();
}, },
beforeDestroy() { beforeDestroy() {
sessionStorage.removeItem("商品ID"); //ID sessionStorage.removeItem("商品ID"); //ID
sessionStorage.removeItem("ID"); //ID sessionStorage.removeItem("ID"); //ID
@ -576,7 +594,29 @@ export default {
border-radius: 5px; border-radius: 5px;
margin-top: 4px; margin-top: 4px;
} }
/* .btn {
/* 分割 */
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409eff;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 148px;
height: 148px;
line-height: 148px;
text-align: center; text-align: center;
} */ }
.avatar {
width: 178px;
height: 178px;
display: block;
}
</style> </style>

View File

@ -239,19 +239,9 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="two_days_ago_num" sortable label="2T">
prop="two_days_ago_num"
sortable
label="2天前库存"
min-width="110"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="yesterday_num" sortable label="1T">
prop="yesterday_num"
sortable
label="1天前库存"
min-width="110"
>
</el-table-column> </el-table-column>
<el-table-column sortable label="今日到货" min-width="110"> <el-table-column sortable label="今日到货" min-width="110">
@ -271,7 +261,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="cost" sortable label="成本" min-width="110"> <el-table-column prop="cost" sortable label="成本">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="isShow"> <div v-if="isShow">
<el-input v-model="scope.row.cost"></el-input> <el-input v-model="scope.row.cost"></el-input>
@ -337,7 +327,7 @@
label="店铺订单" label="店铺订单"
min-width="110" min-width="110"
></el-table-column> ></el-table-column>
<el-table-column sortable label="损耗" min-width="110"> <el-table-column sortable label="损耗">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.id === id2"> <div v-if="scope.row.id === id2">
<el-input v-model="scope.row.daily.loss_num"></el-input> <el-input v-model="scope.row.daily.loss_num"></el-input>
@ -371,14 +361,9 @@
</el-popover> </el-popover>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="stock" sortable label="库存" min-width="110"> <el-table-column prop="stock" sortable label="库存">
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="address" sortable label="盘点">
prop="address"
sortable
label="库存盘点"
min-width="110"
>
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="stock"> <div v-if="stock">
<el-input v-model="scope.row.daily.inventory"></el-input> <el-input v-model="scope.row.daily.inventory"></el-input>
@ -596,7 +581,7 @@ export default {
// console.log("", this.$route); // console.log("", this.$route);
sessionStorage.setItem("商品ID", goodsid); sessionStorage.setItem("商品ID", goodsid);
sessionStorage.setItem("ID", id); sessionStorage.setItem("ID", id);
this.$router.push("/index/yingyeting/addgoods"); this.$router.push("/ADDGOODS");
}, },
// //
@ -681,7 +666,7 @@ export default {
}, },
// //
addNewgoods() { addNewgoods() {
this.$router.push("/index/yingyeting/addgoods"); this.$router.push("/ADDGOODS");
}, },
// //

View File

@ -1,22 +1,24 @@
module.exports = { module.exports = {
lintOnSave: false, lintOnSave: false,
publicPath: './', // 配置打包之后的相对路径 publicPath: "./", // 配置打包之后的相对路径
devServer: { devServer: {
open: true, // 设置浏览器自动打开项目 open: true, // 设置浏览器自动打开项目
port: 8080, // 开发服务器运行端口号 port: 8080, // 开发服务器运行端口号
overlay: { overlay: {
warnings: false, warnings: false,
errors: true errors: true,
}, },
proxy: { // 配置代理 proxy: {
'/api': { // 配置代理
"/api": {
// target: 'http://doc.ii090.com/mock/267/', // target: 'http://doc.ii090.com/mock/267/',
target: 'http://erp.staging.miaoxuan66.cn', target: "http://erp.staging.miaoxuan66.cn",
changeOrigin: true, // 开启代理 changeOrigin: true, // 开启代理
pathRewrite: { // 重命名 pathRewrite: {
'^/api': 'api' // 重命名
} "^/api": "api",
} },
} },
} },
} },
};

1
resources/node_modules/.package_versions.json generated vendored Normal file
View File

@ -0,0 +1 @@
{}