| | |
| | | import {getToken, removeToken} from "@/utils/auth"; |
| | | import {onMounted, ref} from "vue"; |
| | | import Cookies from "js-cookie"; |
| | | import {getUserById} from "@/api/sysUsers"; |
| | | import {getUserById} from "@/api/hazardousChemicals/user"; |
| | | import menu from "@/layout/components/Sidebar/menu"; |
| | | import userDialog from '@/views/hazardousChemicals/systemManage/user/components/userDialog.vue' |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | function getInfo() { |
| | | console.log("getInfo",userInfo.value) |
| | | reviewRef.value.openDialog('view',userInfo.value) |
| | | const getInfo = async () => { |
| | | const info = await getUserById(userInfo.value.id); |
| | | if(info.code === 200){ |
| | | Cookies.set('userInfo',JSON.stringify(info.data)) |
| | | reviewRef.value.openDialog('edit',info.data) |
| | | } |
| | | |
| | | } |
| | | function editPsd() { |
| | | reviewRef.value.openDialog('pwd',userInfo.value) |
| | |
| | | :hollow="item.hollow" |
| | | > |
| | | {{ item.description }} |
| | | <span style="color: #03752e;font-weight: 600" v-if="item.num > 0">{{item.stateName}}</span> |
| | | <span style="color: #f6828e;font-weight: 600" v-else>{{item.stateName}}</span> |
| | | <span style="color: #03752e" v-if="item.num > 0">{{item.num >0 ? '+' + item.num: item.num}}{{item.unit}}</span> |
| | | <span style="color: #f6828e" v-else>{{item.num}}{{item.unit}}</span> |
| | | </el-timeline-item> |
| | |
| | | return { |
| | | ...item, |
| | | unit: item.productBasic.unit, |
| | | description: `${item.updateTime} ${item.user.departName ? item.user.departName +'部门' : ''} ${item.user.name} 进行了 ${item.state == 0 ? '批量导入' : item.state == 3 ? '标签作废' : '销售'}`, |
| | | stateName: item.state ==0 ?'入库': item.state ==1 ? '取用' :item.state ==2 ? '归还': item.state ==3 ? '标签作废' : item.state ==4 ? '用尽登记':item.state ==5 ? '销售' : '', |
| | | description: `${item.updateTime} ${item.user.departName ? item.user.departName +'部门' : ''} ${item.user.name} 进行了 `, |
| | | size: 'large', |
| | | type: 'primary', |
| | | icon: MoreFilled, |
| | |
| | | return { |
| | | ...item, |
| | | unit:item.hazmatBasic.unit, |
| | | description: `${item.updateTime} ${item.user.departName ? item.user.departName +'部门' : ''} ${item.user.name} 进行了 ${item.state ==0?'批量导入': item.state ==1?'取用' :item.state ==2?'归还':item.state ==3?'标签作废' :''}`, |
| | | stateName: item.state ==0 ?'入库': item.state ==1 ? '取用' :item.state ==2 ? '归还': item.state ==3 ? '标签作废' : item.state ==4 ? '用尽登记':item.state ==5 ? '销售' : '', |
| | | description: `${item.updateTime} ${item.user.departName ? item.user.departName +'部门' : ''} ${item.user.name} 进行了 `, |
| | | size: 'large', |
| | | type: 'primary', |
| | | icon: MoreFilled, |
| | |
| | | return { |
| | | ...item, |
| | | unit:item.hazmatBasic.unit, |
| | | description: `${item.updateTime} ${item.user.departName ? item.user.departName +'部门' : ''} ${item.user.name} 进行了 ${item.state ==0?'批量导入': item.state ==1?'取用' :item.state ==2?'归还':item.state ==3?'标签作废' :''}`, |
| | | stateName: item.state ==0 ?'入库': item.state ==1 ? '取用' :item.state ==2 ? '归还': item.state ==3 ? '标签作废' : item.state ==4 ? '用尽登记':item.state ==5 ? '销售' : '', |
| | | description: `${item.updateTime} ${item.user.departName ? item.user.departName +'部门' : ''} ${item.user.name} 进行了 `, |
| | | size: 'large', |
| | | type: 'primary', |
| | | icon: MoreFilled, |
| | |
| | | return { |
| | | ...item, |
| | | unit:item.productBasic.unit, |
| | | description: `${item.updateTime} ${item.user.departName? item.user.departName +'部门' : ''} ${item.user.name} 进行了 ${item.state == 0 ? '批量导入' : item.state == 3 ? '标签作废' : '销售'}`, |
| | | stateName: item.state ==0 ?'入库': item.state ==1 ? '取用' :item.state ==2 ? '归还': item.state ==3 ? '标签作废' : item.state ==4 ? '用尽登记':item.state ==5 ? '销售' : '', |
| | | description: `${item.updateTime} ${item.user.departName? item.user.departName +'部门' : ''} ${item.user.name} 进行了 `, |
| | | size: 'large', |
| | | type: 'primary', |
| | | icon: MoreFilled, |
| | |
| | | </el-form> |
| | | </div> |
| | | <!-- 表格数据 --> |
| | | <el-table v-loading="loading" :data="dataList" :border="true"> |
| | | <el-table v-loading="loading" :data="dataList" :border="true" :cell-style="cellStyle"> |
| | | <el-table-column label="序号" type="index" align="center" width="80" /> |
| | | <el-table-column label="流转时间" prop="updateTime" align="center" width="120"/> |
| | | <el-table-column label="品名" prop="hazmatBasic.name" align="center" /> |
| | |
| | | } |
| | | getList() |
| | | }) |
| | | |
| | | const getList = async () => { |
| | | loading.value = true |
| | | const res = await getRawFlow(data.queryParams) |
| | |
| | | const getProRecord = (val) => { |
| | | dialogRef.value.openDialog(val) |
| | | } |
| | | const cellStyle = ({ row, column,rowIndex, columnIndex }) => { |
| | | let arr = [] |
| | | if (data.dataList !== null) { |
| | | data.dataList.filter((item, index) => { |
| | | arr.push(item.basicId) |
| | | }) |
| | | } |
| | | |
| | | for (let i = 0; i <= arr.length; i++) { |
| | | if (arr[i] == row.basicId) { |
| | | if (columnIndex === 6 || columnIndex === 5){ |
| | | if(row.num > 0){ |
| | | return { color:' green' } |
| | | }else{ |
| | | return { color:' red' } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | }; |
| | | |
| | | defineExpose({ |
| | | getList |
| | |
| | | </div> |
| | | <el-card style="max-width: 480px"> |
| | | <div :id="state.form.code"> |
| | | <div style="display: flex;flex-direction: column;align-items: center;font-size: 16px;"> |
| | | <span>{{title}}</span> |
| | | <vue-qr :size="85" :margin="0" :auto-color="true" :dot-scale="1" :text="state.form.code" style="margin: 10px 0 10px 0"></vue-qr> |
| | | <span>{{state.form.code}}</span> |
| | | <div style="display: flex;flex-direction: column;align-items: center;"> |
| | | <span style="font-size:14px;margin-top:10px;">{{title}}</span> |
| | | <vue-qr :size="80" :margin="0" :auto-color="true" :dot-scale="1" :text="state.form.code" style="margin: 10px 0 5px 0"></vue-qr> |
| | | <span style="font-size:10px;margin-top:5px;">{{state.form.code}}</span> |
| | | </div> |
| | | </div> |
| | | </el-card> |
| | |
| | | <img :src="avator" style="width: 25px;height: 25px" /> |
| | | <div style="display: flex;flex-direction: column;margin-left: 20px"> |
| | | <span style="font-size: 16px;font-weight: 600">{{item.description}} |
| | | <span style="color: #03752e;font-weight: 600" v-if="item.num > 0">{{item.stateName}}</span> |
| | | <span style="color: #f6828e;font-weight: 600" v-else>{{item.stateName}}</span> |
| | | <span style="color: #03752e" v-if="item.num > 0">{{item.num >0 ? '+' + item.num: item.num}}{{item.unit}}</span> |
| | | <span style="color: #f6828e" v-else>{{item.num}}{{item.unit}}</span> |
| | | </span> |
| | |
| | | return { |
| | | ...item, |
| | | unit:item.hazmatBasic.unit, |
| | | description: `${item.user.departName ? item.user.departName +'部门' : ''} ${item.user.name} 进行了 ${item.state ==0?'批量导入': item.state ==1?'取用' :item.state ==2?'归还':item.state ==3?'标签作废' :''} ${item.hazmatBasic.name}` |
| | | stateName: item.state ==0 ?'入库': item.state ==1 ? '取用' :item.state ==2 ? '归还': item.state ==3 ? '标签作废' : item.state ==4 ? '用尽登记':item.state ==5 ? '销售' : '', |
| | | description: `${item.user.departName ? item.user.departName +'部门' : ''} ${item.user.name} 进行了 ` |
| | | } |
| | | }) |
| | | console.log('data.hazmatData',data.hazmatData) |
| | |
| | | <span>{{scope.row.status ==0 ? '正常' : '停用'}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="250" > |
| | | <el-table-column label="操作" align="center" width="250" > |
| | | |
| | | <template #default="scope"> |
| | | <el-button type="success" plain @click="openDialog('add',scope.row)">添加</el-button> |
| | | <el-button type="primary" plain @click="openDialog('edit',scope.row)">编辑</el-button> |
| | | <el-button type="danger" plain @click="handleDelete(scope.row.id)">删除</el-button> |
| | | <el-button type="success" link @click="openDialog('add',scope.row)">添加</el-button> |
| | | <el-button type="primary" link @click="openDialog('edit',scope.row)">编辑</el-button> |
| | | <el-button type="danger" link @click="handleDelete(scope.row.id)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | </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" > |
| | | <el-form-item label="所属部门:" prop="departId" v-if="state.form.userType !=0 && state.title !== '修改密码'" > |
| | | <el-cascader |
| | | v-if="(state.currentUserType == 1 ||state.currentUserType == 0) && (state.title == '新增用户' || state.title == '编辑用户')" |
| | | v-if="state.title == '新增用户' || state.title == '编辑用户'" |
| | | style="width: 100%" |
| | | ref="classifyRef" |
| | | v-model="state.form.departId" |
| | |
| | | const userInfo = ref() |
| | | const classifyRef = ref(null) |
| | | const openDialog = async (type, value) => { |
| | | |
| | | userInfo.value = JSON.parse(Cookies.get('userInfo')) |
| | | console.log("userInfo",userInfo.value) |
| | | state.currentUserType = userInfo.value.userType |
| | |
| | | state.form.companyName = userInfo.value.companyName; |
| | | state.form.userType = 2 |
| | | } |
| | | if(userInfo.value.userType != 0 || (userInfo.value.userType ==0 && (type =='edit' || state.title =='查看用户'))){ |
| | | |
| | | state.title = type === 'add' ? '新增用户' : type ==='edit' ? '编辑用户' : type ==='pwd' ? '修改密码' : '查看用户' ; |
| | | if(state.title !== '修改密码' && (userInfo.value.userType != 0 || (userInfo.value.userType ==0 && (type =='edit' || state.title =='查看用户')))){ |
| | | await getDeptList() |
| | | } |
| | | state.title = type === 'add' ? '新增用户' : type ==='edit' ? '编辑用户' : type ==='pwd' ? '修改密码' : '查看用户' ; |
| | | if(type === 'edit' || type === 'view') { |
| | | startUsername.value = value.username |
| | | if( type === 'view'){ |
| | |
| | | if(type === 'edit' && state.isAdmin){ |
| | | await getCompanyList("") |
| | | } |
| | | state.form = value |
| | | |
| | | state.form = JSON.parse(JSON.stringify(value)); |
| | | } |
| | | if(type == 'pwd'){ |
| | | state.form.id = value.id |
| | |
| | | data.password = Base64.encode(data.password) |
| | | const res = await editUser(data) |
| | | if(res.code == 200){ |
| | | |
| | | // Cookies.set('userInfo',JSON.stringify(data)) |
| | | ElMessage.success(res.message) |
| | | emit('getList') |
| | | handleClose() |
| | |
| | | //background-repeat: no-repeat; |
| | | background-size: cover; |
| | | height: 100%; |
| | | min-height: 931px; |
| | | :deep(.el-form-item__content .el-form-item) { |
| | | display: block; |
| | | } |