Commit ca75d06a authored by 黄奎's avatar 黄奎

页面修改

parent 44a59adf
...@@ -3,66 +3,47 @@ ...@@ -3,66 +3,47 @@
<div class="el-card__header"> <div class="el-card__header">
<span>损益核算</span> <span>损益核算</span>
<div style="display: flex;flex-direction: row;align-items: center"> <div style="display: flex;flex-direction: row;align-items: center">
<!----> <!---->
<el-button type="primary" class="el-button--small" @click="getDateList,getSupplierList">导出全部</el-button> <el-button type="primary" class="el-button--small" @click="Export">导出全部</el-button>
</div> </div>
</div> </div>
<div class="content"> <div class="content">
<div style="display: flex;flex-direction: row;align-items: center"> <div style="display: flex;flex-direction: row;align-items: center">
<span>供应商</span> <span>供应商</span>
<el-select class="w150" style="margin-left: 10px;" v-model="SupplierId" size="small" placeholder="请选择" @change='getDateList'> <el-select class="w150" style="margin-left: 10px;" v-model="SupplierId" size="small" placeholder="请选择"
<el-option @change='getDateList'>
v-for="item in options" <el-option v-for="item in options" :key="item.ID" :label="item.Name" :value="item.ID">
:key="item.ID"
:label="item.Name"
:value="item.ID">
</el-option> </el-option>
</el-select> </el-select>
<div class="block" style="margin-left: 10px;"> <div class="block" style="margin-left: 10px;">
<el-date-picker <el-date-picker style="padding: 3px 10px;width: 380px;height: 32px" v-model="value" type="daterange"
style="padding: 3px 10px;width: 380px;height: 32px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd"
v-model="value" @change="change" align="right">
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
@change="change"
align="right">
</el-date-picker> </el-date-picker>
</div> </div>
</div> </div>
</div> </div>
<div style="padding: 20px;background: #fff;margin-top: 10px"> <div style="padding: 20px;background: #fff;margin-top: 10px">
<el-table <el-table :data="tableData" v-loading="loading" header-cell-class-name="headClass" style="width: 100%" border>
:data="tableData" <el-table-column label="商品信息" align="center">
v-loading="loading" <el-table-column label="订单号" prop="OrderNo" width="200" fixed></el-table-column>
header-cell-class-name="headClass" <el-table-column label="规格" width="300">
style="width: 100%"
border
>
<el-table-column label="商品信息" align="center">
<el-table-column label="订单号" prop="OrderNo" width="200" fixed></el-table-column>
<el-table-column label="规格" width="300" >
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.GoodsName}}{{scope.row.Specification}} {{scope.row.GoodsName}}{{scope.row.Specification}}
<!--<p v-for="(item,index) in scope.row.Specification " :key="index">{{item}}</p>--> <!--<p v-for="(item,index) in scope.row.Specification " :key="index">{{item}}</p>-->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="单价" prop="Unit_Price"></el-table-column> <el-table-column label="单价" prop="Unit_Price"></el-table-column>
<el-table-column label="数量" prop="Number"></el-table-column> <el-table-column label="数量" prop="Number"></el-table-column>
<el-table-column label="供应商" prop="SupplierName"></el-table-column> <el-table-column label="供应商" prop="SupplierName"></el-table-column>
</el-table-column> </el-table-column>
<el-table-column label="营业收入" align="center"> <el-table-column label="营业收入" align="center">
<el-table-column label="结算款" prop="Final_Price"></el-table-column> <el-table-column label="结算款" prop="Final_Price"></el-table-column>
<el-table-column label="运费" prop="FreightMoney"></el-table-column> <el-table-column label="运费" prop="FreightMoney"></el-table-column>
<el-table-column label="已收" prop="AllPrice"></el-table-column> <el-table-column label="已收" prop="AllPrice"></el-table-column>
<el-table-column label="未收款" > <el-table-column label="未收款">
<!--结算款-已收--> <!--结算款-已收-->
<!--暂时写为0--> <!--暂时写为0-->
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -70,93 +51,81 @@ ...@@ -70,93 +51,81 @@
<p>0</p> <p>0</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="合计数" prop="AllPrice"></el-table-column> <el-table-column label="合计数" prop="AllPrice"></el-table-column>
</el-table-column> </el-table-column>
<el-table-column label="营业成本" align="center">
<el-table-column label="采购成本" prop="CostMoney"></el-table-column>
<el-table-column label="营业成本" align="center"> <el-table-column label="包装费摊销" prop="PackingMoney"></el-table-column>
<el-table-column label="采购成本" prop="CostMoney"></el-table-column> <el-table-column label="快递费" prop="CostFreight"></el-table-column>
<el-table-column label="包装费摊销" prop="PackingMoney"></el-table-column> <el-table-column label="商品运费摊销" prop="GoodsFreight"></el-table-column>
<el-table-column label="快递费" prop="CostFreight"></el-table-column> <el-table-column label="一级返佣" prop="OneCommission"></el-table-column>
<el-table-column label="商品运费摊销" prop="GoodsFreight"></el-table-column> <el-table-column label="二级返佣" prop="TwoCommission"></el-table-column>
<el-table-column label="一级返佣" prop="OneCommission"></el-table-column> <el-table-column label="其他" prop="OtherPrice"></el-table-column>
<el-table-column label="二级返佣" prop="TwoCommission"></el-table-column> <el-table-column label="合计" prop="ALLCommission"></el-table-column>
<el-table-column label="其他" prop="OtherPrice"></el-table-column>
<el-table-column label="合计" prop="ALLCommission"></el-table-column>
</el-table-column> </el-table-column>
<el-table-column prop="Paid" label="已付" ></el-table-column> <el-table-column prop="Paid" label="已付"></el-table-column>
<el-table-column prop="NoPaid" label="应付"></el-table-column> <el-table-column prop="NoPaid" label="应付"></el-table-column>
<el-table-column prop="GrossProfit" label="毛利" ></el-table-column> <el-table-column prop="GrossProfit" label="毛利"></el-table-column>
<el-table-column prop="GrossProfitRate" label="毛利率" ></el-table-column> <el-table-column prop="GrossProfitRate" label="毛利率"></el-table-column>
</el-table> </el-table>
<el-pagination style="text-align:right" <el-pagination style="text-align:right" background @current-change="handleCurrentChange" :page-size="msg.pageSize"
background layout="prev, pager, next" :total="count">
@current-change="handleCurrentChange"
:page-size="msg.pageSize"
layout="prev, pager, next"
:total="count">
</el-pagination> </el-pagination>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: "OrderProfitLossList", name: "OrderProfitLossList",
data(){ data() {
return{ return {
value:'', value: '',
msg:{ msg: {
pageIndex:1, pageIndex: 1,
pageSize:10, pageSize: 10,
SupplierId:0, SupplierId: 0,
StartDate:'', StartDate: '',
EndDate:'', EndDate: '',
}, },
SupplierId:"", SupplierId: "",
options:[], options: [],
tableData:[], tableData: [],
count:0, count: 0,
loading:false, loading: false,
} }
}, },
created(){ created() {
this.getDateList() this.getDateList()
this.getSupplierList() this.getSupplierList()
}, },
methods:{ methods: {
getDateList(){ getDateList() {
if (this.value != '') {
if(this.value!=''){
this.msg.StartDate = this.value[0]; this.msg.StartDate = this.value[0];
this.msg.EndDate = this.value[1]; this.msg.EndDate = this.value[1];
} }
if(this.SupplierId!=''){ if (this.SupplierId != '') {
this.msg.SupplierId = this.SupplierId this.msg.SupplierId = this.SupplierId
}else { } else {
this.msg.SupplierId= 0 this.msg.SupplierId = 0
} }
this.loading=true; this.loading = true;
console.log('11111111')
this.mallapipost("/api/Statistics/GetOrderProfitLossList", this.msg, res => { this.mallapipost("/api/Statistics/GetOrderProfitLossList", this.msg, res => {
this.loading=false; this.loading = false;
if(res.data.resultCode==1){ if (res.data.resultCode == 1) {
this.tableData = res.data.data.pageData; this.tableData = res.data.data.pageData;
this.count = res.data.data.count; this.count = res.data.data.count;
}else { } else {
this.Info(res.data.message); this.Info(res.data.message);
} }
}) })
}, },
getSupplierList(){//获取供应商接口 getSupplierList() { //获取供应商接口
console.log("222222")
this.mallapipost("/api/Supplier/GetSupplierAllList", {}, res => { this.mallapipost("/api/Supplier/GetSupplierAllList", {}, res => {
this.loading = false; this.loading = false;
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
...@@ -164,17 +133,14 @@ ...@@ -164,17 +133,14 @@
} }
}); });
}, },
Export() {
Export(){
let msg = { let msg = {
SupplierId:this.msg.SupplierId, SupplierId: this.msg.SupplierId,
StartDate :this.msg.StartDate , StartDate: this.msg.StartDate,
EndDate :this.msg.EndDate, EndDate: this.msg.EndDate,
} }
msg = JSON.parse(JSON.stringify(msg)); msg = JSON.parse(JSON.stringify(msg));
this.GetLocalFile( this.GetMallLocalFile(
"/api/Statistics/GetOrderProfitLossExcel", "/api/Statistics/GetOrderProfitLossExcel",
msg, msg,
"损益核算.xls" "损益核算.xls"
...@@ -184,24 +150,21 @@ ...@@ -184,24 +150,21 @@
this.msg.pageIndex = val; this.msg.pageIndex = val;
this.getDateList(); this.getDateList();
}, },
change(val){ change(val) {
if(val == null ){ if (val == null) {
this.value=''; this.value = '';
this.msg.StartDate=''; this.msg.StartDate = '';
this.msg.EndDate=''; this.msg.EndDate = '';
} }
this.getDateList(); this.getDateList();
}, },
} }
} }
</script> </script>
<style> <style>
.OrderProfitLossList .el-card__header{ .OrderProfitLossList .el-card__header {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
...@@ -209,46 +172,58 @@ ...@@ -209,46 +172,58 @@
background: #fff; background: #fff;
padding: 18px 20px; padding: 18px 20px;
} }
.OrderProfitLossList .el-button--small{
.OrderProfitLossList .el-button--small {
padding: 9px 15px; padding: 9px 15px;
} }
.OrderProfitLossList .content .searchInput{
.OrderProfitLossList .content .searchInput {
border: 1px solid #DCDFE6; border: 1px solid #DCDFE6;
border-radius: 4px; border-radius: 4px;
margin-left: 20px; margin-left: 20px;
} }
.OrderProfitLossList .content .searchInput .el-input__inner{
border:none;outline:none; .OrderProfitLossList .content .searchInput .el-input__inner {
border: none;
outline: none;
height: 30px; height: 30px;
line-height: 30px; line-height: 30px;
} }
.OrderProfitLossList .content .searchInput{
.OrderProfitLossList .content .searchInput {
line-height: normal; line-height: normal;
display: inline-table; display: inline-table;
border-collapse: separate; border-collapse: separate;
border-spacing: 0; border-spacing: 0;
width:250px; width: 250px;
margin-right: 20px; margin-right: 20px;
} }
.OrderProfitLossList .content{
.OrderProfitLossList .content {
background: #fff; background: #fff;
margin-top:10px; margin-top: 10px;
padding: 15px; padding: 15px;
box-sizing: border-box; box-sizing: border-box;
} }
.OrderProfitLossList .el-icon-date{
.OrderProfitLossList .el-icon-date {
line-height: 24px; line-height: 24px;
} }
.OrderProfitLossList .el-range-separator{
.OrderProfitLossList .el-range-separator {
line-height: 24px; line-height: 24px;
} }
.OrderProfitLossList .just{
.OrderProfitLossList .just {
color: rgb(104, 207, 61) color: rgb(104, 207, 61)
} }
.OrderProfitLossList .negative{
.OrderProfitLossList .negative {
color: red color: red
} }
.OrderProfitLossList .el-input__icon { .OrderProfitLossList .el-input__icon {
line-height: 24px; line-height: 24px;
} }
</style> </style>
...@@ -114,8 +114,8 @@ export default { ...@@ -114,8 +114,8 @@ export default {
//域名管理对象 //域名管理对象
Vue.prototype.domainManager = function () { Vue.prototype.domainManager = function () {
let domainUrl = ''; let domainUrl = '';
// domainUrl = "http://192.168.2.214:8082"; domainUrl = "http://192.168.2.214:8082";
domainUrl = "http://192.168.2.65:8025"; //domainUrl = "http://192.168.2.65:8025";
let locationName = window.location.hostname; let locationName = window.location.hostname;
...@@ -158,7 +158,7 @@ export default { ...@@ -158,7 +158,7 @@ export default {
// javaUrl:"http://192.168.2.215:9000", // javaUrl:"http://192.168.2.215:9000",
//Java接口本站文件流下载地址 //Java接口本站文件流下载地址
JavaLocalFileStreamDownLoadUrl: javaUrldo, JavaLocalFileStreamDownLoadUrl: javaUrldo,
mallUrl:"http://192.168.2.65", mallUrl:"http://192.168.0.110:8200",
}; };
return obj; return obj;
}, },
...@@ -349,18 +349,38 @@ export default { ...@@ -349,18 +349,38 @@ export default {
} }
}) })
.then(res => { .then(res => {
console.log("res",res); if (res.data.resultCode == 10000 || res.data.resultCode == 10001) {
// if (res.data.resultCode == 10000 || res.data.resultCode == 10001) { // this.$router.push({
// // this.$router.push({ // path: '/login'
// // path: '/login' // });
// // }); } else if (res.resultCode == 10005) {
// } else if (res.resultCode == 10005) { this.$router.go(-1);
// this.$router.go(-1); } else {
// } else { successCall(res);
// successCall(res); }
// }
}, faildCall) }, faildCall)
} }
//文件下载
Vue.prototype.GetMallLocalFile = function(cmd, msg, fileName, newCmd, successCall) {
var apiurl = this.domainManager().mallUrl + cmd;
var postData = this.GetPostData(cmd, msg, newCmd);
this.$http.post(apiurl, postData, {
responseType: 'arraybuffer'
}).then((res) => {
let blob = new Blob([res.data], {
type: "application/vnd.ms-excel"
})
let url = URL.createObjectURL(blob);
let link = document.createElement('a');
link.href = url;
link.setAttribute("download", fileName);
document.body.appendChild(link);
link.click();
successCall(res);
}).catch(function(res) {});
}
//获取请求参数 //获取请求参数
Vue.prototype.GetPostData = function(cmd, msg, newCmd) { Vue.prototype.GetPostData = function(cmd, msg, newCmd) {
if (msg == null || msg == "") { if (msg == null || msg == "") {
......
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 to comment