449 行
21 KiB
HTML
可执行文件
449 行
21 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;
|
||
}
|
||
|
||
.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="purchase" v-cloak>
|
||
<div class="center-content">
|
||
<div>
|
||
<el-input placeholder="出库单号" style="width: 200px" type="text"
|
||
@keydown.enter.exact.native.prevent="search"
|
||
clearable 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="3" label="申请调拨出库"></el-option>
|
||
<el-option value="2" label="盘亏出库"></el-option>
|
||
<el-option value="4" label="退货出库"></el-option>
|
||
<el-option value="0" label="其他出库"></el-option>
|
||
</el-select>
|
||
<select-mer-supplier :supplier-id.sync="supplier_id" v-if="type==4"></select-mer-supplier>
|
||
|
||
<el-select v-model="warehousing_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>
|
||
<if condition="$authArr['addStockOut'] eq true">
|
||
<el-button type="primary" plain @click="addStockOut" size="small">新增</el-button>
|
||
</if>
|
||
<if condition="$authArr['exportOperation'] eq true">
|
||
<el-button @click="exportOperation" size="small">导出</el-button>
|
||
</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="出库成本价合计"></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="实收成本合计"></el-table-column>
|
||
<el-table-column prop="real_money_total" label="实收价合计"></el-table-column>
|
||
<el-table-column prop="differenceMoney" label="实收盈亏金额"></el-table-column>
|
||
<el-table-column prop="refuse_goods_species" label="拒收商品种数"></el-table-column>
|
||
<el-table-column prop="refuse_total_cost_money" label="拒收成本价合计"></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="store_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></el-table-column>
|
||
<el-table-column prop="money_total" label="出库价" show-overflow-tooltip></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></el-table-column>
|
||
<el-table-column prop="real_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="refuse_goods_species" label="拒收商品种数" show-overflow-tooltip></el-table-column>
|
||
<el-table-column prop="refuse_total_cost_money" label="拒收成本合计" show-overflow-tooltip></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['warehousingInfo'] eq true">
|
||
<el-dropdown-item v-if="scope.row.warehousing_status == 1"
|
||
@click.native="warehousingInfo(scope.row.id)">入库详情
|
||
</el-dropdown-item>
|
||
</if>
|
||
<if condition="$authArr['refuse_info'] eq true">
|
||
<el-dropdown-item v-if="scope.row.refuse_status == 2"
|
||
@click.native="refuse_info(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" src="__PUBLIC__/receipt/JsBarcode.js"></script>
|
||
<script type="text/javascript">
|
||
var purchase = new Vue({
|
||
el: "#purchase",
|
||
data: function () {
|
||
return {
|
||
supplier_id: "",
|
||
order_number: "",
|
||
add_time: "",
|
||
TotalList: [],
|
||
StockOrderList: [],
|
||
currentPage: 1,
|
||
currentLimit: 10,
|
||
currentLen: 0,
|
||
loading: true,
|
||
showSetChild: false,
|
||
dialogTitle: '',
|
||
type: "",
|
||
warehousing_state: false,
|
||
warehousing_status: "",
|
||
orderNumberCode: "123456789", //打印专用
|
||
showPrintSet: false,
|
||
printForm: {
|
||
printNum: 1,
|
||
labelWidth: 58,
|
||
labelHeight: 40,
|
||
showNum: 1,
|
||
},
|
||
ppiRate: 3.779,//电脑屏幕与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;
|
||
if (type == 1) {
|
||
that.warehousing_state = true;
|
||
} else {
|
||
that.warehousing_state = false;
|
||
that.warehousing_status = "";
|
||
}
|
||
},
|
||
//搜索
|
||
search: function () {
|
||
this.currentPage = 1;
|
||
this.getData();
|
||
},
|
||
//列表
|
||
getData: function () {
|
||
this.loading = true;
|
||
$.ajax({
|
||
url: "{:U('stockOrderList')}",
|
||
type: "post",
|
||
data: {
|
||
page: this.currentPage,
|
||
limit: this.currentLimit,
|
||
order_number: this.order_number,
|
||
add_time: this.add_time,
|
||
type: this.type,
|
||
supplier_id: this.supplier_id,
|
||
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: {
|
||
order_number: this.order_number,
|
||
add_time: this.add_time,
|
||
type: this.type,
|
||
supplier_id: this.supplier_id,
|
||
warehousing_status: this.warehousing_status
|
||
},
|
||
success: (res) => {
|
||
this.loading = false;
|
||
this.TotalList = res.data;
|
||
}
|
||
})
|
||
},
|
||
addStockOut: function () {
|
||
var that = this;
|
||
layer.open({
|
||
type: 2,
|
||
content: "{:U('addStockOut')}",
|
||
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',
|
||
})
|
||
},
|
||
//门店详情
|
||
warehousingInfo: function (id) {
|
||
var that = this;
|
||
layer.open({
|
||
type: 2,
|
||
content: "{:U('warehousingInfo')}?id=" + id,
|
||
title: "门店入库详情",
|
||
area: ['calc(100% - 160px)', 'calc(100% - 65px)'],
|
||
offset: 'rb',
|
||
shade: 0,
|
||
btnAlign: 'c',
|
||
})
|
||
},
|
||
refuse_info: function (id) {
|
||
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) {
|
||
console.log(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);
|
||
console.log(_width, _height);
|
||
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> |