Commit 9fd0f344 by zhuxiaomei

日期的处理

parent 1d20a92c
......@@ -810,10 +810,10 @@
sample: {
trademark: '',
qrcode: '',
firstClass:'',
secondClass:'',
thirdClass:'',
fourthClass:'',
firstClass: '',
secondClass: '',
thirdClass: '',
fourthClass: '',
type: '',
typeRemark: '',
source: '',
......@@ -821,7 +821,7 @@
properties: '',
propertiesRemark: '',
dateType: '',
sampleDate:'',
sampleDate: '',
standard: '',
batchNo: '',
specification: '',
......@@ -852,7 +852,7 @@
thirdPartyNatureList: ['委托', '代理', '经销', '进口', '其他'],
storageCondition:[],
storageCondition: [],
place: '', //1生产环节2流通环节3餐饮环节 值为“环节,地点”
placeRemark1: '',
placeRemark2: '',
......@@ -885,7 +885,7 @@
},
methods: {
_open() {
console.log(this.$route.query.id,'this.$route.query.id')
console.log(this.$route.query.id, 'this.$route.query.id')
if (this.$route.query.id) {
this.id = this.$route.query.id
this._getData()
......@@ -901,45 +901,49 @@
this.formObj[key] = result[key]
}
}
for(let key in this.netTested){
if(result.netTested[key]){
this.netTested = result.netTested[key]
for (let key in this.netTested) {
if (result.netTested[key]) {
this.netTested[key] = result.netTested[key]
}
}
for(let key in this.sample){
if(result.sample[key]){
this.sample = result.sample[key]
for (let key in this.sample) {
if (result.sample[key]) {
if (key === 'sampleDate') {
this.sample[key] = result.sample[key] ? this.$dateformat(result.sample[key], 'yyyy-mm-dd') : ''
} else {
this.sample[key] = result.sample[key]
}
}
}
this.testedType = result.testedType
this.shelfId = result.shelfId
}
},
_valParams(){
if(this.formObj.samplingNum===''){
_valParams() {
if (this.formObj.samplingNum === '') {
this.$toast('请输入抽样单编号')
return true
}
if(this.sample.firstClass===''){
if (this.sample.firstClass === '') {
this.$toast('请输入大类')
return true
}
if(this.sample.secondClass===''){
if (this.sample.secondClass === '') {
this.$toast('请输入大亚类')
return true
}
if(this.sample.thirdClass===''){
if (this.sample.thirdClass === '') {
this.$toast('请输入次亚类')
return true
}
if(this.sample.fourthClass===''){
if (this.sample.fourthClass === '') {
this.$toast('请输入细类')
return true
}
return false
},
_ok() {
if(this._valParams()){
if (this._valParams()) {
return
}
let data = Object.assign({}, this.formObj, {nonNetTested: this.nonNetTested}, {sample: this.sample})
......@@ -961,7 +965,7 @@
}
data.shelfId = this.shelfId
data.testedType = this.testedType
console.log(this.testedType,'this.testedType')
console.log(this.testedType, 'this.testedType')
if (this.id) {
this._editSave(data)
} else {
......
......@@ -809,7 +809,7 @@
sample: {
trademark: '',
num: '',
batchNo:'',
batchNo: '',
firstClass: '',
secondClass: '',
thirdClass: '',
......@@ -821,7 +821,7 @@
properties: '',
propertiesRemark: '',
dateType: '',
sampleDate:'',
sampleDate: '',
shelfLife: '',
standard: '',
qualityGrade: '',
......@@ -879,12 +879,16 @@
}
for (let key in this.netTested) {
if (result.netTested[key]) {
this.netTested = result.netTested[key]
this.netTested[key] = result.netTested[key]
}
}
for (let key in this.sample) {
if (result.sample[key]) {
this.sample = result.sample[key]
if (key === 'sampleDate') {
this.sample[key] = result.sample[key] ? this.$dateformat(result.sample[key], 'yyyy-mm-dd') : ''
} else {
this.sample[key] = result.sample[key]
}
}
}
this.testedType = result.testedType
......
......@@ -904,7 +904,11 @@
}
for(let key in this.sample){
if(result.sample[key]){
this.sample[key] = result.sample[key]
if (key === 'sampleDate') {
this.sample[key] = result.sample[key] ? this.$dateformat(result.sample[key], 'yyyy-mm-dd') : ''
} else {
this.sample[key] = result.sample[key]
}
}
}
this.testedType = result.testedType
......
......@@ -879,7 +879,11 @@
}
for (let key in this.sample) {
if (result.sample[key]) {
this.sample[key] = result.sample[key]
if (key === 'sampleDate') {
this.sample[key] = result.sample[key] ? this.$dateformat(result.sample[key], 'yyyy-mm-dd') : ''
} else {
this.sample[key] = result.sample[key]
}
}
}
this.testedType = result.testedType
......
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