| | |
| | | params: params |
| | | }) |
| | | } |
| | | |
| | | export function getProList(params) { |
| | | return request({ |
| | | url: '/product/productCollect', |
| | | method: 'get', |
| | | params: params |
| | | }) |
| | | } |
| | | |
| | | export function disCardPro(data) { |
| | | return request({ |
| | | url: '/product/productDiscard/' + data, |
| | | method: 'post', |
| | | }) |
| | | } |
| | | |
| | | |
| | | export function getAllProFlow(params) { |
| | | return request({ |
| | | url: '/product-flow/getAllProductFlowByProductId', |
| | | method: 'get', |
| | | params: params |
| | | }) |
| | | } |
| | | |
| | | export function getFlowByCode(params) { |
| | | return request({ |
| | | url: '/hazmat-flow/getHazmatFlowByCode', |
| | | method: 'get', |
| | | params: params |
| | | }) |
| | | } |
| | |
| | | params: params |
| | | }) |
| | | } |
| | | |
| | | |
| | | export function getRawFlow(params) { |
| | | return request({ |
| | | url: '/hazmat-flow/list', |
| | | method: 'get', |
| | | params: params |
| | | }) |
| | | } |
| | | |
| | | export function getRawList(params) { |
| | | return request({ |
| | | url: '/hazmat/hazmatCollect', |
| | | method: 'get', |
| | | params: params |
| | | }) |
| | | } |
| | | |
| | | export function disCardRaw(data) { |
| | | return request({ |
| | | url: '/hazmat/hazmatDiscard/' + data, |
| | | method: 'post', |
| | | }) |
| | | } |
| | | |
| | | export function getAllRawFlow(params) { |
| | | return request({ |
| | | url: '/hazmat-flow/getAllHazmatFlowByHazmatId', |
| | | method: 'get', |
| | | params: params |
| | | }) |
| | | } |
| | | |
| | | export function getAllRawFlowByFlowId(params) { |
| | | return request({ |
| | | url: '/hazmat-flow/getAllHazmatFlowById', |
| | | method: 'get', |
| | | params: params |
| | | }) |
| | | } |
| | | |
| | | |
对比新文件 |
| | |
| | | <template> |
| | | <div class="notice"> |
| | | <div v-if="state.dataList.length>0"> |
| | | <div class="title"> |
| | | <span style="margin-right: 5px">{{state.form.name}}( {{state.form.productSn}} )</span> |
| | | <span>二维码识别号:{{state.form.code}} </span> |
| | | </div> |
| | | <div class="content" > |
| | | <el-timeline style="max-width: 600px"> |
| | | <el-timeline-item |
| | | v-for="(item, index) in state.dataList" |
| | | :key="index" |
| | | :icon="item.icon" |
| | | :type="item.type" |
| | | :color="item.color" |
| | | :size="item.size" |
| | | :hollow="item.hollow" |
| | | > |
| | | {{ item.description }} |
| | | <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> |
| | | </el-timeline> |
| | | </div> |
| | | </div> |
| | | <div v-else> |
| | | <el-empty description="暂无数据" /> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <script setup> |
| | | import {onUnmounted, reactive, ref, toRefs} from 'vue' |
| | | import {getAllRawFlow, getRawFlow} from "@/api/hazardousChemicals/rawRecord"; |
| | | import {ElMessage} from "element-plus"; |
| | | import {getAllProFlow, getFlowByCode} from "@/api/hazardousChemicals/productRecord"; |
| | | import { MoreFilled } from '@element-plus/icons-vue' |
| | | const busRef = ref(); |
| | | const length = ref() |
| | | const title = ref('') |
| | | const state = reactive({ |
| | | form: { |
| | | id: '', |
| | | name: '', |
| | | productSn: '', |
| | | code: '' |
| | | }, |
| | | dataList: [], |
| | | active: null |
| | | }) |
| | | |
| | | |
| | | const openDialog = async (type, value) => { |
| | | title.value = type; |
| | | if(type === 'code'){ |
| | | state.form.code = value |
| | | }else { |
| | | state.form = value |
| | | } |
| | | |
| | | await getAllFlow() |
| | | } |
| | | |
| | | const getAllFlow = async () => { |
| | | if(title.value == 'pro' || title.value =='proRecord'){ |
| | | let param = {} |
| | | if(title.value == 'pro'){ |
| | | param = { |
| | | productId: state.form.id |
| | | } |
| | | }else { |
| | | param = { |
| | | productId: state.form.productId |
| | | } |
| | | } |
| | | const res = await getAllProFlow(param) |
| | | if(res.code == 200){ |
| | | if(res.data && res.data.length>0) { |
| | | state.dataList = res.data.map(item => { |
| | | return { |
| | | ...item, |
| | | unit: item.productBasic.unit, |
| | | description: `${item.updateTime} ${item.user.departName}部门 ${item.user.name} 进行了 ${item.state == 0 ? '批量导入' : item.state == 3 ? '标签作废' : '销售'}`, |
| | | size: 'large', |
| | | type: 'primary', |
| | | icon: MoreFilled, |
| | | } |
| | | }) |
| | | state.form.name = res.data[0].productBasic.name |
| | | state.form.productSn = res.data[0].productBasic.productSn |
| | | state.form.code = res.data[0].code |
| | | console.log("state.dataList", state.dataList) |
| | | }else { |
| | | state.dataList=[] |
| | | } |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }else if(title.value == 'raw' || title.value =='rawRecord'){ |
| | | let param = {} |
| | | if(title.value == 'raw'){ |
| | | param = { |
| | | hazmatId: state.form.id |
| | | } |
| | | }else { |
| | | param = { |
| | | hazmatId: state.form.hazmatId |
| | | } |
| | | } |
| | | const res = await getAllRawFlow(param) |
| | | if(res.code == 200){ |
| | | if(res.data && res.data.length>0){ |
| | | state.dataList = res.data.map(item => { |
| | | return { |
| | | ...item, |
| | | unit:item.hazmatBasic.unit, |
| | | description: `${item.updateTime} ${item.user.departName}部门 ${item.user.name} 进行了 ${item.state ==0?'批量导入': item.state ==1?'取用' :item.state ==2?'归还':item.state ==3?'标签作废' :''}`, |
| | | size: 'large', |
| | | type: 'primary', |
| | | icon: MoreFilled, |
| | | } |
| | | }) |
| | | state.form.name = res.data[0].hazmatBasic.name |
| | | state.form.productSn = res.data[0].hazmatBasic.productSn |
| | | state.form.code = res.data[0].code |
| | | console.log("state.dataList",state.dataList) |
| | | }else { |
| | | state.dataList = [] |
| | | } |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }else if(title.value == 'code'){ |
| | | const param = { |
| | | code: state.form.code |
| | | } |
| | | const res = await getFlowByCode(param) |
| | | if(res.code == 200){ |
| | | if(res.data && res.data.length>0){ |
| | | if(res.data[0].hazmatBasic){ |
| | | state.dataList = res.data.map(item => { |
| | | return { |
| | | ...item, |
| | | unit:item.hazmatBasic.unit, |
| | | description: `${item.updateTime} ${item.user.departName}部门 ${item.user.name} 进行了 ${item.state ==0?'批量导入': item.state ==1?'取用' :item.state ==2?'归还':item.state ==3?'标签作废' :''}`, |
| | | size: 'large', |
| | | type: 'primary', |
| | | icon: MoreFilled, |
| | | } |
| | | }) |
| | | state.form.name = res.data[0].hazmatBasic.name |
| | | state.form.productSn = res.data[0].hazmatBasic.productSn |
| | | state.form.code = res.data[0].code |
| | | console.log("state.dataList",state.dataList) |
| | | }else { |
| | | state.dataList = res.data.map(item => { |
| | | return { |
| | | ...item, |
| | | unit:item.productBasic.unit, |
| | | description: `${item.updateTime} ${item.user.departName}部门 ${item.user.name} 进行了 ${item.state == 0 ? '批量导入' : item.state == 3 ? '标签作废' : '销售'}`, |
| | | size: 'large', |
| | | type: 'primary', |
| | | icon: MoreFilled, |
| | | } |
| | | }) |
| | | state.form.name = res.data[0].productBasic.name |
| | | state.form.productSn = res.data[0].productBasic.productSn |
| | | state.form.code = res.data[0].code |
| | | console.log("state.dataList",state.dataList) |
| | | } |
| | | |
| | | }else { |
| | | state.dataList = [] |
| | | } |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | } |
| | | } |
| | | onUnmounted(()=>{ |
| | | state.form = { |
| | | id: '', |
| | | name: '', |
| | | productSn: '', |
| | | code: '' |
| | | } |
| | | state.dataList = [] |
| | | }) |
| | | |
| | | defineExpose({ |
| | | openDialog |
| | | }); |
| | | |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .notice{ |
| | | padding: 20px; |
| | | display: flex; |
| | | flex-direction: column; |
| | | .title{ |
| | | display: flex; |
| | | align-items: center; |
| | | font-size: 18px; |
| | | font-weight: 600; |
| | | } |
| | | .content{ |
| | | margin-top: 40px; |
| | | |
| | | :deep(.el-timeline) { |
| | | font-size: 16px; |
| | | } |
| | | :deep(.el-timeline-item__node--large) { |
| | | left: -8px; |
| | | width: 25px; |
| | | height: 25px; |
| | | top: -5px; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <!-- 表格数据 --> |
| | | <el-table v-loading="loading" :data="dataList" :border="true"> |
| | | <el-table-column label="序号" type="index" align="center" width="80" /> |
| | | <el-table-column label="流转时间" prop="updateTime" align="center" /> |
| | | <el-table-column label="流转时间" prop="updateTime" align="center" width="120"/> |
| | | <el-table-column label="品名" prop="productBasic.name" align="center" /> |
| | | <el-table-column label="产品编号" prop="productBasic.productSn" align="center" /> |
| | | <el-table-column label="二维码识别号" prop="productBasic.code" align="center" /> |
| | | <el-table-column label="二维码识别号" prop="code" align="center" /> |
| | | <el-table-column label="类型" prop="productBasic.productSn" align="center" > |
| | | <template #default="scope"> |
| | | <span>{{scope.row.state === 0 ? '入库' :scope.row.state === 3 ? '标签作废' :scope.row.state === 4 ? '销售' : ''}}</span> |
| | | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="数量" prop="batchNo" align="center" width="120" /> |
| | | <el-table-column label="操作人" prop="batchNo" align="center" width="120" /> |
| | | <el-table-column label="数量" prop="num" align="center" width="120" > |
| | | <template #default="scope"> |
| | | <span>{{scope.row.num}}{{scope.row.productBasic.unit}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作人" prop="user.name" align="center" width="120" /> |
| | | <el-table-column label="人员所在部门" prop="user.departName" align="center" width="120" /> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200" > |
| | | <template #default="scope"> |
| | | <el-button link type="primary" >查看完整记录</el-button> |
| | | <el-button link type="primary" @click="viewFlow(scope.row)">查看完整记录</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | @pagination="getList" |
| | | /> |
| | | |
| | | <el-dialog |
| | | v-model="dialogVisible" |
| | | width="600px" |
| | | :before-close="handleClose" |
| | | :close-on-press-escape="false" |
| | | :close-on-click-modal="false" |
| | | > |
| | | <flow-deail ref="flowRef"></flow-deail> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {getCurrentInstance, onMounted, onUnmounted, reactive, ref, toRefs} from "vue"; |
| | | import {getCurrentInstance, nextTick, onMounted, onUnmounted, reactive, ref, toRefs} from "vue"; |
| | | import {ElMessage, ElMessageBox} from "element-plus"; |
| | | import flowDeail from '../../../components/flowDetail.vue' |
| | | import {delWarehouse, getWarehouse} from "@/api/hazardousChemicals/warehouse"; |
| | | import { |
| | | delProductRecord, |
| | |
| | | const loading = ref(false); |
| | | const dialogRef = ref(); |
| | | const codeRef = ref(); |
| | | const flowRef = ref(); |
| | | const dialogVisible = ref() |
| | | const data = reactive({ |
| | | queryParams: { |
| | | pageNum: 1, |
| | |
| | | codeRef.value.openDialog('pro',val); |
| | | |
| | | } |
| | | |
| | | const handleClose = () => { |
| | | dialogVisible.value = false |
| | | } |
| | | const viewFlow = (val) => { |
| | | dialogVisible.value = true |
| | | nextTick(() => { |
| | | flowRef.value.openDialog('proRecord',val) |
| | | }) |
| | | |
| | | } |
| | | defineExpose({ |
| | | getList |
| | | }); |
对比新文件 |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div style="display: flex;justify-content: space-between"> |
| | | <el-form :inline="true" style="display: flex;align-items: center;flex-wrap: wrap;" > |
| | | <el-form-item label="品名:" > |
| | | <el-input v-model="data.queryParams.name" placeholder="请输入品名" clearable></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="产品编号:" > |
| | | <el-input v-model="data.queryParams.productSn" placeholder="请输入产品编号" clearable></el-input> |
| | | </el-form-item> |
| | | <el-form-item > |
| | | <el-button |
| | | type="primary" |
| | | @click="getList" |
| | | >查询</el-button> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | @click="reset" |
| | | >重置</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <!-- 表格数据 --> |
| | | <el-table v-loading="loading" :data="dataList" :border="true"> |
| | | <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" /> |
| | | <el-table-column label="产品编号" prop="hazmatBasic.productSn" align="center" /> |
| | | <el-table-column label="二维码识别号" prop="code" align="center" /> |
| | | <el-table-column label="类型" prop="hazmatBasic.productSn" align="center" > |
| | | <template #default="scope"> |
| | | <span>{{scope.row.state === 0 ? '入库' :scope.row.state === 1 ? '取用' :scope.row.state === 2 ? '归还' : scope.row.state === 3? '标签作废':''}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="数量" prop="num" align="center" width="120" > |
| | | <template #default="scope"> |
| | | <span>{{scope.row.num}}{{scope.row.hazmatBasic.unit}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作人" prop="user.name" align="center" width="120" /> |
| | | <el-table-column label="人员所在部门" prop="user.departName" align="center" width="120" /> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200" > |
| | | <template #default="scope"> |
| | | <el-button link type="primary" @click="viewFlow(scope.row)" >查看完整记录</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total > 0" |
| | | :total="total" |
| | | v-model:page="queryParams.pageNum" |
| | | v-model:limit="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | <el-dialog |
| | | v-model="dialogVisible" |
| | | width="600px" |
| | | :before-close="handleClose" |
| | | :close-on-press-escape="false" |
| | | :close-on-click-modal="false" |
| | | > |
| | | <flow-deail ref="flowRef"></flow-deail> |
| | | </el-dialog> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {getCurrentInstance, nextTick, onMounted, onUnmounted, reactive, ref, toRefs} from "vue"; |
| | | import {ElMessage, ElMessageBox} from "element-plus"; |
| | | import flowDeail from '../../../components/flowDetail.vue' |
| | | const router = useRouter() |
| | | const route = useRoute() |
| | | import { |
| | | delRawRecord, |
| | | doEntryRaw, |
| | | getRawFlow, |
| | | getRawRecord, |
| | | getRawWarehouseRecord |
| | | } from "@/api/hazardousChemicals/rawRecord"; |
| | | import {useRoute, useRouter} from "vue-router"; |
| | | const { proxy } = getCurrentInstance(); |
| | | const loading = ref(false); |
| | | const dialogRef = ref(); |
| | | const dialogVisible = ref() |
| | | const flowRef = ref(); |
| | | const codeRef = ref(); |
| | | const data = reactive({ |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | name: '', |
| | | productSn: '' |
| | | }, |
| | | total: 0, |
| | | dataList: [] |
| | | }); |
| | | |
| | | const { queryParams, total, dataList } = toRefs(data); |
| | | const classHourRef = ref(); |
| | | onMounted(()=>{ |
| | | if(route.query.val){ |
| | | const val = JSON.parse(route.query.val) |
| | | if(val){ |
| | | data.queryParams.pageNum = val.pageNum; |
| | | data.queryParams.pageSize = val.pageSize; |
| | | } |
| | | } |
| | | getList() |
| | | }) |
| | | |
| | | const getList = async () => { |
| | | loading.value = true |
| | | const res = await getRawFlow(data.queryParams) |
| | | if(res.code == 200){ |
| | | data.dataList = res.data.list |
| | | data.total = res.data.total |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | loading.value = false |
| | | } |
| | | |
| | | const openDialog = (type, value) => { |
| | | dialogRef.value.openDialog(type, value); |
| | | } |
| | | |
| | | /** 重置新增的表单以及其他数据 */ |
| | | function reset() { |
| | | data.queryParams = { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | name: '', |
| | | productSn: '' |
| | | } |
| | | getList() |
| | | } |
| | | const handleDelete = (val) => { |
| | | ElMessageBox.confirm( |
| | | '确定删除此条数据?', |
| | | '提示', |
| | | { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then( async() => { |
| | | const res = await delRawRecord(val.id) |
| | | if(res.code == 200){ |
| | | ElMessage.success('数据删除成功') |
| | | await getList() |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const toDetail = (val) => { |
| | | const obj = { |
| | | pageNum: data.queryParams.pageNum, |
| | | pageSize: data.queryParams.pageSize, |
| | | basicId: val.basicId, |
| | | warehouseId: val.warehouseId |
| | | } |
| | | const v = JSON.stringify(obj) |
| | | router.push({ path: "/rawDetail", query: { val: v } }); |
| | | } |
| | | |
| | | const handleClose = () => { |
| | | dialogVisible.value = false |
| | | } |
| | | const viewFlow = (val) => { |
| | | dialogVisible.value = true |
| | | nextTick(() => { |
| | | flowRef.value.openDialog('rawRecord',val) |
| | | }) |
| | | |
| | | } |
| | | const getProRecord = (val) => { |
| | | dialogRef.value.openDialog(val) |
| | | } |
| | | |
| | | defineExpose({ |
| | | getList |
| | | }); |
| | | |
| | | </script> |
| | |
| | | <pro-table ref="proRef"></pro-table> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="原材料" name="rawMaterial"> |
| | | <!-- <raw-table ref="rawRef"></raw-table>--> |
| | | <raw-table ref="rawRef"></raw-table> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | |
| | | <script setup> |
| | | import {onMounted, reactive, ref} from "vue"; |
| | | import proTable from './components/productTable.vue' |
| | | // import rawTable from './components/rawTable.vue' |
| | | import rawTable from './components/rawTable.vue' |
| | | const showFinishPro = ref(false) |
| | | const proRef = ref() |
| | | const rawRef = ref() |
| | |
| | | <el-table-column label="所在仓库" prop="warehouseName" align="center" /> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180" > |
| | | <template #default="scope"> |
| | | <el-button link type="primary" >取用记录</el-button> |
| | | <el-button link type="primary" @click="viewFlow(scope.row)">取用记录</el-button> |
| | | <el-button link type="danger" v-if="scope.row.state === 0" @click="disCard(scope.row)">标签作废</el-button> |
| | | <el-button link type="primary" @click="viewQR(scope.row)">查看二维码</el-button> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | @pagination="getList" |
| | | /> |
| | | <viewQRcode ref="dialogRef" @getList="getList"></viewQRcode> |
| | | <el-dialog |
| | | v-model="dialogVisible" |
| | | width="600px" |
| | | :before-close="handleClose" |
| | | :close-on-press-escape="false" |
| | | :close-on-click-modal="false" |
| | | > |
| | | <flow-deail ref="flowRef"></flow-deail> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {onMounted, reactive, ref} from "vue"; |
| | | import {nextTick, onMounted, reactive, ref} from "vue"; |
| | | import {useRoute, useRouter} from "vue-router"; |
| | | import {getProDetail, getProductRecord} from "@/api/hazardousChemicals/productRecord"; |
| | | import flowDeail from '../../../components/flowDetail.vue' |
| | | import {disCardPro, doEntryPro, getProDetail, getProductRecord} from "@/api/hazardousChemicals/productRecord"; |
| | | import viewQRcode from './viewQR.vue' |
| | | import {ElMessage} from "element-plus"; |
| | | import {ElMessage, ElMessageBox} from "element-plus"; |
| | | import Cookies from "js-cookie"; |
| | | const route = useRoute() |
| | | const router = useRouter(); |
| | | const dialogRef = ref(); |
| | | const flowRef = ref(); |
| | | |
| | | const dialogVisible = ref(false) |
| | | const data = reactive({ |
| | | queryParams: { |
| | | basicId: null, |
| | |
| | | const viewQR = (val) => { |
| | | dialogRef.value.openDialog('pro',val) |
| | | } |
| | | const disCard = async (val) => { |
| | | ElMessageBox.confirm( |
| | | '确定作废该标签?', |
| | | '提示', |
| | | { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then( async() => { |
| | | const res = await disCardPro(val.id) |
| | | if(res.code == 200){ |
| | | ElMessage.success('操作成功') |
| | | await getList() |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }) |
| | | |
| | | |
| | | } |
| | | const handleClose = () => { |
| | | dialogVisible.value = false |
| | | } |
| | | const viewFlow = (val) => { |
| | | dialogVisible.value = true |
| | | nextTick(() => { |
| | | |
| | | flowRef.value.openDialog('pro',val) |
| | | }) |
| | | |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="批号" prop="batchNo" align="center" width="120" /> |
| | | <el-table-column label="当前库存" prop="stock" align="center" width="120" /> |
| | | <el-table-column label="所在仓库" prop="warehouseName" align="center" > |
| | | <template #default="scope"> |
| | | <span>{{scope.row.warehouse.name}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="状态" prop="state" align="center"> |
| | | <template #default="scope"> |
| | |
| | | import { |
| | | delProductRecord, |
| | | doEntryPro, |
| | | getProductRecord, |
| | | getProductRecord, getProList, |
| | | getProWarehouseRecord |
| | | } from "@/api/hazardousChemicals/productRecord"; |
| | | import {delRawRecord} from "@/api/hazardousChemicals/rawRecord"; |
| | |
| | | |
| | | const getList = async () => { |
| | | loading.value = true |
| | | const res = await getProductRecord(data.queryParams) |
| | | const res = await getProList(data.queryParams) |
| | | if(res.code == 200){ |
| | | data.dataList = res.data.list |
| | | data.total = res.data.total |
| | |
| | | <el-table-column label="所在仓库" prop="warehouseName" align="center" /> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180" > |
| | | <template #default="scope"> |
| | | <el-button link type="primary" >取用记录</el-button> |
| | | <el-button link type="primary" @click="viewFlow(scope.row)">取用记录</el-button> |
| | | <el-button link type="danger" v-if="scope.row.state === 0 || scope.row.state === 1|| scope.row.state === 2" @click="disCard(scope.row)">标签作废</el-button> |
| | | <el-button link type="primary" @click="viewQR(scope.row)">查看二维码</el-button> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | @pagination="getList" |
| | | /> |
| | | <viewQRcode ref="dialogRef" @getList="getList"></viewQRcode> |
| | | <el-dialog |
| | | v-model="dialogVisible" |
| | | width="600px" |
| | | :before-close="handleClose" |
| | | :close-on-press-escape="false" |
| | | :close-on-click-modal="false" |
| | | > |
| | | <flow-deail ref="flowRef"></flow-deail> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {onMounted, reactive, ref} from "vue"; |
| | | import {nextTick, onMounted, reactive, ref} from "vue"; |
| | | import {useRoute, useRouter} from "vue-router"; |
| | | import {getProDetail, getProductRecord} from "@/api/hazardousChemicals/productRecord"; |
| | | import flowDeail from '../../../components/flowDetail.vue' |
| | | import {disCardPro, getProDetail, getProductRecord} from "@/api/hazardousChemicals/productRecord"; |
| | | import viewQRcode from './viewQR.vue' |
| | | import {ElMessage} from "element-plus"; |
| | | import {getRawDetail} from "@/api/hazardousChemicals/rawRecord"; |
| | | import {ElMessage, ElMessageBox} from "element-plus"; |
| | | import {disCardRaw, getRawDetail} from "@/api/hazardousChemicals/rawRecord"; |
| | | import Cookies from "js-cookie"; |
| | | const route = useRoute() |
| | | const router = useRouter(); |
| | | const dialogRef = ref(); |
| | | const dialogVisible = ref(false) |
| | | const flowRef = ref(); |
| | | const data = reactive({ |
| | | queryParams: { |
| | | basicId: null, |
| | |
| | | const viewQR = (val) => { |
| | | dialogRef.value.openDialog('raw',val) |
| | | } |
| | | const disCard = async (val) => { |
| | | ElMessageBox.confirm( |
| | | '确定作废该标签?', |
| | | '提示', |
| | | { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then( async() => { |
| | | const res = await disCardRaw(val.id) |
| | | if(res.code == 200){ |
| | | ElMessage.success('操作成功') |
| | | await getList() |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }) |
| | | |
| | | |
| | | } |
| | | const viewFlow = (val) => { |
| | | dialogVisible.value = true |
| | | nextTick(() => { |
| | | flowRef.value.openDialog('raw',val) |
| | | }) |
| | | } |
| | | const handleClose = () => { |
| | | dialogVisible.value = false |
| | | } |
| | | |
| | | </script> |
| | | |
| | |
| | | </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="hazmatBasic.name" align="center" /> |
| | | <el-table-column label="产品编号" prop="hazmatBasic.productSn" align="center" /> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="批号" prop="batchNo" align="center" width="120" /> |
| | | <el-table-column label="当前库存" prop="stock" align="center" width="120" /> |
| | | <el-table-column label="不完整归还" prop="missStock" align="center" width="120" /> |
| | | <el-table-column label="安全库存" prop="hazmatBasic.safeNum" align="center" width="120" /> |
| | | <el-table-column label="所在仓库" prop="warehouseName" align="center" > |
| | | <template #default="scope"> |
| | | <span>{{scope.row.warehouse.name}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="状态" prop="state" align="center"> |
| | | <template #default="scope"> |
| | |
| | | const router = useRouter() |
| | | const route = useRoute() |
| | | import rawWarehouseDialog from './rawWarehouseRecord.vue' |
| | | import {delRawRecord, doEntryRaw, getRawRecord, getRawWarehouseRecord} from "@/api/hazardousChemicals/rawRecord"; |
| | | import { |
| | | delRawRecord, |
| | | doEntryRaw, |
| | | getRawList, |
| | | getRawRecord, |
| | | getRawWarehouseRecord |
| | | } from "@/api/hazardousChemicals/rawRecord"; |
| | | import {useRoute, useRouter} from "vue-router"; |
| | | const { proxy } = getCurrentInstance(); |
| | | const loading = ref(false); |
| | |
| | | dataList: [] |
| | | }); |
| | | |
| | | const selectValue = ref([]) |
| | | const { queryParams, total, dataList } = toRefs(data); |
| | | const classHourRef = ref(); |
| | | onMounted(()=>{ |
| | |
| | | |
| | | const getList = async () => { |
| | | loading.value = true |
| | | const res = await getRawRecord(data.queryParams) |
| | | const res = await getRawList(data.queryParams) |
| | | if(res.code == 200){ |
| | | data.dataList = res.data.list |
| | | data.dataList.forEach(item => { |
| | | if(item.stock+item.missStock < item.hazmatBasic.safeNum){ |
| | | selectValue.value.push(item) |
| | | } |
| | | }) |
| | | data.total = res.data.total |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | |
| | | dialogRef.value.openDialog(val) |
| | | } |
| | | |
| | | const cellStyle = ({ row, column,rowIndex, columnIndex }) => { |
| | | let arr = [] |
| | | if (selectValue.value !== null) { |
| | | selectValue.value.filter((item, index) => { |
| | | arr.push(item.basicId) |
| | | }) |
| | | } |
| | | for (var i = 0; i <= arr.length; i++) { |
| | | if (arr[i] == row.basicId) { |
| | | if (columnIndex === 9 || columnIndex === 10 || columnIndex === 11){ |
| | | return { backgroundColor: '#FFD7CC !important',color:' red' } |
| | | } |
| | | |
| | | } |
| | | } |
| | | }; |
| | | |
| | | defineExpose({ |
| | | getList |
| | | }); |
| | |
| | | |
| | | </template> |
| | | <script setup> |
| | | import {onMounted, reactive, ref} from "vue"; |
| | | import {onMounted, onUnmounted, reactive, ref} from "vue"; |
| | | import proTable from './components/productTable.vue' |
| | | import rawTable from './components/rawTable.vue' |
| | | import Cookies from "js-cookie"; |
| | |
| | | }else{ |
| | | data.activeName = showFinishPro.value ? 'finishPro' : 'rawMaterial' |
| | | } |
| | | |
| | | }) |
| | | onUnmounted(()=>{ |
| | | Cookies.remove('type') |
| | | }) |
| | | const clickTab = (tab,event) =>{ |
| | | console.log('tab',data.activeName) |
| | |
| | | </el-form-item> |
| | | <el-form-item label="所属企业:" prop="companyName" v-if="state.title !== '修改密码' && state.form.userType !=0"> |
| | | <el-select |
| | | v-if="state.isAdmin && state.title != '编辑用户'" |
| | | v-if="state.isAdmin" |
| | | clearable |
| | | v-model="state.form.companyName" |
| | | filterable |
| | |
| | | </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.currentUserType == 1 && state.title != '查看用户') || (state.currentUserType == 0 && state.form.userType == 2 && state.title == '编辑用户') "> |
| | | <el-form-item label="所属部门:" prop="departId" v-if="state.form.userType !=0" > |
| | | <el-cascader |
| | | v-if="state.currentUserType == 1 && (state.title == '新增用户' || state.title == '编辑用户')" |
| | | v-if="(state.currentUserType == 1 ||state.currentUserType == 0) && (state.title == '新增用户' || state.title == '编辑用户')" |
| | | style="width: 100%" |
| | | ref="classifyRef" |
| | | v-model="state.form.departId" |
| | |
| | | phone: [{ required: true, validator: validateUserPhone, trigger: 'blur' }], |
| | | userType: [{ required: true, message: '请选择用户类型', trigger: 'blur' }], |
| | | sex: [{ required: true, message: '请选择性别', trigger: 'blur' }], |
| | | departId:[{ required: true, message: '请选择部门', trigger: 'blur' }], |
| | | // departId:[{ required: true, message: '请选择部门', trigger: 'blur' }], |
| | | }, |
| | | companyList: [], |
| | | deptList: [], |
| | |
| | | userInfo.value = JSON.parse(Cookies.get('userInfo')) |
| | | console.log("userInfo",userInfo.value) |
| | | state.currentUserType = userInfo.value.userType |
| | | if(state.currentUserType == 1){ |
| | | await getDeptList() |
| | | } |
| | | if(userInfo.value.userType === 0){ |
| | | state.isAdmin = true; |
| | | }else { |
| | |
| | | state.form.companyId = userInfo.value.companyId; |
| | | state.form.companyName = userInfo.value.companyName; |
| | | state.form.userType = 2 |
| | | } |
| | | if(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') { |
| | |
| | | const loadingDept = ref(false) |
| | | const getDeptList = async (val)=>{ |
| | | loadingDept.value = true; |
| | | const res = await getDept() |
| | | const param = { |
| | | companyId: state.form.companyId |
| | | } |
| | | const res = await getDept(param) |
| | | if (res.code == 200) { |
| | | loading.value = false; |
| | | state.deptList = recursion(res.data) |
| | |
| | | } |
| | | |
| | | const selectValue = (val) => { |
| | | state.form.departId = null |
| | | state.companyList.forEach(item => { |
| | | if(item.name === val){ |
| | | state.form.companyId = item.id |
| | | getDeptList(); |
| | | } |
| | | }) |
| | | } |
| | |
| | | <template> |
| | | <div> |
| | | <div class="query"> |
| | | <div style="margin-top:20px;margin-left: 20px"> |
| | | <el-form :inline="true" style="display: flex;align-items: center;flex-wrap: wrap;" > |
| | | <el-form-item label="二维码编号:" > |
| | | <el-input v-model="data.form.code" placeholder="请输入二维码编号进行搜索" clearable></el-input> |
| | | <el-input v-model="data.form.code" placeholder="请输入二维码编号进行搜索"></el-input> |
| | | </el-form-item> |
| | | <el-form-item > |
| | | <el-button |
| | | type="primary" |
| | | @click="getList" |
| | | >查询</el-button> |
| | | <el-button |
| | | @click="reset" |
| | | >重置</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div v-if="data.form.code !=''"> |
| | | |
| | | </div> |
| | | </el-form> |
| | | <div style="display: flex;justify-content: center"> |
| | | <div class="content"> |
| | | <flow-deail ref="flowRef" v-if="data.showData"></flow-deail> |
| | | <el-empty description="暂无数据" style="margin-top: 10%" v-else></el-empty> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | </template> |
| | | <script setup> |
| | | import {reactive} from "vue"; |
| | | import {nextTick, reactive, ref} from "vue"; |
| | | import flowDeail from '../../components/flowDetail.vue' |
| | | import {getFlowByCode, getProFlow} from "@/api/hazardousChemicals/productRecord"; |
| | | import {ElMessage} from "element-plus"; |
| | | |
| | | const flowRef = ref(); |
| | | const data = reactive({ |
| | | queryParams: { |
| | | name: '', |
| | |
| | | form: { |
| | | code: '' |
| | | }, |
| | | dataList: [] |
| | | dataList: [], |
| | | showData:false |
| | | }); |
| | | const getList = () => { |
| | | const getList = async () => { |
| | | if(data.form.code!=''){ |
| | | data.showData = true |
| | | await nextTick(() => { |
| | | flowRef.value.openDialog('code',data.form.code) |
| | | }) |
| | | }else { |
| | | ElMessage.warning('请先输入二维码编号') |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | const reset = () =>{ |
| | | data.form.code = '' |
| | | data.showData = false |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | |
| | | .query{ |
| | | .content{ |
| | | margin-top: 40px; |
| | | width: 650px; |
| | | height: 650px; |
| | | border: 1px solid black; |
| | | overflow-y: scroll; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | import {addWarehouse, checkName, editWarehouse} from "@/api/hazardousChemicals/warehouse"; |
| | | import {verifyPhone} from "@/utils/validate"; |
| | | import {checkBasicName} from "@/api/hazardousChemicals/basicInfo"; |
| | | import {getProDetail, getProductRecord} from "@/api/hazardousChemicals/productRecord"; |
| | | import {getRawDetail} from "@/api/hazardousChemicals/rawRecord"; |
| | | |
| | | const dialogVisible = ref(false); |
| | | const title = ref(""); |
| | |
| | | total: 0, |
| | | queryParams:{ |
| | | pageNum: 1, |
| | | pageSize: 5 |
| | | pageSize: 5, |
| | | warehouseId: null, |
| | | basicId: null, |
| | | }, |
| | | chooseList: [] |
| | | |
| | |
| | | |
| | | const originalList = ref([]) |
| | | const openDialog = async (type,value) => { |
| | | state.queryParams.warehouseId =value.warehouseId |
| | | state.queryParams.basicId =value.basicId |
| | | title.value = type; |
| | | if(type == 'pro'){ |
| | | for(let i=value.startCode ; i<=value.endCode;i++){ |
| | | const obj = { |
| | | name: value.productBasic.name, |
| | | productSn: value.productBasic.productSn, |
| | | code: value.codePrex+(i+"").padStart(4,'0') |
| | | } |
| | | state.dataList.push(obj) |
| | | } |
| | | }else { |
| | | await getList() |
| | | |
| | | for(let i=value.startCode ; i<=value.endCode;i++){ |
| | | const obj = { |
| | | name: value.hazmatBasic.name, |
| | | productSn: value.hazmatBasic.productSn, |
| | | code: value.codePrex+(i+"").padStart(4,'0') |
| | | } |
| | | state.dataList.push(obj) |
| | | } |
| | | } |
| | | state.total = state.dataList.length |
| | | originalList.value = state.dataList |
| | | getList() |
| | | console.log('state.dataList',state.dataList) |
| | | dialogVisible.value = true; |
| | | } |
| | |
| | | state.dataList = []; |
| | | state.queryParams = { |
| | | pageNum: 1, |
| | | pageSize: 5 |
| | | pageSize: 5, |
| | | warehouseId: null, |
| | | basicId: null, |
| | | } |
| | | state.total = 0 |
| | | state.chooseList = [] |
| | | } |
| | | const getList = () => { |
| | | state.dataList = originalList.value.slice((state.queryParams.pageNum-1) * state.queryParams.pageSize, state.queryParams.pageNum * state.queryParams.pageSize) |
| | | const getList = async () => { |
| | | if(title.value == 'pro'){ |
| | | const res = await getProDetail(state.queryParams) |
| | | if(res.code == 200){ |
| | | state.dataList = res.data.list.map(item => { |
| | | return{ |
| | | ...item, |
| | | name: item.productBasic.name, |
| | | productSn: item.productBasic.productSn |
| | | } |
| | | }) |
| | | state.total = res.data.total |
| | | originalList.value = state.dataList |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }else { |
| | | const res = await getRawDetail(state.queryParams) |
| | | if(res.code == 200){ |
| | | state.dataList = res.data.list.map(item => { |
| | | return{ |
| | | ...item, |
| | | name: item.hazmatBasic.name, |
| | | productSn: item.hazmatBasic.productSn |
| | | } |
| | | }) |
| | | state.total = res.data.total |
| | | originalList.value = state.dataList |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | const printEvent=() => { |