Commit 47d2f36d authored by liwenhong's avatar liwenhong

Merge branch 'master' into lwh/head-distribution

# Conflicts:
#	server/config.js
#	server/controllers/goods.js
#	src/pages/Goods/List/index.vue
#	src/pages/Groupmeal/newOrderManagement/index.vue
#	src/service/Goods/goods.js
parents 8445c6ea df096fa1
......@@ -11,7 +11,7 @@
"out_file": "/home/services/op-web-service/logs/opwebservice-preload.out.log",
"max_memory_restart": "1G",
"env": {
"NODE_ENV": "production",
"NODE_ENV": "preprod",
"PORT": "8090"
}
}
......
......@@ -7,12 +7,14 @@ const PANDORA_URI = {
development: "http://pandora.yidian-inc.com",
test: "http://pandora.yidian-inc.com",
production: "http://pandora.yidian-inc.com",
preprod: "http://pandora.yidian-inc.com",
};
const API_INTERNAL_URI = {
test: "http://bp-dev.ini.yidian-inc.com",
development: "http://bp-test.ini.yidian-inc.com",
production: "http://bp.int.yidian-inc.com",
preprod: "http://bp.pre.int.yidian-inc.com",
};
module.exports = {
......
......@@ -56,6 +56,17 @@ exports.putOffline = async (ctx) => {
};
ctx.body = await req(ctx, opts);
};
// 设置商品上架
exports.putOnlineSite = async (ctx) => {
const url = `${GOODS_URI}/goods/background/online_site`;
const opts = {
url,
method: "POST",
json: true,
body: ctx.request.body,
};
ctx.body = await req(ctx, opts);
};
// 获取商品详情列表
exports.getGoodsInfo = async (ctx) => {
const url = `${GOODS_URI}/goods/background/get_goods_info`;
......
......@@ -51,6 +51,7 @@ router.get(`${API_VERSION}/get_goods_category_list`, goods.getCategoryList);
router.get(`${API_VERSION}/goods/background/get_goods_list`, goods.getList);
router.post(`${API_VERSION}/goods/background/online`, goods.putOnline);
router.post(`${API_VERSION}/goods/background/offline`, goods.putOffline);
router.post(`${API_VERSION}/goods/background/putOnlineSite`, goods.putOnlineSite);
router.get(`${API_VERSION}/goods/background/get_goods_info`, goods.getGoodsInfo);
router.post(`${API_VERSION}/goods/background/audit_pass`, goods.postSuccess);
router.post(`${API_VERSION}/goods/background/check_goods_name`, goods.checkGoodsName);
......
......@@ -17,6 +17,9 @@
}
}
}
.pick-time {
margin-left: 10px;
}
.commodity_list {
margin-top: 30px;
}
......
......@@ -70,6 +70,20 @@
</el-table-column>
<el-table-column label="状态更新时间" prop="update_time" align="center"></el-table-column>
<el-table-column label="商品创建时间" prop="create_time" align="center"></el-table-column>
<el-table-column label="上架类型" prop="online_type" align="center">
<template #default="scope">
{{ ["", "立即上架", "定点上架", "暂不上架"][scope.row.online_type] }}
</template>
</el-table-column>
<!-- <el-table-column
label="上架时间"
prop="online_start_time"
align="center"
>
<template #default="scope">
{{scope.row.online_start_time}} - {{scope.row.online_end_time}}
</template>
</el-table-column> -->
<!-- 操作快捷键 -->
<el-table-column label="操作" align="center" fixed="right" width="200">
<template #default="scope">
......@@ -77,7 +91,7 @@
<el-button v-if="scope.row.audit_status == 0" type="text" @click="goDetail(`AUDIT`, scope.row.goods_spu_id)">审核</el-button>
<el-popconfirm
<!-- <el-popconfirm
v-if="scope.row.online_status == 2"
title="您确定要上架该商品吗?"
cancelButtonType="default"
......@@ -86,24 +100,59 @@
<template #reference>
<el-button type="text">上架</el-button>
</template>
</el-popconfirm>
</el-popconfirm> -->
<el-popconfirm
v-if="scope.row.online_status != 2 && (scope.row.audit_status == 1 || scope.row.online_status == 1)"
<!-- <el-popconfirm
v-if="
scope.row.online_status != 2 &&
(scope.row.audit_status == 1 || scope.row.online_status == 1)
"
title="您确定要下架该商品吗?"
cancelButtonType="default"
@confirm="changeGoodsState('UNDERCARRIAGE', scope.row.goods_spu_id)"
@confirm="
changeGoodsState('UNDERCARRIAGE', scope.row.goods_spu_id)
"
>
<template #reference>
<el-button type="text">下架</el-button>
</template>
</el-popconfirm>
</el-popconfirm> -->
<el-button @click="goDetail(`DETAIL`, scope.row.goods_spu_id)" type="text">详情</el-button>
<el-button type="text" @click="handleGoodOnline(scope.row)">上架配置</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog title="上架时间配置" width="50%" top="10%" center v-model="showGoodsAddTime">
<el-form-item>
上架时间:
<el-radio-group v-model="checkedAddTime.online_type">
<el-radio :label="1">立即上架</el-radio>
<el-radio :label="2">
定点上架
<span class="pick-time">
<el-date-picker
v-model="addTimeRange"
type="datetimerange"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="YYYY-MM-DD HH:mm:ss"
value-format="YYYY-MM-DD HH:mm:ss"
:disabled="checkedAddTime.online_type != 2"
@change="pickAddTime"
></el-date-picker>
</span>
</el-radio>
<el-radio :label="3">暂不上架</el-radio>
</el-radio-group>
</el-form-item>
<template #footer>
<span>
<el-button type="primary" @click="handleConfirmRefund">确认</el-button>
<el-button @click="showGoodsAddTime = false">返回</el-button>
</span>
</template>
</el-dialog>
<!-- 页码区 -->
<el-pagination
class="pagination"
......@@ -120,7 +169,7 @@
<style lang="less" src="./index.less" scope></style>
<script>
import { getGoodsList, getList, putOnline, putOffline } from "@/service/Goods/goods";
import { getGoodsList, getList, putOnline, putOffline, putOnlineSite } from "@/service/Goods/goods";
import Layout from "../layout/index.vue";
export default {
name: "GoodsList",
......@@ -184,6 +233,14 @@
goodsList: [],
totalCount: 0, // 总条数
showGoodsAddTime: false, //商品添加弹窗
addTimeRange: [],
checkedAddTime: {
online_start_time: "",
online_end_time: "",
online_type: 3,
goods_spu_id: "",
},
};
},
......@@ -241,6 +298,12 @@
console.log(this.searchProps);
this.getCommodityList();
},
pickAddTime(val) {
if (val[1] < new Date()) {
this.addTimeRange[1] = new Date();
this.$message.warning("结束时间不能小于当前时间");
}
},
// 重置表单
resetList() {
this.searchProps = {
......@@ -289,6 +352,38 @@
console.log(spuId);
this.$router.push({ name: "GoodsDetail", params: { operation, spuId } });
},
handleGoodOnline(item) {
item.online_start_time && item.online_end_time && (this.addTimeRange = [item.online_start_time, item.online_end_time]);
this.showGoodsAddTime = true;
this.checkedAddTime.online_type = item.online_type || 3;
this.checkedAddTime.goods_spu_id = item.goods_spu_id;
},
changeDate(dateA) {
let time = new Date(dateA).toJSON();
let date = new Date(+new Date(time) + 8 * 3600 * 1000)
.toISOString()
.replace(/T/g, " ")
.replace(/\.[\d]{3}Z/, "");
return date;
},
async handleConfirmRefund() {
if (this.checkedAddTime.online_type == 2) {
this.checkedAddTime.online_start_time = this.changeDate(this.addTimeRange[0]);
this.checkedAddTime.online_end_time = this.changeDate(this.addTimeRange[1]);
}
let res = await putOnlineSite(this.checkedAddTime);
await this.getCommodityList();
if (res.code !== 0) return this.$message.error(res.reason);
this.showGoodsAddTime = false;
this.addTimeRange = [];
this.checkedAddTime = {
online_start_time: "",
online_end_time: "",
online_type: 1,
goods_spu_id: "",
};
return this.$message.success("操作成功");
},
},
};
</script>
......@@ -25,9 +25,7 @@
重新审核
</el-button>
<el-button type="text" size="small" v-if="scope.row.audit_status == 1">通过</el-button>
<el-button type="primary" size="small" v-if="scope.row.take_place_status == 1" @click="addPoint(scope.row.colonel_apply_id)">
添加自提点
</el-button>
<el-button type="primary" size="small" @click="addPoint(scope.row.colonel_apply_id)">添加自提点</el-button>
<!-- v-if="scope.row.take_place_status==1" -->
<el-button type="text" size="small" v-if="scope.row.audit_status == 2">拒绝</el-button>
</template>
......@@ -189,7 +187,7 @@
},
async comLibrarySave() {
let res = await colonelAddApplyPoint(this.pointObj);
// this.showAddPointDialog = false;
this.showAddPointDialog = false;
if (res.code !== 0) return this.$message.error(res.reason);
else return this.$message.success("添加成功");
},
......@@ -235,13 +233,21 @@
let AMap = (this.AMap = window.AMap);
AMapUI.loadUI(["misc/PositionPicker"], (PositionPicker) => {
let mapConfig = {
zoom: 16,
// cityName: this.MapCityName
center: [this.pointObj.longitude, this.pointObj.latitude],
zoom: 15,
};
if (this.lat && this.lng) {
mapConfig.center = [this.lng, this.lat];
}
// if (this.lat && this.lng) {
// mapConfig.center = [116.5522566, 39.9207093];
// mapConfig.lng = 116.5522566;
// mapConfig.lat = 39.9207093;
// mapConfig.address = "美然动力";
// mapConfig.province = "北京市";
// mapConfig.city = "北京市";
// mapConfig.area = "北京市";
// }
let map = new AMap.Map("js-container", mapConfig);
map.Marker("js-container", {});
let _this = this;
// 加载地图搜索插件
......@@ -296,13 +302,12 @@
buttonPosition: "RB",
});
map.addControl(geolocation);
geolocation.getCurrentPosition();
// geolocation.getCurrentPosition();
AMap.event.addListener(geolocation, "complete", onComplete);
AMap.event.addListener(geolocation, "error", onError);
function onComplete(data) {
console.log(data);
// data是具体的定位信息
console.log("onComplete", data);
}
function onError(data) {
......
......@@ -92,9 +92,7 @@
<!-- Tabs标签页 -->
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-row class="tabHead">
<el-col :span="12">
<div>商品共计:{{ goodsNum }}</div>
</el-col>
<el-col :span="12"></el-col>
<el-col :span="12" style="text-align: right">
<el-button @click="exportOrder">导出</el-button>
<el-button @click="printOrder">打印</el-button>
......@@ -137,6 +135,7 @@
</template>
</el-table-column>
<el-table-column prop="discount_fee" label="优惠金额"></el-table-column>
<el-table-column prop="refund_apply_time" label="申请退款时间"></el-table-column>
<el-table-column fixed="right" label="操作" width="100">
<template #default="scope">
<el-button
......@@ -204,6 +203,7 @@
</template>
</el-table-column>
<el-table-column prop="discount_fee" label="优惠金额"></el-table-column>
<el-table-column prop="refund_apply_time" label="申请退款时间"></el-table-column>
<el-table-column fixed="right" label="操作" width="100">
<template #default="scope">
<el-button
......@@ -355,7 +355,7 @@
detailedAddressArr: [],
activeName: "all", // Tabs标签页
goodsNum: "", // 商品总计
// goodsNum: "", // 商品总计
// 导出
exportShow: false,
......@@ -670,14 +670,14 @@
.join(",");
let currentParams = JSON.parse(JSON.stringify(this.orderQueryObj));
params = Object.assign(currentParams, {
sub_shop_list: takePlaceListParams,
sub_shop_id: takePlaceListParams,
});
} else {
params = this.orderQueryObj;
}
res = await newGetOrderList(params);
}
this.goodsNum = res.goods_num; // 商品共计
// this.goodsNum = res.goods_num; // 商品共计
this.totalNum = res.count; // 商品总数
this.orderTableData = res.result;
} catch (error) {
......
......@@ -26,6 +26,11 @@ export async function putOffline(query) {
});
return res;
}
// 设置商品上架
export async function putOnlineSite(params) {
const res = await axios.post("/api/v1/goods/background/putOnlineSite", params);
return res;
}
// 获取商品详情列表
export async function getGoodsInfo(params) {
const res = await axios.get("/api/v1/goods/background/get_goods_info", {
......
const path = require("path");
const IS_PROD = process.env.NODE_ENV === "production";
const isDev = process.env.NODE_ENV === "development";
// CDN 链接配置
const CDN = {
......@@ -26,16 +27,16 @@ const CDN = {
};
module.exports = {
outputDir: !IS_PROD ? "./dist" : path.resolve("./public/dist/"),
publicPath: !IS_PROD ? "/" : "/dist",
lintOnSave: !IS_PROD,
outputDir: isDev ? "./dist" : path.resolve("./public/dist/"),
publicPath: isDev ? "/" : "/dist",
lintOnSave: isDev,
productionSourceMap: false, // 去掉生成环境的 sourceMap
devServer: {
proxy: "http://127.0.0.1:8055", //http://localhost:8055
hot: true,
disableHostCheck: true,
},
configureWebpack: config => {
configureWebpack: (config) => {
if (IS_PROD) {
config.externals = CDN.externals;
}
......@@ -46,7 +47,7 @@ module.exports = {
maxAssetSize: 30000000,
};
},
chainWebpack: config => {
chainWebpack: (config) => {
// 默认不开启 prefetch
config.plugins.delete("prefetch");
......@@ -57,7 +58,7 @@ module.exports = {
config.resolve.alias.set("@", path.resolve("src"));
// 修改页面 title
config.plugin("html").tap(args => {
config.plugin("html").tap((args) => {
args[0].title = "运营管理系统";
if (IS_PROD) {
args[0].cdn = CDN.build;
......@@ -67,7 +68,7 @@ module.exports = {
});
// 分包
config.when(IS_PROD, config => {
config.when(IS_PROD, (config) => {
config.optimization.splitChunks({
chunks: "all",
cacheGroups: {
......
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 to comment