mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-12-01 06:30:49 +00:00
2022.8.16
This commit is contained in:
parent
f63d72a59a
commit
79cfae3a26
BIN
resources/frontend/dist.zip
Normal file
BIN
resources/frontend/dist.zip
Normal file
Binary file not shown.
10
resources/frontend/src/api/goods.js
vendored
10
resources/frontend/src/api/goods.js
vendored
@ -57,3 +57,13 @@ export function singleUpdate(id, data) {
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
// 图片上传
|
||||
export function imgUpload(data, item) {
|
||||
return http({
|
||||
url: "/api/upload",
|
||||
Headers: item,
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
2
resources/frontend/src/router/index.js
vendored
2
resources/frontend/src/router/index.js
vendored
@ -1,6 +1,6 @@
|
||||
import Vue from "vue";
|
||||
import VueRouter from "vue-router";
|
||||
import axios from "axios";
|
||||
// import axios from "axios";
|
||||
|
||||
Vue.use(VueRouter);
|
||||
|
||||
|
||||
10
resources/frontend/src/router/index1.js
vendored
10
resources/frontend/src/router/index1.js
vendored
@ -57,7 +57,7 @@ const list = [
|
||||
component: () => import("../views/shuju/record.vue"),
|
||||
},
|
||||
{
|
||||
path: "/index/yingyeting/addgoods",
|
||||
path: "ADDGOODS",
|
||||
name: "新建商品",
|
||||
component: () => import("../views/yingyeting/addgoods/addgoods.vue"),
|
||||
},
|
||||
@ -67,10 +67,10 @@ const list = [
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "/",
|
||||
redirect: "/index",
|
||||
},
|
||||
// {
|
||||
// path: "/",
|
||||
// redirect: "/index",
|
||||
// },
|
||||
];
|
||||
|
||||
export default list;
|
||||
|
||||
@ -50,7 +50,7 @@
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="table" v-if="levelData.length">
|
||||
<!-- <div class="table" v-if="levelData.length">
|
||||
<ul>
|
||||
<li><i class="el-icon-arrow-left" @click="hanlebottom"></i></li>
|
||||
<li>
|
||||
@ -79,7 +79,7 @@
|
||||
</li>
|
||||
<li><i class="el-icon-arrow-right" @click="hanletop"></i></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="box-card">
|
||||
<router-view></router-view>
|
||||
</div>
|
||||
@ -112,7 +112,7 @@ export default {
|
||||
// table构造
|
||||
$route: {
|
||||
handler: function (val) {
|
||||
console.log("0.0", val);
|
||||
// console.log("0.0", val);
|
||||
this.titie = val.matched;
|
||||
this.head = val.name;
|
||||
this.levelData.push({ name: val.name, path: val.path });
|
||||
@ -126,7 +126,7 @@ export default {
|
||||
}
|
||||
|
||||
this.levelData = newArr;
|
||||
console.log("table构造", this.levelData);
|
||||
// console.log("table构造", this.levelData);
|
||||
},
|
||||
deep: true,
|
||||
immediate: true,
|
||||
|
||||
@ -14,9 +14,24 @@
|
||||
<el-table-column label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="danger" v-if="scope.row.status === '未授权'"
|
||||
>授权</el-button
|
||||
><a
|
||||
:href="scope.row.authUrl"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
> 授 权 </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>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -120,6 +135,7 @@ export default {
|
||||
storeList(page).then((res) => {
|
||||
this.tableData = res.data.data;
|
||||
this.Paginationdata = res.data.meta;
|
||||
console.log(111111, this.tableData);
|
||||
});
|
||||
},
|
||||
|
||||
@ -148,6 +164,11 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.conent {
|
||||
width: 100%;
|
||||
min-height: calc(100vh - 200px);
|
||||
|
||||
@ -20,25 +20,19 @@
|
||||
</div>
|
||||
<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>
|
||||
<!-- <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>
|
||||
|
||||
<!-- 编辑按钮进入显示 -->
|
||||
@ -261,21 +255,22 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import UploadTem from "../../../components/upload/index.vue";
|
||||
// import UploadTem from "../../../components/upload/index.vue";
|
||||
import {
|
||||
addGoods,
|
||||
checkGoods,
|
||||
goodsList,
|
||||
updateGoods,
|
||||
imgUpload,
|
||||
} from "../../../api/goods.js";
|
||||
import { goods_types, Brand_goods_types } from "../../../api/rankingData.js";
|
||||
export default {
|
||||
components: {
|
||||
UploadTem,
|
||||
},
|
||||
|
||||
// components: {
|
||||
// UploadTem,
|
||||
// },
|
||||
data() {
|
||||
return {
|
||||
imgs: [],
|
||||
gallery: "",
|
||||
imageUrl: "",
|
||||
lid: "", // 选择的商品列表id
|
||||
@ -300,8 +295,7 @@ export default {
|
||||
form: {
|
||||
goods_id: "",
|
||||
title: "",
|
||||
img_url:
|
||||
"https://bjetxgzv.cdn.bspapp.com/VKCEYUGU-dc-site/c40319b0-6080-11eb-918d-3d24828c498c.png",
|
||||
img_url: "",
|
||||
type_id: "",
|
||||
brand_id: "",
|
||||
goods_code: "",
|
||||
@ -323,6 +317,7 @@ export default {
|
||||
],
|
||||
file: [],
|
||||
isShow: false,
|
||||
URL: "",
|
||||
};
|
||||
},
|
||||
|
||||
@ -343,6 +338,25 @@ export default {
|
||||
},
|
||||
|
||||
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() {
|
||||
this.gid = this.$route.query;
|
||||
@ -387,6 +401,7 @@ export default {
|
||||
goods_id: this.lid,
|
||||
skus: skus,
|
||||
};
|
||||
console.log(updata);
|
||||
addGoods(updata).then((res) => {
|
||||
if (res.statusText === "OK") {
|
||||
this.$message({
|
||||
@ -429,7 +444,7 @@ export default {
|
||||
this.skus.push({
|
||||
title: "",
|
||||
sku_code: "",
|
||||
status: "",
|
||||
status: "0",
|
||||
num: "",
|
||||
cost: "",
|
||||
});
|
||||
@ -482,7 +497,7 @@ export default {
|
||||
// console.log("goodsid", this.goodsData.goods_id);
|
||||
let goods = {
|
||||
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,
|
||||
brand_id: this.goodsData.goods.brand_id,
|
||||
goods_code: this.goodsData.goods.goods_code,
|
||||
@ -531,11 +546,13 @@ export default {
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
created() {
|
||||
this.goodsID = sessionStorage.getItem("商品ID");
|
||||
this.bigID = sessionStorage.getItem("ID");
|
||||
this.getgoodsidData();
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.gid = this.$route.query;
|
||||
// 获取商品种类
|
||||
@ -549,6 +566,7 @@ export default {
|
||||
this.handleList();
|
||||
this.handleUpdate();
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
sessionStorage.removeItem("商品ID"); //销毁内存中的商品ID
|
||||
sessionStorage.removeItem("ID"); //销毁内存中的ID
|
||||
@ -576,7 +594,29 @@ export default {
|
||||
border-radius: 5px;
|
||||
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;
|
||||
} */
|
||||
}
|
||||
.avatar {
|
||||
width: 178px;
|
||||
height: 178px;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -239,19 +239,9 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="two_days_ago_num"
|
||||
sortable
|
||||
label="2天前库存"
|
||||
min-width="110"
|
||||
>
|
||||
<el-table-column prop="two_days_ago_num" sortable label="2T">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="yesterday_num"
|
||||
sortable
|
||||
label="1天前库存"
|
||||
min-width="110"
|
||||
>
|
||||
<el-table-column prop="yesterday_num" sortable label="1T">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column sortable label="今日到货" min-width="110">
|
||||
@ -271,7 +261,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="cost" sortable label="成本" min-width="110">
|
||||
<el-table-column prop="cost" sortable label="成本">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="isShow">
|
||||
<el-input v-model="scope.row.cost"></el-input>
|
||||
@ -337,7 +327,7 @@
|
||||
label="店铺订单"
|
||||
min-width="110"
|
||||
></el-table-column>
|
||||
<el-table-column sortable label="损耗" min-width="110">
|
||||
<el-table-column sortable label="损耗">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.id === id2">
|
||||
<el-input v-model="scope.row.daily.loss_num"></el-input>
|
||||
@ -371,14 +361,9 @@
|
||||
</el-popover>
|
||||
</template>
|
||||
</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
|
||||
prop="address"
|
||||
sortable
|
||||
label="库存盘点"
|
||||
min-width="110"
|
||||
>
|
||||
<el-table-column prop="address" sortable label="盘点">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="stock">
|
||||
<el-input v-model="scope.row.daily.inventory"></el-input>
|
||||
@ -596,7 +581,7 @@ export default {
|
||||
// console.log("我是路由信息", this.$route);
|
||||
sessionStorage.setItem("商品ID", goodsid);
|
||||
sessionStorage.setItem("ID", id);
|
||||
this.$router.push("/index/yingyeting/addgoods");
|
||||
this.$router.push("/ADDGOODS");
|
||||
},
|
||||
|
||||
// 获取商品列表
|
||||
@ -681,7 +666,7 @@ export default {
|
||||
},
|
||||
// 新增商品跳转
|
||||
addNewgoods() {
|
||||
this.$router.push("/index/yingyeting/addgoods");
|
||||
this.$router.push("/ADDGOODS");
|
||||
},
|
||||
|
||||
//分页功能
|
||||
|
||||
26
resources/frontend/vue.config.js
vendored
26
resources/frontend/vue.config.js
vendored
@ -1,22 +1,24 @@
|
||||
module.exports = {
|
||||
lintOnSave: false,
|
||||
publicPath: './', // 配置打包之后的相对路径
|
||||
publicPath: "./", // 配置打包之后的相对路径
|
||||
devServer: {
|
||||
open: true, // 设置浏览器自动打开项目
|
||||
port: 8080, // 开发服务器运行端口号
|
||||
overlay: {
|
||||
warnings: false,
|
||||
errors: true
|
||||
errors: true,
|
||||
},
|
||||
proxy: { // 配置代理
|
||||
'/api': {
|
||||
proxy: {
|
||||
// 配置代理
|
||||
"/api": {
|
||||
// target: 'http://doc.ii090.com/mock/267/',
|
||||
target: 'http://erp.staging.miaoxuan66.cn',
|
||||
target: "http://erp.staging.miaoxuan66.cn",
|
||||
changeOrigin: true, // 开启代理
|
||||
pathRewrite: { // 重命名
|
||||
'^/api': 'api'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
pathRewrite: {
|
||||
// 重命名
|
||||
"^/api": "api",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
1
resources/node_modules/.package_versions.json
generated
vendored
Normal file
1
resources/node_modules/.package_versions.json
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{}
|
||||
Loading…
x
Reference in New Issue
Block a user