Commit 2ddce579 authored by Damon's avatar Damon

申请费用

parent a6e7b9d1
......@@ -61,7 +61,7 @@
display: flex;
flex-wrap: wrap;
line-height: 50rpx;
max-width: 46%;
max-width: 46%;
align-items: center;
&.active{
background-color: #2272FF;
......
......@@ -4,7 +4,7 @@
<view class="file-box">
<view class="pics u-flex u-flex-wrap">
<view class="img-list" v-for="(item,index) in imgList" :key="index">
<u-image class="pic" width="160" height="160" :src="item.path ? item.path : item.src + '?imageView2/1/w/100/h/100/q/75'" :border-radius="10" @click.stop="prviewImage(item,index)"></u-image>
<u-image class="pic" width="160" height="160" :src="item.path ? item.path : item.src + '?imageView2/1/w/100/h/100/q/75'" :border-radius="10" @click.stop="prviewImage(item,index)" fade lazy-load ></u-image>
<view class="icon-del-box" @click.stop="delFile(index)">
<view class="icon-del"></view>
<view class="icon-del rotate"></view>
......
......@@ -2,7 +2,7 @@
<template>
<view :style="{'width': fieldsWidth}">
<u-input :type="type" class="input-item" v-model="dataValue" @input="valueChange" :placeholder="placeholder" :placeholder-style="placeholderStyle"
:custom-style="customStyle" :clearable="false" :border="border" border-color="#ECECEC" :maxlength="maxlength" :cursor-spacing="10" hold-keyboard/>
:custom-style="customStyle" :clearable="false" :border="border" border-color="#ECECEC" :maxlength="maxlength" :cursor-spacing="10" :disabled="isDisabled" hold-keyboard/>
<view class="content" v-if="slotContent">
<text class="txt">{{ slotContent }}</text>
</view>
......@@ -34,41 +34,13 @@
type: String,
default: ''
}
// width: { // 例如:454rpx
// type: String,
// default: '100%'
// }
},
data() {
return {
inputType: 'text',
// type: 'text'
inputType: 'text'
}
},
computed: {
// type() {
// if (this.item) {
// let ty = this.item.fieldsType.toLocaleLowerCase()
// switch (ty) {
// case 'text':
// return 'textarea'
// case 'password':
// return this.item.fieldsType
// case 'decimal':
// case 'number':
// case 'double':
// case 'integer':
// this.maxlength = 9
// return 'digit'
// case 'textarea':
// default:
// return 'text'
// }
// } else {
// return 'text'
// }
// },
maxlength() {
return this.type == 'digit' ? 9 : 140
},
......@@ -96,6 +68,9 @@
},
backgroundColor() {
return this.textarea ? 'transparent' : '#F4F5F7'
},
isDisabled() {
return this.item.function ? true : false
}
},
watch: {},
......
......@@ -19,7 +19,7 @@
</view>
<template v-if="item.fieldsType">
<xh-input v-if="item.formType==='input'" :groupIndex="groupIndex" :type="item.inputType"
:itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""' @value-change="fieldValueChange">
:itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""' :slotContent="item.fieldsInfo" @value-change="fieldValueChange">
</xh-input>
<xh-multi-input v-else-if="item.formType==='multiinput'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'
......@@ -114,7 +114,6 @@
import takePhoto from '@/components/take/index.vue'
import baseFile from '@/components/upload/index'
import Detail from "@/components/order/detail.vue"
// import XhRadio from '@/components/createCom/XhRadio.vue'
// 表单类型map
const formType = new Map([
......@@ -126,6 +125,7 @@
['double', ['input','digit']],
['integer', ['input','digit']],
['string', ['input','text']],
['jscode', ['input','text']],
['multiinput', ['multiinput','text']],
['select', ['select','text']],
['specifications', ['select','text']],
......@@ -339,11 +339,13 @@
},
methods: {
getCompleteData() {//获取工单配置的完工项目
let self = this
if(self.orderId){
self.$u.api.getCompleteConfigAndData(self.orderId).then((res) => {
uni.showLoading({
title: '加载中'
})
if(this.orderId){
this.$u.api.getCompleteConfigAndData(this.orderId).then((res) => {
if (res.code == 200) {
self.initData(res)
this.initData(res)
} else {
this.$refs.uToast.show({
title: res.message,
......@@ -354,28 +356,33 @@
}
},
initData(res) {
this.form = res.data.value || {}
const list = res.data.config.sort((a, b) => a.order - b.order)
list.forEach((item, index) => {
if (this.maintainStep === item.panelFieldsName) this.tabIndex = index
item.items.forEach(v => {
v.items.forEach(d => {
const type = d.fieldsType.toLocaleLowerCase()
const formMap = formType.get(type)
const formMap = formType.get(type) || formType.get('text')
d.formType = formMap[0]
d.inputType = formMap[1]
if (d.fieldsId == 200 && res.data.value) {
d.required = res.data.value['paymentMethodsType'] != '03'
}
if (d.fieldsId === 252 || d.fieldsId === 253) { // 申请费用计算
this.calcMoney()
}
})
})
})
this.list = list
// this.showTab = this.list.length > 1
this.form = res.data.value || {}
this.current = 0
// 异常单处理
if (this.auditResultsId) this.checkCompleteError()
uni.hideLoading()
},
checkCompleteError() { // 异常单定位错误项
let self = this
......@@ -636,20 +643,35 @@
innerItem = groupItem.items[data.itemIndex]
}
if(innerItem.fieldsType ==='multiInput'){
if(innerItem.fieldsType === 'multiInput'){
// 多个输入框的值触发
let key = Object.keys(data.value)[0]
this.form[key] = data.value[key]
}else{
this.$set(this.form,innerItem.fieldsName,data.value)
}
if (innerItem.fieldsId == 199) { // 选不需要收款的时候,收款金额修改为非必选
console.log("innerItem", innerItem)
if (innerItem.fieldsId === 199) { // 选不需要收款的时候,收款金额修改为非必选
const row = groupItem.items.find(v => v.fieldsId === 200)
row.required = data.value !='03'
}
if (innerItem.fieldsId === 252 || innerItem.fieldsId === 253) { // 申请费用计算
this.calcMoney()
}
},
// 申请费用计算
calcMoney() {
const price = parseInt(this.form.pipe) || 0
const pipeUseLength = parseFloat(this.form.pipeUseLength) || 0
if (price && pipeUseLength) {
const money = (price * pipeUseLength).toFixed(2)
this.$set(this.form, 'pipeAmount', money)
} else {
this.$set(this.form, 'pipeAmount', 0)
}
},
// ------------------------- 以下方法为上传组件相关 -------------------------
// 弹出上传选项
selectUpload(item, groupIndex, itemIndex){
......
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