From e3d63f84a43db07fa5992de2937ee23fc67bad38 Mon Sep 17 00:00:00 2001 From: Your Name <123456> Date: 星期五, 06 一月 2023 16:43:58 +0800 Subject: [PATCH] 物资 --- src/views/facilityManagement/safetyGoodsAndEquipment/index.vue | 53 + src/views/facilityManagement/claimReturnRecords/components/returnAndWatch.vue | 239 +++++++++ src/utils/request.ts | 2 src/views/facilityManagement/safetyGoodsAndEquipment/components/safetyGoodsAndEquipmentDialog.vue | 73 +- src/views/facilityManagement/claimReturnRecords/index.ts | 76 +++ src/views/facilityManagement/safetyGoodsAndEquipment/components/addGoodsDialog.vue | 3 src/views/facilityManagement/safetyGoodsAndEquipment/index.ts | 7 src/views/facilityManagement/goodsDetailManage/index.ts | 2 src/views/facilityManagement/goodsTypeManage/index.vue | 435 ++++++++++++++++++ src/views/facilityManagement/claimReturnRecords/index.vue | 258 ++++++++++ src/stores/userInfo.ts | 2 src/views/facilityManagement/goodsDetailManage/components/checkOut.vue | 15 src/assets/style/index.scss | 4 src/views/facilityManagement/safetyGoodsAndEquipment/components/batchInStorage.vue | 9 src/stores/interface/index.ts | 2 src/views/facilityManagement/claimReturnRecords/components/invalidDealDialog.vue | 85 +++ src/views/facilityManagement/goodsDetailManage/components/goodsDetailAdd.vue | 57 +- src/views/facilityManagement/goodsDetailManage/components/goodsDetailEdit.vue | 43 src/api/facilityManagement/claimReturnRecords/index.ts | 27 + src/views/loginPage/component/accountLogin.vue | 1 src/views/facilityManagement/safetyGoodsAndEquipment/components/batchOutStorage.vue | 12 21 files changed, 1,291 insertions(+), 114 deletions(-) diff --git a/src/api/facilityManagement/claimReturnRecords/index.ts b/src/api/facilityManagement/claimReturnRecords/index.ts new file mode 100644 index 0000000..58e17b0 --- /dev/null +++ b/src/api/facilityManagement/claimReturnRecords/index.ts @@ -0,0 +1,27 @@ +import request from "/@/utils/request"; + +export function claimReturnRecordsApi() { + return { + getClaimReturnRecords: (data: {}) => { + return request({ + url: import.meta.env.VITE_API_URL_OUT + `/equipment/material/record/page/list`, + method: 'post', + data + }); + }, + returnGoods: (data: {}) => { + return request({ + url: import.meta.env.VITE_API_URL_OUT + `/equipment/material/record/revert`, + method: 'post', + data + }); + }, + refreshReturnAndNoReturn: (data: {}) => { + return request({ + url: import.meta.env.VITE_API_URL_OUT + `/equipment/material/record/queryById`, + method: 'post', + data + }); + }, + } +} diff --git a/src/assets/style/index.scss b/src/assets/style/index.scss index 22aad3b..1503233 100644 --- a/src/assets/style/index.scss +++ b/src/assets/style/index.scss @@ -3,6 +3,10 @@ padding-right: 10px; padding-bottom: 10px; } +.input-box2{ + width: 200px !important; + padding-right: 10px; +} .input-add{ width: 90% !important; } diff --git a/src/stores/interface/index.ts b/src/stores/interface/index.ts index a0999d6..9ace21a 100644 --- a/src/stores/interface/index.ts +++ b/src/stores/interface/index.ts @@ -11,7 +11,7 @@ time: number; userName: string; uid: string; - depId: string; + depId: null | number; projectId: string; dataList: []; } diff --git a/src/stores/userInfo.ts b/src/stores/userInfo.ts index 973c82a..edbe1ed 100644 --- a/src/stores/userInfo.ts +++ b/src/stores/userInfo.ts @@ -15,7 +15,7 @@ roles: [], authBtnList: [], uid: '', - depId: '', + depId: null, projectId: '', dataList: [] } diff --git a/src/utils/request.ts b/src/utils/request.ts index 05e9b36..ed8cf58 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -44,7 +44,7 @@ // if(typeof JSON.parse(data) === 'object'){ // return JSONbig.parse(data); // }; - return JSONbig.parse(data); + return JSONbig.parse(data); } catch (err) { // 转换失败返回一个空对象 return data diff --git a/src/views/facilityManagement/claimReturnRecords/components/invalidDealDialog.vue b/src/views/facilityManagement/claimReturnRecords/components/invalidDealDialog.vue new file mode 100644 index 0000000..7f0503e --- /dev/null +++ b/src/views/facilityManagement/claimReturnRecords/components/invalidDealDialog.vue @@ -0,0 +1,85 @@ +<template> + <div> + <el-dialog :title="invalidDealState.title" :close-on-click-modal="false" v-model="invalidDealState.invalidDealDialogVisible" width="30%"> + <el-form + :model="invalidDealState.invalidDealForm" + ref="invalidDealFormRef" + size="default" + label-width="150px"> + <el-row> + <el-col :span="24" class="mb20"> + <el-form-item label="失效原因:" prop="reason"> + <el-select class="input-add" v-model="invalidDealState.invalidDealForm.reason" placeholder="失效原因"> + <el-option + v-for="item in invalidDealState.reasonList" + :key="item.id" + :value="item.id" + :label="item.name" + ></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :span="24" class="mb20"> + <el-form-item label="备注:" prop="remark"> + <el-input type="textarea" :rows="3" v-model="invalidDealState.invalidDealForm.remark" placeholder="备注" class="input-add"> + </el-input> + </el-form-item> + </el-col> + </el-row> + </el-form> + <template #footer> + <span class="dialog-footer"> + <el-button @click="invalidDealState.invalidDealDialogVisible = !invalidDealState.invalidDealDialogVisible" size="default">取 消</el-button> + <el-button type="primary" @click="submitInvalidDeal" v-throttle size="default">确 定</el-button> + </span> + </template> + </el-dialog> + </div> +</template> + +<script setup lang="ts"> +import { reactive, ref } from 'vue' +import {InvalidDealStateType, materialType} from '..' + +const invalidDealFormRef = ref() + +const invalidDealState = reactive<InvalidDealStateType>({ + title: '', + invalidDealDialogVisible: false, + invalidDealForm: { + id: null, + reason: null, + remark: null, + }, + reasonList:[ + {id: 0, name:'完好'}, + {id: 1, name:'损坏'}, + {id: 2, name:'丢失'}, + {id: 3, name:'过期'}, + {id: 4, name:'其他'} + ] +}) + +const openInvalidDealDialog = (value: materialType) => { + invalidDealState.invalidDealDialogVisible = true + invalidDealState.invalidDealForm.id = value.id + invalidDealState.invalidDealForm.reason = value.materialStatus + invalidDealState.invalidDealForm.remark = value.remark +} + +const submitInvalidDeal = () => { + emit('refreshInvalidDeal',invalidDealState.invalidDealForm) + invalidDealState.invalidDealDialogVisible = false +} + +const emit = defineEmits(['refreshInvalidDeal']) + +defineExpose({ + openInvalidDealDialog +}) + +</script> + +<style scoped> + +</style> diff --git a/src/views/facilityManagement/claimReturnRecords/components/returnAndWatch.vue b/src/views/facilityManagement/claimReturnRecords/components/returnAndWatch.vue new file mode 100644 index 0000000..9f1b860 --- /dev/null +++ b/src/views/facilityManagement/claimReturnRecords/components/returnAndWatch.vue @@ -0,0 +1,239 @@ +<template> + <div class="system-add-menu-container"> + <el-dialog :title="returnAndWatchState.title" :close-on-click-modal="false" v-model="returnAndWatchState.showReturnAndWatchDialog" width="50%"> + <el-tabs class="active" v-model="returnAndWatchState.activeName"> + <el-tab-pane label="未归还" name="noReturn"> + <el-table + :data="returnAndWatchState.noReturnData" + border fit highlight-current-row lazy + :header-cell-style="{ background: '#fafafa' }" + style="width: 100%" + @selection-change="handleSelectionChange" + > + <el-table-column v-if="returnAndWatchState.ifShow === true" type="selection" width="55"/> + <el-table-column prop="materialName" label="物资名称" show-overflow-tooltip align="center"/> + <el-table-column prop="smdId" label="物资编号" show-overflow-tooltip align="center"/> + <el-table-column prop="materialStatus" label="物资状态" show-overflow-tooltip align="center"> + <template #default="scope"> + <span> + {{ filterMaterialStatus(scope.row.materialStatus) }} + </span> + </template> + </el-table-column> + <el-table-column prop="remark" label="备注" show-overflow-tooltip align="center"/> + <el-table-column label="操作" width="150" align="center"> + <template #default="scope"> + <el-button size="small" v-if="returnAndWatchState.ifShow === true" text type="danger" :icon="Delete" @click="invalidDeal(scope.row)">无效处理</el-button> + </template> + </el-table-column> + </el-table> + <div style="padding-top: 20px" align="center"> + <span> + <el-button type="primary" v-if="returnAndWatchState.ifShow === true" @click="returnConfirm" v-throttle size="default">归 还</el-button> + </span> + </div> + + </el-tab-pane> + <el-tab-pane label="已归还" name="return"> + <el-table + :data="returnAndWatchState.returnData" + border fit highlight-current-row lazy + :header-cell-style="{ background: '#fafafa' }" + style="width: 100%"> + <el-table-column prop="materialName" label="物资名称" show-overflow-tooltip align="center"/> + <el-table-column prop="smdId" label="物资编号" show-overflow-tooltip align="center"/> + <el-table-column prop="materialStatus" label="物资状态" show-overflow-tooltip align="center"> + <template #default="scope"> + <span> + {{ filterMaterialStatus(scope.row.materialStatus) }} + </span> + </template> + </el-table-column> + <el-table-column prop="remark" label="备注" show-overflow-tooltip align="center"/> + </el-table> + </el-tab-pane> + <el-tab-pane label="无效操作" name="Invalid"> + <el-table + :data="returnAndWatchState.invalidData" + border fit highlight-current-row lazy + :header-cell-style="{ background: '#fafafa' }" + style="width: 100%"> + <el-table-column prop="materialName" label="物资名称" show-overflow-tooltip align="center"/> + <el-table-column prop="smdId" label="物资编号" show-overflow-tooltip align="center"/> + <el-table-column prop="materialStatus" label="物资状态" show-overflow-tooltip align="center"> + <template #default="scope"> + <span> + {{ filterMaterialStatus(scope.row.materialStatus) }} + </span> + </template> + </el-table-column> + <el-table-column prop="remark" label="备注" show-overflow-tooltip align="center"/> + </el-table> + </el-tab-pane> + </el-tabs> + </el-dialog> + <invalid-deal-dialog ref="invalidDealDialogRef" @refreshInvalidDeal="refreshInvalidDeal"></invalid-deal-dialog> + </div> +</template> + +<script setup lang="ts"> +import {computed, nextTick, onMounted, reactive, ref, toRefs, watch} from 'vue' +import { Edit, Delete, } from '@element-plus/icons-vue'; +import { + claimReturnDataType, InvalidDealFormType, + materialType, + ReturnAndWatchType +} from "/@/views/facilityManagement/claimReturnRecords/index"; +import {ElMessage, ElMessageBox} from "element-plus"; +import {claimReturnRecordsApi} from "/@/api/facilityManagement/claimReturnRecords"; +import InvalidDealDialog from './invalidDealDialog.vue' + +const invalidDealDialogRef = ref() + +const returnAndWatchState = reactive<ReturnAndWatchType>({ + title: '', + ifShow: false, + goodsClassifyTitle: '', + showReturnAndWatchDialog: false, + activeName: 'noReturn', + goodsClassifyForm: { + id: null, + materialClassifyName: '', + parentId: null, + }, + goodsClassifyRules: { + + }, + returnData: [], + noReturnData: [], + invalidData: [], + returnFormList: { + receiveBaseId: null, + materialList: [] + }, + reasonList:[ + {id: 0, name:'完好'}, + {id: 1, name:'损坏'}, + {id: 2, name:'丢失'}, + {id: 3, name:'过期'}, + {id: 4, name:'其他'} + ] +}); + +const openReturnAndWatchDialog = (title: string, value: claimReturnDataType ) => { + returnAndWatchState.showReturnAndWatchDialog = true; + returnAndWatchState.returnFormList.receiveBaseId = value.id; + if(title === '归还'){ + returnAndWatchState.ifShow = true; + returnAndWatchState.title = '归还记录'; + returnAndWatchState.returnData = value.materialList.filter(item => item.revertStatus === 0); + returnAndWatchState.noReturnData = JSON.parse(JSON.stringify(value.materialList.filter(item => item.revertStatus === 1))); + returnAndWatchState.invalidData = value.materialList.filter(item => item.revertStatus !== 0 && item.revertStatus !== 1); + }else { + returnAndWatchState.ifShow = false; + returnAndWatchState.title = '查看物资'; + returnAndWatchState.returnData = value.materialList.filter(item => item.revertStatus === 0); + returnAndWatchState.noReturnData = value.materialList.filter(item => item.revertStatus === 1); + returnAndWatchState.invalidData = value.materialList.filter(item => item.revertStatus !== 0 && item.revertStatus !== 1); + } +}; + +const returnConfirm = () => { + if(returnAndWatchState.returnFormList.materialList.length > 0){ + ElMessageBox.confirm(`此操作将把所选中物资全部归还,是否继续?`, '提示', { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning' + }) + .then(async () => { + let res = await claimReturnRecordsApi().returnGoods(returnAndWatchState.returnFormList); + if (res.data.code === '200') { + ElMessage({ + type: 'success', + duration: 2000, + message: '物资归还成功' + }); + await refreshReturnTableData() + emit('refreshReturnData') + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }) + .catch(() => {}); + }else{ + ElMessage({ + type:'warning', + message: '请选择要归还的物资' + }) + } +}; + +const refreshReturnTableData = async () => { + let res = await claimReturnRecordsApi().refreshReturnAndNoReturn({id: returnAndWatchState.returnFormList.receiveBaseId}) + if(res.data.code === '200'){ + returnAndWatchState.returnData = res.data.data.materialList.filter((item: materialType) => item.revertStatus === 0); + returnAndWatchState.noReturnData = res.data.data.materialList.filter((item: materialType) => item.revertStatus === 1); + returnAndWatchState.invalidData = res.data.data.materialList.filter((item: materialType) => item.revertStatus !== 0 && item.revertStatus !== 1); + }else{ + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } +} + +const invalidDeal = (value: materialType) => { + invalidDealDialogRef.value.openInvalidDealDialog(value) +}; + +const refreshInvalidDeal = (value: InvalidDealFormType) => { + let returnDataNum = returnAndWatchState.noReturnData.findIndex(item => item.id == value.id) + returnAndWatchState.noReturnData[returnDataNum].materialStatus = value.reason as number + returnAndWatchState.noReturnData[returnDataNum].remark = value.remark as string + for(let i in returnAndWatchState.returnFormList.materialList){ + if(returnAndWatchState.returnFormList.materialList[i].receiveId === value.id){ + returnAndWatchState.returnFormList.materialList[i] = { + receiveId: value.id, + materialStatus: value.reason, + remark: value.remark, + } + } + } +} + +const handleSelectionChange = (val: materialType []) => { + returnAndWatchState.returnFormList.materialList = val.map((item: materialType) => { + return { + receiveId: item.id, + materialStatus: item.materialStatus, + remark: item.remark, + } + }) +}; + +const filterMaterialStatus = (value: number) => { + return returnAndWatchState.reasonList.find(item => item.id === value)?.name +} + +const emit = defineEmits(['refreshReturnData']); + +defineExpose({ + openReturnAndWatchDialog, +}); + + +</script> + +<style scoped> +/*:deep(.el-overlay .el-overlay-dialog .el-dialog .el-dialog__body) {*/ +/* padding-bottom: 20px !important;*/ +/*}*/ +:deep(.el-table .big-row) { + font-size: 16px !important; + font-weight: 700; +} + +</style> diff --git a/src/views/facilityManagement/claimReturnRecords/index.ts b/src/views/facilityManagement/claimReturnRecords/index.ts new file mode 100644 index 0000000..bd9130c --- /dev/null +++ b/src/views/facilityManagement/claimReturnRecords/index.ts @@ -0,0 +1,76 @@ +export interface ClaimReturnRecordsType { + tableLoading: boolean, + total: number, + timeValue: Array<string>, + claimReturnData: Array<claimReturnDataType> , + listQuery: { + pageSize: number, + pageIndex: number, + searchParams: { + materialName: string| null, + receiveUname: string | null, + endTime: string | null, + startTime: string | null, + } + }, +} + +export interface ReturnAndWatchType { + title: string, + ifShow: Boolean, + goodsClassifyTitle: string, + showReturnAndWatchDialog: boolean, + activeName: string, + goodsClassifyForm: { + id: null, + materialClassifyName: '', + parentId: null, + }, + goodsClassifyRules: { + + }, + returnData: materialType [], + noReturnData: materialType [], + invalidData: materialType [], + returnFormList: { + receiveBaseId: null | number, + materialList: returnFormListType [] , + }, + reasonList: Type [] +} + +export interface claimReturnDataType { + id: number, + materialList: materialType [], +} + +export interface materialType { + id: number, + materialStatus: number, + revertStatus: number, + remark: string | null, +} + +export interface returnFormListType { + receiveId: number, + materialStatus: number | null, + remark: string | null, +} + +export interface InvalidDealStateType { + title: string, + invalidDealDialogVisible: boolean, + invalidDealForm: InvalidDealFormType, + reasonList: Type [] +} + +export interface InvalidDealFormType { + id: number | null, + reason: number | null, + remark: string | null, +} + +export interface Type { + id: number, + name: string, +} diff --git a/src/views/facilityManagement/claimReturnRecords/index.vue b/src/views/facilityManagement/claimReturnRecords/index.vue new file mode 100644 index 0000000..e4cf148 --- /dev/null +++ b/src/views/facilityManagement/claimReturnRecords/index.vue @@ -0,0 +1,258 @@ +<template> + <div class="home-container"> + <div style="height: 100%"> + <el-row class="homeCard"> + <div class="basic-line"> + <span>领取时间:</span> + <el-date-picker + value-format="YYYY-MM-DD" + v-model="claimReturnRecordsState.timeValue" + type="daterange" + range-separator="To" + start-placeholder="开始时间" + end-placeholder="结束时间" + /> + </div> +<!-- <div class="basic-line">--> +<!-- <span>领取人:</span>--> +<!-- <el-input class="input-box2" v-model="claimReturnRecordsState.listQuery.searchParams.materialName" placeholder="领取人" clearable> </el-input>--> +<!-- </div>--> + <div> + <el-button size="large" type="primary" class="ml10" v-throttle @click="initClaimReturnData"> + <el-icon> + <ele-Search /> + </el-icon> + 查询 + </el-button> + </div> + </el-row> + <div class="homeCard"> + <div class="main-card"> + <el-table element-loading-text="Loading..." v-loading="claimReturnRecordsState.tableLoading" :data="claimReturnRecordsState.claimReturnData" style="width: 100%" height="calc(100% - 100px)" :header-cell-style="{ background: '#fafafa' }"> + <el-table-column type="index" label="序号" width="60" /> + <el-table-column prop="createTime" label="物资领取时间" show-overflow-tooltip></el-table-column> + <el-table-column prop="receiveUname" label="领取人" show-overflow-tooltip></el-table-column> + <el-table-column prop="materialName" label="物资" show-overflow-tooltip></el-table-column> + <el-table-column prop="receiveCount" label="领取数量" show-overflow-tooltip></el-table-column> + <el-table-column prop="revertCount" label="已归还数量" show-overflow-tooltip></el-table-column> + <el-table-column prop="statusName" label="归还情况" show-overflow-tooltip> + <template #default="scope"> + <el-tag :type="scope.row.status === 0 ? 'danger' : scope.row.status === 1 ? 'warning' : scope.row.status === 2 ? 'success' : ''"> + <span> + {{ scope.row.statusName }} + </span> + </el-tag> + </template> + </el-table-column> + <el-table-column label="操作" width="250" align="center"> + <template #default="scope"> + <el-button size="small" text type="success" @click="onOpenReturnGoodsDialog('归还', scope.row)">归还</el-button> + <el-button size="small" text type="primary" @click="onOpenReturnGoodsDialog('查看物资', scope.row)">查看物资</el-button> + </template> + </el-table-column> + </el-table> + <br /> + <el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" :pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="claimReturnRecordsState.listQuery.pageIndex" background v-model:page-size="claimReturnRecordsState.listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="claimReturnRecordsState.total" class="page-position"> </el-pagination> + </div> + </div> + </div> + <return-and-watch ref="returnAndWatchRef" @refreshReturnData="initClaimReturnData"></return-and-watch> + </div> +</template> + +<script setup lang="ts"> +import {onMounted, reactive, watch, ref} from "vue"; +import { + claimReturnDataType, + ClaimReturnRecordsType, + materialType +} from "/@/views/facilityManagement/claimReturnRecords/index"; +import {claimReturnRecordsApi} from "/@/api/facilityManagement/claimReturnRecords"; +import {ElMessage} from "element-plus"; +import ReturnAndWatch from "/@/views/facilityManagement/claimReturnRecords/components/returnAndWatch.vue"; + +const returnAndWatchRef = ref(); + +const claimReturnRecordsState = reactive<ClaimReturnRecordsType>({ + tableLoading: true, + total: 0, + timeValue: [], + claimReturnData: [], + listQuery: { + pageSize: 10, + pageIndex: 1, + searchParams: { + materialName: null, + receiveUname: null, + endTime: null, + startTime: null, + } + }, +}); + +watch(() => claimReturnRecordsState.timeValue, (newVal, oldVal) => { + claimReturnRecordsState.listQuery.searchParams.startTime = newVal?.[0] || null; + claimReturnRecordsState.listQuery.searchParams.endTime = newVal?.[1] || null; +}) + +const initClaimReturnData = async () => { + claimReturnRecordsState.tableLoading = true; + let res = await claimReturnRecordsApi().getClaimReturnRecords(claimReturnRecordsState.listQuery); + if(res.data.code === '200') { + claimReturnRecordsState.claimReturnData = res.data.data; + claimReturnRecordsState.total = res.data.total; + }else { + ElMessage({ + type:'warning', + message: res.data.msg + }); + } + claimReturnRecordsState.tableLoading = false; +}; + +const onOpenReturnGoodsDialog = (title: string, value: claimReturnDataType) => { + returnAndWatchRef.value.openReturnAndWatchDialog(title, value) +} + +const onHandleSizeChange = (val: number) => { + claimReturnRecordsState.listQuery.pageSize = val; + initClaimReturnData(); +}; + +const onHandleCurrentChange = (val: number) => { + claimReturnRecordsState.listQuery.pageIndex = val; + initClaimReturnData(); +}; + +onMounted(() => { + initClaimReturnData() +}) +</script> + +<style scoped lang="scss"> +$homeNavLengh: 8; +.home-container { + height: calc(100vh - 144px); + box-sizing: border-box; + overflow: hidden; +.homeCard { + width: 100%; + padding: 20px; + box-sizing: border-box; + background: #fff; + border-radius: 4px; + +.main-card { + width: 100%; + height: 100%; +.cardTop { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 20px; +.mainCardBtn { + margin: 0; +} +} +.pageBtn { + height: 60px; + display: flex; + align-items: center; + justify-content: right; + +.demo-pagination-block + .demo-pagination-block { + margin-top: 10px; +} +.demo-pagination-block .demonstration { + margin-bottom: 16px; +} +} +} +&:last-of-type { + height: calc(100% - 100px); + } +} +.el-row { + display: flex; + align-items: center; + margin-bottom: 20px; +&:last-child { + margin-bottom: 0; + } +.grid-content { + align-items: center; + min-height: 36px; +} + +.topInfo { + display: flex; + align-items: center; + font-size: 16px; + font-weight: bold; + +& > div { + white-space: nowrap; + margin-right: 20px; + } +} +} +} +.stepItem { + width: 100%; + display: flex; + align-items: flex-start; + margin-bottom: 30px; + margin-left: 30px; + padding-bottom: 30px; + border-left: 2px solid #ccc; +&:first-of-type { + margin-top: 30px; + } +&:last-of-type { + margin-bottom: 0; + border-left: none; + } +.stepNum { + width: 30px; + height: 30px; + border-radius: 15px; + box-sizing: border-box; + color: #333; + border: 1px solid #999; + line-height: 28px; + text-align: center; + margin-right: 10px; + margin-left: -16px; + margin-top: -30px; +} +.stepCard { + width: 100%; + margin-top: -30px; + +.box-card { + width: 100%; +&:deep(.el-card__header) { + padding: 10px 15px; + } +.card-header { + width: 100%; + display: flex; + justify-content: space-between; + align-items: center; +& > div:first-of-type { + margin-right: 80px; + font-size: 18px; + font-weight: bold; + } +} +} +} +&:hover .card-header { + color: #0098f5; + } +&:hover .stepNum { + border: 2px solid #0098f5; + color: #0098f5; + } +} +</style> diff --git a/src/views/facilityManagement/goodsDetailManage/components/checkOut.vue b/src/views/facilityManagement/goodsDetailManage/components/checkOut.vue index 3d16359..f839bda 100644 --- a/src/views/facilityManagement/goodsDetailManage/components/checkOut.vue +++ b/src/views/facilityManagement/goodsDetailManage/components/checkOut.vue @@ -16,8 +16,8 @@ </el-form-item> </el-col> <el-col :span="24" class="mb20"> - <el-form-item label="认领人:" prop="claimantId"> - <el-select class="input-add" v-model="checkOutState.checkOutForm.claimantId" placeholder="选择认领人"> + <el-form-item label="认领人:" prop="receiveUid"> + <el-select class="input-add" v-model="checkOutState.checkOutForm.receiveUid" placeholder="选择认领人"> <el-option v-for="item in checkOutState.userList" :key="item.uid" @@ -46,6 +46,7 @@ import {teamManageApi} from "/@/api/systemManage/basicDateManage/personShiftManage/teamManage"; import {ElMessage} from "element-plus/es"; import {goodsDetailApi} from "/@/api/facilityManagement/goodsDetailManage"; +import {useUserInfo} from "/@/stores/userInfo"; const checkOutState = reactive<checkOutStateType>({ title: '', @@ -54,7 +55,7 @@ materialName: '', checkOutForm: { id: null, - claimantId: null, + receiveUid: null, ids: [], }, userList: [], @@ -63,21 +64,23 @@ const openCheckOutDialog = (title: string, value: GoodsDetailDataType, ids:Array<number>, checkOutName: null | string) => { checkOutState.title = title; checkOutState.checkOutDialogVisible = true; - checkOutState.checkOutForm.claimantId = null; - getUserByDepartment(1 as number) + checkOutState.checkOutForm.receiveUid = null; + getUserByDepartment(useUserInfo().userInfos.depId as number) if(title === '单独出库'){ checkOutState.materialName = value.name as string checkOutState.checkOutForm.id = value.id; + delete checkOutState.checkOutForm.ids; }else{ checkOutState.materialName = checkOutName as string checkOutState.checkOutForm.ids = ids + delete checkOutState.checkOutForm.id; } } const submitCheckOutForm = async () => { - if(checkOutState.checkOutForm.claimantId === null){ + if(checkOutState.checkOutForm.receiveUid === null){ ElMessage({ type: 'warning', message: '请选择认领人' diff --git a/src/views/facilityManagement/goodsDetailManage/components/goodsDetailAdd.vue b/src/views/facilityManagement/goodsDetailManage/components/goodsDetailAdd.vue index 8004175..b95f332 100644 --- a/src/views/facilityManagement/goodsDetailManage/components/goodsDetailAdd.vue +++ b/src/views/facilityManagement/goodsDetailManage/components/goodsDetailAdd.vue @@ -13,22 +13,22 @@ <el-col :span="24" class="mb20"> <el-form-item label="选择物资" prop="smId"> <el-row :gutter="6"> - <el-col :span="8"> - <el-select - filterable - placeholder="请选择部门" - clearable - @change="changeDepartment" - v-model="goodsDetailAddState.depId"> - <el-option - v-for="item in goodsDetailAddState.departmentList" - :key="item.depId" - :value="item.depId" - :label="item.depName" - ></el-option> - </el-select> - </el-col> - <el-col :span="8"> +<!-- <el-col :span="8">--> +<!-- <el-select--> +<!-- filterable--> +<!-- placeholder="请选择部门"--> +<!-- clearable--> +<!-- @change="changeDepartment"--> +<!-- v-model="goodsDetailAddState.depId">--> +<!-- <el-option--> +<!-- v-for="item in goodsDetailAddState.departmentList"--> +<!-- :key="item.depId"--> +<!-- :value="item.depId"--> +<!-- :label="item.depName"--> +<!-- ></el-option>--> +<!-- </el-select>--> +<!-- </el-col>--> + <el-col :span="12"> <el-select v-model="goodsDetailAddState.classifyId" placeholder="选择分类" @change="changeClassify" filterable clearable> <el-option v-for="item in goodsDetailAddState.classifyList" @@ -38,7 +38,7 @@ ></el-option> </el-select> </el-col> - <el-col :span="8"> + <el-col :span="12"> <el-select v-model="goodsDetailAddState.goodsDetailForm.smId" placeholder="选择物资" filterable clearable> <el-option v-for="item in goodsDetailAddState.goodsList" @@ -130,8 +130,10 @@ import {ElMessage} from "element-plus/es"; import {goodsDetailApi} from "/@/api/facilityManagement/goodsDetailManage"; import {verifiyNumberInteger, verifyString} from "/@/utils/toolsValidate"; +import {useUserInfo} from "/@/stores/userInfo"; const goodsDetailFormRef = ref() +const userInfo = useUserInfo() const goodsDetailAddState = reactive<GoodsDetailAddType>({ title: '新增入库', @@ -174,8 +176,8 @@ setTimeout(() => { goodsDetailFormRef.value.clearValidate(); }); - goodsDetailAddState.startRfid = '' - goodsDetailAddState.endRfid = '' + goodsDetailAddState.startRfid = ''; + goodsDetailAddState.endRfid = ''; goodsDetailAddState.goodsDetailForm = { id: null, smId: null, @@ -184,18 +186,21 @@ startRfid: null, endRfid: null , wareHousingCount: null, - } + }; + goodsDetailAddState.classifyList = goodsDetailAddState.departmentList.find(item => item.depId === userInfo.userInfos.depId)?.classificationList as Array<ClassificationListType> } -const changeDepartment = (value: number | null) => { - goodsDetailAddState.classifyId = null - goodsDetailAddState.goodsDetailForm.smId = null - goodsDetailAddState.classifyList = goodsDetailAddState.departmentList.find(item => item.depId === value)?.classificationList as Array<ClassificationListType> -} +// const changeDepartment = (value: number | null) => { +// goodsDetailAddState.classifyId = null +// goodsDetailAddState.goodsDetailForm.smId = null +// goodsDetailAddState.classifyList = goodsDetailAddState.departmentList.find(item => item.depId === value)?.classificationList as Array<ClassificationListType> +// } const changeClassify = (value: number | null) => { goodsDetailAddState.goodsDetailForm.smId = null - goodsDetailAddState.goodsList = goodsDetailAddState.classifyList.find(item => item.materialClassifyId === value)?.baseMaterialList as Array<BaseMaterialListType> + goodsDetailAddState.goodsList = JSON.parse(JSON.stringify( + (goodsDetailAddState.classifyList.find(item => item.materialClassifyId === value) ?? {baseMaterialList:[]})?.baseMaterialList as Array<BaseMaterialListType> + )) } const submitGoodsDetail = () => { diff --git a/src/views/facilityManagement/goodsDetailManage/components/goodsDetailEdit.vue b/src/views/facilityManagement/goodsDetailManage/components/goodsDetailEdit.vue index 3fe4fd8..c684721 100644 --- a/src/views/facilityManagement/goodsDetailManage/components/goodsDetailEdit.vue +++ b/src/views/facilityManagement/goodsDetailManage/components/goodsDetailEdit.vue @@ -13,22 +13,22 @@ <el-col :span="24" class="mb20"> <el-form-item label="选择物资" prop="smId"> <el-row :gutter="6"> - <el-col :span="8"> - <el-select - filterable - placeholder="请选择部门" - clearable - @change="changeDepartment" - v-model="goodsDetailEditState.depId"> - <el-option - v-for="item in goodsDetailEditState.departmentList" - :key="item.depId" - :value="item.depId" - :label="item.depName" - ></el-option> - </el-select> - </el-col> - <el-col :span="8"> +<!-- <el-col :span="8">--> +<!-- <el-select--> +<!-- filterable--> +<!-- placeholder="请选择部门"--> +<!-- clearable--> +<!-- @change="changeDepartment"--> +<!-- v-model="goodsDetailEditState.depId">--> +<!-- <el-option--> +<!-- v-for="item in goodsDetailEditState.departmentList"--> +<!-- :key="item.depId"--> +<!-- :value="item.depId"--> +<!-- :label="item.depName"--> +<!-- ></el-option>--> +<!-- </el-select>--> +<!-- </el-col>--> + <el-col :span="12"> <el-select v-model="goodsDetailEditState.classifyId" placeholder="选择分类" @change="changeClassify" filterable clearable> <el-option v-for="item in goodsDetailEditState.classifyList" @@ -38,7 +38,7 @@ ></el-option> </el-select> </el-col> - <el-col :span="8"> + <el-col :span="12"> <el-select v-model="goodsDetailEditState.goodsDetailForm.smId" placeholder="选择物资" filterable clearable> <el-option v-for="item in goodsDetailEditState.goodsList" @@ -101,8 +101,10 @@ import {isValidKey} from "/@/views/facilityManagement/safetyGoodsAndEquipment/index"; import {ElMessage} from "element-plus/es"; import {goodsDetailApi} from "/@/api/facilityManagement/goodsDetailManage"; +import {useUserInfo} from "/@/stores/userInfo"; const goodsDetailFormRef = ref() +const userInfo = useUserInfo() const goodsDetailEditState = reactive<GoodsDetailEditType>({ title: '编辑', @@ -128,7 +130,6 @@ }) // watch(() => goodsDetailEditState.depId ,(newVal, oldVal) => { -// debugger // goodsDetailEditState.classify = null // goodsDetailEditState.goodsDetailForm.smId = null // goodsDetailEditState.classifyList = goodsDetailEditState.departmentList.find(item => item.depId === newVal)?.classificationList as Array<ClassificationListType> @@ -140,7 +141,7 @@ setTimeout(() => { goodsDetailFormRef.value.clearValidate(); }); - await changeDepartment(value.depId) + await changeDepartment(userInfo.userInfos.depId) await changeClassify(value.bigClassifyId) goodsDetailEditState.depId = value.depId goodsDetailEditState.classifyId = value.bigClassifyId @@ -156,7 +157,9 @@ const changeDepartment = (value: number | null) => { goodsDetailEditState.classifyId = null goodsDetailEditState.goodsDetailForm.smId = null - goodsDetailEditState.classifyList = goodsDetailEditState.departmentList.find(item => item.depId === value)?.classificationList as Array<ClassificationListType> + goodsDetailEditState.classifyList = JSON.parse(JSON.stringify( + (goodsDetailEditState.departmentList.find(item => item.depId === value) ?? {classificationList:[]})?.classificationList as Array<ClassificationListType> + )) } const changeClassify = (value: number | null) => { diff --git a/src/views/facilityManagement/goodsDetailManage/index.ts b/src/views/facilityManagement/goodsDetailManage/index.ts index 12aedfd..adde520 100644 --- a/src/views/facilityManagement/goodsDetailManage/index.ts +++ b/src/views/facilityManagement/goodsDetailManage/index.ts @@ -90,7 +90,7 @@ materialName: string; checkOutForm: { id?: null | number; - claimantId: null | number; + receiveUid: null | number; ids?: Array<number>; }; // checkOutMoreForm: { diff --git a/src/views/facilityManagement/goodsTypeManage/index.vue b/src/views/facilityManagement/goodsTypeManage/index.vue new file mode 100644 index 0000000..a994107 --- /dev/null +++ b/src/views/facilityManagement/goodsTypeManage/index.vue @@ -0,0 +1,435 @@ +<template> + <div class="home-container"> + <div style="height: 100%"> + <el-row class="homeCard"> + <div class="basic-line"> + </div> + <div class="basic-line"> + </div> + <div style="padding-bottom: 10px"> + <el-button size="default" type="primary" @click="onOpenGoodsClassifyDialog('新增', '')"> + <el-icon> + <ele-FolderAdd /> + </el-icon> + 新增分类 + </el-button> + </div> + </el-row> + <div class="homeCard"> + <div class="main-card"> + <el-table + :data="addGoodsState.goodsData" + style="width: 100%" + height="calc(100% - 100px)" + :header-cell-style="{ background: '#fafafa' }" + border + row-key="id" + :load="load" + :row-class-name="tableRowClassName" + :tree-props="{ children: 'childList', hasChildren: true }" + > + <el-table-column prop="materialClassifyName" label="分类名称" show-overflow-tooltip align="center"/> + <el-table-column prop="consumableName" label="是否耗材" show-overflow-tooltip align="center"/> + <el-table-column prop="materialClassifyName" label="类别" show-overflow-tooltip align="center"> + <template #default="scope"> + <div v-if="scope.row.parentId === 0">{{'分类名称'}}</div> + <div v-if="scope.row.parentId !== 0">{{'物资名称'}}</div> + </template> + </el-table-column> + <el-table-column label="操作" width="150" align="center"> + <template #default="scope"> + <el-button v-if="scope.row.parentId === 0" size="small" text type="primary" @click="onOpenGoodsClassifyDialog('新增物资', scope.row)"> + <el-icon> + <ele-FolderAdd /> + </el-icon> + 新增物资 + </el-button> + <el-button size="small" text type="primary" :icon="Edit" @click="onOpenGoodsClassifyDialog('编辑', scope.row)">编辑</el-button> + <el-button size="small" text type="danger" :icon="Delete" @click="deleteGoodsClassify(scope.row)">删除</el-button> + </template> + </el-table-column> + </el-table> + <br /> + <el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" :pager-count="5" :page-sizes="[5, 10, 20]" v-model:current-page="addGoodsState.listQuery.pageIndex" background v-model:page-size="addGoodsState.listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="addGoodsState.total" class="page-position" style="padding-top: 20px;"> </el-pagination> + </div> + </div> + </div> + <el-dialog :title="addGoodsState.goodsClassifyTitle" :close-on-click-modal="false" v-model="addGoodsState.showAddGoodsClassifyDialog" width="30%"> + <el-form + :model="addGoodsState.goodsClassifyForm" + :rules="addGoodsState.goodsClassifyRules" + ref="goodsClassifyRef" + size="default" + label-width="120px"> + <el-row> + <el-col :span="24" class="mb20" v-if="!addGoodsState.goodsClassifyForm.parentId"> + <el-form-item label="分类名称" prop="materialClassifyName"> + <el-input v-model="addGoodsState.goodsClassifyForm.materialClassifyName" placeholder="输入分类名称" class="input-add"> + </el-input> + </el-form-item> + </el-col> + <el-col :span="24" class="mb20" v-if="addGoodsState.goodsClassifyForm.parentId"> + <el-form-item label="物资名称" prop="materialClassifyName"> + <el-input v-model="addGoodsState.goodsClassifyForm.materialClassifyName" placeholder="输入物资名称" class="input-add"> + </el-input> + </el-form-item> + </el-col> + <el-col :span="24" class="mb20" v-if="addGoodsState.goodsClassifyForm.parentId"> + <el-form-item label="是否耗材" prop="consumable"> + <el-select class="input-add" v-model="addGoodsState.goodsClassifyForm.consumable" placeholder="是否耗材" clearable filterable> + <el-option + v-for="item in addGoodsState.consumableList" + :key="item.id" + :value="item.id" + :label="item.name" + > + </el-option> + </el-select> + </el-form-item> + </el-col> + </el-row> + </el-form> + <template #footer> + <span class="dialog-footer"> + <el-button @click="addGoodsState.showAddGoodsClassifyDialog = !addGoodsState.showAddGoodsClassifyDialog" size="default">取 消</el-button> + <el-button type="primary" @click="submitGoodsClassify" v-throttle size="default">确 定</el-button> + </span> + </template> + </el-dialog> + </div> +</template> + +<script setup lang="ts"> +import {computed, nextTick, onMounted, reactive, ref, watch} from 'vue' +import { Edit, Delete, } from '@element-plus/icons-vue'; +import {AddGoodsStateType, BigClassifyType} from "/@/views/facilityManagement/safetyGoodsAndEquipment/index"; +import {mount} from "sortablejs"; +import {goodsAndEquipmentApi} from "/@/api/facilityManagement/safetyGoodsAndEquipment"; +import {ElMessage, valueEquals} from "element-plus/es"; +import {ElMessageBox} from "element-plus"; +import {inspectTaskApi} from "/@/api/intellectInspectSystem/inspectTask"; + +const addGoodsState = reactive<AddGoodsStateType>({ + title:'', + goodsClassifyTitle:'', + showAddGoodsDialog: false, + showAddGoodsClassifyDialog: false, + activeName: 'goodsInformation', + goodsData: [], + goodsBigClassifyList: [], + consumableList: [ + {id: 0, name: '是'}, + {id: 1, name: '否'}, + ], + total:0, + listQuery:{ + pageSize: 10, + pageIndex: 1, + searchParams: { + classifyName:'' + } + }, + goodsClassifyForm: { + id: null, + materialClassifyName: '', + parentId: null, + consumable: null, + }, + goodsClassifyRules: { + + }, +}); + +const openAddGoodsDialog = (goodsBigClassifyList: BigClassifyType []) => { + addGoodsState.showAddGoodsDialog = true + addGoodsState.goodsBigClassifyList = goodsBigClassifyList + getGoodsClassifyDataByPage() +} + +const onOpenGoodsClassifyDialog = (title: string, value:BigClassifyType ) => { + addGoodsState.showAddGoodsClassifyDialog = true + addGoodsState.goodsClassifyForm = { + id: null, + materialClassifyName: '', + parentId: null, + } + if(title === '新增') { + addGoodsState.goodsClassifyTitle = '新增分类' + }else if(title === '新增物资'){ + addGoodsState.goodsClassifyTitle = `新增${value.materialClassifyName}` + addGoodsState.goodsClassifyForm.parentId = value.id + } else if(title === '编辑' && value.parentId === 0){ + addGoodsState.goodsClassifyTitle = '编辑分类' + addGoodsState.goodsClassifyForm = { + id: value.id, + materialClassifyName: value.materialClassifyName, + consumable: null, + parentId: null, + } + }else { + addGoodsState.goodsClassifyTitle = `编辑${addGoodsState.goodsBigClassifyList.find(item => item.id === value.parentId)?.materialClassifyName as string}` + addGoodsState.goodsClassifyForm.parentId = addGoodsState.goodsBigClassifyList.find(item => item.id === value.parentId)?.id as number + addGoodsState.goodsClassifyForm.materialClassifyName = value.materialClassifyName + addGoodsState.goodsClassifyForm.consumable = value.consumable + addGoodsState.goodsClassifyForm.id = value.id + } +} + +const submitGoodsClassify = async () => { + if(addGoodsState.goodsClassifyTitle.substring(0,2) === '新增'){ + let res = await goodsAndEquipmentApi().addGoodsClassify(addGoodsState.goodsClassifyForm); + if(res.data.code === '200'){ + addGoodsState.showAddGoodsClassifyDialog = false; + await getGoodsClassifyDataByPage(); + ElMessage({ + type: 'success', + message: '新增成功', + duration: 2000 + }); + }else{ + ElMessage({ + type:'warning', + message:res.data.msg + }) + } + }else{ + let res = await goodsAndEquipmentApi().updateGoodsClassify(addGoodsState.goodsClassifyForm); + if(res.data.code === '200'){ + addGoodsState.showAddGoodsClassifyDialog = false; + await getGoodsClassifyDataByPage(); + emit('refreshClassify') + ElMessage({ + type: 'success', + message: '编辑成功', + duration: 2000 + }); + }else{ + ElMessage({ + type:'warning', + message:res.data.msg + }) + } + } +}; + +const deleteGoodsClassify = (row: BigClassifyType) => { + ElMessageBox.confirm(`此操作将永久删除该:“${row.materialClassifyName}”,是否继续?`, '提示', { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning' + }) + .then(async () => { + let res = await goodsAndEquipmentApi().deleteGoodsClassify({ id: row.id }); + if (res.data.code === '200') { + ElMessage({ + type: 'success', + duration: 2000, + message: '删除成功' + }); + await getGoodsClassifyDataByPage(); + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }) + .catch(() => {}); +}; + +const getGoodsClassifyDataByPage = async () => { + let res = await goodsAndEquipmentApi().getAllSafetyEquipmentByPage(addGoodsState.listQuery); + if(res.data.code === '200'){ + addGoodsState.goodsData = res.data.data + addGoodsState.total = res.data.total + }else{ + ElMessage({ + message:res.data.msg, + type:'warning' + }) + } +} + +const getAllSafetyEquipmentList = async () => { + let res = await goodsAndEquipmentApi().getAllSafetyEquipment(); + if(res.data.code === '200'){ + addGoodsState.goodsBigClassifyList = JSON.parse(JSON.stringify(res.data.data)) + }else{ + ElMessage({ + message:res.data.msg, + type:'warning' + }) + } +} + +const tableRowClassName = ( row: {rowIndex: number, row: BigClassifyType } ) => { + if (row.row.parentId === 0) { + return 'big-row'; + } else{ + return 'small-row'; + } +} + +const onHandleSizeChange = (val: number) => { + addGoodsState.listQuery.pageSize = val + getGoodsClassifyDataByPage() +} + +const onHandleCurrentChange = (val: number) => { + addGoodsState.listQuery.pageIndex = val + getGoodsClassifyDataByPage() +} + +const load = ( + row: BigClassifyType, + treeNode: unknown, + resolve: (date: BigClassifyType[]) => void +) => { + setTimeout(() => { + resolve([]) + }, 1000) +} + +const emit = defineEmits(['refreshClassify']) + +defineExpose({ + openAddGoodsDialog, +}); + +onMounted( () => { + getGoodsClassifyDataByPage(); + getAllSafetyEquipmentList(); +}) +</script> + +<style scoped lang="scss"> +$homeNavLengh: 8; +.home-container { + height: calc(100vh - 144px); + box-sizing: border-box; + overflow: hidden; + .homeCard { + width: 100%; + padding: 20px; + box-sizing: border-box; + background: #fff; + border-radius: 4px; + + .main-card { + width: 100%; + height: 100%; + .cardTop { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 20px; + .mainCardBtn { + margin: 0; + } + } + .pageBtn { + height: 60px; + display: flex; + align-items: center; + justify-content: right; + + .demo-pagination-block + .demo-pagination-block { + margin-top: 10px; + } + .demo-pagination-block .demonstration { + margin-bottom: 16px; + } + } + } + &:last-of-type { + height: calc(100% - 100px); + } + } + .el-row { + display: flex; + align-items: center; + margin-bottom: 20px; + &:last-child { + margin-bottom: 0; + } + .grid-content { + align-items: center; + min-height: 36px; + } + + .topInfo { + display: flex; + align-items: center; + font-size: 16px; + font-weight: bold; + + & > div { + white-space: nowrap; + margin-right: 20px; + } + } + } +} +.stepItem { + width: 100%; + display: flex; + align-items: flex-start; + margin-bottom: 30px; + margin-left: 30px; + padding-bottom: 30px; + border-left: 2px solid #ccc; + &:first-of-type { + margin-top: 30px; + } + &:last-of-type { + margin-bottom: 0; + border-left: none; + } + .stepNum { + width: 30px; + height: 30px; + border-radius: 15px; + box-sizing: border-box; + color: #333; + border: 1px solid #999; + line-height: 28px; + text-align: center; + margin-right: 10px; + margin-left: -16px; + margin-top: -30px; + } + .stepCard { + width: 100%; + margin-top: -30px; + + .box-card { + width: 100%; + &:deep(.el-card__header) { + padding: 10px 15px; + } + .card-header { + width: 100%; + display: flex; + justify-content: space-between; + align-items: center; + & > div:first-of-type { + margin-right: 80px; + font-size: 18px; + font-weight: bold; + } + } + } + } + &:hover .card-header { + color: #0098f5; + } + &:hover .stepNum { + border: 2px solid #0098f5; + color: #0098f5; + } +} +:deep(.el-table .big-row) { + font-size: 16px !important; + font-weight: 700; +} +</style> diff --git a/src/views/facilityManagement/safetyGoodsAndEquipment/components/addGoodsDialog.vue b/src/views/facilityManagement/safetyGoodsAndEquipment/components/addGoodsDialog.vue index eb05a5f..55a5571 100644 --- a/src/views/facilityManagement/safetyGoodsAndEquipment/components/addGoodsDialog.vue +++ b/src/views/facilityManagement/safetyGoodsAndEquipment/components/addGoodsDialog.vue @@ -168,6 +168,7 @@ if(res.data.code === '200'){ addGoodsState.showAddGoodsClassifyDialog = false; await getGoodsClassifyDataByPage(); + emit('refreshClassify') ElMessage({ type: 'success', message: '编辑成功', @@ -248,6 +249,8 @@ }, 1000) } +const emit = defineEmits(['refreshClassify']) + defineExpose({ openAddGoodsDialog, }); diff --git a/src/views/facilityManagement/safetyGoodsAndEquipment/components/batchInStorage.vue b/src/views/facilityManagement/safetyGoodsAndEquipment/components/batchInStorage.vue index 1274271..a6d17da 100644 --- a/src/views/facilityManagement/safetyGoodsAndEquipment/components/batchInStorage.vue +++ b/src/views/facilityManagement/safetyGoodsAndEquipment/components/batchInStorage.vue @@ -40,8 +40,9 @@ <el-form-item label="有效期至:" prop="validTime"> <el-date-picker v-model="batchInStorageState.inStorageData.validTime" - format="YYYY-MM-DD" - value-format="YYYY-MM-DD" + type="datetime" + format="YYYY-MM-DD HH:mm:ss" + value-format="YYYY-MM-DD HH:mm:ss" placeholder="选择日期时间" style="width: 90%" /> </el-form-item> @@ -94,9 +95,9 @@ } const submitInStorageData = () => { + batchInStorageState.loading = true; inStorageDataRef.value.validate(async (valid: boolean) => { if(valid){ - batchInStorageState.loading = true; let res = await goodsAndEquipmentApi().batchInStorageGoods(batchInStorageState.inStorageData); if(res.data.code === '200'){ batchInStorageState.batchInStorageDialogVisible = false; @@ -112,7 +113,6 @@ message:res.data.msg }); } - batchInStorageState.loading = false }else{ ElMessage({ type: 'warning', @@ -120,6 +120,7 @@ }); } }); + batchInStorageState.loading = false; }; const emit = defineEmits(['refreshData',]); diff --git a/src/views/facilityManagement/safetyGoodsAndEquipment/components/batchOutStorage.vue b/src/views/facilityManagement/safetyGoodsAndEquipment/components/batchOutStorage.vue index b1e4873..235beb3 100644 --- a/src/views/facilityManagement/safetyGoodsAndEquipment/components/batchOutStorage.vue +++ b/src/views/facilityManagement/safetyGoodsAndEquipment/components/batchOutStorage.vue @@ -29,8 +29,8 @@ </el-form-item> </el-col> <el-col :span="24" class="mb20"> - <el-form-item label="认领人:" prop="claimantId"> - <el-select class="input-add" v-model="batchOutStorageState.outStorageData.claimantId" placeholder="选择认领人"> + <el-form-item label="认领人:" prop="receiveUid"> + <el-select class="input-add" v-model="batchOutStorageState.outStorageData.receiveUid" placeholder="选择认领人"> <el-option v-for="item in batchOutStorageState.userList" :key="item.uid" @@ -70,12 +70,12 @@ outStorageData:{ smId: null, count: null, - claimantId: null, + receiveUid: null, rfid: null, }, outStorageDataRules: { count: [{ required: true, message: '请填写出库数量', trigger: 'blur' }], - claimantId: [{ required: true, message: '请选择认领人', trigger: 'change' }], + receiveUid: [{ required: true, message: '请选择认领人', trigger: 'change' }], }, userList: [], }) @@ -87,9 +87,9 @@ } const submitOutStorageData = () => { + batchOutStorageState.loading = true; outStorageDataRef.value.validate(async (valid: boolean) => { if(valid){ - batchOutStorageState.loading = true; let res = await goodsAndEquipmentApi().batchOutStorageGoods(batchOutStorageState.outStorageData); if(res.data.code === '200'){ batchOutStorageState.batchOutStorageDialogVisible = false; @@ -105,7 +105,6 @@ message:res.data.msg }); } - batchOutStorageState.loading = false }else{ ElMessage({ type: 'warning', @@ -113,6 +112,7 @@ }); } }); + batchOutStorageState.loading = false }; const emit = defineEmits(['refreshData',]); diff --git a/src/views/facilityManagement/safetyGoodsAndEquipment/components/safetyGoodsAndEquipmentDialog.vue b/src/views/facilityManagement/safetyGoodsAndEquipment/components/safetyGoodsAndEquipmentDialog.vue index 4ace281..54fc08e 100644 --- a/src/views/facilityManagement/safetyGoodsAndEquipment/components/safetyGoodsAndEquipmentDialog.vue +++ b/src/views/facilityManagement/safetyGoodsAndEquipment/components/safetyGoodsAndEquipmentDialog.vue @@ -10,7 +10,7 @@ element-loading-text="Loading..." label-width="120px"> <el-row> - <el-col :span="18" class="mb20"> + <el-col :span="24" class="mb20"> <el-form-item label="物资大类" prop="bigClassifyId"> <el-select v-model="dialogState.safetyGoodsAndEquipmentForm.bigClassifyId" @change="changeSmallClassify(null)" placeholder="物资大类" class="input-add"> <el-option @@ -22,10 +22,9 @@ </el-select> </el-form-item> </el-col> - <el-col :span="5"> - <el-button type="primary" @click="openAddGoods">添加物资</el-button> - </el-col> - +<!-- <el-col :span="5">--> +<!-- <el-button type="primary" @click="openAddGoods">添加物资</el-button>--> +<!-- </el-col>--> <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> <el-form-item label="物资小类" prop="smallClassifyId"> <el-select class="input-add" v-model="dialogState.safetyGoodsAndEquipmentForm.smallClassifyId" placeholder="请先选择物资大类"> @@ -42,6 +41,7 @@ <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> <el-form-item label="部门" prop="depId"> <el-cascader + :disabled="true" :options="dialogState.departmentList" :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" placeholder="请选择部门" @@ -51,19 +51,19 @@ </el-cascader> </el-form-item> </el-col> - <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> - <el-form-item label="是否耗材" prop="consumable"> - <el-select class="input-add" v-model="dialogState.safetyGoodsAndEquipmentForm.consumable" placeholder="是否耗材" clearable filterable> - <el-option - v-for="item in dialogState.consumableList" - :key="item.id" - :value="item.id" - :label="item.name" - > - </el-option> - </el-select> - </el-form-item> - </el-col> +<!-- <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">--> +<!-- <el-form-item label="是否耗材" prop="consumable">--> +<!-- <el-select class="input-add" v-model="dialogState.safetyGoodsAndEquipmentForm.consumable" placeholder="是否耗材" clearable filterable>--> +<!-- <el-option--> +<!-- v-for="item in dialogState.consumableList"--> +<!-- :key="item.id"--> +<!-- :value="item.id"--> +<!-- :label="item.name"--> +<!-- >--> +<!-- </el-option>--> +<!-- </el-select>--> +<!-- </el-form-item>--> +<!-- </el-col>--> </el-row> </el-form> <template #footer> @@ -73,7 +73,7 @@ </span> </template> </el-dialog> - <add-goods-dialog ref="addGoodsDialogRef"></add-goods-dialog> + <add-goods-dialog ref="addGoodsDialogRef" @refreshClassify="getAllSafetyEquipmentList"></add-goods-dialog> </div> </template> @@ -88,9 +88,11 @@ import { goodsAndEquipmentApi } from "/@/api/facilityManagement/safetyGoodsAndEquipment"; import {ElMessage} from "element-plus"; import AddGoodsDialog from "./addGoodsDialog.vue"; +import {useUserInfo} from "/@/stores/userInfo"; const safetyGoodsAndEquipmentRef = ref(); -const addGoodsDialogRef = ref() +const addGoodsDialogRef = ref(); +const userInfo = useUserInfo() const dialogState = reactive<SafetyGoodsAndEquipmentDialogStateType>({ safetyGoodsAndEquipmentForm: { @@ -98,13 +100,13 @@ bigClassifyId: null, smallClassifyId: null, depId: null, - consumable: null, + // consumable: null, }, safetyGoodsAndEquipmentRules: { bigClassifyId: [{ required: true, message: '请选择物资大类', trigger: 'change' }], smallClassifyId: [{ required: true, message: '请选择物资小类', trigger: 'change' }], - depId: [{ required: true, message: '请选择部门', trigger: 'change' }], - consumable: [{ required: true, message: '请选择是否耗材', trigger: 'change' }], + // depId: [{ required: true, message: '请选择部门', trigger: 'change' }], + // consumable: [{ required: true, message: '请选择是否耗材', trigger: 'change' }], }, showSafetyGoodsAndEquipmentDialog: false, title: '', @@ -123,9 +125,9 @@ },); -const openAddGoods = () => { - addGoodsDialogRef.value.openAddGoodsDialog(dialogState.goodsBigClassifyList) -} +// const openAddGoods = () => { +// addGoodsDialogRef.value.openAddGoodsDialog(dialogState.goodsBigClassifyList) +// } const openSafetyGoodsAndEquipmentDialog = (title: string, value: safetyGoodsAndEquipmentFormType, goodsBigClassifyList: BigClassifyType [], departmentList : DepartmentType []) => { @@ -137,9 +139,12 @@ id: null, bigClassifyId: null, smallClassifyId: null, - depId: null, - consumable: null, + depId: userInfo.userInfos.depId, + // consumable: null, }; + nextTick( () => { + safetyGoodsAndEquipmentRef.value.clearValidate(); + }) if(title === '新增') { dialogState.title = '新增' }else { @@ -206,6 +211,18 @@ }) }; +const getAllSafetyEquipmentList = async () => { + let res = await goodsAndEquipmentApi().getAllSafetyEquipment(); + if(res.data.code === '200'){ + dialogState.goodsBigClassifyList = res.data.data + }else{ + ElMessage({ + message:res.data.msg, + type:'warning' + }) + } +}; + const emit = defineEmits(['refreshData',]) defineExpose({ diff --git a/src/views/facilityManagement/safetyGoodsAndEquipment/index.ts b/src/views/facilityManagement/safetyGoodsAndEquipment/index.ts index 3772b41..63748a4 100644 --- a/src/views/facilityManagement/safetyGoodsAndEquipment/index.ts +++ b/src/views/facilityManagement/safetyGoodsAndEquipment/index.ts @@ -36,6 +36,7 @@ activeName: string; goodsData: BigClassifyType []; goodsBigClassifyList: BigClassifyType []; + consumableList?: Type []; total: number; listQuery: { pageSize: number; @@ -48,6 +49,7 @@ id: null | number; materialClassifyName: string; parentId: number | null; + consumable?: number | null; }; goodsClassifyRules: { @@ -78,7 +80,7 @@ outStorageData: { smId: null | number, count: null | number, - claimantId: null | number, + receiveUid: null | number, rfid: null | string, }; outStorageDataRules: { @@ -96,7 +98,7 @@ bigClassifyId: null | number, smallClassifyId: null | number, depId: null | number, - consumable: null | number, + // consumable: null | number, } export type DataType = { @@ -119,6 +121,7 @@ export type BigClassifyType = { id: number; materialClassifyName: string; + consumable?: number | null; parentId?: number; childList?: BigClassifyType []; } diff --git a/src/views/facilityManagement/safetyGoodsAndEquipment/index.vue b/src/views/facilityManagement/safetyGoodsAndEquipment/index.vue index d47495a..a2ba323 100644 --- a/src/views/facilityManagement/safetyGoodsAndEquipment/index.vue +++ b/src/views/facilityManagement/safetyGoodsAndEquipment/index.vue @@ -2,15 +2,21 @@ <div class="home-container"> <div style="height: 100%"> <el-row class="homeCard"> -<!-- <div class="basic-line">--> -<!-- <span>设备区域名称:</span>--> -<!-- <el-input class="input-box" v-model="tableData.listQuery.regionName" placeholder="设备区域名称" clearable> </el-input>--> -<!-- </div>--> -<!-- <div class="basic-line">--> -<!-- <span>设备区域类型:</span>--> -<!-- <el-select class="input-box" v-model="tableData.listQuery.regionTypeId" placeholder="设备区域类型" filterable>--> -<!-- </el-select>--> -<!-- </div>--> + <div class="basic-line"> + <span>分类名称:</span> + <el-select class="input-box" v-model="tableData.listQuery.searchParams.bigClassifyId" placeholder="分类名称" filterable> + <el-option + v-for="item in tableData.goodsBigClassifyList" + :key="item.id" + :value="item.id" + :label="item.materialClassifyName" + ></el-option> + </el-select> + </div> + <div class="basic-line"> + <span>物资名称:</span> + <el-input class="input-box" v-model="tableData.listQuery.searchParams.materialName" placeholder="物资名称" clearable> </el-input> + </div> <div style="padding-bottom: 10px"> <el-button size="large" type="primary" class="ml10" v-throttle @click="refreshGoodsAndEquipmentData"> <el-icon> @@ -24,9 +30,9 @@ </el-icon> 新增 </el-button> - <el-button size="large" class="ml10" @click="openAddGoods()"> - 管理分类 - </el-button> +<!-- <el-button size="large" class="ml10" @click="openAddGoods()">--> +<!-- 管理分类--> +<!-- </el-button>--> </div> </el-row> <div class="homeCard"> @@ -38,7 +44,7 @@ <el-table-column prop="serialNum" label="序列号" show-overflow-tooltip></el-table-column> <el-table-column prop="depName" label="部门名称" show-overflow-tooltip></el-table-column> <el-table-column prop="consumableName" label="是否是耗材" show-overflow-tooltip></el-table-column> - <el-table-column prop="validStockCount" label="库存" show-overflow-tooltip></el-table-column> + <el-table-column prop="stockCount" label="库存" show-overflow-tooltip></el-table-column> <el-table-column label="操作" width="250" align="center"> <template #default="scope"> <el-button size="small" text type="success" :icon="Edit" @click="openBatchInStorage('批量入库', scope.row)">批量入库</el-button> @@ -57,7 +63,7 @@ <safety-goods-and-equipment-dialog ref="safetyGoodsAndEquipmentDialogRef" @refreshData="refreshGoodsAndEquipmentData"></safety-goods-and-equipment-dialog> <batch-out-storage ref="batchOutStorageRef" @refreshData="refreshGoodsAndEquipmentData"></batch-out-storage> <batch-in-storage ref="batchInStorageRef" @refreshData="refreshGoodsAndEquipmentData"></batch-in-storage> - <add-goods-dialog ref="addGoodsDialogRef"></add-goods-dialog> + <add-goods-dialog ref="addGoodsDialogRef" @refreshClassify="getAllSafetyEquipmentList"></add-goods-dialog> </div> </template> @@ -119,9 +125,9 @@ batchOutStorageRef.value.openBatchOutStorageDialog(value) } -const openAddGoods = () => { - addGoodsDialogRef.value.openAddGoodsDialog(tableData.goodsBigClassifyList) -} +// const openAddGoods = () => { +// addGoodsDialogRef.value.openAddGoodsDialog(tableData.goodsBigClassifyList) +// } const linkToGoodsDetail = (title: string, value: DataType) => { router.push({ path: '/goodsDetailManage', query:{ id: value.id } }); @@ -169,7 +175,7 @@ const getAllSafetyEquipmentList = async () => { let res = await goodsAndEquipmentApi().getAllSafetyEquipment(); if(res.data.code === '200'){ - tableData.goodsBigClassifyList = res.data.data + tableData.goodsBigClassifyList = JSON.parse(JSON.stringify(res.data.data)) }else{ ElMessage({ message:res.data.msg, @@ -323,4 +329,15 @@ color: #0098f5; } } + +:deep(.el-textarea.is-disabled .el-textarea__inner) { + background-color: var(--el-card-bg-color); + color: var(--el-input-text-color, var(--el-text-color-regular)); +} +:deep(.el-input.is-disabled .el-input__inner) { + color: var(--el-input-text-color, var(--el-text-color-regular)); +} +:deep(.el-input.is-disabled .el-input__wrapper) { + background-color: var(--el-card-bg-color); +} </style> diff --git a/src/views/loginPage/component/accountLogin.vue b/src/views/loginPage/component/accountLogin.vue index bcbe021..167d6b1 100644 --- a/src/views/loginPage/component/accountLogin.vue +++ b/src/views/loginPage/component/accountLogin.vue @@ -193,6 +193,7 @@ Cookies.set('token', res.data.data.accessToken); Cookies.set('projectId', ''); Cookies.set('uid', res.data.data.uid); + Cookies.set('depId', res.data.data.depId); // Session.set('token', res.data.data.accessToken); // Session.set('projectId', ''); // Session.set('uid', res.data.data.uid); -- Gitblit v1.9.2