From 91d0e0b49cf324d22d486ff58e5f16b39193a614 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=8F?= <1978476055@qq.com> Date: Mon, 26 Aug 2024 10:29:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=98=E6=89=A3,=E5=AE=9A=E5=88=B6=E4=BA=A7?= =?UTF-8?q?=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 8 +- .env.production | 5 +- src/filters/commFilter.js | 2 +- src/views/order/orderDetails.vue | 539 +++- src/views/order/orderRefund/refundDetail.vue | 2 +- src/views/product/addProduct/index.vue | 2739 +++++++++++------- src/views/product/productList/index.vue | 1220 +++++--- src/views/product/productList/proDetails.vue | 1381 +++++---- vue.config.js | 5 +- 9 files changed, 3722 insertions(+), 2179 deletions(-) diff --git a/.env.development b/.env.development index 4142a44..6caf031 100644 --- a/.env.development +++ b/.env.development @@ -2,12 +2,12 @@ ENV = 'development' # base api -# VUE_APP_BASE_API = 'http://192.168.1.12:8080' -VUE_APP_BASE_API = 'https://api.tropjoin.com' +VUE_APP_BASE_API = 'http://test.tropjoin.com' +# VUE_APP_BASE_API = 'https://api.tropjoin.com' # socket 连接地址 -# VUE_APP_WS_URL = 'ws://192.168.1.12:8080' -VUE_APP_WS_URL = 'ws://api.tropjoin.com' +VUE_APP_WS_URL = 'wss://test.tropjoin.com' +# VUE_APP_WS_URL = 'ws://api.tropjoin.com' # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable, # to control whether the babel-plugin-dynamic-import-node plugin is enabled. diff --git a/.env.production b/.env.production index f5380e6..fbb419e 100644 --- a/.env.production +++ b/.env.production @@ -2,7 +2,8 @@ ENV = 'production' # base api -VUE_APP_BASE_API = +VUE_APP_BASE_API ='https://api.tropjoin.com' # socket 连接地址 -VUE_APP_WS_URL = +VUE_APP_WS_URL ='wss://api.tropjoin.com' + diff --git a/src/filters/commFilter.js b/src/filters/commFilter.js index e86c94b..fcd181e 100644 --- a/src/filters/commFilter.js +++ b/src/filters/commFilter.js @@ -40,7 +40,7 @@ export function paidFilter(status) { */ export function payTypeFilter(status) { const statusMap = { - '0': '抵扣券', + '0': '折扣', '1': '微信', '2': '微信', '3': '微信', diff --git a/src/views/order/orderDetails.vue b/src/views/order/orderDetails.vue index f817f23..66ce1ab 100644 --- a/src/views/order/orderDetails.vue +++ b/src/views/order/orderDetails.vue @@ -12,21 +12,32 @@ <div class="full"> <img class="order_icon" :src="orderImg" alt="" /> <div class="text"> - <div class="title">{{ orderDetailList.order_type == 0 ? '普通订单' : '核销订单' }}</div> + <div class="title"> + {{ orderDetailList.order_type == 0 ? "普通订单" : "核销订单" }} + </div> <div> - <span class="mr20">订单编号:{{ orderDetailList.order_sn }}</span> + <span class="mr20" + >订单编号:{{ orderDetailList.order_sn }}</span + > </div> </div> <div> <el-button - v-if="orderDetailList.order_type != 0 && orderDetailList.status == 0" + v-if=" + orderDetailList.order_type != 0 && orderDetailList.status == 0 + " type="primary" size="small" @click="orderCancellation" >订单核销</el-button > <el-button - v-if="(orderDetailList.order_type == 0 || orderDetailList.order_type == 2) && orderDetailList.status === 0 && orderDetailList.paid === 1" + v-if=" + (orderDetailList.order_type == 0 || + orderDetailList.order_type == 2) && + orderDetailList.status === 0 && + orderDetailList.paid === 1 + " type="primary" size="small" @click="send" @@ -43,7 +54,15 @@ <el-button icon="el-icon-more" size="small"></el-button> <el-dropdown-menu slot="dropdown"> <el-dropdown-item command="mark">订单备注</el-dropdown-item> - <el-dropdown-item v-if="orderDetailList.order_type == 0 && orderDetailList.status === 1 && orderDetailList.paid === 1" command="modify">修改发货信息</el-dropdown-item> + <el-dropdown-item + v-if=" + orderDetailList.order_type == 0 && + orderDetailList.status === 1 && + orderDetailList.paid === 1 + " + command="modify" + >修改发货信息</el-dropdown-item + > <!-- <el-dropdown-item v-if="orderDetailList.status!=-1&&orderDetailList.paid==1&&orderDetailList.status<9" command="refund">退款</el-dropdown-item> --> </el-dropdown-menu> </el-dropdown> @@ -53,12 +72,42 @@ <li class="item"> <div class="title">订单状态</div> <div> - <div v-if="!orderDetailList.pay_time" class="value1">待付款<span v-if="orderDetailList.is_del>0" style="color:rgb(237,64,20);font-size:12px;">(用户已删除)</span></div> - <div v-if="orderDetailList.order_type === 0 && orderDetailList.pay_time" class="value1"> - <span>{{ orderDetailList.status | orderStatusFilter }}<span v-if="orderDetailList.is_del>0" style="color:rgb(237,64,20);font-size:12px;">(用户已删除)</span></span> + <div v-if="!orderDetailList.pay_time" class="value1"> + 待付款<span + v-if="orderDetailList.is_del > 0" + style="color:rgb(237,64,20);font-size:12px;" + >(用户已删除)</span + > </div> - <div v-if="orderDetailList.order_type === 1 && orderDetailList.pay_time" class="value1"> - <span>{{ orderDetailList.status | cancelOrderStatusFilter }}<span v-if="orderDetailList.is_del>0" style="color:rgb(237,64,20);font-size:12px;">(用户已删除)</span></span> + <div + v-if=" + orderDetailList.order_type === 0 && orderDetailList.pay_time + " + class="value1" + > + <span + >{{ orderDetailList.status | orderStatusFilter + }}<span + v-if="orderDetailList.is_del > 0" + style="color:rgb(237,64,20);font-size:12px;" + >(用户已删除)</span + ></span + > + </div> + <div + v-if=" + orderDetailList.order_type === 1 && orderDetailList.pay_time + " + class="value1" + > + <span + >{{ orderDetailList.status | cancelOrderStatusFilter + }}<span + v-if="orderDetailList.is_del > 0" + style="color:rgb(237,64,20);font-size:12px;" + >(用户已删除)</span + ></span + > </div> </div> </li> @@ -66,7 +115,14 @@ <div class="title">实际支付</div> <div> ¥{{ orderDetailList.pay_price }} - <span v-if="orderDetailList.finalOrder&&orderDetailList.finalOrder.pay_price&&orderDetailList.finalOrder.paid==1">尾款¥{{orderDetailList.finalOrder.pay_price}}</span> + <span + v-if=" + orderDetailList.finalOrder && + orderDetailList.finalOrder.pay_price && + orderDetailList.finalOrder.paid == 1 + " + >尾款¥{{ orderDetailList.finalOrder.pay_price }}</span + > </div> </li> <li class="item"> @@ -74,7 +130,9 @@ <div>{{ orderDetailList.pay_type | payTypeFilter }}</div> </li> <li class="item"> - <div class="title">{{ orderDetailList.pay_time ? '支付时间' : '下单时间'}}</div> + <div class="title"> + {{ orderDetailList.pay_time ? "支付时间" : "下单时间" }} + </div> <div>{{ orderDetailList.create_time }}</div> </li> </ul> @@ -88,7 +146,9 @@ <div>用户昵称:</div> <div class="value"> {{ - orderDetailList.user.real_name ? orderDetailList.user.real_name : orderDetailList.user.nickname + orderDetailList.user.real_name + ? orderDetailList.user.real_name + : orderDetailList.user.nickname }} </div> </li> @@ -98,9 +158,14 @@ </li> --> <li class="item"> <div>绑定电话:</div> - <div class="value">{{ orderDetailList.user.phone ? orderDetailList.user.phone : '-' }}</div> + <div class="value"> + {{ + orderDetailList.user.phone + ? orderDetailList.user.phone + : "-" + }} + </div> </li> - </ul> </div> <div class="section"> @@ -108,52 +173,113 @@ <ul class="list"> <li class="item"> <div>收货人:</div> - <div class="value">{{ orderDetailList.real_name ? orderDetailList.real_name : '-' }}</div> + <div class="value"> + {{ + orderDetailList.real_name + ? orderDetailList.real_name + : "-" + }} + </div> </li> <li class="item"> <div>收货电话:</div> - <div class="value">{{ orderDetailList.user_phone ? orderDetailList.user_phone : '-' }}</div> + <div class="value"> + {{ + orderDetailList.user_phone + ? orderDetailList.user_phone + : "-" + }} + </div> </li> <li class="item"> <div>收货地址:</div> - <div class="value">{{ orderDetailList.user_address ? orderDetailList.user_address : '-' }}</div> + <div class="value"> + {{ + orderDetailList.user_address + ? orderDetailList.user_address + : "-" + }} + </div> </li> </ul> </div> - + <div class="section"> <div class="title">订单信息</div> <ul class="list"> <li class="item"> <div>创建时间:</div> - <div class="value">{{ orderDetailList.create_time ? orderDetailList.create_time : '-' }}</div> + <div class="value"> + {{ + orderDetailList.create_time + ? orderDetailList.create_time + : "-" + }} + </div> </li> <li class="item"> <div>商品总数:</div> - <div class="value">{{ orderDetailList.total_num ? orderDetailList.total_num : '-' }}</div> + <div class="value"> + {{ + orderDetailList.total_num + ? orderDetailList.total_num + : "-" + }} + </div> </li> <li v-if="orderDetailList.pay_time" class="item"> <div>实际支付:</div> <div class="value"> {{ orderDetailList.pay_price }} - <span v-if="orderDetailList.finalOrder&&orderDetailList.finalOrder.pay_price&&orderDetailList.finalOrder.paid==1">尾款¥{{orderDetailList.finalOrder.pay_price}}</span> + <span + v-if=" + orderDetailList.finalOrder && + orderDetailList.finalOrder.pay_price && + orderDetailList.finalOrder.paid == 1 + " + >尾款¥{{ orderDetailList.finalOrder.pay_price }}</span + > </div> </li> - <!-- <li class="item"> + <!-- <li class="item"> <div>优惠券金额:</div> <div class="value">{{ orderDetailList.coupon_price ? orderDetailList.coupon_price : '-' }}</div> </li> --> - <li v-if="orderDetailList.integral" class="item"> + <li v-if="orderDetailList.integral" class="item"> <div>铸源星抵扣:</div> - <div v-if="orderDetailList.integral && orderDetailList.integral != 0" class="value">使用了{{ orderDetailList.integral }}个铸源星,抵扣了{{ orderDetailList.integral_price }}元</div> + <div + v-if=" + orderDetailList.integral && orderDetailList.integral != 0 + " + class="value" + > + 使用了{{ orderDetailList.integral }}个铸源星,抵扣了{{ + orderDetailList.integral_price + }}元 + </div> </li> - <li v-if="orderDetailList.amount_price>0" class="item"> - <div>抵扣券抵扣:</div> - <div v-if="orderDetailList.amount_price && orderDetailList.amount_price != 0" class="value">使用了{{ orderDetailList.amount_price }}个抵扣券,抵扣了{{ orderDetailList.amount_price }}元</div> + <li v-if="orderDetailList.amount_price > 0" class="item"> + <div>折扣:</div> + <!-- <div v-if="orderDetailList.amount_price && orderDetailList.amount_price != 0" class="value">使用了{{ orderDetailList.amount_price }}个折扣,抵扣了{{ orderDetailList.amount_price }}元</div> --> + <div + v-if=" + orderDetailList.amount_price && + orderDetailList.amount_price != 0 + " + class="value" + > + -{{ orderDetailList.amount_price }}元 + </div> </li> <li class="item"> <div>商品总价:</div> - <div class="value">{{ orderDetailList.total_price ? orderDetailList.total_price : '-' }}</div> + <div class="value"> + {{ + orderDetailList.total_price + ? orderDetailList.total_price + : "-" + }} + </div> </li> <!-- <li class="item" v-if="orderDetailList.svip_discount"> <div>会员商品优惠:</div> @@ -169,7 +295,9 @@ </li> <li v-if="orderDetailList.TopSpread" class="item"> <div>上级推广人:</div> - <div class="value">{{ orderDetailList.TopSpread.nickname }}</div> + <div class="value"> + {{ orderDetailList.TopSpread.nickname }} + </div> </li> <!-- <li v-if="!orderDetailList.activity_type" class="item"> <div>一级佣金:</div> @@ -185,35 +313,68 @@ <em v-if="orderDetailList.refund_extension_two > 0" style="color: red;font-style: normal;">(-{{ orderDetailList.refund_extension_two }})</em> </div> </li> --> - <!-- <li class="item"> + <!-- <li class="item"> <div>赠送积分:</div> <div class="value">{{orderDetailList.give_integral || '-'}}</div> </li> --> <li class="item"> <div>发货方式:</div> - <div v-if="orderDetailList.order_type == 1" class="value">核销</div> - <div v-else class="value">{{ orderDetailList.delivery_type | sendWay }}</div> + <div v-if="orderDetailList.order_type == 1" class="value"> + 核销 + </div> + <div v-else class="value"> + {{ orderDetailList.delivery_type | sendWay }} + </div> </li> <li class="item"> <div>商品类型:</div> - <div class="value">{{ orderDetailList.is_virtual==1 ? '虚拟商品' : orderDetailList.is_virtual==2 ? '卡密商品' : '普通商品' }}</div> + <div class="value"> + {{ + orderDetailList.is_virtual == 1 + ? "虚拟商品" + : orderDetailList.is_virtual == 2 + ? "卡密商品" + : "普通商品" + }} + </div> </li> <li class="item"> <div>活动类型:</div> - <div class="value">{{ orderDetailList.activity_type == 1 ? '秒杀' : orderDetailList.activity_type == 2 ? '预售' : orderDetailList.activity_type == 3 ? '助力' : orderDetailList.activity_type == 4 ? '拼团' : '普通' }}</div> + <div class="value"> + {{ + orderDetailList.activity_type == 1 + ? "秒杀" + : orderDetailList.activity_type == 2 + ? "预售" + : orderDetailList.activity_type == 3 + ? "助力" + : orderDetailList.activity_type == 4 + ? "拼团" + : "普通" + }} + </div> </li> </ul> </div> <div class="section" v-if="orderDetailList.order_extend"> <div class="title">自定义留言</div> <ul class="list"> - <li class="item" v-for="(item,i) in orderDetailList.order_extend" :key="i"> + <li + class="item" + v-for="(item, i) in orderDetailList.order_extend" + :key="i" + > <div>{{ i }}:</div> <template v-if="!Array.isArray(item)"> <div class="value">{{ item }}</div> </template> <template v-else> - <img v-for="(pic,idx) in item" :key="idx" :src="pic" style="width:40px;height:40px;margin-right:12px;"/> + <img + v-for="(pic, idx) in item" + :key="idx" + :src="pic" + style="width:40px;height:40px;margin-right:12px;" + /> </template> </li> </ul> @@ -222,7 +383,9 @@ <div class="title">买家留言</div> <ul class="list"> <li class="item"> - <div>{{ orderDetailList.mark ? orderDetailList.mark : '-' }}</div> + <div> + {{ orderDetailList.mark ? orderDetailList.mark : "-" }} + </div> </li> </ul> </div> @@ -230,7 +393,9 @@ <div class="title">商家备注</div> <ul class="list"> <li class="item"> - <div>{{ orderDetailList.remark ? orderDetailList.remark : '-' }}</div> + <div> + {{ orderDetailList.remark ? orderDetailList.remark : "-" }} + </div> </li> </ul> </div> @@ -239,16 +404,33 @@ <ul class="list"> <li class="item"> <div>快递公司:</div> - <div class="value">{{ orderDetailList.delivery_name ? orderDetailList.delivery_name : '-' }}</div> + <div class="value"> + {{ + orderDetailList.delivery_name + ? orderDetailList.delivery_name + : "-" + }} + </div> </li> <li class="item"> <div>快递单号:</div> - <div class="value">{{ orderDetailList.delivery_id ? orderDetailList.delivery_id : '-' }}</div> - <el-button type="text" size="mini" style="margin-left: 5px" @click="openLogistics">物流查询</el-button> + <div class="value"> + {{ + orderDetailList.delivery_id + ? orderDetailList.delivery_id + : "-" + }} + </div> + <el-button + type="text" + size="mini" + style="margin-left: 5px" + @click="openLogistics" + >物流查询</el-button + > </li> </ul> </div> - </el-tab-pane> <el-tab-pane label="商品信息" name="goods"> <el-table :data="orderDetailList.orderProduct" size="small"> @@ -262,10 +444,14 @@ /> </div> <div> - <div class="line1">{{ scope.row.cart_info.product.store_name }}</div> + <div class="line1"> + {{ scope.row.cart_info.product.store_name }} + </div> <div class="line1 gary"> 规格:{{ - scope.row.cart_info.productAttr.sku ? scope.row.cart_info.productAttr.sku : '默认' + scope.row.cart_info.productAttr.sku + ? scope.row.cart_info.productAttr.sku + : "默认" }} </div> </div> @@ -276,7 +462,11 @@ <template slot-scope="scope"> <div class="tab"> <div class="line1"> - {{ scope.row.cart_info.productAttr.price ? scope.row.cart_info.productAttr.price : '-' }} + {{ + scope.row.cart_info.productAttr.price + ? scope.row.cart_info.productAttr.price + : "-" + }} </div> </div> </template> @@ -285,16 +475,22 @@ <template slot-scope="scope"> <div class="tab"> <div class="line1"> - {{ scope.row.cart_info.productAttr.cost ? scope.row.cart_info.productAttr.cost : '-' }} + {{ + scope.row.cart_info.productAttr.cost + ? scope.row.cart_info.productAttr.cost + : "-" + }} </div> </div> </template> </el-table-column> - <el-table-column label="实付金额" min-width="90"> + <el-table-column label="实付金额" min-width="90"> <template slot-scope="scope"> <div class="tab"> <div class="line1"> - {{ scope.row.product_price ? scope.row.product_price : '-' }} + {{ + scope.row.product_price ? scope.row.product_price : "-" + }} </div> </div> </template> @@ -382,13 +578,24 @@ </el-table-column> </el-table> <div class="block"> - <el-pagination :page-size="tableFromLog.limit" :current-page="tableFromLog.page" layout="prev, pager, next, jumper" :total="tableDataLog.total" @size-change="handleSizeChangeLog" @current-change="pageChangeLog" /> + <el-pagination + :page-size="tableFromLog.limit" + :current-page="tableFromLog.page" + layout="prev, pager, next, jumper" + :total="tableDataLog.total" + @size-change="handleSizeChangeLog" + @current-change="pageChangeLog" + /> </div> </el-tab-pane> - <el-tab-pane v-if="childOrder.length>0" label="关联订单" name="subOrder"> + <el-tab-pane + v-if="childOrder.length > 0" + label="关联订单" + name="subOrder" + > <el-table :data="childOrder"> - <el-table-column label="订单编号" prop="order_sn" min-width="150"> - <template slot-scope="scope"> + <el-table-column label="订单编号" prop="order_sn" min-width="150"> + <template slot-scope="scope"> <div>{{ scope.row.order_sn }}</div> </template> </el-table-column> @@ -405,28 +612,46 @@ :preview-src-list="[val.cart_info.product.image]" /> </div> - <span - class="tabBox_tit" - >{{ val.cart_info.product.store_name + ' | ' }}{{ val.cart_info.productAttr.sku }}</span> + <span class="tabBox_tit" + >{{ val.cart_info.product.store_name + " | " + }}{{ val.cart_info.productAttr.sku }}</span + > <span class="tabBox_pice"> - {{ '¥'+ val.cart_info.productAttr.price + ' x '+ val.product_num }} + {{ + "¥" + + val.cart_info.productAttr.price + + " x " + + val.product_num + }} <em - v-if="val.refund_num < val.product_num && val.refund_num > 0" + v-if=" + val.refund_num < val.product_num && val.refund_num > 0 + " style="color: red;font-style: normal;" - >(-{{ val.product_num - val.refund_num }})</em> + >(-{{ val.product_num - val.refund_num }})</em + > </span> </div> </template> - </el-table-column> + </el-table-column> <el-table-column label="实际支付" min-width="80" align="center"> <template slot-scope="scope"> <span>{{ scope.row.pay_price }}</span> </template> </el-table-column> - <el-table-column label="订单生成时间" prop="create_time" min-width="120" /> + <el-table-column + label="订单生成时间" + prop="create_time" + min-width="120" + /> <el-table-column label="操作" min-width="50" fixed="right"> <template slot-scope="scope"> - <el-button type="text" size="small" @click="getChildOrderDetail(scope.row.order_id)">详情</el-button> + <el-button + type="text" + size="small" + @click="getChildOrderDetail(scope.row.order_id)" + >详情</el-button + > </template> </el-table-column> </el-table> @@ -441,7 +666,9 @@ v-if="dialogLogistics" > <div class="logistics acea-row row-top"> - <div class="logistics_img"><img src="@/assets/images/expressi.jpg"></div> + <div class="logistics_img"> + <img src="@/assets/images/expressi.jpg" /> + </div> <div class="logistics_cent"> <span>物流公司:{{ orderDetailList.delivery_name }}</span> <span>物流单号:{{ orderDetailList.delivery_id }}</span> @@ -449,8 +676,8 @@ </div> <div class="acea-row row-column-around trees-coadd"> <div class="scollhide"> - <el-timeline v-if="result.length>0"> - <el-timeline-item v-for="(item,i) in result" :key="i"> + <el-timeline v-if="result.length > 0"> + <el-timeline-item v-for="(item, i) in result" :key="i"> <p class="time" v-text="item.time" /> <p class="content" v-text="item.status" /> </el-timeline-item> @@ -463,7 +690,6 @@ </div> </template> <script> - import { getExpress, orderDeliveryApi, @@ -472,31 +698,31 @@ import { orderPrintApi, orderRemarkApi, getChildrenOrderApi -} from '@/api/order'; -import orderCancellate from './orderCancellate' +} from "@/api/order"; +import orderCancellate from "./orderCancellate"; export default { - components: { + components: { orderCancellate }, props: { drawer: { type: Boolean, - default: false, - }, + default: false + } }, data() { return { loading: true, - orderId: '', - direction: 'rtl', - activeName: 'detail', + orderId: "", + direction: "rtl", + activeName: "detail", goodsList: [], timeVal: [], orderConfirm: false, sendGoods: false, dialogLogistics: false, confirmReceiptForm: { - id: '', + id: "" }, tableDataLog: { data: [], @@ -507,15 +733,15 @@ export default { result: [], orderDetailList: { user: { - real_name: '', + real_name: "" }, groupOrder: { - group_order_sn: '', - }, + group_order_sn: "" + } }, - orderImg: require('@/assets/images/order_icon.png'), + orderImg: require("@/assets/images/order_icon.png"), tableFromLog: { - user_type: '', + user_type: "", date: [], page: 1, limit: 10 @@ -523,94 +749,99 @@ export default { childOrder: [] }; }, - filters: { - }, + filters: {}, methods: { // 具体日期 onchangeTime(e) { - this.timeVal = e - this.tableFromLog.date = e ? this.timeVal.join('-') : '' - this.onOrderLog(this.orderId) + this.timeVal = e; + this.tableFromLog.date = e ? this.timeVal.join("-") : ""; + this.onOrderLog(this.orderId); }, handleClose() { - this.activeName = 'detail'; - this.$emit('closeDrawer'); + this.activeName = "detail"; + this.$emit("closeDrawer"); this.sendGoods = false; this.orderRemark = false; }, openLogistics() { - this.getOrderData() - this.dialogLogistics = true + this.getOrderData(); + this.dialogLogistics = true; }, // 订单核销 orderCancellation() { - const that = this + const that = this; that.$refs.orderCancellate.dialogVisible = true; - that.$refs.orderCancellate.productDetails(that.orderDetailList.verify_code) + that.$refs.orderCancellate.productDetails( + that.orderDetailList.verify_code + ); that.$refs.orderCancellate.isColum = true; }, // 发送货 - send(){ - this.$emit('send',this.orderDetailList,this.orderId); + send() { + this.$emit("send", this.orderDetailList, this.orderId); }, // 小票打印 printOrder() { orderPrintApi(this.orderId) - .then((res) => { - this.$message.success(res.message) - }) - .catch((res) => { - this.$message.error(res.message) + .then(res => { + this.$message.success(res.message); }) + .catch(res => { + this.$message.error(res.message); + }); }, - // 备注 + // 备注 onOrderMark() { - this.$modalForm(orderRemarkApi(this.orderId)).then(() => this.getInfo(this.orderId)) + this.$modalForm(orderRemarkApi(this.orderId)).then(() => + this.getInfo(this.orderId) + ); }, - //下拉 + //下拉 handleCommand(command) { - if (command == 'mark') { + if (command == "mark") { this.onOrderMark(); - } else if(command == 'modify') { + } else if (command == "modify") { this.reSend(this.orderId); - }else{ - this.refund(this.orderId) + } else { + this.refund(this.orderId); } }, // 退款 - refund(id){ - this.$emit('onOrderRefund',id); + refund(id) { + this.$emit("onOrderRefund", id); }, // 修改发货信息 - reSend(id){ - this.$emit('reSend',id); + reSend(id) { + this.$emit("reSend", id); }, // 修改订单信息 getList() { - this.$emit('getList',''); + this.$emit("getList", ""); }, // 获取子订单信息 getChildOrder() { this.loading = true; getChildrenOrderApi(this.orderId) - .then((res) => { - this.activeName = 'detail' - this.childOrder = res.data - setTimeout(()=>{ + .then(res => { + this.activeName = "detail"; + this.childOrder = res.data; + setTimeout(() => { this.loading = false; - },500) - }) - .catch((res) => { - this.$message.error(res.message) + }, 500); }) + .catch(res => { + this.$message.error(res.message); + }); }, - // 获取订单物流信息 + // 获取订单物流信息 getOrderData() { - getExpress(this.orderId).then(async res => { - this.result = res.data - }).catch(res => { - this.$message.error(res.message) - }) + getExpress(this.orderId) + .then(async res => { + this.result = res.data; + }) + .catch(res => { + this.$message.error(res.message); + }); }, //发送货 toSendGoods() { @@ -618,66 +849,66 @@ export default { }, getDelivery() { orderDeliveryApi(this.orderId) - .then((res) => { + .then(res => { this.$message.success(res.message); this.sendGoods = false; }) - .catch((res) => { + .catch(res => { this.$message.error(res.message); }); }, - getChildOrderDetail(id){ + getChildOrderDetail(id) { this.getInfo(id); }, getInfo(id) { this.loading = true; this.orderId = id; orderDetailApi(id) - .then((res) => { + .then(res => { this.drawer = true; this.orderDetailList = res.data; - this.getChildOrder() + this.getChildOrder(); }) - .catch((res) => { + .catch(res => { this.$message.error(res.message); }); }, tabClick(tab) { - if (tab.name === 'orderList') { - this.onOrderLog(this.orderId) + if (tab.name === "orderList") { + this.onOrderLog(this.orderId); } }, - onOrderLog(id){ - orderLogApi(id, this.tableFromLog).then((res) => { - this.tableDataLog.data = res.data.list - this.tableDataLog.total = res.data.count + onOrderLog(id) { + orderLogApi(id, this.tableFromLog).then(res => { + this.tableDataLog.data = res.data.list; + this.tableDataLog.total = res.data.count; }); }, pageChangeLog(page) { - this.tableFromLog.page = page - this.onOrderLog(this.orderId) + this.tableFromLog.page = page; + this.onOrderLog(this.orderId); }, handleSizeChangeLog(val) { - this.tableFromLog.limit = val - this.onOrderLog(this.orderId) + this.tableFromLog.limit = val; + this.onOrderLog(this.orderId); }, operationType(type) { if (type == 0) { - return '系统'; + return "系统"; } else if (type == 1) { - return '用户'; + return "用户"; } else if (type == 2) { - return '平台'; + return "平台"; } else if (type == 3) { - return '商户'; + return "商户"; } else if (type == 4) { - return '商家客服'; + return "商家客服"; } else { - return '未知'; + return "未知"; } - }, - }, + } + } }; </script> <style lang="scss" scoped> @@ -743,7 +974,7 @@ export default { } .value3 { - color: #437FFD; + color: #437ffd; } .value4 { @@ -822,20 +1053,20 @@ export default { .gary { color: #aaa; } -.logistics{ +.logistics { align-items: center; padding: 10px 0px; - .logistics_img{ + .logistics_img { width: 45px; height: 45px; margin-right: 12px; - img{ + img { width: 100%; height: 100%; } } - .logistics_cent{ - span{ + .logistics_cent { + span { display: block; font-size: 12px; } diff --git a/src/views/order/orderRefund/refundDetail.vue b/src/views/order/orderRefund/refundDetail.vue index 0a44a3e..caf43f4 100644 --- a/src/views/order/orderRefund/refundDetail.vue +++ b/src/views/order/orderRefund/refundDetail.vue @@ -34,7 +34,7 @@ <div v-if="orderDatalist.delivery_id" class="description-term">退货快递单号:{{ orderDatalist.delivery_id }}</div> <div class="description-term">创建时间:{{ orderDatalist.create_time }}</div> <div class="description-term">退货金额:{{ orderDatalist.refund_price-orderDatalist.refund_postage }}</div> - <div class="description-term">退抵扣券:{{ orderDatalist.amount }}</div> + <div class="description-term">退折扣:{{ orderDatalist.amount }}</div> <div class="description-term">退运费金额:{{ orderDatalist.refund_postage }}</div> <div class="description-term">商家备注:{{ orderDatalist.mer_mark }}</div> <div class="description-term100">退款凭证: diff --git a/src/views/product/addProduct/index.vue b/src/views/product/addProduct/index.vue index a2e9abe..fc77c24 100644 --- a/src/views/product/addProduct/index.vue +++ b/src/views/product/addProduct/index.vue @@ -2,7 +2,11 @@ <div class="divBox"> <el-card class="box-card"> <div class="clearfix"> - <el-tabs :style="{'pointer-events':isTabs}" v-if="headTab.length > 0" v-model="currentTab"> + <el-tabs + :style="{ 'pointer-events': isTabs }" + v-if="headTab.length > 0" + v-model="currentTab" + > <el-tab-pane v-for="(item, index) in headTab" :key="index" @@ -38,8 +42,14 @@ > <div class="virtual_top">{{ item.tit }}</div> <div class="virtual_bottom">({{ item.tit2 }})</div> - <div v-if="formValidate.audit_type == item.id" class="virtual_san" /> - <div v-if="formValidate.audit_type == item.id" class="virtual_dui"> + <div + v-if="formValidate.audit_type == item.id" + class="virtual_san" + /> + <div + v-if="formValidate.audit_type == item.id" + class="virtual_dui" + > ✓ </div> </div> @@ -54,7 +64,7 @@ show-word-limit size="small" class="pageWidth" - :disabled='virStatus' + :disabled="virStatus" /> </el-form-item> </el-col> @@ -67,7 +77,7 @@ placeholder="请输入商品关键字" size="small" class="pageWidth" - :disabled='virStatus' + :disabled="virStatus" /> </el-form-item> </el-col> @@ -92,11 +102,25 @@ :props="props" filterable clearable - :disabled='virStatus' + :disabled="virStatus" @visible-change="getSpecsLst" /> </el-form-item> </el-col> + <el-col :span="24"> + <el-form-item label="定制产品:"> + <el-radio-group + :disabled="virStatus" + v-model="formValidate.is_customize" + > + <el-radio :label="0" class="radio">否</el-radio> + <el-radio :label="1">是</el-radio> + </el-radio-group> + <!-- <div style="color: red;"> + 选择是定制产品则不受20天没发货的限制,超出20天不自动退款 + </div> --> + </el-form-item> + </el-col> <!-- <el-col :span="24"> <el-form-item label="商户商品分类:"> <el-cascader @@ -154,7 +178,7 @@ @click="modalPicTap('1')" > <div v-if="formValidate.image" class="pictrue"> - <img :src="formValidate.image"> + <img :src="formValidate.image" /> </div> <div v-else class="upLoad"> <i class="el-icon-camera cameraIconfont" /> @@ -175,7 +199,7 @@ @dragenter="handleDragEnter($event, item)" @dragend="handleDragEnd($event, item)" > - <img :src="item"> + <img :src="item" /> <i class="el-icon-error btndel" @click="handleRemove(index)" @@ -201,7 +225,7 @@ v-model="videoLink" size="small" class="perW50" - :disabled='virStatus' + :disabled="virStatus" placeholder="请输入MP4格式的视频链接" /> <input @@ -209,13 +233,13 @@ type="file" style="display: none;" @change="zh_uploadFile_change" - > + /> <el-button type="primary" icon="ios-cloud-upload-outline" class="uploadVideo" size="small" - :disabled='virStatus' + :disabled="virStatus" @click="zh_uploadFile" > {{ videoLink ? "确认添加" : "上传视频" }} @@ -252,19 +276,30 @@ size="small" class="pageWidth" /> --> - <el-select :disabled='virStatus' v-model="formValidate.unit_name" placeholder="请选择" class="perW50 mr10" clearable filterable=""> - <el-option v-for="item in unitList" :key="item.label" :label="item.label" :value="item.label" /> + <el-select + :disabled="virStatus" + v-model="formValidate.unit_name" + placeholder="请选择" + class="perW50 mr10" + clearable + filterable="" + > + <el-option + v-for="item in unitList" + :key="item.label" + :label="item.label" + :value="item.label" + /> </el-select> <el-button type="primary" size="small" - :disabled='virStatus' + :disabled="virStatus" @click="addUnit" > 添加单位 </el-button> </el-form-item> - </el-col> <el-col :span="24"> <el-form-item label="商品简介:" prop="store_info"> @@ -272,14 +307,14 @@ v-model="formValidate.store_info" type="textarea" :rows="3" - :disabled='virStatus' + :disabled="virStatus" placeholder="请输入商品简介" class="pageWidth" size="small" /> </el-form-item> </el-col> -<!-- + <!-- <el-col :span="24"> <el-form-item label="优惠券(赠送券):" class="proCoupon"> <div class="acea-row"> @@ -309,7 +344,7 @@ v-model="formValidate.qualification.brands_name" placeholder="请输入品牌商标" size="small" - :disabled='virStatus' + :disabled="virStatus" class="pageWidth" /> </el-form-item> @@ -317,7 +352,7 @@ <el-col :span="24"> <el-form-item label="商品来源:"> <el-radio-group - :disabled='virStatus' + :disabled="virStatus" v-model="formValidate.qualification.commodity_type" @input="handlCommodity('formValidate')" > @@ -326,13 +361,19 @@ </el-radio-group> </el-form-item> </el-col> - <div v-if="formValidate.qualification.commodity_type==0" style="margin-left: 40px;"> + <div + v-if="formValidate.qualification.commodity_type == 0" + style="margin-left: 40px;" + > <div>生产企业资质</div> <el-col :span="24"> - <el-form-item label="企业名称:" prop="qualification.production_name"> + <el-form-item + label="企业名称:" + prop="qualification.production_name" + > <el-input v-model="formValidate.qualification.production_name" - :disabled='virStatus' + :disabled="virStatus" placeholder="请输入生产企业名称" size="small" class="pageWidth" @@ -340,7 +381,10 @@ </el-form-item> </el-col> <el-col :span="24"> - <el-form-item label="营业执照:" prop="qualification.businessList"> + <el-form-item + label="营业执照:" + prop="qualification.businessList" + > <el-upload ref="businessList" class="upload-demo" @@ -353,13 +397,27 @@ list-type="picture-card" :file-list="formValidate.qualification.businessList" > - <div slot="file" slot-scope="{ file }" class="el_upload_preview_list"> - <div v-if="['application/pdf'].includes(file.type)" class="pdfContainer"> + <div + slot="file" + slot-scope="{ file }" + class="el_upload_preview_list" + > + <div + v-if="['application/pdf'].includes(file.type)" + class="pdfContainer" + > {{ file.name }} </div> <!-- 图片预览 --> <el-image - v-if="['image/jpeg', 'image/png', 'image/jpg', 'image/gif'].includes(file.type)" + v-if=" + [ + 'image/jpeg', + 'image/png', + 'image/jpg', + 'image/gif' + ].includes(file.type) + " :id="'image' + file.uid" class="el-upload-list__item-thumbnail" :src="file.url" @@ -367,21 +425,33 @@ :preview-src-list="[file.url]" /> <span class="el-upload-list__item-actions"> - <span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)"> + <span + class="el-upload-list__item-preview" + @click="handlePictureCardPreview(file)" + > <i class="el-icon-zoom-in" /> </span> - <span v-if="!virStatus" class="el-upload-list__item-delete" @click="onRemoveHandler(file,'businessList')"> + <span + v-if="!virStatus" + class="el-upload-list__item-delete" + @click="onRemoveHandler(file, 'businessList')" + > <i class="el-icon-delete" /> </span> </span> </div> - <el-button :disabled='virStatus' size="small" type="primary">点击上传</el-button> + <el-button :disabled="virStatus" size="small" type="primary" + >点击上传</el-button + > <!-- <div slot="tip" class="el-upload__tip">只能上传图片和PDF文件</div> --> </el-upload> </el-form-item> </el-col> <el-col :span="24"> - <el-form-item label="生产许可证:" prop="qualification.licenceList"> + <el-form-item + label="生产许可证:" + prop="qualification.licenceList" + > <el-upload class="upload-demo" ref="licenceList" @@ -392,13 +462,27 @@ list-type="picture-card" :file-list="formValidate.qualification.licenceList" > - <div slot="file" slot-scope="{ file }" class="el_upload_preview_list"> - <div v-if="['application/pdf'].includes(file.type)" class="pdfContainer"> + <div + slot="file" + slot-scope="{ file }" + class="el_upload_preview_list" + > + <div + v-if="['application/pdf'].includes(file.type)" + class="pdfContainer" + > {{ file.name }} </div> <!-- 图片预览 --> <el-image - v-if="['image/jpeg', 'image/png', 'image/jpg', 'image/gif'].includes(file.type)" + v-if=" + [ + 'image/jpeg', + 'image/png', + 'image/jpg', + 'image/gif' + ].includes(file.type) + " :id="'image' + file.uid" class="el-upload-list__item-thumbnail" :src="file.url" @@ -406,22 +490,34 @@ :preview-src-list="[file.url]" /> <span class="el-upload-list__item-actions"> - <span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)"> + <span + class="el-upload-list__item-preview" + @click="handlePictureCardPreview(file)" + > <i class="el-icon-zoom-in" /> </span> - <span v-if="!virStatus" class="el-upload-list__item-delete" @click="onRemoveHandler(file,'licenceList')"> + <span + v-if="!virStatus" + class="el-upload-list__item-delete" + @click="onRemoveHandler(file, 'licenceList')" + > <i class="el-icon-delete" /> </span> </span> </div> - <el-button :disabled='virStatus' size="small" type="primary">点击上传</el-button> + <el-button :disabled="virStatus" size="small" type="primary" + >点击上传</el-button + > <!-- <div slot="tip" class="el-upload__tip">只能上传图片和PDF文件</div> --> </el-upload> </el-form-item> </el-col> <div>品牌方资质</div> <el-col :span="24"> - <el-form-item label="商标注册证:" prop="qualification.trademarkList"> + <el-form-item + label="商标注册证:" + prop="qualification.trademarkList" + > <el-upload class="upload-demo" ref="trademarkList" @@ -432,13 +528,27 @@ list-type="picture-card" :file-list="formValidate.qualification.trademarkList" > - <div slot="file" slot-scope="{ file }" class="el_upload_preview_list"> - <div v-if="['application/pdf'].includes(file.type)" class="pdfContainer"> + <div + slot="file" + slot-scope="{ file }" + class="el_upload_preview_list" + > + <div + v-if="['application/pdf'].includes(file.type)" + class="pdfContainer" + > {{ file.name }} </div> <!-- 图片预览 --> <el-image - v-if="['image/jpeg', 'image/png', 'image/jpg', 'image/gif'].includes(file.type)" + v-if=" + [ + 'image/jpeg', + 'image/png', + 'image/jpg', + 'image/gif' + ].includes(file.type) + " :id="'image' + file.uid" class="el-upload-list__item-thumbnail" :src="file.url" @@ -446,21 +556,33 @@ :preview-src-list="[file.url]" /> <span class="el-upload-list__item-actions"> - <span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)"> + <span + class="el-upload-list__item-preview" + @click="handlePictureCardPreview(file)" + > <i class="el-icon-zoom-in" /> </span> - <span v-if="!virStatus" class="el-upload-list__item-delete" @click="onRemoveHandler(file,'trademarkList')"> + <span + v-if="!virStatus" + class="el-upload-list__item-delete" + @click="onRemoveHandler(file, 'trademarkList')" + > <i class="el-icon-delete" /> </span> </span> </div> - <el-button :disabled='virStatus' size="small" type="primary">点击上传</el-button> + <el-button :disabled="virStatus" size="small" type="primary" + >点击上传</el-button + > <!-- <div slot="tip" class="el-upload__tip">只能上传图片和PDF文件</div> --> </el-upload> </el-form-item> </el-col> <el-col :span="24"> - <el-form-item label="销售授权及品牌方营业执照:" prop="qualification.authorizedList"> + <el-form-item + label="销售授权及品牌方营业执照:" + prop="qualification.authorizedList" + > <el-upload class="upload-demo" :action="filePdf" @@ -471,13 +593,27 @@ list-type="picture-card" :file-list="formValidate.qualification.authorizedList" > - <div slot="file" slot-scope="{ file }" class="el_upload_preview_list"> - <div v-if="['application/pdf'].includes(file.type)" class="pdfContainer"> + <div + slot="file" + slot-scope="{ file }" + class="el_upload_preview_list" + > + <div + v-if="['application/pdf'].includes(file.type)" + class="pdfContainer" + > {{ file.name }} </div> <!-- 图片预览 --> <el-image - v-if="['image/jpeg', 'image/png', 'image/jpg', 'image/gif'].includes(file.type)" + v-if=" + [ + 'image/jpeg', + 'image/png', + 'image/jpg', + 'image/gif' + ].includes(file.type) + " :id="'image' + file.uid" class="el-upload-list__item-thumbnail" :src="file.url" @@ -485,22 +621,34 @@ :preview-src-list="[file.url]" /> <span class="el-upload-list__item-actions"> - <span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)"> + <span + class="el-upload-list__item-preview" + @click="handlePictureCardPreview(file)" + > <i class="el-icon-zoom-in" /> </span> - <span v-if="!virStatus" class="el-upload-list__item-delete" @click="onRemoveHandler(file,'authorizedList')"> + <span + v-if="!virStatus" + class="el-upload-list__item-delete" + @click="onRemoveHandler(file, 'authorizedList')" + > <i class="el-icon-delete" /> </span> </span> </div> - <el-button :disabled='virStatus' size="small" type="primary">点击上传</el-button> + <el-button :disabled="virStatus" size="small" type="primary" + >点击上传</el-button + > <!-- <div slot="tip" class="el-upload__tip">只能上传图片和PDF文件</div> --> </el-upload> </el-form-item> </el-col> <div>产品资质</div> <el-col :span="24"> - <el-form-item label="商品检测报告及备案:" prop="qualification.commodityList"> + <el-form-item + label="商品检测报告及备案:" + prop="qualification.commodityList" + > <el-upload class="upload-demo" :action="filePdf" @@ -511,13 +659,27 @@ list-type="picture-card" :file-list="formValidate.qualification.commodityList" > - <div slot="file" slot-scope="{ file }" class="el_upload_preview_list"> - <div v-if="['application/pdf'].includes(file.type)" class="pdfContainer"> + <div + slot="file" + slot-scope="{ file }" + class="el_upload_preview_list" + > + <div + v-if="['application/pdf'].includes(file.type)" + class="pdfContainer" + > {{ file.name }} </div> <!-- 图片预览 --> <el-image - v-if="['image/jpeg', 'image/png', 'image/jpg', 'image/gif'].includes(file.type)" + v-if=" + [ + 'image/jpeg', + 'image/png', + 'image/jpg', + 'image/gif' + ].includes(file.type) + " :id="'image' + file.uid" class="el-upload-list__item-thumbnail" :src="file.url" @@ -525,15 +687,24 @@ :preview-src-list="[file.url]" /> <span class="el-upload-list__item-actions"> - <span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)"> + <span + class="el-upload-list__item-preview" + @click="handlePictureCardPreview(file)" + > <i class="el-icon-zoom-in" /> </span> - <span v-if="!virStatus" class="el-upload-list__item-delete" @click="onRemoveHandler(file,'commodityList')"> + <span + v-if="!virStatus" + class="el-upload-list__item-delete" + @click="onRemoveHandler(file, 'commodityList')" + > <i class="el-icon-delete" /> </span> </span> </div> - <el-button :disabled='virStatus' size="small" type="primary">点击上传</el-button> + <el-button :disabled="virStatus" size="small" type="primary" + >点击上传</el-button + > <!-- <div slot="tip" class="el-upload__tip">只能上传图片和PDF文件</div> --> </el-upload> </el-form-item> @@ -550,13 +721,27 @@ list-type="picture-card" :file-list="formValidate.qualification.otherList" > - <div slot="file" slot-scope="{ file }" class="el_upload_preview_list"> - <div v-if="['application/pdf'].includes(file.type)" class="pdfContainer"> + <div + slot="file" + slot-scope="{ file }" + class="el_upload_preview_list" + > + <div + v-if="['application/pdf'].includes(file.type)" + class="pdfContainer" + > {{ file.name }} </div> <!-- 图片预览 --> <el-image - v-if="['image/jpeg', 'image/png', 'image/jpg', 'image/gif'].includes(file.type)" + v-if=" + [ + 'image/jpeg', + 'image/png', + 'image/jpg', + 'image/gif' + ].includes(file.type) + " :id="'image' + file.uid" class="el-upload-list__item-thumbnail" :src="file.url" @@ -564,26 +749,38 @@ :preview-src-list="[file.url]" /> <span class="el-upload-list__item-actions"> - <span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)"> + <span + class="el-upload-list__item-preview" + @click="handlePictureCardPreview(file)" + > <i class="el-icon-zoom-in" /> </span> - <span v-if="!virStatus" class="el-upload-list__item-delete" @click="onRemoveHandler(file,'otherList')"> + <span + v-if="!virStatus" + class="el-upload-list__item-delete" + @click="onRemoveHandler(file, 'otherList')" + > <i class="el-icon-delete" /> </span> </span> </div> - <el-button :disabled='virStatus' size="small" type="primary">点击上传</el-button> + <el-button :disabled="virStatus" size="small" type="primary" + >点击上传</el-button + > </el-upload> </el-form-item> </el-col> </div> - <div v-if="formValidate.qualification.commodity_type==1" style="margin-left: 40px;"> + <div + v-if="formValidate.qualification.commodity_type == 1" + style="margin-left: 40px;" + > <div>进口企业/境内总代企业资质</div> <el-col :span="24"> <el-form-item label="企业名称:" prop="qualification.import_name"> <el-input v-model="formValidate.qualification.import_name" - :disabled='virStatus' + :disabled="virStatus" placeholder="请输入进口/企业境内总代企业名称" size="small" class="pageWidth" @@ -591,7 +788,10 @@ </el-form-item> </el-col> <el-col :span="24"> - <el-form-item label="营业执照:" prop="qualification.importBusinessList"> + <el-form-item + label="营业执照:" + prop="qualification.importBusinessList" + > <el-upload class="upload-demo" ref="importBusinessList" @@ -602,13 +802,27 @@ list-type="picture-card" :file-list="formValidate.qualification.importBusinessList" > - <div slot="file" slot-scope="{ file }" class="el_upload_preview_list"> - <div v-if="['application/pdf'].includes(file.type)" class="pdfContainer"> + <div + slot="file" + slot-scope="{ file }" + class="el_upload_preview_list" + > + <div + v-if="['application/pdf'].includes(file.type)" + class="pdfContainer" + > {{ file.name }} </div> <!-- 图片预览 --> <el-image - v-if="['image/jpeg', 'image/png', 'image/jpg', 'image/gif'].includes(file.type)" + v-if=" + [ + 'image/jpeg', + 'image/png', + 'image/jpg', + 'image/gif' + ].includes(file.type) + " :id="'image' + file.uid" class="el-upload-list__item-thumbnail" :src="file.url" @@ -616,22 +830,34 @@ :preview-src-list="[file.url]" /> <span class="el-upload-list__item-actions"> - <span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)"> + <span + class="el-upload-list__item-preview" + @click="handlePictureCardPreview(file)" + > <i class="el-icon-zoom-in" /> </span> - <span v-if="!virStatus" class="el-upload-list__item-delete" @click="onRemoveHandler(file,'importBusinessList')"> + <span + v-if="!virStatus" + class="el-upload-list__item-delete" + @click="onRemoveHandler(file, 'importBusinessList')" + > <i class="el-icon-delete" /> </span> </span> </div> - <el-button :disabled='virStatus' size="small" type="primary">点击上传</el-button> + <el-button :disabled="virStatus" size="small" type="primary" + >点击上传</el-button + > <!-- <div slot="tip" class="el-upload__tip">只能上传图片和PDF文件</div> --> </el-upload> </el-form-item> </el-col> <div>品牌方资质</div> <el-col :span="24"> - <el-form-item label="销售授权及品牌方营业执照:" prop="qualification.importAuthorizedList"> + <el-form-item + label="销售授权及品牌方营业执照:" + prop="qualification.importAuthorizedList" + > <el-upload class="upload-demo" ref="importAuthorizedList" @@ -642,13 +868,27 @@ list-type="picture-card" :file-list="formValidate.qualification.importAuthorizedList" > - <div slot="file" slot-scope="{ file }" class="el_upload_preview_list"> - <div v-if="['application/pdf'].includes(file.type)" class="pdfContainer"> + <div + slot="file" + slot-scope="{ file }" + class="el_upload_preview_list" + > + <div + v-if="['application/pdf'].includes(file.type)" + class="pdfContainer" + > {{ file.name }} </div> <!-- 图片预览 --> <el-image - v-if="['image/jpeg', 'image/png', 'image/jpg', 'image/gif'].includes(file.type)" + v-if=" + [ + 'image/jpeg', + 'image/png', + 'image/jpg', + 'image/gif' + ].includes(file.type) + " :id="'image' + file.uid" class="el-upload-list__item-thumbnail" :src="file.url" @@ -656,22 +896,34 @@ :preview-src-list="[file.url]" /> <span class="el-upload-list__item-actions"> - <span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)"> + <span + class="el-upload-list__item-preview" + @click="handlePictureCardPreview(file)" + > <i class="el-icon-zoom-in" /> </span> - <span v-if="!virStatus" class="el-upload-list__item-delete" @click="onRemoveHandler(file,'importAuthorizedList')"> + <span + v-if="!virStatus" + class="el-upload-list__item-delete" + @click="onRemoveHandler(file, 'importAuthorizedList')" + > <i class="el-icon-delete" /> </span> </span> </div> - <el-button :disabled='virStatus' size="small" type="primary">点击上传</el-button> + <el-button :disabled="virStatus" size="small" type="primary" + >点击上传</el-button + > <!-- <div slot="tip" class="el-upload__tip">只能上传图片和PDF文件</div> --> </el-upload> </el-form-item> </el-col> <div>产品资质</div> <el-col :span="24"> - <el-form-item label="海关检验检疫证书及报关单:" prop="qualification.customsList"> + <el-form-item + label="海关检验检疫证书及报关单:" + prop="qualification.customsList" + > <el-upload class="upload-demo" ref="customsList" @@ -682,13 +934,27 @@ list-type="picture-card" :file-list="formValidate.qualification.customsList" > - <div slot="file" slot-scope="{ file }" class="el_upload_preview_list"> - <div v-if="['application/pdf'].includes(file.type)" class="pdfContainer"> + <div + slot="file" + slot-scope="{ file }" + class="el_upload_preview_list" + > + <div + v-if="['application/pdf'].includes(file.type)" + class="pdfContainer" + > {{ file.name }} </div> <!-- 图片预览 --> <el-image - v-if="['image/jpeg', 'image/png', 'image/jpg', 'image/gif'].includes(file.type)" + v-if=" + [ + 'image/jpeg', + 'image/png', + 'image/jpg', + 'image/gif' + ].includes(file.type) + " :id="'image' + file.uid" class="el-upload-list__item-thumbnail" :src="file.url" @@ -696,21 +962,33 @@ :preview-src-list="[file.url]" /> <span class="el-upload-list__item-actions"> - <span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)"> + <span + class="el-upload-list__item-preview" + @click="handlePictureCardPreview(file)" + > <i class="el-icon-zoom-in" /> </span> - <span v-if="!virStatus" class="el-upload-list__item-delete" @click="onRemoveHandler(file,'customsList')"> + <span + v-if="!virStatus" + class="el-upload-list__item-delete" + @click="onRemoveHandler(file, 'customsList')" + > <i class="el-icon-delete" /> </span> </span> </div> - <el-button :disabled='virStatus' size="small" type="primary">点击上传</el-button> + <el-button :disabled="virStatus" size="small" type="primary" + >点击上传</el-button + > <!-- <div slot="tip" class="el-upload__tip">只能上传图片和PDF文件</div> --> </el-upload> </el-form-item> </el-col> <el-col :span="24"> - <el-form-item label="产品外包装实拍图含中文标签:" prop="qualification.packingList"> + <el-form-item + label="产品外包装实拍图含中文标签:" + prop="qualification.packingList" + > <el-upload class="upload-demo" ref="packingList" @@ -721,13 +999,27 @@ list-type="picture-card" :file-list="formValidate.qualification.packingList" > - <div slot="file" slot-scope="{ file }" class="el_upload_preview_list"> - <div v-if="['application/pdf'].includes(file.type)" class="pdfContainer"> + <div + slot="file" + slot-scope="{ file }" + class="el_upload_preview_list" + > + <div + v-if="['application/pdf'].includes(file.type)" + class="pdfContainer" + > {{ file.name }} </div> <!-- 图片预览 --> <el-image - v-if="['image/jpeg', 'image/png', 'image/jpg', 'image/gif'].includes(file.type)" + v-if=" + [ + 'image/jpeg', + 'image/png', + 'image/jpg', + 'image/gif' + ].includes(file.type) + " :id="'image' + file.uid" class="el-upload-list__item-thumbnail" :src="file.url" @@ -735,21 +1027,33 @@ :preview-src-list="[file.url]" /> <span class="el-upload-list__item-actions"> - <span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)"> + <span + class="el-upload-list__item-preview" + @click="handlePictureCardPreview(file)" + > <i class="el-icon-zoom-in" /> </span> - <span v-if="!virStatus" class="el-upload-list__item-delete" @click="onRemoveHandler(file,'packingList')"> + <span + v-if="!virStatus" + class="el-upload-list__item-delete" + @click="onRemoveHandler(file, 'packingList')" + > <i class="el-icon-delete" /> </span> </span> </div> - <el-button :disabled='virStatus' size="small" type="primary">点击上传</el-button> + <el-button :disabled="virStatus" size="small" type="primary" + >点击上传</el-button + > <!-- <div slot="tip" class="el-upload__tip">只能上传图片和PDF文件</div> --> </el-upload> </el-form-item> </el-col> <el-col :span="24"> - <el-form-item label="其他资质:" prop="qualification.importOtherList"> + <el-form-item + label="其他资质:" + prop="qualification.importOtherList" + > <el-upload class="upload-demo" ref="importOtherList" @@ -760,13 +1064,27 @@ list-type="picture-card" :file-list="formValidate.qualification.importOtherList" > - <div slot="file" slot-scope="{ file }" class="el_upload_preview_list"> - <div v-if="['application/pdf'].includes(file.type)" class="pdfContainer"> + <div + slot="file" + slot-scope="{ file }" + class="el_upload_preview_list" + > + <div + v-if="['application/pdf'].includes(file.type)" + class="pdfContainer" + > {{ file.name }} </div> <!-- 图片预览 --> <el-image - v-if="['image/jpeg', 'image/png', 'image/jpg', 'image/gif'].includes(file.type)" + v-if=" + [ + 'image/jpeg', + 'image/png', + 'image/jpg', + 'image/gif' + ].includes(file.type) + " :id="'image' + file.uid" class="el-upload-list__item-thumbnail" :src="file.url" @@ -774,15 +1092,24 @@ :preview-src-list="[file.url]" /> <span class="el-upload-list__item-actions"> - <span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)"> + <span + class="el-upload-list__item-preview" + @click="handlePictureCardPreview(file)" + > <i class="el-icon-zoom-in" /> </span> - <span v-if="!virStatus" class="el-upload-list__item-delete" @click="onRemoveHandler(file,'importOtherList')"> + <span + v-if="!virStatus" + class="el-upload-list__item-delete" + @click="onRemoveHandler(file, 'importOtherList')" + > <i class="el-icon-delete" /> </span> </span> </div> - <el-button :disabled='virStatus' size="small" type="primary">点击上传</el-button> + <el-button :disabled="virStatus" size="small" type="primary" + >点击上传</el-button + > <!-- <div slot="tip" class="el-upload__tip">只能上传图片和PDF文件</div> --> </el-upload> </el-form-item> @@ -804,7 +1131,11 @@ <el-radio :label="1" class="radio">单独设置</el-radio> <el-radio :label="0">默认设置</el-radio> </el-radio-group> - <span style="color: #F56464;">(平台设置,一级佣金{{ extension_one_rate }}%,二级佣金{{ extension_two_rate }}%)</span> + <span style="color: #F56464;" + >(平台设置,一级佣金{{ extension_one_rate }}%,二级佣金{{ + extension_two_rate + }}%)</span + > </el-form-item> </el-col> <el-col :span="24"> @@ -827,7 +1158,7 @@ <el-form-item label="商品规格:" props="spec_type"> <el-radio-group v-model="formValidate.spec_type" - :disabled='virStatus' + :disabled="virStatus" @change="onChangeSpec(formValidate.spec_type)" > <el-radio :label="0" class="radio">单规格</el-radio> @@ -852,12 +1183,11 @@ class="ml15" size="small" @click="confirm" - >确认</el-button> - <el-button - class="ml15" - size="small" - @click="addRule" - >添加规格模板</el-button> + >确认</el-button + > + <el-button class="ml15" size="small" @click="addRule" + >添加规格模板</el-button + > </div> </el-form-item> <el-form-item v-if="formValidate.attr.length > 0"> @@ -880,7 +1210,7 @@ class="mb5 mr10 move-icon" style="cursor: pointer;" @close="handleClose(item.detail, indexn)" - >{{ j }} + >{{ j }} </el-tag> </draggable> <el-input @@ -899,7 +1229,8 @@ class="button-new-tag" size="small" @click="showInput(item)" - >+ 添加</el-button> + >+ 添加</el-button + > </div> </div> </el-form-item> @@ -929,7 +1260,8 @@ class="ml15" size="small" @click="createAttrName" - >确定</el-button> + >确定</el-button + > <el-button size="small" @click="offAttrName">取消</el-button> </el-form-item> </el-col> @@ -941,23 +1273,31 @@ class="mr15" size="small" @click="addBtn" - >添加新规格</el-button> + >添加新规格</el-button + > <el-button type="success" icon="md-add" class="mr15" size="small" @click="generate" - >立即生成</el-button> + >立即生成</el-button + > </el-form-item> </el-col> <!-- 批量设置--> <el-col - v-if="(formValidate.spec_type === 1 && formValidate.attr.length > 0 && $route.params.id) || (!$route.params.id && createProduct && formValidate.spec_type === 1)" + v-if=" + (formValidate.spec_type === 1 && + formValidate.attr.length > 0 && + $route.params.id) || + (!$route.params.id && + createProduct && + formValidate.spec_type === 1) + " :span="24" class="noForm" > - <el-form-item :label="'批量设置:'" class="labeltop"> <el-table :data="oneFormBatch" @@ -967,8 +1307,14 @@ > <el-table-column align="center" label="商品规格" min-width="80"> <template slot-scope="scope"> - <div class="acea-row row-between-wrapper" style="cursor: pointer;" @click="batchAttr"> - <div style="width: 45px;">{{ oneFormBatch[0]['attr'] }}</div> + <div + class="acea-row row-between-wrapper" + style="cursor: pointer;" + @click="batchAttr" + > + <div style="width: 45px;"> + {{ oneFormBatch[0]["attr"] }} + </div> <i class="el-icon-arrow-down" /> </div> </template> @@ -981,7 +1327,7 @@ @click="modalPicTap('1', 'pi')" > <div v-if="scope.row.image" class="pictrue tabPic"> - <img :src="scope.row.image"> + <img :src="scope.row.image" /> </div> <div v-else class="upLoad tabPic"> <i class="el-icon-camera cameraIconfont" /> @@ -1012,7 +1358,7 @@ type="text" size="small" :disabled="isVirStatus(iii)" - @input="handleCost(scope.row,iii,$event,'batchAdd')" + @input="handleCost(scope.row, iii, $event, 'batchAdd')" class="priceBox" /> <el-input-number @@ -1026,7 +1372,10 @@ @blur="memberPrice(formThead[iii], scope.row)" /> <el-input - v-if="formThead[iii].title === '库存' && formValidate.type == 2" + v-if=" + formThead[iii].title === '库存' && + formValidate.type == 2 + " v-model="scope.row[iii]" type="text" size="small" @@ -1034,7 +1383,10 @@ disabled /> <el-input - v-else-if="formThead[iii].title === '库存' && formValidate.type != 2" + v-else-if=" + formThead[iii].title === '库存' && + formValidate.type != 2 + " v-model="scope.row[iii]" type="text" size="small" @@ -1048,23 +1400,32 @@ type="text" size="small" :disabled="isVirStatus(iii)" - @input="handleCost(scope.row,iii,$event,'batchAdd')" + @input="handleCost(scope.row, iii, $event, 'batchAdd')" class="priceBox" /> <el-input - v-else-if="formThead[iii].title === '库存' && formValidate.type == 2" + v-else-if=" + formThead[iii].title === '库存' && + formValidate.type == 2 + " v-model="scope.row[iii]" type="text" size="small" class="priceBox" disabled /> - <el-select @change="proportionChange(scope.row,iii,$event)" v-else-if="formThead[iii].title === '占比'" v-model="scope.row[iii]" placeholder="请选择"> + <el-select + @change="proportionChange(scope.row, iii, $event)" + v-else-if="formThead[iii].title === '占比'" + v-model="scope.row[iii]" + placeholder="请选择" + > <el-option v-for="item in proportionList" :key="item.value" :label="item.label" - :value="item.value"> + :value="item.value" + > </el-option> </el-select> <el-input @@ -1087,7 +1448,8 @@ class="submission" size="small" @click="batchAdd" - >批量添加</el-button> + >批量添加</el-button + > </template> </el-table-column> </el-table> @@ -1095,7 +1457,14 @@ </el-col> <el-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24"> <!-- 单规格表格--> - <el-form-item :rules="{required: true, message: '域名不能为空', trigger: 'blur'}" v-if="formValidate.spec_type === 0"> + <el-form-item + :rules="{ + required: true, + message: '域名不能为空', + trigger: 'blur' + }" + v-if="formValidate.spec_type === 0" + > <el-table :data="OneattrValue" border @@ -1109,7 +1478,7 @@ @click="modalPicTap('1', 'dan', 'pi')" > <div v-if="scope.row.image" class="pictrue tabPic"> - <img :src="scope.row.image"> + <img :src="scope.row.image" /> </div> <div v-else class="upLoad tabPic"> <i class="el-icon-camera cameraIconfont" /> @@ -1125,7 +1494,9 @@ min-width="120" > <template slot-scope="scope"> - <div v-if="formValidate.svip_price_type != 0 && formThead[iii]"> + <div + v-if="formValidate.svip_price_type != 0 && formThead[iii]" + > <el-input-number v-if="formThead[iii].title === '付费会员价'" v-model="scope.row[iii]" @@ -1141,7 +1512,7 @@ type="text" size="small" :disabled="isVirStatus(iii)" - @input="handleCost(scope.row,iii,$event)" + @input="handleCost(scope.row, iii, $event)" class="priceBox" /> <el-input-number @@ -1155,7 +1526,10 @@ @blur="memberPrice(formThead[iii], scope.row)" /> <el-input - v-if="formThead[iii].title === '库存' && formValidate.type == 2" + v-if=" + formThead[iii].title === '库存' && + formValidate.type == 2 + " v-model="scope.row[iii]" type="text" size="small" @@ -1163,7 +1537,10 @@ disabled /> <el-input - v-else-if="formThead[iii].title === '库存' && formValidate.type !== 2" + v-else-if=" + formThead[iii].title === '库存' && + formValidate.type !== 2 + " v-model="scope.row[iii]" type="text" size="small" @@ -1178,15 +1555,21 @@ type="text" size="small" :disabled="isVirStatus(iii)" - @input="handleCost(scope.row,iii,$event)" + @input="handleCost(scope.row, iii, $event)" class="priceBox" /> - <el-select @change="proportionChange(scope.row,iii,$event)" v-else-if="formThead[iii].title === '占比'" v-model="scope.row[iii]" placeholder="请选择"> + <el-select + @change="proportionChange(scope.row, iii, $event)" + v-else-if="formThead[iii].title === '占比'" + v-model="scope.row[iii]" + placeholder="请选择" + > <el-option v-for="item in proportionList" :key="item.value" :label="item.label" - :value="item.value"> + :value="item.value" + > </el-option> </el-select> <el-input-number @@ -1238,7 +1621,15 @@ </el-form-item> <!-- 多规格表格--> <el-form-item - v-if="(formValidate.spec_type === 1 && formValidate.attr.length > 0 && $route.params.id) || (!$route.params.id && createProduct && formValidate.spec_type === 1) || (!$route.params.id && formValidate.is_copy)" + v-if=" + (formValidate.spec_type === 1 && + formValidate.attr.length > 0 && + $route.params.id) || + (!$route.params.id && + createProduct && + formValidate.spec_type === 1) || + (!$route.params.id && formValidate.is_copy) + " class="labeltop" label="规格列表:" > @@ -1259,7 +1650,11 @@ min-width="80" > <template slot-scope="scope"> - <span class="priceBox" :class="scope.row.select?'selectOn':''" v-text="scope.row[iii]" /> + <span + class="priceBox" + :class="scope.row.select ? 'selectOn' : ''" + v-text="scope.row[iii]" + /> </template> </el-table-column> </template> @@ -1270,8 +1665,11 @@ title="750*750px" @click="modalPicTap('1', 'duo', scope.$index)" > - <div v-if="scope.row.image || scope.row.pic" class="pictrue tabPic"> - <img :src="scope.row.image || scope.row.pic"> + <div + v-if="scope.row.image || scope.row.pic" + class="pictrue tabPic" + > + <img :src="scope.row.image || scope.row.pic" /> </div> <div v-else class="upLoad tabPic"> <i class="el-icon-camera cameraIconfont" /> @@ -1287,7 +1685,9 @@ min-width="120" > <template slot-scope="scope"> - <div v-if="formValidate.svip_price_type != 0 && formThead[iii]"> + <div + v-if="formValidate.svip_price_type != 0 && formThead[iii]" + > <el-input-number v-if="formThead[iii].title === '付费会员价'" v-model="scope.row[iii]" @@ -1303,7 +1703,7 @@ type="text" size="small" :disabled="isVirStatus(iii)" - @input="handleCost(scope.row,iii,$event)" + @input="handleCost(scope.row, iii, $event)" class="priceBox" /> <el-input-number @@ -1317,7 +1717,10 @@ @blur="memberPrice(formThead[iii], scope.row)" /> <el-input - v-if="formThead[iii].title === '库存' && formValidate.type == 2" + v-if=" + formThead[iii].title === '库存' && + formValidate.type == 2 + " v-model="scope.row[iii]" type="text" size="small" @@ -1325,7 +1728,10 @@ disabled /> <el-input - v-else-if="formThead[iii].title === '库存' && formValidate.type != 2" + v-else-if=" + formThead[iii].title === '库存' && + formValidate.type != 2 + " v-model="scope.row[iii]" type="text" size="small" @@ -1340,23 +1746,32 @@ size="small" :class="scope.row[iii]" :disabled="isVirStatus(iii)" - @input="handleCost(scope.row,iii,$event)" + @input="handleCost(scope.row, iii, $event)" class="priceBox" /> <el-input - v-else-if="formThead[iii].title === '库存' && formValidate.type == 2" + v-else-if=" + formThead[iii].title === '库存' && + formValidate.type == 2 + " v-model="scope.row[iii]" type="text" size="small" class="priceBox" disabled /> - <el-select @change="proportionChange(scope.row,iii,$event)" v-else-if="formThead[iii].title === '占比'" v-model="scope.row[iii]" placeholder="请选择"> + <el-select + @change="proportionChange(scope.row, iii, $event)" + v-else-if="formThead[iii].title === '占比'" + v-model="scope.row[iii]" + placeholder="请选择" + > <el-option v-for="item in proportionList" :key="item.value" :label="item.label" - :value="item.value"> + :value="item.value" + > </el-option> </el-select> <el-input-number @@ -1460,7 +1875,7 @@ <el-checkbox-group v-model="checkboxGroup" size="small" - :disabled='virStatus' + :disabled="virStatus" @change="onChangeGroup" > <el-checkbox @@ -1481,16 +1896,13 @@ :key="index" class="pictrue" > - <img :src="item.image"> + <img :src="item.image" /> <i class="el-icon-error btndel" @click="deleteRecommend(index)" /> </div> - <div - v-if="goodList.length<18" - class="uploadCont" - > + <div v-if="goodList.length < 18" class="uploadCont"> <div class="upLoadPicBox" @click="openRecommend"> <div class="upLoad"> <i class="el-icon-camera cameraIconfont" /> @@ -1504,7 +1916,7 @@ <el-form-item v-if="deductionStatus > 0" label="积分抵扣比例:"> <el-radio-group v-model="deduction_set" - :disabled='virStatus' + :disabled="virStatus" @change="changeIntergral(deduction_set)" > <el-radio :label="1" class="radio">单独设置</el-radio> @@ -1565,7 +1977,10 @@ <el-col v-if="deliveryList.length > 0" :span="24"> <el-form-item label="送货方式:" prop="delivery_way"> <div class="acea-row"> - <el-checkbox-group :disabled='virStatus' v-model="formValidate.delivery_way"> + <el-checkbox-group + :disabled="virStatus" + v-model="formValidate.delivery_way" + > <el-checkbox v-for="item in deliveryList" :key="item.value" @@ -1577,28 +1992,28 @@ </div> </el-form-item> </el-col> - <el-col + <!-- <el-col v-if=" (formValidate.delivery_way.length == 2 || (formValidate.delivery_way.length == 1 && - formValidate.delivery_way[0] == 2)) && + formValidate.delivery_way[0] == 2)) && formValidate.type == 0 " :span="24" > - <!-- <el-form-item label="是否包邮:"> + <el-form-item label="是否包邮:"> <el-radio-group :disabled='virStatus' v-model="formValidate.delivery_free"> <el-radio :label="0" class="radio">否</el-radio> <el-radio :label="1">是</el-radio> </el-radio-group> - </el-form-item> --> - </el-col> + </el-form-item> + </el-col> --> <el-col v-if=" formValidate.delivery_free == 0 && (formValidate.delivery_way.length == 2 || - (formValidate.delivery_way.length == 1 && - formValidate.delivery_way[0] == 2)) && + (formValidate.delivery_way.length == 1 && + formValidate.delivery_way[0] == 2)) && formValidate.type == 0 " :span="24" @@ -1608,7 +2023,7 @@ <el-select v-model="formValidate.temp_id" size="small" - :disabled='virStatus' + :disabled="virStatus" placeholder="请选择" class="pageWidth" > @@ -1621,10 +2036,11 @@ </el-select> <el-button class="ml15" - :disabled='virStatus' + :disabled="virStatus" size="small" @click="addTem" - >添加运费模板</el-button> + >添加运费模板</el-button + > </div> </el-form-item> </el-col> @@ -1632,20 +2048,25 @@ <el-col> <el-form-item label="最少购买件数:"> <el-input-number - :disabled='virStatus' + :disabled="virStatus" v-model="formValidate.once_min_count" :min="0" size="small" controls-position="right" placeholder="请输入购买件数" /> - <span class="explanation">默认为0,则不限制购买件数</span> + <span class="explanation" + >默认为0,则不限制购买件数</span + > </el-form-item> </el-col> </el-col> <el-col :span="24"> <el-form-item label="限购类型:"> - <el-radio-group :disabled='virStatus' v-model="formValidate.pay_limit"> + <el-radio-group + :disabled="virStatus" + v-model="formValidate.pay_limit" + > <el-radio :label="0" class="radio">不限购</el-radio> <el-radio :label="1">单次限购</el-radio> <el-radio :label="2">长期限购</el-radio> @@ -1659,7 +2080,7 @@ v-model="formValidate.once_max_count" :min="formValidate.once_min_count" size="small" - :disabled='virStatus' + :disabled="virStatus" controls-position="right" placeholder="请输入购买件数" /> @@ -1672,7 +2093,7 @@ <el-form-item label="排序:"> <el-input-number v-model="formValidate.sort" - :disabled='virStatus' + :disabled="virStatus" controls-position="right" placeholder="请输入排序" size="small" @@ -1873,7 +2294,7 @@ <el-form-item label="商品提报备注:"> <el-input v-model="formValidate.remark" - :disabled='virStatus' + :disabled="virStatus" placeholder="请输入商品提报备注" size="small" class="pageWidth" @@ -1883,7 +2304,13 @@ <el-col :span="16"> <el-form-item v-if="formValidate.mer_form_id"> <div style="width: 350px;"> - <iframe id="iframe" ref="iframe" class="iframe-box" :src="formUrl" frameborder="0" /> + <iframe + id="iframe" + ref="iframe" + class="iframe-box" + :src="formUrl" + frameborder="0" + /> </div> <!-- <el-table border @@ -1913,7 +2340,7 @@ class="submission" size="small" @click="handleSubmitUp" - >上一步 + >上一步 </el-button> <el-button v-show="currentTab < 6" @@ -1921,7 +2348,7 @@ class="submission" size="small" @click="handleSubmitNest('formValidate')" - >下一步 + >下一步 </el-button> <el-button v-show="currentTab == '6' || $route.params.id" @@ -1930,7 +2357,7 @@ class="submission" size="small" @click="handleSubmit('formValidate')" - >提交 + >提交 </el-button> <el-button :loading="loading" @@ -1938,14 +2365,25 @@ class="submission" size="small" @click="handlePreview('formValidate')" - >预览 + >预览 </el-button> </el-form-item> </el-form> </el-card> <!--属性选择弹窗--> - <el-dialog v-if="attrShow" :visible.sync="attrShow" title="请选择商品规格" width="320px"> - <attr-list v-if="attrShow" :attrs="attrsList" @activeData="activeAttr" @close="labelAttr" @subAttrs="subAttrs" /> + <el-dialog + v-if="attrShow" + :visible.sync="attrShow" + title="请选择商品规格" + width="320px" + > + <attr-list + v-if="attrShow" + :attrs="attrsList" + @activeData="activeAttr" + @close="labelAttr" + @subAttrs="subAttrs" + /> </el-dialog> <!--添加服务保障模板--> <guarantee-service ref="serviceGuarantee" @get-list="getGuaranteeList" /> @@ -1961,7 +2399,13 @@ <!-- 生成淘宝京东表单--> <tao-bao ref="taoBao" @info-data="infoData" /> <!--添加卡密--> - <add-carMy ref="addCarMy" :virtual-list="virtualList" @changeVirtual="changeVirtual" @fixdBtn="fixdBtn" @closeCarMy="closeCarMy" /> + <add-carMy + ref="addCarMy" + :virtual-list="virtualList" + @changeVirtual="changeVirtual" + @fixdBtn="fixdBtn" + @closeCarMy="closeCarMy" + /> <!--选择店铺推荐商品--> <el-dialog :visible.sync="recommendVisible" @@ -1983,18 +2427,23 @@ top="4vh" :visible.sync="dialogVisible" width="80%" - > - <templatesFrom tempType='dialog' :tempId='0' @onsubmit='onsubmit' @resetForm="resetForm" @getList='getShippingList'/> + > + <templatesFrom + tempType="dialog" + :tempId="0" + @onsubmit="onsubmit" + @resetForm="resetForm" + @getList="getShippingList" + /> </el-dialog> </div> </template> <script> - -import ueditorFrom from '@/components/ueditorFrom' -import VueUeditorWrap from 'vue-ueditor-wrap' -import vuedraggable from 'vuedraggable' -import Sortable from 'sortablejs' +import ueditorFrom from "@/components/ueditorFrom"; +import VueUeditorWrap from "vue-ueditor-wrap"; +import vuedraggable from "vuedraggable"; +import Sortable from "sortablejs"; import { shippingListApi, templateLsitApi, @@ -2016,36 +2465,37 @@ import { associatedFormInfo, unitOptionsApi, unitCreatApi -} from '@/api/product' -import { roterPre } from '@/settings' -import guaranteeService from '@/components/serviceGuarantee/index' -import previewBox from '@/components/previewBox/index' -import attrList from '@/components/attrList' -import goodsList from '@/components/goodsList' -import SettingMer from '@/libs/settingMer' -import { getToken } from '@/utils/auth' -import taoBao from './taoBao' -import copyRecord from './copyRecord' -import addCarMy from './addCarMy' -import { toFixedNoRounding } from '@/utils/util' +} from "@/api/product"; +import { roterPre } from "@/settings"; +import guaranteeService from "@/components/serviceGuarantee/index"; +import previewBox from "@/components/previewBox/index"; +import attrList from "@/components/attrList"; +import goodsList from "@/components/goodsList"; +import SettingMer from "@/libs/settingMer"; +import { getToken } from "@/utils/auth"; +import taoBao from "./taoBao"; +import copyRecord from "./copyRecord"; +import addCarMy from "./addCarMy"; +import { toFixedNoRounding } from "@/utils/util"; const defaultObj = { - image: '', + image: "", + is_customize: 0, refund_switch: 1, slider_image: [], - store_name: '', - store_info: '', - keyword: '', - brand_id: '', // 品牌id - cate_id: '', // 平台分类id + store_name: "", + store_info: "", + keyword: "", + brand_id: "", // 品牌id + cate_id: "", // 平台分类id mer_cate_id: [], // 商户分类id param_temp_id: [], - unit_name: '', + unit_name: "", sort: 0, once_max_count: 0, is_good: 0, - temp_id: '', - video_link: '', - guarantee_template_id: '', + temp_id: "", + video_link: "", + guarantee_template_id: "", delivery_way: [], mer_labels: [], delivery_free: 0, @@ -2055,27 +2505,27 @@ const defaultObj = { params: [], attrValue: [ { - image: '', + image: "", price: null, cost: null, ot_price: null, svip_price: null, select: false, - proportion:0.60, - coupon:'', - growth:0, + proportion: 0.6, + coupon: "", + growth: 0, stock: null, cdkey: {}, - bar_code: '', + bar_code: "", weight: null, volume: null, - gist_url:'' + gist_url: "" } ], attr: [], extension_type: 0, integral_rate: -1, - content: '', + content: "", spec_type: 0, give_coupon_ids: [], is_gift_bag: 0, @@ -2084,11 +2534,11 @@ const defaultObj = { type: 0, product_type: 0, qualification_type: 0, - remark: '', + remark: "", // is_huimei:0, - audit_type:0, + audit_type: 0, qualification: { - production_name: '', + production_name: "", businessList: [], licenceList: [], trademarkList: [], @@ -2101,51 +2551,51 @@ const defaultObj = { packingList: [], importOtherList: [], commodity_type: 0, - brands_name: '', - import_name: '' + brands_name: "", + import_name: "" } -} +}; const objTitle = { price: { - title: '售价' + title: "售价" }, cost: { - title: '成本价' + title: "成本价" }, ot_price: { - title: '市场价' + title: "市场价" }, svip_price: { - title: '付费会员价' + title: "付费会员价" }, proportion: { - title: '占比' + title: "占比" }, - coupon:{ - title:'抵扣券' + coupon: { + title: "折扣" }, stock: { - title: '库存' + title: "库存" }, growth: { - title: '成长值' + title: "成长值" }, bar_code: { - title: '商品编号' + title: "商品编号" }, weight: { - title: '重量(KG)' + title: "重量(KG)" }, volume: { - title: '体积(m³)' + title: "体积(m³)" }, gist_url: { - title: '依据链接' + title: "依据链接" } -} -const proOptions = [{ name: '店铺推荐', value: 'is_good' }] +}; +const proOptions = [{ name: "店铺推荐", value: "is_good" }]; export default { - name: 'ProductProductAdd', + name: "ProductProductAdd", components: { ueditorFrom, VueUeditorWrap, @@ -2160,108 +2610,108 @@ export default { }, data() { const url = - SettingMer.https + '/upload/image/0/file?ueditor=1&token=' + getToken() + SettingMer.https + "/upload/image/0/file?ueditor=1&token=" + getToken(); return { myConfig: { autoHeightEnabled: false, // 编辑器不自动被内容撑高 initialFrameHeight: 500, // 初始容器高度 - initialFrameWidth: '100%', // 初始容器 + initialFrameWidth: "100%", // 初始容器 enableAutoSave: false, - UEDITOR_HOME_URL: '/UEditor/', + UEDITOR_HOME_URL: "/UEditor/", serverUrl: url, imageUrl: url, - imageFieldName: 'file', - imageUrlPrefix: '', - imageActionName: 'upfile', + imageFieldName: "file", + imageUrlPrefix: "", + imageActionName: "upfile", imageMaxSize: 2048000, - readonly:false, - imageAllowFiles: ['.png', '.jpg', '.jpeg', '.gif', '.bmp'] + readonly: false, + imageAllowFiles: [".png", ".jpg", ".jpeg", ".gif", ".bmp"] }, optionsCate: { - value: 'store_category_id', - label: 'cate_name', - children: 'children', + value: "store_category_id", + label: "cate_name", + children: "children", emitPath: false }, - proportionList:[ + proportionList: [ { - value: '0.80', - label: '0.80', - coupon:0.1, - growth:0.3 - }, - { - value: '0.75', - label: '0.75', - coupon:0.15, - growth:0.35 - }, - { - value: '0.70', - label: '0.70', - coupon:0.2, - growth:0.4 - }, - { - value: '0.65', - label: '0.65', - coupon:0.25, - growth:0.45 - }, - { - value: '0.60', - label: '0.60', - coupon:0.3, - growth:0.5 - }, - { - value: '0.55', - label: '0.55', - coupon:0.35, - growth:0.55 - }, - { - value: '0.50', - label: '0.50', - coupon:0.4, - growth:0.60 + value: "0.80", + label: "0.80", + coupon: 0.1, + growth: 0.3 }, { - value: '0.45', - label: '0.45', - coupon:0.45, - growth:0.65 - }, - { - value: '0.40', - label: '0.40', - coupon:0.5, - growth:0.7 + value: "0.75", + label: "0.75", + coupon: 0.15, + growth: 0.35 }, { - value: '0.35', - label: '0.35', - coupon:0.55, - growth:0.75 + value: "0.70", + label: "0.70", + coupon: 0.2, + growth: 0.4 }, { - value: '0.30', - label: '0.30', - coupon:0.60, - growth:0.8 + value: "0.65", + label: "0.65", + coupon: 0.25, + growth: 0.45 }, { - value: '0.25', - label: '0.25', - coupon:0.65, - growth:0.85 + value: "0.60", + label: "0.60", + coupon: 0.3, + growth: 0.5 }, { - value: '0.20', - label: '0.20', - coupon:0.7, - growth:0.9 + value: "0.55", + label: "0.55", + coupon: 0.35, + growth: 0.55 }, + { + value: "0.50", + label: "0.50", + coupon: 0.4, + growth: 0.6 + }, + { + value: "0.45", + label: "0.45", + coupon: 0.45, + growth: 0.65 + }, + { + value: "0.40", + label: "0.40", + coupon: 0.5, + growth: 0.7 + }, + { + value: "0.35", + label: "0.35", + coupon: 0.55, + growth: 0.75 + }, + { + value: "0.30", + label: "0.30", + coupon: 0.6, + growth: 0.8 + }, + { + value: "0.25", + label: "0.25", + coupon: 0.65, + growth: 0.85 + }, + { + value: "0.20", + label: "0.20", + coupon: 0.7, + growth: 0.9 + } // { // value: '0.15', // label: '0.15', @@ -2279,13 +2729,13 @@ export default { fileList: [], roterPre: roterPre, // baseURL: 'http://localhost:8080', - baseURL: SettingMer.httpUrl || 'http://localhost:8080', + baseURL: SettingMer.httpUrl || "http://localhost:8080", filePdf: `${SettingMer.httpUrl}/mer/upload/pdf`, pdfHeaders: { - 'X-Token': getToken() + "X-Token": getToken() }, - formUrl: '', - selectRule: '', + formUrl: "", + selectRule: "", checkboxGroup: [], recommend: proOptions, tabs: [], @@ -2309,7 +2759,7 @@ export default { formValidate: Object.assign({}, defaultObj), picValidate: true, formDynamics: { - template_name: '', + template_name: "", template_value: [] }, manyTabTit: {}, @@ -2333,18 +2783,18 @@ export default { }, // 规格数据 formDynamic: { - attrsName: '', - attrsVal: '' + attrsName: "", + attrsVal: "" }, isBtn: false, images: [], - currentTab: '1', - isChoice: '', + currentTab: "1", + isChoice: "", upload: { videoIng: false // 是否显示进度条; }, progress: 10, // 进度条默认0 - videoLink: '', + videoLink: "", grid: { xl: 8, lg: 8, @@ -2357,19 +2807,23 @@ export default { give_coupon_ids: [ { required: true, - message: '请选择优惠券', - trigger: 'change', - type: 'array' + message: "请选择优惠券", + trigger: "change", + type: "array" } ], - 'qualification.production_name': [ + "qualification.production_name": [ { - required: true, message: '请输入生产企业名称', trigger: 'blur' + required: true, + message: "请输入生产企业名称", + trigger: "blur" } ], - 'qualification.businessList': [ + "qualification.businessList": [ { - required: true, message: '请上传营业执照图片或者PDF', trigger: 'blur' + required: true, + message: "请上传营业执照图片或者PDF", + trigger: "blur" } ], // 'qualification.licenceList': [ @@ -2387,34 +2841,46 @@ export default { // required: true, message: '请上传销售授权及其他图片或者PDF', trigger: 'blur' // } // ], - 'qualification.commodityList': [ + "qualification.commodityList": [ { - required: true, message: '请上传商品检测报告及相关文件图片或者PDF', trigger: 'blur' + required: true, + message: "请上传商品检测报告及相关文件图片或者PDF", + trigger: "blur" } ], - 'qualification.import_name': [ + "qualification.import_name": [ { - required: true, message: '请输入进口/企业境内总代企业名称', trigger: 'blur' + required: true, + message: "请输入进口/企业境内总代企业名称", + trigger: "blur" } ], - 'qualification.importBusinessList': [ + "qualification.importBusinessList": [ { - required: true, message: '请上传营业执照图片或者PDF', trigger: 'blur' + required: true, + message: "请上传营业执照图片或者PDF", + trigger: "blur" } ], - 'qualification.importAuthorizedList': [ + "qualification.importAuthorizedList": [ { - required: true, message: '请上传销售授权及其他图片或者PDF', trigger: 'blur' + required: true, + message: "请上传销售授权及其他图片或者PDF", + trigger: "blur" } ], - 'qualification.customsList': [ + "qualification.customsList": [ { - required: true, message: '请上传海关检验检疫证书及报关单图片或者PDF', trigger: 'blur' + required: true, + message: "请上传海关检验检疫证书及报关单图片或者PDF", + trigger: "blur" } ], - 'qualification.packingList': [ + "qualification.packingList": [ { - required: true, message: '请上传产品外包装实物图的图片或者PDF', trigger: 'blur' + required: true, + message: "请上传产品外包装实物图的图片或者PDF", + trigger: "blur" } ], // 'qualification.otherList': [ @@ -2423,38 +2889,38 @@ export default { // } // ], store_name: [ - { required: true, message: '请输入商品名称', trigger: 'blur' } + { required: true, message: "请输入商品名称", trigger: "blur" } ], cate_id: [ - { required: true, message: '请选择平台分类', trigger: 'change' } + { required: true, message: "请选择平台分类", trigger: "change" } ], keyword: [ - { required: true, message: '请输入商品关键字', trigger: 'blur' } + { required: true, message: "请输入商品关键字", trigger: "blur" } ], - unit_name: [{ required: true, message: '请输入单位', trigger: 'blur' }], + unit_name: [{ required: true, message: "请输入单位", trigger: "blur" }], store_info: [ - { required: true, message: '请输入商品简介', trigger: 'blur' } + { required: true, message: "请输入商品简介", trigger: "blur" } ], temp_id: [ - { required: true, message: '请选择运费模板', trigger: 'change' } + { required: true, message: "请选择运费模板", trigger: "change" } ], once_max_count: [ - { required: true, message: '请输入限购数量', trigger: 'change' } + { required: true, message: "请输入限购数量", trigger: "change" } ], - image: [{ required: true, message: '请上传商品图', trigger: 'change' }], + image: [{ required: true, message: "请上传商品图", trigger: "change" }], slider_image: [ { required: true, - message: '请上传商品轮播图', - type: 'array', - trigger: 'change' + message: "请上传商品轮播图", + type: "array", + trigger: "change" } ], spec_type: [ - { required: true, message: '请选择商品规格', trigger: 'change' } + { required: true, message: "请选择商品规格", trigger: "change" } ], delivery_way: [ - { required: true, message: '请选择送货方式', trigger: 'change' } + { required: true, message: "请选择送货方式", trigger: "change" } ] }, attrInfo: {}, @@ -2462,59 +2928,59 @@ export default { extensionStatus: 0, deductionStatus: 0, previewVisible: false, - previewKey: '', + previewKey: "", deliveryType: [], virtual: [ - { tit: '食品及保健品', id: 0, tit2: '物流发货' }, - { tit: '化妆品及日化品', id: 1, tit2: '物流发货' }, - { tit: '其他品类', id: 2, tit2: '物流发货' } + { tit: "食品及保健品", id: 0, tit2: "物流发货" }, + { tit: "化妆品及日化品", id: 1, tit2: "物流发货" }, + { tit: "其他品类", id: 2, tit2: "物流发货" } ], customBtn: 0, // 自定义留言开关 // 自定义留言下拉选择 CustomList: [ { - value: 'text', - label: '文本框' + value: "text", + label: "文本框" }, { - value: 'number', - label: '数字' + value: "number", + label: "数字" }, { - value: 'email', - label: '邮件' + value: "email", + label: "邮件" }, { - value: 'date', - label: '日期' + value: "date", + label: "日期" }, { - value: 'time', - label: '时间' + value: "time", + label: "时间" }, { - value: 'idCard', - label: '身份证' + value: "idCard", + label: "身份证" }, { - value: 'mobile', - label: '手机号' + value: "mobile", + label: "手机号" }, { - value: 'image', - label: '图片' + value: "image", + label: "图片" } ], customess: { content: [] }, // 自定义留言内容 headTab: [ - { title: '商品信息', name: '1' }, - { title: '资质详情', name: '2' }, - { title: '规格设置', name: '3' }, - { title: '商品详情', name: '4' }, - { title: '营销设置', name: '5' }, - { title: '其他设置', name: '6' } + { title: "商品信息", name: "1" }, + { title: "资质详情", name: "2" }, + { title: "规格设置", name: "3" }, + { title: "商品详情", name: "4" }, + { title: "营销设置", name: "5" }, + { title: "其他设置", name: "6" } ], type: 0, modals: false, @@ -2522,19 +2988,19 @@ export default { price: null, cost: null, ot_price: null, - proportion:0.60, - coupon:'', + proportion: 0.6, + coupon: "", stock: null, // growth:0, - bar_code: '', + bar_code: "", weight: null, volume: null, - gist_url:'' + gist_url: "" }, open_svip: false, svip_rate: 0, - extension_one_rate: '', - extension_two_rate: '', + extension_one_rate: "", + extension_two_rate: "", customSpecs: [], merSpecsSelect: [], sysSpecsSelect: [], @@ -2549,52 +3015,52 @@ export default { createCount: this.$route.params.id ? 0 : -10, virtualList: [], formList: [], - carMyShow: false, // 是否开启卡密弹窗 + carMyShow: false, // 是否开启卡密弹窗 tabIndex: 0, - tabName: '', + tabName: "", oneFormBatch: [ { - attr: '全部', - image: '', - price: '', - cost: '', - ot_price: '', - svip_price: '', - proportion:'0.60', - coupon:'', - gist_url:'', - growth:0, - stock: '', + attr: "全部", + image: "", + price: "", + cost: "", + ot_price: "", + svip_price: "", + proportion: "0.60", + coupon: "", + gist_url: "", + growth: 0, + stock: "", cdkey: {}, - code: '', - weight: '', - volume: '' + code: "", + weight: "", + volume: "" } ], headerCarMy: { - title: '卡密设置', - slot: 'fictitious', - align: 'center', + title: "卡密设置", + slot: "fictitious", + align: "center", width: 95 }, - product_id: '', - dialogVisible:false, + product_id: "", + dialogVisible: false, goodList: [], unitList: [], recommendVisible: false, - virStatus:false - } + virStatus: false + }; }, computed: { attrValue() { - const obj = Object.assign({}, this.attrVal) - return obj + const obj = Object.assign({}, this.attrVal); + return obj; }, isTabs() { - if(!this.$route.params.id){ - return 'none' - }else{ - return 'all' + if (!this.$route.params.id) { + return "none"; + } else { + return "all"; } } // oneFormBatch() { @@ -2606,10 +3072,10 @@ export default { // } }, watch: { - 'formValidate.attr': { + "formValidate.attr": { handler: function(val) { - this.createCount += 1 - if (this.formValidate.spec_type === 1) this.watCh(val) + this.createCount += 1; + if (this.formValidate.spec_type === 1) this.watCh(val); }, immediate: false, deep: true @@ -2618,123 +3084,148 @@ export default { console.log(newVal); if (newVal == 6) { this.$nextTick(e => { - this.setSort() - }) + // this.setSort() + }); } } }, created() { - this.tempRoute = Object.assign({}, this.$route) + this.tempRoute = Object.assign({}, this.$route); if (this.$route.params.id && this.formValidate.spec_type === 1) { - this.$watch('formValidate.attr', this.watCh) + this.$watch("formValidate.attr", this.watCh); } }, mounted() { - this.getCategorySelect() - this.getCategoryList() - this.getBrandListApi() - this.getShippingList() - this.getGuaranteeList() - this.productGetRule() - this.getLabelLst() - this.getFormList() - this.getUnitList() - this.$store.dispatch('settings/setEdit', true) - this.formValidate.slider_image = [] + this.getCategorySelect(); + this.getCategoryList(); + this.getBrandListApi(); + this.getShippingList(); + this.getGuaranteeList(); + this.productGetRule(); + this.getLabelLst(); + this.getFormList(); + this.getUnitList(); + this.$store.dispatch("settings/setEdit", true); + this.formValidate.slider_image = []; if (this.$route.params.id) { - this.product_id = this.$route.params.id - this.setTagsViewTitle() - this.getInfo() + this.product_id = this.$route.params.id; + this.setTagsViewTitle(); + this.getInfo(); } else { - this.formValidate.qualification = Object.assign({}, defaultObj.qualification) - this.getSpecsLst(this.formValidate.cate_id) - this.productCon() - if (this.deduction_set == -1) this.formValidate.integral_rate = -1 + this.formValidate.qualification = Object.assign( + {}, + defaultObj.qualification + ); + this.getSpecsLst(this.formValidate.cate_id); + this.productCon(); + if (this.deduction_set == -1) this.formValidate.integral_rate = -1; } this.formValidate.attr.map(item => { - this.$set(item, 'inputVisible', false) - }) + this.$set(item, "inputVisible", false); + }); if (this.$route.query.type == 1) { - this.type = this.$route.query.type - this.$refs.taoBao.modals = true + this.type = this.$route.query.type; + this.$refs.taoBao.modals = true; } else { - this.type = 0 + this.type = 0; } }, - + destroyed() { - window.removeEventListener('popstate', this.goBack, false) + window.removeEventListener("popstate", this.goBack, false); }, methods: { // 输入的联动的 - isSpecification(iii){ - let arr = ['商品编号','依据链接','售价','市场价'] - return arr.includes(this.formThead[iii].title) + isSpecification(iii) { + let arr = ["商品编号", "依据链接", "售价", "市场价"]; + return arr.includes(this.formThead[iii].title); }, // 审核后禁止编辑 - isVirStatus(iii){ - let arr = ['依据链接','商品编号','市场价'] - return this.virStatus&&arr.includes(this.formThead[iii].title) + isVirStatus(iii) { + let arr = ["依据链接", "商品编号", "市场价"]; + return this.virStatus && arr.includes(this.formThead[iii].title); }, - isForbidden(iii){ - let arr = ['成本价','抵扣券','成长值'] - let forbidden = ['库存','重量(KG)','体积(m³)'] - return arr.includes(this.formThead[iii].title) || (this.virStatus&&forbidden.includes(this.formThead[iii].title)) + isForbidden(iii) { + let arr = ["成本价", "折扣", "成长值"]; + let forbidden = ["库存", "重量(KG)", "体积(m³)"]; + return ( + arr.includes(this.formThead[iii].title) || + (this.virStatus && forbidden.includes(this.formThead[iii].title)) + ); }, - isForbiddens(iii){ - let arr = ['付费会员价','商品编号','依据链接','售价','市场价','库存'] - return !arr.includes(this.formThead[iii].title) + isForbiddens(iii) { + let arr = [ + "付费会员价", + "商品编号", + "依据链接", + "售价", + "市场价", + "库存" + ]; + return !arr.includes(this.formThead[iii].title); }, - onsubmit(){ - this.dialogVisible = false + onsubmit() { + this.dialogVisible = false; }, - resetForm(){ - this.dialogVisible = false + resetForm() { + this.dialogVisible = false; }, // 占比值变化处理 - proportionChange(val,i,e){ - val.cost = toFixedNoRounding(val.price * e) - let obj = this.proportionList.find(item=>item.value==e) - val.coupon = Math.floor(val.price*obj.coupon) - val.growth = Math.floor(val.price*obj.growth) + proportionChange(val, i, e) { + val.cost = toFixedNoRounding(val.price * e); + let obj = this.proportionList.find(item => item.value == e); + val.coupon = Math.floor(val.price * obj.coupon); + val.growth = Math.floor(val.price * obj.growth); }, // 规格值变化 - handleCost(val,i,e,type){ - if(type == 'batchAdd'){ - i=='price'?val.cost = toFixedNoRounding(val.price * val.proportion):'' + handleCost(val, i, e, type) { + if (type == "batchAdd") { + i == "price" + ? (val.cost = toFixedNoRounding(val.price * val.proportion)) + : ""; } - if(i=='price'){ - val.price=val.price.replace(/^([0-9-]\d*\.?\d{0,2})?.*$/,'$1') - val.cost = toFixedNoRounding(e * val.proportion) + if (i == "price") { + val.price = val.price.replace(/^([0-9-]\d*\.?\d{0,2})?.*$/, "$1"); + val.cost = toFixedNoRounding(e * val.proportion); - let obj = this.proportionList.find(item=>item.value==val.proportion) - val.coupon = Math.floor(val.price*obj.coupon) - val.growth = Math.floor(val.price*obj.growth) + let obj = this.proportionList.find( + item => item.value == val.proportion + ); + val.coupon = Math.floor(val.price * obj.coupon); + val.growth = Math.floor(val.price * obj.growth); } - if(i=='bar_code'){ - val.bar_code = val.bar_code.replace(/[\W]/g,'') + if (i == "bar_code") { + val.bar_code = val.bar_code.replace(/[\W]/g, ""); } - if(i=='ot_price'){ - val.ot_price=val.ot_price.replace(/^([0-9-]\d*\.?\d{0,2})?.*$/,'$1') - if(!val.price){ - this.$message.error('成本价低于0') + if (i == "ot_price") { + val.ot_price = val.ot_price.replace(/^([0-9-]\d*\.?\d{0,2})?.*$/, "$1"); + if (!val.price) { + this.$message.error("成本价低于0"); } } }, handlCommodity(name) { - this.$refs[name].clearValidate() + this.$refs[name].clearValidate(); }, - beforeUpload(file,fileList) { - if (['application/pdf', 'image/jpeg', 'image/png', 'image/jpg', 'image/gif'].indexOf(file.type) == -1) { - this.$message.error('只能上传图片和PDF文件') - return false + beforeUpload(file, fileList) { + if ( + [ + "application/pdf", + "image/jpeg", + "image/png", + "image/jpg", + "image/gif" + ].indexOf(file.type) == -1 + ) { + this.$message.error("只能上传图片和PDF文件"); + return false; } }, handlePictureCardPreview(file) { // 预览pdf - if (['application/pdf'].includes(file.type)) { - window.open(file.url) - return + if (["application/pdf"].includes(file.type)) { + window.open(file.url); + return; } // 预览pdf图片 this.$refs[file.uid].clickHandler(); @@ -2742,261 +3233,283 @@ export default { // 移除 onRemoveHandler(file, name) { // if (fileList) return - let uploadFiles = this.$refs[name]?.uploadFiles + let uploadFiles = this.$refs[name]?.uploadFiles; uploadFiles?.splice( - uploadFiles.findIndex((item) => item.uid === file.uid), + uploadFiles.findIndex(item => item.uid === file.uid), 1 - ) + ); this.formValidate.qualification[name]?.splice( this.formValidate.qualification[name].findIndex( - (item) => item.uid === file.uid + item => item.uid === file.uid ), 1 - ) + ); }, - initSuccess(name,res,fileList){ + initSuccess(name, res, fileList) { if (res.status == 200) { if (fileList.every(item => item.status == "success")) { - let arr = [] + let arr = []; fileList.map(item => { - arr.push({ name:item.name,uid:item.uid,url: item?.response?.data?.src||item.url,type:item?.raw?.type||item.type}) - }) - this.formValidate.qualification[name] = arr + arr.push({ + name: item.name, + uid: item.uid, + url: item?.response?.data?.src || item.url, + type: item?.raw?.type || item.type + }); + }); + this.formValidate.qualification[name] = arr; console.log(this.formValidate.qualification[name]); } } }, - handleSuccess(res, file,fileList) { - this.initSuccess('businessList',res,fileList) + handleSuccess(res, file, fileList) { + this.initSuccess("businessList", res, fileList); }, - licenSuccess(res, file,fileList) { - this.initSuccess('licenceList',res,fileList) + licenSuccess(res, file, fileList) { + this.initSuccess("licenceList", res, fileList); }, - trademarkSuccess(res, file,fileList) { - this.initSuccess('trademarkList',res,fileList) + trademarkSuccess(res, file, fileList) { + this.initSuccess("trademarkList", res, fileList); }, - authorizedSuccess(res, file,fileList) { - this.initSuccess('authorizedList',res,fileList) + authorizedSuccess(res, file, fileList) { + this.initSuccess("authorizedList", res, fileList); }, - commoditySuccess(res, file,fileList) { - this.initSuccess('commodityList',res,fileList) + commoditySuccess(res, file, fileList) { + this.initSuccess("commodityList", res, fileList); }, - otherSuccess(res, file,fileList) { - this.initSuccess('otherList',res,fileList) + otherSuccess(res, file, fileList) { + this.initSuccess("otherList", res, fileList); }, - importHandleSuccess(res, file,fileList) { - this.initSuccess('importBusinessList',res,fileList) + importHandleSuccess(res, file, fileList) { + this.initSuccess("importBusinessList", res, fileList); }, - importAuthorizedSuccess(res, file,fileList) { - this.initSuccess('importAuthorizedList',res,fileList) + importAuthorizedSuccess(res, file, fileList) { + this.initSuccess("importAuthorizedList", res, fileList); }, - customsSuccess(res, file,fileList) { - this.initSuccess('customsList',res,fileList) + customsSuccess(res, file, fileList) { + this.initSuccess("customsList", res, fileList); }, - packingSuccess(res, file,fileList) { - this.initSuccess('packingList',res,fileList) + packingSuccess(res, file, fileList) { + this.initSuccess("packingList", res, fileList); }, - importOtherSuccess(res, file,fileList) { - this.initSuccess('importOtherList',res,fileList) + importOtherSuccess(res, file, fileList) { + this.initSuccess("importOtherList", res, fileList); }, setSort() { // ref一定跟table上面的ref一致 const el = this.$refs.tableParameter.$el.querySelectorAll( - '.el-table__body-wrapper > table > tbody' - )[0] + ".el-table__body-wrapper > table > tbody" + )[0]; this.sortable = Sortable.create(el, { - ghostClass: 'sortable-ghost', + ghostClass: "sortable-ghost", setData: function(dataTransfer) { - dataTransfer.setData('Text', '') + dataTransfer.setData("Text", ""); }, // 监听拖拽事件结束时触发 onEnd: evt => { - this.elChangeExForArray(evt.oldIndex, evt.newIndex, this.formValidate.params) + this.elChangeExForArray( + evt.oldIndex, + evt.newIndex, + this.formValidate.params + ); } - }) + }); }, elChangeExForArray(index1, index2, array) { - const temp = array[index1] - array[index1] = array[index2] - array[index2] = temp - return array + const temp = array[index1]; + array[index1] = array[index2]; + array[index2] = temp; + return array; }, goBack() { - sessionStorage.clear() - window.history.back() + sessionStorage.clear(); + window.history.back(); }, handleCloseCoupon(tag) { this.formValidate.couponData.splice( this.formValidate.couponData.indexOf(tag), 1 - ) - this.formValidate.give_coupon_ids = [] + ); + this.formValidate.give_coupon_ids = []; this.formValidate.couponData.map(item => { - this.formValidate.give_coupon_ids.push(item.coupon_id) - }) + this.formValidate.give_coupon_ids.push(item.coupon_id); + }); }, doCombination(arr) { - var count = arr.length - 1 // 数组长度(从0开始) - var tmp = [] - var totalArr = []// 总数组 - return doCombinationCallback(arr, 0)// 从第一个开始 + var count = arr.length - 1; // 数组长度(从0开始) + var tmp = []; + var totalArr = []; // 总数组 + return doCombinationCallback(arr, 0); // 从第一个开始 // js 没有静态数据,为了避免和外部数据混淆,需要使用闭包的形式 function doCombinationCallback(arr, curr_index) { for (const val of arr[curr_index]) { - tmp[curr_index] = val// 以curr_index为索引,加入数组 + tmp[curr_index] = val; // 以curr_index为索引,加入数组 // 当前循环下标小于数组总长度,则需要继续调用方法 if (curr_index < count) { - doCombinationCallback(arr, curr_index + 1)// 继续调用 + doCombinationCallback(arr, curr_index + 1); // 继续调用 } else { - totalArr.push(tmp.join(','))// (直接给push进去,push进去的不是值,而是值的地址) + totalArr.push(tmp.join(",")); // (直接给push进去,push进去的不是值,而是值的地址) } // js 对象都是 地址引用(引用关系),每次都需要重新初始化,否则 totalArr的数据都会是最后一次的 tmp 数据; - const oldTmp = tmp - tmp = [] + const oldTmp = tmp; + tmp = []; for (const index of oldTmp) { - tmp.push(index) + tmp.push(index); } } - return totalArr + return totalArr; } }, // 提交属性值; - subAttrs(e) { - const selectData = [] + subAttrs(e) { + const selectData = []; this.attrsList.forEach((el, index) => { - const obj = [] - el.details.forEach((label) => { + const obj = []; + el.details.forEach(label => { if (label.select) { - obj.push(label.name) + obj.push(label.name); } - }) + }); if (obj.length) { - selectData.push(obj) + selectData.push(obj); } - }) - let newData = [] - if (selectData.length) { - newData = this.doCombination(selectData) - } - this.attrShow = false - this.activeAtter = selectData - this.oneFormBatch[0].attr = newData.length ? newData.join(';') : '全部' - const manyAttr = this.ManyAttrValue - manyAttr.forEach(j => { - this.$set(j, 'select', false) - if (newData.length) { - newData.forEach(item => { - if (j.sku.split('').length == item.split('').length) { + }); + let newData = []; + if (selectData.length) { + newData = this.doCombination(selectData); + } + this.attrShow = false; + this.activeAtter = selectData; + this.oneFormBatch[0].attr = newData.length ? newData.join(";") : "全部"; + const manyAttr = this.ManyAttrValue; + manyAttr.forEach(j => { + this.$set(j, "select", false); + if (newData.length) { + newData.forEach(item => { + if (j.sku.split("").length == item.split("").length) { if (j.sku == item) { - this.$set(j, 'select', true) + this.$set(j, "select", true); } } else { if (j.sku == item) { - this.$set(j, 'select', true) + this.$set(j, "select", true); } } - }) - } else { - this.$set(j, 'select', true) - } - }) + }); + } else { + this.$set(j, "select", true); + } + }); this.$nextTick(function() { - this.$set(this, 'ManyAttrValue', manyAttr) - }) - }, + this.$set(this, "ManyAttrValue", manyAttr); + }); + }, // 参数模板 getSpecsLst(id) { - const cate_id = id || this.formValidate.cate_id + const cate_id = id || this.formValidate.cate_id; specsSelectedApi({ cate_id: cate_id }) .then(res => { - this.merSpecsSelect = res.data.mer - this.sysSpecsSelect = res.data.sys + this.merSpecsSelect = res.data.mer; + this.sysSpecsSelect = res.data.sys; }) .catch(res => { - this.$message.error(res.message) - }) + this.$message.error(res.message); + }); }, // 添加单位 addUnit() { - this.$modalForm(unitCreatApi()).then(() => this.getUnitList()) + this.$modalForm(unitCreatApi()).then(() => this.getUnitList()); }, // 单位下拉选项 getUnitList() { unitOptionsApi() .then(res => { - this.unitList = res.data + this.unitList = res.data; }) .catch(res => { - this.$message.error(res.message) - }) + this.$message.error(res.message); + }); }, // 配置 productCon() { productConfigApi() .then(res => { - this.extensionStatus = res.data.extension_status - this.deductionStatus = res.data.integral_status - this.deliveryType = res.data.delivery_way.map(String) + this.extensionStatus = res.data.extension_status; + this.deductionStatus = res.data.integral_status; + this.deliveryType = res.data.delivery_way.map(String); this.open_svip = - res.data.mer_svip_status == 1 && res.data.svip_switch_status == 1 - this.svip_rate = res.data.svip_store_rate - this.extension_one_rate = res.data.extension_one_rate - this.extension_two_rate = res.data.extension_two_rate - const name = this.formValidate.type == 0 ? '快递配送' : this.formValidate.type == 1 ? '虚拟发货' : '卡密发货' - if (!this.$route.params.id) { this.formValidate.delivery_way = this.deliveryType } + res.data.mer_svip_status == 1 && res.data.svip_switch_status == 1; + this.svip_rate = res.data.svip_store_rate; + this.extension_one_rate = res.data.extension_one_rate; + this.extension_two_rate = res.data.extension_two_rate; + const name = + this.formValidate.type == 0 + ? "快递配送" + : this.formValidate.type == 1 + ? "虚拟发货" + : "卡密发货"; + if (!this.$route.params.id) { + this.formValidate.delivery_way = this.deliveryType; + } if (this.deliveryType.length == 2) { if (this.formValidate.type == 2) { - this.deliveryList = [ - { value: '2', name: name } - ] + this.deliveryList = [{ value: "2", name: name }]; } else { this.deliveryList = [ - { value: '1', name: '到店自提' }, - { value: '2', name: name } - ] + { value: "1", name: "到店自提" }, + { value: "2", name: name } + ]; } } else { - if (this.deliveryType.length == 1 && this.deliveryType[0] == '1' && this.formValidate.type != 2) { - this.deliveryList = [{ value: '1', name: '到店自提' }] + if ( + this.deliveryType.length == 1 && + this.deliveryType[0] == "1" && + this.formValidate.type != 2 + ) { + this.deliveryList = [{ value: "1", name: "到店自提" }]; } else { - this.deliveryList = [{ value: '2', name: name }] - this.formValidate.delivery_way = ['2'] + this.deliveryList = [{ value: "2", name: name }]; + this.formValidate.delivery_way = ["2"]; } } }) .catch(res => { - this.$message.error(res.message) - }) + this.$message.error(res.message); + }); }, // 获取标签项 getLabelLst() { getProductLabelApi() .then(res => { - this.labelList = res.data + this.labelList = res.data; }) .catch(res => { - this.$message.error(res.message) - }) + this.$message.error(res.message); + }); }, // 系统表单下拉数据 getFormList() { associatedFormList() .then(res => { - this.formList = res.data + this.formList = res.data; }) .catch(res => { - this.$message.error(res.message) - }) + this.$message.error(res.message); + }); }, // 关联的表单信息 getFormInfo() { if (!this.formValidate.mer_form_id) { - return + return; // this.formData = [] } else { - const time = new Date().getTime() * 1000 - const formUrl = `${this.baseURL}/pages/admin/system_form/index?inner_frame=1&time=${time}&form_id=${this.formValidate.mer_form_id}` - this.formUrl = formUrl + const time = new Date().getTime() * 1000; + const formUrl = `${ + this.baseURL + }/pages/admin/system_form/index?inner_frame=1&time=${time}&form_id=${ + this.formValidate.mer_form_id + }`; + this.formUrl = formUrl; // associatedFormInfo(this.formValidate.mer_form_id).then((res) => { // this.formData = res.data // }) @@ -3007,269 +3520,281 @@ export default { }, // 选择店铺推荐商品 openRecommend() { - if(this.virStatus) return this.$message.error('无法编辑') - this.recommendVisible = true + if (this.virStatus) return this.$message.error("无法编辑"); + this.recommendVisible = true; }, getRecommend(selected) { - this.goodList = selected && selected.length <= 18 ? selected : selected.slice(0, 18) - this.recommendVisible = false + this.goodList = + selected && selected.length <= 18 ? selected : selected.slice(0, 18); + this.recommendVisible = false; }, closeRecommend() { - this.recommendVisible = false + this.recommendVisible = false; }, // 删除店铺推荐商品 deleteRecommend(index) { - if(this.virStatus) return this.$message.error('无法编辑') - this.goodList.splice(index, 1) + if (this.virStatus) return this.$message.error("无法编辑"); + this.goodList.splice(index, 1); }, addCoupon() { - const _this = this + const _this = this; this.$modalCoupon( this.formValidate.couponData, - 'wu', + "wu", _this.formValidate.give_coupon_ids, (this.keyNum += 1), function(row) { - _this.formValidate.give_coupon_ids = [] - _this.formValidate.couponData = row + _this.formValidate.give_coupon_ids = []; + _this.formValidate.couponData = row; row.map(item => { - _this.formValidate.give_coupon_ids.push(item.coupon_id) - }) + _this.formValidate.give_coupon_ids.push(item.coupon_id); + }); } - ) + ); }, delSpecs(index) { - this.formValidate.params.splice(index, 1) + this.formValidate.params.splice(index, 1); }, addSpecs() { - this.formValidate.params.push({ name: '', value: '', sort: 0 }) + this.formValidate.params.push({ name: "", value: "", sort: 0 }); }, // 参数模板详情 getSpecsList() { - const merParams = [...this.customSpecs]; const sysParams = [...[this.formValidate.param_temp_id]] - const params = [...merParams, ...sysParams] + const merParams = [...this.customSpecs]; + const sysParams = [...[this.formValidate.param_temp_id]]; + const params = [...merParams, ...sysParams]; if (params.length <= 0) { - this.formValidate.merParams = [] - this.formValidate.sysParams = [] + this.formValidate.merParams = []; + this.formValidate.sysParams = []; } else { productSpecsDetailApi({ template_ids: params.toString() }) .then(res => { - const arr = [] + const arr = []; this.formValidate.params.forEach((item, i) => { - if (!item.parameter_id)arr.push(item) - }) - this.formValidate.params = [...res.data, ...arr] + if (!item.parameter_id) arr.push(item); + }); + this.formValidate.params = [...res.data, ...arr]; }) .catch(res => { - this.$message.error(res.message) - }) + this.$message.error(res.message); + }); } }, // 添加倒入卡密的值 - changeVirtual(e) { - this.virtualList = this.virtualList.concat(e) - }, - // 添加卡密 - addVirtual(index, name) { - this.$refs.addCarMy.carMyShow = true - this.tabIndex = index - this.tabName = name - this.virtualListClear() + changeVirtual(e) { + this.virtualList = this.virtualList.concat(e); + }, + // 添加卡密 + addVirtual(index, name) { + this.$refs.addCarMy.carMyShow = true; + this.tabIndex = index; + this.tabName = name; + this.virtualListClear(); this.$refs.addCarMy.fixedCar = { is_type: 0, - key: '', + key: "", stock: 0 + }; + }, + // 确认提交卡密 + fixdBtn(e) { + if (e.is_type == 0) { + this.$set(this[this.tabName][this.tabIndex]["cdkey"], "key", e.key); + this.$set(this[this.tabName][this.tabIndex], "stock", Number(e.stock)); + this[this.tabName][this.tabIndex]["cdkey"].list = []; + } else { + this.$set(this[this.tabName][this.tabIndex]["cdkey"], "list", e.list); + this.$set(this[this.tabName][this.tabIndex], "stock", e.list.length); + this[this.tabName][this.tabIndex]["cdkey"].key = ""; } - }, - // 确认提交卡密 - fixdBtn(e) { - if (e.is_type == 0) { - this.$set(this[this.tabName][this.tabIndex]['cdkey'], 'key', e.key) - this.$set(this[this.tabName][this.tabIndex], 'stock', Number(e.stock)) - this[this.tabName][this.tabIndex]['cdkey'].list = [] - } else { - this.$set(this[this.tabName][this.tabIndex]['cdkey'], 'list', e.list) - this.$set(this[this.tabName][this.tabIndex], 'stock', e.list.length) - this[this.tabName][this.tabIndex]['cdkey'].key = '' - } - this.$set(this[this.tabName][this.tabIndex]['cdkey'], 'is_type', e.is_type) - this.$refs.addCarMy.carMyShow = false - }, - closeCarMy() { - this.$refs.addCarMy.carMyShow = false - }, - // 清空卡密 - virtualListClear() { - this.virtualList = [ - { + this.$set( + this[this.tabName][this.tabIndex]["cdkey"], + "is_type", + e.is_type + ); + this.$refs.addCarMy.carMyShow = false; + }, + closeCarMy() { + this.$refs.addCarMy.carMyShow = false; + }, + // 清空卡密 + virtualListClear() { + this.virtualList = [ + { is_type: 0, - key: '', - stock: '' - } - ] - }, - seeVirtual(data, name, index) { - this.tabName = name - this.tabIndex = index - this.virtualListClear() + key: "", + stock: "" + } + ]; + }, + seeVirtual(data, name, index) { + this.tabName = name; + this.tabIndex = index; + this.virtualListClear(); this.$refs.addCarMy.fixedCar = { is_type: 0, - key: '', + key: "", stock: 0 + }; + if ( + data.cdkey && + data.cdkey.list && + data.cdkey.list.length && + data.cdkey.is_type == 1 + ) { + this.$refs.addCarMy.fixedCar.is_type = 1; + this.virtualList = data.cdkey.list; + } else if (data.cdkey && data.cdkey.key) { + this.$refs.addCarMy.fixedCar.is_type = 0; + this.$refs.addCarMy.fixedCar.key = data.cdkey.key; + this.$refs.addCarMy.fixedCar.stock = data.stock; } - if (data.cdkey && data.cdkey.list && data.cdkey.list.length && data.cdkey.is_type == 1) { - this.$refs.addCarMy.fixedCar.is_type = 1 - this.virtualList = data.cdkey.list - } else if (data.cdkey && data.cdkey.key) { - this.$refs.addCarMy.fixedCar.is_type = 0 - this.$refs.addCarMy.fixedCar.key = data.cdkey.key - this.$refs.addCarMy.fixedCar.stock = data.stock - } - this.$refs.addCarMy.carMyShow = true - }, + this.$refs.addCarMy.carMyShow = true; + }, setTagsViewTitle() { - const title = '编辑商品' + const title = "编辑商品"; const route = Object.assign({}, this.tempRoute, { title: `${title}-${this.$route.params.id}` - }) - this.$store.dispatch('tagsView/updateVisitedView', route) + }); + this.$store.dispatch("tagsView/updateVisitedView", route); }, onChangeGroup() { - this.checkboxGroup.includes('is_good') + this.checkboxGroup.includes("is_good") ? (this.formValidate.is_good = 1) - : (this.formValidate.is_good = 0) + : (this.formValidate.is_good = 0); }, watCh(val) { // console.log(val); - const tmp = {} - const tmpTab = {} + const tmp = {}; + const tmpTab = {}; this.formValidate.attr.forEach((o, i) => { - tmp['value' + i] = { title: o.value } - tmpTab['value' + i] = '' - }) + tmp["value" + i] = { title: o.value }; + tmpTab["value" + i] = ""; + }); if (this.isGenerate || this.createCount == 1) { - this.ManyAttrValue = this.attrFormat(val) - this.manyTabTit = tmp - this.manyTabDate = tmpTab - this.formThead = Object.assign({}, this.formThead, tmp) + this.ManyAttrValue = this.attrFormat(val); + this.manyTabTit = tmp; + this.manyTabDate = tmpTab; + this.formThead = Object.assign({}, this.formThead, tmp); } - this.isGenerate = false - this.addGenerate = false + this.isGenerate = false; + this.addGenerate = false; }, attrFormat(arr) { - let data = []; const that = this - const res = [] - return format(arr) + let data = []; + const that = this; + const res = []; + return format(arr); function format(arr) { if (arr.length > 1) { arr.forEach((v, i) => { - if (i === 0) data = arr[i]['detail'] - const tmp = [] + if (i === 0) data = arr[i]["detail"]; + const tmp = []; data.forEach(function(vv) { arr[i + 1] && - arr[i + 1]['detail'] && - arr[i + 1]['detail'].forEach(g => { + arr[i + 1]["detail"] && + arr[i + 1]["detail"].forEach(g => { const rep2 = - (i !== 0 ? '' : arr[i]['value'] + '_$_') + + (i !== 0 ? "" : arr[i]["value"] + "_$_") + vv + - '-$-' + - arr[i + 1]['value'] + - '_$_' + - g - tmp.push(rep2) + "-$-" + + arr[i + 1]["value"] + + "_$_" + + g; + tmp.push(rep2); if (i === arr.length - 2) { const rep4 = { - image: '', + image: "", price: 0, cost: 0, ot_price: 0, select: true, - sku: '', + sku: "", stock: 0, cdkey: {}, - bar_code: '', - gist_url:'', + bar_code: "", + gist_url: "", weight: 0, volume: 0, - growth:0, - proportion:'0.60', - coupon:'', + growth: 0, + proportion: "0.60", + coupon: "", extension_one: 0, extension_two: 0 - } - rep2.split('-$-').forEach((h, k) => { - const rep3 = h.split('_$_') - if (!rep4['detail']) rep4['detail'] = {} - rep4['detail'][rep3[0]] = rep3.length > 1 ? rep3[1] : '' - }) + }; + rep2.split("-$-").forEach((h, k) => { + const rep3 = h.split("_$_"); + if (!rep4["detail"]) rep4["detail"] = {}; + rep4["detail"][rep3[0]] = rep3.length > 1 ? rep3[1] : ""; + }); // if(rep4.detail !== 'undefined' && rep4.detail !== null){ Object.values(rep4.detail).forEach((v, i) => { - rep4['value' + i] = v - }) + rep4["value" + i] = v; + }); // } - res.push(rep4) + res.push(rep4); } - }) - }) - data = tmp.length ? tmp : [] - }) + }); + }); + data = tmp.length ? tmp : []; + }); } else { - const dataArr = [] + const dataArr = []; arr.forEach((v, k) => { - v['detail'].forEach((vv, kk) => { - dataArr[kk] = v['value'] + '_' + vv + v["detail"].forEach((vv, kk) => { + dataArr[kk] = v["value"] + "_" + vv; res[kk] = { - image: '', + image: "", price: 0, cost: 0, ot_price: 0, select: true, - gist_url:'', - sku: '', + gist_url: "", + sku: "", stock: 0, cdkey: {}, - bar_code: '', + bar_code: "", weight: 0, volume: 0, - growth:0, - proportion:'0.60', - coupon:'', + growth: 0, + proportion: "0.60", + coupon: "", extension_one: 0, extension_two: 0, - detail: { [v['value']]: vv } - } + detail: { [v["value"]]: vv } + }; Object.values(res[kk].detail).forEach((v, i) => { - res[kk]['value' + i] = v - }) - }) - }) - data.push(dataArr.join('$&')) + res[kk]["value" + i] = v; + }); + }); + }); + data.push(dataArr.join("$&")); } if (that.generateArr.length > 0) { that.generateArr.forEach((v, i) => { - res[i]['image'] = v.image || v.pic - res[i]['price'] = v.price - res[i]['cost'] = v.cost - res[i]['ot_price'] = v.ot_price - res[i]['sku'] = v.sku - res[i]['stock'] = v.stock - res[i]['unique'] = v.unique - res[i]['bar_code'] = v.bar_code - res[i]['volume'] = v.volume - res[i]['weight'] = v.weight - res[i]['growth'] = v.growth - res[i]['gist_url'] = v.gist_url - res[i]['proportion'] = v.proportion - res[i]['coupon'] = v.coupon - res[i]['extension_one'] = v.extension_one - res[i]['extension_two'] = v.extension_two - res[i]['cdkey'] = v.cdkey && v.cdkey.length && v.cdkey[0] || null - res[i]['svip_price'] = v.svip_price || '' - }) + res[i]["image"] = v.image || v.pic; + res[i]["price"] = v.price; + res[i]["cost"] = v.cost; + res[i]["ot_price"] = v.ot_price; + res[i]["sku"] = v.sku; + res[i]["stock"] = v.stock; + res[i]["unique"] = v.unique; + res[i]["bar_code"] = v.bar_code; + res[i]["volume"] = v.volume; + res[i]["weight"] = v.weight; + res[i]["growth"] = v.growth; + res[i]["gist_url"] = v.gist_url; + res[i]["proportion"] = v.proportion; + res[i]["coupon"] = v.coupon; + res[i]["extension_one"] = v.extension_one; + res[i]["extension_two"] = v.extension_two; + res[i]["cdkey"] = (v.cdkey && v.cdkey.length && v.cdkey[0]) || null; + res[i]["svip_price"] = v.svip_price || ""; + }); } - return res + return res; } }, // 运费模板 @@ -3278,32 +3803,32 @@ export default { // this.$modalTemplates(0, function() { // _this.getShippingList() // }) - this.dialogVisible = true + this.dialogVisible = true; }, // 添加服务保障模板 addServiceTem() { - this.$refs.serviceGuarantee.add() + this.$refs.serviceGuarantee.add(); }, // 删除视频; delVideo() { - const that = this - that.$set(that.formValidate, 'video_link', '') + const that = this; + that.$set(that.formValidate, "video_link", ""); }, zh_uploadFile() { if (this.videoLink) { - this.formValidate.video_link = this.videoLink + this.formValidate.video_link = this.videoLink; } else { - this.$refs.refid.click() + this.$refs.refid.click(); } }, zh_uploadFile_change(evfile) { - const that = this - that.progress = 10 + const that = this; + that.progress = 10; const suffix = evfile.target.files[0].name.substr( - evfile.target.files[0].name.indexOf('.') - ) - if (suffix !== '.mp4') { - return that.$message.error('只能上传MP4文件') + evfile.target.files[0].name.indexOf(".") + ); + if (suffix !== ".mp4") { + return that.$message.error("只能上传MP4文件"); } productGetTempKeysApi().then(res => { that.$videoCloud @@ -3312,317 +3837,392 @@ export default { evfile: evfile, res: res, uploading(status, progress) { - that.upload.videoIng = status + that.upload.videoIng = status; } }) .then(res => { - that.formValidate.video_link = res.url || res.data.src - that.$message.success('视频上传成功') - that.progress = 100 + that.formValidate.video_link = res.url || res.data.src; + that.$message.success("视频上传成功"); + that.progress = 100; }) .catch(res => { - that.upload.videoIng = false - that.$message.error(res.msg && res.msg.message || res.message) - }) - }) + that.upload.videoIng = false; + that.$message.error((res.msg && res.msg.message) || res.message); + }); + }); }, // 添加规则; addRule() { - const _this = this + const _this = this; this.$modalAttr(this.formDynamics, function() { - _this.productGetRule() - }) + _this.productGetRule(); + }); }, // 选择规格 onChangeSpec(num) { - if (num === 1) this.productGetRule() + if (num === 1) this.productGetRule(); }, // 切换积分抵扣 changeIntergral(e) { if (e == -1) { - this.formValidate.integral_rate = -1 + this.formValidate.integral_rate = -1; } else { - this.formValidate.integral_rate = this.formValidate.integral_rate + this.formValidate.integral_rate = this.formValidate.integral_rate; } }, // 选择属性确认 confirm() { if (!this.selectRule) { - return this.$message.warning('请选择属性') + return this.$message.warning("请选择属性"); } this.ruleList.forEach(item => { if (item.attr_template_id === this.selectRule) { - this.formValidate.attr = item.template_value - this.attrs = item.template_value + this.formValidate.attr = item.template_value; + this.attrs = item.template_value; } - }) - this.addmanyData(this.ManyAttrValue) - this.getAttr() + }); + this.addmanyData(this.ManyAttrValue); + this.getAttr(); }, addmanyData(data) { data.forEach(item => { - item.select = true - }) - this.ManyAttrValue = data + item.select = true; + }); + this.ManyAttrValue = data; }, // 打开属性 - batchAttr() { - this.attrShow = true - }, + batchAttr() { + this.attrShow = true; + }, // 选中属性 - activeAttr(e) { - this.attrsList = e - }, - // 关闭属性弹窗 - labelAttr() { - this.attrShow = false - }, + activeAttr(e) { + this.attrsList = e; + }, + // 关闭属性弹窗 + labelAttr() { + this.attrShow = false; + }, // 获取属性 getAttr() { - this.oneFormBatch[0].attr = '全部' - const data = this.attrs + this.oneFormBatch[0].attr = "全部"; + const data = this.attrs; data.map(el => { - el.details = [] + el.details = []; el.detail.map(label => { el.details.push({ name: label, select: false - }) - }) - }) - this.attrsList = data + }); + }); + }); + this.attrsList = data; }, // 商户分类; getCategorySelect() { categorySelectApi() .then(res => { - this.merCateList = res.data + this.merCateList = res.data; }) .catch(res => { - this.$message.error(res.message) - }) + this.$message.error(res.message); + }); }, // 平台分类; getCategoryList() { categoryListApi() .then(res => { - this.categoryList = res.data + this.categoryList = res.data; }) .catch(res => { - this.$message.error(res.message) - }) + this.$message.error(res.message); + }); }, // 品牌筛选; getBrandListApi() { categoryBrandListApi() .then(res => { - this.BrandList = res.data + this.BrandList = res.data; }) .catch(res => { - this.$message.error(res.message) - }) + this.$message.error(res.message); + }); }, // 获取商品属性模板; productGetRule() { templateLsitApi().then(res => { - this.ruleList = res.data - }) + this.ruleList = res.data; + }); }, // 运费模板; getShippingList() { shippingListApi().then(res => { - this.shippingList = res.data - }) + this.shippingList = res.data; + }); }, // 获取服务保障模板 getGuaranteeList() { guaranteeListApi().then(res => { - this.guaranteeList = res.data - }) + this.guaranteeList = res.data; + }); }, showInput(item) { - this.$set(item, 'inputVisible', true) + this.$set(item, "inputVisible", true); }, virtualbtn(id, type) { if (this.virStatus) { - return this.$message.warning('商品类型不能切换!') + return this.$message.warning("商品类型不能切换!"); } - this.formValidate.audit_type = id + this.formValidate.audit_type = id; // this.productCon() }, customMessBtn(e) { if (!e) { - this.formValidate.extend = [] + this.formValidate.extend = []; } }, addcustom() { if (this.formValidate.extend.length > 9) { - this.$message.warning('最多添加10条') + this.$message.warning("最多添加10条"); } else { this.formValidate.extend.push({ - title: '', - key: 'text', - value: '', + title: "", + key: "text", + value: "", require: false - }) + }); } }, delcustom(index) { - this.formValidate.extend.splice(index, 1) + this.formValidate.extend.splice(index, 1); }, onChangetype(item) { if (item === 1) { this.OneattrValue.map(item => { - this.$set(item, 'extension_one', null) - this.$set(item, 'extension_two', null) - }) + this.$set(item, "extension_one", null); + this.$set(item, "extension_two", null); + }); this.ManyAttrValue.map(item => { - this.$set(item, 'extension_one', null) - this.$set(item, 'extension_two', null) - }) + this.$set(item, "extension_one", null); + this.$set(item, "extension_two", null); + }); } else { this.OneattrValue.map(item => { - delete item.extension_one - delete item.extension_two - this.$set(item, 'extension_one', null) - this.$set(item, 'extension_two', null) - }) + delete item.extension_one; + delete item.extension_two; + this.$set(item, "extension_one", null); + this.$set(item, "extension_two", null); + }); this.ManyAttrValue.map(item => { - delete item.extension_one - delete item.extension_two - }) + delete item.extension_one; + delete item.extension_two; + }); } }, onChangeSpecs(item) { - if (item == 1 || item == 2 && this.open_svip) { - this.formThead.svip_price = { title: '付费会员价' } + if (item == 1 || (item == 2 && this.open_svip)) { + this.formThead.svip_price = { title: "付费会员价" }; this.attrVal = { price: null, cost: null, ot_price: null, svip_price: null, stock: null, - proportion:0.60, - coupon:'', - growth:0, - bar_code: '', + proportion: 0.6, + coupon: "", + growth: 0, + bar_code: "", weight: null, volume: null, - gist_url:'' - } + gist_url: "" + }; // if(this.formValidate.type == 2)this.attrVal.cdkey = {} - this.OneattrValue[0]['svip_price'] = this.OneattrValue[0]['price'] - ? this.accMul(this.OneattrValue[0]['price'], this.svip_rate) - : 0 - let price = 0 + this.OneattrValue[0]["svip_price"] = this.OneattrValue[0]["price"] + ? this.accMul(this.OneattrValue[0]["price"], this.svip_rate) + : 0; + let price = 0; for (const val of this.ManyAttrValue) { - price = val.price ? this.accMul(val.price, this.svip_rate) : 0 - this.$set(val, 'svip_price', price) + price = val.price ? this.accMul(val.price, this.svip_rate) : 0; + this.$set(val, "svip_price", price); } } else { - delete this.formThead.svip_price + delete this.formThead.svip_price; this.attrVal = { price: null, cost: null, ot_price: null, stock: null, - bar_code: '', + bar_code: "", weight: null, volume: null, - proportion:0.60, - coupon:'', - growth:0, - gist_url:'' - } + proportion: 0.6, + coupon: "", + growth: 0, + gist_url: "" + }; } }, memberPrice(formHead, row) { - if (formHead.title == '售价') { - row.svip_price = this.accMul(row.price, this.svip_rate) + if (formHead.title == "售价") { + row.svip_price = this.accMul(row.price, this.svip_rate); } }, // 乘法 accMul(arg1, arg2) { - var max = 0 - var s1 = arg1.toString() - var s2 = arg2.toString() + var max = 0; + var s1 = arg1.toString(); + var s2 = arg2.toString(); try { - max += s1.split('.')[1].length + max += s1.split(".")[1].length; } catch (e) {} try { - max += s2.split('.')[1].length + max += s2.split(".")[1].length; } catch (e) {} return ( - (Number(s1.replace('.', '')) * Number(s2.replace('.', ''))) / + (Number(s1.replace(".", "")) * Number(s2.replace(".", ""))) / Math.pow(10, max) - ) + ); }, // 删除表格中的属性 delAttrTable(index) { - this.ManyAttrValue.splice(index, 1) + this.ManyAttrValue.splice(index, 1); }, // 批量添加 batchAdd() { - let attr = this.oneFormBatch[0] - if(!attr.price) return this.$message.error("批量添加-售价为必须填写"); - if(+attr.ot_price<attr.price) return this.$message.error("批量添加-市场价格限定等于或大于售价"); - if(!attr.gist_url) return this.$message.error("批量添加-依据链接为必须填写"); + let attr = this.oneFormBatch[0]; + if (!attr.price) return this.$message.error("批量添加-售价为必须填写"); + if (+attr.ot_price < attr.price) + return this.$message.error("批量添加-市场价格限定等于或大于售价"); + if (!attr.gist_url) + return this.$message.error("批量添加-依据链接为必须填写"); for (const val of this.ManyAttrValue) { if (val.select) { - if (this.oneFormBatch[0].attr != '') this.$set(val, 'attr', this.oneFormBatch[0].attr) - if (this.oneFormBatch[0].image != '') this.$set(val, 'image', this.oneFormBatch[0].image) - if (this.oneFormBatch[0].price != null && this.oneFormBatch[0].price != '') this.$set(val, 'price', this.oneFormBatch[0].price) - if (this.oneFormBatch[0].cost != null && this.oneFormBatch[0].cost != '') this.$set(val, 'cost', this.oneFormBatch[0].cost) - if (this.oneFormBatch[0].ot_price != null && this.oneFormBatch[0].ot_price != '') this.$set(val, 'ot_price', this.oneFormBatch[0].ot_price) - if (this.oneFormBatch[0].svip_price != null && this.oneFormBatch[0].svip_price != '') this.$set(val, 'svip_price', this.oneFormBatch[0].svip_price) - if (this.oneFormBatch[0].stock != null && this.oneFormBatch[0].stock != '') this.$set(val, 'stock', this.oneFormBatch[0].stock) - if (this.oneFormBatch[0].bar_code != null && this.oneFormBatch[0].bar_code != '') this.$set(val, 'bar_code', this.oneFormBatch[0].bar_code) - if (this.oneFormBatch[0].weight != null && this.oneFormBatch[0].weight != '') this.$set(val, 'weight', this.oneFormBatch[0].weight) - if (this.oneFormBatch[0].volume != null && this.oneFormBatch[0].volume != '') this.$set(val, 'volume', this.oneFormBatch[0].volume) - if (this.oneFormBatch[0].growth != null && this.oneFormBatch[0].growth != '') this.$set(val, 'growth', this.oneFormBatch[0].growth) - if (this.oneFormBatch[0].proportion != null && this.oneFormBatch[0].proportion != '') this.$set(val, 'proportion', this.oneFormBatch[0].proportion) - if (this.oneFormBatch[0].coupon != null && this.oneFormBatch[0].coupon != '') this.$set(val, 'coupon', this.oneFormBatch[0].coupon) - if (this.oneFormBatch[0].gist_url != null && this.oneFormBatch[0].gist_url != '') this.$set(val, 'gist_url', this.oneFormBatch[0].gist_url) - if (this.oneFormBatch[0].extension_one != null && this.oneFormBatch[0].extension_one != '') this.$set(val, 'extension_one', this.oneFormBatch[0].extension_one) - if (this.oneFormBatch[0].extension_two != null && this.oneFormBatch[0].extension_two != '') this.$set(val, 'extension_two', this.oneFormBatch[0].extension_two) + if (this.oneFormBatch[0].attr != "") + this.$set(val, "attr", this.oneFormBatch[0].attr); + if (this.oneFormBatch[0].image != "") + this.$set(val, "image", this.oneFormBatch[0].image); + if ( + this.oneFormBatch[0].price != null && + this.oneFormBatch[0].price != "" + ) + this.$set(val, "price", this.oneFormBatch[0].price); + if ( + this.oneFormBatch[0].cost != null && + this.oneFormBatch[0].cost != "" + ) + this.$set(val, "cost", this.oneFormBatch[0].cost); + if ( + this.oneFormBatch[0].ot_price != null && + this.oneFormBatch[0].ot_price != "" + ) + this.$set(val, "ot_price", this.oneFormBatch[0].ot_price); + if ( + this.oneFormBatch[0].svip_price != null && + this.oneFormBatch[0].svip_price != "" + ) + this.$set(val, "svip_price", this.oneFormBatch[0].svip_price); + if ( + this.oneFormBatch[0].stock != null && + this.oneFormBatch[0].stock != "" + ) + this.$set(val, "stock", this.oneFormBatch[0].stock); + if ( + this.oneFormBatch[0].bar_code != null && + this.oneFormBatch[0].bar_code != "" + ) + this.$set(val, "bar_code", this.oneFormBatch[0].bar_code); + if ( + this.oneFormBatch[0].weight != null && + this.oneFormBatch[0].weight != "" + ) + this.$set(val, "weight", this.oneFormBatch[0].weight); + if ( + this.oneFormBatch[0].volume != null && + this.oneFormBatch[0].volume != "" + ) + this.$set(val, "volume", this.oneFormBatch[0].volume); + if ( + this.oneFormBatch[0].growth != null && + this.oneFormBatch[0].growth != "" + ) + this.$set(val, "growth", this.oneFormBatch[0].growth); + if ( + this.oneFormBatch[0].proportion != null && + this.oneFormBatch[0].proportion != "" + ) + this.$set(val, "proportion", this.oneFormBatch[0].proportion); + if ( + this.oneFormBatch[0].coupon != null && + this.oneFormBatch[0].coupon != "" + ) + this.$set(val, "coupon", this.oneFormBatch[0].coupon); + if ( + this.oneFormBatch[0].gist_url != null && + this.oneFormBatch[0].gist_url != "" + ) + this.$set(val, "gist_url", this.oneFormBatch[0].gist_url); + if ( + this.oneFormBatch[0].extension_one != null && + this.oneFormBatch[0].extension_one != "" + ) + this.$set(val, "extension_one", this.oneFormBatch[0].extension_one); + if ( + this.oneFormBatch[0].extension_two != null && + this.oneFormBatch[0].extension_two != "" + ) + this.$set(val, "extension_two", this.oneFormBatch[0].extension_two); if (this.formValidate.type == 2) { - val.cdkey = {} - if (this.oneFormBatch[0]['cdkey'].is_type == 1) { - if (this.oneFormBatch[0]['cdkey'].list && this.oneFormBatch[0]['cdkey'].list.length) { - this.$set(val.cdkey, 'list', this.oneFormBatch[0]['cdkey'].list) - this.$set(val, 'stock', this.oneFormBatch[0]['cdkey'].list.length) + val.cdkey = {}; + if (this.oneFormBatch[0]["cdkey"].is_type == 1) { + if ( + this.oneFormBatch[0]["cdkey"].list && + this.oneFormBatch[0]["cdkey"].list.length + ) { + this.$set( + val.cdkey, + "list", + this.oneFormBatch[0]["cdkey"].list + ); + this.$set( + val, + "stock", + this.oneFormBatch[0]["cdkey"].list.length + ); } - } else if (this.oneFormBatch[0]['cdkey'].key) { - this.$set(val.cdkey, 'key', this.oneFormBatch[0]['cdkey'].key) + } else if (this.oneFormBatch[0]["cdkey"].key) { + this.$set(val.cdkey, "key", this.oneFormBatch[0]["cdkey"].key); } - this.$set(val.cdkey, 'is_type', this.oneFormBatch[0]['cdkey'].is_type) - } + this.$set( + val.cdkey, + "is_type", + this.oneFormBatch[0]["cdkey"].is_type + ); + } } } }, // 添加按钮 addBtn() { - this.clearAttr() - this.isBtn = true - this.addGenerate = true + this.clearAttr(); + this.isBtn = true; + this.addGenerate = true; }, // 取消 offAttrName() { - this.isBtn = false + this.isBtn = false; }, clearAttr() { - this.formDynamic.attrsName = '' - this.formDynamic.attrsVal = '' + this.formDynamic.attrsName = ""; + this.formDynamic.attrsVal = ""; }, // 删除规格 handleRemoveAttr(index) { - this.formValidate.attr.splice(index, 1) - this.ManyAttrValue.splice(index, 1) + this.formValidate.attr.splice(index, 1); + this.ManyAttrValue.splice(index, 1); }, // 删除属性 handleClose(item, index) { - item.splice(index, 1) - this.attrs = this.formValidate.attr + item.splice(index, 1); + this.attrs = this.formValidate.attr; }, // 添加规则名称 createAttrName() { @@ -3630,9 +4230,9 @@ export default { const data = { value: this.formDynamic.attrsName, detail: [this.formDynamic.attrsVal] - } - this.formValidate.attr.push(data) - var hash = {} + }; + this.formValidate.attr.push(data); + var hash = {}; this.formValidate.attr = this.formValidate.attr.reduce(function( item, next @@ -3664,33 +4264,41 @@ export default { }, []); this.formValidate.attr[idx].inputVisible = false; } else { - if(this.formValidate.attr[idx].inputVisible)this.$message.warning("请添加属性"); + if (this.formValidate.attr[idx].inputVisible) + this.$message.warning("请添加属性"); } this.attrs = this.formValidate.attr; }, - // 立即生成 + // 立即生成 generate() { let id = this.$route.params.id || 0; - generateAttrApi(id,{ attrs: this.formValidate.attr,product_type: this.formValidate.product_type }) - .then((res) => { - let info = res.data - this.generateArr = this.formValidate.is_copy ? this.formValidate.value : res.data.value + generateAttrApi(id, { + attrs: this.formValidate.attr, + product_type: this.formValidate.product_type + }) + .then(res => { + let info = res.data; + this.generateArr = this.formValidate.is_copy + ? this.formValidate.value + : res.data.value; this.formValidate.attr = res.data.attr; - this.createProduct = true - this.isGenerate = true + this.createProduct = true; + this.isGenerate = true; if (this.$route.params.id !== "0") { - this.addmanyData(info.value); + this.addmanyData(info.value); } - if (!this.$route.params.id && this.formValidate.spec_type === 1) { - this.ManyAttrValue.map((item) => { - item.image = (item.image||item.pic) || this.formValidate.slider_image[0]; + if (!this.$route.params.id && this.formValidate.spec_type === 1) { + this.ManyAttrValue.map(item => { + item.image = + item.image || item.pic || this.formValidate.slider_image[0]; // this.$set(item, 'select', true) }); - this.oneFormBatch[0].image = this.oneFormBatch[0].image || this.formValidate.slider_image[0]; + this.oneFormBatch[0].image = + this.oneFormBatch[0].image || this.formValidate.slider_image[0]; } - this.getAttr(); + this.getAttr(); }) - .catch((res) => { + .catch(res => { this.$message.error(res.message); }); }, @@ -3703,9 +4311,13 @@ export default { this.infoData(info); this.getSpecsLst(info.cate_id); this.productCon(); - if(info.mer_form_id){ - let time = new Date().getTime() * 1000 - let formUrl = `${this.baseURL}/pages/admin/system_form/index?inner_frame=1&time=${time}&form_id=${info.mer_form_id}`; + if (info.mer_form_id) { + let time = new Date().getTime() * 1000; + let formUrl = `${ + this.baseURL + }/pages/admin/system_form/index?inner_frame=1&time=${time}&form_id=${ + info.mer_form_id + }`; this.formUrl = formUrl; // associatedFormInfo(info.mer_form_id).then((res) => { // this.formData = res.data @@ -3722,18 +4334,20 @@ export default { }, infoData(info) { console.log(info); - if(info.status == 1){ - this.myConfig.readonly = true - this.virStatus = true + if (info.status == 1) { + this.myConfig.readonly = true; + this.virStatus = true; } this.deduction_set = info.integral_rate == -1 ? -1 : 1; this.goodList = info.goodList || []; this.attrs = info.attr || []; info.attrValue.forEach(val => { - this.$set(val,'select', true) + this.$set(val, "select", true); }); + console.log(info); this.formValidate = { product_type: info.product_type || 0, + is_customize: info.is_customize || 0, is_copy: info.is_copy, image: info.image, attrValue: info.attrValue, @@ -3778,10 +4392,11 @@ export default { ? info.mer_labels.map(Number) : [], type: info.type || 0, - audit_type:info.audit_type, + audit_type: info.audit_type, extend: info.extend || [], svip_price_type: info.svip_price_type || 0, - qualification:info.qualification || Object.assign({}, defaultObj.qualification), + qualification: + info.qualification || Object.assign({}, defaultObj.qualification) // is_huimei:info.is_huimei }; console.log(info.qualification); @@ -3792,31 +4407,31 @@ export default { ot_price: null, svip_price: null, stock: null, - proportion:0.60, - coupon:'', - growth:0, + proportion: 0.6, + coupon: "", + growth: 0, // cdkey: {}, bar_code: "", weight: null, volume: null, - gist_url:'' + gist_url: "" }; if (this.formValidate.extend.length != 0) { this.customBtn = 1; } if (this.formValidate.spec_type === 0) { - this.OneattrValue = info.attrValue - } else { - this.ManyAttrValue = info.attrValue - if(info.is_copy){ - this.formValidate.value = info.value - } - console.log(this.ManyAttrValue); - this.generate(); - } + this.OneattrValue = info.attrValue; + } else { + this.ManyAttrValue = info.attrValue; + if (info.is_copy) { + this.formValidate.value = info.value; + } + console.log(this.ManyAttrValue); + this.generate(); + } // if (this.formValidate.spec_type === 0) { // info.attrValue[0].list = [], - // this.OneattrValue = info.attrValue; + // this.OneattrValue = info.attrValue; // } else { // this.ManyAttrValue = info.attrValue; // if(info.is_copy){ @@ -3836,12 +4451,12 @@ export default { this.infoData(data); }, handleRemove(i) { - if(this.virStatus) return + if (this.virStatus) return; this.formValidate.slider_image.splice(i, 1); }, // 点击商品图 modalPicTap(tit, num, i) { - if(tit !== "1" && this.virStatus) return + if (tit !== "1" && this.virStatus) return; const _this = this; const attr = []; this.$modalUpload(function(img) { @@ -3871,23 +4486,28 @@ export default { }, handleSubmitUp() { this.currentTab = (Number(this.currentTab) - 1).toString(); - console.log(this.currentTab) + console.log(this.currentTab); }, handleSubmitNest(name) { console.log(this.formValidate); - if (this.formValidate.spec_type === 1 && this.currentTab=='3') { - let mode = this.ManyAttrValue.every(item=>{ - return !(+item.ot_price<item.price) - }) - if(!mode) return this.$message.error("规格设置-多规格市场价格限定等于或大于售价"); - let url = this.ManyAttrValue.every(item=>{ - return item.gist_url - }) - if(!url) return this.$message.error("规格设置-多规格依据链接必选填写"); - } else if(this.currentTab == '3'){ - let attr = this.OneattrValue[0] - if(+attr.ot_price<attr.price) return this.$message.error("规格设置-市场价格限定等于或大于售价"); - if(!attr.gist_url) return this.$message.error("规格设置-依据链接必须填写"); + if (this.formValidate.spec_type === 1 && this.currentTab == "3") { + let mode = this.ManyAttrValue.every(item => { + return !(+item.ot_price < item.price); + }); + if (!mode) + return this.$message.error( + "规格设置-多规格市场价格限定等于或大于售价" + ); + let url = this.ManyAttrValue.every(item => { + return item.gist_url; + }); + if (!url) return this.$message.error("规格设置-多规格依据链接必选填写"); + } else if (this.currentTab == "3") { + let attr = this.OneattrValue[0]; + if (+attr.ot_price < attr.price) + return this.$message.error("规格设置-市场价格限定等于或大于售价"); + if (!attr.gist_url) + return this.$message.error("规格设置-依据链接必须填写"); } this.$refs[name].validate(valid => { if (valid) { @@ -3900,27 +4520,30 @@ export default { this.$store.dispatch("settings/setEdit", false); this.onChangeGroup(); if (this.formValidate.spec_type === 1) { - let mode = this.ManyAttrValue.every(item=>{ - return !(+item.ot_price<item.price) - }) - if(!mode) return this.$message.error("规格设置-市场价格限定等于或大于售价"); - let url = this.ManyAttrValue.every(item=>{ - return item.gist_url - }) - if(!url) return this.$message.error("规格设置-多规格依据链接必选填写"); + let mode = this.ManyAttrValue.every(item => { + return !(+item.ot_price < item.price); + }); + if (!mode) + return this.$message.error("规格设置-市场价格限定等于或大于售价"); + let url = this.ManyAttrValue.every(item => { + return item.gist_url; + }); + if (!url) return this.$message.error("规格设置-多规格依据链接必选填写"); this.formValidate.attrValue = this.ManyAttrValue; } else { - let attr = this.OneattrValue[0] - if(+attr.ot_price<attr.price) return this.$message.error("规格设置-市场价格限定等于或大于售价"); - if(!attr.gist_url) return this.$message.error("规格设置-依据链接必须填写"); + let attr = this.OneattrValue[0]; + if (+attr.ot_price < attr.price) + return this.$message.error("规格设置-市场价格限定等于或大于售价"); + if (!attr.gist_url) + return this.$message.error("规格设置-依据链接必须填写"); this.formValidate.attrValue = this.OneattrValue; this.formValidate.attr = []; } - let ids = [] - this.goodList.forEach((item,index)=>{ - ids.push(item.product_id) - }) + let ids = []; + this.goodList.forEach((item, index) => { + ids.push(item.product_id); + }); this.formValidate.good_ids = ids; this.$refs[name].validate(valid => { if (valid) { @@ -3936,22 +4559,22 @@ export default { this.$refs[name].resetFields(); this.formValidate.slider_image = []; this.formValidate.qualification = { - production_name: '', - businessList: [], - licenceList: [], - trademarkList: [], - authorizedList: [], - commodityList: [], - otherList: [], - importBusinessList: [], - importAuthorizedList: [], - customsList: [], - packingList: [], - importOtherList: [], - commodity_type: 0, - brands_name: '', - import_name: '' - } + production_name: "", + businessList: [], + licenceList: [], + trademarkList: [], + authorizedList: [], + commodityList: [], + otherList: [], + importBusinessList: [], + importAuthorizedList: [], + customsList: [], + packingList: [], + importOtherList: [], + commodity_type: 0, + brands_name: "", + import_name: "" + }; this.loading = false; }) .catch(res => { @@ -4029,19 +4652,19 @@ export default { }, // 移动 handleDragStart(e, item) { - if(this.virStatus) return + if (this.virStatus) return; this.dragging = item; }, handleDragEnd(e, item) { - if(this.virStatus) return + if (this.virStatus) return; this.dragging = null; }, handleDragOver(e) { - if(this.virStatus) return + if (this.virStatus) return; e.dataTransfer.dropEffect = "move"; }, handleDragEnter(e, item) { - if(this.virStatus) return + if (this.virStatus) return; e.dataTransfer.effectAllowed = "move"; if (item === this.dragging) { return; @@ -4122,12 +4745,12 @@ export default { .goods_detail .goods_detail_wrapper { z-index: -10; } -.iframe-box{ +.iframe-box { min-height: 300px; } -.upload-demo{ - /deep/ .el-upload-list__item{ - width:10% +.upload-demo { + /deep/ .el-upload-list__item { + width: 10%; } // /deep/ .el-upload{ // border: 1px dotted #0fc6c2; @@ -4136,7 +4759,7 @@ export default { // line-height: 50px; // } } -::v-deep .el-upload--picture-card{ +::v-deep .el-upload--picture-card { width: auto; line-height: normal; height: unset; @@ -4180,8 +4803,8 @@ export default { } } -::v-deep .specsList th{ - line-height: 20px!important; +::v-deep .specsList th { + line-height: 20px !important; } ::v-deep .upLoadPicBox { .upLoad { @@ -4211,7 +4834,7 @@ export default { .noLeft ::v-deep .el-form-item__content { margin-left: 0 !important; } -.explanation{ +.explanation { color: #909399; } .tabNumWidth ::v-deep .el-input-number--medium { @@ -4233,15 +4856,15 @@ export default { padding-left: 25px !important; padding-right: 25px !important; } -/deep/.el-input-number.is-controls-right .el-input__inner{ +/deep/.el-input-number.is-controls-right .el-input__inner { padding-right: 15px !important; } .tabNumWidth ::v-deep .priceBox .el-input-number__decrease, -.tabNumWidth ::v-deep .priceBox .el-input-number__increase{ +.tabNumWidth ::v-deep .priceBox .el-input-number__increase { display: none; } -.tabNumWidth ::v-deep .priceBox.el-input-number--small{ - width: 100px!important; +.tabNumWidth ::v-deep .priceBox.el-input-number--small { + width: 100px !important; } .tabNumWidth ::v-deep thead { line-height: normal !important; @@ -4253,10 +4876,10 @@ export default { .seeCatMy { color: var(--prev-color-primary); cursor: pointer; -} -.selectOn{ - color: var(--prev-color-primary); -} +} +.selectOn { + color: var(--prev-color-primary); +} .virtual_boder { border: 1px solid var(--prev-color-primary); } diff --git a/src/views/product/productList/index.vue b/src/views/product/productList/index.vue index c92e268..401d7fb 100644 --- a/src/views/product/productList/index.vue +++ b/src/views/product/productList/index.vue @@ -1,9 +1,22 @@ <template> <div class="divBox"> <div class="selCard"> - <el-form ref="searchForm" :model="tableFrom" size="small" label-width="95px" :inline="true"> + <el-form + ref="searchForm" + :model="tableFrom" + size="small" + label-width="95px" + :inline="true" + > <el-form-item label="平台分类:" prop="cate_id"> - <el-cascader v-model="tableFrom.cate_id" class="selWidth" :options="categoryList" :props="props" clearable @change="getList(1)" /> + <el-cascader + v-model="tableFrom.cate_id" + class="selWidth" + :options="categoryList" + :props="props" + clearable + @change="getList(1)" + /> </el-form-item> <!-- <el-form-item label="商户分类:" prop="mer_cate_id"> <el-select v-model="tableFrom.mer_cate_id" placeholder="请选择" class="filter-item selWidth" clearable @change="getList(1)"> @@ -24,8 +37,19 @@ </el-select> </el-form-item> --> <el-form-item label="商品状态:" prop="us_status"> - <el-select v-model="tableFrom.us_status" placeholder="请选择" class="filter-item selWidth" clearable @change="getList"> - <el-option v-for="item in productStatusList" :key="item.value" :label="item.label" :value="item.value" /> + <el-select + v-model="tableFrom.us_status" + placeholder="请选择" + class="filter-item selWidth" + clearable + @change="getList" + > + <el-option + v-for="item in productStatusList" + :key="item.value" + :label="item.label" + :value="item.value" + /> </el-select> </el-form-item> <el-form-item label="标签:" prop="mer_labels"> @@ -80,7 +104,13 @@ </el-select> </el-form-item> --> <el-form-item label="关键字:" prop="keyword"> - <el-input v-model="tableFrom.keyword" placeholder="请输入商品名称,ID号" class="selWidth" clearable @keyup.enter.native="getList(1)" /> + <el-input + v-model="tableFrom.keyword" + placeholder="请输入商品名称,ID号" + class="selWidth" + clearable + @keyup.enter.native="getList(1)" + /> </el-form-item> <!-- <el-form-item label="商品类型:" prop="is_ficti"> <el-select v-model="tableFrom.is_ficti" placeholder="请选择" class="filter-item selWidth" clearable @change="getList(1)"> @@ -89,94 +119,188 @@ </el-form-item> --> <el-form-item label="创建时间:" prop="create_time"> <el-date-picker - v-model="timeVal" - value-format="yyyy/MM/dd" - format="yyyy/MM/dd" - type="daterange" - placement="bottom-end" - placeholder="自定义时间" - start-placeholder="开始日期" - end-placeholder="结束日期" - style="width: 280px;" - :picker-options="pickerOptions" - @change="onchangeTime" - clearable - /> + v-model="timeVal" + value-format="yyyy/MM/dd" + format="yyyy/MM/dd" + type="daterange" + placement="bottom-end" + placeholder="自定义时间" + start-placeholder="开始日期" + end-placeholder="结束日期" + style="width: 280px;" + :picker-options="pickerOptions" + @change="onchangeTime" + clearable + /> </el-form-item> <el-form-item label="审核时间:" prop="update_date"> <el-date-picker - v-model="updateTimeVal" - value-format="yyyy/MM/dd" - format="yyyy/MM/dd" - type="daterange" - placement="bottom-end" - placeholder="自定义时间" - start-placeholder="开始日期" - end-placeholder="结束日期" - style="width: 280px;" - :picker-options="pickerOptions" - @change="onchangeUpdateTime" - clearable - /> + v-model="updateTimeVal" + value-format="yyyy/MM/dd" + format="yyyy/MM/dd" + type="daterange" + placement="bottom-end" + placeholder="自定义时间" + start-placeholder="开始日期" + end-placeholder="结束日期" + style="width: 280px;" + :picker-options="pickerOptions" + @change="onchangeUpdateTime" + clearable + /> </el-form-item> <el-form-item> - <el-button type="primary" size="small" @click="getList(1)">搜索</el-button> + <el-button type="primary" size="small" @click="getList(1)" + >搜索</el-button + > <el-button size="small" @click="searchReset()">重置</el-button> </el-form-item> </el-form> </div> <el-card class="mt14 dataBox"> <el-tabs v-model="tableFrom.type" @tab-click="getProduct"> - <el-tab-pane v-for="(item,index) in headeNum" :key="index" :name="item.type.toString()" :label="item.name +'('+item.count +')' " /> + <el-tab-pane + v-for="(item, index) in headeNum" + :key="index" + :name="item.type.toString()" + :label="item.name + '(' + item.count + ')'" + /> </el-tabs> <div class="mt5 mb14"> - <router-link :to="{ path:`${roterPre}` + '/product/list/addProduct' }" class="mr10"> + <router-link + :to="{ path: `${roterPre}` + '/product/list/addProduct' }" + class="mr10" + > <el-button size="small" type="primary">添加商品</el-button> </router-link> - <el-button size="small" type="primary" @click="exports">导出列表</el-button> + <el-button size="small" type="primary" @click="exports" + >导出列表</el-button + > <!-- <el-button size="small" type="success" @click="onCopy">商品采集</el-button> --> - <el-button size="small" :disabled="checkedIds.length == 0 && !allCheck" type="default" @click="openBatch">批量设置</el-button> - <el-button size="small" :disabled="tableFrom.type != 1 || checkedIds.length == 0 && !allCheck" @click="batchOff">批量下架</el-button> - <el-button size="small" :disabled="tableFrom.type != 2 || checkedIds.length == 0 && !allCheck" @click="batchShelf">批量上架</el-button> + <el-button + size="small" + :disabled="checkedIds.length == 0 && !allCheck" + type="default" + @click="openBatch" + >批量设置</el-button + > + <el-button + size="small" + :disabled=" + tableFrom.type != 1 || (checkedIds.length == 0 && !allCheck) + " + @click="batchOff" + >批量下架</el-button + > + <el-button + size="small" + :disabled=" + tableFrom.type != 2 || (checkedIds.length == 0 && !allCheck) + " + @click="batchShelf" + >批量上架</el-button + > </div> - <el-alert v-if="checkedIds.length>0 || allCheck" :title="allCheck ? `已选择 ${tableData.total} 项` : `已选择 ${checkedIds.length} 项`" type="info" show-icon class="mb10" /> + <el-alert + v-if="checkedIds.length > 0 || allCheck" + :title=" + allCheck + ? `已选择 ${tableData.total} 项` + : `已选择 ${checkedIds.length} 项` + " + type="info" + show-icon + class="mb10" + /> <el-table v-loading="listLoading" :data="tableData.data" size="small" :row-class-name="tableRowClassName" - :row-key="(row) => { return row.product_id }" + :row-key=" + row => { + return row.product_id; + } + " @selection-change="handleSelectionChange" @rowclick.stop="closeEdit" > <el-table-column width="50"> <template slot="header" slot-scope="scope"> - <el-popover placement="top-start" width="100" trigger="hover" class="tabPop"> + <el-popover + placement="top-start" + width="100" + trigger="hover" + class="tabPop" + > <div> - <span class="spBlock onHand" :class="{'check': chkName === 'dan'}" @click="onHandle('dan',scope.$index)">选中本页</span> - <span class="spBlock onHand" :class="{'check': chkName === 'duo'}" @click="onHandle('duo')">选中全部</span> + <span + class="spBlock onHand" + :class="{ check: chkName === 'dan' }" + @click="onHandle('dan', scope.$index)" + >选中本页</span + > + <span + class="spBlock onHand" + :class="{ check: chkName === 'duo' }" + @click="onHandle('duo')" + >选中全部</span + > </div> - <el-checkbox slot="reference" :value="(chkName === 'dan' && checkedPage.indexOf(tableFrom.page) > -1) || chkName === 'duo'" @change="changeType" /> + <el-checkbox + slot="reference" + :value=" + (chkName === 'dan' && + checkedPage.indexOf(tableFrom.page) > -1) || + chkName === 'duo' + " + @change="changeType" + /> </el-popover> </template> <template slot-scope="scope"> - <el-checkbox :disabled="scope.row.cancel_time" :value="!scope.row.cancel_time && (checkedIds.indexOf(scope.row.product_id) > -1 || (chkName === 'duo' && noChecked.indexOf(scope.row.product_id) === -1))" @change="(v)=>changeOne(v,scope.row)" /> + <el-checkbox + :disabled="scope.row.cancel_time" + :value=" + !scope.row.cancel_time && + (checkedIds.indexOf(scope.row.product_id) > -1 || + (chkName === 'duo' && + noChecked.indexOf(scope.row.product_id) === -1)) + " + @change="v => changeOne(v, scope.row)" + /> </template> </el-table-column> <el-table-column type="expand"> <template slot-scope="props"> - <el-form label-position="left" inline class="demo-table-expand demo-table-expand1" label-width="90px"> + <el-form + label-position="left" + inline + class="demo-table-expand demo-table-expand1" + label-width="90px" + > <el-form-item label="平台分类:"> - <span>{{ props.row.storeCategory?props.row.storeCategory.cate_name:'-' }}</span> + <span>{{ + props.row.storeCategory + ? props.row.storeCategory.cate_name + : "-" + }}</span> </el-form-item> <el-form-item label="商品分类:"> <template v-if="props.row.merCateId.length"> - <span v-for="(item, index) in props.row.merCateId" :key="index" class="mr10">{{ item.category.cate_name }}</span> + <span + v-for="(item, index) in props.row.merCateId" + :key="index" + class="mr10" + >{{ item.category.cate_name }}</span + > </template> <span v-else>-</span> </el-form-item> <el-form-item label="品牌:"> - <span class="mr10">{{ props.row.brand?props.row.brand.brand_name:'其他' }}</span> + <span class="mr10">{{ + props.row.brand ? props.row.brand.brand_name : "其他" + }}</span> </el-form-item> <el-form-item label="市场价格:"> <span>{{ props.row.ot_price | filterEmpty }}</span> @@ -187,7 +311,11 @@ <el-form-item label="收藏:"> <span>{{ props.row.care_count | filterEmpty }}</span> </el-form-item> - <el-form-item v-if="tableFrom.type === '7'" key="1" label="未通过原因:"> + <el-form-item + v-if="tableFrom.type === '7'" + key="1" + label="未通过原因:" + > <span>{{ props.row.refusal }}</span> </el-form-item> </el-form> @@ -197,31 +325,72 @@ <el-table-column label="商品图" min-width="70"> <template slot-scope="scope"> <div class="demo-image__preview"> - <el-image :src="scope.row.image" :preview-src-list="[scope.row.image]" /> + <el-image + :src="scope.row.image" + :preview-src-list="[scope.row.image]" + /> </div> </template> </el-table-column> <el-table-column prop="store_name" label="商品名称" min-width="230"> <template slot-scope="scope"> - <div><span class="tags_name" :class="'name'+scope.row.spec_type">{{ scope.row.spec_type==0 ? '[单规格]' : '[多规格]' }}</span>{{ scope.row.store_name || '-' }}</div> + <div> + <span class="tags_name" :class="'name' + scope.row.spec_type">{{ + scope.row.spec_type == 0 ? "[单规格]" : "[多规格]" + }}</span + >{{ scope.row.store_name || "-" }} + </div> + </template> + </el-table-column> + + <el-table-column prop="is_customize" label="定制产品" min-width="70"> + <template slot-scope="scope"> + {{ scope.row.is_customize ? "是" : "否" }} </template> </el-table-column> <el-table-column prop="remark" label="商品备注" min-width="70" /> <el-table-column prop="price" label="商品售价" min-width="80" /> <el-table-column prop="sales" label="销量" min-width="70" /> <el-table-column prop="stock" label="库存" min-width="70" /> - <el-table-column prop="storeCategory.cate_name" label="商品类型" min-width="70" /> + <el-table-column + prop="storeCategory.cate_name" + label="商品类型" + min-width="70" + /> <el-table-column prop="sort" align="center" label="排序" min-width="80"> <template slot-scope="scope"> <span v-if="scope.row.index === tabClickIndex"> - <el-input v-model.number="scope.row['sort']" type="number" maxlength="300" size="mini" autofocus @blur="inputBlur(scope)" /> + <el-input + v-model.number="scope.row['sort']" + type="number" + maxlength="300" + size="mini" + autofocus + @blur="inputBlur(scope)" + /> </span> - <span v-else @dblclick.stop="tabClick(scope.row)">{{ scope.row['sort'] }}</span> + <span v-else @dblclick.stop="tabClick(scope.row)">{{ + scope.row["sort"] + }}</span> </template> </el-table-column> - <el-table-column v-if="Number(tableFrom.type) < 5" key="1" prop="status" label="上/下架" min-width="90"> + <el-table-column + v-if="Number(tableFrom.type) < 5" + key="1" + prop="status" + label="上/下架" + min-width="90" + > <template slot-scope="scope"> - <el-switch v-model="scope.row.is_show" :active-value="1" :inactive-value="0" :width="55" active-text="上架" inactive-text="下架" @change="onchangeIsShow(scope.row)" /> + <el-switch + v-model="scope.row.is_show" + :active-value="1" + :inactive-value="0" + :width="55" + active-text="上架" + inactive-text="下架" + @change="onchangeIsShow(scope.row)" + /> </template> </el-table-column> <el-table-column prop="stock" label="商品状态" min-width="90"> @@ -232,45 +401,119 @@ <el-table-column prop="create_time" label="创建时间" min-width="120" /> <el-table-column label="操作" min-width="150" fixed="right"> <template slot-scope="scope"> - <el-button type="text" size="small" class="mr10" @click="onDetails(scope.row.product_id)">详情</el-button> - <router-link v-if="tableFrom.type != 5 && tableFrom.type!=12" :to="{path: roterPre + '/product/list/addProduct/' + scope.row.product_id}"> + <el-button + type="text" + size="small" + class="mr10" + @click="onDetails(scope.row.product_id)" + >详情</el-button + > + <router-link + v-if="tableFrom.type != 5 && tableFrom.type != 12" + :to="{ + path: + roterPre + '/product/list/addProduct/' + scope.row.product_id + }" + > <el-button type="text" size="small" class="mr10">编辑</el-button> </router-link> - <el-button v-if="tableFrom.type !== '5'" type="text" size="small" class="mr10" @click="handlePreview(scope.row.product_id)">预览</el-button> + <el-button + v-if="tableFrom.type !== '5'" + type="text" + size="small" + class="mr10" + @click="handlePreview(scope.row.product_id)" + >预览</el-button + > <el-dropdown> <span class="el-dropdown-link"> 更多<i class="el-icon-arrow-down el-icon--right" /> </span> <el-dropdown-menu slot="dropdown"> - <el-dropdown-item v-if="tableFrom.type !== '5' && is_audit == '1'" @click.native="onAuditFree(scope.row)">免审编辑</el-dropdown-item> + <el-dropdown-item + v-if="tableFrom.type !== '5' && is_audit == '1'" + @click.native="onAuditFree(scope.row)" + >免审编辑</el-dropdown-item + > <el-dropdown-item v-if="tableFrom.type != 5"> - <router-link :to="{path: roterPre + '/product/list/addProduct/' + scope.row.product_id+'?type=copy'}"> + <router-link + :to="{ + path: + roterPre + + '/product/list/addProduct/' + + scope.row.product_id + + '?type=copy' + }" + > 复制商品 </router-link> </el-dropdown-item> <!-- <el-dropdown-item v-if="tableFrom.type !== '5'" @click.native="onEditLabel(scope.row)">编辑标签</el-dropdown-item> --> <el-dropdown-item v-if="tableFrom.type != 5"> - <router-link :to="{path: roterPre + '/product/reviews/?product_id=' + scope.row.product_id}"> + <router-link + :to="{ + path: + roterPre + + '/product/reviews/?product_id=' + + scope.row.product_id + }" + > 查看评价 </router-link> </el-dropdown-item> - <el-dropdown-item v-if="tableFrom.type !== '1' && tableFrom.type!== '3' && tableFrom.type !=='4'" @click.native="handleDelete(scope.row.product_id, scope.$index)">{{ tableFrom.type === '5' ? '删除' : '加入回收站' }}</el-dropdown-item> - <el-dropdown-item v-if="tableFrom.type === '5'" @click.native="handleRestore(scope.row.product_id)">恢复商品</el-dropdown-item> + <el-dropdown-item + v-if=" + tableFrom.type !== '1' && + tableFrom.type !== '3' && + tableFrom.type !== '4' + " + @click.native=" + handleDelete(scope.row.product_id, scope.$index) + " + >{{ + tableFrom.type === "5" ? "删除" : "加入回收站" + }}</el-dropdown-item + > + <el-dropdown-item + v-if="tableFrom.type === '5'" + @click.native="handleRestore(scope.row.product_id)" + >恢复商品</el-dropdown-item + > </el-dropdown-menu> </el-dropdown> </template> </el-table-column> </el-table> <div class="block"> - <el-pagination background :page-size="tableFrom.limit" :current-page="tableFrom.page" background layout="total, prev, pager, next, jumper" :total="tableData.total" @size-change="handleSizeChange" @current-change="pageChange" /> + <el-pagination + background + :page-size="tableFrom.limit" + :current-page="tableFrom.page" + background + layout="total, prev, pager, next, jumper" + :total="tableData.total" + @size-change="handleSizeChange" + @current-change="pageChange" + /> </div> </el-card> <!-- 生成淘宝京东表单--> - <tao-bao ref="taoBao" :delivery-type="deliveryType" :delivery-list="deliveryList" @getSuccess="getSuccess" /> + <tao-bao + ref="taoBao" + :delivery-type="deliveryType" + :delivery-list="deliveryList" + @getSuccess="getSuccess" + /> <!--预览商品--> <div v-if="previewVisible"> <div class="bg" @click.stop="previewVisible = false" /> - <preview-box v-if="previewVisible" ref="previewBox" :goods-id="goodsId" :product-type="0" :preview-key="previewKey" /> + <preview-box + v-if="previewVisible" + ref="previewBox" + :goods-id="goodsId" + :product-type="0" + :preview-key="previewKey" + /> </div> <!--编辑标签--> <el-dialog @@ -280,9 +523,20 @@ width="470px" :before-close="handleClose" > - <el-form ref="labelForm" :model="labelForm" size="small" @submit.native.prevent> + <el-form + ref="labelForm" + :model="labelForm" + size="small" + @submit.native.prevent + > <el-form-item> - <el-select v-model="labelForm.mer_labels" clearable multiple placeholder="请选择" class="width100"> + <el-select + v-model="labelForm.mer_labels" + clearable + multiple + placeholder="请选择" + class="width100" + > <el-option v-for="item in labelList" :key="item.id" @@ -293,8 +547,10 @@ </el-form-item> </el-form> <span slot="footer" class="dialog-footer"> - <el-button size="small" @click="dialogLabel=false">取消</el-button> - <el-button size="small" type="primary" @click="submitForm('labelForm')">提交</el-button> + <el-button size="small" @click="dialogLabel = false">取消</el-button> + <el-button size="small" type="primary" @click="submitForm('labelForm')" + >提交</el-button + > </span> </el-dialog> <!-- 免审核弹窗--> @@ -307,9 +563,19 @@ width="800px" :before-close="handleFreightClose" > - <el-form ref="tempForm" :model="tempForm" :rules="tempRule" @submit.native.prevent> + <el-form + ref="tempForm" + :model="tempForm" + :rules="tempRule" + @submit.native.prevent + > <el-form-item prop="temp_id"> - <el-select v-model="tempForm.temp_id" clearable placeholder="请选择" class="selWidth"> + <el-select + v-model="tempForm.temp_id" + clearable + placeholder="请选择" + class="selWidth" + > <el-option v-for="item in tempList" :key="item.shipping_template_id" @@ -320,7 +586,9 @@ </el-form-item> </el-form> <span slot="footer" class="dialog-footer"> - <el-button type="primary" @click="submitTempForm('tempForm')">提交</el-button> + <el-button type="primary" @click="submitTempForm('tempForm')" + >提交</el-button + > </span> </el-dialog> <!--批量设置佣金弹窗--> @@ -330,19 +598,45 @@ :visible.sync="dialogCommision" width="600px" > - <el-form ref="commisionForm" :model="commisionForm" :rules="commisionRule" @submit.native.prevent> + <el-form + ref="commisionForm" + :model="commisionForm" + :rules="commisionRule" + @submit.native.prevent + > <el-form-item label="一级佣金比例:" prop="extension_one"> - <el-input-number v-model="commisionForm.extension_one" :precision="2" :step="0.1" :min="0" :max="1" class="priceBox" controls-position="right" /> + <el-input-number + v-model="commisionForm.extension_one" + :precision="2" + :step="0.1" + :min="0" + :max="1" + class="priceBox" + controls-position="right" + /> </el-form-item> <el-form-item label="二级佣金比例:" prop="extension_two"> - <el-input-number v-model="commisionForm.extension_two" :precision="2" :step="0.1" :min="0" :max="1" class="priceBox" controls-position="right" /> + <el-input-number + v-model="commisionForm.extension_two" + :precision="2" + :step="0.1" + :min="0" + :max="1" + class="priceBox" + controls-position="right" + /> </el-form-item> <el-form-item> - <span>备注:订单交易成功后给上级返佣的比例,例:0.5 = 返订单金额的50%</span> + <span + >备注:订单交易成功后给上级返佣的比例,例:0.5 = + 返订单金额的50%</span + > </el-form-item> </el-form> <span slot="footer" class="dialog-footer"> - <el-button type="primary" @click="submitCommisionForm('commisionForm')">提交</el-button> + <el-button type="primary" @click="submitCommisionForm('commisionForm')" + >提交</el-button + > </span> </el-dialog> <!--批量设置付费会员价--> @@ -352,21 +646,33 @@ :visible.sync="dialogSvip" width="700px" > - <el-form ref="svipForm" :model="svipForm" label-width="80px" @submit.native.prevent> - <el-form-item - label="参与方式:" - > + <el-form + ref="svipForm" + :model="svipForm" + label-width="80px" + @submit.native.prevent + > + <el-form-item label="参与方式:"> <el-radio-group v-model="svipForm.svip_price_type"> <el-radio :label="0" class="radio">不设置会员价</el-radio> <el-radio :label="1" class="radio">默认设置会员价</el-radio> </el-radio-group> </el-form-item> <el-form-item> - 备注:默认设置会员价是指商户在 <router-link :to="{path: roterPre + '/systemForm/Basics/svip'}" class="member-link"> [设置-付费会员设置] </router-link> 中设置的会员折扣价,选择后每个商品默认展示此处设置的会员折扣价。 + 备注:默认设置会员价是指商户在 + <router-link + :to="{ path: roterPre + '/systemForm/Basics/svip' }" + class="member-link" + > + [设置-付费会员设置] + </router-link> + 中设置的会员折扣价,选择后每个商品默认展示此处设置的会员折扣价。 </el-form-item> </el-form> <span slot="footer" class="dialog-footer"> - <el-button type="primary" @click="submitSvipForm('svipForm')">提交</el-button> + <el-button type="primary" @click="submitSvipForm('svipForm')" + >提交</el-button + > </span> </el-dialog> <!--批量设置弹窗--> @@ -387,14 +693,26 @@ <el-tab-pane label="商品分类" name="cate"> <el-form size="small" label-width="120px" :inline="true"> <el-form-item label="平台商品分类:"> - <el-cascader v-model="batchData.cate_id" :options="categoryList" :props="props" clearable class="width100" /> + <el-cascader + v-model="batchData.cate_id" + :options="categoryList" + :props="props" + clearable + class="width100" + /> </el-form-item> </el-form> </el-tab-pane> <el-tab-pane label="商品标签" name="label"> <el-form size="small" label-width="120px" :inline="true"> <el-form-item label="商品标签:"> - <el-select v-model="batchData.mer_labels" clearable multiple placeholder="请选择" class="width100"> + <el-select + v-model="batchData.mer_labels" + clearable + multiple + placeholder="请选择" + class="width100" + > <el-option v-for="item in labelList" :key="item.id" @@ -426,11 +744,15 @@ <el-radio-group v-model="batchData.delivery_free"> <el-radio :label="1">包邮</el-radio> <el-radio :label="0" class="radio">运费模板</el-radio> - </el-radio-group> </el-form-item> <el-form-item v-if="batchData.delivery_free == 0"> - <el-select v-model="batchData.temp_id" clearable placeholder="请选择" class="width100"> + <el-select + v-model="batchData.temp_id" + clearable + placeholder="请选择" + class="width100" + > <el-option v-for="item in tempList" :key="item.shipping_template_id" @@ -547,7 +869,6 @@ </div> </template> <script> - import { productLstApi, productDeleteApi, @@ -571,16 +892,16 @@ import { associatedFormInfo, batchSetProduct, exportProductApi -} from '@/api/product' -import { roterPre } from '@/settings' -import createWorkBook from '@/utils/newToExcel.js' -import taoBao from './taoBao' -import editAttr from './editAttr' -import proDetail from './proDetails.vue' -import previewBox from '@/components/previewBox/index' -import timeOptions from '@/utils/timeOptions'; +} from "@/api/product"; +import { roterPre } from "@/settings"; +import createWorkBook from "@/utils/newToExcel.js"; +import taoBao from "./taoBao"; +import editAttr from "./editAttr"; +import proDetail from "./proDetails.vue"; +import previewBox from "@/components/previewBox/index"; +import timeOptions from "@/utils/timeOptions"; export default { - name: 'ProductList', + name: "ProductList", components: { taoBao, previewBox, editAttr, proDetail }, data() { return { @@ -594,7 +915,7 @@ export default { labelList: [], tempList: [], timeVal: [], - updateTimeVal:[], + updateTimeVal: [], listLoading: true, tableData: { data: [], @@ -603,47 +924,53 @@ export default { tableFrom: { page: 1, limit: 20, - date:'', - mer_cate_id: '', - cate_id: '', - keyword: '', - temp_id: '', - form_id: '', - type: this.$route.query.type ? this.$route.query.type : '1', - is_ficti: '', - is_gift_bag: '', - us_status: '', - mer_labels: '', - svip_price_type: '', - product_id: this.$route.query.id ? this.$route.query.id : '' + date: "", + mer_cate_id: "", + cate_id: "", + keyword: "", + temp_id: "", + form_id: "", + type: this.$route.query.type ? this.$route.query.type : "1", + is_ficti: "", + is_gift_bag: "", + us_status: "", + mer_labels: "", + svip_price_type: "", + product_id: this.$route.query.id ? this.$route.query.id : "" }, categoryList: [], // 平台 merCateList: [], // 商户分类筛选 modals: false, - tabClickIndex: '', + tabClickIndex: "", multipleSelection: [], productStatusList: [ - { label: '上架显示', value: 1 }, - { label: '下架', value: 0 }, - { label: '平台关闭', value: -1 } + { label: "上架显示", value: 1 }, + { label: "下架", value: 0 }, + { label: "平台关闭", value: -1 } ], productTypeList: [ - { label: '普通商品', value: 0 }, - { label: '虚拟商品', value: 1 }, - { label: '卡密商品', value: 2 } + { label: "普通商品", value: 0 }, + { label: "虚拟商品", value: 1 }, + { label: "卡密商品", value: 2 } ], tempRule: { - temp_id: [{ required: true, message: '请选择运费模板', trigger: 'change' }] + temp_id: [ + { required: true, message: "请选择运费模板", trigger: "change" } + ] }, commisionRule: { - extension_one: [{ required: true, message: '请输入一级佣金', trigger: 'change' }], - extension_two: [{ required: true, message: '请输入二级佣金', trigger: 'change' }] + extension_one: [ + { required: true, message: "请输入一级佣金", trigger: "change" } + ], + extension_two: [ + { required: true, message: "请输入二级佣金", trigger: "change" } + ] }, commisionForm: { extension_one: 0, extension_two: 0 }, svipForm: { svip_price_type: 0 }, - goodsId: '', - previewKey: '', - product_id: '', + goodsId: "", + previewKey: "", + product_id: "", configData: {}, previewVisible: false, dialogLabel: false, @@ -658,594 +985,615 @@ export default { isBatch: false, open_svip: false, batchModal: false, - tabPosition: 'left', + tabPosition: "left", formList: [], formData: [], // 表单数据 - batchName: 'cate', + batchName: "cate", batchData: { delivery_way: [], - price_type: 'add', + price_type: "add", delivery_free: 1, extension_one: 0, extension_two: 0, price_number: 0 }, - chkName: '', + chkName: "", checkedIds: [], // 订单当前页选中的数据 noChecked: [], // 订单全选状态下当前页不选中的数据 checkedPage: [], allCheck: false - } + }; }, mounted() { - this.getLstFilterApi() - this.getCategorySelect() - this.getCategoryList() - this.getFormList() - this.getList(1) - this.getLabelLst() - this.getTempLst() - this.productCon() + this.getLstFilterApi(); + this.getCategorySelect(); + this.getCategoryList(); + this.getFormList(); + this.getList(1); + this.getLabelLst(); + this.getTempLst(); + this.productCon(); }, methods: { // 到处列表 async exports() { - const excelData = JSON.parse(JSON.stringify(this.tableFrom)); let data = [] - excelData.page = 1 - excelData.limit = 100 - excelData.ids = this.checkedIds.toString() - let pageCount = 1 - let lebData = {} + const excelData = JSON.parse(JSON.stringify(this.tableFrom)); + let data = []; + excelData.page = 1; + excelData.limit = 100; + excelData.ids = this.checkedIds.toString(); + let pageCount = 1; + let lebData = {}; for (let i = 0; i < pageCount; i++) { - lebData = await this.downOrderData(excelData) - pageCount = Math.ceil(lebData.count / excelData.limit) + lebData = await this.downOrderData(excelData); + pageCount = Math.ceil(lebData.count / excelData.limit); if (lebData.export.length) { - data = data.concat(lebData.export) - excelData.page++ + data = data.concat(lebData.export); + excelData.page++; } } - createWorkBook(lebData.header, lebData.title, data, lebData.foot, lebData.filename) - return + createWorkBook( + lebData.header, + lebData.title, + data, + lebData.foot, + lebData.filename + ); + return; }, /** 订单 */ downOrderData(excelData) { return new Promise((resolve, reject) => { - exportProductApi(excelData).then((res) => { - return resolve(res.data) - }) - }) + exportProductApi(excelData).then(res => { + return resolve(res.data); + }); + }); }, - // 具体日期 + // 具体日期 onchangeTime(e) { - this.timeVal = e - this.tableFrom.date = e ? this.timeVal.join('-') : '' - this.getList(1) + this.timeVal = e; + this.tableFrom.date = e ? this.timeVal.join("-") : ""; + this.getList(1); }, - // 审核日期 + // 审核日期 onchangeUpdateTime(e) { - this.updateTimeVal = e - this.tableFrom.update_date = e ? this.updateTimeVal.join('-') : '' - this.getList(1) + this.updateTimeVal = e; + this.tableFrom.update_date = e ? this.updateTimeVal.join("-") : ""; + this.getList(1); }, /** 重置 */ searchReset() { - this.timeVal = [] - this.tableFrom.date = "" - this.$refs.searchForm.resetFields() - this.getList(1) + this.timeVal = []; + this.tableFrom.date = ""; + this.$refs.searchForm.resetFields(); + this.getList(1); }, // 把每一行的索引放进row tableRowClassName({ row, rowIndex }) { - row.index = rowIndex + row.index = rowIndex; }, // 添加明细原因 row 当前行 column 当前列 tabClick(row) { - this.tabClickIndex = row.index + this.tabClickIndex = row.index; }, // 失去焦点初始化 inputBlur(scope) { - if (!scope.row.sort || scope.row.sort < 0) scope.row.sort = 0 + if (!scope.row.sort || scope.row.sort < 0) scope.row.sort = 0; productSort(scope.row.product_id, { sort: scope.row.sort }) - .then((res) => { - this.closeEdit() - }) - .catch((res) => { + .then(res => { + this.closeEdit(); }) + .catch(res => {}); }, closeEdit() { - this.tabClickIndex = null + this.tabClickIndex = null; }, // 选择商品 onHandle(name) { - this.chkName = this.chkName === name ? '' : name - this.changeType(!(this.chkName === '')) + this.chkName = this.chkName === name ? "" : name; + this.changeType(!(this.chkName === "")); }, changeType(v) { if (v) { if (!this.chkName) { - this.chkName = 'dan' + this.chkName = "dan"; } } else { - this.chkName = '' - this.allCheck = false + this.chkName = ""; + this.allCheck = false; } - const index = this.checkedPage.indexOf(this.tableFrom.page) - if (this.chkName === 'dan') { - this.checkedPage.push(this.tableFrom.page) + const index = this.checkedPage.indexOf(this.tableFrom.page); + if (this.chkName === "dan") { + this.checkedPage.push(this.tableFrom.page); } else if (index > -1) { - this.checkedPage.splice(index, 1) + this.checkedPage.splice(index, 1); } - this.syncCheckedId() + this.syncCheckedId(); }, syncCheckedId() { const ids = this.tableData.data.map(v => { - return v.product_id - }) - if (this.chkName === 'duo') { - this.checkedIds = [] - this.allCheck = true - } else if (this.chkName === 'dan') { - this.allCheck = false + return v.product_id; + }); + if (this.chkName === "duo") { + this.checkedIds = []; + this.allCheck = true; + } else if (this.chkName === "dan") { + this.allCheck = false; ids.forEach(id => { - const index = this.checkedIds.indexOf(id) + const index = this.checkedIds.indexOf(id); if (index === -1) { - this.checkedIds.push(id) + this.checkedIds.push(id); } - }) + }); } else { ids.forEach(id => { - const index = this.checkedIds.indexOf(id) + const index = this.checkedIds.indexOf(id); if (index > -1) { - this.checkedIds.splice(index, 1) + this.checkedIds.splice(index, 1); } - }) + }); } - console.log(this.checkedIds) + console.log(this.checkedIds); }, // 分开选择 changeOne(v, row) { if (v) { - if (this.chkName === 'duo') { - const index = this.noChecked.indexOf(row.product_id) - if (index > -1) this.noChecked.splice(index, 1) + if (this.chkName === "duo") { + const index = this.noChecked.indexOf(row.product_id); + if (index > -1) this.noChecked.splice(index, 1); } else { - const index = this.checkedIds.indexOf(row.product_id) - if (index === -1) this.checkedIds.push(row.product_id) + const index = this.checkedIds.indexOf(row.product_id); + if (index === -1) this.checkedIds.push(row.product_id); } } else { - if (this.chkName === 'duo') { - const index = this.noChecked.indexOf(row.product_id) - if (index === -1) this.noChecked.push(row.product_id) + if (this.chkName === "duo") { + const index = this.noChecked.indexOf(row.product_id); + if (index === -1) this.noChecked.push(row.product_id); } else { - const index = this.checkedIds.indexOf(row.product_id) - if (index > -1) this.checkedIds.splice(index, 1) + const index = this.checkedIds.indexOf(row.product_id); + if (index > -1) this.checkedIds.splice(index, 1); } } }, // 批量设置价格 changePrice() { - if (this.batchData.price_type == 'div') { - this.batchData.price_number = 1 + if (this.batchData.price_type == "div") { + this.batchData.price_number = 1; } else { - this.batchData.price_number = 0 + this.batchData.price_number = 0; } }, // 批量设置--提交数据 submitBatchForm() { - console.log(this.batchName) - const name = this.batchName + console.log(this.batchName); + const name = this.batchName; switch (name) { - case 'cate': + case "cate": if (!this.batchData.cate_id) { - return this.$message.warning('请选择商品分类!') + return this.$message.warning("请选择商品分类!"); } - break - case 'delivery_method': + break; + case "delivery_method": if (!this.batchData.delivery_way.length) { - return this.$message.warning('请选择配送方式!') + return this.$message.warning("请选择配送方式!"); } - break - case 'postage': - if (this.batchData.delivery_free != 0 && this.batchData.delivery_free != 1) { - return this.$message.warning('请选择运费设置!') + break; + case "postage": + if ( + this.batchData.delivery_free != 0 && + this.batchData.delivery_free != 1 + ) { + return this.$message.warning("请选择运费设置!"); } if (this.batchData.delivery_free == 0 && !this.batchData.temp_id) { - return this.$message.warning('请选择运费模板!') + return this.$message.warning("请选择运费模板!"); } - break - case 'commission': - this.batchData.extension_one = this.batchData.extension_one || 0 - this.batchData.extension_two = this.batchData.extension_two || 0 - break - case 'price': - if (this.batchData.price_type == 'div' && this.batchData.price_number == 0) { - return this.$message.warning('除数不能为0!') + break; + case "commission": + this.batchData.extension_one = this.batchData.extension_one || 0; + this.batchData.extension_two = this.batchData.extension_two || 0; + break; + case "price": + if ( + this.batchData.price_type == "div" && + this.batchData.price_number == 0 + ) { + return this.$message.warning("除数不能为0!"); } - break + break; } - const parmas = this.batchData - parmas.batch_type = this.batchName + const parmas = this.batchData; + parmas.batch_type = this.batchName; if (this.allCheck) { - parmas.batch_select_type = 'all' - parmas.where = this.tableFrom + parmas.batch_select_type = "all"; + parmas.where = this.tableFrom; } else { - parmas.batch_select_type = 'select' - parmas.ids = this.checkedIds + parmas.batch_select_type = "select"; + parmas.ids = this.checkedIds; } - batchSetProduct(parmas).then((res) => { - this.batchModal = false - this.$message.success(res.message) - }) - .catch((res) => { - this.$message.error(res.message) + batchSetProduct(parmas) + .then(res => { + this.batchModal = false; + this.$message.success(res.message); }) + .catch(res => { + this.$message.error(res.message); + }); }, handleSelectionChange(val) { - this.multipleSelection = val - const data = [] - this.multipleSelection.map((item) => { - data.push(item.product_id) - }) - this.product_ids = data + this.multipleSelection = val; + const data = []; + this.multipleSelection.map(item => { + data.push(item.product_id); + }); + this.product_ids = data; }, productCon() { productConfigApi() .then(res => { - this.configData = res.data - this.is_audit = res.data.is_audit - this.open_svip = res.data.mer_svip_status == 1 && res.data.svip_switch_status == 1 - this.deliveryType = res.data.delivery_way.map(String) + this.configData = res.data; + this.is_audit = res.data.is_audit; + this.open_svip = + res.data.mer_svip_status == 1 && res.data.svip_switch_status == 1; + this.deliveryType = res.data.delivery_way.map(String); if (this.deliveryType.length == 2) { this.deliveryList = [ - { value: '1', name: '到店自提' }, - { value: '2', name: '快递配送' } - ] + { value: "1", name: "到店自提" }, + { value: "2", name: "快递配送" } + ]; } else { - if (this.deliveryType.length == 1 && this.deliveryType[0] == '1') { - this.deliveryList = [ - { value: '1', name: '到店自提' } - ] + if (this.deliveryType.length == 1 && this.deliveryType[0] == "1") { + this.deliveryList = [{ value: "1", name: "到店自提" }]; } else { - this.deliveryList = [ - { value: '2', name: '快递配送' } - ] + this.deliveryList = [{ value: "2", name: "快递配送" }]; } } }) .catch(res => { - this.$message.error(res.message) - }) + this.$message.error(res.message); + }); }, // 系统表单下拉数据 getFormList() { associatedFormList() .then(res => { - this.formList = res.data + this.formList = res.data; }) .catch(res => { - this.$message.error(res.message) - }) + this.$message.error(res.message); + }); }, // 关联的表单信息 getFormInfo() { if (this.batchData.mer_form_id) { - associatedFormInfo(this.batchData.mer_form_id).then((res) => { - this.formData = res.data - }) - .catch((res) => { - this.$message.error(res.message) + associatedFormInfo(this.batchData.mer_form_id) + .then(res => { + this.formData = res.data; }) + .catch(res => { + this.$message.error(res.message); + }); } else { - this.formData = [] + this.formData = []; } }, getSuccess() { - this.getLstFilterApi() - this.getList(1) + this.getLstFilterApi(); + this.getList(1); }, handleClose() { - this.dialogLabel = false + this.dialogLabel = false; }, handleFreightClose() { - this.dialogFreight = false + this.dialogFreight = false; }, // 添加淘宝商品成功 onClose() { - this.modals = false + this.modals = false; }, // 复制淘宝 onCopy() { this.$router.push({ - path: this.roterPre + '/product/list/addProduct', + path: this.roterPre + "/product/list/addProduct", query: { type: 1 } - }) + }); }, // 打开批量设置弹窗 openBatch() { - this.batchModal = true + this.batchModal = true; }, // 获取标签项 getLabelLst() { - getProductLabelApi().then(res => { - this.labelList = res.data - }) - .catch(res => { - this.$message.error(res.message) + getProductLabelApi() + .then(res => { + this.labelList = res.data; }) + .catch(res => { + this.$message.error(res.message); + }); }, // 获取运费模板 getTempLst() { - shippingListApi().then(res => { - this.tempList = res.data - }) - .catch(res => { - this.$message.error(res.message) + shippingListApi() + .then(res => { + this.tempList = res.data; }) + .catch(res => { + this.$message.error(res.message); + }); }, // 免审编辑 onAuditFree(row) { - this.$refs.editAttr.getAttrDetail(row.product_id) + this.$refs.editAttr.getAttrDetail(row.product_id); }, // 批量设置佣金 batchCommision() { // if(this.multipleSelection.length === 0) return this.$message.warning('请先选择商品') - this.dialogCommision = true + this.dialogCommision = true; }, // 批量设置会员价 batchSvip() { - if (this.multipleSelection.length === 0) return this.$message.warning('请先选择商品') - this.dialogSvip = true + if (this.multipleSelection.length === 0) + return this.$message.warning("请先选择商品"); + this.dialogSvip = true; }, submitCommisionForm(name) { this.$refs[name].validate(valid => { if (valid) { - this.commisionForm.ids = this.product_ids + this.commisionForm.ids = this.product_ids; productBathExtApi(this.commisionForm).then(({ message }) => { - this.$message.success(message) - this.getList('') - this.dialogCommision = false - }) + this.$message.success(message); + this.getList(""); + this.dialogCommision = false; + }); } else { - return + return; } - }) + }); }, // 提交会员价 submitSvipForm(name) { - this.svipForm.ids = this.product_ids + this.svipForm.ids = this.product_ids; productBathSvipApi(this.svipForm).then(({ message }) => { - this.$message.success(message) - this.getList('') - this.dialogSvip = false - }) + this.$message.success(message); + this.getList(""); + this.dialogSvip = false; + }); }, // 批量上架 batchShelf() { - if (this.checkedIds.length === 0 && !this.allCheck) return this.$message.warning('请先选择商品') - let ids = [] + if (this.checkedIds.length === 0 && !this.allCheck) + return this.$message.warning("请先选择商品"); + let ids = []; if (this.allCheck) { - this.tableData.data.map((item) => { - ids.push(item.product_id) - }) + this.tableData.data.map(item => { + ids.push(item.product_id); + }); } else { - ids = this.checkedIds + ids = this.checkedIds; } - const data = { status: 1, ids: ids } - batchesOnOffApi(data).then(res => { - this.$message.success(res.message) - this.getLstFilterApi() - this.getList('') - }) - .catch(res => { - this.$message.error(res.message) + const data = { status: 1, ids: ids }; + batchesOnOffApi(data) + .then(res => { + this.$message.success(res.message); + this.getLstFilterApi(); + this.getList(""); }) + .catch(res => { + this.$message.error(res.message); + }); }, // 批量下架 batchOff() { - if (this.checkedIds.length === 0 && !this.allCheck) return this.$message.warning('请先选择商品') - let ids = [] + if (this.checkedIds.length === 0 && !this.allCheck) + return this.$message.warning("请先选择商品"); + let ids = []; if (this.allCheck) { - this.tableData.data.map((item) => { - ids.push(item.product_id) - }) + this.tableData.data.map(item => { + ids.push(item.product_id); + }); } else { - ids = this.checkedIds + ids = this.checkedIds; } - const data = { status: 0, ids: ids } - batchesOnOffApi(data).then(res => { - this.$message.success(res.message) - this.getLstFilterApi() - this.getList('') - }) - .catch(res => { - this.$message.error(res.message) + const data = { status: 0, ids: ids }; + batchesOnOffApi(data) + .then(res => { + this.$message.success(res.message); + this.getLstFilterApi(); + this.getList(""); }) + .catch(res => { + this.$message.error(res.message); + }); }, // 批量设置标签 batchLabel() { this.labelForm = { mer_labels: [], ids: this.product_ids - } - this.isBatch = true - this.dialogLabel = true + }; + this.isBatch = true; + this.dialogLabel = true; }, // 批量设置运费模板 batchFreight() { - this.dialogFreight = true + this.dialogFreight = true; }, submitTempForm(name) { this.$refs[name].validate(valid => { if (valid) { - this.tempForm.ids = this.product_ids + this.tempForm.ids = this.product_ids; batchesTempApi(this.tempForm).then(({ message }) => { - this.$message.success(message) - this.getList('') - this.dialogFreight = false - }) + this.$message.success(message); + this.getList(""); + this.dialogFreight = false; + }); } else { - return + return; } - }) + }); }, handleRestore(id) { - this.$modalSure('恢复商品').then(() => { + this.$modalSure("恢复商品").then(() => { restoreApi(id) .then(res => { - this.$message.success(res.message) - this.getLstFilterApi() - this.getList('') + this.$message.success(res.message); + this.getLstFilterApi(); + this.getList(""); }) .catch(res => { - this.$message.error(res.message) - }) - }) + this.$message.error(res.message); + }); + }); }, // 预览 handlePreview(id) { - this.previewVisible = true - this.goodsId = id - this.previewKey = '' + this.previewVisible = true; + this.goodsId = id; + this.previewKey = ""; }, // 查看详情 onDetails(id) { - this.product_id = id - this.drawer = true - this.$refs.proDetail.getInfo(id) + this.product_id = id; + this.drawer = true; + this.$refs.proDetail.getInfo(id); }, changeDrawer(v) { - this.drawer = v + this.drawer = v; }, closeDrawer() { - this.drawer = false + this.drawer = false; }, // 商户分类; getCategorySelect() { categorySelectApi() .then(res => { - this.merCateList = res.data + this.merCateList = res.data; }) .catch(res => { - this.$message.error(res.message) - }) + this.$message.error(res.message); + }); }, // 平台分类; getCategoryList() { categoryListApi() .then(res => { - this.categoryList = res.data + this.categoryList = res.data; }) .catch(res => { - this.$message.error(res.message) - }) + this.$message.error(res.message); + }); }, // 顶部切换并初始化选择的商品 getProduct() { - this.getList() - this.changeType() + this.getList(); + this.changeType(); }, // 列表表头; getLstFilterApi() { lstFilterApi() .then(res => { - this.headeNum = res.data + this.headeNum = res.data; }) .catch(res => { - this.$message.error(res.message) - }) + this.$message.error(res.message); + }); }, // 列表 getList(num) { - this.listLoading = true - this.tableFrom.page = num || this.tableFrom.page + this.listLoading = true; + this.tableFrom.page = num || this.tableFrom.page; productLstApi(this.tableFrom) .then(res => { - this.tableData.data = res.data.list - this.tableData.total = res.data.count - this.listLoading = false + this.tableData.data = res.data.list; + this.tableData.total = res.data.count; + this.listLoading = false; }) .catch(res => { - this.listLoading = false - this.$message.error(res.message) - }) - this.getLstFilterApi() + this.listLoading = false; + this.$message.error(res.message); + }); + this.getLstFilterApi(); }, pageChange(page) { - this.tableFrom.page = page - this.getList('') + this.tableFrom.page = page; + this.getList(""); }, handleSizeChange(val) { - this.tableFrom.limit = val - this.getList('') + this.tableFrom.limit = val; + this.getList(""); }, // 删除 handleDelete(id, idx) { - this.$modalSure(this.tableFrom.type !== '5' ? '加入回收站' : '删除该商品').then( - () => { - this.tableFrom.type === '5' - ? destoryApi(id) + this.$modalSure( + this.tableFrom.type !== "5" ? "加入回收站" : "删除该商品" + ).then(() => { + this.tableFrom.type === "5" + ? destoryApi(id) .then(({ message }) => { - this.$message.success(message) - this.getList('') - this.getLstFilterApi() + this.$message.success(message); + this.getList(""); + this.getLstFilterApi(); }) .catch(({ message }) => { - this.$message.error(message) + this.$message.error(message); }) - : productDeleteApi(id) + : productDeleteApi(id) .then(({ message }) => { - this.$message.success(message) - this.getList('') - this.getLstFilterApi() + this.$message.success(message); + this.getList(""); + this.getLstFilterApi(); }) .catch(({ message }) => { - this.$message.error(message) - }) - } - ) + this.$message.error(message); + }); + }); }, // 编辑标签 onEditLabel(row) { - this.dialogLabel = true - this.product_id = row.product_id + this.dialogLabel = true; + this.product_id = row.product_id; this.labelForm = { mer_labels: row.mer_labels - } + }; }, submitForm(name) { this.$refs[name].validate(valid => { if (valid) { - this.isBatch ? batchesLabelsApi(this.labelForm).then(({ message }) => { - this.$message.success(message) - this.getList('') - this.dialogLabel = false - this.isBatch = false - }) - : updatetProductLabel(this.product_id, this.labelForm).then(({ message }) => { - this.$message.success(message) - this.getList('') - this.dialogLabel = false - }) + this.isBatch + ? batchesLabelsApi(this.labelForm).then(({ message }) => { + this.$message.success(message); + this.getList(""); + this.dialogLabel = false; + this.isBatch = false; + }) + : updatetProductLabel(this.product_id, this.labelForm).then( + ({ message }) => { + this.$message.success(message); + this.getList(""); + this.dialogLabel = false; + } + ); } else { - return + return; } - }) + }); }, onchangeIsShow(row) { statusApi(row.product_id, row.is_show) .then(({ message }) => { - this.$message.success(message) - this.getList('') - this.getLstFilterApi() + this.$message.success(message); + this.getList(""); + this.getLstFilterApi(); }) .catch(({ message }) => { - this.$message.error(message) - }) + this.$message.error(message); + }); } } -} +}; </script> <style scoped lang="scss"> @@ -1261,24 +1609,24 @@ export default { .check { color: #00a2d4; } -.spBlock{ +.spBlock { display: block; cursor: pointer; } -.tags_name{ +.tags_name { font-size: 10px; height: 16px; line-height: 16px; padding: 0 2px; margin-right: 2px; - &.name0{ + &.name0 { color: var(--prev-color-primary); } - &.name1{ - color: #FF8A4D; + &.name1 { + color: #ff8a4d; } } -.member-link{ +.member-link { color: var(--prev-color-primary); } .goods_detail .goods_detail_wrapper { @@ -1307,16 +1655,16 @@ export default { .el-icon-arrow-down { font-size: 12px; } -::v-deep .batch-tab .el-tabs__item{ +::v-deep .batch-tab .el-tabs__item { padding-left: 0; height: 50px; line-height: 50px; } -.batch-tab .el-tabs{ +.batch-tab .el-tabs { display: flex; align-items: center; } -::v-deep .batch-tab .el-tabs__content{ +::v-deep .batch-tab .el-tabs__content { min-width: 560px; } </style> diff --git a/src/views/product/productList/proDetails.vue b/src/views/product/productList/proDetails.vue index 33841aa..a30cea4 100644 --- a/src/views/product/productList/proDetails.vue +++ b/src/views/product/productList/proDetails.vue @@ -21,11 +21,19 @@ <ul class="list"> <li class="item"> <div class="title">商品类型</div> - <div>{{productData.type == 0 ? '普通商品' : productData.type == 1 ? '虚拟商品' : '卡密商品' }}</div> + <div> + {{ + productData.type == 0 + ? "普通商品" + : productData.type == 1 + ? "虚拟商品" + : "卡密商品" + }} + </div> </li> <li class="item"> <div class="title">商品状态</div> - <div>{{ productData.status == 1 ? '上架显示' : '下架' }}</div> + <div>{{ productData.status == 1 ? "上架显示" : "下架" }}</div> </li> <li class="item"> <div class="title">销量</div> @@ -48,80 +56,149 @@ <li class="item item100"> <div class="item-title">封面图:</div> <el-image - style="width: 60px; height: 60px" - :src="productData.image" - :preview-src-list="[productData.image]" - /> + style="width: 60px; height: 60px" + :src="productData.image" + :preview-src-list="[productData.image]" + /> <!-- <img :src="productData.image" style="width:40px;height:40px;margin-right:12px;"/> --> </li> <li class="item item100"> <div class="item-title">轮播图:</div> <el-image - v-for="(pic,idx) in productData.slider_image" - style="width: 60px; height: 60px" - :key="idx" - :src="pic" - :preview-src-list="productData.slider_image" - /> + v-for="(pic, idx) in productData.slider_image" + style="width: 60px; height: 60px" + :key="idx" + :src="pic" + :preview-src-list="productData.slider_image" + /> <!-- <img v-for="(pic,idx) in productData.slider_image" :key="idx" :src="pic" style="width:40px;height:40px;margin-right:12px;"/> --> - </li> + </li> </ul> <li class="item item100"> <div class="item-title">商品简介:</div> - <div class="value">{{productData.store_info || '-'}}</div> - </li> + <div class="value">{{ productData.store_info || "-" }}</div> + </li> <ul class="list"> <li class="item"> <div class="item-title">平台分类:</div> - <div class="value">{{productData.storeCategory&&productData.storeCategory.cate_name || '-'}}</div> + <div class="value"> + {{ + (productData.storeCategory && + productData.storeCategory.cate_name) || + "-" + }} + </div> </li> - <li v-if="productData.merCateId&&productData.merCateId.length>0" class="item"> + <li + v-if=" + productData.merCateId && productData.merCateId.length > 0 + " + class="item" + > <div class="item-title">商户分类:</div> <div v-if="productData.merCateId.length" class="value"> - <span v-for="item in productData.merCateId" :key="item.mer_cate_id">{{item.category&&item.category.cate_name}} </span> + <span + v-for="item in productData.merCateId" + :key="item.mer_cate_id" + >{{ + item.category && item.category.cate_name + }} </span + > </div> <div v-else class="value"><span>-</span></div> </li> <li class="item"> <div class="item-title">商品标签:</div> - <div v-if="(productData.mer_labels&&productData.mer_labels_data.length) || (productData.sys_labels_data&&productData.sys_labels_data.length)" class="value"> - <template v-if="productData.mer_labels_data&&productData.mer_labels_data.length"> - <span v-for="(item,index) in productData.mer_labels_data" :key="index" class="value-item"> {{item}} </span> + <div + v-if=" + (productData.mer_labels && + productData.mer_labels_data.length) || + (productData.sys_labels_data && + productData.sys_labels_data.length) + " + class="value" + > + <template + v-if=" + productData.mer_labels_data && + productData.mer_labels_data.length + " + > + <span + v-for="(item, index) in productData.mer_labels_data" + :key="index" + class="value-item" + > + {{ item }} + </span> </template> - <template v-if="productData.sys_labels_data&&productData.sys_labels_data.length"> - <span v-for="(item,index) in productData.sys_labels_data" :key="index" class="value-item"> {{item}} </span> + <template + v-if=" + productData.sys_labels_data && + productData.sys_labels_data.length + " + > + <span + v-for="(item, index) in productData.sys_labels_data" + :key="index" + class="value-item" + > + {{ item }} + </span> </template> </div> <div v-else class="value"><span>-</span></div> </li> <li class="item"> <div class="item-title">品牌选择:</div> - <div class="value">{{productData.brand&&productData.brand.brand_name || '其它'}}</div> + <div class="value"> + {{ + (productData.brand && productData.brand.brand_name) || + "其它" + }} + </div> </li> <li class="item"> <div class="item-title">单位:</div> - <div class="value">{{productData.unit_name || '-'}}</div> + <div class="value">{{ productData.unit_name || "-" }}</div> </li> <li class="item"> <div class="item-title">关键字:</div> - <div class="value">{{productData.keyword || '-'}}</div> + <div class="value">{{ productData.keyword || "-" }}</div> </li> <li class="item"> <div class="item-title">配送方式:</div> - <template v-if="productData.type==0"> - <div v-if="productData.delivery_way.length==2" class="value">快递/到店自提</div> - <div v-else-if="productData.delivery_way.length==1">{{productData.delivery_way[0]==1 ? "到店自提" : "快递"}}</div> + <template v-if="productData.type == 0"> + <div + v-if="productData.delivery_way.length == 2" + class="value" + > + 快递/到店自提 + </div> + <div v-else-if="productData.delivery_way.length == 1"> + {{ + productData.delivery_way[0] == 1 ? "到店自提" : "快递" + }} + </div> </template> <template v-else> - <div v-if="productData.type == 1" class="value">虚拟发货</div> - <div v-else-if="productData.type == 2" class="value">卡密发货</div> + <div v-if="productData.type == 1" class="value"> + 虚拟发货 + </div> + <div v-else-if="productData.type == 2" class="value"> + 卡密发货 + </div> </template> </li> </ul> <ul v-if="productData.video_link" class="list"> <li class="item item100"> <div class="item-title">主图视频:</div> - <video style="width:300px;height: 150px;border-radius: 10px;" :src="productData.video_link" controls="controls"> + <video + style="width:300px;height: 150px;border-radius: 10px;" + :src="productData.video_link" + controls="controls" + > 您的浏览器不支持 video 标签。 </video> </li> @@ -139,33 +216,52 @@ <div class="item-title">付费会员价:</div> <div class="value">{{productData.svip_price_type==0 ? '不设置会员价' : productData.svip_price_type==1 ? '默认设置会员价' : '自定义设置会员价'}}</div> </li> --> - <li class="item"> + <li class="item"> <div class="item-title">规格:</div> - <div class="value">{{productData.spec_type == 1 ? "多规格" : "单规格"}}</div> + <div class="value"> + {{ productData.spec_type == 1 ? "多规格" : "单规格" }} + </div> </li> <li class="item item100"> <div class="item-title">佐证图片:</div> - <el-image v-for="(item,index) in productData.status_img" :key="index" :src="item" style="width:40px;height:40px;margin-right:12px;" :preview-src-list="productData.status_img" /> - </li> + <el-image + v-for="(item, index) in productData.status_img" + :key="index" + :src="item" + style="width:40px;height:40px;margin-right:12px;" + :preview-src-list="productData.status_img" + /> + </li> </ul> </div> <div class="section" style="margin-top: 50px;"> <div class="title">规格列表:</div> <div class="list"> <template v-if="productData.spec_type === 0"> - <el-table :data="OneattrValue" border class="tabNumWidth ones" size="mini"> + <el-table + :data="OneattrValue" + border + class="tabNumWidth ones" + size="mini" + > <el-table-column align="center" label="图片" min-width="80"> <template slot-scope="scope"> - <div class="pictrue tabPic"> - <el-image + <div class="pictrue tabPic"> + <el-image style="width: 60px; height: 60px" :src="scope.row.image" :preview-src-list="[scope.row.image]" /> - </div> + </div> </template> </el-table-column> - <el-table-column v-for="(item,iii) in attrValue" :key="iii" :label="formThead[iii].title" align="center" min-width="80"> + <el-table-column + v-for="(item, iii) in attrValue" + :key="iii" + :label="formThead[iii].title" + align="center" + min-width="80" + > <template slot-scope="scope"> <a v-if="formThead[iii].title == '依据链接'" @@ -177,34 +273,70 @@ </template> </el-table-column> <template v-if="productData.extension_type === 1"> - <el-table-column align="center" label="一级返佣(元)" min-width="100"> + <el-table-column + align="center" + label="一级返佣(元)" + min-width="100" + > <template slot-scope="scope"> - <span class="priceBox" v-text="scope.row.extension_one" /> + <span + class="priceBox" + v-text="scope.row.extension_one" + /> </template> </el-table-column> - <el-table-column align="center" label="二级返佣(元)" min-width="100"> + <el-table-column + align="center" + label="二级返佣(元)" + min-width="100" + > <template slot-scope="scope"> - <span class="priceBox" v-text="scope.row.extension_two" /> + <span + class="priceBox" + v-text="scope.row.extension_two" + /> </template> </el-table-column> </template> </el-table> </template> <template v-if="productData.spec_type === 1"> - <el-table :data="ManyAttrValue" border class="tabNumWidth ones" size="mini"> - <template v-if="manyTabDate"> - <el-table-column v-for="(item,iii) in manyTabDate" :key="iii" align="center" :label="manyTabTit[iii].title" min-width="100"> - <template slot-scope="scope"> - <span class="priceBox" v-text="scope.row[iii]" /> - </template> - </el-table-column> - </template> + <el-table + :data="ManyAttrValue" + border + class="tabNumWidth ones" + size="mini" + > + <template v-if="manyTabDate"> + <el-table-column + v-for="(item, iii) in manyTabDate" + :key="iii" + align="center" + :label="manyTabTit[iii].title" + min-width="100" + > + <template slot-scope="scope"> + <span class="priceBox" v-text="scope.row[iii]" /> + </template> + </el-table-column> + </template> <el-table-column align="center" label="图片" min-width="80"> - <template slot-scope="scope"> - <div class="pictrue tabPic"><img :src="scope.row.image" style="width: 36px; height: 36px; border-radius: 4px;"></div> + <template slot-scope="scope"> + <div class="pictrue tabPic"> + <img + :src="scope.row.image" + style="width: 36px; height: 36px; border-radius: 4px;" + /> + </div> </template> </el-table-column> - <el-table-column v-for="(item,iii) in attrValue" :key="iii" :label="formThead[iii].title" align="center" min-width="80"> + <el-table-column + v-for="(item, iii) in attrValue" + :key="iii" + :label="formThead[iii].title" + align="center" + min-width="80" + > <template slot-scope="scope"> <a v-if="formThead[iii].title == '依据链接'" @@ -212,18 +344,32 @@ target="_blank" >{{ scope.row[iii] }}</a > - <span v-else class="priceBox">{{ scope.row[iii] }}</span> + <span v-else class="priceBox">{{ + scope.row[iii] + }}</span> </template> </el-table-column> <template v-if="productData.extension_type === 1"> - <el-table-column align="center" label="一级返佣(元)" min-width="80"> + <el-table-column + align="center" + label="一级返佣(元)" + min-width="80" + > <template slot-scope="scope"> - <span class="priceBox">{{ scope.row.extension_one }}</span> + <span class="priceBox">{{ + scope.row.extension_one + }}</span> </template> </el-table-column> - <el-table-column align="center" label="二级返佣(元)" min-width="80"> + <el-table-column + align="center" + label="二级返佣(元)" + min-width="80" + > <template slot-scope="scope"> - <span class="priceBox">{{ scope.row.extension_two }}</span> + <span class="priceBox">{{ + scope.row.extension_two + }}</span> </template> </el-table-column> </template> @@ -234,7 +380,7 @@ </el-tab-pane> <el-tab-pane label="商品详情" name="detail"> <div class="section"> - <div class="contentPic" v-html="productData.content"/> + <div class="contentPic" v-html="productData.content" /> </div> </el-tab-pane> <el-tab-pane label="营销信息" name="marketing"> @@ -242,7 +388,9 @@ <ul class="list"> <li class="item"> <div class="item-title">店铺推荐:</div> - <div class="value">{{productData.is_good ? '是' : '否'}}</div> + <div class="value"> + {{ productData.is_good ? "是" : "否" }} + </div> </li> <li v-if="productData.is_gift_bag" class="item"> <div class="item-title">平台推荐:</div> @@ -253,11 +401,27 @@ </li> <li v-else class="item"> <div class="item-title">平台推荐:</div> - <div v-if="productData.is_benefit||productData.is_new||productData.is_best||productData.is_hot" class="value"> - <span class="value-item" v-if="productData.is_benefit">特惠专区</span> - <span class="value-item" v-if="productData.is_new">首发新品</span> - <span class="value-item" v-if="productData.is_best">精品推荐</span> - <span class="value-item" v-if="productData.is_hot">热门榜单</span> + <div + v-if=" + productData.is_benefit || + productData.is_new || + productData.is_best || + productData.is_hot + " + class="value" + > + <span class="value-item" v-if="productData.is_benefit" + >特惠专区</span + > + <span class="value-item" v-if="productData.is_new" + >首发新品</span + > + <span class="value-item" v-if="productData.is_best" + >精品推荐</span + > + <span class="value-item" v-if="productData.is_hot" + >热门榜单</span + > </div> <div v-else class="value-item">无</div> </li> @@ -268,40 +432,64 @@ <li v-if="productData.star" class="item"> <div class="item-title">平台推荐星级:</div> <div class="value"> - <el-rate disabled v-model="productData.star" :colors="colors"></el-rate> + <el-rate + disabled + v-model="productData.star" + :colors="colors" + ></el-rate> </div> </li> <li v-if="configData.integral_status" class="item"> <div class="item-title">积分抵扣比例:</div> - <div v-if="productData.integral_rate == -1" class="value">默认设置{{'('+configData.integral_rate+'%)'}}</div> - <div v-else-if="productData.integral_rate >= 0" class="value">单独设置{{'('+productData.integral_rate+'%)'}}</div> + <div v-if="productData.integral_rate == -1" class="value"> + 默认设置{{ "(" + configData.integral_rate + "%)" }} + </div> + <div v-else-if="productData.integral_rate >= 0" class="value"> + 单独设置{{ "(" + productData.integral_rate + "%)" }} + </div> </li> <li v-if="configData.integral_status" class="item"> <div class="item-title">积分抵扣金额:</div> - <div class="value">{{productData.integral_price_total}}元</div> + <div class="value"> + {{ productData.integral_price_total }}元 + </div> </li> - <li v-if="productData.coupon&&productData.coupon.length>0" class="item"> + <li + v-if="productData.coupon && productData.coupon.length > 0" + class="item" + > <div class="item-title">优惠券(赠送券):</div> <div class="value"> - <span v-for="(itm,idx) in productData.coupon" :key="idx" class="value-item"> {{itm.title}} </span> + <span + v-for="(itm, idx) in productData.coupon" + :key="idx" + class="value-item" + > + {{ itm.title }} + </span> </div> </li> <li class="item"> <div class="item-title">收藏人数:</div> <div class="value"> - <span> {{productData.care_count}}人</span> + <span> {{ productData.care_count }}人</span> </div> </li> <li class="item"> <div class="item-title">已售数量:</div> <div class="value"> - <span> {{productData.ficti}} (指手动添加数量)</span> + <span> {{ productData.ficti }} (指手动添加数量)</span> </div> </li> <li class="item"> <div class="item-title">实际销量 :</div> <div class="value"> - <span> {{productData.sales-productData.ficti}} (指实际售出数量)</span> + <span> + {{ + productData.sales - productData.ficti + }} + (指实际售出数量)</span + > </div> </li> </ul> @@ -311,13 +499,25 @@ <div class="section"> <ul class="list"> <li class="audit" v-if="productData.refusal"> - <div class="item-title">{{productData.status==0?'锁定原因':'审核拒绝原因'}}:</div> - <div style="margin-left: 100px;" class="value">{{productData.refusal || ''}}</div> + <div class="item-title"> + {{ + productData.status == 0 ? "锁定原因" : "审核拒绝原因" + }}: + </div> + <div style="margin-left: 100px;" class="value"> + {{ productData.refusal || "" }} + </div> </li> - <li class="item item100" v-if="productData.status!=0"> + <li class="item item100" v-if="productData.status != 0"> <div class="item-title">佐证图片:</div> - <el-image v-for="(item,index) in productData.status_img" :key="index" :src="item" style="width:40px;height:40px;margin-right:12px;" :preview-src-list="productData.status_img" /> - </li> + <el-image + v-for="(item, index) in productData.status_img" + :key="index" + :src="item" + style="width:40px;height:40px;margin-right:12px;" + :preview-src-list="productData.status_img" + /> + </li> </ul> </div> </el-tab-pane> @@ -326,22 +526,55 @@ <ul class="list"> <li class="item"> <div class="item-title">支持退款:</div> - <div class="value">{{productData.refund_switch ? '是' : '否'}}</div> + <div class="value"> + {{ productData.refund_switch ? "是" : "否" }} + </div> + </li> + <li class="item"> + <div class="item-title">是否定制:</div> + <div class="value"> + {{ productData.is_customize ? "是" : "否" }} + </div> </li> <li class="item"> <div class="item-title">最少购买件数:</div> - <div class="value">{{productData.once_min_count == 0 ? '不限购' : productData.once_min_count}}</div> + <div class="value"> + {{ + productData.once_min_count == 0 + ? "不限购" + : productData.once_min_count + }} + </div> </li> - <li v-if="productData.pay_limit!=0" class="item"> + <li v-if="productData.pay_limit != 0" class="item"> <div class="item-title">限购类型:</div> - <div class="value">{{productData.pay_limit==1?'单次限购':'长期限购'}}{{productData.once_max_count+'('+productData.unit_name+')'}}</div> + <div class="value"> + {{ productData.pay_limit == 1 ? "单次限购" : "长期限购" + }}{{ + productData.once_max_count + + "(" + + productData.unit_name + + ")" + }} + </div> </li> <li v-if="productData.guarantee" class="item item100"> <div class="item-title">保障服务:</div> <div class="value" style="width: 250px;"> - <span>{{productData.guarantee.template_name}}</span> - <div v-if="productData.guarantee.templateValue && productData.guarantee.templateValue.length>0" style="display: inline;"> - 【<span v-for="(item,i) in productData.guarantee.templateValue" :key="i" class="value-temp">{{item.value&&item.value.guarantee_name}}</span>】 + <span>{{ productData.guarantee.template_name }}</span> + <div + v-if=" + productData.guarantee.templateValue && + productData.guarantee.templateValue.length > 0 + " + style="display: inline;" + > + 【<span + v-for="(item, i) in productData.guarantee.templateValue" + :key="i" + class="value-temp" + >{{ item.value && item.value.guarantee_name }}</span + >】 </div> </div> </li> @@ -370,12 +603,16 @@ width="360" > <template slot-scope="scope"> - <span>{{scope.row.name}}</span> + <span>{{ scope.row.name }}</span> </template> </el-table-column> - <el-table-column align="center" label="参数值" width="360"> + <el-table-column + align="center" + label="参数值" + width="360" + > <template slot-scope="scope"> - <span>{{scope.row.value}}</span> + <span>{{ scope.row.value }}</span> </template> </el-table-column> </el-table> @@ -398,12 +635,16 @@ width="360" > <template slot-scope="scope"> - <span>{{scope.row.name}}</span> + <span>{{ scope.row.name }}</span> </template> </el-table-column> - <el-table-column align="center" label="参数值" width="360"> + <el-table-column + align="center" + label="参数值" + width="360" + > <template slot-scope="scope"> - <span>{{scope.row.value}}</span> + <span>{{ scope.row.value }}</span> </template> </el-table-column> </el-table> @@ -421,217 +662,309 @@ </div> </el-tab-pane> <el-tab-pane label="资质信息" name="aptitude"> - <span class="sp">商品名称: - <el-radio-group v-model="qualification.commodity_type"> - <el-radio :label="0" class="radio" :disabled="qualification.commodity_type==1">国产</el-radio> - <el-radio :label="1" :disabled="qualification.commodity_type==0">进口</el-radio> - </el-radio-group> - </span> - <div v-if="qualification.commodity_type == 0"> - <span class="sp">生产企业名称:{{ qualification.production_name }}</span> - <span class="upload"> - <div class="upload_left">生产营业执照:</div> - <div class="upload_right"> - <div - v-for="(item,index) in qualification.businessList" - :key="index" - > - <a class="txt" v-if="getType(item)" :href="item.url" target="downloadFile" download>{{ item.name }}</a> - <div class="pictrue" v-else> - <el-image - style="width: 60px; height: 60px;" - :src="item.url" - :preview-src-list="[item.url]" - /> - </div> + <span class="sp" + >商品名称: + <el-radio-group v-model="qualification.commodity_type"> + <el-radio + :label="0" + class="radio" + :disabled="qualification.commodity_type == 1" + >国产</el-radio + > + <el-radio + :label="1" + :disabled="qualification.commodity_type == 0" + >进口</el-radio + > + </el-radio-group> + </span> + <div v-if="qualification.commodity_type == 0"> + <span class="sp" + >生产企业名称:{{ qualification.production_name }}</span + > + <span class="upload"> + <div class="upload_left">生产营业执照:</div> + <div class="upload_right"> + <div + v-for="(item, index) in qualification.businessList" + :key="index" + > + <a + class="txt" + v-if="getType(item)" + :href="item.url" + target="downloadFile" + download + >{{ item.name }}</a + > + <div class="pictrue" v-else> + <el-image + style="width: 60px; height: 60px;" + :src="item.url" + :preview-src-list="[item.url]" + /> + </div> + </div> + </div> + </span> + <span class="upload"> + <div class="upload_left">生产许可证:</div> + <div class="upload_right"> + <div + v-for="(item, index) in qualification.licenceList" + :key="index" + > + <a + class="txt" + v-if="getType(item)" + :href="item.url" + target="downloadFile" + download + >{{ item.name }}</a + > + <div class="pictrue" v-else> + <el-image + style="width: 60px; height: 60px;" + :src="item.url" + :preview-src-list="[item.url]" + /> + </div> + </div> + </div> + </span> + <span class="upload"> + <div class="upload_left">商标注册证:</div> + <div class="upload_right"> + <div + v-for="(item, index) in qualification.trademarkList" + :key="index" + > + <a + class="txt" + v-if="getType(item)" + :href="item.url" + target="downloadFile" + download + >{{ item.name }}</a + > + <div class="pictrue" v-else> + <el-image + style="width: 60px; height: 60px;" + :src="item.url" + :preview-src-list="[item.url]" + /> + </div> + </div> + </div> + </span> + <span class="upload"> + <div class="upload_left">销售授权及品牌方营业执照:</div> + <div class="upload_right"> + <div + v-for="(item, index) in qualification.authorizedList" + :key="index" + > + <a + class="txt" + v-if="getType(item)" + :href="item.url" + target="downloadFile" + download + >{{ item.name }}</a + > + <div class="pictrue" v-else> + <el-image + style="width: 60px; height: 60px;" + :src="item.url" + :preview-src-list="[item.url]" + /> + </div> + </div> + </div> + </span> + <span class="upload"> + <div class="upload_left">商品检测报告及备案:</div> + <div class="upload_right"> + <div + v-for="(item, index) in qualification.commodityList" + :key="index" + > + <a + class="txt" + v-if="getType(item)" + :href="item.url" + target="downloadFile" + download + >{{ item.name }}</a + > + <div class="pictrue" v-else> + <el-image + style="width: 60px; height: 60px;" + :src="item.url" + :preview-src-list="[item.url]" + /> + </div> + </div> + </div> + </span> + <span class="upload"> + <div class="upload_left">其他资质:</div> + <div class="upload_right"> + <div + v-for="(item, index) in qualification.otherList" + :key="index" + > + <a + class="txt" + v-if="getType(item)" + :href="item.url" + target="downloadFile" + download + >{{ item.name }}</a + > + <div class="pictrue" v-else> + <el-image + style="width: 60px; height: 60px;" + :src="item.url" + :preview-src-list="[item.url]" + /> + </div> + </div> + </div> + </span> </div> - </div> - </span> - <span class="upload"> - <div class="upload_left">生产许可证:</div> - <div class="upload_right"> - <div - v-for="(item,index) in qualification.licenceList" - :key="index" - > - <a class="txt" v-if="getType(item)" :href="item.url" target="downloadFile" download>{{ item.name }}</a> - <div class="pictrue" v-else> - <el-image - style="width: 60px; height: 60px;" - :src="item.url" - :preview-src-list="[item.url]" - /> - </div> + <div v-if="qualification.commodity_type == 1"> + <span class="sp" + >进口/企业境内总代企业名称: + {{ qualification.import_name }}</span + > + <span class="upload"> + <div class="upload_left">生产营业执照:</div> + <div class="upload_right"> + <div + v-for="(item, index) in qualification.importBusinessList" + :key="index" + > + <a + class="txt" + v-if="getType(item)" + :href="item.url" + target="downloadFile" + download + >{{ item.name }}</a + > + <div class="pictrue" v-else> + <el-image + style="width: 60px; height: 60px;" + :src="item.url" + :preview-src-list="[item.url]" + /> + </div> + </div> + </div> + </span> + <span class="upload"> + <div class="upload_left">销售授权及其他:</div> + <div class="upload_right"> + <div + v-for="(item, index) in qualification.importAuthorizedList" + :key="index" + > + <a + class="txt" + v-if="getType(item)" + :href="item.url" + target="downloadFile" + download + >{{ item.name }}</a + > + <div class="pictrue" v-else> + <el-image + style="width: 60px; height: 60px;" + :src="item.url" + :preview-src-list="[item.url]" + /> + </div> + </div> + </div> + </span> + <span class="upload"> + <div class="upload_left">海关检验检疫证书及报关单:</div> + <div class="upload_right"> + <div + v-for="(item, index) in qualification.customsList" + :key="index" + > + <a + class="txt" + v-if="getType(item)" + :href="item.url" + target="downloadFile" + download + >{{ item.name }}</a + > + <div class="pictrue" v-else> + <el-image + style="width: 60px; height: 60px;" + :src="item.url" + :preview-src-list="[item.url]" + /> + </div> + </div> + </div> + </span> + <span class="upload"> + <div class="upload_left">产品外包装实物图:</div> + <div class="upload_right"> + <div + v-for="(item, index) in qualification.packingList" + :key="index" + > + <a + class="txt" + v-if="getType(item)" + :href="item.url" + target="downloadFile" + download + >{{ item.name }}</a + > + <div class="pictrue" v-else> + <el-image + style="width: 60px; height: 60px;" + :src="item.url" + :preview-src-list="[item.url]" + /> + </div> + </div> + </div> + </span> + <span class="upload"> + <div class="upload_left">其他资质:</div> + <div class="upload_right"> + <div + v-for="(item, index) in qualification.importOtherList" + :key="index" + > + <a + class="txt" + v-if="getType(item)" + :href="item.url" + target="downloadFile" + download + >{{ item.name }}</a + > + <div class="pictrue" v-else> + <el-image + style="width: 60px; height: 60px;" + :src="item.url" + :preview-src-list="[item.url]" + /> + </div> + </div> + </div> + </span> </div> - </div> - </span> - <span class="upload"> - <div class="upload_left">商标注册证:</div> - <div class="upload_right"> - <div - v-for="(item,index) in qualification.trademarkList" - :key="index" - > - <a class="txt" v-if="getType(item)" :href="item.url" target="downloadFile" download>{{ item.name }}</a> - <div class="pictrue" v-else> - <el-image - style="width: 60px; height: 60px;" - :src="item.url" - :preview-src-list="[item.url]" - /> - </div> - </div> - </div> - </span> - <span class="upload"> - <div class="upload_left">销售授权及品牌方营业执照:</div> - <div class="upload_right"> - <div - v-for="(item,index) in qualification.authorizedList" - :key="index" - > - <a class="txt" v-if="getType(item)" :href="item.url" target="downloadFile" download>{{ item.name }}</a> - <div class="pictrue" v-else> - <el-image - style="width: 60px; height: 60px;" - :src="item.url" - :preview-src-list="[item.url]" - /> - </div> - </div> - </div> - </span> - <span class="upload"> - <div class="upload_left">商品检测报告及备案:</div> - <div class="upload_right"> - <div - v-for="(item,index) in qualification.commodityList" - :key="index" - > - <a class="txt" v-if="getType(item)" :href="item.url" target="downloadFile" download>{{ item.name }}</a> - <div class="pictrue" v-else> - <el-image - style="width: 60px; height: 60px;" - :src="item.url" - :preview-src-list="[item.url]" - /> - </div> - </div> - </div> - </span> - <span class="upload"> - <div class="upload_left">其他资质:</div> - <div class="upload_right"> - <div - v-for="(item,index) in qualification.otherList" - :key="index" - > - <a class="txt" v-if="getType(item)" :href="item.url" target="downloadFile" download>{{ item.name }}</a> - <div class="pictrue" v-else> - <el-image - style="width: 60px; height: 60px;" - :src="item.url" - :preview-src-list="[item.url]" - /> - </div> - </div> - </div> - </span> - </div> - <div v-if="qualification.commodity_type == 1"> - <span class="sp">进口/企业境内总代企业名称: {{ qualification.import_name }}</span> - <span class="upload"> - <div class="upload_left">生产营业执照:</div> - <div class="upload_right"> - <div - v-for="(item,index) in qualification.importBusinessList" - :key="index" - > - <a class="txt" v-if="getType(item)" :href="item.url" target="downloadFile" download>{{ item.name }}</a> - <div class="pictrue" v-else> - <el-image - style="width: 60px; height: 60px;" - :src="item.url" - :preview-src-list="[item.url]" - /> - </div> - </div> - </div> - </span> - <span class="upload"> - <div class="upload_left">销售授权及其他:</div> - <div class="upload_right"> - <div - v-for="(item,index) in qualification.importAuthorizedList" - :key="index" - > - <a class="txt" v-if="getType(item)" :href="item.url" target="downloadFile" download>{{ item.name }}</a> - <div class="pictrue" v-else> - <el-image - style="width: 60px; height: 60px;" - :src="item.url" - :preview-src-list="[item.url]" - /> - </div> - </div> - </div> - </span> - <span class="upload"> - <div class="upload_left">海关检验检疫证书及报关单:</div> - <div class="upload_right"> - <div - v-for="(item,index) in qualification.customsList" - :key="index" - > - <a class="txt" v-if="getType(item)" :href="item.url" target="downloadFile" download>{{ item.name }}</a> - <div class="pictrue" v-else> - <el-image - style="width: 60px; height: 60px;" - :src="item.url" - :preview-src-list="[item.url]" - /> - </div> - </div> - </div> - </span> - <span class="upload"> - <div class="upload_left">产品外包装实物图:</div> - <div class="upload_right"> - <div - v-for="(item,index) in qualification.packingList" - :key="index" - > - <a class="txt" v-if="getType(item)" :href="item.url" target="downloadFile" download>{{ item.name }}</a> - <div class="pictrue" v-else> - <el-image - style="width: 60px; height: 60px;" - :src="item.url" - :preview-src-list="[item.url]" - /> - </div> - </div> - </div> - </span> - <span class="upload"> - <div class="upload_left">其他资质:</div> - <div class="upload_right"> - <div - v-for="(item,index) in qualification.importOtherList" - :key="index" - > - <a class="txt" v-if="getType(item)" :href="item.url" target="downloadFile" download>{{ item.name }}</a> - <div class="pictrue" v-else> - <el-image - style="width: 60px; height: 60px;" - :src="item.url" - :preview-src-list="[item.url]" - /> - </div> - </div> - </div> - </span> - </div> - </el-tab-pane> + </el-tab-pane> <!-- <el-tab-pane label="商品操作记录" name="records"> <div class="section"> <el-form size="small" label-width="80px"> @@ -714,116 +1047,120 @@ </div> </template> <script> - -import SettingMer from '@/libs/settingMer' -import { productDetailApi, operateRecordList, associatedFormInfo } from '@/api/product'; +import SettingMer from "@/libs/settingMer"; +import { + productDetailApi, + operateRecordList, + associatedFormInfo +} from "@/api/product"; const defaultObj = { - image: '', + image: "", slider_image: [], - store_name: '', - store_info: '', - keyword: '', - brand_id: '', // 品牌id - cate_id: '', // 平台分类id + store_name: "", + store_info: "", + keyword: "", + brand_id: "", // 品牌id + cate_id: "", // 平台分类id mer_cate_id: [], // 商户分类id - unit_name: '', + unit_name: "", sort: 0, is_show: 0, is_benefit: 0, is_new: 0, is_good: 0, - temp_id: '', + temp_id: "", params: [], - attrValue: [{ - image: '', - price: null, - svip_price: null, - proportion:'0.6', - coupon:'', - cost: null, - ot_price: null, - stock: null, - bar_code: '', - gist_url:'', - weight: null, - volume: null - }], + attrValue: [ + { + image: "", + price: null, + svip_price: null, + proportion: "0.6", + coupon: "", + cost: null, + ot_price: null, + stock: null, + bar_code: "", + gist_url: "", + weight: null, + volume: null + } + ], attr: [], - selectRule: '', + selectRule: "", extension_type: 0, - content: '', - spec_type: 0, - -} + content: "", + spec_type: 0 +}; const objTitle = { price: { - title: '售价' + title: "售价" }, svip_price: { - title: '付费会员价' + title: "付费会员价" }, cost: { - title: '成本价' + title: "成本价" }, ot_price: { - title: '市场价' + title: "市场价" }, stock: { - title: '库存' + title: "库存" }, proportion: { - title: '占比' + title: "占比" }, - coupon:{ - title:'抵扣券' + coupon: { + title: "折扣" }, bar_code: { - title: '商品编号' + title: "商品编号" }, weight: { - title: '重量(KG)' + title: "重量(KG)" }, gist_url: { - title: '依据链接' + title: "依据链接" }, volume: { - title: '体积(m³)' + title: "体积(m³)" } -} +}; export default { components: {}, props: { drawer: { type: Boolean, - default: false, + default: false }, configData: { type: Object, - default: {}, + default: {} } }, data() { return { loading: true, - productId: '', - direction: 'rtl', - activeName: 'basic', - qualification:{ - production_name: '', - businessList: [], - licenceList: [], - trademarkList: [], - authorizedList: [], - commodityList: [], - otherList: [], - importBusinessList: [], - importAuthorizedList: [], - customsList: [], - packingList: [], - importOtherList: [], - commodity_type: 0, - brands_name: '', - import_name: '' + productId: "", + direction: "rtl", + activeName: "basic", + qualification: { + production_name: "", + businessList: [], + licenceList: [], + trademarkList: [], + authorizedList: [], + commodityList: [], + otherList: [], + importBusinessList: [], + importAuthorizedList: [], + customsList: [], + packingList: [], + importOtherList: [], + commodity_type: 0, + brands_name: "", + import_name: "" }, productData: {}, formThead: Object.assign({}, objTitle), @@ -833,194 +1170,197 @@ export default { ManyAttrValue: [Object.assign({}, defaultObj.attrValue[0])], // 多规格 svip_type: 0, mer_svip_status: 0, - orderImg: require('@/assets/images/product_icon.png'), + orderImg: require("@/assets/images/product_icon.png"), merParams: [], sysParams: [], formData: [], formUrl: "", - baseURL: SettingMer.httpUrl || 'http://localhost:8080', + baseURL: SettingMer.httpUrl || "http://localhost:8080", // baseURL: 'http://localhost:8080', timeVal: [], recordData: { data: [], total: 0 - },//商品操作记录 + }, //商品操作记录 recordForm: { - type: '', + type: "", date: "", page: 1, limit: 10 }, - colors: ['#99A9BF', '#F7BA2A', '#FF9900'], + colors: ["#99A9BF", "#F7BA2A", "#FF9900"] }; }, computed: { attrValue() { - const obj = Object.assign({}, defaultObj.attrValue[0]) - if(this.svip_type == 0 || this.mer_svip_status == 0)delete obj.svip_price - delete obj.image - return obj - }, - }, - filters: { + const obj = Object.assign({}, defaultObj.attrValue[0]); + if (this.svip_type == 0 || this.mer_svip_status == 0) + delete obj.svip_price; + delete obj.image; + return obj; + } }, + filters: {}, methods: { isValidURL(url) { // (http|https):\/\/([\w.]+\/?)\S* var pattern = /^(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/; - if(!pattern.test(url)){ - return `https://${url}` + if (!pattern.test(url)) { + return `https://${url}`; } - return url + return url; // return pattern.test(url); }, - getType(val){ - var regex = /(?:\.([^.]+))?$/; - let suffix = regex.exec(val.url)[1] - return suffix == 'pdf' - }, + getType(val) { + var regex = /(?:\.([^.]+))?$/; + let suffix = regex.exec(val.url)[1]; + return suffix == "pdf"; + }, handleClose() { - this.activeName = 'basic'; - this.$emit('closeDrawer'); + this.activeName = "basic"; + this.$emit("closeDrawer"); }, getInfo(id) { this.loading = true; this.productId = id; - productDetailApi(id).then(res => { - this.loading = false; - this.productData = res.data - let qualification={ - production_name: '', - businessList: [], - licenceList: [], - trademarkList: [], - authorizedList: [], - commodityList: [], - otherList: [], - importBusinessList: [], - importAuthorizedList: [], - customsList: [], - packingList: [], - importOtherList: [], - commodity_type: 0, - brands_name: '', - import_name: '' - } - this.qualification = res.data.qualification || qualification - this.mer_svip_status = res.data.mer_svip_status - this.svip_type = res.data.svip_price_type - if (this.productData.spec_type === 0) { - this.OneattrValue = res.data.attrValue - } else { - this.ManyAttrValue = res.data.attrValue - } - const tmp = {} - const tmpTab = {} - this.productData.attr.forEach((o, i) => { - tmp['value' + i] = { title: o.value } - tmpTab['value' + i] = '' - }) - this.manyTabDate = tmpTab - this.manyTabTit = tmp - this.checkboxGroup = [] - this.formThead = Object.assign({}, this.formThead, tmp) - this.sysParams = [] - this.merParams = [] - if(res.data.params&&res.data.params.length>0){ - for(var i=0;i<res.data.params.length;i++){ - if(res.data.params[i]['mer_id'] == 0){ - this.sysParams.push(res.data.params[i]) - }else{ - this.merParams.push(res.data.params[i]) + productDetailApi(id) + .then(res => { + this.loading = false; + this.productData = res.data; + let qualification = { + production_name: "", + businessList: [], + licenceList: [], + trademarkList: [], + authorizedList: [], + commodityList: [], + otherList: [], + importBusinessList: [], + importAuthorizedList: [], + customsList: [], + packingList: [], + importOtherList: [], + commodity_type: 0, + brands_name: "", + import_name: "" + }; + this.qualification = res.data.qualification || qualification; + this.mer_svip_status = res.data.mer_svip_status; + this.svip_type = res.data.svip_price_type; + if (this.productData.spec_type === 0) { + this.OneattrValue = res.data.attrValue; + } else { + this.ManyAttrValue = res.data.attrValue; + } + const tmp = {}; + const tmpTab = {}; + this.productData.attr.forEach((o, i) => { + tmp["value" + i] = { title: o.value }; + tmpTab["value" + i] = ""; + }); + this.manyTabDate = tmpTab; + this.manyTabTit = tmp; + this.checkboxGroup = []; + this.formThead = Object.assign({}, this.formThead, tmp); + this.sysParams = []; + this.merParams = []; + if (res.data.params && res.data.params.length > 0) { + for (var i = 0; i < res.data.params.length; i++) { + if (res.data.params[i]["mer_id"] == 0) { + this.sysParams.push(res.data.params[i]); + } else { + this.merParams.push(res.data.params[i]); + } } } - } - if(res.data.mer_form_id)this.getFormInfo(res.data.mer_form_id) - this.getRecordData(id); - this.loading = false - }).catch(res => { - this.$message.error(res.message) - this.loading = false - }) + if (res.data.mer_form_id) this.getFormInfo(res.data.mer_form_id); + this.getRecordData(id); + this.loading = false; + }) + .catch(res => { + this.$message.error(res.message); + this.loading = false; + }); }, // 关联的表单信息 - getFormInfo(id){ - associatedFormInfo(id).then((res) => { - this.formData = res.data - let time = new Date().getTime() * 1000 - let formUrl = `${this.baseURL}/pages/admin/system_form/index?inner_frame=1&form_id=${id}&time=${time}`; - this.formUrl = formUrl; - }) - .catch((res) => { - this.$message.error(res.message) - }) + getFormInfo(id) { + associatedFormInfo(id) + .then(res => { + this.formData = res.data; + let time = new Date().getTime() * 1000; + let formUrl = `${ + this.baseURL + }/pages/admin/system_form/index?inner_frame=1&form_id=${id}&time=${time}`; + this.formUrl = formUrl; + }) + .catch(res => { + this.$message.error(res.message); + }); }, // 具体日期 onchangeTime(e) { - this.timeVal = e - this.recordForm.date = e ? this.timeVal.join('-') : '' - this.getRecordData(this.productId) + this.timeVal = e; + this.recordForm.date = e ? this.timeVal.join("-") : ""; + this.getRecordData(this.productId); }, // 商品操作记录 - getRecordData(){ - operateRecordList(this.productId,this.recordForm) + getRecordData() { + operateRecordList(this.productId, this.recordForm) .then(res => { - this.recordData.data = res.data.list - this.recordData.total = res.data.count + this.recordData.data = res.data.list; + this.recordData.total = res.data.count; }) .catch(res => { - this.$message.error(res.message) - }) + this.$message.error(res.message); + }); }, pageChange(page) { - this.recordForm.page = page - this.getRecordData() + this.recordForm.page = page; + this.getRecordData(); }, handleSizeChange(val) { - this.recordForm.limit = val - this.getRecordData() + this.recordForm.limit = val; + this.getRecordData(); }, - tabClick(tab) { - - }, - }, + tabClick(tab) {} + } }; </script> <style lang="scss" scoped> .sp { - display: block; - // width: 33%; - margin-bottom: 20px; - } -.upload{ + display: block; + // width: 33%; + margin-bottom: 20px; +} +.upload { + display: flex; + flex-direction: row; + // align-content: center; + align-items: center; + height: 60px; + // line-height: 60px; + margin-bottom: 20px; + &_right { display: flex; - flex-direction: row; - // align-content: center; - align-items: center; height: 60px; - // line-height: 60px; - margin-bottom: 20px; - &_right{ - display: flex; - height: 60px; - } - &_left{ - width: 115px; - } - .txt{ - width: 60px; - height: 60px; - line-height: 60px; - overflow: hidden; - display: inline-block; - text-overflow: ellipsis; - white-space: nowrap; - border: 1px solid #DCDFE6; - border-radius: 4px; - margin-right: 10px; - color: blue; - } } + &_left { + width: 115px; + } + .txt { + width: 60px; + height: 60px; + line-height: 60px; + overflow: hidden; + display: inline-block; + text-overflow: ellipsis; + white-space: nowrap; + border: 1px solid #dcdfe6; + border-radius: 4px; + margin-right: 10px; + color: blue; + } +} .head { padding: 20px 35px; .full { @@ -1068,7 +1408,7 @@ export default { width: 20%; font-size: 14px; line-height: 14px; - color: rgba(0, 0, 0, 0.85); + color: rgba(0, 0, 0, 0.85); .title { margin-bottom: 12px; font-size: 13px; @@ -1078,10 +1418,10 @@ export default { } } } -.tabNumWidth{ +.tabNumWidth { max-height: 350px; overflow-y: auto; - &:before{ + &:before { display: none; } } @@ -1103,11 +1443,11 @@ export default { padding: 0; margin: 0; } - .audit{ + .audit { margin-top: 16px; font-size: 13px; color: #606266; - .item-title{ + .item-title { width: 100px; text-align: right; } @@ -1129,17 +1469,17 @@ export default { &:nth-child(3n + 3) { padding-left: 20px; } - .item-title{ + .item-title { width: 100px; text-align: right; } } - .item100{ + .item100 { flex: 0 0 calc(100% / 1); - padding-left: 0!important; + padding-left: 0 !important; padding-left: 0; } - .contentPic{ + .contentPic { width: 500px; margin: 0 auto; max-height: 600px; @@ -1148,23 +1488,23 @@ export default { .value { // flex: 1; .value-item { - &::after{ + &::after { content: "/"; display: inline-block; } - &:last-child{ - &::after{ + &:last-child { + &::after { display: none; } } } - .value-temp{ - &::after{ + .value-temp { + &::after { content: "、"; display: inline-block; } - &:last-child{ - &::after{ + &:last-child { + &::after { display: none; } } @@ -1178,7 +1518,7 @@ export default { } } } -.contentPic ::v-deep img{ +.contentPic ::v-deep img { max-width: 100%; } .tab { @@ -1193,8 +1533,7 @@ export default { ::v-deep .el-drawer__body { overflow: auto; } -::v-deep .ones th{ - background: #F0F5FF; +::v-deep .ones th { + background: #f0f5ff; } - </style> diff --git a/vue.config.js b/vue.config.js index d5a2027..acad3f1 100644 --- a/vue.config.js +++ b/vue.config.js @@ -28,7 +28,8 @@ module.exports = { outputDir: 'dist', assetsDir: 'mer', indexPath: process.env.NODE_ENV === 'development' ? 'index.html' : 'mer.html', - lintOnSave: process.env.NODE_ENV === 'development', + // lintOnSave: process.env.NODE_ENV === 'development', + lintOnSave: false, productionSourceMap: false, devServer: { port: port, @@ -94,7 +95,7 @@ module.exports = { .plugin('ScriptExtHtmlWebpackPlugin') .after('html') .use('script-ext-html-webpack-plugin', [{ - // `runtime` must same as runtimeChunk name. default is `runtime` + // `runtime` must same as runtimeChunk name. default is `runtime` inline: /runtime\..*\.js$/ }]) .end()