问题修改

master
zhangdi 1 year ago
parent b205c88ef5
commit f7472d4fcd
  1. 11
      src/api/system/user.js
  2. 17
      src/option/user/info.js
  3. 11
      src/router/page/index.js
  4. 15
      src/views/device/deviceSystem.vue
  5. 170
      src/views/system/userinfo.vue

@ -167,4 +167,13 @@ export const addInvoice = (data) =>{
method:'post', method:'post',
data data
}) })
} }
// 根据部门id查部门名字 /blade-system/dept/getDeptName?deptId=1887682530864697346
export const getDeptName = (query) =>{
return request({
url:'/api/blade-system/dept/getDeptName',
method:'get',
params:query
})
}

@ -51,19 +51,20 @@ export default {
prop: 'realName', prop: 'realName',
formslot:true, formslot:true,
}, },
// { {
// label: '用户名', label: '所属实验室',
// span: 12, span: 12,
// row: true, row: true,
// prop: 'name' prop: 'deptName',
// }, display:false,
},
{ {
label: '手机号', label: '手机号',
span: 12, span: 12,
row: true, row: true,
prop: 'phone', prop: 'phone',
formslot:true, formslot:true,
}, },
{ {
label:'位置', label:'位置',
span:12, span:12,
@ -128,7 +129,7 @@ export default {
{ {
label: '公司名称', label: '公司名称',
prop: "companyName" prop: "companyName"
}, },
{ {
label: '税号', label: '税号',
prop: "taxCode" prop: "taxCode"

@ -67,17 +67,6 @@ export default [{
} }
}, },
{
path: '/deviceCategory',
name: '设备分类',
meta: {
keepAlive: true,
isTab: false,
isAuth: false
},
component: () =>
import( /* webpackChunkName: "views" */ '@/views/device/deviceCategory')
},
{ {
path: '/403', path: '/403',
component: () => component: () =>

@ -1,6 +1,6 @@
<template> <template>
<el-row> <el-row>
<el-col :span="5"> <el-col :span="5" v-if="dataTypes!=1">
<div class="box"> <div class="box">
<el-scrollbar> <el-scrollbar>
<basic-container> <basic-container>
@ -9,7 +9,7 @@
</el-scrollbar> </el-scrollbar>
</div> </div>
</el-col> </el-col>
<el-col :span="19"> <el-col :span="dataTypes!=1?19:24">
<basic-container style="max-height: 800px; overflow: hidden"> <basic-container style="max-height: 800px; overflow: hidden">
<avue-crud :option="option" :table-loading="loading" :data="data" :search.sync="searchForm" :page.sync="page" <avue-crud :option="option" :table-loading="loading" :data="data" :search.sync="searchForm" :page.sync="page"
ref="crud" v-model="form" :permission="permissionList" :before-open="beforeOpen" :before-close="beforeClose" ref="crud" v-model="form" :permission="permissionList" :before-open="beforeOpen" :before-close="beforeClose"
@ -122,17 +122,20 @@
</el-form-item> </el-form-item>
<el-form-item label="单位" prop="supplier"> <el-form-item label="单位" prop="supplier">
<el-input style="width: 98%;" :disabled="viewType == 'view'" placeholder="请输入单位" <el-input style="width: 98%;" :disabled="viewType == 'view'" placeholder="请输入单位"
v-model="addForm.limsName"></el-input> v-model="addForm.unit"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="supplier"> <el-form-item label="备注" prop="supplier">
<el-input style="width: 98%;" :disabled="viewType == 'view'" placeholder="请输入备注" <el-input style="width: 98%;" :disabled="viewType == 'view'" placeholder="请输入备注"
v-model="addForm.description"></el-input> v-model="addForm.description"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="关联实验室" prop="lab"> <el-form-item label="关联实验室" prop="lab" v-if="dataTypes!=1">
<el-cascader :props="labProps" style="width:98%;" v-model="addForm.lab" :disabled="viewType == 'view'" <el-cascader :props="labProps" style="width:98%;" v-model="addForm.lab" :disabled="viewType == 'view'"
ref="labRef" clearable></el-cascader> ref="labRef" clearable></el-cascader>
</el-form-item> </el-form-item>
<el-form-item label="关联实验室" prop="lab" v-else>
{{ addForm.limsName }}/{{ addForm.floorName }}/{{ addForm.roomName }}
</el-form-item>
</div> </div>
<div> <div>
@ -440,7 +443,7 @@ export default {
{ {
label: "单位", label: "单位",
labelWidth: 120, labelWidth: 120,
prop: "limsName", prop: "unit",
overHidden: true, overHidden: true,
search: true, search: true,
}, },
@ -1079,7 +1082,7 @@ export default {
query.limsId = this.addForm.lab[0] query.limsId = this.addForm.lab[0]
query.floorId = this.addForm.lab[1] query.floorId = this.addForm.lab[1]
query.roomId = this.addForm.lab[2] query.roomId = this.addForm.lab[2]
query.limsNmae = labNameList[0].label query.limsName = labNameList[0].label
query.floorName = labNameList[1].label query.floorName = labNameList[1].label
query.roomName = labNameList[2].label query.roomName = labNameList[2].label
} }

@ -1,7 +1,8 @@
<template> <template>
<div> <div>
<basic-container> <basic-container>
<avue-form :option="option1" v-model="form" @tab-click="handleTabClick" @submit="handleSubmit" @row-del="handleDelete"> <avue-form :option="option1" v-model="form" @tab-click="handleTabClick" @submit="handleSubmit"
@row-del="handleDelete">
<template slot-scope="{disabled,size}" slot="realName"> <template slot-scope="{disabled,size}" slot="realName">
<div style="display: flex;"> <div style="display: flex;">
<el-input style="width: 600px;" :disabled="nameDisabled" :size="size" v-model="form.realName" <el-input style="width: 600px;" :disabled="nameDisabled" :size="size" v-model="form.realName"
@ -16,6 +17,11 @@
<el-button style="margin-left: 10px;" type="primary" @click="changePhone">修改</el-button> <el-button style="margin-left: 10px;" type="primary" @click="changePhone">修改</el-button>
</div> </div>
</template> </template>
<template slot-scope="{disabled,size}" slot="deptName">
<div style="display: flex;">
<el-input style="width: 600px;" disabled :size="size" v-model="deptName" placeholder="请输入所属实验室"></el-input>
</div>
</template>
<template slot-scope="{disabled,size}" slot="address"> <template slot-scope="{disabled,size}" slot="address">
<div style="display: flex;"> <div style="display: flex;">
<el-input style="width: 600px;" :disabled="positionDisabled" :size="size" v-model="form.address" <el-input style="width: 600px;" :disabled="positionDisabled" :size="size" v-model="form.address"
@ -32,15 +38,15 @@
<script> <script>
import mapSel from "@/components/mapSel/index.vue"; import mapSel from "@/components/mapSel/index.vue";
import option from "@/option/user/info"; import option from "@/option/user/info";
import { getUserInfo,updateInfo,getInvoiceList,addInvoice } from "@/api/system/user"; import { getUserInfo, updateInfo, getInvoiceList, addInvoice, getDeptName } from "@/api/system/user";
import md5 from 'js-md5'; import md5 from 'js-md5';
import func from "@/util/func"; import func from "@/util/func";
import {mapGetters} from "vuex"; import { mapGetters } from "vuex";
import { getPosition } from '../../api/sign/sign'; import { getPosition } from '../../api/sign/sign';
export default { export default {
components:{ components: {
mapSel mapSel
}, },
data() { data() {
@ -53,29 +59,49 @@ export default {
positionDisabled: true, positionDisabled: true,
dialogVisible: false, dialogVisible: false,
center: { lng: 116.404, lat: 39.915 }, center: { lng: 116.404, lat: 39.915 },
BMap:null, BMap: null,
positionList:[], positionList: [],
keyword:'', keyword: '',
infoPosition:{lng:'',lat:''}, infoPosition: { lng: '', lat: '' },
isMarker:false, isMarker: false,
point:'', point: '',
option1:{} option1: {},
deptName: ''
}; };
}, },
computed:{ computed: {
...mapGetters(["userInfo", "permission"]), ...mapGetters(["userInfo", "permission"]),
}, },
created() { created() {
this.option1 = JSON.parse(JSON.stringify(option)) this.option1 = JSON.parse(JSON.stringify(option))
if(this.userInfo.role_id != '1846419477876510721'){ if (this.userInfo.role_id != '1846419477876510721') {
this.option1.group = this.option1.group.filter(item => item.prop == 'info') this.option1.group = this.option1.group.filter(item => item.prop == 'info')
this.getInvoice() this.getInvoice()
}else{ } else {
this.option1 = option this.option1 = option
} }
this.handleWitch(); this.handleWitch();
console.log(9999,this.userInfo.dataType)
if (this.userInfo.dataType == 1) {
this.getDeptName()
let column = this.findObject(this.option.group[0].column, "deptName");
column.display=true
}
}, },
methods: { methods: {
// id
getDeptName() {
let query = {
deptId: this.userInfo.dept_id
}
getDeptName(query).then(res => {
this.deptName = res.data.data
}).catch(err => {
})
},
// //
changeRealName() { changeRealName() {
this.nameDisabled = false this.nameDisabled = false
@ -84,23 +110,23 @@ export default {
changePhone() { changePhone() {
this.phoneDisabled = false this.phoneDisabled = false
}, },
getLoc(loc,address){ getLoc(loc, address) {
this.form = { this.form = {
...this.form, ...this.form,
address : address, address: address,
addressLat:loc.latitude, addressLat: loc.latitude,
addressLon:loc.longitude addressLon: loc.longitude
} }
}, },
// //
changePosition() { changePosition() {
// this.dialogVisible = true // this.dialogVisible = true
if(this.form.address && this.form.address != '' && this.form.addressLon != '' && this.form.addressLat != ''){ if (this.form.address && this.form.address != '' && this.form.addressLon != '' && this.form.addressLat != '') {
this.$refs.mapSel.showMap({ this.$refs.mapSel.showMap({
longitude: this.form.addressLon, longitude: this.form.addressLon,
latitude: this.form.addressLat latitude: this.form.addressLat
}); });
}else{ } else {
this.$refs.mapSel.showMap({ this.$refs.mapSel.showMap({
longitude: "116.404", longitude: "116.404",
latitude: "39.915" latitude: "39.915"
@ -112,34 +138,34 @@ export default {
this.BMap = e.BMap; this.BMap = e.BMap;
}, },
// //
changeKeyword(val){ changeKeyword(val) {
getPosition({ getPosition({
query:val.target.value, query: val.target.value,
// region:'', // region:'',
// ak:'NqGy7LGcdxNUNqR7pBwPqeOkZ11Arn5Y', // ak:'NqGy7LGcdxNUNqR7pBwPqeOkZ11Arn5Y',
// city_limit:true,output:'json' // city_limit:true,output:'json'
}).then(res =>{ }).then(res => {
if(res.data.data.result.length != 0){ if (res.data.data.result.length != 0) {
this.positionList = res.data.data.result this.positionList = res.data.data.result
this.showPositionList = true this.showPositionList = true
this.points = [] this.points = []
this.positionList.map(item =>{ this.positionList.map(item => {
item.show = false item.show = false
this.points.push({ this.points.push({
lng: item.location.lng, lat: item.location.lat lng: item.location.lng, lat: item.location.lat
}) })
}) })
if(this.BMap){ if (this.BMap) {
this.center = { this.center = {
lng:this.positionList[0].location.lng, lng: this.positionList[0].location.lng,
lat:this.positionList[0].location.lat, lat: this.positionList[0].location.lat,
} }
} }
} }
}) })
}, },
// //
clearKeyword(){ clearKeyword() {
this.positionList = [] this.positionList = []
this.showPositionList = false this.showPositionList = false
}, },
@ -194,9 +220,9 @@ export default {
} }
}, },
// //
infoWindowOpen1(row,index){ infoWindowOpen1(row, index) {
this.isMarker = true this.isMarker = true
this.infoPosition = {lng:row.location.lng,lat:row.location.lat} this.infoPosition = { lng: row.location.lng, lat: row.location.lat }
this.infoAddress = row.address this.infoAddress = row.address
this.infoName = row.name this.infoName = row.name
this.showInfowindow = true this.showInfowindow = true
@ -212,14 +238,14 @@ export default {
handleCancel() { handleCancel() {
this.dialogVisible = false this.dialogVisible = false
}, },
handleDelete(row,index){ handleDelete(row, index) {
}, },
// //
handleSubmitPositon(){ handleSubmitPositon() {
this.form = { this.form = {
...this.form, ...this.form,
address : this.isMarker ? this.province + this.city + this.district + this.address : this.infoAddress, address: this.isMarker ? this.province + this.city + this.district + this.address : this.infoAddress,
coordinate:this.infoPosition ? this.infoPosition.lat + ',' + this.infoPosition.lng : '' coordinate: this.infoPosition ? this.infoPosition.lat + ',' + this.infoPosition.lng : ''
} }
this.dialogVisible = false this.dialogVisible = false
this.showPositionList = false this.showPositionList = false
@ -231,16 +257,16 @@ export default {
handleSubmit(form, done) { handleSubmit(form, done) {
if (this.index === 0) { if (this.index === 0) {
let query = { let query = {
id:this.form.id, id: this.form.id,
address:this.form.address ? this.form.address : null, address: this.form.address ? this.form.address : null,
avatar:this.form.avatar ? this.form.avatar : null, avatar: this.form.avatar ? this.form.avatar : null,
backGroundPic:this.form.backGroundPic ? this.form.backGroundPic : null, backGroundPic: this.form.backGroundPic ? this.form.backGroundPic : null,
name:this.form.name ? this.form.name : null, name: this.form.name ? this.form.name : null,
phone:this.form.phone ? this.form.phone : null, phone: this.form.phone ? this.form.phone : null,
realName:this.form.realName ? this.form.realName : null, realName: this.form.realName ? this.form.realName : null,
coordinate:this.form.coordinate ? this.form.coordinate : null, coordinate: this.form.coordinate ? this.form.coordinate : null,
addressLat:this.form.addressLat, addressLat: this.form.addressLat,
addressLon:this.form.addressLon addressLon: this.form.addressLon
} }
updateInfo(query).then(res => { updateInfo(query).then(res => {
if (res.data.success) { if (res.data.success) {
@ -264,34 +290,34 @@ export default {
done(); done();
}) })
} else { } else {
if(this.form.invoice.length == 0){ if (this.form.invoice.length == 0) {
this.$message.error('请至少维护一条发票信息') this.$message.error('请至少维护一条发票信息')
done() done()
}else{ } else {
let notaxCode = this.form.invoice.find(item => item.companyName != '' && item.taxCode == '') let notaxCode = this.form.invoice.find(item => item.companyName != '' && item.taxCode == '')
let nocompanyName = this.form.invoice.find(item => item.companyName == '' && item.taxCode != '') let nocompanyName = this.form.invoice.find(item => item.companyName == '' && item.taxCode != '')
if(notaxCode || nocompanyName){ if (notaxCode || nocompanyName) {
this.$message.error('请填写完整的税号及公司名称') this.$message.error('请填写完整的税号及公司名称')
done() done()
}else{ } else {
let query = [] let query = []
this.form.invoice.map(item =>{ this.form.invoice.map(item => {
query.push({ query.push({
id:item.id ? item.id : null, id: item.id ? item.id : null,
companyName:item.companyName, // companyName: item.companyName, //
taxCode:item.taxCode, // taxCode: item.taxCode, //
companyPhone:item.companyPhone, // companyPhone: item.companyPhone, //
openBank:item.openBank, // openBank: item.openBank, //
number:item.number, // number: item.number, //
address:item.address, // address: item.address, //
remark:item.remark // remark: item.remark //
}) })
}) })
addInvoice(query).then(res =>{ addInvoice(query).then(res => {
if(res.data.code == 200){ if (res.data.code == 200) {
this.$message.success('提交成功') this.$message.success('提交成功')
getInvoiceList().then(res =>{ getInvoiceList().then(res => {
this.form.invoice = res.data.data this.form.invoice = res.data.data
}) })
done() done()
@ -325,31 +351,31 @@ export default {
this.form = { this.form = {
id: user.id, id: user.id,
avatar: user.avatar, avatar: user.avatar,
backGroundPic:user.backGroundPic, backGroundPic: user.backGroundPic,
name: user.name, name: user.name,
realName: user.realName, realName: user.realName,
phone: user.phone, phone: user.phone,
email: user.email, email: user.email,
address:user.address, address: user.address,
coordinate:user.coordinate, coordinate: user.coordinate,
addressLat:user.addressLat, addressLat: user.addressLat,
addressLon:user.addressLon addressLon: user.addressLon
} }
this.nameDisabled = true this.nameDisabled = true
this.phoneDisabled = true this.phoneDisabled = true
}); });
} }
}, },
getInvoice(){ getInvoice() {
getInvoiceList().then(res =>{ getInvoiceList().then(res => {
this.form.invoice = res.data.data this.form.invoice = res.data.data
}) })
}, },
handleTabClick(tabs) { handleTabClick(tabs) {
this.index = func.toInt(tabs.index); this.index = func.toInt(tabs.index);
if(this.index == 0){ if (this.index == 0) {
this.handleWitch(); this.handleWitch();
}else{ } else {
this.getInvoice() this.getInvoice()
} }
} }

Loading…
Cancel
Save