|
@@ -0,0 +1,987 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <!-- <el-card style="margin-bottom: 20px" class="box-card" v-if="this.dadaDspId">
|
|
|
+ <div>
|
|
|
+ <div class="dada_dsp_info_top">
|
|
|
+ <span> 配送商名称:{{ dataForm.name }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="dada_dsp_info_top">
|
|
|
+ <span> 联系人: {{ dataForm.contactName }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="dada_dsp_info_top">
|
|
|
+ <span> 归属: 达达</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div style="margin-top: 15px">
|
|
|
+ <div class="dada_dsp_info_top"><span> 二维码: <img @click="showImages(dataForm.qrCode)" :src="dataForm.qrCode" style="display: block; max-width: 100%; margin: 0 auto;margin-top: -11%; height: 50px; width: 50px; margin-left: 22%;cursor:pointer"></span></div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div style="margin-top: 15px">
|
|
|
+ <div class="dada_dsp_info_top">
|
|
|
+ <span> 联系电话: {{ dataForm.mobile }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="dada_dsp_info_top">
|
|
|
+ <span>
|
|
|
+ 所在地区: {{ dataForm.provinceName }} >> {{ dataForm.cityName }} >>
|
|
|
+ {{ dataForm.districtName }}</span
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-card> -->
|
|
|
+ <div style="flex: 1;padding-bottom: 25px;">
|
|
|
+ <el-form ref="dataForm" :model="form" :rules="rules" v-if="this.dadaDspId">
|
|
|
+ <div>
|
|
|
+ <div class="dada_dsp_info_top">
|
|
|
+ <span> 配送商名称:{{ dataForm.name }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="dada_dsp_info_top">
|
|
|
+ <span> 联系人: {{ dataForm.contactName }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="dada_dsp_info_top">
|
|
|
+ <span> 归属: 达达</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div style="margin-top: 15px">
|
|
|
+ <div class="dada_dsp_info_top"><span> 二维码: <img @click="showImages(dataForm.qrCode)" :src="dataForm.qrCode" style="display: block; max-width: 100%; margin: 0 auto;margin-top: -11%; height: 50px; width: 50px; margin-left: 22%;cursor:pointer"></span></div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div style="margin-top: 15px">
|
|
|
+ <div class="dada_dsp_info_top">
|
|
|
+ <span> 联系电话: {{ dataForm.mobile }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="dada_dsp_info_top">
|
|
|
+ <span>
|
|
|
+ 所在地区: {{ dataForm.provinceName }} >> {{ dataForm.cityName }} >>
|
|
|
+ {{ dataForm.districtName }}</span
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
|
|
|
+ <el-form-item label="商户名称" prop="merchantName">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.merchantName"
|
|
|
+ placeholder="请输入商户名称"
|
|
|
+ clearable
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="联系人" prop="contactName">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.contactName"
|
|
|
+ placeholder="请输入联系人"
|
|
|
+ clearable
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="联系手机" prop="mobile">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.mobile"
|
|
|
+ placeholder="请输入联系手机"
|
|
|
+ clearable
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="商家类型" prop="type">
|
|
|
+ <el-select v-model="queryParams.merchantType" placeholder="请选择商家类型" clearable >
|
|
|
+ <el-option v-for="item in merchantTypeOption" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="运费包" prop="freightPackageId" v-if="this.userType == 4">
|
|
|
+ <el-select v-model="queryParams.freightPackageId" placeholder="请选择运费包" filterable clearable >
|
|
|
+ <el-option v-for="item in filterPackageFreightList" :key="item.id" :value="item.id" :label="item.name"/>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="余额(元)" prop="amountStart">
|
|
|
+ <el-input v-model.number="queryParams.amountStart" @keyup.enter.native="handleQuery" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="~" label-width="10px" prop="amountEnd">
|
|
|
+ <el-input v-model.number="queryParams.amountEnd" @keyup.enter.native="handleQuery" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="创建时间" prop="createTime">
|
|
|
+ <el-date-picker v-model="date" type="datetimerange" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间"
|
|
|
+ :default-time="['00:00:00', '23:59:59']" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd HH:mm:ss">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
|
|
+ <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
|
|
+ <!-- <el-button icon="el-icon-download" @click="handleExport()" type="primary">导出</el-button> -->
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ v-if="this.userType == 4 || this.userType == 5"
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ icon="el-icon-plus"
|
|
|
+ @click="handleAdd"
|
|
|
+ >新增</el-button>
|
|
|
+ </el-col>
|
|
|
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-table v-loading="loading" :data="merchantList" @selection-change="handleSelectionChange" stripe border highlight-current-row style="width: 100%">
|
|
|
+ <el-table-column label="商家名称" align="center" prop="merchantName" />
|
|
|
+ <el-table-column label="联系人/电话" align="center" prop="merchantName">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{scope.row.contactName}} / {{scope.row.contactMobile}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="所属配送商" align="center" prop="dspName" />
|
|
|
+ <el-table-column label="商家类型" align="center" prop="merchantType">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tag v-if="scope.row.merchantType == 1">单店</el-tag>
|
|
|
+ <el-tag type="success" v-if="scope.row.merchantType == 2">连锁店</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="创建时间" align="center" prop="createTime" />
|
|
|
+ <el-table-column label="账户余额" align="center" prop="accountAmount" />
|
|
|
+ <el-table-column label="运费包类型" align="center" v-if="this.userType == 4">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.dimensionName || '- -' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="运费包" align="center" v-if="this.userType == 4">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.freightPackageName || '- -' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- <el-table-column label="状态" align="center" prop="status">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-switch @change="updateStatus(scope.row.id,scope.row.status)" :active-value="2" :inactive-value="0"
|
|
|
+ v-model="scope.row.status" active-color="#13ce66" inactive-color="#ff4949"></el-switch>
|
|
|
+ </template>
|
|
|
+ </el-table-column> -->
|
|
|
+ <el-table-column label="打印二维码" align="center" prop="status">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-switch
|
|
|
+ v-model="scope.row.openQrCode"
|
|
|
+ @change="updateQrCode(scope.row)"
|
|
|
+ active-color="#13ce66"
|
|
|
+ inactive-color="#ff4949"
|
|
|
+ active-value="1"
|
|
|
+ inactive-value="0"
|
|
|
+ ></el-switch>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ v-if="userType == 4 || userType == 5"
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="handleUpdate(scope.row)"
|
|
|
+ >修改</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ @click="gotoInfo(scope.row)"
|
|
|
+ >详情</el-button>
|
|
|
+ <el-button
|
|
|
+ v-if="userType == 4"
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ @click="handleDelivery(scope.row.id)"
|
|
|
+ >绑定运费包</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <pagination
|
|
|
+ v-show="total>0"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="queryParams.pageNum"
|
|
|
+ :limit.sync="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+
|
|
|
+ <!-- 添加或修改客户商家对话框 -->
|
|
|
+ <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body close="close">
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="140px">
|
|
|
+ <el-tabs v-model="activeName" type="card">
|
|
|
+ <el-tab-pane label="主要信息" name="first">
|
|
|
+ <el-form-item label="商家名称" prop="merchantName">
|
|
|
+ <el-input style="width:300px" v-model="form.merchantName" placeholder="请输入商家名称" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="代理商" v-if="user.type == 1">
|
|
|
+ <el-select v-model="form.agentId" placeholder="请选择" filterable @change="changeAgent" clearable>
|
|
|
+ <el-option v-for="item in agentOption" :key="item.id" :label="item.name" :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="达达配送服务商" v-if="user.type == 1">
|
|
|
+ <el-select v-model="form.dadaDspId" placeholder="请选择" filterable @change="changeAgent" clearable>
|
|
|
+ <el-option v-for="item in dadaDspOption" :key="item.id" :label="item.name" :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="所属员工" v-if="user.type == 1">
|
|
|
+ <el-select v-model="form.personnelId" placeholder="请选择" filterable clearable>
|
|
|
+ <el-option v-for="item in personnelOption" :key="item.id" :label="item.name" :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="所在地区">
|
|
|
+ <span style="color: #f56c6c;float: left;position: absolute;left: -77px;">*</span>
|
|
|
+ <Area :areaProp="areaProp" @changeArea="changeArea" ref="area"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="详细地址" prop="address">
|
|
|
+ <el-input style="width:500px" v-model="form.address" placeholder="请输入商家地址" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="门牌号" prop="street">
|
|
|
+ <el-input style="width:500px" v-model="form.street" placeholder="请输入门牌号" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="商家类型" prop="merchantType">
|
|
|
+ <el-radio-group v-model="form.merchantType">
|
|
|
+ <el-radio :label="1">单店</el-radio>
|
|
|
+ <el-radio :label="2">连锁店</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="商户营业执照类型" prop="licenseType">
|
|
|
+ <el-select v-model="form.licenseType" placeholder="商户营业执照类型" clearable >
|
|
|
+ <el-option
|
|
|
+ v-for="item in licenseTypeOption"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.value"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="商家分类" prop="categoryId">
|
|
|
+ <el-select v-model="form.categoryId" placeholder="商家分类" clearable >
|
|
|
+ <el-option
|
|
|
+ v-for="item in merchantCategoryList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="联系人名称" prop="contactName">
|
|
|
+ <el-input style="width:300px" v-model="form.contactName" placeholder="请输入联系人名称" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="手机号码" prop="contactMobile">
|
|
|
+ <span style="color: #f56c6c;float: left;position: absolute;left: -77px;">*</span>
|
|
|
+ <el-input style="width:300px" v-model="form.contactMobile" placeholder="请输入手机号码" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="法人姓名" prop="legalPerson">
|
|
|
+ <el-input style="width:300px" v-model="form.legalPerson" placeholder="请输入法人姓名" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="身份证号码" prop="idcardNo">
|
|
|
+ <el-input style="width:300px" v-model="form.idcardNo" placeholder="请输入身份证号码" maxlength="18" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitForm" v-if="this.userType == 4 || this.userType == 5">确 定</el-button>
|
|
|
+ <el-button @click="cancel">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog title="绑定运费包" :visible.sync="packageRequestOpen" width="700px" append-to-body>
|
|
|
+ <el-form ref="packageRequest" :model="packageRequest" :rules="packageRequestRules" label-width="130px">
|
|
|
+ <el-form-item label="选择包" prop="packageId">
|
|
|
+ <el-select v-model="packageRequest.packageId" placeholder="请选择运费包" filterable clearable>
|
|
|
+ <el-option v-for="item in this.packageFreightList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitFormPackage">确 定</el-button>
|
|
|
+ <el-button @click="cancelPackage">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog :visible.sync="images" title="预览配送商二维码" width="30%" append-to-body>
|
|
|
+ <img :src="value" style="display: block; max-width: 100%; margin: 0 auto;">
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { delMerchant, exportMerchant, getMerchantCategoryList } from "@/api/module/merchant";
|
|
|
+import { getDadaDsp, listDadaMerchant } from "@/api/module/dadaDsp";
|
|
|
+import { addMerchant, getDadaMerchant, listPackageFreight, filterListPackageFreight, updateMerchant } from "@/api/module/dadaDspMerchant";
|
|
|
+import Area from '@/components/area/oldArea'
|
|
|
+import area from '@/api/oldCity'
|
|
|
+import wditor from '@/components/Wditor';
|
|
|
+import user from '@/store/modules/user'
|
|
|
+import OldSend from '@/components/area/oldSend'
|
|
|
+import { getPersonnelByAgent } from "@/api/module/personnel";
|
|
|
+import { changeQrCode } from '@/api/module/shop';
|
|
|
+
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "Merchant",
|
|
|
+ components: {
|
|
|
+ Area,
|
|
|
+ wditor,
|
|
|
+ OldSend
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ value:undefined,
|
|
|
+ images: false,
|
|
|
+ // 开关
|
|
|
+ date:[],
|
|
|
+ agentList: [],
|
|
|
+ personnelList: [],
|
|
|
+ personnelOption: [],
|
|
|
+ activeName: 'first',
|
|
|
+ merchantTypeOption:[{
|
|
|
+ value: 1,
|
|
|
+ label:'单店'
|
|
|
+ },{
|
|
|
+ value:2,
|
|
|
+ label:'连锁店'
|
|
|
+ }],
|
|
|
+ merchantCategoryList: [],
|
|
|
+ licenseTypeOption: [{
|
|
|
+ value: 1,
|
|
|
+ name: '个体'
|
|
|
+ },{
|
|
|
+ value: 3,
|
|
|
+ name: '公司'
|
|
|
+ }],
|
|
|
+ areaProp: {},
|
|
|
+ startArea: {
|
|
|
+ province: '',
|
|
|
+ city: '',
|
|
|
+ district: '',
|
|
|
+ provinceName: '',
|
|
|
+ cityName: '',
|
|
|
+ districtName: '',
|
|
|
+ cityValues: [],
|
|
|
+ districtValues: [],
|
|
|
+ districtNames: [],
|
|
|
+ },
|
|
|
+ sendAreaProp: {},
|
|
|
+ sendStartArea: {
|
|
|
+ province: '',
|
|
|
+ city: '',
|
|
|
+ district: '',
|
|
|
+ provinceName: '',
|
|
|
+ cityName: '',
|
|
|
+ districtName: '',
|
|
|
+ cityValues: [],
|
|
|
+ districtValues: [],
|
|
|
+ districtNames: [],
|
|
|
+ },
|
|
|
+ user: {},
|
|
|
+ dadaDspId: '',
|
|
|
+ agentOption: [],
|
|
|
+ dadaDspOption: [],
|
|
|
+ // 遮罩层
|
|
|
+ loading: true,
|
|
|
+ // 选中数组
|
|
|
+ ids: [],
|
|
|
+ // 非单个禁用
|
|
|
+ single: true,
|
|
|
+ // 非多个禁用
|
|
|
+ multiple: true,
|
|
|
+ // 显示搜索条件
|
|
|
+ showSearch: true,
|
|
|
+ // 总条数
|
|
|
+ total: 0,
|
|
|
+ // 客户商家表格数据
|
|
|
+ merchantList: [],
|
|
|
+ // 弹出层标题
|
|
|
+ title: "",
|
|
|
+ // 是否显示弹出层
|
|
|
+ open: false,
|
|
|
+ // 登录用户类型
|
|
|
+ userType: undefined,
|
|
|
+ // 打印二维码类型
|
|
|
+ qrCodeType: 2,
|
|
|
+ // 查询参数
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ merchantName: undefined,
|
|
|
+ agentId: undefined,
|
|
|
+ provinceId: undefined,
|
|
|
+ cityId: undefined,
|
|
|
+ districtId: undefined,
|
|
|
+ merchantType: undefined,
|
|
|
+ licenseType: undefined,
|
|
|
+ categoryId: undefined,
|
|
|
+ logo: undefined,
|
|
|
+ contactName: undefined,
|
|
|
+ contactMobile: undefined,
|
|
|
+ intro: undefined,
|
|
|
+ photoAlbum: undefined,
|
|
|
+ bizLicense: undefined,
|
|
|
+ bizLicenseNo: undefined,
|
|
|
+ legalPerson: undefined,
|
|
|
+ idcardNo: undefined,
|
|
|
+ idcardFront: undefined,
|
|
|
+ idcardBack: undefined,
|
|
|
+ lng: undefined,
|
|
|
+ lat: undefined,
|
|
|
+ address: undefined,
|
|
|
+ errorMsg: undefined,
|
|
|
+ status: undefined,
|
|
|
+ memberName: undefined,
|
|
|
+ memberMobile: undefined,
|
|
|
+ aId: undefined,
|
|
|
+ bindDeliveryAmount: undefined,
|
|
|
+ personnelName: undefined,
|
|
|
+ personnelId: undefined,
|
|
|
+ dadaDspId: undefined,
|
|
|
+ startTime: undefined,
|
|
|
+ endTime: undefined,
|
|
|
+ freightPackageId: undefined,
|
|
|
+ amountStart: undefined,
|
|
|
+ amountEnd: undefined,
|
|
|
+ merchantType: undefined
|
|
|
+ },
|
|
|
+ exportParams: {
|
|
|
+ },
|
|
|
+ packageRequest: {
|
|
|
+ packageType: undefined,
|
|
|
+ packageId: undefined,
|
|
|
+ merchantId: undefined
|
|
|
+ },
|
|
|
+ packageRequestRules: {},
|
|
|
+ packageRequestOpen: false,
|
|
|
+ // 弹框运费包
|
|
|
+ packageFreightList: [],
|
|
|
+ // 筛选运费包
|
|
|
+ filterPackageFreightList: [],
|
|
|
+ // 表单参数
|
|
|
+ form: {
|
|
|
+ },
|
|
|
+ dataForm: {
|
|
|
+ id: "",
|
|
|
+ },
|
|
|
+ // 表单校验
|
|
|
+ rules: {
|
|
|
+ merchantName: [
|
|
|
+ { required: true, message: "商家名称不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ address: [
|
|
|
+ { required: true, message: "详细地址不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ street: [
|
|
|
+ { required: true, message: "门牌号不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ agentId: [
|
|
|
+ { required: true, message: "代理商Id不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ selectedArea: [
|
|
|
+ { required: true, message: "地区不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ provinceId: [
|
|
|
+ { required: true, message: "省id不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ cityId: [
|
|
|
+ { required: true, message: "市id不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ categoryId: [
|
|
|
+ { required: true, message: "商家分类不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ districtId: [
|
|
|
+ { required: true, message: "区县ID不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ merchantType: [
|
|
|
+ { required: true, message: "商家类型 1->单店,2->连锁店不能为空", trigger: "change" }
|
|
|
+ ],
|
|
|
+ licenseType: [
|
|
|
+ { required: true, message: "商户营业执照类型 1->个体, 3->公司不能为空", trigger: "change" }
|
|
|
+ ],
|
|
|
+ status: [
|
|
|
+ { required: true, message: "状态:0->禁用,1->待认证, 2->已认证不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ contactName: [
|
|
|
+ { required: true, message: "联系人名称不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ contactMobile: [
|
|
|
+ { required: true, message: "手机号码不能为空", trigger: "blur" }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.user = user.actions.getSysUser()
|
|
|
+ this.userType = localStorage.getItem("SYS_USER_TYPE")
|
|
|
+ this.dadaDspId = user.state.dadaDspId;
|
|
|
+ if (typeof this.dadaDspId !== 'undefined') {
|
|
|
+ getDadaDsp(this.dadaDspId).then((response) => {
|
|
|
+ this.dataForm = response.data;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.getList();
|
|
|
+
|
|
|
+ getMerchantCategoryList().then(response => {
|
|
|
+ this.merchantCategoryList = response.data
|
|
|
+ });
|
|
|
+ listPackageFreight().then(response => {
|
|
|
+ this.packageFreightList = response.data
|
|
|
+ });
|
|
|
+ filterListPackageFreight().then(response => {
|
|
|
+ this.filterPackageFreightList = response.data
|
|
|
+ });
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ updateQrCode(row) {
|
|
|
+ console.log('row', row)
|
|
|
+ var qrCodeType = this.qrCodeType
|
|
|
+ let text = row.openQrCode === 1 ? "启用" : "停用";
|
|
|
+ this.$confirm('确认要"' + text + '""' + row.name + '"达达配送服务商吗?', "警告", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(function () {
|
|
|
+ return changeQrCode(row.id, row.openQrCode, qrCodeType);
|
|
|
+ }).then(() => {
|
|
|
+ this.msgSuccess(text + "成功");
|
|
|
+ }).catch(function () {
|
|
|
+ row.openQrCode = row.openQrCode === 1 ? 0: 1;
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ showImages(qrCode){
|
|
|
+ console.log('ddd',qrCode)
|
|
|
+ this.images = true
|
|
|
+ this.value = qrCode
|
|
|
+ },
|
|
|
+
|
|
|
+ handleDelivery(merchantId) {
|
|
|
+ this.packageRequest.merchantId = merchantId;
|
|
|
+ getDadaMerchant(merchantId).then(response => {
|
|
|
+ this.packageRequest.packageId = response.data.freightPackageId
|
|
|
+ });
|
|
|
+ this.packageRequestOpen = true;
|
|
|
+ },
|
|
|
+
|
|
|
+ cancelPackage() {
|
|
|
+ this.packageRequestOpen = false;
|
|
|
+ this.packageRequest = {
|
|
|
+ packageType: undefined,
|
|
|
+ packageId: undefined,
|
|
|
+ merchantId: undefined
|
|
|
+ };
|
|
|
+ },
|
|
|
+
|
|
|
+ submitFormPackage() {
|
|
|
+ this.$refs["packageRequest"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ this.$http.post('/module/dadaDsp/merchant/bindFreightPackage', this.packageRequest).then(( { data }) => {
|
|
|
+ if(data) {
|
|
|
+ this.$message.success('绑定成功!')
|
|
|
+ this.packageRequestOpen = false
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ changeAgent() {
|
|
|
+ this.personnelOption = [];
|
|
|
+ this.form.personnelId = undefined;
|
|
|
+ getPersonnelByAgent(this.form.agentId).then(response => {
|
|
|
+ this.personnelOption = response.data
|
|
|
+ console.log("option2", this.personnelOption)
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ changeSendArea(e) {
|
|
|
+ this.sendStartArea = e
|
|
|
+ },
|
|
|
+ close(){
|
|
|
+ this.reset()
|
|
|
+ },
|
|
|
+ updateStatus(id, status) {
|
|
|
+ this.$http
|
|
|
+ .get(`/module/merchant/updateStatus?id=` + id)
|
|
|
+ .then(({
|
|
|
+ data
|
|
|
+ }) => {
|
|
|
+ let msg = '启用'
|
|
|
+ if (status === 0) {
|
|
|
+ msg = '禁用'
|
|
|
+ }
|
|
|
+ if (data && data === 'OK') {
|
|
|
+ this.$message({
|
|
|
+ message: msg + '成功',
|
|
|
+ type: 'success',
|
|
|
+ duration: 1500
|
|
|
+ })
|
|
|
+ this.handleQuery()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ gotoInfo(row){
|
|
|
+ this.$router.push({ path: '/dadaDspMerchant/dadaDspMerchant/info', query: { merchantId: row.id } })
|
|
|
+ },
|
|
|
+ introChange(data) {
|
|
|
+ this.form.intro = data
|
|
|
+ },
|
|
|
+ // 选择区域
|
|
|
+ changeArea (e) {
|
|
|
+ this.startArea = e
|
|
|
+ },
|
|
|
+ /** 查询客户商家列表 */
|
|
|
+ getList() {
|
|
|
+ this.loading = true;
|
|
|
+ this.queryParams.dadaDspId = this.dadaDspId;
|
|
|
+ if (this.date !== null && this.date !== "") {
|
|
|
+ if (this.date[0] !== undefined) {
|
|
|
+ this.queryParams.startTime = this.date[0];
|
|
|
+ this.queryParams.endTime = this.date[1];
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.queryParams.startTime = "";
|
|
|
+ this.queryParams.endTime = "";
|
|
|
+ }
|
|
|
+ listDadaMerchant(this.queryParams).then(response => {
|
|
|
+ this.merchantList = response.data.data;
|
|
|
+ this.total = response.data.totalNums;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 取消按钮
|
|
|
+ cancel() {
|
|
|
+ this.open = false;
|
|
|
+ this.reset();
|
|
|
+ },
|
|
|
+ // 表单重置
|
|
|
+ reset() {
|
|
|
+ this.form = {
|
|
|
+ id: undefined,
|
|
|
+ merchantName: undefined,
|
|
|
+ agentId: undefined,
|
|
|
+ personnelId: undefined,
|
|
|
+ provinceId: undefined,
|
|
|
+ provinceName: undefined,
|
|
|
+ cityId: undefined,
|
|
|
+ cityName: undefined,
|
|
|
+ districtId: undefined,
|
|
|
+ districtName: undefined,
|
|
|
+ merchantType: undefined,
|
|
|
+ licenseType: undefined,
|
|
|
+ categoryId: undefined,
|
|
|
+ logo: undefined,
|
|
|
+ contactName: undefined,
|
|
|
+ contactMobile: undefined,
|
|
|
+ intro: undefined,
|
|
|
+ photoAlbum: undefined,
|
|
|
+ photoList: [],
|
|
|
+ bizLicense: undefined,
|
|
|
+ bizLicenseNo: undefined,
|
|
|
+ legalPerson: undefined,
|
|
|
+ idcardNo: undefined,
|
|
|
+ idcardFront: undefined,
|
|
|
+ idcardBack: undefined,
|
|
|
+ lng: undefined,
|
|
|
+ lat: undefined,
|
|
|
+ address: undefined,
|
|
|
+ errorMsg: undefined,
|
|
|
+ status: 0,
|
|
|
+ bindDeliveryAmount: undefined,
|
|
|
+ };
|
|
|
+ this.personnelOption = [];
|
|
|
+ this.resetForm("form");
|
|
|
+ },
|
|
|
+ /** 搜索按钮操作 */
|
|
|
+ handleQuery() {
|
|
|
+ // this.queryParams.pageNum = 1;
|
|
|
+ this.queryParams.provinceName = this.sendStartArea.provinceName
|
|
|
+ this.queryParams.cityName = this.sendStartArea.cityName
|
|
|
+ this.queryParams.districtName = this.sendStartArea.districtName
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ /** 重置按钮操作 */
|
|
|
+ resetQuery() {
|
|
|
+ this.resetForm("queryForm");
|
|
|
+ this.date = []
|
|
|
+ this.queryParams.startTime = ""
|
|
|
+ this.queryParams.endTime = ""
|
|
|
+ this.sendStartArea = {
|
|
|
+ province: '',
|
|
|
+ city: '',
|
|
|
+ district: '',
|
|
|
+ provinceName: '',
|
|
|
+ cityName: '',
|
|
|
+ districtName: '',
|
|
|
+ cityValues: [],
|
|
|
+ districtValues: [],
|
|
|
+ districtNames: [],
|
|
|
+ };
|
|
|
+ this.sendAreaProp = {}
|
|
|
+ this.handleQuery();
|
|
|
+ },
|
|
|
+ // 多选框选中数据
|
|
|
+ handleSelectionChange(selection) {
|
|
|
+ this.ids = selection.map(item => item.id)
|
|
|
+ this.single = selection.length!==1
|
|
|
+ this.multiple = !selection.length
|
|
|
+ },
|
|
|
+
|
|
|
+ /** 新增按钮操作 */
|
|
|
+ handleAdd() {
|
|
|
+ this.reset();
|
|
|
+ this.areaProp = {},
|
|
|
+ this.open = true;
|
|
|
+ this.title = "添加客户商家";
|
|
|
+ },
|
|
|
+ /** 修改按钮操作 */
|
|
|
+ handleUpdate(row) {
|
|
|
+ this.reset();
|
|
|
+ const id = row.id || this.ids
|
|
|
+ getDadaMerchant(id).then(response => {
|
|
|
+ this.startArea.provinceName = response.data.provinceName
|
|
|
+ this.startArea.districtName = response.data.districtName
|
|
|
+ this.startArea.cityName = response.data.cityName
|
|
|
+ if(response.data.provinceName == undefined && response.data.districtName == undefined && response.data.cityName == undefined) {
|
|
|
+ this.startArea.provinceName = response.data.provinceName
|
|
|
+ this.startArea.districtName = response.data.districtName
|
|
|
+ this.startArea.cityName = response.data.cityName
|
|
|
+ } else {
|
|
|
+ const func = array => {
|
|
|
+ // 如果传入的不是数组 则返回
|
|
|
+ if (!Array.isArray(array)) return
|
|
|
+ // 使用reduce遍历数组,给定义一个初始值空数组,如果遍历的当前子元素是数组,那么拼接它继续递归后的结果,如果不是数组那么就是值,直接concat添加到数组尾部
|
|
|
+ return array.reduce(
|
|
|
+ (prev, curr) =>
|
|
|
+ Array.isArray(curr.childs) ? prev.concat(curr).concat(func(curr.childs)) : prev.concat(curr),
|
|
|
+ []
|
|
|
+ )
|
|
|
+ }
|
|
|
+ console.log('变化前:',area)
|
|
|
+ console.log('变化后:',func(area))
|
|
|
+
|
|
|
+ this.startArea.province = (func(area).find(item => {return item.name === this.startArea.provinceName && item.level === 1}) || {}).id
|
|
|
+ console.log('this.startArea.province:', this.startArea.province)
|
|
|
+
|
|
|
+ this.startArea.city = (func(area).find(item => {return item.name === this.startArea.cityName && item.level === 2}) || {}).id
|
|
|
+ console.log('this.startArea.city:', this.startArea.city)
|
|
|
+
|
|
|
+ var cityId = this.startArea.city.substr(0,4)
|
|
|
+ console.log('var cityId', cityId)
|
|
|
+ this.startArea.district = (func(area).find(item => {return item.name === this.startArea.districtName && item.id.includes(cityId) && item.level === 3}) || {}).id
|
|
|
+ console.log('this.startArea.district:', this.startArea.district)
|
|
|
+ }
|
|
|
+
|
|
|
+ this.areaProp = JSON.parse(JSON.stringify(this.startArea))
|
|
|
+ this.form = Object.assign({}, { personnelId: '' }, response.data);
|
|
|
+
|
|
|
+ console.log('form', this.form)
|
|
|
+ this.open = true;
|
|
|
+ this.title = "修改客户商家";
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 提交按钮 */
|
|
|
+ submitForm() {
|
|
|
+ if(!this.form.photoList == undefined){
|
|
|
+ if (this.form.photoList.length > 0){
|
|
|
+ for (var i=0; i<this.form.photoList.length; i++){
|
|
|
+ if (i==0){
|
|
|
+ this.form.photoAlbum = this.form.photoList[i]
|
|
|
+ } else {
|
|
|
+ this.form.photoAlbum = this.form.photoAlbum + ',' + this.form.photoList[i]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.activeName = 'first'
|
|
|
+ this.$refs["form"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ if (this.startArea.province === undefined || this.startArea.city === undefined || this.startArea.district === undefined ||
|
|
|
+ this.startArea.province === "" || this.startArea.city === "" || this.startArea.district === "") {
|
|
|
+ this.$message({
|
|
|
+ message: '请选择地区',
|
|
|
+ type: 'error',
|
|
|
+ duration: 1500
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.form.provinceId = this.startArea.province
|
|
|
+ this.form.cityId = this.startArea.city
|
|
|
+ this.form.districtId = this.startArea.district
|
|
|
+
|
|
|
+ this.form.provinceName = this.startArea.provinceName
|
|
|
+ this.form.cityName = this.startArea.cityName
|
|
|
+ this.form.districtName = this.startArea.districtName
|
|
|
+
|
|
|
+ console.log('form', this.form)
|
|
|
+ if (this.form.id != null) {
|
|
|
+ // updateMerchant(this.form).then(response => {
|
|
|
+ // this.msgSuccess("修改成功");
|
|
|
+ // this.open = false;
|
|
|
+ // this.getList();
|
|
|
+ // });
|
|
|
+
|
|
|
+ this.$confirm("确定修改数据吗?", "警告", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ updateMerchant(this.form).then(response => {
|
|
|
+ this.msgSuccess("修改成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ // addMerchant(this.form).then(response => {
|
|
|
+ // this.msgSuccess("新增成功");
|
|
|
+ // this.open = false;
|
|
|
+ // this.getList();
|
|
|
+ // });
|
|
|
+
|
|
|
+ this.$confirm("确定新增数据吗?", "警告", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ addMerchant(this.form).then(response => {
|
|
|
+ this.msgSuccess("新增成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 删除按钮操作 */
|
|
|
+ handleDelete(row) {
|
|
|
+ const ids = row.id || this.ids;
|
|
|
+ this.$confirm('是否确认删除客户商家编号为"' + ids + '"的数据项?', "警告", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(function() {
|
|
|
+ return delMerchant(ids);
|
|
|
+ }).then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.msgSuccess("删除成功");
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /** 导出按钮操作 */
|
|
|
+ handleExport() {
|
|
|
+ this.exportParams.merchantName = this.queryParams.merchantName
|
|
|
+ this.exportParams.merchantType = this.queryParams.merchantType
|
|
|
+ this.exportParams.licenseType = this.queryParams.licenseType
|
|
|
+ this.exportParams.contactName = this.queryParams.contactName
|
|
|
+ this.exportParams.mobile = this.queryParams.mobile
|
|
|
+ this.exportParams.memberName = this.queryParams.memberName
|
|
|
+ this.exportParams.memberMobile = this.queryParams.memberMobile
|
|
|
+ this.exportParams.personnelName = this.queryParams.personnelName
|
|
|
+ this.exportParams.personnelId = this.queryParams.personnelId
|
|
|
+ if (this.date !== null && this.date !== '') {
|
|
|
+ if (this.date[0] !== undefined) {
|
|
|
+ this.exportParams.startTime = this.date[0]
|
|
|
+ this.exportParams.endTime = this.date[1]
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.exportParams.startTime = ''
|
|
|
+ this.exportParams.endTime = ''
|
|
|
+ }
|
|
|
+
|
|
|
+ const params = this.exportParams;
|
|
|
+
|
|
|
+ this.$confirm('是否确认导出所有客户商家数据项?', "警告", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(function() {
|
|
|
+ return exportMerchant(params);
|
|
|
+ }).then(response => {
|
|
|
+ this.download(response.data);
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style lang="scss">
|
|
|
+ .onlyOne.el-input-number {
|
|
|
+ width: 100%;
|
|
|
+ background-color: rgb(251, 251, 251);
|
|
|
+ height: calc(100% - 2px);
|
|
|
+
|
|
|
+ .el-input__inner {
|
|
|
+ background: rgb(251, 251, 251);
|
|
|
+ border: none;
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|
|
|
+<style lang="scss" scoped>
|
|
|
+ .table {
|
|
|
+ border: 1px solid #eeeeee;
|
|
|
+ border-right: 0;
|
|
|
+ display: inline-block;
|
|
|
+
|
|
|
+ .table-header {
|
|
|
+ display: flex;
|
|
|
+ height: 40px;
|
|
|
+ border-right: 1px solid #eeeeee;
|
|
|
+ background: #f5f5f5;
|
|
|
+
|
|
|
+ .table-header-item {
|
|
|
+ width: 196px;
|
|
|
+ height: 40px;
|
|
|
+ line-height: 40px;
|
|
|
+ padding-left: 14px;
|
|
|
+ font-size: 12px;
|
|
|
+ color: #666666;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .table-list {
|
|
|
+ display: flex;
|
|
|
+ height: 40px;
|
|
|
+ border-top: 1px solid #eeeeee;
|
|
|
+ text-align: center;
|
|
|
+
|
|
|
+ &:nth-of-type(2n + 2) {
|
|
|
+ background: #fbfbfb;
|
|
|
+ }
|
|
|
+
|
|
|
+ .table-list-item {
|
|
|
+ width: 196px;
|
|
|
+ height: 40px;
|
|
|
+ line-height: 40px;
|
|
|
+ padding-left: 14px;
|
|
|
+ font-size: 12px;
|
|
|
+ color: #333333;
|
|
|
+ border-right: 1px solid #eeeeee;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ padding: 0;
|
|
|
+ white-space: nowrap;
|
|
|
+ // input {
|
|
|
+ // width: 100%;
|
|
|
+ // height: 100%;
|
|
|
+ // border: none;
|
|
|
+ // background: none;
|
|
|
+ // outline: none;
|
|
|
+ // font-size: 12px;
|
|
|
+ // color: #333333;
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|
|
|
+
|
|
|
+<style>
|
|
|
+.dada_dsp_info_top {
|
|
|
+ width: 300px;
|
|
|
+ display: inline-block;
|
|
|
+}
|
|
|
+</style>
|