|
@@ -374,6 +374,12 @@
|
|
|
@click="handleChannelCode(scope.row)"
|
|
|
>生成渠道码</el-button
|
|
|
>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="mini"
|
|
|
+ v-permission="['GET /admin/goods/onclickCopy']"
|
|
|
+ @click="onclickCopy(scope.row)"
|
|
|
+ >一键复制商品</el-button>
|
|
|
|
|
|
<!-- <el-button type="success" size="mini" @click="handleFee(scope.row)">商品计提</el-button>
|
|
|
<el-button type="info" size="mini" @click="handleNoServiceTimeRange(scope.row)">不可约设定</el-button>-->
|
|
@@ -550,7 +556,7 @@ import {
|
|
|
onsale,
|
|
|
sync2Douyin,
|
|
|
dyUrl,
|
|
|
- goodsChannelQrCode
|
|
|
+ goodsChannelQrCode, onclickCopy
|
|
|
} from "@/api/goods";
|
|
|
import { listCatL1 } from "@/api/category";
|
|
|
import BackToTop from "@/components/BackToTop";
|
|
@@ -987,7 +993,39 @@ export default {
|
|
|
this.changeChanneldialog = false;
|
|
|
this.orderInputForm = {};
|
|
|
});
|
|
|
- }
|
|
|
+ },
|
|
|
+ //一键复制商品
|
|
|
+ onclickCopy(val) {
|
|
|
+ console.log("商品信息:", val);
|
|
|
+ this.$confirm("确认复制吗?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ onclickCopy({
|
|
|
+ goodsId:val.id
|
|
|
+ }).then(res => {
|
|
|
+ if (res.data.errno == 0) {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "新商品创建成功"
|
|
|
+ });
|
|
|
+ this.$router.push({ path: '/goods/edit?id='+res.data.data });
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: "info",
|
|
|
+ message: res.data.errmsg
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: "info",
|
|
|
+ message: "新商品创建失败"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
}
|
|
|
};
|
|
|
</script>
|