|
@@ -7,11 +7,7 @@
|
|
|
<el-form :inline="true" ref="form" style="margin-left: 10px">
|
|
|
<el-form-item>
|
|
|
<!-- 优惠码 -->
|
|
|
- <el-form-item
|
|
|
- class="label-input"
|
|
|
- :label="$t('Key793')"
|
|
|
- style="margin-right: 30px"
|
|
|
- >
|
|
|
+ <el-form-item class="label-input" :label="$t('Key793')" style="margin-right: 30px">
|
|
|
<!-- 输入生成激活码数量" -->
|
|
|
<el-input
|
|
|
:placeholder="$t('Key794')"
|
|
@@ -20,47 +16,24 @@
|
|
|
:oninput="numberInput"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-button
|
|
|
- @click="onSubmit"
|
|
|
- size="medium"
|
|
|
- type="primary"
|
|
|
- :loading="loading"
|
|
|
- >
|
|
|
- <!-- 生成 -->{{ $t("Key562") }}
|
|
|
+ <el-button @click="onSubmit" size="medium" type="primary" :loading="loading">
|
|
|
+ <!-- 生成 -->{{ $t('Key562') }}
|
|
|
</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<el-form :inline="true">
|
|
|
- <el-form-item
|
|
|
- class="label-input"
|
|
|
- :label="$t('Key563') + ':'"
|
|
|
- style="margin-right: 30px"
|
|
|
- >
|
|
|
- <el-radio v-model="exportRadio" :label="-1">
|
|
|
- <!-- 全部 -->{{ $t("Key110") }}
|
|
|
- </el-radio>
|
|
|
- <el-radio v-model="exportRadio" :label="1">
|
|
|
- <!-- 已使用 -->{{ this.$t("Key564") }}
|
|
|
- </el-radio>
|
|
|
- <el-radio v-model="exportRadio" :label="0">
|
|
|
- <!-- 未使用 -->{{ this.$t("Key565") }}
|
|
|
- </el-radio>
|
|
|
+ <el-form-item class="label-input" :label="$t('Key563') + ':'" style="margin-right: 30px">
|
|
|
+ <el-radio v-model="exportRadio" :label="-1"> <!-- 全部 -->{{ $t('Key110') }} </el-radio>
|
|
|
+ <el-radio v-model="exportRadio" :label="1"> <!-- 已使用 -->{{ this.$t('Key564') }} </el-radio>
|
|
|
+ <el-radio v-model="exportRadio" :label="0"> <!-- 未使用 -->{{ this.$t('Key565') }} </el-radio>
|
|
|
</el-form-item>
|
|
|
- <el-button
|
|
|
- @click="onExport"
|
|
|
- size="medium"
|
|
|
- type="primary"
|
|
|
- :loading="exportLoading"
|
|
|
- >{{ this.$t("Key566") }} excel</el-button
|
|
|
+ <el-button @click="onExport" size="medium" type="primary" :loading="exportLoading"
|
|
|
+ >{{ this.$t('Key566') }} excel</el-button
|
|
|
>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
<div class="table-box">
|
|
|
- <el-table
|
|
|
- :data="tableData"
|
|
|
- style="width: 100%"
|
|
|
- v-loading="tableloading"
|
|
|
- >
|
|
|
+ <el-table :data="tableData" style="width: 100%" v-loading="tableloading">
|
|
|
<!-- 优惠码 -->
|
|
|
<el-table-column
|
|
|
class="table-firstC"
|
|
@@ -69,43 +42,20 @@
|
|
|
width="150"
|
|
|
></el-table-column>
|
|
|
<!-- 状态 -->
|
|
|
- <el-table-column
|
|
|
- :label="$t('Key164')"
|
|
|
- prop="is_used"
|
|
|
- width="150"
|
|
|
- :formatter="handleStatus"
|
|
|
- ></el-table-column>
|
|
|
+ <el-table-column :label="$t('Key164')" prop="is_used" width="150" :formatter="handleStatus"></el-table-column>
|
|
|
<!-- 使用者 -->
|
|
|
- <el-table-column
|
|
|
- :label="$t('Key569')"
|
|
|
- prop="consumer_name"
|
|
|
- width="150"
|
|
|
- ></el-table-column>
|
|
|
+ <el-table-column :label="$t('Key569')" prop="consumer_name" width="150"></el-table-column>
|
|
|
<!-- 使用时间 -->
|
|
|
- <el-table-column
|
|
|
- :label="$t('Key568')"
|
|
|
- prop="use_time"
|
|
|
- width="200"
|
|
|
- ></el-table-column>
|
|
|
+ <el-table-column :label="$t('Key568')" prop="use_time" width="200"></el-table-column>
|
|
|
<!-- 使用者所属机构 -->
|
|
|
- <el-table-column
|
|
|
- :label="$t('Key567')"
|
|
|
- prop="consumer_org_name"
|
|
|
- width="250"
|
|
|
- ></el-table-column>
|
|
|
+ <el-table-column :label="$t('Key567')" prop="consumer_org_name" width="250"></el-table-column>
|
|
|
<!-- 创建时间 -->
|
|
|
- <el-table-column
|
|
|
- :label="$t('Key163')"
|
|
|
- prop="create_time"
|
|
|
- width="200"
|
|
|
- ></el-table-column>
|
|
|
+ <el-table-column :label="$t('Key163')" prop="create_time" width="200"></el-table-column>
|
|
|
<!-- 操作 -->
|
|
|
<el-table-column fixed="right" :label="$t('Key166')" prop width="100">
|
|
|
<template slot-scope="scope">
|
|
|
<!-- 删除 -->
|
|
|
- <el-button @click="handleDel(scope.row)" type="text">{{
|
|
|
- $t("Key172")
|
|
|
- }}</el-button>
|
|
|
+ <el-button @click="handleDel(scope.row)" type="text">{{ $t('Key172') }}</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -124,21 +74,21 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import Header from "@/components/Header";
|
|
|
-import Nav from "@/components/teacher-devEntering/Nav";
|
|
|
-import { BookgetContent, LearnWebSI } from "@/api/api";
|
|
|
-import { getToken } from "@/utils/auth";
|
|
|
-import { encodeURL } from "js-base64";
|
|
|
-import { updateWordPack } from "@/utils/i18n";
|
|
|
+import Header from '@/components/Header';
|
|
|
+import Nav from '@/components/teacher-devEntering/Nav';
|
|
|
+import { BookgetContent, LearnWebSI } from '@/api/api';
|
|
|
+import { getToken } from '@/utils/auth';
|
|
|
+import { encodeURL } from 'js-base64';
|
|
|
+import { updateWordPack } from '@/utils/i18n';
|
|
|
export default {
|
|
|
- name: "courselist",
|
|
|
+ name: 'courselist',
|
|
|
components: {
|
|
|
Header,
|
|
|
Nav,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- bookId: "",
|
|
|
+ bookId: '',
|
|
|
discountNumber: null, // 生成数量
|
|
|
loading: false,
|
|
|
tableData: [], // 数据内容
|
|
@@ -156,41 +106,41 @@ export default {
|
|
|
async created() {
|
|
|
await updateWordPack({
|
|
|
word_key_list: [
|
|
|
- "Key5",
|
|
|
- "Key8",
|
|
|
- "Key9",
|
|
|
- "Key39",
|
|
|
- "Key83",
|
|
|
- "Key94",
|
|
|
- "Key110",
|
|
|
- "Key164",
|
|
|
- "Key163",
|
|
|
- "Key166",
|
|
|
- "Key172",
|
|
|
- "Key232",
|
|
|
- "Key361",
|
|
|
- "Key532",
|
|
|
- "Key560",
|
|
|
- "Key561",
|
|
|
- "Key562",
|
|
|
- "Key563",
|
|
|
- "Key564",
|
|
|
- "Key565",
|
|
|
- "Key566",
|
|
|
- "Key567",
|
|
|
- "Key568",
|
|
|
- "Key569",
|
|
|
- "Key687",
|
|
|
- "Key689",
|
|
|
- "Key793",
|
|
|
- "Key794",
|
|
|
+ 'Key5',
|
|
|
+ 'Key8',
|
|
|
+ 'Key9',
|
|
|
+ 'Key39',
|
|
|
+ 'Key83',
|
|
|
+ 'Key94',
|
|
|
+ 'Key110',
|
|
|
+ 'Key164',
|
|
|
+ 'Key163',
|
|
|
+ 'Key166',
|
|
|
+ 'Key172',
|
|
|
+ 'Key232',
|
|
|
+ 'Key361',
|
|
|
+ 'Key532',
|
|
|
+ 'Key560',
|
|
|
+ 'Key561',
|
|
|
+ 'Key562',
|
|
|
+ 'Key563',
|
|
|
+ 'Key564',
|
|
|
+ 'Key565',
|
|
|
+ 'Key566',
|
|
|
+ 'Key567',
|
|
|
+ 'Key568',
|
|
|
+ 'Key569',
|
|
|
+ 'Key687',
|
|
|
+ 'Key689',
|
|
|
+ 'Key793',
|
|
|
+ 'Key794',
|
|
|
],
|
|
|
});
|
|
|
|
|
|
const _this = this;
|
|
|
_this.usedStatus = {
|
|
|
- true: this.$t("Key564"), //"已使用",
|
|
|
- false: this.$t("Key565"), //"未使用",
|
|
|
+ true: this.$t('Key564'), //"已使用",
|
|
|
+ false: this.$t('Key565'), //"未使用",
|
|
|
};
|
|
|
_this.isData = true;
|
|
|
_this.bookId = this.$route.query.bookId;
|
|
@@ -199,7 +149,7 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
numberInput() {
|
|
|
- this.discountNumber = this.discountNumber.replace(/[^0-9]/g, "");
|
|
|
+ this.discountNumber = this.discountNumber.replace(/[^0-9]/g, '');
|
|
|
},
|
|
|
// 切换每页条数
|
|
|
handleSizeChange(val) {
|
|
@@ -216,8 +166,7 @@ export default {
|
|
|
onSubmit() {
|
|
|
if (this.discountNumber) {
|
|
|
this.loading = true;
|
|
|
- let MethodName =
|
|
|
- "order-discount_manager-BatchCreateDiscountCodeFoGoods";
|
|
|
+ let MethodName = 'order-discount_manager-BatchCreateDiscountCodeFoGoods';
|
|
|
let data = {
|
|
|
goods_id: this.bookId,
|
|
|
goods_type: this.goods_type * 1,
|
|
@@ -225,7 +174,7 @@ export default {
|
|
|
};
|
|
|
LearnWebSI(MethodName, data)
|
|
|
.then((res) => {
|
|
|
- this.$message.success(this.$t("Key687")); //操作成功
|
|
|
+ this.$message.success(this.$t('Key687')); //操作成功
|
|
|
this.discountNumber = null;
|
|
|
this.loading = false;
|
|
|
this.pageIndex = 1;
|
|
@@ -237,17 +186,17 @@ export default {
|
|
|
} else {
|
|
|
this.$message(
|
|
|
{
|
|
|
- type: "warning",
|
|
|
- message: this.$t("Key561"), //"请输入生成激活码数量!",
|
|
|
+ type: 'warning',
|
|
|
+ message: this.$t('Key561'), //"请输入生成激活码数量!",
|
|
|
},
|
|
|
- 2000
|
|
|
+ 2000,
|
|
|
);
|
|
|
return false;
|
|
|
}
|
|
|
},
|
|
|
// 查询数据列表
|
|
|
getList() {
|
|
|
- let MethodName = "page_query-PageQueryGoodsDiscountCodeList";
|
|
|
+ let MethodName = 'page_query-PageQueryGoodsDiscountCodeList';
|
|
|
let data = {
|
|
|
goods_id: this.bookId,
|
|
|
page_capacity: this.page_capacity,
|
|
@@ -271,13 +220,13 @@ export default {
|
|
|
// 删除书籍
|
|
|
handleDel(row) {
|
|
|
// 确定删除此优惠码吗?
|
|
|
- this.$confirm(this.$t("Key689"), this.$t("Key361"), {
|
|
|
- confirmButtonText: this.$t("Key94"), //"确定",
|
|
|
- cancelButtonText: this.$t("Key83"), //"取消",
|
|
|
- type: "warning",
|
|
|
+ this.$confirm(this.$t('Key689'), this.$t('Key361'), {
|
|
|
+ confirmButtonText: this.$t('Key94'), //"确定",
|
|
|
+ cancelButtonText: this.$t('Key83'), //"取消",
|
|
|
+ type: 'warning',
|
|
|
})
|
|
|
.then(() => {
|
|
|
- let MethodName = "order-discount_manager-DeleteGoodsDiscountCode";
|
|
|
+ let MethodName = 'order-discount_manager-DeleteGoodsDiscountCode';
|
|
|
let data = {
|
|
|
discount_code_id: row.id,
|
|
|
goods_id: this.bookId,
|
|
@@ -288,8 +237,8 @@ export default {
|
|
|
this.currentPage = 1;
|
|
|
this.getList();
|
|
|
this.$message({
|
|
|
- type: "success",
|
|
|
- message: this.$t("Key532"), //"删除成功!",
|
|
|
+ type: 'success',
|
|
|
+ message: this.$t('Key532'), //"删除成功!",
|
|
|
});
|
|
|
})
|
|
|
.catch(() => {});
|
|
@@ -299,17 +248,17 @@ export default {
|
|
|
// 导出
|
|
|
onExport() {
|
|
|
this.exportLoading = true;
|
|
|
- let userInfor = getToken();
|
|
|
- let UserCode = "",
|
|
|
- UserType = "",
|
|
|
- SessionID = "";
|
|
|
+ let userInfor = getToken() || sessionStorage.getItem('GCLS_Token_Tc');
|
|
|
+ let UserCode = '',
|
|
|
+ UserType = '',
|
|
|
+ SessionID = '';
|
|
|
if (userInfor) {
|
|
|
- let user = JSON.parse(getToken());
|
|
|
+ let user = getToken() ? JSON.parse(getToken()) : JSON.parse(sessionStorage.getItem('GCLS_Token_Tc'));
|
|
|
UserCode = user.user_code;
|
|
|
UserType = user.user_type;
|
|
|
SessionID = user.session_id;
|
|
|
}
|
|
|
- let MethodName = "data_export-ExportGoodsDiscountCodeList";
|
|
|
+ let MethodName = 'data_export-ExportGoodsDiscountCodeList';
|
|
|
let data = {
|
|
|
use_status: this.exportRadio,
|
|
|
goods_id: this.bookId,
|
|
@@ -318,8 +267,8 @@ export default {
|
|
|
window.open(
|
|
|
process.env.VUE_APP_BASE_API +
|
|
|
`/GCLSLearnWebSI/ServiceInterface?MethodName=${MethodName}&UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}&Parameter=${encodeURIComponent(
|
|
|
- JSON.stringify(data)
|
|
|
- )}`
|
|
|
+ JSON.stringify(data),
|
|
|
+ )}`,
|
|
|
);
|
|
|
this.exportLoading = false;
|
|
|
},
|