|
@@ -1,84 +1,85 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
<el-form
|
|
|
- :model="queryParams"
|
|
|
- class="main-search"
|
|
|
- ref="queryForm"
|
|
|
- size="small"
|
|
|
- :inline="true"
|
|
|
- v-show="showSearch"
|
|
|
- label-width="68px"
|
|
|
+ :model="queryParams"
|
|
|
+ class="main-search"
|
|
|
+ ref="queryForm"
|
|
|
+ size="small"
|
|
|
+ :inline="true"
|
|
|
+ v-show="showSearch"
|
|
|
+ label-width="68px"
|
|
|
>
|
|
|
- <el-form-item label="店铺名称" prop="name">
|
|
|
- <el-input
|
|
|
- v-model="queryParams.name"
|
|
|
- placeholder="请输入店铺名称"
|
|
|
- clearable
|
|
|
- style="width: 240px"
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="状态" prop="status">
|
|
|
- <el-select
|
|
|
- v-model="queryParams.status"
|
|
|
- placeholder="状态"
|
|
|
- clearable
|
|
|
- style="width: 240px"
|
|
|
- >
|
|
|
- <el-option key="A" label="启用" value="A" />
|
|
|
- <el-option key="N" label="禁用" value="N" />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- icon="el-icon-search"
|
|
|
- size="mini"
|
|
|
- @click="handleQuery"
|
|
|
- >搜索</el-button
|
|
|
- >
|
|
|
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
|
|
- >重置</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- plain
|
|
|
- icon="el-icon-plus"
|
|
|
- size="mini"
|
|
|
- @click="handleAdd"
|
|
|
- v-hasPermi="['store:add']"
|
|
|
- >新增店铺</el-button
|
|
|
- >
|
|
|
- </el-form-item>
|
|
|
+ <el-form-item :label="$t('storeList.list.storeName')" prop="name">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.name"
|
|
|
+ :placeholder="$t('storeList.list.pleaseEnterStoreName')"
|
|
|
+ clearable
|
|
|
+ style="width: 240px"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t('storeList.list.status')" prop="status">
|
|
|
+ <el-select
|
|
|
+ v-model="queryParams.status"
|
|
|
+ :placeholder="$t('storeList.list.status')"
|
|
|
+ clearable
|
|
|
+ style="width: 240px"
|
|
|
+ >
|
|
|
+ <el-option :key="$t('storeList.list.enabledKey')" :label="$t('storeList.list.enabled')" :value="A" />
|
|
|
+ <el-option :key="$t('storeList.list.disabledKey')" :label="$t('storeList.list.disabled')" :value="N" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-search"
|
|
|
+ size="mini"
|
|
|
+ @click="handleQuery"
|
|
|
+ >
|
|
|
+ {{ $t('storeList.list.search') }}
|
|
|
+ </el-button>
|
|
|
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">
|
|
|
+ {{ $t('storeList.list.reset') }}
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ icon="el-icon-plus"
|
|
|
+ size="mini"
|
|
|
+ @click="handleAdd"
|
|
|
+ v-hasPermi="['store:add']"
|
|
|
+ >
|
|
|
+ {{ $t('storeList.list.addNewStore') }}
|
|
|
+ </el-button>
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
|
|
|
<el-table
|
|
|
- ref="tables"
|
|
|
- v-loading="loading"
|
|
|
- :data="list"
|
|
|
- @selection-change="handleSelectionChange"
|
|
|
- :default-sort="defaultSort"
|
|
|
- @sort-change="handleSortChange"
|
|
|
+ ref="tables"
|
|
|
+ v-loading="loading"
|
|
|
+ :data="list"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
+ :default-sort="defaultSort"
|
|
|
+ @sort-change="handleSortChange"
|
|
|
>
|
|
|
- <el-table-column label="ID" prop="id" width="55">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ showIdLastFour(scope.row.id) }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="店铺名称" align="center" prop="name" />
|
|
|
- <el-table-column
|
|
|
- label="所属商户"
|
|
|
- align="center"
|
|
|
- prop="merchantName"
|
|
|
- width="160"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{
|
|
|
- scope.row.merchantName ? scope.row.merchantName : "-"
|
|
|
- }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <!-- <el-table-column label="默认店铺" align="center" prop="isDefault">
|
|
|
+ <el-table-column :label="$t('storeList.list.ID')" prop="id" width="55">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ showIdLastFour(scope.row.id) }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('storeList.list.storeName')" align="center" prop="name" />
|
|
|
+ <el-table-column
|
|
|
+ :label="$t('storeList.list.belongingMerchant')"
|
|
|
+ align="center"
|
|
|
+ prop="merchantName"
|
|
|
+ width="160"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.merchantName? scope.row.merchantName : "-" }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('storeList.list.contactPerson')" align="center" prop="contact" />
|
|
|
+ <!-- <el-table-column label="默认店铺" align="center" prop="isDefault">
|
|
|
<template slot-scope="scope">
|
|
|
<el-switch
|
|
|
v-model="scope.row.isDefault"
|
|
@@ -88,40 +89,39 @@
|
|
|
></el-switch>
|
|
|
</template>
|
|
|
</el-table-column> -->
|
|
|
- <el-table-column label="联系人" align="center" prop="contact" />
|
|
|
- <el-table-column label="手机号" align="center" prop="phone" />
|
|
|
- <el-table-column label="地址" align="center" prop="address" />
|
|
|
- <el-table-column
|
|
|
- label="创建时间"
|
|
|
- align="center"
|
|
|
- prop="createTime"
|
|
|
- sortable="custom"
|
|
|
- :sort-orders="['descending', 'ascending']"
|
|
|
- width="180"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- <span>{{ parseTime(scope.row.createTime) }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="状态" align="center" prop="status">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-switch
|
|
|
- v-model="scope.row.status"
|
|
|
- active-value="A"
|
|
|
- inactive-value="N"
|
|
|
- v-hasPermi="['store:add']"
|
|
|
- @change="handleStatusChange(scope.row)"
|
|
|
- ></el-switch>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="操作"
|
|
|
- align="center"
|
|
|
- width="180"
|
|
|
- class-name="small-padding fixed-width"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- <el-button
|
|
|
+ <el-table-column :label="$t('storeList.list.phoneNumber')" align="center" prop="phone" />
|
|
|
+ <el-table-column :label="$t('storeList.list.address')" align="center" prop="address" />
|
|
|
+ <el-table-column
|
|
|
+ :label="$t('storeList.list.createTime')"
|
|
|
+ align="center"
|
|
|
+ prop="createTime"
|
|
|
+ sortable="custom"
|
|
|
+ :sort-orders="['descending', 'ascending']"
|
|
|
+ width="180"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ parseTime(scope.row.createTime) }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('storeList.list.status')" align="center" prop="status">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-switch
|
|
|
+ v-model="scope.row.status"
|
|
|
+ active-value="A"
|
|
|
+ inactive-value="N"
|
|
|
+ v-hasPermi="['store:add']"
|
|
|
+ @change="handleStatusChange(scope.row)"
|
|
|
+ ></el-switch>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ :label="$t('storeList.list.operation')"
|
|
|
+ align="center"
|
|
|
+ width="180"
|
|
|
+ class-name="small-padding fixed-width"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <!-- <el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-copy-document"
|
|
@@ -129,25 +129,26 @@
|
|
|
@click="handleQrCode(scope.row)"
|
|
|
>二维码</el-button
|
|
|
> -->
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- icon="el-icon-edit"
|
|
|
- @click="handleUpdate(scope.row)"
|
|
|
- >修改</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- icon="el-icon-delete"
|
|
|
- v-hasPermi="['store:add']"
|
|
|
- @click="handleDelete(scope.row)"
|
|
|
- >删除</el-button
|
|
|
- >
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="handleUpdate(scope.row)"
|
|
|
+ >
|
|
|
+ {{ $t('storeList.list.modify') }}
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ v-hasPermi="['store:add']"
|
|
|
+ @click="handleDelete(scope.row)"
|
|
|
+ >
|
|
|
+ {{ $t('storeList.list.delete') }}
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
-
|
|
|
<pagination
|
|
|
v-show="total > 0"
|
|
|
:total="total"
|
|
@@ -158,45 +159,45 @@
|
|
|
|
|
|
<!-- 添加或修改对话框 -->
|
|
|
<el-dialog
|
|
|
- :title="title"
|
|
|
- :visible.sync="open"
|
|
|
- class="common-dialog"
|
|
|
- width="800px"
|
|
|
- append-to-body
|
|
|
+ :title="title"
|
|
|
+ :visible.sync="open"
|
|
|
+ class="common-dialog"
|
|
|
+ width="800px"
|
|
|
+ append-to-body
|
|
|
>
|
|
|
- <el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
|
- <el-row>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="店铺名称" prop="name">
|
|
|
- <el-input
|
|
|
- v-model="form.name"
|
|
|
- placeholder="请输入店铺名称"
|
|
|
- maxlength="30"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="9">
|
|
|
- <el-form-item label="商户logo" prop="logo">
|
|
|
- <el-upload
|
|
|
- :action="uploadAction"
|
|
|
- list-type="picture-card"
|
|
|
- :class="{ hide: hideUpload }"
|
|
|
- :file-list="uploadFiles"
|
|
|
- :auto-upload="true"
|
|
|
- :show-file-list="false"
|
|
|
- :headers="uploadHeader"
|
|
|
- :on-success="handleUploadSuccess"
|
|
|
- >
|
|
|
- <img v-if="form.logo" :src="imagePath + form.logo" class="list-img" />
|
|
|
- <i v-if="!form.logo" class="el-icon-plus"></i>
|
|
|
- </el-upload>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <p class="form-tips">(提示:点击图片修改)</p>
|
|
|
- </el-row>
|
|
|
- <!-- <el-row>
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item :label="$t('storeList.list.storeName')" prop="name">
|
|
|
+ <el-input
|
|
|
+ v-model="form.name"
|
|
|
+ :placeholder="$t('storeList.list.pleaseEnterStoreName')"
|
|
|
+ maxlength="30"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="9">
|
|
|
+ <el-form-item :label="$t('storeList.list.merchantLogo')" prop="logo">
|
|
|
+ <el-upload
|
|
|
+ :action="uploadAction"
|
|
|
+ list-type="picture-card"
|
|
|
+ :class="{ hide: hideUpload }"
|
|
|
+ :file-list="uploadFiles"
|
|
|
+ :auto-upload="true"
|
|
|
+ :show-file-list="false"
|
|
|
+ :headers="uploadHeader"
|
|
|
+ :on-success="handleUploadSuccess"
|
|
|
+ >
|
|
|
+ <img v-if="form.logo" :src="imagePath + form.logo" class="list-img" />
|
|
|
+ <i v-if="!form.logo" class="el-icon-plus"></i>
|
|
|
+ </el-upload>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <p class="form-tips">{{ $t('storeList.list.clickToModifyTip') }}</p>
|
|
|
+ </el-row>
|
|
|
+ <!-- <el-row>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="是否默认店铺">
|
|
|
<el-radio-group v-model="form.isDefault">
|
|
@@ -206,80 +207,80 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row> -->
|
|
|
- <el-row>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="所属商户" prop="merchantId">
|
|
|
- <el-select v-model="form.merchantId" placeholder="请选择所属商户">
|
|
|
- <el-option
|
|
|
- v-for="item in merchantOptions"
|
|
|
- :key="item.id"
|
|
|
- :label="item.name"
|
|
|
- :value="item.id"
|
|
|
- :disabled="item.status !== 'A'"
|
|
|
- ></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="选择货币" prop="currencyId">
|
|
|
- <el-select v-model="form.currencyId" placeholder="请选择货币">
|
|
|
- <el-option
|
|
|
- v-for="item in currencyOptions"
|
|
|
- :key="item.id"
|
|
|
- :label="item.name"
|
|
|
- :value="item.id"
|
|
|
- ></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="联系人姓名" prop="contact">
|
|
|
- <el-input
|
|
|
- v-model="form.contact"
|
|
|
- placeholder="请输入联系人姓名"
|
|
|
- maxlength="30"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="联系人电话" prop="phone">
|
|
|
- <el-input
|
|
|
- v-model="form.phone"
|
|
|
- placeholder="请输入联系人电话"
|
|
|
- maxlength="30"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="店铺详细地址" prop="address">
|
|
|
- <el-input
|
|
|
- v-model="form.address"
|
|
|
- placeholder="请输入店铺详细地址"
|
|
|
- maxlength="200"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="营业时间" prop="hours">
|
|
|
- <el-input
|
|
|
- v-model="form.hours"
|
|
|
- placeholder="请输入店铺营业时间"
|
|
|
- maxlength="100"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <!-- <el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item :label="$t('storeList.list.belongingMerchant')" prop="merchantId">
|
|
|
+ <el-select v-model="form.merchantId" :placeholder="$t('storeList.list.pleaseSelectBelongingMerchant')">
|
|
|
+ <el-option
|
|
|
+ v-for="item in merchantOptions"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ :disabled="item.status!== 'A'"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item :label="$t('storeList.list.selectCurrency')" prop="currencyId">
|
|
|
+ <el-select v-model="form.currencyId" :placeholder="$t('storeList.list.pleaseSelectCurrency')">
|
|
|
+ <el-option
|
|
|
+ v-for="item in currencyOptions"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item :label="$t('storeList.list.contactPersonName')" prop="contact">
|
|
|
+ <el-input
|
|
|
+ v-model="form.contact"
|
|
|
+ :placeholder="$t('storeList.list.pleaseEnterContactPersonName')"
|
|
|
+ maxlength="30"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item :label="$t('storeList.list.contactPersonPhone')" prop="phone">
|
|
|
+ <el-input
|
|
|
+ v-model="form.phone"
|
|
|
+ :placeholder="$t('storeList.list.pleaseEnterContactPersonPhone')"
|
|
|
+ maxlength="30"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item :label="$t('storeList.list.storeDetailedAddress')" prop="address">
|
|
|
+ <el-input
|
|
|
+ v-model="form.address"
|
|
|
+ :placeholder="$t('storeList.list.pleaseEnterStoreDetailedAddress')"
|
|
|
+ maxlength="200"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item :label="$t('storeList.list.businessHours')" prop="hours">
|
|
|
+ <el-input
|
|
|
+ v-model="form.hours"
|
|
|
+ :placeholder="$t('storeList.list.pleaseEnterBusinessHours')"
|
|
|
+ maxlength="100"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <!-- <el-row>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="店铺纬度" prop="latitude">
|
|
|
<el-input
|
|
@@ -453,33 +454,32 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row> -->
|
|
|
-
|
|
|
- <el-row>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="备注信息">
|
|
|
- <el-input
|
|
|
- v-model="form.description"
|
|
|
- type="textarea"
|
|
|
- placeholder="请输入备注信息内容"
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="状态">
|
|
|
- <el-radio-group v-model="form.status">
|
|
|
- <el-radio key="A" label="A" value="A">启用</el-radio>
|
|
|
- <el-radio key="N" label="N" value="N">禁用</el-radio>
|
|
|
- </el-radio-group>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-form>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="submitForm">确定</el-button>
|
|
|
- <el-button @click="cancel">取消</el-button>
|
|
|
- </div>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item :label="$t('storeList.list.remarkInfo')">
|
|
|
+ <el-input
|
|
|
+ v-model="form.description"
|
|
|
+ type="textarea"
|
|
|
+ :placeholder="$t('storeList.list.pleaseEnterRemarkInfo')"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item :label="$t('storeList.list.status')">
|
|
|
+ <el-radio-group v-model="form.status">
|
|
|
+ <el-radio :key="$t('storeList.list.enabledKey')" :label="$t('storeList.list.enabledLabel')" value="A">{{ $t('storeList.list.enabled') }}</el-radio>
|
|
|
+ <el-radio :key="$t('storeList.list.disabledKey')" :label="$t('storeList.list.disabledLabel')" value="N">{{ $t('storeList.list.disabled') }}</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitForm">{{ $t('storeList.list.confirm') }}</el-button>
|
|
|
+ <el-button @click="cancel">{{ $t('storeList.list.cancel') }}</el-button>
|
|
|
+ </div>
|
|
|
</el-dialog>
|
|
|
<FuintQrCode :showDialog="openQrCode" :qr="qr" @closeDialog="closeDialog" />
|
|
|
</div>
|
|
@@ -570,39 +570,59 @@ export default {
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
name: [
|
|
|
- { required: true, message: "店铺名称不能为空", trigger: "blur" },
|
|
|
- {
|
|
|
- min: 2,
|
|
|
- max: 30,
|
|
|
- message: "店铺名称长度必须介于 2 和 30 之间",
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: this.$t('storeList.list.storeNameRequired'),
|
|
|
+ trigger: "blur"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ min: 2,
|
|
|
+ max: 30,
|
|
|
+ message: this.$t('storeList.list.storeNameLengthRange'),
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
],
|
|
|
merchantId: [
|
|
|
- { required: true, message: "所属商户不能为空", trigger: "blur" },
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: this.$t('storeList.list.belongingMerchantRequired'),
|
|
|
+ trigger: "blur"
|
|
|
+ },
|
|
|
],
|
|
|
contact: [
|
|
|
- { required: true, message: "联系人姓名不能为空", trigger: "blur" },
|
|
|
- {
|
|
|
- min: 2,
|
|
|
- max: 30,
|
|
|
- message: "联系人姓名长度必须介于 2 和 30 之间",
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: this.$t('storeList.list.contactPersonNameRequired'),
|
|
|
+ trigger: "blur"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ min: 2,
|
|
|
+ max: 30,
|
|
|
+ message: this.$t('storeList.list.contactPersonNameLengthRange'),
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
],
|
|
|
phone: [
|
|
|
- { required: true, message: "联系人电话不能为空", trigger: "blur" },
|
|
|
- {
|
|
|
- min: 6,
|
|
|
- max: 30,
|
|
|
- message: "联系人电话长度必须介于 6 和 30 之间",
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: this.$t('storeList.list.contactPersonPhoneRequired'),
|
|
|
+ trigger: "blur"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ min: 6,
|
|
|
+ max: 30,
|
|
|
+ message: this.$t('storeList.list.contactPersonPhoneLengthRange'),
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
],
|
|
|
currencyId: [
|
|
|
- { required: true, message: "货币不能为空", trigger: "blur" },
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: this.$t('storeList.list.currencyRequired'),
|
|
|
+ trigger: "blur"
|
|
|
+ },
|
|
|
],
|
|
|
- },
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -642,18 +662,24 @@ export default {
|
|
|
},
|
|
|
// 状态修改
|
|
|
handleStatusChange(row) {
|
|
|
- let text = row.status == 'A' ? '启用' : '禁用'
|
|
|
- this.$modal
|
|
|
- .confirm('确认要' + text + '"' + row.name + '"店铺吗?')
|
|
|
- .then(function () {
|
|
|
- return updateStoreStatus(row.id, row.status)
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.$modal.msgSuccess(text + '成功')
|
|
|
- })
|
|
|
- .catch(function () {
|
|
|
- row.status = row.status === 'N' ? 'A' : 'N'
|
|
|
- })
|
|
|
+ // 根据状态获取对应的文本,使用 $t 函数从 i18n 中获取翻译
|
|
|
+ let text = row.status === 'A' ? this.$t('storeList.list.enabled') : this.$t('storeList.list.disabled');
|
|
|
+ // 从 i18n 中获取确认提示信息,并将店铺名称和操作文本动态插入
|
|
|
+ let confirmMsg = this.$t('storeList.list.confirmChangeStatus', { action: text, storeName: row.name });
|
|
|
+
|
|
|
+ this.$modal
|
|
|
+ .confirm(confirmMsg)
|
|
|
+ .then(() => {
|
|
|
+ return updateStoreStatus(row.id, row.status);
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ // 从 i18n 中获取操作成功的提示信息,并将操作文本动态插入
|
|
|
+ let successMsg = this.$t('storeList.list.statusChangeSuccess', { action: text });
|
|
|
+ this.$modal.msgSuccess(successMsg);
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ row.status = row.status === 'N' ? 'A' : 'N';
|
|
|
+ });
|
|
|
},
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
@@ -668,81 +694,82 @@ export default {
|
|
|
},
|
|
|
// 新增按钮操作
|
|
|
handleAdd() {
|
|
|
- this.reset()
|
|
|
- this.open = true
|
|
|
- this.title = '新增店铺'
|
|
|
+ this.reset();
|
|
|
+ this.open = true;
|
|
|
+ this.title = this.$t('storeList.list.addNewStore');
|
|
|
},
|
|
|
// 表单重置
|
|
|
reset() {
|
|
|
- this.form = {
|
|
|
- id: '',
|
|
|
- name: '',
|
|
|
- // logo: "",
|
|
|
- merchantId: this.$store.getters.merchantId,
|
|
|
- status: 'A'
|
|
|
- // isDefault: "N",
|
|
|
- // wxCertPath: "",
|
|
|
- }
|
|
|
- this.resetForm('form')
|
|
|
+ this.form = {
|
|
|
+ id: '',
|
|
|
+ name: '',
|
|
|
+ // logo: "",
|
|
|
+ merchantId: this.$store.getters.merchantId,
|
|
|
+ status: 'A'
|
|
|
+ // isDefault: "N",
|
|
|
+ // wxCertPath: "",
|
|
|
+ };
|
|
|
+ this.resetForm('form');
|
|
|
},
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
|
- this.open = false
|
|
|
- this.reset()
|
|
|
+ this.open = false;
|
|
|
+ this.reset();
|
|
|
},
|
|
|
// 提交按钮
|
|
|
submitForm: function () {
|
|
|
- this.$refs['form'].validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- if (this.form.id) {
|
|
|
- saveStore(this.form).then((response) => {
|
|
|
- this.$modal.msgSuccess('修改成功')
|
|
|
- this.open = false
|
|
|
- this.getList()
|
|
|
- })
|
|
|
- } else {
|
|
|
- saveStore(this.form).then((response) => {
|
|
|
- this.$modal.msgSuccess('新增成功')
|
|
|
- this.open = false
|
|
|
- this.getList()
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
+ this.$refs['form'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ if (this.form.id) {
|
|
|
+ saveStore(this.form).then((response) => {
|
|
|
+ this.$modal.msgSuccess(this.$t('storeList.list.modifySuccess'));
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ saveStore(this.form).then((response) => {
|
|
|
+ this.$modal.msgSuccess(this.$t('storeList.list.addSuccess'));
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
// 二维码
|
|
|
handleQrCode(row) {
|
|
|
- this.qr = { type: 'store', id: row.id }
|
|
|
- this.openQrCode = true
|
|
|
+ this.qr = { type: 'store', id: row.id };
|
|
|
+ this.openQrCode = true;
|
|
|
},
|
|
|
// 关闭二维码
|
|
|
closeDialog() {
|
|
|
- this.openQrCode = false
|
|
|
+ this.openQrCode = false;
|
|
|
},
|
|
|
// 修改按钮操作
|
|
|
handleUpdate(row) {
|
|
|
- this.reset()
|
|
|
- const id = row.id || this.ids
|
|
|
- getStoreInfo(id).then((response) => {
|
|
|
- this.form = response.data.storeInfo
|
|
|
- this.wxCertPath = this.form.wxCertPath
|
|
|
- this.open = true
|
|
|
- this.title = '编辑店铺'
|
|
|
- })
|
|
|
+ this.reset();
|
|
|
+ const id = row.id || this.ids;
|
|
|
+ getStoreInfo(id).then((response) => {
|
|
|
+ this.form = response.data.storeInfo;
|
|
|
+ this.wxCertPath = this.form.wxCertPath;
|
|
|
+ this.open = true;
|
|
|
+ this.title = this.$t('storeList.list.editStore');
|
|
|
+ });
|
|
|
},
|
|
|
// 删除按钮操作
|
|
|
handleDelete(row) {
|
|
|
- const name = row.name || this.id
|
|
|
- this.$modal
|
|
|
- .confirm('是否确认删除"' + name + '"的数据项?')
|
|
|
- .then(function () {
|
|
|
- return updateStoreStatus(row.id, 'D')
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.getList()
|
|
|
- this.$modal.msgSuccess('删除成功')
|
|
|
- })
|
|
|
- .catch(() => {})
|
|
|
+ const name = row.name || this.id;
|
|
|
+ const confirmMsg = this.$t('storeList.list.confirmDelete', { name });
|
|
|
+ this.$modal
|
|
|
+ .confirm(confirmMsg)
|
|
|
+ .then(() => {
|
|
|
+ return updateStoreStatus(row.id, 'D');
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.$modal.msgSuccess(this.$t('storeList.list.deleteSuccess'));
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
},
|
|
|
handleUploadSuccess(file) {
|
|
|
this.form.logo = file.data.fileName
|