Commit cf8a0a74 authored by Damon's avatar Damon

feat: 完工配件信息回显

parent 4ad4f85b
......@@ -32,13 +32,13 @@
<script>
import adjustParts from "@/components/select-parts/adjust"
import arrMixin from './arrMixin'
import stringMixin from './stringMixin'
export default {
name: 'XhParts',
components: {
adjustParts
},
mixins: [arrMixin],
mixins: [stringMixin],
props: {
orderId: {
type: String,
......@@ -66,16 +66,16 @@
return process.uniEnv.qn_base_url + 'no_parts.png'
},
},
created() {
mounted() {
this.getWorkOrderParts()
},
methods: {
getWorkOrderParts() {
this.lists = this.dataValue || []
this.lists = JSON.parse(this.dataValue) || []
},
partsChange(val, index) {
this.$set(this.lists[index], 'quantity', val)
this.valueChange(this.lists)
this.valueChange(JSON.stringify(this.lists))
},
valChange(val) {
val.forEach(v => {
......@@ -86,7 +86,7 @@
this.$set(this.lists, index, v)
}
})
this.valueChange(this.lists)
this.valueChange(JSON.stringify(this.lists))
},
toParts() {
uni.navigateTo({
......
<!-- ******************* 扫码 ******************* -->
<template>
<view class="">
<view class="u-flex" @click="scanCode">
<view class="txt u-flex-1">扫描二维码(仅挚达充电桩可扫描)</view>
<u-icon name="arrow-right" color="#666" size="28"></u-icon>
<view class="">
<view class="u-flex" @click="scanCode">
<view class="txt u-flex-1">扫描二维码(仅挚达充电桩可扫描)</view>
<u-icon name="arrow-right" color="#666" size="28"></u-icon>
</view>
<view class="u-flex">
<u-input class="u-flex-1 input-item" v-model="dataValue" @input="valueChange" type="text" />
......@@ -23,33 +23,19 @@
return {}
},
computed: {
valueTxt() {
let str = ''
const dataValue = this.dataValue
if(dataValue && dataValue.length>1){
str = '经度:'+dataValue[0]+','+'维度:'+dataValue[1]
}
return str
}
},
watch: {},
mounted() {},
methods: {
scanCode(type){
const self = this
// qrCode 二维码;barCode 条形码
let scanType = type && [type] || ['qrCode']
uni.scanCode({
// scanType: scanType,
success: function (res) {
self.dataValue = res.result
self.valueChange(res.result)
self.dataValue = res.result
self.valueChange(res.result)
}
});
},
// setValue(txt) {
// this.valueChange(this.dataValue)
// }
}
}
}
</script>
......@@ -59,10 +45,10 @@
font-size: 28rpx;
line-height: 40rpx;
color: #fa3534;
}
.input-item{
background: #F4F5F7;
border-radius: 12rpx;
padding-left: 20rpx;
}
.input-item{
background: #F4F5F7;
border-radius: 12rpx;
padding-left: 20rpx;
}
</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