Commit cdefca66 by zhuxiaomei

抽样单位取最近的 重选清空remark

parent ad4e06d4
......@@ -10,4 +10,5 @@ export default {
edit: data => httpJson.post('/drs/v1/sampling_summary/edit',JSON.stringify(data)).then(res => res),
deleteByIds: ids => http.delete('/drs/v1/sampling_summary/?ids=' + ids).then(res => res),
getById: id => http.get('/drs/v1/sampling_summary/' + id).then(res => res),
lastTester: () => http.post('/drs/v1/sampling_summary/last_tester').then(res => res),
}
......@@ -102,7 +102,7 @@
</van-radio>
</van-radio-group>
<div style="border-bottom: 1px solid #000">
<van-field
<van-field :readonly="nonNetTested.areaType!=='其他'"
label-class="cus-field-class"
label-width="50%"
label-align="center"
......@@ -183,7 +183,7 @@
{{item}}
</van-radio>
<div style="border-bottom: 1px solid #000">
<van-field
<van-field :readonly="placeRemark1Readonly"
label-class="cus-field-class"
label-width="50%"
label-align="center"
......@@ -197,7 +197,7 @@
{{item}}
</van-radio>
<div style="border-bottom: 1px solid #000">
<van-field
<van-field :readonly="placeRemark2Readonly"
label-class="cus-field-class"
label-width="50%"
label-align="center"
......@@ -225,7 +225,7 @@
shape="square">{{item}}
</van-radio>
<div style="border-bottom: 1px solid #000">
<van-field
<van-field :readonly="placeRemark3Readonly"
label-class="cus-field-class"
label-width="50%"
label-align="center"
......@@ -344,7 +344,7 @@
{{item}}
</van-radio>
<div style="border-bottom: 1px solid #000">
<van-field
<van-field :readonly="sample.type!=='其他'"
label-class="cus-field-class"
label-width="50%"
label-align="center"
......@@ -369,7 +369,7 @@
</van-radio>
</van-radio-group>
<div style="border-bottom: 1px solid #000">
<van-field
<van-field :readonly="sample.source!=='其他'"
label-class="cus-field-class"
label-width="50%"
label-align="center"
......@@ -392,7 +392,7 @@
</van-radio>
</van-radio-group>
<div style="border-bottom: 1px solid #000">
<van-field
<van-field :readonly="sample.properties!=='其他'"
label-class="cus-field-class"
label-width="50%"
label-align="center"
......@@ -688,7 +688,7 @@
</van-radio>
</van-radio-group>
<div style="border-bottom: 1px solid #000">
<van-field
<van-field :readonly="formObj.thirdPartyNature!=='其他'"
label-class="cus-field-class"
label-width="50%"
label-align="center"
......@@ -843,7 +843,7 @@
selectDateType: '',
showCityPicker: false,
areaList:areaList,
areaList: areaList,
formObj: {
samplingNum: '',
......@@ -867,12 +867,12 @@
testAddress: '',
testLinkman: '',
testTel: '',
testEmail: '',
testFax: '',
remark: '',
samplingDate: '',
testMembers: '',
testEmail: '',
},
nonNetTested: {
name: '',
......@@ -945,6 +945,11 @@
placeRemark1: '',
placeRemark2: '',
placeRemark3: '',
placeRemark1Readonly: true,
placeRemark2Readonly: true,
placeRemark3Readonly: true,
proLinkList: ['原辅料库', '生产线', '半成品库', '成品库待检区', '成品库已检区', '其他'],
flowLinkList: ['农贸市场', '菜市场', '批发市场', '商场', '超市', '小食杂店', '其他'],
restLinkList1: [
......@@ -968,9 +973,70 @@
shelfId: this.$route.query.shelfId
}
},
watch: {
//除储存条件 选其他以外的选项备注清空
'nonNetTested.areaType': function (val) {
if (val !== '' && val !== '其他') {
this.nonNetTested.areaTypeRemark = ''
}
},
'sample.type': function (val) {
if (val !== '' && val !== '其他') {
this.sample.typeRemark = ''
}
},
'sample.source': function (val) {
if (val !== '' && val !== '其他') {
this.sample.sourceRemark = ''
}
},
'sample.properties': function (val) {
if (val !== '' && val !== '其他') {
this.sample.propertiesRemark = ''
}
},
'formObj.thirdPartyNature': function (val) {
if (val !== '' && val !== '其他') {
this.formObj.thirdPartyNatureRemark = ''
}
},
//抽样地点特殊处理
place: function (val) {
if (val !== '') {
let placeLink = val.split(',')[0]
let place = val.split(',')[1]
if (placeLink === '1') {
if (place === '其他') {
this.placeRemark1Readonly = false
} else {
this.placeRemark1 = ''
this.placeRemark1Readonly = true
}
} else if (placeLink === '2') {
if (place === '其他') {
this.placeRemark2Readonly = false
} else {
this.placeRemark2 = ''
this.placeRemark2Readonly = true
}
} else if (placeLink === '3') {
if (place === '其他') {
this.placeRemark3Readonly = false
} else {
this.placeRemark3 = ''
this.placeRemark3Readonly = true
}
}
} else {
this.placeRemark1Readonly = true
this.placeRemark2Readonly = true
this.placeRemark3Readonly = true
}
},
},
computed: {
areaObj:function(){
return this.nonNetTested.testedProvince+this.nonNetTested.testedCity+this.nonNetTested.testedCountry
areaObj: function () {
return this.nonNetTested.testedProvince + this.nonNetTested.testedCity + this.nonNetTested.testedCountry
}
},
mounted() {
......@@ -978,12 +1044,25 @@
},
methods: {
_open() {
if (this.$route.query.id) {
if (this.$route.query.id) {//编辑
this.id = this.$route.query.id
this._getData()
} else {
} else {//添加
this.id = ''
this.formObj.testMembers = this.$global.getUserInfo().realname
this._getLastTester()
}
},
//获取最近填写的抽样单位信息
_getLastTester: async function () {
let result = await samplingSummary.lastTester()
if (result) {
this.formObj.testName = result.testName ? result.testName : ''
this.formObj.testAddress = result.testAddress ? result.testAddress : ''
this.formObj.testLinkman = result.testLinkman ? result.testLinkman : ''
this.formObj.testTel = result.testTel ? result.testTel : ''
this.formObj.testEmail = result.testEmail ? result.testEmail : ''
this.formObj.testFax = result.testFax ? result.testFax : ''
}
},
_getData: async function () {
......
......@@ -342,11 +342,11 @@
</van-radio>
</van-radio-group>
<div style="border-bottom: 1px solid #000">
<van-field
<van-field :readonly="sample.type!=='其他'"
label-class="cus-field-class"
label-width="50%"
label-align="center"
v-model="sample.typeRemak"
v-model="sample.typeRemark"
></van-field>
</div>
</template>
......@@ -366,7 +366,7 @@
</van-radio>
</van-radio-group>
<div style="border-bottom: 1px solid #000">
<van-field
<van-field :readonly="sample.source!=='其他'"
label-class="cus-field-class"
label-width="50%"
label-align="center"
......@@ -389,7 +389,7 @@
</van-radio>
</van-radio-group>
<div style="border-bottom: 1px solid #000">
<van-field
<van-field :readonly="sample.properties!=='其他'"
label-class="cus-field-class"
label-width="50%"
label-align="center"
......@@ -684,7 +684,7 @@
</van-radio>
</van-radio-group>
<div style="border-bottom: 1px solid #000">
<van-field
<van-field :readonly="formObj.thirdPartyNature!=='其他'"
label-class="cus-field-class"
label-width="50%"
label-align="center"
......@@ -906,7 +906,7 @@
thirdClass: '',
fourthClass: '',
type: '',
typeRemak: '',
typeRemark: '',
source: '',
sourceRemark: '',
properties: '',
......@@ -949,6 +949,29 @@
shelfId: this.$route.query.shelfId
}
},
watch:{
//除储存条件 选其他以外的选项备注清空
'sample.type':function (val) {
if(val!=='其他'){
this.sample.typeRemark =''
}
},
'sample.source':function (val) {
if(val!=='其他'){
this.sample.sourceRemark =''
}
},
'sample.properties':function (val) {
if(val!=='其他'){
this.sample.propertiesRemark =''
}
},
'formObj.thirdPartyNature':function (val) {
if(val!=='其他'){
this.formObj.thirdPartyNatureRemark =''
}
}
},
computed: {
areaObj:function(){
return this.netTested.testedProvince+this.netTested.testedCity+this.netTested.testedCountry
......@@ -959,12 +982,25 @@
},
methods: {
_open() {
if (this.$route.query.id) {
if (this.$route.query.id) {//编辑
this.id = this.$route.query.id
this._getData()
} else {
} else {//添加
this.id = ''
this.formObj.testMembers = this.$global.getUserInfo().realname
this._getLastTester()
}
},
//获取最近填写的抽样单位信息
_getLastTester: async function () {
let result = await samplingSummary.lastTester()
if (result) {
this.formObj.testName = result.testName ? result.testName : ''
this.formObj.testAddress = result.testAddress ? result.testAddress : ''
this.formObj.testLinkman = result.testLinkman ? result.testLinkman : ''
this.formObj.testTel = result.testTel ? result.testTel : ''
this.formObj.testEmail = result.testEmail ? result.testEmail : ''
this.formObj.testFax = result.testFax ? result.testFax : ''
}
},
_getData: async function () {
......
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