Bladeren bron

Merge branch 'lyz_dev' of http://1.94.207.143:3000/chongqing/store-admin into lyz_dev

Mcal 1 week geleden
bovenliggende
commit
8b3fe14da2

+ 109 - 0
src/locales/en.json

@@ -462,6 +462,115 @@
       "passwordChangeSuccess": "Password changed successfully"
     }
   },
+  "goodList":{
+    "categoryName": "Category Name",
+    "pleaseEnterCategoryName": "Please Enter Category Name",
+    "belongingShop": "Belonging Shop",
+    "publicCategory": "Public Category",
+    "categoryId": "Category ID",
+    "Name": "Name",
+    "image": "Image",
+    "creationTime": "Creation Time",
+    "updateTime": "Update Time",
+    "actions": "Actions",
+    "sortOrder": "Sort Order",
+    "remarks": "Remarks",
+    "enable": "Enable",
+    "disable": "Disable",
+    "tipOrder": "Tip: The smaller the value, the higher the ranking",
+    "tipImage": "Tip: Click the image to modify, recommended size: 128 x 128",
+    "publicAll": "Public All",
+    "enterRemarkContent": "Please enter the remark content",
+    "addProductCategory": "Add Product Category",
+    "editProductCategory": "Edit Product Category",
+    "confirmDelete": "Are you sure you want to delete?",
+    "onlyImageAllowed": "Only image files can be uploaded for this data item!",
+    "imageSizeLimit": "The uploaded image size must not exceed 20MB!",
+    "addSuccess": "Add Successful",
+    "modificationSuccess": "Modification Successful",
+    "SaveSuccessful":"Save Successful",
+    "deleteSuccess": "Delete Successful",
+    "confirm": "Confirm",
+    "cancel": "Cancel",
+    "modify": "Modify",
+    "delete": "Delete",
+    "status": "Status",
+    "search": "Search",
+    "reset": "Reset",
+    "addNew": "Add New",
+    "edit":"edit",
+    "productName": "Product Name",
+    "productNamePlaceholder": "Please enter the product name",
+    "store": "Affiliated Stores",
+    "PublicGoods":"Public Goods",
+    "productCategory": "Product Category",
+    "selectCategory": "Please select product category",
+    "productType": "Product Type",
+    "selectProductType": "Please select product type",
+    "specificationType": "Specification Type",
+    "singleSpecification": "Single Specification",
+    "multipleSpecifications": "Multiple Specifications",
+    "shelfStatus": "Shelf Status",
+    "putOnShelf":"Put On Shelf",
+    "removeFromShelf": "Remove From Shelf",
+    "stockStatus": "Stock Status",
+    "inStock": "In Stock",
+    "outOfStock": "Out of Stock",
+    "id": "ID",
+    "storeName": "Store",
+    "mainImage": "Main Image",
+    "remainingStock": "Remaining Stock",
+    "category": "Category",
+    "price": "Price",
+    "displaySorting": "Display sorting",
+    "ProductStatus":"Product Status",
+    "ProductImage":"Product Image",
+    "hintSmallerValueHigherRank": "Hint: The smaller the value, the higher the rank",
+    "basicInfo": "Basic Information",
+    "extendedInfo": "Extended Information",
+    "productDescription": "Product Description",
+    "ProductSpecifications":"Product specifications",
+    "InventoryQuantity":"Inventory quantity",
+    "quantity":"Please enter the quantity in stock",
+    "commodityPrice":"commodity price",
+    "goodsPrice":"Please enter the price of the product",
+    "UnitYuan":"Unit:Yuan",
+    "ProductWeight":"Product weight",
+    "serviceDuration": "Service Duration",
+    "enterServiceDuration": "Please enter the service duration, unit: minutes",
+    "serviceDurationTip": "Tip: Enter numbers, unit: minutes",
+    "couponId": "Coupon ID",
+    "enterCouponId": "Please enter the purchased coupon IDs, separated by commas, e.g., 1000,1001,1002",
+    "couponIdTip": "Tip: Coupon IDs, separated by commas",
+    "Batch": "Batch Settings",
+    "skuNo": "SKU Code",
+    "randomGenerate": "Random Generate",
+    "linePrice": "Original Price",
+    "goodStock": "Stock",
+    "goodsWeight": "Weight",
+    "confirmSetting": "Confirm Settings",
+    "index": "Index",
+    "specifications": "Specifications",
+    "skuCode": "SKU Code",
+    "salesPrice": "Sales Price (Yuan)",
+    "originalPrice": "Original Price (Yuan)",
+    "stock": "Stock",
+    "weight": "Weight (kg)",
+    "addSpec": "Add Specification",
+    "specName": "Specification Name",
+    "specValue": "Specification Value",
+    "add": "Add",
+    "deleteSpec": "Delete Specification",
+    "enterSpecName": "Enter specification name",
+    "specNameRequired": "Specification name is required",
+    "enterSpecValue": "Enter specification value",
+    "addSpecValue": "Add Specification Value",
+    "specValueRequired": "Specification value is required",
+    "priceGreaterThanZero": "The product price must be greater than 0!",
+    "linePriceGreaterThanZero": "The product line price must be greater than or equal to 0!",
+    "weightGreaterThanZero": "The product weight must be greater than or equal to 0!",
+    "stockGreaterThanZero": "The product stock must be greater than or equal to 0!"
+  },
   "盼达点餐管理系统": "Panda ordering system",
   "Dashboard":"Dashboard",
   "订单管理": "Order Management",

+ 220 - 233
src/views/currency/list.vue

@@ -1,5 +1,5 @@
 <template>
-     <div class="app-container">
+  <div class="app-container">
     <el-form
       :model="queryParams"
       class="main-search"
@@ -19,12 +19,7 @@
         />
       </el-form-item>
       <el-form-item>
-        <el-button
-          type="primary"
-          icon="el-icon-search"
-          size="mini"
-          @click="handleQuery"
-        >
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">
           {{ $t('currency.search') }}
         </el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">
@@ -50,7 +45,11 @@
       :default-sort="defaultSort"
       @sort-change="handleSortChange"
     >
-      <el-table-column :label="$t('currency.ID')" prop="id" width="55" />
+      <el-table-column :label="$t('currency.ID')" prop="id" width="55">
+        <template slot-scope="scope">
+          <span>{{ showIdLastFour(scope.row.id) }}</span>
+        </template>
+      </el-table-column>
       <el-table-column :label="$t('currency.currencyName')" align="center" prop="name" />
       <el-table-column :label="$t('currency.currencySymbol')" align="center" prop="symbol" />
       <el-table-column
@@ -72,12 +71,7 @@
         class-name="small-padding fixed-width"
       >
         <template slot-scope="scope">
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-          >
+          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">
             {{ $t('currency.modify') }}
           </el-button>
         </template>
@@ -131,228 +125,221 @@
   </div>
 </template>
 
-  <script>
-  import FuintQrCode from "@/components/Fuint/QrCode";
-  import { getToken } from "@/utils/auth";
-  import {
-    getStoreList,
-    updateStoreStatus,
-    getStoreInfo,
-    saveStore,
-  } from "@/api/store";
-  import {saveCurrency,getCurrencyList,updateCurrency} from '@/api/currency'
-  export default {
-    name: "StoreList",
-    components: {
-      FuintQrCode,
-    },
-    data() {
-      return {
-        // 二维码
-        qr: null,
-        // 二维码对话框
-        openQrCode: false,
-        // 遮罩层
-        loading: true,
-        // 标题
-        title: "",
-        // 选中数组
-        ids: [],
-        // 非多个禁用
-        multiple: true,
-        // 显示搜索条件
-        showSearch: true,
-        // 总条数
-        total: 0,
-        // 表格数据
-        list: [],
-        // 是否显示弹出层
-        open: false,
-        // 日期范围
-        dateRange: [],
-        // 默认排序
-        defaultSort: { prop: "operTime", order: "descending" },
-        // 表单参数
-        form: {
-          name: "",
-          symbol:''
-        },
-        // 微信支付证书
-        wxCertPath: "",
-        // 上传地址
-        uploadAction: process.env.VUE_APP_SERVER_URL + "/backendApi/file/upload",
-        // 隐藏上传
-        hideUpload: false,
-        // 上传文件列表
-        uploadFiles: [],
-        uploadHeader: { "Access-Token": getToken() },
-        merchantOptions: [],
-        // 图片根目录
-        imagePath: "",
-        // 查询参数
-        queryParams: {
-          page: 1,
-          pageSize: 10,
-          name: "",
-        },
-        // 表单校验
-        rules: {
-          name: [
-              {
-                  required: true,
-                  message: this.$t('currency.currencyNameRequired'),
-                  trigger: "blur"
-              }
-          ],
-          symbol: [
-              {
-                  required: true,
-                  message: this.$t('currency.currencySymbolRequired'),
-                  trigger: "blur"
-              }
-          ]
-        },
-      };
-    },
-    created() {
-      this.getList();
-    },
-    methods: {
-      // 查询列表
-      getList() {
-          this.loading = true;
-          getCurrencyList(this.queryParams).then(
-              (response) => {
-                  console.log('res;', response);
-                  this.list = response.data;
-                  this.total = response.total;
-                  this.loading = false;
-              }
-          );
-      },
-      // 搜索按钮操作
-      handleQuery() {
-          this.queryParams.page = 1;
-          this.getList();
-      },
-      // 重置按钮操作
-      resetQuery() {
-          this.dateRange = [];
-          this.resetForm("queryForm");
-          this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order);
-          this.handleQuery();
-      },
-      // 状态修改
-      handleStatusChange(row) {
-          let text = row.status === "A" ? this.$t('currency.enable') : this.$t('currency.disable');
-          const confirmMsg = this.$t('currency.confirmChangeStatus', { action: text, name: row.name });
-          this.$modal
-            .confirm(confirmMsg)
-            .then(() => {
-                  return updateStoreStatus(row.id, row.status);
-              })
-            .then(() => {
-                  const successMsg = this.$t('currency.statusChangeSuccess', { action: text });
-                  this.$modal.msgSuccess(successMsg);
-              })
-            .catch(() => {
-                  row.status = row.status === "N" ? "A" : "N";
-              });
-      },
-      // 多选框选中数据
-      handleSelectionChange(selection) {
-          this.ids = selection.map((item) => item.operId);
-          this.multiple = !selection.length;
-      },
-      // 排序触发事件
-      handleSortChange(column, prop, order) {
-          this.queryParams.orderByColumn = column.prop;
-          this.queryParams.isAsc = column.order;
-          this.getList();
-      },
-      // 新增按钮操作
-      handleAdd() {
-          this.reset();
-          this.open = true;
-          this.title = this.$t('currency.addNewCurrency');
-      },
-      // 表单重置
-      reset() {
-          this.form = {
-              id: "",
-              name: "",
-              symbol: ''
-          };
-          this.resetForm("form");
-      },
-      // 取消按钮
-      cancel() {
-          this.open = false;
-          this.reset();
-      },
-      // 提交按钮
-      submitForm: function () {
-          this.$refs["form"].validate((valid) => {
-              if (valid) {
-                  if (this.form.id) {
-                      updateCurrency(this.form).then((response) => {
-                          this.$modal.msgSuccess(this.$t('currency.modifySuccess'));
-                          this.open = false;
-                          this.getList();
-                      });
-                  } else {
-                      saveCurrency(this.form).then(response => {
-                          this.$modal.msgSuccess(this.$t('currency.addSuccess'));
-                          this.open = false;
-                          this.getList();
-                      });
-                  }
-              }
-          });
-      },
+<script>
+import FuintQrCode from '@/components/Fuint/QrCode'
+import { getToken } from '@/utils/auth'
+import { updateStoreStatus } from '@/api/store'
+import { saveCurrency, getCurrencyList, updateCurrency } from '@/api/currency'
+export default {
+  name: 'StoreList',
+  components: {
+    FuintQrCode
+  },
+  data() {
+    return {
       // 二维码
-      handleQrCode(row) {
-          this.qr = { type: "store", id: row.id };
-          this.openQrCode = true;
-      },
-      // 关闭二维码
-      closeDialog() {
-          this.openQrCode = false;
+      qr: null,
+      // 二维码对话框
+      openQrCode: false,
+      // 遮罩层
+      loading: true,
+      // 标题
+      title: '',
+      // 选中数组
+      ids: [],
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 表格数据
+      list: [],
+      // 是否显示弹出层
+      open: false,
+      // 日期范围
+      dateRange: [],
+      // 默认排序
+      defaultSort: { prop: 'operTime', order: 'descending' },
+      // 表单参数
+      form: {
+        name: '',
+        symbol: ''
       },
-      // 修改按钮操作
-      handleUpdate(row) {
-          this.reset();
-          this.title = this.$t('currency.editCurrency');
-          this.open = true;
-          const { id, name, symbol } = row;
-          this.form = { id, name, symbol };
+      // 微信支付证书
+      wxCertPath: '',
+      // 上传地址
+      uploadAction: process.env.VUE_APP_SERVER_URL + '/backendApi/file/upload',
+      // 隐藏上传
+      hideUpload: false,
+      // 上传文件列表
+      uploadFiles: [],
+      uploadHeader: { 'Access-Token': getToken() },
+      merchantOptions: [],
+      // 图片根目录
+      imagePath: '',
+      // 查询参数
+      queryParams: {
+        page: 1,
+        pageSize: 10,
+        name: ''
       },
-      handleUploadSuccess(file) {
-          this.form.logo = file.data.fileName;
-      },
-      handleUploadLicenseSuccess(file) {
-          this.form.license = file.data.fileName;
-      },
-      handleUploadCertSuccess(file) {
-          this.form.wxCertPath = file.data.fileName;
-          this.wxCertPath = file.data.fileName;
+      // 表单校验
+      rules: {
+        name: [
+          {
+            required: true,
+            message: this.$t('currency.currencyNameRequired'),
+            trigger: 'blur'
+          }
+        ],
+        symbol: [
+          {
+            required: true,
+            message: this.$t('currency.currencySymbolRequired'),
+            trigger: 'blur'
+          }
+        ]
       }
     }
-  };
-  </script>
-  <style scoped>
-  .common-dialog >>> .el-upload--picture-card {
-    width: 60px;
-    height: 50px;
-    line-height: 60px;
-  }
-  .upload-cert >>> .el-upload {
-    width: 20px;
-    height: 20px;
-    line-height: 20px;
-  }
-  .upload-cert .file-name {
-    width: 700px;
-    text-align: left;
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    // 查询列表
+    getList() {
+      this.loading = true
+      getCurrencyList(this.queryParams).then((response) => {
+        console.log('res;', response)
+        this.list = response.data
+        this.total = response.total
+        this.loading = false
+      })
+    },
+    // 搜索按钮操作
+    handleQuery() {
+      this.queryParams.page = 1
+      this.getList()
+    },
+    // 重置按钮操作
+    resetQuery() {
+      this.dateRange = []
+      this.resetForm('queryForm')
+      this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order)
+      this.handleQuery()
+    },
+    // 状态修改
+    handleStatusChange(row) {
+      let text = row.status === 'A' ? this.$t('currency.enable') : this.$t('currency.disable')
+      const confirmMsg = this.$t('currency.confirmChangeStatus', { action: text, name: row.name })
+      this.$modal
+        .confirm(confirmMsg)
+        .then(() => {
+          return updateStoreStatus(row.id, row.status)
+        })
+        .then(() => {
+          const successMsg = this.$t('currency.statusChangeSuccess', { action: text })
+          this.$modal.msgSuccess(successMsg)
+        })
+        .catch(() => {
+          row.status = row.status === 'N' ? 'A' : 'N'
+        })
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map((item) => item.operId)
+      this.multiple = !selection.length
+    },
+    // 排序触发事件
+    handleSortChange(column, prop, order) {
+      this.queryParams.orderByColumn = column.prop
+      this.queryParams.isAsc = column.order
+      this.getList()
+    },
+    // 新增按钮操作
+    handleAdd() {
+      this.reset()
+      this.open = true
+      this.title = this.$t('currency.addNewCurrency')
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: '',
+        name: '',
+        symbol: ''
+      }
+      this.resetForm('form')
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false
+      this.reset()
+    },
+    // 提交按钮
+    submitForm: function () {
+      this.$refs['form'].validate((valid) => {
+        if (valid) {
+          if (this.form.id) {
+            updateCurrency(this.form).then((response) => {
+              this.$modal.msgSuccess(this.$t('currency.modifySuccess'))
+              this.open = false
+              this.getList()
+            })
+          } else {
+            saveCurrency(this.form).then((response) => {
+              this.$modal.msgSuccess(this.$t('currency.addSuccess'))
+              this.open = false
+              this.getList()
+            })
+          }
+        }
+      })
+    },
+    // 二维码
+    handleQrCode(row) {
+      this.qr = { type: 'store', id: row.id }
+      this.openQrCode = true
+    },
+    // 关闭二维码
+    closeDialog() {
+      this.openQrCode = false
+    },
+    // 修改按钮操作
+    handleUpdate(row) {
+      this.reset()
+      this.title = this.$t('currency.editCurrency')
+      this.open = true
+      const { id, name, symbol } = row
+      this.form = { id, name, symbol }
+    },
+    handleUploadSuccess(file) {
+      this.form.logo = file.data.fileName
+    },
+    handleUploadLicenseSuccess(file) {
+      this.form.license = file.data.fileName
+    },
+    handleUploadCertSuccess(file) {
+      this.form.wxCertPath = file.data.fileName
+      this.wxCertPath = file.data.fileName
+    }
   }
-  </style>
+}
+</script>
+<style scoped>
+.common-dialog >>> .el-upload--picture-card {
+  width: 60px;
+  height: 50px;
+  line-height: 60px;
+}
+.upload-cert >>> .el-upload {
+  width: 20px;
+  height: 20px;
+  line-height: 20px;
+}
+.upload-cert .file-name {
+  width: 700px;
+  text-align: left;
+}
+</style>

+ 67 - 43
src/views/goods/cate/index.vue

@@ -9,23 +9,28 @@
       v-show="showSearch"
       label-width="68px"
     >
-      <el-form-item label="分类名称" prop="name">
+      <el-form-item :label="$t('goodList.categoryName')" prop="name">
         <el-input
           v-model="queryParams.name"
-          placeholder="请输入分类名称"
+          :placeholder="$t('goodList.pleaseEnterCategoryName')"
           clearable
           style="width: 240px"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="所属店铺" prop="store">
+      <el-form-item :label="$t('goodList.belongingShop')" prop="store">
         <el-select
           v-model="queryParams.storeId"
-          placeholder="所属店铺"
+          :placeholder="$t('goodList.belongingShop')"
           clearable
           style="width: 180px"
         >
-          <el-option :key="0" label="公共分类" v-if="!this.$store.getters.storeId" :value="0" />
+          <el-option
+            :key="0"
+            :label="$t('goodList.publicCategory')"
+            v-if="!this.$store.getters.storeId"
+            :value="0"
+          />
           <el-option
             v-for="storeInfo in storeOptions"
             :key="storeInfo.id"
@@ -34,17 +39,24 @@
           />
         </el-select>
       </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-form-item :label="$t('goodList.status')" prop="status">
+        <el-select
+          v-model="queryParams.status"
+          :placeholder="$t('goodList.status')"
+          clearable
+          style="width: 240px"
+        >
+          <el-option key="A" :label="$t('goodList.enable')" value="A" />
+          <el-option key="N" :label="$t('goodList.disable')" value="N" />
         </el-select>
       </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">
-          搜索
+          {{ $t('goodList.search') }}
+        </el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">
+          {{ $t('goodList.reset') }}
         </el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
         <el-button
           type="primary"
           plain
@@ -53,7 +65,7 @@
           @click="handleAdd"
           v-hasPermi="['goods:cate:index']"
         >
-          新增
+          {{ $t('goodList.addNew') }}
         </el-button>
       </el-form-item>
     </el-form>
@@ -66,31 +78,35 @@
       :default-sort="defaultSort"
       @sort-change="handleSortChange"
     >
-      <el-table-column label="分类ID" prop="id" width="66" />
-      <el-table-column label="所属店铺" align="center">
+      <el-table-column :label="$t('goodList.categoryId')" prop="id" width="80">
+        <template slot-scope="scope">
+          <span>{{ showIdLastFour(scope.row.id) }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column :label="$t('goodList.belongingShop')" align="center">
         <template slot-scope="scope">
           <span v-if="scope.row.storeName">{{ scope.row.storeName }}</span>
-          <span v-else>公共所有</span>
+          <span v-else>{{ $t('goodList.publicAll') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="名称" align="center" prop="name" />
-      <el-table-column label="图片" align="center" width="200">
+      <el-table-column :label="$t('goodList.Name')" align="center" prop="name" />
+      <el-table-column :label="$t('goodList.image')" align="center" width="200">
         <template slot-scope="scope">
           <!-- imagePath +  -->
           <img class="list-img" :src="scope.row.logo" />
         </template>
       </el-table-column>
-      <el-table-column label="创建时间" align="center" prop="createTime">
+      <el-table-column :label="$t('goodList.creationTime')" align="center" prop="createTime">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.createTime) }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="更新时间" align="center" prop="updateTime">
+      <el-table-column :label="$t('goodList.updateTime')" align="center" prop="updateTime">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.updateTime) }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="状态" align="center" prop="status">
+      <el-table-column :label="$t('goodList.status')" align="center" prop="status">
         <template slot-scope="scope">
           <el-switch
             v-model="scope.row.status"
@@ -100,7 +116,11 @@
           ></el-switch>
         </template>
       </el-table-column>
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+      <el-table-column
+        :label="$t('goodList.actions')"
+        align="center"
+        class-name="small-padding fixed-width"
+      >
         <template slot-scope="scope">
           <el-button
             size="mini"
@@ -110,7 +130,7 @@
             v-if="storeId == scope.row.storeId || storeId == 0"
             @click="handleUpdate(scope.row)"
           >
-            修改
+            {{ $t('goodList.modify') }}
           </el-button>
           <el-button
             size="mini"
@@ -120,7 +140,7 @@
             v-if="storeId == scope.row.storeId || storeId == 0"
             @click="handleDelete(scope.row)"
           >
-            删除
+            {{ $t('goodList.delete') }}
           </el-button>
         </template>
       </el-table-column>
@@ -145,8 +165,12 @@
       <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="200" />
+            <el-form-item :label="$t('goodList.categoryName')" prop="name">
+              <el-input
+                v-model="form.name"
+                :placeholder="$t('goodList.pleaseEnterCategoryName')"
+                maxlength="200"
+              />
             </el-form-item>
           </el-col>
         </el-row>
@@ -179,15 +203,15 @@
         </el-row> -->
         <el-row>
           <el-col :span="24">
-            <el-form-item label="排序" prop="sort">
+            <el-form-item :label="$t('goodList.sortOrder')" prop="sort">
               <el-input-number v-model="form.sort" :min="0" />
-              <div class="form-tips">提示:数值越小,排行越靠前</div>
+              <div class="form-tips">{{ $t('goodList.tipOrder') }}</div>
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
           <el-col :span="9">
-            <el-form-item label="图片" prop="image">
+            <el-form-item :label="$t('goodList.image')" prop="image">
               <el-upload
                 :action="uploadAction"
                 :before-upload="beforeUpload"
@@ -205,33 +229,33 @@
               </el-upload>
             </el-form-item>
           </el-col>
-          <p class="form-tips">(提示:点击图片修改,建议尺寸:128 x 128)</p>
+          <p class="form-tips">{{ $t('goodList.tipImage') }}</p>
         </el-row>
         <el-row>
           <el-col :span="24">
-            <el-form-item label="备注信息">
+            <el-form-item :label="$t('goodList.remarks')">
               <el-input
                 v-model="form.description"
                 type="textarea"
-                placeholder="请输入内容"
+                :placeholder="$t('goodList.enterRemarkContent')"
               ></el-input>
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
           <el-col :span="24">
-            <el-form-item label="状态">
+            <el-form-item :label="$t('goodList.status')">
               <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 key="A" label="A" value="A">{{ $t('goodList.enable') }}</el-radio>
+                <el-radio key="N" label="N" value="N">{{ $t('goodList.disable') }}</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>
+        <el-button type="primary" @click="submitForm">{{ $t('goodList.confirm') }}</el-button>
+        <el-button @click="cancel">{{ $t('goodList.cancel') }}</el-button>
       </div>
     </el-dialog>
   </div>
@@ -367,7 +391,7 @@ export default {
     handleAdd() {
       this.reset()
       this.open = true
-      this.title = '新增商品分类'
+      this.title = this.$t('goodList.addProductCategory')
     },
     // 表单重置
     reset() {
@@ -397,13 +421,13 @@ export default {
           }
           if (this.form.id) {
             saveGoodsCate(this.form).then((response) => {
-              this.$modal.msgSuccess('修改成功')
+              this.$modal.msgSuccess(this.$t('goodList.modificationSuccess'))
               this.open = false
               this.getList()
             })
           } else {
             saveGoodsCate(this.form).then((response) => {
-              this.$modal.msgSuccess('新增成功')
+              this.$modal.msgSuccess(this.$t('goodList.addSuccess'))
               this.open = false
               this.getList()
             })
@@ -419,7 +443,7 @@ export default {
         this.form = response.data.cateInfo
         this.uploadFiles = [{ url: response.data.imagePath + this.form.logo, status: 'finished' }]
         this.open = true
-        this.title = '编辑商品分类'
+        this.title = this.$t('goodList.editProductCategory')
       })
     },
     // 删除按钮操作
@@ -432,7 +456,7 @@ export default {
         })
         .then(() => {
           this.getList()
-          this.$modal.msgSuccess('删除成功')
+          this.$modal.msgSuccess(this.$t('goodList.deleteSuccess'))
         })
         .catch(() => {})
     },
@@ -444,11 +468,11 @@ export default {
       console.log(file.size)
 
       if (!isImage) {
-        this.$message.error('只能上传图片文件!')
+        this.$message.error(this.$t('goodList.onlyImageAllowed'))
       }
 
       if (!isLt2M) {
-        this.$message.error('上传图片大小不能超过 20MB!')
+        this.$message.error(this.$t('goodList.imageSizeLimit'))
       }
 
       return isImage && isLt2M // 返回 true 则允许上传,返回 false 则阻止上传

+ 36 - 33
src/views/goods/components/Sku.vue

@@ -2,7 +2,7 @@
   <div class="sku-list">
     <template v-if="!disabled">
       <div class="sku-list-head">
-        <el-button type="primary" size="mini" @click="addSkuRow">添加规格</el-button
+        <el-button type="primary" size="mini" @click="addSkuRow">{{$t('goodList.addSpec')}}</el-button
         >
       </div>
       <div
@@ -12,7 +12,7 @@
       >
         <div class="sku-list-item-main">
           <div class="sku-list-item__layout">
-            <span class="span">规格名</span>
+            <span class="span">{{$t('goodList.specName')}}</span>
             <el-input
               size="small"
               v-model="item.name"
@@ -20,7 +20,7 @@
             ></el-input>
           </div>
           <div class="sku-list-item__layout">
-            <span class="span">规格值</span>
+            <span class="span">{{$t('goodList.specValue')}}</span>
             <div class="sku-list-item-tags">
               <el-tag
                 class="sku-list-item-tag"
@@ -35,7 +35,7 @@
                 size="small"
                 icon="el-icon-plus"
                 @click="addSkuAttr(index)"
-              >添加</el-button
+              >{{$t('goodList.add')}}</el-button
               >
             </div>
           </div>
@@ -45,29 +45,30 @@
           size="small"
           class="sku-list-item-removeBtn"
           @click="removeSkuRow(index)"
-        >删除规格</el-button
+        >{{$t('goodList.deleteSpec')}}</el-button
         >
       </div>
     </template>
 
     <div class="batch-setting">
-      <span class="label">批量设置</span>
-      <el-input size="small" v-model="batch.skuNo" placeholder="sku编码" class="input input-sn"></el-input>
-      <span class="create-sn" @click="createGoodsSn()">随机生成</span>
-      <el-input size="small" v-model="batch.price" placeholder="商品价格" class="input"></el-input>
-      <el-input size="small" v-model="batch.linePrice" placeholder="划线价格" class="input"></el-input>
-      <el-input size="small" v-model="batch.stock" placeholder="商品库存" class="input"></el-input>
-      <el-input size="small" v-model="batch.weight" placeholder="商品重量" class="input"></el-input>
-      <el-button size="small" type="danger" class="button" @click="batchSetSku()">确认设置</el-button>
+      <span class="label">{{ $t('goodList.Batch') }}</span>
+      <el-input size="small" v-model="batch.skuNo" :placeholder="$t('goodList.skuNo')" class="input input-sn"></el-input>
+      <span class="create-sn" @click="createGoodsSn()">{{ $t('goodList.randomGenerate') }}</span>
+      <el-input size="small" v-model="batch.price" :placeholder="$t('goodList.commodityPrice')" class="input"></el-input>
+      <el-input size="small" v-model="batch.linePrice" :placeholder="$t('goodList.linePrice')" class="input"></el-input>
+      <el-input size="small" v-model="batch.stock" :placeholder="$t('goodList.goodStock')" class="input"></el-input>
+      <el-input size="small" v-model="batch.weight" :placeholder="$t('goodList.weight')" class="input"></el-input>
+      <el-button size="small" type="danger" class="button" @click="batchSetSku()">{{ $t('goodList.confirmSetting') }}</el-button>
     </div>
 
+
     <el-table border :data="skuData.skuList">
-      <el-table-column label="序号" align="center" width="60">
+      <el-table-column :label="$t('goodList.index')" align="center" width="60">
         <template slot-scope="scope">
           <span>{{ scope.$index + 1 }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="图片" align="center" width="120">
+      <el-table-column :label="$t('goodList.image')" align="center" width="120">
         <template slot-scope="scope">
           <el-upload
             :disabled="disabled"
@@ -77,8 +78,7 @@
             :headers="uploadHeader"
             :file-list="[]"
             :limit="1"
-            :on-success="function(file) {
-               return onUploadImgSuccess(file, scope.$index) }"
+            :on-success="function(file) { return onUploadImgSuccess(file, scope.$index) }"
             :show-file-list="false"
           >
             <img
@@ -90,12 +90,14 @@
           </el-upload>
         </template>
       </el-table-column>
-      <el-table-column label="规格" align="center">
+      <el-table-column :label="$t('goodList.specifications')" align="center">
         <template slot-scope="scope">
-          <div class="spec-tag" v-for="spec in scope.row.specList"><span class="i">{{ spec.value }}</span></div>
+          <div class="spec-tag" v-for="spec in scope.row.specList">
+            <span class="i">{{ spec.value }}</span>
+          </div>
         </template>
       </el-table-column>
-      <el-table-column label="sku编码" align="center" width="160">
+      <el-table-column :label="$t('goodList.skuCode')" align="center" width="160">
         <template slot-scope="scope">
           <el-input
             :readonly="disabled"
@@ -103,7 +105,7 @@
           ></el-input>
         </template>
       </el-table-column>
-      <el-table-column label="销售价格(元)" align="center">
+      <el-table-column :label="$t('goodList.salesPrice')" align="center">
         <template slot-scope="scope">
           <el-input
             :readonly="disabled"
@@ -111,7 +113,7 @@
           ></el-input>
         </template>
       </el-table-column>
-      <el-table-column label="划线价格(元)" align="center">
+      <el-table-column :label="$t('goodList.originalPrice')" align="center">
         <template slot-scope="scope">
           <el-input
             :readonly="disabled"
@@ -119,17 +121,18 @@
           ></el-input>
         </template>
       </el-table-column>
-      <el-table-column label="商品库存" align="center">
+      <el-table-column :label="$t('goodList.stock')" align="center">
         <template slot-scope="scope">
           <el-input :readonly="disabled" v-model="scope.row.stock"></el-input>
         </template>
       </el-table-column>
-      <el-table-column label="重量(千克)" align="center">
+      <el-table-column :label="$t('goodList.weight')" align="center">
         <template slot-scope="scope">
           <el-input :readonly="disabled" v-model="scope.row.weight"></el-input>
         </template>
-      </el-table-column>
+  </el-table-column>
     </el-table>
+
   </div>
 </template>
 
@@ -183,11 +186,11 @@ export default {
   methods: {
     // 添加规格行
     addSkuRow(i) {
-      this.$prompt("请输入规格名称", "添加规格", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
+      this.$prompt(this.$t('goodList.enterSpecName'), this.$t('goodList.addSpec'), {
+        confirmButtonText: this.$t('goodList.confirm'),
+        cancelButtonText: this.$t('goodList.cancel'),
         inputPattern: /\S+/,
-        inputErrorMessage: "规格名称不能为空",
+        inputErrorMessage: this.$t('goodList.specNameRequired'),
         closeOnClickModal: false,
       }).then(({ value }) => {
           saveSpecName({ goodsId: this.goodsId, name: value }).then(response => {
@@ -222,11 +225,11 @@ export default {
     },
     // 添加规格属性值
     addSkuAttr(i) {
-      this.$prompt("请输入规格值", "添加规格值", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
+      this.$prompt(this.$t('goodList.enterSpecValue'), this.$t('goodList.addSpecValue'), {
+        confirmButtonText: this.$t('goodList.confirm'),
+        cancelButtonText: this.$t('goodList.cancel'),
         inputPattern: /\S+/,
-        inputErrorMessage: "规格值不能为空",
+        inputErrorMessage:this.$t('goodList.specValueRequired'),
         closeOnClickModal: false,
       }).then(({ value }) => {
           saveSpecValue({ goodsId: this.goodsId, specName: this.skuData.attrList[i].name, value: value }).then(response => {

+ 35 - 34
src/views/goods/goods/goodsForm.vue

@@ -2,7 +2,7 @@
   <div class="app-container">
     <div class="main-panel">
       <el-tabs v-model="activeTab" @tab-click="handleTabClick">
-        <el-tab-pane label="基础信息" name="base">
+        <el-tab-pane :label="$t('goodList.basicInfo')" name="base">
           <div class="content">
             <el-form ref="baseForm" :model="baseForm" :rules="baseRules" label-width="120px">
               <!-- <el-row>
@@ -21,11 +21,11 @@
               </el-row> -->
               <el-row>
                 <el-col :span="24">
-                  <el-form-item label="商品名称" prop="name">
+                  <el-form-item :label="$t('goodList.productName')" prop="name">
                     <el-input
                       class="input"
                       v-model="baseForm.name"
-                      placeholder="请输入商品名称"
+                      :placeholder="$t('goodList.productNamePlaceholder')"
                       maxlength="200"
                     />
                   </el-form-item>
@@ -46,8 +46,8 @@
               </el-row> -->
               <el-row>
                 <el-col :span="24">
-                  <el-form-item label="商品分类" prop="cateId">
-                    <el-select class="input" v-model="baseForm.cateId" placeholder="请选择商品分类">
+                  <el-form-item :label="$t('goodList.productCategory')" prop="cateId">
+                    <el-select class="input" v-model="baseForm.cateId" :placeholder="$t('goodList.selectCategory')">
                       <el-option
                         v-for="item in cateOptions"
                         :key="item.id"
@@ -83,7 +83,7 @@
               </el-row> -->
               <el-row>
                 <el-col :span="24">
-                  <el-form-item label="商品图片" prop="images">
+                  <el-form-item :label="$t('goodList.ProductImage')" prop="images">
                     <el-upload
                       class="form__head-icon-upload"
                       :action="uploadAction"
@@ -105,18 +105,18 @@
               </el-row>
               <el-row>
                 <el-col :span="24">
-                  <el-form-item label="显示排序" prop="sort">
+                  <el-form-item :label="$t('goodList.displaySorting')" prop="sort">
                     <el-input-number v-model="baseForm.sort" :min="0" />
-                    <div class="form-tips">提示:数值越小,排行越靠前</div>
+                    <div class="form-tips">{{$t('goodList.hintSmallerValueHigherRank')}}</div>
                   </el-form-item>
                 </el-col>
               </el-row>
               <el-row>
                 <el-col :span="24">
-                  <el-form-item label="商品状态">
+                  <el-form-item :label="$t('goodList.ProductStatus')">
                     <el-radio-group v-model="baseForm.status">
-                      <el-radio key="A" label="A" value="A">上架</el-radio>
-                      <el-radio key="N" label="N" value="N">下架</el-radio>
+                      <el-radio key="A" label="A" value="A">{{$t('goodList.putOnShelf')}}</el-radio>
+                      <el-radio key="N" label="N" value="N">{{$t('goodList.removeFromShelf')}}</el-radio>
                     </el-radio-group>
                   </el-form-item>
                 </el-col>
@@ -124,7 +124,7 @@
             </el-form>
           </div>
         </el-tab-pane>
-        <el-tab-pane label="扩展信息" name="extend">
+        <el-tab-pane :label="$t('goodList.extendedInfo')" name="extend">
           <div class="content">
             <el-form ref="extendForm" :model="extendForm" :rules="extendRules" label-width="120px">
               <!-- <el-row>
@@ -149,10 +149,10 @@
               </el-row> -->
               <el-row>
                 <el-col :span="24">
-                  <el-form-item label="规格类型" prop="isSingleSpec">
+                  <el-form-item :label="$t('goodList.specificationType')" prop="isSingleSpec">
                     <el-radio-group v-model="extendForm.isSingleSpec">
-                      <el-radio key="Y" label="Y" value="Y">单规格</el-radio>
-                      <el-radio key="N" label="N" value="N">多规格</el-radio>
+                      <el-radio key="Y" label="Y" value="Y">{{$t('goodList.singleSpecification')}}</el-radio>
+                      <el-radio key="N" label="N" value="N">{{$t('goodList.multipleSpecifications')}}</el-radio>
                     </el-radio-group>
                   </el-form-item>
                 </el-col>
@@ -160,7 +160,7 @@
 
               <el-row v-if="extendForm.isSingleSpec == 'N'">
                 <el-col :span="24">
-                  <el-form-item label="商品规格" prop="goodsSpec">
+                  <el-form-item :label="$t('goodList.ProductSpecifications')" prop="goodsSpec">
                     <Sku
                       ref="Sku"
                       :skuData="skuData"
@@ -174,41 +174,42 @@
 
               <el-row v-if="baseForm.type == 'service'">
                 <el-col :span="24">
-                  <el-form-item label="服务时长" prop="serviceTime">
+                  <el-form-item :label="$t('goodList.serviceDuration')" prop="serviceTime">
                     <el-input
                       v-model="extendForm.serviceTime"
                       class="min-input"
-                      placeholder="请输入服务时长,单位:分钟"
+                      :placeholder="$t('goodList.enterServiceDuration')"
                       maxlength="50"
                     />
-                    <div class="form-tips">提示:输入数字,单位:分钟</div>
+                    <div class="form-tips">{{ $t('goodList.serviceDurationTip') }}</div>
                   </el-form-item>
                 </el-col>
               </el-row>
 
               <el-row v-if="baseForm.type == 'coupon'">
                 <el-col :span="24">
-                  <el-form-item label="卡券ID" prop="couponIds">
+                  <el-form-item :label="$t('goodList.couponId')" prop="couponIds">
                     <el-input
                       v-model="extendForm.couponIds"
                       class="input"
                       rows="2"
                       type="textarea"
-                      placeholder="请输入购买的卡券ID,英文逗号分隔,如:1000,1001,1002"
+                      :placeholder="$t('goodList.enterCouponId')"
                       maxlength="1000"
                     />
-                    <div class="form-tips">提示:购买的卡券ID,英文逗号分隔</div>
+                    <div class="form-tips">{{ $t('goodList.couponIdTip') }}</div>
                   </el-form-item>
                 </el-col>
               </el-row>
 
+
               <el-row v-if="extendForm.isSingleSpec == 'Y'">
                 <el-col :span="24">
-                  <el-form-item label="库存数量" prop="stock">
+                  <el-form-item :label="$t('goodList.InventoryQuantity')" prop="stock">
                     <el-input
                       v-model="extendForm.stock"
                       class="min-input"
-                      placeholder="请输入库存数量"
+                      :placeholder="$t('goodList.quantity')"
                       maxlength="50"
                     />
                   </el-form-item>
@@ -217,14 +218,14 @@
 
               <el-row v-if="extendForm.isSingleSpec == 'Y'">
                 <el-col :span="24">
-                  <el-form-item label="商品价格" prop="price">
+                  <el-form-item :label="$t('goodList.commodityPrice')" prop="price">
                     <el-input
                       v-model="extendForm.price"
                       class="min-input"
-                      placeholder="请输入商品价格"
+                      :placeholder="$t('goodList.goodsPrice')"
                       maxlength="50"
                     />
-                    <div class="form-tips">单位:元</div>
+                    <div class="form-tips">{{$t('goodList.UnitYuan')}}</div>
                   </el-form-item>
                 </el-col>
               </el-row>
@@ -256,7 +257,7 @@
               </el-row> -->
               <el-row v-if="extendForm.isSingleSpec == 'Y' && baseForm.type == 'product'">
                 <el-col :span="24">
-                  <el-form-item label="商品重量" prop="weight">
+                  <el-form-item :label="$t('goodList.ProductWeight')" prop="weight">
                     <el-input
                       v-model="extendForm.weight"
                       class="min-input"
@@ -282,7 +283,7 @@
             </el-form>
           </div>
         </el-tab-pane>
-        <el-tab-pane label="商品介绍" name="detail">
+        <el-tab-pane :label="$t('goodList.productDescription')" name="detail">
           <div class="content" style="width: 375px; margin-left: 80px">
             <el-form ref="detailForm" :model="detailForm" :rules="detailRules" label-width="120px">
               <editor v-model="detailForm.description" :min-height="550" />
@@ -291,8 +292,8 @@
         </el-tab-pane>
       </el-tabs>
       <div slot="footer" class="footer">
-        <el-button type="primary" @click="submitForm">确定</el-button>
-        <el-button @click="cancel">取消</el-button>
+        <el-button type="primary" @click="submitForm">{{$t('goodList.confirm')}}</el-button>
+        <el-button @click="cancel">{{$t('goodList.cancel')}}</el-button>
       </div>
     </div>
   </div>
@@ -481,7 +482,7 @@ export default {
         app.$refs['baseForm'].validate((valid) => {
           if (valid) {
             saveGoods(app.baseForm).then((response) => {
-              app.$modal.msgSuccess('保存成功!')
+              app.$modal.msgSuccess(this.$t('goodList.SaveSuccessful'))
               app.getGoodsInfo(response.data.goodsInfo.id)
             })
           }
@@ -527,7 +528,7 @@ export default {
         app.$refs['extendForm'].validate((valid) => {
           if (valid) {
             saveGoods(app.extendForm).then((response) => {
-              app.$modal.msgSuccess('保存成功!')
+              app.$modal.msgSuccess(this.$t('goodList.SaveSuccessful'))
               app.getGoodsInfo(response.data.goodsInfo.id)
             })
           }
@@ -541,7 +542,7 @@ export default {
         app.$refs['detailForm'].validate((valid) => {
           if (valid) {
             saveGoods(app.detailForm).then((response) => {
-              app.$modal.msgSuccess('保存成功!')
+              app.$modal.msgSuccess(this.$t('goodList.SaveSuccessful'))
               app.getGoodsInfo(response.data.goodsInfo.id)
             })
           }

+ 69 - 38
src/views/goods/goods/index.vue

@@ -9,23 +9,23 @@
       v-show="showSearch"
       label-width="68px"
     >
-      <el-form-item label="商品名称" prop="name">
+      <el-form-item :label="$t('goodList.productName')" prop="name">
         <el-input
           v-model="queryParams.name"
-          placeholder="请输入商品名称"
+          :placeholder="$t('goodList.productNamePlaceholder')"
           clearable
           style="width: 240px"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="所属店铺" prop="store">
+      <el-form-item :label="$t('goodList.store')" prop="store">
         <el-select
           v-model="queryParams.storeId"
-          placeholder="所属店铺"
+          :placeholder="$t('goodList.store')"
           clearable
           style="width: 180px"
         >
-          <el-option :key="0" label="公共商品" v-if="!storeId" :value="0" />
+          <el-option :key="0" :label="$t('goodList.PublicGoods')" v-if="!storeId" :value="0" />
           <el-option
             v-for="storeInfo in storeOptions"
             :key="storeInfo.id"
@@ -34,12 +34,12 @@
           />
         </el-select>
       </el-form-item>
-      <el-form-item label="商品分类" prop="cateId">
+      <el-form-item :label="$t('goodList.productCategory')" prop="cateId">
         <el-select
           class="input"
           v-model="queryParams.cateId"
           clearable
-          placeholder="请选择商品分类"
+          :placeholder="$t('goodList.selectCategory')"
         >
           <el-option
             v-for="item in cateList"
@@ -59,8 +59,13 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item> -->
-      <el-form-item label="商品类型" prop="type">
-        <el-select class="input" v-model="queryParams.type" clearable placeholder="请选择商品类型">
+      <el-form-item :label="$t('goodList.productType')" prop="type">
+        <el-select
+          class="input"
+          v-model="queryParams.type"
+          clearable
+          :placeholder="$t('goodList.selectProductType')"
+        >
           <el-option
             v-for="item in typeOptions"
             :key="item.key"
@@ -69,44 +74,46 @@
           ></el-option>
         </el-select>
       </el-form-item>
-      <el-form-item label="规格类型" prop="isSingleSpec">
+      <el-form-item :label="$t('goodList.specificationType')" prop="isSingleSpec">
         <el-select
           v-model="queryParams.isSingleSpec"
-          placeholder="规格类型"
+          :placeholder="$t('goodList.specificationType')"
           clearable
           style="width: 120px"
         >
-          <el-option key="Y" label="单规格" value="Y" />
-          <el-option key="N" label="多规格" value="N" />
+          <el-option key="Y" :label="$t('goodList.singleSpecification')" value="Y" />
+          <el-option key="N" :label="$t('goodList.multipleSpecifications')" value="N" />
         </el-select>
       </el-form-item>
-      <el-form-item label="上架状态" prop="status">
+      <el-form-item :label="$t('goodList.shelfStatus')" prop="status">
         <el-select
           v-model="queryParams.status"
-          placeholder="上架状态"
+          :placeholder="$t('goodList.shelfStatus')"
           clearable
           style="width: 120px"
         >
-          <el-option key="A" label="上架" value="A" />
-          <el-option key="N" label="下架" value="N" />
+          <el-option key="A" :label="$t('goodList.putOnShelf')" value="A" />
+          <el-option key="N" :label="$t('goodList.removeFromShelf')" value="N" />
         </el-select>
       </el-form-item>
-      <el-form-item label="库存状态" prop="stock">
+      <el-form-item :label="$t('goodList.stockStatus')" prop="stock">
         <el-select
           v-model="queryParams.stock"
-          placeholder="库存状态"
+          :placeholder="$t('goodList.stockStatus')"
           clearable
           style="width: 120px"
         >
-          <el-option key="Y" label="有库存" value="Y" />
-          <el-option key="N" label="无库存" value="N" />
+          <el-option key="Y" :label="$t('goodList.inStock')" value="Y" />
+          <el-option key="N" :label="$t('goodList.outOfStock')" value="N" />
         </el-select>
       </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">
-          搜索
+          {{ $t('goodList.search') }}
+        </el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">
+          {{ $t('goodList.reset') }}
         </el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
         <el-button
           type="primary"
           plain
@@ -115,7 +122,7 @@
           @click="handleAdd"
           v-hasPermi="['goods:goods:add']"
         >
-          新增
+          {{ $t('goodList.addNew') }}
         </el-button>
       </el-form-item>
     </el-form>
@@ -128,33 +135,47 @@
       :default-sort="defaultSort"
       @sort-change="handleSortChange"
     >
-      <el-table-column label="ID" prop="id" width="100" />
-      <el-table-column label="所属店铺" align="center">
+      <el-table-column :label="$t('goodList.id')" prop="id" width="80">
+        <template slot-scope="scope">
+          <span>{{ showIdLastFour(scope.row.id) }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column :label="$t('goodList.storeName')" align="center">
         <template slot-scope="scope">
           <span v-if="scope.row.storeInfo">{{ scope.row.storeInfo.name }}</span>
           <span v-else>公共所有</span>
         </template>
       </el-table-column>
-      <el-table-column label="商品名称" align="center" min-width="200" prop="name" />
-      <el-table-column label="主图" align="center" width="100">
+      <el-table-column
+        :label="$t('goodList.productName')"
+        align="center"
+        min-width="200"
+        prop="name"
+      />
+      <el-table-column :label="$t('goodList.mainImage')" align="center" width="100">
         <template slot-scope="scope">
           <img class="list-img" :src="scope.row.logo" />
         </template>
       </el-table-column>
       <!-- <el-table-column label="商品条码" align="center" prop="goodsNo" width="140"/> -->
-      <el-table-column label="剩余库存" align="center" prop="stock" width="100" />
-      <el-table-column label="所属分类" align="center">
+      <el-table-column
+        :label="$t('goodList.remainingStock')"
+        align="center"
+        prop="stock"
+        width="100"
+      />
+      <el-table-column :label="$t('goodList.productCategory')" align="center">
         <template slot-scope="scope">
           <span>{{ scope.row.cateInfo.name }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="价格" align="center" width="80">
+      <el-table-column :label="$t('goodList.price')" align="center" width="80">
         <template slot-scope="scope">
           <span v-if="scope.row.price">{{ scope.row.price.toFixed(2) }}</span>
           <span v-else>0.00</span>
         </template>
       </el-table-column>
-      <el-table-column label="上架状态" align="center" prop="status">
+      <el-table-column :label="$t('goodList.shelfStatus')" align="center" prop="status">
         <template slot-scope="scope">
           <el-switch
             v-model="scope.row.status"
@@ -164,17 +185,27 @@
           ></el-switch>
         </template>
       </el-table-column>
-      <el-table-column label="创建时间" align="center" width="150" prop="createTime">
+      <el-table-column
+        :label="$t('goodList.creationTime')"
+        align="center"
+        width="150"
+        prop="createTime"
+      >
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.createTime) }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="更新时间" align="center" width="150" prop="updateTime">
+      <el-table-column
+        :label="$t('goodList.updateTime')"
+        align="center"
+        width="150"
+        prop="updateTime"
+      >
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.updateTime) }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="操作" align="center" width="120" fixed="right">
+      <el-table-column :label="$t('goodList.actions')" align="center" width="120" fixed="right">
         <template slot-scope="scope">
           <el-button
             size="mini"
@@ -184,7 +215,7 @@
             @click="handleUpdate(scope.row)"
             v-if="storeId == scope.row.storeId || storeId == 0"
           >
-            编辑
+            {{ $t('goodList.edit') }}
           </el-button>
           <el-button
             size="mini"
@@ -194,7 +225,7 @@
             v-if="storeId == scope.row.storeId || storeId == 0"
             @click="handleDelete(scope.row)"
           >
-            删除
+            {{ $t('goodList.delete') }}
           </el-button>
         </template>
       </el-table-column>
@@ -340,7 +371,7 @@ export default {
         })
         .then(() => {
           this.getList()
-          this.$modal.msgSuccess('删除成功')
+          this.$modal.msgSuccess(this.$t('goodList.deleteSuccess'))
         })
         .catch(() => {})
     },