Commit 139f86a2 by zhangzhen

委外执行加工表页面展示优化

parent bd8f0147
......@@ -51,82 +51,102 @@ $(function () {
columns2:[
{
label:'公司名称',
align:'left',
value:'companyName'
},
{
label:'委外加工日期',
align:'left',
value:'contractDate'
},
{
label:'委外加工单号',
align:'left',
value:'contractCode'
},
{
label:'供应商名称',
align:'left',
value:'supName'
},
{
label:'材料编码',
align:'left',
value:'lcinventCode'
},
{
label:'材料名称',
align:'left',
value:'lcinventName'
},
{
label:'材料规格',
align:'left',
value:'lcspec'
},
{
label:'计划出库数量',
align:'right',
value:'jhckQty'
},
{
label:'计划出库重量',
align:'right',
value:'jhckWeight'
},
{
label:'出库日期',
align:'left',
value:'outDate'
},
{
label:'实际出库数量',
align:'right',
value:'sjckoutQty'
},
{
label:'实际出库重量',
align:'right',
value:'sjckoutWeight'
},
{
label:'成品编码',
align:'left',
value:'productCode'
},
{
label:'成品名称',
align:'left',
value:'productName'
},
{
label:'成品规格',
align:'left',
value:'rkspec'
},
{
label:'计划入库数量',
align:'right',
value:'jhrkdepositQty'
},
{
label:'计划入库重量',
align:'right',
value:'jhrkdepositWeight'
},
{
label:'入库日期',
align:'left',
value:'depositDate'
},
{
label:'实际入库数量',
align:'right',
value:'actualQty'
},
{
label:'实际入库重量',
align:'right',
value:'depositWeight'
}
],
......@@ -234,15 +254,19 @@ $(function () {
let productCodeObj = {}
g.forEach(item3 =>{
productCodeObj[item3.productCode.value] = '';
let valStr = item3.productCode.value + item3.outDate.value
productCodeObj[valStr] = '';
})
let gList = Object.keys(productCodeObj)
let Hlist = gList.map(item4 => {
let d = g.filter(val7 => val7.productCode.value === item4);
return d.map((val6,i5) => {
let d = g.filter(val7 => {
let val2Str = val7.productCode.value + val7.outDate.value
return val2Str === item4
});
let arrFinal = d.map((val6,i5) => {
return {
...val6,
productCode:{
......@@ -269,12 +293,31 @@ $(function () {
...val6.jhrkdepositWeight,
rowspan: d.length,
show: !i5
},
outDate:{
...val6.outDate,
rowspan: d.length,
show: !i5
},
sjckoutQty:{
...val6.sjckoutQty,
value: i5 && val6.sjckoutQty.value? (Number(val6.sjckoutQty.value||0)+Number(d[i5-1].sjckoutQty.value)): Number(val6.sjckoutQty.value||0),
rowspan: d.length,
show: !i5
},
sjckoutWeight:{
...val6.sjckoutWeight,
value: i5 && val6.sjckoutWeight.value? (Number(val6.sjckoutWeight.value||0)+Number(d[i5-1].sjckoutWeight.value)): Number(val6.sjckoutWeight.value||0),
rowspan: d.length,
show: !i5
}
}
});
arrFinal[0].sjckoutQty.value = arrFinal[arrFinal.length-1].sjckoutQty.value;
arrFinal[0].sjckoutWeight.value = arrFinal[arrFinal.length-1].sjckoutWeight.value;
return arrFinal
})
let finalArr = []
Hlist.forEach(item6=>{
finalArr.push(...item6);
......@@ -316,8 +359,8 @@ $(function () {
arr1.forEach(item=>{
that.list.push(...item);
})
}else {
that.list = [];
}
},
onFail: (err) => {
......
......@@ -97,7 +97,7 @@
</thead>
<tbody>
<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" :rowspan="valObj[item.value].rowspan" :class="i/2%1?'bg-blue':''" :style="{textAlign:item.align}">
<span>{{valObj[item.value].value}}</span>
</td>
</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