mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2025-12-19 17:35:53 +08:00
Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e4d228ac2 | ||
|
|
f2491124d1 | ||
|
|
ef7d3d7a1a | ||
|
|
ea7ce1636e | ||
|
|
a2de4ccb2e | ||
|
|
0a1182f1e6 | ||
|
|
47a77ff046 | ||
|
|
1923061d78 | ||
|
|
8ed1d92f80 | ||
|
|
7c330ebeb1 | ||
|
|
6e872f0287 | ||
|
|
7cdb8d5456 | ||
|
|
c106423742 | ||
|
|
108bb6c901 | ||
|
|
e45a1db2f9 | ||
|
|
9e630bb2ba | ||
|
|
c03778676c | ||
|
|
c970309802 |
@@ -10,10 +10,12 @@ import { getBaseSite } from "@/api/common.js";
|
|||||||
export default {
|
export default {
|
||||||
name: "App",
|
name: "App",
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
||||||
this.init();
|
this.init();
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
init(){
|
init(){
|
||||||
|
|
||||||
if(!storage.getItem("siteName")||!storage.getItem("logoImg")||!storage.getItem("sitelogo_expiration_time")) {
|
if(!storage.getItem("siteName")||!storage.getItem("logoImg")||!storage.getItem("sitelogo_expiration_time")) {
|
||||||
this.getSite();
|
this.getSite();
|
||||||
}else{
|
}else{
|
||||||
@@ -33,6 +35,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
getSite(){
|
getSite(){
|
||||||
//获取基本站点信息
|
//获取基本站点信息
|
||||||
getBaseSite().then((res) => {
|
getBaseSite().then((res) => {
|
||||||
|
|||||||
@@ -10,6 +10,19 @@ export function getVerifyImg (verificationEnums) {
|
|||||||
needToken: false
|
needToken: false
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export function getImSetting(params) {
|
||||||
|
return request({
|
||||||
|
url: `/buyer/other/setting/get/IM_SETTING`,
|
||||||
|
method: Method.GET,
|
||||||
|
needToken: true,
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证码校验
|
* 验证码校验
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -527,3 +527,44 @@ export function getGoodsDistribution (distributionId) {
|
|||||||
needToken: true
|
needToken: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取会员发票抬头列表
|
||||||
|
*/
|
||||||
|
export function getMemberReceiptList (params) {
|
||||||
|
return request({
|
||||||
|
url: `/buyer/wallet/receipt`,
|
||||||
|
method: Method.GET,
|
||||||
|
needToken: true,
|
||||||
|
params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存会员发票抬头
|
||||||
|
*/
|
||||||
|
export function setMemberReceiptList (params) {
|
||||||
|
return request({
|
||||||
|
url: `/buyer/wallet/receipt`,
|
||||||
|
method: Method.POST,
|
||||||
|
needToken: true,
|
||||||
|
data:params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存会员发票抬头
|
||||||
|
*/
|
||||||
|
export function delMemberReceipt(id) {
|
||||||
|
return request({
|
||||||
|
url: `/buyer/wallet/receipt/${id}`,
|
||||||
|
method: Method.DELETE,
|
||||||
|
needToken: true,
|
||||||
|
params:{id},
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded",
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -81,9 +81,6 @@
|
|||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
|
||||||
<span class="nav-item" @click="shopEntry">店铺入驻</span>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@@ -162,18 +159,6 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
shopEntry() {
|
|
||||||
// 店铺入驻
|
|
||||||
if (storage.getItem('accessToken')) {
|
|
||||||
let routeUrl = this.$router.resolve({
|
|
||||||
path: '/shopEntry',
|
|
||||||
query: {id: 1}
|
|
||||||
});
|
|
||||||
window.open(routeUrl.href, '_blank');
|
|
||||||
} else {
|
|
||||||
this.$router.push('login');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getCartList() {
|
getCartList() {
|
||||||
// 获取购物车列表
|
// 获取购物车列表
|
||||||
if (this.userInfo.username) {
|
if (this.userInfo.username) {
|
||||||
|
|||||||
@@ -95,11 +95,7 @@ export default {
|
|||||||
label: "宝贝收藏",
|
label: "宝贝收藏",
|
||||||
path: "/home/Favorites"
|
path: "/home/Favorites"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
icon: "shop",
|
|
||||||
label: "收藏店铺",
|
|
||||||
path: "/home/Favorites?type=STORE"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
icon: "carts",
|
icon: "carts",
|
||||||
label: "购物车",
|
label: "购物车",
|
||||||
|
|||||||
@@ -6,11 +6,11 @@
|
|||||||
</p>
|
</p>
|
||||||
<!-- 普通发票 -->
|
<!-- 普通发票 -->
|
||||||
<div class="nav-content">
|
<div class="nav-content">
|
||||||
<Form :model="invoiceForm" ref="form" label-position="left" :rules="ruleInline" :label-width="110">
|
<Form :model="invoiceForm" ref="form" label-position="left" :label-width="110">
|
||||||
<FormItem label="发票类型">
|
<FormItem label="发票类型">
|
||||||
<RadioGroup v-model="invoice" type="button" button-style="solid">
|
<RadioGroup v-model="invoice" type="button" button-style="solid">
|
||||||
<Radio @on-change="changeInvoice" :label="1">电子普通发票</Radio>
|
<Radio @on-change="changeInvoice" :label="1">电子普通发票</Radio>
|
||||||
<Radio :label="2" :disabled="true">增值税专用发票</Radio>
|
<Radio :label="2" >增值税专用发票</Radio>
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="发票抬头">
|
<FormItem label="发票抬头">
|
||||||
@@ -24,10 +24,46 @@
|
|||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="单位名称" v-if="type === 2" prop="receiptTitle">
|
<FormItem label="单位名称" v-if="type === 2" prop="receiptTitle">
|
||||||
<i-input v-model="invoiceForm.receiptTitle"></i-input>
|
<i-input v-model="invoiceForm.receiptTitle"></i-input>
|
||||||
|
<Poptip ref="poptip" placement="right" width="300">
|
||||||
|
<div class="global_color">选择其他发票抬头</div>
|
||||||
|
<div slot="content">
|
||||||
|
<Spin fix v-if="delReceiptLoad"></Spin>
|
||||||
|
<div class="receipt-content">
|
||||||
|
<div class="flex receipt-item" v-for="item in receiptList" :key="item.id" >
|
||||||
|
<div @click="chooseReceipt(item)">
|
||||||
|
<div class="receipt-title">{{ item.receiptTitle }}</div>
|
||||||
|
<div>{{ item.taxpayerId }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="global_color" @click="delReceipt(item.id)">
|
||||||
|
删除
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="text-align: right;">
|
||||||
|
<Page :total="total" @on-change="changePage"
|
||||||
|
:current="searchParams.pageNumber" :page-size="searchParams.pageSize" size="small" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Poptip>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="纳税人识别号" v-if="type === 2" prop="taxpayerId">
|
<FormItem label="纳税人识别号" v-if="type === 2" prop="taxpayerId">
|
||||||
<i-input v-model="invoiceForm.taxpayerId"></i-input>
|
<i-input v-model="invoiceForm.taxpayerId"></i-input>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
<div v-if="type === 2" class="more" @click="showMore = !showMore">更多选填项</div>
|
||||||
|
<div v-if="showMore">
|
||||||
|
<FormItem label="单位地址" v-if="type === 2" prop="address">
|
||||||
|
<i-input v-model="invoiceForm.address"></i-input>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem label="单位电话" v-if="type === 2" prop="mobile">
|
||||||
|
<i-input v-model="invoiceForm.mobile"></i-input>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem label="开户银行" v-if="type === 2" prop="bank">
|
||||||
|
<i-input v-model="invoiceForm.bank"></i-input>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem label="银行账号" v-if="type === 2" prop="bankNumber">
|
||||||
|
<i-input v-model="invoiceForm.bankNumber"></i-input>
|
||||||
|
</FormItem>
|
||||||
|
</div>
|
||||||
<FormItem label="发票内容">
|
<FormItem label="发票内容">
|
||||||
<RadioGroup v-model="invoiceForm.receiptContent" type="button" button-style="solid">
|
<RadioGroup v-model="invoiceForm.receiptContent" type="button" button-style="solid">
|
||||||
<Radio label="商品明细">商品明细</Radio>
|
<Radio label="商品明细">商品明细</Radio>
|
||||||
@@ -36,8 +72,10 @@
|
|||||||
</FormItem>
|
</FormItem>
|
||||||
</Form>
|
</Form>
|
||||||
<div style="text-align: center">
|
<div style="text-align: center">
|
||||||
<Button type="primary" :loading="loading" @click="submit">保存发票信息</Button>
|
|
||||||
|
<Button type="primary" class="mr_10" :loading="loading" @click="submit">保存发票信息</Button>
|
||||||
<Button type="default" @click="invoiceAvailable = false">取消</Button>
|
<Button type="default" @click="invoiceAvailable = false">取消</Button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
@@ -45,11 +83,15 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { receiptSelect } from '@/api/cart.js';
|
import { receiptSelect } from '@/api/cart.js';
|
||||||
import { TINumber } from '@/plugins/RegExp.js';
|
import { getMemberReceiptList ,setMemberReceiptList,delMemberReceipt } from '@/api/member.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'invoiceModal',
|
name: 'invoiceModal',
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
receiptList:[],
|
||||||
|
showMore:false,
|
||||||
|
delReceiptLoad:false,
|
||||||
invoice: 1, // 发票类型
|
invoice: 1, // 发票类型
|
||||||
invoiceAvailable: false, // 模态框显隐
|
invoiceAvailable: false, // 模态框显隐
|
||||||
loading: false, // 提交状态
|
loading: false, // 提交状态
|
||||||
@@ -59,17 +101,36 @@ export default {
|
|||||||
taxpayerId: '', // 纳税人识别号
|
taxpayerId: '', // 纳税人识别号
|
||||||
receiptContent: '商品明细' // 发票内容
|
receiptContent: '商品明细' // 发票内容
|
||||||
},
|
},
|
||||||
|
isDefault:false,
|
||||||
type: 1, // 1 个人 2 单位
|
type: 1, // 1 个人 2 单位
|
||||||
ruleInline: {
|
searchParams:{
|
||||||
taxpayerId: [
|
|
||||||
{ required: true, message: '请填写纳税人识别号' },
|
pageNumber:1,
|
||||||
{ pattern: TINumber, message: '请填写正确的纳税人识别号' }
|
pageSize:5
|
||||||
]
|
},
|
||||||
}
|
total:0,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: ['invoiceData'],
|
props: ['invoiceData'],
|
||||||
watch: {
|
watch: {
|
||||||
|
type(val){
|
||||||
|
if(val === 2 && !this.invoiceForm.receiptTitle){
|
||||||
|
// 查找默认的发票抬头
|
||||||
|
const defaultValue = this.receiptList.find(item => item.isDefault === 1)
|
||||||
|
if(!defaultValue){
|
||||||
|
this.invoiceForm.receiptTitle = this.receiptList[0].receiptTitle
|
||||||
|
this.invoiceForm.taxpayerId = this.receiptList[0].taxpayerId
|
||||||
|
}else{
|
||||||
|
this.invoiceForm.receiptTitle = defaultValue.receiptTitle
|
||||||
|
this.invoiceForm.taxpayerId = defaultValue.taxpayerId
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
invoiceAvailable(val){
|
||||||
|
if(val){
|
||||||
|
this.getReceiptList()
|
||||||
|
}
|
||||||
|
},
|
||||||
// 回显的发票信息
|
// 回显的发票信息
|
||||||
invoiceData: {
|
invoiceData: {
|
||||||
handler (val) {
|
handler (val) {
|
||||||
@@ -85,7 +146,40 @@ export default {
|
|||||||
immeadite: true
|
immeadite: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted () {
|
||||||
|
this.getReceiptList()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
changePage(v){
|
||||||
|
this.searchParams.pageNumber = v;
|
||||||
|
this.getReceiptList();
|
||||||
|
},
|
||||||
|
getReceiptList () { // 获取抬头列表
|
||||||
|
getMemberReceiptList(this.searchParams).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
const list = res.result.records;
|
||||||
|
this.receiptList = list;
|
||||||
|
this.total = res.result.total
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async delReceipt(id){
|
||||||
|
try {
|
||||||
|
this.delReceiptLoad = true
|
||||||
|
const res = await delMemberReceipt(id)
|
||||||
|
this.delReceiptLoad = false
|
||||||
|
if(res.success){
|
||||||
|
if(this.searchParams.pageNumber !==1 && this.total - 1 < this.searchParams.pageNumber * this.searchParams.pageSize){
|
||||||
|
this.searchParams.pageNumber = this.searchParams.pageNumber - 1
|
||||||
|
}
|
||||||
|
this.$Message.success('删除成功')
|
||||||
|
this.getReceiptList()
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
this.delReceiptLoad = false
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 选择发票抬头
|
* 选择发票抬头
|
||||||
*/
|
*/
|
||||||
@@ -94,12 +188,16 @@ export default {
|
|||||||
this.type = val;
|
this.type = val;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
chooseReceipt(val){
|
||||||
|
this.$refs.poptip.visible = false
|
||||||
|
this.invoiceForm.receiptTitle = val.receiptTitle
|
||||||
|
this.invoiceForm.taxpayerId = val.taxpayerId
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 保存判断
|
* 保存判断
|
||||||
*/
|
*/
|
||||||
save () {
|
save () {
|
||||||
let flage = true;
|
let flag = true;
|
||||||
|
|
||||||
// 保存分为两种类型,个人以及企业
|
// 保存分为两种类型,个人以及企业
|
||||||
const { receiptTitle } = JSON.parse(
|
const { receiptTitle } = JSON.parse(
|
||||||
@@ -108,31 +206,35 @@ export default {
|
|||||||
// 判断是否填写发票抬头
|
// 判断是否填写发票抬头
|
||||||
if (!receiptTitle) {
|
if (!receiptTitle) {
|
||||||
this.$Message.error('请填写发票抬头!');
|
this.$Message.error('请填写发票抬头!');
|
||||||
flage = false;
|
flag = false;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.type === 2) {
|
if (this.type === 2) {
|
||||||
this.$refs.form.validate((valid) => {
|
this.$refs.form.validate((valid) => {
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
flage = false;
|
flag = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
delete this.invoiceForm.taxpayerId;
|
delete this.invoiceForm.taxpayerId;
|
||||||
}
|
}
|
||||||
|
|
||||||
return flage;
|
return flag;
|
||||||
},
|
},
|
||||||
// 保存发票信息
|
// 保存发票信息
|
||||||
async submit () {
|
async submit () {
|
||||||
if (this.save()) {
|
if (this.save()) {
|
||||||
this.loading = true;
|
|
||||||
let submit = {
|
let submit = {
|
||||||
way: this.$route.query.way,
|
way: this.$route.query.way,
|
||||||
...this.invoiceForm
|
...this.invoiceForm
|
||||||
};
|
};
|
||||||
|
// 存储到发票列表中
|
||||||
|
await setMemberReceiptList({...submit,isDefault:this.isDefault ? 1 : 0})
|
||||||
|
this.loading = true;
|
||||||
let receipt = await receiptSelect(submit);
|
let receipt = await receiptSelect(submit);
|
||||||
|
|
||||||
if (receipt.success) {
|
if (receipt.success) {
|
||||||
this.$emit('change', true);
|
this.$emit('change', true);
|
||||||
}
|
}
|
||||||
@@ -156,9 +258,33 @@ export default {
|
|||||||
color: $theme_color;
|
color: $theme_color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.global_color{
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.receipt-item{
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding:8px 16px;
|
||||||
|
cursor: pointer;
|
||||||
|
line-height: 1.5;
|
||||||
|
border-bottom: 1px solid #ededed;
|
||||||
|
}
|
||||||
|
|
||||||
|
.receipt-content{
|
||||||
|
height: 280px;
|
||||||
|
}
|
||||||
|
|
||||||
.nav-content {
|
.nav-content {
|
||||||
width: 500px;
|
width: 500px;
|
||||||
margin: 10px auto;
|
margin: 10px auto;
|
||||||
}
|
}
|
||||||
|
.more{
|
||||||
|
text-align: center;
|
||||||
|
color: $theme_color;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
/deep/ .ivu-input{
|
||||||
|
width: 280px !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getIMDetail } from "@/api/common";
|
import { getIMDetail ,getImSetting} from "@/api/common";
|
||||||
import Storage from "@/plugins/storage";
|
import Storage from "@/plugins/storage";
|
||||||
import { getMemberMsg } from "@/api/login";
|
import { getMemberMsg } from "@/api/login";
|
||||||
export default {
|
export default {
|
||||||
@@ -40,9 +40,15 @@ export default {
|
|||||||
},
|
},
|
||||||
// 获取im信息
|
// 获取im信息
|
||||||
async getIMDetailMethods() {
|
async getIMDetailMethods() {
|
||||||
let res = await getIMDetail();
|
// 获取pc im
|
||||||
|
// let res = await getImSetting();
|
||||||
|
// if (res.success) {
|
||||||
|
// this.IMLink = res.result.qrCode
|
||||||
|
// }
|
||||||
|
let res = await getImSetting();
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.IMLink = res.result;
|
window.open(res.result.url);
|
||||||
|
// this.IMLink = res.result.qrCode;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -57,15 +57,6 @@
|
|||||||
:key="index"
|
:key="index"
|
||||||
>
|
>
|
||||||
<div class="shop-name">
|
<div class="shop-name">
|
||||||
<div>
|
|
||||||
<Checkbox
|
|
||||||
v-model="shop.checked"
|
|
||||||
@on-change="changeChecked(shop.checked, 'shop', shop.storeId)"
|
|
||||||
></Checkbox>
|
|
||||||
<span class="go-shop-page" @click="goShopPage(shop.storeId)">{{
|
|
||||||
shop.storeName
|
|
||||||
}}</span>
|
|
||||||
</div>
|
|
||||||
<span
|
<span
|
||||||
class="shop-coupon"
|
class="shop-coupon"
|
||||||
v-if="shop.couponList.length"
|
v-if="shop.couponList.length"
|
||||||
@@ -546,90 +537,6 @@ export default {
|
|||||||
padding-top: 100px;
|
padding-top: 100px;
|
||||||
}
|
}
|
||||||
&-items {
|
&-items {
|
||||||
.shop-name {
|
|
||||||
height: 50px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
padding: 0 20px;
|
|
||||||
position: relative;
|
|
||||||
@include title_color($light_title_color);
|
|
||||||
> * {
|
|
||||||
width: 50%;
|
|
||||||
}
|
|
||||||
.go-shop-page:hover {
|
|
||||||
color: $theme_color;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.customer-service {
|
|
||||||
margin-left: 5px;
|
|
||||||
color: #fcc217;
|
|
||||||
cursor: pointer;
|
|
||||||
&:hover {
|
|
||||||
color: $theme_color;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/** 优惠券 */
|
|
||||||
.shop-coupon {
|
|
||||||
width: 80px;
|
|
||||||
height: 24px;
|
|
||||||
position: relative;
|
|
||||||
background: url(../assets/images/cart-coupon-icons02.png) 0 0 no-repeat;
|
|
||||||
> div {
|
|
||||||
position: absolute;
|
|
||||||
top: 35px;
|
|
||||||
left: 0;
|
|
||||||
width: 300px;
|
|
||||||
height: 300px;
|
|
||||||
background-color: #fff;
|
|
||||||
border: 1px solid $theme_color;
|
|
||||||
// border-radius: 3px;
|
|
||||||
z-index: 1;
|
|
||||||
padding: 10px 20px;
|
|
||||||
&::before {
|
|
||||||
content: "";
|
|
||||||
display: block;
|
|
||||||
background: url(../assets/images/cart-coupon-icons02.png) 0 -58px no-repeat;
|
|
||||||
width: 80px;
|
|
||||||
height: 12px;
|
|
||||||
position: absolute;
|
|
||||||
top: -12px;
|
|
||||||
left: 0;
|
|
||||||
}
|
|
||||||
.coupon-item {
|
|
||||||
margin-bottom: 10px;
|
|
||||||
span:nth-child(1) {
|
|
||||||
border: 1px solid #e33937;
|
|
||||||
display: inline-block;
|
|
||||||
padding: 3px 10px;
|
|
||||||
color: $theme_color;
|
|
||||||
border-radius: 3px;
|
|
||||||
}
|
|
||||||
span:nth-child(2) {
|
|
||||||
font-size: 12px;
|
|
||||||
margin-left: 5px;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
.coupon-btn {
|
|
||||||
height: 26px;
|
|
||||||
float: right;
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
&::after {
|
|
||||||
display: block;
|
|
||||||
content: "";
|
|
||||||
clear: right;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.promotion-notice {
|
|
||||||
text-align: right;
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
.shop-coupon-show {
|
|
||||||
background-position-y: -34px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.goods-item {
|
.goods-item {
|
||||||
position: relative;
|
position: relative;
|
||||||
@extend .cart-goods-title;
|
@extend .cart-goods-title;
|
||||||
|
|||||||
@@ -12,15 +12,8 @@
|
|||||||
</Breadcrumb>
|
</Breadcrumb>
|
||||||
<div class="store-collect" v-if="!takeDownSale">
|
<div class="store-collect" v-if="!takeDownSale">
|
||||||
<span class="mr_10" v-if="goodsMsg.data">
|
<span class="mr_10" v-if="goodsMsg.data">
|
||||||
<router-link :to="'Merchant?id=' + goodsMsg.data.storeId">{{
|
|
||||||
goodsMsg.data.storeName
|
|
||||||
}}</router-link>
|
|
||||||
</span>
|
</span>
|
||||||
<span @click="collect">
|
<span class="ml_10" @click="getIMDetailMethods()">联系客服</span>
|
||||||
<Icon type="ios-heart" :color="storeCollected ? '#ed3f14' : '#666'" />
|
|
||||||
{{ storeCollected? "已收藏店铺": "收藏店铺" }}
|
|
||||||
</span>
|
|
||||||
<span class="ml_10" @click="IMService(goodsMsg.data.storeId,goodsMsg.data.goodsId,goodsMsg.data.id)">联系客服</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -36,6 +29,12 @@
|
|||||||
<Button size="small" @click="target('goodsList')">返回商品列表</Button>
|
<Button size="small" @click="target('goodsList')">返回商品列表</Button>
|
||||||
</div>
|
</div>
|
||||||
</empty>
|
</empty>
|
||||||
|
|
||||||
|
<Modal title="扫码联系客服" hide-footer v-model="showQrCode">
|
||||||
|
<div class="img">
|
||||||
|
<img :src="IMLink" alt="">
|
||||||
|
</div>
|
||||||
|
</Modal>
|
||||||
<Spin size="large" fix v-if="isLoading"></Spin>
|
<Spin size="large" fix v-if="isLoading"></Spin>
|
||||||
<BaseFooter></BaseFooter>
|
<BaseFooter></BaseFooter>
|
||||||
</div>
|
</div>
|
||||||
@@ -68,16 +67,19 @@ export default {
|
|||||||
mixins: [imTalk],
|
mixins: [imTalk],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
showQrCode:false,
|
||||||
goodsMsg: {}, // 商品信息
|
goodsMsg: {}, // 商品信息
|
||||||
isLoading: false, // 加载状态
|
isLoading: false, // 加载状态
|
||||||
categoryBar: [], // 分类
|
categoryBar: [], // 分类
|
||||||
storeCollected: false, // 商品收藏
|
storeCollected: false, // 商品收藏
|
||||||
storeMsg: {}, // 店铺信息
|
storeMsg: {}, // 店铺信息
|
||||||
takeDownSale:false, // 是否下架
|
takeDownSale:false, // 是否下架
|
||||||
|
IMLink:"",
|
||||||
|
// qrCode:""
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
// 跳转首页或商品页面
|
// 跳转首页或商品页面
|
||||||
target(url){
|
target(url){
|
||||||
this.$router.push({path: url})
|
this.$router.push({path: url})
|
||||||
@@ -230,4 +232,11 @@ export default {
|
|||||||
margin:10px 0
|
margin:10px 0
|
||||||
|
|
||||||
}
|
}
|
||||||
|
.img{
|
||||||
|
text-align: center;
|
||||||
|
>img{
|
||||||
|
width: 200px;
|
||||||
|
height: 200px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -74,12 +74,6 @@
|
|||||||
已有<span>{{ item.commentNum || 0 }}</span
|
已有<span>{{ item.commentNum || 0 }}</span
|
||||||
>人评价
|
>人评价
|
||||||
</div>
|
</div>
|
||||||
<div class="goods-show-seller">
|
|
||||||
<span class="text-bottom" style="color: #e4393c">{{
|
|
||||||
item.storeName
|
|
||||||
}}</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="goods-show-right">
|
<div class="goods-show-right">
|
||||||
<Tag
|
<Tag
|
||||||
class="goods-show-tag"
|
class="goods-show-tag"
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<Alert class="l_title" show-icon type="warning">商家申诉信息</Alert>
|
<!-- <Alert class="l_title" show-icon type="warning">商家申诉信息</Alert>
|
||||||
<table cellspacing="0" cellpadding='0' border="1">
|
<table cellspacing="0" cellpadding='0' border="1">
|
||||||
<tr>
|
<tr>
|
||||||
<td>申诉时间</td>
|
<td>申诉时间</td>
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table> -->
|
||||||
|
|
||||||
<Alert class="l_title" show-icon type="warning">平台仲裁</Alert>
|
<Alert class="l_title" show-icon type="warning">平台仲裁</Alert>
|
||||||
<table cellspacing="0" cellpadding='0' border="1">
|
<table cellspacing="0" cellpadding='0' border="1">
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
{{ item.goodsName }}
|
{{ item.goodsName }}
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="goodsTitle hover-pointer" @click="buynow(item.skuId, item.goodsId,item.id)" >
|
<div v-else class="goodsTitle hover-pointer" @click="buynow(item.skuId, item.goodsId,item.id)" >
|
||||||
{{ item.storeName }}
|
|
||||||
<Tag color="error" class="operated" v-if="item.selfOperated">商家自营</Tag>
|
<Tag color="error" class="operated" v-if="item.selfOperated">商家自营</Tag>
|
||||||
</div>
|
</div>
|
||||||
<div class="goodsPrice">
|
<div class="goodsPrice">
|
||||||
|
|||||||
@@ -42,10 +42,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
|
||||||
<span @click="shopPage(order.shopId)">{{ order.storeName }}</span>
|
<div class="btns">
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<!-- 订单基础操作 -->
|
<!-- 订单基础操作 -->
|
||||||
<Button @click="goDetail(order.sn)" type="info" size="small">售后详情</Button>
|
<Button @click="goDetail(order.sn)" type="info" size="small">售后详情</Button>
|
||||||
<Button @click="openModal(order)"
|
<Button @click="openModal(order)"
|
||||||
@@ -184,14 +182,7 @@ export default {
|
|||||||
});
|
});
|
||||||
window.open(routeUrl.href, '_blank');
|
window.open(routeUrl.href, '_blank');
|
||||||
},
|
},
|
||||||
// 跳转店铺首页
|
|
||||||
shopPage(id) {
|
|
||||||
let routeUrl = this.$router.resolve({
|
|
||||||
path: '/Merchant',
|
|
||||||
query: {id: id}
|
|
||||||
});
|
|
||||||
window.open(routeUrl.href, '_blank');
|
|
||||||
},
|
|
||||||
getList() { // 获取售后列表
|
getList() { // 获取售后列表
|
||||||
this.spinShow = true;
|
this.spinShow = true;
|
||||||
let params = JSON.parse(JSON.stringify(this.params))
|
let params = JSON.parse(JSON.stringify(this.params))
|
||||||
@@ -363,4 +354,10 @@ export default {
|
|||||||
.modal-goods {
|
.modal-goods {
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.btns{
|
||||||
|
>*{
|
||||||
|
margin: 4px 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -13,15 +13,7 @@
|
|||||||
<p class="global_color fontsize_18">{{ afterSale.orderStatusValue }}</p>
|
<p class="global_color fontsize_18">{{ afterSale.orderStatusValue }}</p>
|
||||||
<p>售后单号:{{ afterSale.sn }} 订单号:{{afterSale.orderSn}}</p>
|
<p>售后单号:{{ afterSale.sn }} 订单号:{{afterSale.orderSn}}</p>
|
||||||
<div style="color:#999;" class="operation-time">创建时间:{{afterSale.createTime}}</div>
|
<div style="color:#999;" class="operation-time">创建时间:{{afterSale.createTime}}</div>
|
||||||
<div class="service-after">
|
|
||||||
<div>
|
|
||||||
本次售后服务由<span>{{afterSale.storeName}}</span>为您提供
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<img :src="afterSale.goodsImage" alt="" width="60" height="60">
|
|
||||||
<span>{{afterSale.goodsName}}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="order-card">
|
<div class="order-card">
|
||||||
<h3>售后进程</h3>
|
<h3>售后进程</h3>
|
||||||
|
|||||||
@@ -59,10 +59,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
|
||||||
<span @click="shopPage(order.storeId)">{{ order.storeName }}</span>
|
<div class="btns">
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<!-- 订单基础操作 -->
|
<!-- 订单基础操作 -->
|
||||||
<Button @click="orderDetail(order.sn)" type="info" size="small">订单详情</Button>
|
<Button @click="orderDetail(order.sn)" type="info" size="small">订单详情</Button>
|
||||||
<Button @click="handleCancelOrder(order.sn)" type="error" v-if="order.allowOperationVO.cancel" size="small">取消订单</Button>
|
<Button @click="handleCancelOrder(order.sn)" type="error" v-if="order.allowOperationVO.cancel" size="small">取消订单</Button>
|
||||||
@@ -195,14 +193,7 @@ export default {
|
|||||||
}
|
}
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
// 跳转店铺首页
|
|
||||||
shopPage (id) {
|
|
||||||
let routeUrl = this.$router.resolve({
|
|
||||||
path: '/Merchant',
|
|
||||||
query: { id: id }
|
|
||||||
});
|
|
||||||
window.open(routeUrl.href, '_blank');
|
|
||||||
},
|
|
||||||
orderDetail (sn) {
|
orderDetail (sn) {
|
||||||
// 跳转订单详情
|
// 跳转订单详情
|
||||||
this.$router.push({ name: 'OrderDetail', query: {sn} });
|
this.$router.push({ name: 'OrderDetail', query: {sn} });
|
||||||
@@ -391,4 +382,9 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.btns{
|
||||||
|
>*{
|
||||||
|
margin: 4px 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -106,9 +106,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- 订单商品 -->
|
<!-- 订单商品 -->
|
||||||
<div class="goods">
|
<div class="goods">
|
||||||
<div class="shop-name">
|
|
||||||
<span @click="shopPage(order.order.storeId)">{{order.order.storeName}}</span>
|
|
||||||
</div>
|
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -488,24 +486,6 @@ export default {
|
|||||||
top: 20px;
|
top: 20px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/** 店铺名称 */
|
|
||||||
.shop-name {
|
|
||||||
margin: 15px 0;
|
|
||||||
span {
|
|
||||||
color: #438cde;
|
|
||||||
cursor: pointer;
|
|
||||||
&:hover {
|
|
||||||
color: $theme_color;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.ivu-icon {
|
|
||||||
color: #ff8f23;
|
|
||||||
cursor: pointer;
|
|
||||||
&:hover {
|
|
||||||
color: $theme_color;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/** 商品列表 */
|
/** 商品列表 */
|
||||||
table {
|
table {
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
|
|||||||
@@ -115,13 +115,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="goods-msg" v-for="(shop, shopIndex) in goodsList" :key="shopIndex">
|
<div class="goods-msg" v-for="(shop, shopIndex) in goodsList" :key="shopIndex">
|
||||||
<div v-if="shop.checked">
|
<div v-if="shop.checked">
|
||||||
<div class="shop-name">
|
|
||||||
<span>
|
|
||||||
<span class="hover-color" @click="goShopPage(shop.storeId)">{{
|
|
||||||
shop.storeName
|
|
||||||
}}</span>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="goods-list">
|
<div class="goods-list">
|
||||||
<div class="goods-item" v-for="(goods, goodsIndex) in shop.checkedSkuList" :key="goodsIndex">
|
<div class="goods-item" v-for="(goods, goodsIndex) in shop.checkedSkuList" :key="goodsIndex">
|
||||||
<span class="hover-color" @click="
|
<span class="hover-color" @click="
|
||||||
@@ -890,53 +884,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 购买商品列表 start */
|
|
||||||
.shop-name {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
>span:nth-child(1) {
|
|
||||||
font-weight: bold;
|
|
||||||
|
|
||||||
.ivu-icon {
|
|
||||||
color: #ff8f23;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: $theme_color;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
>span:nth-child(2) {
|
|
||||||
color: #999;
|
|
||||||
position: relative;
|
|
||||||
display: flex;
|
|
||||||
width: 200px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.delivery-list {
|
|
||||||
position: absolute;
|
|
||||||
right: 0;
|
|
||||||
top: 20px;
|
|
||||||
background-color: #f3fafe;
|
|
||||||
box-shadow: 0px 0px 5px #b9b2b2;
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
width: 200px;
|
|
||||||
min-height: 100px;
|
|
||||||
padding: 10px;
|
|
||||||
|
|
||||||
li {
|
|
||||||
width: 90px;
|
|
||||||
height: 30px;
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods-list {
|
.goods-list {
|
||||||
width: 1150px;
|
width: 1150px;
|
||||||
|
|||||||
@@ -32,9 +32,7 @@
|
|||||||
已有<span>{{ item.commentNum || 0 }}</span
|
已有<span>{{ item.commentNum || 0 }}</span
|
||||||
>人评价
|
>人评价
|
||||||
</div>
|
</div>
|
||||||
<div class="goods-show-seller">
|
|
||||||
<span>{{ item.storeName }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="page-size">
|
<div class="page-size">
|
||||||
|
|||||||
@@ -66,9 +66,7 @@
|
|||||||
: 100
|
: 100
|
||||||
" />
|
" />
|
||||||
</div>
|
</div>
|
||||||
<div class="goods-show-seller">
|
|
||||||
<span>{{ item.storeName }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<BaseFooter />
|
<BaseFooter />
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ Vue.use(Vuex);
|
|||||||
|
|
||||||
export default new Vuex.Store({
|
export default new Vuex.Store({
|
||||||
state: {
|
state: {
|
||||||
|
imQrCode: '',
|
||||||
navList: [], // 首页快捷导航
|
navList: [], // 首页快捷导航
|
||||||
cartNum: storage.getItem('cartNum') || 0,
|
cartNum: storage.getItem('cartNum') || 0,
|
||||||
logoImg: storage.getItem('logoImg') || require('@/assets/images/logo2.png'),
|
logoImg: storage.getItem('logoImg') || require('@/assets/images/logo2.png'),
|
||||||
|
|||||||
BIN
manager/public/static/instructions.xlsx
Normal file
BIN
manager/public/static/instructions.xlsx
Normal file
Binary file not shown.
BIN
manager/public/static/logisticsType.xlsx
Normal file
BIN
manager/public/static/logisticsType.xlsx
Normal file
Binary file not shown.
@@ -57,5 +57,15 @@ export const auditDistributionCash = (id,params) => {
|
|||||||
return postRequest(`/distribution/cash/audit/${id}`, params)
|
return postRequest(`/distribution/cash/audit/${id}`, params)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 取消分销商品
|
||||||
|
export const distributionGoodsCancel = (id) => {
|
||||||
|
return deleteRequest(`/distribution/goods/cancel/${id}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 选择分销商品
|
||||||
|
export const distributionGoodsCheck = (id,param) => {
|
||||||
|
return putRequest(`/distribution/goods/checked/${id}`,param)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -225,3 +225,60 @@ export const refundStatistics = (params) => {
|
|||||||
export const refundPriceStatistics = (params) => {
|
export const refundPriceStatistics = (params) => {
|
||||||
return getRequest(`/statistics/refund/order/getPrice`, params)
|
return getRequest(`/statistics/refund/order/getPrice`, params)
|
||||||
}
|
}
|
||||||
|
// 获取草稿商品分页列表
|
||||||
|
export const getDraftGoodsListData = params => {
|
||||||
|
return getRequest("/goods/draftGoods/page", params);
|
||||||
|
};
|
||||||
|
// 获取草稿商品详情
|
||||||
|
export const getDraftGoodsDetail = id => {
|
||||||
|
return getRequest(`/goods/draftGoods/${id}`);
|
||||||
|
};
|
||||||
|
// 保存草稿商品
|
||||||
|
export function saveDraftGoods(params) {
|
||||||
|
return postRequest("/goods/draftGoods/save", params, {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除草稿商品
|
||||||
|
export const deleteDraftGoods = id => {
|
||||||
|
return deleteRequest(`/goods/draftGoods/${id}`);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export function createGoods(params) {
|
||||||
|
return postRequest("/goods/goods/create", params, {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function editGoods(goodsId, params) {
|
||||||
|
return putRequest(`/goods/goods/update/${goodsId}`, params, {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//根据分类id获取关联品牌
|
||||||
|
export const getCategoryBrandListDataSeller = (category_id, params) => {
|
||||||
|
return getRequest(`/goods/category/${category_id}/brands`, params);
|
||||||
|
};
|
||||||
|
|
||||||
|
//查询分类绑定参数信息
|
||||||
|
export const getCategoryParamsListDataSeller = (id, params) => {
|
||||||
|
return getRequest(`/goods/categoryParameters/${id}`, params);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 获取商品详情
|
||||||
|
export const getGoods = id => {
|
||||||
|
return getRequest(`/goods/goods/get/${id}`);
|
||||||
|
};
|
||||||
|
|
||||||
|
//保存获取关联规格
|
||||||
|
export const getGoodsSpecInfoSeller = (category_id) => {
|
||||||
|
return getRequest(`/goods/spec/${category_id}`);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 获取商品单位列表
|
||||||
|
export const getGoodsUnitList = params => {
|
||||||
|
return getRequest(`/goods/goodsUnit`,params);
|
||||||
|
};
|
||||||
|
|||||||
@@ -42,6 +42,11 @@ export const afterSaleOrderDetail = (sn) => {
|
|||||||
export const afterSaleSellerReview = (sn, params) => {
|
export const afterSaleSellerReview = (sn, params) => {
|
||||||
return putRequest(`/order/afterSale/review/${sn}`, params)
|
return putRequest(`/order/afterSale/review/${sn}`, params)
|
||||||
}
|
}
|
||||||
|
//查询包裹列表
|
||||||
|
export const getPackage = (orderSn) => {
|
||||||
|
return getRequest(`/order/order/getPackage/${orderSn}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 商家确认收货
|
// 商家确认收货
|
||||||
export const afterSaleSellerConfirm = (sn, params) => {
|
export const afterSaleSellerConfirm = (sn, params) => {
|
||||||
@@ -126,10 +131,7 @@ export const getAfterSaleOrderDetail = (sn) => {
|
|||||||
export const getAfterSaleTraces = (sn) => {
|
export const getAfterSaleTraces = (sn) => {
|
||||||
return getRequest(`/order/afterSale/getDeliveryTraces/${sn}`)
|
return getRequest(`/order/afterSale/getDeliveryTraces/${sn}`)
|
||||||
}
|
}
|
||||||
// 获取商家选中的物流公司
|
|
||||||
export const getLogisticsChecked = () => {
|
|
||||||
return getRequest(`/other/logistics/getChecked`)
|
|
||||||
}
|
|
||||||
|
|
||||||
//查询物流
|
//查询物流
|
||||||
export const getTraces = (sn, params) => {
|
export const getTraces = (sn, params) => {
|
||||||
@@ -160,3 +162,19 @@ export const refundLog = (params) => {
|
|||||||
export const storeAddress = (sn) => {
|
export const storeAddress = (sn) => {
|
||||||
return getRequest(`/order/afterSale/getStoreAfterSaleAddress/${sn}`)
|
return getRequest(`/order/afterSale/getStoreAfterSaleAddress/${sn}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 订单核验
|
||||||
|
export const orderTake = (sn, verificationCode) => {
|
||||||
|
return putRequest(`/order/order/take/${sn}/${verificationCode}`);
|
||||||
|
};
|
||||||
|
|
||||||
|
//分包裹发货
|
||||||
|
export const partDelivery = (orderSn,params) => {
|
||||||
|
return postRequest(`/order/order/${orderSn}/partDelivery`,params,{
|
||||||
|
"Content-type": "application/json"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 修改订单备注
|
||||||
|
export const modifyOrderRemark = (sn, params) => {
|
||||||
|
return putRequest(`/order/order/${sn}/sellerRemark`, params);
|
||||||
|
};
|
||||||
|
|||||||
@@ -281,3 +281,32 @@ export const deletePointsGoodsCategoryById = id => {
|
|||||||
export const getCouponReceiveList = (params) => {
|
export const getCouponReceiveList = (params) => {
|
||||||
return getRequest("/promotion/coupon/received", params);
|
return getRequest("/promotion/coupon/received", params);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 新增满减活动
|
||||||
|
export const newFullDiscount = (params) => {
|
||||||
|
return postRequest(`/promotion/fullDiscount`, params, { 'Content-type': 'application/json' })
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 编辑满减活动
|
||||||
|
export const editFullDiscount = (params) => {
|
||||||
|
return putRequest(`/promotion/fullDiscount`, params, { 'Content-type': 'application/json' })
|
||||||
|
}
|
||||||
|
// 新建 拼团
|
||||||
|
export const savePintuan = (params) => {
|
||||||
|
return postRequest('/promotion/pintuan', params, { 'Content-type': 'application/json' })
|
||||||
|
}
|
||||||
|
// 编辑 拼团
|
||||||
|
export const editPintuan = (params) => {
|
||||||
|
return putRequest('/promotion/pintuan', params, { 'Content-type': 'application/json' })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加限时抢购 商品
|
||||||
|
export const setSeckillGoods = (params) => {
|
||||||
|
return postRequest(`/promotion/seckill/apply/${params.seckillId}`, params.applyVos, { 'Content-type': 'application/json' })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加限时抢购 商品
|
||||||
|
export const removeSeckillGoods = (seckillId, ids) => {
|
||||||
|
return deleteRequest(`/promotion/seckill/apply/${seckillId}/${ids}`)
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// 统一请求路径前缀在libs/axios.js中修改
|
// 统一请求路径前缀在libs/axios.js中修改
|
||||||
import {getRequest, postRequest, putRequest} from '@/libs/axios';
|
import {getRequest, postRequest, putRequest,deleteRequest} from '@/libs/axios';
|
||||||
|
|
||||||
//查询店铺列表
|
//查询店铺列表
|
||||||
export const getBillPage = (params) => {
|
export const getBillPage = (params) => {
|
||||||
@@ -87,3 +87,40 @@ export const downloadBill = (id) => {
|
|||||||
return getRequest(`/order/bill/downLoad/${id}`, {}, 'blob')
|
return getRequest(`/order/bill/downLoad/${id}`, {}, 'blob')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//查询运费模板
|
||||||
|
export const getShipTemplate = () => {
|
||||||
|
return getRequest(`/setting/freightTemplate`)
|
||||||
|
}
|
||||||
|
|
||||||
|
export const replyMemberComment = (id, params) => {
|
||||||
|
return putRequest(`/member/evaluation/reply/${id}`, params)
|
||||||
|
}
|
||||||
|
//删除运费模板
|
||||||
|
export const deleteShipTemplate = (id) => {
|
||||||
|
return deleteRequest(`/setting/freightTemplate/${id}`)
|
||||||
|
}
|
||||||
|
//新增运费模板
|
||||||
|
export const addShipTemplate = (params, headers) => {
|
||||||
|
return postRequest(`/setting/freightTemplate`, params, headers)
|
||||||
|
}
|
||||||
|
//编辑运费模板
|
||||||
|
export const editShipTemplate = (id, params, headers) => {
|
||||||
|
return putRequest(`/setting/freightTemplate/${id}`, params, headers)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取商家自提点
|
||||||
|
export const getShopAddress = (id, params) => {
|
||||||
|
return getRequest(`/store/member/storeAddress/`, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
export const editShopAddress = (id, params) => {
|
||||||
|
return putRequest(`/store/member/storeAddress/${id}`, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
export const addShopAddress = (params) => {
|
||||||
|
return postRequest(`/store/member/storeAddress/`, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
export const deleteShopAddress = (id) => {
|
||||||
|
return deleteRequest(`/store/member/storeAddress/${id}`)
|
||||||
|
}
|
||||||
|
|||||||
BIN
manager/src/assets/goodsType1.png
Normal file
BIN
manager/src/assets/goodsType1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
BIN
manager/src/assets/goodsType2.png
Normal file
BIN
manager/src/assets/goodsType2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 754 B |
BIN
manager/src/assets/goodsTypeTpl.png
Normal file
BIN
manager/src/assets/goodsTypeTpl.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.6 KiB |
@@ -10,14 +10,7 @@
|
|||||||
{{ item.year + '年' + item.month + '月' }}</Option>
|
{{ item.year + '年' + item.month + '月' }}</Option>
|
||||||
</Select>
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
<div class="shop-list" v-if="!closeShop">
|
|
||||||
<Select clearable @on-change="changeshop(selectedWay)" v-model="storeId" placeholder="店铺查询"
|
|
||||||
style="width:200px;margin-left:10px;">
|
|
||||||
<Scroll :on-reach-bottom="handleReachBottom">
|
|
||||||
<Option v-for="(item, index) in shopsData" :value="item.id" :key="index">{{ item.storeName }}</Option>
|
|
||||||
</Scroll>
|
|
||||||
</Select>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -57,15 +57,15 @@
|
|||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
<Modal width="1000" v-model="showOssManager" @on-ok="confirmUrls">
|
<Modal width="1000" v-model="showOssManager" @on-ok="confirmUrls">
|
||||||
<OssManage ref="ossManage" :isComponent="true" :initialize="showOssManager" @selected="handleCallback" />
|
<OssManage ref="ossManage" :isComponent="true" :initialize="showOssManager" @selected="(list)=>{ selectedImage = list}" @callback="handleCallback" />
|
||||||
</Modal>
|
</Modal>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import vuedraggable from "vuedraggable";
|
import vuedraggable from "vuedraggable";
|
||||||
import {uploadFile} from "@/libs/axios";
|
import {uploadFile} from "@/libs/axios";
|
||||||
|
// import OssManage from "@/views/sys/oss-manage/ossManage";
|
||||||
import OssManage from "@/views/sys/oss-manage/ossManage.vue";
|
import OssManage from "@/views/sys/oss-manage/ossManage.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "upload-image",
|
name: "upload-image",
|
||||||
components: {
|
components: {
|
||||||
@@ -88,11 +88,8 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
confirmUrl(){
|
|
||||||
|
|
||||||
},
|
|
||||||
handleClickUploadImage(){
|
handleClickUploadImage(){
|
||||||
this.show = true
|
this.show = true;
|
||||||
},
|
},
|
||||||
// 回调给父级
|
// 回调给父级
|
||||||
callback() {
|
callback() {
|
||||||
@@ -126,17 +123,18 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
confirmUrls(){
|
confirmUrls(){
|
||||||
this.selectedImage.length ? this.selectedImage.forEach(element => {
|
// this.selectedImage.length ? this.selectedImage.forEach(element => {
|
||||||
this.images.push({ url: element.url })
|
// this.images.push({ url: element.url })
|
||||||
}):''
|
// }):''
|
||||||
this.showOssManager = false
|
this.showOssManager = false
|
||||||
},
|
},
|
||||||
handleCallback(val){
|
handleCallback(val){
|
||||||
this.selectedImage = val
|
this.$Message.success("导入成功")
|
||||||
|
this.images.push({url:val.url})
|
||||||
},
|
},
|
||||||
// 从资源库中导入图片
|
// 从资源库中导入图片
|
||||||
importOSS(){
|
importOSS(){
|
||||||
this.showOssManager = true
|
this.showOssManager = true;
|
||||||
this.$refs.ossManage.selectImage = true;
|
this.$refs.ossManage.selectImage = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
222
manager/src/components/map/multiple-region.vue
Normal file
222
manager/src/components/map/multiple-region.vue
Normal file
@@ -0,0 +1,222 @@
|
|||||||
|
<template>
|
||||||
|
<Modal :mask-closable="false" :value="switched" v-model="switched" title="选择地址" @on-ok="submit" @on-cancel="cancel">
|
||||||
|
<div class="flex">
|
||||||
|
<Spin size="large" fix v-if="spinShow"></Spin>
|
||||||
|
<Tree ref="tree" class="tree" :data="data" expand-node show-checkbox multiple></Tree>
|
||||||
|
</div>
|
||||||
|
</Modal>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { getAllCity } from "@/api/index";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
switched: false, // 控制模态框显隐
|
||||||
|
spinShow: false, // 加载loading
|
||||||
|
data: [], // 地区数据
|
||||||
|
selectedWay: [], // 选择的地区
|
||||||
|
callBackData: "", // 打开组件的回显数据
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
clear() { // 引用该组件的父组件会调用
|
||||||
|
this.data = [];
|
||||||
|
this.selectedWay = [];
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 关闭
|
||||||
|
*/
|
||||||
|
cancel() {
|
||||||
|
this.switched = false;
|
||||||
|
|
||||||
|
// 关闭的时候所有数据设置成disabled为true
|
||||||
|
this.data.forEach((item) => {
|
||||||
|
this.$set(item, "disabled", false);
|
||||||
|
item.children.forEach((child) => {
|
||||||
|
this.$set(child, "disabled", false);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打开地图选择器
|
||||||
|
* @param {val} 回调的数据
|
||||||
|
* @param {index} 当前操作的运费模板的索引
|
||||||
|
*/
|
||||||
|
open(val, index) {
|
||||||
|
if (val) {
|
||||||
|
//已选中的地址
|
||||||
|
let checkedData = this.$store.state.shipTemplate;
|
||||||
|
|
||||||
|
let checkData = [];
|
||||||
|
let disabledData = checkedData.filter((item, i) => {
|
||||||
|
if (i != index) {
|
||||||
|
return i != index;
|
||||||
|
} else {
|
||||||
|
checkData.push(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 选中
|
||||||
|
checkData.forEach((check) => {
|
||||||
|
// 循环出已经选中的地址id
|
||||||
|
check.areaId.split(",").forEach((ids) => {
|
||||||
|
this.data.forEach((item) => {
|
||||||
|
// 如果当前省份下市区全部选中则选中该省份
|
||||||
|
if (check.selectedAll) {
|
||||||
|
check.area.split(",").forEach((area) => {
|
||||||
|
if (area == item.name) {
|
||||||
|
this.$set(item, "checked", true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 将市区继续循环
|
||||||
|
item.children.forEach((child, childIndex) => {
|
||||||
|
// 判断当前市区是否是已选中状态
|
||||||
|
if (item.checked) {
|
||||||
|
this.$set(child, "checked", true);
|
||||||
|
}
|
||||||
|
if (child.id == ids) {
|
||||||
|
this.$set(child, "checked", true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// 禁用
|
||||||
|
disabledData.forEach((dis) => {
|
||||||
|
// 循环出已经选中的地址id
|
||||||
|
dis.areaId.split(",").forEach((ids) => {
|
||||||
|
// 循环出省份
|
||||||
|
this.data.forEach((item) => {
|
||||||
|
// 如果当前省份下市区全部选中则禁用该省份
|
||||||
|
if (dis.selectedAll) {
|
||||||
|
dis.area.split(",").forEach((area) => {
|
||||||
|
if (area == item.name) {
|
||||||
|
this.$set(item, "disabled", true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 将市区继续循环
|
||||||
|
item.children.forEach((child, childIndex) => {
|
||||||
|
// 判断当前市区是否是已禁用状态
|
||||||
|
if (item.disabled) {
|
||||||
|
this.$set(child, "disabled", true);
|
||||||
|
} else {
|
||||||
|
if (child.id == ids) {
|
||||||
|
this.$set(child, "disabled", true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.switched ? (this.switched = true) : (this.switched = true);
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交并筛选出省市
|
||||||
|
*/
|
||||||
|
submit() {
|
||||||
|
// 筛选出省市
|
||||||
|
let list = this.$refs.tree.getCheckedAndIndeterminateNodes();
|
||||||
|
|
||||||
|
let sort = [];
|
||||||
|
list.forEach((item, i) => {
|
||||||
|
item.selectedList = [];
|
||||||
|
item.selectedAll = false;
|
||||||
|
// 筛选出当前的省份
|
||||||
|
if (item.level == "province" && !item.disabled) {
|
||||||
|
sort.push({
|
||||||
|
...item,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 筛选出当前选中的市
|
||||||
|
sort.forEach((sortItem, sortIndex) => {
|
||||||
|
if (
|
||||||
|
item.level != "province" &&
|
||||||
|
sortItem.id == item.parentId &&
|
||||||
|
!item.disabled
|
||||||
|
) {
|
||||||
|
sortItem.selectedList.push({
|
||||||
|
...item,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// 判断如果当前省是否全选
|
||||||
|
this.data.forEach((whether) => {
|
||||||
|
sort.forEach((item) => {
|
||||||
|
// 如果当前省匹配
|
||||||
|
if (
|
||||||
|
item.id == whether.id &&
|
||||||
|
item.selectedList.length == whether.children.length
|
||||||
|
) {
|
||||||
|
// 给一个全选子级的标识符
|
||||||
|
item.selectedList.forEach((child) => {
|
||||||
|
this.$set(child, "selectedAll", true);
|
||||||
|
});
|
||||||
|
this.$set(item, "selectedAll", true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
this.$emit("selected", sort);
|
||||||
|
|
||||||
|
this.cancel();
|
||||||
|
},
|
||||||
|
// 初始化地区数据
|
||||||
|
init() {
|
||||||
|
getAllCity().then((res) => {
|
||||||
|
if (res.result) {
|
||||||
|
res.result.forEach((item) => {
|
||||||
|
item.children.forEach((child) => {
|
||||||
|
child.title = child.name;
|
||||||
|
});
|
||||||
|
|
||||||
|
let data = {
|
||||||
|
title: item.name,
|
||||||
|
|
||||||
|
...item,
|
||||||
|
};
|
||||||
|
this.data.push(data);
|
||||||
|
|
||||||
|
this.selectedWay.push({ name: data.title, id: data.id });
|
||||||
|
});
|
||||||
|
this.$store.state.regions = this.data;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.flex {
|
||||||
|
display: flex;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.tree {
|
||||||
|
flex: 2;
|
||||||
|
}
|
||||||
|
.form {
|
||||||
|
flex: 8;
|
||||||
|
}
|
||||||
|
.button-list {
|
||||||
|
margin-left: 80px;
|
||||||
|
> * {
|
||||||
|
margin: 0 4px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/deep/ .ivu-modal-body {
|
||||||
|
height: 400px !important;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -31,6 +31,20 @@ export const otherRouter = {
|
|||||||
meta: { title: "个人中心" },
|
meta: { title: "个人中心" },
|
||||||
component: () => import("@/views/personal-center/personal-center.vue")
|
component: () => import("@/views/personal-center/personal-center.vue")
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "pickup",
|
||||||
|
title: "自提点设置",
|
||||||
|
name: "pickup",
|
||||||
|
meta: { title: "自提点设置" },
|
||||||
|
component: () => import("@/views/sys/setting-manage/pickup.vue")
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "goods-publish",
|
||||||
|
title: "商品发布",
|
||||||
|
name: "goods-publish",
|
||||||
|
meta: { title: "商品发布" },
|
||||||
|
component: () => import("@/views/goods/goodsOperation.vue")
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: "change-password",
|
path: "change-password",
|
||||||
title: "修改密码",
|
title: "修改密码",
|
||||||
@@ -55,6 +69,12 @@ export const otherRouter = {
|
|||||||
name: "shop",
|
name: "shop",
|
||||||
component: () => import("@/views/seller/shop/shopList.vue")
|
component: () => import("@/views/seller/shop/shopList.vue")
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "shipTemplate",
|
||||||
|
title: "自提点设置",
|
||||||
|
name: "shipTemplate",
|
||||||
|
component: () => import("@/views/logistics/shipTemplate.vue")
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: "shop-detail",
|
path: "shop-detail",
|
||||||
title: "店铺详细",
|
title: "店铺详细",
|
||||||
@@ -235,6 +255,12 @@ export const otherRouter = {
|
|||||||
name: "pintuan-goods",
|
name: "pintuan-goods",
|
||||||
component: () => import("@/views/promotions/pintuan/pintuan-goods.vue")
|
component: () => import("@/views/promotions/pintuan/pintuan-goods.vue")
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "promotions/pintuan/pintuan-create",
|
||||||
|
title: "添加拼团活动",
|
||||||
|
name: "pintuan-create",
|
||||||
|
component: () => import("@/views/promotions/pintuan/pintuan-create.vue")
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: "promotions/full-discount-detail",
|
path: "promotions/full-discount-detail",
|
||||||
title: "满减满折详情",
|
title: "满减满折详情",
|
||||||
|
|||||||
@@ -93,3 +93,12 @@ export const REQUIRED = {
|
|||||||
required: true,
|
required: true,
|
||||||
message:'请填写参数'
|
message:'请填写参数'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const WHITE_SPACE = {
|
||||||
|
whitespace: true,
|
||||||
|
message: "不可为纯空格",
|
||||||
|
}
|
||||||
|
export const VARCHAR60 = {
|
||||||
|
pattern: /^.{1,60}$/,
|
||||||
|
message: '长度应该限制在1-60个字符'
|
||||||
|
}
|
||||||
|
|||||||
@@ -9,6 +9,8 @@
|
|||||||
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
||||||
</Form>
|
</Form>
|
||||||
<Row class="operation" style="margin:10px 0;">
|
<Row class="operation" style="margin:10px 0;">
|
||||||
|
<Button @click="add" type="primary">添加</Button>
|
||||||
|
|
||||||
<Button @click="delAll" type="primary">批量下架</Button>
|
<Button @click="delAll" type="primary">批量下架</Button>
|
||||||
</Row>
|
</Row>
|
||||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom"
|
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom"
|
||||||
@@ -34,11 +36,34 @@
|
|||||||
show-sizer></Page>
|
show-sizer></Page>
|
||||||
</Row>
|
</Row>
|
||||||
</Card>
|
</Card>
|
||||||
|
<liliDialog
|
||||||
|
ref="liliDialog"
|
||||||
|
@selectedGoodsData="selectedGoodsData"
|
||||||
|
></liliDialog>
|
||||||
|
<Modal
|
||||||
|
:title="modalTitle"
|
||||||
|
v-model="modalVisible"
|
||||||
|
:mask-closable="false"
|
||||||
|
:width="500"
|
||||||
|
>
|
||||||
|
<Form ref="form" :model="form" :label-width="100" :rules="formValidate">
|
||||||
|
<FormItem label="分销佣金" prop="commission">
|
||||||
|
<Input v-model="form.commission" clearable style="width: 100%"/>
|
||||||
|
</FormItem>
|
||||||
|
</Form>
|
||||||
|
<div slot="footer">
|
||||||
|
<Button type="text" @click="modalVisible = false">取消</Button>
|
||||||
|
<Button type="primary" :loading="submitLoading" @click="handleSubmit"
|
||||||
|
>提交
|
||||||
|
</Button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</Modal>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { delDistributionGoods, getDistributionGoods } from "@/api/distribution";
|
import { delDistributionGoods, getDistributionGoods,distributionGoodsCheck } from "@/api/distribution";
|
||||||
import vueQr from "vue-qr";
|
import vueQr from "vue-qr";
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@@ -47,6 +72,11 @@ export default {
|
|||||||
name: "distributionGoods",
|
name: "distributionGoods",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
modalVisible: false, // 添加或编辑显示
|
||||||
|
modalTitle: "", // 添加或编辑标题
|
||||||
|
form:{
|
||||||
|
commission : 1 // 分销金额
|
||||||
|
},
|
||||||
loading: true, // 表单加载状态
|
loading: true, // 表单加载状态
|
||||||
searchForm: {
|
searchForm: {
|
||||||
// 搜索框初始化对象
|
// 搜索框初始化对象
|
||||||
@@ -155,11 +185,48 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
submitLoading: false, // 添加或编辑提交状态
|
||||||
data: [], // 表单数据
|
data: [], // 表单数据
|
||||||
total: 0, // 表单数据总数
|
total: 0, // 表单数据总数
|
||||||
|
skuId:0,
|
||||||
|
formValidate: {
|
||||||
|
commission: [
|
||||||
|
{ required: true, message: '请输入大于1小于9999的合法分销金额'},
|
||||||
|
{
|
||||||
|
pattern: /^[1-9]\d{0,3}(\.\d{1,2})?$/,
|
||||||
|
message: "请输入大于1小于9999的合法分销金额",
|
||||||
|
trigger: "change"
|
||||||
|
}],
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 选择商品回调
|
||||||
|
selectedGoodsData(v){
|
||||||
|
this.modalVisible = true
|
||||||
|
this.form.commission = 1
|
||||||
|
this.modalTitle = "保存分销商品"
|
||||||
|
this.skuId = v[0].id
|
||||||
|
},
|
||||||
|
// 添加商品
|
||||||
|
handleSubmit(){
|
||||||
|
this.$refs['form'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
distributionGoodsCheck(this.skuId,this.form).then(res => {
|
||||||
|
if(res.message === 'success') {
|
||||||
|
this.$Message.success("添加成功");
|
||||||
|
}
|
||||||
|
this.modalVisible = false
|
||||||
|
this.getDataList()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
add(){
|
||||||
|
this.$refs.liliDialog.flag = true;
|
||||||
|
this.$refs.liliDialog.goodsFlag = true;
|
||||||
|
this.$refs.liliDialog.singleGoods();
|
||||||
|
},
|
||||||
// 初始化数据
|
// 初始化数据
|
||||||
init() {
|
init() {
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
|
|||||||
@@ -20,12 +20,6 @@
|
|||||||
style="width: 200px"
|
style="width: 200px"
|
||||||
/>
|
/>
|
||||||
</Form-item>
|
</Form-item>
|
||||||
<Form-item label="店铺名称">
|
|
||||||
<Select v-model="searchForm.storeId" placeholder="请选择" @on-query-change="searchChange" filterable
|
|
||||||
clearable style="width: 150px">
|
|
||||||
<Option v-for="item in shopList" :value="item.id" :key="item.id">{{ item.storeName }}</Option>
|
|
||||||
</Select>
|
|
||||||
</Form-item>
|
|
||||||
<Form-item label="订单时间">
|
<Form-item label="订单时间">
|
||||||
<DatePicker type="daterange" v-model="timeRange" format="yyyy-MM-dd" placeholder="选择时间"
|
<DatePicker type="daterange" v-model="timeRange" format="yyyy-MM-dd" placeholder="选择时间"
|
||||||
style="width: 210px"></DatePicker>
|
style="width: 210px"></DatePicker>
|
||||||
@@ -68,7 +62,6 @@
|
|||||||
getDistributionOrder
|
getDistributionOrder
|
||||||
} from "@/api/distribution";
|
} from "@/api/distribution";
|
||||||
import {orderStatusList} from './dataJson'
|
import {orderStatusList} from './dataJson'
|
||||||
import {getShopListData} from '@/api/shops'
|
|
||||||
import vueQr from 'vue-qr'
|
import vueQr from 'vue-qr'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -80,7 +73,6 @@
|
|||||||
return {
|
return {
|
||||||
timeRange: [], // 范围时间
|
timeRange: [], // 范围时间
|
||||||
orderStatusList, // 订单状态列表
|
orderStatusList, // 订单状态列表
|
||||||
shopList: [], // 店铺列表
|
|
||||||
distributionId: this.$route.query.id, // 分销id
|
distributionId: this.$route.query.id, // 分销id
|
||||||
loading: true, // 表单加载状态
|
loading: true, // 表单加载状态
|
||||||
searchForm: { // 搜索框初始化对象
|
searchForm: { // 搜索框初始化对象
|
||||||
@@ -109,12 +101,7 @@
|
|||||||
tooltip: true,
|
tooltip: true,
|
||||||
minWidth:80,
|
minWidth:80,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: "店铺名称",
|
|
||||||
key: "storeName",
|
|
||||||
minWidth:80,
|
|
||||||
tooltip: true
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: "状态",
|
title: "状态",
|
||||||
slot: "distributionOrderStatus",
|
slot: "distributionOrderStatus",
|
||||||
@@ -147,7 +134,6 @@
|
|||||||
// 初始化数据
|
// 初始化数据
|
||||||
init() {
|
init() {
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
this.getShopList()
|
|
||||||
},
|
},
|
||||||
//分页 改变页码
|
//分页 改变页码
|
||||||
changePage(v) {
|
changePage(v) {
|
||||||
@@ -187,25 +173,7 @@
|
|||||||
this.total = this.data.length;
|
this.total = this.data.length;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
},
|
},
|
||||||
getShopList(val) { // 获取店铺列表 搜索用
|
|
||||||
const params = {
|
|
||||||
pageNumber: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
storeName: ''
|
|
||||||
}
|
|
||||||
if (val) {
|
|
||||||
params.storeName = val;
|
|
||||||
} else {
|
|
||||||
params.storeName = ''
|
|
||||||
}
|
|
||||||
|
|
||||||
getShopListData(params).then(res => {
|
|
||||||
this.shopList = res.result.records
|
|
||||||
})
|
|
||||||
},
|
|
||||||
searchChange(val) { // 店铺搜索,键盘点击回调
|
|
||||||
this.getShopList(val)
|
|
||||||
},
|
|
||||||
filterStatus (status) { // 过滤订单状态
|
filterStatus (status) { // 过滤订单状态
|
||||||
const arr = [
|
const arr = [
|
||||||
{status: 'WAIT_BILL', title: '待结算'},
|
{status: 'WAIT_BILL', title: '待结算'},
|
||||||
|
|||||||
528
manager/src/views/goods/addGoods.scss
Normal file
528
manager/src/views/goods/addGoods.scss
Normal file
@@ -0,0 +1,528 @@
|
|||||||
|
/*选择商品品类*/
|
||||||
|
.content-goods-publish {
|
||||||
|
padding: 15px;
|
||||||
|
margin: 0 auto;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 0.8em;
|
||||||
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||||
|
background: none repeat 0 0 #fff;
|
||||||
|
|
||||||
|
/*商品品类*/
|
||||||
|
.goods-category {
|
||||||
|
min-height: 500px;
|
||||||
|
border-radius: 0.8em;
|
||||||
|
text-align: left;
|
||||||
|
padding: 10px;
|
||||||
|
background: #ededed;
|
||||||
|
|
||||||
|
ul {
|
||||||
|
padding: 12px 8px;
|
||||||
|
list-style: none;
|
||||||
|
width: 300px;
|
||||||
|
background: none repeat 0 0 #fff;
|
||||||
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
|
||||||
|
border-radius: 0.4em;
|
||||||
|
display: inline-block;
|
||||||
|
letter-spacing: normal;
|
||||||
|
margin-right: 15px;
|
||||||
|
vertical-align: top;
|
||||||
|
word-spacing: normal;
|
||||||
|
|
||||||
|
li {
|
||||||
|
line-height: 20px;
|
||||||
|
padding: 10px 5px;
|
||||||
|
cursor: pointer;
|
||||||
|
color: #333;
|
||||||
|
font-size: 12px;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 当前品类被选中的样式 */
|
||||||
|
.activeClass {
|
||||||
|
border-radius: 0.4em;
|
||||||
|
background-color: rgba($color: $theme_color, $alpha: 0.2);
|
||||||
|
border: 1px solid rgba($color: $theme_color, $alpha: 0.8);
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!*当前选择的商品品类文字*!*/
|
||||||
|
.current-goods-category {
|
||||||
|
text-align: left;
|
||||||
|
padding: 10px;
|
||||||
|
width: 100%;
|
||||||
|
border: 1px solid #fbeed5;
|
||||||
|
color: #c09853;
|
||||||
|
background-color: #fcf8e3;
|
||||||
|
margin: 10px auto;
|
||||||
|
padding: 8px 35px 8px 14px;
|
||||||
|
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*编辑基本信息*/
|
||||||
|
.el-form {
|
||||||
|
padding-bottom: 80px;
|
||||||
|
|
||||||
|
.el-form-item {
|
||||||
|
width: 100%;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.sku-val {
|
||||||
|
justify-content: flex-start;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
|
>.ivu-form {
|
||||||
|
flex-wrap: wrap !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .sku-item-content-val {
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
div.base-info-item {
|
||||||
|
h4 {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
padding: 0 10px;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
background-color: #f8f8f8;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #333;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 40px;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
>div {
|
||||||
|
padding-left: 5%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-item-view {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: space-between;
|
||||||
|
// padding-left: 80px;
|
||||||
|
|
||||||
|
.form-item-view-wholesale {
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
.form-item-view-wholesale-preview {
|
||||||
|
padding-left: 5%;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.layout {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
width: 100%;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
.sku-item-content {
|
||||||
|
margin: 20px 0;
|
||||||
|
display: flex;
|
||||||
|
width: 100% !important;
|
||||||
|
flex: 1;
|
||||||
|
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: flex-start;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
>.ivu-card-body {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ivu-card-body {
|
||||||
|
width: 100%;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sku-item-content-name {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: flex-start;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.shop-category-text {
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-item-view-bottom {
|
||||||
|
margin-bottom: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-goods-properts-row {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
word-break: break-all;
|
||||||
|
white-space: normal;
|
||||||
|
width: 300px;
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-goods-properts {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 审核信息-拒绝原因 */
|
||||||
|
.auth-info {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form-item {
|
||||||
|
width: 30%;
|
||||||
|
min-width: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-name-width {
|
||||||
|
width: 50%;
|
||||||
|
min-width: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form-item__content {
|
||||||
|
margin-left: 120px;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
p.goods-group-manager {
|
||||||
|
padding-left: 7.5%;
|
||||||
|
text-align: left;
|
||||||
|
color: #999;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*teatarea*/
|
||||||
|
/deep/ .el-textarea {
|
||||||
|
width: 150%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.seo-text {
|
||||||
|
width: 150%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*折叠面板*/
|
||||||
|
.el-collapse-item {
|
||||||
|
/deep/ .el-collapse-item__header {
|
||||||
|
text-align: left;
|
||||||
|
background-color: #f8f8f8;
|
||||||
|
padding: 0 10px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #333;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form-item {
|
||||||
|
margin-left: 5%;
|
||||||
|
width: 25%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .el-form-item__content {
|
||||||
|
margin-left: 120px;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
p.goods-group-manager {
|
||||||
|
padding-left: 12%;
|
||||||
|
text-align: left;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .el-collapse-item__content {
|
||||||
|
padding: 10px 0;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.success {
|
||||||
|
>h1 {
|
||||||
|
font-size: 28px;
|
||||||
|
}
|
||||||
|
|
||||||
|
>* {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.operation {
|
||||||
|
>* {
|
||||||
|
margin: 10px 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*商品描述*/
|
||||||
|
.goods-intro {
|
||||||
|
line-height: 40;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 底部步骤 */
|
||||||
|
.footer {
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 20px;
|
||||||
|
padding: 10px;
|
||||||
|
background-color: #ffc;
|
||||||
|
position: sticky;
|
||||||
|
bottom: 0px;
|
||||||
|
text-align: center;
|
||||||
|
z-index: 999;
|
||||||
|
|
||||||
|
>.ivu-btn {
|
||||||
|
margin: 0 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*图片上传组件第一张图设置封面*/
|
||||||
|
.goods-images {
|
||||||
|
/deep/ li.el-upload-list__item:first-child {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ li.el-upload-list__item:first-child:after {
|
||||||
|
content: "封";
|
||||||
|
color: #fff;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 12px;
|
||||||
|
position: absolute;
|
||||||
|
left: -15px;
|
||||||
|
top: -6px;
|
||||||
|
width: 40px;
|
||||||
|
height: 24px;
|
||||||
|
padding-top: 6px;
|
||||||
|
background: #13ce66;
|
||||||
|
text-align: center;
|
||||||
|
-webkit-transform: rotate(-45deg);
|
||||||
|
transform: rotate(-45deg);
|
||||||
|
-webkit-box-shadow: 0 0 1pc 1px rgba(0, 0, 0, 0.2);
|
||||||
|
box-shadow: 0 0 1pc 1px rgba(0, 0, 0, 0.2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form-item__label {
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
|
||||||
|
.step-list {
|
||||||
|
height: 60px;
|
||||||
|
padding: 10px 30px;
|
||||||
|
background-color: #fff;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
border-radius: 0.8em;
|
||||||
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.add-sku-btn {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sku-item:not(:first-child) {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sku-upload-list {
|
||||||
|
text-align: center;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
border-radius: 4px;
|
||||||
|
overflow: hidden;
|
||||||
|
background: #fff;
|
||||||
|
position: relative;
|
||||||
|
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.preview-picture {
|
||||||
|
width: 100%;
|
||||||
|
margin: 0 auto;
|
||||||
|
display: block;
|
||||||
|
// text-align: center;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
// justify-self: center;
|
||||||
|
// align-self: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.preview-picture img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sku-upload-list img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sku-upload-list-cover {
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
background: rgba(0, 0, 0, 0.6);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sku-upload-list:hover .sku-upload-list-cover {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sku-upload-list-cover i {
|
||||||
|
color: #fff;
|
||||||
|
font-size: 20px;
|
||||||
|
cursor: pointer;
|
||||||
|
margin: 0 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.required {
|
||||||
|
/deep/ .ivu-form-item-label::before {
|
||||||
|
content: "*";
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 4px;
|
||||||
|
line-height: 1;
|
||||||
|
font-family: SimSun;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #ed4014;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.demo-upload-list {
|
||||||
|
width: 150px;
|
||||||
|
height: 150px;
|
||||||
|
text-align: center;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
border-radius: 4px;
|
||||||
|
display: inline-block;
|
||||||
|
background: #fff;
|
||||||
|
position: relative;
|
||||||
|
margin-right: 4px;
|
||||||
|
vertical-align: bottom;
|
||||||
|
}
|
||||||
|
|
||||||
|
.demo-upload-list img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.demo-upload-list-cover {
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
|
||||||
|
right: 0;
|
||||||
|
background: rgba(0, 0, 0, 0.6);
|
||||||
|
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.demo-upload-list:hover .demo-upload-list-cover {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.demo-upload-list-cover div {
|
||||||
|
margin-top: 50px;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
>i {
|
||||||
|
width: 50%;
|
||||||
|
margin-top: 8px;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 20px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.active-goods-type {
|
||||||
|
background: #e8e8e8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-type-list {
|
||||||
|
max-height: 500px;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.template-item {
|
||||||
|
justify-content: flex-start !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tree-bar {
|
||||||
|
height: auto !important;
|
||||||
|
max-height: auto !important;
|
||||||
|
min-height: 240px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-type-item {
|
||||||
|
padding: 20px 0;
|
||||||
|
width: 100%;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: 0.35s;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
/deep/ img {
|
||||||
|
margin-right: 20px;
|
||||||
|
width: 100px;
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/deep/ p {
|
||||||
|
color: #999;
|
||||||
|
font-size: 14px;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-type-item:hover {
|
||||||
|
background: #ededed;
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-list-box {
|
||||||
|
height: 450px;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 21px;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-item-view-wholesale-form-col {
|
||||||
|
height: 400px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-item-view-wholesale-row-del {
|
||||||
|
display: "flex";
|
||||||
|
justify-content: "space-between";
|
||||||
|
align-items: "center";
|
||||||
|
}
|
||||||
|
.promise-intro-btn{
|
||||||
|
margin: 10px 0;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
@@ -27,15 +27,7 @@
|
|||||||
style="width: 200px"
|
style="width: 200px"
|
||||||
/>
|
/>
|
||||||
</Form-item>
|
</Form-item>
|
||||||
<Form-item label="店铺名称" prop="id">
|
|
||||||
<Input
|
|
||||||
type="text"
|
|
||||||
v-model="searchForm.storeName"
|
|
||||||
placeholder="请输入店铺名称"
|
|
||||||
clearable
|
|
||||||
style="width: 200px"
|
|
||||||
/>
|
|
||||||
</Form-item>
|
|
||||||
<Form-item label="状态" prop="status">
|
<Form-item label="状态" prop="status">
|
||||||
<Select
|
<Select
|
||||||
v-model="searchForm.marketEnable"
|
v-model="searchForm.marketEnable"
|
||||||
@@ -77,6 +69,9 @@
|
|||||||
>搜索</Button
|
>搜索</Button
|
||||||
>
|
>
|
||||||
</Form>
|
</Form>
|
||||||
|
<div class="mt_10">
|
||||||
|
<Button type="primary" @click="handleAdd">新增商品</Button>
|
||||||
|
</div>
|
||||||
<Table
|
<Table
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
border
|
border
|
||||||
@@ -257,12 +252,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: "店铺名称",
|
|
||||||
key: "storeName",
|
|
||||||
minWidth: 100,
|
|
||||||
tooltip: true,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: "操作",
|
title: "操作",
|
||||||
key: "action",
|
key: "action",
|
||||||
@@ -349,6 +339,10 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 新增商品
|
||||||
|
handleAdd(){
|
||||||
|
this.$router.push('/goods-publish')
|
||||||
|
},
|
||||||
// 初始化数据
|
// 初始化数据
|
||||||
init() {
|
init() {
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
@@ -423,7 +417,7 @@ export default {
|
|||||||
showDetail(v) {
|
showDetail(v) {
|
||||||
let id = v.id;
|
let id = v.id;
|
||||||
this.$options.filters.customRouterPush({
|
this.$options.filters.customRouterPush({
|
||||||
name: "goods-detail",
|
name: "goods-publish",
|
||||||
query: { id: id },
|
query: { id: id },
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -154,12 +154,7 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
|
||||||
title: "店铺名称",
|
|
||||||
key: "storeName",
|
|
||||||
minWidth: 100,
|
|
||||||
tooltip: true,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: "操作",
|
title: "操作",
|
||||||
key: "action",
|
key: "action",
|
||||||
|
|||||||
@@ -65,12 +65,6 @@
|
|||||||
</Button>
|
</Button>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template slot="commissionRate" slot-scope="scope">
|
|
||||||
<priceColorScheme v-if="scope.row.commissionRate > 0" unit="" :color="$mainColor" :value="scope.row.commissionRate">%</priceColorScheme>
|
|
||||||
<priceColorScheme v-else :value="scope.row.commissionRate" unit="" >%</priceColorScheme>
|
|
||||||
<!-- {{ scope.row.commissionRate }}% -->
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<template slot="deleteFlag" slot-scope="{ row }">
|
<template slot="deleteFlag" slot-scope="{ row }">
|
||||||
<Tag
|
<Tag
|
||||||
:class="{ ml_10: row.deleteFlag }"
|
:class="{ ml_10: row.deleteFlag }"
|
||||||
@@ -113,9 +107,7 @@
|
|||||||
<FormItem label="排序值" prop="sortOrder" style="width: 345px">
|
<FormItem label="排序值" prop="sortOrder" style="width: 345px">
|
||||||
<InputNumber v-model="formAdd.sortOrder"></InputNumber>
|
<InputNumber v-model="formAdd.sortOrder"></InputNumber>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="佣金比例(%)" prop="commissionRate" style="width: 345px">
|
|
||||||
<InputNumber :max="100" :min="0" v-model="formAdd.commissionRate"></InputNumber>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem label="是否启用" prop="deleteFlag">
|
<FormItem label="是否启用" prop="deleteFlag">
|
||||||
<i-switch
|
<i-switch
|
||||||
size="large"
|
size="large"
|
||||||
@@ -240,7 +232,6 @@ export default {
|
|||||||
specForm: {}, // 规格数据
|
specForm: {}, // 规格数据
|
||||||
// 表单验证规则
|
// 表单验证规则
|
||||||
formValidate: {
|
formValidate: {
|
||||||
commissionRate: [regular.REQUIRED, regular.INTEGER],
|
|
||||||
name: [regular.REQUIRED, regular.VARCHAR20],
|
name: [regular.REQUIRED, regular.VARCHAR20],
|
||||||
sortOrder: [regular.REQUIRED, regular.INTEGER],
|
sortOrder: [regular.REQUIRED, regular.INTEGER],
|
||||||
},
|
},
|
||||||
@@ -254,12 +245,7 @@ export default {
|
|||||||
title: "状态",
|
title: "状态",
|
||||||
slot: "deleteFlag",
|
slot: "deleteFlag",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: "佣金",
|
|
||||||
key: "commissionRate",
|
|
||||||
|
|
||||||
slot: "commissionRate",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: "操作",
|
title: "操作",
|
||||||
key: "action",
|
key: "action",
|
||||||
@@ -340,7 +326,7 @@ export default {
|
|||||||
this.modalTitle = "添加子分类";
|
this.modalTitle = "添加子分类";
|
||||||
this.parentTitle = v.name;
|
this.parentTitle = v.name;
|
||||||
this.formAdd.level = eval(v.level + "+1");
|
this.formAdd.level = eval(v.level + "+1");
|
||||||
this.formAdd.commissionRate = v.commissionRate;
|
this.formAdd.commissionRate = 0;
|
||||||
this.showParent = true;
|
this.showParent = true;
|
||||||
delete this.formAdd.id;
|
delete this.formAdd.id;
|
||||||
this.formAdd.parentId = v.id;
|
this.formAdd.parentId = v.id;
|
||||||
@@ -355,7 +341,7 @@ export default {
|
|||||||
this.formAdd.level = v.level;
|
this.formAdd.level = v.level;
|
||||||
this.formAdd.parentId = v.parentId;
|
this.formAdd.parentId = v.parentId;
|
||||||
this.formAdd.sortOrder = v.sortOrder;
|
this.formAdd.sortOrder = v.sortOrder;
|
||||||
this.formAdd.commissionRate = v.commissionRate;
|
this.formAdd.commissionRate = 0;
|
||||||
this.formAdd.deleteFlag = v.deleteFlag;
|
this.formAdd.deleteFlag = v.deleteFlag;
|
||||||
this.formAdd.image = v.image;
|
this.formAdd.image = v.image;
|
||||||
this.showParent = false;
|
this.showParent = false;
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
<div>
|
<div>
|
||||||
<Card>
|
<Card>
|
||||||
<Row>
|
<Row>
|
||||||
<Form ref="searchForm" :model="searchForm" @keydown.enter.native="handleSearch" @submit.native.prevent inline :label-width="70" class="search-form">
|
<Form ref="searchForm" :model="searchForm" @keydown.enter.native="handleSearch" @submit.native.prevent inline
|
||||||
|
:label-width="70" class="search-form">
|
||||||
<Form-item label="会员名称" prop="memberName">
|
<Form-item label="会员名称" prop="memberName">
|
||||||
<Input type="text" v-model="searchForm.memberName" placeholder="请输入会员名称" clearable style="width: 200px" />
|
<Input type="text" v-model="searchForm.memberName" placeholder="请输入会员名称" clearable style="width: 200px" />
|
||||||
</Form-item>
|
</Form-item>
|
||||||
@@ -18,11 +19,16 @@
|
|||||||
<span slot="close">隐藏</span>
|
<span slot="close">隐藏</span>
|
||||||
</i-switch>
|
</i-switch>
|
||||||
</template>
|
</template>
|
||||||
|
<!-- 回复状态 -->
|
||||||
|
<template slot="replyStatus" slot-scope="scope">
|
||||||
|
<Tag v-if="scope.row.replyStatus" color="green">已回复</Tag>
|
||||||
|
<Tag v-if="!scope.row.replyStatus" color="red">未回复</Tag>
|
||||||
|
</template>
|
||||||
</Table>
|
</Table>
|
||||||
<Row type="flex" justify="end" class="mt_10">
|
<Row type="flex" justify="end" class="mt_10">
|
||||||
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage"
|
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage"
|
||||||
@on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]"
|
@on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small" show-total show-elevator
|
||||||
size="small" show-total show-elevator show-sizer></Page>
|
show-sizer></Page>
|
||||||
</Row>
|
</Row>
|
||||||
</Card>
|
</Card>
|
||||||
<!-- 评价详情 -->
|
<!-- 评价详情 -->
|
||||||
@@ -45,7 +51,6 @@
|
|||||||
<div class="right-container">
|
<div class="right-container">
|
||||||
<div class="border-b">{{ infoData.goodsName }}</div>
|
<div class="border-b">{{ infoData.goodsName }}</div>
|
||||||
<div class="border-b">
|
<div class="border-b">
|
||||||
<div class="div-height"> 店铺名称:{{ infoData.storeName }}</div>
|
|
||||||
<div class="div-height"> 订单号:{{ infoData.orderNo }}</div>
|
<div class="div-height"> 订单号:{{ infoData.orderNo }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -66,43 +71,74 @@
|
|||||||
<div style="margin-left: 40px">
|
<div style="margin-left: 40px">
|
||||||
<template v-if="infoData.images && infoData.images.length">
|
<template v-if="infoData.images && infoData.images.length">
|
||||||
<img style="width: 100px;height: 110px;margin-left: 2px"
|
<img style="width: 100px;height: 110px;margin-left: 2px"
|
||||||
v-for="(img,index) in infoData.images.split(',')" :src="img"
|
v-for="(img, index) in infoData.images.split(',')" :src="img" alt="" :key="index" />
|
||||||
alt="" :key="index"/>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</List>
|
</List>
|
||||||
</div>
|
</div>
|
||||||
<div class="border-b" v-if="infoData.reply">
|
<div class="mt_10">
|
||||||
|
<Form ref="form" :model="replyForm" :label-width="100">
|
||||||
|
<FormItem prop="reply" label="平台回复">
|
||||||
|
<Input :disabled="infoData.replyStatus" show-word-limit v-model="replyForm.reply" type="textarea" />
|
||||||
|
</FormItem>
|
||||||
|
<FormItem prop="reply" label="回复图片">
|
||||||
|
<vuedraggable :animation="200" :list="replyForm.replyImage">
|
||||||
|
<div v-for="(item, __index) in replyForm.replyImage" :key="__index" class="demo-upload-list">
|
||||||
|
<template>
|
||||||
|
<img :src="item" />
|
||||||
|
<div class="demo-upload-list-cover">
|
||||||
<div>
|
<div>
|
||||||
<div>
|
<Icon size="30" type="md-search" @click.native="handleViewGoodsPicture(item)"></Icon>
|
||||||
<div style="float: left"> 商家回复:</div>
|
<Icon size="30" v-if="!infoData.replyStatus" type="md-trash" @click.native="handleRemoveGoodsPicture(item)"></Icon>
|
||||||
<div style="margin-left: 60px">{{ infoData.reply }}</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="infoData.haveReplyImage">
|
|
||||||
<div style="margin-left: 60px">
|
|
||||||
<template v-if="infoData.replyImage && infoData.replyImage.length">
|
|
||||||
<img style="width: 100px;height: 110px" v-for="(img,index) in infoData.replyImage.split(',')" :key="index"
|
|
||||||
:src="img" alt=""/>
|
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
</vuedraggable>
|
||||||
|
<Button v-if="!infoData.replyStatus" @click="openPicModel">上传图片</Button>
|
||||||
|
</FormItem>
|
||||||
|
</Form>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div slot="footer">
|
||||||
|
<Button @click="infoFlag = false">取消</Button>
|
||||||
|
<Button type="error" :loading="modalLoading" @click="reply">提交</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</Modal>
|
||||||
</div>
|
<Modal v-model="picModelFlag" width="1200px" @on-ok="confirmUrls">
|
||||||
|
<ossManage ref="ossManage" :isComponent="true" :initialize="picModelFlag" @callback="callbackSelected"
|
||||||
|
@selected="(list) => { selectedImage = list }" />
|
||||||
|
</Modal>
|
||||||
|
<Modal v-model="goodsPictureVisible" title="View Image">
|
||||||
|
<img v-if="goodsPictureVisible" :src="previewGoodsPicture" style="width: 100%" />
|
||||||
</Modal>
|
</Modal>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import * as API_Member from "@/api/member";
|
import * as API_Member from "@/api/member";
|
||||||
|
import vuedraggable from "vuedraggable";
|
||||||
|
import ossManage from "@/views/sys/oss-manage/ossManage";
|
||||||
|
import { replyMemberComment } from '@/api/shops'
|
||||||
export default {
|
export default {
|
||||||
name: "goods-review", // 会员评价
|
name: "goods-review", // 会员评价
|
||||||
|
components: {
|
||||||
|
vuedraggable,
|
||||||
|
ossManage
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
modalLoading:false,
|
||||||
|
picModelFlag: false,
|
||||||
|
previewGoodsPicture: "",
|
||||||
|
replyForm: {
|
||||||
|
reply: '',
|
||||||
|
replyImage: []
|
||||||
|
},
|
||||||
infoData: {}, // 商品信息
|
infoData: {}, // 商品信息
|
||||||
infoFlag: false, // 评价展示
|
infoFlag: false, // 评价展示
|
||||||
infoTitle: "", // modal名称
|
infoTitle: "", // modal名称
|
||||||
@@ -116,6 +152,8 @@ export default {
|
|||||||
startDate: "", // 起始时间
|
startDate: "", // 起始时间
|
||||||
endDate: "", // 终止时间
|
endDate: "", // 终止时间
|
||||||
},
|
},
|
||||||
|
goodsPictureVisible: false,
|
||||||
|
selectedImage: [],
|
||||||
columns: [
|
columns: [
|
||||||
// 表头
|
// 表头
|
||||||
{
|
{
|
||||||
@@ -174,6 +212,14 @@ export default {
|
|||||||
align: "left",
|
align: "left",
|
||||||
width: 170
|
width: 170
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
title: "回复状态",
|
||||||
|
key: "replyStatus",
|
||||||
|
align: "left",
|
||||||
|
width: 100,
|
||||||
|
slot: "replyStatus",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: "页面展示",
|
title: "页面展示",
|
||||||
key: "shopDisable",
|
key: "shopDisable",
|
||||||
@@ -235,6 +281,53 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 回复
|
||||||
|
async reply(){
|
||||||
|
try {
|
||||||
|
if(!this.replyForm.reply){
|
||||||
|
this.$Message.warning('请输入回复内容')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.modalLoading = true
|
||||||
|
const params = JSON.parse(JSON.stringify(this.replyForm))
|
||||||
|
params.replyImage = params.replyImage.join(",")
|
||||||
|
params.id = this.infoData.id
|
||||||
|
const res = await replyMemberComment(this.infoData.id,params)
|
||||||
|
if(res.success){
|
||||||
|
this.modalLoading = false
|
||||||
|
this.$Message.success('回复成功')
|
||||||
|
this.infoFlag = false
|
||||||
|
this.init()
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
this.modalLoading = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 查看商品大图
|
||||||
|
handleViewGoodsPicture(url) {
|
||||||
|
this.previewGoodsPicture = url;
|
||||||
|
this.goodsPictureVisible = true;
|
||||||
|
},
|
||||||
|
// 移除商品图片
|
||||||
|
handleRemoveGoodsPicture(file) {
|
||||||
|
this.replyForm.replyImage =
|
||||||
|
this.replyForm.replyImage.filter((i) => i !== file);
|
||||||
|
},
|
||||||
|
// 图片选择后回调
|
||||||
|
callbackSelected(val) {
|
||||||
|
|
||||||
|
this.picModelFlag = false;
|
||||||
|
|
||||||
|
this.replyForm.replyImage.push(val.url);
|
||||||
|
|
||||||
|
},
|
||||||
|
openPicModel() {
|
||||||
|
this.$refs.ossManage.selectImage = true;
|
||||||
|
this.picModelFlag = true
|
||||||
|
},
|
||||||
|
confirmUrls() {
|
||||||
|
|
||||||
|
},
|
||||||
// 切换查看switch
|
// 切换查看switch
|
||||||
changeSwitchView(val) {
|
changeSwitchView(val) {
|
||||||
let status = val;
|
let status = val;
|
||||||
@@ -253,7 +346,6 @@ export default {
|
|||||||
changePage(v) {
|
changePage(v) {
|
||||||
this.searchForm.pageNumber = v;
|
this.searchForm.pageNumber = v;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
this.clearSelectAll();
|
|
||||||
},
|
},
|
||||||
// 分页 改变页数
|
// 分页 改变页数
|
||||||
changePageSize(v) {
|
changePageSize(v) {
|
||||||
@@ -293,6 +385,8 @@ export default {
|
|||||||
API_Member.getMemberInfoReview(v.id).then((res) => {
|
API_Member.getMemberInfoReview(v.id).then((res) => {
|
||||||
if (res.result) {
|
if (res.result) {
|
||||||
this.infoData = res.result;
|
this.infoData = res.result;
|
||||||
|
this.replyForm.reply = res.result.reply;
|
||||||
|
this.replyForm.replyImage = res.result.replyImage ? res.result.replyImage.split(",") : [];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -331,20 +425,24 @@ export default {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
border-style: none;
|
border-style: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product {
|
.product {
|
||||||
width: 140px;
|
width: 140px;
|
||||||
height: 160px;
|
height: 160px;
|
||||||
border: 1px solid #d9d9d9;
|
border: 1px solid #d9d9d9;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.show {
|
.show {
|
||||||
label {
|
label {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -356,6 +454,7 @@ label {
|
|||||||
float: left;
|
float: left;
|
||||||
margin-right: 2px;
|
margin-right: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.border-b {
|
.border-b {
|
||||||
border-bottom: 1px solid #e9e9e9;
|
border-bottom: 1px solid #e9e9e9;
|
||||||
width: 500px;
|
width: 500px;
|
||||||
@@ -363,11 +462,68 @@ label {
|
|||||||
position: relative;
|
position: relative;
|
||||||
margin-top: 12px;
|
margin-top: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.div-height {
|
.div-height {
|
||||||
line-height: 25px;
|
line-height: 25px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.score-content {
|
.score-content {
|
||||||
margin: 5px 0;
|
margin: 5px 0;
|
||||||
span{margin-right: 20px;}
|
|
||||||
|
span {
|
||||||
|
margin-right: 20px;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.demo-upload-list {
|
||||||
|
width: 150px;
|
||||||
|
height: 150px;
|
||||||
|
text-align: center;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
border-radius: 4px;
|
||||||
|
display: inline-block;
|
||||||
|
background: #fff;
|
||||||
|
position: relative;
|
||||||
|
margin-right: 4px;
|
||||||
|
vertical-align: bottom;
|
||||||
|
}
|
||||||
|
.demo-upload-list:hover .demo-upload-list-cover {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.demo-upload-list img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.demo-upload-list-cover {
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
|
||||||
|
right: 0;
|
||||||
|
background: rgba(0, 0, 0, 0.6);
|
||||||
|
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.demo-upload-list:hover .demo-upload-list-cover {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.demo-upload-list-cover div {
|
||||||
|
margin-top: 50px;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
>i {
|
||||||
|
width: 50%;
|
||||||
|
margin-top: 8px;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 20px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
60
manager/src/views/goods/goodsOperation.vue
Normal file
60
manager/src/views/goods/goodsOperation.vue
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
<template>
|
||||||
|
<div class="goods-operation">
|
||||||
|
<div class="step-list">
|
||||||
|
<steps :current="activestep" style="height:60px;margin-top: 10px">
|
||||||
|
<step title="选择商品品类"/>
|
||||||
|
<step title="填写商品详情"/>
|
||||||
|
<step title="商品发布成功"/>
|
||||||
|
</steps>
|
||||||
|
</div>
|
||||||
|
<!-- 第一步 选择分类 -->
|
||||||
|
<first-step ref='first' v-show="activestep === 0" @change="getFirstData"></first-step>
|
||||||
|
<!-- 第二步 商品详细信息 -->
|
||||||
|
<second-step ref='second' :firstData="firstData" v-if="activestep === 1"></second-step>
|
||||||
|
<!-- 第三步 发布完成 -->
|
||||||
|
<third-step ref='third' v-if="activestep === 2"></third-step>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import firstStep from './goodsOperationFirst'
|
||||||
|
import secondStep from './goodsOperationSec'
|
||||||
|
import thirdStep from './goodsOperationThird'
|
||||||
|
export default {
|
||||||
|
name: "addGoods",
|
||||||
|
components: {
|
||||||
|
firstStep,
|
||||||
|
secondStep,
|
||||||
|
thirdStep
|
||||||
|
},
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
/** 当前激活步骤*/
|
||||||
|
activestep: 0,
|
||||||
|
firstData: {}, // 第一步传递的数据
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 选择商品分类回调
|
||||||
|
getFirstData (item) {
|
||||||
|
this.firstData = item;
|
||||||
|
this.activestep = 1;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
// 编辑商品、模板
|
||||||
|
if (this.$route.query.id || this.$route.query.draftId) {
|
||||||
|
this.activestep = 1;
|
||||||
|
} else {
|
||||||
|
this.activestep = 0
|
||||||
|
this.$refs.first.selectGoodsType = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import "./addGoods.scss";
|
||||||
|
</style>
|
||||||
260
manager/src/views/goods/goodsOperationFirst.vue
Normal file
260
manager/src/views/goods/goodsOperationFirst.vue
Normal file
@@ -0,0 +1,260 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<!-- 选择商品类型 -->
|
||||||
|
<Modal v-model="selectGoodsType" width="550" :closable="false">
|
||||||
|
<div class="goods-type-list" v-if="!showGoodsTemplates">
|
||||||
|
<div
|
||||||
|
class="goods-type-item"
|
||||||
|
:class="{ 'active-goods-type': item.check }"
|
||||||
|
@click="handleClickGoodsType(item)"
|
||||||
|
v-for="(item, index) in goodsTypeWay"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
<img :src="item.img" />
|
||||||
|
<div>
|
||||||
|
<h2>{{ item.title }}</h2>
|
||||||
|
<p>{{ item.desc }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else class="goods-type-list">
|
||||||
|
<h2 @click="showGoodsTemplates = !showGoodsTemplates">返回</h2>
|
||||||
|
<div class="goods-list-box">
|
||||||
|
<Scroll :on-reach-bottom="handleReachBottom">
|
||||||
|
<div
|
||||||
|
class="goods-type-item template-item"
|
||||||
|
@click="handleClickGoodsTemplate(item)"
|
||||||
|
v-for="(item, tempIndex) in goodsTemplates"
|
||||||
|
:key="tempIndex"
|
||||||
|
>
|
||||||
|
<img :src="item.thumbnail" />
|
||||||
|
<div>
|
||||||
|
<h2>{{ item.goodsName }}</h2>
|
||||||
|
<p>{{ item.sellingPoint || "" }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Scroll>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Modal>
|
||||||
|
<!-- 商品分类 -->
|
||||||
|
<div class="content-goods-publish">
|
||||||
|
<div class="goods-category">
|
||||||
|
<ul v-if="categoryListLevel1.length > 0">
|
||||||
|
<li
|
||||||
|
v-for="(item, index) in categoryListLevel1"
|
||||||
|
:class="{ activeClass: category[0].name === item.name }"
|
||||||
|
@click="handleSelectCategory(item, index, 1)"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
<span>{{ item.name }}</span>
|
||||||
|
<span>></span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<ul v-if="categoryListLevel2.length > 0">
|
||||||
|
<li
|
||||||
|
v-for="(item, index) in categoryListLevel2"
|
||||||
|
:class="{ activeClass: category[1].name === item.name }"
|
||||||
|
@click="handleSelectCategory(item, index, 2)"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
<span>{{ item.name }}</span>
|
||||||
|
<span>></span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<ul v-if="categoryListLevel3.length > 0">
|
||||||
|
<li
|
||||||
|
v-for="(item, index) in categoryListLevel3"
|
||||||
|
:class="{ activeClass: category[2].name === item.name }"
|
||||||
|
@click="handleSelectCategory(item, index, 3)"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
<span>{{ item.name }}</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<p class="current-goods-category">
|
||||||
|
您当前选择的商品类别是:
|
||||||
|
<span>{{ category[0].name }}</span>
|
||||||
|
<span v-show="category[1].name">> {{ category[1].name }}</span>
|
||||||
|
<span v-show="category[2].name">> {{ category[2].name }}</span>
|
||||||
|
</p>
|
||||||
|
<template v-if="selectedTemplate.goodsName">
|
||||||
|
<Divider>已选商品模版:{{ selectedTemplate.goodsName }}</Divider>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
<!-- 底部按钮 -->
|
||||||
|
<div class="footer">
|
||||||
|
<ButtonGroup>
|
||||||
|
<Button type="primary" @click="selectGoodsType = true">商品类型</Button>
|
||||||
|
<Button type="primary" @click="next">下一步</Button>
|
||||||
|
</ButtonGroup>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import * as API_GOODS from "@/api/goods";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
selectedTemplate: {}, // 已选模板
|
||||||
|
selectGoodsType: false, // 展示选择商品分类modal
|
||||||
|
goodsTemplates: [], // 商品模板列表
|
||||||
|
showGoodsTemplates: false, //是否显示选择商品模板
|
||||||
|
goodsTypeWay: [
|
||||||
|
{
|
||||||
|
title: "实物商品",
|
||||||
|
img: require("@/assets/goodsType1.png"),
|
||||||
|
desc: "零售批发,物流配送",
|
||||||
|
type: "PHYSICAL_GOODS",
|
||||||
|
check: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "虚拟商品",
|
||||||
|
img: require("@/assets/goodsType2.png"),
|
||||||
|
desc: "虚拟核验,无需物流",
|
||||||
|
type: "VIRTUAL_GOODS",
|
||||||
|
check: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "商品模板导入",
|
||||||
|
img: require("@/assets/goodsTypeTpl.png"),
|
||||||
|
desc: "商品模板,一键导入",
|
||||||
|
check: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
// 商品分类选择数组
|
||||||
|
category: [
|
||||||
|
{ name: "", id: "" },
|
||||||
|
{ name: "", id: "" },
|
||||||
|
{ name: "", id: "" },
|
||||||
|
],
|
||||||
|
// 商品类型
|
||||||
|
goodsType: "",
|
||||||
|
/** 1级分类列表*/
|
||||||
|
categoryListLevel1: [],
|
||||||
|
/** 2级分类列表*/
|
||||||
|
categoryListLevel2: [],
|
||||||
|
/** 3级分类列表*/
|
||||||
|
categoryListLevel3: [],
|
||||||
|
searchParams: {
|
||||||
|
saveType: "TEMPLATE",
|
||||||
|
sort: "create_time",
|
||||||
|
order: "desc",
|
||||||
|
pageSize: 10,
|
||||||
|
pageNumber: 1,
|
||||||
|
},
|
||||||
|
templateTotal: 0,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 商品模版触底加载
|
||||||
|
handleReachBottom() {
|
||||||
|
setTimeout(() => {
|
||||||
|
if (
|
||||||
|
this.searchParams.pageNumber * this.searchParams.pageSize <=
|
||||||
|
this.templateTotal
|
||||||
|
) {
|
||||||
|
this.searchParams.pageNumber++;
|
||||||
|
this.GET_GoodsTemplate();
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
|
},
|
||||||
|
// 点击商品类型
|
||||||
|
handleClickGoodsType(val) {
|
||||||
|
this.goodsTypeWay.map((item) => {
|
||||||
|
return (item.check = false);
|
||||||
|
});
|
||||||
|
|
||||||
|
val.check = !val.check;
|
||||||
|
if (!val.type) {
|
||||||
|
this.GET_GoodsTemplate();
|
||||||
|
this.showGoodsTemplates = true;
|
||||||
|
} else {
|
||||||
|
this.goodsType = val.type;
|
||||||
|
this.selectedTemplate = {};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 点击商品模板
|
||||||
|
handleClickGoodsTemplate(val) {
|
||||||
|
this.selectedTemplate = val;
|
||||||
|
this.selectGoodsType = false;
|
||||||
|
this.$emit("change", { tempId: val.id });
|
||||||
|
},
|
||||||
|
// 获取商品模板
|
||||||
|
GET_GoodsTemplate() {
|
||||||
|
API_GOODS.getDraftGoodsListData(this.searchParams).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.goodsTemplates.push(...res.result.records);
|
||||||
|
this.templateTotal = res.result.total;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 选择商城商品分类 */
|
||||||
|
handleSelectCategory(row, index, level) {
|
||||||
|
if (level === 1) {
|
||||||
|
this.category.forEach((cate) => {
|
||||||
|
(cate.name = ""), (cate.id = "");
|
||||||
|
});
|
||||||
|
this.category[0].name = row.name;
|
||||||
|
this.category[0].id = row.id;
|
||||||
|
this.categoryListLevel2 = this.categoryListLevel1[index].children;
|
||||||
|
this.categoryListLevel3 = [];
|
||||||
|
} else if (level === 2) {
|
||||||
|
this.category[1].name = row.name;
|
||||||
|
this.category[1].id = row.id;
|
||||||
|
this.category[2].name = "";
|
||||||
|
this.category[2].id = "";
|
||||||
|
this.categoryListLevel3 = this.categoryListLevel2[index].children;
|
||||||
|
} else {
|
||||||
|
this.category[2].name = row.name;
|
||||||
|
this.category[2].id = row.id;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 查询下一级 商城商品分类*/
|
||||||
|
GET_NextLevelCategory(row) {
|
||||||
|
const _id = row && row.id !== 0 ? row.id : 0;
|
||||||
|
API_GOODS.getCategoryTree().then((res) => {
|
||||||
|
if (res.success && res.result) {
|
||||||
|
this.categoryListLevel1 = res.result;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 下一步
|
||||||
|
next() {
|
||||||
|
window.scrollTo(0, 0);
|
||||||
|
if (!this.goodsType && !this.selectedTemplate.goodsName) {
|
||||||
|
this.$Message.error("请选择商品类型");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.category[0].name) {
|
||||||
|
this.$Message.error("请选择商品分类");
|
||||||
|
return;
|
||||||
|
} else if (!this.category[2].name) {
|
||||||
|
this.$Message.error("必须选择到三级分类");
|
||||||
|
return;
|
||||||
|
} else if (this.category[2].name) {
|
||||||
|
let params = {
|
||||||
|
category: this.category,
|
||||||
|
goodsType: this.goodsType,
|
||||||
|
};
|
||||||
|
if (this.selectedTemplate.id) {
|
||||||
|
params.tempId = this.selectedTemplate.id;
|
||||||
|
this.$emit("change", params);
|
||||||
|
} else {
|
||||||
|
this.$emit("change", params);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.GET_NextLevelCategory();
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import "./addGoods.scss";
|
||||||
|
/deep/ .ivu-scroll-container {
|
||||||
|
height: 450px !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
2018
manager/src/views/goods/goodsOperationSec.vue
Normal file
2018
manager/src/views/goods/goodsOperationSec.vue
Normal file
File diff suppressed because it is too large
Load Diff
38
manager/src/views/goods/goodsOperationThird.vue
Normal file
38
manager/src/views/goods/goodsOperationThird.vue
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<template>
|
||||||
|
<div class="content-goods-publish">
|
||||||
|
<div class="success" style="text-align: left">
|
||||||
|
<h1>恭喜您,商品发布成功!</h1>
|
||||||
|
<div class="goToGoodsList" @click="gotoGoodsList">
|
||||||
|
<a>去店铺查看商品列表>></a>
|
||||||
|
</div>
|
||||||
|
<div class="operation">
|
||||||
|
<h3>您还可以:</h3>
|
||||||
|
<div>
|
||||||
|
1、继续
|
||||||
|
<a @click="gotoBack">发布商品</a>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
2、管理
|
||||||
|
<a @click="gotoGoodsList">商品列表</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
methods: {
|
||||||
|
// 跳转商品列表
|
||||||
|
gotoGoodsList() {
|
||||||
|
this.$router.push({name: "managerGoods"});
|
||||||
|
},
|
||||||
|
// 刷新页面
|
||||||
|
gotoBack() {
|
||||||
|
this.$router.go();
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import "./addGoods.scss";
|
||||||
|
</style>
|
||||||
@@ -31,15 +31,7 @@
|
|||||||
<div>订单数量</div>
|
<div>订单数量</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="count-item" @click="navigateTo('shopList')">
|
|
||||||
<div>
|
|
||||||
<Icon class="icon" size="31" type="ios-stats" />
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<div class="counts">{{ homeData.storeNum || 0 }}</div>
|
|
||||||
<div>店铺数量</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -183,15 +175,7 @@
|
|||||||
></Table>
|
></Table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- top10店铺 -->
|
|
||||||
<div class="card transform">
|
|
||||||
<h4>热卖店铺TOP10</h4>
|
|
||||||
<Table
|
|
||||||
stripe
|
|
||||||
:columns="tophotShopsColumns"
|
|
||||||
:data="topHotShopsData"
|
|
||||||
></Table>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -206,40 +190,7 @@ export default {
|
|||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 测试数据
|
|
||||||
test: {
|
|
||||||
a: "test",
|
|
||||||
languages: [],
|
|
||||||
},
|
|
||||||
// 测试数据结束
|
|
||||||
tophotShopsColumns: [
|
|
||||||
// 表格表头
|
|
||||||
{
|
|
||||||
type: "index",
|
|
||||||
width: 100,
|
|
||||||
title: "排名",
|
|
||||||
align: "center",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "店铺名称",
|
|
||||||
key: "storeName",
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
title: "价格",
|
|
||||||
key: "price",
|
|
||||||
|
|
||||||
render: (h, params) => {
|
|
||||||
return h("priceColorScheme", {props:{value:params.row.price,color:this.$mainColor}} );
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "销量",
|
|
||||||
key: "num",
|
|
||||||
width: 100,
|
|
||||||
sortable: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
|
|
||||||
tophotGoodsColumns: [
|
tophotGoodsColumns: [
|
||||||
{
|
{
|
||||||
@@ -268,7 +219,6 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
topHotGoodsData: [], //热卖商品集合
|
topHotGoodsData: [], //热卖商品集合
|
||||||
topHotShopsData: [], //热卖店铺集合
|
|
||||||
awaitTodoData: "", //今日待办集合
|
awaitTodoData: "", //今日待办集合
|
||||||
homeData: "", // 首页数据
|
homeData: "", // 首页数据
|
||||||
pvChart: "", // 流量统计
|
pvChart: "", // 流量统计
|
||||||
@@ -300,11 +250,7 @@ export default {
|
|||||||
res.success ? (this.topHotGoodsData = res.result) : "";
|
res.success ? (this.topHotGoodsData = res.result) : "";
|
||||||
},
|
},
|
||||||
|
|
||||||
// top10热卖店铺
|
|
||||||
async topHotShops() {
|
|
||||||
let res = await hotShops(this.params);
|
|
||||||
res.success ? (this.topHotShopsData = res.result) : "";
|
|
||||||
},
|
|
||||||
// 今日待办
|
// 今日待办
|
||||||
async awaitTodo() {
|
async awaitTodo() {
|
||||||
let res = await getNoticePage();
|
let res = await getNoticePage();
|
||||||
@@ -529,7 +475,6 @@ export default {
|
|||||||
// 初始化信息
|
// 初始化信息
|
||||||
init() {
|
init() {
|
||||||
this.toHotGoods();
|
this.toHotGoods();
|
||||||
this.topHotShops();
|
|
||||||
this.awaitTodo();
|
this.awaitTodo();
|
||||||
this.getHomeData();
|
this.getHomeData();
|
||||||
this.getPvChart();
|
this.getPvChart();
|
||||||
|
|||||||
382
manager/src/views/logistics/company.vue
Normal file
382
manager/src/views/logistics/company.vue
Normal file
@@ -0,0 +1,382 @@
|
|||||||
|
<template>
|
||||||
|
<div class="search">
|
||||||
|
<Card>
|
||||||
|
<Row class="operation padding-row">
|
||||||
|
<Button @click="add" type="primary">添加</Button>
|
||||||
|
</Row>
|
||||||
|
<Table :loading="loading" border :columns="columns" :data="data" ref="table">
|
||||||
|
<!-- 页面展示 -->
|
||||||
|
<template slot="disableSlot" slot-scope="{row}">
|
||||||
|
<i-switch size="large" :true-value="true" :false-value="false" :value="row.switch"
|
||||||
|
@on-change="changeSwitch(row)">
|
||||||
|
<span slot="open">开启</span>
|
||||||
|
<span slot="close">禁用</span>
|
||||||
|
</i-switch>
|
||||||
|
</template>
|
||||||
|
</Table>
|
||||||
|
<Row type="flex" justify="end" class="mt_10">
|
||||||
|
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage"
|
||||||
|
@on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small" show-total show-elevator
|
||||||
|
show-sizer></Page>
|
||||||
|
</Row>
|
||||||
|
</Card>
|
||||||
|
<Modal :title="modalTitle" v-model="modalVisible" :mask-closable="false" :width="500">
|
||||||
|
<Form ref="form" :model="form" :label-width="120" :rules="formValidate">
|
||||||
|
<FormItem label="物流公司名称" prop="name">
|
||||||
|
<Input v-model="form.name" clearable style="width: 100%" />
|
||||||
|
</FormItem>
|
||||||
|
<FormItem label="物流公司代码" prop="code">
|
||||||
|
<Input v-model="form.code" clearable style="width: 100%" />
|
||||||
|
</FormItem>
|
||||||
|
<FormItem label="支持电子面单">
|
||||||
|
<i-switch v-model="form.standBy" size="large">
|
||||||
|
<span slot="open">开</span>
|
||||||
|
<span slot="close">关</span>
|
||||||
|
</i-switch>
|
||||||
|
</FormItem>
|
||||||
|
<Card v-if="form.standBy === true" class="modalStyle">
|
||||||
|
<h3 style="color: #ff3c2a; margin-bottom: 10px">请输入详细信息</h3>
|
||||||
|
<Form ref="formValidate" :label-width="150" label-position="right" :model="faceSheetForm"
|
||||||
|
:rules="ruleValidate">
|
||||||
|
<FormItem label="customerName" prop="customerName">
|
||||||
|
<Input v-model="faceSheetForm.customerName" type="text" class="faceSheetInput"></Input>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem label="customerPwd" prop="customerPwd">
|
||||||
|
<Input v-model="faceSheetForm.customerPwd" type="text" class="faceSheetInput"></Input>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem label="monthCode" prop="monthCode">
|
||||||
|
<Input v-model="faceSheetForm.monthCode" type="text" class="faceSheetInput"></Input>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem label="sendSite" prop="sendSite">
|
||||||
|
<Input v-model="faceSheetForm.sendSite" type="text" class="faceSheetInput"></Input>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem label="sendStaff" prop="sendStaff">
|
||||||
|
<Input v-model="faceSheetForm.sendStaff" type="text" class="faceSheetInput"></Input>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem label="支付方式" prop="payType">
|
||||||
|
<Select v-model="faceSheetForm.payType" class="faceSheetInput">
|
||||||
|
<Option value="1">现付</Option>
|
||||||
|
<Option value="2">到付</Option>
|
||||||
|
<Option value="3">月结</Option>
|
||||||
|
<Option value="4">第三方支付(仅SF支持)</Option>
|
||||||
|
</Select>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem label="快递类型" prop="expType">
|
||||||
|
<Input v-model="faceSheetForm.expType" type="text" class="faceSheetInput" />
|
||||||
|
</FormItem>
|
||||||
|
<div style="width:100%;text-align:center;">
|
||||||
|
<a style="padding-right: 20px" @click="frontDownload('use')">使用说明</a>
|
||||||
|
<a @click="frontDownload('type')">快递类型</a>
|
||||||
|
</div>
|
||||||
|
</Form>
|
||||||
|
</Card>
|
||||||
|
<!-- <FormItem label="禁用状态" prop="disabled">
|
||||||
|
|
||||||
|
<i-switch true-value="OPEN" false-value="CLOSE" v-model="form.disabled" size="large">
|
||||||
|
<span slot="open">开启</span>
|
||||||
|
<span slot="close">禁用</span>
|
||||||
|
</i-switch>
|
||||||
|
</FormItem> -->
|
||||||
|
</Form>
|
||||||
|
<div slot="footer">
|
||||||
|
<Button type="text" @click="modalVisible = false">取消</Button>
|
||||||
|
<Button type="primary" :loading="submitLoading" @click="handleSubmit">提交
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</Modal>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
getLogisticsPage,
|
||||||
|
updateLogistics,
|
||||||
|
addLogistics,
|
||||||
|
delLogistics,
|
||||||
|
} from "@/api/logistics";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "logistics",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
faceSheetForm: {
|
||||||
|
faceSheetFlag: true,
|
||||||
|
customerName: "",
|
||||||
|
payType: '1',
|
||||||
|
expType: '1',
|
||||||
|
customerPwd: "",
|
||||||
|
monthCode: "",
|
||||||
|
sendSite: "",
|
||||||
|
sendStaff: "",
|
||||||
|
},
|
||||||
|
ruleValidate: {
|
||||||
|
// customerName: [{ required: true, message: "请填写必填项" ,trigger: "blur" }],
|
||||||
|
// payType: [{ required: true, message: "请填写必填项" ,trigger: "change" }],
|
||||||
|
// expType: [{ required: true, message: "请填写必填项" ,trigger: "blur" }],
|
||||||
|
// customerPwd: [{ required: true, message: "请填写必填项" ,trigger: "blur" }],
|
||||||
|
// monthCode: [{ required: true, message: "请填写必填项" ,trigger: "blur" }],
|
||||||
|
// sendSite: [{ required: true, message: "请填写必填项" ,trigger: "blur" }],
|
||||||
|
// sendStaff: [{ required: true, message: "请填写必填项" ,trigger: "blur" }],
|
||||||
|
|
||||||
|
},
|
||||||
|
openText: false,
|
||||||
|
loading: true, // 表单加载状态
|
||||||
|
modalVisible: false, // 添加或编辑显示
|
||||||
|
modalTitle: "", // 添加或编辑标题
|
||||||
|
searchForm: {
|
||||||
|
// 搜索框初始化对象
|
||||||
|
pageNumber: 1, // 当前页数
|
||||||
|
pageSize: 20, // 页面大小
|
||||||
|
sort: "createTime", // 默认排序字段
|
||||||
|
order: "desc", // 默认排序方式
|
||||||
|
name: "",
|
||||||
|
},
|
||||||
|
form: {
|
||||||
|
// 添加或编辑表单对象初始化数据
|
||||||
|
name: "",
|
||||||
|
disabled: "OPEN"
|
||||||
|
},
|
||||||
|
// 表单验证规则
|
||||||
|
formValidate: {
|
||||||
|
name: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请输入物流公司名称",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
code: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请输入物流公司代码",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
submitLoading: false, // 添加或编辑提交状态
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
title: "物流公司名称",
|
||||||
|
key: "name",
|
||||||
|
minWidth: 120,
|
||||||
|
sortable: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "物流公司编码",
|
||||||
|
key: "code",
|
||||||
|
minWidth: 120,
|
||||||
|
sortable: false,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
title: "创建时间",
|
||||||
|
key: "createTime",
|
||||||
|
width: 180,
|
||||||
|
sortable: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
key: "action",
|
||||||
|
align: "center",
|
||||||
|
width: 150,
|
||||||
|
render: (h, params) => {
|
||||||
|
return h("div", [
|
||||||
|
h(
|
||||||
|
"Button",
|
||||||
|
{
|
||||||
|
props: {
|
||||||
|
type: "info",
|
||||||
|
size: "small",
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
marginRight: "5px",
|
||||||
|
},
|
||||||
|
on: {
|
||||||
|
click: () => {
|
||||||
|
this.detail(params.row);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"修改"
|
||||||
|
),
|
||||||
|
h(
|
||||||
|
"Button",
|
||||||
|
{
|
||||||
|
props: {
|
||||||
|
type: "error",
|
||||||
|
size: "small",
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
marginRight: "5px",
|
||||||
|
},
|
||||||
|
on: {
|
||||||
|
click: () => {
|
||||||
|
this.remove(params.row);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"删除"
|
||||||
|
),
|
||||||
|
]);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
data: [], // 表单数据
|
||||||
|
total: 0, // 表单数据总数
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
frontDownload(val) {
|
||||||
|
var a = document.createElement("a"); //创建一个<a></a>标签
|
||||||
|
//根据点击按钮来下载不同文件
|
||||||
|
if (val === 'use') {
|
||||||
|
a.href = "static/instructions.xlsx"; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.
|
||||||
|
a.download = "使用说明.xlsx"; //设置下载文件文件名,这里加上.xlsx指定文件类型,pdf文件就指定.fpd即可
|
||||||
|
} else if (val === 'type') {
|
||||||
|
a.href = "static/logisticsType.xlsx"; // 给a标签的href属性值加上地址,注意,这里是绝对路径,不用加 点.
|
||||||
|
a.download = "快递类型.xlsx"; //设置下载文件文件名,这里加上.xlsx指定文件类型,pdf文件就指定.fpd即可
|
||||||
|
}
|
||||||
|
a.style.display = "none"; // 障眼法藏起来a标签
|
||||||
|
document.body.appendChild(a); // 将a标签追加到文档对象中
|
||||||
|
a.click(); // 模拟点击了a标签,会触发a标签的href的读取,浏览器就会自动下载了
|
||||||
|
a.remove(); // 一次性的,用完就删除a标签
|
||||||
|
},
|
||||||
|
// 初始化
|
||||||
|
init() {
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
// 分页 改变页码
|
||||||
|
changePage(v) {
|
||||||
|
this.searchForm.pageNumber = v;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
// 分页 改变页数
|
||||||
|
changePageSize(v) {
|
||||||
|
this.searchForm.pageSize = v;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
// 获取列表
|
||||||
|
getDataList() {
|
||||||
|
this.loading = true;
|
||||||
|
|
||||||
|
getLogisticsPage(this.searchForm).then((res) => {
|
||||||
|
this.loading = false;
|
||||||
|
if (res.success) {
|
||||||
|
const data = res.result.records;
|
||||||
|
data.forEach(e => {
|
||||||
|
e.switch = e.disabled === 'OPEN' ? true : false;
|
||||||
|
e.standBy = e.standBy == 'null' || !e.standBy ? false : true;
|
||||||
|
});
|
||||||
|
this.data = data;
|
||||||
|
console.log(data)
|
||||||
|
this.total = res.result.total;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.total = this.data.length;
|
||||||
|
this.loading = false;
|
||||||
|
},
|
||||||
|
// switch 切换状态
|
||||||
|
changeSwitch(v) {
|
||||||
|
this.form.name = v.name;
|
||||||
|
this.form.code = v.code;
|
||||||
|
this.form.standBy = v.standBy;
|
||||||
|
|
||||||
|
this.form.disabled = v.disabled === 'CLOSE' ? 'OPEN' : 'CLOSE';
|
||||||
|
updateLogistics(v.id, this.form).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$Message.success("操作成功");
|
||||||
|
this.getDataList();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 确认提交
|
||||||
|
handleSubmit() {
|
||||||
|
console.log('1', 1)
|
||||||
|
this.$refs.form.validate((valid) => {
|
||||||
|
console.log(valid)
|
||||||
|
if (valid) {
|
||||||
|
// this.submitLoading = true;
|
||||||
|
console.log(params, 'params', { ...this.form, ...this.faceSheetForm })
|
||||||
|
|
||||||
|
const params = { ...this.form, ...this.faceSheetForm }
|
||||||
|
|
||||||
|
console.log(params, 'params')
|
||||||
|
if (this.modalTitle == "添加") {
|
||||||
|
// 添加 避免编辑后传入id等数据 记得删除
|
||||||
|
delete params.id;
|
||||||
|
params.disabled = 'OPEN'
|
||||||
|
|
||||||
|
addLogistics(params).then((res) => {
|
||||||
|
this.submitLoading = false;
|
||||||
|
if (res.success) {
|
||||||
|
this.$Message.success("操作成功");
|
||||||
|
this.getDataList();
|
||||||
|
this.modalVisible = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
params.disabled = 'OPEN'
|
||||||
|
// 编辑
|
||||||
|
updateLogistics(this.id, params).then((res) => {
|
||||||
|
this.submitLoading = false;
|
||||||
|
if (res.success) {
|
||||||
|
this.$Message.success("操作成功");
|
||||||
|
this.getDataList();
|
||||||
|
this.modalVisible = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 添加信息
|
||||||
|
add() {
|
||||||
|
this.modalTitle = "添加";
|
||||||
|
this.form = {};
|
||||||
|
this.$refs.form.resetFields();
|
||||||
|
this.faceSheetForm = {};
|
||||||
|
this.modalVisible = true;
|
||||||
|
},
|
||||||
|
// 编辑
|
||||||
|
detail(v) {
|
||||||
|
this.id = v.id;
|
||||||
|
this.modalTitle = "修改";
|
||||||
|
this.modalVisible = true;
|
||||||
|
|
||||||
|
this.form.name = v.name;
|
||||||
|
this.form.code = v.code;
|
||||||
|
this.$set(this.form, 'standBy', v.standBy);
|
||||||
|
|
||||||
|
|
||||||
|
console.log(v)
|
||||||
|
|
||||||
|
|
||||||
|
// this.form.disabled = v.disabled
|
||||||
|
this.form.disabled = 'OPEN'
|
||||||
|
},
|
||||||
|
// 删除物流公司
|
||||||
|
remove(v) {
|
||||||
|
this.$Modal.confirm({
|
||||||
|
title: "确认删除",
|
||||||
|
// 记得确认修改此处
|
||||||
|
content: "您确认要删除 " + v.name + " ?",
|
||||||
|
loading: true,
|
||||||
|
onOk: () => {
|
||||||
|
// 删除
|
||||||
|
delLogistics(v.id).then((res) => {
|
||||||
|
this.$Modal.remove();
|
||||||
|
if (res.success) {
|
||||||
|
this.$Message.success("操作成功");
|
||||||
|
this.getDataList();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -1,321 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="search">
|
<div>
|
||||||
<Card>
|
<company />
|
||||||
<Row class="operation padding-row">
|
|
||||||
<Button @click="add" type="primary">添加</Button>
|
|
||||||
</Row>
|
|
||||||
<Table
|
|
||||||
:loading="loading"
|
|
||||||
border
|
|
||||||
:columns="columns"
|
|
||||||
:data="data"
|
|
||||||
ref="table"
|
|
||||||
>
|
|
||||||
<!-- 页面展示 -->
|
|
||||||
<template slot="disableSlot" slot-scope="{row}">
|
|
||||||
<i-switch size="large" :true-value="true" :false-value="false" :value="row.switch" @on-change="changeSwitch(row)">
|
|
||||||
<span slot="open">开启</span>
|
|
||||||
<span slot="close">禁用</span>
|
|
||||||
</i-switch>
|
|
||||||
</template>
|
|
||||||
</Table>
|
|
||||||
<Row type="flex" justify="end" class="mt_10">
|
|
||||||
<Page
|
|
||||||
:current="searchForm.pageNumber"
|
|
||||||
:total="total"
|
|
||||||
:page-size="searchForm.pageSize"
|
|
||||||
@on-change="changePage"
|
|
||||||
@on-page-size-change="changePageSize"
|
|
||||||
:page-size-opts="[10, 20, 50]"
|
|
||||||
size="small"
|
|
||||||
show-total
|
|
||||||
show-elevator
|
|
||||||
show-sizer
|
|
||||||
></Page>
|
|
||||||
</Row>
|
|
||||||
</Card>
|
|
||||||
<Modal
|
|
||||||
:title="modalTitle"
|
|
||||||
v-model="modalVisible"
|
|
||||||
:mask-closable="false"
|
|
||||||
:width="500"
|
|
||||||
>
|
|
||||||
<Form ref="form" :model="form" :label-width="120" :rules="formValidate">
|
|
||||||
<FormItem label="物流公司名称" prop="name">
|
|
||||||
<Input v-model="form.name" clearable style="width: 100%"/>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem label="物流公司代码" prop="code">
|
|
||||||
<Input v-model="form.code" clearable style="width: 100%"/>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem label="支持电子面单">
|
|
||||||
<i-switch v-model="form.standBy" size="large">
|
|
||||||
<span slot="open">开</span>
|
|
||||||
<span slot="close">关</span>
|
|
||||||
</i-switch>
|
|
||||||
</FormItem>
|
|
||||||
|
|
||||||
<FormItem label="禁用状态" prop="disabled">
|
|
||||||
|
|
||||||
<i-switch true-value="OPEN" false-value="CLOSE" v-model="form.disabled" size="large">
|
|
||||||
<span slot="open">开启</span>
|
|
||||||
<span slot="close">禁用</span>
|
|
||||||
</i-switch>
|
|
||||||
</FormItem>
|
|
||||||
</Form>
|
|
||||||
<div slot="footer">
|
|
||||||
<Button type="text" @click="modalVisible = false">取消</Button>
|
|
||||||
<Button type="primary" :loading="submitLoading" @click="handleSubmit"
|
|
||||||
>提交
|
|
||||||
</Button
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
</Modal>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import company from './company.vue'
|
||||||
getLogisticsPage,
|
|
||||||
updateLogistics,
|
|
||||||
addLogistics,
|
|
||||||
delLogistics,
|
|
||||||
} from "@/api/logistics";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "logistics",
|
components: {
|
||||||
|
company,
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: true, // 表单加载状态
|
|
||||||
modalVisible: false, // 添加或编辑显示
|
|
||||||
modalTitle: "", // 添加或编辑标题
|
|
||||||
searchForm: {
|
|
||||||
// 搜索框初始化对象
|
|
||||||
pageNumber: 1, // 当前页数
|
|
||||||
pageSize: 20, // 页面大小
|
|
||||||
sort: "createTime", // 默认排序字段
|
|
||||||
order: "desc", // 默认排序方式
|
|
||||||
name: "",
|
|
||||||
},
|
|
||||||
form: {
|
|
||||||
// 添加或编辑表单对象初始化数据
|
|
||||||
name: "",
|
|
||||||
disabled:"CLOSE"
|
|
||||||
},
|
|
||||||
// 表单验证规则
|
|
||||||
formValidate: {
|
|
||||||
name: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "请输入物流公司名称",
|
|
||||||
trigger: "blur",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
submitLoading: false, // 添加或编辑提交状态
|
|
||||||
columns: [
|
|
||||||
{
|
|
||||||
title: "物流公司名称",
|
|
||||||
key: "name",
|
|
||||||
minWidth: 120,
|
|
||||||
sortable: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "物流公司编码",
|
|
||||||
key: "code",
|
|
||||||
minWidth: 120,
|
|
||||||
sortable: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "状态",
|
|
||||||
key: "disabled",
|
|
||||||
width: 150,
|
|
||||||
slot: "disableSlot",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "创建时间",
|
|
||||||
key: "createTime",
|
|
||||||
width: 180,
|
|
||||||
sortable: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "操作",
|
|
||||||
key: "action",
|
|
||||||
align: "center",
|
|
||||||
width: 150,
|
|
||||||
render: (h, params) => {
|
|
||||||
return h("div", [
|
|
||||||
h(
|
|
||||||
"Button",
|
|
||||||
{
|
|
||||||
props: {
|
|
||||||
type: "info",
|
|
||||||
size: "small",
|
|
||||||
},
|
|
||||||
style: {
|
|
||||||
marginRight: "5px",
|
|
||||||
},
|
|
||||||
on: {
|
|
||||||
click: () => {
|
|
||||||
this.detail(params.row);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"修改"
|
|
||||||
),
|
|
||||||
h(
|
|
||||||
"Button",
|
|
||||||
{
|
|
||||||
props: {
|
|
||||||
type: "error",
|
|
||||||
size: "small",
|
|
||||||
},
|
|
||||||
style: {
|
|
||||||
marginRight: "5px",
|
|
||||||
},
|
|
||||||
on: {
|
|
||||||
click: () => {
|
|
||||||
this.remove(params.row);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"删除"
|
|
||||||
),
|
|
||||||
]);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
data: [], // 表单数据
|
|
||||||
total: 0, // 表单数据总数
|
|
||||||
};
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 初始化
|
|
||||||
init() {
|
|
||||||
this.getDataList();
|
|
||||||
},
|
|
||||||
// 分页 改变页码
|
|
||||||
changePage(v) {
|
|
||||||
this.searchForm.pageNumber = v;
|
|
||||||
this.getDataList();
|
|
||||||
},
|
|
||||||
// 分页 改变页数
|
|
||||||
changePageSize(v) {
|
|
||||||
this.searchForm.pageSize = v;
|
|
||||||
this.getDataList();
|
|
||||||
},
|
|
||||||
// 获取列表
|
|
||||||
getDataList() {
|
|
||||||
this.loading = true;
|
|
||||||
|
|
||||||
getLogisticsPage(this.searchForm).then((res) => {
|
|
||||||
this.loading = false;
|
|
||||||
if (res.success) {
|
|
||||||
const data = res.result.records;
|
|
||||||
data.forEach(e => {
|
|
||||||
e.switch = e.disabled === 'OPEN' ? true : false;
|
|
||||||
e.standBy = e.standBy == 'null' || !e.standBy ? false : true;
|
|
||||||
});
|
|
||||||
this.data = data;
|
|
||||||
console.log(data)
|
|
||||||
this.total = res.result.total;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.total = this.data.length;
|
|
||||||
this.loading = false;
|
|
||||||
},
|
|
||||||
// switch 切换状态
|
|
||||||
changeSwitch (v) {
|
|
||||||
this.form.name = v.name;
|
|
||||||
this.form.code = v.code;
|
|
||||||
this.form.standBy = v.standBy;
|
|
||||||
|
|
||||||
this.form.disabled = v.disabled === 'CLOSE' ? 'OPEN' : 'CLOSE';
|
|
||||||
updateLogistics(v.id, this.form).then((res) => {
|
|
||||||
if (res.success) {
|
|
||||||
this.$Message.success("操作成功");
|
|
||||||
this.getDataList();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 确认提交
|
|
||||||
handleSubmit() {
|
|
||||||
this.$refs.form.validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
this.submitLoading = true;
|
|
||||||
|
|
||||||
if (this.modalTitle == "添加") {
|
|
||||||
// 添加 避免编辑后传入id等数据 记得删除
|
|
||||||
delete this.form.id;
|
|
||||||
|
|
||||||
|
|
||||||
addLogistics(this.form).then((res) => {
|
|
||||||
this.submitLoading = false;
|
|
||||||
if (res.success) {
|
|
||||||
this.$Message.success("操作成功");
|
|
||||||
this.getDataList();
|
|
||||||
this.modalVisible = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
// 编辑
|
|
||||||
updateLogistics(this.id, this.form).then((res) => {
|
|
||||||
this.submitLoading = false;
|
|
||||||
if (res.success) {
|
|
||||||
this.$Message.success("操作成功");
|
|
||||||
this.getDataList();
|
|
||||||
this.modalVisible = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
},
|
|
||||||
// 添加信息
|
|
||||||
add() {
|
|
||||||
this.modalTitle = "添加";
|
|
||||||
this.form = {};
|
|
||||||
this.$refs.form.resetFields();
|
|
||||||
|
|
||||||
this.modalVisible = true;
|
|
||||||
},
|
|
||||||
// 编辑
|
|
||||||
detail(v) {
|
|
||||||
this.id = v.id;
|
|
||||||
this.modalTitle = "修改";
|
|
||||||
this.modalVisible = true;
|
|
||||||
|
|
||||||
this.form.name = v.name;
|
|
||||||
this.form.code = v.code;
|
|
||||||
console.log(v)
|
|
||||||
this.form.standBy = v.standBy;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.form.disabled = v.disabled
|
|
||||||
},
|
|
||||||
// 删除物流公司
|
|
||||||
remove(v) {
|
|
||||||
this.$Modal.confirm({
|
|
||||||
title: "确认删除",
|
|
||||||
// 记得确认修改此处
|
|
||||||
content: "您确认要删除 " + v.name + " ?",
|
|
||||||
loading: true,
|
|
||||||
onOk: () => {
|
|
||||||
// 删除
|
|
||||||
delLogistics(v.id).then((res) => {
|
|
||||||
this.$Modal.remove();
|
|
||||||
if (res.success) {
|
|
||||||
this.$Message.success("操作成功");
|
|
||||||
this.getDataList();
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.init();
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped></style>
|
||||||
|
|||||||
633
manager/src/views/logistics/shipTemplate.vue
Normal file
633
manager/src/views/logistics/shipTemplate.vue
Normal file
@@ -0,0 +1,633 @@
|
|||||||
|
<template>
|
||||||
|
<div class="search">
|
||||||
|
<Card>
|
||||||
|
<Row>
|
||||||
|
<Button @click="refresh">刷新</Button>
|
||||||
|
<Button @click="add" type="primary">添加</Button>
|
||||||
|
</Row>
|
||||||
|
<Tabs @on-click="handleClickType" v-model="currentTab" style="margin-top: 10px">
|
||||||
|
<TabPane label="运费模板" name="INFO">
|
||||||
|
<table class="ncsc-default-table order m-b-30" :key="index" v-for="(item,index) in shipInfo">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td class="sep-row" colspan="20"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th colspan="20">
|
||||||
|
<span class="temp-name">{{item.name}}</span>
|
||||||
|
<Tag v-if="item.pricingMethod==='FREE'" class="baoyou" color="warning">包邮</Tag>
|
||||||
|
<span class="fr m-r-5">
|
||||||
|
<time style="margin-right: 20px" title="最后编辑时间">
|
||||||
|
<i class="icon-time"></i>{{item.updateTime}}
|
||||||
|
</time>
|
||||||
|
<Button @click="edit(item)" type="info">修改</Button>
|
||||||
|
<Button @click="remove(item.id)" type="error">删除</Button>
|
||||||
|
</span>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
<tr v-if="item.pricingMethod!=='FREE'">
|
||||||
|
<td class="w10 bdl"></td>
|
||||||
|
<td class="cell-area tl w150">运送到</td>
|
||||||
|
<td class="w150">首件(重)</td>
|
||||||
|
<td class="w150">运费</td>
|
||||||
|
<td class="w150">续件(重)</td>
|
||||||
|
<td class="w150 bdr">运费</td>
|
||||||
|
</tr>
|
||||||
|
<template v-if="item.pricingMethod!=='FREE'">
|
||||||
|
<tr v-for="(children,index) in item.freightTemplateChildList" :key="index">
|
||||||
|
<td class="bdl"></td>
|
||||||
|
<td class="cell-area tl w150" style="width: 60%;white-space:normal;">{{children.area}}</td>
|
||||||
|
<td>
|
||||||
|
{{children.firstCompany}}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<span class="yuan">¥</span><span class="integer">{{children.firstPrice | unitPrice}}</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{children.continuedCompany}}
|
||||||
|
</td>
|
||||||
|
<td class="bdr">
|
||||||
|
<span class="yuan">¥</span><span class="integer">{{children.continuedPrice | unitPrice}}</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</template>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</TabPane>
|
||||||
|
<TabPane v-if="csTab" :label="title" :name="operation">
|
||||||
|
<Form ref="form" :model="form" :label-width="100" :rules="formValidate">
|
||||||
|
<FormItem label="模板名称" prop="name">
|
||||||
|
<Input v-model="form.name" maxlength="10" clearable style="width: 20%" />
|
||||||
|
</FormItem>
|
||||||
|
<FormItem label="计价方式" prop="pricingMethod">
|
||||||
|
<RadioGroup type="button" button-style="solid" v-model="form.pricingMethod">
|
||||||
|
<Radio label="WEIGHT">按重量</Radio>
|
||||||
|
<Radio label="NUM">按件数</Radio>
|
||||||
|
<Radio label="FREE">包邮</Radio>
|
||||||
|
</RadioGroup>
|
||||||
|
</FormItem>
|
||||||
|
|
||||||
|
<FormItem label="详细设置" v-if="form.pricingMethod !== 'FREE'">
|
||||||
|
<Alert type="warning" >点击右侧修改按钮编辑数据</Alert>
|
||||||
|
<div class="ncsu-trans-type" data-delivery="TRANSTYPE">
|
||||||
|
<div class="entity">
|
||||||
|
<div class="tbl-except">
|
||||||
|
<table cellspacing="0" class="ncsc-default-table">
|
||||||
|
<thead>
|
||||||
|
<tr style="border-bottom: 1px solid #ddd;">
|
||||||
|
<th class="w10"></th>
|
||||||
|
<th class="tl">运送到</th>
|
||||||
|
<th class="w10"></th>
|
||||||
|
<th class="w50">首件(重)</th>
|
||||||
|
<th class="w110">首费</th>
|
||||||
|
<th class="w50">续件(重)</th>
|
||||||
|
<th class="w110">续费</th>
|
||||||
|
<th class="w150">操作</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr class="bd-line" data-group="n1" v-for="(item,index) in form.freightTemplateChildList"
|
||||||
|
:key="index">
|
||||||
|
<td></td>
|
||||||
|
<td class="tl cell-area">
|
||||||
|
<span class="area-group">
|
||||||
|
<p style="display:inline-block">{{item.area}}</p>
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
<td></td>
|
||||||
|
<td>
|
||||||
|
<InputNumber class="text w40" type="text" v-model="item.firstCompany" :max="999" :min="0" :step="0.1" clearable/>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<InputNumber class="text w60" type="text" v-model="item.firstPrice" :max="999999" :min="0" clearable :formatter="value => `¥ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')"
|
||||||
|
:parser="value => value.replace(/\¥\s?|(,*)/g, '')">
|
||||||
|
</InputNumber>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<InputNumber class="text w40" type="text" v-model="item.continuedCompany" :max="999" :min="0" :step="0.1"
|
||||||
|
/>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<InputNumber class="text w60" type="text" v-model="item.continuedPrice" :max="999999" :min="0" clearable :formatter="value => `¥ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')"
|
||||||
|
:parser="value => value.replace(/\¥\s?|(,*)/g, '')">
|
||||||
|
</InputNumber>
|
||||||
|
</td>
|
||||||
|
<td class="nscs-table-handle">
|
||||||
|
<Button @click="editRegion(item,index)" type="info" size="small"
|
||||||
|
style="margin-bottom: 5px">修改
|
||||||
|
</Button>
|
||||||
|
<Button @click="removeTemplateChildren(index)" type="error"
|
||||||
|
size="small" style="margin-bottom: 5px">删除
|
||||||
|
</Button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="tbl-attach p-5">
|
||||||
|
<div class="div-error" v-if="saveError">
|
||||||
|
<i class="fa fa-exclamation-circle" aria-hidden="true"></i>
|
||||||
|
<Icon type="ios-information-circle-outline" />
|
||||||
|
指定地区城市为空或指定错误
|
||||||
|
<!-- <Icon type="ios-information-circle-outline" />
|
||||||
|
首费应输入正确的金额
|
||||||
|
<Icon type="ios-information-circle-outline" />
|
||||||
|
续费应输入正确的金额 -->
|
||||||
|
<Icon type="ios-information-circle-outline" />
|
||||||
|
首(续)件(重)费应输入大于0的整数
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</FormItem>
|
||||||
|
<Form-item>
|
||||||
|
<Button @click="addShipTemplateChildren(index)" v-if="form.pricingMethod !== 'FREE'"
|
||||||
|
icon="ios-create-outline">为指定城市设置运费模板
|
||||||
|
</Button>
|
||||||
|
<Button @click="handleSubmit" type="primary" style="margin-right:5px">保存
|
||||||
|
</Button>
|
||||||
|
</Form-item>
|
||||||
|
</Form>
|
||||||
|
</TabPane>
|
||||||
|
</Tabs>
|
||||||
|
</Card>
|
||||||
|
<multiple-region ref="region" @selected="handleSelect">
|
||||||
|
|
||||||
|
</multiple-region>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import * as API_Shop from "@/api/shops";
|
||||||
|
import multipleRegion from "@/components/map/multiple-region";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "shipTemplate",
|
||||||
|
components: {
|
||||||
|
multipleRegion,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
gotop: false,
|
||||||
|
index:'0',
|
||||||
|
selectedIndex: 0, //选中的地址模板下标
|
||||||
|
item: "", //运费模板子模板
|
||||||
|
shipInfo: {}, // 运费模板数据
|
||||||
|
title: "添加运费模板", // 模态框标题
|
||||||
|
operation: "add", // 操作状态
|
||||||
|
currentTab: "", // 当前模板tab
|
||||||
|
// submitLoading:false,
|
||||||
|
saveError: false, // 是否显示错误提示
|
||||||
|
csTab: false, // 添加运费模板显示
|
||||||
|
form: {
|
||||||
|
// 添加或编辑表单对象初始化数据
|
||||||
|
name: "",
|
||||||
|
pricingMethod: "WEIGHT",
|
||||||
|
},
|
||||||
|
formValidate: {
|
||||||
|
name: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请输入模板名称",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
pricingMethod: [
|
||||||
|
// 计费方式
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请选择计费方式",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
regions() {
|
||||||
|
return this.$store.state.regions;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 初始化数据
|
||||||
|
init() {
|
||||||
|
this.getData();
|
||||||
|
},
|
||||||
|
//切换tabPane
|
||||||
|
handleClickType(v) {
|
||||||
|
if (v == "INFO") {
|
||||||
|
this.getData();
|
||||||
|
this.csTab = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//添加运费模板
|
||||||
|
add() {
|
||||||
|
this.$refs.region.clear();
|
||||||
|
this.title = "添加运费模板";
|
||||||
|
this.csTab = true;
|
||||||
|
this.operation = "ADD";
|
||||||
|
this.currentTab = "ADD";
|
||||||
|
this.saveError = false;
|
||||||
|
this.form = {
|
||||||
|
pricingMethod: "WEIGHT",
|
||||||
|
name: "",
|
||||||
|
freightTemplateChildList: [
|
||||||
|
{
|
||||||
|
area: "",
|
||||||
|
areaId: "",
|
||||||
|
firstCompany: 0,
|
||||||
|
firstPrice: 0,
|
||||||
|
continuedCompany: 0,
|
||||||
|
continuedPrice: 0,
|
||||||
|
selectedAll: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
handleScroll(){
|
||||||
|
let scrolltop = document.documentElement.scrollTop || document.body.scrollTop;
|
||||||
|
scrolltop > 30 ? (this.gotop = true) : (this.gotop = false);
|
||||||
|
},
|
||||||
|
//修改运费模板
|
||||||
|
edit(item) {
|
||||||
|
this.title = "修改运费模板";
|
||||||
|
this.csTab = true;
|
||||||
|
this.operation = "EDIT";
|
||||||
|
this.currentTab = "EDIT";
|
||||||
|
this.saveError = false;
|
||||||
|
//给form赋值
|
||||||
|
this.form = item;
|
||||||
|
|
||||||
|
let top = document.documentElement.scrollTop || document.body.scrollTop;
|
||||||
|
// 实现滚动效果
|
||||||
|
const timeTop = setInterval(() => {
|
||||||
|
document.body.scrollTop = document.documentElement.scrollTop = top -= 50;
|
||||||
|
if (top <= 0) {
|
||||||
|
clearInterval(timeTop);
|
||||||
|
}
|
||||||
|
}, 0);
|
||||||
|
},
|
||||||
|
//选择地区
|
||||||
|
editRegion(item, index) {
|
||||||
|
this.selectedIndex = index;
|
||||||
|
this.item = item;
|
||||||
|
|
||||||
|
this.regions.forEach((addr) => {
|
||||||
|
this.form.freightTemplateChildList.forEach((child) => {
|
||||||
|
child.area.split(",").forEach((area) => {
|
||||||
|
if (addr.name == area) {
|
||||||
|
addr.selectedAll = true;
|
||||||
|
this.$set(child, "selectedAll", true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
this.$store.state.shipTemplate = this.form.freightTemplateChildList;
|
||||||
|
|
||||||
|
this.$refs.region.open(item, index);
|
||||||
|
},
|
||||||
|
//刷细数据
|
||||||
|
refresh() {
|
||||||
|
this.csTab = false;
|
||||||
|
this.operation = "INFO";
|
||||||
|
this.currentTab = "INFO";
|
||||||
|
this.getData();
|
||||||
|
this.$Message.success("刷新成功");
|
||||||
|
},
|
||||||
|
//运费模板数据
|
||||||
|
getData() {
|
||||||
|
API_Shop.getShipTemplate().then((res) => {
|
||||||
|
this.shipInfo = res.result;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 选择地址回调
|
||||||
|
*/
|
||||||
|
handleSelect(v) {
|
||||||
|
let area = "";
|
||||||
|
let areaId = "";
|
||||||
|
if (v != "") {
|
||||||
|
v.forEach((child) => {
|
||||||
|
if (child.selectedList != "") {
|
||||||
|
// 只显示省份
|
||||||
|
|
||||||
|
if (child.selectedAll) {
|
||||||
|
area += child.name + ",";
|
||||||
|
this.form.freightTemplateChildList[
|
||||||
|
this.selectedIndex
|
||||||
|
].selectedAll = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
child.selectedList.forEach((son) => {
|
||||||
|
if (child.selectedAll) {
|
||||||
|
areaId += son.id + ",";
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
// 显示城市
|
||||||
|
area += son.name + ",";
|
||||||
|
areaId += son.id + ",";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.item.area = area;
|
||||||
|
this.item.areaId = areaId;
|
||||||
|
},
|
||||||
|
//添加或者修改运费模板
|
||||||
|
handleSubmit() {
|
||||||
|
const headers = {
|
||||||
|
"Content-Type": "application/json;charset=utf-8",
|
||||||
|
};
|
||||||
|
|
||||||
|
this.$refs.form.validate((valid) => {
|
||||||
|
// const regNumber = /^\+?[1-9][0-9]*$/;
|
||||||
|
// const regMoney =
|
||||||
|
// /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/;
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.pricingMethod != "FREE") {
|
||||||
|
//校验运费模板详细信息
|
||||||
|
for (
|
||||||
|
let i = 0;
|
||||||
|
i < this.form.freightTemplateChildList.length;
|
||||||
|
i++
|
||||||
|
) {
|
||||||
|
if (
|
||||||
|
this.form.freightTemplateChildList[i].area == "" ||
|
||||||
|
this.form.freightTemplateChildList[i].firstCompany == "" ||
|
||||||
|
// this.form.freightTemplateChildList[i].firstPrice == "" ||
|
||||||
|
this.form.freightTemplateChildList[i].continuedCompany == ""
|
||||||
|
// this.form.freightTemplateChildList[i].continuedPrice == ""
|
||||||
|
) {
|
||||||
|
this.saveError = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// if (
|
||||||
|
// regNumber.test(
|
||||||
|
// this.form.freightTemplateChildList[i].firstCompany
|
||||||
|
// ) == false ||
|
||||||
|
// regNumber.test(
|
||||||
|
// this.form.freightTemplateChildList[i].continuedCompany
|
||||||
|
// ) == false ||
|
||||||
|
// regMoney.test(
|
||||||
|
// this.form.freightTemplateChildList[i].firstPrice
|
||||||
|
// ) == false ||
|
||||||
|
// regMoney.test(
|
||||||
|
// this.form.freightTemplateChildList[i].continuedPrice
|
||||||
|
// ) == false
|
||||||
|
// ) {
|
||||||
|
// this.saveError = true;
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.operation == "ADD") {
|
||||||
|
API_Shop.addShipTemplate(this.form, headers).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$Message.success("新增成功");
|
||||||
|
this.operation = "INFO";
|
||||||
|
this.currentTab = "INFO";
|
||||||
|
this.csTab = false;
|
||||||
|
this.getData();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
API_Shop.editShipTemplate(this.form.id, this.form, headers).then(
|
||||||
|
(res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$Message.success("新增成功");
|
||||||
|
this.operation = "INFO";
|
||||||
|
this.currentTab = "INFO";
|
||||||
|
this.csTab = false;
|
||||||
|
this.getData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//添加子模板
|
||||||
|
addShipTemplateChildren() {
|
||||||
|
const params = {
|
||||||
|
area: "",
|
||||||
|
areaId: "",
|
||||||
|
firstCompany: 0,
|
||||||
|
firstPrice: 0,
|
||||||
|
continuedCompany: 0,
|
||||||
|
continuedPrice: 0,
|
||||||
|
selectedAll: false,
|
||||||
|
};
|
||||||
|
this.form.freightTemplateChildList.push(params);
|
||||||
|
},
|
||||||
|
//删除一个子模板
|
||||||
|
removeTemplateChildren(index) {
|
||||||
|
if (Object.keys(this.form.freightTemplateChildList).length == 1) {
|
||||||
|
this.$Message.error("必须保留一个子模板");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.form.freightTemplateChildList.splice(index, 1);
|
||||||
|
},
|
||||||
|
//删除运费模板
|
||||||
|
remove(id) {
|
||||||
|
this.$Modal.confirm({
|
||||||
|
title: "确认删除",
|
||||||
|
// 记得确认修改此处
|
||||||
|
content: "您确认要删除此运费模板 ?",
|
||||||
|
loading: true,
|
||||||
|
onOk: () => {
|
||||||
|
API_Shop.deleteShipTemplate(id).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$Message.success("删除成功");
|
||||||
|
}
|
||||||
|
this.$Modal.remove();
|
||||||
|
this.getData();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.init();
|
||||||
|
window.addEventListener("scroll", this.handleScroll, true);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.ncsc-default-table thead th {
|
||||||
|
line-height: 20px;
|
||||||
|
color: #555;
|
||||||
|
background-color: #fafafa;
|
||||||
|
text-align: center;
|
||||||
|
height: 20px;
|
||||||
|
padding: 9px 0;
|
||||||
|
border-bottom: solid 1px #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ncsc-default-table {
|
||||||
|
line-height: 20px;
|
||||||
|
width: 100%;
|
||||||
|
border-collapse: collapse;
|
||||||
|
|
||||||
|
tbody th {
|
||||||
|
background-color: #fafafa;
|
||||||
|
border: solid #e6e6e6;
|
||||||
|
border-width: 1px 0;
|
||||||
|
padding: 4px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
tbody td {
|
||||||
|
color: #999;
|
||||||
|
background-color: #fff;
|
||||||
|
text-align: center;
|
||||||
|
padding: 6px 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.order tbody tr td {
|
||||||
|
border-bottom: 1px solid #e6e6e6;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order tbody tr td.bdr {
|
||||||
|
border-right: 1px solid #e6e6e6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order tbody tr th {
|
||||||
|
border: solid 1px #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order tbody tr td.sep-row {
|
||||||
|
height: 14px;
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.w10 {
|
||||||
|
width: 10px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tl {
|
||||||
|
text-align: left !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order tbody tr td.bdl {
|
||||||
|
border-left: 1px solid #e6e6e6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order tbody tr th .temp-name {
|
||||||
|
float: left;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #555;
|
||||||
|
// line-height: 44px;
|
||||||
|
margin: 7px 0 0 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.m-r-5 {
|
||||||
|
margin-right: 5px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fr {
|
||||||
|
float: right !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.m-b-30 {
|
||||||
|
margin-bottom: 10px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
margin: 3px 5px 0px 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
thead {
|
||||||
|
display: table-header-group;
|
||||||
|
vertical-align: middle;
|
||||||
|
border-color: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr {
|
||||||
|
display: table-row;
|
||||||
|
vertical-align: inherit;
|
||||||
|
border-color: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
caption,
|
||||||
|
th {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tl {
|
||||||
|
text-align: left !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
colgroup {
|
||||||
|
display: table-column-group;
|
||||||
|
}
|
||||||
|
|
||||||
|
button,
|
||||||
|
input,
|
||||||
|
select,
|
||||||
|
textarea {
|
||||||
|
font-family: inherit;
|
||||||
|
font-size: inherit;
|
||||||
|
line-height: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bd-line td {
|
||||||
|
border-bottom: solid 1px #eee;
|
||||||
|
}
|
||||||
|
|
||||||
|
.w40 {
|
||||||
|
width: 60px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.w60 {
|
||||||
|
width: 100px !important;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
Input[type="text"],
|
||||||
|
Input[type="password"],
|
||||||
|
Input.text,
|
||||||
|
Input.password {
|
||||||
|
display: inline-block;
|
||||||
|
min-height: 20px;
|
||||||
|
padding: 10px;
|
||||||
|
border: solid 1px #e6e9ee;
|
||||||
|
outline: 0 none;
|
||||||
|
}
|
||||||
|
|
||||||
|
ncsc-default-table {
|
||||||
|
line-height: 20px;
|
||||||
|
width: 100%;
|
||||||
|
border-collapse: collapse;
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ncsu-trans-type {
|
||||||
|
background-color: #fff;
|
||||||
|
border: solid #ddd 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
i,
|
||||||
|
cite,
|
||||||
|
em {
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cell-area {
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-error {
|
||||||
|
margin-left: 7px;
|
||||||
|
margin-bottom: -8px;
|
||||||
|
font-size: 15px;
|
||||||
|
color: #f00;
|
||||||
|
}
|
||||||
|
.baoyou {
|
||||||
|
margin: 6px 10px 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="message-con">
|
<div class="message-con">
|
||||||
|
<Button type="default" class="mr_10" @click="navigateTo('pickup')">自提点设置</Button>
|
||||||
|
<Button type="default" class="mr_10" @click="navigateTo('shipTemplate')">运费模版设置</Button>
|
||||||
<Dropdown trigger="click">
|
<Dropdown trigger="click">
|
||||||
|
|
||||||
<a href="javascript:void(0)">
|
<a href="javascript:void(0)">
|
||||||
|
|||||||
@@ -563,12 +563,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: "购买店铺",
|
|
||||||
key: "storeName",
|
|
||||||
width: 120,
|
|
||||||
tooltip: true
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: "下单时间",
|
title: "下单时间",
|
||||||
key: "createTime",
|
key: "createTime",
|
||||||
|
|||||||
@@ -38,15 +38,7 @@
|
|||||||
style="width: 200px"
|
style="width: 200px"
|
||||||
></DatePicker>
|
></DatePicker>
|
||||||
</Form-item>
|
</Form-item>
|
||||||
<Form-item label="商家名称" prop="storeName">
|
|
||||||
<Input
|
|
||||||
type="text"
|
|
||||||
v-model="searchForm.storeName"
|
|
||||||
placeholder="请输入商家名称"
|
|
||||||
clearable
|
|
||||||
style="width: 200px"
|
|
||||||
/>
|
|
||||||
</Form-item>
|
|
||||||
<Form-item label="会员名称" prop="memberName">
|
<Form-item label="会员名称" prop="memberName">
|
||||||
<Input
|
<Input
|
||||||
type="text"
|
type="text"
|
||||||
@@ -201,12 +193,7 @@ export default {
|
|||||||
key: "memberName",
|
key: "memberName",
|
||||||
width: 140,
|
width: 140,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: "商家名称",
|
|
||||||
key: "storeName",
|
|
||||||
minWidth: 100,
|
|
||||||
tooltip: true,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: "售后金额",
|
title: "售后金额",
|
||||||
key: "applyRefundPrice",
|
key: "applyRefundPrice",
|
||||||
|
|||||||
@@ -67,14 +67,7 @@
|
|||||||
|
|
||||||
<div class="div-form-default" v-if="afterSaleInfo.serviceStatus == 'APPLY'">
|
<div class="div-form-default" v-if="afterSaleInfo.serviceStatus == 'APPLY'">
|
||||||
<h3>处理意见</h3>
|
<h3>处理意见</h3>
|
||||||
<dl>
|
|
||||||
<dt>商家</dt>
|
|
||||||
<dd>
|
|
||||||
<div class="div-content">
|
|
||||||
{{ afterSaleInfo.storeName }}
|
|
||||||
</div>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<dl>
|
<dl>
|
||||||
<dt>是否同意</dt>
|
<dt>是否同意</dt>
|
||||||
<dd>
|
<dd>
|
||||||
@@ -134,37 +127,7 @@
|
|||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
<div class="div-form-default" v-if="afterSaleInfo.serviceStatus != 'APPLY'">
|
|
||||||
<h3>商家处理</h3>
|
|
||||||
<dl>
|
|
||||||
<dt>商家</dt>
|
|
||||||
<dd>
|
|
||||||
<div class="div-content">
|
|
||||||
{{ afterSaleInfo.storeName }}
|
|
||||||
</div>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
<!-- <dl>
|
|
||||||
<dt>审核结果</dt>
|
|
||||||
<dd>
|
|
||||||
<div class="div-content">
|
|
||||||
<span v-if="params.serviceStatus=='PASS'">
|
|
||||||
审核通过
|
|
||||||
</span>
|
|
||||||
<span v-else>
|
|
||||||
审核拒绝
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</dd>
|
|
||||||
</dl> -->
|
|
||||||
<dl>
|
|
||||||
<dt>备注信息</dt>
|
|
||||||
<dd>
|
|
||||||
{{ afterSaleInfo.auditRemark || "暂无备注信息" }}
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="div-flow-center"></div>
|
<div class="div-flow-center"></div>
|
||||||
<div class="div-flow-right">
|
<div class="div-flow-right">
|
||||||
@@ -245,6 +208,7 @@
|
|||||||
>
|
>
|
||||||
退款
|
退款
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
@@ -255,14 +219,7 @@
|
|||||||
"
|
"
|
||||||
>
|
>
|
||||||
<h3>物流信息</h3>
|
<h3>物流信息</h3>
|
||||||
<dl>
|
|
||||||
<dt>收货商家</dt>
|
|
||||||
<dd>{{ afterSaleInfo.storeName }}</dd>
|
|
||||||
</dl>
|
|
||||||
<dl>
|
|
||||||
<dt>收货商家手机</dt>
|
|
||||||
<dd>{{ storeMsg.salesConsigneeMobile }}</dd>
|
|
||||||
</dl>
|
|
||||||
<dl>
|
<dl>
|
||||||
<dt>收货地址</dt>
|
<dt>收货地址</dt>
|
||||||
<dd>
|
<dd>
|
||||||
@@ -291,6 +248,12 @@
|
|||||||
>
|
>
|
||||||
查询物流
|
查询物流
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button type="info" :loading="submitLoading" @click="sellerConfirmSubmit('PASS')" style="margin-left: 5px" v-if="afterSaleInfo.afterSaleAllowOperationVO.rog">
|
||||||
|
确认收货
|
||||||
|
</Button>
|
||||||
|
<Button type="primary" :loading="submitLoading" @click="sellerConfirmSubmit('REFUSE')" style="margin-left: 5px" v-if="afterSaleInfo.afterSaleAllowOperationVO.rog">
|
||||||
|
拒收
|
||||||
|
</Button>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
@@ -411,6 +374,33 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
//商家确认收货
|
||||||
|
sellerConfirmSubmit(type) {
|
||||||
|
let title = "确认收货";
|
||||||
|
let content = "请确认已经收到退货货物?";
|
||||||
|
let message = "收货成功";
|
||||||
|
if (type !== "PASS") {
|
||||||
|
title = "确认拒收";
|
||||||
|
content = "确认拒收此货物?";
|
||||||
|
message = "拒收成功";
|
||||||
|
this.params.serviceStatus = "REFUSE";
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$Modal.confirm({
|
||||||
|
title: title,
|
||||||
|
content: content,
|
||||||
|
loading: true,
|
||||||
|
onOk: () => {
|
||||||
|
API_Order.afterSaleSellerConfirm(this.sn, this.params).then((res) => {
|
||||||
|
this.$Modal.remove();
|
||||||
|
if (res.success) {
|
||||||
|
this.$Message.success(message);
|
||||||
|
this.getDetail();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
// 获取售后详情
|
// 获取售后详情
|
||||||
getDetail() {
|
getDetail() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
|||||||
@@ -137,9 +137,9 @@
|
|||||||
<Button type="primary" ghost :loading="submitLoading" v-if="arbitrationResultShow == false" @click="arbitrationHandle">
|
<Button type="primary" ghost :loading="submitLoading" v-if="arbitrationResultShow == false" @click="arbitrationHandle">
|
||||||
直接仲裁结束投诉流程
|
直接仲裁结束投诉流程
|
||||||
</Button>
|
</Button>
|
||||||
<Button :loading="submitLoading" v-if="complaintInfo.complainStatus == 'NEW'" @click="handleStoreComplaint">
|
<!-- <Button :loading="submitLoading" v-if="complaintInfo.complainStatus == 'NEW'" @click="handleStoreComplaint">
|
||||||
交由商家申诉
|
交由商家申诉
|
||||||
</Button>
|
</Button> -->
|
||||||
<Button type="primary" :loading="submitLoading" v-if="arbitrationResultShow == true" @click="arbitrationHandleSubmit">
|
<Button type="primary" :loading="submitLoading" v-if="arbitrationResultShow == true" @click="arbitrationHandleSubmit">
|
||||||
提交仲裁
|
提交仲裁
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -64,12 +64,7 @@ export default {
|
|||||||
minWidth: 180,
|
minWidth: 180,
|
||||||
tooltip: true,
|
tooltip: true,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: "店铺名称",
|
|
||||||
key: "storeName",
|
|
||||||
minWidth: 100,
|
|
||||||
tooltip: true,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: "支付方式",
|
title: "支付方式",
|
||||||
key: "paymentMethod",
|
key: "paymentMethod",
|
||||||
|
|||||||
@@ -7,6 +7,10 @@
|
|||||||
<Button v-if="allowOperation.editConsignee" @click="editAddress" type="primary" ghost>修改收货地址</Button>
|
<Button v-if="allowOperation.editConsignee" @click="editAddress" type="primary" ghost>修改收货地址</Button>
|
||||||
<Button v-if="allowOperation.cancel" @click="orderCancel" type="warning" ghost>订单取消</Button>
|
<Button v-if="allowOperation.cancel" @click="orderCancel" type="warning" ghost>订单取消</Button>
|
||||||
<Button v-if="orderInfo.order.orderStatus === 'UNPAID'" @click="confirmPrice" type="primary">收款</Button>
|
<Button v-if="orderInfo.order.orderStatus === 'UNPAID'" @click="confirmPrice" type="primary">收款</Button>
|
||||||
|
<Button v-if="allowOperation.ship" @click="groupShip" type="primary">分包裹发货</Button>
|
||||||
|
<Button v-if="allowOperation.showLogistics || orderPackage.length > 0" @click="checkLogistics" type="primary">查看物流</Button>
|
||||||
|
<Button v-if="allowOperation.take" @click="orderTake" type="primary">订单核销</Button>
|
||||||
|
<Button @click="modifyRemark" type="primary">添加备注</Button>
|
||||||
<Button @click="orderLog" type="info" ghost>订单日志</Button>
|
<Button @click="orderLog" type="info" ghost>订单日志</Button>
|
||||||
<Button @click="printOrder" type="primary" ghost style="float:right;"
|
<Button @click="printOrder" type="primary" ghost style="float:right;"
|
||||||
v-if="$route.query.orderType != 'VIRTUAL'">打印发货单</Button>
|
v-if="$route.query.orderType != 'VIRTUAL'">打印发货单</Button>
|
||||||
@@ -24,7 +28,10 @@
|
|||||||
{{ orderInfo.order.clientType | clientTypeWay }}
|
{{ orderInfo.order.clientType | clientTypeWay }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="div-item">
|
||||||
|
<div class="div-item-left">订单备注:</div>
|
||||||
|
<div class="div-item-right">{{ orderInfo.order.sellerRemark }}</div>
|
||||||
|
</div>
|
||||||
<div class="div-item">
|
<div class="div-item">
|
||||||
<div class="div-item-left">订单状态:</div>
|
<div class="div-item-left">订单状态:</div>
|
||||||
<div class="div-item-right">
|
<div class="div-item-right">
|
||||||
@@ -431,7 +438,97 @@
|
|||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
|
<!--订单分包裹发货-->
|
||||||
|
<Modal v-model="groupShipModal" :loading="shipLoading" title="分包裹发快递" width="1000">
|
||||||
|
<div>
|
||||||
|
<Form ref="groupOrderDeliveryForm" :model="groupOrderDeliveryForm" :label-width="90" :rules="groupOrderDeliverFormValidate" style="position: relative">
|
||||||
|
<FormItem label="物流公司" prop="logisticsId">
|
||||||
|
<Select v-model="groupOrderDeliveryForm.logisticsId" placeholder="请选择" style="width: 250px">
|
||||||
|
<Option v-for="(item, i) in checkedLogistics" :key="i" :value="item.id">{{ item.name }}
|
||||||
|
</Option>
|
||||||
|
</Select>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem label="物流单号" prop="logisticsNo">
|
||||||
|
<Input v-model="groupOrderDeliveryForm.logisticsNo" style="width: 250px" />
|
||||||
|
</FormItem>
|
||||||
|
</Form>
|
||||||
|
</div>
|
||||||
|
<Table @on-select="selectGroupShipGoodsMethods" @on-selection-change="selectGroupShipGoodsMethods"
|
||||||
|
@on-select-all="selectGroupShipGoodsMethods" :data="data" :columns="groupShipColumns" border>
|
||||||
|
<template slot="goodsSlot" slot-scope="{ row }">
|
||||||
|
<div style="margin-top: 5px; height: 80px; display: flex">
|
||||||
|
<div style="">
|
||||||
|
<img :src="row.image" style="height: 60px; margin-top: 1px; width: 60px" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="margin-left: 13px">
|
||||||
|
<div class="div-zoom">
|
||||||
|
<a @click="linkTo(row.goodsId, row.skuId)">{{
|
||||||
|
row.goodsName
|
||||||
|
}}</a>
|
||||||
|
</div>
|
||||||
|
<span v-for="(item, key) in JSON.parse(row.specs)" :key="key">
|
||||||
|
<span v-show="key != 'images'" style="font-size: 12px; color: #999999">
|
||||||
|
{{ key }} : {{ item }}
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
<Poptip trigger="hover" style="display: block" title="扫码在手机中查看" transfer>
|
||||||
|
<div slot="content">
|
||||||
|
<vue-qr :text="wapLinkTo(row.goodsId, row.skuId)" :margin="0" colorDark="#000" colorLight="#fff"
|
||||||
|
:size="150"></vue-qr>
|
||||||
|
</div>
|
||||||
|
<img src="../../../assets/qrcode.svg" class="hover-pointer" width="20" height="20" alt="" />
|
||||||
|
</Poptip>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template slot="numSlot" slot-scope="{ row, index }">
|
||||||
|
<InputNumber :min="0" :max="row.___num - row.deliverNumber" v-model="data[index].canNum">
|
||||||
|
</InputNumber>
|
||||||
|
</template>
|
||||||
|
</Table>
|
||||||
|
<div slot="footer">
|
||||||
|
<Button type="default" @click="groupShipModal = false">取消</Button>
|
||||||
|
<Button type="primary" @click="confirmShipGroupGoods">确定</Button>
|
||||||
|
</div>
|
||||||
|
</Modal>
|
||||||
|
|
||||||
|
<!-- 订单核销 -->
|
||||||
|
<Modal v-model="orderTakeModal" width="530">
|
||||||
|
<p slot="header">
|
||||||
|
<Icon type="edit"></Icon>
|
||||||
|
<span>订单核销</span>
|
||||||
|
</p>
|
||||||
|
<div>
|
||||||
|
<Form ref="orderTakeForm" :model="orderTakeForm" label-position="left" :label-width="100"
|
||||||
|
:rules="orderTakeValidate">
|
||||||
|
<FormItem label="核销码" prop="qrCode">
|
||||||
|
<Input v-model="orderTakeForm.qrCode" size="large" maxlength="10"></Input>
|
||||||
|
</FormItem>
|
||||||
|
</Form>
|
||||||
|
</div>
|
||||||
|
<div slot="footer" style="text-align: right">
|
||||||
|
<Button @click="orderTakeModal = false">关闭</Button>
|
||||||
|
<Button type="primary" @click="orderTakeSubmit">核销</Button>
|
||||||
|
</div>
|
||||||
|
</Modal>
|
||||||
|
<Modal v-model="sellerRemarkModal" width="530">
|
||||||
|
<p slot="header">
|
||||||
|
<Icon type="edit"></Icon>
|
||||||
|
<span>编辑备注</span>
|
||||||
|
</p>
|
||||||
|
<div>
|
||||||
|
<Form ref="modifyRemarkForm" :model="modifyRemarkForm" label-position="left" :label-width="100">
|
||||||
|
<FormItem label="订单备注" prop="sellerRemark">
|
||||||
|
<Input v-model="modifyRemarkForm.sellerRemark" size="large" maxlength="20"></Input>
|
||||||
|
</FormItem>
|
||||||
|
</Form>
|
||||||
|
</div>
|
||||||
|
<div slot="footer" style="text-align: right">
|
||||||
|
<Button @click="sellerRemarkModal = false">关闭</Button>
|
||||||
|
<Button type="primary" @click="modifyRemarkSubmit">确认</Button>
|
||||||
|
</div>
|
||||||
|
</Modal>
|
||||||
<multipleMap ref="map" @callback="selectedRegion" />
|
<multipleMap ref="map" @callback="selectedRegion" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -439,7 +536,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import * as API_Order from "@/api/order";
|
import * as API_Order from "@/api/order";
|
||||||
import * as RegExp from "@/libs/RegExp.js";
|
import * as RegExp from "@/libs/RegExp.js";
|
||||||
|
import * as API_Logistics from "@/api/logistics";
|
||||||
import multipleMap from "@/components/map/multiple-map";
|
import multipleMap from "@/components/map/multiple-map";
|
||||||
import vueQr from "vue-qr";
|
import vueQr from "vue-qr";
|
||||||
export default {
|
export default {
|
||||||
@@ -451,6 +548,39 @@ export default {
|
|||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
sellerRemarkModal: false,//弹出编辑订单备注
|
||||||
|
//修改订单备注表单
|
||||||
|
modifyRemarkForm: {
|
||||||
|
sellerRemark: 0,
|
||||||
|
},
|
||||||
|
// 分包裹发货
|
||||||
|
groupShipModal: false,
|
||||||
|
shipLoading: true,
|
||||||
|
groupOrderDeliveryForm: {
|
||||||
|
logisticsNo: "", //发货单号
|
||||||
|
logisticsId: "", //物流公司
|
||||||
|
},
|
||||||
|
checkedLogistics: [], //选中的物流公司集合
|
||||||
|
|
||||||
|
orderTakeModal: false, //订单核销弹出框
|
||||||
|
|
||||||
|
//订单核销表单
|
||||||
|
orderTakeForm: {
|
||||||
|
qrCode: "",
|
||||||
|
},
|
||||||
|
//验证要调整的订单金额
|
||||||
|
orderTakeValidate: {
|
||||||
|
qrCode: [
|
||||||
|
{ required: true, message: "订单核销码不能为空", trigger: "blur" },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
groupOrderDeliverFormValidate: {
|
||||||
|
logisticsNo: [{ required: true, message: "发货单号不能为空", trigger: "change" },],
|
||||||
|
logisticsId: [{ required: true, message: "请选择物流公司", trigger: "blur" },],
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
typeList: [],
|
typeList: [],
|
||||||
showPrices: false,
|
showPrices: false,
|
||||||
printHiddenFlag: false,//隐藏信息
|
printHiddenFlag: false,//隐藏信息
|
||||||
@@ -611,6 +741,8 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
data: [], // 表单数据
|
data: [], // 表单数据
|
||||||
|
logisticsModal: false, //弹出查询物流框
|
||||||
|
orderPackage: [],
|
||||||
orderLogColumns: [
|
orderLogColumns: [
|
||||||
{
|
{
|
||||||
title: "操作者",
|
title: "操作者",
|
||||||
@@ -634,6 +766,40 @@ export default {
|
|||||||
minWidth: 200,
|
minWidth: 200,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
// 选择要发货的商品
|
||||||
|
selectGroupShipGoods: [],
|
||||||
|
groupShipColumns: [
|
||||||
|
{type: "selection", width: 60, align: "center",},
|
||||||
|
{title: "商品", key: "goodsName", width: 300, slot: "goodsSlot",},
|
||||||
|
{
|
||||||
|
title: "单价",
|
||||||
|
key: "unitPrice",
|
||||||
|
slot: "priceSlot",
|
||||||
|
width: 100,
|
||||||
|
render: (h, params) => {
|
||||||
|
if (!params.row.unitPrice) {
|
||||||
|
return h("div", this.$options.filters.unitPrice(0, "¥"));
|
||||||
|
}
|
||||||
|
return h("div", this.$options.filters.unitPrice(params.row.unitPrice, "¥"));
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{title: "数量", key: "num", slot: "numSlot", width: 120,},
|
||||||
|
{
|
||||||
|
title: "已发包裹",
|
||||||
|
key: "deliverNumber",
|
||||||
|
render: (h, params) => {
|
||||||
|
return h("div", params.row.deliverNumber ? params.row.deliverNumber : 0);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "小计",
|
||||||
|
key: "subTotal",
|
||||||
|
width: 120,
|
||||||
|
render: (h, params) => {
|
||||||
|
return h("div", this.$options.filters.unitPrice(params.row.subTotal, "¥"));
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -642,6 +808,136 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
//查询物流
|
||||||
|
checkLogistics () {
|
||||||
|
this.logisticsModal = true;
|
||||||
|
if (this.orderPackage.length > 0) {
|
||||||
|
this.logisticsList();
|
||||||
|
} else {
|
||||||
|
this.logistics();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
logisticsList () {
|
||||||
|
this.logisticsModal = true;
|
||||||
|
API_Order.getPackage(this.sn).then((res) => {
|
||||||
|
if (res.success && res.result != null) {
|
||||||
|
this.packageTraceList = res.result;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
logistics () {
|
||||||
|
this.logisticsModal = true;
|
||||||
|
API_Order.getTraces(this.sn).then((res) => {
|
||||||
|
if (res.success && res.result != null) {
|
||||||
|
this.logisticsInfo = res.result;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getOrderPackage() {
|
||||||
|
API_Order.getPackage(this.sn).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
this.orderPackage = res.result;
|
||||||
|
console.log('this.orderPackage',this.orderPackage);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
modifyRemark () {
|
||||||
|
this.modifyRemarkForm.sellerRemark = this.orderInfo.order.sellerRemark;
|
||||||
|
this.sellerRemarkModal = true;
|
||||||
|
},
|
||||||
|
//修改订单备注提交
|
||||||
|
modifyRemarkSubmit () {
|
||||||
|
this.$refs.modifyRemarkForm.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
API_Order.modifyOrderRemark(this.sn, this.modifyRemarkForm).then(
|
||||||
|
(res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$Message.success("编辑订单备注成功");
|
||||||
|
this.sellerRemarkModal = false;
|
||||||
|
this.getDataList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 选中
|
||||||
|
selectGroupShipGoodsMethods (selected) {
|
||||||
|
this.selectGroupShipGoods = selected;
|
||||||
|
},
|
||||||
|
//订单核销提交
|
||||||
|
orderTakeSubmit () {
|
||||||
|
this.$refs.orderTakeForm.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
API_Order.orderTake(this.sn, this.orderTakeForm.qrCode).then(
|
||||||
|
(res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$Message.success("订单核销成功");
|
||||||
|
this.orderTakeModal = false;
|
||||||
|
this.getDataList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//弹出订单核销框
|
||||||
|
orderTake () {
|
||||||
|
this.orderTakeForm.qrCode = this.orderInfo.order.verificationCode;
|
||||||
|
this.orderTakeModal = true;
|
||||||
|
},
|
||||||
|
// 分包裹发货
|
||||||
|
groupShip () {
|
||||||
|
this.groupShipModal = true;
|
||||||
|
this.getLogisticsList();
|
||||||
|
},
|
||||||
|
// 分页获取物流公司
|
||||||
|
getLogisticsList () {
|
||||||
|
API_Logistics.getLogisticsPage({pageSize:100}).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.checkedLogistics = res.result.records;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 分包裹发货
|
||||||
|
confirmShipGroupGoods () {
|
||||||
|
this.$refs.groupOrderDeliveryForm.validate(async (valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.selectGroupShipGoods.length) {
|
||||||
|
let submit = {
|
||||||
|
...this.groupOrderDeliveryForm,
|
||||||
|
orderSn: this.sn,
|
||||||
|
partDeliveryDTOList: this.selectGroupShipGoods.map((item) => {
|
||||||
|
return {
|
||||||
|
orderItemId: item.id,
|
||||||
|
deliveryNum: item.canNum ? item.canNum : item.num,
|
||||||
|
};
|
||||||
|
}),
|
||||||
|
};
|
||||||
|
const res = await API_Order.partDelivery(this.sn, submit);
|
||||||
|
if (res.success) {
|
||||||
|
this.$Message.success("发货成功!");
|
||||||
|
this.groupShipModal = false;
|
||||||
|
this.shipLoading = false;
|
||||||
|
this.getDataList();
|
||||||
|
this.getOrderPackage();
|
||||||
|
|
||||||
|
this.groupOrderDeliveryForm = []
|
||||||
|
} else {
|
||||||
|
this.shipLoading = false;
|
||||||
|
this.groupShipModal = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.shipLoading = false;
|
||||||
|
this.groupShipModal = true;
|
||||||
|
this.$Message.error("请选择要发货的商品");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.shipLoading = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
gotoHomes () {
|
gotoHomes () {
|
||||||
return false
|
return false
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -53,23 +53,6 @@
|
|||||||
style="width: 160px"
|
style="width: 160px"
|
||||||
></DatePicker>
|
></DatePicker>
|
||||||
</Form-item>
|
</Form-item>
|
||||||
<!-- <Form-item label="订单状态" prop="orderStatus">-->
|
|
||||||
<!-- <Select-->
|
|
||||||
<!-- v-model="searchForm.orderStatus"-->
|
|
||||||
<!-- placeholder="请选择"-->
|
|
||||||
<!-- clearable-->
|
|
||||||
<!-- style="width: 160px"-->
|
|
||||||
<!-- >-->
|
|
||||||
<!-- <Option value="UNPAID">未付款</Option>-->
|
|
||||||
<!-- <Option value="PAID">已付款</Option>-->
|
|
||||||
<!-- <Option value="UNDELIVERED">待发货</Option>-->
|
|
||||||
<!-- <Option value="DELIVERED">已发货</Option>-->
|
|
||||||
<!-- <Option value="COMPLETED">已完成</Option>-->
|
|
||||||
<!-- <Option value="TAKE">待核验</Option>-->
|
|
||||||
<!-- <Option value="CANCELLED">已关闭</Option>-->
|
|
||||||
<!-- <Option value="STAY_PICKED_UP">待自提</Option>-->
|
|
||||||
<!-- </Select>-->
|
|
||||||
<!-- </Form-item>-->
|
|
||||||
<Button
|
<Button
|
||||||
@click="handleSearch"
|
@click="handleSearch"
|
||||||
type="primary"
|
type="primary"
|
||||||
@@ -283,6 +266,10 @@ export default {
|
|||||||
return h("div", [
|
return h("div", [
|
||||||
h("tag", { props: { color: "red" } }, "已关闭"),
|
h("tag", { props: { color: "red" } }, "已关闭"),
|
||||||
]);
|
]);
|
||||||
|
}else if (params.row.orderStatus == "PARTS_DELIVERED") {
|
||||||
|
return h("div", [
|
||||||
|
h("tag", { props: { color: "orange" } }, "部分发货"),
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -321,6 +308,7 @@ export default {
|
|||||||
{title: '已付款', value: 'PAID'},
|
{title: '已付款', value: 'PAID'},
|
||||||
{title: '待发货', value: 'UNDELIVERED'},
|
{title: '待发货', value: 'UNDELIVERED'},
|
||||||
{title: '已发货', value: 'DELIVERED'},
|
{title: '已发货', value: 'DELIVERED'},
|
||||||
|
{title: '部分发货', value: 'PARTS_DELIVERED'},
|
||||||
{title: '待核验', value: 'TAKE'},
|
{title: '待核验', value: 'TAKE'},
|
||||||
{title: '待自提', value: 'STAY_PICKED_UP'},
|
{title: '待自提', value: 'STAY_PICKED_UP'},
|
||||||
{title: '已完成', value: 'COMPLETED'},
|
{title: '已完成', value: 'COMPLETED'},
|
||||||
|
|||||||
@@ -63,17 +63,6 @@
|
|||||||
</Select>
|
</Select>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
<FormItem label="店铺承担比例" prop="storeCommission">
|
|
||||||
<Input
|
|
||||||
:disabled="disabled"
|
|
||||||
v-model="form.storeCommission"
|
|
||||||
placeholder="店铺承担比例"
|
|
||||||
style="width: 260px"
|
|
||||||
>
|
|
||||||
<span slot="append">%</span>
|
|
||||||
</Input>
|
|
||||||
<span class="describe">店铺承担比例,输入0-100之间数值</span>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem label="发放数量" prop="publishNum" v-if="form.getType === 'FREE'">
|
<FormItem label="发放数量" prop="publishNum" v-if="form.getType === 'FREE'">
|
||||||
<Input
|
<Input
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
@@ -329,10 +318,7 @@ export default {
|
|||||||
message: "请输入0-10的数字,可有一位小数",
|
message: "请输入0-10的数字,可有一位小数",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
storeCommission: [
|
|
||||||
{ required: true, message: "请输入店铺承担比例" },
|
|
||||||
{ pattern: regular.rate, message: "请输入0-100的正整数" },
|
|
||||||
],
|
|
||||||
publishNum: [
|
publishNum: [
|
||||||
{ required: true, message: "请输入发放数量" },
|
{ required: true, message: "请输入发放数量" },
|
||||||
{ pattern: regular.Integer, message: "请输入正整数" },
|
{ pattern: regular.Integer, message: "请输入正整数" },
|
||||||
@@ -455,6 +441,7 @@ export default {
|
|||||||
this.$refs.form.validate((valid) => {
|
this.$refs.form.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const params = JSON.parse(JSON.stringify(this.form));
|
const params = JSON.parse(JSON.stringify(this.form));
|
||||||
|
params.storeCommission = 0
|
||||||
// 判断当前活动类型
|
// 判断当前活动类型
|
||||||
params.getType != "ACTIVITY" ? delete params.effectiveDays : "";
|
params.getType != "ACTIVITY" ? delete params.effectiveDays : "";
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<Input
|
<Input
|
||||||
type="text"
|
type="text"
|
||||||
v-model="form.promotionName"
|
v-model="form.promotionName"
|
||||||
disabled
|
:disabled="form.promotionStatus != 'NEW'"
|
||||||
placeholder="活动名称"
|
placeholder="活动名称"
|
||||||
clearable
|
clearable
|
||||||
style="width: 260px"
|
style="width: 260px"
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
<DatePicker
|
<DatePicker
|
||||||
type="datetimerange"
|
type="datetimerange"
|
||||||
v-model="form.rangeTime"
|
v-model="form.rangeTime"
|
||||||
disabled
|
:disabled="form.promotionStatus != 'NEW'"
|
||||||
format="yyyy-MM-dd HH:mm:ss"
|
format="yyyy-MM-dd HH:mm:ss"
|
||||||
placeholder="请选择"
|
placeholder="请选择"
|
||||||
:options="options"
|
:options="options"
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
<FormItem label="活动描述" prop="description">
|
<FormItem label="活动描述" prop="description">
|
||||||
<Input
|
<Input
|
||||||
v-model="form.description"
|
v-model="form.description"
|
||||||
disabled
|
:disabled="form.promotionStatus != 'NEW'"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
:rows="4"
|
:rows="4"
|
||||||
clearable
|
clearable
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
<Input
|
<Input
|
||||||
type="text"
|
type="text"
|
||||||
v-model="form.fullMoney"
|
v-model="form.fullMoney"
|
||||||
disabled
|
:disabled="form.promotionStatus != 'NEW'"
|
||||||
placeholder="优惠门槛"
|
placeholder="优惠门槛"
|
||||||
clearable
|
clearable
|
||||||
style="width: 260px"
|
style="width: 260px"
|
||||||
@@ -58,8 +58,8 @@
|
|||||||
button-style="solid"
|
button-style="solid"
|
||||||
v-model="form.discountType"
|
v-model="form.discountType"
|
||||||
>
|
>
|
||||||
<Radio label="fullMinusFlag" disabled>减现金</Radio>
|
<Radio label="fullMinusFlag" :disabled="form.promotionStatus != 'NEW'">减现金</Radio>
|
||||||
<Radio label="fullRateFlag" disabled>打折</Radio>
|
<Radio label="fullRateFlag" :disabled="form.promotionStatus != 'NEW'">打折</Radio>
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem
|
<FormItem
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
>
|
>
|
||||||
<Input
|
<Input
|
||||||
type="text"
|
type="text"
|
||||||
disabled
|
:disabled="form.promotionStatus != 'NEW'"
|
||||||
v-model="form.fullMinus"
|
v-model="form.fullMinus"
|
||||||
placeholder="优惠金额"
|
placeholder="优惠金额"
|
||||||
clearable
|
clearable
|
||||||
@@ -85,24 +85,24 @@
|
|||||||
type="text"
|
type="text"
|
||||||
v-model="form.fullRate"
|
v-model="form.fullRate"
|
||||||
placeholder="优惠折扣"
|
placeholder="优惠折扣"
|
||||||
disabled
|
:disabled="form.promotionStatus != 'NEW'"
|
||||||
clearable
|
clearable
|
||||||
style="width: 260px"
|
style="width: 260px"
|
||||||
/>
|
/>
|
||||||
<span class="describe">优惠折扣为0-10之间数字,可有一位小数</span>
|
<span class="describe">优惠折扣为0-10之间数字,可有一位小数</span>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="额外赠送">
|
<FormItem label="额外赠送">
|
||||||
<Checkbox v-model="form.freeFreightFlag" disabled>免邮费</Checkbox
|
<Checkbox v-model="form.freeFreightFlag" :disabled="form.promotionStatus != 'NEW'">免邮费</Checkbox
|
||||||
>
|
>
|
||||||
<Checkbox v-model="form.couponFlag" disabled>送优惠券</Checkbox
|
<Checkbox v-model="form.couponFlag" :disabled="form.promotionStatus != 'NEW'">送优惠券</Checkbox
|
||||||
>
|
>
|
||||||
<Checkbox v-model="form.giftFlag" disabled>送赠品</Checkbox>
|
<Checkbox v-model="form.giftFlag" :disabled="form.promotionStatus != 'NEW'">送赠品</Checkbox>
|
||||||
<Checkbox v-model="form.pointFlag" disabled>送积分</Checkbox>
|
<Checkbox v-model="form.pointFlag" :disabled="form.promotionStatus != 'NEW'">送积分</Checkbox>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem v-if="form.couponFlag" label="赠送优惠券" prop="couponId">
|
<FormItem v-if="form.couponFlag" label="赠送优惠券" prop="couponId">
|
||||||
<Select
|
<Select
|
||||||
v-model="form.couponId"
|
v-model="form.couponId"
|
||||||
:disabled="form.promotionStatus != 'NEW'"
|
::disabled="form.promotionStatus != 'NEW'"
|
||||||
filterable
|
filterable
|
||||||
:remote-method="getCouponList"
|
:remote-method="getCouponList"
|
||||||
placeholder="输入优惠券名称搜索"
|
placeholder="输入优惠券名称搜索"
|
||||||
@@ -123,7 +123,7 @@
|
|||||||
filterable
|
filterable
|
||||||
:remote-method="getGiftList"
|
:remote-method="getGiftList"
|
||||||
placeholder="输入赠品名称搜索"
|
placeholder="输入赠品名称搜索"
|
||||||
disabled
|
:disabled="form.promotionStatus != 'NEW'"
|
||||||
:loading="giftLoading"
|
:loading="giftLoading"
|
||||||
style="width: 260px"
|
style="width: 260px"
|
||||||
>
|
>
|
||||||
@@ -136,10 +136,10 @@
|
|||||||
</Select>
|
</Select>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem v-if="form.pointFlag" label="赠积分" prop="point">
|
<FormItem v-if="form.pointFlag" label="赠积分" prop="point">
|
||||||
<Input
|
<InputNumber
|
||||||
v-model="form.point"
|
v-model="form.point"
|
||||||
type="number"
|
:min="0"
|
||||||
disabled
|
:disabled="form.promotionStatus != 'NEW'"
|
||||||
style="width: 260px"
|
style="width: 260px"
|
||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
@@ -149,8 +149,8 @@
|
|||||||
button-style="solid"
|
button-style="solid"
|
||||||
v-model="form.scopeType"
|
v-model="form.scopeType"
|
||||||
>
|
>
|
||||||
<Radio label="ALL" disabled>全品类</Radio>
|
<Radio label="ALL" :disabled="form.promotionStatus != 'NEW'">全品类</Radio>
|
||||||
<Radio label="PORTION_GOODS" disabled>指定商品</Radio>
|
<Radio label="PORTION_GOODS" :disabled="form.promotionStatus != 'NEW'">指定商品</Radio>
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
@@ -158,7 +158,11 @@
|
|||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
v-if="form.scopeType == 'PORTION_GOODS'"
|
v-if="form.scopeType == 'PORTION_GOODS'"
|
||||||
>
|
>
|
||||||
<Table border :columns="columns" :data="form.promotionGoodsList">
|
<div style="display: flex; margin-bottom: 10px" v-if="form.promotionStatus == 'NEW'">
|
||||||
|
<Button type="primary" @click="openSkuList">选择商品</Button>
|
||||||
|
<Button type="error" ghost style="margin-left: 10px" @click="delSelectGoods">批量删除</Button>
|
||||||
|
</div>
|
||||||
|
<Table border :columns="columns" @on-selection-change="changeSelect" :data="form.promotionGoodsList">
|
||||||
<template slot-scope="{ row }" slot="goodsName">
|
<template slot-scope="{ row }" slot="goodsName">
|
||||||
<div>
|
<div>
|
||||||
<a class="mr_10" @click="linkTo(row.goodsId, row.skuId)">{{
|
<a class="mr_10" @click="linkTo(row.goodsId, row.skuId)">{{
|
||||||
@@ -185,40 +189,105 @@
|
|||||||
</Poptip>
|
</Poptip>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</Table>
|
</Table>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<FormItem label="操作" >
|
||||||
<div>
|
<div>
|
||||||
<Button
|
<Button
|
||||||
@click="$router.push({ name: 'promotions/full-discount' })"
|
@click="$router.push({ name: 'promotions/full-discount' })"
|
||||||
>返回</Button
|
>返回</Button
|
||||||
>
|
>
|
||||||
|
<Button type="primary" class="ml_10" :disabled="form.promotionStatus != 'NEW' && !!id" :loading="submitLoading"
|
||||||
|
@click="handleSubmit">提交</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</FormItem>
|
||||||
</div>
|
|
||||||
</Form>
|
</Form>
|
||||||
</Card>
|
</Card>
|
||||||
|
<sku-select ref="skuSelect" @selectedGoodsData="selectedGoodsData"></sku-select>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getPlatformCouponList, getFullDiscountById } from "@/api/promotion";
|
import { getPlatformCouponList, getFullDiscountById, newFullDiscount, editFullDiscount,} from "@/api/promotion";
|
||||||
import { getGoodsSkuData } from "@/api/goods";
|
import { getGoodsSkuData } from "@/api/goods";
|
||||||
|
import { regular } from "@/utils";
|
||||||
|
import skuSelect from "@/components/lili-dialog";
|
||||||
|
|
||||||
|
|
||||||
import vueQr from "vue-qr";
|
import vueQr from "vue-qr";
|
||||||
export default {
|
export default {
|
||||||
name: "add-full-discount",
|
name: "add-full-discount",
|
||||||
components: {
|
components: {
|
||||||
"vue-qr": vueQr,
|
"vue-qr": vueQr,
|
||||||
|
skuSelect,
|
||||||
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
const checkPrice = (rule, value, callback) => {
|
||||||
|
if (!value && value !== 0) {
|
||||||
|
return callback(new Error("面额不能为空"));
|
||||||
|
} else if (!regular.money.test(value)) {
|
||||||
|
callback(new Error("请输入正整数或者两位小数"));
|
||||||
|
} else if (parseFloat(value) > 99999999) {
|
||||||
|
callback(new Error("面额设置超过上限值"));
|
||||||
|
} else {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const checkWeight = (rule, value, callback) => {
|
||||||
|
if (!value && typeof value !== "number") {
|
||||||
|
callback(new Error("优惠门槛不能为空"));
|
||||||
|
} else if (!regular.money.test(value)) {
|
||||||
|
callback(new Error("请输入正整数或者两位小数"));
|
||||||
|
} else if (parseFloat(value) > 99999999) {
|
||||||
|
callback(new Error("优惠门槛设置超过上限值"));
|
||||||
|
} else {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
};
|
||||||
return {
|
return {
|
||||||
form: {
|
form: {
|
||||||
// 表单
|
// 表单
|
||||||
discountType: "fullMinusFlag",
|
discountType: "fullMinusFlag",
|
||||||
scopeType: "ALL",
|
scopeType: "ALL",
|
||||||
promotionGoodsList: [],
|
promotionGoodsList: [],
|
||||||
|
promotionStatus: "NEW",
|
||||||
},
|
},
|
||||||
id: this.$route.query.id, // 活动id
|
id: this.$route.query.id, // 活动id
|
||||||
|
selectedGoods: [], // 已选商品列表,便于删除
|
||||||
|
submitLoading: false, // 添加或编辑提交状态
|
||||||
|
formRule: {
|
||||||
|
// 验证规则
|
||||||
|
promotionName: [{ required: true, message: "活动名称不能为空" }],
|
||||||
|
rangeTime: [{ required: true, message: "请选择活动时间" }],
|
||||||
|
description: [{ required: true, message: "请填写活动描述" }],
|
||||||
|
price: [
|
||||||
|
{ required: true, message: "请输入面额" },
|
||||||
|
{ validator: checkPrice },
|
||||||
|
],
|
||||||
|
consumptionLimit: [{ required: true, validator: checkWeight }],
|
||||||
|
fullMoney: [{ required: true, validator: checkWeight }],
|
||||||
|
fullMinus: [
|
||||||
|
{ required: true, message: "请填写优惠金额" },
|
||||||
|
{ pattern: regular.money, message: "请输入正确金额" },
|
||||||
|
],
|
||||||
|
fullRate: [
|
||||||
|
{ required: true, message: "请填写优惠折扣" },
|
||||||
|
{
|
||||||
|
pattern: regular.discount,
|
||||||
|
message: "请输入0-10的数字,可有一位小数",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
couponId: [{ required: true, message: "请选择优惠券" }],
|
||||||
|
giftId: [{ required: true, message: "请选择赠品" }],
|
||||||
|
point: [{ required: true, message: "请填写积分" }],
|
||||||
|
},
|
||||||
couponList: [], // 优惠券列表
|
couponList: [], // 优惠券列表
|
||||||
giftList: [], // 赠品列表
|
giftList: [], // 赠品列表
|
||||||
giftLoading: false, // 赠品加载状态
|
giftLoading: false, // 赠品加载状态
|
||||||
@@ -257,11 +326,27 @@ export default {
|
|||||||
async mounted() {
|
async mounted() {
|
||||||
if (this.id) {
|
if (this.id) {
|
||||||
this.getDetail();
|
this.getDetail();
|
||||||
|
this.columns.shift()
|
||||||
|
this.columns.pop()
|
||||||
}
|
}
|
||||||
this.getCouponList();
|
this.getCouponList();
|
||||||
this.getGiftList();
|
this.getGiftList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
changeSelect (e) {
|
||||||
|
// 已选商品批量选择
|
||||||
|
this.selectedGoods = e;
|
||||||
|
},
|
||||||
|
openSkuList () {
|
||||||
|
// 显示商品选择器
|
||||||
|
this.$refs.skuSelect.open("goods");
|
||||||
|
let data = JSON.parse(JSON.stringify(this.form.promotionGoodsList));
|
||||||
|
data.forEach((e) => {
|
||||||
|
e.id = e.skuId;
|
||||||
|
});
|
||||||
|
this.$refs.skuSelect.goodsData = data;
|
||||||
|
},
|
||||||
getDetail() {
|
getDetail() {
|
||||||
// 获取活动详情
|
// 获取活动详情
|
||||||
getFullDiscountById(this.id).then((res) => {
|
getFullDiscountById(this.id).then((res) => {
|
||||||
@@ -318,6 +403,130 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
/** 保存 */
|
||||||
|
handleSubmit () {
|
||||||
|
this.$refs.form.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
const params = JSON.parse(JSON.stringify(this.form));
|
||||||
|
const strat = this.$options.filters.unixToDate(
|
||||||
|
this.form.rangeTime[0] / 1000
|
||||||
|
);
|
||||||
|
const end = this.$options.filters.unixToDate(
|
||||||
|
this.form.rangeTime[1] / 1000
|
||||||
|
);
|
||||||
|
params.startTime = strat;
|
||||||
|
params.endTime = end;
|
||||||
|
|
||||||
|
if (
|
||||||
|
params.scopeType == "PORTION_GOODS" &&
|
||||||
|
(!params.promotionGoodsList ||
|
||||||
|
params.promotionGoodsList.length == 0)
|
||||||
|
) {
|
||||||
|
this.$Modal.warning({ title: "提示", content: "请选择指定商品" });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (params.scopeType == "ALL") {
|
||||||
|
delete params.promotionGoodsList;
|
||||||
|
params.number = -1;
|
||||||
|
} else {
|
||||||
|
let scopeId = [];
|
||||||
|
params.number = 1;
|
||||||
|
params.promotionGoodsList.forEach((e) => {
|
||||||
|
e.startTime = params.startTime;
|
||||||
|
e.endTime = params.endTime;
|
||||||
|
scopeId.push(e.skuId);
|
||||||
|
});
|
||||||
|
params.scopeId = scopeId.toString();
|
||||||
|
}
|
||||||
|
if (params.discountType == "fullMinusFlag") {
|
||||||
|
params.fullMinusFlag = true;
|
||||||
|
} else {
|
||||||
|
params.fullRateFlag = true;
|
||||||
|
}
|
||||||
|
delete params.rangeTime;
|
||||||
|
// this.submitLoading = true;
|
||||||
|
if (!this.id) {
|
||||||
|
// 添加 避免编辑后传入id等数据 记得删除
|
||||||
|
delete params.id;
|
||||||
|
newFullDiscount(params).then((res) => {
|
||||||
|
this.submitLoading = false;
|
||||||
|
if (res.success) {
|
||||||
|
this.$Message.success("添加活动成功");
|
||||||
|
this.closeCurrentPage();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// 编辑
|
||||||
|
delete params.updateTime;
|
||||||
|
|
||||||
|
editFullDiscount(params).then((res) => {
|
||||||
|
this.submitLoading = false;
|
||||||
|
if (res.success) {
|
||||||
|
this.$Message.success("编辑活动成功");
|
||||||
|
this.closeCurrentPage();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
closeCurrentPage () {
|
||||||
|
this.$store.commit("removeTag", "full-cut-detail");
|
||||||
|
this.$store.commit("removeTag", "promotions/full-discount");
|
||||||
|
localStorage.storeOpenedList = JSON.stringify(
|
||||||
|
this.$store.state.app.storeOpenedList
|
||||||
|
);
|
||||||
|
this.$router.go(-1);
|
||||||
|
},
|
||||||
|
changeSelect (e) {
|
||||||
|
// 已选商品批量选择
|
||||||
|
this.selectedGoods = e;
|
||||||
|
},
|
||||||
|
|
||||||
|
delSelectGoods () {
|
||||||
|
// 多选删除商品
|
||||||
|
if (this.selectedGoods.length <= 0) {
|
||||||
|
this.$Message.warning("您还未选择要删除的数据");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$Modal.confirm({
|
||||||
|
title: "确认删除",
|
||||||
|
content: "您确认要删除所选商品吗?",
|
||||||
|
onOk: () => {
|
||||||
|
let ids = [];
|
||||||
|
this.selectedGoods.forEach(function (e) {
|
||||||
|
ids.push(e.id);
|
||||||
|
});
|
||||||
|
this.form.promotionGoodsList = this.form.promotionGoodsList.filter(
|
||||||
|
(item) => {
|
||||||
|
return !ids.includes(item.id);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
delGoods (index) {
|
||||||
|
// 删除商品
|
||||||
|
this.form.promotionGoodsList.splice(index, 1);
|
||||||
|
},
|
||||||
|
selectedGoodsData (item) {
|
||||||
|
// 回显已选商品
|
||||||
|
let list = [];
|
||||||
|
item.forEach((e) => {
|
||||||
|
list.push({
|
||||||
|
goodsName: e.goodsName,
|
||||||
|
price: e.price,
|
||||||
|
quantity: e.quantity,
|
||||||
|
storeId: e.storeId,
|
||||||
|
storeName: e.storeName,
|
||||||
|
thumbnail: e.thumbnail,
|
||||||
|
skuId: e.id,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
this.form.promotionGoodsList = list;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -50,6 +50,9 @@
|
|||||||
>
|
>
|
||||||
</Form>
|
</Form>
|
||||||
</Row>
|
</Row>
|
||||||
|
<div class="mt_10">
|
||||||
|
<Button type="primary" @click="view">添加活动</Button>
|
||||||
|
</div>
|
||||||
<Table
|
<Table
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
border
|
border
|
||||||
@@ -133,11 +136,7 @@ export default {
|
|||||||
key: "endTime",
|
key: "endTime",
|
||||||
width: 170,
|
width: 170,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: "店铺名称",
|
|
||||||
key: "storeName",
|
|
||||||
minWidth: 60,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: "活动类型",
|
title: "活动类型",
|
||||||
slot: "promotionType",
|
slot: "promotionType",
|
||||||
@@ -162,6 +161,7 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
// 初始化数据
|
// 初始化数据
|
||||||
init() {
|
init() {
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
@@ -227,7 +227,14 @@ export default {
|
|||||||
},
|
},
|
||||||
view(row) {
|
view(row) {
|
||||||
// 查看
|
// 查看
|
||||||
this.$router.push({ name: "full-discount-detail", query: { id: row.id } });
|
let data = { name: "full-discount-detail" }
|
||||||
|
if(row){
|
||||||
|
data = {
|
||||||
|
name: "full-discount-detail",
|
||||||
|
query: { id: row.id }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.$router.push(data);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|||||||
190
manager/src/views/promotions/pintuan/pintuan-create.vue
Normal file
190
manager/src/views/promotions/pintuan/pintuan-create.vue
Normal file
@@ -0,0 +1,190 @@
|
|||||||
|
<template>
|
||||||
|
<div class="new-pintuan">
|
||||||
|
<Card>
|
||||||
|
<Form ref="form" :model="form" :label-width="130" :rules="formValidate">
|
||||||
|
<FormItem label="活动名称" prop="promotionName" :label-width="130">
|
||||||
|
<Input v-model="form.promotionName" clearable style="width: 260px" maxlength="25" />
|
||||||
|
<div style="color: #cccccc">
|
||||||
|
活动名称将显示在对人拼团活动列表中,方便商家管理使用,最多输入25个字符
|
||||||
|
</div>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem label="活动时间" prop="rangeTime">
|
||||||
|
<DatePicker type="datetimerange" v-model="form.rangeTime" format="yyyy-MM-dd HH:mm:ss" placeholder="请选择" :options="options" style="width: 260px">
|
||||||
|
</DatePicker>
|
||||||
|
</FormItem>
|
||||||
|
|
||||||
|
<FormItem label="参团人数" prop="requiredNum" :label-width="130">
|
||||||
|
<Input v-model="form.requiredNum" style="width: 260px" max="8">
|
||||||
|
<span slot="append">人</span>
|
||||||
|
</Input>
|
||||||
|
<span style="color: #cccccc">参团人数不少于2人,不得超过10人。</span>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem label="限购数量" prop="limitNum" :label-width="130">
|
||||||
|
<Input v-model="form.limitNum" type="number" style="width: 260px">
|
||||||
|
<span slot="append">件/人</span>
|
||||||
|
</Input>
|
||||||
|
<span style="color: #cccccc">如果设置为0则视为不限制购买数量</span>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem label="虚拟成团" prop="fictitious">
|
||||||
|
<RadioGroup type="button" button-style="solid" v-model="form.fictitious">
|
||||||
|
<Radio title="开启" :label="1">
|
||||||
|
<span>开启</span>
|
||||||
|
</Radio>
|
||||||
|
<Radio title="关闭" :label="0">
|
||||||
|
<span>关闭</span>
|
||||||
|
</Radio>
|
||||||
|
</RadioGroup>
|
||||||
|
<br />
|
||||||
|
<span style="color: #cccccc">开启虚拟成团后,24小时人数未满的团,系统将会模拟匿名买家凑满人数,使该团成团;您只需要对已付款参团的真实买家发货;建议合理开启以提高成团率</span>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem label="拼团规则" prop="pintuanRule">
|
||||||
|
<Input v-model="form.pintuanRule" type="textarea" :rows="4" clearable maxlength="255" style="width: 260px" />
|
||||||
|
<br />
|
||||||
|
<span style="color: #cccccc">拼团规则描述不能为空且不能大于255个字,会在WAP拼团详情页面显示</span>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem label="操作" >
|
||||||
|
<div>
|
||||||
|
<Button type="text" @click="closeCurrentPage">返回</Button>
|
||||||
|
<Button type="primary" :loading="submitLoading" @click="handleSubmit">提交</Button>
|
||||||
|
</div>
|
||||||
|
</FormItem>
|
||||||
|
</Form>
|
||||||
|
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { savePintuan, editPintuan, getPintuanDetail } from "@/api/promotion";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
id: this.$route.query.id, // 拼团id
|
||||||
|
form: {
|
||||||
|
// 添加或编辑表单对象初始化数据
|
||||||
|
promotionName: "",
|
||||||
|
promotionTitle: "",
|
||||||
|
pintuanRule: "",
|
||||||
|
requiredNum: "",
|
||||||
|
fictitious: 0,
|
||||||
|
limitNum: "",
|
||||||
|
startTime: "",
|
||||||
|
endTime: "",
|
||||||
|
},
|
||||||
|
// 表单验证规则
|
||||||
|
formValidate: {
|
||||||
|
promotionName: [{ required: true, message: "活动名称不能为空" }],
|
||||||
|
requiredNum: [
|
||||||
|
{ required: true, message: "参团人数不能为空" },
|
||||||
|
{
|
||||||
|
pattern: /^([2-9]|10)?$/,
|
||||||
|
message: "参团人数不合法",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
limitNum: [
|
||||||
|
{ required: true, message: "限购数不能为空" },
|
||||||
|
{
|
||||||
|
pattern: /^(0|[1-9]\d?|100)$/,
|
||||||
|
message: "限购数不合法",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
rangeTime: [{ required: true, message: "请选择活动时间" }],
|
||||||
|
},
|
||||||
|
submitLoading: false, // 添加或编辑提交状态
|
||||||
|
options: {
|
||||||
|
// 不可选取时间
|
||||||
|
disabledDate(date) {
|
||||||
|
return date && date.valueOf() < Date.now() - 86400000;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
if (this.id) {
|
||||||
|
this.getDetail();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
// 关闭当前页面
|
||||||
|
closeCurrentPage() {
|
||||||
|
this.$store.commit("removeTag", "new-pintuan");
|
||||||
|
localStorage.storeOpenedList = JSON.stringify(
|
||||||
|
this.$store.state.app.storeOpenedList
|
||||||
|
);
|
||||||
|
this.$router.go(-1);
|
||||||
|
},
|
||||||
|
// 提交活动
|
||||||
|
handleSubmit() {
|
||||||
|
this.$refs.form.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
this.submitLoading = true;
|
||||||
|
let params = JSON.parse(JSON.stringify(this.form));
|
||||||
|
params.fictitious
|
||||||
|
? (params.fictitious = true)
|
||||||
|
: (params.fictitious = false);
|
||||||
|
params.startTime = this.$options.filters.unixToDate(
|
||||||
|
this.form.rangeTime[0] / 1000
|
||||||
|
);
|
||||||
|
|
||||||
|
params.endTime = this.$options.filters.unixToDate(
|
||||||
|
this.form.rangeTime[1] / 1000
|
||||||
|
);
|
||||||
|
if (params.startTime === "" || params.endTime === "") {
|
||||||
|
this.$Message.error("活动时间不能为空");
|
||||||
|
this.submitLoading = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (params.startTime < new Date()) {
|
||||||
|
this.$Message.error("拼团活动开始时间不能小于当前时间");
|
||||||
|
this.submitLoading = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
delete params.rangeTime;
|
||||||
|
if (!this.id) {
|
||||||
|
// 添加 避免编辑后传入id等数据 记得删除
|
||||||
|
delete params.id;
|
||||||
|
savePintuan(params).then((res) => {
|
||||||
|
this.submitLoading = false;
|
||||||
|
if (res.success) {
|
||||||
|
this.$Message.success("拼团活动发布成功");
|
||||||
|
this.closeCurrentPage();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// 编辑
|
||||||
|
if (params.promotionGoodsList == "")
|
||||||
|
delete params.promotionGoodsList;
|
||||||
|
editPintuan(params).then((res) => {
|
||||||
|
this.submitLoading = false;
|
||||||
|
if (res.success) {
|
||||||
|
this.$Message.success("操作成功");
|
||||||
|
this.closeCurrentPage();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 获取详情
|
||||||
|
getDetail() {
|
||||||
|
getPintuanDetail(this.id).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
const data = res.result;
|
||||||
|
data.rangeTime = [];
|
||||||
|
data.rangeTime.push(new Date(data.startTime), new Date(data.endTime));
|
||||||
|
this.form = data;
|
||||||
|
// 此处将值转换为 1 true ,0 false 不然ivew radio组件会报错
|
||||||
|
this.form.fictitious ? this.$set(this.form, "fictitious", 1) : this.$set(this.form, "fictitious", 0);
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
/deep/ .ivu-form-item {
|
||||||
|
padding: 18px 10px !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -5,42 +5,51 @@
|
|||||||
<Table style="margin: 10px 0" border :columns="columns" :data="data"></Table>
|
<Table style="margin: 10px 0" border :columns="columns" :data="data"></Table>
|
||||||
|
|
||||||
<h4>商品信息</h4>
|
<h4>商品信息</h4>
|
||||||
|
|
||||||
|
|
||||||
|
<Row class="operation" v-if="status == 'manager'">
|
||||||
|
<Button type="primary" @click="openSkuList">选择商品</Button>
|
||||||
|
<Button @click="delAll">批量删除</Button>
|
||||||
|
<Button @click="getDataList" icon="md-refresh">刷新</Button>
|
||||||
|
<Button type="dashed" @click="openTip = !openTip">{{
|
||||||
|
openTip ? "关闭提示" : "开启提示"
|
||||||
|
}}</Button>
|
||||||
|
</Row>
|
||||||
|
<Row v-show="openTip" v-if="status == 'manager'">
|
||||||
|
<Alert show-icon>
|
||||||
|
已选择 <span>{{ selectCount }}</span> 项
|
||||||
|
<a class="select-clear" @click="clearSelectAll">清空</a>
|
||||||
|
</Alert>
|
||||||
|
</Row>
|
||||||
|
<h3 class="act-goods">活动商品</h3>
|
||||||
<Table
|
<Table
|
||||||
|
class="mt_10"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
border
|
border
|
||||||
class="operation"
|
|
||||||
:columns="goodsColumns"
|
:columns="goodsColumns"
|
||||||
:data="goodsData"
|
:data="goodsData"
|
||||||
ref="table"
|
ref="table"
|
||||||
sortable="custom"
|
@on-selection-change="changeSelect"
|
||||||
>
|
>
|
||||||
<template slot-scope="{ row }" slot="goodsName">
|
<template slot-scope="{ row, index }" slot="price">
|
||||||
<div>
|
<Input
|
||||||
<a class="mr_10" @click="linkTo(row.goodsId, row.skuId)">{{
|
v-model="row.price"
|
||||||
row.goodsName
|
:disabled="status === 'view'"
|
||||||
}}</a>
|
@input="goodsData[index].price = row.price"
|
||||||
<Poptip trigger="hover" title="扫码在手机中查看" transfer>
|
|
||||||
<div slot="content">
|
|
||||||
<vue-qr
|
|
||||||
:text="wapLinkTo(row.goodsId, row.skuId)"
|
|
||||||
:margin="0"
|
|
||||||
colorDark="#000"
|
|
||||||
colorLight="#fff"
|
|
||||||
:size="150"
|
|
||||||
></vue-qr>
|
|
||||||
</div>
|
|
||||||
<img
|
|
||||||
src="../../../assets/qrcode.svg"
|
|
||||||
style="vertical-align: middle"
|
|
||||||
class="hover-pointer"
|
|
||||||
width="20"
|
|
||||||
height="20"
|
|
||||||
alt=""
|
|
||||||
/>
|
/>
|
||||||
</Poptip>
|
</template>
|
||||||
</div>
|
<template slot-scope="{ index }" slot="action">
|
||||||
|
<Button
|
||||||
|
type="error"
|
||||||
|
size="small"
|
||||||
|
ghost
|
||||||
|
v-if="status === 'manager'"
|
||||||
|
@click="delGoods(index)"
|
||||||
|
>删除</Button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</Table>
|
</Table>
|
||||||
|
|
||||||
<Row type="flex" justify="end" class="page operation">
|
<Row type="flex" justify="end" class="page operation">
|
||||||
<Page
|
<Page
|
||||||
:current="searchForm.pageNumber"
|
:current="searchForm.pageNumber"
|
||||||
@@ -56,19 +65,29 @@
|
|||||||
></Page>
|
></Page>
|
||||||
</Row>
|
</Row>
|
||||||
</Card>
|
</Card>
|
||||||
|
<sku-select
|
||||||
|
ref="skuSelect"
|
||||||
|
:goodsData="goodsData"
|
||||||
|
@selectedGoodsData="selectedGoodsData"
|
||||||
|
></sku-select>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getPintuanGoodsList, getPintuanDetail } from "@/api/promotion.js";
|
import { getPintuanGoodsList, getPintuanDetail } from "@/api/promotion.js";
|
||||||
import vueQr from "vue-qr";
|
import vueQr from "vue-qr";
|
||||||
import { promotionsStatusRender } from "@/utils/promotions";
|
import { promotionsStatusRender } from "@/utils/promotions";
|
||||||
|
import skuSelect from "@/components/lili-dialog";
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
"vue-qr": vueQr,
|
"vue-qr": vueQr,
|
||||||
|
skuSelect,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
selectCount:0,
|
||||||
|
status: this.$route.query.status, // 查看还是修改
|
||||||
|
openTip: true, // 显示提示
|
||||||
|
|
||||||
loading: false, // 表单加载状态
|
loading: false, // 表单加载状态
|
||||||
searchForm: {
|
searchForm: {
|
||||||
// 搜索框初始化对象
|
// 搜索框初始化对象
|
||||||
@@ -137,6 +156,72 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
selectedGoodsData(item) {
|
||||||
|
// 选择商品
|
||||||
|
console.log(item);
|
||||||
|
let list = [];
|
||||||
|
item.forEach((e) => {
|
||||||
|
list.push({
|
||||||
|
goodsName: e.goodsName,
|
||||||
|
price: e.price,
|
||||||
|
originalPrice: e.price,
|
||||||
|
quantity: e.quantity,
|
||||||
|
storeId: e.storeId,
|
||||||
|
sellerName: e.sellerName,
|
||||||
|
thumbnail: e.thumbnail,
|
||||||
|
skuId: e.id,
|
||||||
|
categoryPath: e.categoryPath,
|
||||||
|
goodsId: e.goodsId,
|
||||||
|
goodsType: e.goodsType,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
this.goodsData = list;
|
||||||
|
},
|
||||||
|
changeSelect(e) {
|
||||||
|
// 获取选择数据
|
||||||
|
this.selectList = e;
|
||||||
|
this.selectCount = e.length;
|
||||||
|
},
|
||||||
|
delGoods(index) {
|
||||||
|
// 删除商品
|
||||||
|
this.goodsData.splice(index, 1);
|
||||||
|
this.selectCount = 0;
|
||||||
|
},
|
||||||
|
clearSelectAll() {
|
||||||
|
// 清空所有已选项
|
||||||
|
this.$refs.table.selectAll(false);
|
||||||
|
},
|
||||||
|
|
||||||
|
delAll() {
|
||||||
|
// 批量删除商品
|
||||||
|
if (this.selectCount <= 0) {
|
||||||
|
this.$Message.warning("您还未选择要删除的数据");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$Modal.confirm({
|
||||||
|
title: "确认删除",
|
||||||
|
content: "您确认要删除所选的 " + this.selectCount + " 条数据?",
|
||||||
|
onOk: () => {
|
||||||
|
let ids = [];
|
||||||
|
this.selectList.forEach(function (e) {
|
||||||
|
ids.push(e.skuId);
|
||||||
|
});
|
||||||
|
this.goodsData = this.goodsData.filter((item) => {
|
||||||
|
return !ids.includes(item.skuId);
|
||||||
|
});
|
||||||
|
this.selectCount = 0;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
openSkuList() {
|
||||||
|
// 显示商品选择器
|
||||||
|
this.$refs.skuSelect.open("goods");
|
||||||
|
let data = JSON.parse(JSON.stringify(this.goodsData));
|
||||||
|
data.forEach((e) => {
|
||||||
|
e.id = e.skuId;
|
||||||
|
});
|
||||||
|
this.$refs.skuSelect.goodsData = data;
|
||||||
|
},
|
||||||
// 初始化数据
|
// 初始化数据
|
||||||
init() {
|
init() {
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
@@ -146,6 +231,7 @@ export default {
|
|||||||
changePage(v) {
|
changePage(v) {
|
||||||
this.searchForm.pageNumber = v;
|
this.searchForm.pageNumber = v;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
|
this.clearSelectAll();
|
||||||
},
|
},
|
||||||
// 分页 改变页数
|
// 分页 改变页数
|
||||||
changePageSize(v) {
|
changePageSize(v) {
|
||||||
@@ -188,4 +274,19 @@ h4 {
|
|||||||
text-align: left;
|
text-align: left;
|
||||||
border-left: 3px solid red;
|
border-left: 3px solid red;
|
||||||
}
|
}
|
||||||
|
.operation {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
.act-goods {
|
||||||
|
margin: 20px 0;
|
||||||
|
font-size: 15px;
|
||||||
|
&::before {
|
||||||
|
content: "|";
|
||||||
|
color: $theme_color;
|
||||||
|
display: inline-block;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 16px;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -41,6 +41,9 @@
|
|||||||
</Form-item>
|
</Form-item>
|
||||||
<Button @click="handleSearch" type="primary" class="search-btn">搜索</Button>
|
<Button @click="handleSearch" type="primary" class="search-btn">搜索</Button>
|
||||||
</Form>
|
</Form>
|
||||||
|
<div class="mt_10">
|
||||||
|
<Button type="primary" @click="add()">添加活动</Button>
|
||||||
|
</div>
|
||||||
<Table
|
<Table
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
border
|
border
|
||||||
@@ -50,9 +53,20 @@
|
|||||||
class="mt_10"
|
class="mt_10"
|
||||||
>
|
>
|
||||||
<template slot-scope="{ row }" slot="action">
|
<template slot-scope="{ row }" slot="action">
|
||||||
|
<Button
|
||||||
|
type="info"
|
||||||
|
v-if="row.promotionStatus == 'NEW'"
|
||||||
|
style="margin-right: 5px"
|
||||||
|
size="small"
|
||||||
|
@click="manage(row, 'manager')"
|
||||||
|
>管理</Button
|
||||||
|
>
|
||||||
<Button type="info" size="small" @click="view(row)" style="margin-right: 5px"
|
<Button type="info" size="small" @click="view(row)" style="margin-right: 5px"
|
||||||
>查看</Button
|
>查看</Button
|
||||||
>
|
>
|
||||||
|
<Button type="default" v-if="row.promotionStatus === 'NEW'" size="small" @click="edit(row)" style="margin-right: 5px"
|
||||||
|
>编辑</Button
|
||||||
|
>
|
||||||
<Button
|
<Button
|
||||||
type="error"
|
type="error"
|
||||||
size="small"
|
size="small"
|
||||||
@@ -113,12 +127,7 @@ export default {
|
|||||||
return promotionsStatusRender(h, params);
|
return promotionsStatusRender(h, params);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: "所属店铺",
|
|
||||||
key: "storeName",
|
|
||||||
minWidth: 120,
|
|
||||||
tooltip: true,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
title: "活动开始时间",
|
title: "活动开始时间",
|
||||||
@@ -136,7 +145,7 @@ export default {
|
|||||||
title: "操作",
|
title: "操作",
|
||||||
slot: "action",
|
slot: "action",
|
||||||
align: "center",
|
align: "center",
|
||||||
width: 200,
|
width: 250,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
data: [], // 表单数据
|
data: [], // 表单数据
|
||||||
@@ -144,6 +153,15 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
edit(v){
|
||||||
|
this.$router.push({ name: 'pintuan-create', query: {id:v.id}})
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
manage(v, status) {
|
||||||
|
this.$options.filters.customRouterPush({name: "pintuan-goods", query: { id: v.id, status: status }} )
|
||||||
|
|
||||||
|
},
|
||||||
// 初始化数据
|
// 初始化数据
|
||||||
init() {
|
init() {
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
@@ -184,6 +202,9 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
add(){
|
||||||
|
this.$router.push({ name: 'pintuan-create'})
|
||||||
|
},
|
||||||
// 查看拼团商品
|
// 查看拼团商品
|
||||||
view(v) {
|
view(v) {
|
||||||
this.$router.push({ name: "pintuan-goods", query: { id: v.id } });
|
this.$router.push({ name: "pintuan-goods", query: { id: v.id } });
|
||||||
|
|||||||
@@ -173,10 +173,7 @@ export default {
|
|||||||
message: "请输入0-10的数字,可有一位小数",
|
message: "请输入0-10的数字,可有一位小数",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
sellerCommission: [
|
|
||||||
{ required: true, message: "请输入店铺承担比例" },
|
|
||||||
{ pattern: regular.rate, message: "请输入0-100的正整数" },
|
|
||||||
],
|
|
||||||
publishNum: [
|
publishNum: [
|
||||||
{ required: true, message: "请输入发放数量" },
|
{ required: true, message: "请输入发放数量" },
|
||||||
{ pattern: regular.Integer, message: "请输入正整数" },
|
{ pattern: regular.Integer, message: "请输入正整数" },
|
||||||
|
|||||||
@@ -217,11 +217,7 @@ export default {
|
|||||||
key: "points",
|
key: "points",
|
||||||
width: 100,
|
width: 100,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: "所属店铺",
|
|
||||||
key: "storeName",
|
|
||||||
width: 100,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: "活动开始时间",
|
title: "活动开始时间",
|
||||||
slot: "startTime",
|
slot: "startTime",
|
||||||
|
|||||||
@@ -9,33 +9,82 @@
|
|||||||
<Tag v-for="item in unixHours(row.hours)" :key="item">{{ item }}</Tag>
|
<Tag v-for="item in unixHours(row.hours)" :key="item">{{ item }}</Tag>
|
||||||
</template>
|
</template>
|
||||||
</Table>
|
</Table>
|
||||||
|
|
||||||
|
<Row class="operation">
|
||||||
|
<template v-if="promotionStatus == 'NEW'">
|
||||||
|
<Button type="primary" @click="openSkuList">选择商品</Button>
|
||||||
|
<!-- <Button @click="delAll">批量删除</Button> -->
|
||||||
|
</template>
|
||||||
|
</Row>
|
||||||
|
<Row class="operation">
|
||||||
|
<Tabs type="card" v-model="tabCurrent">
|
||||||
|
<TabPane
|
||||||
|
v-for="(tab, tabIndex) in goodsList"
|
||||||
|
:key="tabIndex"
|
||||||
|
:label="tab.hour"
|
||||||
|
:name="tabIndex + ''"
|
||||||
|
>
|
||||||
<Table
|
<Table
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
border
|
border
|
||||||
class="operation"
|
|
||||||
:columns="goodsColumns"
|
:columns="goodsColumns"
|
||||||
:data="goodsList"
|
v-if="tabIndex == tabCurrent"
|
||||||
ref="table"
|
:data="tab.list"
|
||||||
|
:ref="'table' + tabIndex"
|
||||||
|
@on-selection-change="changeSelect"
|
||||||
>
|
>
|
||||||
<template slot-scope="{ row }" slot="originalPrice">
|
<template slot-scope="{ row }" slot="originalPrice">
|
||||||
<div>
|
<div>{{ row.originalPrice | unitPrice("¥") }}</div>
|
||||||
<priceColorScheme :value="row.originalPrice" :color="$mainColor"></priceColorScheme>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template slot-scope="{ row }" slot="quantity">
|
<template slot-scope="{ row, index }" slot="quantity">
|
||||||
<div>{{ row.quantity }}</div>
|
<InputNumber
|
||||||
|
:min="0"
|
||||||
|
v-model="row.quantity"
|
||||||
|
:disabled="row.promotionApplyStatus == 'PASS'"
|
||||||
|
@input="goodsList[tabIndex].list[index].quantity = row.quantity"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template slot-scope="{ row }" slot="price">
|
<template slot-scope="{ row, index }" slot="price">
|
||||||
<div>
|
<InputNumber
|
||||||
<priceColorScheme :value="row.price" :color="$mainColor"></priceColorScheme>
|
:min="0"
|
||||||
</div>
|
style="width: 100%"
|
||||||
|
v-model="row.price"
|
||||||
|
:disabled="row.promotionApplyStatus == 'PASS'"
|
||||||
|
@input="goodsList[tabIndex].list[index].price = row.price"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template slot-scope="{ row }" slot="time">
|
<template slot-scope="{ row }" slot="promotionApplyStatus">
|
||||||
<Tag>{{ row.timeLine + ":00" }}</Tag>
|
<Badge
|
||||||
|
status="success"
|
||||||
|
v-if="row.promotionApplyStatus == 'PASS'"
|
||||||
|
:text="promotionApplyStatus(row.promotionApplyStatus)"
|
||||||
|
/>
|
||||||
|
<Badge
|
||||||
|
status="blue"
|
||||||
|
v-if="row.promotionApplyStatus == 'APPLY'"
|
||||||
|
:text="promotionApplyStatus(row.promotionApplyStatus)"
|
||||||
|
/>
|
||||||
|
<Badge
|
||||||
|
status="error"
|
||||||
|
v-if="row.promotionApplyStatus == 'REFUSE'"
|
||||||
|
:text="promotionApplyStatus(row.promotionApplyStatus)"
|
||||||
|
/>
|
||||||
|
<span
|
||||||
|
v-if="row.promotionApplyStatus == 'REFUSE'"
|
||||||
|
@click="showReason(row.failReason)"
|
||||||
|
class="reason"
|
||||||
|
>(拒绝原因)</span
|
||||||
|
>
|
||||||
|
<Badge
|
||||||
|
status="error"
|
||||||
|
v-if="row.promotionApplyStatus == ''"
|
||||||
|
:text="promotionApplyStatus(row.promotionApplyStatus)"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template slot-scope="{ row }" slot="QRCode">
|
<template slot-scope="{ row }" slot="QRCode">
|
||||||
<img
|
<img
|
||||||
v-if="row.QRCode"
|
v-if="row.QRCode"
|
||||||
@@ -46,53 +95,69 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template slot-scope="{ row, index }" slot="action">
|
<template slot-scope="{ row, index }" slot="action">
|
||||||
<Button type="error" size="small" @click="delGoods(index, row)">删除 </Button>
|
<Button
|
||||||
|
type="error"
|
||||||
|
v-if="promotionStatus === 'NEW'"
|
||||||
|
size="small"
|
||||||
|
ghost
|
||||||
|
@click="delGoods(index, row)"
|
||||||
|
>删除
|
||||||
|
</Button>
|
||||||
</template>
|
</template>
|
||||||
</Table>
|
</Table>
|
||||||
<Row type="flex" justify="end" class="mt_10">
|
</TabPane>
|
||||||
<Page
|
</Tabs>
|
||||||
:current="searchForm.pageNumber"
|
</Row>
|
||||||
:total="total"
|
|
||||||
:page-size="searchForm.pageSize"
|
<Row class="operation">
|
||||||
@on-change="changePage"
|
<Button @click="closeCurrentPage">返回</Button>
|
||||||
@on-page-size-change="changePageSize"
|
<Button
|
||||||
:page-size-opts="[10, 20, 50]"
|
type="primary"
|
||||||
size="small"
|
:loading="submitLoading"
|
||||||
show-total
|
v-if="promotionStatus === 'NEW'"
|
||||||
show-elevator
|
@click="save"
|
||||||
show-sizer
|
>提交
|
||||||
></Page>
|
</Button>
|
||||||
</Row>
|
</Row>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
|
<sku-select ref="skuSelect" @selectedGoodsData="selectedGoodsData"></sku-select>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
seckillGoodsList,
|
seckillGoodsList,
|
||||||
seckillDetail,
|
seckillDetail,
|
||||||
auditApplySeckill,
|
setSeckillGoods,
|
||||||
delSeckillGoods,
|
delSeckillGoods,
|
||||||
} from "@/api/promotion.js";
|
} from "@/api/promotion.js";
|
||||||
|
import skuSelect from "@/components/lili-dialog";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
skuSelect,
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
tabCurrent(val) {
|
||||||
|
this.tabIndex = val;
|
||||||
|
},
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
tabCurrent: 0,
|
||||||
promotionStatus: "", // 活动状态
|
promotionStatus: "", // 活动状态
|
||||||
showModal: false, // modal显隐
|
|
||||||
openTip: true, // 显示提示
|
|
||||||
loading: false, // 表单加载状态
|
loading: false, // 表单加载状态
|
||||||
submitLoading: false, // 加载状态
|
|
||||||
searchForm: {
|
searchForm: {
|
||||||
// 搜索框初始化对象
|
// 搜索框初始化对象
|
||||||
pageNumber: 1, // 当前页数
|
pageNumber: 0, // 当前页数
|
||||||
pageSize: 10, // 页面大小
|
pageSize: 1000, // 页面大小
|
||||||
},
|
},
|
||||||
total: 0, // 总数
|
tabIndex: 0, // 选择商品的下标
|
||||||
|
submitLoading: false, // 添加或编辑提交状态
|
||||||
selectList: [], // 多选数据
|
selectList: [], // 多选数据
|
||||||
selectCount: 0, // 多选计数
|
selectCount: 0, // 多选计数
|
||||||
data: [], // 表单数据
|
data: [{}], // 表单数据
|
||||||
columns: [
|
columns: [
|
||||||
// 表头
|
|
||||||
{
|
{
|
||||||
title: "活动名称",
|
title: "活动名称",
|
||||||
key: "promotionName",
|
key: "promotionName",
|
||||||
@@ -110,144 +175,121 @@ export default {
|
|||||||
title: "时间场次",
|
title: "时间场次",
|
||||||
slot: "hours",
|
slot: "hours",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: "活动状态",
|
|
||||||
key: "promotionStatus",
|
|
||||||
minWidth: 80,
|
|
||||||
sortable: false,
|
|
||||||
render: (h, params) => {
|
|
||||||
if (params.row.promotionStatus == "NEW") {
|
|
||||||
return h("div", [
|
|
||||||
h("Badge", {
|
|
||||||
props: {
|
|
||||||
status: "error",
|
|
||||||
text: "新建",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]);
|
|
||||||
} else if (params.row.promotionStatus == "START") {
|
|
||||||
return h("div", [
|
|
||||||
h("Badge", {
|
|
||||||
props: {
|
|
||||||
status: "success",
|
|
||||||
text: "开始",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]);
|
|
||||||
} else if (params.row.promotionStatus == "END") {
|
|
||||||
return h("div", [
|
|
||||||
h("Badge", {
|
|
||||||
props: {
|
|
||||||
status: "error",
|
|
||||||
text: "结束",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]);
|
|
||||||
} else if (params.row.promotionStatus == "CLOSE") {
|
|
||||||
return h("div", [
|
|
||||||
h("Badge", {
|
|
||||||
props: {
|
|
||||||
status: "error",
|
|
||||||
text: "废弃",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
goodsColumns: [
|
goodsColumns: [
|
||||||
// 商品表单
|
|
||||||
{
|
{
|
||||||
title: "商品名称",
|
title: "商品名称",
|
||||||
key: "goodsName",
|
key: "goodsName",
|
||||||
minWidth: 120,
|
minWidth: 120,
|
||||||
tooltip: true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "商品价格",
|
title: "商品价格",
|
||||||
slot: "originalPrice",
|
slot: "originalPrice",
|
||||||
width: 110,
|
minWidth: 50,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "库存",
|
title: "库存",
|
||||||
slot: "quantity",
|
slot: "quantity",
|
||||||
minWidth: 30,
|
minWidth: 40,
|
||||||
width: 90,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "活动价格",
|
title: "活动价格",
|
||||||
slot: "price",
|
slot: "price",
|
||||||
width: 100,
|
minWidth: 50,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "商家名称",
|
title: "状态",
|
||||||
key: "storeName",
|
slot: "promotionApplyStatus",
|
||||||
minWidth: 100,
|
minWidth: 30,
|
||||||
tooltip: true,
|
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: "活动场次",
|
|
||||||
width: 100,
|
|
||||||
slot: "time",
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// title: "状态",
|
|
||||||
// slot: "promotionApplyStatus",
|
|
||||||
// width: 90,
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
title: "操作",
|
title: "操作",
|
||||||
slot: "action",
|
slot: "action",
|
||||||
width: 150,
|
minWidth: 50,
|
||||||
align: "center",
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
goodsList: [], // 商品列表
|
goodsList: [], // 商品列表
|
||||||
params: {
|
defaultGoodsList: [], //默认查询秒杀的商品
|
||||||
// 请求参数
|
|
||||||
seckillId: this.$route.query.id,
|
|
||||||
applyStatus: "PASS",
|
|
||||||
failReason: "",
|
|
||||||
ids: "",
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
// 验证规则
|
|
||||||
failReason: [{ required: true, message: "请输入拒绝原因" }],
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 关闭当前页面
|
||||||
|
closeCurrentPage() {
|
||||||
|
this.$store.commit("removeTag", "seckill-goods");
|
||||||
|
localStorage.storeOpenedList = JSON.stringify(
|
||||||
|
this.$store.state.app.storeOpenedList
|
||||||
|
);
|
||||||
|
this.$router.go(-1);
|
||||||
|
},
|
||||||
|
// 提交秒杀商品
|
||||||
|
save() {
|
||||||
|
let list = JSON.parse(JSON.stringify(this.goodsList));
|
||||||
|
let params = {
|
||||||
|
seckillId: this.$route.query.id,
|
||||||
|
applyVos: [],
|
||||||
|
};
|
||||||
|
|
||||||
|
list.forEach((e, index) => {
|
||||||
|
e.list.forEach((i) => {
|
||||||
|
// if(e.id) delete e.id
|
||||||
|
params.applyVos.push(i);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
this.submitLoading = true;
|
||||||
|
|
||||||
|
console.log(list);
|
||||||
|
|
||||||
|
setSeckillGoods(params).then((res) => {
|
||||||
|
this.submitLoading = false;
|
||||||
|
if (res && res.success) {
|
||||||
|
this.$Message.success("提交活动商品成功");
|
||||||
|
this.closeCurrentPage();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
// 初始化数据
|
// 初始化数据
|
||||||
init() {
|
init() {
|
||||||
this.getSeckillMsg();
|
this.getSeckillMsg();
|
||||||
},
|
},
|
||||||
// 分页 改变页码
|
|
||||||
changePage(v) {
|
|
||||||
this.searchForm.pageNumber = v;
|
|
||||||
this.getDataList();
|
|
||||||
this.clearSelectAll();
|
|
||||||
},
|
|
||||||
// 分页 改变页数
|
|
||||||
changePageSize(v) {
|
|
||||||
this.searchForm.pageNumber = 1;
|
|
||||||
this.searchForm.pageSize = v;
|
|
||||||
this.getDataList();
|
|
||||||
},
|
|
||||||
// 清除选中状态
|
// 清除选中状态
|
||||||
clearSelectAll() {
|
clearSelectAll() {
|
||||||
this.$refs.table.selectAll(false);
|
this.$refs.table.selectAll(false);
|
||||||
},
|
},
|
||||||
|
// 获取选择数据
|
||||||
|
changeSelect(e) {
|
||||||
|
this.selectList = e;
|
||||||
|
this.selectCount = e.length;
|
||||||
|
},
|
||||||
|
|
||||||
getDataList() {
|
getDataList() {
|
||||||
// 获取商品详情
|
// 获取商品详情
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.searchForm.seckillId = this.$route.query.id;
|
this.searchForm.seckillId = this.$route.query.id;
|
||||||
|
// 处理过的时间 为‘1:00’
|
||||||
|
let hours = this.unixHours(this.data[0].hours);
|
||||||
|
hours.forEach((e) => {
|
||||||
|
this.goodsList.push({
|
||||||
|
hour: e,
|
||||||
|
list: [],
|
||||||
|
});
|
||||||
|
});
|
||||||
seckillGoodsList(this.searchForm).then((res) => {
|
seckillGoodsList(this.searchForm).then((res) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
if (res.success && res.result) {
|
if (res.success && res.result) {
|
||||||
this.goodsList = res.result.records;
|
let data = res.result.records;
|
||||||
this.total = res.result.total;
|
// 未处理时间 为'1'
|
||||||
|
let noFilterhours = this.data[0].hours.split(",");
|
||||||
|
if (data.length) {
|
||||||
|
noFilterhours.forEach((e, index) => {
|
||||||
|
data.forEach((i) => {
|
||||||
|
if (i.timeLine == e) {
|
||||||
|
this.goodsList[index].list.push(i);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
this.defaultGoodsList = this.goodsList[this.tabIndex].list;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -265,39 +307,105 @@ export default {
|
|||||||
},
|
},
|
||||||
delGoods(index, row) {
|
delGoods(index, row) {
|
||||||
// 删除商品
|
// 删除商品
|
||||||
this.$Modal.confirm({
|
if (row.promotionApplyStatus === "PASS") {
|
||||||
title: "确认删除",
|
|
||||||
content: "您确认要删除该商品吗?删除后不可恢复",
|
|
||||||
onOk: () => {
|
|
||||||
const params = {
|
const params = {
|
||||||
seckillId: row.seckillId,
|
seckillId: row.seckillId,
|
||||||
id: row.id,
|
id: row.id,
|
||||||
};
|
};
|
||||||
delSeckillGoods(params).then((res) => {
|
delSeckillGoods(params).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.goodsList.splice(index, 1);
|
this.goodsList[this.tabIndex].list.splice(index, 1);
|
||||||
this.$Message.success("删除成功!");
|
this.$Message.success("删除成功!");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
this.goodsList[this.tabIndex].list.splice(index, 1);
|
||||||
|
this.$Message.success("删除成功!");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
selectedGoodsData(callback) {
|
||||||
|
let way = [];
|
||||||
|
let data = JSON.parse(JSON.stringify(callback));
|
||||||
|
|
||||||
|
data.forEach((e) => {
|
||||||
|
way.push({
|
||||||
|
goodsName: e.goodsName,
|
||||||
|
price: e.price,
|
||||||
|
originalPrice: e.price,
|
||||||
|
promotionApplyStatus: e.promotionApplyStatus || "",
|
||||||
|
quantity: e.quantity,
|
||||||
|
seckillId: this.$route.query.id,
|
||||||
|
storeId: e.storeId,
|
||||||
|
storeName: e.storeName,
|
||||||
|
skuId: e.id,
|
||||||
|
timeLine: this.data[0].hours.split(",")[this.tabIndex],
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
this.$set(this.goodsList[this.tabIndex], "list", [
|
||||||
|
...way,
|
||||||
|
// ...this.defaultGoodsList,
|
||||||
|
]);
|
||||||
|
// this.$nextTick(() => {
|
||||||
|
// this.$forceUpdate();
|
||||||
|
// });
|
||||||
|
},
|
||||||
|
openSkuList() {
|
||||||
|
// 显示商品选择器
|
||||||
|
|
||||||
|
this.$refs.skuSelect.open("goods");
|
||||||
|
let data = this.goodsList[this.tabIndex].list;
|
||||||
|
data.forEach((e) => {
|
||||||
|
e.id = e.skuId;
|
||||||
|
});
|
||||||
|
this.$refs.skuSelect.goodsData = data;
|
||||||
},
|
},
|
||||||
unixDate(time) {
|
unixDate(time) {
|
||||||
// 处理报名截止时间
|
// 处理报名截止时间
|
||||||
return this.$options.filters.unixToDate(new Date(time) / 1000);
|
return this.$options.filters.unixToDate(new Date(time) / 1000);
|
||||||
},
|
},
|
||||||
unixHours(item) {
|
unixHours(item) {
|
||||||
|
if (item) {
|
||||||
// 处理小时场次
|
// 处理小时场次
|
||||||
let hourArr = item.split(",");
|
let hourArr = item.split(",");
|
||||||
for (let i = 0; i < hourArr.length; i++) {
|
for (let i = 0; i < hourArr.length; i++) {
|
||||||
hourArr[i] += ":00";
|
hourArr[i] += ":00";
|
||||||
}
|
}
|
||||||
return hourArr;
|
return hourArr;
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
},
|
||||||
|
// 格式化申请状态
|
||||||
|
promotionApplyStatus(key) {
|
||||||
|
switch (key) {
|
||||||
|
case "APPLY":
|
||||||
|
return "申请";
|
||||||
|
case "PASS":
|
||||||
|
return "通过";
|
||||||
|
case "REFUSE":
|
||||||
|
return "拒绝";
|
||||||
|
default:
|
||||||
|
return "未申请";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 展示审核拒绝原因
|
||||||
|
showReason(reason) {
|
||||||
|
this.$Modal.info({
|
||||||
|
title: "拒绝原因",
|
||||||
|
content: reason,
|
||||||
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.init();
|
this.init();
|
||||||
},
|
},
|
||||||
|
// 如果是从详情页返回列表页,修改列表页keepAlive为true,确保不刷新页面
|
||||||
|
beforeRouteLeave(to, from, next) {
|
||||||
|
if (to.name === "seckill") {
|
||||||
|
to.meta.keepAlive = true;
|
||||||
|
}
|
||||||
|
next();
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -150,7 +150,6 @@
|
|||||||
<RadioGroup type="button" button-style="solid" v-model="messageSendForm.messageClient"
|
<RadioGroup type="button" button-style="solid" v-model="messageSendForm.messageClient"
|
||||||
@on-change="selectObject">
|
@on-change="selectObject">
|
||||||
<Radio label="member">会员</Radio>
|
<Radio label="member">会员</Radio>
|
||||||
<Radio label="store">商家</Radio>
|
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
@@ -161,14 +160,7 @@
|
|||||||
<Radio v-if="messageSendForm.messageClient == 'member'" label="MEMBER">指定会员</Radio>
|
<Radio v-if="messageSendForm.messageClient == 'member'" label="MEMBER">指定会员</Radio>
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="指定商家" v-if="shopShow">
|
|
||||||
<Select v-model="messageSendForm.userIds" filterable multiple style="width: 90%;"
|
|
||||||
label-in-value @on-change="getName">
|
|
||||||
<Option v-for="item in shopList" :value="item.id" :key="item.id" :lable="item.storeName">{{ item.storeName
|
|
||||||
}}
|
|
||||||
</Option>
|
|
||||||
</Select>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem label="选择会员" prop="scopeType"
|
<FormItem label="选择会员" prop="scopeType"
|
||||||
v-if="memberShow">
|
v-if="memberShow">
|
||||||
<Button type="primary" icon="ios-add" @click="addVip" ghost>选择会员</Button>
|
<Button type="primary" icon="ios-add" @click="addVip" ghost>选择会员</Button>
|
||||||
|
|||||||
@@ -890,6 +890,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 复选框值改变时触发
|
// 复选框值改变时触发
|
||||||
selectOssChange(e) {
|
selectOssChange(e) {
|
||||||
|
console.log(e)
|
||||||
if (e) {
|
if (e) {
|
||||||
this.selectList = e.map(item => {return { id: item.split(',')[0]}});
|
this.selectList = e.map(item => {return { id: item.split(',')[0]}});
|
||||||
this.selectCount = e.length;
|
this.selectCount = e.length;
|
||||||
|
|||||||
331
manager/src/views/sys/setting-manage/pickup.vue
Normal file
331
manager/src/views/sys/setting-manage/pickup.vue
Normal file
@@ -0,0 +1,331 @@
|
|||||||
|
<template>
|
||||||
|
<div class="self-address">
|
||||||
|
<Card>
|
||||||
|
<Button @click="add" type="primary">添加</Button>
|
||||||
|
<Table
|
||||||
|
:loading="loading"
|
||||||
|
border
|
||||||
|
:columns="columns"
|
||||||
|
:data="data"
|
||||||
|
ref="table"
|
||||||
|
style="margin-top:10px"
|
||||||
|
></Table>
|
||||||
|
<Row type="flex" justify="end" style="margin-top:10px;">
|
||||||
|
<Page
|
||||||
|
:current="searchForm.pageNumber"
|
||||||
|
:total="total"
|
||||||
|
:page-size="searchForm.pageSize"
|
||||||
|
@on-change="changePage"
|
||||||
|
@on-page-size-change="changePageSize"
|
||||||
|
:page-size-opts="[10, 20, 50]"
|
||||||
|
size="small"
|
||||||
|
show-total
|
||||||
|
show-elevator
|
||||||
|
show-sizer
|
||||||
|
></Page>
|
||||||
|
</Row>
|
||||||
|
</Card>
|
||||||
|
<Modal
|
||||||
|
:title="modalTitle"
|
||||||
|
v-model="modalVisible"
|
||||||
|
:mask-closable="false"
|
||||||
|
:width="500"
|
||||||
|
>
|
||||||
|
<Form ref="form" :model="form" :label-width="100" :rules="formValidate">
|
||||||
|
<FormItem label="名称" prop="addressName">
|
||||||
|
<Input v-model="form.addressName" clearable style="width: 90%"/>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem label="详细地址" prop="address">
|
||||||
|
<span>{{ form.address || '暂无地址' }}</span>
|
||||||
|
<Button type="default" style="margin-left: 10px;" @click="$refs.map.open()">选择地址</Button>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem label="联系电话" prop="mobile">
|
||||||
|
<Input v-model="form.mobile" clearable style="width: 90%" maxlength="11"/>
|
||||||
|
</FormItem>
|
||||||
|
</Form>
|
||||||
|
<div slot="footer">
|
||||||
|
<Button type="text" @click="modalVisible = false">取消</Button>
|
||||||
|
<Button type="primary" :loading="submitLoading" @click="handleSubmit"
|
||||||
|
>提交
|
||||||
|
</Button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</Modal>
|
||||||
|
<multipleMap ref="map" @callback="getAddress"></multipleMap>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import * as API_Shop from "@/api/shops";
|
||||||
|
import { validateMobile } from "@/libs/validate";
|
||||||
|
|
||||||
|
import multipleMap from "@/components/map/multiple-map";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "shopAddress",
|
||||||
|
components: {
|
||||||
|
multipleMap
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: true, // 表单加载状态
|
||||||
|
modalType: 0, // 添加或编辑标识
|
||||||
|
modalVisible: false, // 添加或编辑显示
|
||||||
|
modalTitle: "", // 添加或编辑标题
|
||||||
|
searchForm: {
|
||||||
|
// 搜索框初始化对象
|
||||||
|
pageNumber: 1, // 当前页数
|
||||||
|
pageSize: 10, // 页面大小
|
||||||
|
},
|
||||||
|
form: {
|
||||||
|
// 添加或编辑表单对象初始化数据
|
||||||
|
addressName: "",
|
||||||
|
center: "",
|
||||||
|
address:"",//详细地址
|
||||||
|
mobile:"",//手机号码
|
||||||
|
},
|
||||||
|
|
||||||
|
// 表单验证规则
|
||||||
|
formValidate: {
|
||||||
|
addressName: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请输入地址名称",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
longitude: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请输入地址经度",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
latitude: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请输入地址纬度",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
mobile: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请输入联系电话号",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
{ validator: validateMobile,
|
||||||
|
trigger: "blur"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
address: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: " ",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
submitLoading: false, // 添加或编辑提交状态
|
||||||
|
columns: [
|
||||||
|
// 表头
|
||||||
|
{
|
||||||
|
title: "自提点名称",
|
||||||
|
key: "addressName",
|
||||||
|
minWidth: 120,
|
||||||
|
sortable: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "详细地址",
|
||||||
|
key: "address",
|
||||||
|
minWidth: 280
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "创建时间",
|
||||||
|
key: "createTime",
|
||||||
|
minWidth: 120,
|
||||||
|
sortable: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
key: "action",
|
||||||
|
align: "center",
|
||||||
|
width: 200,
|
||||||
|
render: (h, params) => {
|
||||||
|
return h("div", [
|
||||||
|
h(
|
||||||
|
"Button",
|
||||||
|
{
|
||||||
|
props: {
|
||||||
|
type: "success",
|
||||||
|
size: "small",
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
marginRight: "5px",
|
||||||
|
},
|
||||||
|
on: {
|
||||||
|
click: () => {
|
||||||
|
this.edit(params.row);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"修改"
|
||||||
|
),
|
||||||
|
h(
|
||||||
|
"Button",
|
||||||
|
{
|
||||||
|
props: {
|
||||||
|
type: "error",
|
||||||
|
size: "small",
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
marginRight: "5px",
|
||||||
|
},
|
||||||
|
on: {
|
||||||
|
click: () => {
|
||||||
|
this.deleteSubmit(params.row);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"删除"
|
||||||
|
)
|
||||||
|
]);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
data: [], // 表单数据
|
||||||
|
total: 0, // 表单数据总数
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
init() { // 初始化数据
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
// 分页 改变页码
|
||||||
|
changePage(v) {
|
||||||
|
this.searchForm.pageNumber = v;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
// 分页 改变页数
|
||||||
|
changePageSize(v) {
|
||||||
|
this.searchForm.pageSize = v;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
// 搜索
|
||||||
|
handleSearch() {
|
||||||
|
this.searchForm.pageNumber = 1;
|
||||||
|
this.searchForm.pageSize = 10;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
// 重置
|
||||||
|
handleReset() {
|
||||||
|
this.$refs.searchForm.resetFields();
|
||||||
|
this.searchForm.pageNumber = 1;
|
||||||
|
this.searchForm.pageSize = 10;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
//获取地址
|
||||||
|
getAddress(val){
|
||||||
|
if(val.type === 'select'){
|
||||||
|
const paths = val.data.map(item => item.name).join(',')
|
||||||
|
this.$set(this.form, 'address', paths)
|
||||||
|
|
||||||
|
this.form.center = val.data[val.data.length - 1].center
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.$set(this.form, 'address', val.data.addr)
|
||||||
|
this.form.address = val.data.address
|
||||||
|
this.form.center = val.data.position.lng + "," + val.data.position.lat
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
// 获取数据
|
||||||
|
getDataList() {
|
||||||
|
this.loading = true;
|
||||||
|
API_Shop.getShopAddress(this.searchForm).then((res) => {
|
||||||
|
this.loading = false;
|
||||||
|
if (res.success) {
|
||||||
|
this.data = res.result.records;
|
||||||
|
this.total = res.result.total;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.total = this.data.length;
|
||||||
|
this.loading = false;
|
||||||
|
},
|
||||||
|
//添加弹出框
|
||||||
|
add() {
|
||||||
|
this.$refs.form.resetFields()
|
||||||
|
this.modalVisible = true
|
||||||
|
this.modalTitle = "添加自提地址"
|
||||||
|
},
|
||||||
|
//修改弹出框
|
||||||
|
edit(v) {
|
||||||
|
this.modalType = 1
|
||||||
|
this.modalVisible = true
|
||||||
|
this.modalTitle = "修改自提地址"
|
||||||
|
this.form.id = v.id
|
||||||
|
this.form.address = v.address
|
||||||
|
this.form.addressName = v.addressName
|
||||||
|
this.form.mobile = v.mobile
|
||||||
|
this.form.center = v.center
|
||||||
|
this.form.longitude = v.center.split(',')[0]
|
||||||
|
this.form.latitude = v.center.split(',')[1]
|
||||||
|
},
|
||||||
|
|
||||||
|
//保存或者编辑
|
||||||
|
handleSubmit() {
|
||||||
|
this.$refs.form.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
this.submitLoading = true;
|
||||||
|
if (this.modalType == 0) {
|
||||||
|
// 添加
|
||||||
|
delete this.form.id;
|
||||||
|
API_Shop.addShopAddress(this.form).then((res) => {
|
||||||
|
this.submitLoading = false;
|
||||||
|
if (res.success) {
|
||||||
|
this.$Message.success("添加成功");
|
||||||
|
this.getDataList();
|
||||||
|
this.modalVisible = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// 编辑
|
||||||
|
API_Shop.editShopAddress(this.form.id, this.form).then((res) => {
|
||||||
|
this.submitLoading = false;
|
||||||
|
if (res.success) {
|
||||||
|
this.$Message.success("修改成功");
|
||||||
|
this.getDataList();
|
||||||
|
this.modalVisible = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//删除
|
||||||
|
deleteSubmit(v){
|
||||||
|
this.$Modal.confirm({
|
||||||
|
title: "确认删除",
|
||||||
|
// 记得确认修改此处
|
||||||
|
content: "确认删除自提地址么?",
|
||||||
|
loading: true,
|
||||||
|
onOk: () => {
|
||||||
|
API_Shop.deleteShopAddress(v.id).then((res) => {
|
||||||
|
this.$Modal.remove();
|
||||||
|
if (res.success) {
|
||||||
|
this.$Message.success("此自自提地址已删除");
|
||||||
|
this.init();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
@@ -0,0 +1,124 @@
|
|||||||
|
<template>
|
||||||
|
<div class="layout">
|
||||||
|
<Form ref="formValidate" :label-width="150" label-position="right" :model="formValidate" :rules="ruleValidate">
|
||||||
|
<FormItem label="发货人姓名" prop="salesConsignorName">
|
||||||
|
<Input v-model="formValidate.salesConsignorName"/>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem label="发货人手机号" prop="salesConsignorMobile">
|
||||||
|
<Input v-model="formValidate.salesConsignorMobile"/>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem label="地址名称" >
|
||||||
|
{{ formValidate.salesConsignorAddressPath || '暂无地址' }}
|
||||||
|
|
||||||
|
|
||||||
|
<Button style="margin-left: 10px;" @click="$refs.map.open()">选择</Button>
|
||||||
|
|
||||||
|
</FormItem>
|
||||||
|
<FormItem label="详细地址" prop="salesConsignorDetail">
|
||||||
|
<Input type="textarea" v-model="formValidate.salesConsignorDetail"/>
|
||||||
|
</FormItem>
|
||||||
|
|
||||||
|
<div class="label-btns">
|
||||||
|
<Button type="primary" @click="submit('formValidate')">保存</Button>
|
||||||
|
</div>
|
||||||
|
</Form>
|
||||||
|
<multipleMap ref="map" @callback="selectedRegion"/>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import multipleMap from "@/components/map/multiple-map";
|
||||||
|
|
||||||
|
import {setSetting} from "@/api/index";
|
||||||
|
import {handleSubmit} from "./validate";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
ruleValidate: {}, // 验证规则
|
||||||
|
formValidate: { // 表单数据
|
||||||
|
salesConsignorName: "",
|
||||||
|
salesConsignorMobile:"",
|
||||||
|
salesConsignorDetail:"",
|
||||||
|
salesConsignorAddressPath:"",
|
||||||
|
salesConsignorAddressId:""
|
||||||
|
},
|
||||||
|
result:"",
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components:{
|
||||||
|
multipleMap
|
||||||
|
},
|
||||||
|
props: ["res", "type"],
|
||||||
|
created() {
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 选中的地址
|
||||||
|
selectedRegion(val) {
|
||||||
|
if(val.type === 'select'){
|
||||||
|
const paths = val.data.map(item => item.name).join(',')
|
||||||
|
const ids = val.data.map(item => item.id).join(',')
|
||||||
|
|
||||||
|
this.$set(this.formValidate,'salesConsignorAddressPath',paths)
|
||||||
|
this.$set(this.formValidate,'salesConsignorAddressId',ids)
|
||||||
|
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.$set(this.formValidate,'salesConsignorAddressPath',val.data.addr)
|
||||||
|
this.$set(this.formValidate,'salesConsignorAddressId',val.data.addrId)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 保存
|
||||||
|
submit(name) {
|
||||||
|
let that = this;
|
||||||
|
if (handleSubmit(that, name)) {
|
||||||
|
this.setupSetting()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 保存设置
|
||||||
|
setupSetting() {
|
||||||
|
setSetting(this.type, this.formValidate).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$Message.success("保存成功!");
|
||||||
|
} else {
|
||||||
|
this.$Message.error("保存失败!");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 实例化数据
|
||||||
|
init() {
|
||||||
|
this.result = JSON.parse(this.res);
|
||||||
|
|
||||||
|
this.$set(this, "formValidate", {...this.result});
|
||||||
|
Object.keys(this.formValidate).forEach((item) => {
|
||||||
|
this.ruleValidate[item] = [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请填写必填项",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import "./style.scss";
|
||||||
|
|
||||||
|
.label-item {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .ivu-input {
|
||||||
|
width: 300px !important;
|
||||||
|
margin: 0 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ivu-input-wrapper {
|
||||||
|
width: 300px;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,28 +1,57 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="layout">
|
<div class="layout">
|
||||||
|
<Alert>
|
||||||
|
企业微信客服设置提示
|
||||||
|
<template slot="desc">
|
||||||
|
<p>1.移动端需配置客服链接地址和企业id <a href="https://work.weixin.qq.com/nl/act/p/a733314375294bdd" target="blank">查看如何配置</a>
|
||||||
|
</p>
|
||||||
|
<p>2.PC端需配置企业微信客服二维码</p>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
</Alert>
|
||||||
<Form ref="formValidate" :label-width="150" label-position="right" :model="formValidate" :rules="ruleValidate">
|
<Form ref="formValidate" :label-width="150" label-position="right" :model="formValidate" :rules="ruleValidate">
|
||||||
<FormItem label="云IM地址" prop="httpUrl">
|
<FormItem label="客服链接" prop="url">
|
||||||
<Input v-model="formValidate.httpUrl"/>
|
<Input v-model="formValidate.url" />
|
||||||
<span class="desc">配置买家端联系客服以及商家端登录客服跳转的路径</span>
|
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
<FormItem label="企业ID" prop="companyId">
|
||||||
|
<Input v-model="formValidate.companyId" />
|
||||||
|
</FormItem>
|
||||||
|
<!-- <FormItem label="客服二维码" prop="qrCode">
|
||||||
|
<div class="label-item-upload">
|
||||||
|
<img v-if="formValidate.qrCode" class="img" :src="formValidate.qrCode" />
|
||||||
|
<img v-else class="img" src="../../../../assets/emptyImg.png" alt="">
|
||||||
|
<Button style @click="onClickImg('qrCode')">选择图片</Button>
|
||||||
|
</div>
|
||||||
|
</FormItem> -->
|
||||||
|
|
||||||
<div class="label-btns">
|
<div class="label-btns">
|
||||||
<Button type="primary" @click="submit('formValidate')">保存</Button>
|
<Button type="primary" @click="submit('formValidate')">保存</Button>
|
||||||
</div>
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
|
<Modal width="1200px" v-model="picModelFlag">
|
||||||
|
<ossManage @callback="callbackSelected" :isComponent="true" :initialize="picModelFlag" ref="ossManage" />
|
||||||
|
</Modal>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { setSetting } from "@/api/index";
|
import { setSetting } from "@/api/index";
|
||||||
import { handleSubmit } from "./validate";
|
import { handleSubmit } from "./validate";
|
||||||
|
import ossManage from "@/views/sys/oss-manage/ossManage";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components:{ossManage},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
ruleValidate: {}, // 验证规则
|
ruleValidate: {}, // 验证规则
|
||||||
formValidate: { // 表单数据
|
formValidate: { // 表单数据
|
||||||
httpUrl: ""
|
url: "",
|
||||||
|
companyId:"",
|
||||||
|
qrCode:""
|
||||||
},
|
},
|
||||||
|
picModelFlag: false, // 预览图片显隐
|
||||||
|
selected: "", // 已选数据
|
||||||
|
|
||||||
result: "",
|
result: "",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -31,6 +60,15 @@ export default {
|
|||||||
this.init();
|
this.init();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
callbackSelected(val) {
|
||||||
|
this.picModelFlag = false;
|
||||||
|
this.formValidate[this.selected] = val.url;
|
||||||
|
},
|
||||||
|
onClickImg(item) {
|
||||||
|
this.selected = item;
|
||||||
|
this.$refs.ossManage.selectImage = true;
|
||||||
|
this.picModelFlag = true;
|
||||||
|
},
|
||||||
// 保存
|
// 保存
|
||||||
submit(name) {
|
submit(name) {
|
||||||
let that = this;
|
let that = this;
|
||||||
@@ -83,4 +121,22 @@ export default {
|
|||||||
width: 300px;
|
width: 300px;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.label-item {
|
||||||
|
display: flex;
|
||||||
|
> .ivu-input {
|
||||||
|
width: 200px;
|
||||||
|
margin: 0 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.label-item-upload {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
|
img {
|
||||||
|
margin-right: 10px;
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -60,7 +60,11 @@ export default {
|
|||||||
//阿里短信配置
|
//阿里短信配置
|
||||||
{
|
{
|
||||||
type: "IM_SETTING",
|
type: "IM_SETTING",
|
||||||
name: "客服设置",
|
name: "企业微信客服设置",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "DELIVERY_SETTING",
|
||||||
|
name: "电子面单发货地址",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
authLogin: [
|
authLogin: [
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import WECHAT_CONNECT from "./authLogin/WECHAT_CONNECT";
|
|||||||
import QQ_CONNECT from "./authLogin/QQ_CONNECT";
|
import QQ_CONNECT from "./authLogin/QQ_CONNECT";
|
||||||
import CONNECT_SETTING from "./authLogin/CONNECT_SETTING";
|
import CONNECT_SETTING from "./authLogin/CONNECT_SETTING";
|
||||||
|
|
||||||
|
import DELIVERY_SETTING from "./setting/DELIVERY_SETTING";
|
||||||
export default {
|
export default {
|
||||||
BASE_SETTING,
|
BASE_SETTING,
|
||||||
GOODS_SETTING,
|
GOODS_SETTING,
|
||||||
@@ -21,6 +22,7 @@ export default {
|
|||||||
POINT_SETTING,
|
POINT_SETTING,
|
||||||
LOGISTICS_SETTING,
|
LOGISTICS_SETTING,
|
||||||
OSS_SETTING,
|
OSS_SETTING,
|
||||||
|
DELIVERY_SETTING,
|
||||||
SMS_SETTING,
|
SMS_SETTING,
|
||||||
IM_SETTING,
|
IM_SETTING,
|
||||||
WITHDRAWAL_SETTING,
|
WITHDRAWAL_SETTING,
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ export const addShipTemplate = (params, headers) => {
|
|||||||
return postRequest(`/setting/freightTemplate`, params, headers)
|
return postRequest(`/setting/freightTemplate`, params, headers)
|
||||||
}
|
}
|
||||||
|
|
||||||
//新增运费模板
|
//编辑运费模板
|
||||||
export const editShipTemplate = (id, params, headers) => {
|
export const editShipTemplate = (id, params, headers) => {
|
||||||
return putRequest(`/setting/freightTemplate/${id}`, params, headers)
|
return putRequest(`/setting/freightTemplate/${id}`, params, headers)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,9 +123,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
confirmUrls(){
|
confirmUrls(){
|
||||||
this.selectedImage.length ? this.selectedImage.forEach(element => {
|
// this.selectedImage.length ? this.selectedImage.forEach(element => {
|
||||||
this.images.push({ url: element.url })
|
// this.images.push({ url: element.url })
|
||||||
}):''
|
// }):''
|
||||||
this.showOssManager = false
|
this.showOssManager = false
|
||||||
},
|
},
|
||||||
handleCallback(val){
|
handleCallback(val){
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
</Card>
|
</Card>
|
||||||
<Modal v-model="openModal" :title="openModalTitle" @on-ok="submit" @on-cancel="cancelModal">
|
<Modal v-model="openModal" :title="openModalTitle" @on-ok="submit" @on-cancel="cancelModal">
|
||||||
<h3 style="color: #ff3c2a; margin-bottom: 10px">是否需要电子面单</h3>
|
<h3 style="color: #ff3c2a; margin-bottom: 10px">是否需要电子面单</h3>
|
||||||
|
|
||||||
<ButtonGroup style="margin-bottom: 10px;">
|
<ButtonGroup style="margin-bottom: 10px;">
|
||||||
<Button :type="faceSheetForm.faceSheetFlag ? 'primary' : 'default'"
|
<Button :type="faceSheetForm.faceSheetFlag ? 'primary' : 'default'"
|
||||||
@click="faceSheetForm.faceSheetFlag = true">需要</Button>
|
@click="faceSheetForm.faceSheetFlag = true">需要</Button>
|
||||||
|
|||||||
Reference in New Issue
Block a user