Commit 2023fc1c authored by 高铭波's avatar 高铭波

perf(order):勘查材料金额计算修改

parent 08090899
This diff is collapsed.
......@@ -25,7 +25,12 @@
</u-tr>
<view class="line-view"></view>
<u-tr class="u-tr" v-for="(item, index) in list" :key="index">
<u-td class="u-td" v-for="(value, key) in titles" :key="key">
<u-td
class="u-td"
v-for="(value, key) in titles"
:key="key"
width="200"
>
<view v-if="key == 'useLength'" class="uselen-input">
<u-input
@blur="handleBlur(item)"
......@@ -143,6 +148,15 @@ export default {
useLength: "用量",
};
},
widths() {
return {
matName: 200,
matUnit: "auto",
freeLength: "auto",
unitAmt: "auto",
useLength: "auto",
};
},
thStyle() {
return {
"font-weight": "bold",
......@@ -162,9 +176,9 @@ export default {
var amount = 0;
for (var item of this.list) {
if (
Number(item.useLength) &&
Number(item.freeLength) &&
Number(item.unitAmt)
this.$u.test.number(item.useLength) &&
this.$u.test.number(item.freeLength) &&
this.$u.test.number(item.unitAmt)
) {
amount +=
Math.max(Number(item.useLength) - Number(item.freeLength), 0) *
......@@ -197,6 +211,9 @@ export default {
eventChannel.on("showMaterialData", function (data) {
if (!data || data.length === 0) {
self.getMaterialData();
if (self.$u.test.isEmpty(self.other)) {
self.handleAdd();
}
} else {
self.formatServiceMoreList(data);
}
......@@ -208,7 +225,7 @@ export default {
matName: "开孔厚40cm以上,直径11cm以下",
matUnit: "个",
freeLength: 0,
unitAmt: 0,
unitAmt: 10,
useLength: 0,
},
{
......@@ -217,7 +234,7 @@ export default {
matName: "验收完成后移动安装地点",
matUnit: "次",
freeLength: 0,
unitAmt: 0,
unitAmt: 20,
useLength: 0,
},
{
......@@ -226,7 +243,7 @@ export default {
matName: "北京地区报装",
matUnit: "次",
freeLength: 0,
unitAmt: 0,
unitAmt: 30,
useLength: 0,
},
{
......@@ -235,7 +252,7 @@ export default {
matName: "墙面开墙及恢复",
matUnit: "米",
freeLength: 0,
unitAmt: 0,
unitAmt: 40,
useLength: 0,
},
{
......@@ -244,7 +261,7 @@ export default {
matName: "安装位置单次往返经销商距离",
matUnit: "千米",
freeLength: 0,
unitAmt: 0,
unitAmt: 50,
useLength: 0,
},
{
......@@ -252,8 +269,8 @@ export default {
priceType: "01",
matName: "开孔厚40cm以上,直径11cm以下",
matUnit: "个",
freeLength: 0,
unitAmt: 0,
freeLength: 1,
unitAmt: 60,
useLength: 0,
},
{
......@@ -261,8 +278,8 @@ export default {
priceType: "01",
matName: "桥架50mm*50mm",
matUnit: "米",
freeLength: 0,
unitAmt: 0,
freeLength: 2,
unitAmt: 70,
useLength: 0,
},
{
......@@ -270,7 +287,7 @@ export default {
priceType: "01",
matName: "铺装庭院开挖(复合材料)",
matUnit: "米",
freeLength: 0,
freeLength: 3,
unitAmt: 220,
useLength: 0,
},
......@@ -334,7 +351,7 @@ export default {
let row = this.list.find((item, index) => {
return item.useLength != 0;
});
if (!this.$u.test.isEmpty(this.list) && this.$u.test.isEmpty(row)) {
if (this.$u.test.isEmpty(row)) {
this.$refs.uToast.show({
title: "请填写电缆、漏保、空开等用量",
type: "error",
......@@ -351,7 +368,7 @@ export default {
return false;
}
for (let item of this.other) {
if (!item.otherExplain) {
if (this.other.length > 1 && !item.otherExplain) {
this.$refs.uToast.show({
title: "请输入其他项说明",
type: "warning",
......
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