Commit 6776616c authored by 王飞龙's avatar 王飞龙

bug修改

parent 3bd11dac
......@@ -2,8 +2,8 @@
<el-tooltip :content="text" placement="top-start" :disabled="tipDisabled">
<el-input
v-model="text"
readonly="true"
disabled="true"
readonly
disabled
:style="{width: width}"
@mouseover.native="inputOnMouseOver($event)"
/>
......
......@@ -8,7 +8,10 @@
</div>
<el-form ref="form" :model="form" :rules="rules" :inline="true" label-width="auto">
<div class="title-paragraph">
<div style="padding-left: 13px;font-size: 16px;font-family: Microsoft YaHei-Bold, Microsoft YaHei,serif;font-weight: bold;color: #333333;">基本信息</div>
<div
style="padding-left: 13px;font-size: 16px;font-family: Microsoft YaHei-Bold, Microsoft YaHei,serif;font-weight: bold;color: #333333;"
>基本信息
</div>
</div>
<!-- 1-->
<el-row>
......@@ -102,7 +105,7 @@
controls-position="right"
class="inputNumber_Width"
/>
<span class="text">{{ "次" }}</span>
<span class="text">{{ '次' }}</span>
</el-form-item>
</el-col>
</el-row>
......@@ -282,7 +285,10 @@
</el-row>
</el-form>
<div class="title-paragraph">
<div style="padding-left: 13px;font-size: 16px;font-family: Microsoft YaHei-Bold, Microsoft YaHei,serif;font-weight: bold;color: #333333;">使用信息</div>
<div
style="padding-left: 13px;font-size: 16px;font-family: Microsoft YaHei-Bold, Microsoft YaHei,serif;font-weight: bold;color: #333333;"
>使用信息
</div>
</div>
<el-table :data="useList" :header-cell-style="{ background:'#F4F4F4'}" border>
<el-table-column label="检查项目" align="center" prop="checkItemsName" show-overflow-tooltip />
......@@ -297,7 +303,11 @@
<el-table-column label="检查时段" align="center" prop="deve" show-overflow-tooltip>
<template slot-scope="scope">
<span v-if="scope.row.checkStartTime === null && scope.row.checkEndTime === null">{{ '-' }}</span>
<span v-else>{{ parseTime(scope.row.checkStartTime, '{h}:{i}') + '~' + parseTime(scope.row.checkEndTime, '{h}:{i}') || '-' }}</span>
<span
v-else
>{{
parseTime(scope.row.checkStartTime, '{h}:{i}') + '~' + parseTime(scope.row.checkEndTime, '{h}:{i}') || '-'
}}</span>
</template>
</el-table-column>
<el-table-column label="检查状态" align="center" prop="payType" show-overflow-tooltip>
......@@ -325,13 +335,21 @@
</div>
<el-form ref="form" :model="form" :rules="rules" :inline="true" label-width="auto">
<div class="title-paragraph">
<div style="padding-left: 13px;font-size: 16px;font-family: Microsoft YaHei-Bold, Microsoft YaHei,serif;font-weight: bold;color: #333333;">基本信息</div>
<div
style="padding-left: 13px;font-size: 16px;font-family: Microsoft YaHei-Bold, Microsoft YaHei,serif;font-weight: bold;color: #333333;"
>基本信息
</div>
</div>
<!-- 1-->
<el-row>
<el-col :span="8">
<el-form-item label="设备名称" prop="deviceName">
<el-input v-model.trim="form.deviceName" placeholder="请输入设备名称" class="inputWidth" maxlength="20" />
<el-input
v-model.trim="form.deviceName"
placeholder="请输入设备名称"
class="inputWidth"
maxlength="20"
/>
</el-form-item>
</el-col>
<el-col :span="8">
......@@ -428,7 +446,7 @@
@blur="handleuseNum"
@keydown.native="keydown($event)"
/>
<span class="text">{{ "次" }}</span>
<span class="text">{{ '次' }}</span>
</el-form-item>
</el-col>
</el-row>
......@@ -580,7 +598,14 @@
<el-row>
<el-col>
<el-form-item label="支持检查项目" prop="checkType">
<el-select v-model="form.checkType" placeholder="请选择支持检查项目" class="inputWidth" multiple collapse-tags clearable>
<el-select
v-model="form.checkType"
placeholder="请选择支持检查项目"
class="inputWidth"
multiple
collapse-tags
clearable
>
<el-option
v-for="(item, index) in checkItemOptions"
:key="index"
......@@ -594,7 +619,8 @@
</el-form>
<el-row>
<el-col style="display: flex;justify-content: left; margin-left: 20px; margin-top: 20px">
<el-button class="queryBtn" type="primary" size="mini" icon="el-icon-check" @click="submitForm">提交</el-button>
<el-button class="queryBtn" type="primary" size="mini" icon="el-icon-check" @click="submitForm">提交
</el-button>
<el-button class="resetBtn" size="mini" icon="el-icon-back" @click="cancel">返回</el-button>
</el-col>
</el-row>
......@@ -616,6 +642,7 @@ import { listItemByType } from '@/api/business/item'
import { mapGetters } from 'vuex'
import { signHospitalMessage } from '@/api/business/hospital'
import InputTips from '@/components/InputTips/InputTips.vue'
export default {
name: 'EquipmentDetail',
components: { InputTips },
......@@ -671,8 +698,8 @@ export default {
deviceName: '',
// appointmentMethod: '',
serviceArea: [],
serviceAreaText: [],
checkTypeText: [],
serviceAreaText: '',
checkTypeText: '',
head: '',
phone: '',
deviceType: '',
......@@ -701,7 +728,7 @@ export default {
],
phone: [
{
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
pattern: /^1[3-9][0-9]\d{8}$/,
message: '请输入正确的手机号码',
trigger: 'blur'
}
......@@ -813,17 +840,13 @@ export default {
this.id = this.$route.query.id
this.identify = this.$route.query.identify
this.form.isPrivate = this.$route.query.isPrivate
console.log(' this.form.isPrivate', this.form.isPrivate)
if (this.identify === '1') {
// this.$route.meta.title = ''
console.log('1')
} else if (this.identify === '2') {
// this.$route.meta.title = ''
console.log('2')
}
this.getAreaData()
console.time('start option')
Promise.all([this.getUserInfo(), this.getAreaData(), this.getuseList(), this.getItemByType()])
.then(_ => {
console.timeLog('start option')
console.time('detail')
this.handleUpdate()
this.getuseList()
})
},
computed: {
...mapGetters(['userType'])
......@@ -832,40 +855,22 @@ export default {
parseTime,
// 获取登陆人信息
getUserInfo() {
getInfo().then(res => {
// this.userType = res.user.userType
console.log(' this.userType', this.userType)
return getInfo().then(_ => {
if (this.userType === '3') {
this.isShow = false
this.hpshow = true
this.itemType = 0
if (this.form.isPrivate === '1') {
signHospitalMessage().then(response => {
console.log('查到医院信息', response)
this.form.serviceArea.push(response.data.addressCode)
this.serviceAreaShow = true
console.log('查到医院地址', this.form.serviceArea)
})
}
}
if (this.userType === '00') {
} else if (this.userType === '00') {
this.isShow = true
this.hpshow = false
this.itemType = 3
}
this.getItemByType()
// this.getAllByType()
console.log('登陆人', res)
})
},
// 时间段获取
getam() {
console.log(this.useTime)
},
getpm() {
console.log(this.useTime)
},
// 禁止输入空格
keydown(e) {
if (e.keyCode === 32) {
......@@ -887,7 +892,6 @@ export default {
},
// 权重不能为0
validWeigh(rule, value, callback) {
// console.log('value', value)
if (value > 0) {
callback()
} else {
......@@ -896,7 +900,6 @@ export default {
},
// 单位时段服务数不能为0
validUseNum(rule, value, callback) {
// console.log('value', value)
if (value > 0) {
callback()
} else {
......@@ -905,7 +908,6 @@ export default {
},
// 服务地点表单校验
validaddress(rule, value, callback) {
console.log('validaddress', this.form.selectedOptions)
if (this.form.selectedOptions.length > 0) {
callback()
} else {
......@@ -914,7 +916,6 @@ export default {
},
// 支持服务地区表单校验
validserviceArea(rule, value, callback) {
console.log('validaddress', this.form.serviceArea)
if (this.form.serviceArea.length > 0) {
callback()
} else {
......@@ -923,7 +924,6 @@ export default {
},
// 支持检查类型表单校验
validcheckType(rule, value, callback) {
console.log('validaddress', this.form.checkType)
if (this.form.checkType.length > 0) {
callback()
} else {
......@@ -934,11 +934,9 @@ export default {
validateMorningStart(rule, value, callback) {
const morningEnd = this.form.useTime.ame
if (isEmpty(value) && isEmpty(this.form.useTime.ame) && isEmpty(this.form.useTime.pms) && isEmpty(this.form.useTime.pme)) {
console.log('上午开始时间第一层报错')
callback(new Error('请选择上午开始时间'))
} else {
if (isEmpty(value) && isEmpty(!morningEnd)) {
console.log('上午开始时间第二层报错')
callback(new Error('请选择上午开始时间'))
} else {
callback()
......@@ -948,11 +946,9 @@ export default {
validateMorningEnd(rule, value, callback) {
const morningStart = this.form.useTime.ams
if (isEmpty(value) && isEmpty(this.form.useTime.ams) && isEmpty(this.form.useTime.pms) && isEmpty(this.form.useTime.pme)) {
console.log('上午结束时间第一层报错')
callback(new Error('请选择上午结束时间'))
} else {
if (isEmpty(value) && isEmpty(!morningStart)) {
console.log('上午结束时间第一层报错')
callback(new Error('请选择上午结束时间'))
} else {
callback()
......@@ -962,11 +958,9 @@ export default {
validateAfternoonStart(rule, value, callback) {
const afternoonEnd = this.form.useTime.pme
if (isEmpty(value) && isEmpty(this.form.useTime.ams) && isEmpty(this.form.useTime.ame) && isEmpty(this.form.useTime.pme)) {
console.log(' 下午开始时间第一层报错')
callback(new Error('请选择下午开始时间'))
} else {
if (isEmpty(value) && isEmpty(!afternoonEnd)) {
console.log('下午开始时间开始第二层报错')
callback(new Error('请选择下午开始时间'))
} else {
callback()
......@@ -976,11 +970,9 @@ export default {
validateAfternoonEnd(rule, value, callback) {
const afternoonStart = this.form.useTime.pms
if (isEmpty(value) && isEmpty(this.form.useTime.ams) && isEmpty(this.form.useTime.ame) && isEmpty(this.form.useTime.pms)) {
console.log('下午结束时间结束第一层报错')
callback(new Error('请选择下午结束时间'))
} else {
if (isEmpty(value) && isEmpty(!afternoonStart)) {
console.log('下午结束时间结束第二层报错')
callback(new Error('请选择下午结束时间'))
} else {
callback()
......@@ -989,36 +981,19 @@ export default {
},
// 获取检查项目下拉框
getItemByType() {
listItemByType({ itemType: this.itemType }).then(res => {
this.form.checkType = this.form.checkType.filter(item => {
let flag = false
res.rows.forEach(row => {
if (row.id === item) {
flag = true
if (this.userType === '3') {
this.itemType = 0
} else if (this.userType === '00') {
this.itemType = 3
}
})
return flag
})
console.log('检查项目23333', res, this.form)
return listItemByType({ itemType: this.itemType }).then(res => {
this.checkItemOptions = res.rows
console.log('xdddd', this.checkItemOptions)
const result = []
const ids = [... this.form.checkType]
for (let i = 0; i < this.checkItemOptions.length; i++) {
if (ids.includes(parseInt(this.checkItemOptions[i].id))) {
result.push(this.checkItemOptions[i].name)
}
}
this.form.checkTypeText = result
console.log(' this.checkTypeText', this.form.checkTypeText)
})
},
// getAllByType() {
// listAllByType({ itemType: this.itemType }).then(res => {
// console.log('检查全部项目', res)
// this.checkItemOptions = res.rows
// // console.log('xdddd', this.checkItemOptions)
// const result = []
// // this.checkItemOptions = res.rows
// // // const result = []
// const ids = [... this.form.checkType]
// for (let i = 0; i < this.checkItemOptions.length; i++) {
// if (ids.includes(parseInt(this.checkItemOptions[i].id))) {
......@@ -1026,58 +1001,13 @@ export default {
// }
// }
// // this.form.checkTypeText = result
// // console.log(' this.checkTypeText', this.form.checkTypeText)
// })
// // // })
// },
// 获取地址数据
getAreaData() {
getAreTreeStructure().then(response => {
console.log('地区三级', response)
if (response.code === 200) {
return getAreTreeStructure().then(response => {
this.removeEmptyChildren(response.data)
this.areaOptions = response.data
console.log('这是我要遍历的this.form.serviceArea', this.form.serviceArea)
const valueGroups = this.form.serviceArea
const labelList = []
for (let i = 0; i < valueGroups.length; i++) {
const values = valueGroups[i].split(',')
let currentData = this.areaOptions
const currentLabel = []
let foundLabel = true
for (let j = 0; j < values.length; j++) {
const value = parseInt(values[j])
const item = currentData.find((item) => item.value === value)
if (item) {
if (currentLabel.length === 0) {
currentLabel.push(item.label)
} else {
currentLabel.push(`-${item.label}`)
}
currentData = item.children
} else {
foundLabel = false
break
}
}
if (foundLabel) {
labelList.push(currentLabel.join(''))
} else {
labelList.push('-')
}
}
this.form.serviceAreaText = labelList
console.log('----------------------------------------111111111111', labelList)
console.log(' this.areaOptions', this.areaOptions)
}
})
},
removeEmptyChildren(array) {
......@@ -1098,7 +1028,6 @@ export default {
}
},
handleChangeCascader(value) {
console.log('handleChangeCascader', value)
if (value.length > 0) {
this.getAreNameById(value)
} else {
......@@ -1108,7 +1037,6 @@ export default {
}
},
handleChangeServiceArea(value) {
console.log('handleChangeServiceArea', value)
// 拿到所选的省级id 把重复的过滤掉
const uniqueFirstItems = value.map((arr) => arr[0]).filter((item, index, arr) => arr.indexOf(item) === index)
this.form.serviceProvince = uniqueFirstItems.toString()
......@@ -1126,15 +1054,12 @@ export default {
}
this.addtions.names = addressText
this.city = city
console.log('地区名', addressText)
console.log('城市名', city)
})
},
// 提交
submitForm() {
const form = deepClone(this.form)
console.log('selectedOptions', form.selectedOptions)
if (form.selectedOptions != null) {
form.addressCode = form.selectedOptions.join(',')
}
......@@ -1145,7 +1070,6 @@ export default {
form.checkType = form.checkType.join(',')
}
if (!isEmpty(form.serviceArea)) {
console.log('支持服务地区', form.serviceArea)
form.serviceArea = form.serviceArea.join(';')
}
if (!isEmpty(form.useTime)) {
......@@ -1166,7 +1090,6 @@ export default {
updateDevice(form).then(response => {
this.$modal.msgSuccess('编辑成功')
this.cancel()
console.log('this.form)', form)
})
})
}
......@@ -1181,44 +1104,72 @@ export default {
// 查询使用信息
getuseList() {
this.queryParams.deviceId = this.id
listCheckManage(this.queryParams).then(response => {
console.log('a使用信息', response)
return listCheckManage(this.queryParams).then(response => {
this.useList = response.rows
console.log(' -----------------this.useList', this.useList)
})
},
// id查询
handleUpdate() {
getDevice(this.id).then(response => {
this.form = response.data
console.log('查询是否为医院设备', this.form.isPrivate)
this.getUserInfo()
this.form.selectedOptions = response.data.addressCode.split(',').map(Number)
console.log('地址编码-------------', this.form.selectedOptions)
// this.getAreNameById(this.form.selectedOptions)
// if (this.form.isPrivate === '1') {
// signHospitalMessage().then(response => {
// console.log('查到医院信息', response)
// this.form.serviceArea.push(response.data.addressCode)
// this.serviceAreaShow = true
// console.log('查到医院地址', this.form.serviceArea)
// })
// } else {
this.form.serviceArea = response.data.serviceArea.split(';')
return getDevice(this.id).then(({ data }) => {
data.selectedOptions = data.addressCode.split(',').map(Number)
data.serviceArea = data.serviceArea.split(';')
if (data.checkType != null && data.checkType !== '') {
data.checkType = data.checkType.split(',').map(Number)
}
if (data.useTime !== null && data.useTime !== '') {
data.useTime = JSON.parse(data.useTime)
}
data.createTimeShow = this.replace(data.createTime)
// 回显检查项目
data.checkTypeText = this.checkItemOptions.filter(({ id }) => data.checkType.includes(id))
.map(({ name }) => name)
.join(',')
// 回显服务地区
const valueGroups = data.serviceArea
const labelList = []
// const getAreaName = (valueList, parentNameList) => {
//
// }
console.log(' this.areaOptions--------------------------', this.areaOptions)
console.log('支持检查地区回显值', this.form.serviceArea)
if (this.form.checkType != null && this.form.checkType !== '') {
this.form.checkType = response.data.checkType.split(',').map(Number)
console.log('this.form.checkType', this.form.checkType)
for (let i = 0; i < valueGroups.length; i++) {
const values = valueGroups[i].split(',')
let currentData = this.areaOptions
const currentLabel = []
let foundLabel = true
for (let j = 0; j < values.length; j++) {
const value = parseInt(values[j])
const item = currentData.find((item) => item.value === value)
if (item) {
if (currentLabel.length === 0) {
currentLabel.push(item.label)
} else {
currentLabel.push(`-${item.label}`)
}
currentData = item.children
} else {
foundLabel = false
break
}
}
if (this.form.useTime != null && this.form.useTime !== '') {
this.form.useTime = JSON.parse(response.data.useTime)
if (foundLabel) {
labelList.push(currentLabel.join(''))
} else {
labelList.push('-')
}
this.form.createTimeShow = this.replace(this.form.createTime)
console.log('详情数据---', this.form)
}
data.serviceAreaText = labelList.join(',')
this.form = data
console.timeLog('detail')
})
}
}
......@@ -1226,33 +1177,34 @@ export default {
</script>
<style scoped lang="scss">
.tip1{
.tip1 {
height: 30px;
border-left: 5px solid #409eff;
}
::v-deep.app-container {
//background-color: #f0f2f5;
//position: absolute;
//bottom: 0;
//top: 0;
//right: 0;
//left: 0;
//background-color: #f0f2f5;
//position: absolute;
//bottom: 0;
//top: 0;
//right: 0;
//left: 0;
}
.title-paragraph {
margin-bottom: 20px;
border-left: 5px solid #5FB54B;
.title-text {
.title-text {
margin-left: 10px;
}
}
.title {
.title {
color: #666666;
font-weight: 600;
font-size: 17px
}
}
}
.headerTitle {
......@@ -1262,19 +1214,24 @@ export default {
line-height: 50px;
padding-left: 45px;
}
.address{
.address {
width: 520px;
}
.inputWidth{
.inputWidth {
width: 300px;
}
.inputNumber_Width{
.inputNumber_Width {
width: 270px;
}
.text{
.text {
margin-left: 10px;
}
.remark_with{
.remark_with {
width: 1360px;
}
......@@ -1291,6 +1248,7 @@ export default {
font-weight: bold;
cursor: pointer
}
.time-select-item.selected:not(.disabled) {
color: #5FB54B;
font-weight: bold;
......
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