文件

461 行
22 KiB
HTML
可执行文件

此文件含有模棱两可的 Unicode 字符

此文件含有可能会与其他字符混淆的 Unicode 字符。 如果您是想特意这样的,可以安全地忽略该警告。 使用 Escape 按钮显示他们。

<!--[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;
}
.print-tip {
color: #aaa;
}
#purchase .el-drawer {
height: 500px;
top: auto;
}
.el-range-editor--small .el-range-separator {
line-height: 32px;
}
</style>
<div class="purchaseBox" id="sStockOutOrderApp" v-cloak>
<div class="center-content">
<div>
<el-input placeholder="出库单号" type="text" style="width: 200px" 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" clearable>
<el-option value="1" label="退货至商户出库"></el-option>
<el-option value="9" label="退货至供货商出库"></el-option>
<el-option value="2" label="盘亏出库"></el-option>
<el-option value="3" label="调拨出库"></el-option>
<el-option value="0" label="其他出库"></el-option>
</el-select>
<select-store-supplier :supplier-id.sync="supplier_id" v-if="type == 9"></select-store-supplier>
<el-select v-model="warehousing_status" placeholder="所有状态" v-if="type == 1 || type == 3" 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" plain @click="search" size="small">搜索</el-button>
<if condition="$authArr['addStockOut'] eq true">
<el-button type="primary" plain @click="addStockOut(0)" size="small">新增</el-button>
</if>
<if
condition="$global_store_jurisdiction && ($global_store_jurisdiction['data_export'] eq '2') && $identity eq 2">
<else />
<if condition="$authArr['exportOperation'] eq true">
<el-button type="primary" plain @click="exportOperation" size="small">导出</el-button>
</if>
</if>
<el-button plain size="small" @click="batchPrint">批量打印单号</el-button>
<el-button round size="small" @click="showPrintSet=true">打印设置</el-button>
</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="goods_species" label="出库商品种数"></el-table-column>
<el-table-column prop="total_cost_price" label="出库成本合计" v-if="storeAuth.showpurch_price == 1">
</el-table-column>
<el-table-column prop="money_total" label="出库价合计"></el-table-column>
<el-table-column prop="real_goods_species" label="实收商品种数"></el-table-column>
<el-table-column prop="real_total_cost_money" label="实收成本合计" v-if="storeAuth.showpurch_price == 1">
</el-table-column>
<el-table-column prop="real_money_total" label="实收价合计" v-if="storeAuth.showpurch_price == 1">
</el-table-column>
<el-table-column prop="differenceMoney" label="实收盈亏金额" v-if="storeAuth.showpurch_price == 1">
</el-table-column>
<el-table-column prop="refuse_goods_species" label="拒收商品种数"></el-table-column>
<el-table-column prop="refuse_total_cost_money" label="拒收成本价合计" v-if="storeAuth.showpurch_price == 1">
</el-table-column>
<el-table-column prop="refuse_total_stock_money" label="拒收出库价合计"></el-table-column>
</el-table>
</template>
</div>
<div style="border: 1px solid #e6e6e6;max-width: calc(100vw - 208px);">
<el-table border :data="StockOrderList" style="width: calc(100vw - 208px);border: none;" size="mini"
max-height="500" v-loading="loading" @selection-change="handleSelectionChange" element-loading-text="数据获取中"
element-loading-spinner="el-icon-loading">
<el-table-column type="selection" width="55">
</el-table-column>
<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="warehouse_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="goods_to_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="total_cost_price" label="出库成本价" show-overflow-tooltip
v-if="storeAuth.showpurch_price == 1"></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_total_cost_money" label="实收成本价" show-overflow-tooltip
v-if="storeAuth.showpurch_price == 1"></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="difference_money" 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_cost_money" label="拒收成本价" show-overflow-tooltip
v-if="storeAuth.showpurch_price == 1"></el-table-column>
<el-table-column prop="refuse_total_stock_money" label="拒收出库价" show-overflow-tooltip></el-table-column>
<el-table-column prop="remarks" label="备注" show-overflow-tooltip></el-table-column>
<el-table-column prop="warehousing_name" label="货至状态" show-overflow-tooltip></el-table-column>
<el-table-column fixed="right" label="操作" width="100px" 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">
<if condition="$authArr['OrderInfo'] eq true">
<el-dropdown-item
@click.native="OrderInfo(scope.row.id,scope.row.type,scope.row.operator)">出库详情
</el-dropdown-item>
</if>
<if condition="$authArr['warehouseInfo'] eq true">
<el-dropdown-item
v-if="scope.row.warehousing_status == 1 && (scope.row.type==1 ||scope.row.type==3)"
@click.native="warehouseInfo(scope.row.id,scope.row.type,scope.row.goods_to_name)">
入库详情
</el-dropdown-item>
</if>
<el-dropdown-item v-if="scope.row.examine_status == 2 && scope.row.type==3"
@click.native="addStockOut(scope.row.id)">重新调拨
</el-dropdown-item>
<if condition="$authArr['refuseInfo'] eq true">
<el-dropdown-item v-if="scope.row.refuse_status == 2"
@click.native="refuseInfo(scope.row.id)">拒收详情
</el-dropdown-item>
</if>
<el-dropdown-item @click.native="orderNumberPrint([scope.row])">打印单号
</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 id="prints" style="text-align: center;padding: 20px;display: none"></div>
<el-drawer size="370px" :modal="false" :visible.sync="showPrintSet" title="打印设置" :append-to-body="false">
<el-form label-width="100px" size="small">
<el-form-item label="打印数量">
<el-input v-model="printForm.printNum" oninput="value=this.value.replace(/^[0]|\D/,'')"></el-input>
<div class="print-tip">每个商品标签打印张数,留空默认1张</div>
</el-form-item>
<el-form-item label="打印纸宽">
<el-input v-model="printForm.labelWidth" oninput="value=this.value.replace(/^[0]|\D/,'')"></el-input>
<div class="print-tip">以mm(毫米)为单位</div>
</el-form-item>
<el-form-item label="打印纸高">
<el-input v-model="printForm.labelHeight" oninput="value=this.value.replace(/^[0]|\D/,'')"></el-input>
<div class="print-tip">以mm(毫米)为单位</div>
</el-form-item>
<el-form-item label="显示数字">
<el-switch v-model="printForm.showNum" :inactive-value="0" :active-value="1">
</el-switch>
<div class="print-tip">关闭则不显示条码下面的数字</div>
</el-form-item>
</el-form>
</el-drawer>
</div>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/Retail/common/js/select-supplier.js"></script>
<script type="text/javascript" src="__PUBLIC__/retails/js/LodopFuncs.js"></script>
<script type="text/javascript">
var sStockOutOrderApp = new Vue({
el: "#sStockOutOrderApp",
data: function () {
return {
supplier_id: "",
order_number: "",
add_time: "",
type: "",
TotalList: [],
StockOrderList: [],
currentPage: 1,
currentLimit: 10,
currentLen: 0,
loading: true,
warehousing_status: "",
orderNumberCode: "123456789", //打印预览的二维码
showPrintSet: false,
printForm: {
printNum: 1,
labelWidth: 58,
labelHeight: 40,
showNum: 1,
},
ppiRate: 175,//电脑屏幕与mm单位比例
// 打印
LODOP: null, //声明为全局变量
LODOPbol: true,
selectionData: [],//多选选中的数组
}
},
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;
that.warehousing_status = "";
},
//搜索
search: function () {
this.currentPage = 1;
this.getData();
},
//查询
getData: function () {
this.loading = true;
//列表查询
$.ajax({
url: "{:U('stockOrderList')}",
type: "post",
data: {
supplier_id: this.supplier_id,
page: this.currentPage,
limit: this.currentLimit,
order_number: this.order_number,
add_time: this.add_time,
type: this.type,
warehousing_status: this.warehousing_status
},
success: (res) => {
this.loading = false;
this.StockOrderList = res.data.list;
this.$nextTick(function () {
this.currentLen = parseInt(res.data.count);
})
}
})
//金额统计
$.ajax({
url: "{:U('stockOrderTotal')}",
type: "post",
data: {
supplier_id: this.supplier_id,
order_number: this.order_number,
add_time: this.add_time,
type: this.type,
warehousing_status: this.warehousing_status
},
success: (res) => {
this.TotalList = res.data;
}
})
},
addStockOut: function (id) {
var that = this;
layer.open({
type: 2,
content: "{:U('addStockOut')}?stock_order_id=" + id,
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',
})
},
//入库详情
warehouseInfo: function (id, type, goods_to_name) {
var that = this;
layer.open({
type: 2,
content: "{:U('warehouseInfo')}?id=" + id + "&type=" + type + "&goods_to_name=" + goods_to_name,
title: "入库详情",
area: ['calc(100% - 160px)', 'calc(100% - 65px)'],
offset: 'rb',
shade: 0,
btnAlign: 'c',
})
},
//拒收详情
refuseInfo: function (id) {
var that = this;
layer.open({
type: 2,
content: "{:U('refuseInfo')}?id=" + id,
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 add_time = that.add_time;
var type = that.type;
var supplier_id = that.supplier_id;
var warehousing_status = that.warehousing_status;
window.location.href = "{:U('export')}?order_number=" + order_number + "&add_time=" + add_time + "&type=" + type + "&warehousing_status=" + warehousing_status + "&supplier_id=" + supplier_id
},
//打印
handleSelectionChange(data) {
console.log(data);
this.selectionData = data;
},
batchPrint() {
if (!this.selectionData.length) {
this.$message({message: '请选择要打印的单号', type: 'warning'});
return;
}
this.orderNumberPrint(this.selectionData)
},
//打印订单号
orderNumberPrint(data) {
var num = this.printForm.printNum || 1;
var _width = this.printForm.labelWidth || 58;
var _height = this.printForm.labelHeight || 40;
_width = parseInt(_width * this.ppiRate);
_height = parseInt(_height * this.ppiRate);
for (var i = 0; i < data.length; i++) {
var codeNumber = '';
if (this.printForm.showNum) {
codeNumber = `<div style="padding-top: -5px;font-size: 14px;">${data[i].order_number}</div>`;
}
for (var k = 0; k < num; k++) {
$("#prints").html(`<div style="width:${_width}px;height:${_height}px;padding:0 10px;text-align: center;display: flex;align-items:center;justify-content:center;flex-direction:column;box-sizing: border-box">
<img id="imgCode"/>
${codeNumber}
</div>`);
var h = parseInt(_height * 0.8);
$('#imgCode').JsBarcode(data[i].order_number, {
format: "CODE128",
displayValue: false,
height: h,
width: 1,
fontSize: 12,
margin: 0
});
this.Preview1();
}
}
},
Preview1() {
if (!this.LODOPbol) {
return;
}
this.LODOP = getLodop();
// console.log(LODOP);
if (this.LODOP) {
this.LODOP.SET_PREVIEW_WINDOW(0, 1, 0, this.arrDPI[0], this.arrDPI[1], "");
this.LODOP.SET_SHOW_MODE("PREVIEW_NO_MINIMIZE", true);//预览窗口禁止最小化,并始终最前
this.LODOP.SET_PRINT_MODE("AUTO_CLOSE_PREWINDOW", 1);
this.AddPrintContent();
this.LODOP.PRINT();
} else {
this.LODOPbol = false;
this.$message({message: '打印机未准备好,无法打印', type: 'warning'});
}
},
AddPrintContent() {
this.LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", document.getElementById("prints").innerHTML);
this.LODOP.SET_PRINT_PAGESIZE(3, 5700, 50, "");
},
},
created: function () {
this.getData();
var arrDPI = new Array;
if (window.screen.deviceXDPI) {
arrDPI[0] = window.screen.deviceXDPI;
arrDPI[1] = window.screen.deviceYDPI;
} else {
var tmpNode = document.createElement("DIV");
tmpNode.style.cssText = "width:1in;height:1in;position:absolute;left:0px;top:0px;z-index:99;visibility:hidden";
document.body.appendChild(tmpNode);
arrDPI[0] = parseInt(tmpNode.offsetWidth);
arrDPI[1] = parseInt(tmpNode.offsetHeight);
tmpNode.parentNode.removeChild(tmpNode);
}
this.ppiRate = arrDPI[0] * 100 / 2540;
this.arrDPI = arrDPI;
console.log(this.arrDPI, this.ppiRate);
}
})
</script>