Commit cc8f6f40 authored by 刘用法's avatar 刘用法
parents 49173101 49bfbc44
......@@ -41,7 +41,15 @@
},
partnerCompanyId: {
type: String,
default: '{}'
default: ''
},
categoryId: {
type: String,
default: ''
},
brandId: {
type: String,
default: ''
},
},
filters:{},
......@@ -117,14 +125,16 @@
setValue() {
const dataValue = []
this.imgList.map(item=>{
dataValue.push(item.path)
dataValue.push(item.src)
})
console.log("dataValue", dataValue)
this.valueChange(dataValue)
},
closeTake(val) {
if(val && val.length > 0){
val.forEach((item,index,array)=>{
item.path = item.key
item.src = item.key
this.imgList.push(item)
})
this.setValue()
......@@ -143,34 +153,17 @@
},
getPhotoStander(){// 获取拍照规范接口
let self = this
this.$u.api.orderStandardItem({}).then((res)=>{
let param = {"partnerCompanyId":self.partnerCompanyId,
"categoryId":self.categoryId,
"brandId":self.brandId,
"fieldName":self.item.fieldsName}
this.$u.api.orderStandardItem(param).then((res)=>{
if (res.code == 200 && res.data.length>0) {
self.currentItemDate = res.data[0]
}else{
console.log("获取完工项的拍照标准异常",res.data.message)
}
})
// self.currentItemDate = {
// "id": 154,
// "partnerCompanyId": 10115000001,
// "categoryId": 1100000216,
// "brandId": null,
// "type": "勘测部分",
// "name": "勘测单",
// "fieldName": "06",
// "images": [
// "https://cloud-bak.banshouhui.com/2-勘测单.jpg"
// ],
// "mainPoint": [
// "表格清晰,文字可辨",
// "表格居中,不倾斜",
// "全部填写完整,不能填写的部分划横杠。",
// "涉及到用户签字部分,不允许我方人员代签,由用户或用户指定人进行签字确认。",
// "涉及到物业的由现场物业人员签字确认。"
// ],
// "note": "正面拍摄,完整看到单据 4 条边",
// "orderImages": null
// }
},
getWatermark(){
if(getApp().globalData.photo.waterSetting){
......
<!-- ******************* 输入框 ******************* -->
<template>
<view>
<view class="list u-flex u-row-between">
<image class="item-image" :src="mixingImage" v-if="item.required"></image>
<view class="u-m-r-20">{{item.fieldsTitle}}</view>
<view class="u-flex-1 location-name" >{{valueTxt}}</view>
</view>
</view>
</template>
<script>
import stringMixin from './stringMixin'
export default {
name: 'XhInput', // 新建 input
components: {},
mixins: [stringMixin],
props: {
placeholder: {
type: String,
default: '请输入'
},
},
data() {
return {
maxlength: 140,
}
},
computed: {
valueTxt() {
let str = '元'
const dataValue = this.dataValue
if(dataValue > 0){
str = dataValue + str
}
return str
},
mixingImage() {
return process.uniEnv.qn_base_url + 'mixing.png'
}
},
watch: {},
mounted() {
},
methods: {
}
}
</script>
<style scoped>
.required {
padding-right: 10rpx;
font-size: 28rpx;
line-height: 40rpx;
color: #fa3534;
}
.item-image {
width: 24rpx;
height: 24rpx;
margin-right: 10rpx;
}
.location-name {
color: #2272FF;
text-align: right;
}
.location {
background: #F4F5F7;
padding: 10rpx 20rpx;
border-radius: 12rpx;
}
</style>
......@@ -113,12 +113,22 @@
photo.currentItemLength = 0
// this.ctx = uni.createCameraContext();
this.updateTime()
this.getLocation()
const locationData = uni.getStorageSync('locationData')
const validityTime = 60000
if (Date.now() - locationData.locationTime < validityTime) { // 1分钟内不重复请求位置信息
this.waterInfo.latitude = locationData.waterInfo.latitude
this.waterInfo.longitude = locationData.waterInfo.longitude
this.baiduLocation()
} else {
this.getLocation()
}
this.getMarkPath()
this.initData()
photo.currentItem = this.currentItem
if (this.currentItem.images.length > 0) {
if (this.currentItem.images && this.currentItem.images.length > 0) {
this.shadowInitShow = true
this.standardShow = true
this.standardStatus = true
......@@ -266,6 +276,17 @@
success: function(res) {
waterInfo.longitude = parseFloat(res.longitude).toFixed(4)
waterInfo.latitude = parseFloat(res.latitude).toFixed(3)
const data = {
waterInfo: {
latitude: waterInfo.latitude,
longitude: waterInfo.longitude
},
locationTime: Date.now()
}
uni.setStorage({
key: 'locationData',
data: data,
})
that.baiduLocation()
},
fail(err) {
......
......@@ -24,7 +24,7 @@
<view class="class-bd">
<u-form-item v-for="(item,itemIndex) in groupItem.items" :key="itemIndex" label-position="top"
:prop="item.fieldsName" :border-bottom="false" v-show="item.fieldsId != 200 || show200">
<view :class="[{'label-bold': groupItem.name === '基本信息'}, 'label']" v-if="typeToComponentType(item.fieldsType)!=='location'&&typeToComponentType(item.fieldsType)!=='form'">
<view :class="[{'label-bold': groupItem.name === '基本信息'}, 'label']" v-if="typeToComponentType(item.fieldsType)!=='location'&&typeToComponentType(item.fieldsType)!=='form'&&typeToComponentType(item.fieldsType)!=='label'">
<image class="item-image" :src="mixingImage" v-if="item.required"></image>
{{item.fieldsTitle}}
</view>
......@@ -49,7 +49,7 @@
@value-change="fieldValueChange">
</xh-select>
<xh-files v-else-if="typeToComponentType(item.fieldsType)==='file'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :partnerCompanyId="partnerCompanyId" :value='form[item.fieldsName] || []'
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :partnerCompanyId="partnerCompanyId" :categoryId="categoryId" :value='form[item.fieldsName] || []'
@value-change="fieldValueChange">
</xh-files>
<xh-location v-else-if="typeToComponentType(item.fieldsType)==='location'"
......@@ -77,6 +77,9 @@
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :order-id="orderId" :value='form[item.fieldsName] || ""'
@value-change="fieldValueChange">
</xh-service-more>
<xh-label v-else-if="typeToComponentType(item.fieldsType)==='label'"
:groupIndex="groupIndex" :itemIndex="itemIndex" :item="item" :value='form[item.fieldsName] || ""'>
</xh-label>
</template>
</u-form-item>
</view>
......@@ -119,6 +122,7 @@
import XhTime from '@/components/createCom/XhTime.vue'
import XhServiceMeasure from '@/components/createCom/XhServiceMeasure.vue'
import XhServiceMore from "../../components/createCom/XhServiceMore";
import XhLabel from "../../components/createCom/XhLabel";
// import XhRadio from '@/components/createCom/XhRadio.vue'
export default {
data() {
......@@ -191,13 +195,13 @@
XhPicker,
XhTime,
XhServiceMeasure,
XhServiceMore
XhServiceMore,
XhLabel
},
created() {
// console.log(allComponents,'allComponents')
},
onLoad(option) {
console.log(option)
if (option) {
this.orderId = option.orderId
this.categoryId = option.categoryId
......@@ -415,10 +419,29 @@
this.getMenuItemTop()
})
},
calMaterialCraftListAmount(arr){
let amount = 0
if(arr){
arr.forEach(item =>{
if (Number(item.useLength) && Number(item.freeLength) && Number(item.unitAmt)) {
amount += Math.max(Number(item.useLength) - Number(item.freeLength), 0) * Number(item.unitAmt)
}
if(Number(item.extraAmt)){
amount += Number(item.extraAmt)
}
})
}
return amount
},
setData(data){// 通过页面设置数据
Object.keys(data).forEach(key => {
this.$set(this.form,key,data[key])
})
// 更新预计超出金额
let amount = this.calMaterialCraftListAmount(this.form.materialList)
amount += this.calMaterialCraftListAmount(this.form.craftList)
this.$set(this.form,'overAmount',amount)
},
// 字段的值更新
fieldValueChange(data) {
......@@ -444,8 +467,6 @@
}
}
}
console.log(this.form)
},
nextStep() {
if (this.tabIndex < this.list.length - 1) {
......@@ -469,7 +490,7 @@
case 'number':
case 'decimal':
case 'double':
case 'integer':
case 'integer':
formType = 'input'
break
case 'multiinput':
......@@ -510,6 +531,9 @@
case 'form':
formType = 'form'
break
case 'label':
formType = 'label'
break
}
return formType
},
......
......@@ -120,8 +120,8 @@
}
}
for (var item of this.other) {
if (item.freeMount && Number(item.freeMount)) {
amount += Number(item.freeMount)
if (item.extraAmt && Number(item.extraAmt)) {
amount += Number(item.extraAmt)
}
}
return amount
......@@ -156,9 +156,9 @@
methods: {
getMaterialData(){
let self = this
self.$u.api.getCompleteConfigAndData(self.orderId).then((res) => {
self.$u.api.getOrderMaterial(self.orderId).then((res) => {
if (res.code !== 200) {
console.log(result.data.message)
console.log(res.data.message)
return
}
self.formatServiceMoreList(res.data)
......
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