Commit f4416d07 by zhuxiaomei

样品名称和日期

parent 9fd0f344
...@@ -238,8 +238,7 @@ ...@@ -238,8 +238,7 @@
label-class="cus-field-class" label-class="cus-field-class"
label-width="50%" label-width="50%"
label-align="center" label-align="center"
name="sampleName" v-model="sample.name"
v-model="formObj.sampleName"
label="样品名称" label="样品名称"
></van-field> ></van-field>
</table-col> </table-col>
...@@ -383,6 +382,7 @@ ...@@ -383,6 +382,7 @@
</table-col> </table-col>
<table-col> <table-col>
<van-field <van-field
readonly
label-class="cus-field-class" label-class="cus-field-class"
label-width="50%" label-width="50%"
label-align="center" label-align="center"
...@@ -747,6 +747,16 @@ ...@@ -747,6 +747,16 @@
<div class="bottom-btn"> <div class="bottom-btn">
<van-button block type="info" @click="_ok">保存</van-button> <van-button block type="info" @click="_ok">保存</van-button>
</div> </div>
<van-popup v-model="showPicker" position="bottom"
:safe-area-inset-bottom="true"
:close-on-popstate="true">
<van-datetime-picker
:type="type"
v-model="currentDate"
@confirm="_dateOnConfirm"
@cancel="showPicker = false"
></van-datetime-picker>
</van-popup>
</div> </div>
</template> </template>
...@@ -765,11 +775,13 @@ ...@@ -765,11 +775,13 @@
}, },
data() { data() {
return { return {
showPicker:false,
currentDate:new Date(),
selectDateType:'',
formObj: { formObj: {
samplingNum: '', samplingNum: '',
taskNum: '', taskNum: '',
sampleName: '',
source: '', source: '',
taskType: '', taskType: '',
proName: '', proName: '',
...@@ -808,6 +820,7 @@ ...@@ -808,6 +820,7 @@
placeRemark: '' //保存时单独赋值 根据环节取对应的placeRemarkN placeRemark: '' //保存时单独赋值 根据环节取对应的placeRemarkN
}, },
sample: { sample: {
name:'',
trademark: '', trademark: '',
qrcode: '', qrcode: '',
firstClass: '', firstClass: '',
...@@ -985,6 +998,14 @@ ...@@ -985,6 +998,14 @@
this.$toast('编辑成功!') this.$toast('编辑成功!')
this.$router.go(-1) this.$router.go(-1)
} }
},
_selectDate(type){
this.selectDateType = type
this.showPicker = true
},
_dateOnConfirm(date) {
this.sample.sampleDate = this.$dateformat(date, this.format)
this.showPicker = false
} }
} }
} }
......
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
label-class="cus-field-class" label-class="cus-field-class"
label-width="50%" label-width="50%"
label-align="center" label-align="center"
v-model="formObj.sampleName" v-model="sample.name"
label="样品名称" label="样品名称"
></van-field> ></van-field>
</table-col> </table-col>
...@@ -377,11 +377,13 @@ ...@@ -377,11 +377,13 @@
</table-col> </table-col>
<table-col> <table-col>
<van-field <van-field
readonly
label-class="cus-field-class" label-class="cus-field-class"
label-width="50%" label-width="50%"
label-align="center" label-align="center"
v-model="sample.sampleDate" v-model="sample.sampleDate"
label="" label=""
@click="_selectDate('sample.sampleDate')"
></van-field> ></van-field>
</table-col> </table-col>
<table-col> <table-col>
...@@ -741,6 +743,17 @@ ...@@ -741,6 +743,17 @@
<div class="bottom-btn"> <div class="bottom-btn">
<van-button block type="info" @click="_ok">保存</van-button> <van-button block type="info" @click="_ok">保存</van-button>
</div> </div>
<van-popup v-model="showPicker" position="bottom"
:safe-area-inset-bottom="true"
:close-on-popstate="true">
<van-datetime-picker
:type="type"
v-model="currentDate"
@confirm="_dateOnConfirm"
@cancel="showPicker = false"
></van-datetime-picker>
</van-popup>
</div> </div>
</template> </template>
...@@ -760,12 +773,14 @@ ...@@ -760,12 +773,14 @@
}, },
data() { data() {
return { return {
showPicker:false,
currentDate:new Date(),
selectDateType:'',
formObj: { formObj: {
samplingNum: '', samplingNum: '',
taskNum: '', taskNum: '',
source: '', source: '',
taskType: '', taskType: '',
sampleName: '',
proName: '', proName: '',
proAddress: '', proAddress: '',
...@@ -807,6 +822,7 @@ ...@@ -807,6 +822,7 @@
place: '', //保存时单独赋值 从place字段分离出 place: '', //保存时单独赋值 从place字段分离出
}, },
sample: { sample: {
name:'',
trademark: '', trademark: '',
num: '', num: '',
batchNo: '', batchNo: '',
...@@ -950,6 +966,14 @@ ...@@ -950,6 +966,14 @@
this.$toast('编辑成功!') this.$toast('编辑成功!')
this.$router.go(-1) this.$router.go(-1)
} }
},
_selectDate(type){
this.selectDateType = type
this.showPicker = true
},
_dateOnConfirm(date) {
this.sample.sampleDate = this.$dateformat(date, this.format)
this.showPicker = false
} }
} }
} }
......
...@@ -238,8 +238,7 @@ ...@@ -238,8 +238,7 @@
label-class="cus-field-class" label-class="cus-field-class"
label-width="50%" label-width="50%"
label-align="center" label-align="center"
name="sampleName" v-model="sample.name"
v-model="formObj.sampleName"
label="样品名称" label="样品名称"
></van-field> ></van-field>
</table-col> </table-col>
...@@ -770,7 +769,6 @@ ...@@ -770,7 +769,6 @@
samplingNum: '', samplingNum: '',
taskNum: '', taskNum: '',
sampleName: '',
source: '', source: '',
taskType: '', taskType: '',
proName: '', proName: '',
...@@ -809,6 +807,7 @@ ...@@ -809,6 +807,7 @@
placeRemark: '' //保存时单独赋值 根据环节取对应的placeRemarkN placeRemark: '' //保存时单独赋值 根据环节取对应的placeRemarkN
}, },
sample: { sample: {
name:'',
trademark: '', trademark: '',
qrcode: '', qrcode: '',
firstClass:'', firstClass:'',
......
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
label-class="cus-field-class" label-class="cus-field-class"
label-width="50%" label-width="50%"
label-align="center" label-align="center"
v-model="formObj.sampleName" v-model="sample.name"
label="样品名称" label="样品名称"
></van-field> ></van-field>
</table-col> </table-col>
...@@ -766,7 +766,6 @@ ...@@ -766,7 +766,6 @@
taskNum: '', taskNum: '',
source: '', source: '',
taskType: '', taskType: '',
sampleName: '',
proName: '', proName: '',
proAddress: '', proAddress: '',
...@@ -808,6 +807,7 @@ ...@@ -808,6 +807,7 @@
place: '', //保存时单独赋值 从place字段分离出 place: '', //保存时单独赋值 从place字段分离出
}, },
sample: { sample: {
name:'',
trademark: '', trademark: '',
num: '', num: '',
batchNo:'', batchNo:'',
......
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