文件

395 行
18 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 10px;
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;
}
.el-range-editor--small .el-range-separator {
line-height: 32px;
}
</style>
<div class="purchaseBox" id="sWarehousingRecordApp" v-cloak>
<div class="center-content">
<div>
<el-input placeholder="入库单号" style="width: 200px" type="text" clearable
@keydown.enter.exact.native.prevent="search"
size="small" v-model="order_number">
</el-input>
<template>
<date-picker-range :date-time.sync="add_time"></date-picker-range>
<el-select v-model="type" placeholder="入库类型" @change="typeOperation" size="small">
<el-option value="" label="所有类型"></el-option>
<el-option value="1" label="采购入库"></el-option>
<el-option value="2" label="补货入库"></el-option>
<el-option value="3" label="盘盈入库"></el-option>
<el-option value="4" label="商户调拨入库" v-if="supplier_type != 2"></el-option>
<el-option value="5" label="门店调拨入库" v-if="supplier_type != 2"></el-option>
<el-option value="6" label="申请调拨入库" v-if="supplier_type != 2"></el-option>
<el-option value="0" label="其他入库" v-if="supplier_type != 2"></el-option>
</el-select>
<select-store-supplier :supplier-id.sync="supplier_id" v-if="supplier_state"></select-store-supplier>
<el-select v-model="status" placeholder="状态" v-if="warehousing_state" size="small">
<el-option value="" label="所有状态"></el-option>
<el-option value="0" label="未入库"></el-option>
<el-option value="1" label="已入库"></el-option>
</el-select>
</template>
<el-button type="primary" @click="search" size="small">搜索</el-button>
<el-button type="primary" plain v-if="operate.addWarehousing" @click="addWarehousing" size="small">新增
</el-button>
<el-button v-if="storeAuth.data_export==1 && operate.exportOperation" type="primary" plain
@click="exportOperation" size="small">导出
</el-button>
</div>
</div>
<div style="border: 1px solid #e6e6e6;max-width: calc(100vw - 208px);">
<el-table border :data="WarehousingRecordList" 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="allocation_time" 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="warehouse_name" label="入库仓库" show-overflow-tooltip></el-table-column>
<el-table-column prop="type_name" label="入库类型" show-overflow-tooltip></el-table-column>
<el-table-column prop="supplier_name" label="供应商" show-overflow-tooltip></el-table-column>
<el-table-column prop="goods_species" label="应收商品种数" show-overflow-tooltip></el-table-column>
<el-table-column prop="money_total" label="应收金额" show-overflow-tooltip
v-if="storeAuth.showpurch_price == 1"></el-table-column>
<el-table-column prop="real_goods_species" label="实收商品种数" show-overflow-tooltip></el-table-column>
<el-table-column prop="real_money_total" label="实收金额" show-overflow-tooltip
v-if="storeAuth.showpurch_price == 1"></el-table-column>
<el-table-column prop="refuse_goods_species" label="拒收商品种数" show-overflow-tooltip></el-table-column>
<el-table-column prop="refuse_total_stock_money" label="拒收收金额" show-overflow-tooltip
v-if="storeAuth.showpurch_price == 1"></el-table-column>
<el-table-column prop="remarks" label="备注" show-overflow-tooltip></el-table-column>
<el-table-column prop="examine_name" label="状态" show-overflow-tooltip></el-table-column>
<el-table-column fixed="right" label="操作" width="150px" style="border-right: none;">
<template slot-scope="scope">
<el-dropdown>
<el-button type="primary" size="mini">
操作<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="allocationDetails(scope.row.id,scope.row.type)"
v-if="operate.allocationDetails&&(scope.row.type == 4 || scope.row.type == 5 || scope.row.type == 6)">
调拨详情
</el-dropdown-item>
<el-dropdown-item
v-if="operate.allocation&&(scope.row.type== 4 || (scope.row.type == 5 && scope.row.examine_status == 1)) && scope.row.status == 0 && scope.row.refuse_status == 1"
@click.native="allocation(scope.row.id,scope.row.type)">入库
</el-dropdown-item>
<el-dropdown-item v-if="operate.OrderInfo&&scope.row.status == 1"
@click.native="OrderInfo(scope.row.id,scope.row.type,scope.row.operator)"
type="text"
size="small">入库详情
</el-dropdown-item>
<el-dropdown-item
v-if="operate.refuse&&(scope.row.type== 4 || (scope.row.type == 5 && scope.row.examine_status == 1)) && scope.row.status == 0 && scope.row.refuse_status == 1"
@click.native="refuse(scope.row.id,scope.row.stock_out_id,scope.row.type)">拒收
</el-dropdown-item>
<el-dropdown-item v-if="operate.refuseInfo&&scope.row.refuse_status == 2"
@click.native="refuseInfo(scope.row.stock_out_id,scope.row.type)">拒收详情
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</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 sWarehousingRecordApp = new Vue({
el: "#sWarehousingRecordApp",
data: function () {
return {
supplier_type: "{$supplier_type}",
showPrice: "{$showPrice}",
order_number: "",
add_time: "",
supplier_id: "",
WarehousingRecordList: [],
currentPage: 1,
currentLimit: 10,
currentLen: 0,
loading: true,
showSetChild: false,
dialogTitle: '',
type: "",
status: "",
supplier_state: true,
warehousing_state: false,
operate: {},//操作权限
}
},
methods: {
handleSizeChange: function (val) {
this.currentLimit = val;//切换每页数量
this.currentPage = 1;
this.getData();
},
handleCurrentChange: function (val) {
this.currentPage = val;
this.getData();//切换页数
},
//入库类型
typeOperation: function () {
var that = this;
var type = that.type;
if (type == 4 || type == 5) {
that.supplier_state = false;
that.supplier_id = "";
that.warehousing_state = true;
} else {
that.supplier_state = true;
that.warehousing_state = false;
that.status = "";
}
},
//搜索
search: function () {
this.currentPage = 1;
this.getData();
},
getData: function () {
this.loading = true;
$.ajax({
url: "{:U('WarehousingRecordList')}",
type: "post",
data: {
page: this.currentPage,
limit: this.currentLimit,
order_number: this.order_number,
supplier_id: this.supplier_id,
add_time: this.add_time,
type: this.type,
status: this.status
},
success: (res) => {
this.loading = false;
this.WarehousingRecordList = res.data.list;
this.$nextTick(function () {
this.currentLen = parseInt(res.data.count);
})
}
})
},
addWarehousing: function () {
var that = this;
layer.open({
type: 2,
content: "{:U('addWarehousing')}",
title: "入库单",
area: ['calc(100% - 160px)', 'calc(100% - 65px)'],
offset: 'rb',
shade: 0,
btnAlign: 'c',
end: function () {
that.getData();
}
})
},
//调拨详情
allocationDetails: function (id, type) {
var that = this;
layer.open({
type: 2,
content: "{:U('allocationDetails')}?id=" + id + "&type=" + type,
title: "详情",
area: ['calc(100% - 160px)', 'calc(100% - 65px)'],
offset: 'rb',
shade: 0,
btnAlign: 'c',
})
},
//入库
allocation: function (id, type) {
var that = this;
layer.open({
type: 2,
content: "{:U('allocation')}?id=" + id + "&type=" + type,
title: "调拨单",
area: ['calc(100% - 160px)', 'calc(100% - 65px)'],
offset: 'rb',
shade: 0,
btnAlign: 'c',
end: function () {
that.getData();
}
})
},
//入库详情
OrderInfo: function (id, type, operator) {
var that = this;
layer.open({
type: 2,
content: "{:U('details')}?id=" + id + "&type=" + type + "&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 add_time = that.add_time;
var type = that.type;
var status = that.status;
window.location.href = "{:U('export')}?order_number=" + order_number + "&supplier_id=" + supplier_id + "&add_time=" + add_time + "&type=" + type + "&status=" + status
},
//拒收
refuse: function (warehousing_id, stock_out_id, type) {
this.$confirm('此操作将拒收所有商品, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var that = this;
$.ajax({
url: "{:U('refuseOperation')}",
type: "post",
data: {
warehousing_id: warehousing_id,
stock_out_id: stock_out_id,
type: type
},
success: function (res) {
if (res.status == 1) {
that.$message({
type: "success",
message: res.message,
duration: 2000,
onClose: function () {
that.getData();
}
});
} else {
that.$message({
type: "error",
message: res.message,
duration: 2000,
});
}
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
});
});
},
//拒收详情
refuseInfo: function (id, type) {
var that = this;
if (type == 5) {
//其他门店调拨
layer.open({
type: 2,
content: "{:U('SStockOutOrder/refuseInfo')}?id=" + id,
title: "拒收商品详情",
area: ['calc(100% - 160px)', 'calc(100% - 65px)'],
offset: 'rb',
shade: 0,
btnAlign: 'c',
})
} else {
layer.open({
type: 2,
content: "{:U('StockOutOrder/refuseInfo')}?id=" + id + "&type=" + type,
title: "拒收商品详情",
area: ['calc(100% - 160px)', 'calc(100% - 65px)'],
offset: 'rb',
shade: 0,
btnAlign: 'c',
})
}
},
//获取操作权限
getOperate() {
var auth_list = {
addWarehousing: '/index.php/Retail/SWarehousingRecord/addWarehousing',
exportOperation: '/index.php/Retail/SWarehousingRecord/export',
allocationDetails: '/index.php/Retail/SWarehousingRecord/allocationDetails',
allocation: '/index.php/Retail/SWarehousingRecord/allocation',
OrderInfo: '/index.php/Retail/SWarehousingRecord/details',
refuse: '/index.php/Retail/SWarehousingRecord/refuseOperation',
refuseInfo: '/index.php/Retail/StockOutOrder/refuseInfo'
};
$.ajax({
url: '/index.php/Retail/Component/checkOperateAuth',
type: "post",
data: {
auth_list: JSON.stringify(auth_list),
},
success: (res) => {
if (res.status == 1) {
this.operate = res.data;
}
}
})
},
},
created: function () {
this.getOperate();
this.getData();
}
})
</script>