Commit 2ddce579 authored by Damon's avatar Damon

申请费用

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