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