This commit is contained in:
faiz 2024-03-30 18:52:24 +08:00
parent ba65f5e957
commit c1d92e8ac6
8 changed files with 1434 additions and 918 deletions

View File

@ -2,11 +2,11 @@
ENV = 'development' ENV = 'development'
# base api # base api
# VUE_APP_BASE_API = 'http://192.168.31.106:8324' VUE_APP_BASE_API = 'http://192.168.1.32:8080'
VUE_APP_BASE_API = 'http://many.shop.lo' # VUE_APP_BASE_API = 'https://plus.hwms.shop'
# socket 连接地址 # socket 连接地址
VUE_APP_WS_URL = 'ws://many.shop.lo' VUE_APP_WS_URL = 'ws://plus.hwms.shop'
# VUE_APP_WS_URL = 'ws://mer1.crmeb.net' # VUE_APP_WS_URL = 'ws://mer1.crmeb.net'
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable, # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,

View File

@ -57,6 +57,12 @@ export function attrCreatApi(data) {
export function attrEdittApi(id, data) { export function attrEdittApi(id, data) {
return request.post(`store/attr/template/${id}`, data) return request.post(`store/attr/template/${id}`, data)
} }
/**
* @description 上传 -- 编辑
*/
export function httpRequest(data) {
return request.post(`upload/pdf`, data)
}
/** /**
* @description 属性规则 -- 删除 * @description 属性规则 -- 删除
*/ */
@ -528,11 +534,11 @@ export function batchesTempApi(data) {
} }
/** 参数模板 -- 添加 */ /** 参数模板 -- 添加 */
export function productSpecs(data) { export function productSpecs(data) {
return request.post(`store/params/temp/create`,data) return request.post(`store/params/temp/create`, data)
} }
/** 参数模板 -- 编辑 */ /** 参数模板 -- 编辑 */
export function specsUpdate(id, data) { export function specsUpdate(id, data) {
return request.post(`store/params/temp/update/${id}`,data) return request.post(`store/params/temp/update/${id}`, data)
} }
/** 参数模板 -- 详情 */ /** 参数模板 -- 详情 */
export function productSpecsInfo(id) { export function productSpecsInfo(id) {
@ -552,7 +558,7 @@ export function specsDetailApi(id) {
} }
/** 添加商品 -- 参数筛选 */ /** 添加商品 -- 参数筛选 */
export function specsSelectedApi(data) { export function specsSelectedApi(data) {
return request.get(`store/params/temp/select`,data) return request.get(`store/params/temp/select`, data)
} }
/** 添加商品 -- 参数筛选详情 */ /** 添加商品 -- 参数筛选详情 */
export function productSpecsDetailApi(data) { export function productSpecsDetailApi(data) {
@ -567,7 +573,7 @@ export function productBathSvipApi(data) {
return request.post(`store/product/batch_svip`, data) return request.post(`store/product/batch_svip`, data)
} }
/** 商品列表 -- 立即生成规格 */ /** 商品列表 -- 立即生成规格 */
export function generateAttrApi(id,data) { export function generateAttrApi(id, data) {
return request.post(`store/product/get_attr_value/${id}`, data) return request.post(`store/product/get_attr_value/${id}`, data)
} }
/** 商品列表 -- 系统表单下拉 */ /** 商品列表 -- 系统表单下拉 */
@ -580,11 +586,11 @@ export function associatedFormInfo(id) {
} }
/** 商品列表 -- 批量设置 */ /** 商品列表 -- 批量设置 */
export function batchSetProduct(data) { export function batchSetProduct(data) {
return request.post(`store/product/batch_process`,data) return request.post(`store/product/batch_process`, data)
} }
/** 商品列表 -- 商品操作记录 */ /** 商品列表 -- 商品操作记录 */
export function operateRecordList(id,data) { export function operateRecordList(id, data) {
return request.get(`store/product/get_operate_list/${id}`,data) return request.get(`store/product/get_operate_list/${id}`, data)
} }
/** /**
@ -616,4 +622,4 @@ export function unitDeleteApi(id) {
*/ */
export function unitOptionsApi() { export function unitOptionsApi() {
return request.get(`product/unit/option`) return request.get(`product/unit/option`)
} }

View File

@ -118,7 +118,7 @@
</el-button> </el-button>
</el-form-item> </el-form-item>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="16">
<el-form-item label="指定区域不配送:" prop="undelivery"> <el-form-item label="指定区域不配送:" prop="undelivery">
<el-radio-group v-model="ruleForm.undelivery"> <el-radio-group v-model="ruleForm.undelivery">
<el-radio :label="1">自定义</el-radio> <el-radio :label="1">自定义</el-radio>
@ -126,7 +126,7 @@
<el-radio :label="0">关闭</el-radio> <el-radio :label="0">关闭</el-radio>
</el-radio-group> </el-radio-group>
<br> <br>
(说明: 选择"开启", 仅支持上表添加的配送区域) (说明: 选择"开启"仅支持上表添加的可配送区域下单除此之外的全部区域无法下单)
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -482,7 +482,7 @@ export default {
} }
.noBox ::v-deep .el-form-item__content{ .noBox ::v-deep .el-form-item__content{
margin-left: 0 !important; margin-left: 0 !important;
} }
.tempBox ::v-deep .el-input-number--mini{ .tempBox ::v-deep .el-input-number--mini{
width: 100px !important; width: 100px !important;
} }

View File

@ -8,198 +8,200 @@
// | Author: CRMEB Team <admin@crmeb.com> // | Author: CRMEB Team <admin@crmeb.com>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
import { isEmpty } from 'element-ui/lib/utils/util'; import { isEmpty } from 'element-ui/lib/utils/util'
import ExcelJS from 'exceljs' import ExcelJS from 'exceljs'
import * as FileSaver from 'file-saver' import * as FileSaver from 'file-saver'
export default function createWorkBook(header, title, data, foot, filename,sheets){ export default function createWorkBook(header, title, data, foot, filename, sheets) {
const letter = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']; const letter = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
let lcomun = 1; let lcomun = 1
let worksheet ; let worksheet
const workBook = new ExcelJS.Workbook(); const workBook = new ExcelJS.Workbook()
let long = header.length; const long = header.length
/**
* 创建工作薄
* @param {*} sheets
*/
function createSheets(sheets) {
let sheet = Array.isArray(sheets) ? sheets[0] : sheets;
let style = Array.isArray(sheets) ? sheets[1] : {};
worksheet = workBook.addWorksheet(sheet,style);
}
/**
* 设置表名介绍等
* @param {*} title
* @param {*} long
*/
function setTitle(title,long){
if (isEmpty(title)) return ;
title = Array.isArray(title) ? title : title.split(',');
for (let i = 0; i < title.length; i++) {
let ti = worksheet.getRow(i + 1);
ti.getCell(1).value = title[i];
ti.height = 30;
ti.font = {bold: true,size: 20,vertAlign: 'subscript',};
ti.alignment = { vertical: 'bottom', horizontal: 'center' };
ti.outlineLevel = 1;
worksheet.mergeCells(i + 1 , 1, i + 1, long)
ti.commit();
lcomun++;
}
}
/**
* 设置表头行
* @param {*} header
*/
function setHeader(header){
if (isEmpty(header)) return ;
const headerRow = worksheet.getRow(lcomun);
for (let index = 1; index <= header.length; index++) {
headerRow.getCell(index).value = header[index - 1];
}
headerRow.height = 25;
headerRow.width = 50;
headerRow.font = {bold: true, size: 18,vertAlign: 'subscript',};
headerRow.alignment = { vertical: 'bottom', horizontal: 'center' };
headerRow.outlineLevel = 1;
headerRow.commit();
lcomun++;
}
/**
* 导出内容
* @param {*} data
*/
function setContent(data){
if (isEmpty(data)) return ;
for (let h = 0; h < data.length; h++) {
let satarLcomun = lcomun;
let lcomunNow = worksheet.getRow(lcomun);
let hasMerge = false;
let starKey = 0;
let endKey = 0;
/** 循环列 */
//需要操作第几列
let sk = 0;
for (let l = 0; l < data[h].length; l++) {
if (Array.isArray(data[h][l])) {
//数组长度
starKey = sk;
hasMerge = true;
setArrayContent(data[h][l],sk);
sk = sk + data[h][l][0].length
endKey =sk;
} else {
//不是数组
lcomunNow.getCell(getLetter(sk)).value = data[h][l];
lcomunNow.getCell(getLetter(sk)).border = {top: {style:'thin'},left: {style:'thin'},bottom: {style:'thin'},right: {style:'thin'}};
lcomunNow.alignment = { vertical: 'middle', horizontal: 'center' };
sk++
}
}
if (hasMerge) setMergeLcomun(satarLcomun, lcomun, starKey, endKey);
lcomunNow.height = 25;
lcomunNow.commit();
lcomun++
}
}
/**
* 占多行的数组
* @param {*} arr
* @param {*} sk
*/
function setArrayContent(arr, sk) {
/** /**
* 循环二维数组,在循环行 * 创建工作薄
*/ * @param {*} sheets
let al = arr.length; */
let sl = al - 1 ; function createSheets(sheets) {
for (let i = 0; i < arr.length; i++ ) { const sheet = Array.isArray(sheets) ? sheets[0] : sheets
let lcomunNow = worksheet.getRow(lcomun); const style = Array.isArray(sheets) ? sheets[1] : {}
for(let v = 0; v < arr[i].length; v++) { worksheet = workBook.addWorksheet(sheet, style)
lcomunNow.getCell(getLetter(sk+v)).value = arr[i][v];
lcomunNow.getCell(getLetter(sk+v)).border = {top: {style:'thin'},left: {style:'thin'},bottom: {style:'thin'},right: {style:'thin'}};
lcomunNow.alignment = { vertical: 'middle', horizontal: 'center' };
}
lcomunNow.height = 25;
lcomunNow.commit()
if (i < sl) lcomun++
} }
}
/**
* 合并操作
* @param {*} satarLcomun
* @param {*} endLcomun
* @param {*} starKey
* @param {*} endKey
*/
function setMergeLcomun(satarLcomun, endLcomun, starKey, endKey){
for(let ml = 0 ; ml < long ; ml++ ){
if (ml < starKey || ml >= endKey) {
worksheet.mergeCells(getLetter(ml) + satarLcomun +':'+getLetter(ml) + endLcomun)
}
}
}
/** /**
* 设置表末尾统计备注等 * 设置表名介绍等
* @param {*} footData * @param {*} title
* @param {*} long
*/ */
function setFoot(footData){ function setTitle(title, long) {
if (isEmpty(footData)) return ; if (isEmpty(title)) return
if (Array.isArray(footData)) { title = Array.isArray(title) ? title : title.split(',')
for (let f = 0; f < footData.length; f++) { for (let i = 0; i < title.length; i++) {
let lcomunNow = worksheet.getRow(lcomun); const ti = worksheet.getRow(i + 1)
lcomunNow.getCell(1).value = footData[f]; ti.getCell(1).value = title[i]
lcomunNow.getCell(1).border = {top: {style:'thin'},left: {style:'thin'},bottom: {style:'thin'},right: {style:'thin'}}; ti.height = 30
lcomunNow.alignment = { vertical: 'middle', horizontal: 'left' }; ti.font = { bold: true, size: 20, vertAlign: 'subscript' }
worksheet.mergeCells('A' + lcomun +':'+getLetter(long-1) + lcomun) ti.alignment = { vertical: 'bottom', horizontal: 'center' }
ti.outlineLevel = 1
worksheet.mergeCells(i + 1, 1, i + 1, long)
ti.commit()
lcomun++ lcomun++
} }
} else {
let lcomunNow = worksheet.getRow(lcomun);
lcomunNow.getCell(1).value = footData[f];
lcomunNow.getCell(1).border = {top: {style:'thin'},left: {style:'thin'},bottom: {style:'thin'},right: {style:'thin'}};
lcomunNow.alignment = { vertical: 'middle', horizontal: 'left' };
worksheet.mergeCells('A' + lcomun +':'+getLetter(long-1) + lcomun)
} }
} /**
* 设置表头行
* @param {*} header
*/
function setHeader(header) {
if (isEmpty(header)) return
const headerRow = worksheet.getRow(lcomun)
for (let index = 1; index <= header.length; index++) {
headerRow.getCell(index).value = header[index - 1]
}
headerRow.height = 25
headerRow.width = 50
headerRow.font = { bold: true, size: 18, vertAlign: 'subscript' }
headerRow.alignment = { vertical: 'bottom', horizontal: 'center' }
headerRow.outlineLevel = 1
headerRow.commit()
lcomun++
}
/** /**
* 导出内容
* @param {*} data
*/
function setContent(data) {
if (isEmpty(data)) return
for (let h = 0; h < data.length; h++) {
const satarLcomun = lcomun
const lcomunNow = worksheet.getRow(lcomun)
let hasMerge = false
let starKey = 0
let endKey = 0
/** 循环列 */
// 需要操作第几列
let sk = 0
for (let l = 0; l < data[h].length; l++) {
if (Array.isArray(data[h][l])) {
// 数组长度
starKey = sk
hasMerge = true
setArrayContent(data[h][l], sk)
// console.log(data[h][l][0].length)
if (data[h][l][0]) {
sk = sk + data[h][l][0].length
}
endKey = sk
} else {
// 不是数组
lcomunNow.getCell(getLetter(sk)).value = data[h][l]
lcomunNow.getCell(getLetter(sk)).border = { top: { style: 'thin' }, left: { style: 'thin' }, bottom: { style: 'thin' }, right: { style: 'thin' } }
lcomunNow.alignment = { vertical: 'middle', horizontal: 'center' }
sk++
}
}
if (hasMerge) setMergeLcomun(satarLcomun, lcomun, starKey, endKey)
lcomunNow.height = 25
lcomunNow.commit()
lcomun++
}
}
/**
* 占多行的数组
* @param {*} arr
* @param {*} sk
*/
function setArrayContent(arr, sk) {
/**
* 循环二维数组,在循环行
*/
const al = arr.length
const sl = al - 1
for (let i = 0; i < arr.length; i++) {
const lcomunNow = worksheet.getRow(lcomun)
for (let v = 0; v < arr[i].length; v++) {
lcomunNow.getCell(getLetter(sk + v)).value = arr[i][v]
lcomunNow.getCell(getLetter(sk + v)).border = { top: { style: 'thin' }, left: { style: 'thin' }, bottom: { style: 'thin' }, right: { style: 'thin' } }
lcomunNow.alignment = { vertical: 'middle', horizontal: 'center' }
}
lcomunNow.height = 25
lcomunNow.commit()
if (i < sl) lcomun++
}
}
/**
* 合并操作
* @param {*} satarLcomun
* @param {*} endLcomun
* @param {*} starKey
* @param {*} endKey
*/
function setMergeLcomun(satarLcomun, endLcomun, starKey, endKey) {
for (let ml = 0; ml < long; ml++) {
if (ml < starKey || ml >= endKey) {
worksheet.mergeCells(getLetter(ml) + satarLcomun + ':' + getLetter(ml) + endLcomun)
}
}
}
/**
* 设置表末尾统计备注等
* @param {*} footData
*/
function setFoot(footData) {
if (isEmpty(footData)) return
if (Array.isArray(footData)) {
for (let f = 0; f < footData.length; f++) {
const lcomunNow = worksheet.getRow(lcomun)
lcomunNow.getCell(1).value = footData[f]
lcomunNow.getCell(1).border = { top: { style: 'thin' }, left: { style: 'thin' }, bottom: { style: 'thin' }, right: { style: 'thin' } }
lcomunNow.alignment = { vertical: 'middle', horizontal: 'left' }
worksheet.mergeCells('A' + lcomun + ':' + getLetter(long - 1) + lcomun)
lcomun++
}
} else {
const lcomunNow = worksheet.getRow(lcomun)
lcomunNow.getCell(1).value = footData[f]
lcomunNow.getCell(1).border = { top: { style: 'thin' }, left: { style: 'thin' }, bottom: { style: 'thin' }, right: { style: 'thin' } }
lcomunNow.alignment = { vertical: 'middle', horizontal: 'left' }
worksheet.mergeCells('A' + lcomun + ':' + getLetter(long - 1) + lcomun)
}
}
/**
* 处理超过26个字母的列 * 处理超过26个字母的列
* @param {*} number * @param {*} number
* @returns * @returns
*/ */
function getLetter(number){ function getLetter(number) {
if (number < 26) { if (number < 26) {
return letter[number]; return letter[number]
} else { } else {
let n = number % 26 const n = number % 26
let l = Math.floor(number % 26) const l = Math.floor(number % 26)
return letter[l]+letter[n] return letter[l] + letter[n]
}
} }
}
/** /**
* 导出下载 * 导出下载
* @param {*} filename * @param {*} filename
*/ */
function saveAndDowloade(filename){ function saveAndDowloade(filename) {
if (!filename) filename = new Date().getTime(); if (!filename) filename = new Date().getTime()
workBook.xlsx.writeBuffer().then(data => { workBook.xlsx.writeBuffer().then(data => {
const blob = new Blob([data], {type: 'application/octet-stream'}) const blob = new Blob([data], { type: 'application/octet-stream' })
FileSaver.saveAs(blob, filename + '.xlsx') FileSaver.saveAs(blob, filename + '.xlsx')
}) })
} }
createSheets(sheets);
setTitle(title,long);
setHeader(header);
setContent(data);
setFoot(foot);
saveAndDowloade(filename);
createSheets(sheets)
setTitle(title, long)
setHeader(header)
setContent(data)
setFoot(foot)
saveAndDowloade(filename)
} }

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="divBox"> <div class="divBox">
<div class="selCard mb14"> <div class="selCard mb14">
<el-form :model="tableFrom" ref="searchForm" size="small" label-width="85px" inline> <el-form ref="searchForm" :model="tableFrom" size="small" label-width="85px" inline>
<el-form-item label="订单状态:" style="display: block;" prop="status"> <el-form-item label="订单状态:" style="display: block;" prop="status">
<el-radio-group v-model="tableFrom.status" type="button" @change="getList(1),getCardList()"> <el-radio-group v-model="tableFrom.status" type="button" @change="getList(1),getCardList()">
<el-radio-button label>全部 {{ '(' +orderChartType.all?orderChartType.all:0 + ')' }}</el-radio-button> <el-radio-button label>全部 {{ '(' +orderChartType.all?orderChartType.all:0 + ')' }}</el-radio-button>
@ -89,13 +89,13 @@
</el-form-item> </el-form-item>
<el-form-item label="用户信息:" prop="username"> <el-form-item label="用户信息:" prop="username">
<el-input v-model="tableFrom.username" placeholder="请输入用户昵称/手机号" class="selWidth" clearable @keyup.enter.native="getList(1),getCardList()" /> <el-input v-model="tableFrom.username" placeholder="请输入用户昵称/手机号" class="selWidth" clearable @keyup.enter.native="getList(1),getCardList()" />
</el-form-item> </el-form-item>
<el-form-item label="快递单号:" prop="delivery_id"> <el-form-item label="快递单号:" prop="delivery_id">
<el-input v-model="tableFrom.delivery_id" placeholder="请输入快递单号" class="selWidth" clearable @keyup.enter.native="getList(1),getCardList()" /> <el-input v-model="tableFrom.delivery_id" placeholder="请输入快递单号" class="selWidth" clearable @keyup.enter.native="getList(1),getCardList()" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" size="small" @click="getList(1),getCardList()">搜索</el-button> <el-button type="primary" size="small" @click="getList(1),getCardList()">搜索</el-button>
<el-button size="small" @click="searchReset()">重置</el-button> <el-button size="small" @click="searchReset()">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
@ -168,7 +168,7 @@
<span v-show="scope.row.is_del > 0" style="color: #ED4014;display: block;">用户已删除</span> <span v-show="scope.row.is_del > 0" style="color: #ED4014;display: block;">用户已删除</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="real_name" label="收货人/订购人" min-width="130" /> <el-table-column prop="real_name" label="收货人/订购人" min-width="130" />
<el-table-column label="商品信息" min-width="330"> <el-table-column label="商品信息" min-width="330">
<template slot-scope="scope"> <template slot-scope="scope">
@ -223,7 +223,7 @@
<el-button v-if="scope.row.paid === 0 && scope.row.is_del===0 && scope.row.activity_type != 2" type="text" size="small" @click="edit(scope.row.order_id)">编辑</el-button> <el-button v-if="scope.row.paid === 0 && scope.row.is_del===0 && scope.row.activity_type != 2" type="text" size="small" @click="edit(scope.row.order_id)">编辑</el-button>
<el-button v-if="(scope.row.order_type == 0 || scope.row.order_type == 2) && scope.row.status === 0 && scope.row.paid === 1" type="text" size="small" @click="send(scope.row,scope.row.order_id)">发送货</el-button> <el-button v-if="(scope.row.order_type == 0 || scope.row.order_type == 2) && scope.row.status === 0 && scope.row.paid === 1" type="text" size="small" @click="send(scope.row,scope.row.order_id)">发送货</el-button>
<el-button v-if="scope.row.is_del !== 0" type="text" size="small" @click.native="handleDelete(scope.row, scope.$index)">删除</el-button> <el-button v-if="scope.row.is_del !== 0" type="text" size="small" @click.native="handleDelete(scope.row, scope.$index)">删除</el-button>
<el-button v-if="scope.row.order_type == 1 && scope.row.status === 0 && scope.row.paid === 1" type="text" size="small" @click.native="orderCancellation(scope.row.verify_code)">去核销</el-button> <el-button v-if="scope.row.order_type == 1 && scope.row.status === 0 && scope.row.paid === 1" type="text" size="small" @click.native="orderCancellation(scope.row.verify_code)">去核销</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -277,7 +277,7 @@
<el-form-item label="选择类型:" prop="delivery_type"> <el-form-item label="选择类型:" prop="delivery_type">
<el-radio-group v-model="shipment.delivery_type" @change="changeSend"> <el-radio-group v-model="shipment.delivery_type" @change="changeSend">
<el-radio v-if="!isBatch && tableFrom.order_type != 2 && orderType != 1" :label="1">手动发货</el-radio> <el-radio v-if="!isBatch && tableFrom.order_type != 2 && orderType != 1" :label="1">手动发货</el-radio>
<el-radio :label="3" class="radio"> {{orderType == 1 ? '虚拟发货' : '无需物流'}}</el-radio> <el-radio :label="3" class="radio"> {{ orderType == 1 ? '虚拟发货' : '无需物流' }}</el-radio>
<el-radio v-if="isDump==1 && tableFrom.order_type != 2 && orderType !=1 && !isBatch" :label="4" class="radio">电子面单打印</el-radio> <el-radio v-if="isDump==1 && tableFrom.order_type != 2 && orderType !=1 && !isBatch" :label="4" class="radio">电子面单打印</el-radio>
<el-radio v-if="tableFrom.order_type != 2 && orderType !=1" :label="2">自己配送</el-radio> <el-radio v-if="tableFrom.order_type != 2 && orderType !=1" :label="2">自己配送</el-radio>
<el-radio v-if="tableFrom.order_type != 2 && orderType !=1 && !isBatch" :label="5">同城配送</el-radio> <el-radio v-if="tableFrom.order_type != 2 && orderType !=1 && !isBatch" :label="5">同城配送</el-radio>
@ -300,8 +300,8 @@
</el-form-item> </el-form-item>
<el-form-item v-if="(shipment.delivery_type == 1 || shipment.delivery_type == 4) && tableFrom.order_type != 2 && orderType !=1" label="快递公司:" prop="delivery_name"> <el-form-item v-if="(shipment.delivery_type == 1 || shipment.delivery_type == 4) && tableFrom.order_type != 2 && orderType !=1" label="快递公司:" prop="delivery_name">
<el-select <el-select
filterable
v-model="shipment.delivery_name" v-model="shipment.delivery_name"
filterable
size="small" size="small"
placeholder="请选择快递公司" placeholder="请选择快递公司"
class="pageWidth" class="pageWidth"
@ -318,8 +318,8 @@
<el-form-item v-if="shipment.delivery_type == 5 && tableFrom.order_type != 2 && orderType !=1" label="包裹重量(kg)" prop="cargo_weight"> <el-form-item v-if="shipment.delivery_type == 5 && tableFrom.order_type != 2 && orderType !=1" label="包裹重量(kg)" prop="cargo_weight">
<el-input-number v-model="shipment.cargo_weight" style="width: 200px;" size="small" placeholder="请输入包裹重量" /> <el-input-number v-model="shipment.cargo_weight" style="width: 200px;" size="small" placeholder="请输入包裹重量" />
</el-form-item> </el-form-item>
<el-form-item v-if="shipment.delivery_type == 5 && tableFrom.order_type != 2 && orderType !=1" label="配送备注:" > <el-form-item v-if="shipment.delivery_type == 5 && tableFrom.order_type != 2 && orderType !=1" label="配送备注:">
<el-input type="textarea" v-model="shipment.mark" size="small" class="pageWidth" placeholder="请输入配送单备注" /> <el-input v-model="shipment.mark" type="textarea" size="small" class="pageWidth" placeholder="请输入配送单备注" />
</el-form-item> </el-form-item>
<el-form-item v-if="shipment.delivery_type == 1 && tableFrom.order_type != 2 && orderType !=1" label="快递单号:" prop="delivery_id"> <el-form-item v-if="shipment.delivery_type == 1 && tableFrom.order_type != 2 && orderType !=1" label="快递单号:" prop="delivery_id">
<el-input v-model="shipment.delivery_id" size="small" class="pageWidth" placeholder="请输入快递单号" /> <el-input v-model="shipment.delivery_id" size="small" class="pageWidth" placeholder="请输入快递单号" />
@ -376,32 +376,32 @@
:row-key="(row) => { return row.product_id }" :row-key="(row) => { return row.product_id }"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<el-table-column align="center" type="selection" :reserve-selection="true" min-width="50"/> <el-table-column align="center" type="selection" :reserve-selection="true" min-width="50" />
<el-table-column align="center" label="商品信息" min-width="200"> <el-table-column align="center" label="商品信息" min-width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="acea-row" style="align-items: center;"> <div class="acea-row" style="align-items: center;">
<div class="demo-image__preview"> <div class="demo-image__preview">
<el-image :src="scope.row.cart_info.product.image" :preview-src-list="[scope.row.cart_info.product.image]" /> <el-image :src="scope.row.cart_info.product.image" :preview-src-list="[scope.row.cart_info.product.image]" />
</div> </div>
<span class="priceBox" style="width: 150px;">{{scope.row.cart_info.product.store_name}}</span> <span class="priceBox" style="width: 150px;">{{ scope.row.cart_info.product.store_name }}</span>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="规格" min-width="80"> <el-table-column align="center" label="规格" min-width="80">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="priceBox">{{scope.row.cart_info.productAttr.sku}}</span> <span class="priceBox">{{ scope.row.cart_info.productAttr.sku }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="商品售价" min-width="80"> <el-table-column align="center" label="商品售价" min-width="80">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="priceBox">{{scope.row.cart_info.productAttr.price}}</span> <span class="priceBox">{{ scope.row.cart_info.productAttr.price }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="总数" min-width="80"> <el-table-column align="center" label="总数" min-width="80">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="priceBox">{{scope.row.stock_num}}</span> <span class="priceBox">{{ scope.row.stock_num }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="待发数量" align="center" min-width="120"> <el-table-column label="待发数量" align="center" min-width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input <el-input
@ -412,17 +412,17 @@
size="small" size="small"
class="priceBox" class="priceBox"
@blur="limitCount(scope.row)" @blur="limitCount(scope.row)"
/> />
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-form-item> </el-form-item>
<el-form-item label="备注:" prop="remark"> <el-form-item label="备注:" prop="remark">
<el-input v-model="shipment.remark" type="textarea" class="pageWidth" placeholder="请输入备注" /> <el-input v-model="shipment.remark" type="textarea" class="pageWidth" placeholder="请输入备注" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="handleClose" size="small"> </el-button> <el-button size="small" @click="handleClose"> </el-button>
<el-button type="primary" size="small" @click="submitForm('shipment')">提交</el-button> <el-button type="primary" size="small" @click="submitForm('shipment')">提交</el-button>
</span> </span>
</el-dialog> </el-dialog>
@ -433,15 +433,15 @@
<!--详情--> <!--详情-->
<order-detail <order-detail
ref="orderDetail" ref="orderDetail"
:orderId="orderId" :order-id="orderId"
:drawer="drawer"
@closeDrawer="closeDrawer" @closeDrawer="closeDrawer"
@changeDrawer="changeDrawer" @changeDrawer="changeDrawer"
@reSend="reSend" @reSend="reSend"
@onOrderRefund="onOrderRefund" @onOrderRefund="onOrderRefund"
@send="send" @send="send"
@getList="getList" @getList="getList"
:drawer="drawer" />
></order-detail>
<!--导出订单列表--> <!--导出订单列表-->
<file-list ref="exportList" /> <file-list ref="exportList" />
<!--导出订单列表--> <!--导出订单列表-->
@ -482,11 +482,11 @@ import {
expressLst, expressLst,
exprTempsLst, exprTempsLst,
getEleTempData, getEleTempData,
getDeliveryStoreLst, getDeliveryStoreLst
} from '@/api/order' } from '@/api/order'
import createWorkBook from '@/utils/newToExcel.js' import createWorkBook from '@/utils/newToExcel.js'
import { serveInfoApi } from '@/api/setting' import { serveInfoApi } from '@/api/setting'
import orderDetail from './orderDetails.vue'; import orderDetail from './orderDetails.vue'
import fileList from '@/components/exportFile/fileList' import fileList from '@/components/exportFile/fileList'
import deliveryRecord from '@/components/deliveryRecord/index' import deliveryRecord from '@/components/deliveryRecord/index'
import orderCancellate from './orderCancellate' import orderCancellate from './orderCancellate'
@ -495,9 +495,9 @@ import cardsData from '@/components/cards/index'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
import SettingMer from '@/libs/settingMer' import SettingMer from '@/libs/settingMer'
import { roterPre } from '@/settings' import { roterPre } from '@/settings'
import timeOptions from '@/utils/timeOptions'; import timeOptions from '@/utils/timeOptions'
// //
import printJS from 'print-js'; import printJS from 'print-js'
export default { export default {
components: { components: {
orderDetail, orderDetail,
@ -533,7 +533,7 @@ export default {
type: this.$route.query.order_type || '1', type: this.$route.query.order_type || '1',
username: '', username: '',
filter_delivery: '', filter_delivery: '',
filter_product : '', filter_product: '',
pay_type: '', pay_type: '',
order_id: this.$route.query.id ? this.$route.query.id : '', order_id: this.$route.query.id ? this.$route.query.id : '',
activity_type: '' activity_type: ''
@ -551,12 +551,12 @@ export default {
{ value: 4, label: '核销订单' }, { value: 4, label: '核销订单' },
{ value: 3, label: '虚拟发货' }, { value: 3, label: '虚拟发货' },
{ value: 6, label: '自动发货' } { value: 6, label: '自动发货' }
], // ], //
productTypeList: [ productTypeList: [
{ value: 1, label: '实物商品' }, { value: 1, label: '实物商品' },
{ value: 2, label: '虚拟商品' }, { value: 2, label: '虚拟商品' },
{ value: 3, label: '卡密商品' } { value: 3, label: '卡密商品' }
], // ], //
orderChartType: {}, orderChartType: {},
timeVal: [], timeVal: [],
fromList: { fromList: {
@ -621,15 +621,15 @@ export default {
}, },
deliveryList: [], deliveryList: [],
eleTempsLst: [], eleTempsLst: [],
productList: [], // productList: [], //
productNum: 0, productNum: 0,
storeList: [], // storeList: [], //
multipleSelection: [], multipleSelection: [],
shipment: { shipment: {
delivery_type: 1, delivery_type: 1,
station_id: '', station_id: '',
is_split:"0", is_split: '0',
split:[] split: []
}, },
original: { original: {
delivery_name: '', delivery_name: '',
@ -701,10 +701,10 @@ export default {
this.getStoreList() this.getStoreList()
}, },
methods: { methods: {
/**重置 */ /** 重置 */
searchReset(){ searchReset() {
this.timeVal = [] this.timeVal = []
this.tableFrom.date = "" this.tableFrom.date = ''
this.$refs.searchForm.resetFields() this.$refs.searchForm.resetFields()
this.getList(1) this.getList(1)
}, },
@ -713,17 +713,17 @@ export default {
if (row.stock > row.product_num)row.stock = row.product_num if (row.stock > row.product_num)row.stock = row.product_num
}, },
changeDrawer(v) { changeDrawer(v) {
this.drawer = v; this.drawer = v
}, },
closeDrawer() { closeDrawer() {
this.drawer = false; this.drawer = false
}, },
// //
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val this.multipleSelection = val
const data = [] const data = []
this.multipleSelection.map((item) => { this.multipleSelection.map((item) => {
data.push({id:item.order_product_id,num:item.product_num}) data.push({ id: item.order_product_id, num: item.product_num })
}) })
this.ids = data this.ids = data
}, },
@ -761,18 +761,18 @@ export default {
from_tel: data.mer_from_tel, from_tel: data.mer_from_tel,
delivery_type: delivery_type, delivery_type: delivery_type,
delivery_name: data.mer_from_com, delivery_name: data.mer_from_com,
temp_id: "" temp_id: ''
// temp_id: data.mer_config_temp_id // temp_id: data.mer_config_temp_id
} }
if(data.mer_from_com != ''){ if (data.mer_from_com != '') {
this.getTempsLst(data.mer_from_com) this.getTempsLst(data.mer_from_com)
} }
}) })
.catch((res) => { .catch((res) => {
this.$message.error(res.message) this.$message.error(res.message)
}) })
}, },
// //
getStoreList() { getStoreList() {
getDeliveryStoreLst().then((res) => { getDeliveryStoreLst().then((res) => {
this.storeList = res.data this.storeList = res.data
@ -781,11 +781,11 @@ export default {
}) })
}, },
changeSend(e) { changeSend(e) {
this.$refs['shipment'].clearValidate(); this.$refs['shipment'].clearValidate()
if(e == 3){ if (e == 3) {
// //
this.shipment.is_split = '0'; this.shipment.is_split = '0'
delete this.shipment.split; delete this.shipment.split
} }
}, },
getPicture(name) { getPicture(name) {
@ -802,18 +802,18 @@ export default {
}, },
// //
batchSend() { batchSend() {
if (!this.allCheck&&this.checkedIds.length == 0) { if (!this.allCheck && this.checkedIds.length == 0) {
return this.$message.warning('请先选择订单') return this.$message.warning('请先选择订单')
} else { } else {
this.isBatch = true this.isBatch = true
this.sendVisible = true this.sendVisible = true
this.shipment.delivery_type = 2 this.shipment.delivery_type = 2
this.shipment.select_type = this.allCheck ? 'all' : 'select' this.shipment.select_type = this.allCheck ? 'all' : 'select'
if(this.allCheck){ if (this.allCheck) {
this.shipment.where = this.tableFrom this.shipment.where = this.tableFrom
}else{ } else {
this.shipment.order_id = this.checkedIds this.shipment.order_id = this.checkedIds
} }
} }
}, },
handleClose() { handleClose() {
@ -913,15 +913,15 @@ export default {
}) })
}, },
// 退 // 退
onOrderRefund(id){ onOrderRefund(id) {
this.$refs.orderRefund.getOrderDetails(id) this.$refs.orderRefund.getOrderDetails(id)
}, },
// 退 // 退
refundSuccess(){ refundSuccess() {
setTimeout(() => { setTimeout(() => {
this.drawer = false; this.drawer = false
this.getList(); this.getList()
},500) }, 500)
}, },
// //
addTdClass(val) { addTdClass(val) {
@ -938,27 +938,27 @@ export default {
// //
onOrderDetails(id) { onOrderDetails(id) {
this.orderId = id this.orderId = id
this.$refs.orderDetail.getInfo(id); this.$refs.orderDetail.getInfo(id)
this.drawer = true; this.drawer = true
}, },
async exports(value) { async exports(value) {
let excelData = JSON.parse(JSON.stringify(this.tableFrom)), data = [] const excelData = JSON.parse(JSON.stringify(this.tableFrom)); let data = []
excelData.page = 1 excelData.page = 1
excelData.ids = this.checkedIds.toString() excelData.ids = this.checkedIds.toString()
let pageCount = 1 let pageCount = 1
let lebData = {}; let lebData = {}
for (let i = 0; i < pageCount; i++) { for (let i = 0; i < pageCount; i++) {
lebData = value == 1 ? await this.downOrderData(excelData) : await this.downInvoiceData(excelData) lebData = value == 1 ? await this.downOrderData(excelData) : await this.downInvoiceData(excelData)
pageCount = Math.ceil(lebData.count/excelData.limit) pageCount = Math.ceil(lebData.count / excelData.limit)
if (lebData.export.length) { if (lebData.export.length) {
data = data.concat(lebData.export) data = data.concat(lebData.export)
excelData.page++ excelData.page++
} }
} }
createWorkBook(lebData.header, lebData.title, data, lebData.foot,lebData.filename); createWorkBook(lebData.header, lebData.title, data, lebData.foot, lebData.filename)
return return
}, },
/**订单 */ /** 订单 */
downOrderData(excelData) { downOrderData(excelData) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
exportOrderApi(excelData).then((res) => { exportOrderApi(excelData).then((res) => {
@ -966,7 +966,7 @@ export default {
}) })
}) })
}, },
/**发货单 */ /** 发货单 */
downInvoiceData(excelData) { downInvoiceData(excelData) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
exportInvoiceApi(excelData).then((res) => { exportInvoiceApi(excelData).then((res) => {
@ -993,13 +993,13 @@ export default {
// //
orderCancellation(code) { orderCancellation(code) {
const that = this const that = this
that.$refs.orderCancellate.dialogVisible = true; that.$refs.orderCancellate.dialogVisible = true
if(code) { if (code) {
that.$refs.orderCancellate.productDetails(code) that.$refs.orderCancellate.productDetails(code)
that.$refs.orderCancellate.isColum = true; that.$refs.orderCancellate.isColum = true
}else{ } else {
that.$refs.orderCancellate.isColum = false; that.$refs.orderCancellate.isColum = false
that.$refs.orderCancellate.resetData() that.$refs.orderCancellate.resetData()
} }
}, },
// //
@ -1114,8 +1114,8 @@ export default {
pay_postage: res.data.pay_postage, pay_postage: res.data.pay_postage,
total_price: res.data.total_price, total_price: res.data.total_price,
integral_price: res.data.integral_price, integral_price: res.data.integral_price,
coupon_price: (Number(res.data.coupon_price) + Number(res.data.svip_discount)).toFixed(2) , coupon_price: (Number(res.data.coupon_price) + Number(res.data.svip_discount)).toFixed(2),
pay_price: (Number(res.data.total_price) + Number(res.data.pay_postage) - Number(res.data.coupon_price) - Number(res.data.svip_discount)).toFixed(2) pay_price: (Number(res.data.total_price) + Number(res.data.pay_postage) - Number(res.data.coupon_price) - Number(res.data.svip_discount)).toFixed(2)
} }
this.loading = false this.loading = false
}).catch(({ message }) => { }).catch(({ message }) => {
@ -1136,7 +1136,7 @@ export default {
this.formValidate.pay_price = (this.formValidate.total_price + this.formValidate.pay_postage - this.formValidate.coupon_price).toFixed(2) this.formValidate.pay_price = (this.formValidate.total_price + this.formValidate.pay_postage - this.formValidate.coupon_price).toFixed(2)
}, },
// //
send(row,id) { send(row, id) {
this.isBatch = false this.isBatch = false
this.sendVisible = true this.sendVisible = true
this.isResend = false this.isResend = false
@ -1148,9 +1148,9 @@ export default {
item.stock_num = item.product_num item.stock_num = item.product_num
}) })
this.productList = row.orderProduct this.productList = row.orderProduct
this.productNum = row.orderProduct && row.orderProduct[0] && row.orderProduct[0]['product_num'] || 0 this.productNum = row.orderProduct && row.orderProduct[0] && row.orderProduct[0]['product_num'] || 0
delete this.shipment.order_id delete this.shipment.order_id
if(this.tableFrom.order_type == 2)this.shipment.delivery_type = 3 if (this.tableFrom.order_type == 2) this.shipment.delivery_type = 3
}, },
sendReset() { sendReset() {
this.shipment = { this.shipment = {
@ -1190,13 +1190,13 @@ export default {
this.shipment.delivery_name = this.shipment.to_name this.shipment.delivery_name = this.shipment.to_name
this.shipment.delivery_id = this.shipment.to_phone this.shipment.delivery_id = this.shipment.to_phone
} }
if(this.shipment.is_split != '0' && this.shipment.is_split && this.orderType != 2){ if (this.shipment.is_split != '0' && this.shipment.is_split && this.orderType != 2) {
if (!this.multipleSelection.length) { if (!this.multipleSelection.length) {
return this.$message.warning('请选择拆单商品!') return this.$message.warning('请选择拆单商品!')
} }
const data = [] const data = []
this.multipleSelection.map((item) => { this.multipleSelection.map((item) => {
data.push({id:item.order_product_id,num:item.product_num_input}) data.push({ id: item.order_product_id, num: item.product_num_input })
}) })
this.ids = data this.ids = data
this.shipment.split = this.ids this.shipment.split = this.ids
@ -1205,13 +1205,13 @@ export default {
if (valid) { if (valid) {
delete this.shipment.to_name delete this.shipment.to_name
delete this.shipment.to_phone delete this.shipment.to_phone
console.log(this.shipment); console.log(this.shipment)
// return // return
this.isBatch ? batchDeliveryApi(this.shipment).then(res => { this.isBatch ? batchDeliveryApi(this.shipment).then(res => {
this.sendVisible = false this.sendVisible = false
this.$message.success(res.message) this.$message.success(res.message)
this.getList('') this.getList('')
if(this.drawer)this.$refs.orderDetail.getInfo(id); if (this.drawer) this.$refs.orderDetail.getInfo(id)
// this.$refs[name].resetFields() // this.$refs[name].resetFields()
this.sendReset() this.sendReset()
}).catch(({ message }) => { }).catch(({ message }) => {
@ -1222,10 +1222,10 @@ export default {
this.$message.success(res.message) this.$message.success(res.message)
this.getList('') this.getList('')
// this.$refs[name].resetFields() // this.$refs[name].resetFields()
if(this.drawer)this.$refs.orderDetail.getInfo(id); if (this.drawer) this.$refs.orderDetail.getInfo(id)
this.sendReset() this.sendReset()
// //
if (res.data.label) this.printImg(res.data.label); if (res.data.label) this.printImg(res.data.label)
}).catch(({ message }) => { }).catch(({ message }) => {
this.$message.error(message) this.$message.error(message)
}) })
@ -1234,7 +1234,7 @@ export default {
} }
}) })
}, },
// //
printImg(url) { printImg(url) {
printJS({ printJS({
// printable: 'http://api.kuaidi100.com/label/getImage/20230518/9CBFE5F980044698A54CF19EB1585125', // printable: 'http://api.kuaidi100.com/label/getImage/20230518/9CBFE5F980044698A54CF19EB1585125',
@ -1244,8 +1244,8 @@ export default {
style: `img{ style: `img{
width: 100%; width: 100%;
height: 476px; height: 476px;
}`, }`
}); })
}, },
// //
getList(num) { getList(num) {

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="divBox"> <div class="divBox">
<div class="selCard"> <div class="selCard">
<el-form :model="tableFrom" ref="searchForm" size="small" label-width="95px" :inline="true"> <el-form ref="searchForm" :model="tableFrom" size="small" label-width="95px" :inline="true">
<el-form-item label="平台分类:" prop="cate_id"> <el-form-item label="平台分类:" prop="cate_id">
<el-cascader v-model="tableFrom.cate_id" class="selWidth" :options="categoryList" :props="props" clearable @change="getList(1)" /> <el-cascader v-model="tableFrom.cate_id" class="selWidth" :options="categoryList" :props="props" clearable @change="getList(1)" />
</el-form-item> </el-form-item>
@ -89,11 +89,11 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" size="small" @click="getList(1)">搜索</el-button> <el-button type="primary" size="small" @click="getList(1)">搜索</el-button>
<el-button size="small" @click="searchReset()">重置</el-button> <el-button size="small" @click="searchReset()">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<el-card class="mt14 dataBox"> <el-card class="mt14 dataBox">
<el-tabs v-model="tableFrom.type" @tab-click="getProduct"> <el-tabs v-model="tableFrom.type" @tab-click="getProduct">
<el-tab-pane v-for="(item,index) in headeNum" :key="index" :name="item.type.toString()" :label="item.name +'('+item.count +')' " /> <el-tab-pane v-for="(item,index) in headeNum" :key="index" :name="item.type.toString()" :label="item.name +'('+item.count +')' " />
</el-tabs> </el-tabs>
@ -101,33 +101,34 @@
<router-link :to="{ path:`${roterPre}` + '/product/list/addProduct' }" class="mr10"> <router-link :to="{ path:`${roterPre}` + '/product/list/addProduct' }" class="mr10">
<el-button size="small" type="primary">添加商品</el-button> <el-button size="small" type="primary">添加商品</el-button>
</router-link> </router-link>
<el-button size="small" type="success" @click="onCopy">商品采集</el-button> <!-- <el-button size="small" type="success" @click="onCopy">商品采集</el-button> -->
<el-button size="small" :disabled="checkedIds.length == 0 && !allCheck" type="default" @click="openBatch">批量设置</el-button> <el-button size="small" :disabled="checkedIds.length == 0 && !allCheck" type="default" @click="openBatch">批量设置</el-button>
<el-button size="small" :disabled="tableFrom.type != 1 || checkedIds.length == 0 && !allCheck" @click="batchOff">批量下架</el-button> <el-button size="small" :disabled="tableFrom.type != 1 || checkedIds.length == 0 && !allCheck" @click="batchOff">批量下架</el-button>
<el-button size="small" :disabled="tableFrom.type != 2 || checkedIds.length == 0 && !allCheck" @click="batchShelf">批量上架</el-button> <el-button size="small" :disabled="tableFrom.type != 2 || checkedIds.length == 0 && !allCheck" @click="batchShelf">批量上架</el-button>
</div> </div>
<el-alert v-if="checkedIds.length>0 || allCheck" :title="allCheck ? `已选择 ${tableData.total}` : `已选择 ${checkedIds.length}`" type="info" show-icon class="mb10" /> <el-alert v-if="checkedIds.length>0 || allCheck" :title="allCheck ? `已选择 ${tableData.total}` : `已选择 ${checkedIds.length}`" type="info" show-icon class="mb10" />
<el-table <el-table
v-loading="listLoading" v-loading="listLoading"
:data="tableData.data" :data="tableData.data"
size="small" size="small"
:row-class-name="tableRowClassName" :row-class-name="tableRowClassName"
:row-key="(row) => { return row.product_id }" :row-key="(row) => { return row.product_id }"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
@rowclick.stop="closeEdit"> @rowclick.stop="closeEdit"
<el-table-column width="50"> >
<el-table-column width="50">
<template slot="header" slot-scope="scope"> <template slot="header" slot-scope="scope">
<el-popover placement="top-start" width="100" trigger="hover" class="tabPop"> <el-popover placement="top-start" width="100" trigger="hover" class="tabPop">
<div> <div>
<span class="spBlock onHand" :class="{'check': chkName === 'dan'}" @click="onHandle('dan',scope.$index)">选中本页</span> <span class="spBlock onHand" :class="{'check': chkName === 'dan'}" @click="onHandle('dan',scope.$index)">选中本页</span>
<span class="spBlock onHand" :class="{'check': chkName === 'duo'}" @click="onHandle('duo')">选中全部</span> <span class="spBlock onHand" :class="{'check': chkName === 'duo'}" @click="onHandle('duo')">选中全部</span>
</div> </div>
<el-checkbox slot="reference" :value="(chkName === 'dan' && checkedPage.indexOf(tableFrom.page) > -1) || chkName === 'duo'" @change="changeType" /> <el-checkbox slot="reference" :value="(chkName === 'dan' && checkedPage.indexOf(tableFrom.page) > -1) || chkName === 'duo'" @change="changeType" />
</el-popover> </el-popover>
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<el-checkbox :disabled="scope.row.cancel_time" :value="!scope.row.cancel_time && (checkedIds.indexOf(scope.row.product_id) > -1 || (chkName === 'duo' && noChecked.indexOf(scope.row.product_id) === -1))" @change="(v)=>changeOne(v,scope.row)" /> <el-checkbox :disabled="scope.row.cancel_time" :value="!scope.row.cancel_time && (checkedIds.indexOf(scope.row.product_id) > -1 || (chkName === 'duo' && noChecked.indexOf(scope.row.product_id) === -1))" @change="(v)=>changeOne(v,scope.row)" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column type="expand"> <el-table-column type="expand">
<template slot-scope="props"> <template slot-scope="props">
@ -195,14 +196,14 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" min-width="150" fixed="right"> <el-table-column label="操作" min-width="150" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" class="mr10" @click="onDetails(scope.row.product_id)">详情</el-button> <el-button type="text" size="small" class="mr10" @click="onDetails(scope.row.product_id)">详情</el-button>
<router-link v-if="tableFrom.type != 5" :to="{path: roterPre + '/product/list/addProduct/' + scope.row.product_id}"> <router-link v-if="tableFrom.type != 5" :to="{path: roterPre + '/product/list/addProduct/' + scope.row.product_id}">
<el-button type="text" size="small" class="mr10">编辑</el-button> <el-button type="text" size="small" class="mr10">编辑</el-button>
</router-link> </router-link>
<el-button v-if="tableFrom.type !== '5'" type="text" size="small" class="mr10" @click="handlePreview(scope.row.product_id)">预览</el-button> <el-button v-if="tableFrom.type !== '5'" type="text" size="small" class="mr10" @click="handlePreview(scope.row.product_id)">预览</el-button>
<el-dropdown> <el-dropdown>
<span class="el-dropdown-link"> <span class="el-dropdown-link">
更多<i class="el-icon-arrow-down el-icon--right" /> 更多<i class="el-icon-arrow-down el-icon--right" />
</span> </span>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item v-if="tableFrom.type !== '5' && is_audit == '1'" @click.native="onAuditFree(scope.row)">免审编辑</el-dropdown-item> <el-dropdown-item v-if="tableFrom.type !== '5' && is_audit == '1'" @click.native="onAuditFree(scope.row)">免审编辑</el-dropdown-item>
@ -218,7 +219,7 @@
</router-link> </router-link>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item v-if="tableFrom.type !== '1' && tableFrom.type!== '3' && tableFrom.type !=='4'" @click.native="handleDelete(scope.row.product_id, scope.$index)">{{ tableFrom.type === '5' ? '删除' : '加入回收站' }}</el-dropdown-item> <el-dropdown-item v-if="tableFrom.type !== '1' && tableFrom.type!== '3' && tableFrom.type !=='4'" @click.native="handleDelete(scope.row.product_id, scope.$index)">{{ tableFrom.type === '5' ? '删除' : '加入回收站' }}</el-dropdown-item>
<el-dropdown-item v-if="tableFrom.type === '5'" @click.native="handleRestore(scope.row.product_id)">恢复商品</el-dropdown-item> <el-dropdown-item v-if="tableFrom.type === '5'" @click.native="handleRestore(scope.row.product_id)">恢复商品</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</template> </template>
@ -229,7 +230,7 @@
</div> </div>
</el-card> </el-card>
<!-- 生成淘宝京东表单--> <!-- 生成淘宝京东表单-->
<tao-bao ref="taoBao" @getSuccess="getSuccess" :deliveryType="deliveryType" :deliveryList="deliveryList"/> <tao-bao ref="taoBao" :delivery-type="deliveryType" :delivery-list="deliveryList" @getSuccess="getSuccess" />
<!--预览商品--> <!--预览商品-->
<div v-if="previewVisible"> <div v-if="previewVisible">
<div class="bg" @click.stop="previewVisible = false" /> <div class="bg" @click.stop="previewVisible = false" />
@ -243,7 +244,7 @@
width="470px" width="470px"
:before-close="handleClose" :before-close="handleClose"
> >
<el-form ref="labelForm" :model="labelForm" @submit.native.prevent size="small"> <el-form ref="labelForm" :model="labelForm" size="small" @submit.native.prevent>
<el-form-item> <el-form-item>
<el-select v-model="labelForm.mer_labels" clearable multiple placeholder="请选择" class="width100"> <el-select v-model="labelForm.mer_labels" clearable multiple placeholder="请选择" class="width100">
<el-option <el-option
@ -261,7 +262,7 @@
</span> </span>
</el-dialog> </el-dialog>
<!-- 免审核弹窗--> <!-- 免审核弹窗-->
<edit-attr ref="editAttr"/> <edit-attr ref="editAttr" />
<!--运费模板弹窗--> <!--运费模板弹窗-->
<el-dialog <el-dialog
v-if="dialogFreight" v-if="dialogFreight"
@ -295,10 +296,10 @@
> >
<el-form ref="commisionForm" :model="commisionForm" :rules="commisionRule" @submit.native.prevent> <el-form ref="commisionForm" :model="commisionForm" :rules="commisionRule" @submit.native.prevent>
<el-form-item label="一级佣金比例:" prop="extension_one"> <el-form-item label="一级佣金比例:" prop="extension_one">
<el-input-number v-model="commisionForm.extension_one" :precision="2" :step="0.1" :min="0" :max="1" class="priceBox" controls-position="right"/> <el-input-number v-model="commisionForm.extension_one" :precision="2" :step="0.1" :min="0" :max="1" class="priceBox" controls-position="right" />
</el-form-item> </el-form-item>
<el-form-item label="二级佣金比例:" prop="extension_two"> <el-form-item label="二级佣金比例:" prop="extension_two">
<el-input-number v-model="commisionForm.extension_two" :precision="2" :step="0.1" :min="0" :max="1" class="priceBox" controls-position="right"/> <el-input-number v-model="commisionForm.extension_two" :precision="2" :step="0.1" :min="0" :max="1" class="priceBox" controls-position="right" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<span>备注订单交易成功后给上级返佣的比例:0.5 = 返订单金额的50%</span> <span>备注订单交易成功后给上级返佣的比例:0.5 = 返订单金额的50%</span>
@ -315,7 +316,7 @@
:visible.sync="dialogSvip" :visible.sync="dialogSvip"
width="700px" width="700px"
> >
<el-form ref="svipForm" :model="svipForm" @submit.native.prevent label-width="80px"> <el-form ref="svipForm" :model="svipForm" label-width="80px" @submit.native.prevent>
<el-form-item <el-form-item
label="参与方式:" label="参与方式:"
> >
@ -325,7 +326,7 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
备注默认设置会员价是指商户在 <router-link :to="{path: roterPre + '/systemForm/Basics/svip'}" class="member-link"> [设置-付费会员设置] </router-link> 备注默认设置会员价是指商户在 <router-link :to="{path: roterPre + '/systemForm/Basics/svip'}" class="member-link"> [设置-付费会员设置] </router-link>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
@ -342,10 +343,11 @@
<div> <div>
<el-alert <el-alert
title="每次只能修改一项,如需修改多项,请多次操作。" title="每次只能修改一项,如需修改多项,请多次操作。"
type="warning" :closable="false"> type="warning"
</el-alert> :closable="false"
/>
<div class="batch-tab mt20"> <div class="batch-tab mt20">
<el-tabs :tab-position="tabPosition" v-model="batchName"> <el-tabs v-model="batchName" :tab-position="tabPosition">
<el-tab-pane label="商品分类" name="cate"> <el-tab-pane label="商品分类" name="cate">
<el-form size="small" label-width="120px" :inline="true"> <el-form size="small" label-width="120px" :inline="true">
<el-form-item label="平台商品分类:"> <el-form-item label="平台商品分类:">
@ -388,7 +390,7 @@
<el-radio-group v-model="batchData.delivery_free"> <el-radio-group v-model="batchData.delivery_free">
<el-radio :label="1">包邮</el-radio> <el-radio :label="1">包邮</el-radio>
<el-radio :label="0" class="radio">运费模板</el-radio> <el-radio :label="0" class="radio">运费模板</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item v-if="batchData.delivery_free == 0"> <el-form-item v-if="batchData.delivery_free == 0">
@ -406,10 +408,10 @@
<el-tab-pane label="佣金设置" name="commission"> <el-tab-pane label="佣金设置" name="commission">
<el-form size="small" label-width="120px" :inline="false"> <el-form size="small" label-width="120px" :inline="false">
<el-form-item label="一级佣金比例:"> <el-form-item label="一级佣金比例:">
<el-input-number v-model="batchData.extension_one" :precision="2" :step="0.1" :min="0" :max="1" class="width100" controls-position="right"/> <el-input-number v-model="batchData.extension_one" :precision="2" :step="0.1" :min="0" :max="1" class="width100" controls-position="right" />
</el-form-item> </el-form-item>
<el-form-item label="二级佣金比例:"> <el-form-item label="二级佣金比例:">
<el-input-number v-model="batchData.extension_two" :precision="2" :step="0.1" :min="0" :max="1" class="width100" controls-position="right"/> <el-input-number v-model="batchData.extension_two" :precision="2" :step="0.1" :min="0" :max="1" class="width100" controls-position="right" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<span style="color:#909399">备注订单交易成功后给上级返佣的比例:0.5 = 返订单金额的50%</span> <span style="color:#909399">备注订单交易成功后给上级返佣的比例:0.5 = 返订单金额的50%</span>
@ -427,7 +429,7 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
备注默认设置会员价是指商户在 <router-link :to="{path: roterPre + '/systemForm/Basics/svip'}" class="member-link"> [设置-付费会员设置] </router-link> 备注默认设置会员价是指商户在 <router-link :to="{path: roterPre + '/systemForm/Basics/svip'}" class="member-link"> [设置-付费会员设置] </router-link>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-tab-pane> </el-tab-pane>
@ -435,12 +437,12 @@
<el-form label-width="120px"> <el-form label-width="120px">
<el-form-item label="系统表单:"> <el-form-item label="系统表单:">
<el-select <el-select
v-model="batchData.mer_form_id"
size="small" size="small"
clearable clearable
v-model="batchData.mer_form_id"
@change="getFormInfo"
class="width100" class="width100"
> @change="getFormInfo"
>
<el-option <el-option
v-for="items in formList" v-for="items in formList"
:key="items.form_id" :key="items.form_id"
@ -450,7 +452,7 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-if="formData.length>0"> <el-form-item v-if="formData.length>0">
<el-table <el-table
border border
class="specsList" class="specsList"
@ -460,12 +462,12 @@
<el-table-column prop="label" label="表单标题" min-width="100" /> <el-table-column prop="label" label="表单标题" min-width="100" />
<el-table-column prop="type" label="表单类型" min-width="100"> <el-table-column prop="type" label="表单类型" min-width="100">
<template slot-scope="{row}"> <template slot-scope="{row}">
<span>{{row.type | formTypeFilter}}</span> <span>{{ row.type | formTypeFilter }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column min-width="100" label="是否必填"> <el-table-column min-width="100" label="是否必填">
<template slot-scope="{row}"> <template slot-scope="{row}">
<span>{{row.val ? '必填' : '不必填'}}</span> <span>{{ row.val ? '必填' : '不必填' }}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -482,7 +484,7 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-input-number v-model="batchData.price_number" :precision="2" :step="0.1" :min="0" class="width100" controls-position="right"/> <el-input-number v-model="batchData.price_number" :precision="2" :step="0.1" :min="0" class="width100" controls-position="right" />
<span style="color:#909399">({{ (batchData.price_type=='add' || batchData.price_type=='sub') ? '元' : '%' }})</span> <span style="color:#909399">({{ (batchData.price_type=='add' || batchData.price_type=='sub') ? '元' : '%' }})</span>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
@ -498,14 +500,14 @@
</span> </span>
</el-dialog> </el-dialog>
<!--商品详情--> <!--商品详情-->
<pro-detail <pro-detail
ref="proDetail" ref="proDetail"
:productId="product_id" :product-id="product_id"
:configData="configData" :config-data="configData"
:drawer="drawer"
@closeDrawer="closeDrawer" @closeDrawer="closeDrawer"
@changeDrawer="changeDrawer" @changeDrawer="changeDrawer"
:drawer="drawer" />
></pro-detail>
</div> </div>
</template> </template>
<script> <script>
@ -544,7 +546,7 @@ import {
import { roterPre } from '@/settings' import { roterPre } from '@/settings'
import taoBao from './taoBao' import taoBao from './taoBao'
import editAttr from './editAttr' import editAttr from './editAttr'
import proDetail from './proDetails.vue'; import proDetail from './proDetails.vue'
import previewBox from '@/components/previewBox/index' import previewBox from '@/components/previewBox/index'
export default { export default {
name: 'ProductList', name: 'ProductList',
@ -573,7 +575,7 @@ export default {
temp_id: '', temp_id: '',
form_id: '', form_id: '',
type: this.$route.query.type ? this.$route.query.type : '1', type: this.$route.query.type ? this.$route.query.type : '1',
is_ficti: "", is_ficti: '',
is_gift_bag: '', is_gift_bag: '',
us_status: '', us_status: '',
mer_labels: '', mer_labels: '',
@ -596,14 +598,14 @@ export default {
{ label: '卡密商品', value: 2 } { label: '卡密商品', value: 2 }
], ],
tempRule: { tempRule: {
temp_id: [{required: true,message: '请选择运费模板',trigger: 'change'}] temp_id: [{ required: true, message: '请选择运费模板', trigger: 'change' }]
}, },
commisionRule: { commisionRule: {
extension_one: [{required: true,message: '请输入一级佣金',trigger: 'change'}], extension_one: [{ required: true, message: '请输入一级佣金', trigger: 'change' }],
extension_two: [{required: true,message: '请输入二级佣金',trigger: 'change'}] extension_two: [{ required: true, message: '请输入二级佣金', trigger: 'change' }]
}, },
commisionForm: {extension_one:0,extension_two:0}, commisionForm: { extension_one: 0, extension_two: 0 },
svipForm: {svip_price_type: 0}, svipForm: { svip_price_type: 0 },
goodsId: '', goodsId: '',
previewKey: '', previewKey: '',
product_id: '', product_id: '',
@ -623,7 +625,7 @@ export default {
batchModal: false, batchModal: false,
tabPosition: 'left', tabPosition: 'left',
formList: [], formList: [],
formData: [], // formData: [], //
batchName: 'cate', batchName: 'cate',
batchData: { batchData: {
delivery_way: [], delivery_way: [],
@ -631,13 +633,13 @@ export default {
delivery_free: 1, delivery_free: 1,
extension_one: 0, extension_one: 0,
extension_two: 0, extension_two: 0,
price_number: 0, price_number: 0
}, },
chkName: '', chkName: '',
checkedIds: [], // checkedIds: [], //
noChecked: [], // noChecked: [], //
checkedPage: [], checkedPage: [],
allCheck: false, allCheck: false
} }
}, },
mounted() { mounted() {
@ -651,8 +653,8 @@ export default {
this.productCon() this.productCon()
}, },
methods: { methods: {
/**重置 */ /** 重置 */
searchReset(){ searchReset() {
this.$refs.searchForm.resetFields() this.$refs.searchForm.resetFields()
this.getList(1) this.getList(1)
}, },
@ -677,7 +679,7 @@ export default {
closeEdit() { closeEdit() {
this.tabClickIndex = null this.tabClickIndex = null
}, },
// //
onHandle(name) { onHandle(name) {
this.chkName = this.chkName === name ? '' : name this.chkName = this.chkName === name ? '' : name
this.changeType(!(this.chkName === '')) this.changeType(!(this.chkName === ''))
@ -689,7 +691,7 @@ export default {
} }
} else { } else {
this.chkName = '' this.chkName = ''
this.allCheck = false; this.allCheck = false
} }
const index = this.checkedPage.indexOf(this.tableFrom.page) const index = this.checkedPage.indexOf(this.tableFrom.page)
if (this.chkName === 'dan') { if (this.chkName === 'dan') {
@ -697,7 +699,7 @@ export default {
} else if (index > -1) { } else if (index > -1) {
this.checkedPage.splice(index, 1) this.checkedPage.splice(index, 1)
} }
this.syncCheckedId() this.syncCheckedId()
}, },
syncCheckedId() { syncCheckedId() {
@ -706,9 +708,9 @@ export default {
}) })
if (this.chkName === 'duo') { if (this.chkName === 'duo') {
this.checkedIds = [] this.checkedIds = []
this.allCheck = true; this.allCheck = true
} else if (this.chkName === 'dan') { } else if (this.chkName === 'dan') {
this.allCheck = false; this.allCheck = false
ids.forEach(id => { ids.forEach(id => {
const index = this.checkedIds.indexOf(id) const index = this.checkedIds.indexOf(id)
if (index === -1) { if (index === -1) {
@ -746,52 +748,52 @@ export default {
} }
}, },
// //
changePrice(){ changePrice() {
if(this.batchData.price_type == 'div'){ if (this.batchData.price_type == 'div') {
this.batchData.price_number = 1 this.batchData.price_number = 1
}else{ } else {
this.batchData.price_number = 0 this.batchData.price_number = 0
} }
}, },
// -- // --
submitBatchForm(){ submitBatchForm() {
console.log(this.batchName) console.log(this.batchName)
let name = this.batchName const name = this.batchName
switch (name) { switch (name) {
case 'cate': case 'cate':
if(!this.batchData.cate_id){ if (!this.batchData.cate_id) {
return this.$message.warning('请选择商品分类!') return this.$message.warning('请选择商品分类!')
} }
break break
case 'delivery_method': case 'delivery_method':
if(!this.batchData.delivery_way.length){ if (!this.batchData.delivery_way.length) {
return this.$message.warning('请选择配送方式!') return this.$message.warning('请选择配送方式!')
} }
break break
case 'postage': case 'postage':
if(this.batchData.delivery_free != 0 && this.batchData.delivery_free != 1){ if (this.batchData.delivery_free != 0 && this.batchData.delivery_free != 1) {
return this.$message.warning('请选择运费设置!') return this.$message.warning('请选择运费设置!')
} }
if(this.batchData.delivery_free == 0 && !this.batchData.temp_id){ if (this.batchData.delivery_free == 0 && !this.batchData.temp_id) {
return this.$message.warning('请选择运费模板!') return this.$message.warning('请选择运费模板!')
} }
break break
case 'commission': case 'commission':
this.batchData.extension_one = this.batchData.extension_one || 0 this.batchData.extension_one = this.batchData.extension_one || 0
this.batchData.extension_two = this.batchData.extension_two || 0 this.batchData.extension_two = this.batchData.extension_two || 0
break break
case 'price': case 'price':
if(this.batchData.price_type == 'div' && this.batchData.price_number == 0){ if (this.batchData.price_type == 'div' && this.batchData.price_number == 0) {
return this.$message.warning('除数不能为0') return this.$message.warning('除数不能为0')
} }
break break
} }
let parmas = this.batchData const parmas = this.batchData
parmas.batch_type = this.batchName parmas.batch_type = this.batchName
if(this.allCheck){ if (this.allCheck) {
parmas.batch_select_type = 'all' parmas.batch_select_type = 'all'
parmas.where = this.tableFrom parmas.where = this.tableFrom
}else{ } else {
parmas.batch_select_type = 'select' parmas.batch_select_type = 'select'
parmas.ids = this.checkedIds parmas.ids = this.checkedIds
} }
@ -799,11 +801,11 @@ export default {
this.batchModal = false this.batchModal = false
this.$message.success(res.message) this.$message.success(res.message)
}) })
.catch((res) => { .catch((res) => {
this.$message.error(res.message) this.$message.error(res.message)
}) })
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val this.multipleSelection = val
const data = [] const data = []
@ -841,9 +843,9 @@ export default {
}) })
}, },
// //
getFormList(){ getFormList() {
associatedFormList() associatedFormList()
.then(res => { .then(res => {
this.formList = res.data this.formList = res.data
}) })
.catch(res => { .catch(res => {
@ -851,17 +853,17 @@ export default {
}) })
}, },
// //
getFormInfo(){ getFormInfo() {
if(this.batchData.mer_form_id){ if (this.batchData.mer_form_id) {
associatedFormInfo(this.batchData.mer_form_id).then((res) => { associatedFormInfo(this.batchData.mer_form_id).then((res) => {
this.formData = res.data this.formData = res.data
}) })
.catch((res) => { .catch((res) => {
this.$message.error(res.message) this.$message.error(res.message)
}) })
}else{ } else {
this.formData = [] this.formData = []
} }
}, },
getSuccess() { getSuccess() {
this.getLstFilterApi() this.getLstFilterApi()
@ -879,32 +881,32 @@ export default {
}, },
// //
onCopy() { onCopy() {
this.$router.push({ this.$router.push({
path: this.roterPre + '/product/list/addProduct', path: this.roterPre + '/product/list/addProduct',
query: { type: 1 }, query: { type: 1 }
}); })
}, },
// //
openBatch(){ openBatch() {
this.batchModal = true; this.batchModal = true
}, },
// //
getLabelLst() { getLabelLst() {
getProductLabelApi().then(res => { getProductLabelApi().then(res => {
this.labelList = res.data this.labelList = res.data
}) })
.catch(res => { .catch(res => {
this.$message.error(res.message) this.$message.error(res.message)
}) })
}, },
// //
getTempLst() { getTempLst() {
shippingListApi().then(res => { shippingListApi().then(res => {
this.tempList = res.data this.tempList = res.data
}) })
.catch(res => { .catch(res => {
this.$message.error(res.message) this.$message.error(res.message)
}) })
}, },
// //
onAuditFree(row) { onAuditFree(row) {
@ -913,12 +915,12 @@ export default {
// //
batchCommision() { batchCommision() {
// if(this.multipleSelection.length === 0) return this.$message.warning('') // if(this.multipleSelection.length === 0) return this.$message.warning('')
this.dialogCommision = true; this.dialogCommision = true
}, },
// //
batchSvip() { batchSvip() {
if(this.multipleSelection.length === 0) return this.$message.warning('请先选择商品') if (this.multipleSelection.length === 0) return this.$message.warning('请先选择商品')
this.dialogSvip = true; this.dialogSvip = true
}, },
submitCommisionForm(name) { submitCommisionForm(name) {
this.$refs[name].validate(valid => { this.$refs[name].validate(valid => {
@ -945,45 +947,45 @@ export default {
}, },
// //
batchShelf() { batchShelf() {
if(this.checkedIds.length === 0 && !this.allCheck) return this.$message.warning('请先选择商品') if (this.checkedIds.length === 0 && !this.allCheck) return this.$message.warning('请先选择商品')
let ids = [] let ids = []
if(this.allCheck){ if (this.allCheck) {
this.tableData.data.map((item) => { this.tableData.data.map((item) => {
ids.push(item.product_id) ids.push(item.product_id)
}) })
}else{ } else {
ids = this.checkedIds ids = this.checkedIds
} }
let data = {status: 1,ids: ids} const data = { status: 1, ids: ids }
batchesOnOffApi(data).then(res => { batchesOnOffApi(data).then(res => {
this.$message.success(res.message) this.$message.success(res.message)
this.getLstFilterApi() this.getLstFilterApi()
this.getList('') this.getList('')
}) })
.catch(res => { .catch(res => {
this.$message.error(res.message) this.$message.error(res.message)
}) })
}, },
// //
batchOff() { batchOff() {
if(this.checkedIds.length === 0 && !this.allCheck) return this.$message.warning('请先选择商品') if (this.checkedIds.length === 0 && !this.allCheck) return this.$message.warning('请先选择商品')
let ids = [] let ids = []
if(this.allCheck){ if (this.allCheck) {
this.tableData.data.map((item) => { this.tableData.data.map((item) => {
ids.push(item.product_id) ids.push(item.product_id)
}) })
}else{ } else {
ids = this.checkedIds ids = this.checkedIds
} }
let data = {status: 0,ids: ids} const data = { status: 0, ids: ids }
batchesOnOffApi(data).then(res => { batchesOnOffApi(data).then(res => {
this.$message.success(res.message) this.$message.success(res.message)
this.getLstFilterApi() this.getLstFilterApi()
this.getList('') this.getList('')
}) })
.catch(res => { .catch(res => {
this.$message.error(res.message) this.$message.error(res.message)
}) })
}, },
// //
batchLabel() { batchLabel() {
@ -996,7 +998,7 @@ export default {
}, },
// //
batchFreight() { batchFreight() {
this.dialogFreight = true; this.dialogFreight = true
}, },
submitTempForm(name) { submitTempForm(name) {
this.$refs[name].validate(valid => { this.$refs[name].validate(valid => {
@ -1033,15 +1035,15 @@ export default {
}, },
// //
onDetails(id) { onDetails(id) {
this.product_id = id; this.product_id = id
this.drawer = true; this.drawer = true
this.$refs.proDetail.getInfo(id) this.$refs.proDetail.getInfo(id)
}, },
changeDrawer(v) { changeDrawer(v) {
this.drawer = v; this.drawer = v
}, },
closeDrawer() { closeDrawer() {
this.drawer = false; this.drawer = false
}, },
// //
getCategorySelect() { getCategorySelect() {
@ -1064,7 +1066,7 @@ export default {
}) })
}, },
// //
getProduct(){ getProduct() {
this.getList() this.getList()
this.changeType() this.changeType()
}, },
@ -1139,17 +1141,17 @@ export default {
submitForm(name) { submitForm(name) {
this.$refs[name].validate(valid => { this.$refs[name].validate(valid => {
if (valid) { if (valid) {
this.isBatch ? batchesLabelsApi(this.labelForm).then(({ message }) => { this.isBatch ? batchesLabelsApi(this.labelForm).then(({ message }) => {
this.$message.success(message) this.$message.success(message)
this.getList('') this.getList('')
this.dialogLabel = false this.dialogLabel = false
this.isBatch = false this.isBatch = false
}) :
updatetProductLabel(this.product_id, this.labelForm).then(({ message }) => {
this.$message.success(message)
this.getList('')
this.dialogLabel = false
}) })
: updatetProductLabel(this.product_id, this.labelForm).then(({ message }) => {
this.$message.success(message)
this.getList('')
this.dialogLabel = false
})
} else { } else {
return return
} }

View File

@ -7,15 +7,15 @@
<div v-if="infoType == '1'" class="user-msg"> <div v-if="infoType == '1'" class="user-msg">
<div class="basic-information"> <div class="basic-information">
<span class="basic-label">商户名称</span> <span class="basic-label">商户名称</span>
{{ merData.mer_name }} {{ merData.mer_name }}
</div> </div>
<div class="basic-information"> <div class="basic-information">
<span class="basic-label">商户负责人手机号</span> <span class="basic-label">商户负责人手机号</span>
{{ merData.mer_phone }} {{ merData.mer_phone }}
</div> </div>
<div v-if="merData.merchantCategory.category_name" class="basic-information"> <div v-if="merData.merchantCategory.category_name" class="basic-information">
<span class="basic-label">商户分类</span> <span class="basic-label">商户分类</span>
{{ merData.merchantCategory.category_name || "" }} {{ merData.merchantCategory.category_name || "" }}
</div> </div>
<div v-if="merData.merchantType" class="basic-information"> <div v-if="merData.merchantType" class="basic-information">
<span class="basic-label"> 商户类型</span> <span class="basic-label"> 商户类型</span>
@ -27,7 +27,7 @@
</div> </div>
<div class="basic-information"> <div class="basic-information">
<span class="basic-label"> 商户负责人姓名</span> <span class="basic-label"> 商户负责人姓名</span>
{{ merData.real_name }} {{ merData.real_name }}
</div> </div>
<div class="basic-information"> <div class="basic-information">
<span class="basic-label"> 商户入驻时间</span> <span class="basic-label"> 商户入驻时间</span>
@ -45,7 +45,7 @@
<div> <div>
<span class="basic-label">是否开启商户</span> <span class="basic-label">是否开启商户</span>
<el-tooltip v-if="merData.is_margin == 1 && merData.mer_state == 0" class="item" effect="dark" content="请先支付店铺保证金!" placement="top-start"> <el-tooltip v-if="merData.is_margin == 1 && merData.mer_state == 0" class="item" effect="dark" content="请先支付店铺保证金!" placement="top-start">
<el-switch disabled v-model="merData.mer_state" :width="55" active-text="开启" inactive-text="关闭" :active-value="1" :inactive-value="0" /> <el-switch v-model="merData.mer_state" disabled :width="55" active-text="开启" inactive-text="关闭" :active-value="1" :inactive-value="0" />
</el-tooltip> </el-tooltip>
<el-switch v-else v-model="merData.mer_state" active-text="开启" inactive-text="关闭" :active-value="1" :inactive-value="0" :width="55" /> <el-switch v-else v-model="merData.mer_state" active-text="开启" inactive-text="关闭" :active-value="1" :inactive-value="0" :width="55" />
<span class="trip">开启店铺即可展示在移动端</span> <span class="trip">开启店铺即可展示在移动端</span>
@ -56,7 +56,7 @@
<!--未支付--> <!--未支付-->
<div v-if="merData.is_margin == 1"> <div v-if="merData.is_margin == 1">
<span class="basic-label">店铺保证金</span> <span class="basic-label">店铺保证金</span>
<span class="font_red">{{merData.margin}}</span> <span class="font_red">{{ merData.margin }}</span>
<div class="margin_count" @mouseenter="getCode()"> <div class="margin_count" @mouseenter="getCode()">
<el-button type="text" size="small" class="mr10 pay_btn">去支付保证金</el-button> <el-button type="text" size="small" class="mr10 pay_btn">去支付保证金</el-button>
<!--支付二维码--> <!--支付二维码-->
@ -64,25 +64,25 @@
<div class="pay_title">支付保证金</div> <div class="pay_title">支付保证金</div>
<div> <div>
<vue-qr class="bicode" :text="qrCode" :size="310" /> <vue-qr class="bicode" :text="qrCode" :size="310" />
<div class="pay_type" >请使用微信扫码支付</div> <div class="pay_type">请使用微信扫码支付</div>
<div class="pay_price" >{{marginPrice}}</div> <div class="pay_price">{{ marginPrice }}</div>
<div class="pay_time">支付码过期时间 {{qrEndTime}}</div> <div class="pay_time">支付码过期时间 {{ qrEndTime }}</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!--已支付--> <!--已支付-->
<div class="margin_main" v-if="merData.is_margin == 10 "> <div v-if="merData.is_margin == 10 " class="margin_main">
<span class="basic-label">店铺保证金</span> <span class="basic-label">店铺保证金</span>
<span class="margin_price">{{merData.margin}}</span> <span class="margin_price">{{ merData.margin }}</span>
<div class="margin_count"> <div class="margin_count">
<span class="mr10 spanBtn" @click="viewRecords">查看保证金记录</span> <span class="mr10 spanBtn" @click="viewRecords">查看保证金记录</span>
<!--保证金弹窗--> <!--保证金弹窗-->
<div class="margin_modal" @mouseleave="supplyPay=false"> <div class="margin_modal" @mouseleave="supplyPay=false">
<div> <div>
<img src="@/assets/images/margin03.png"/> <img src="@/assets/images/margin03.png">
<div class="alic"> <div class="alic">
<span class="text_g">剩余保证金{{merData.margin}}</span> <span class="text_g">剩余保证金{{ merData.margin }}</span>
<el-button v-if="merData.margin>0" type="primary" size="small" @click="applyReturn">申请退回保证金</el-button> <el-button v-if="merData.margin>0" type="primary" size="small" @click="applyReturn">申请退回保证金</el-button>
</div> </div>
</div> </div>
@ -90,42 +90,42 @@
</div> </div>
<div v-if="merData.marginStatus" style="display: inline-block;"> <div v-if="merData.marginStatus" style="display: inline-block;">
<div class="margin_count" @mouseenter="getCode()"> <div class="margin_count" @mouseenter="getCode()">
<el-button type="text" size="small" class="mr10 pay_btn">去补缴保证金</el-button> <el-button type="text" size="small" class="mr10 pay_btn">去补缴保证金</el-button>
<!--支付二维码--> <!--支付二维码-->
<div class="erweima"> <div class="erweima">
<div class="pay_title">支付保证金</div> <div class="pay_title">支付保证金</div>
<div> <div>
<vue-qr class="bicode" :text="qrCode" :size="310" /> <vue-qr class="bicode" :text="qrCode" :size="310" />
<div class="pay_type" >请使用微信扫码支付</div> <div class="pay_type">请使用微信扫码支付</div>
<div class="pay_price" >{{marginPrice}}</div> <div class="pay_price">{{ marginPrice }}</div>
<div class="pay_time">支付码过期时间 {{qrEndTime}}</div> <div class="pay_time">支付码过期时间 {{ qrEndTime }}</div>
</div>
</div> </div>
</div> </div>
</div> </div>
</div>
</div> </div>
<div class="margin_main" v-if="merData.is_margin == -10 || merData.is_margin == -1"> <div v-if="merData.is_margin == -10 || merData.is_margin == -1" class="margin_main">
<span class="basic-label">店铺保证金</span> <span class="basic-label">店铺保证金</span>
<span class="margin_price">{{merData.margin}}</span> <span class="margin_price">{{ merData.margin }}</span>
<div class="margin_count"> <div class="margin_count">
<span class="mr10 spanBtn" @click="viewRecords">查看保证金记录</span> <span class="mr10 spanBtn" @click="viewRecords">查看保证金记录</span>
<!--保证金弹窗--> <!--保证金弹窗-->
<div class="margin_modal" @mouseleave="goPay=false"> <div class="margin_modal" @mouseleave="goPay=false">
<div> <div>
<img v-if="merData.is_margin == -10" src="@/assets/images/margin01.png"/> <img v-if="merData.is_margin == -10" src="@/assets/images/margin01.png">
<img v-if="merData.is_margin == -1" src="@/assets/images/margin02.png"/> <img v-if="merData.is_margin == -1" src="@/assets/images/margin02.png">
<img v-if="merData.is_margin == 10" src="@/assets/images/margin03.png"/> <img v-if="merData.is_margin == 10" src="@/assets/images/margin03.png">
<div class="alic" v-if="merData.is_margin == 10"> <div v-if="merData.is_margin == 10" class="alic">
<span class="text_g">剩余保证金{{merData.margin}}</span> <span class="text_g">剩余保证金{{ merData.margin }}</span>
<el-button v-if="merData.margin>0" type="primary" size="small" @click="applyReturn">申请退回保证金</el-button> <el-button v-if="merData.margin>0" type="primary" size="small" @click="applyReturn">申请退回保证金</el-button>
</div> </div>
<div class="alic" v-if="merData.is_margin == -1"> <div v-if="merData.is_margin == -1" class="alic">
<span class="text_b b01"> 审核中</span> <span class="text_b b01"> 审核中</span>
<div class="margin_refused">您申请退回保证金正在审核中</div> <div class="margin_refused">您申请退回保证金正在审核中</div>
</div> </div>
<div class="alic" v-if="merData.is_margin == -10"> <div v-if="merData.is_margin == -10" class="alic">
<span class="text_b b02">审核未通过</span> <span class="text_b b02">审核未通过</span>
<div class="margin_refused">未通过原因<span>{{merData.refundMarginOrder.refusal}}</span></div> <div class="margin_refused">未通过原因<span>{{ merData.refundMarginOrder.refusal }}</span></div>
<el-button type="primary" size="small" @click="applyReturn">再次申请</el-button> <el-button type="primary" size="small" @click="applyReturn">再次申请</el-button>
</div> </div>
</div> </div>
@ -136,7 +136,7 @@
</div> </div>
</div> </div>
<!--申请退回保障金银行信息弹窗--> <!--申请退回保障金银行信息弹窗-->
<el-dialog <el-dialog
v-if="modalBank" v-if="modalBank"
v-model="modalBank" v-model="modalBank"
:visible.sync="modalBank" :visible.sync="modalBank"
@ -148,14 +148,14 @@
<div class="bank-container"> <div class="bank-container">
<div class="item">说明 <span class="red">申请退回保证金则视为关闭店铺请谨慎操作</span></div> <div class="item">说明 <span class="red">申请退回保证金则视为关闭店铺请谨慎操作</span></div>
<div class="item"> <div class="item">
<div v-if="online > 0">线上支付的保证金 <span class="red">{{online}}</span>会原路返回</div> <div v-if="online > 0">线上支付的保证金 <span class="red">{{ online }}</span>会原路返回</div>
<div v-if="offline > 0"> <div v-if="offline > 0">
线下支付的保证金<span class="red">{{offline}}</span>会通过下方账号信息返回请务必确认下方您的收款信息真实有效以确保资金可顺利退回感谢配合 线下支付的保证金<span class="red">{{ offline }}</span>会通过下方账号信息返回请务必确认下方您的收款信息真实有效以确保资金可顺利退回感谢配合
</div> </div>
</div> </div>
<div class="title">账号信息</div> <div class="title">账号信息</div>
<el-form ref="bankValidate" :model="bankValidate" :rules="bankRules" label-width="100px" @submit.native.prevent> <el-form ref="bankValidate" :model="bankValidate" :rules="bankRules" label-width="100px" @submit.native.prevent>
<el-form-item label="真实姓名:" prop="name"> <el-form-item label="真实姓名:" prop="name">
<el-input v-model="bankValidate.name" type="text" placeholder="请输入真实姓名" /> <el-input v-model="bankValidate.name" type="text" placeholder="请输入真实姓名" />
</el-form-item> </el-form-item>
@ -210,8 +210,8 @@
<div v-else class="upLoad"> <div v-else class="upLoad">
<i class="el-icon-camera cameraIconfont" /> <i class="el-icon-camera cameraIconfont" />
</div> </div>
<div class="trip">建议尺寸710*134px或710*460px(请根据平台要求选择尺寸此图如未上传默认展示店铺背景图)</div> <div class="trip">建议尺寸710*134px或710*460px(请根据平台要求选择尺寸此图如未上传默认展示店铺背景图)</div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item class="form-item" label="店铺资质:" :prop="merData.sys_bases_status == 1 ? 'uploadedqualifications' : ''"> <el-form-item class="form-item" label="店铺资质:" :prop="merData.sys_bases_status == 1 ? 'uploadedqualifications' : ''">
<div class="upLoadPicBox_qualification"> <div class="upLoadPicBox_qualification">
@ -251,7 +251,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row v-if="(merData.delivery_way.length == 1 && merData.delivery_way[0] == '1') || (merData.delivery_way.length == 2)" > <el-row v-if="(merData.delivery_way.length == 1 && merData.delivery_way[0] == '1') || (merData.delivery_way.length == 2)">
<el-col :span="24"> <el-col :span="24">
<el-form-item label="详细地址:" prop="mer_take_address"> <el-form-item label="详细地址:" prop="mer_take_address">
<el-input v-model="merData.mer_take_address" placeholder="请输入详细地址" /> <el-input v-model="merData.mer_take_address" placeholder="请输入详细地址" />
@ -275,7 +275,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row v-if="(merData.delivery_way.length == 1 && merData.delivery_way[0] == '1') || (merData.delivery_way.length == 2)" > <el-row v-if="(merData.delivery_way.length == 1 && merData.delivery_way[0] == '1') || (merData.delivery_way.length == 2)">
<el-col :span="24"> <el-col :span="24">
<el-form-item label="提货点营业日期:" prop="mer_take_day"> <el-form-item label="提货点营业日期:" prop="mer_take_day">
<el-select <el-select
@ -299,14 +299,14 @@
v-model="value1" v-model="value1"
placeholder="开始时间" placeholder="开始时间"
value-format="HH:mm" value-format="HH:mm"
@change="onchangeTime1"> @change="onchangeTime1"
</el-time-picker> />
<el-time-picker <el-time-picker
v-model="value2" v-model="value2"
placeholder="结束时间" placeholder="结束时间"
value-format="HH:mm" value-format="HH:mm"
@change="onchangeTime2"> @change="onchangeTime2"
</el-time-picker> />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -331,7 +331,7 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="客服电话:"> <el-form-item label="客服电话:">
<el-input v-model="merData.service_phone" type="number"/> <el-input v-model="merData.service_phone" type="number" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -354,7 +354,7 @@
<div v-if="infoType == '3'" class="user-msg"> <div v-if="infoType == '3'" class="user-msg">
<div class="basic-information"> <div class="basic-information">
<span class="basic-label"> 商户手续费</span> <span class="basic-label"> 商户手续费</span>
{{ Number(merData.commission_rate) > 0 ? (parseFloat(merData.commission_rate)).toFixed(2) : (parseFloat(merData.merchantCategory.commission_rate * 100)).toFixed(2)}}% {{ Number(merData.commission_rate) > 0 ? (parseFloat(merData.commission_rate)).toFixed(2) : (parseFloat(merData.merchantCategory.commission_rate * 100)).toFixed(2) }}%
</div> </div>
<div class="basic-information"> <div class="basic-information">
<span class="basic-label"> 添加商品</span> <span class="basic-label"> 添加商品</span>
@ -398,33 +398,33 @@
class="mapBox" class="mapBox"
custom-class="dialog-scustom" custom-class="dialog-scustom"
> >
<el-table :data="tableData.data" :loading="loading" size="small"> <el-table :data="tableData.data" :loading="loading" size="small">
<el-table-column label="序号" min-width="50"> <el-table-column label="序号" min-width="50">
<template scope="scope"> <template scope="scope">
<span>{{ scope.$index+(tableFrom.page - 1) * tableFrom.limit + 1 }}</span> <span>{{ scope.$index+(tableFrom.page - 1) * tableFrom.limit + 1 }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="标题" min-width="90" prop="title" /> <el-table-column label="标题" min-width="90" prop="title" />
<el-table-column prop="number" label="金额" min-width="60"> <el-table-column prop="number" label="金额" min-width="60">
<template scope="scope"> <template scope="scope">
<span v-if="scope.row.pm == 1" style="color:#13ce66">+{{scope.row.number}}</span> <span v-if="scope.row.pm == 1" style="color:#13ce66">+{{ scope.row.number }}</span>
<span v-else style="color:rgb(237, 64, 20)">-{{scope.row.number}}</span> <span v-else style="color:rgb(237, 64, 20)">-{{ scope.row.number }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="balance" label="保证金结余" min-width="100" /> <el-table-column prop="balance" label="保证金结余" min-width="100" />
<el-table-column label="备注" min-width="150" prop="mark" /> <el-table-column label="备注" min-width="150" prop="mark" />
<el-table-column prop="create_time" label="操作时间" min-width="120" /> <el-table-column prop="create_time" label="操作时间" min-width="120" />
</el-table> </el-table>
<div class="acea-row row-right page"> <div class="acea-row row-right page">
<el-pagination <el-pagination
:page-size="tableFrom.limit" :page-size="tableFrom.limit"
:current-page="tableFrom.page" :current-page="tableFrom.page"
layout="prev, pager, next, jumper" layout="prev, pager, next, jumper"
:total="tableData.total" :total="tableData.total"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="pageChange" @current-change="pageChange"
/> />
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@ -464,7 +464,7 @@ export default {
if (value.charAt(0) == 0) { if (value.charAt(0) == 0) {
// charAt // charAt
regPone = tel regPone = tel
}else if(value.charAt(0) == 4){ } else if (value.charAt(0) == 4) {
regPone = tels regPone = tels
} else { } else {
regPone = mobile regPone = mobile
@ -476,38 +476,38 @@ export default {
} }
} }
// const checkPhone= (rule, value, callback) =>{ // const checkPhone= (rule, value, callback) =>{
// const phoneExp = /^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/; // const phoneExp = /^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/;
// setTimeout(()=>{ // setTimeout(()=>{
// if(value !== undefined && value !==''){ // if(value !== undefined && value !==''){
// if ((!phoneExp.test(value)) && value !== '') { // if ((!phoneExp.test(value)) && value !== '') {
// callback(new Error('')); // callback(new Error(''));
// } else { // } else {
// callback(); // callback();
// } // }
// }else{ // }else{
// callback() // callback()
// } // }
// },100) // },100)
// } // }
// var checkPhone = (rule, value, callback) => { // var checkPhone = (rule, value, callback) => {
// if (value === '') { // if (value === '') {
// callback(new Error('')) // callback(new Error(''))
// } // }
// if (value.length !== 11) { // if (value.length !== 11) {
// callback(new Error('')) // callback(new Error(''))
// } // }
// if (value.length !== 11) { // if (value.length !== 11) {
// callback(new Error('')) // callback(new Error(''))
// } // }
// // ? ? // // ? ?
// var ab = /^[1][3,4,5,7,8][0-9]{9}$/ // var ab = /^[1][3,4,5,7,8][0-9]{9}$/
// if (ab.test(value) === false) { // if (ab.test(value) === false) {
// callback(new Error('')) // callback(new Error(''))
// } // }
// callback() // callback()
// } // }
const validatePhone = (rule, value, callback) => { const validatePhone = (rule, value, callback) => {
if (!value) { if (!value) {
@ -537,8 +537,8 @@ export default {
total: 0, total: 0,
data: [] data: []
}, },
value1: "", value1: '',
value2: "", value2: '',
marginPrice: 0, marginPrice: 0,
merData: { merData: {
delivery_way: [], delivery_way: [],
@ -566,7 +566,7 @@ export default {
], ],
submitLoading: false, // loading submitLoading: false, // loading
deliveryList: [ deliveryList: [
{ value: '1', name: '到店自提' }, // { value: '1', name: '' },
{ value: '2', name: '快递配送' } { value: '2', name: '快递配送' }
], ],
rules: { rules: {
@ -587,10 +587,10 @@ export default {
mer_take_location: [{ required: true, message: '请选择经纬度', trigger: 'blur' }] mer_take_location: [{ required: true, message: '请选择经纬度', trigger: 'blur' }]
}, },
bankValidate: { bankValidate: {
code: "", code: '',
name: "", name: '',
type: 1, type: 1,
pic: "" pic: ''
}, },
bankRules: { bankRules: {
code: [{ required: true, message: '请输入开户银行', trigger: 'blur' }], code: [{ required: true, message: '请输入开户银行', trigger: 'blur' }],
@ -598,16 +598,16 @@ export default {
{ required: true, message: '请输入银行卡号', trigger: 'blur' }, { required: true, message: '请输入银行卡号', trigger: 'blur' },
{ pattern: /\d{10,19}/, message: '请输入正确的银行账号', trigger: 'blur' } { pattern: /\d{10,19}/, message: '请输入正确的银行账号', trigger: 'blur' }
], ],
name: [{ required: true, message: '请输入真实姓名', trigger: 'blur' }], name: [{ required: true, message: '请输入真实姓名', trigger: 'blur' }]
}, },
offline: "", offline: '',
online: "", online: '',
keyUrl: '', keyUrl: '',
infoType: '1', infoType: '1',
tabList: [ tabList: [
{value: '1',title: '基本信息'}, { value: '1', title: '基本信息' },
{value: '2',title: '店铺信息'}, { value: '2', title: '店铺信息' },
{value: '3',title: '功能信息'} { value: '3', title: '功能信息' }
] ]
} }
}, },
@ -628,8 +628,6 @@ export default {
}, },
created() { created() {
this.getMapInfo() this.getMapInfo()
}, },
mounted: function() { mounted: function() {
window.addEventListener( window.addEventListener(
@ -650,11 +648,11 @@ export default {
methods: { methods: {
// //
onchangeTime1(e) { onchangeTime1(e) {
this.value1 = e; this.value1 = e
this.merData.mer_take_time[0] = e this.merData.mer_take_time[0] = e
}, },
onchangeTime2(e) { onchangeTime2(e) {
this.value2 = e; this.value2 = e
this.merData.mer_take_time[1] = e this.merData.mer_take_time[1] = e
}, },
// //
@ -707,18 +705,18 @@ export default {
}) })
} else { } else {
that.uploadedQualifications = [] that.uploadedQualifications = []
} }
if(that.merData.is_margin == 1)(this.getCode()) if (that.merData.is_margin == 1)(this.getCode())
}) })
}, },
// 线 // 线
bankConfirm(name){ bankConfirm(name) {
this.$refs[name].validate(valid => { this.$refs[name].validate(valid => {
if (valid) { if (valid) {
marginRefundApply(this.bankValidate) marginRefundApply(this.bankValidate)
.then((res) => { .then((res) => {
this.$message.success(res.message) this.$message.success(res.message)
this.modalBank = false; this.modalBank = false
this.getInfo() this.getInfo()
}) })
.catch((res) => { .catch((res) => {
@ -732,7 +730,7 @@ export default {
}, },
// / // /
submitForm(formName) { submitForm(formName) {
if(this.infoType == 2){ if (this.infoType == 2) {
this.$refs[formName].validate(valid => { this.$refs[formName].validate(valid => {
if (valid) { if (valid) {
const dataKey = Object.keys(this.rules) const dataKey = Object.keys(this.rules)
@ -765,12 +763,12 @@ export default {
return false return false
} }
}) })
}else{ } else {
let data = { const data = {
mer_state: this.merData.mer_state, mer_state: this.merData.mer_state,
type: this.infoType type: this.infoType
} }
merchantUpdate(data) merchantUpdate(data)
.then((res) => { .then((res) => {
console.log(res) console.log(res)
this.submitLoading = false this.submitLoading = false
@ -779,52 +777,52 @@ export default {
.catch((rej) => { .catch((rej) => {
this.submitLoading = false this.submitLoading = false
this.$message.error(rej.data.message) this.$message.error(rej.data.message)
}) })
} }
}, },
// //
getCode() { getCode() {
let that = this const that = this
if(this.merData.marginStatus){ if (this.merData.marginStatus) {
marginMakeCode() marginMakeCode()
.then((res) => { .then((res) => {
that.qrCode = res.data.config that.qrCode = res.data.config
that.qrEndTime = res.data.endtime that.qrEndTime = res.data.endtime
that.marginPrice = res.data.price that.marginPrice = res.data.price
}) })
.catch(function(res) { .catch(function(res) {
that.$message.error(res.message) that.$message.error(res.message)
}) })
}else{ } else {
marginCode() marginCode()
.then((res) => { .then((res) => {
that.qrCode = res.data.config that.qrCode = res.data.config
that.qrEndTime = res.data.endtime that.qrEndTime = res.data.endtime
that.marginPrice = res.data.price that.marginPrice = res.data.price
}) })
.catch(function(res) { .catch(function(res) {
that.$message.error(res.message) that.$message.error(res.message)
}) })
} }
}, },
// //
viewRecords() { viewRecords() {
this.tableFrom.page = 1; this.tableFrom.page = 1
this.modalRecord = true; this.modalRecord = true
this.getRecordList() this.getRecordList()
}, },
// //
getRecordList(){ getRecordList() {
let that = this const that = this
that.loading = true; that.loading = true
marginRecordLst(that.tableFrom).then(async (res) => { marginRecordLst(that.tableFrom).then(async(res) => {
that.tableData.data = res.data.list; that.tableData.data = res.data.list
that.tableData.total = res.data.count; that.tableData.total = res.data.count
that.loading = false; that.loading = false
}).catch((res) => { }).catch((res) => {
that.loading = false; that.loading = false
that.$message.error(res.message); that.$message.error(res.message)
}); })
}, },
pageChange(page) { pageChange(page) {
this.tableFrom.page = page this.tableFrom.page = page
@ -836,33 +834,33 @@ export default {
}, },
// 退 // 退
applyReturn() { applyReturn() {
let that = this; const that = this
that.$confirm('申请退回保证金则视为关闭店铺,请谨慎操作!您是否确定继续操作?', '提示', { that.$confirm('申请退回保证金则视为关闭店铺,请谨慎操作!您是否确定继续操作?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
marginRefund() marginRefund()
.then((res) => { .then((res) => {
that.bankValidate = res.data.info that.bankValidate = res.data.info
that.offline = res.data.offline that.offline = res.data.offline
that.online = res.data.online that.online = res.data.online
if(Number(res.data.offline) <= 0){ if (Number(res.data.offline) <= 0) {
marginRefundApply(this.bankValidate) marginRefundApply(this.bankValidate)
.then((res) => { .then((res) => {
this.$message.success(res.message) this.$message.success(res.message)
this.getInfo() this.getInfo()
}) })
.catch((res) => { .catch((res) => {
this.$message.error(res.message) this.$message.error(res.message)
}) })
}else{ } else {
that.modalBank = true that.modalBank = true
} }
}) })
.catch(function(res) { .catch(function(res) {
that.$message.error(res.message) that.$message.error(res.message)
}) })
}) })
}, },
// //
@ -1023,7 +1021,7 @@ export default {
margin-top: 10px; margin-top: 10px;
color: #282828; color: #282828;
font-size: 13px; font-size: 13px;
line-height: 26px; line-height: 26px;
} }
.red{ .red{
color:rgb(237, 64, 20);; color:rgb(237, 64, 20);;
@ -1133,7 +1131,7 @@ export default {
border-radius: 8px; border-radius: 8px;
padding: 10px; padding: 10px;
box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, .3); box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, .3);
img{ img{
width: 160px; width: 160px;
height: 160px; height: 160px;
@ -1143,7 +1141,7 @@ export default {
font-size: 16px; font-size: 16px;
color: #303133; color: #303133;
font-weight: normal; font-weight: normal;
} }
.pay_price{ .pay_price{
font-size: 18px; font-size: 18px;
@ -1158,7 +1156,7 @@ export default {
.pay_time{ .pay_time{
font-size: 12px; font-size: 12px;
color: #6D7278; color: #6D7278;
} }
} }