问题修改

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',
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',
formslot:true,
},
// {
// label: '用户名',
// span: 12,
// row: true,
// prop: 'name'
// },
{
label: '所属实验室',
span: 12,
row: true,
prop: 'deptName',
display:false,
},
{
label: '手机号',
span: 12,
row: true,
prop: 'phone',
formslot:true,
},
},
{
label:'位置',
span:12,
@ -128,7 +129,7 @@ export default {
{
label: '公司名称',
prop: "companyName"
},
},
{
label: '税号',
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',
component: () =>

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

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

Loading…
Cancel
Save