Commit 148edc12 by zhangzhen

新表格模式页面功能优化

parent 2f8dc287
...@@ -35,34 +35,34 @@ ...@@ -35,34 +35,34 @@
from hggp.hgsc004 h from hggp.hgsc004 h
join ( join (
select select
h.id , -- 主键 --> h.id , <!-- 主键 -->
h.company_code , -- 公司编码(预留) --> h.company_code , <!-- 公司编码(预留) -->
h.company_name , -- 公司名称(预留) --> h.company_name , <!-- 公司名称(预留) -->
h.proj_code , -- 项目编码(预留) --> h.proj_code , <!-- 项目编码(预留) -->
h.proj_name , -- 项目名称(预留) --> h.proj_name , <!-- 项目名称(预留) -->
h.parent_prod_code , -- 父节点-产品编码 --> h.parent_prod_code , <!-- 父节点-产品编码 -->
h.parent_prod_name , -- 父节点-产品名称 --> h.parent_prod_name , <!-- 父节点-产品名称 -->
h.material_id , -- 物料清单id --> h.material_id , <!-- 物料清单id -->
h.product_id , -- 产品id --> h.product_id , <!-- 产品id -->
h.product_type , -- 产品类别 --> h.product_type , <!-- 产品类别 -->
h.product_code , -- 产品编号 --> h.product_code , <!-- 产品编号 -->
h.product_name , -- 产品名称 --> h.product_name , <!-- 产品名称 -->
h.invent_type , -- 档案类型 --> h.invent_type , <!-- 档案类型 -->
h.spec , -- 规格 --> h.spec , <!-- 规格 -->
h.length , -- 长 --> h.length , <!-- 长 -->
h.width , -- 宽 --> h.width , <!-- 宽 -->
h.thick , -- 厚 --> h.thick , <!-- 厚 -->
h.quantity , -- 数量 --> h.quantity , <!-- 数量 -->
h.single_weight , -- 单重 --> h.single_weight , <!-- 单重 -->
h.total_weight , -- 总重 --> h.total_weight , <!-- 总重 -->
h.approval_status , -- 审批状态 0:待审;1:审核中;2:已审 --> h.approval_status , <!-- 审批状态 0:待审;1:审核中;2:已审 -->
h.leaf , -- 是否有叶子节点 --> h.leaf , <!-- 是否有叶子节点 -->
h.sort , -- 排序字段 --> h.sort , <!-- 排序字段 -->
h.lv , -- 层级 --> h.lv , <!-- 层级 -->
k.DEPOSIT_DATE , -- 入库日期 --> k.DEPOSIT_DATE , <!-- 入库日期 -->
k.INV_QTY , -- 数量 --> k.INV_QTY , <!-- 数量 -->
k.INV_UNIT_WEIGHT , -- 单重 --> k.INV_UNIT_WEIGHT , <!-- 单重 -->
k.INV_WEIGHT -- 重量 --> k.INV_WEIGHT <!-- 重量 -->
from hggp.hgsc004a h from hggp.hgsc004a h
left join hggp.hgkc003 k on h.company_code = k.COMPANY_CODE and h.proj_code = k.PROJ_CODE left join hggp.hgkc003 k on h.company_code = k.COMPANY_CODE and h.proj_code = k.PROJ_CODE
and h.product_code = k.PRDT_CODE and h.product_code = k.PRDT_CODE
...@@ -92,42 +92,42 @@ ...@@ -92,42 +92,42 @@
) ha on h.id = ha.material_id ) ha on h.id = ha.material_id
join ( join (
select select
h.id , -- 主键 --> h.id ,<!-- 主键 -->
h.company_code , -- 公司编码(预留) --> h.company_code ,<!-- 公司编码(预留) -->
h.company_name , -- 公司名称(预留) --> h.company_name ,<!-- 公司名称(预留) -->
h.proj_code , -- 项目编码(预留) --> h.proj_code ,<!-- 项目编码(预留) -->
h.proj_name , -- 项目名称(预留) --> h.proj_name ,<!-- 项目名称(预留) -->
h.parent_prod_code , -- 父节点-产品编码 --> h.parent_prod_code ,<!-- 父节点-产品编码 -->
h.parent_prod_name , -- 父节点-产品名称 --> h.parent_prod_name ,<!-- 父节点-产品名称 -->
h.material_id , -- 物料清单id --> h.material_id ,<!-- 物料清单id -->
h.product_id , -- 产品id --> h.product_id ,<!-- 产品id -->
h.product_type , -- 产品类别 --> h.product_type ,<!-- 产品类别 -->
h.product_code , -- 产品编号 --> h.product_code ,<!-- 产品编号 -->
h.product_name , -- 产品名称 --> h.product_name ,<!-- 产品名称 -->
h.invent_type , -- 档案类型 --> h.invent_type ,<!-- 档案类型 -->
h.spec , -- 规格 --> h.spec ,<!-- 规格 -->
h.length , -- 长 --> h.length ,<!-- 长 -->
h.width , -- 宽 --> h.width ,<!-- 宽 -->
h.thick , -- 厚 --> h.thick ,<!-- 厚 -->
h.quantity , -- 数量 --> h.quantity ,<!-- 数量 -->
h.single_weight , -- 单重 --> h.single_weight ,<!-- 单重 -->
h.total_weight , -- 总重 --> h.total_weight ,<!-- 总重 -->
h.approval_status , -- 审批状态 0:待审;1:审核中;2:已审 --> h.approval_status ,<!-- 审批状态 0:待审;1:审核中;2:已审 -->
h.leaf , -- 是否有叶子节点 --> h.leaf ,<!-- 是否有叶子节点 -->
h.sort , -- 排序字段 --> h.sort ,<!-- 排序字段 -->
h.lv , -- 层级 --> h.lv , <!-- 层级 -->
k.RECEIPT_DATE , -- 入库日期 --> k.RECEIPT_DATE ,<!-- 入库日期 -->
k.INV_QTY , -- 数量 --> k.INV_QTY ,<!-- 数量 -->
k.INV_WEIGHT -- 重量 --> k.INV_WEIGHT<!-- 重量 -->
from hggp.hgsc004a h from hggp.hgsc004a h
left join ( left join (
select select
k.COMPANY_CODE , k.COMPANY_CODE ,
k.PROJ_CODE , k.PROJ_CODE ,
k1.RECEIPT_DATE , -- 入库日期 --> k1.RECEIPT_DATE ,<!-- 入库日期 -->
k.INVENT_CODE , k.INVENT_CODE ,
sum(k.INV_QTY) as INV_QTY, -- 数量 --> sum(k.INV_QTY) as INV_QTY,<!-- 数量 -->
sum(k.INV_WEIGHT) as INV_WEIGHT -- 重量 --> sum(k.INV_WEIGHT) as INV_WEIGHT<!-- 重量 -->
from hggp.hgkc008a k from hggp.hgkc008a k
join hggp.hgkc008 k1 on k.RECEIVE_ID = k1.id join hggp.hgkc008 k1 on k.RECEIVE_ID = k1.id
where k.DELETE_FLAG = 0 where k.DELETE_FLAG = 0
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<style> <style>
table{ table{
border-color: #99d2ff; border-color: #99d2ff;
min-width: 100%;
} }
table tr{ table tr{
......
...@@ -2,9 +2,8 @@ $(function () { ...@@ -2,9 +2,8 @@ $(function () {
let inInfo = new EiInfo(); let inInfo = new EiInfo();
$("#QUERY").on("click", () => { $("#QUERY").on("click", () => {
inInfo.set("inqu_status-0-companyCode",$("#inqu_status-0-companyCode").val()); inInfo.set("inqu_status-0-companyCode",$("#inqu_status-0-companyCode").val());
inInfo.set("inqu_status-0-contractDate",$("#inqu_status-0-contractDate").val()) inInfo.set("inqu_status-0-contractDate",$("#inqu_status-0-projName").val())
inInfo.set("inqu_status-0-contractCode",$("#inqu_status-0-contractCode").val()) inInfo.set("inqu_status-0-contractCode",$("#inqu_status-0-productName").val())
inInfo.set("inqu_status-0-supCode",$("#inqu_status-0-supCode").val())
vue.onLoading() vue.onLoading()
}); });
...@@ -28,106 +27,143 @@ $(function () { ...@@ -28,106 +27,143 @@ $(function () {
return { return {
columns: [ columns: [
{ {
label:"委外加工单", label:"物料清单(一级物料)",
tableType:'th', tableType:'th',
colspan:9 colspan:12
}, },
{ {
label:"委外出库单", label:"生产入库单",
tableType:'th', tableType:'th',
colspan:3 colspan:4
}, },
{ {
label:"委外加工单", label:"物料清单(二级物料)",
tableType:'th', tableType:'th',
colspan:5 colspan:8
}, },
{ {
label:"委外入库单", label:"生产领料单",
tableType:'th', tableType:'th',
colspan:3 colspan:4
}, },
], ],
columns2:[ columns2:[
{ {
label:'公司编号',
value:'companyCode',
show: false
},
{
label:'公司名称', label:'公司名称',
value:'companyName' value:'companyName'
}, },
{ {
label:'委外加工日期', label:'项目编码',
value:'contractDate' value:'projCode'
}, },
{ {
label:'委外加工单号', label:'项目名称',
value:'contractCode' value:'projName'
}, },
{ {
label:'供应商名称', label:'产品编码',
value:'supName' value:'productCode'
}, },
{ {
label:'材料编码', label:'产品名称',
value:'lcinventCode' value:'productName'
}, },
{ {
label:'材料名称', label:'规格',
value:'lcinventName' value:'spec'
}, },
{ {
label:'材料规格', label:'长度',
value:'lcspec' value:'length'
}, },
{ {
label:'计划出库数量', label:'宽度',
value:'jhckQty' value:'width'
}, },
{ {
label:'计划出库重量', label:'厚度',
value:'jhckWeight' value:'thick'
}, },
{ {
label:'出库日期', label:'数量',
value:'outDate' value:'quantity'
}, },
{ {
label:'实际出库数量', label:'单重',
value:'sjckoutQty' value:'singleWeight'
}, },
{ {
label:'实际出库重量', label:'总重',
value:'sjckoutWeight' value:'totalWeight'
}, },
{ {
label:'成品编码', label:'入库日期',
value:'productCode' value:'depositDate'
}, },
{ {
label:'成品名称', label:'数量',
value:'productName' value:'invQty'
}, },
{ {
label:'成品规格', label:'单重',
value:'rkspec' value:'invUnitWeight'
}, },
{ {
label:'计划入库数量', label:'量',
value:'jhrkdepositQty' value:'invWeight'
}, },
{ {
label:'计划入库重量', label:'材料编码',
value:'jhrkdepositWeight' value:'clproductCode'
}, },
{ {
label:'入库日期', label:'材料名称',
value:'depositDate' value:'clproductName'
},
{
label:'规格',
value:'clspec'
}, },
{ {
label:'实际入库数量', label:'长度',
value:'actualQty' value:'cllength'
}, },
{ {
label:'实际入库重量', label:'宽度',
value:'depositWeight' value:'clwidth'
},
{
label:'厚度',
value:'clthick'
},
{
label:'数量',
value:'clquantity'
},
{
label:'总重',
value:'cltotalWeight'
},
{
label:'领料日期',
value:'receiptDate'
},
{
label:'数量',
value:'llinvQty'
},
{
label:'重量',
value:'llinvWeight'
},
{
label:'成材率',
value:'ccl'
} }
], ],
list:[] list:[]
...@@ -139,15 +175,13 @@ $(function () { ...@@ -139,15 +175,13 @@ $(function () {
methods:{ methods:{
onLoading(){ onLoading(){
let that = this; let that = this;
IPLAT.EiCommunicator.send('HGSC012', 'query', inInfo, { IPLAT.EiCommunicator.send('HGSC013', 'query', inInfo, {
onSuccess: (res) => { onSuccess: (res) => {
if(res.extAttr.result && res.extAttr.result.length){ if(res.extAttr.result && res.extAttr.result.length){
that.list = []; that.list = [];
let list = res.extAttr.result.map(item => { let list = res.extAttr.result.map(item => {
return { return {
...item, ...item,
contractDate: item.contractDate? dayjs(item.contractDate).format('YYYY-MM-DD'):'',
outDate: item.outDate? dayjs(item.outDate).format('YYYY-MM-DD'):'',
depositDate: item.depositDate? dayjs(item.depositDate).format('YYYY-MM-DD'):'' depositDate: item.depositDate? dayjs(item.depositDate).format('YYYY-MM-DD'):''
} }
}).map(item =>{ }).map(item =>{
...@@ -163,126 +197,77 @@ $(function () { ...@@ -163,126 +197,77 @@ $(function () {
}); });
let contractCodeObj = {} let contractCodeObj = {}
list.forEach(item =>{ list.forEach(item =>{
contractCodeObj[item.contractCode.value] = ''; let valStr = item.companyCode.value+item.projCode.value+item.clproductCode.value
contractCodeObj[valStr] = '';
}) })
let contractCodeList = Object.keys(contractCodeObj); let contractCodeList = Object.keys(contractCodeObj);
let arr1 = contractCodeList.map(val => { let arr1 = contractCodeList.map(val => {
let a = list.filter(val2 => val2.contractCode.value === val); let a = list.filter(val2 =>{
let val2Str = val2.companyCode.value+val2.projCode.value+val2.clproductCode.value
return val2Str === val
});
let obj2 ={} let obj2 ={}
a.forEach(item2 => { a.forEach(item2 => {
obj2[item2.lcinventCode.value] = ''; obj2[item2.productCode.value] = '';
}); });
let bList = Object.keys(obj2) let bList = Object.keys(obj2)
let Elist = bList.map(item3 => { let Elist = bList.map(item3 => {
let b = a.filter(val2 => val2.lcinventCode.value === item3); return a.filter(val2 => val2.productCode.value === item3);
return b;
}) })
if(Elist.length){ if(Elist.length){
let fList = []; let fList = [];
Elist.forEach(val4 => { Elist.forEach(val4 => {
if(val4.length){
let g = val4.map((val5,i4) => { let g = val4.map((val5,i4) => {
return { return {
...val5, ...val5,
lcinventCode:{ productCode:{
...val5.lcinventCode, ...val5.productCode,
rowspan: val4.length, rowspan: val4.length,
show: !i4 show: !i4
}, },
lcinventName:{ productName:{
...val5.lcinventName, ...val5.productName,
rowspan: val4.length, rowspan: val4.length,
show: !i4 show: !i4
}, },
lcspec:{ spec:{
...val5.lcspec, ...val5.spec,
rowspan: val4.length, rowspan: val4.length,
show: !i4 show: !i4
}, },
jhckQty:{ length:{
...val5.jhckQty, ...val5.length,
rowspan: val4.length, rowspan: val4.length,
show: !i4 show: !i4
}, },
jhckWeight:{ width:{
...val5.jhckWeight, ...val5.width,
rowspan: val4.length, rowspan: val4.length,
show: !i4 show: !i4
}, },
outDate:{ thick:{
...val5.outDate, ...val5.thick,
rowspan: val4.length, rowspan: val4.length,
show: !i4 show: !i4
}, },
sjckoutQty:{ quantity:{
...val5.sjckoutQty, ...val5.quantity,
rowspan: val4.length, rowspan: val4.length,
show: !i4 show: !i4
}, },
sjckoutWeight:{ singleWeight:{
...val5.sjckoutWeight, ...val5.singleWeight,
rowspan: val4.length, rowspan: val4.length,
show: !i4 show: !i4
}, },
} totalWeight:{
}) ...val5.totalWeight,
rowspan: val4.length,
show: !i4
let productCodeObj = {}
g.forEach(item3 =>{
productCodeObj[item3.productCode.value] = '';
})
let gList = Object.keys(productCodeObj)
let Hlist = gList.map(item4 => {
let d = g.filter(val7 => val7.productCode.value === item4);
return d.map((val6,i5) => {
return {
...val6,
productCode:{
...val6.productCode,
rowspan: d.length,
show: !i5
},
productName:{
...val6.productName,
rowspan: d.length,
show: !i5
},
rkspec:{
...val6.rkspec,
rowspan: d.length,
show: !i5
},
jhrkdepositQty:{
...val6.jhrkdepositQty,
rowspan: d.length,
show: !i5
},
jhrkdepositWeight:{
...val6.jhrkdepositWeight,
rowspan: d.length,
show: !i5
} }
} }
});
}) })
fList.push(...g)
let finalArr = []
Hlist.forEach(item6=>{
finalArr.push(...item6);
})
fList.push(...finalArr)
}
}) })
a = fList; a = fList;
} }
...@@ -295,18 +280,23 @@ $(function () { ...@@ -295,18 +280,23 @@ $(function () {
rowspan: a.length, rowspan: a.length,
show: !i3 show: !i3
}, },
contractDate:{ projCode:{
...val3.contractDate, ...val3.projCode,
rowspan: a.length, rowspan: a.length,
show: !i3 show: !i3
}, },
contractCode:{ projName:{
...val3.contractCode, ...val3.projName,
rowspan: a.length, rowspan: a.length,
show: !i3 show: !i3
}, },
supName:{ clproductCode:{
...val3.supName, ...val3.clproductCode,
rowspan: a.length,
show: !i3
},
clproductName:{
...val3.clproductName,
rowspan: a.length, rowspan: a.length,
show: !i3 show: !i3
} }
...@@ -316,8 +306,6 @@ $(function () { ...@@ -316,8 +306,6 @@ $(function () {
arr1.forEach(item=>{ arr1.forEach(item=>{
that.list.push(...item); that.list.push(...item);
}) })
} }
}, },
onFail: (err) => { onFail: (err) => {
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
<style> <style>
table{ table{
border-color: #99d2ff; border-color: #99d2ff;
min-width: 100%;
} }
table tr{ table tr{
...@@ -61,20 +62,17 @@ ...@@ -61,20 +62,17 @@
background-color: #eff8ff; background-color: #eff8ff;
} }
</style> </style>
<EF:EFPage title="委外执行加工表"> <EF:EFPage title="产品成材率">
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
<div class="row"> <div class="row">
<EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains"> <EF:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/> <EF:EFOptions blockId="roleCompany" textField="companyName" valueField="companyCode"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFDatePicker blockId="inqu_status" row="0" ename="contractDate" cname="委外加工日期" role="date" <%-- <EF:EFDatePicker blockId="inqu_status" row="0" ename="contractDate" cname="委外加工日期" role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>--%>
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/> <EF:EFInput blockId="inqu_status" row="0" ename="projName" cname="项目名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="contractCode" cname="委外加工单号" placeholder="模糊查询" colWidth="3"/> <EF:EFInput blockId="inqu_status" row="0" ename="productName" cname="产品名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="supCode" cname="供应商名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="sup_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
</div> </div>
</EF:EFRegion> </EF:EFRegion>
...@@ -96,14 +94,14 @@ ...@@ -96,14 +94,14 @@
</th> </th>
</tr> </tr>
<tr> <tr>
<th v-for="(item,k) in columns2" :key="k" > <th v-for="(item,k) in columns2" :key="k" v-if="k>0">
<span>{{item.label}}</span> <span>{{item.label}}</span>
</th> </th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr v-for="(valObj,i) in list" :key="i"> <tr v-for="(valObj,i) in list" :key="i">
<td v-for="(item,k) in columns2" :key="k" v-if="valObj[item.value].show" :rowspan="valObj[item.value].rowspan" :class="i/2%1?'bg-blue':''"> <td v-for="(item,k) in columns2" :key="k" v-if="valObj[item.value].show && k>0" :rowspan="valObj[item.value].rowspan" :class="i/2%1?'bg-blue':''">
<span>{{valObj[item.value].value}}</span> <span>{{valObj[item.value].value}}</span>
</td> </td>
</tr> </tr>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment