Commit 4c359099 authored by Facius's avatar Facius

Merge branch 'dev-1.4.1' of https://git.banshouhui.com/lijundan/self-support into dev-1.4.1

parents 61a42247 66c3bdd7
......@@ -7,13 +7,22 @@
padding="0">
<u-tr class="u-tr">
<u-th class="u-th content-tab-th" v-for="(value, key) in titles" :key="key" width="auto">
<text :class="['tab-th-txt', {'left': key == firstKey}]">{{value}}</text>
<view class="tab-th-txt" v-if="key == 'useLength'">
<u-parse :html="value" :tag-style="style"></u-parse>
</view>
<text v-else :class="['tab-th-txt', {'left': key == firstKey}]">{{value}}</text>
</u-th>
</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-input v-if="key == 'useLength'" @blur="handleBlur(item)" @focus="handleFocus(item)" type="digit" :placeholder="null" v-model="item[key]" placeholder-style="color: #999999;font-size:26rpx" input-align="center" :clearable="false"><u-icon name="edit"></u-icon></u-input>
<view v-if="key == 'useLength'" class="uselen-input">
<u-input @blur="handleBlur(item)" :border="true" border-color="#2979FF"
@focus="handleFocus(item)" type="digit" placeholder="请输入"
v-model="item[key]" placeholder-style="color: #999999;font-size:26rpx"
input-align="center" :clearable="false" :verify-number="true">
<u-icon name="edit"></u-icon></u-input>
</view>
<text v-else :class="['tab-th-txt', {'left': key == firstKey}]">{{item[key]}}</text>
</u-td>
</u-tr>
......@@ -22,31 +31,25 @@
<!-- 其他 -->
<view class="mtr-other">
<view class="line-view"></view>
<view class="other-space">
<text>其他</text>
<image class="image-view" :src="addImage" @click="handleAdd"></image>
</view>
<view v-if="other.length > 0" class="other-content">
<view class="other-space" v-for="(item, index) in other" :key="index">
<view class="input-view">
<view class="other-space">
<text class="input-title">说明:</text>
<view class="input-content">
<u-input v-model="item.otherExplain" :clearable="false" placeholder-style="color:#999999;font-size:26rpx" />
</view>
</view>
<view class="other-space">
<text class="input-title">金额:</text>
<view class="input-content">
<u-input v-model="item.extraAmt" type="number" :clearable="false" placeholder-style="color:#999999;font-size:26rpx" />
</view>
</view>
<view class="u-flex u-row-between other-space">
<view class="other-label">其他</view>
<view class="list">
<view v-for="(item, index) in other" :key="index"
class="u-flex u-row-between">
<u-input v-model="item.otherExplain" :border="true"
class="u-m-r-15" :clearable="false" placeholder="请输入内容"
:border-color="index === 0 ? '#2979FF' : '#FF930D'"/>
<u-input v-model="item.extraAmt" type="number" :border="true"
class="u-m-l-15" :clearable="false" placeholder="请输入金额"
:border-color="index === 0 ? '#2979FF' : '#FF930D'"/>
<image v-if="index === 0" class="image-view"
:src="addImage" @click="handleAdd"/>
<image v-else class="image-view"
:src="subtractImage" @click="handleSubtract(index)"/>
</view>
<image class="image-view" :src="subtractImage" @click="handleSubtract"></image>
</view>
</view>
<view class="other-space">
<view class="other-space u-p-t-20">
<text>超出金额</text>
<text>{{money}}元</text>
</view>
......@@ -70,6 +73,10 @@
fieldName:'materialList',
list: [], // 材料列表
other: [], // 其他列表
style: {
// 字符串的形式
p: 'color: red;font-size: 24rpx'
}
};
},
computed: {
......@@ -83,11 +90,11 @@
},
titles() {
return {
matName: this.isMaterial ? '工艺名称' : '材料名称',
matName: this.isMaterial ? '材料名称' : '工艺名称',
matUnit: '单位',
freeLength: '免费量',
unitAmt: '单价/元',
useLength: '用量'
useLength: '用量<p>(请输入实际用量)</p>'
}
},
thStyle() {
......@@ -141,6 +148,24 @@
self.formatServiceMoreList(data)
}
});
this.list = [
{matType: "02", priceType: "01", matName: '开孔厚40cm以上,直径11cm以下',
matUnit: "个", freeLength: 0, unitAmt: 0, useLength: 0},
{matType: "02", priceType: "01", matName: '验收完成后移动安装地点',
matUnit: "次", freeLength: 0, unitAmt: 0, useLength: 0},
{matType: "02", priceType: "01", matName: '北京地区报装',
matUnit: "次", freeLength: 0, unitAmt: 0, useLength: 0},
{matType: "02", priceType: "01", matName: '墙面开墙及恢复',
matUnit: "米", freeLength: 0, unitAmt: 0, useLength: 0},
{matType: "02", priceType: "01", matName: '安装位置单次往返经销商距离',
matUnit: "千米", freeLength: 0, unitAmt: 0, useLength: 0},
{matType: "02", priceType: "01", matName: '开孔厚40cm以上,直径11cm以下',
matUnit: "个", freeLength: 0, unitAmt: 0, useLength: 0},
{matType: "02", priceType: "01", matName: '桥架50mm*50mm',
matUnit: "米", freeLength: 0, unitAmt: 0, useLength: 0},
{matType: "02", priceType: "01", matName: '铺装庭院开挖(复合材料)',
matUnit: "米", freeLength: 0, unitAmt: 220, useLength: 0},
]
},
created() {
},
......@@ -166,14 +191,15 @@
})
},
handleBlur(item) { // 失去焦点如果没输入用原先的值
if (!item.useLength) {
item.useLength = item.temp
if(this.$u.test.isEmpty(item.useLength)
|| !this.$u.test.number(item.useLength)) {
item.useLength = 0
}
},
handleFocus(item) { // 点击清空
item.temp = item.useLength;
item.useLength = ''
if(this.$u.test.isEmpty(item.useLength)) {
item.useLength = null
}
},
/* 其他添加新的 */
handleAdd() {
......@@ -182,7 +208,7 @@
isDel:'N',
isWebAdd:true,
matName:'其他',
extraAmt:0,
extraAmt:null,
priceType:this.priceType,
matType:'04',
otherExplain:''
......@@ -192,7 +218,27 @@
handleSubtract(index) {
this.other.splice(index, 1)
},
validateForm() {
if(this.isMaterial) {
let row = this.list.find((item, index) => {
return item.useLength != 0;
})
if(!this.$u.test.isEmpty(this.list) && this.$u.test.isEmpty(row)) {
this.$refs.uToast.show({
title: '请填写电缆、漏保、空开等用量',
type: 'error',
icon: false,
position: 'bottom'
})
return false
}
}
return true
},
handleSure() {
if(!this.validateForm()) {
return false
}
for (let item of this.other){
if(!item.otherExplain){
this.$refs.uToast.show({
......@@ -238,6 +284,7 @@
.tab-th-txt {
background-color: #FFFFFF;
padding: 10rpx 0;
line-break: anywhere;
&.left {
text-align: left;
......@@ -291,4 +338,9 @@
height: 104rpx;
}
}
.other-label {
width: 150rpx;
align-self: flex-start;
line-height: 80rpx;
}
</style>
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