Commit 7f4cf40e by LJM

js

parent 67f9fbb6
.listDetail{
.detail-nav{
background: #fff;
padding:20px;
font-size: 14px;
color:#333;
span{
margin-right: 45px;
}
padding-top:28px;
}
.data-box{
padding:20px;
padding-top: 5px;
background: #fff;
}
.listDetail {
.data-box {
background: #fff;
}
}
\ No newline at end of file
.listDetail .detail-nav {
background: #fff;
padding: 20px;
font-size: 14px;
color: #333;
padding-top: 28px;
}
.listDetail .detail-nav span {
margin-right: 45px;
}
.listDetail .data-box {
padding: 20px;
padding-top: 5px;
background: #fff;
}
/*# sourceMappingURL=listDetail.min.css.map */
\ No newline at end of file
{"version":3,"sources":["listDetail.less"],"names":[],"mappings":"AAAA,WACI;EACI,gBAAA;EACA,aAAA;EACA,eAAA;EACA,WAAA;EAIA,iBAAA;;AATR,WACI,YAKI;EACI,kBAAA;;AAPZ,WAWI;EACI,aAAA;EACA,gBAAA;EACA,gBAAA","file":"listDetail.min.css"}
\ No newline at end of file
{"version":3,"sources":["listDetail.less"],"names":[],"mappings":"AAAA,WAEE;EACE,gBAAA","file":"listDetail.min.css"}
\ No newline at end of file
<template>
<div class="listDetail pagex">
<div class="detail-nav row verCenter" v-if="detailInfo">
<span>单号:{{ detailInfo.up_sn }}</span>
<span>文件名:{{ detailInfo.file_name }}</span>
<span>上传时间:{{ detailInfo.create_time }}</span>
<div>
状态:
<span v-if="detailInfo.status==1" class="f-green">待处理</span>
<span v-else-if="detailInfo.status==2" class="f-yellow1">处理中</span>
<span v-else-if="detailInfo.status==3">已处理</span>
<span v-else-if="detailInfo.status==4" class="f-red1">其他失败</span>
<el-descriptions style="width: 600px" :column="4">
<el-descriptions-item label="导入总数">{{ itemListObj.total }}</el-descriptions-item>
<el-descriptions-item label="导入成功"><span class="alink">{{ itemListObj.suss_count }}</span></el-descriptions-item>
<el-descriptions-item label="导入失败"><span style="color: red">{{ itemListObj.error_count }}</span></el-descriptions-item>
<el-descriptions-item label="导入时间">{{ detailInfo.create_time }}</el-descriptions-item>
</el-descriptions>
<!--操作区-->
<div class="operation-area row" style="margin-top: 10px;">
<div class="operation-button row verCenter">
<el-button type="primary" @click="changeStatus(1)">上架</el-button>
<el-button type="primary" @click="changeStatus(3)">下架</el-button>
<a class="downTemplateExport" @click="exportChange">导出失败文件</a>
</div>
</div>
<div class="btn-nav clr">
<el-button type="primary" @click="changeStatus(1)">上架</el-button>
<el-button type="primary" @click="changeStatus(3)">下架</el-button>
</div>
<!--列表区-->
<div class="data-box" v-if="tableData">
<el-table :data="tableData" border max-height="600" @selection-change="handleSelectionChange">
<el-table-column fixed type="selection" width="40"></el-table-column>
<el-table-column fixed prop="item_id" label="ID" width="75"></el-table-column>
<el-table-column prop="status" fixed label="状态" width="100" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.status==1" type="danger">审核前失败</el-tag>
......@@ -28,30 +26,15 @@
<el-tag v-else-if="scope.row.status==4" type="warning">审核未通过</el-tag>
</template>
</el-table-column>
<el-table-column fixed prop="error_msg" label="同步提示" width="100" :show-overflow-tooltip="true"></el-table-column>
<el-table-column fixed prop="goods_sn" label="供应商内部型号编码" width="180"></el-table-column>
<el-table-column fixed prop="goods_name" label="型号" width="180"></el-table-column>
<el-table-column fixed prop="brand_name" label="品牌" width="180"></el-table-column>
<el-table-column prop="goods_status_name" label="状态" width="80">
<template slot-scope="scope">
<el-tag v-if="scope.row.goods_status_name=='上架'" type="success">{{ scope.row.goods_status_name }}</el-tag>
<el-tag v-else-if="scope.row.goods_status_name=='下架'" type="info">{{ scope.row.goods_status_name }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="stock" label="库存数量" width="150"></el-table-column>
<el-table-column prop="moq" label="起订量" width="150"></el-table-column>
<el-table-column prop="mpq" label="标准包装量" width="150"></el-table-column>
<el-table-column prop="batch_sn" label="批次" width="150"></el-table-column>
<el-table-column prop="cn_delivery_time" label="大陆交期" width="150"></el-table-column>
<el-table-column prop="hk_delivery_time" label="香港交期" width="150"></el-table-column>
<el-table-column prop="spu_brief" label="简短描述" width="150"></el-table-column>
<template v-if="maxPrice.length">
<template v-for="item in maxPrice">
<el-table-column :prop="'purchases'+(item+1)" :label="'阶梯数量'+(item+1)" width="150"></el-table-column>
<el-table-column :prop="'price_cn'+(item+1)" :label="'国内含税价'+(item+1)" width="150"></el-table-column>
<el-table-column :prop="'price_us'+(item+1)" :label="'香港交货价'+(item+1)" width="150"></el-table-column>
</template>
</template>
<el-table-column prop="error_msg" label="失败原因" width="75" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="goods_name" label="型号" width="150"></el-table-column>
<el-table-column prop="brand_name" label="品牌" width="150"></el-table-column>
<el-table-column prop="stock" label="库存数量" width="100"></el-table-column>
<el-table-column prop="moq" label="最小起订量" width="120"></el-table-column>
<el-table-column prop="mpq" label="标准包装量" width="120"></el-table-column>
<el-table-column prop="batch_sn" label="批次" width="100"></el-table-column>
<el-table-column prop="cn_delivery_time" label="大陆交期" width="120"></el-table-column>
<el-table-column prop="hk_delivery_time" label="香港交期" width="120"></el-table-column>
</el-table>
<el-pagination layout="total, sizes, prev, pager, next, jumper" :page-sizes="[10, 20, 50, 100, 200]" :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page"></el-pagination>
</div>
......@@ -62,15 +45,19 @@
import Vue from 'vue';
import Menu from "@/components/menu.vue";
import {Message, Pagination, Table, TableColumn, Tag} from 'element-ui'
import {Descriptions, DescriptionsItem, Message, Pagination, Table, TableColumn, Tag} from 'element-ui'
import {NODE_ENVS} from "@/ajax";
import Tool from "@/tool";
Vue.prototype.$message = Message
Vue.use(Pagination).use(TableColumn).use(Table).use(Tag);
Vue.prototype.$message = Message;
Vue.use(Pagination).use(TableColumn).use(Table).use(Tag).use(Descriptions).use(DescriptionsItem);
export default {
name: "ListDetail",
data() {
return {
detailInfo: "",
itemListObj: {},
total: 0,
limit: 10,
page: 1,
......@@ -92,6 +79,9 @@ export default {
this.getList()
},
methods: {
/**
* 获取详情
*/
getInfo() {
this.$http('get', "/api/uploadSku/info", {
id: this.$route.query.id
......@@ -103,11 +93,70 @@ export default {
}
})
},
/**
* 获取列表数据
*/
getList() {
this.$http('get', "/api/uploadSku/itemList", {
page: this.page,
limit: this.limit,
up_sn: this.$route.query.sn
}).then(res => {
if (res.code === 0) {
this.itemListObj = res.data;
var arr = res.data.list || [];
for (var i = 0; i < arr.length; i++) {
if (arr[i]['ladder_price']) {
for (var j = 0; j < arr[i]['ladder_price'].length; j++) {
arr[i]['purchases' + (j + 1)] = arr[i]['ladder_price'][j]['purchases']
arr[i]['price_cn' + (j + 1)] = arr[i]['ladder_price'][j]['price_cn']
arr[i]['price_us' + (j + 1)] = arr[i]['ladder_price'][j]['price_us']
}
}
}
this.tableData = arr
this.total = res.data.total || 0;
var max_ = res.data.max_price_count || 0;
for (var g = 0; g < max_; g++) {
this.maxPrice.push(g)
}
} else {
this.$message(res.msg);
}
})
},
/**
* 导出文件
*/
exportChange(){
var up_sn = this.tableData[0].up_sn;
this.$http('GET', "/api/uploadSku/exportErrorItemList",{
up_sn:up_sn.join(",")
}).then(res => {
if (res.code === 0) {
this.toUrl( NODE_ENVS + '/api/uploadSku/exportErrorItemList?up_sn=' + up_sn + '&token=' + Tool.getCookie('token'));
} else {
this.$message({
message: res.msg,
type: 'error'
});
}
})
},
toUrl(url){
var htmlArr = [];
htmlArr.push('<form action="' + url + '" method="post" id="form" style="display: none">' +
' <input type="submit" value="提交">' +
' </form>');
$("body").append(htmlArr.join(''));
$("#form").attr('target', '_blank');
$("#form").submit();
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
changeStatus(status) {
var self=this;
var self = this;
var arr = [];
if (this.multipleSelection.length == 0) {
this.$message({
......@@ -138,7 +187,7 @@ export default {
this.$message({
message: '操作成功',
type: 'success',
onClose(){
onClose() {
self.getList()
}
});
......@@ -150,34 +199,6 @@ export default {
}
})
},
getList() {
this.$http('get', "/api/uploadSku/itemList", {
page: this.page,
limit: this.limit,
up_sn: this.$route.query.sn
}).then(res => {
if (res.code === 0) {
var arr = res.data.list || [];
for (var i = 0; i < arr.length; i++) {
if (arr[i]['ladder_price']) {
for (var j = 0; j < arr[i]['ladder_price'].length; j++) {
arr[i]['purchases' + (j + 1)] = arr[i]['ladder_price'][j]['purchases']
arr[i]['price_cn' + (j + 1)] = arr[i]['ladder_price'][j]['price_cn']
arr[i]['price_us' + (j + 1)] = arr[i]['ladder_price'][j]['price_us']
}
}
}
this.tableData = arr
this.total = res.data.total || 0;
var max_ = res.data.max_price_count || 0;
for (var g = 0; g < max_; g++) {
this.maxPrice.push(g)
}
} else {
this.$message(res.msg);
}
})
},
handleSizeChange(val) {
this.limit = val;
this.getList();
......@@ -199,4 +220,28 @@ export default {
background: #FFFFFF;
padding: 0 0 20px 20px;
}
::v-deep .el-descriptions-item__label {
white-space: nowrap;
}
::v-deep .el-descriptions-item__content {
white-space: nowrap;
}
.downTemplateExport {
width: 92px;
height: 28px;
text-align: center;
line-height: 28px;
color: #FFF;
background-color: #409EFF;
border-color: #409EFF;
font-size: 12px;
border-radius: 3px;
margin-left: 10px;
margin-right: 10px;
display: block;
cursor: pointer;
}
</style>
\ No newline at end of file
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