文件

242 行
9.4 KiB
HTML
可执行文件

<!--[1.7.90]-->
<style>
th {
background-color: #f5f7fa !important;
}
th>.cell {
white-space: nowrap !important;
text-align: center;
}
th,
td {
text-align: center;
line-height: 30px;
padding: 0;
}
th>.cell,
td>.cell {
text-align: center;
}
.el-pagination {
padding: 8px;
}
.el-table__row>td:last-child>.cell {
white-space: nowrap;
}
.center-content {
margin: 0 0 20px;
display: flex;
justify-content: space-between;
align-items: center;
}
.center-content .el-input__inner {
padding: 0 15px;
text-align: left;
}
.el-input {
margin-bottom: 10px;
}
.max-dialog-content {
position: absolute;
bottom: 0;
right: 0;
height: calc(100vh - 65px);
overflow-y: auto;
margin: 0;
}
.el-range-editor--small .el-range-separator {
line-height: 32px;
}
</style>
<div class="purchaseBox" id="purchase" v-cloak>
<div class="center-content">
<div>
<el-input placeholder="采购退货单号" style="width: 200px" type="text"
clearable size="small"
@keydown.enter.exact.native.prevent="search"
v-model="order_number"></el-input>
<template>
<date-picker-range :date-time.sync="add_time"></date-picker-range>
<select-mer-supplier :supplier-id.sync="supplier_id"></select-mer-supplier>
<el-select v-model="warehouse_id" placeholder="采购仓库" size="small" clearable>
<el-option value="">所有仓库</el-option>
<el-option v-for="item in warehouse" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</template>
<el-button type="primary" @click="search" size="small">搜索</el-button>
<if condition="$authArr['addRetreatOrder'] eq true">
<el-button type="primary" plain @click="addRetreatOrder" size="small">新增</el-button>
</if>
<if condition="$authArr['exportOperation'] eq true">
<el-button @click="exportOperation" size="small">导出</el-button>
</if>
</div>
</div>
<div>
<template>
<el-table :data="TotalList" style="width: calc(100vw - 208px);border: none;">
<el-table-column prop="orderCount" label="订单数"></el-table-column>
<el-table-column prop="goodsCount" label="退货商品种数"></el-table-column>
<el-table-column prop="total_cost_price" label="原采购价"></el-table-column>
<el-table-column prop="totalMoney" label="退货金额"></el-table-column>
<el-table-column prop="difference_money" label="盈亏金额"></el-table-column>
</el-table>
</template>
</div>
<div style="border: 1px solid #e6e6e6;max-width: calc(100vw - 208px);">
<el-table border :data="retreatOrderList" style="width: calc(100vw - 208px);border: none;" size="mini"
max-height="500" v-loading="loading" element-loading-text="数据获取中" element-loading-spinner="el-icon-loading">
<el-table-column prop="index" label="序号" show-overflow-tooltip></el-table-column>
<el-table-column prop="operator" label="操作人" show-overflow-tooltip></el-table-column>
<el-table-column prop="add_time" label="退货时间" show-overflow-tooltip></el-table-column>
<el-table-column prop="order_number" label="退货单号" show-overflow-tooltip></el-table-column>
<el-table-column prop="supplier" label="供应商" show-overflow-tooltip></el-table-column>
<el-table-column prop="warehouse" label="仓库" show-overflow-tooltip></el-table-column>
<el-table-column prop="goods_species" label="合计" show-overflow-tooltip></el-table-column>
<el-table-column prop="total_cost_price" label="原采购金额" show-overflow-tooltip></el-table-column>
<el-table-column prop="money_total" label="退货金额" show-overflow-tooltip></el-table-column>
<el-table-column prop="difference_money" label="盈亏金额" show-overflow-tooltip></el-table-column>
<el-table-column prop="remarks" label="备注" show-overflow-tooltip></el-table-column>
<el-table-column fixed="right" label="操作" width="150px" style="border-right: none;">
<template slot-scope="scope">
<if condition="$authArr['OrderInfo'] eq true">
<el-button @click="OrderInfo(scope.row.id,scope.row.operator)" type="text" size="small">详情
</el-button>
</if>
</template>
</el-table-column>
</el-table>
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
:page-sizes="[10, 15, 20, 25, 30, 35, 40, 45, 50]" :page-size="100"
layout="total, sizes, prev, pager, next, jumper" :total="currentLen">
</el-pagination>
</div>
</div>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/Retail/common/js/select-supplier.js"></script>
<script type="text/javascript">
var purchase = new Vue({
el: "#purchase",
data: function () {
return {
TotalList: [],
order_number: "",
add_time: "",
supplier_id: "",
warehouse_id: "",
warehouse: {$warehouse},
retreatOrderList: [],
currentPage: 1,
currentLimit: 10,
currentLen: 0,
loading: true,
showSetChild: false,
dialogTitle: '',
}
},
methods: {
handleSizeChange: function (val) {
this.currentLimit = val;//切换每页数量
this.currentPage = 1;
this.getData();
},
handleCurrentChange: function (val) {
this.currentPage = val;
this.getData();//切换页数
},
//搜索
search: function () {
this.currentPage = 1;
this.getData();
},
//查询
getData: function () {
this.loading = true;
$.ajax({
url: "{:U('retreatOrderList')}",
type: "post",
data: {
page: this.currentPage,
limit: this.currentLimit,
order_number: this.order_number,
supplier_id: this.supplier_id,
warehouse_id: this.warehouse_id,
add_time: this.add_time
},
success: (res) => {
this.loading = false;
this.retreatOrderList = res.data.list;
this.$nextTick(function () {
this.currentLen = parseInt(res.data.count);
})
}
})
$.ajax({
url: "{:U('OrderTotal')}",
type: "post",
data: {
order_number: this.order_number,
supplier_id: this.supplier_id,
warehouse_id: this.warehouse_id,
add_time: this.add_time
},
success: (res) => {
this.loading = false;
this.TotalList = res.data;
}
})
},
addRetreatOrder: function () {
var that = this;
layer.open({
type: 2,
content: "{:U('addRetreatOrder')}",
title: "采购单",
area: ['calc(100% - 160px)', 'calc(100% - 65px)'],
offset: 'rb',
shade: 0,
btnAlign: 'c',
end: function () {
that.getData();
}
})
},
//详情
OrderInfo: function (id, operator) {
var that = this;
layer.open({
type: 2,
content: "{:U('details')}?id=" + id + '&operator=' + operator,
title: "详情",
area: ['calc(100% - 160px)', 'calc(100% - 65px)'],
offset: 'rb',
shade: 0,
btnAlign: 'c',
})
},
exportOperation: function () {
var that = this;
var order_number = that.order_number;
var supplier_id = that.supplier_id;
var warehouse_id = that.warehouse_id;
var add_time = that.add_time;
window.location.href = "{:U('export')}?order_number=" + order_number + "&supplier_id=" + supplier_id + "&warehouse_id=" + warehouse_id + "&add_time=" + add_time
}
},
created: function () {
this.getData();
}
})
</script>