Commit 6fcea6f4 by liangjianmin

feat: 更新下载模板链接,支持不同环境下的模板下载

parent 6b63c904
......@@ -23,7 +23,7 @@
<!--操作区-->
<div class="operation-area row">
<el-button type="primary" @click="importChange">导入</el-button>
<a href="/uploadSku.csv" class="downTemplate">下载模版</a>
<a :href="skuHref" class="downTemplate">下载模版</a>
<el-button type="danger" @click="del">删除</el-button>
</div>
<!--列表区-->
......@@ -114,6 +114,7 @@ export default {
name: "enter",
data() {
return {
skuHref: location.hostname === 'xinlian.ichunt.com' ? '//cloud.liexindev.net/template/芯链SKU上传模板.csv' : 'https://cloud.ichunt.com/template/芯链SKU上传模板.csv',
cp_time_day: localStorage.getItem('cp_time_day') || '',
futures_cp_time_day: localStorage.getItem('futures_cp_time_day') || '',
uploading: false,
......
......@@ -24,7 +24,7 @@
<div class="operation-area row verCenter bothSide">
<div class="operation-button row verCenter">
<el-button type="primary" @click="importChange">导入</el-button>
<a href="/寄售商品导入.csv" download style="text-decoration: none;margin-left: 10px;">
<a :href="jsHref" download style="text-decoration: none;margin-left: 10px;">
<el-button type="primary">下载模板</el-button>
</a>
</div>
......@@ -98,6 +98,7 @@ export default {
name: "consignmentImport",
data() {
return {
jsHref: location.hostname === 'xinlian.ichunt.com' ? '//cloud.liexindev.net/template/芯链寄售商品导入模板.csv' : 'https://cloud.ichunt.com/template/芯链寄售商品导入模板.csv',
cp_time_day: localStorage.getItem('cp_time_day') || '',//现货最高天数
futures_cp_time_day: localStorage.getItem('futures_cp_time_day') || '',//期货最高天数
uploadUrl: NODE_ENVS + '/api/uploadSku/import',//上传接口
......@@ -126,7 +127,7 @@ export default {
},
methods: {
getData() {
var params = Object.assign({}, {page: this.page, limit: this.limit, source: 12, status: this.formParam.status, action_time: this.formParam.date[0], end_time: this.formParam.date[1]});
var params = Object.assign({}, { page: this.page, limit: this.limit, source: 12, status: this.formParam.status, action_time: this.formParam.date[0], end_time: this.formParam.date[1] });
this.$http('GET', "/api/uploadSku/list", params).then(res => {
if (res.code === 0) {
this.list = res.data.list || [];
......@@ -146,12 +147,12 @@ export default {
// 先重置所有状态
this.progress = 0;
this.uploading = false;
// 清空上传列表
if (this.$refs.upload) {
this.$refs.upload.clearFiles();
}
// 使用 nextTick 确保DOM更新后再显示对话框
this.$nextTick(() => {
this.dialogVisible = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment