|
|
|
|
@ -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() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|