| | |
| | | VITE_APP_RESOURCE_API = 'http://192.168.2.16:9000/trainexam/' |
| | | |
| | | #董 |
| | | VITE_APP_BASE_API = 'http://192.168.2.24:8083/api' |
| | | VITE_APP_BASE_API = 'http://192.168.2.37:8083/api' |
| | | |
| | | #贺 |
| | | #VITE_APP_BASE_API = 'http://192.168.2.11:5812/api' |
| | |
| | | import Cookies from "js-cookie"; |
| | | import {getUserById} from "@/api/hazardousChemicals/user"; |
| | | import {getConfigById} from "@/api/hazardousChemicals/config"; |
| | | import {ElMessage} from "element-plus"; |
| | | const useUserStore = defineStore( |
| | | 'user', |
| | | { |
| | |
| | | if(info.code === 200){ |
| | | Cookies.set('userInfo',JSON.stringify(info.data)) |
| | | } |
| | | if(info.data.userType == 3){ |
| | | ElMessage.warning('监管部门账号不可登录') |
| | | loading.value = false |
| | | return |
| | | } |
| | | if(info.data.userType != 0){ |
| | | const con = await getConfigById(res.data.companyId); |
| | | if(con.code === 200){ |
| | |
| | | import {ElMessage} from "element-plus"; |
| | | import {getAllProFlow, getFlowByCode} from "@/api/hazardousChemicals/productRecord"; |
| | | import { MoreFilled } from '@element-plus/icons-vue' |
| | | import Cookies from "js-cookie"; |
| | | const busRef = ref(); |
| | | const length = ref() |
| | | const title = ref('') |
| | |
| | | dataList: [], |
| | | active: null |
| | | }) |
| | | |
| | | const userInfo = ref() |
| | | |
| | | const openDialog = async (type, value) => { |
| | | userInfo.value = JSON.parse(Cookies.get('userInfo')) |
| | | title.value = type; |
| | | if(type === 'code'){ |
| | | state.form.code = value |
| | | }else { |
| | | |
| | | state.form = JSON.parse(JSON.stringify(value)) |
| | | } |
| | | |
| | | await getAllFlow() |
| | | } |
| | | |
| | |
| | | let param = {} |
| | | if(title.value == 'pro'){ |
| | | param = { |
| | | productId: state.form.id |
| | | productId: state.form.id, |
| | | companyId: userInfo.value.companyId |
| | | } |
| | | }else { |
| | | param = { |
| | | productId: state.form.productId |
| | | productId: state.form.productId, |
| | | companyId: userInfo.value.companyId |
| | | } |
| | | } |
| | | const res = await getAllProFlow(param) |
| | |
| | | let param = {} |
| | | if(title.value == 'raw'){ |
| | | param = { |
| | | hazmatId: state.form.id |
| | | hazmatId: state.form.id, |
| | | companyId: userInfo.value.companyId |
| | | } |
| | | }else { |
| | | param = { |
| | | hazmatId: state.form.hazmatId |
| | | hazmatId: state.form.hazmatId, |
| | | companyId: userInfo.value.companyId |
| | | } |
| | | } |
| | | const res = await getAllRawFlow(param) |
| | |
| | | } |
| | | }else if(title.value == 'code'){ |
| | | const param = { |
| | | code: state.form.code |
| | | code: state.form.code, |
| | | companyId: userInfo.value.companyId |
| | | } |
| | | const res = await getFlowByCode(param) |
| | | if(res.code == 200){ |
| | |
| | | <el-form-item label="企业名称:" prop="name" > |
| | | <el-input v-model.trim="state.form.name" placeholder="请输入企业名称"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="企业类型:" prop="type" > |
| | | <el-select |
| | | v-model="state.form.type" |
| | | placeholder="请选择企业类型" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="item in state.typeList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="负责人:" prop="major" > |
| | | <el-input v-model.trim="state.form.major" placeholder="请输入负责人"></el-input> |
| | | </el-form-item> |
| | |
| | | name: [{ required: true, trigger: "blur", validator: validateName }], |
| | | phone:[{ required: true, trigger: "blur", validator: validatePhone }], |
| | | code:[{ required: true, validator: validateCode, trigger: 'blur' }], |
| | | type: [{ required: true, message: '请选择企业类型', trigger: 'blur' }], |
| | | }, |
| | | typeList: [ |
| | | { |
| | | id: 0, |
| | | name: '研发类' |
| | | }, |
| | | { |
| | | id: 1, |
| | | name: '生产类' |
| | | }, |
| | | { |
| | | id: 2, |
| | | name: '中试类' |
| | | }, |
| | | ] |
| | | }) |
| | | |
| | | |
| | |
| | | <el-table-column label="企业信用代码" prop="creditCode" align="center" /> |
| | | <el-table-column label="企业编码" prop="code" align="center" /> |
| | | <el-table-column label="企业名称" prop="name" align="center" /> |
| | | <el-table-column label="企业类型" prop="type" align="center" > |
| | | <template #default="scope"> |
| | | <span>{{scope.row.type == 0 ? '研发类' : scope.row.type == 1 ? '生产类' : scope.row.type == 2?'中试类':'' }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="负责人" prop="major" align="center" /> |
| | | <el-table-column label="联系电话" prop="phone" align="center"/> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200" > |
| | |
| | | <el-dialog |
| | | v-model="dialogVisible" |
| | | :title="title" |
| | | width="500px" |
| | | width="600px" |
| | | :before-close="handleClose" |
| | | :close-on-press-escape="false" |
| | | :close-on-click-modal="false" |
| | |
| | | </template> |
| | | </el-upload> |
| | | </el-form-item> |
| | | |
| | | <el-row :gutter="24"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="经度:" prop="longitude" label-width="90px"> |
| | | <el-input v-model="state.form.longitude" style="width:165px" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11"> |
| | | <el-form-item label="纬度:" prop="latitude" label-width="60px"> |
| | | <el-input v-model="state.form.latitude" style="width:165px"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="1"> |
| | | <img :src="mapPng" class="enterpriseBasicInformation_image" @click="showMapLocation" /> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <mapLo ref="mapLocationRef" @giveLatLng="achieveLatLng"></mapLo> |
| | | </div> |
| | | </template> |
| | | <script setup> |
| | | import {reactive, ref, toRefs} from 'vue' |
| | | import {ElMessage} from "element-plus"; |
| | | import mapLo from './mapLocation.vue' |
| | | import {addWarehouse, checkName, editWarehouse} from "@/api/hazardousChemicals/warehouse"; |
| | | import {verifyPhone} from "@/utils/validate"; |
| | | import {checkBasicName} from "@/api/hazardousChemicals/basicInfo"; |
| | | import mapPng from '@/assets/images/map.png' |
| | | const mapLocationRef = ref() |
| | | import {addConfig, editConfig} from "@/api/hazardousChemicals/config"; |
| | | import {getCompany} from "@/api/hazardousChemicals/company"; |
| | | import {getToken} from "@/utils/auth"; |
| | |
| | | companyId: null, |
| | | companyName: '', |
| | | logoPath: '', |
| | | useProd: 0 |
| | | |
| | | useProd: 0, |
| | | longitude:'', |
| | | latitude: '' |
| | | }, |
| | | companyList: [], |
| | | formRules:{ |
| | | companyName: [{ required: true, message: '请选择企业', trigger: 'blur' }], |
| | | useProd: [{ required: true, message: '请选择是否使用成品', trigger: 'blur' }], |
| | | longitude:[{ required: true, message: '请填写经度', trigger: 'blur' }], |
| | | latitude:[{ required: true, message: '请填写纬度', trigger: 'blur' }], |
| | | }, |
| | | uploadUrl: import.meta.env.VITE_APP_BASE_API + '/system/common/uploadFile', |
| | | header: { |
| | |
| | | }) |
| | | } |
| | | } |
| | | const showMapLocation = () => { |
| | | mapLocationRef.value.openMapLocation(state.form.longitude,state.form.latitude) |
| | | } |
| | | const handleRemove = async (file, uploadFiles) => { |
| | | let path = state.form.logoPath; |
| | | await delPic({path: path}).then(res => { |
| | |
| | | state.form.logoPath = '' |
| | | }); |
| | | } |
| | | const achieveLatLng=(lng,lat)=>{ |
| | | if(lng && lat){ |
| | | state.form.longitude = lng |
| | | state.form.latitude = lat |
| | | }else { |
| | | ElMessage.warning('请选择公司经纬度') |
| | | } |
| | | |
| | | } |
| | | const reset = () => { |
| | | state.form = { |
| | | id: '', |
| | | name: '', |
| | | remark: '', |
| | | companyId: null, |
| | | companyName: '', |
| | | logoPath: '', |
| | | useProd: 0, |
| | | longitude:'', |
| | | latitude: '' |
| | | } |
| | | } |
| | | defineExpose({ |
| | |
| | | flex-direction: column; |
| | | align-items: flex-start; |
| | | } |
| | | .enterpriseBasicInformation_image{ |
| | | cursor: pointer; |
| | | width:30px; |
| | | height:30px; |
| | | margin-left: -35px; |
| | | } |
| | | .enterpriseBasicInformation_input{ |
| | | width:100%; |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <el-dialog |
| | | v-model="state.mapLocationVisible" |
| | | v-if="state.mapLocationVisible" |
| | | append-to-body |
| | | :close-on-click-modal="false" |
| | | width="75%" |
| | | :title="state.title" |
| | | @close="handleClose" |
| | | > |
| | | <div class="mapLocation_head"> |
| | | <div> |
| | | <el-alert |
| | | title="点击地点获取经纬度信息" |
| | | type="info" |
| | | :closable="false" |
| | | > |
| | | </el-alert> |
| | | </div> |
| | | <div class="mapLocation_latlng"> |
| | | <span>经度:</span> |
| | | <el-input class="mapLocation_latlng_input" id="lng" v-model.trim="state.longitude" @change="getAdress"></el-input> |
| | | </div> |
| | | <div class="mapLocation_latlng"> |
| | | <span>纬度:</span> |
| | | <el-input class="mapLocation_latlng_input" id="lat" v-model.trim="state.latitude" @change="getAdress"></el-input> |
| | | </div> |
| | | <div class="mapLocation_latlng"> |
| | | <span>地址:</span> |
| | | <el-input class="mapLocation_latlng_input" id="lat" v-model.trim="state.BAddress"></el-input> |
| | | </div> |
| | | |
| | | </div> |
| | | <div class="mapLocation_body"> |
| | | <baidu-map class="map" @ready="getAdress" ak="BkZdiHBj9aGrMdVFM48r2njNiMzsekga" v="3.0" type="API" :center="state.center" :zoom="state.zoom" scroll-wheel-zoom @click="getPosition"> |
| | | <!-- <div style="position: absolute;z-index: 999;margin-top: -495px">--> |
| | | <!-- <label>搜索:<input v-model="state.keyword"></label>--> |
| | | <!-- <bm-local-search--> |
| | | <!-- :keyword="state.keyword"--> |
| | | <!-- :auto-viewport="true"--> |
| | | <!-- location="新疆"--> |
| | | <!-- :pageCapacity="3"--> |
| | | <!-- ></bm-local-search>--> |
| | | <!-- </div>--> |
| | | <bm-marker :position="{lng: state.longitude, lat: state.latitude}" :dragging="true" animation="BMAP_ANIMATION_BOUNCE"> |
| | | <!-- <bm-label :labelStyle="{color: 'red'}" :offset="{width: -35, height: 30}"/>--> |
| | | </bm-marker> |
| | | </baidu-map> |
| | | </div> |
| | | <div align="right" style="margin-top: 10px"> |
| | | <el-button @click="handleClose()">取消</el-button> |
| | | <el-button type="primary" @click="submitLatLng()">确认</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {ref, onMounted, reactive, toRefs, defineComponent, defineExpose, defineEmits, watch} from 'vue'; |
| | | import { BaiduMap,BmMarker,BmLocalSearch,BmLabel } from 'vue-baidu-map-3x' |
| | | const state = reactive({ |
| | | title: '', |
| | | longitude: '', |
| | | latitude: '', |
| | | mapLocationVisible: false, |
| | | zoom: 7, |
| | | center: { |
| | | lng: '120.622500', |
| | | lat: '31.305800' |
| | | }, |
| | | keyword:'', |
| | | location: '', |
| | | BAddress: '' |
| | | }) |
| | | |
| | | const emit = defineEmits(['giveLatLng']) |
| | | |
| | | onMounted(() => { |
| | | // ...(mounted钩子中的代码不变) |
| | | }); |
| | | const map = reactive({}) |
| | | |
| | | const getPosition = ({type, target, point, pixel, overlay})=>{ |
| | | state.longitude = point.lng |
| | | state.latitude = point.lat |
| | | getAdress() |
| | | } |
| | | |
| | | const openMapLocation=(longitude,latitude)=>{ |
| | | |
| | | if(longitude){ |
| | | state.longitude = longitude |
| | | state.latitude = latitude |
| | | state.zoom = 10 |
| | | state.center = { |
| | | lng: longitude, |
| | | lat: latitude |
| | | } |
| | | }else { |
| | | state.zoom = 10 |
| | | state.center = { |
| | | lng: '120.622500', |
| | | lat: '31.305800' |
| | | } |
| | | } |
| | | |
| | | state.mapLocationVisible = true |
| | | } |
| | | |
| | | const submitLatLng=()=>{ |
| | | emit('giveLatLng',state.longitude,state.latitude); |
| | | handleClose() |
| | | } |
| | | |
| | | const initMap=()=>{ |
| | | |
| | | } |
| | | const myGeo = ref(null) |
| | | const getAdress = () => { |
| | | myGeo.value = new BMap.Geocoder(); |
| | | const pt = new BMap.Point(state.longitude, state.latitude); |
| | | myGeo.value.getLocation(pt,function(result){ |
| | | state.BAddress = result.address; //获取到当前定位的详细地址信息 |
| | | }, |
| | | { enableHighAccuracy: true } |
| | | ); |
| | | } |
| | | const handleClose = () => { |
| | | state.longitude = '' |
| | | state.latitude = '' |
| | | state.BAddress = '' |
| | | state.mapLocationVisible = false |
| | | } |
| | | defineExpose({ |
| | | openMapLocation |
| | | }) |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .map { |
| | | width: 100%; |
| | | height: 500px; |
| | | |
| | | :deep(.BMap_cpyCtrl){ |
| | | display: none!important; |
| | | visibility: hidden!important; |
| | | } |
| | | |
| | | :deep(.anchorBL) { |
| | | display: none!important; |
| | | visibility: hidden!important; |
| | | } |
| | | } |
| | | .mapLocation_head{ |
| | | width:100%; |
| | | height:100px; |
| | | } |
| | | .mapLocation_body{ |
| | | width:100%; |
| | | height:500px |
| | | } |
| | | .mapLocation_latlng{ |
| | | padding-top:10px; |
| | | display:inline-block; |
| | | margin-right: 20px; |
| | | } |
| | | .mapLocation_latlng_input{ |
| | | width:250px; |
| | | } |
| | | </style> |
| | |
| | | <span>{{scope.row.useProd == 0 ? '不使用' : '使用' }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="经度" prop="longitude" align="center" /> |
| | | <el-table-column label="纬度" prop="latitude" align="center" /> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200" > |
| | | <template #default="scope"> |
| | | <el-button link type="primary" @click="openDialog('edit',scope.row)">编辑</el-button> |
| | |
| | | <el-form-item label="用户类型:" v-if="state.title !== '修改密码'" prop="userType" > |
| | | <el-radio-group v-model="state.form.userType" @change="changeType" v-if="state.title == '新增用户'" > |
| | | <el-radio :label="0" v-if="state.isAdmin">管理员</el-radio> |
| | | <el-radio :label="3" v-if="state.isAdmin">监管部门</el-radio> |
| | | <el-radio :label="1" v-if="state.isAdmin">企业用户</el-radio> |
| | | <el-radio :label="2" v-if="!state.isAdmin">普通用户</el-radio> |
| | | </el-radio-group> |
| | | <span v-else>{{state.form.userType ==0 ? '管理员':state.form.userType ==1 ? '企业用户' : '普通用户'}}</span> |
| | | <span v-else>{{state.form.userType ==0 ? '管理员':state.form.userType ==1 ? '企业用户' : state.form.userType ==2?'普通用户':'监管用户'}}</span> |
| | | </el-form-item> |
| | | <el-form-item label="所属企业:" prop="companyName" v-if="state.title !== '修改密码' && state.form.userType !=0"> |
| | | <el-form-item label="所属企业:" prop="companyName" v-if="state.title !== '修改密码' && state.form.userType !=0 && state.form.userType !=3"> |
| | | <el-select |
| | | v-if="state.isAdmin" |
| | | clearable |
| | |
| | | </el-select> |
| | | <el-input v-else disabled style="width: 100%" v-model="state.form.companyName"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="所属部门:" prop="departId" v-if="state.form.userType !=0 && state.title !== '修改密码'" > |
| | | <el-form-item label="所属部门:" prop="departId" v-if="state.form.userType !=3 && state.form.userType !=0 && state.title !== '修改密码'" > |
| | | <el-cascader |
| | | v-if="state.title == '新增用户' || state.title == '编辑用户'" |
| | | style="width: 100%" |
| | |
| | | </el-table-column> |
| | | <el-table-column label="用户类型" prop="userType" align="center"> |
| | | <template #default="scope"> |
| | | <span>{{scope.row.userType == 0 ?'管理员':scope.row.userType == 1 ? '企业用户':'普通用户'}}</span> |
| | | <span>{{scope.row.userType == 0 ?'管理员':scope.row.userType == 1 ? '企业用户':scope.row.userType ==2 ? '普通用户' : '监管用户'}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width" > |
| | |
| | | sidebarRouters.value = menu.commonMenu |
| | | } |
| | | Cookies.set('routers',JSON.stringify(sidebarRouters.value)) |
| | | }else { |
| | | ElMessage.warning('监管部门账号不可登录') |
| | | loading.value = false |
| | | return |
| | | } |
| | | let path = "" |
| | | if(sidebarRouters.value[0].children && sidebarRouters.value[0].children.length > 0){ |