增加 表头 打印 和行号

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 double shwl { get; set; }
public string cPosName { get; set; } public string cPosName { get; set; }
public string invsort { get; set; }
/// <summary> /// <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 '委外' WHEN c.bPurchase <> 1 AND c.bProxyForeign = 1 and c.bself <> 1 THEN '委外'
ELSE '其它' ELSE '其它'
END AS std, ma.Qty qty1, ma.IssQty issqty,(ma.Qty-ma.IssQty) as wll, motype.description, 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 FROM mom_order m WITH (NOLOCK) INNER JOIN
mom_orderdetail md WITH (NOLOCK) ON m.MoId = md.MoId 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 mom_morder mor WITH (NOLOCK) ON md.MoDId = mor.MoDId INNER JOIN

View File

@@ -333,7 +333,7 @@ FROM
POSITION b WITH ( NOLOCK ) POSITION b WITH ( NOLOCK )
WHERE WHERE
a.iQuantity <> 0 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 ) a
WHERE WHERE
b.cinvcode = a.cinvcode 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": { "vue-router": {
"version": "3.5.1", "version": "3.5.1",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.5.1.tgz", "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.5.1.tgz",

View File

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

View File

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

View File

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

View File

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