增加 表头 打印 和行号

This commit is contained in:
杰 朱
2021-09-03 11:30:15 +08:00
parent 0ada5e1ab4
commit ed16762195
8 changed files with 556 additions and 471 deletions

View File

@@ -50,6 +50,7 @@ namespace NX.ERP.Model
public double shwl { get; set; }
public string cPosName { get; set; }
public string invsort { get; set; }
/// <summary>

View File

@@ -328,7 +328,7 @@ SELECT m..mocode,CONVERT(varchar(100), mor.StartDate, 23) as StartDate ,md.Rem
WHEN c.bPurchase <> 1 AND c.bProxyForeign = 1 and c.bself <> 1 THEN '委外'
ELSE '其它'
END AS std, ma.Qty qty1, ma.IssQty issqty,(ma.Qty-ma.IssQty) as wll, motype.description,
CASE WHEN md.Status = 2 THEN '锁定' WHEN md.Status = 4 THEN '关闭' WHEN md.Status = 3 THEN '审核' ELSE '新建' END AS st, md.Status,ISNULL(ds.qty, 0) dqty,post.cPosName
CASE WHEN md.Status = 2 THEN '锁定' WHEN md.Status = 4 THEN '关闭' WHEN md.Status = 3 THEN '审核' ELSE '新建' END AS st, md.Status,ISNULL(ds.qty, 0) dqty,post.cPosName,ma.SortSeq as invsort
FROM mom_order m WITH (NOLOCK) INNER JOIN
mom_orderdetail md WITH (NOLOCK) ON m.MoId = md.MoId INNER JOIN
mom_morder mor WITH (NOLOCK) ON md.MoDId = mor.MoDId INNER JOIN

View File

@@ -333,7 +333,7 @@ FROM
POSITION b WITH ( NOLOCK )
WHERE
a.iQuantity <> 0
AND a.cPosCode= b.cPosCode
AND a.cPosCode= b.cPosCode and a.cPosCode not in ('00701','00801','09001') and a.cWhCode not in (4,5)
) a
WHERE
b.cinvcode = a.cinvcode

View File

@@ -11790,6 +11790,14 @@
}
}
},
"vue-print-nb": {
"version": "1.7.5",
"resolved": "https://registry.npmjs.org/vue-print-nb/-/vue-print-nb-1.7.5.tgz",
"integrity": "sha512-iNbNyUVRWz0Ha1UTiCKxMPtHLUDGgNI8e8xmD3xqm9RlXIUeX9bT7DgNAfY8vPzqyFRHqGjxLI1rycKH366ziQ==",
"requires": {
"vue": "^2.6.11"
}
},
"vue-router": {
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.5.1.tgz",

View File

@@ -19,6 +19,7 @@
"vue": "^2.6.11",
"vue-clipboard2": "^0.3.1",
"vue-echarts": "^6.0.0-rc.5",
"vue-print-nb": "^1.7.5",
"vue-router": "^3.5.1",
"xlsx": "^0.16.9"
},

View File

@@ -3,6 +3,7 @@ import App from "./App.vue";
import ViewUI from "view-design";
import "view-design/dist/styles/iview.css";
import VueClipboard from "vue-clipboard2";
//import print from 'vue-print-nb'
// import HelloWorld from "./components/HelloWorld.vue";

View File

@@ -12,20 +12,11 @@
<Input v-model="filter.material_code" />
</Col>
<Col span="6">
<Button
size="large"
type="primary"
icon="ios-search"
@click="handleClick"
>查询</Button
>
<Button size="large" type="success" @click="handelExport"
>导出</Button
>
<Button size="large" type="info" @click="print"
<Button size="large" type="primary" icon="ios-search" @click="handleClick">查询</Button>
<Button size="large" type="success" @click="handelExport">导出</Button>
<!-- <Button size="large" type="info" @click="print"
>打印</Button
>
>-->
</Col>
</Row>
</div>
@@ -37,8 +28,7 @@
border
:columns="columnsMaterialAppVouch"
:data="pagedData"
>
</Table>
></Table>
</div>
<Page
style="margin-top: 20px"
@@ -56,30 +46,36 @@
<Modal width="1366" v-model="modal1" title="单据详情" @on-cancel="cancel">
<Button size="large" type="primary" @click="print">打印</Button>
<div id="tb2">
<div class="divHeader">
<Col span="8">{{this.ccode}}</Col>
</div>
<div>
<Row :gutter="16">
<Col span="7">
<label></label>
</Col>
<Col span="6">
<h1>采购到货单</h1>
<h1>领料单</h1>
</Col>
</Row>
</div>
<div>
<Row :gutter="16">
<Col span="8">
{{"领料单号:"+this.ccode}}
</Col>
<Col span="6">
{{"领料时间:"+this.ArrivalDate}}
</Col>
<Col span="4">
{{"业务员:"+this.cpersonname}}
</Col>
<Col span="8">{{"领料单号:"+this.ccode}}</Col>
<Col span="6">{{"领料时间:"+this.demand_date}}</Col>
<Col span="4">{{"拣货员:"+this.cpersonname}}</Col>
</Row>
<Row :gutter="16">
<Col span="8">{{"生产订单:"+this.product_order_no}}</Col>
<Col span="4">{{"产品编码:"+this.product_code}}</Col>
<Col span="6">{{"产品名称:"+this.product_name}}</Col>
</Row>
</div>
</div>
<div>
<Table
style="margin-top: 20px"
height="700"
@@ -87,8 +83,8 @@
border
:columns="columns2"
:data="datas2"
>
</Table>
></Table>
</div>
</div>
</Modal>
</div>
@@ -112,21 +108,25 @@
pageSize: 15,
datas: [],
ccode: "",
ArrivalDate:"",
demand_date: "",
cpersonname: "",
demand_date: "",
product_code: "",
product_name: "",
datas2: [],
product_order_no: "",
filter: {
app_vouch_order_no: "",
material_code: "",
material_code: ""
},
dom: "",
ranges: [
{
type: "price",
ccode: "",
ccode: ""
// low: "", //区间的最小值
// height: "", //区间的最大值
},
}
],
columnsMaterialAppVouch: [
// {
@@ -135,47 +135,70 @@
// width: 60,
// align: "center",
// },
{
title: "领料单号",
align: "center",
key: "app_vouch_order_no",
width: 150,
width: 135,
className: "demo-table-info-new",
render: (h, params) => {
return h("div", [
h(
"a",
{
props: {
type: "primary",
size: "small"
},
style: { color: "#2db7f5" },
domProps: {
title: params.row.app_vouch_order_no //添加title属性
},
on: {
click: () => {
this.handleShow(params.row.app_vouch_order_no, ""); //点击事件
}
}
},
params.row.app_vouch_order_no
)
]);
}
},
{
title: "行号",
align: "center",
key: "irowno",
width: 90,
width: 90
},
{
title: "存货编码",
align: "center",
key: "material_code",
width: 110,
className: "demo-table-info-new",
className: "demo-table-info-new"
},
{
title: "存货名称",
align: "center",
key: "material_name",
width: 130,
className: "demo-table-info-nom",
className: "demo-table-info-nom"
},
{
title: "规格型号",
align: "center",
key: "material_spec",
width: 150,
className: "demo-table-info-nom",
className: "demo-table-info-nom"
},
{
title: "单位",
align: "center",
key: "unit",
width: 80,
className: "demo-table-info-nom",
className: "demo-table-info-nom"
},
{
@@ -183,35 +206,35 @@
align: "center",
key: "qty",
width: 80,
className: "demo-table-info-nom",
className: "demo-table-info-nom"
},
{
title: "现存量",
align: "center",
key: "wh_qty",
width: 80,
className: "demo-table-info-nom",
className: "demo-table-info-nom"
},
{
title: "现存库位",
key: "position",
width: 160,
align: "left",
className: "demo-table-info-nom",
className: "demo-table-info-nom"
},
{
title: "需求日期",
align: "center",
key: "demand_date",
width: 150,
className: "demo-table-info-nom",
className: "demo-table-info-nom"
},
{
title: "仓库",
align: "center",
key: "warehouse_name",
width: 150,
className: "demo-table-info-nom",
className: "demo-table-info-nom"
},
{
@@ -219,36 +242,36 @@
align: "center",
key: "product_order_no",
width: 150,
className: "demo-table-info-nom",
className: "demo-table-info-nom"
},
{
title: "行号",
align: "center",
key: "product_order_line_no",
width: 70,
className: "demo-table-info-nom",
className: "demo-table-info-nom"
},
{
title: "产品编码",
align: "center",
key: "product_code",
width: 150,
className: "demo-table-info-nom",
className: "demo-table-info-nom"
},
{
title: "产品名称",
align: "center",
key: "product_name",
width: 150,
className: "demo-table-info-nom",
className: "demo-table-info-nom"
},
{
title: "产品规格",
align: "product_spec",
key: "Quantity",
width: 150,
className: "demo-table-info-nom",
},
className: "demo-table-info-nom"
}
],
columns: [
{
@@ -264,117 +287,128 @@
{
props: {
type: "primary",
size: "small",
size: "small"
},
style: { color: "#2db7f5" },
domProps: {
title: params.row.ArrivalCode, //添加title属性
title: params.row.ArrivalCode //添加title属性
},
on: {
click: () => {
this.handleShow(params.row.ArrivalCode); //点击事件
},
},
}
}
},
params.row.ArrivalCode
),
)
]);
},
}
},
{
title: "到货日期",
align: "center",
key: "ArrivalDate",
key: "ArrivalDate"
},
{
title: "业务员",
align: "center",
key: "cpersonname",
key: "cpersonname"
},
{
title: "存货编码",
align: "center",
key: "MaterialCode",
key: "MaterialCode"
},
{
title: "存货名称",
align: "center",
key: "cinvname",
key: "cinvname"
},
{
title: "规格型号",
align: "center",
key: "cinvstd",
key: "cinvstd"
},
{
title: "单位",
align: "center",
key: "cinvm_unit",
key: "cinvm_unit"
},
{
title: "到货数量",
align: "center",
key: "Quantity",
key: "Quantity"
},
{
title: "现存库位",
align: "center",
key: "cPosName",
width: 200,
},
width: 200
}
],
columns2: [
{
title: "行号",
align: "center",
key: "irowno",
width: 80
},
{
title: "存货编码",
align: "center",
key: "MaterialCode",
key: "material_code",
width: 110,
className: "demo-table-info-new",
className: "demo-table-info-new"
},
{
title: "存货名称",
align: "center",
key: "cinvname",
key: "material_name",
width: 130,
className: "demo-table-info-nom",
className: "demo-table-info-nom"
},
{
title: "规格型号",
align: "center",
key: "cinvstd",
width: 135,
className: "demo-table-info-nom",
key: "material_spec",
width: 150,
className: "demo-table-info-nom"
},
{
title: "单位",
align: "center",
key: "cinvm_unit",
key: "unit",
width: 80,
className: "demo-table-info-nom",
className: "demo-table-info-nom"
},
{
title: "数量",
align: "center",
key: "Quantity",
key: "qty",
width: 80,
className: "demo-table-info-nom",
className: "demo-table-info-nom"
},
{
title: "现存量",
align: "center",
key: "wh_qty",
width: 80,
className: "demo-table-info-nom"
},
{
title: "现存库位",
key: "cPosName",
key: "position",
width: 160,
align: "left",
className: "demo-table-info-nom",
},
],
className: "demo-table-info-nom"
}
]
};
},
computed: {
@@ -383,7 +417,7 @@
},
pagedData() {
return pageingData(this.datas, this.pageSize, this.pageNo);
},
}
},
mounted() {
this.loadData();
@@ -396,18 +430,18 @@
this.loadData();
},
print() {
this.dom = document.getElementById("tb");
this.dom = document.getElementById("tb2");
// console.log(this.dom);
console.log(this.dom);
this.$print(this.dom);
},
inventory(ranges) {
const skus = new Array();
//筛选条件
this.datas.map((Item, index) => {
if (Item.ArrivalCode == this.ranges[0].ccode) {
if (Item.app_vouch_order_no == this.ranges[0].ccode) {
skus.push({
...Item,
...Item
});
}
});
@@ -422,9 +456,14 @@
this.ranges[0].ccode = h;
this.datas2 = this.inventory(this.ranges);
this.ccode = h;
this.ArrivalDate=this.datas2[0].ArrivalDate;
this.cpersonname=this.datas2[0].cpersonname;
this.product_order_no = this.datas2[0].product_order_no;
this.app_vouch_order_no = this.datas2[0].app_vouch_order_no;
this.demand_date = this.datas2[0].demand_date;
this.product_code = this.datas2[0].product_code;
this.product_name = this.datas2[0].product_name;
//app_vouch_order_no
// this.cpersonname = this.datas2[0].cpersonname;
this.modal1 = true;
},
@@ -447,14 +486,29 @@
},
handlePageSize(pageSize) {
this.pageSize = pageSize;
},
},
}
}
};
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style >
@media screen {
div.divHeader {
display: none;
}
}
@media print {
div.divHeader {
position: fixed;
right: 20px;
top: 5x;
z-index: 1;
}
}
h3 {
margin: 40px 0 0;
}

View File

@@ -69,6 +69,9 @@
<Modal width="1366" v-model="modal1" title="单据详情" @on-cancel="cancel">
<Button size="large" type="primary" @click="print">打印</Button>
<div id="tb2">
<div class="divHeader">
<Col span="8">{{this.ccode}}</Col>
</div>
<div>
<Row :gutter="16">
<Col span="7">
@@ -81,13 +84,16 @@
</div>
<div>
<Row :gutter="16">
<Col span="8">{{"单据号:"+this.ccode}}</Col>
<Col span="6">
<Col span="4">{{"单据号:"+this.ccode}}</Col>
<Col span="4">
{{"产品编码:"+this.inv_code}}
</Col>
<Col span="4">
<Col span="6">
{{"产品名称:"+this.c_inv_name}}
</Col>
<Col span="2">
{{"拣货员:"}}
</Col>
</Row>
</div>
<Table
@@ -501,6 +507,20 @@ export default {
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style >
@media screen {
div.divHeader {
display: none;
}
}
@media print {
div.divHeader {
position: fixed;
right: 20px;
top: 5x;
z-index: 1;
}
}
h3 {
margin: 40px 0 0;
}