Commit 32ce5fda authored by 高滢's avatar 高滢

Merge remote-tracking branch 'origin/master'

parents fcbf0f05 b11d1a8b
......@@ -58,3 +58,11 @@ export function refreshCache() {
method: 'delete'
})
}
export function uploadCommon(data) {
return request({
headers: { 'Content-Type': 'multipart/form-data' },
url: '/common/upload',
method: 'post',
data
})
}
......@@ -273,3 +273,44 @@
.permi-disabled {
cursor: not-allowed;
}
.el-button--success--solid{
width: 50px !important;
border-radius: 6px 6px 6px 6px;
border: 1px solid rgb(95,181,75)!important;
}
.el-button--primary--solid{
width: 50px !important;
border-radius: 6px 6px 6px 6px;
border: 1px solid rgb(52, 144, 206)!important;
}
.el-button--warning--solid{
width: 50px!important;
border-radius: 6px 6px 6px 6px;
border: 1px solid rgb(255,157,78)!important;
}
.el-button--error--solid{
width: 50px!important;
border-radius: 6px 6px 6px 6px;
border: 1px solid rgb(219, 71, 71)!important;
}
.el-button--success--solid--four{
width: 80px !important;
border-radius: 6px 6px 6px 6px;
border: 1px solid rgb(95,181,75)!important;
}
.el-button--primary--solid--four{
width: 80px !important;
border-radius: 6px 6px 6px 6px;
border: 1px solid rgb(52, 144, 206)!important;
}
.el-button--warning--solid--four{
width: 80px!important;
border-radius: 6px 6px 6px 6px;
border: 1px solid rgb(255,157,78)!important;
}
.el-button--error--solid--four{
width: 80px!important;
border-radius: 6px 6px 6px 6px;
border: 1px solid rgb(219, 71, 71)!important;
}
This diff is collapsed.
<template>
<div class="image-cropper-modal">
<el-dialog
:visible="visible"
:append-to-body="true"
:close-on-click-modal="false"
title="裁剪图片"
width="700px"
class="image-cropper-dialog"
@close="visible = false"
>
<vue-cropper
ref="imageCropper"
:img="url"
:auto-crop-width="autoCropWidth"
:auto-crop-height="autoCropHeight"
:auto-crop="true"
:fixed="false"
:fixed-number="[1, 1]"
:fixed-box="true"
:output-size="1"
output-type="png"
/>
<template #footer>
<span class="dialog-footer">
<el-button class="common-btn cancel" @click="onCancel">取 消</el-button>
<el-button class="common-btn confirm" type="primary" @click="onConfirm">确 定</el-button>
</span>
</template>
</el-dialog>
</div>
</template>
<script>
import { VueCropper } from 'vue-cropper'
export default {
name: 'ImageCropperModal',
components: {
VueCropper
},
props: {
visible: {
type: Boolean,
default: false
},
url: {
type: String,
default: ''
},
autoCropWidth: {
type: String,
default: `${100 * 4}`
},
autoCropHeight: {
type: String,
default: `${100 * 4}`
}
},
methods: {
onCancel() {
this.$emit('cancel')
},
onConfirm() {
this.$refs.imageCropper.getCropBlob((blob) => {
this.$emit('confirm', blob)
})
}
}
}
</script>
<style lang="scss" scoped>
.image-cropper-dialog {
.vue-cropper {
height: 500px;
}
}
</style>
......@@ -274,14 +274,6 @@
style="width: 250px"
@change="handleChangeServiceArea"
/>
<!-- <el-select v-model="form.serviceArea" placeholder="请选择支持服务地区" style="width: 300px" multiple collapse-tags clearable>-->
<!-- <el-option-->
<!-- v-for="dict in dict.type.service_area"-->
<!-- :key="dict.label"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- />-->
<!-- </el-select>-->
</el-form-item>
</el-col>
</el-row>
......@@ -289,12 +281,12 @@
<el-row>
<el-col>
<el-form-item label="支持检查项目" prop="checkType">
<el-select v-model="form.checkType" placeholder="请选择支持检查项目" style="width: 300px" multiple collapse-tags clearable>
<el-select v-model="form.checkType" placeholder="请选择支持检查项目" style="width: 250px" multiple collapse-tags clearable>
<el-option
v-for=" dict in checkItemOptions"
:key="dict.id"
:label="dict.name"
:value="dict.id"
v-for=" (item,index) in checkItemOptions"
:key="index"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
......@@ -464,6 +456,8 @@ export default {
// 是否显示
isShow: '',
hpshow: '',
// 查询检查项目下拉框传递的字段
itemType: '',
// // 可用时段
// useTime: {
......@@ -518,7 +512,6 @@ export default {
},
created() {
this.getUserInfo()
this.getItemByType()
this.getAreaData()
},
methods: {
......@@ -530,12 +523,15 @@ export default {
this.isShow = false
this.hpshow = true
this.isPrivate = 1
this.itemType = 0
}
if (this.userType === '00') {
this.isShow = true
this.hpshow = false
this.isPrivate = 0
this.itemType = 3
}
this.getItemByType()
console.log('登陆人', res)
console.log('this.form--------------------', this.form)
})
......@@ -603,13 +599,6 @@ export default {
console.log('城市名', city)
})
},
// 时间段获取
getam() {
console.log(this.useTime)
},
getpm() {
console.log(this.useTime)
},
// 单位时段服务数不可以输入小数
handleuseNum() {
const parsedValue = parseFloat(this.form.useNum)
......@@ -695,14 +684,7 @@ export default {
},
// 四个时间的表单校验
validateMorningStart(rule, value, callback) {
// // TODO: please clear this log
const morningEnd = this.form.useTime.ame
console.log('value', value)
console.log('morningEnd', morningEnd)
console.log('this.form.useTime.ame', this.form.useTime.ame)
console.log('this.form.useTime.pms', this.form.useTime.pms)
console.log('his.form.useTime.pme', this.form.useTime.pme)
// if (isEmpty(value) && isEmpty(this.form.useTime.ams) || isEmpty(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('请选择上午开始时间'))
......@@ -759,7 +741,7 @@ export default {
},
// 获取检查项目下拉框
getItemByType() {
listItemByType({ itemType: null }).then(res => {
listItemByType({ itemType: this.itemType }).then(res => {
console.log('检查项目', res)
this.checkItemOptions = res.rows
console.log('xdddd', this.checkItemOptions)
......@@ -865,5 +847,9 @@ export default {
::v-deep .el-picker-panel {
background-color: #5FB54B;
}
::v-deep.time-select-item.selected:not {
background: #f6fcf5;
}
</style>
......@@ -589,12 +589,12 @@
<el-row>
<el-col>
<el-form-item label="支持检查项目" prop="checkType">
<el-select v-model="form.checkType" multiple placeholder="请选择支持检查项目" style="width: 300px" collapse-tags clearable>
<el-select v-model="form.checkType" placeholder="请选择支持检查项目" style="width: 250px" multiple collapse-tags clearable>
<el-option
v-for="(item,index) in dict.type.exam_type"
:key="index.label"
:label="item.label"
:value="item.value"
v-for="(item, index) in checkItemOptions"
:key="index"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
......@@ -621,6 +621,7 @@ import { getInfo } from '@/api/login'
import { listCheckManage } from '@/api/business/manage'
import { isEmpty, parseTime, selectDictLabels } from '@/utils/ruoyi'
import { deepClone } from '@/utils'
import { listItemByType } from '@/api/business/item'
export default {
name: 'EquipmentDetail',
dicts: ['device_status', 'device_type', 'exam_type', 'check_type', 'service_area'],
......@@ -671,6 +672,7 @@ export default {
addtions: {
names: ''
},
addressList: [],
addForm: {
province: '',
county: '',
......@@ -798,6 +800,8 @@ export default {
citys: regionData,
// 支持服务地区
serviceAreaS: [],
// 检查项目下拉框
checkItemOptions: [],
serviceAreaList: [
{
......@@ -844,11 +848,14 @@ export default {
if (this.userType === '3') {
this.isShow = false
this.hpshow = true
this.itemType = 0
}
if (this.userType === '00') {
this.isShow = true
this.hpshow = false
this.itemType = 3
}
this.getItemByType()
console.log('登陆人', res)
})
},
......@@ -981,6 +988,14 @@ export default {
}
}
},
// 获取检查项目下拉框
getItemByType() {
listItemByType({ itemType: this.itemType }).then(res => {
console.log('检查项目', res)
this.checkItemOptions = res.rows
console.log('xdddd', this.checkItemOptions)
})
},
// 获取地址数据
getAreaData() {
getAreTreeStructure().then(response => {
......@@ -988,7 +1003,48 @@ export default {
if (response.code === 200) {
this.removeEmptyChildren(response.data)
this.areaOptions = response.data
console.log('dsa', 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(labelList)
console.log('----------------------------------------111111111111', labelList)
console.log(' this.areaOptions', this.areaOptions)
}
})
},
......@@ -1054,7 +1110,7 @@ export default {
form.addressText = this.addtions.names
}
if (!isEmpty(form.checkType)) {
form.checkType = form.checkType.toString()
form.checkType = form.checkType.join(',')
}
if (!isEmpty(form.serviceArea)) {
console.log('支持服务地区', form.serviceArea)
......@@ -1102,42 +1158,18 @@ export default {
handleUpdate() {
getDevice(this.id).then(response => {
this.form = response.data
// if (this.form.selectedOptions != null && this.form.selectedOptions !== '') {
this.form.selectedOptions = response.data.addressCode.split(',').map(Number)
console.log('查询到的地址信息', this.form.selectedOptions)
//
// }
// if (this.form.serviceArea != null && this.form.serviceArea !== '') {
console.log('this.form.serviceArea', response.data.serviceArea)
// this.form.serviceAreaText = selectDictLabels(this.dict.type.service_area, this.form.serviceArea)
console.log(' this.form.serviceAreaText', this.form.serviceAreaText)
// console.log('查询到的地址信息', this.form.selectedOptions)
// console.log('this.form.serviceArea', response.data.serviceArea)
// console.log(' this.form.serviceAreaText', this.form.serviceAreaText)
this.form.serviceArea = response.data.serviceArea.split(';')
// const data = '1,32,368;1,33,372;1,33,373;1,33,374;1,33,375'
// const dataArray = data.split(';')
// const resultArr = []
console.log(' this.areaOptions--------------------------', this.areaOptions)
// for (let i = 0; i < this.form.serviceArea.length; i++) {
// // const name = getAreNameById({ idList: dataArray[i] })
// getAreNameById({ idList: this.form.serviceArea[i] }).then(response => {
// let addressText = ''
// for (let i = 0; i < response.data.length; i++) {
// addressText += response.data[i].nameLocal
// }
// resultArr.push(addressText)
// })// 假设 getName() 方法接收一个参数,将每一项传递给它
// }
// console.log('dataArray--------------', resultArr)
// for (let i=0;i<this.form.serviceArea.length;i++){
// let name = getAreNameById()
// }
console.log('支持检查地区回显值', this.form.serviceArea)
if (this.form.checkType != null && this.form.checkType !== '') {
this.form.checkTypeText = selectDictLabels(this.dict.type.exam_type, this.form.checkType)
console.log(' this.form.checkTypeText', this.form.checkTypeText)
this.form.checkType = response.data.checkType.split(',')
this.form.checkType = response.data.checkType.split(',').map(Number)
console.log('this.form.checkType', this.form.checkType)
}
if (this.form.useTime != null && this.form.useTime !== '') {
......
......@@ -88,26 +88,26 @@
</el-button>
<el-button
icon="el-icon-finished"
class="fourWordsBtn"
class="fourWordswhiteBtn"
@click="selectAll()"
>选择全部
</el-button>
<el-button
icon="el-icon-back"
class="fourWordsBtn"
class="fourWordswhiteBtn"
@click="reverseSelect(deviceList)"
>反向选择
</el-button>
<el-button
v-hasPermi="['business:device:import']"
class="fourWordsBtn"
class="fourWordswhiteBtn"
icon="el-icon-download"
@click="handleImport"
>批量导入
</el-button>
<el-button
v-hasPermi="['business:device:export']"
class="fourWordsBtn"
class="fourWordswhiteBtn"
icon="el-icon-upload2"
@click="handleExport"
>批量导出
......@@ -371,6 +371,8 @@ export default {
deviceList: [],
// 弹出层标题
title: '',
// 查询检查项目下拉框传递的字段
itemType: '',
// 是否显示弹出层
open: false,
// 查询参数
......@@ -473,21 +475,24 @@ export default {
},
created() {
this.getList()
this.getItemByType()
this.getUserInfo()
},
methods: {
// 获取登陆人信息
getUserInfo() {
getInfo().then(res => {
console.log('-------------------', res)
this.userType = res.user.userType
console.log('this.userTyep', this.userType)
// this.userType = res.user.userType
// console.log('this.userTyep', this.userType)
if (this.userType === '3') {
this.orderShow = false
this.itemType = 0
}
if (this.userType === '00') {
this.serviceShow = false
this.itemType = 3
}
this.getItemByType()
})
},
// 显示两位数字
......@@ -542,43 +547,6 @@ export default {
})
},
// // 取消按钮
// cancel() {
// this.open = false
// this.reset()
// },
// // 表单重置
// reset() {
// this.daterangeCreateTime = ''
// this.serviceArea = ''
// this.form = {
// id: null,
// deviceCode: null,
// deptId: null,
// deviceName: null,
// head: null,
// phone: null,
// deviceType: null,
// checkType: null,
// isPrivate: null,
// serviceArea: null,
// reservationMethod: null,
// useTime: null,
// servicePrice: null,
// orderPrice: null,
// status: null,
// useNum: null,
// sort: null,
// delFlag: null,
// createBy: null,
// createTime: null,
// updateBy: null,
// updateTime: null,
// remark: null
//
// }
// this.resetForm('form')
// },
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
......@@ -698,7 +666,7 @@ export default {
},
// 获取检查项目下拉框
getItemByType() {
listItemByType({ itemType: null }).then(res => {
listItemByType({ itemType: this.itemType }).then(res => {
console.log('检查项目', res)
this.checkItemOptions = res.rows
console.log('xdddd', this.checkItemOptions)
......@@ -736,3 +704,8 @@ export default {
}
}
</script>
<style class="scss">
.app-container{
background-color: white;
}
</style>
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