This commit is contained in:
杰 朱
2022-04-11 13:33:53 +08:00
parent f4b34807a9
commit 480efb7334
2 changed files with 239 additions and 241 deletions

View File

@@ -88,7 +88,7 @@ namespace NX.ERP.U8.Finance
public IEnumerable<object> Voucherror(NX.ERP.Model.Request.VouchererrorRequest info) public IEnumerable<object> Voucherror(NX.ERP.Model.Request.VouchererrorRequest info)
{ {
string sql = $@" string sql = $@"
select *from ( select *from (
select c.MoCode,b.SortSeq,b.InvCode,d.cInvName,a.InvCode as InvCode1, t.cInvName as cInvName1,t.cInvStd,a.Qty , a.IssQty ,'超领' as error from mom_moallocate a WITH (NOLOCK) select c.MoCode,b.SortSeq,b.InvCode,d.cInvName,a.InvCode as InvCode1, t.cInvName as cInvName1,t.cInvStd,a.Qty , a.IssQty ,'超领' as error from mom_moallocate a WITH (NOLOCK)
left join mom_orderdetail b WITH (NOLOCK) on a.MoDId= b.MoDId left join mom_orderdetail b WITH (NOLOCK) on a.MoDId= b.MoDId
left join mom_order c WITH (NOLOCK) on b.MoId= c.MoId left join mom_order c WITH (NOLOCK) on b.MoId= c.MoId
@@ -103,7 +103,16 @@ namespace NX.ERP.U8.Finance
left join Inventory d WITH (NOLOCK) on b.InvCode= d.cInvCode left join Inventory d WITH (NOLOCK) on b.InvCode= d.cInvCode
left join Inventory t WITH (NOLOCK) on a.InvCode= t.cInvCode left join Inventory t WITH (NOLOCK) on a.InvCode= t.cInvCode
where a.IssQty < a.Qty*(b.QualifiedInQty/b.qty) where a.IssQty < a.Qty*(b.QualifiedInQty/b.qty)
) mm
union all
select c.MoCode,b.SortSeq,b.InvCode,d.cInvName,a.InvCode as InvCode1, t.cInvName as cInvName1,t.cInvStd,a.Qty , a.IssQty ,'无应领' as error from mom_moallocate a WITH (NOLOCK)
left join mom_orderdetail b WITH (NOLOCK) on a.MoDId= b.MoDId
left join mom_order c WITH (NOLOCK) on b.MoId= c.MoId
left join Inventory d WITH (NOLOCK) on b.InvCode= d.cInvCode
left join Inventory t WITH (NOLOCK) on a.InvCode= t.cInvCode
where a.Qty=0 and b.QualifiedInQty>0
) mm
"; ";

View File

@@ -4,34 +4,21 @@
<div> <div>
<Row :gutter="16"> <Row :gutter="16">
<Col span="4"> <Col span="4">
<label>生产订单号</label> <label>生产订单号</label>
<Input autosize type="textarea" v-model="filter.mo_codes" /> <Input autosize type="textarea" v-model="filter.mo_codes" />
</Col> </Col>
<Col span="3"> <Col span="3">
<label>异常类型:</label> <label>异常类型:</label>
<div> <div>
<Select v-model="filter.by_finish" multiple> <Select v-model="filter.by_finish" multiple>
<Option <Option v-for="item in stateList" :value="item.value" :key="item.value">{{ item.label }}</Option>
v-for="item in stateList" </Select>
:value="item.value" </div>
:key="item.value"
>{{ item.label }}</Option
>
</Select>
</div>
</Col> </Col>
<Col span="4"> <Col span="4">
<Button <Button size="large" type="primary" icon="ios-search" @click="handleClick">查询</Button>
size="large" <Button size="large" type="success" @click="handelExport">导出</Button>
type="primary"
icon="ios-search"
@click="handleClick"
>查询</Button
>
<Button size="large" type="success" @click="handelExport"
>导出</Button
>
</Col> </Col>
</Row> </Row>
</div> </div>
@@ -39,245 +26,247 @@
<div> <div>
<Row :gutter="16"> <Row :gutter="16">
<Col span="4"> <Col span="4">
<label></label> <label></label>
</Col> </Col>
<Col span="12"> <Col span="12">
<label>超领:已领大于应领; 缺领:已领小于(应领*(入库量/生产量))</label> <label>超领:已领大于应领; 缺领:已领小于(应领*(入库量/生产量))</label>
</Col> </Col>
</Row> </Row>
</div> </div>
<div id="tb"> <div id="tb">
<Table <Table style="margin-top: 20px" :loading="loading" size="small" border :columns="columns" :data="pagedData">
style="margin-top: 20px"
:loading="loading"
size="small"
border
:columns="columns"
:data="pagedData"
>
</Table> </Table>
</div> </div>
<Page <Page style="margin-top: 20px" :current="pageNo" :page-size="pageSize" :total="total" :page-size-opts="PageSizeOpts"
style="margin-top: 20px" @on-change="handlePagechange" @on-page-size-change="handlePageSize" show-elevator show-sizer show-total
:current="pageNo" size="small" />
:page-size="pageSize"
:total="total"
:page-size-opts="PageSizeOpts"
@on-change="handlePagechange"
@on-page-size-change="handlePageSize"
show-elevator
show-sizer
show-total
size="small"
/>
</div> </div>
</template> </template>
<script> <script>
import { Voucherror } from "@/api/Finance"; import {
//import vUpLoad from "@/bill/PrintView"; Voucherror
import { pageingData, export_col_to_excel, sortByKey } from "@/libs/tools"; } from "@/api/Finance";
export default { //import vUpLoad from "@/bill/PrintView";
//components:{vUpLoad}, import {
data() { pageingData,
return { export_col_to_excel,
loading: false, sortByKey
PageSizeOpts: [10, 15, 20, 30], } from "@/libs/tools";
pageNo: 1, export default {
modal1: false, //components:{vUpLoad},
printing: false, data() {
strfilter: "", return {
multiple: false, loading: false,
pageSize: 15, PageSizeOpts: [10, 15, 20, 30],
datas: [], pageNo: 1,
ccode: "", modal1: false,
stateList: [ printing: false,
{ strfilter: "",
value: "超领", multiple: false,
label: "超领", pageSize: 15,
}, datas: [],
{ ccode: "",
value: "缺领", stateList: [{
label: "缺领", value: "超领",
}, label: "超领",
],
filter: {
inv_codes: "",
by_finish: ["超领", "缺领"],
inv_std: "",
mo_codes: "",
},
columns: [
{
title: "生产订单号",
align: "center",
key: "MoCode",
},
{
title: "行号",
align: "center",
key: "SortSeq",
width: 80,
},
{
title: "产品编号",
align: "center",
key: "InvCode",
width: 120,
},
{
title: "产品名称",
align: "center",
key: "cInvName",
},
{
title: "子件编号",
align: "center",
key: "InvCode1",
width: 120,
},
{
title: "子件名称",
align: "center",
key: "cInvName1",
},
{
title: "规格型号",
align: "center",
key: "cInvStd",
},
{
title: "应领数量",
align: "center",
key: "Qty",
},
{
title: "已领数量",
align: "center",
key: "IssQty",
},
{
title: "异常情况",
align: "center",
key: "error",
render: (h, params) => {
if (params.row.error === "超领") {
return h(
"span",
{ style: { color: "#ff6600" } },
params.row.error
);
} else {
return h(
"span",
{ style: { color: "#2db7f5" } },
params.row.error
);
}
}, },
{
value: "缺领",
label: "缺领",
},
{
value: "无应领",
label: "无应领",
},
],
filter: {
inv_codes: "",
by_finish: ["超领", "缺领"],
inv_std: "",
mo_codes: "",
}, },
],
}; columns: [{
}, title: "生产订单号",
computed: { align: "center",
total() { key: "MoCode",
return this.datas.length; },
{
title: "行号",
align: "center",
key: "SortSeq",
width: 80,
},
{
title: "产品编号",
align: "center",
key: "InvCode",
width: 120,
},
{
title: "产品名称",
align: "center",
key: "cInvName",
},
{
title: "子件编号",
align: "center",
key: "InvCode1",
width: 120,
},
{
title: "子件名称",
align: "center",
key: "cInvName1",
},
{
title: "规格型号",
align: "center",
key: "cInvStd",
},
{
title: "应领数量",
align: "center",
key: "Qty",
},
{
title: "已领数量",
align: "center",
key: "IssQty",
},
{
title: "异常情况",
align: "center",
key: "error",
render: (h, params) => {
if (params.row.error === "超领") {
return h(
"span", {
style: {
color: "#ff6600"
}
},
params.row.error
);
} else {
return h(
"span", {
style: {
color: "#2db7f5"
}
},
params.row.error
);
}
},
},
],
};
}, },
pagedData() { computed: {
return pageingData(this.datas, this.pageSize, this.pageNo); total() {
return this.datas.length;
},
pagedData() {
return pageingData(this.datas, this.pageSize, this.pageNo);
},
}, },
}, mounted() {
mounted() {
this.loadData();
},
methods: {
handelExport() {
export_col_to_excel(this.columns, this.datas);
},
handleClick() {
this.loadData(); this.loadData();
}, },
async loadData() { methods: {
try { handelExport() {
let _filert = { export_col_to_excel(this.columns, this.datas);
ccode: },
this.filter.mo_codes !== "" handleClick() {
? this.filter.mo_codes.split(/[,\s\n,]/) this.loadData();
: null, },
error: this.filter.by_finish, async loadData() {
}; try {
this.loading = true; let _filert = {
let resp = await Voucherror(_filert); ccode: this.filter.mo_codes !== "" ?
this.pageNo = 1; this.filter.mo_codes.split(/[,\s\n,]/) :
this.datas = sortByKey(resp.data.data, "MoCode"); null,
// this.datas = resp.data.data; error: this.filter.by_finish,
} catch (error) { };
} finally { this.loading = true;
this.loading = false; let resp = await Voucherror(_filert);
} this.pageNo = 1;
this.datas = sortByKey(resp.data.data, "MoCode");
// this.datas = resp.data.data;
} catch (error) {} finally {
this.loading = false;
}
},
handlePagechange(page) {
this.pageNo = page;
},
handlePageSize(pageSize) {
this.pageSize = pageSize;
},
}, },
handlePagechange(page) { };
this.pageNo = page;
},
handlePageSize(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 { h3 {
margin: 40px 0 0; margin: 40px 0 0;
} }
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
.ivu-table .demo-table-info-row td { ul {
background-color: #2db7f5; list-style-type: none;
color: #fff; padding: 0;
} }
.ivu-table .demo-table-error-row td {
background-color: #ff6600;
color: #fff;
}
.ivu-table td.demo-table-info-old { li {
color: #2db7f5; display: inline-block;
} margin: 0 10px;
}
.ivu-table td.demo-table-info-new { a {
color: #ff6600; color: #42b983;
font-size: 12px; }
}
.ivu-table td.demo-table-info-nom { .ivu-table .demo-table-info-row td {
font-size: 11px; background-color: #2db7f5;
} color: #fff;
.ivu-table td.demo-table-info-ex { }
color: #187;
font-weight: 600; .ivu-table .demo-table-error-row td {
} background-color: #ff6600;
body { color: #fff;
padding: 10px 1; }
}
.ivu-table td.demo-table-info-old {
color: #2db7f5;
}
.ivu-table td.demo-table-info-new {
color: #ff6600;
font-size: 12px;
}
.ivu-table td.demo-table-info-nom {
font-size: 11px;
}
.ivu-table td.demo-table-info-ex {
color: #187;
font-weight: 600;
}
body {
padding: 10px 1;
}
</style> </style>