Commit d6a40082 authored by 王飞龙's avatar 王飞龙

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/views/equipment-management/equipment-management/equipment-detail.vue
parent 449e160a
......@@ -141,7 +141,8 @@
:picker-options="{
start: '01:00',
step: '01:00',
end: '12:00'
end: '12:00',
maxTime:form.useTime.ame
}"
/>
</el-form-item>
......@@ -180,7 +181,8 @@
:picker-options="{
start: '12:00',
step: '01:00',
end: '24:00'
end: '24:00',
maxTime:form.useTime.pme
}"
/>
</el-form-item>
......@@ -338,8 +340,7 @@ export default {
// 设备归属 0 平台设备 1医院设备
isPrivate: '',
cityOptions: regionData,
// 存储省市区选中的地址码
selectedOptions: [],
// 地址码对用的文字
addtions: {
names: ''
......@@ -381,7 +382,7 @@ export default {
{ required: true, message: '请输入详细地址地址(街道、楼牌号等)', trigger: 'blur' }
],
'useTime.ams': [
{ required: true, validator: this.validateMorningStart, trigger: 'change' }
{ required: true, validator: this.validateMorningStart, trigger: 'blur' }
],
'useTime.ame': [
{ required: true, validator: this.validateMorningEnd, trigger: 'blur' }
......@@ -456,10 +457,13 @@ export default {
// 表单参数
form: {
deviceName: '',
// 存储省市区选中的地址码
selectedOptions: [],
// appointmentMethod: '',
sort: 0,
isPrivate: '1',
serviceArea: '',
serviceArea: [],
checkType: [],
head: '',
phone: '',
useNum: 0,
......@@ -512,6 +516,7 @@ export default {
this.isPrivate = 0
}
console.log('登陆人', res)
console.log('this.form--------------------', this.form)
})
},
// 时间段获取
......@@ -560,16 +565,16 @@ export default {
},
// 选择地址
handleChangeAddress(value) {
this.selectedOptions = value
console.log('地区码', this.selectedOptions)
this.form.selectedOptions = value
console.log('地区码', this.form.selectedOptions)
var name = ''
this.selectedOptions.map(item => name += CodeToText[item] + '') // 将省市区三个拼接一起
this.form.selectedOptions.map(item => name += CodeToText[item] + '') // 将省市区三个拼接一起
this.addtions.names = name
console.log(this.addtions.names)
// 运用了CodeToText把编码转成了中文
this.addForm.province = CodeToText[this.selectedOptions[0]]
this.addForm.county = CodeToText[this.selectedOptions[1]]
this.addForm.area = CodeToText[this.selectedOptions[2]]
this.addForm.province = CodeToText[ this.form.selectedOptions[0]]
this.addForm.county = CodeToText[ this.form.selectedOptions[1]]
this.addForm.area = CodeToText[ this.form.selectedOptions[2]]
if (this.addForm.county === '市辖区' || this.addForm.county === '县') {
this.city = this.addForm.province
} else {
......@@ -618,7 +623,7 @@ export default {
console.log('上午开始时间第一层报错')
callback(new Error('请选择上午开始时间'))
} else {
if (isEmpty(value) && isEmpty(morningEnd)) {
if (isEmpty(value) && isEmpty(!morningEnd)) {
console.log('上午开始时间第二层报错')
callback(new Error('请选择上午开始时间'))
} else {
......@@ -632,7 +637,7 @@ export default {
console.log('上午结束时间第一层报错')
callback(new Error('请选择上午结束时间'))
} else {
if (isEmpty(value) && isEmpty(morningStart)) {
if (isEmpty(value) && isEmpty(!morningStart)) {
console.log('上午结束时间第一层报错')
callback(new Error('请选择上午结束时间'))
} else {
......@@ -646,7 +651,7 @@ export default {
console.log(' 下午开始时间第一层报错')
callback(new Error('请选择下午开始时间'))
} else {
if (isEmpty(value) && isEmpty(afternoonEnd)) {
if (isEmpty(value) && isEmpty(!afternoonEnd)) {
console.log('下午开始时间开始第二层报错')
callback(new Error('请选择下午开始时间'))
} else {
......@@ -660,7 +665,7 @@ export default {
console.log('下午结束时间结束第一层报错')
callback(new Error('请选择下午结束时间'))
} else {
if (isEmpty(value) && isEmpty(afternoonStart)) {
if (isEmpty(value) && isEmpty(!afternoonStart)) {
console.log('下午结束时间结束第二层报错')
callback(new Error('请选择下午结束时间'))
} else {
......@@ -672,8 +677,8 @@ export default {
submitForm() {
const form = deepClone(this.form)
console.log('this.form-----------------------', this.form)
if (this.selectedOptions != null) {
form.addressCode = this.selectedOptions.join(',')
if (form.selectedOptions != null) {
form.addressCode = form.selectedOptions.join(',')
}
if (this.addtions.names != null) {
form.addressText = this.addtions.names
......@@ -692,8 +697,6 @@ export default {
}
form.isPrivate = this.isPrivate
this.loading = true
// TODO: please clear this log
console.log('form=======================================', form)
this.$refs['form'].validate(valid => {
if (valid) {
addDevice(form).then(response => {
......
......@@ -451,7 +451,8 @@
:picker-options="{
start: '01:00',
step: '01:00',
end: '12:00'
end: '12:00',
maxTime:form.useTime.ame
}"
/>
</el-form-item>
......@@ -489,7 +490,8 @@
:picker-options="{
start: '12:00',
step: '01:00',
end: '24:00'
end: '24:00',
maxTime:form.useTime.pme
}"
/>
</el-form-item>
......@@ -713,8 +715,8 @@ export default {
{ required: true, message: '请选择设备类型', trigger: 'change' }
],
selectedOptions: [
// { required: true, message: '请选择服务地点', trigger: 'blur' }
{ required: true, validator: this.validaddress, trigger: 'blur' }
{ required: true, message: '请选择服务地点', trigger: 'blur' },
{ type: 'number', validator: this.validaddress, trigger: 'change' }
],
// addressCode: [
// { required: true, message: '请选择服务地点', trigger: 'change,blur' }
......@@ -723,7 +725,7 @@ export default {
{ required: true, message: '请输入服务地址', trigger: 'blur' }
],
'useTime.ams': [
{ required: true, validator: this.validateMorningStart, trigger: 'change' }
{ required: true, validator: this.validateMorningStart, trigger: 'blur' }
],
'useTime.ame': [
{ required: true, validator: this.validateMorningEnd, trigger: 'blur' }
......@@ -752,10 +754,12 @@ export default {
{ min: 2, max: 200, message: '备注长度必须介于2~200之间', trigger: 'blur' }
],
serviceArea: [
{ required: true, message: '请选择支持服务地区', trigger: 'blur' }
{ required: true, message: '请选择支持服务地区', trigger: 'blur' },
{ type: 'number', validator: this.validserviceArea, trigger: 'change' }
],
checkType: [
{ required: true, message: '请选择支持检查类型', trigger: 'blur' }
{ required: true, message: '请选择支持检查类型', trigger: 'blur' },
{ type: 'number', validator: this.validcheckType, trigger: 'change' }
]
},
// 是否平台自有设备
......@@ -899,6 +903,7 @@ export default {
callback(new Error('单位时段服务数不能为0'))
}
},
// 服务地点表单校验
validaddress(rule, value, callback) {
console.log('validaddress', this.form.selectedOptions)
if (this.form.selectedOptions.length > 0) {
......@@ -907,6 +912,24 @@ export default {
callback(new Error('请选择服务地点'))
}
},
// 支持服务地区表单校验
validserviceArea(rule, value, callback) {
console.log('validaddress', this.form.serviceArea)
if (this.form.serviceArea.length > 0) {
callback()
} else {
callback(new Error('请选择支持检查项目'))
}
},
// 支持检查类型表单校验
validcheckType(rule, value, callback) {
console.log('validaddress', this.form.checkType)
if (this.form.checkType.length > 0) {
callback()
} else {
callback(new Error('请选择支持服务地区'))
}
},
// 四个时间的表单校验
validateMorningStart(rule, value, callback) {
// // TODO: please clear this log
......@@ -921,7 +944,7 @@ export default {
console.log('上午开始时间第一层报错')
callback(new Error('请选择上午开始时间'))
} else {
if (isEmpty(value) && isEmpty(morningEnd)) {
if (isEmpty(value) && isEmpty(!morningEnd)) {
console.log('上午开始时间第二层报错')
callback(new Error('请选择上午开始时间'))
} else {
......@@ -935,7 +958,7 @@ export default {
console.log('上午结束时间第一层报错')
callback(new Error('请选择上午结束时间'))
} else {
if (isEmpty(value) && isEmpty(morningStart)) {
if (isEmpty(value) && isEmpty(!morningStart)) {
console.log('上午结束时间第一层报错')
callback(new Error('请选择上午结束时间'))
} else {
......@@ -949,7 +972,7 @@ export default {
console.log(' 下午开始时间第一层报错')
callback(new Error('请选择下午开始时间'))
} else {
if (isEmpty(value) && isEmpty(afternoonEnd)) {
if (isEmpty(value) && isEmpty(!afternoonEnd)) {
console.log('下午开始时间开始第二层报错')
callback(new Error('请选择下午开始时间'))
} else {
......@@ -963,7 +986,7 @@ export default {
console.log('下午结束时间结束第一层报错')
callback(new Error('请选择下午结束时间'))
} else {
if (isEmpty(value) && isEmpty(afternoonStart)) {
if (isEmpty(value) && isEmpty(!afternoonStart)) {
console.log('下午结束时间结束第二层报错')
callback(new Error('请选择下午结束时间'))
} else {
......
......@@ -515,6 +515,7 @@ export default {
},
/** 查询设备列表 */
getList() {
this.loading = true
if (this.daterangeCreateTime !== '') {
this.queryParams.beginCheckTime = this.daterangeCreateTime + ' 00:00:00'
this.queryParams.endCheckTime = this.daterangeCreateTime + ' 23:59:59'
......
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