Commit a002b6c6 by zhuxiaomei

赋值的问题

parent 2113b1d7
......@@ -38,7 +38,13 @@
return {
showHighSearch: false,
searchValue: '',
labelText: this.label ? this.label : '关键字'
}
},
computed: {
labelText: {
get() {
return this.label ? this.label : '关键字'
},
}
},
watch: {
......
......@@ -300,7 +300,7 @@
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-width="25%"
label-align="center"
v-model="sample.firstClass"
label="大类"
......@@ -311,7 +311,7 @@
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-width="25%"
label-align="center"
v-model="sample.secondClass"
label="亚类"
......@@ -324,7 +324,7 @@
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-width="25%"
label-align="center"
v-model="sample.thirdClass"
label="次亚类"
......@@ -335,7 +335,7 @@
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-width="25%"
label-align="center"
v-model="sample.fourthClass"
label="细类"
......@@ -1131,7 +1131,7 @@
},
_scanResult(result) {
for (let key in this.sample) {
if (result[key]) {
if (result[key]!=='') {
if (key === 'sampleDate') {
this.sample[key] = result[key] ? this.$dateformat(result[key], 'yyyy-mm-dd') : ''
} else if (key === 'storageCondition') {
......@@ -1209,7 +1209,7 @@
let result = await samplingSummary.getById(this.id)
if (result) {
for (let key in this.formObj) {
if (result[key]) {
if (result[key]!=='') {
if (key === 'samplingDate') {
this.formObj[key] = result[key] ? this.$dateformat(result[key], 'yyyy-mm-dd') : ''
} else {
......@@ -1218,12 +1218,12 @@
}
}
for (let key in this.nonNetTested) {
if (result.nonNetTested[key]) {
if (result.nonNetTested[key]!=='') {
this.nonNetTested[key] = result.nonNetTested[key]
}
}
for (let key in this.sample) {
if (result.sample[key]) {
if (result.sample[key]!=='') {
if (key === 'sampleDate') {
this.sample[key] = result.sample[key] ? this.$dateformat(result.sample[key], 'yyyy-mm-dd') : ''
} else if (key === 'storageCondition') {
......
......@@ -295,7 +295,7 @@
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-width="25%"
label-align="center"
v-model="sample.firstClass"
label="大类"
......@@ -306,7 +306,7 @@
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-width="25%"
label-align="center"
v-model="sample.secondClass"
label="亚类"
......@@ -319,7 +319,7 @@
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-width="25%"
label-align="center"
v-model="sample.thirdClass"
label="次亚类"
......@@ -330,7 +330,7 @@
<table-col>
<van-field
label-class="cus-field-class"
label-width="50%"
label-width="25%"
label-align="center"
v-model="sample.fourthClass"
label="细类"
......@@ -1068,7 +1068,7 @@
},
_scanResult(result) {
for (let key in this.sample) {
if (result[key]) {
if (result[key]!=='') {
if (key === 'sampleDate') {
this.sample[key] = result[key] ? this.$dateformat(result[key], 'yyyy-mm-dd') : ''
} else if (key === 'storageCondition') {
......@@ -1147,7 +1147,7 @@
let result = await samplingSummary.getById(this.id)
if (result) {
for (let key in this.formObj) {
if (result[key]) {
if (result[key]!=='') {
if (key === 'samplingDate') {
this.formObj[key] = result[key] ? this.$dateformat(result[key], 'yyyy-mm-dd') : ''
} else {
......@@ -1156,12 +1156,12 @@
}
}
for (let key in this.netTested) {
if (result.netTested[key]) {
if (result.netTested[key]!=='') {
this.netTested[key] = result.netTested[key]
}
}
for (let key in this.sample) {
if (result.sample[key]) {
if (result.sample[key]!=='') {
if (key === 'sampleDate') {
this.sample[key] = result.sample[key] ? this.$dateformat(result.sample[key], 'yyyy-mm-dd') : ''
} else if (key === 'storageCondition') {
......
......@@ -294,7 +294,7 @@
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-width="25%"
label-align="center"
v-model="sample.firstClass"
label="大类"
......@@ -303,7 +303,7 @@
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-width="25%"
label-align="center"
v-model="sample.secondClass"
label="亚类"
......@@ -314,7 +314,7 @@
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-width="25%"
label-align="center"
v-model="sample.thirdClass"
label="次亚类"
......@@ -323,7 +323,7 @@
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-width="25%"
label-align="center"
v-model="sample.fourthClass"
label="细类"
......@@ -954,7 +954,7 @@
let result = await samplingSummary.getById(this.id)
if (result) {
for (let key in this.formObj) {
if (result[key]) {
if (result[key]!=='') {
if (key === 'samplingDate') {
this.formObj[key] = result[key] ? this.$dateformat(result[key], 'yyyy-mm-dd') : ''
} else {
......@@ -963,12 +963,12 @@
}
}
for(let key in this.nonNetTested){
if(result.nonNetTested[key]){
if(result.nonNetTested[key]!==''){
this.nonNetTested[key] = result.nonNetTested[key]
}
}
for(let key in this.sample){
if(result.sample[key]){
if(result.sample[key]!==''){
if (key === 'sampleDate') {
this.sample[key] = result.sample[key] ? this.$dateformat(result.sample[key], 'yyyy-mm-dd') : ''
}else if(key==='storageCondition'){
......
......@@ -290,7 +290,7 @@
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-width="25%"
label-align="center"
v-model="sample.firstClass"
label="大类"
......@@ -299,7 +299,7 @@
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-width="25%"
label-align="center"
v-model="sample.secondClass"
label="亚类"
......@@ -310,7 +310,7 @@
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-width="25%"
label-align="center"
v-model="sample.thirdClass"
label="次亚类"
......@@ -319,7 +319,7 @@
<table-col>
<van-field readonly
label-class="cus-field-class"
label-width="50%"
label-width="25%"
label-align="center"
v-model="sample.fourthClass"
label="细类"
......@@ -932,7 +932,7 @@
let result = await samplingSummary.getById(this.id)
if (result) {
for (let key in this.formObj) {
if (result[key]) {
if (result[key]!=='') {
if (key === 'samplingDate') {
this.formObj[key] = result[key] ? this.$dateformat(result[key], 'yyyy-mm-dd') : ''
} else {
......@@ -941,12 +941,12 @@
}
}
for (let key in this.netTested) {
if (result.netTested[key]) {
if (result.netTested[key]!=='') {
this.netTested[key] = result.netTested[key]
}
}
for (let key in this.sample) {
if (result.sample[key]) {
if (result.sample[key]!=='') {
if (key === 'sampleDate') {
this.sample[key] = result.sample[key] ? this.$dateformat(result.sample[key], 'yyyy-mm-dd') : ''
} else if(key==='storageCondition'){
......
......@@ -72,8 +72,8 @@
})
},
_getSample: async function (data) {
console.log(data, 'data')
let res = await samplingSample.scanSample({num: data})
console.log(data,'data')
let res = await samplingSample.scanSample({qrcode: '123456'})
if (res) {
this.$emit('on-result-change', res)
barcode.close();
......
......@@ -3,12 +3,12 @@
:safe-area-inset-bottom="true"
:close-on-popstate="true">
<div style="height: 70vh;overflow: hidden;background: #f7f8fa">
<search-bar ref="searchBar" :label="level===0?'大类':level===1?'亚类':level===2?'次亚类':'细类'" :fixed="false"
<search-bar ref="searchBar" :label="label" :fixed="false"
@search="_search"></search-bar>
<div style="height:calc(100% - 55px);overflow:auto">
<div class="result-item" v-for="item in resultList" :key="item"
@click="_tapResult(item)">
<div> {{item}}</div>
<div>{{item}}</div>
</div>
</div>
</div>
......@@ -24,6 +24,7 @@
return {
key: '',
resultList: [],
label: '',
level: '',
pname: '',
showPicker: false
......@@ -35,6 +36,7 @@
this.level = level
this.pname = pname
this.key = ''
this.label = level === 0 ? '大类' : level === 1 ? '亚类' : level === 2 ? '次亚类' : '细类'
this.$nextTick(function () {
this.$refs.searchBar.searchValue = ''
})
......
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